Bill Morefield My thoughts, discoveries, and occasional rambiings.

April 15, 2013

A Goal Reached

Filed under: health — Tags: , — Bill Morefield @ 2:04 pm

On the morning of April 3, 2013, I stepped onto the scale and it read 189.5. The number may not seem that special on a glance, but to me it’s a big milestone. It marks the conclusion of more than two years of work to drop over 100 pounds. To put the change into a bit more into context in 2010 I wore an extra large shirt and forty four inch waist pants that sometimes felt snug. Today I wear either a a medium shirt or small shirt depending on the type and maker and pants with a thirty four inch waist. That’s a drop of three or so shirt sizes and ten inches off my waist. So forgive me a bit to indulge in a bit of a story of getting from there to here. I’ll have another post in a few days more on what I did so think of this more as the overview.

The highest weight I ever saw on a scale came in late 2010 when I weighed in at 290 pounds. While that was the one measured weight, it probably moved 290 and 300 pounds for much of the late summer and early fall of 2010. There wasn’t any kind of epiphany that day. I never really recall a single moment of “I need to lose weight.” If anything it was just the slow realization that I didn’t like being this heavy. At some level maybe that 300 number I knew I’d reach anytime in my current path started the pressure.

As December arrived I started exercising. Nothing outstanding or grand. Some days I walked, but being winter I I mostly used my elliptical. If I remember right my first exercise session lasted about ten minutes and I felt exhausted. I wanted to avoid gaining weight over the holidays and as I got past Christmas I’d succeeded and still hadn’t hit that 300 pound mark. In January I moved to exercising two or three days a week on an elliptical for about twenty minutes at a time. I didn’t really diet, but became a bit more aware of what I ate. Not cutting out anything, but ordering the small instead of the large when eating out.

And it worked. I don’t remember the exact amount, but maybe ten or fifteen pounds as spring 2011 got here. Whatever the amount a few acquaintances and friends commented on it. That was I think the shift, that I’d not only been able to lose weight, but enough to be noticed by others. Don’t underestimate that feedback that came in being a motivation to keep going.

Another incentive with spring coming came from an interest in getting outdoors more for hiking and photography I’d developed the year before. I wanted to be better able to take those hikes without spending as much time resting and recovering as I’d done before. From that first time on the elliptical when ten minutes at a slow pace left me exhausted I could now do thirty minutes at a decent speed. And while I felt tired afterward, I was no longer exhausted. Walking up several flights of stairs into work still left me winded, but not as much as before. I noticed the changes. They were subtle even after a few months, but I had changed.

I again looked at my food intake. I didn’t go onto a real diet and I didn’t stop eating what I wanted. I just ate a little less of it. I’d have a salad on occasion for lunch. I paid attention to portions trying to east smaller ones. No more large fries with lunch and now I’d have one hot dog instead of two or the regular burger and not the double. Not much, but the small things will add up over time. The weight came on over years and it wouldn’t go away overnight. By the end of the summer of 2011 I’d dropped down to about 250 pounds. I exercised pretty regularly now, usually five days a week. The only stretch of any length I missed was after tweaking my back helping a friend move furniture and taking most of a week off to let it heal.

I hit a wall a bit there. I made it to around 245 as September moved to October and really didn’t move much over the rest of 2011. When 2012 began I’d gotten to about 240 pounds. It seemed I’d lost more fat than weight. My health was undeniably better and I had better endurance and strength than probably since I’d been in college. Still I just couldn’t get the weight to budge more. I finally figured out the months of futility came to medicine I took, but whose dosage hadn’t been adjusted for the weight loss. Once I made that change and over the next few months I got my weight down through 230 and to near 225. Then I kind of took the summer of 2012 off a bit and just worked to maintain weight.

By the time I got to fall I was ready for a more serious effort. I wanted rid of the extra weight and back to a normal rate. I was ready to focus and do the work to get there at a faster pace. I set the goal to reach 200 pounds by January 1, 2013.

