Friday, September 23, 2005
Looks like Austin dodged the Rita bullet
So after the line of people waiting to get into Cosco in Austin to stockpile food and supplies, and the inability to find water in the shops, seems like Rita took a steep right turn and will now miss us almost entirely. Even though Rita has been downgraded it will still be pretty bad when it makes landfall, but hopefully the worst of it has been averted this time.
On a related note, a timely news item today on CNN says the string of intense storms is part of normal cycle and isn't due to global warming.
All I know is, when my car lease is up, I'm getting something that has decent gas mileage.
On a related note, a timely news item today on CNN says the string of intense storms is part of normal cycle and isn't due to global warming.
All I know is, when my car lease is up, I'm getting something that has decent gas mileage.
Wednesday, September 21, 2005
When Global Warming costs too much
Less than a month after Katrina wiped out New Orleans and ravaged the lives of hundreds of thousands, Texas is now looking down the barrel of one of the strongest hurricans in recorded history - the currently Category 5 hurricane Rita. Indeed, Rita is quite personal for me, as it is due to go straight over my home town of Austin, Texas. We're just praying the wind and rain will have died back a little by the time it reaches us.
While many were shocked to see gas go up over $5 a gallon in places in the immediate aftermath of Katrina, that is nothing to what a direct hit on the refinery network along the Texas coast from Corpus Christi through to Port Arthur would do. It could well hit $5-$6 and stay there for months. The cost to the US economy will be staggering.
Its interesting to think back to 2001, when Bush rejected the Kyoto protocol stating "I will not accept a plan that will harm our economy and hurt our workers". After Bush requested $200bn in Federal money to help in the aftermath of Katrina, we are now facing perhaps that much again (or more) following Rita. Then there is the indirect cost to business and to individuals both at the pump and indirectly through the increased cost of shipping goods to your neighborhood Wal-Mart and points in between.
Of course, Kyoto was a little bit brain dead (trading of carbon credits? huh?), but after two huge hurricanes (at a potential cost of over $400bn in one month), the terrible flooding we have seen in China and Europe, and the terrible mudslides in Venezuela to name just a few, you have to wonder where it will end.
Part of the argument against signing is that it makes no sense if China and India aren't part of any reduction. An Indian friend told me that the counter argument is "You [The West] got where you are today by going on a 50 year pollution spree ... now its our turn".
Which leads me to wonder — if the weather is to become increasingly erratic, or heaven forbid, melting ice caps disrupt the Global Conveyor , just what kind of world will the Chinese and Indians be inheriting in 50 years?
While many were shocked to see gas go up over $5 a gallon in places in the immediate aftermath of Katrina, that is nothing to what a direct hit on the refinery network along the Texas coast from Corpus Christi through to Port Arthur would do. It could well hit $5-$6 and stay there for months. The cost to the US economy will be staggering.
Its interesting to think back to 2001, when Bush rejected the Kyoto protocol stating "I will not accept a plan that will harm our economy and hurt our workers". After Bush requested $200bn in Federal money to help in the aftermath of Katrina, we are now facing perhaps that much again (or more) following Rita. Then there is the indirect cost to business and to individuals both at the pump and indirectly through the increased cost of shipping goods to your neighborhood Wal-Mart and points in between.
Of course, Kyoto was a little bit brain dead (trading of carbon credits? huh?), but after two huge hurricanes (at a potential cost of over $400bn in one month), the terrible flooding we have seen in China and Europe, and the terrible mudslides in Venezuela to name just a few, you have to wonder where it will end.
Part of the argument against signing is that it makes no sense if China and India aren't part of any reduction. An Indian friend told me that the counter argument is "You [The West] got where you are today by going on a 50 year pollution spree ... now its our turn".
Which leads me to wonder — if the weather is to become increasingly erratic, or heaven forbid, melting ice caps disrupt the Global Conveyor , just what kind of world will the Chinese and Indians be inheriting in 50 years?
Friday, September 16, 2005
One of the coolest things about the PDC is that you get to hang out with really smart people. In this vein I got to give my feedback on C# 3.0 directly to Anders Hejlsberg, the inventor of the language.
On the order I fed them back, my top 3 things were:
On the order I fed them back, my top 3 things were:
- The => "lambda operator" doesn't feel like a C# construct
I find the => syntax a little clumsy and it doesn't feel like a C# way of doing things.
For those that haven't looked at LINQ or C# 3.0, the syntax looks like this:c => c.Name == "London"
Thecname defines a reference to a name provided earlier in the composite expression.
Consider now theforeachkeyword. When implementing a loop over an object Microsoft could have just overload theforkeyword, say like this:for( string s / myStrings ) { ...
(the "/" hear read as "over", as the variable s is enumerated over the collection)
Instead MS chose to use a separateforeachkeyword in the form:foreach( string s in myStrings ). It just feels to me like => should be a keyword instead.
I raised this with Anders. His comment was "yes, we considered that, but what is that keyword?". I thought it should be "in". Anders response was that it is sometimes "in", but sometimes "over" and sometimes something else. This is because lambda expressions might be used in LINQ in a Select() or a Where() or a GroupBy() or an OrderBy() but the way you would describe => would vary in each, because sometimes you are describing the collection, sometimes picking fields, sometimes defining a filter and so on.
I admitted defeat on this one. - I don't like the
thisexpression in Extension Method syntaxAnother feature of C# 3.0 is extension methods, which allow you to define an instance method on a type outside of that type. Think about extending System.String to add a MixedCase() method, or extending System.Int32 to add a Factorial() method.
The current syntax looks like this:public static class MyExtensions{public static string MixedCase( this string source ){return ...}}
Notice thethiskeyword on the method argument. This tells the compiler to treat this method like it extends the string type, and to pass in the string's instance variable as a parameter here calledsource.
In code I might call this method like this:string foo = "Hello World";Console.WriteLine( foo.MixedCase() );
My objections to this are twofold:- The number of parameters on the method is different between the method declaration and the method call, because the compiler implicitly passes the object's instance pointer before the first true parameter. This just doesn't feel right to me.
- Because it extends method syntax (being inside the method's parentheses) this mechanism will not work for properties.
public static class MyExtensions{public static string MixedCase() on string source{return ...}}
Now we've more clearly called that this the method is implemented "on" another type ("on string" in this case). We might also put an "as" keyword to make it read better "on string as source".
Better yet, you can imagine now turning this method into a property:public static class MyExtensions{public static string MixedCase on string source{get { return ... }}}
Anders saw where I was coming from but said there are still quite a few other constraints they have to work through and my solution still has the same constraints as their current implementation (which is obviously true). - I would like support for XSD-like "choice" behavior in Generics
C# 3.0's LINQ system and lambda expressions originated in a number of different initiatives. The two main parents are ObjectSpaces (which moved into WinFS then got superceced by LINQ) and the second is Cw (pronounced like "See Omega"). Cw was an interesting language because it introduced a lot of XSD schema functionality into the C# language, in particular the idea of facets (constraints) and support of "choice".
Facets provide a way to declarative implement business rules such as "There must be exactly two addresses" or "Age must be between 16 and 70". I don't really lament the loss of facet support in C# 3.0 because that code is fairly easy to write, and more importantly is easy to read.
Choice is a different matter. Using "choice" in XSD allows you to constrain a type, e.g. to say that an object called Lunch must refer to either Pasta or Burrito or Lasagna but nothing else. In generics today you could say that all the types you want to chose between share some base class (say, "Food"). Consider though an Italian restaurant that wants its options to just be "Pasta" or "Lasagna" and not accept "Burrito". To write code to ensure this is quite annoying, as XSD doesn't require the types to even share a common base. In C# that means you're back to using ArrayList and doing type checks and casting, and generics doesn't buy you anything.
The proposal I made to Anders was to allow for something like this:List<Pasta or Lasagna>
That is to say that the generic T in the definition of Listcould reference on of several types. The expanded code could then provide explicit case operators that allowed you to get at a particular type, or else you write code like this: var myList = new List<Pasta or Lasagna>();myList.Add( new Pasta() );Pasta p = myList[0] as Pasta; // p gets the valueLasagna l = myList[0] as Lasagna; // l will be null
Anders thought this was a nice idea, but I don't see it happening in C# 3.0.
Wednesday, September 14, 2005
This week I'm at the Microsoft Professional Developers Conference in Los Angeles.
The bulk of what is being talked about is obviously Windows Vista. Vista is Microsoft's most blatant attempt yet to catch up with MacOS X'S Aqua user interface.
Vista includes A host of features to get them to parity with Tiger features such as Spotlight, Exposé, widgets, and the underlying Quartz Extreme technology for using the video card GPU to provide a much richer gui.
Windows Vista is a big yawn for me. Sorry MS.
In fact the most interesting thing I've seen is something called Language INdependent Query, or LINQ. LINQ takes Microsoft's work on XQuery, and a Microsoft Research project called C Omega, and blends them to allow embedded database queries directly in your C# or VB.NET code.
LINQ is cool because it lets you work with and combine not just SQL Server data, but also XML and any .NET object that implements IEnumerable, so you could use a join to request customers from a table by pulling ids from a string array.
Not just that, but the queries are composible. If you do a "select" query and get back a result, you can then write another query against that result. And all with Intellisense in Visual Studio. Impressive.
The frustration is this feature will not go live until .NET "Orcas", the next version after .NET 2.0 "Whidbey" ... so 2008 if we're lucky.
The saving grace is that MS has a tech preview that lets you play with LINQ on Whidbey... Still need to check the rules on putting thing live with that code. Hmm...
Nearly forgot ... I'm writing this on a iMate Jasjar, aka. the HTC Universal, a Pocket PC-based phone running Windows Mobile 2005 that has a tablet PC style keyboard and hinged screen. Pretty neat, if a little bulky. Better still, while the devices retail for $1200 or so, the first 1000 folks to order one at PDC got them for $149! I've seen very few folks using them, so I wouldn't be surprised if 980 or so of them are already on eBay :-O
The bulk of what is being talked about is obviously Windows Vista. Vista is Microsoft's most blatant attempt yet to catch up with MacOS X'S Aqua user interface.
Vista includes A host of features to get them to parity with Tiger features such as Spotlight, Exposé, widgets, and the underlying Quartz Extreme technology for using the video card GPU to provide a much richer gui.
Windows Vista is a big yawn for me. Sorry MS.
In fact the most interesting thing I've seen is something called Language INdependent Query, or LINQ. LINQ takes Microsoft's work on XQuery, and a Microsoft Research project called C Omega, and blends them to allow embedded database queries directly in your C# or VB.NET code.
LINQ is cool because it lets you work with and combine not just SQL Server data, but also XML and any .NET object that implements IEnumerable, so you could use a join to request customers from a table by pulling ids from a string array.
Not just that, but the queries are composible. If you do a "select" query and get back a result, you can then write another query against that result. And all with Intellisense in Visual Studio. Impressive.
The frustration is this feature will not go live until .NET "Orcas", the next version after .NET 2.0 "Whidbey" ... so 2008 if we're lucky.
The saving grace is that MS has a tech preview that lets you play with LINQ on Whidbey... Still need to check the rules on putting thing live with that code. Hmm...
Nearly forgot ... I'm writing this on a iMate Jasjar, aka. the HTC Universal, a Pocket PC-based phone running Windows Mobile 2005 that has a tablet PC style keyboard and hinged screen. Pretty neat, if a little bulky. Better still, while the devices retail for $1200 or so, the first 1000 folks to order one at PDC got them for $149! I've seen very few folks using them, so I wouldn't be surprised if 980 or so of them are already on eBay :-OWednesday, September 07, 2005
Clinton / Obama in '08, anyone?
I found it interesting to see pictures of Barack Obama hanging out with Bill and Hillary Clinton in Houston this week. I'm under no illusions about Hillary's aspirations but I can't say I like her very much. In that respect Obama is an ideal choice for VP, as he has a popular appeal but isn't known well enough to hold the ticket by himself. Plus he's not been on the main stage long enough for folks to know what he is truly capable of.
This ticket would provide strength in both the women's vote, the black vote, as well as those that respect the two individuals.
So, how will the Republicans respond? Being the more conservative party, I don't think they're ready to put the first woman President in the White House, but I wouldn't be surprised if they picked Condi Rice for VP to neutralize the women/black advantage the Democrats would be carrying. As for the Presidential ticket ... Probably McCain. I don't think Bill Frist will win over the Evangelicals after he u-turned on stem cell research. There's also Rudy Guliani, but I've always thought he was a bit of a snake. Then there's Jeb Bush, but I don't see us putting another Bush in the White House anytime soon. Just ask anyone who lost a family member in Iraq, or anyone from New Orleans.
This ticket would provide strength in both the women's vote, the black vote, as well as those that respect the two individuals.
So, how will the Republicans respond? Being the more conservative party, I don't think they're ready to put the first woman President in the White House, but I wouldn't be surprised if they picked Condi Rice for VP to neutralize the women/black advantage the Democrats would be carrying. As for the Presidential ticket ... Probably McCain. I don't think Bill Frist will win over the Evangelicals after he u-turned on stem cell research. There's also Rudy Guliani, but I've always thought he was a bit of a snake. Then there's Jeb Bush, but I don't see us putting another Bush in the White House anytime soon. Just ask anyone who lost a family member in Iraq, or anyone from New Orleans.



