docker run -i -t --name nodejs ubuntu:latest /bin/bash
So here, -i
stands for interactive mode and -t
will allocate a pseudo terminal for us.
Some more trivia about these flags.
#!/bin/bash | |
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport | |
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport |
docker run -i -t --name nodejs ubuntu:latest /bin/bash
So here, -i
stands for interactive mode and -t
will allocate a pseudo terminal for us.
Some more trivia about these flags.
Download, unzip and drag to your Applications directory.
https://www.iterm2.com/downloads.html
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback | |
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB; | |
// Open (or create) the database | |
var open = indexedDB.open("MyDatabase", 1); | |
// Create the schema | |
open.onupgradeneeded = function() { | |
var db = open.result; | |
var store = db.createObjectStore("MyObjectStore", {keyPath: "id"}); |
import shutil | |
import tempfile | |
from django.conf import settings | |
from django.core.files.storage import FileSystemStorage | |
from django.db.models import FileField | |
from django.apps.apps import get_model, get_models | |
from django.test.runner import DiscoverRunner | |
import h5py | |
f = h5py.File('path/to/file', 'r') | |
# List all groups | |
print('Keys: %s' % f.keys()) | |
# Get data | |
key = 'random_data' | |
random_data = np.asarray(f[key]) |
import pstats, cProfile | |
def recip_square(i): | |
return 1./i**2 | |
def approx_pi(n=10000000): | |
val = 0. | |
for k in range(1,n+1): | |
val += recip_square(k) | |
return (6 * val)**.5 |
import cython | |
cimport cython | |
import numpy as np | |
cimport numpy as np | |
cdef extern from "utils.h": | |
void print_array(double *, int) | |
def print_np_as_c(np.ndarray[double, ndim=2, mode="c"] arr not None): | |
cdef int n |
from keras.models import Model | |
from keras.applications.vgg16 import VGG16 | |
from keras.layers import GlobalAveragePooling2D | |
# Wait for downloading for the 1st time, | |
# the weights is saved in ~/.keras/models | |
vgg16 = VGG16(include_top=False, # don't include 3 fully connected layers | |
weights='imagenet', # use pre-trained weights, not random initialization | |
pooling=None) # don't apply any pooling at the last convolutional layer |