Friday, February 18, 2005

ASP.NET Visual Studio and Dissapearing events

If you use Visual Studio 2003 to development code behind ASP.NET pages, you have probably stumbled upon a bug, in which the events on some server controls simply disappear. I have talked with Microsoft about this and they have confirmed this to be a bug but don't have a fix for this simply a work around. What's happening is when switching between design and html view the ide changes the contents of the InitializeComponent() function which holds all of the delegates for the events of your controls. This is normal behaviour, the bug comes in when every now and then and for some undetectable reason the entire contents of this function get erased, deleting all of your delegates. Microsoft's work around is to not use the IDE to wire up the events but instead to add the specific code the server controls tag. For example <ASP:TextBox ID=Textbox1 OnClick="MyEventHandler()" RUNAT="Server" > This works, if you are working with noobs to ASP.NET they only live and breath in the IDE and rarely look at the underlying tags and stay in design mode almost exclusively. When these noobs try to figure how or why the click event still fires even though there isn't a delegate, they typically add a delegate causing the event to fire twice. This basically hides functionality. My work around is to simply take the generated code out of initializeComponent() function and move into the OnInit() function, this function does not appear to be touched by the IDE and the code never seems to thrashed. And it makes the delegation code plainly visible to all the noobs out there, who might maintain your code at a later date.

to search or not to search

when is a search not a search? Something that has bothered me and something that I have had to argue for and in favour of is using a vaild search instead of using positioning to. Imagine you have a customer list stored in a file. There are several ways of allowing users to search this customer file, one way is to display the customer file alphabetically and then allow a user to "position to" a record within the list, so for example if I was looking for Smith, I could say position to the "S" records then scroll down until I found the "Smith" record. This is how a lot of database centric systems work by default, xbase does this, dbase, DB2 and so on. The reason is it is an effecient reading mechanism from a hard disk especially if the data is ordered the way you want it on the disk. My big problem is what if there are no "S" records in your list, "position to" always displays the next record, so if I was searching for "Smith" and I said position to "S" and there aren't any records that begin with "S" the program will display all records beginning with "T" providing there are "T" records or "U" if there aren't any "T" records, etc. For example if I ask for "Smith" and there aren't any records for "Smith" however there are some records for "Thompson" being that "T" is alphabetically after "S" a position to, scenario would return "Thompson" records, is it me or would that not be confusing? This is terribly wasteful as far as resources go and not very intuitive to the user using the system, although a user could adapt to this type of system. Its wasteful because I already displayed the first number of records from the list alphabetically however the user wasn't looking for a customer that began with a lower letter (in this case "Smith") . Being a web developer in the corporate world most of the data I would be displaying to a user is stored on back-end legacy systems, most of these systems are fast however their resources are not infinite. So anytime resources could be saved they should be. When a resource is saved whether it is bandwidth or processing time or disk access, you increase the scaling capability of a system.

So if I was writing a web site that could be used to search for a specific customer what would be the best use of the resources? Display a list of 25 customers alphabetically then allow them to do a "position to" and then display what the next 25 records after the position to? This involves 2 full round trips to back end system plus the bandwidth to send two full 25 pages of data to the end user. Noting that the user may still not find the data he or she is looking for. OR would a better use of resources be to display a text box for the user to enter full or partially what they are looking for, so in my example "Smith". Then go to the back end system query for only records that match the word "Smith" and return only those records that match. So if there are three records with the name "Smith" display only those records. If no records exists for "Smith" display nothing to the user to inform the user that "Smith" does not exist?

To me the latter seems far more sensible and for more realistic then the former. Not to mention it works the way you expect it to work. If I asked for "Smith" and got a list of "Thompson"s would that mean there aren't any records for "Smith"? Or would it mean the computer is screwing up and sending me the wrong data? Chances are good joe user will assume the computer is not working properly and try the query again and again. Just imagine if you search Google for Bob and they had no records for Bob so they sent you records on Boobs instead because that was the next record after Bob. I don't think the users would be very happy.

Friday, February 11, 2005

What is going on?

