Thursday, January 2, 2014
Why do indices start at 0?
question on delegate predicates
in the following class:
class testLinq
{
public bool www(string s)
{ return
s.Equals("def"); }
public
delegate bool d(string s);
public
void write()
{
List<String> l = new
List<string>()
{ "abc", "def"
};
normal way of doing predicate:
Console.WriteLine(l.Find(p
=> { return p.Equals("def"); }));
bizzare method:
Predicate<string> pred = new Predicate<string>(www);
Console.WriteLine(l.Find(pred));
non working method -
d
di = null;
di = www;
Console.WriteLine(l.Find(di)));
Why?
Console.ReadLine();
}
}
Basic Web Vulnerabilities
are broken in to 3 types
- Injection
- sql injection
- LDAP Injection
- The server trusting requests
- the client trusting responses
words that c# compiler add to LINQ
for example:
in this case
in this case
SortedList<int, string> sl = new SortedList<int, string>() { {
4, "beatrice" }, { 2, "herby" } };
this
Console.WriteLine(sl.FirstOrDefault((KeyValuePair<int,
string> p) => {return
p.Key == 4; }).Value);
is equivelant to this:
Console.WriteLine(sl.FirstOrDefault(p
=> p.Key == 4).Value);
Wednesday, January 1, 2014
Subscribe to:
Comments (Atom)