Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from matplotlib import pyplot as plt | |
import openmdao.api as om | |
def rotations(theta): | |
# define rotation matrices per http://web.mit.edu/course/3/3.11/www/modules/laminates.pdf | |
s = np.sin(theta) | |
c = np.cos(theta) | |
# stress in fiber axis = A * stress in xy axis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with | |
dau as ( | |
-- This part of the query can be pretty much anything. | |
-- The only requirement is that it have three columns: | |
-- dt, user_id, inc_amt | |
-- Where dt is a date and user_id is some unique identifier for a user. | |
-- Each dt-user_id pair should be unique in this table. | |
-- inc_amt represents the amount of value that this user created on dt. | |
-- The most common case is | |
-- inc_amt = incremental revenue from the user on dt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert an animated video to gif | |
# Works best for videos with low color palettes like Dribbble shots | |
# | |
# @param $1 - video file name like `animation.mov` | |
# @param @optional $2 - resize parameter as widthxheight like `400x300` | |
# | |
# Example: vidtogif animation.mov 400x300 | |
# Requirements: ffmpeg and gifsicle. Can be downloaded via homebrew | |
# | |
# http://chrismessina.me/b/13913393/mov-to-gif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The MIT License (MIT) | |
Copyright (c) 2014 Tomas Kafka | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You can do that in your Chrome Console | |
// Load the initial object, like an Attempt | |
var attempt = new Parse.Object("Attempt"); | |
attempt.id = "myId"; | |
attempt.fetch(); | |
// Get the relation "handler" from the attempt object | |
var relation = attempt.relation("products"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "compass/css3/shared"; | |
// September 2012 Candidate Recommendation (http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/) | |
// Chrome 21 (prefixed) | |
// Opera 12.1 (unprefixed) | |
// Firefox 20 (unprefixed) | |
$flex-moz: false !default; | |
$flex-webkit: true !default; | |
$flex-o: false !default; | |
$flex-ms: false !default; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Clean expired quotes (cron process) | |
* | |
* @param Mage_Cron_Model_Schedule $schedule | |
* @return Mage_Sales_Model_Observer | |
*/ | |
public function cleanExpiredQuotes($schedule) | |
{ | |
Mage::dispatchEvent('clear_expired_quotes_before', array('sales_observer' => $this)); | |