The World According to Nick
My take on Software, Technology, Politics, and anything else I feel like talking about.
Wednesday, March 31, 2004

Thats a SIDE Effect? 

I was watching TV last night and saw a commercial for Ambien... a perscription sleep aid. Now I've seen the commercial before, and I've noticed this little detail before... but I figured that since I now have a blog I'd post about it. During any perscription commercial they very quickly list the meriad of awful things that can happen to you as side effects if you take the drug. For Ambien... the very first side effect that they mention is drowsiness. Now forgive my ignorance... but isn't drowsiness supposed to be one of the primary effects? After all, what's the point of a sleep aid if it doesn't make you... well... sleepy? I suppose sometime soon the great people at Sanofi-Synthelabo (the maker of Ambien) will come up with a non-drowsy version... to help you get through your day. I wonder what will be in it.

Tuesday, March 30, 2004

C# FAQ: Object.Equals vs. operator == 

When should I use == and when should I use Equals? I actually didn't know this little tidbit... and my first reaction on reading about it was Ewwwwww... Here is the relevant portion:

The main difference between the two is polymorphism. Operators are overloaded, not overridden, which means that unless the compiler knows to call the more specific version, it'll just call the identity version. To illustrate that, here's an example:

using System;

public class Test
{
   static void Main()
   {
      // Create two equal but distinct strings
      string a = new string(new char[] {'h', 'e', 'l', 'l', 'o'});
      string b = new string(new char[] {'h', 'e', 'l', 'l', 'o'});

      Console.WriteLine (a==b);
      Console.WriteLine (a.Equals(b));

      // Now let's see what happens with the same tests but
      // with variables of type object
      object c = a;
      object d = b;

      Console.WriteLine (c==d);
      Console.WriteLine (c.Equals(d));
   }
}

The results are:

True
True
False
True

The third line is False because the compiler can only call the non-overloaded version of == as it doesn't know that the contents of c and d are both string references. As they are references to different strings, the identity operator returns false.


One more time... just for effect... Ewwwwww.

Wednesday, March 24, 2004

Writing Around the Garbage Collector 

Or Teaching an old dog new tricks: GC fun in Whidbey. A blog by Brad Abrams on some new features added to the Whidbey release of Visual Studio .NET (and the .NET framework) to workaround issues that non-deterministic finalization causes with regards to unmanaged memory. Basically they've added two new features:

  1. GC.AddMemoryPressure. This function lets the GC know the true cost of a managed object when you have written a small wrapper around unmanaged memory that could be possibly large. This allows the GC to collect sooner then it might normally.
  2. HandleCollector class. This is a class that allows you to inform the GC of a limited number of objects available (database connections, handles, etc.) so that it can cause a collection to occur when these resources may be running low.

Of course both of these solutions are hacks, and what they need instead is Deterministic Finalization... but we've been over that before.

Monday, March 22, 2004

The Outsourcing Bogeyman 

Here is a very long article by Daniel Drezner on the The Outsourcing Bogeyman. It is an extremely well thought out and well written article on the myth that outsourcing is taking away American jobs. What's more, he cites very credible evidence and gives very well thought out explanations on the common perceptions (or mis-perceptions as it were) about outsourcing. I'd provide highlights, but the article is so well thought out, its hard to take tidbits out and do them justice standing on their own out of context.

One thing that is not mentioned in this article is how he thinks the importation of workers into the United States affects the economy. This is especially noteworthy in the software sector where I believe there is a large influx of people from countries like India on the H1B Visa program, not to mention jobs taken by illegal immigrants. That would be a very interesting article topic indeed I think.

Either way, read the whole thing. Its well worth it.

More Helpful Messages from MSN Messenger 

Today I tried logging into to MSN Messenger from work only to receive the following message (emphasis added):

You cannot use Messenger at this time because your contact list is not availalbe. Please try again later.
Click Help to learn more about your contact list 0x81000378.

