Categories
Random

What Is Happening In Wisconsin?

Other than we just came out of the 2009 Ice Age? A few things.

This week we saw the temps drop to -22 F, and crazy low with wind chills. Talking with family and friends back in MN, they were seeing -37 F or more – crazy cold. To friends in PDX or CA or wherever, don’t complain about cold, ever.

Ok, so back to things going on in WI. I read blogs from all over on a regular basis and this week two stories popped up about WI (I’m excluding all the WI/Madison blogs I read – since that is what they are all about, these stories are from nationwide blogs)

1. Wisconsin Girl Cancels Online College Courses Thanks To A Mind Blown By Her Ubuntu Dell

What the heck? So this girl gets a Dell, it has Linux instead of XP, she can’t figure out how to use it, or get Windows on it, and can’t go to school. Wow…

2. Two Wisconsin Walmarts Evacuated Due To Mysterious Odors, FBI Investigates

Ok, so Wal-Mart has some sewer gas back up, call in FBI!

Maybe it’s just the cold getting to everyone’s head? Guess we will never know


Categories
Business Intelligence Geeky/Programming

Trends for GMail?

Google Reader has had “trends” for a while now, it really lets you see what you read, when you read it, etc.


Why doesn’t Gmail have a trends page? Why doesn’t it show you who you get email from, who you email the most, time of day etc. Something like Xobni. I know there is a Python app that a dev at Google made, but why can’t Google just add this to Gmail? They already have the information. Maybe it would be nice as a labs feature.

There are so many things out there like this. Where the metadata is available, but not available to you. From your TV, to you car, to your computer, apps, even your body. You can’t automatically get the times you went to sleep, bathroom, eat, etc from yourself, but it would be nice. Build the ultimate Data Warehouse.

I just wish that apps that had the data would let you see it, use it, and improve your productivity. Someday.


Categories
Geeky/Programming

How To Speed Up Visual Studio Start Up

Add /nosplash to the end of your visual studio shortcuts..

image

also you can also go to tools->options and change the startup to an empty environment to speed up open times

 

image

Categories
Geeky/Programming

Programmatically creating Excel (XLS) Files, as XML files – Things to Keep In Mind

I worked on a small project that required to export data to Excel. The spreadsheets needed to be formatted very precisely, and the best way to do this is with the XML format of an excel file. But I have found some gotchas throughout the project, which will cause the .xls files to not load.

First, since it is XML, you need to make sure you handle some special XML characters..

quotes “ should be "

ampersands & should be &

apostrophes ‘ should be '

less than < should be &lt;

greater than > should be &gt;

Now, if you make a function or something in code to do these operations, there is one thing to make sure of. Replace the & first. If you do it last, like the quick and dirty function I wrote first, then you could end up replacing a less than with &lt; and then replacing that new ampersand with &amp; so you end up with &amp;lt; – whoops …

Another few little gotchas.. Excel tab names have to be distinct. If you have duplicates, the spreadsheet will still create just fine, you just wont be able to open it. Another thing with the tabs, you can have a division sign in them – / – same thing will happen.

Categories
Blogging

Blogging

I haven’t blogged much lately. Why? Well the main reason is that I am using a Mac. 🙂

At work I use Windows – Windows XP (ugh), and I run into all these technical things that I even have drafts for in WordPress – 4 drafts so far. Thing is, I don’t blog from that machine, it’s a work laptop.

So I get home, get on my Macbook Pro – and yeah, I don’t have a Windows VM at the moment, so I never end up finishing any posts, since all the good content, and ability to get screenshots, etc is on the Windows laptop.

I am trying to work around this, I think I am going to go get a big external drive for all my media and such and run that off the laptop, so I can have a Windows Vista VM locally on the MBP.

Anyway, that is why there hasn’t been much new. Hope to change that in 2009.

Categories
Life

Sunday Night Show – The Annex (Madison, WI)

This sunday (Dec 14th), the Band I am in (Saturday Morning Cartel) is playing at the Annex in Madison. We are doing a charity/benefit show. The tickets are 10.00 and it all goes for the cause, which is for a little girl who is having medical problems. It will be my first show with the band where we are playing in Madison, so that is cool.

We also are playing on New Years at the MT Bar in Waterloo.

Categories
Uncategorized

