Skip to content

{ Monthly Archives } April 2010

In LINQ, Don’t Use Count() When You Mean Any()

If you have a list, array, or query in a C#/LINQ application and need to check and see if the list is empty, the correct way to do this is to use the Any() extension method:

if (q.Any())
{

Similarly, you can check to see if any elements in the list meet a certain condition:

if (q.Any(i => i.IsSpecial))
{

If [...]

Tagged , ,

A Math Primer for Gentry’s Fully Homomorphic Encryption

A couple of weeks ago, I wrote What Is Homomorphic Encryption, and Why Should I Care? In that post, I promised to share my C# implementation of the algorithm from Craig Gentry’s CACM article. Before I can do that, though, I need to explain some of the math involved.
Perhaps surprisingly, it’s actually very simple. (I [...]

Tagged , , ,

Bad Behavior has blocked 713 access attempts in the last 7 days.

Close