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
| The MIT License (MIT) | |
| Copyright (c) 2015 J Kishore Kumar | |
| 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 | |
| furnished to do so, subject to the following conditions: |
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 camelToTitle($camelStr) | |
| { | |
| $intermediate = preg_replace('/(?!^)([[:upper:]][[:lower:]]+)/', | |
| ' $0', | |
| $camelStr); | |
| $titleStr = preg_replace('/(?!^)([[:lower:]])([[:upper:]])/', | |
| '$1 $2', | |
| $intermediate); |
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 | |
| count=0 | |
| sys.setrecursionlimit(50000) | |
| cache={} | |
| def a(m,n): | |
| global count | |
| global cache | |
| count=count+1 | |
| if cache.has_key(m) and cache[m].has_key(n): | |
| return cache[m][n] |
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 math import * | |
| import sys | |
| chosen = {} | |
| n = int(sys.argv[1]) | |
| def place(xpos, ypos): | |
| if (ypos in chosen.values()): | |
| return False | |
| opponent = 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/env python | |
| """ | |
| Backup github issues | |
| Input: Read from settings.py | |
| Output: JSON data written to stdout | |
| Usage: ./github-issues.py >xyz-issues.json | |
| """ |
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 math import cos | |
| PI = 3.141592 | |
| N = 8 | |
| def f(u,v): | |
| if u + v % 2: return 0 | |
| return 1 | |
| def sum(x,y): |
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
| // Ackermann's Function - Full Recursive | |
| #include<stdio.h> | |
| #include<stdlib.h> | |
| int ackermann(int x, int y); | |
| int count = 0, indent = 0; | |
| int main(int argc, char **argv) | |
| { | |
| int x,y; | |
| if(argc!=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
| // Backtracking solution to Knight's Tour problem http://en.wikipedia.org/wiki/Knights_tour | |
| #include<stdio.h> | |
| #include<string.h> | |
| #include<stdlib.h> | |
| // Constraint: MAXX should be greater than or equal to MAXY | |
| #define MAXX 5 | |
| #define MAXY 5 | |
| typedef enum {FALSE, TRUE} bool; | |
| int n = 0; | |
| bool treaded_blocks[MAXX][MAXY]; |
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
| pre_composer_script: | | |
| memcached -d | |
| sudo apt-get -y -q --force-yes install zlib1g-dev pkg-config libmemcached-dev | |
| cd /tmp | |
| wget https://github.com/php-memcached-dev/php-memcached/archive/2.2.0.tar.gz | |
| tar zxvf 2.2.0.tar.gz | |
| cd php-memcached-2.2.0 | |
| phpize | |
| ./configure --disable-memcached-sasl | |
| make |
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
| # BEGIN WordPress | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteRule ^index\.php$ - [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule . /index.php [L] | |
| </IfModule> |
NewerOlder