Apparently they don't use spell check at Microsoft. Either way the message was useless... and had nothing to do with the actual problem which was the fact that they updated MSN Messenger due to a security bug... and didn't really post anything about it anywhere. I went to MSN and downloaded a new copy of the client (even though they didn't have anything that said... oh... I don't know... NEW version needed to connect!) I installed it and was back up and running again.

How hard could it be to have intelligent error messages?

One More Reason to Interview at Microsoft 

You become an instant sex magnet? Strange but true.

Sunday, March 21, 2004

E-mail and Snail Mail Unite 

An article on BBC News shows how E-mail and snail mail united are bringing mail to inaccessable areas of India.

Post offices in the northern state of Himachal Pradesh will take a customer's handwritten letter and computer scan it. Then the letter can be e-mailed to remote, high-altitude post-offices in this Himalayan region.

From there, the e-mails are printed out and then taken by hand to their destinations - many of which are located in almost inaccessible mountain areas such as the Lahaul, Spiti, Kinnaur and Pangi valleys.

This isn't exactly a new idea though... the US Army used a similar concept during WWII. Letters sent to service men were actually miniaturized and placed on micro-fiche. Then the smaller more compact letters were sent over seas and printed out for the service men. Doing this actually cut the weight of mail down signifcantly.

UPDATE: Chris Sells caught this story as well and has suggested a new service for the USPS that he would be willing to pay for... and frankly so might I. Filter out all my junk mail for me, and then take the good stuff, scan it, and email it to me. Sounds like a winner!

Friday, March 19, 2004

Can Blogging Ruin Your Life? 

Blogging Off by Whitney Pastorek... apparently it can, if you don't blog. Very funny. If anyone starts seeing these things happen to me... feel free to slap me the next time you see me.

Congress to Test Air Screening Program 

Congress to Test Air Screening Program... I wonder if it will clasify my mom as yellow.

The Transportation Security Administration said Wednesday it will order airlines to turn over passengers' personal records in the next couple of months to test a computerized passenger screening program that could keep dangerous people off airlines.
...
The Computer-Assisted Passenger Prescreening System, or CAPPS II, would rank all air passengers according to the likelihood of their being terrorists. But some say the project would violate privacy rights, while others are concerned it would cost the private sector too much money.
...
Suspected terrorists and violent criminals would be designated as red and forbidden to fly. Passengers who raise questions would be classified as yellow and would receive extra security screening. The vast majority would be designated green and allowed through routine screening.

I find this very interesting since I recently took my mother to the airport for a trip to California. While checking in, the majority of passengers had their bags put on the conveyor belt and they went about their way. But when my mom's bag was put on, the belt suddenly stopped and the lady behind the counter started typing away on her console. Then she said, "You're all ready to go, just take your bag over there"... and she directed us to the special detection equipment they've setup for suspicious bags. My 65 year old mother had apparently been mistaken for a terrorist. With security precautions like those, I'm sure we're all in great hands.

Anti-Piracy Vigilantes Strike 

Anti-Piracy Vigilantes Track File Sharers.

A pair of coders nurturing a deep antipathy for software pirates set off a controversy Thursday when they went public with a months-old experiment to trick file sharers into running a Trojan horse program that chastises users and reports back to a central server.

As of Thursday, the crime-busting duo's server had logged over 12,000 victims of "Walk the Plank," and a sequel they call "Dust Bunny," since the cyber sting secretly launched in January. The programs have circulated disguised as activation key generators and cracks for Unreal Tournament 2004, Pinnacle Studio 9, Norton Antivirus, TurboTax, and as a copy of the leaked Microsoft source code -- all titles chosen for their popularity on peer-to-peer networks. When executed, a large message appears scolding, "Bad Pirate!"

Apparently some people at the Electronic Freedom Foundation think this might actually be illegal... and they might be right. After all, two wrongs don't make a right... but it is kind of funny. Any time you download something over the net, you are taking a risk. If nothing else, the website they've setup to track the program is kind of funny.

