Pages

Friday, October 31, 2008

SQL Server default constraints

... created implicitly are pain in the ass.
Note to myself: ALWAYS explicitly name your default constraints, otherwise altering/dropping columns across different servers becomes major headache.

P.S. Not mentioning that system tables that can be used to find implicit constraints change between SQL Server releases...

P.P.S This link helps.

Wednesday, October 8, 2008

Strongly Typed Collections or lets party like it's 1999

Strongly Typed Collections. Great idea. Of course one can argue that if whole code is under your control you should always know what you are adding, but hey, extra sanity check. Can't go wrong with it. Still rather great idea....
... or it was back in 1999. Since then most used languages implemented a next big thing - generics. Even Java that usually drags its feet due to highly collaborative nature of its development did it in the release before last (1.5 if I'm not mistaken). So why our offshore team just checked in brand new strongly typed collection implementation? I know timezones and such, but being years behind? Just another WTF in that looooong list.

Thursday, September 11, 2008

Case sensitivity

Everybody knows that net is case insensitive - no matter whether you go to http://GOOGLE.com or http://GoOgLe.CoM - you still gonna end up on the same web site and see the same page, right? I thought so too. Until yesterday.

Currently I'm working on a web service (C#/.Net 1.1/IIS6.0). It's already deployed and working at one location and we are getting ready to roll it out at the second one. So on my QA server I have two applications: /Service and /Service.EXT (note the capitalization), pointing to the two different databases (same codebase mind you). Couple days ago on the call our front-end developer asked me what's the URL for the service for the second location and being blissfully unaware I told him "just add .EXT to the application name". As you may know it's tad bit difficult to capitalize over the phone (unless yelling) so he did as I said: http://website/Service.ext/Service.asmx. Do you see a problem? Neither did he or I (yet).


Yesterday I got an email from our tester that one of the service operations fails. In the log there was an error that filewatcher threw an exception because of the non-existing directory (/level up from deployed code root/Service.ext). Well, duh - there is no such directory. Of course I don't use any file watchers either, so I had to dig deeper and found that one of our internal company shared components uses it to monitor some cache file it creates (I'm not gonna say anything abouth them writing into the application directory instead of the temp directory - that's totally different rant). The way they obtain the path is very simple: HttpContext.Request.MapPath("") - map virtual path to the physical path. This can't be a bug - someone would scream long time ago, plus the original application (Service) works like charm.

So off to do a little test I went.

When web service URL is "http://website/Service.ext/Service.asmx" - MapPath() returns "/level up from deployed code root/Service.ext"; when URL is "http://website/Service.EXT/Service.asmx" - MapPath() returns "/deployed code root" as expected.


Wow. I had to call front-end developer to ask him to change the case of the URL he's using. Just... wow...

Tuesday, July 8, 2008

We are so screwed

So if you create a fake identity on the Net - you are committing a felony according to Computer Fraud and Abuse Act (see here).

We as internet using society are soooooooo screwed now...

Monday, June 9, 2008

What is programming

From the Coding Horror:

programming is all about knowing when to boil the orange sponge donkey across the phillipines with an orangutang gorilla crossed with a ham sandwich to the fourth power of twelve across the nile with an awful headache from the previous night when all of alfred's naughty jalapeno peppers frog-marched the nordic elves across the loom-lined geronimo induced swamp donkey over and above the fortran fortified kilomanjaro fence past the meticulously crafted anti disgusting sponge cake scenario where all the hats doth quoteth the milk which is not unlike the super werewolf from the infinite realm of ninja-step. it's hard to define, really.

... yes, I agree...

Monday, May 12, 2008

Vista networking woes

I was sitting quietly leveling my rogue in Felwood on Saturday night, when all of a sudden WoW grinds to a halt and "Disconnected" screen pops up. Good thing I just finished that escort quest, otherwise I'd be really pissed. WoW servers do go down once in a while, so I just tried to re-connect - no luck. Hmmmm, quick Alt-Tab uncovers the problem - network icon got a yellow triangle on it. I'm on wireless connection (desktop is downstairs, router is upstairs and no desire to drag cables all the way), so I figured quick disconnect/reconnect ought to fix the problem. Yeah, right. Three attempts to reconnect/resolve issue later I gave up and went to bed (plus it was after 1 AM, so I didn't feel like thinking too much).
Next day - problem persists. Removed wireless card from the device manager, reboot - same thing. Once in a while it just refuses to authenticate, although I KNOW the key is right. Once in a while it authenticates, but still remains limited. Frustration sets in. Cris shows up and points me to the subnet mask (255.255.0.0). Tells me a horror story about how he had to reformat Vista that ran into this problem at his office. Damn, I really don't want to do it (Full WoW reinstall IS a bitch that takes forever and CDs I got are.... OLD, pre-BC). Plus I don't have any backups, so I'll need to go buy external HD or something. Argghhhh... Brand new Vista box not even two months old, half dead.
As always - Google to the rescue. After browsing few search results I start to grasp the picture. Auto IP assignment when DHCP fails is the culprit. For some reason my box failed to obtain new IP address from DHCP and got it auto assigned. And for some other reason - when you got auto assigned IP address on Vista/XP - it's next to impossible to get rid of it. Tried few things I found here and there - didn't work. Flushed all the caches I could think of in netsh. Started messing with the router - no authentication/WEP authentication/WSA authentication - no effect, except now Linux box doesn't want to get on the network. Tried static IP assignment - no dice, router shows that my box should have 169.254.x. address, although box is configured to have static 192.x.x.x address. And there is no way to change it in the router (router configuration is another story on its own, what a piece of crappy interface). Attempts to delete interface through netsh failed as well. Finally in frustration I got my old router (thank god for various pieces of equipment laying around) and set up second wireless network. Attempt to connect - same thing. It was almost midnight, so I quit for the day.

Results so far:
  • One almost brand new Vista system half dead.
  • One Linux Ubuntu not being able to connect to the network after switching security options and no obvious way to specify new security type (although I have an idea what might be the problem there).
From what I can tell so far - Vista "caches" network interfaces in its registry and never lets them go. Those are invisible (don't show in netsh or network list) and unaccessible. Deleting/disabling adapters doesn't have any effect - interfaces persist. I have two wireless interfaces there (my wireless card driver somehow changed GUID during driver update, so now I have Wireless Network Interface somewhere which I can't see it or access and Wireless Network Interface 2 the one that got stuck with auto assigned IP) and whole bunch of Ethernet ones (found them in the registry), but only active ones (tied to an active driver GUID) are visible.
Autoconfigured IP is somehow associated with the interface, so there are couple of things I gonna try tonight:
get rid of interfaces or force my card to change its GUID. ... or just buy new damn wireless card.

The saga continues...

Friday, May 2, 2008

Too funny

From the AFP:

"And, again, we would urge restraint on the part of the Russian government and urge them to consider the effects of their actions on the overall stability of the region," Casey said.

That's State Department deputy spokesman Tom Casey.

Rice said it is extremely important that Russia respects "the territorial integrity and sovereignty of Georgia," adding that she would raise the issue with Russian Foreign Minister Sergei Lavrov.

And that's US Secretary of State Condoleezza Rice.

One can only wonder why they weren't concerned with "stability of the region" or "territorial integrity and sovereignty" when they rushed to acknowledge independence of Kosovo. Probably because Balkans is such stable region... Wait, no, it isn't. Maybe because Kosovo has much stronger claims? No, that's not it either. Oh, I know, it's "do as I say and not what I do" foreign policy. Must be really hating Serbs, to jump into this Balkan mess... again. I'm not sure what did Serbs do to them, to piss them off that much. I really don't buy "protecting region stability". Well, I understand that Bill needed a war to get nation's mind off Zippergate, but c'mon people - there is no oil there, why US still kicks Serbs and cuddles with Albanians? After all same "terrorists" that fight in Afghanistan now were helping their muslim brother in Bosnia and Kosovo. And I'm 150% sure Serbs are not muslims. So what gives? Enemy of my enemy is my friend, even though he is my enemy elsewhere?

Of course if US didn't rush it would be Russia's turn to look silly, defending Serb territorial integrity and supporting Abkhazia in their struggle against Georgia (not the US state mind you). I say they should declare independence and Russia should acknowledge them. Hell, why not? Basques will be next, maybe be French and Dutch parts of Belgium and before you know it we'll have a tons of little city-states in Europe.

Now THAT is stability.

Friday, March 21, 2008

Next "big" idea (continued)

Looks like the idea really was in the air. Apparently Facebook is planning to roll out something like this.

Ideal Job

I think I figured out what my ideal job would be.
Something where I can lounge around doing nothing for a while and then short burst of serious coding, hell, a week of 20 hour work days where I can make enough money to cover the idle time. Then a month of doing nothing again. Now, THAT would be great job for me. Except where the hell am I gonna get a job like that in programming?

Friday, March 14, 2008

RIP Scorch

Scorch got shut down.
And although it sucked big time during the weeks, weekends were pretty good and drinks were superb (better then any other club I know). Not to mention that it not that far away from Phoenix west side (comparing to the rest of the night life centered around downtown Scottsdale). Hopefully they'll fix all their problems and open sometime soon.
Buh bye Scorch, you'll be missed =/

Tuesday, February 5, 2008

Next "big" idea...

Fully customizable social site, with a very fine control of who sees what. Every friend can be tagged with several labels. Every section/picture/blog entry can be shown to all, none or people who have certain tag. The problem is how to render it in some meaningful way, without leaving major gaps where hidden content is supposed to be. Solution (possible) - let viewers customize pages themselves, from the list of available modes, let owners set a general L&F.