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
| ;Hello world in x86 assembly syntax (for nasm) | |
| ;to compile and run: | |
| ;$ yasm -f elf hello.asm 2>&1 | |
| ;$ ld -m elf_i386 -s -o hello *.o 2>&1 | |
| section .text | |
| global _start ;declared for linker | |
| _start: ;linker entry point | |
| mov edx,len ;message len | |
| mov ecx,msg ;message to write |
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
| // minimal example of a golang gorrilla websocket client | |
| package main | |
| import "github.com/gorilla/websocket" | |
| import "net/http" | |
| import "log" | |
| import "os" | |
| func main() { |
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
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| """ | |
| client.py | |
| Based heavily on: | |
| - https://github.com/mtah/python-websocket/blob/master/examples/echo.py | |
| - http://stackoverflow.com/a/7586302/316044 | |
| Created by Drew Harry on 2011-11-28. |
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 sys | |
| if __name__ == "__main__": | |
| args = sys.argv[1:] | |
| print(', '.join(args[0:3])) |
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
| package main | |
| import "os" | |
| import "log" | |
| import "io/ioutil" | |
| import "github.com/szferi/gomdb" | |
| func Set_Key(key, value string) int { | |
| path, err := ioutil.TempDir("/tmp", "mdb_test") | |
| if err != nil { |
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
| def define_fan(fan): | |
| pool = Pool(4) | |
| try: | |
| book = {} | |
| def name(fan): | |
| book['name'] = fan.item.get_name() | |
| def get_age(fan): | |
| book['age'] = fan.item.get_age() |
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
| # A Python Netwide Assembley Utility | |
| # makes 32bit assembly compatible with 64bit Os | |
| # tweaks basic 32bit assembly (not all) to native 64bit assembly | |
| # | |
| # License GPLv3 | |
| # code author: James Rubino | |
| from subprocess import check_call | |
| import sys |
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 urllib2 | |
| # todo | |
| # stablize work flow | |
| # slqlitedb integration | |
| # salary estimation | |
| # language market share | |
| # local search | |
| # reporting |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from __future__ import with_statement | |
| import collections, operator, math, random, pprint | |
| class Classifier(object): | |
| AttrsToDump = ["value_counts", "class_counts", "features", "feature_counts"] | |
| def __init__(self, features={}, verbose=False): |
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 OnlineLearner(object): | |
| def __init__(self, **kwargs): | |
| self.last_misses = 0. | |
| self.iratio = 0. | |
| self.it = 1. | |
| self.l = kwargs["l"] | |
| self.max_ratio = -np.inf | |
| self.threshold = 500. | |
| def hinge_loss(self, vector, cls, weight): |