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
# -*- coding: utf-8 -*- | |
import sys | |
import numpy as np | |
class Perceptron(object): | |
"""Perceptron classifier. | |
Parameters |
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
# -*- coding: utf-8 -*- | |
""" | |
SQLAlchemy example code. | |
Requirements: | |
* Python3 | |
* PostgreSQL | |
* SQLAlchemy |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
#!/bin/sh | |
### | |
### pydiet.sh -- remove unnecessary files from Python directory interactively | |
### | |
### Feature: | |
### * remove test script files (ex: python2.7/test/*) | |
### * remove *.pyo files (ex: python2.7/**/*.pyo) | |
### * remove *.opt-[12].pyc files (Python 3.5 or later) | |
### |
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
# -*- coding: utf-8 -*- | |
import sys | |
from benchmarker import Benchmarker | |
import main | |
from rchk.utils.simple_crypto import encrypt, decrypt | |
from rchk.utils import scrumble_uint32 |
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
#include <iostream> | |
#include <string> | |
void fn() { | |
int x; | |
std::string s; | |
std::cout << x; // warning: variable 'x' is uninitialized when used here | |
std::cout << s; // (no warnings due to default constructor) | |
std::cout << "\n"; | |
} |
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
#include <iostream> | |
int fn() { | |
int x; | |
return x; // returns uninitialized local variable | |
} | |
int main(int argc, char*args[]) { | |
//std::cout << "Hello\n"; | |
std::cout << fn() << "\n"; |
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
class IO | |
## | |
## Easy-to-use nonblocking read() | |
## | |
## * returns non-empty string when data exists | |
## * returns empty string when data not exist | |
## * returns nil when EOF | |
## | |
def read_nonblocking(size) |
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
/// coding: utf-8 | |
/// | |
/// for 15puzzle | |
/// | |
var Util = { | |
init: function() { |
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
/* coding: utf-8 */ | |
#main-content { | |
padding-top: 50px; | |
} | |
#puzzle { | |
border-collapse: collapse; | |
border: solid 1px #ccc; | |
font-size: x-large; |