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
| /* file: "tinyc.c" */ | |
| /* Copyright (C) 2001 by Marc Feeley, All Rights Reserved. */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| /* | |
| * This is a compiler for the Tiny-C language. Tiny-C is a |
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 <time.h> | |
| #define O_O const char* | |
| #define __ if | |
| #define ___ while | |
| #define OO void | |
| O_O O[]={"$%&'(#)*+,-./0#1234567#)89:;<=>#","0?@ABC5D#EFBG#", | |
| "HIJBK#HILBM#HINO-PB#HIFBQ#HIRS#HIATU-VB#","WXY=Z.[#\\]^_`#abc'Rd#efg*h^ij#k*+l-mInd#opBqrC5D#" | |
| ,"sJBK#sJBK#HIJtIJ#uBK#HIJtIJ#uBK#","WXY=Z.[#\\]^_`#abc'Rd#efg*h^ij#","\n","I;y.;","21","-,.?29;.-",",1","41*;", |
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 generateGrid(x, y, r=1): | |
| matrix = [] | |
| for dy in xrange(-r, r+1): | |
| for dx in xrange(-r, r+1): | |
| matrix.append((x+dx, y+dy)) | |
| return matrix | |
| print generateGrid(0, 1) | |
| """ |
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/python | |
| # ecole polytechnique - c.durr - 2009 | |
| # Kuhn-Munkres, The hungarian algorithm. Complexity O(n^3) | |
| # Computes a max weight perfect matching in a bipartite graph | |
| # for min weight matching, simply negate the weights. | |
| """ Global variables: | |
| n = number of vertices on each side | |
| U,V vertex sets |
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 bestChange(denominations, amount): | |
| if amount == 0: | |
| return [] | |
| for i in denominations: | |
| if i <= amount: | |
| return [i] + bestChange(denominations, amount-i) | |
| denominations = [100, 50, 20, 10, 5, 2, 1] | |
| amount = 109 |
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
| /* | |
| * Galois linear feedback shift register (LFSR) in Java | |
| * Copyright (c) 2012 Nayuki Minase | |
| */ | |
| import java.math.BigInteger; | |
| import java.util.Random; | |
| /** |
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
| <?php | |
| function fch($csm) | |
| { | |
| if($csm < 0) | |
| $csm += 4294967296.0; | |
| $a = (int)fmod($csm, 10); | |
| $t = 1; | |
| $b = (int)($csm / 10); |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <test> | |
| <case>42</case> | |
| </test> |
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
| <?php | |
| /* | |
| Usage: |
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 java.util.Arrays; | |
| /* Copyright (c) 2012 Kevin L. Stern | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |