May 2004 Entries

I took the plunge...

Well I finally did it. I proposed to my wonderful girlfriend of 2 years! I threw her a surprise birthday party with all of her friends. It took quite a bit of effort since Emily is very hard to surprise. It took several levels of misdirection to keep her from finding out about the party. But everything went as planned, and she was really surprised. After some pizza and karaoke, and before anyone could leave, I popped the question. It took everyone by surprise since I am usually a very quiet guy, but it went great and of course she said...

posted @ Monday, May 31, 2004 9:41 AM | Feedback (8)

Full Screen in Remote Desktop Connection

I just found out that you can CTRL-ALT-BREAK to go full screen when connecting to a computer using Remote Desktop Connection in Windows XP. Thats always been a pet peeve of mine  since maximizing the window goes full screen when connecting to a computer that is running Terminal Services. I figured they took it out for some reason, but it turns out they just buried the command - just a little too deeply if you ask me. Edit: I guess you could just do options->display->full screen, but who checks there anyway? Besides, whatever happened to good ol' ALT-ENTER?

posted @ Thursday, May 27, 2004 7:12 PM | Feedback (25)

IANADBA2

Luciano Evaristo passes along a cool tip on how to get an average from a datetime field: To workaround this, just change the SQL statement to SELECT CAST(AVG(CAST(MyTable.MyDateTimeField AS float)) AS datetime) FROM MyTable and things will work properly. Cool tip!

posted @ Tuesday, May 25, 2004 9:30 AM | Feedback (15)

CSS2 Intellisense for Visual Studio .Net

Paschal L posts about adding CSS2 Intellisense support into Visual Studio .Net.

posted @ Tuesday, May 25, 2004 8:05 AM | Feedback (16)

Dealing With Stubborn Sql Server Log Files

Normally when you backup a database the log files are automatically truncated, however recently we had a development database that had racked up a 9GB log file! Despite nightly backup's the log file wouldn't clear.In order to shrink it down to a manageable size I ran the following commands from Query Analyzer: BACKUP LOG DBName WITH TRUNCATE_ONLYGODBCC SHRINKFILE(LogFileName,SizeInMB) GO Now all I have to do is figure out why it get so large in the first place.

posted @ Monday, May 24, 2004 2:22 PM | Feedback (27)

Smart Paster

Alex Papadimoulis wrote a cool little vs addin called "Smart Paster" that gives you some great pasting options. Definatly worth checking out.

posted @ Monday, May 24, 2004 1:00 PM | Feedback (35)

IANADBA

I am not a dba, which is probably why I found this page on Dynamic SQL eye-opening and informative. If you are not a fully qualified dba, but find yourself writing stored procedures, it's a must read (or a re-read if you have already seen it).

posted @ Monday, May 24, 2004 6:57 AM | Feedback (25)

Movie Season:Shrek 2

Emily and I saw Shrek 2 at the spur of the moment last night, and I was kind of let down (though it was better than Troy). While it was a good movie, I was expecting a little bit more from it. The animation was top notch, an improvement over the original Shrek, but there were fewer big laughs than the first and it felt rather short. It is a good movie that lives up to it's predecessor, but never really improves on the formula. However, if you like the first one, I'd definitely recommend seeing Shrek 2. But, if you weren't a fan...

posted @ Friday, May 21, 2004 6:53 AM | Feedback (1)

A Fix for my VPN Woes

The last few weeks I've been trying to vpn into my office's network. While I could do it at my girlfriend Emily's condo, I could not get it to work at home. I could get it to connect, but it would just hang whenever I tried to do anything. I had almost identical setups between Emily's place and mine (I setup both networks), so I couldn't figure out the difference. Then suddenly vpn stopped working at her place as well and I thought all was lost. Well I googled around the other day for vpn problems and came across this page http://www.homenethelp.com/vpn/router-client-problems.asp. I...