As September began I started tracking my activity, everything I ate, and my weight daily. Before I’d weighed more sporadically, often just when I remembered to. There are cons to weighing everyday, but overall I think it worked well for me in this case. In September I weighted in at 227. I started a steady drop keeping to a target of dropping a bit over 1.5 pounds per week with the goal of weighing in at 200 pounds on January 1. In the end I missed it by only a few days. I continued the drop through January and took another short break through February. I’m now under the 190 mark that always felt like a big goal to me of getting to 100 pounds below my peak.

I’m not done yet as I have a bit more weight to go. My next target is to get to around 180 and I think I’ll be pretty close to a good weight for me once I get there. In addition to the weight I’d really say the bigger change came in my overall health. I’m probably in better shape now than I’d ever been. I can walk up flights of stairs while having a conversation. I regularly do four mile hikes and while tired, feel quite good after them.

January 15, 2013

Arbitrary Sorting Order in Linq To SQL

Filed under: c#,development — Tags: , , — Bill Morefield @ 3:22 pm

I ran into a situation recently that took me some time to work out and thought I’d document here. I have an older ASP.NET Web Forms application I help maintain. Some upgrades and changes to the workflow used by the customer had meant a few assumptions I’d made no longer applied.

The biggest of these was that a list of values no longer returned from the database the way I’d assumed before. Here is the Linq to Sql that pulled the values to that point.

   1:  var plans = from m in dc.MenuPlans
   2:              where m.client == CurrentClient && m.year == year &&
   3:                  m.month == month && m.day == day
   4:              select m;

As you might guess from this code, it pulls a set of menu plans from a database for a client. Each menu plan is specific to a day. What you can’t see here is that each meal has a meal name that is simply “Breakfast”, “Lunch”, “Dinner”, or “Snack”. Before the meals had been entered in that order and the creation method ensured they showed up in the order being entered.

Now they were being entered in a different order by multiple people and the order of creation no longer worked. The desired order was still breakfast, lunch, dinner, and then snack at the end. Sorting simply by the column wouldn’t work as that would produce an alphabetical order resulting in breakfast, dinner, lunch, and then snack. Close, but not quite.

What I needed was a custom ordering sequence. I could pull the items over in four groups and then append them to a final list, but that seemed messy and slow. I wanted a solution to do so at the database and not have to bring the elements in and sort in memory. I finally worked out a nice solution with this code.

   1:  var plans = from m in dc.MenuPlans
   2:              where m.client == CurrentClient && m.year == year &&
   3:                 m.month == month && m.day == day
   4:              orderby m.mealname == "Breakfast" ? 1 :
   5:                 m.mealname == "Lunch" ? 2 :
   6:                 m.mealname == "Dinner" ? 3 : 4
   7:              select m;

The new code lies on lines 4-6. What I do is compare the element that I want to sort by to the values in the order I wish things to show. I’m using the binary operator here. If you’re not familiar with it, this works like a compact if/then statement. The binary operator:

   1:  return x > 0 ? 0 : 1

Is equivalent to the following if/then statement.

   1:  if(x > 0)
   2:     return 0;
   3:  else
   4:     return 1

So the code lets me map the string values to numeric values arbitrarily. Breakfast maps to 1, Lunch maps to 2, Dinner maps to 3, and any other value to 4. Since the result of this is a set of integers, the ordering works the way I want.

While the code looks a bit messy, it translates nicely to SQL that runs on the database server through a CASE statement and I get the order I want without any extra processing in the web application.

October 1, 2012

Apple Maps and What’s the Problem

Filed under: iPhone — Tags: , , , — Bill Morefield @ 10:09 pm

Every iPhone release seems to bring some kind of debacle varying from real to merely a search for clicks on the web by writers. The commentary usually starts with the normal “Apple is finally losing it” to “Apple can do no wrong” and then somewhat sane reality comes in. The iOS maps debacle, which is an iOS issue and not an iPhone issue, looks to be the most valid and worst of them. I’ve followed this one with some interest as I’ve planned to upgrade to the new iPhone.

