Monday, December 16, 2013

From concept to reality in 6 weeks - part 22

We have to pick up every a couple of notches today. To start off the day on the wrong foot, my Windows laptop had updates that had to be applied which meant a reboot. The only good thing about that is that it forces me to reboot my Windows laptop which I forget to do after using a Mac for so many years you just forget about it like one should. Why would I ever want to reboot my computer daily or weekly?

On the other hand my wife is sick and is got worse over the weekend, which almost never happens. I keep telling myself that I cannot sick as I now have to finish the rest of the work in two days. I will leave one extra day to change anything the customer wants changing. The good news is that I never expected to have any break over Christmas so now I get one! I definitely need a break to recover as this has been fun but I cannot sustain this for much longer without downtime.

Now to work. I have a new update to the mapping engine this morning that I need to try. I downloaded the ZIP file and updated all of the files in my project. I cleaned the solution and then did a rebuild solution. I then ran the app to make sure everything was still working as it should. The first problem of the day, which I knew there would some issues when I try to hurry up. The server failed with a 500 error. I knew that I was going to run into road blocks today and tomorrow as I try to rush to the finish line.

When I rewrote all of the asynchronous server downloading code yesterday I forgot to put in the debug statements for the URLs being accessed so that would have helped the above 500 error. I need to put those back in and then try again. I also need to add back in the Cancel button on the progress as after the 500 error, the app got stuck. I could actually take care of that case as well. First the debug statements to figure out the real problem and then I will look into handling errors and the cancel button. After I add the log statements, now I no longer see the 500 server error. I don't know how to feel about that. A bug you cannot reproduce is not giving me a warm fuzzy feeling this early in the morning or any time of the day for that matter. I am going to work on the Cancel button to get that to work as a fall back, just in case it happens again. I am going to the number of dat ago download to 24, so it will be easy to tell if the cancel actually works. I then will check to make sure I can start another download as it has to clear everything on the map and start over. Cancel and restarting download from scratch is working - now that is a good start to the day as all of the that finished in only one hour. One thing is absolutely for sure and that as I rewrite code it is definitely getting better with each passing day. Time to check in the code and move on. Wait, I am going to the save the JSON files for 24 hours as a backup in case I do not have an internet connection so I can still do work.

The next big task is finishing the user interface for the download dialog where the user can choose how much data to download from the server to the app. Now that I know all of the underlying code works and is testing, adding the UI and doing something when the user clicks on the Download button will be so easy. At least that is what I am thinking right now anyway!

Every time I use a Grid layout I have to remember the difference between "Auto" and "*". It makes sense when you learn it but it just is not intuitively obvious to me as it just does not fit my mental modal. There must have been some special keyword Microsoft could have created to mean auto-fill all remaining space instead of using a "*". Now what I am over that, I must learn how to use a slider and configure it like I want it to look. First I read up on the standard guidelines for sliders as I don't want to create something that looks and works really oddly on Windows. I take that back first thing is to find the right music for my mood. I have been listening to Jazz this morning but it is just not doing it for me. I switch over to Spotify and try to discover something new from it's suggestions since I have been listening to Spotify for so long. OK, I am switching to blues as that is just about right.

Yet another very long, so I need to recap what I did since my last comment and what I learned. I first tried to use the Perpetuum free controls as I wanted to see if their calendar and date/time controls were good. The bottom line is not what I wanted at all, so I remove the DLLs from the project and removed all references. No need code that does not help me, so it is all gone. Next I looked up how to use the standard Windows Store Metro sliders as I need to show minimum and maximum values, which I had to do myself using a TextBlock, Slider and TextBlock inside horizontal StackPanel. Pretty easy to add tick marks as the Slider just did the right thing by adding minimum and maximum values. That was easy as it should be. I looked up the standard guidelines on using sliders just to make sure I was not doing anything off guidelines.

Then I wanted to learn more about customizing components using styles and templates so I read yet another MSDN web page on that topic. What I have yet to figure out was how to see the existing visual templates in VDE. I found references to it but I just got too impatient trying to find it in VSE. I did find this great explanation on how to create Metro styles. I wish I had more time to explore that in great detail but I am in a hurry today.

Since I got rid of Perpetuum, I need to get up to speed on how to use the Telerik Date/Time component and they have really great documentation so it made my life very easy. Specifically I just skip to the Selector properties as everything just made sense with little documentation reading. It took me a couple of hours to get the dialog looking special like I wanted it to, but the end result made me happy and worth the effort involved.

I spent several hours working with the mapping engine lead developer to make sure I understood all of the issues and a couple of them were indeed misunderstandings on my part where I had to fix my code. By the end of the very long day, I am good on all of the issues and will met him tomorrow to finish off the rest.

To end the day I had to look up the latitude/longitude extents of the continental USA and also including Alaska. With these bounds I can tell the mapping engine how to show that part of the geographic map initially. I found a couple of interesting blog posts on this subject. The most useful one was a link to OpenStreetMaps with the extents showing on a map so I could verify I had them set right. I double checked them on another blog post. I was using the geographic center of the USA  of (39.8282, -98.5795) and trying to change the zoom level but that was too odd. Now I am using visible extents of (24.52, -124.77) to (49.38, 66.95) and that did the trick.

To end the data I re-wrote code to read 24 hours of data from local disk as a debugging aid so I did not have to wait for the server to return the data. At least this verified that the problem is not in my code as 44,000 observations were loaded into the mapping engine very quickly. If I have time tomorrow I will have to look into that some more to find where all of the time is spent as maybe I am doing something wrong in gathering the data from the server.

Right now I am very tired and need to call it another day. Tomorrow will be the last full day of development unless the customer coughs up more money for me to do more work. I am feeling the need for rest...

No comments: