Nov 24, 2009

What Was, Has Never Been: Global Warming

So, most of you may have not have heard on TV...or pretty much any other major news outlet that the cats out of the bag.  A hacker was able to break in to the servers at University of East Anglia's Climate Research Unit.  To say the least, what has been revealed is pretty shocking.  Emails reveal deletion of data meant to be kept for FOIA records, conspiring to manipulate data with other scientist, attempts to hide published climate phenomena that contradicts global warming theory, and even moving to prevent scientist that disagree on the causes of Global War-err...I mean "Climate Change".  So here is a few articles with a rundown of all that is happening:

Climategate: the final nail in the coffin of 'Anthropogenic Global Warming'?

Hiding evidence of global cooling

CRU Hackery Links

CBS: East Anglia CRU covered up bad data, computer modeling

UPDATE:
Remember that EPA report that the left howled over the Bush administration "suppressing", and cheered Obama for putting science back in its rightful place by releasing it? CBS reminds us that the EPA "relies on most heavily" on this very same corrupt data in formulating its conclusion.

Nov 9, 2009

Generic Client for WCF


While working on WCF i got frustrated working with the proxy auto-generated by VS2008.  While I loved creating the client channels using a ChannelFactory, i really got tired of writing:

ICommunicationObject
c = Client as ICommunicationObject;
if (c.State == CommunicationState.Faulted)
c.Abort();
else if (c.State != CommunicationState.Closed)
c.Close(); 


after every remoting call.  I searched for ever trying to find an easy way to close up the channel gracefully,
and nothing really stood out.  I really love the using statement pattern as I dont have to call Close(), but if the channel is in a faulted state you get an exception thrown.  I resorted to writing this generic class which isnt exactly pretty, but it gets the job done.



public class RemotingClient:IDisposable
{
public RemotingClient(ChannelFactory factory)
{
Client = factory.CreateChannel();

ICommunicationObject c = Client as ICommunicationObject;

if(null ==c)
throw new ArgumentException(typeof(T).GetType().ToString()
"Can not be used as an ICommunicationObject");

c.Open();
}


public T Client
{ getset; }


#region

//IDisposable Members


public void
Dispose()

{
ICommunicationObject c = Client as ICommunicationObject;

if(c.State == CommunicationState.Faulted)
c.Abort();
else if (c.State != CommunicationState.Closed)
c.Close();


}
#endregion

}
Now I can use my client in a fashion such as:


using(RemotingClient c = new RemotingClient(_channelfactory))
{

c.Client.SomeMethod();
}
and everything takes care of itself.  But for some reason having a class inherit from IDisposable just to take care of the channel doesnt feel right.  If there are any suggestions for a cleaner way I would love to hear it.

Oct 22, 2009

Windows 7 Will Give You a Heart Attack

Well, not really.  But this Windows 7 Whopper from Burger King in Japan is certainly doing its best:


Oct 8, 2009

How To: Setting up mobile blogging on iPhone for BlogSpot

I realized a bunch of people dont know how to setup mobile blogging (MMS/SMS) for the iPhone.  So here is a short step by step.

Prequisites: iPhone must be updated to OS 3.1, use iTunes to make sure you have your phone completely updated.

Step 1: Go to http://www.blogger.com/mobile-start.g and follow the instructions for setting up MMS.  You DO NOT need to follow the instructions for setting up SMS.

Step 2: Once you have setup your mobile MMS account for blogger, and linked it to your blog, go to your iPhone's 'Settings' app.


Sep 30, 2009

Speeding up LINQ .Contains Queries with an Extension Method

Ive been working on some reporting forms for the company i work for.  Ive been using LINQ to filter the data, and ran in to some, well actually ALOT of slowdown when trying to filter a bunch of Int32.  The query typically looked something like ths:
var someHugeListOfIds = myData.Pages
.Select(p=>p.ParentSessionId);

var someSessions = myData.Sessions
.Where(s=>someHugeListOfIds.Contains(s.Id));

foreach(var session in someSessions)
DoSomething(someSession)

Sep 25, 2009

Questions

I often do my best thinking while driving. Life, programmming, dinner are all fair game. I answer all my questions except for one: was that light green or red?a

Must Have: Free Waze App Turns GPS Navigation Into a Social Cellphone Game

http://gizmodo.com/5367212/free-waze-app-turns-gps-navigation-into-a-social-cellphone-game

Sep 13, 2009

Great 912 Videos

Im stealing this one, but you can watch the rest over at moderateinthemiddle