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
/// <summary> | |
/// A stream reader which will puts the seek position to the right place after each line read. | |
/// </summary> | |
internal class LineReader | |
{ | |
private Stream stream; | |
private Encoding encoding; | |
/// <summary> | |
/// Creates a new instance of this class. |
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
using System; | |
using System.Diagnostics; | |
namespace SunriseCalculator | |
{ | |
public class SolarInfo | |
{ | |
public double SolarDeclination { get; private set; } | |
public TimeSpan EquationOfTime { get; private set; } | |
public DateTime Sunrise { get; private set; } |
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 Commit(Row[] rows) | |
{ | |
// yield priority to commits that came before | |
GetGlobalLock(); | |
ReleaseGlobalLock(); | |
// attempt to lock all rows | |
int i = 0; | |
for (i = 0; i < rows.Length; i++) | |
{ |
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
// sluu99 (C) 2013 | |
// Released under WTFPL | |
// Fakenode version 0.0.1 | |
window.require = function(x) { | |
if (x === 'resolverjs') { | |
return { | |
get: function(x, defaultVal) { return defaultVal; } | |
}; | |
} |
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
{ | |
"formsoul": { | |
"url": "http://github.com/sluu99/formsoul", | |
"lastVersion": "0.0.1", | |
"allVersions": ["0.0.1"], | |
"cdn": "http://cdn.sluu99.com/formsoul/formsoul-<version>.min.js" | |
} | |
} |
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 original import CallMe | |
CallMe() |
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
public bool IsEven(int num) | |
{ | |
int up = num; | |
int down = num; | |
try | |
{ | |
while(up != 0) | |
{ | |
up = up + 2; | |
} |
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
<script> | |
function shawty(data) { | |
if (data.success) { | |
document.write( | |
'<a href="' + data.short + | |
'">Short URL to the current page</a>'); | |
} | |
} | |
</script> | |
<script src="//luu.bz/shawty.js"></script> |
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
shawty({ | |
'success': 1, | |
'message': '', | |
'short': 'http://luu.bz/bD', | |
'long': 'http://en.wikipedia.org/wiki/URL_shortening', | |
'hits': 0, | |
'timestamp': 1349564105 | |
}); |
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
Robot r = new Robot(); | |
System.out.println("Start!"); | |
Thread.sleep(2000); // give yourself some margin to switch window | |
int[] times = { 1, 5, 4, 4, 1, 3, 2 }; // number of shots for each distance | |
int[] delays = { 400, 400, 575, 820, 850, 1150, 1350 }; // time holding the ball | |
int[] delays2 = { 200, 650, 700, 600, 400, 450, 400 }; // time waiting for a new ball | |
for (int i = 0; i < times.length; i++) | |
for (int j = 0; j < times[i]; j++) { | |
r.keyPress(KeyEvent.VK_SPACE); | |
r.delay(delays[i]); |