roncli.com blog
The blog of roncli
roncli.com blog
roncli.com
blog
Profile
roncli
Houston, Texas, United States
Labels
Coding
CTG Music
Editorials
Games
Miscellaneous
Music
Servers
Silliness
Software
Sports
Trax in Space Beta
Weather
Recent Posts
A Tale of Two Communities
The Final Stretch
A Two Tiered, Untiered OTL
Secretly, you wish you could've done what I did
What have I done since roncli.com v2?
It's Done. It's Finally Done.
The Big Picture is Starting to Wear on Me
A Low Bang to Buck Ratio
win-acme
Overload has truth; next it needs balance
Archives
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
June 2008
July 2008
September 2008
December 2008
February 2009
July 2009
August 2009
September 2009
October 2009
November 2009
February 2010
March 2010
April 2010
June 2010
July 2010
August 2010
September 2010
October 2010
November 2010
December 2010
March 2011
June 2011
July 2011
August 2011
September 2011
October 2011
December 2011
January 2012
February 2012
April 2012
July 2012
November 2012
July 2013
April 2014
July 2014
August 2014
November 2014
December 2014
March 2015
April 2015
May 2015
June 2015
July 2015
September 2015
January 2016
February 2016
May 2016
July 2016
November 2016
March 2017
January 2018
May 2018
June 2018
January 2019
January 2021
February 2021
March 2021
August 2021
October 2021
December 2021
August 2022
November 2022
October 2023
February 2024
Current Posts
Saturday, December 25, 2010
LINQ to Entities and constructors with parameters
Posted: 3:42:00 PM 0 comments
Merry Christmas! You can tell you love something if you do it while on vacation and holidays, so let's jump right into it.

I recently converted the data access layer of Six Minutes To Release to LINQ to Entities. Aside from a bit of syntactical change, the conversion was painless. That is, until I got into the runtime:

Only parameterless constructors and initializers are supported in LINQ to Entities.

Fair enough. What I like to do is to create a class that I can quickly dump the results of a LINQ to SQL query into. Typically I'll use this for ListViews. For example:

ListView1.DataSource = (From t In db.table Select New DataClass(t, t.otherTable.Value, t.otherTable.Value2))

The problem is not that LINQ can't do this, it's specifically LINQ to Entities. So what you need to do instead is a 2-step process. First, take the data out of LINQ to Entities. Then, deal with the data in LINQ. How do you do this? By using .ToList() to process the query in LINQ to Entities and using a second query to get it into the class.

Dim query = (From t in db.table Select New With {.Table = t, .Value = t.otherTable.Value, .Value2 = t.otherTable.Value2})
ListView1.DataSource = (From q in query Select New DataClass(q.Table, q.Value, q.Value2))

Ideally, I'd like to get all this stuff out of ASP.Net and use jQuery templates instead, but that would be more legacy code converting than I have time for these days. So for now, this will be the solution I use.

Labels: , ,

Wednesday, December 08, 2010
Cyberwars
Posted: 1:23:00 PM 1 comments
If you haven't heard about the whole WikiLeaks ordeal by now, you've probably been hiding under a rock. The short of it is that WikiLeaks has been publishing classified government documents on the Internet. There are arguments as to whether or not doing so is considered treason. This article does not address this topic, but it is the argument itself that is the heart of this post.

A bit of a background. I use EveryDNS to host my DNS needs. This includes domain name resolution for roncli.com, Outpost Music, Six Minutes To Release, and even this blog. It is an excellent free service, and I highly recommend it to anyone that needs DNS services.

EveryDNS, however, is between the proverbial rock and hard place.

You see, EveryDNS also hosted the DNS entries for many of the WikiLeaks websites. I say "hosted", because they discontinued hosting them on December 2nd.

EveryDNS.net provided domain name system (DNS) services to the wikileaks.org domain name until 10PM EST, December 2, 2010, when such services were terminated. As with other users of the EveryDNS.net network, this service was provided for free. The termination of services was effected pursuant to, and in accordance with, the EveryDNS.net Acceptable Use Policy.

The assumption made here, of course, is that EveryDNS believes that WikiLeaks is wrong, and that taking it offline is the best course of action. Well, some people support WikiLeaks, including Operation Payback. This is group of people who want to payback those who do what they perceive as wrong on the Internet. And, apparently, they have deemed WikiLeaks to be wrong.

But, as is often in life, assumptions may not always be the truth:

More specifically, the services were terminated for violation of the provision which states that "Member shall not interfere with another Member's use and enjoyment of the Service or another entity's use and enjoyment of similar services." The interference at issues arises from the fact that wikileaks.org has become the target of multiple distributed denial of service (DDOS) attacks. These attacks have, and future attacks would, threaten the stability of the EveryDNS.net infrastructure, which enables access to almost 500,000 other websites.

And the cyberwar begins. EveryDNS is afraid of being DDOS'd due to them hosting the DNS to WikiLeaks' websites. EveryDNS shuts WikiLeaks' DNS down to protect themeselves. Operation Payback responds by DDOSing EveryDNS.

Is there any way EveryDNS can win?

Granted, I'm assuming that the story EveryDNS gives us is true, and we all know where assumptions lead us.

Labels: , , ,