Thursday, April 26, 2007

Saturday, April 21, 2007

Water coolers

So, should you buy a water cooler, say from Hamilton, and the instructions indicate that you can safely use pliers on a silicone seal, don't. We get to take ours back to Target and get another because the instruction sheet clearly shows someone doing just that, and the text just says "See illustration". Sadly, using pliers will rip the silicone. I talked to some people from Lowe's, they said that those instructions seemed bad and to call the 800 number and get new seals. Well, this American customer does not know the word patience. :) So, I will take it back, get the other box they had, and this time take it off by hand (which is how the 1st one came off, although it did take some work). So now we'll have a water cooler in the kitchen. I was able to sanitise and clean out the old water cooler - turns out it was the water bottle and not the cooler, so we're going to go back to using it (or at least we'll see).

Sunday, April 08, 2007

Police Academy

has NOT ever seen Police Academy. I've now added it to the TOP of my Netflix queue. How this happened, I'll never know...

The real reason behind Easter eggs

For those NOT easily offended: http://community.livejournal.com/metaquotes/5993308.html.

Google Maps mashup coolness

Go to this page. It's a GeoRSS mashup supported by a recent change in the Google Maps API. It's just the sort of coolness that I can add to the site on a Sunday night in less than 2 hours, including testing.
We went over to the family's today for Easter. Burned my non-pork subsitute (fish), so I didn't eat any of that. Instead had lots of potato/mushroom much, Jell-o(tm), and deviled eggs. Went to Whole Foods (one of the few places open this Sunday (weird, eh?)). Got some eggnog, white chocolate milk, other junk.

Friday, April 06, 2007

Here's another C#/.Net code sample. This one takes a CSV file, optionally with quotes around fields, or not, or mixed within one line (THANKS Excel 2007, for throwing that in the gears..). IT converts it into a DataTable, optionally with ColumnNames from the file. Actually, looking at the code, it HAS to have ColumnNames in the first row. So, if you want to use it that way, adjust the code. I could have used this code yesterday, so I decided to post it for others.
        private System.Data.DataTable ConvertCSVToTable(String file, bool firstRowHasColumnNames)
        {
            System.Data.DataTable dt = new System.Data.DataTable();
            String[] lines = System.IO.File.ReadAllLines(file);
            foreach (String line in lines)
            {
                System.Collections.Specialized.StringCollection parts = ParseCSVString(line);
                if (dt.Columns.Count < 1 && firstRowHasColumnNames)
                {
                    // this row contains column names
                    foreach (String part in parts)
                        dt.Columns.Add(new System.Data.DataColumn(part.Trim('"')));
                }
                else
                {
                    // FIXME TODO: Adjust to dynamically create new columns as needed if a row has more items than we have columns (due to broken CSV implementations, or if we didn't have column names in row 1)
                    // this row contains data
                    System.Data.DataRow dr = dt.NewRow();
                    for (int i = 0; i < parts.Count; i++)
                        dr[i] = parts[i].Trim('"');
                    dt.Rows.Add(dr);
                }
            }
            return dt;
        }

        private System.Collections.Specialized.StringCollection ParseCSVString(String line)
        {
            System.Collections.Specialized.StringCollection sc = new System.Collections.Specialized.StringCollection();
            String buf = "";
            bool inQuotes = false;
            foreach (Char c in line) // each character
            {
                if (c == '\"') {
                    inQuotes = !inQuotes;
                }
                else if (c == ',' && !inQuotes) // if comma and NOT in quotes, delimit!
                {
                    sc.Add(buf);
                    buf = ""; // add new item, clear buffer
                }
                else
                {
                    buf += c.ToString();
                }
            }
            if (buf != "") sc.Add(buf); // add remaining buffer as last item
            return sc;
        }

Wednesday, April 04, 2007

Raise!

I got a raise! This evening, just as I was about to leave work, my boss asked me to step in the office for a few minutes. He told me that he's very pleased with my performance, and I'm getting a raise (can't say how much online, sorry) to recognize my value to the company. 3 months ahead of schedule even! Well I for one will certainly appreciate it. and went to Mom's Night Out (although I understand there was only one other mommy there tonight), so , Tiny, and I all went out to run some errands. Went out to Old Chicago for dinner afterwards. Was fun, we may or may not go hiking this weekend depending on the weather - Colorado has decided that winter isn't quite dead yet - it's been cool these past couple of days (for which I am thankful!).