Wednesday, March 17, 2004

It Was All About the Oil... for the French 

The French Was For Oil from the New York Post.

In documents I obtained during an investigation of the French relationship to Saddam Hussein, the French interest in maintaining Saddam Hussein in power was spelled out in excruciating detail. The price tag: close to $100 billion. That was what French oil companies stood to profit in the first seven years of their exclusive oil arrangements - had Saddam remained in power.
...
Almost as soon as the guns went silent after the first Gulf war in 1991, French oil giants Total SA and Elf Aquitaine - who have now merged and expanded to become TotalFinaElf - sought a competitive advantage over their rivals in Iraq by negotiating exclusive production-sharing contracts with Saddam's regime that were intended to give them a stranglehold on Iraq's future oil production for decades to come.

Its never as black and white as people want it to be.

The Programmer's Secret Handshake 

Zero or One based collection? Eric Gunnerson from Microsoft has been a blogging machine lately... and covers a question someone recently asked which is why in today's modern programming world do we still have 0 based instead of 1 based arrays... after all, when humans start counting, we start at 1... not 0.

Understanding how zero-based indexing works is the secret handshake of the programming world. We all started not knowing the secret handshake, but over time we learned and even began to like the secret handshake, and now we don't know any other way to shake hands.

Or as one of my professors in college used to say... 0 is a perfectly good number... so why not use it?

Tuesday, March 16, 2004

If Kerry was Misquoted... Why Didn't He Just Say So? 

If Kerry was Misquoted... Why Didn't He Just Say So? This is of course related to Kerry's latest political gaffe where he said during a town hall meeting that foreign leaders have told him that they hope he wins. The Boston Globe reporter how quoted him is now saying he mis-transcribed... and that Kerry never said "foreign"... but if thats true... then why didn't Kerry make that assertion? Why didn't he say - Hey! I was misquoted?

Blogosphere 1, New York Times 0 

Blogosphere 1, New York Times 0. If you haven't been following this Blogosphere controversery... its a very cool David and Goliath story. Robert Cox over at The National Debate had maintained a New York Times Editorial Correction Page in an effort to correct blatently false information given in editorials, that as part of policy, the Times does not post corrections on.

The Times does not welcome information about errors that call for correction in columns written by Times' Op-Ed columnists. Since The New York Times refuses to hold their columnists to any standard of accuracy, The National Debate has taken upon itself to offer this Supplemental Corrections Page for New York Times readers. Messages may be posted on The National Debate web site by click on the (Comment) link at the end of each correction. If you have information about an error that appeared in a column written by a columnist of The Times please send an email to nytcorrections@thenationaldebate.com


The page is maintained in the same format as the New York Times website, and is meant to act as a paradoy. Well the Times didn't like this and sent Mr. Cox and his ISP a letter threatening them under the DMCA (Digital Multimedia Copyright Act). After temporarily taking down the parody, and then after a copyright lawyer volunteered his services and helped him fight back, the Times has withdrawn its complaint... how nice of them.

You'd think that an organization that depends so heavily on the First Ammendment would not be so quick to quelch it.

Monday, March 15, 2004

The Dangers of DHMO... Makes City Officials Look Like Morons 

City falls victim to Internet hoax, considers banning items made with water. I remember this joke going around when I was in high school chemistry. You can read more about the scurge of DHMO from DHMO.org. Here is a fact sheet on DHMO that looks very similar to the one I remember in high school. Some of the more serious dangers of DHMO are:

  • contributes to the "greenhouse effect."
  • may cause severe burns.
  • contributes to the erosion of our natural landscape.
  • accelerates corrosion and rusting of many metals.
  • may cause electrical failures and decreased effectiveness of automobile brakes.
  • has been found in excised tumors of terminal cancer patients.
  • causes severe tissue damage in its solid form.