Morning Question: What Mobile Phone Do You Use, and Why Do You (Or Don't You) Like it

I have had countless mobile phones over the years. Starting with a Nokia 5125 back in like 97, moving up the Nokia chain, then to Sanyos when I worked for Northern PCS (A Sprint Affiliate), then Windows Mobile Phones (6601, etc), then a T-Mobile Dash, and now the iPhone. I have to say the iPhone win’s hands down, can’t even compare with WinMo. I’d like to get an Android phone to compare (G1 Developer Edition – Santa please?)

I’d say with iPhone the one thing that is severely lacking is copy/paste. Other than that, I can’t complain much. When you aren’t on 3G or Wifi it kind of stinks, but it is usable.

What mobile phone do you use and why? What are the pros/cons? Benefits?

Categories
Geeky/Programming

Technology Hypocrites?

Why do IT Departments, SysAdmins, and techno geeks love to push the latest and greatest server products, use the latest technologies in hardware, etc, yet they are scared out of their boots about Vista?

(Side Note: Testing out the QuickPress feature of WordPress 2.7)

Categories
Geeky/Programming

HowTo: Delete a Custom Event Log Source – XP

I installed RedGate trial software, and it created a custom event log source in my event logs, but I uninstalled it, and the event source still remains, how do you remove it?

run regedit, go to [HKEY_LOCAL_MACHINESYSTEMControlSet001ServicesEventlog] and remove the custom event log

Categories
Business Intelligence Geeky/Programming SQLServerPedia Syndication

SSIS – Slowly Changing Dimensions with Checksum

In the Microsoft Business Intelligence world, most people use SQL Server Integration Services (SSIS) to do their ETL. Usually with your ETL you are building a DataMart or OLAP Database so then you can build a multi-dimensional cube using SQL Server Analysis Services (SSAS) or report on data using SQL Server Reporting Services (SSRS).

When creating the ETL using SSIS, you pull data from one or many sources (usually an OLTP database) and summarize it, put it into a snowflake or star schema in your DataMart. You build you Dimension tables and Fact tables, which you can then build your Dims and Measures in SSAS.

When building and populating your Dimensions in SSIS, you pull data from a source table, and then move it to your dimension table (in the most basic sense).

You can handle situations in different ways (SCD type 1, SCD type 2, etc) – basically, should you update records, or mark them as old and add new records, etc.

The basic problem with dimension loading comes in with grabbing data from the source, checking if you already have it in your destination dimension table, and then either inserting, updating, or ignoring it.

SSIS has a built in transformation, called the “Slowly Changing Dimension” wizard. You give it some source data, you go through some wizard screens, choosing what columns from your source are “business keys” (columns that are the unique key/primary key in your source table) and what other columns you want. You choose if the other columns are changing or historical columns, and then choose what should happen when data is different, update the records directly, or add date columns, etc.

Once you get through the SCD wizard, some things happen behind the scenes, and you see the insert, update transformations are there and things just “work” when you you run your package.

What most people fail to do, is tweak any settings with the automagically created transformations. You should tweak some things depending on your environment, size of source/destination data, etc.

What I have found in my experience though, is that the SCD is good for smaller dimensions (less than 10,000 records). When you get a dimension that grows larger than that, things slow down dramatically. For example, a dimension with 2 million, or 10 million or more records, will run really slow using the SCD wizard – it will take 15-20 minutes to process a 2 million row dimension.

What else can you do besides use the SCD wizard?

I have tried a few other 3rd party SCD “wizard” transformations, and I couldn’t get them to work correctly in my environment, or they didn’t work correctly. What I have found to work the best, the fastest and the most reliable is using a “checksum SCD method”

The checksum method works similarly to the SCD wizard, but you basically do it yourself.

First, you need to get a checksum transformation (you can download here: http://www.sqlis.com/post/Checksum-Transformation.aspx)

The basic layout of your package to populate a dimension will be like this:


What you want to do, is add a column your dimension destination table called “RowChecksum” that is a BIGINT. Allow nulls, you can update them all to 0 by default if you want, etc.

In your “Get Source Data” Source, add the column to the result query. In your “Checksum Transformation”, add the columns that you want your checksum to be created on. What you want to add is all the columns that AREN’T your business keys.

In your “Lookup Transformation”, your query should grab from your destination the checksum column and the business key or keys. Map the business keys as the lookup columns, add the dimension key as a new column on the output, and the existing checksum column as a new column as well.

So you do a lookup, and if the record already exists, its going to come out the valid output (green line) and you should tie that to your conditional transformation. You need to take the error output from the lookup to your insert destination. (Think of it this way, you do a lookup, you couldn’t find a match, so it is an “error condition, the row doesn’t already exist in your destination, so you INSERT it).

On the conditional transformation, you need to do a check if the existing checksum == the new checksum. If they equal, you don’t need to do anything. You can just ignore that output, but I find it useful to use a trash destination transform, so when debugging you can see the row counts.

If the checksums don’t equal, you put that output the OLEDB Command (where you do your update statement).

Make sure in your insert statement, you set the “new checksum” column from the lookup output to the RowChecksum column in your table. In the update, you want to do the update on the record that matches your business keys, and set the RowChecksum to the new checksum value.

One thing you might also run into is this. If your destination table key column isn’t an identity column, you will need to create that new id before your insert transformation. Which probably consists of grabbing the MAX key + 1 in the Control Flow tab, dumping into a variable, and using that in the Data Flow tab. You can use a script component to add 1 each time, or you can get a rownumber transformation as well (Both the trash and rownumber transformations are on the SQLIS website – same as the checksum transformation)>

After getting your new custom slowly changing dimension data flow set up, you should see way better performance, I have seen 2.5 million rows process in around 2 minutes.

One other caveat I have seen, is in the Insert Destination, you probably want to uncheck the “Table Lock” checkbox. I have seen the Insert and Update transformations lock up on each other. Basically what happens is the run into some type of race condition. The cpu on your server will just sit low, but the package will just run forever, never error out, just sit there. It usually happens with dimension tables that are huge.

Like I said earlier, the checksum method is good for large dimension tables. I use the checksum method for all my dimension population, small or large, I find it easier to manage when everything is standardized.

By no means is this post an extensive list of everything that you would run across, but more of a basic overview of how it works with using the checksum method.

In any event, you can get huge performance gains by using the checksum method and not using the SCD Wizard that comes with SSIS, and you will also feel like you have more control of what is going on, because you will. Happy ETL’ing 🙂