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() | |
{ | |
Person p=new Person(){Name="Orlando",Age=10}; | |
Console.WriteLine(p.GetType().GetProperties()); | |
Console.WriteLine(p.GetType().GetProperties().Select(x=>x.GetMethod.Invoke(p,null))); | |
} | |
// Define other methods and classes here | |
class Person { | |
public string Name {get; set;} |
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 Puppy { | |
// instance variables; private | |
private String _name; | |
private int _age; | |
// constructor | |
public Puppy (String name, int age) | |
{ | |
// constructor is called on a specific instance; let's modify that instance's variables | |
_name=name; |
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
sales=sc.textFile("sales_*.txt").map(lambda x:x.split('\t')) |
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
{ | |
"sheets": [ | |
{ | |
"title": "P&P", | |
"queries": [ | |
{ | |
"db_driver": "psycopg2", | |
"db_conn_str": "dbname=curri user=curri", | |
"title": "People", | |
"query": "SELECT * FROM Person" |
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
class DFA[StateType] | |
( | |
val Q:Set[StateType], | |
val F:Set[StateType], | |
val q0:StateType, | |
val delta: (StateType,Char)=>StateType, | |
val Sigma:Set[Char] | |
) | |
{ | |
... |
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
<contacts> | |
<contact id="1"> | |
<firstName>Orlando</firstName> | |
<lastName>Karam</lastName> | |
</contact> | |
<contact id="2"> | |
<firstName>Lina</firstName> | |
<lastName>Colli</lastName> | |
</contact> | |
</contacts> |
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 MyExtensions | |
{ | |
public static System.TimeSpan Months(this Int32 x) | |
{ | |
return System.DateTime.Today.AddMonths(x) - System.DateTime.Today; | |
} | |
public static System.TimeSpan Years(this Int32 x) | |
{ | |
return System.DateTime.Today.AddYears(x) - System.DateTime.Today; |
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
SELECT id,name, SkillsXml.query('/skills/skill[1]') | |
FROM People |
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 Dapper; | |
namespace DapperCleanDemo.Controllers | |
{ | |
public class PeopleController : ApiController | |
{ | |
public IEnumerable<dynamic> GetResultById(string id) | |
{ | |
using (var conn = new SqlConnection(@"Server=localhost\sqlexpress;Database=XmlTest;Trusted_Connection=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
bool accepts(string str) | |
{ | |
return contains(F,delta_hat(q0,str)); | |
} |
NewerOlder