The issue was driven home a bit to me over the weekend. I was in the northern part of the Cumberland Plateau in Middle Tennessee Sunday looking for two places. One was a place that I’d last visited in my college days and the other one I’d only read about. Along with me were some directions and notes. Neither was a spot you could just plug into a GPS and get directions which admittedly is my normal way of getting somewhere now.

The first spot I found with no problems between good directions and vague memories. It was in fact a more lovely location than I remembered. The second I never found though I drove within a few miles of it. The reason, my directions left out a single turn, a short trip of less than a quarter mile, that meant I never saw the road I was searching for. As a result eventually we gave up and had to abandon the quest for another day.

While driving back home I thought back to when several years ago I learned that at least one major GPS had a mistake on the addresses on the street where I live. The street is a circle, a short loop of about thirty homes. That brand of GPS, or more exactly the map provider they used, had the addresses backwards so that if you followed them you’d likely end up exactly on the opposite side of the circle from where you actually meant to go.

In the daytime this was a  minor issue since the address numbers on the home would tell you that you were in the wrong spot. At night where these numbers were invisible, it wasn’t so clear. More than once someone I’d provided directions to my house wound up knocking on the wrong door or realizing something didn’t look right and calling me while from the street. It’s how I learned there was a problem and for a while I always added the warning when someone visited the first time.

Both of these had the same basic issue. Bad data. The GPS data was beyond my control and I did the only thing I could do, warn visitors not to trust the address on their GPS. The never found place on Sunday was my largely my fault. I could have checked or verified the directions before I left or at least checked a map well enough to have realized something was off in time to get to the right spot. In both cases though the data I had failed me.

The first time I remember using a computer map system to find directions to a place I’d not visited before it told me to use a bridge that no longer existed to cross a river. On a trip in Kentucky a couple years ago a road under construction and not in my GPS caused it so much confusion my GPS actually crashed and had to be restarted. A construction project I drive through several times almost every day has shifted the entrance and exit patterns to a shopping center, college, and mall several times in less than a year and will do so several more before being complete where the pattern will be completely unrelated to the original one.

And that’s the problem Apple is facing with maps. Map data is often inaccurate. Even good data is often behind. It’s so much easier to travel now with GPS data and maps available on demand on your phone. I’ve learned the art of interpreting the GPS, trusting it enough to get me there, but also expecting it to be wrong at times and using common sense.

The bigger issue is that the overall accuracy of the data doesn’t matter. What matters is how the data is where I want to go. All I know is that one of the two sets of directions I used Sunday was wrong. It doesn’t matter if every other one on the site is perfect, I’ll remember the one that was wrong and never trust them the same way again. Right now that’s what people think about Apple’s maps

It doesn’t really matter where it might be wrong because it will always be a little wrong somewhere and each time I or someone I know gets wrong directions that will be reinforced. I’ll probably take a long time before I trust Apple’s maps to get me there which might be the biggest problem they face now. Apple has to make maps that work not as well as Google, but better and for long enough that everyone forgets how bad a start they got off to.

September 20, 2012

Recent Articles

Filed under: article — Tags: , , — Bill Morefield @ 9:31 pm

Here’s a few articles that I’ve recently had published:

August 20, 2012

My Review of Skip Tunes for Mac OS

Filed under: article — Tags: , , — Bill Morefield @ 6:11 pm

An excerpt:

Most of my solo work time passes with music in the background. Sometimes I’m playing music from my iTunes library, and sometimes I’m streaming music from online radio stations or subscription services. Controlling it all can be a pain….

Skip Tunes is a simple menubar app that offers a solution. It runs in your menu bar to let you control the your music from the menu bar or with keyboard shortcuts. How well does it work?

Read the full Review…

August 15, 2012

A Couple Recent Articles Posted

Filed under: Uncategorized — Bill Morefield @ 8:41 pm