DHMO can be found in many locations:

  • as an industrial solvent and coolant.
  • in nuclear power plants.
  • in the production of styrofoam.
  • as a fire retardant.
  • in many forms of cruel animal research.
  • in the distribution of pesticides. Even after washing, produce remains contaminated by this chemical.
  • as an additive in certain "junk-foods" and other food products.
  • as a performance enhancing substance used by atheletes.


STOP DHMO!

Friday, March 12, 2004

You Are Here 

A picture of the Mars rover Spirit looking back on Earth. What were we arguing about again?

Thursday, March 11, 2004

More Data Structure Goodness 

Scott Mitchell is back on MSDN with Part 5 of the Extensive Examination of Data Structures. In this latest installment he covers Graphs, which are really a more general form of a tree.

In this fifth installment of the article series we're going to examine graphs. Graphs are composed of a set of nodes and edges, just like trees, but with graphs there are no rules for the connections between nodes. With graphs, there is no concept of a root node, nor is there a concept of parents and children. Rather, a graph is a collection of interconnected nodes.


Great article... and worth the time to read.

Wednesday, March 10, 2004

Debugging the Debugger 

You read that right... The VS7.X Debugger doesn't work, What can I do? This is a blog entry by one of the Microsoft VS.NET QA (that's Quality Assurance for those of you who don't know) guys. He has a whole slew of of messages that you may encounter while attempting to debug either a Windows Forms, or ASP.NET project... and what it means... and what you can do to resolve the problem.

Tuesday, March 09, 2004

LiteScribe 

Not Lite Brite... LiteScribe... a new technology from HP that will allow you to Simplify DVD Labeling by burning your label using the same laser that burns the data.

After burning your data, just flip the disc over and the laser will burn a label onto a special coating. The disc will cost only a few cents more than the average burnable disc... and the drive itself is only about $10 more expensive. Looks cool.

Programming in the Blue 

Programming in the Blue is a blog post by Matt Warren from the Microsoft C# team... I have a feeling that this was a late night post made while hyped up on caffine and low on sleep. He talks about the difficulting in changing a language after its initial release... and then has an "epiphany" at the end and arrives at a "solution". Very funny... that is if he's kidding. Kinda strange if he's not.

Monday, March 08, 2004

Not a Cow... But a Comet? 

Did a Comet Trigger The Great Chicago Fire?

Perhaps it was not Mrs. O'Leary's cow kicking over a lantern that sparked the Great Chicago Fire of 1871, which destroyed the downtown area and claimed 300 lives.

New research lends credence to an alternative explanation: The fire, along with less-publicized and even more deadly blazes the same night in upstate Wisconsin and Michigan, was the result of a comet fragment crashing into Earth's atmosphere.

Intellectual Diversity 

Here is an article from the Duke Conservative Union on the issues that school is having with Intellectual Diversity there.

Much to the dismay of the Duke administration, the DCU has provoked its ritual annual contretemps, this time by publishing an advertisement revealing that registered Democrats outnumber Republicans by a whopping 142-to-8 margin among university deans as well as faculty members of eight liberal arts departments. The numbers apparently startled some alumni-donors, which provoked President Keohane to publish a soothing article declaring that the near monopoly Democrats enjoy in the humanities, of course, in no way implies any insincerity regarding her oft-stated commitment to intellectual diversity.
...
Unlike Professors Thompson and Quilligan, VP Burness acknowledged the predominance of liberals in the surveyed departments, which he explained by citing the need for “creativity” and “innovation” in the humanities, qualities that are apparently in short supply among conservatives. Philosophy Department Chairman Robert Brandon voiced a similar explanation, although in less diplomatic terms: “If, as John Stuart Mill said, stupid people are generally conservative, Editorial then there are lots of conservatives we will never hire. Mill’s analysis may go some way towards explaining the power of the Republican party in our society and the relative scarcity of Republicans in academia. Players in the NBA tend to be taller than average. There is a good reason for this. Members of academia tend to be a bit smarter than average. There is a good reason for this too.”
...
The ultimate irony is that by uttering such inane comments and thereby turning himself into a national laughingstock, Professor Brandon undermined his essential point that academics are smart. Thus, he cleverly managed to disprove his own argument merely by stating it. In fact, the entire argument, coming from a hiring committee member, that few conservatives get hired not due to any bias in the hiring process, but rather because many conservatives are stupid, also serves to refute itself. Professor Brandon apparently does not realize the difficulty of agreeing with a person who doesn’t even agree with himself.


