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 numpy as np | |
def loadDataSet(): | |
postingList = [['my', 'dog', 'has', 'flea', 'problems', 'help', 'please'], | |
['maybe', 'not', 'take', 'him', 'to', 'dog', 'park', 'stupid'], | |
['my', 'dalmation', 'is', 'so', 'cute', 'I', 'love', 'him'], | |
['stop', 'posting', 'stupid', 'worthless', 'garbage'], | |
['mr', 'licks', 'ate', 'my', 'steak', 'how', 'to', 'stop', 'him'], | |
['quit', 'buying', 'worthless', 'dog', 'food', 'stupid']] |
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
function swap(array, index1, index2) { | |
var temp = array[index1]; | |
array[index1] = array[index2]; | |
array[index2] = temp; | |
} | |
function WTFSorting(arr){ | |
var res = []; | |
res.push(arr[0]); | |
console.log(res); |
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
// | |
// main.c | |
// sort | |
// | |
// Created by Markakod Development on 20/10/15. | |
// Copyright (c) 2015 Markakod Development. All rights reserved. | |
// | |
#include <stdio.h> |
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 -*- | |
# ________________________ | |
# | Recursion | | |
# |________________________| | |
# | |
# |---Illustrative Examples | |
# | | | |
# | |__factorial function | |
# | |
# |
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 sys | |
import os | |
import time | |
def get_terminal_size(fd=1): | |
try: | |
import fcntl, termios, struct | |
hw = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234')) | |
except: | |
try: |
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
from flask import Flask | |
from flask import request | |
from werkzeug import secure_filename | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return 'hello world' |
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
.... | |
checking for objdir... .libs | |
checking for the correct version of gmp.h... yes | |
checking for the correct version of mpfr.h... yes | |
checking for the correct version of mpc.h... yes | |
checking for the correct version of the gmp/mpfr/mpc libraries... yes | |
checking for compatible ISL... no | |
configure: error: Unable to find a usable ISL. See config.log for details. | |
READ THIS: https://git.io/brew-troubleshooting |
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
from bottle import route,run,request,static_file | |
import os | |
import json | |
import numpy as np | |
import cv2 | |
@route('/upload',method='POST') | |
def do_upload(): | |
category = request.forms.get('category') |
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 subprocess | |
def sb_proc(input, output): | |
subprocess.call(['avconv -r 20 -i ' + input + ' -b:v 1000k ' + output ,''],shell=True) | |
sb_proc('input/new_%d.jpg','output/tt1.mp4');#new_%d.jpg ==> new_0.jpg,new_1.jpg,.... |
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
<html> | |
<head></head> | |
<body> | |
<% var queue = [],l=null,r=null; %> | |
<% queue.push(btree) %> | |
<% while(queue.length > 0){ %> | |
<% var s = queue.shift() %> |
OlderNewer