posted @ Wednesday, May 19, 2004 7:09 AM | Feedback (16)

VSIP: Whidbey Commands on VS 2003

I missed this from a few days ago, but Gaston Milano packaged up a few new features from Whidbey and made them available for Visual Stuido. NET 2003. Simple, but really cool stuff: Close All but this ( Close all document windows but this) Copy Full Path ( Copy the full path of the active document to the clipboard ) Show File In Explorer I found this via Sanjay's Coding Tips

posted @ Sunday, May 16, 2004 9:21 PM | Feedback (23)

Broken VS.NET Formatting and the Same Old Story

Mikhail Arkhipov details, once again explains why the existing Visual Studio html formatting bug cannot be fixed (or why Microsoft doesn't want to bother). I'm sorry, but I'm not drinking the Koo-laid. Yes, there are valid reasons for the terrible formatting behavior, but COME ON. It's a bug that's been around for at least 3 products! And it's not just some annoying little bug, it's a productivity killing bug that mangles code and prevents us from using many features the html designer provides. I haven't dragged and dropped a single thing onto a web page in a year because it will reformat...

posted @ Sunday, May 16, 2004 7:07 PM | Feedback (35)

Troy

Emily (my girlfriend) and I saw Troy this past Friday at one of our local AMC theaters (there are at least 2, if not more in easy driving distance).  My first impression was one of disappointment. I haven't read the Iliad in quite a while, so I can't really compare it to the original epic poem, but as a screenplay it was just flat and full of holes. The acting was decent enough, Brad Pitt, Eric Bana, Brian Cox, were all pretty solid, and Peter O'Toole provided some much needed comic relief, though I don't think that was what they were trying to achieve...

posted @ Sunday, May 16, 2004 6:02 PM | Feedback (13)

Microsoft Security Summit - STL

Earlier this week I was fortunate enough to get a day off of work to attend the Microsoft Security Summit in St. Louis, MO. It was my first technical convention, though I don't know if it really counts since it was only a day and free, but hey, it was good to see that St. Louis has some other developers. I often feel rather isolated at my company since I'm currently the only developer. If you've never been to one of these events, you start off with a keynote speech, where they announced the new Microsoft Update, which will replace Windows Update...

posted @ Saturday, May 15, 2004 8:46 PM | Feedback (53)

Programming iTunes

Dan Crevier points out that you can now script to iTunes via a COM interface (on windows) and provides some examples. Maybe now someone will write a winamp-like hotkeys system (if there isn't one already), or maybe I'll write one sometime. Pretty cool stuff.

posted @ Monday, May 10, 2004 10:26 AM | Feedback (46)

Make your own windows boot disk

I saw Bart's Preinstalled Environment (BartPE) bootable live windows CD/DVD on the Screen Savers the other day, with it you can make your own windows bootdisk/disk-based installation, not unlike Knoppix for Linux. I haven't tried it yet, but sounds sort of like creating your own Ultimate Boot CD, except much cooler. It also looks like there's someone trying to bring UBCD together with PE Builder with WindowsUBCD, but it doesn't quite look ready yet. Yoshi Taguri also mentions PE Builder.

posted @ Monday, May 10, 2004 7:54 AM | Feedback (12)

Word is getting around

Josh Ledgard also brings up the Visual Studio.Net loading problems that I mentioned earlier. In addition to the earlier tips, he also recommends disabling anti-virus software to see if that's the culprit. Incidentally, he is also the author of the VSTweak Powertoy. Cool stuff.

posted @ Monday, May 10, 2004 7:32 AM | Feedback (24)

Using Property Accessors With Private Variables

When learning about Object Oriented programming in .net and specifically C#, we are taught to always use public properties with accessors to expose a particular variable: private string _myVar;public string MyVar{    get { return _myVar; }    set { _myVar = value; }} Which is normally the beginning and the end of the conversation. However, you can also use accessors (getters/setters) to encapsulate complex or receptive logic for private variables as well. This is especially useful in ASP.NET programming where you often have to deal with state management. For example to retrieve a value from the QueryString you would write something like: int myVar; if...

posted @ Sunday, May 09, 2004 4:41 PM | Feedback (13)

Slow loading fix for Visual Studio

I've been dealing with a very slow loading Visual Studio.Net for a while now, which has been driving me nuts since vs.net loads instantly on my laptop, which is slower than my development machine. I've even reinstalled and nothing worked, but I finally came across the answer to my woes thanks to Alex Chang who provides the solution. Basically vs.net keeps a Most Recently Used list of opened files/projects and if one of those is on a network share or removed it can cause vs.net to load very slowly. I used VSTweak to clear my MRU list and it worked like a charm (although I...

posted @ Friday, May 07, 2004 8:33 AM | Feedback (28)

A better dynamic calendar control 2

The calendar control, while useful has one undesirable behavior: it re-hides when changing the visible month. Fortunatly it's an easy fix using the calendar's VisibleMonthChanged event handler. If you have visual studio you can click on the calendar in design view, the click on the 'Events' (lightning bolt) icon and double click on 'VisibleMonthChanged' under 'Action' or add the following line to the InitializeComponent() method  in CalendarPopup.ascx.cs : this.calendar.VisibleMonthChanged += new MonthChangedEventHandler(this.calendar_VisibleMonthChanged); To make the calendar remain visible after the postback, we need to set it's display attribute to auto (a blank attribute will work as well): private void calendar_VisibleMonthChanged(object sender, MonthChangedEventArgs e) {     calendarDiv.Style.Add("display", "auto"); } Now the...

posted @ Thursday, May 06, 2004 8:45 PM | Feedback (11)

A better dynamic calendar control

I came across this cool little article on creating a dropdown calendar control recently. It basically uses dhtml to popup an asp.net calendar control when you need it, rather than opening up a new window. While it's useful, it's dhtml is IE specific, so I made a few quick changes and came up with: CalendarControl.ascx: <%@ Control Language="c#" AutoEventWireup="false" Codebehind="CalendarControl.ascx.cs" Inherits="CalendarControl.CalendarControl" %> <asp:textbox runat="server" id="calendarDateBox" /> <input type="button" value="..." onclick="<%=calendarDiv.ClientID%>_ToggleCalendar()"> <div runat="server" id="calendarDiv" style="display:none;position:absolute;">        <asp:Calendar backcolor="#ffffff" id="calendar" runat="server"></asp:Calendar> </div>   <script language="javascript"> function <%=calendarDiv.ClientID%>_ToggleCalendar(){          var cal = document.getElementById('<%=calendarDiv.ClientID%>');          if ( cal.style.display == "none")          {                   cal.style.display = "";          }          else          {                   cal.style.display = "none";         ...

posted @ Monday, May 03, 2004 9:52 PM | Feedback (3)

Some asp.net project tips

I'm pretty particular when it comes to how visual studio (vs) handles my project files so how it handles asp.net irks me to no end, but with a little extra work and a few tried and true tricks you can have things your way. These tricks have been around a while, but if you missed them the first time around, here's another chance. I like having my project files all in one place, it just makes it easier to copy or backup projects (not to mention source control). however, by default vs will create the solution files in one place and the web...

posted @ Monday, May 03, 2004 8:31 PM | Feedback (1)

Is this thing on?

Hello, my name is Michael Cook and I'm am currently an asp.net developer in St. Louis for a company called Mozaic Ltd. I've been lurking on the Internet for quite some time now, and after a few half-hearted attempts, I figured it was about time to really get something going. So welcome to my little corner of the web. My blog will be mostly tech oriented, but I'll try to spice things up with a little personal gossip from time to time. If you don't like it (or like it more than anything else), you can use the category links on the left to filter...

posted @ Sunday, May 02, 2004 3:03 PM | Feedback (16)