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
/* | |
ways to calculate the number of blocks of used to build a pyramid | |
*/ | |
var numberOfBlocksInPyramid = function(edgeLength,intialCount) { | |
if (edgeLength==0) return intialCount; | |
var atLevel=edgeLength*edgeLength; | |
console.log(edgeLength + " " + atLevel + " " + intialCount); | |
intialCount=atLevel+intialCount; | |
return numberOfBlocksInPyramid(--edgeLength, intialCount); | |
} |
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
public static class WidgetHelper | |
{ | |
// sets text and move caret to the end of the line | |
public static void SetText (this EditText edt, string textToSet){ | |
edt.Text = textToSet; | |
edt.Append(""); | |
} | |
} |
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 Android.App; | |
using Android.Runtime; | |
using Android.Util; | |
namespace VelocityTab | |
{ | |
[Application] | |
public class App : Application | |
{ |
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
foreach (Environment.SpecialFolder s in (Environment.SpecialFolder[])Enum.GetValues(typeof(System.Environment.SpecialFolder))) | |
{ | |
Android.Util.Log.Info("App", string.Format("Environment.SpecialFolder.{0}::{1}",Enum.GetName(typeof(Environment.SpecialFolder),s),Environment.GetFolderPath(s))); | |
} | |
/* output starts */ | |
/* | |
Environment.SpecialFolder.Desktop::/data/data/{package name}/files/Desktop | |
Environment.SpecialFolder.Programs:: |
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
public static class StringExtension | |
{ | |
public static bool IsNumeric(this string str) | |
{ | |
double n; | |
return Double.TryParse(str, out 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
public class DoingConstants | |
{ | |
public const string Flying = "F"; | |
public const string Walking = "W"; | |
public const string Crawling = "C"; | |
public const string Scooting = "R"; | |
static Dictionary<string,string> _asDictionary; | |
public static Dictionary<string, string> AsDictionary | |
{ |
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
adfads |
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
// @dankapusta on twitter sent me a link to | |
// http://stackoverflow.com/questions/13015523/angular-js-is-value-the-proper-way-to-set-app-wide-constant-and-how-to-retri | |
// so changing service to const to | |
//code omitted | |
.constant('Consts', | |
{ | |
const1: { | |
yes: 1, | |
no: 2, |
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; | |
class Program | |
{ | |
static void Main() | |
{ | |
// Read in every line in the file. | |
var list = new List<JobSchedule>{ |
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
namespace tests | |
{ | |
[TestClass] | |
public class string_extension_tests | |
{ | |
[TestMethod] | |
public void when_formatting_title_case_to_delimited_but_the_delimiter_is_not_specified() | |
{ | |
var s = "ThisIsTheDayThatTheLordHasMade"; | |
var formated = s.TitleCaseToDelimited(); |