Now that I have a sweet 24 inch cinema display in the same room as my bike, I was looking for a way to get my tivoed shows from my Tivo to my Mac. Unfortunatly, the software provided by Tivo only allows you to share your music and photos from your computer to your Tivo while the Windows version allows you to access your shows from your computer. I tested a few different apps and I only found one that worked well and is free. It is called iTivo and it can be found here. It works pretty well. The only negative is that it takes a long time to transfer the show. Luckily they have queue functionality so you can transfer them overnight. Now I am watching shows while cycling without paying the insane $2.99 that iTunes is trying to get per show.
08
Mar 10
Change is Good
Every once in a while you have to take a risk if you are ever going to see improvements. Last month I decided to leave my job at W3i and I started a new job as a Senior Software Developer with a company in Maple Grove called Data Recognition Corporation. This was big step for me but one that was needed. My main motivation was getting to the Twin Cities area since that is where 99% of my friends are. I have never had the intention of staying in the St. Cloud area for so long. There is nothing about this city that I like except for the place I was working. I also realized that I was losing passion for what I was doing and at a very fast rate. Passion about what I am doing or building is my fuel which ensures that I put 100% into it. At W3i I started as a Software Developer, then Team Lead and finally Software Development Manager. After much thought I realized that agreeing to move up into management was the worse thing I could have done for myself. I was getting further away from technology and that is why I was losing passion. I found that I was spending most of my days in meetings or doing HR related things instead of building great systems/applications. Then I read the book Now, Discover Your Strengths. This book really hit home. I was spending day in, day out trying to figure out how to improve on my weaknesses versus spending that energy on leveraging my strengths to be successful. So after much thought I made the decision to leave. It has only been a month but I can say that I made the right decision. I love what I am doing and it is so refreshing. I already have results at my job that I am very proud of and couldn’t be happier. I do miss the people at W3i though. That was the hardest part about leaving. It is a great group of people and I can’t say enough nice things about the company. I also do miss my 5 minute commute. Currently I am driving to Maple Grove everyday. Traffic hasn’t been nearly as bad as everyone made it out to be, but regardless it is still two hours of the day that I could be working, exercising or doing something besides driving. I really hope my house sells here in the next 1 to 3 months so that can change.
05
Mar 10
Easily Saving ComboBox Values in Windows Forms
A common thing that one might want to do is save the values in a combobox between application uses. In my case, I wanted to save SQL Server names once a user was able to connect successfully to that server. This way when the user came back they could select that server from a drop down list. If it isn’t in the list than they can type one in.
I found that the easiest way to do this is to add an application settings file to your project if one does not exist already. Then add an entry to save the values. I gave mine a name of Databases. I selected System.Collection.Specialized.StringCollection as the type. I chose user for scope so the value can be changed at runtime. If you choose application this value cannot be changed at runtime. The BindServers method takes the settings from the list and converts them to a generic list of type string. It then simply binds this list to the combobox. The SaveNewDatabase method is called after I confirm that server exists and that I know the user has access to it. This method gets the string collection again. It then makes sure the server isn’t already in the lists and if it doesn’t it adds it. It finally calls the save method to save to the settings file. Don’t forget to call this method.
Private Sub BindServers()
Dim list As List(Of String) = Settings.Default.Databases.Cast(Of String).ToList()
With cbServer
.DataSource = list
End With
End Sub
Private Sub SaveNewDatabase()
Dim list As List(Of String) = Settings.Default.Databases.Cast(Of String).ToList()
If Not list.Contains(cbServer.Text) Then
list.Add(cbServer.Text)
Settings.Default.Databases.Add(cbServer.Text)
Settings.Default.Save()
End If
End Sub
04
Mar 10
Comparing Database Schemas and Data in .NET
Currently at work I am working on an application that does a database difference on particular tables in two databases. The application needs to allow a user to decide if they want to move over records to one database or update them if they already exist. This is very similar to SQL Delta, SQL Compare or the tools in Visual Studio Database Edition. We are writing this custom because we have business logic that needs to occur when moving the data.
While trying to find the easiest way to accomplish this I ran across a lot of resources on the net. There was an easy way, however, I think the posts are old because they are missing some key points. I spent a while trying to figure this out. In the first method you simply populate two datasets with data. I am grabbing data here from the same table in two different databases. I have already ran a check to make sure the schemas are the same between the two databases. After I do this I create a third dataset. I simply merge the destination dataset into the merged one. You then HAVE to make sure you AcceptChanges here because you don’t want these changes to be included in your diff. Finally you merge the source database into the merged dataset. Finally this method returns a dataset that contains the changes. The GetChanges method takes in one parameter which allows you to specify if you want modified rows, new rows or deleted rows. You will get all differences if you don’t specify that parameter. Now, for the fun part. The part that all the blogs and examples left out. You MUST do a few things to your DataAdapter for this to work. I spent a lot of time figuring this out this afternoon. First, you must make sure that you set the AcceptChangesDuringFill property to false. If you do not do this, it basically accepts the changes as soon as you do a merge. You will end up with what appears as no changes if you do not do this. The second thing you must do is call the FillSchema method and also set the MissingSchemaAction property. If you do not do this the tables in your dataset will not contain the schema of the table. Most importantly, the primary key. To be able to do a difference on the tables a primary key must be specified. By calling FillSchema the same primary key that is set in your database will be set in your dataset.
After getting past the DataAdapter issues I was pleasantly surprised with how few lines of code it takes to get the difference between a table in two databases.
My code plugin doesn’t handle long lines of code well. For a better format just hover over the code and click the markup button on the dialog that appears.
Public Shared Function GetChanges(ByVal sourceConnectionString As String, ByVal destinationConnectionString As String, ByVal tableName As String, ByVal rowState As DataRowState) As DataSet
Dim sourceDS As DataSet = GetDataset(sourceConnectionString, String.Format(My.Resources.SQLQueries.GetAllDataForTable, tableName), CommandType.Text, "ds")
Dim destDS As DataSet = GetDataset(destinationConnectionString, String.Format(My.Resources.SQLQueries.GetAllDataForTable, tableName), CommandType.Text, "ds")
Dim mergeDS As New DataSet()
Dim mergedDS As New DataSet
mergedDS.Merge(destDS, False)
mergedDS.AcceptChanges()
mergedDS.Merge(sourceDS, True, MissingSchemaAction.AddWithKey)
Return mergedDS.GetChanges(rowState)
End Function
Public Shared Function GetDataset(ByVal connectionString As String, ByVal command As String, ByVal commandType As CommandType, ByVal dsName As String) As DataSet
Dim sqlConn As New SqlConnection(connectionString)
sqlConn.Open()
Dim sqlCommand As New SqlCommand(command, sqlConn)
sqlCommand.CommandType = commandType
Dim sqlAdapter As New SqlDataAdapter(sqlCommand)
Dim ds As New DataSet(dsName)
sqlAdapter.AcceptChangesDuringFill = False
sqlAdapter.FillSchema(ds, SchemaType.Source)
sqlAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
sqlAdapter.Fill(ds)
sqlAdapter.Dispose()
sqlCommand.Dispose()
sqlConn.Close()
Return ds
End Function
02
Mar 10
Twin Cities Technical Events
It seems like there are many cheap or free events technical events in the Twin Cities in the upcoming month. Especially if you are looking for mobile sessions. I am planning on attending three already. I thought I would share them in case anyone else is interested.
- Twin Cities Code Camp (April 10th, 8:00 AM to 5:00 PM) - This is a free event and is always good. I have been to three of them and have heard some very interesting sessions. I highly recommend this one.
- Mobile March (March 27th, 8:30 AM to 5:30 PM) - I just signed up for this one tonight. It cost $20. You get lunch though so it is practically free. I am super excited for this one because I am very passionate about mobile development. Mobile development is going to be huge. There is time to socialize afterwards as well and have a few drinks.
- Android Development for .NET Developers (April 6th, 6:00 PM to 7:30 PM) – This looks to be another very interesting session. Unlike the other two, this is not an all day event.
Let me know if you plan on attending these in the comments. It would be great to see some familiar faces.
28
Feb 10
VB.NET and the With Statement
Disclaimer: The real reason I am making this post is to test out a syntax plug-in for WordPress to see if it highlights/formats code correctly. With that being said, at my new job they do some development in VB.NET. It isn’t my language of choice, however, if you know C# it isn’t that different. All the libraries are the same as well as the concepts. There are a few small things though that are different between C# and VB.NET. One thing I learned on Friday is that the refactoring tools in Visual Studio 2008 are not supported with Visual Basic. I downloaded some third party tool for that though and will post a review once I have more experience with it. This last week I did learn of one syntax feature that VB has that C# doesn’t though. That is the WITH statement. All it does really is allows you to keep your code cleaner when you are setting numerous properties of the same object.
Here is an example of binding a combo box in VB.NET and setting it’s DisplayMember and it’s ValueMember. This syntax pretty much indents your setting of properties and it also allows you so you don’t have to type the name of the object over and over again.
With comboBox
.DataSource = connectionStrings
.DisplayMember = "Name"
.ValueMember = "ConnectionString"
End With
Here is an example of what this looks like in C#. You can use this exact same syntax in VB.NET as well. You aren’t forced to use the WITH statement with VB.NET.
comboBox.DataSource = connectionStrings comboBox.DisplayMember = "Name" comboBox.ValueMember = "ConnectionString"
Now obviously I gave a simple example, however, this feature is very handy if you’re setting a lot of properties. A better example might be when you are styling a GridView from the code behind or populating an object from a DataRow.
06
Jan 10
Make Your Blog Mobile Friendly
I don’t know how many bloggers are left since the introduction of microblogging sites such as Twitter, but I thought I would share a plug-in I found for blogs using WordPress. The plug-in is called WPTouch and can be found here. Simply installing and activating the plug-in will change the theme of your blog when someone visits it from an iPhone, Android device, or another smart phone. Installing it won’t only make your blog more user friendly it will make it load faster. Let’s face it; even though internet speeds have increased over the last few years they still aren’t that great.
Here is an example of what this blog that you are currently reading looks like on an iPhone:
03
Jan 10
Top 10 iPhone Applications of 2009
In the spirit of tradition I thought I would post my favorite iPhone applications of 2009 like I did last year. The apps listed are the ones that I use the most and not necessary the coolest or the most innovative. This list excludes the native iPhone applications like mail, calendar or calculator. The apps are listed in order from the most to the least used.
iFitness – $1.99 (link)
This application is a steal for $1.99 and is the app that I used most in 2009. I use it as an exercise log so I can keep track of my weight, reps and history. It does a lot more than that though. It has a whole library of exercises that contains pictures, video and text descriptions of the exercises to ensure you do them properly. It also allows you to view graphs of your progress. This application has a TON of functionality, but remains one of the most user friendly interfaces. The application allows for easy data entry at the gym so you don’t look like a big geek who won’t get off your iPhone while working out. I also enjoy that they have updates very often. They are constantly adding more value and making the application easier to use.
GroceryIQ – $0.99 (link)
This application was great earlier in the year and it just got an update that makes it 10 times better. This application has saved me a ton of time in the place I hate most on earth, the grocery store. It allows you to make your grocery list at home. You can type in items or you can choose from a list of favorites. It assigns the items to the correct area of the store so you won’t find yourself wondering from one side of the store to the other. Earlier in the year I was wishing the application would have the ability to scan barcodes like RedLaser. Early in December, they had a release that now has this functionality. All one needs to do is click the scan button and use the iPhone’s camera to scan a barcode and the item will be added to your grocery list.
Facebook – Free (link)
The Facebook application made my list for the second year in a row. This application had a major upgrade this past year with iPhone 3.0 being released. In my opinion, it is the best designed iPhone application out there. It just isn’t number one because I don’t use it the most. The only thing that it still lacks is push notification. This is supposed to be in the next release, however, who knows when that will be since the main developer of this application quit this past year due to Apple’s strict requirements on iPhone developers.
Tweetie 2 – $2.99 (link)
Tweetie 2 is my twitter client of choice along with most other twitter users on the iPhone. It got a major upgrade this past year as well. So much of an upgrade that they made it a new application in the app store and even if you had the first version of Tweetie you still had to pay for this one. It is worth the price though. It supports pretty much all of Twitter’s functionality, even the newer things like retweet, lists and geotagging. The only downfall of this application is that it doesn’t have native push notifications.
Boxcar – Free* (link)
Neither Facebook nor Tweetie 2 has push notifications. Boxcar is an application that allows you to add push notifications to these applications. Wither someone is writing on your wall, liking your status, commenting on your picture, sending you a direct message or replying to you; you will be notified on your iPhone. You can view that notification and boxcar will open the corresponding application. The application is free as well as the first service. Additional services cost $0.99. I only use this for Facebook and Tweetie 2 so I paid $0.99.
Remember the Milk – Free* (link)
This application compliments the website Remember the Milk. Remember the Milk is a task management application that allows you to add tasks, change their due dates, change their priorities and so on. It has a lot of features and is a well designed application. The application is free in the app store, however, there is a yearly charge to use pro services at rememberthemilk.com. The cost for the pro service is $25.00 per year. The web interface for Remember the Milk rocks as well.
CNN – $1.99 (link)
CNN joined the app bandwagon this year and released a full featured CNN application that allows you to read stories, watch video and submit news as it happens where you live. When there is breaking news you can watch live video. This became real handy when a co-worker didn’t believe me about Balloon Boy. CNN made a bold move with this application that hadn’t been done in the app store or at least not with a popular application. CNN charged for the application AND they decided to show display ads within the application. I complained for a few days and still think it is greedy, but I also do think this is the best news app in the app store right now.
The Weather Channel – Free (link)
There’s not too much to say about this application except for it is my most used weather application. One feature that is very useful is the radar tab that allows you to see where the storm is and in what direction it is moving. I used this feature several times this past summer while cycling and trying to avoid the storms. There is a pro version for $3.99 which I haven’t researched so I don’t know what it offers additionally.
TomTom – $49.99 (link)
This was one of the most highly anticipated applications this past year. TomTom is well known for their stand-alone navigation devices and this year they brought it to the iPhone. It is a well designed application and it has improved throughout the year. You need to make sure your iPhone is plugged into a power source while using this application because it will drain the battery in no time if you don’t. There is a separate piece of hardware that you can buy that will mount the iPhone to the dash, enhance the GPS signal and charge while driving. I don’t have this, but I have been driving and have had the app fail when I needed it the most because it had a weak GPS signal. Not cool.
Kindle for iPhone – Free (link)
In my opinion, this application is only cool if you have the kindle. This application allows you to read books on the iPhone. I don’t think this is something I would want to do long term though. The neatest thing about this application is that I can buy a book and read it on my kindle, but then if I go somewhere where I have some time to kill I can just take out my iPhone and this application will sync to where I left off on my kindle and I can start reading. Once I am done my kindle will update to where I left off on my iPhone.
So there you have it; my favorite iPhone application of 2009 based on usage. What are some of your favorites that were released this year? Leave them in the comments so I can check them out.
Here’s to an innovative 2010 for iPhone applications!!
02
Jan 10
My 2010 Resolutions & Goals
Here are my 2010 goals. What are some of yours?
- Sell my house!
- Get 2,250 miles in on my bike.
- Complete the 2010 Red Ribbon Ride and raise $2010 for charity.
- Gain 10 lbs. (Muscle, not Fat)
- Hit the gym 156 times (Min of 3 times a week).
- Develop an iPhone application.
- Drink more water.
- Go on a vacation to somewhere I haven’t been in the U.S.
- Build new friendships and strengthen existing ones.
- Go to Blue Earth and Vincent once to visit my parents.
- Read more books on technology, leadership, self-improvement.
- Write 24 blog entries that actually have substance!!
13
Sep 09
Finished!! Rode my bike from the Twin Cities to Duluth!!
And my reward was taking a shower in this nasty building.
Sent from my iPhone