A couple articles/reviews of mine published this week.  First back on Monday a look at what PowerShell for Windows let’s you do on Windows.AppStorm.

Also my first article for Mac.Appstorm reviewing SideEffects, a program that puts color icons back into the sidebar in Finder.

July 6, 2012

Creating HDR photos with Luminance

Filed under: Uncategorized — Bill Morefield @ 3:54 pm

My article on Creating HDR photos with Luminance is up on Windows.AppStorm. A preview:

HDR attempts to compensate for the lesser dynamic range of a camera by taking multiple images that together cover the entire dynamic range of the scene and combining them together to produce a photo that better presents the full dynamic range in the original scene. Many high end graphic processing packages such as Photoshop contain the ability to create HDR images. Other specialty programs designed only to create these images also exist. Creating these images does not require expensive specialized software. Here we’ll look at using the free open source Luminance to produce HDR images.

Read the rest on Windows.AppStorm

June 27, 2012

Fixing Error when Building Windows Phone Apps on Network Drive

Filed under: development — Tags: , — Bill Morefield @ 6:31 pm

I’m working on building a Windows Phone application and ran into an interesting error that took some time to track down and I thought I’d share the fix here. I normally develop on a Windows virtual machine running on my MacBook. To make backups simpler and to sharing files between machines easier, I map the documents of the virtual machine to the MacBook’s documents folder. This means that my documents folder inside the VM appears to be on a network drive.

When I tried to compile my phone app for the first time I got an error similar to this:
Error : Could not load the assembly
Path to Assembly\MyApplication.dll.
This assembly may have been downloaded from the Web. If an assembly has been downloaded from the Web, it is flagged by Windows as being a Web file, even if it resides on the local computer. This may prevent it from being used in your project. You can change this designation by changing the file properties. Only unblock assemblies that you trust. See http://go.microsoft.com/fwlink/?LinkId=179545 for more information.

This belongs on the all time list of bad Microsoft error messages in that it not only is wrong, it’s downright misleading. the article discusses assemblies downloaded from the web. In my case the problem couldn’t have anything to do with the assembly being downloaded form the web. First the assembly in question is one that I’m trying to compile. There is no option to unblock as the article suggests as a fix.

I finally figured out the problem comes from the assembly, and my whole project, resides on a network drive as far as Windows is concerned. The first and most common fix I found was to move the project to the local hard drive. That wasn’t my first option so I looked into alternatives.

I finally found an article on Microsoft’s web site that gives a fix at http://msdn.microsoft.com/en-us/library/dd409252%28VS.100%29.aspx, but even this article has problems. It tells you to ignore it in the header and refers to the other article in spite of it being the actual fix for what’s probably a more common problem (purely my speculation, but I feel more people are probably accessing assemblies on a network drive than downloading them from the Internet). It also doesn’t really tell you where to apply the fix. The change needs to go into the devenv.exe.config file under C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE (or C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE if you’re running a 64 bit OS). Under Windows 7 the file and folder are protected making the file a bit tricky to edit so here’s the process I used.

  1. Copy the devenv.exe.config file from the appropriate IDE path for your OS to a directory you have full rights to (your documents folder for example).
  2. Open the copy of the file in a text editor (Notepad for example) and look for the line
    <runtime>
    which will be close to the top of the file.
  3. Directly under this line add the following line
    <loadFromRemoteSources enabled=”true”/>
  4. Save the changed file.
  5. Now copy the edited file from your temporary directory back to the directory you moved it from. You will be told it requires admin rights and have to grant them. Do so.
  6. Restart Visual Studio and it works.

June 4, 2012

What I Want in IOS 6

Filed under: apple,iPhone,mobile technology — Tags: , , — Bill Morefield @ 1:17 pm

By the time IOS 6 likely comes out in the fall I’ll have been using IOS for two years.  Overall I enjoy my iPhone and iPad in spite of the occasional quirks.  No technology is perfect and I’m too much of a technically minded user to ever completely like any system that I didn’t create.  With IOS 6 likely to be announced soon, I thought I’d throw my two cents on the changes I’d like to see in the next version of Apple’s mobile OS.

