Rob Kraft's Software Development Blog

Software Development Insights

How to programmatically switch to a new pivot item in Windows Phone 7

Posted by robkraft on April 3, 2011

I hope the title of my article does not mislead you, but I just learned today that you cannot programmatically change which pivot item is displayed in the pivot control from your C# code. Apparently this is a known bug:
http://stackoverflow.com/questions/4541020/pivotcontrol-item-changing-behavior-in-silverlight-windows-phone-7.

Unfortunately for me this is a fairly devasting problem because my whole user interface (UI) is based on the Pivot Control and I needed my search function in the application to send me to a specific PivotItem. But code like this does not work:

PivotControl.SelectedIndex = 3;

I spent an hour or two before I started writing my application trying to decide if a Pivot Control or non Pivot based UI would work best. Had I known that the pivotcontrol was not working as expected, I certainly would have not used it. Fortunately I have also been writing unit tests and using MVVM on this project which is going to make putting an entirely different UI on the application relatively simple. I estimate 2 to 8 hours. Of course since I only work on this on the evenings and weekends the calendar time is going to cost me a week.

I am using the latest Microsoft Phone Developer SDK (release in February 2011). Hopefully the next SDK will fix this bug.

Posted in Code Design, Silverlight, Visual Studio 2010 | 3 Comments »

How to prevent foreign language subfolders in Silverlight projects

Posted by robkraft on April 2, 2011

I like to keep my folders and libraries clean, and one thing I find annoying is the generation of subfolders and DLLs for to support foreign languages when I have no interest in providing that support in my application.  Specifically, when I am developing Silverlight applications I notice many subfolders like ar, bg, zh-hans, sr-cryl-cs, and es.  If you want to keep your compile from generating those subfolders, you can do this by deleting all the foreign language subfolders that were created by the installation of Silverlight.
This can be tedious, especially if you want to delete them on several machines.  So I created this simple batch file to do it for me.  You may need to change the silverlight folder, and there will probably be additional langauges added, but this may provide you a starter batch file.

c:
cd\
cd "program files\microsoft silverlight\4.0.60129.0\"
rd ar /S /Q
rd bg /S /Q
rd ca /S /Q
rd cs /S /Q
rd da /S /Q
rd de /S /Q
rd el /S /Q
rd es /S /Q
rd et /S /Q
rd eu /S /Q
rd fi /S /Q
rd fr /S /Q
rd he /S /Q
rd hr /S /Q
rd hu /S /Q
rd id /S /Q
rd it /S /Q
rd ja /S /Q
rd ko /S /Q
rd lt /S /Q
rd lv /S /Q
rd ms /S /Q
rd nl /S /Q
rd ru /S /Q
rd zh-hans /S /Q
rd zh-hant /S /Q
rd no /S /Q
rd pl /S /Q
rd pt /S /Q
rd pt-br /S /Q
rd ro /S /Q
rd sk /S /Q
rd sl /S /Q
rd sr-cyrl-cs /S /Q
rd sr-latn-cs /S /Q
rd sv /S /Q
rd th /S /Q
rd tr /S /Q
rd uk /S /Q
rd vi /S /Q

cd\
cd "Program Files\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\"
rd ar /S /Q
rd bg /S /Q
rd ca /S /Q
rd cs /S /Q
rd da /S /Q
rd de /S /Q
rd el /S /Q
rd es /S /Q
rd et /S /Q
rd eu /S /Q
rd fi /S /Q
rd fr /S /Q
rd he /S /Q
rd hr /S /Q
rd hu /S /Q
rd id /S /Q
rd it /S /Q
rd ja /S /Q
rd ko /S /Q
rd lt /S /Q
rd lv /S /Q
rd ms /S /Q
rd nl /S /Q
rd ru /S /Q
rd zh-hans /S /Q
rd zh-hant /S /Q
rd no /S /Q
rd pl /S /Q
rd pt /S /Q
rd pt-br /S /Q
rd ro /S /Q
rd sk /S /Q
rd sl /S /Q
rd sr-cyrl-cs /S /Q
rd sr-latn-cs /S /Q
rd sv /S /Q
rd th /S /Q
rd tr /S /Q
rd uk /S /Q
rd vi /S /Q

Posted in Dev Environment, Silverlight | Leave a Comment »

Increase your productivity with Chrome 10

Posted by robkraft on March 9, 2011

I’ll confess that I prefer to use tools from Microsoft for most of my daily activities.  This is not because I drank the Microsoft kool-aid, but rather because I make a living solving problems using Microsoft technologies and it helps that I know them so well.

With Chrome 10 I have decided I can no longer wait for Microsoft to release a faster browser (IE9).  I have started using Chrome 10 for all my browsing because it is just so much faster than IE8.  I never would have guessed that the client-side browser contributed so much to my Internet surfing speed.  I always just assumed that most of the delay was due to the network traffic.  But Chrome 10 proves that wrong.  Chrome 10 renders everything five times faster than IE8 (confession – it feels 5 times faster, but it is really probably just twice as fast).  The speed difference is noticeable enough for me to realize that I am wasting my time running IE.

I took a look at Chrome 10 after reading this article.

