This file contains 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
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
require_once 'vendor/autoload.php'; | |
use Aws\S3\S3Client; | |
final class AWS_S3 | |
{ | |
private static $client = null; |
This file contains 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 cmd | |
import string, sys | |
from chardet.universaldetector import UniversalDetector | |
class CLI(cmd.Cmd): | |
def __init__(self): | |
cmd.Cmd.__init__(self) | |
self.prompt = '$' | |
self.path = '' | |
self.intro = '''Encoding Detection Usage Guide: |
This file contains 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
//For "# min" type | |
var searchCorpus = $('a.lecture-link').text(); | |
var matches = searchCorpus.match(/(\d).+min/gm); | |
var bigResult = []; | |
for (index in matches) {bigResult.push(matches[index].match(/([\d]+)/g)[0]);} | |
var sum = 0; | |
for (index in bigResult) {sum = sum + parseInt(bigResult[index]);} | |
/*============================================= | |
= User Guide |
This file contains 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 select | |
import socket | |
import sys | |
import objc | |
from PyObjCTools import AppHelper | |
objc.loadBundle("CoreBluetooth", globals(), | |
bundle_path=objc.pathForFramework(u'/System/Library/Frameworks/IOBluetooth.framework/Versions/A/Frameworks/CoreBluetooth.framework')) |
This file contains 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
# Monty Hall simulation | |
import numpy as np | |
winningdoor = -1 # ordinal numbers | |
firstChoice = -1 # both first pick and final pick | |
closedDoor = -1 | |
finalChoice = -1 | |
This file contains 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
# simulate coin toss | |
import numpy as np | |
X = np.zeros(3) # random variable X: X[0], X[1], X[2] | |
X_0_sets = set() | |
X_1_sets = set() | |
X_2_sets = set() | |
This file contains 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
# simulate coupon collector's problem | |
import numpy as np | |
def run(n): | |
""" | |
n: number of different coupons (stamps) | |
return: days it took to achieve such goal | |
""" |
This file contains 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
""" | |
An implementation of the `Local reparameterization trick` | |
from Kingma & Wellings and | |
Bayesian RNN | |
from Fortunato, Blundell & Vinyals | |
""" | |
import os | |
import time | |
import copy | |
from os.path import join as pjoin |
This file contains 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
# -*- coding: utf-8 -*- | |
import spacy | |
import logging | |
import string | |
import os | |
log_fmt = "%(asctime)s - %(name)s - %(levelname)s - %(message)s" | |
logging.basicConfig(level=logging.INFO, format=log_fmt) | |
logger = logging.getLogger(__name__) |
This file contains 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
Download Google Drive files with WGET | |
Example Google Drive download link: | |
https://docs.google.com/open?id=[ID] | |
To download the file with WGET you need to use this link: | |
https://googledrive.com/host/[ID] | |
Example WGET command: |
OlderNewer