Here is more on this controversy from Instapundit. Of course, this is really just the tip of the iceberg as Duke is not the only place where this is a problem.

C# Frequently Asked Questions 

Have a question or complaint about something in C#... or lacking in C#? Then take a look at the C# Frequently Asked Questions. This is a new blog from MSDN where they will answer questions from people on the language. They've already answered some good questions relating to the language architecture. To ask a question, simply reply to the first post in the blog.

I've already asked a question there about const reference parameters... so click and fire away!

Thursday, March 04, 2004

Don't Like John Kerry? Wait a Week. 

A great opinion piece on Slate... John Kerry's Waffles - If you don't like the Democratic nominee's views, just wait a week.

Kerry did vote for the Patriot Act, the No Child Left Behind Act, and the war in Iraq, even though he constantly trashes the Patriot Act, the No Child Left Behind Act, and the war in Iraq. He voted against the Defense of Marriage Act, which limited marriage to a man and a woman, but he now says marriage should be limited to a man and a woman. (Although he also points out that he once attended a gay wedding.) And those are just the better-known issues on which Kerry has "evolved."

It even comes with a handy reference guide in the form of a table at the end showing some of his more substantial reversals. The most important question is this. Which of the his views are we going to get? Are we going to get what he voted and campaigned on as a Senator... or what he says now? And what guarantee do we have that those views won't "devolve" to where they were as soon as the election is over?

Bring Out Your Code! 

Judge orders SCO, IBM to produce disputed code.

In her ruling, the judge wrote that SCO hasn't produced enough proof to back up its allegations that IBM moved proprietary Unix software to new Linux systems. SCO Group filed its $1 billion lawsuit against Big Blue nearly one year ago, on March 6, 2003.
...
The judge's ruling included these key statements:

  • As previously ordered, SCO is to provide and identify all specific lines of code IBM is alleged to have contribute to Linux from either AIX or Dynix. This is to include all lines of code that SCO can identify at this time.
  • SCO is to provide and identify all specific lines of code from Unix System V from which IBM's contributions from AIX or Dynix are alleged to be derived.
  • SCO is to provide and identify with specificity all lines of code in Linux that it claims rights to.
  • SCO is to provide and identify with specificity the lines of code that SCO that SCO distribute to other parties. This is to include where applicable the conditions of release, to whom the code was released, and the date and under what circusmstances such code was released.

IBM is to "provide the releases of AIX and Dynix, consisting of 'about 232 products,'" and SCO is then required to "provide additional memoranda to the court indicating if and how these files support its position and how they are relevant."


Not that I'm following this case very closely... cause I could really care less. I just find it rather amusing. Knowing how code is written... and how that code probably looks (ugly as sin more than likely)... if you can find a judge/jury that will be able to understand and recognize similarities, then I take my hat off to you.

Wednesday, March 03, 2004

Kerry Not Representing Anyone 

Here is an article from the Boston Herald on Kerry being AWOL from the Senate:

Presidential hopeful John F. Kerry has been a virtual no-show in the U.S. Senate over the past 14 months, but he hasn't missed a paycheck, even though a dusty federal law says some of his $158,000 salary should have been withheld.

During his run for the presidency, Kerry has missed every one of the 22 roll call votes in the Senate this year and was absent for 292, or 64 percent of the roll call votes last year, according to a Herald review of Senate records.

That means the Massachusetts senator has been away from his post in the Senate chamber for at least 128 days over the past 14 months.
...
Section 39 of the United States Code Service requires the Secretary of the Senate and the Chief Administrative Officer of the House to deduct daily pay from members for each day they are absent.