The author ran some performance numbers and shows that Chrome 10 is already faster than IE9; and Chrome 10 runs on Windows XP (which I still have to run at one of my client sites).

I highly encourage everyone to take a few minutes to install Chrome 10 and decide for yourself if it isn’t time to start browsing quickly, instead of waiting for Microsoft to release a faster browser that will be slower than Chrome.

Warning:  I doubt that Chrome 10 is as secure as Internet Explorer 9 (or even IE8), but it is certainly the browser you will prefer to use for much of your surfing where speed is more valuable than security.

Posted in I.T. | Leave a Comment »

Filing your Missouri Annual Report

Posted by robkraft on February 22, 2011

Don’t forget to file your state’s Annual Report.  Maybe this isn’t needed in every state, but you do need to do so every year in Missouri.  You can also file for two years at a time.  The cost is $20 per year and it takes less than 10 minutes if you have previously filed.  Go to www.sos.mo.gov/business to file online.  If you don’t file on time the fee goes up to $35.

I think that your deadline to file is on a yearly basis since you first incorporated.  So the month you incorporated determines your deadlines.  Log in to find out your deadlines.

Posted in Taxes and Fees | Leave a Comment »

Use MailChimp for a great free mailing list

Posted by robkraft on February 22, 2011

I have maintained a few mailing lists for some non-profit organizations for the last ten years using a .Net program I wrote.  I was proud of my little program and the features I provided, but I recently discovered MailChimp.com and am now using it instead.

With MailChimp I can send 12,000 emails per month for free.  I can upload a list of existing email addresses from an Excel spreadsheet.  I get feedback and statistics about who has opened the email, when it was opened, and where it was opened from. They also provide dozens of email templates to make your emails look great!

If you manage small email lists and are using your own excel spreadsheets, or just a blob of emails you send to from within outlook, you owe it to yourself to take a few minutes and get to know MailChimp.com.

Posted in Free tools, Web Sites | Leave a Comment »

W-3 form for the state is due February 28th, 2011

Posted by robkraft on February 20, 2011

If you are incorporated in the state of Missouri then you need to file the MO W-3 by the end of this month.  This is a very simple form to fill out, especially for those of us self-employed S Corporations.

I tried to verify that my federal W-3 was complete when I entered my W-2 information online but found the federal web site to have a javascript error preventing me from logging in.  Doing business online is very handy, but it gives us further reason to avoid procrastination, because if you wait to the last minute, and you find an online site is not functioning, you are much more likely to fail to complete your forms on time.

Posted in Taxes and Fees | Leave a Comment »

Use the free service from TraceTune.com to find your SQL problems

Posted by robkraft on February 16, 2011

The new free service http://www.tracetune.com/ will instantly analyze the trace files upload to let you know which queries are taking the longest to run.  I recommend giving it a quick trial run using the script file provided on the site to configure your trace.  It is easy to implement, easy to gather data, and easy to submit for analysis and get results.

This site is targeted for traces from Microsoft SQL Server, and most any edition.

Posted in SQL Server | Leave a Comment »

Missouri Consumer Use Tax form for businesses to file

Posted by robkraft on February 10, 2011

I received a letter from the state of Missouri this week asking me to send in a form (53U-1) for my Consumer’s Use Tax for years 2007 and 2008.  I suspect I will get a similar request for such a form some day for years 2009 and 2010.  Getting letters like this always makes me a little nervous.  I wonder if I was not filing something I should have been filing and am about to be hit with huge penalties.

As it turns out, I don’t need to send in the form because I am exempt.  But I do need to send them a letter to let them know that I don’t need to send in the form.  So I made a copy of their letter, put my X in a few check boxes, and mailed it back to them.

Who should be filing this form?  It is for businesses that buy products wholesale (without paying sales tax) in order to resale them to other clients.  So if I purchased a new computer and used my Tax ID to excuse myself from paying sales tax, and then sold that computer to one of my clients, I should be filling out this form.  Even then, you only need to do this if you bought more than $2,000 worth of stuff in one year.

Posted in Taxes and Fees | Leave a Comment »

Long and thorough SQL Server Security Checklist

Posted by robkraft on February 6, 2011

I presented a lecture on SQL Server Security at SQL Saturday #53 in Kansas City in October last year.  As part of the lecture I provided reference to this very long checklist of security considerations for SQL Server.  I think it is very thorough and hope some will find value in it: http://kraftsoftware.com/Publications/SQLServerSecurityChecklist.aspx

Posted in SQL Server | Leave a Comment »

Are you a software development enthusiast?

Posted by robkraft on February 4, 2011

I’ve heard some developers argue that a “professional” is someone that is dedicated to their craft and thus works unpaid hours improving skills.  A lot of developers don’t like this definition of professional because they put in their 40 hours of weekly work but still believe they should be considered a professional.  This is why I use the term “Enthusiast”.  Surely, by definition, only Enthusiasts put in non-paid hours merely for the sake of learning new software related skills that may or may not be applicable to their current job.  I agree that a person can be a software professional, and yet not read any blogs or spend any time on a computer outside of the office; but I think only an Enthusiast spends their own personal time doing such things.

I consider myself to be a software development enthusiast. Do you?

Posted in Coding | Leave a Comment »

 
Design a site like this with WordPress.com
Get started