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
func calculateHouses(in string) int { | |
v := map[int]int{0: 1} | |
z := map[rune]int{'<': -1, '>': 1, '^': 99, 'v': -99} | |
x := 0 | |
for _, a := range in { | |
x += z[a] | |
v[x] = 1 | |
} |
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
(function (window, document, $, undefined) { | |
var possibleCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
var defaults = { | |
selector: "#captcha", | |
text: null, | |
randomText: true, | |
randomColours: true, |
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.IO; | |
using MsgPack.Serialization; | |
using ZeroMQ_MessagePack_Testbed.Models; | |
using ZMQ; | |
namespace ZeroMQ_MessagePack_Testbed | |
{ | |
class Program | |
{ |
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
$(function () { | |
//add a requesting indicator to the page | |
$(document.body).append( | |
$('<div id="requesting" />').css({ | |
top: '0px', | |
right: '0px', | |
height: '5px', | |
width: '5px', | |
'background-color': 'gray', |
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.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using System.Xml; | |
using Newtonsoft.Json; | |
using Formatting = Newtonsoft.Json.Formatting; | |
namespace XML2JSON | |
{ | |
class Program |
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
private static dynamic GetDynamicFromXml(string pathToXml) | |
{ | |
var xdoc = XDocument.Load(pathToXml); | |
return GetDynamicFromNode(xdoc.Root); | |
} | |
private static dynamic GetDynamicFromNode(XElement node) | |
{ | |
dynamic result = new ExpandoObject(); |
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
(function (window) { | |
//declare the variables here, | |
//as js variable hoisting will do this | |
//here anyway | |
var m, queryString, re; | |
//if the window query object does not exist | |
if (!window.query) { | |