# Matplotlib depends on a few libraries that seem to be missing. Run the following commands to get them.
sudo apt-get install libsm6
sudo apt-get install libxrender1
# Zappa depends on these.
sudo apt-get install libffi-dev
sudo apt-get install libssl-dev
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
figsize(10,5) | |
x = np.linspace(-10,10,10000) | |
y1 = x.astype(np.float32) | |
y2 = x.astype(np.float16) | |
# plt.semilogy(np.abs(x - x)) | |
plt.semilogy(np.abs(x - y1)) | |
plt.semilogy(np.abs(x - y2)) | |
plt.legend(['32','16']) | |
label('Original value','Error','Error when reducing precision of 64-bit floats') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Set grub timeout to 0, so you don't see the grub screen at boot time. http://askubuntu.com/questions/327311/how-to-auto-boot-to-ubuntu-instead-of-showing-text-mode-grub-menu-on-power-failu
Fix sublime ctrl-tab behavior: http://stackoverflow.com/questions/25569381/how-to-configure-sublime-text-2-3-to-use-direct-ctrltab-order-and-to-create-new
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 Html.App as Html | |
import Html exposing ( Html, div, text ) | |
import Html.Attributes exposing ( .. ) | |
import Html.Events exposing ( onClick ) | |
import Window | |
import Task | |
main = Html.program | |
{ init = ( ( initSize, initSize ), triggerGetSize ) |
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 | |
import time | |
from IPython.display import clear_output | |
sentences = [ | |
("I must eat.", "Je dois manger."), | |
("I want to eat.","Je veux manger."), | |
("I'm going to eat tomorrow.","Je vais manger demain."), | |
("I can't eat.","Je ne peux pas manger.") | |
] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 time | |
import numpy as np | |
def g(t): | |
ti = 0 | |
for _ in range(int(1e6)): | |
print ' '.join(np.random.randint(2, size = 80).astype(str)) | |
time.sleep(np.random.random() * 0.05) | |
ti += 0.01 | |
if ti > t: |
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 string to number | |
string = '12.1'; | |
number = parseFloat(string); | |
// Convert float to int | |
myInt = Math.floor(number); | |
// Convert list of strings to list of ints | |
strings = ['1.1','2.1','3.1']; | |
numbers = strings.map(parseFloat); |
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
{ | |
"version": "1.0.0", | |
"summary": "helpful summary of your project, less than 80 characters", | |
"repository": "https://github.com/user/project.git", | |
"license": "BSD3", | |
"source-directories": [ | |
"." | |
], | |
"exposed-modules": [], | |
"dependencies": { |