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
private IEnumerable<string> ConvertToMarkdownTables(string response) | |
{ | |
var jobj = JObject.Parse(response); | |
var arrays = GetAllArrays(jobj); | |
var tabs = new List<string>(); | |
foreach (var a in arrays) | |
{ | |
var tab = DumpTable(a); | |
tabs.Add(tab); |
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
import math | |
def sign (x): | |
if x > 0: return 1 | |
if x < 0: return -1 | |
return 0 | |
def is_misclassified (x, w, b, y): | |
val = x[0]*w[0] + x[1]*w[1] + b | |
print ("x=", x, "w=", w, "b=", b, "y=", y, "mis_classification=", sign(y) != sign(val)) |
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
static class IO | |
{ | |
public static int ReadInt () | |
{ | |
var n = Console.ReadLine (); | |
return int.Parse (n); | |
} | |
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
Master Product Import | |
* Formats : CSV, XML, JSON | |
* Bind sources: Http, Ftp, Tcp | |
WHAT TO IMPORT : You can import master product datas from various file formats. | |
HOW TO IMPORT : Import Process supports different protocols. | |
TAGBOXES Tag your Products with TagBox. | |
* Color = Red | |
* Price = 5 |
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
[Test] | |
public void functional_lists() | |
{ | |
FuncList<Func<int>> first = null; | |
FuncList<Func<int>> current = null; | |
Enumerable.Range(1,100).ToList().ForEach(x => | |
{ | |
var newFunc = new FuncList<Func<int>>(() => x, new FuncList<Func<int>>()); | |
if (first == null) | |
{ |
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
List<string> _trace = new List<string>(); | |
int SumNumbers(int from, int to) | |
{ | |
_trace.Add(string.Format("SumNumbers ({0},{1}) : int {{", from, to)); | |
if (from > to) | |
{ | |
_trace.Add(string.Format("({0} > {1}) return 0 }}", from, to)); | |
return 0; |
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
director directorname dns { | |
.list = { | |
.host_header = "www.example.com"; | |
.port = "80"; | |
.connect_timeout = 0.4; | |
"192.168.15.0"/24; | |
"192.168.16.128"/25; | |
} | |
.ttl = 5m; | |
} |
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
def S(seq, i=0): | |
if i == len(seq): return 0 | |
return S(seq, i + 1) + seq[i] | |
sys.setrecursionlimit(100000) | |
print S(range(100000), 0) |
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
static void Main(string[] args) | |
{ | |
Console.WriteLine(S(Enumerable.Range(1, 23456).ToList())); // No problem | |
Console.WriteLine(S(Enumerable.Range(1, 25799).ToList())); // Stack problem | |
} | |
static int S(IList<int> seq, int i = 0) // Problem function | |
{ | |
if (i == seq.Count()) return 0; |
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
# X = [1,1,1,1,1] | |
# Y = [1,1,1,1,1] | |
X = [2,3] | |
Y = [4,5] | |
def pearson (x,y): | |
print 'x ',x | |
print 'y ',y | |
NewerOlder