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 | |
| class Hello(object): | |
| singleton = None | |
| def __new__(clz): | |
| if not clz.singleton: | |
| clz.singleton = object.__new__(clz) | |
| return clz.singleton |
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 emacs --script | |
| (require 'cl) | |
| (defun foreach (alist func) | |
| (while alist | |
| (progn | |
| (funcall func (car alist)) | |
| (setq alist (cdr alist))) | |
| )) |
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 emacs --script | |
| (require 'cl) | |
| (defun show-string-list (l) | |
| (message | |
| (mapconcat (lambda (s) (concat s "\n")) l ""))) | |
| (defun show-pack (s) | |
| (file-name-nondirectory (replace-regexp-in-string "\\.el$" "" s))) |
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 ruby | |
| #-*- mode: ruby -*- | |
| require 'rubygems' | |
| require "eventmachine" | |
| require "evma_httpserver" | |
| class EchoServer < EM::Connection | |
| include EM::HttpServer | |
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
| # vim: syntax=sh | |
| # | |
| function load { | |
| if [ -f $1 ]; then | |
| source $1 | |
| fi | |
| if [ -d $1 ]; then | |
| for file in $1/*; do | |
| load $file |
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 <stdio.h> | |
| #include <stdlib.h> | |
| #include <ctype.h> | |
| void print_array( int* array, int size ) { | |
| printf("["); | |
| for ( int i = 0; i < size; i++ ) { | |
| printf("\"%d\"", array[i]); | |
| if ( i < size-1 ) { printf(", "); } | |
| } |
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 <stdio.h> | |
| #include <stdlib.h> | |
| #include <ctype.h> | |
| int* intcat( int* a1, int size1, int* a2, int size2 ) { | |
| int *result = malloc((size1+size2)*sizeof(int)); | |
| int *iter = result; | |
| for ( int i = 0; i < size1; i++ ) { *iter++ = *a1++; } | |
| for ( int i = 0; i < size2; i++ ) { *iter++ = *a2++; } | |
| return result; |
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 <stdio.h> | |
| #include <stdlib.h> | |
| #include <ctype.h> | |
| void print_array( int* array, int size ) { | |
| printf("["); | |
| for ( int i = 0; i < size; i++ ) { | |
| printf("\"%d\"", array[i]); | |
| if ( i < size-1 ) { printf(", "); } | |
| } |
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
| /* | |
| Modification of Paul Bourkes FFT code by Peter Cusack | |
| to utilise the Microsoft complex type. | |
| This computes an in-place complex-to-complex FFT | |
| x and y are the real and imaginary arrays of 2^m points. | |
| dir = 1 gives forward transform | |
| dir = -1 gives reverse transform | |
| */ | |
| void FFT(int dir, long m, complex <double> x[]) |
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
| 1 | |
| 00:00:04,829 --> 00:00:09,829 | |
| Credit to: Sakti Tandi [1st Indonesian-Script] | |
| English. Subs. and. Re-Sync. by npdv-iD | |
| 2 | |
| 00:00:19,043 --> 00:00:21,168 | |
| You know there are more people | |
| with genius IQ living in China |