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
SyntaxTree tree = SyntaxTree.ParseText(@"int fun(int x,int z){ int y = 0; x++; return x+1;} | |
double funny(double x){ return x/2.13;}"); | |
List<MethodDeclarationSyntax> methods = tree.GetRoot() | |
.DescendantNodes() | |
.Where(d => d.Kind == SyntaxKind.MethodDeclaration) | |
.Cast<MethodDeclarationSyntax>().ToList(); | |
methods.Select(z => | |
{ | |
var parameters = z.ParameterList.Parameters.Select(p => p.Identifier.ValueText); |
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
void Main() | |
{ | |
//Should show understand. See the bold characters | |
string path = "ujnbvcderesdftrewazxcvbnhgfds"; | |
//Define other methods and classes here | |
StreamReader sr = new StreamReader ("C:\\T9.txt"); | |
string total = sr.ReadToEnd(); sr.Close(); | |
List<string> suggestions = new List<string>(); | |
var query = total.Split(new char[]{'\r','\n',' '},StringSplitOptions.RemoveEmptyEntries) | |
.Select (t => t.Trim()) ; |
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
string keyPad = @"2 = ABC2 | |
3 = DEF3 | |
4 = GHI4 | |
5 = JKL5 | |
6 = MNO6 | |
7 = PQRS7 | |
8 = TUV8 | |
9 = WXYZ9"; | |
Dictionary<char,char> keyMap = new Dictionary<char,char>(); | |
//4663 can lead to "good","home" etc |
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
//Nearest Neighbour | |
var trainingSet = File.ReadAllText(@"C:\iris.csv") | |
.Split(new char[]{'\r','\n'},StringSplitOptions.RemoveEmptyEntries) | |
.Select ( f => f.Split(',')) | |
.Skip(1) | |
.Select (f => | |
new | |
{ | |
SepalLength = Convert.ToDouble( f[0]), | |
SepalWidth = Convert.ToDouble(f[1]), |
NewerOlder