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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Text; | |
using System.Threading.Tasks; | |
// Assume .NET 4.5 | |
namespace FunAPI |
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
# | |
# vi $profile | |
# C:\Users\userid\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 | |
# | |
new-alias vi "C:\Program Files\Sublime Text 2\sublime_text.exe" | |
new-alias grep select-string |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
DateTime a = DateTime.Now; | |
DateTime z = DateTime.Parse("2014-06-01 00:00:00"); |
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 Expander = (function(){ | |
var Expander = function(id) { | |
this._id = id; | |
this._elem = elem = document.getElementById(id); | |
this._step = 0; | |
this._height = 0; | |
}; | |
Expander.prototype.expand = function(incr,to) { | |
var self = this; | |
var animate = (incr>0 && this._height<to) |
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 expect = function(value1) { | |
return { | |
toBe: function(value2) { | |
document.getElementById('test').innerHTML += | |
"<pre>" | |
+ ((JSON.stringify(value1) === JSON.stringify(value2)) ? "Pass " : "Fail ") | |
+ "(val1: " + JSON.stringify(value1) | |
+ " val2: " + JSON.stringify(value2) | |
+ ")</pre><br\>"; | |
} |
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
using System; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine(wordRepeater("Hi! ",10)); | |
Console.WriteLine(wordRepeater2("Hello! ",10)); | |
} | |
public static String wordRepeater(String name, int n) { |
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
// See http://blog.bdoughan.com/2011/06/using-jaxbs-xmlaccessortype-to.html | |
@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER) | |
@XmlRootElement | |
public class Cake implements PlainTextBean { | |
private String type; | |
// The getter is up here since the order of fields affects the order in the | |
// xml. | |
public String getType() { | |
return type; |
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
#!/usr/bin/env groovy | |
// GROOVY STYLE!!!!!!!!!!!!!!!! | |
def a = new ArrayList<String>() | |
a.add("Hello") | |
a.add("my") | |
a.add("name") | |
a.add("is") | |
a.add("Jess") |
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
#!/usr/bin/env node | |
/* | |
* Design a stack with a push, pop, and min method. | |
* Min returns the smallest element. | |
* All methods must operate in O(1) time. | |
* I implemented this with simple numbers, but I could enhance it | |
* to use objects with a comparator function. | |
*/ |
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
#!/usr/bin/env node | |
var util = require("util"); | |
util.puts("Search Array for value N."); | |
// This only took me 12 minutes to do on a white board. | |
// This has a complexity of O(log n). | |
// 0 1 2 3 4 5 6 7 8 9 10 11 | |
var a = [ 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16 ]; | |
var _indexOf = function(pos1, pos2, n) { |