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
*** Date: Sunday, September 28, 2014 at 3:21:13 PM Central European Summer Time | |
*** Platform Details: | |
*** System properties: | |
applicationXMI=org.eclipse.ui.workbench/LegacyIDE.e4xmi | |
awt.toolkit=sun.lwawt.macosx.LWCToolkit | |
derby.system.home=/Users/kaiyin/personal_config_bin_files/workspace/.metadata/.plugins/de.walware.ecommons.edb | |
eclipse.application=org.eclipse.ui.ide.workbench | |
eclipse.buildId=4.4.0.I20140606-1215 |
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
#include <stdio.h> | |
int main(int argc, const char *argv[]) | |
{ | |
int x = 1; | |
char *y = (char*)&x; | |
printf("If next line prints 1, then it's little-endian.\n") | |
printf("%c\n", (*y)+48); | |
return 0; | |
} |
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 urllib.request import urlopen | |
from urllib.parse import urlparse | |
import re | |
import sys | |
LINK_REGEX = re.compile("<a [^>]*href=['\"]([^'\"]+)['\"][^>]*>") | |
class LinkCollector: | |
def __init__(self, url): | |
""":type url: str""" | |
#::type: str |
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
// 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 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 Animal: | |
__metaclass__ = ABCMeta | |
@abstractmethod | |
def say_something(self): | |
return "I'm an animal!" | |
class Cat(Animal): | |
def say_something(self): | |
s = super(Cat, self).say_something() |
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
on :: (b -> b -> c) -> (a -> b) -> a -> a -> c | |
f `on` g = \x y -> f (g x) (g y) |
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
Blog china kids music yahoo want wrong service tech saying lots had address working following years didn internet wants photos former technology being traffic small past full november experience door company learn paper research sell self sometimes couple video makes next process books could stuff audio web become problem details worth provide feeds another john away hand thanks night test update guy cost product still non drop year tried america amp start podcast month advertising ask almost systems american culture close pictures smart showing popular application e dvd camera links including during university special times party home display star likely room before personal digg yes yet save deal magazine down weekend international box visit making interesting morning enough sound images released again u hour days needs coming through services point cut source though planet entire access turn happens development school however news conference n gave level posts goes sure later case director without list ver |
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
(ns clojure-noob.core | |
(:gen-class)) | |
(defn -main | |
"I don't do a whole lot ... yet." | |
[& args] | |
(println "Hello, World!")) | |
(println "hi there") |
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
(defn sum [xs] (reduce + xs)) | |
(defn avg [xs] (/ (sum xs) (count xs))) | |
(sum [1 2 3]) | |
(avg [1 2 3]) | |
(defn stats [numbers] | |
(map #(% numbers) [count sum avg]) | |
) | |
(stats [1 2 3 4]) |
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
(defn even-numbers | |
([] (even-numbers 0)) | |
([n] (cons n | |
(lazy-seq (even-numbers (+ n 2))))) | |
) | |
(take 10 (even-numbers 1)) |
OlderNewer