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
| segment .text | |
| global _start | |
| _start: | |
| XOR R5, R5 ; clear r5 | |
| XOR R6, R6 ; clear r6 | |
| INC R6 ; increment r6 | |
| SRC R1 ; shift right with carry | |
| JC _carry ; if carry jump _carry |
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
| // ===================================================================================== | |
| // | |
| // Filename: path.c | |
| // | |
| // Description: | |
| // | |
| // Version: 1.0 | |
| // Created: 03/26/2014 09:31:02 PM | |
| // Revision: none | |
| // Compiler: gcc |
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
| void _fft(double* buf, double* out, unsigned int n, unsigned int step){ | |
| if(step<n){ | |
| _fft(out, buf, n, step*2); | |
| _fft(out+step, buf+step, n, step*2); | |
| int i; | |
| for(i=0;i<n;i += 2*step){ | |
| double t = cexp(-I*PI*i/n)*out[i+step]; | |
| buf[i/2] = out[i] + t; | |
| buf[(i+n)/2] = out[i] - t; |
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> | |
| typedef union{ | |
| int i; | |
| char c; | |
| }_value; | |
| typedef struct _node{ | |
| struct _node* left; | |
| struct _node* right; |
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 Tag(object): | |
| """HTML tag class""" | |
| def __init__(self, item, value, **atts): | |
| """ | |
| HTML tag constructor | |
| """ | |
| self.__item = item | |
| self.__value = value | |
| self.__attributes = [' %s="%s"' % i for i in atts.items()] | |
| self.__element = "<{item}{attributes}>{value}</{item}>".format( |
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 | |
| def tailf(f_file): | |
| f_file.seek(0, 2) | |
| while True: | |
| l = f_file.readline() | |
| if not l: | |
| continue | |
| yield l |
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
| from faker import Faker | |
| import random | |
| fake = Faker() | |
| pop = 100 # total population | |
| mxval = 100 # max value | |
| mnval = 1000 # min value |
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 requests | |
| import re | |
| from multiprocessing import Pool | |
| url = "http://www.cs.umd.edu/~gasarch/bookrev/bookrev.html" | |
| r_url = re.compile("HREF=.*.pdf\"") | |
| r_replace_t = "HREF=\"" | |
| r_replace_w = "http://www.cs.umd.edu/~gasarch/bookrev/" | |
| site_content = requests.get(url).content |
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
| # Thanking everyone who wished me on my birthday | |
| import requests | |
| import json | |
| # Aman's post time | |
| AFTER = 1353233754 |
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
| #define bitGet(v, n) ((v >> n) & 1) | |
| int bitGet(int v, int n){ | |
| switch(n - 1){ | |
| case 7: v >>= 1; | |
| case 6: v >>= 1; | |
| case 5: v >>= 1; | |
| case 4: v >>= 1; | |
| case 3: v >>= 1; | |
| case 2: v >>= 1; |