A Common Documents Storage

Many of my annoyances with IOS would go away with this single change.  I’m not talking about a full file system access to everything on the device, but just a single document area that all apps can access.  I want to be able to create a file in QuickOffice and be able to edit it in Pages.  I want to be able to save a file as a PDF in one app and then read it in GoodReader later.  The independent silos where all apps are self contained mean I often have the same file on my device multiple times.  I think this is the biggest obstacle to using the iPad as a creation device.

Another thing a centralized document system would allow are easier email attachments and multiple attachments to an email.  Imagine being able to email two photos at the same time to someone.

Better Data at a Glance

With IOS an icon generally tells me nothing other than I can tap it to start an application.  I can get a number, but a single number can only tell you s much.  It’s useful for how many like unread messages or voicemails I have, but tells me nothing about who sent those messages or called.

Microsoft is doing this right in Windows Phone and Windows 8.  The weather apps shows me at a glance if I need my umbrella that day.  The sports app shows me who won last night.  I’d love a small block on my iPhone to show me these things.  When I’m busy let me find what I need and go.

Conduits Between Apps

Why does every developer have to write DropBox integration into their App?  Give an interface that app developers can write against and then let DropBox, SugarSync, Google Drive, and everyone else write their own handler of that interface.  If I want to use Microsoft’s SkyDrive to store my files, I don’t want to worry about if the developer chose to integrate it.  Let Microsoft write an implementation of SkyDrive and then every app instantly supports it.

This would work for so many things.  Let’s say I have a program to manage my photos on my device.  I use 500px to post my photography, so why not a search interface that let’s me search for photos there just like searching for photos on my device?  The integration options would really open up apps to the world.

Better App Organization

I really don’t need or want two folders with the same name because I have one more than the limit Apple decided I should keep in one.  There is no way that having Games 1 and Games 2 makes sense.  Let me put more things into a folder or even better let me put as much as I want into a folder.

Centralized Communication

I’ve always wanted a unified communication point.  I want all my email, text messages, even phone calls and voicemails in one place.  I want to see Facebook updates, RSS updates (yes I still use those), Google+ posts, and tweets there too.  Tie this in with the connectors mentioned above so that anybody could make their service available to the hub.

Bring my digital life to a centralized point and let me choose what I want to see at a given time.  If I’m meeting someone for dinner I may want to just look for any texts or emails from her or for a tweet about being traffic letting me know she’ll be a little late.  If I’m coming back from a week’s vacation in the mountains, I want to see everything work related from the last week, but only from co-workers.

Stop Worrying So Much if Apple Gets it Cut

I know this one has zero chance of happening, but it’s just an annoyance I’d like to see go away.  Apple seems determined to make sure nothing happens on the device where Apple doesn’t get it’s 30% cut.  Want to buy a book for the Kindle App?  Have to go to the web site as Apple’s rules would require Amazon to give Apple a 30% cut if it could be done there.

This simply makes my life less convenient and isn’t making Apple any more money.  Vendors have overwhelmingly shown that they’ll just remove the functionality to purchase in app and rely on their customers to find them somewhere else.  And it’s working.  I don’t use iBooks because it’s more convenient, I use Kindle because it’s what I want.  My audiobooks come straight from Audible.

That’s my wish list for iOS 6.  Anyone else with requests?

May 29, 2012

My Review of CrashPlan on Windows.AppStorm

Filed under: article — Tags: , , — Bill Morefield @ 6:37 pm

Think about everything stored on your computer right now. Photos of special moments, that great vacation, or the last time you saw a friend, copies of the project that you’re working on for months or the paper you’re writing. Financial and tax records.

What happens if something happens to your computer and all that was lost? Let’s take a look at how to avoid all that tears and heart ache with CrashPlan!

Read the Rest…

« Newer PostsOlder Posts »

Powered by WordPress