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 <mach-o/dyld.h> | |
unsigned int bufferSize = 512; | |
std::vector<char> buffer(bufferSize + 1); | |
if(_NSGetExecutablePath(&buffer[0], &bufferSize)) | |
{ | |
buffer.resize(bufferSize); | |
_NSGetExecutablePath(&buffer[0], &bufferSize); | |
} | |
std::string s = &buffer[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
import java.util.*; | |
import static java.lang.System.out; | |
public class TreeNode | |
{ | |
public List<TreeNode> children; | |
public TreeNode() | |
{ |
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
jQuery.fn.futureFind = function futureFind(query, callback) { | |
function startLooking(el, query, initialElement, localEventID) { | |
var observer; | |
function stopLooking() { | |
observer.disconnect(); | |
} |
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
var words = [ | |
'lorem', 'ipsum', 'dolor', 'sit', 'amet', 'consectetur', | |
'adipiscing', 'elit', 'curabitur', 'vel', 'hendrerit', 'libero', | |
'eleifend', 'blandit', 'nunc', 'ornare', 'odio', 'ut', | |
'orci', 'gravida', 'imperdiet', 'nullam', 'purus', 'lacinia', | |
'a', 'pretium', 'quis', 'congue', 'praesent', 'sagittis', | |
'laoreet', 'auctor', 'mauris', 'non', 'velit', 'eros', | |
'dictum', 'proin', 'accumsan', 'sapien', 'nec', 'massa', | |
'volutpat', 'venenatis', 'sed', 'eu', 'molestie', 'lacus', | |
'quisque', 'porttitor', 'ligula', 'dui', 'mollis', 'tempus', |
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
IRestResponse response = _client.Execute (request); | |
response.Content = response.Content.Replace ("[]", "{}"); | |
var formatedResponse = _deserializer.Deserialize<ProfileResponse> (response); |
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
var lastValue = list[0] | |
for(var i = 1; i < list.length; i ++ ) | |
{ | |
lastValue = takeTwoValues(list[i],lastValue) | |
} |
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
f = open("schools.csv", 'r') | |
l = f.readline(); | |
while l: | |
l = l[1:-2] | |
x = repr(l).replace("'","\\\'")[1:-4] + "\'" + "," | |
if x[0] != "'": | |
x = "'" + x[1:len(x)] | |
x = x.replace("\\\\", "\\").replace("\'","\"") | |
print x |
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
// app.js | |
define(["require", "exports", "Player"], function (require, exports, player) { | |
var PhaserDemo = (function () { | |
function PhaserDemo() { | |
this.game = new Phaser.Game(800, 600, Phaser.WEBGL, 'content', { preload: this.preload, create: this.create }); | |
} | |
PhaserDemo.prototype.preload = function () { | |
this.game.load.image('phaser_run', 'run.png'); | |
}; | |
PhaserDemo.prototype.create = function () { |