Categories
Geeky/Programming

Enum or Lookup Table (Or Both?)

Well, here is a dilemma. Should you use an Enum in code or a Lookup Table in the DB for static lookup data. Or should you use both and make sure they match up? And if you do, should you make the tables have an identity INT column?

Depends on the situation.

If you have a lookup table for something that is static (or relatively static – changes maybe once every year or more), then an Enum to Lookup table relationship might be what you need. But, if your list is more than say 10-15 items, I don’t know if it would be best to even have an enum. If you have a lookup table that will get added to a lot (more than once a year) then I don’t think you want to add an enum as you would have to change it and recompile your code on every addition. With the case of frequently changing data or a lot of items in your list, a cached dataset would probably work the best. I think in practice you should lay out ground rules before the start of a project on what business rules have data assumptions and where they will be (data layer, business layer, presentation layer) – that way, there will be no confusion on lookup/seed/static data throughout your project.

If .NET had some way to make sure that your enum and lookup table matched or if you could create the enum from a data table, it would be great. You can dynamically create enums using reflection, but I don’t think that would be the best solution in this scenario.

Here are some other blog posts on the subject

Enums and Lookup Tables

Data Modeling and Enums

Categories
Random

Sony's Bad Day

Wow, Sony just can’t get it right. First, they release cd’s with copy protection. Then, the copy protection is found to install a rootkit. Then, they say it is no big deal. Then recently, they say they will stop using the copy protection and offer and uninstaller. Thing is, the uninstaller leaves security holes open on the machine.

And then too add fuel to the fire, there are rumors (which Sony denies) that they are going to create some kind of locking feature on game discs so they will only play on one console, etc.

I am very disappointed in Sony. I have a PS2, but I don’t know if I am going to get a PS2. XBox 360 and/or Nintendo Revolution is what I will probably go with when they come out.

Categories
Product Reviews

Hauppauge WinTV

I purchased a Hauppauge WinTV 1.5 PVR card recently. What a cool device. First off, I can watch tv down in the corner of my desktop while doing other things. I can record shows directly to my computer. I can use MSN remote record to record a show that I might want to see but I am not at home. I can use orb to stream the recorded shows over the net to anywhere, or even stream live TV. This week I have been streaming MSNBC and just minimizing it, listening to it over the headphones instead of music. It is just so cool, being able to be connected to your media all the time. With Media Center Edition, Orb, a TV Tuner Card and TV Recorder Card you are all set. Add in your music collection, dvd’s and then downloaded movies, you are all set. The only thing missing is the abilty to remotely play your video games!

Categories
Geeky/Programming

Detecting Flash – FlashObject

There are many ways to detect flash in a browser, but today I came across an elegant solution that I think is the best I have seen so far, and better yet – works with all browsers, and lets you expose minimal code. With around 10 lines of code you can detect flash, and set up your alternate content, etc. Pretty sweet if you ask me, especially compared to some of the hacks I have seen to try to detect the browser and OS and if flash is installed and what version and you get the picture. With FlashObject, you reference the js file, and then you set up a div tag for alt content, and a JavaScript block with your flash code (2 lines of code). It seems a lot more easier then the default shockwave EMBED method. If you have to detect flash on multiple browser, I suggest you check out FlashObject.

FlashObject

Categories
Geeky/Programming

Firefox Support

Most of my web developing has been for a corporate environment, where every browser was IE (or we could say – install IE!), but now I have to develop for the internet in general. Today I found that more Firefox issues are handled if you set your browserCaps in your web.config so that ASP.NET sees FF as a “Up Level” browser (and not something like Netscape 2.0!!). Granted that there are other CSS issues and formatting issues, but I found that the majority of issues clear up once ASP.net knows about Firefox (and Opera, et al)

Good browserCaps reference

Categories
Random

Comic Book Prices

So I have a few old comic books laying around from garage sales, etc. Some of them are from the early 70’s. I went online to look some prices up, lo and behold, none of them are worth more than 5 bucks.

Here is what I have

  • MARVEL SUPER-HEROES #65
  • NEW ADVENTURES OF SUPERBOY, THE #20
  • SUPERMAN THE MAN OF STEEL #21
  • MARVEL’S GREATEST COMICS #83
  • MARVEL’S GREATEST COMICS #84
  • MARVEL’S GREATEST COMICS #86

Seem’s that they aren’t worth much, but at least more than the 10 cents paid for each.

Categories
Life

Zathura

Can you say it? Zathura. Went and saw it Friday night. Pretty good movie. About a board game that brings the game to life with a adventure across space. It seems like most people can’t pronouce the name, which is weird.

Categories
Life

Rain

Nov. 12th and it has been raining pretty much all day. I wonder how much snow it would be if it was snow…alot I am guessing. Pretty weird weather. I remember years where on Oct 31st we had 5 feet of snow.

Categories
Random

All Over The Place

Ok, today I have been doing some rearranging. Moved my blog here. Changed the site to asp.net 2.0 – redid some web services I had running on here to 2.0, pretty much just changing every all over the place!

Categories
Life

stevienova.com

sweet, http://www.stevienova.com works now with or without the port 311. HostMySite.com hooked me up tonight.

What a great time to start redoin the site – I have already started, I have it started on my local machine but hope to update it out there soon. Maybe even get my blog moved over there so it is all on one site, who knows.

stevienova.com

Host My Site