The only legal excuse is if the senator or representative, or one of their family members, is ill, the law states.


But do you think that Kerry (one of the wealthiest members of the Senate) will actually cut a check to the US Treasury? I doubt it. More importantly is the fact that the people of his state are not being represented. What kind of President would he be based on the fact that he is not even representing the people of his state, which he took an oath to do? At least Bob Dole resigned from the Senate when he ran in 1996 so that the Governer of Kansas could appoint a new Senator to represent the people of that state. Kerry should do the right thing and resign... but he's probably too afraid he'd lose and then be out of a job all together.

Tuesday, March 02, 2004

Is a Property a Field or Function? 

I've been reading a book called The Elegant Universe lately... talking about fun things like String Theory, Hidden Dimensions, Theory of Everything... etc. You know light reading. One of the things being discussed in the book right now is the dual nature of light. The fact that it acts as both a wave and a particle. What does this have to do with properties in .NET you ask? Like light, properties are a funky little thing. They're syntacticly like a field. But their underlying implementation is a pair of functions. In essense, a property is a field where the programmer is allowed to do extra type checking, and validation... abstracting away those details so the consumer of the property doesn't even need to know thats happening. A programmer could even create a property called Age, but never store the age in the object. Instead, he might track the birth date, and return the age each time by doing substraction with the current date. You as the property consumer don't need to know. So should we even be aware that properties are actually a pair of get_ and set_ functions under the hood? Take the following example:

class MyClass
{
   public int MyProperty
   {
      get { /* ... */ }
      set { /* ... */ }
   }

   public int MyField;

   public void MyMethod( ref int n )
   { /* Do something with n */ }

   public void MyTest()
   {
      MyMethod( ref MyField ); // Works fine
      MyMethod( ref MyProperty ); // Uh oh!
   }
}

If properties were really properly abstracted, you should be able to pass it as ref parameter to a method. But you can't. You will get a nice little compiler error saying "A property or indexer may not be passed as an out or ref parameter". Instead you'd have to implement MyTest like this:

public void MyTest()
{
   MyMethod( ref MyField ); // Still fine
   int temp = 0;
   MyMethod( ref temp );
   MyProperty = temp;
}

Wouldn't it be nice if the C# compiler would generate that extra boilerplate code in MSIL for you... thus keeping the abstraction... and never really revealing the fact that a property is really a pair of methods? Just a thought. Of couse if you know that a property is really two methods... you can take advantage of it if you want.

How Fast is Fast Enough? 

How fast does Avalon need to be? For anyone looking at the new drawing subsystem (code named Avalon) in the next generation of Windows (code named Longhorn) this is an interesting blog by one of the architects. Along with general goals they have in mind for Avalon... he also talks about generic usability guidelines for speed in software:

An interesting guiding article comes from the useit site. Jacob Nielsen defines 3 important limits for systems of all kinds:

  • Anything between 0-.1 seconds is fast enough for users not to be distracted from their task.
  • Between .1-1 second is tolerable, with sufficient feedback. However, users’ attention may wander away from their task.
  • Between 1-10 seconds, users’ attention is distracted from the task. Users might not wait for the download, and cancel out.

A collection from various usability engineers:

  • Faster is always better
  • Consistent response times are better than inconsistent ones
  • Speed affects not just the perception of performance, but also the perception of the resulting content. For Avalon this means eye candy needs to be balanced with proper speed. [Ramsay, J., Barbesi, A., and Preece, J. (1998) A Psychological Investigation of Long Retrieval Times on the World Wide Web. Interacting with Computers, 10, 77—86]
  • Smoothness of animation and transition are very important
  • And the most basic rule: Be faster than your competition for comparable scenarios


Monday, March 01, 2004

Something of Note with the New Iraqi Constitution 

Iraqis Reach Agreement on Interim Constitution from FoxNews.com:

He also said the charter sets a goal, not a quota, to have at least 25 percent of the national assembly made up of women, adding that council members unanimously approved the document.


The United States Congress isn't even made up of 25% women (right now its about 13.6%)... why on Earth do we think we should force that quota or even goal on Iraqi's? Not that I'm against having female representatives in any way... in fact in the U.S. the statistics show that when women run for office, they are more likely to be voted in when running against a man. The problem is that women don't tend to run for one reason or another. But thats besides the point.

If you have a truly democratic system where the people vote for their representation, how on can you possibly even enforce such a quota/goal? I have a feeling this is more to satisfy all the Politically Correct Enforcement Agents that are here in the U.S. which is a shame. That sort of language doesn't belong in anyone's constitution.

The Passion of The Christ Reviews 

I haven't seen Passion of the Christ yet... and actually I'm not sure if I'm going to (I'll probably wait til the book comes out)... but this is a pretty typical review of the movie from JSOnline.

But it's hard seeing too much too clearly for all the blood. Gibson subverts our presumed familiarity with the biblical material by using a level of violence that is probably intended to make us see old things in a new way, while simultaneously making them almost unwatchable.
...
He is beaten by the temple guards, gleefully flayed by the Romans and left a dead man walking the stations of the cross. A crown of thorns pressed onto his head makes a sickening sound, his arm is pulled out of its socket to fit the rough-hewn cross, a nail driven into his palm drips blood as it passes through the wood. He is sweaty and anxious in Gethsemane and, shortly after he is dragged from the garden, a severe beating swells one of his eyes shut. The other eye remains fiercely fixed on his accusers, even as it sheds a tear for mankind.

But only the eye of the beholder will determine whether all of this is seen as extremely profound or profoundly extreme.


That's strange, my version of the Bible has Jesus dying of laughter from being tickled by feathers and licked by kittens. Do people actually think that being Crucified didn't hurt? That wearing a crown of thorns doesn't cause your scalp to bleed? Have you ever cut any place on your head? Even a small cut causes tons of blood because of the large number of blood vessels in the head. This is actually a very accurate portrayal of a typical crusifiction... which was an extremely long and torturous way to die.

Kerry's Haiti jab 

More hypocracy and two facing from John Kerry in the New York Daily News:

Kerry (D-Mass.) said he would have sent troops to Haiti even without international support to quell the revolt against President Jean-Bertrand Aristide.

"President Kerry would never have allowed that to get where it is," Kerry said, though he added he's not "a big Aristide fan."
...
A Kerry administration would have given the rebels a 48-hour ultimatum to come up with a peaceful agreement - "otherwise, we're coming in," he said.

"I would intervene with the international community, and absent an international force, I'd do it unilaterally," he said, adding the most important thing was to protect democracy.


But of course we should never have gone into Iraq without multilateral agreement from every country in the world and full UN endorsement. Thats just different.

Wrapping Up Properties with Delegates 

Here's a C# tip that came out of some thoughts I had after reading an article on Code Guru on how to create properties and delegates in managed C++ called Why Don't I Get Those Keywords? What's interesting about the syntax for defining properties is that you are actually creating two functions with this general form:

class MyClass
{
// ... Constructor and Stuff
private:
   type MyProperty;
public:
   __property type get_MyProperty()
   {
      return MyProperty;
   }
   __property void set_MyProperty( type value )
   {
      MyProperty = value;
   }
};


Obviously, type should be replaces with int, string, or whatever the type of the property is... and MyProperty is a generic name for whatever you want to call your property.

One of the nice things you can do in .NET, is create a delegate that is basically a type safe function pointer. But can you create a delegate which is a pointer to a property, instead of a method? At first I thought it would be nice if you could have one delegate that would somehow wrap up both the property get and set in one... but that is not possible. But if you can live with having two delegates for a property, then the syntax for doing that in C++ would be relatively straight forward... following this form:

__delegate type MyPropertyGet();
__delegate void MyPropertySet( type value );

