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 SubSetSolver | |
{ | |
// Define other methods and classes here | |
public void Solve(string input) | |
{ | |
List<int> seq = input.Split(',').Select(x => int.Parse(x)).ToList(); | |
seq.Sort(); | |
List<List<int>> combinations = new List<List<int>>(seq.Count *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
<?php | |
$result = mysql_query('SELECT * FROM Customers'); | |
if (!$result) { | |
die('Invalid query: ' . mysql_error()); | |
} | |
?> |
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(root){ | |
var widget = function(){ | |
var self = this; | |
// configuration | |
var config = { | |
css:{ | |
theme:'current' |
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 myVariable = "Some external value;" | |
(function(root){ | |
var myVariable = "Some internal value;" | |
console.log(myVariable); // will be "Some internal value" | |
})(window); | |
console.log(myVariable); // will still be "Some external value" |
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
void Main() | |
{ | |
string A = @"A New Hope | |
The Empire Strikes Back | |
Return of the Jedi | |
The Phantom Menace | |
Attack of the Clones | |
Revenge of the Sith"; | |
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 loadScript(address, callback) { | |
var script_tag = document.createElement('script'); | |
script_tag.setAttribute("type", "text/javascript"); | |
script_tag.setAttribute("src", address); | |
if (script_tag.readyState) { | |
script_tag.onreadystatechange = function () { // For old versions of IE | |
if (this.readyState == 'complete' || this.readyState == 'loaded') { | |
callback(); | |
} | |
}; |
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
// Greatest Common Denominator using Euclidian Algorithm | |
int gcd(int a, int b) | |
{ | |
return b==0 ? a : gcd(b, a % b); | |
} |
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 string GenerateRandomString(int length = 32) | |
{ | |
if (length <= 0) | |
throw new ArgumentException("provided length must be greater than 0"); | |
using (RNGCryptoServiceProvider cryptoProvider = new RNGCryptoServiceProvider()) | |
{ | |
var bytes = new byte[length]; | |
cryptoProvider.GetNonZeroBytes(bytes); | |
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
// Create epub file from unsongbook.com and write to console. | |
open FSharp.Data | |
open System.Collections.Generic | |
type Chapter(title:string, body:string, url:string)= | |
member x.Title = title | |
member x.Body = body | |
member x.URL = url | |
let chapters = new List<Chapter>() |
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
Option Explicit | |
'################################################ | |
'This script is to export Visio and PUML files to PNG files | |
'################################################ | |
Sub main() | |
Dim ArgCount, argumentPath, workItems, skipped, scriptdir | |
ArgCount = WScript.Arguments.Count |
OlderNewer