Another news article that is simply mind blowing here. Oracle is going to include .NET support in its upcoming release of 10g, including but not limited to, the ability to write stored procedures in the .NET language of your choice (which of course is c#) . WTF!??. Has a snowball survived in hell? Or is hell really exothermic and frozen over? I do not know. All I know is I never trust my enemies especially when they are offering gifts. Anyone worked with the beta? Is this a token gesture or is this for real?

Thursday, February 10, 2005

Wisky Tango Foxtrot ALERT

I just read this article here and I can't believe my eyes. What the fuck is wrong with the U.S. justice system if shit like this can happen? I'll tell you what? It has been pulled too far to the right, corporations own the U.S. and U.S. policies. What was the war in Iraq? 20 years of planning by right wing econo-nazis. They wanted a tight fist on their oil supply, and they got it, as a bonus they also got lucrative re-building contracts. Is it me or should the country that blows shit up, not be able to make money off of the rebuilding of the shit they blew up? Seems a little like the fox watching the hen house. "Hey, our economy is sucking soo much ass right now, what should we do??", "Let's blow up some shit ass country half way around the world and make them pay us to rebuild them!" "Sounds like a plan to me, let's get on it, it sounds like a win-win situation to me!"

So back to the article. These guys are being sued by a game maker because they have found ways to change the textures that are used in the games. They then exchange these images over the internet with instructions on how to overwrite the existing textures. Techmo says that they are "losing" or "hurting" because of this. So how are they losing or hurting, well let's see; a user buys a copy of the game. (money in techmo's pocket) the user plays the game (techmo isn't making much money off of this). the user gets bored of the game (techmo is very happy, bored users mean, users are willing to buy new games) User finds way of changing the textures in the game to make the scantily clad female volleyball players to appear nude (techmo has a heart attack, how could a user deface such a family oriented game like this?) User is no longer bored, user enjoys playing again, hell maybe even puts a few extra deposits in the spank bank along the way (Techmo is very unhappy, users are no longer bored, so users are less willing to spend money on new game). User shares this with their friends over the internet (Techmo is raging mad, now even more users are enjoying the game that they bought, must begin lawsuit immediately) So as you can see, techmo has absolutely everything to lose here and the user has everything to win, which means the system is not right, we need to oppress the little man and make him bored and unhappy so that he is a good consumer. If you couldn't tell I was being just a little sarcastic. What these users have done is no different then you or I painting our cars after we have bought them or modifying our garage door opener to open a little faster or slower. This lawsuit is ridiculously ludicrous and frivilous. However, the guys may still end up losing because these kinds of lawsuits are not about right or wrong but who has the most amount of money which Techmo surely has plenty. But further why do these even exist? The DMCA or the Digital Millenium Copyright Act is bascially a law that was written with the copywright holders interest in mind only. As a matter of fact it (DMCA) was almost entirely penned by various trade organizations representing major copyright holders like the RIAA and the MPAA. Never was the common man thought, never was there a fight put in for fair use, only token nods to get the bill passed.

Monday, February 07, 2005

The ghosts have battle ready flamingos

Been really digging playing some Ghost Recon lately. I recently pulled out the CD and blew off the dust loaded er up, then applied all kinds of patches and mods, HX5 setting sun in particular. And started playing some modded co-op online. Ghost recon if you're not familiar, is a first person tactical shooter. With the HX5 mod the co-op multi-player is taken to a crazy new level. On some maps you have 85+ tangos and they are deadly accurate and are rushing at you. Woohoo, hit the deck cheek your rifle and start unloading and hope you are accurate with your shots, cause while you're reloading they'll steady up and plant several 7.62 rounds in your skull. Average life span on some these maps is 4 seconds. Crazy amounts of fun.




car payments

Ok so I have a 95 integra that has some extra loving added into it. It is 10 years young. I say that because to look at the car you probably wouldn't guess that it is 10 years old. We have put some extra time into this car and put a better engine in it and changed the colour from black to pearl white. Overall it is a great car, as matter of fact I can't think of any car that can match it as far as price, performace and reliability go, with a whole bunch of practicality thrown in. There may be cars you might like better, or may look better but I assure you there isn't a better all round package then it. Ok that said, I think it is time to replace this car, the interior of the car is terrible and needs some work. The car has 250,000 kms on it, and is going to get to a point where several things are going to need replacement. Things that normally need to be replaced but because of its age there will be many at once. For example, tires, shocks/struts, brakes, altenator. It is structurally sound and can be driven very reliably at red line ( i know I drive it that way every day :)) But the thought of replacing everything and then still having a 10 year old car just doesn't appeal to me.

I talked before in other posts about buying a new car. Aside from the RSX-S there isn't a car on the market that is even in the same category as the Integra (teg). The RSX-S can match the performance and reliability of the teg however it fails in two areas, mainly the price and secondly the interior. The price at about $35,000 is just too much for this car, realistically it should be around the $27000 to $28000 range. However Honda wants to make the acura line its upscale brand, so it has to charge according. The interior, mainly the dash is terrible, whatever happened to wrap around interiors? And an arm rest should be standard. Although no other manufacturer can match honda's build quality, and I would miss feeling that quality whenever I drove a car.

So needless to say I'm not sure what car I want to drive but I did do some shopping and found some interesting things.

First the price you pay isn't always the price you pay. Second the lower monthly payment is not always the best deal. Third, its all about the product and has nothing to do with price. (if you buy a price you get a price)

Here are some details for this example I'll use a Mazda 3 for comparisons.

Option 1 2004 Mazda 3 sport, fully loaded, used, theft recovery, 39000 kms
Option 2 2004 Mazda 3 spott, fully loaded, brand new no KMS, full warranty + leather

Finance Option 1 - Finance $18,000 60 months
Finance Option 2 - Finance $18,000 60 months with buy back option
Finance Option 3 - Finance $25,000 60 months, special dealer 2.9% finance rate
Finance Option 4 - Finance $25,000 60 months with buy back option

so here are the numbers for these scenarios
Car Option1: Finance Option 1
Monthly: $360 Interest Paid:$3564.09 Buy Back: $0
Car Option1: Finance Option 2
Monthly: $288 Interest Paid:$4449.70 Buy Back: $5225

Car Option2: Finance Option 3
Monthly: $457 Interest Paid:$3625 Buy Back: $0
Car Option2: Finance Option 4
Monthly: $422 Interest Paid:$5506 Buy Back: $5225

So car option 2 Finance Option 3 although costs more pre month is the better deal, the dealer said they would also knock another $1000 off if I took it this week. However it does cost more out of pocket every month. In both cases doing a buy back option, although looks very tempting because the monthly payments are lower per month actually end up costing you more money in the end, and in some cases significantly more money. I guess the bottom line is look at all the numbers before deciding to buy the car, you may save in one area to pay too much in another area.



Wednesday, February 02, 2005

Fun with labotomies

I have shit luck, I have my whole life. A few weeks ago I was playing volleyball in a rather old school and found myself diving for a ball, not sure why cause we suck anyway and 9 times out of 10 we lose. Picking myself off the old and rather rough floor, I found both my knee and my elbow hurt, and I wasn't sure which I should favour first. I should have favoured my elbow first because it turns out I ripped it open. Now my entire body and especially my elbow is almost one big scar, I have cut and injured myself so many times that I basically have scar on top of scar(back to that shit luck thing again) I turns out this cut was unique, just under an inch long, nothing to write home about, but there was soft white tissue hanging out of the cut, it was rather wierd, when I touched it, it felt like I was touching myself on the inside. So of course my standard reaction is to do nothing, "it'll heal just fine on its own". However talking with my biatch and advice from the pharmacist I went to get it stiched up. Long story short, everything was fine for two weeks, Friday afternoon about an hour before work was done it started to hurt and I noticed my elbow was starting to swell, again my standard response "Ahh, it's fine, I've lived through worse". By the next morning my elbow had swelled to roughly 3 times its normal size and I was starting to get a fever (most likely from the poison running through my system). So I went to the ER and got it checked out. Of course the nurses and doctors gave me shit for not looking after it and had a good chuckle to most of my responses to their questions. Now I have had swollen infected cuts before and my action as well as the doctors action was to lance it and drain the fluid, not this time. The doctor ordered a healthy diet of anti-biotics administered through IV. I've never had IV before but I find the idea of needles to be repulsive. The nurse hooked me up to IV and within 5 minutes I completely passed out, I must have been out for quite a while cause when I came to, every nurse and doctor in the area was looking over me, very concerned. Now i'm on IV meds for 10 days, and have a semi-permanant IV hookup in my arm, so no volleyball, no snowboarding (basically no living) for the next 10 days.

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