MyClass* obj = new MyClass();

MyPropertyGet* myGet = new MyPropertyGet( obj, &MyClass::get_MyProperty );
MyPropertySet* mySet = new MyPropertySet( obj, &MyClass::set_MyProperty );


The problem is when you try to do this in C#. C# has a completely different syntax for defining properties, that makes the above method impossible. So does that mean that you can't do this in C#... nope. It just means you need to use a little reflection to gain access to the underlying get and set functions that do exist under the hood:


public delegate type MyPropertyGet();
public delegate void MyPropertySet( type s );

MyClass obj = new MyClass();

MyPropertyGet getDel = (MyPropertyGet)Delegate.CreateDelegate( typeof(MyPropertyGet), obj, "get_MyProperty" );
MyPropertySet setDel = (MyPropertySet)Delegate.CreateDelegate( typeof(MyPropertySet), obj, "set_MyProperty" );

CodeGuru has a New Look 

CodeGuru has finally decided to update their look. It looks nice, but its still not as functional as other software sites out there. Of course, their search engine still sucks, and all the links I have that point to articles there are broken. So as they move older articles into the new database, I will update the links from previous posts.

Anway, take a look. They still do have a lot of great content.

Rethinking Free Software 

Having gone through the free/open source rocks stage myself... I find this open letter on the Consequences of Writing Free Software very interesting. It was in response to a conversation this gentleman had with a young developer (yes, younger than me) at a software conference.


However, I start to wonder where your benefit is. You are – out of principle – not making any money out of this, because it is open-source and you and your buddies insist that it must be absolutely free. So you are putting all of that time and energy into this project for what? Fame? To found a career? Come on.

If someone installs your work from disc 3 of some Linux distro, they couldn’t care less who you are. The whole fame thing you are telling me only works amongst geeks. The good looking, intelligent girl over there at the bar that you’d really like to talk to doesn’t care much whether you are famous amongst a group of geeks and neither does she even remotely fathom why you’d be famous for that stuff in the first place. I mean – get real here.
...
The whole thing about “free software” is a lie. It’s a dream created and made popular by people who have a keen interest in having cheap software so that they can drive down their own cost and profit more or by people who can easily demand it, because they make their money out of speaking at conferences or write books about how nice it is to have free software.
...
And I sure understand the whole altruistic aspect of this and the idea of helping people to have better lives through free software. There’s a saying that goes: “If you are 20 and you aren’t a communist you have no heart.”, but it continues “if you are 30 and you still are a communist, you lack rationality”.


This of course interests me because I have written plugins for Winamp3 which I put out for free to benefit that particular community... and I'm now working on a skinning program for Winamp Moder Skins, which I plan on selling for money (gasp). My problem comes from the fact that the Winamp community is very into free software rocks... and if you make us pay you are evil. Of course the vast majority of those community members are still in college... and can't afford anything. Wait til they have a real life to support.

Redefining Low and High when it comes to Unemployment 

Its all Relative from Tim Blair's Blog... interesting. Compares how unemployment rates were described during the Clinton era compared to how the exact same numbers are compared during the Bush era.

About Me



Name: Nick
Home: Wauwatosa, WI, United States

I'm a Software Consultant in the Milwaukee area. Among various geeky pursuits, I'm also an amateur triathlete, and enjoy rock climbing. I also like to think I'm a political pundit.


 View My Profile

Archives
 Home Page

Subscribe to this Feed

Search Archives
Personal Links
Carnival of the Badger
The Coding Monkey
del.icio.us Links
Flickr Photos
Blog Critics Reviews





Blogroll Me!

music
books
video
culture
politics
sports
gaming

www.flickr.com
This is a Flickr badge showing public photos from Nick_Schweitzer. Make your own badge here.

Credits

Blogcritics: news and reviews







This page is powered by Blogger. Isn't yours?

Weblog Commenting and Trackback by HaloScan.com

RSS-to-JavaScript.com

Listed on BlogShares

Design By maystar