For my first day of my 30 day learning sprint focusing on Microsoft Silverlight, I'm going to go through the Quickstarts on the community Silverlight website. Before starting with the Quickstarts, I had to set my machine up. Based on Scott Hanselman's post " VS 2008 and .NET 3.5 Beta 2 Releases Made Easy," I downloaded and installed the following: Then I got confused. I wasn't sure whether to start with 1.0 or 1.1. Silverlight 1.0 is at the release candidate stage with a go live license, so it seems like a safe bet. But with 1.1 I can program with c# on the client. I'm 95% more proficient with c# than with javascript, so this is a tough one. While digging around for more details, I found Jesse Liberty's blog posts about learning Silverlight from a .NET developer's perspective. Excellent! Not only is there are series with me as a target audience, but one that is a lot like my planned learning exercise, AND it's by the guy who wrote the book that I started my .NET learning with as well! Jesse's post about the differences between 1.0 and 1.1 lead me to the Silverlight Runtimes Matrix which shed some more light. I could deal with just using javascript for my initial learning, but when I saw that isolated storage wasn't supported in 1.0 that tipped the scale. I'm not sure exactly why ... it could be because one of the first cool demos I saw of Silverlight was how the isolated storage was shared between all browsers. I found the demo again on ExplosiveDog.com's " Silverlight Isolated Storage" post. I switched targets and downloaded the Silverlight 1.1 Alpha Refresh and Silverlight 1.1 SDK. One thing I'm still confused about is whether the 1.1 SDK is up to date with the 1.1 alpha refresh. I kind of doubt it because the search results on Microsoft Download have it listed with a date of 5/17/2007, while the Silverlight 1.0 SDK RC has a date of 7/27/2007. I decided to hold off on installing the 1.1 SDK, but I'd already installed the 1.0 SDK RC so we'll see what happens. At this point I've more than used up my first day's amount of time. Maybe later tonight I'll look at some of the samples in the quickstarts, but now my eyes are tired from staring at the monitor for too long. Too bad there aren't any books out yet, because I could really use some printed text at this point. Labels: silverlight, sprint
Today I've decided to start the 30 day learning sprint that I've been putting off for a while now. The technology that I've decided to learn is Microsoft Silverlight. This was my plan from a few months ago but procrastination lead me to put it off until now. For the next 30 days I am making a pledge to myself to spend at least an hour each day focusing solely on a task that will help me learn Silverlight. Whether that task is reading a tutorial or document, writing or debugging code, or anything else related, the point is that I commit to spending this amount of time each day on the goal. I hope that the one hour requirement will allow this to fit into my family life and schedule without being disruptive. Also, by writing this blog post I'm not only committing this to myself, but hopefully the public announcement will help me stay on task. (Plus, I can always come back and delete this post). I will also post one blog entry detailing what I planned on accomplishing for each day, how it went, and what the outcome was. Labels: silverlight, sprint
This is old news for most developers, but I'm throwing it out there anyway. I've known about Microsoft's LogParser for a long time now, but today is the first time I've actually used it. I needed to get some quick stats about the usage of some WCF services from an IIS log of an application recently put into production. I downloaded LogParser 2.2, googled and found some examples, experimented with some queries, and within 2 hours had a batch file that was creating two simple text file reports that would quickly tell you about service usage. Here's the batch file contents I created: @echo off if "%1" == "" goto reqparam @echo on
@echo * Getting total hits per service into %1_ServiceHits.txt
"C:\Program Files\Log Parser 2.2\logparser.exe" -i:iisw3c "SELECT DISTINCT cs-uri-stem AS Url, COUNT(*) AS Hits INTO %1_ServiceHits.txt FROM %1 WHERE (cs-uri-stem LIKE '%%.svc') GROUP BY Url ORDER BY Hits DESC" -o:NAT -rtp:-1
@echo * Getting hits per hour into %1_HitsPerHour.txt
"C:\Program Files\Log Parser 2.2\logparser.exe" -i:iisw3c "SELECT date, QUANTIZE(time, 3600) AS Hour, cs-uri-stem AS Url, COUNT(*) AS Hits INTO %1_HitsPerHour.txt FROM %1 WHERE (cs-uri-stem LIKE '%%.svc') GROUP BY date, Hour, Url ORDER BY date, Hour, URL" -o:NAT -rtp:-1
@echo off goto end :reqparam @echo Missing Parameter - IIS log filename :end And here's an example of the output: Url Hits ------------------------- ------ /AwesomeService.svc 208862 /SweetService.svc 133267 /GoodService.svc 41577 /MundaneService.svc 41271 /HappyService.svc 10300 /CrappyService.svc 2950 Just for fun, here's a command that will create a pie chart. "C:\Program Files\Log Parser 2.2\logparser.exe" -i:iisw3c "SELECT DISTINCT cs-uri-stem AS Url, COUNT(*) AS Hits INTO c:\temp\iisreport.gif FROM c:\temp\ex070730.log WHERE (cs-uri-stem LIKE '%.svc') GROUP BY Url ORDER BY Hits DESC" -chartType:PieExploded3D -chartTitle:"Service Hits" Which generated this image:  Its a little bit ugly because of the values put in front of the chart, but it wasn't worth it to me to spend the time figuring out which command line option would turn that off. * PS - I've noticed that the unofficial website for LogParser seems to be down. Bummer. Labels: tools
Christopher Hawkins' post Monday Consulting Questions: Three Reason Not to Work On-Site resonated deeply within me. As most things are, working on-site isn't a black and white issue. You have to take the bad with the good. One thing I've learned about working on-site is that you have to throw out your methodologies and adopt your client's. You won't be able to get the respect you need for your preferred practices, so you have to bend over. Another down side to working on-site is that you lose your sense of belonging. You are kind of like an employee of your client, but at most a second class version. You also have to conform to the rules, such as things listed in an employee handbook, for both your client and your employer. If you aren't independent, you also lose your connection with your real employer - your consulting company. It's really hard to maintain a connection with your company. I'm extremely fortunate that my employer does an excellent job at making me feel like I'm an owner of the company, and not just a stooge out in the world making them money. Another issue is who owns your equipment. I'd prefer to work on my own machine when I'm on-site, but usually decisions like that are beyond my control. The next best thing is to use portable apps to protect your privacy and reduce your footprint on your client's hardware. On the flip side, one of the good things about working on-site is that your client (usually) knows exactly what you've been working on and will be aware of the reasons behind delays or issues that pop up. If you're working on-site and you have the problem Christopher mentioned where the client thinks you're "just typing all day" then you've got other deeper issues that working off-site won't fix. Visibility is an important thing, as is being close to your clients. Working on-site gives you that visibility. Labels: misc
When I'm feeling especially paranoid, I worry that even my secure passwords are vulnerable to key loggers and other software that could be running on a computer. This is doubly true for public terminals. Also, as a consultant, I don't like to install applications on my work computer so I use portable applications off of a USB drive that I carry with my keys. Gizmo Richards' newsletter has a great article about improving password security in the June issue as part of a series about increasing security when using public terminals. So what can you do to improve your security when entering passwords?
Quite a lot actually. Of the many different options available to improve your password security to me the most attractive is to enter your passwords using a password manager like RoboForm2Go running from your own USB flash drive. The article also goes into alternative techniques to make entering a password more secure in order to obfuscate it from anyone snooping on you.  - Choose passwords with random characters that are long. This is standard password strength advise that is covered here and here.
- Look behind you for people/cameras that may be able to see what you're doing. Shield your keyboard if you're worried about visibility. You may feel silly about looking paranoid, but it only takes a few seconds and the only people would will even notice are ones that are trying to spy on you.
- Enter your password in a way other than just typing. This includes pasting from the clipboard, drag and drop from another place, use ALT+numpad combinations to insert letters, insert dummy characters and remove later, enter parts of your password in a different order, highlight and drag characters to another location, and maybe even using the character map to insert characters. Ideally you would use a few of these techniques together.
This information is useful even if you're not using portable apps, but worry about password strength and vulnerability. There will never be a totally foolproof method, but one of the best methods to increase security is to do things that make you less of a target. Just like pickpockets will target people who are more vulnerable, hackers and spies will target people using little to no security and ignore you because it would take too long to figure out what you're doing. Labels: security
As part of a significant refactoring effort, I was moving code from one project to another and accidentally made a change that resulted in a much different result than I expected. I'm getting a date from a database query, but that date column allows nulls. Here's what I had before: DateTime? someDate = (dataReader["DATE_COLUMN"]) != null ? Convert.ToDateTime(dataReader["DATE_COLUMN"]) : new DateTime?(); And here's what I ended up typing in my refactored code: DateTime? someDate = (dataReader["DATE_COLUMN"]) != null ? Convert.ToDateTime(dataReader["DATE_COLUMN"]) : default(DateTime); I didn't even realize I'd written the code differently, probably because they should have the same result, but they didn't. The first version, new DateTime?(), has the value null, while the second version, default(DateTime), has the value 1/1/0001. That's not even a valid date in SQL Server! The following code in a console application will demonstrate different default values. Console.WriteLine("new DateTime?() = {0}", new DateTime?()); Console.WriteLine("default(DateTime) = {0}", default(DateTime)); Console.WriteLine(); Console.WriteLine("new TimeSpan?() = {0}", new TimeSpan?()); Console.WriteLine("default(TimeSpan) = {0}", default(TimeSpan)); It looks like a new instance of a nullable object will always be null, while the default value for that type won't be null. Of course, I came to this conclusion with very limited tests, but it's good enough for me.  Labels: c#
I'm annoyed when sites require you to register in order to access certain parts. It's one thing to mandate authentication if a user is modifying or submitting content, but to for things like downloading sample code it is ridiculous. If you run into this situation, go to Bugmenot.com, type in the domain of the web site, then try one of the registered username/passwords. If you can't find one that works, you can register yourself, using a temporary email address of course, and submit your registration information to Bugmenot. Yet another victory for the web community. Labels: web
I've blogged before about my tendency to use the mouse over the keyboard. Currently I have a Microsoft Natural Ergonomic Keyboard 4000. I liked my old Microsoft Natural Multimedia Keyboard, but the keys were sticking and the light grey colored plastic was seriously discolored and nasty looking (my sweat is great at discoloring things). My wife didn't like the ergonomic split keyboard of the 4000 I got for home, so I took it with me when I started my new job. Comparison Pros - 5 customizable buttons designed for launching apps
- standard layout of the insert/delete, home/end, pgup/pgdn buttons
- black coloring looks nice and won't show sweat residue
- back/forward buttons (see below) and zoom in/out toggle
- wrist pad feels really nice
Cons - only media buttons - play/pause
- volume up/down/mute controls windows, not media player
- wrist pad is already staining where my wrists rest
- zoom in/out button not customizable
- I don't like how pressing keys feels - not enough tactile feedback
Back / ForwardI never really liked the back and forward buttons that tend to end up on mice, and having them on the keyboard is even more useless. When I'm surfing, I'm actively using my mouse, so I don't mind clicking back/forward in my browser's toolbar. I end up mapping the mouse buttons to other things. I also don't surf while at work, so I found a practical re-mapping for these buttons. Visual Studio shortcutsLukeH's recent post about the F12 button reminded me of a custom configuration I have set up.  The post mentioned the navigate back/forward functionality in Visual Studio. I configured my keyboard's back/forward buttons to the these navigation keystrokes so I can easily move around in code without moving my hand to the mouse. I've found this configuration very useful. I've actually been trying to learn more keyboard shortcuts lately, and set my own. I've downloaded Roy Osherove's Keyboard Jedi application, but I'm too much of a wimp to turn on the no-mouse feature. Where's the mouse?My motivation behind using more keyboard shortcuts is because I moved my keyboard to a keyboard tray that doesn't have any room for the mouse. I was using my mouse on the desktop, but my shoulder really started hurting from having my right arm extended so often. Also, my wrist was resting on the edge of the desk which was sometimes cutting off circulation.  My solution was to get a trackball to fit in the 3.5 inches of space available on the keyboard tray. I tried the Logitech Cordless TrackMan Programmable Optical Mouse, but the thumb buttons were too close to the keyboard and I just couldn't get used to using my fingers to navigate and click. I now use the Logitech Trackman Wheel Scroll Optical Mouse trackball and I'm amazed how quickly I adapted to using it. ( why can't Logitech come up with product names that don't all look the same?) My navigation speed is still a lot slower than with a regular mouse, and when it's getting close to lunch time I sometimes find my thumb starting twitching making accuracy very difficult, so I still have my regular mouse attached. This is also useful when a co-worker stops by and wants to take over to show me something. It's funny how many people are surprised that you can have multiple I/O devices of the same type attached, but it really doesn't cause a problem unless the configuration applications conflict. Reminds me of a year ago when I was working on virtual keyboard functionality and had three keyboards, all different languages, attached at once in order to do unit testing. Unfortunately, the trackball doesn't have any thumb buttons, but I did remap the middle click to bring up my Clipboard Recorder floating window, which is occasionally useful. Labels: devices
With my family out of town for the past couple of days, I found myself with a lot of free time that I'm not normally used to. I was planning on doing some things that I've wanted to get done for a while now. I didn't get any of these things done. I look back and realize that I didn't use my time effectively. I need a new strategy. The NormNormally, a full time job, significant commute and a toddler add up and leave me with almost no free time each day. What free time I do have with ends up being at the end of the day, spent on time fillers that are of questionable value, but allow me to let off some steam. Things such as reading blogs, watching TV, playing games on my DS. While my television time has gone down significantly (thanks to TiVo), it's empty time. The same could be said for playing video games, but at least they're more interactive and engaging. Reading blogs could be considered useful, but I seem to only really learn anything from maybe 10% of what I read. Everyone needs time for activities that allow them to relax, but I think I've gotten so used to spending my free time in this way, when I end up with a large chunk of time to do something useful I fall back to the things that I'm used to doing. I've been conditioned to fill my free time with small chunks of relaxing activities. So with several evenings with no responsibilities, what did I spend my time doing? - I put in extra hours at work.
- I read blogs.
- I slept in.
- I played video games.
- I spent time making lists of things I've been meaning to get done.
Boring!Have I really become such a dull person. I'm not going to complain about having time to do all of this, because it was nice. But, please! Working overtime? I think it was so novel to not have to leave by a certain time to pick up my son at day care that I worked later than usual. When I got home, I had the computer to myself, and got sucked into catching up on my feeds. I was so lost in the moment of not being distracted, that I even forgot to eat supper. The next morning I slept in and worked late again. "Hey, I don't have to leave until I get my current task done!" I arrived home late again, low on energy. "I need to focus on getting some of these things on my mind done, " I said to myself. "I know, I'll make a list!" I started up the laptop. "Let me just read my email first. Oh yeah, and I'll quickly check some of the blogs that I like to read regularly." You can see where this is leading. By the time I made my list, it was late at night. The list was also so large it was overwhelming. Luckily, one of the blog posts I read made me realize that I need to manage my time better. J. D. Meier has some good advice on time management that I'm going to try to leverage. I need to cut my list down mercilessly and figure out what my top priority is. Another problem I have is that there are so many amazing new technologies coming out lately, in addition to existing languages and frameworks I'd like to learn, that I can't possibly learn them all so I need to focus on one, but I don't know which one to choose. The PlanMy plan is to commit to a 30 Day Improvement Sprint focused on my top priority. I can't spend a lot of time each day, but if I spend it consistently I will get results. I'm still not sure what my focus area is, but it will be obvious because part of that goal is to blog daily about my progress. Labels: effectiveness
|