Push It Real Good – Version Control in Real Life

Several weeks ago, Chris gave Ada and I a mini-workshop on “version control.” Wondering what that is? (I certainly was, at the time) In non-programmer’s terms, version control describes how, when several people are working on the same code, they make sure that they are working on the most up-to-date version that includes everyone’s edits. Version control uses some pretty entertainexplainingversioncontroling jargon; for example, you “pull” the most recent version of a file, and then “push” the changes you’ve made. Each change must be “committed” to update the file. That way, there aren’t a slew of working copies floating out there and no one knows which is the most recent version. Visually, you could think of it like this:

 

A few days later, Ada mentioned that the whole push/pull thing was a lot like going through various stages of life, wherein one “pushes” a life change (like starting university or a job) into your life and that change becomes integrated (i.e., committed)stick01 into the main branch (i.e., the master copy) of your life. I wondered what it might look like on paper…

The earliest thing I remember wanting to be was an airline pilot. Don’t ask me why. Jumbo jets impressed my 7 year old self.

stick02

I think veterinarian came next. (foreshadowing for cats?)

stick03

Then physician (glad I got that out of my system as an undergrad!).

stick04

Then research scientist. That actually lasted for quite a while.

stick05

 

This overlapped with restaurateur (not going to elaborate that one today…). This is where things got confusing…I think it was a “multiple working copies and I don’t know which version is the most up to date one” kind of situation.

 

stick06And here we are at the Officer Sunglasses version. There are tons of changes in this version (more than I have space for here). Looking back at the chain of command, I can see how all past changes lead to this one, even if that isn’t immediately apparent. So don’t be afraid to push changes. Push it. Push it real good!

Posted in Fun, Goal App | Comments Off on Push It Real Good – Version Control in Real Life

Fixing MSBuild not Exiting

After upgrading to Visual Studio Xamarin 4.1 from 4.0 our TeamCity build suddenly stopped working.  Actually it was working but won’t stop working.  The build would get hang after rebuilding out solution to create the IPA file.

The step in question looked like:

Solution Runner That Hangs

The TeamCity logs looked like:

[09:23:28][Foo\Foo.iOS\Foo.iOS.csproj] _SayGoodbye
[09:23:28][_SayGoodbye] SayGoodbye
[09:23:28][SayGoodbye] Compute signature for bin\iPhone\Release\FooiOS.app

The build would also hang if I logged into the build machine and ran the msbuild via the command line.  However, the build would not hang if built via Visual Studio.

The error only occurs when creating the IPA file.  If compiling non-IPA project, even a iOS project that doesn’t create a IPA, everything works as expected and msbuild ends when it should

Fixing the problem involved telling msbuild to quit once it’s done.  You can do this by setting and environment variable and/or msbuild arguments.  I did both because why not.  The environment variable should be set like:

MSBUILDDISABLENODEREUSE=1

The command switch in question is:

msbuild YourApp.sln /m:4 /nr:false /t:rebuild

The /nr switch tells msbuild to quite once it’s done.  The /m switch tells how many cores to use.  This actually won’t help with the issue but it does speed up my build a bit.

To read more about the above fixes see these Stackoverflow links:

http://stackoverflow.com/questions/13510465/the-mystery-of-stuck-inactive-msbuild-exe-processes-locked-stylecop-dll-nuget

http://stackoverflow.com/questions/3919892/msbuild-exe-staying-open-locking-files

In TeamCity I tried adding the environment variable as a environment property but that didn’t work.  Adding the /nr switch as a parameter to the Solution Runner also didn’t work.  I had to create command line build step as shown below.

Command Line Build Step

The script that is cut off looks like:

set MSBUILDDISABLENODEREUSE=1
"C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe" YouApp.sln /m:4 /nr:false /t:rebuild /p:Configuration=Release /p:Platform=iPhone /p:ServerAddress=%MacIP% /p:ServerUser=%MacUser% /p:ServerPassword=%MacPassword% /p:ContinueOnDisconnected=false

By the time you read this this issue will hopefully be resolved but maybe someone will find the above helpful.  That or it’s just me experiencing it due to some weird configuration issue.

P.S. – Xamarin 4.1 also moved and renamed the where the IPA gets created and this will also break you build scripts.  The IP is now created in a time-stamped folder just to make it more of a challenge for your script.  You can read more about it:

https://forums.xamarin.com/discussion/67044/ipa-output-location

Again hopefully this will be fixed the IPA file created in a non-time-stamped location.

Posted in Code Examples, Software Development | Tagged , , , | Comments Off on Fixing MSBuild not Exiting

What Would Goal Buddy Say – Part II

I have been mastering small (and some medium-sized) goals, like working out every other day, purchasing a study manual for the APCAT (the written entrance exam for EPS), volunteering twice weekly at the John Howard Society, and driving around with a tiny police cruiser perched on my dash (for good luck, of course), to name a few. Committing to do each one of those is far easier than declaring, “I want to be a police officer,” and then feeling hopelessly lost and overwhelmed because the entire endeavour is so daunting that one might not know where to start.

Part of what makes Goal Buddy unique is that it encourages the achievement of large goals through starting with small and achievable ones. Things that you might accomplish in a week (or an hour, even), but help build patterns of behaviour amenable to the achievement of grander goals.

But what happens if you get stuck? The Saturday Morning Productions crew pondered this quandary. Would a reminder on your phone help? What if you kept missing the goal? Should you abandon it, modify it, or change the timeline? I’m not sure that there is a clear answer to that yet, because there are many reasons why one might miss a deadline for achieving a goal. However, I do know that failure is a destructive feeling that one might experience if a goal is missed.

It’s been a while since I’ve written a detailed blog post (writing them frequently is a goal of mine). I must confess that my head has been elsewhere, namely, due to factors I erroneously thought were beyond my control. Over the last few weeks, I’ve struggled to meet my goals (as outlined above) due to a situation elsewhere. It was like trying to swim while wearing leg irons. I wondered if leaving or staying in that situation would negatively affect my end goal (i.e., Would I get a bad reference if I left? Would I be seen as a quitter?). I indeed wondered what Goal Buddy would say.

Ultimately, after much thought and consultation with close friends, I knew that staying would be a huge hindrance and I opted to remove myself voluntarily from aforementioned situation. While there were many aspects of the situation that I could not influence, there was one variable over which I had complete control: my own choices. Modifying the timeline or nature of a goal is not failure. It is merely a reconfiguration of factors to set yourself up for success.

Things, my friends, are looking up!

Posted in Fun, Goal App | Comments Off on What Would Goal Buddy Say – Part II

Best Productivity Article

As we continue to work on Goal Buddy I’ve been reading books and research papers about goal setting and its cousin productivity.  Productivity is just a fancy word for saying “get stuff done”.

Some interesting articles/podcasts about productivity I recently read/listened to are:

Freaknomics: How to be More Productive

Joshua Kennon: The Secrets of Highly Productive People

However, these articles don’t hold a candle to this best article about productivity.  Be warned that reading this article will shake you to your core.  You will re-think how you approach work and view your co-workers in a different light.  Make sure you are sitting down.

The Onion: Study Finds Working At Work Improves Productivity

Yes it’s The Onion.  You know the joke website but it’s still a good read and sums up everything else in other articles about getting stuff done.  So quit reading this and get back to work.

 

Posted in Business Side, Fun, Goal App | Comments Off on Best Productivity Article

What Would Goal Buddy Say?

Support can make or break a goal. When we circulated a survey several months ago, asking the general public how (and if) they would use an app to help them achieve a goal, a large number of respondents indicated that lack of support was a primary reason that they had not met goals in the past. Support often comes from an external source – another human being close to you, typically – but powerful support also exists in electronic guises like social media platforms, forums, online discussion groups, and in apps.

Indeed, our own Goal Buddy app is intended to fulfill a support role for the user, lending motivation in a friendly but non-intrusive way. Like a friend would. The entire Saturday Morning Productions team has asked itself, when faced with a challenge, a conundrum, or a goal:

What would Goal Buddy say?

How can we make Goal Buddy’s “voice” (for lack of a better term) human? More importantly, how can GB’s communication with the user be tailored so that its messages are effective and welcome? Moreover, how can we strike the right tone? Some of us respond to drill sergeant-type orders, and others need less militaristic encouragement. Neither way is right or wrong, but it isn’t always easy to know which voice people (or oneself, for that matter) people respond to.

We thought about it this way: what would you say to a friend who had embarked on a grand journey towards a significant goal (one that, like virtually all huge goals) consisted of many smaller pieces? I would do my best to be kind, positive, and patient – all the qualities I value in my friends – but, at the same time, if my friend kept not doing what they say they wanted to do, I would ask them if that is indeed what they want. We all miss doing things from time to time (like if you get sick and can’t go for your daily run, for example), but if skipping out on things becomes a pattern, it may be time to reexamine the situation.

My own goal situation – the goal of joining EPS – has become a bit of a case study for Goal Buddy’s development (which is flattering and cool – I’ve never been a case study before!), and is timely because such a significant goal is inevitably comprised of many small hurdles that must be cleared before the giant, final, hurdle is conquered. It’s made a world of difference knowing that someone expects me to be at the gym every other day, but there are other things that don’t have an audience. Like studying for the entrance exams, keeping on top of current events, and remembering to keep a positive inner dialogue going. Sometimes, when a current of self-doubt slips into my mind, I ask myself: what would Goal Buddy say?

Posted in Fun, Goal App | Comments Off on What Would Goal Buddy Say?

The Scary Sun and Other Things

 

The very first Splash Screen. That sun can see dead people.

The very first Splash Screen. That sun can see dead people.

I spent the better part of last Sunday doodling on an ancient version of Photoshop (ver. 5.5, but I’m dating myself), working on the welcome screen for our Goal Buddy App. I laboured over rolling green hills (going to town with the ‘gradient’ tool), soaring mountains (gradient!) and ethereal blue sky (gradient!). It’s the first serious version of the splash screen yet, and I wouldn’t argue that the previous version was a strange three-way mix of scary, hilarious and creepy.

The previous version had “Creepy Sun” right in the middle of a painfully blue screen. The sun itself had a demented, crooked smile, and two eyes that didn’t quite point in the same direction. I think Chris named it “Creepy Sun.” In my own defense, it is really hard to draw with a mouse!

I was thinking about Creepy Sun the last time I was at the gym. I was dangling from the chin-up bar like a wounded orangutan. No matter which muscles I flexed, I couldn’t raise myself up. I’m really good at

The next version. 90% less creepy and 30% more inspirational.

The next version. 90% less creepy and 30% more inspirational.

the “down” part of chin-ups, though. I’ve got that down pat. I started to think, as I was hanging there, that I am still at the Creepy Sun stage of this whole law enforcement endeavour. I’m definitely sticking to the small goals I’ve set (i.e., exercise, studying for entrance exams, wearing aviator sunglasses every time I drive), but there is still a long road ahead. Just like designing the splash screen and other graphics for Goal Buddy, there will be many iterations and I don’t know quite how the end product will look, but stick with me and we will find out!

Posted in Fun, Goal App | Comments Off on The Scary Sun and Other Things

Goals – One Bite at a Time

We have been in the “goals” mindset at SMP for a quite a few months now, as you’ve doubtless noticed. We (and by “we” I mean “Chris”) spend most of our time on the programming end of things, but also continue to learn about the psychology of goal-setting. We ponder: why do we achieve some goals but not others? Support? Determination? How realistic is the goal?

We set goals for ourselves and discuss them weekly. Mine have all been fairly pedestrian and, hence, very achievable. I felt a huge sense of satisfaction when I cleaned and organized the storage room, but knew that action was unlikely to alter the course of my existence. I practice the bass guitar three times per week. It feels great to rock out, but my downstairs neighbour just doesn’t share my appreciation of Billy Idol or Def Leppard (I can’t turn the volume above “2” or he thumps on the ceiling). It took me nearly two months to put the Christmas decorations back in the storage locker, and it felt good to finally get those cursed tote boxes out of my office.

We hoped, however, that making goals, seeing them through, and developing our Goal-Achieving App (or “Goal Buddy” as we call it) would go up and beyond the usual domestic tasks I’ve mentioned here. We want to help people achieve bigger things, like quitting smoking, achieving academic success, or sticking to a financial plan. I have a big goal too: find a career path that really excites me. I’ve been down many blind alleys these past few years, and it has been poignantly discouraging. I got an idea in my head a few months ago – before Christmas, I think – and I just couldn’t shake it. Maybe I should join the police force. I didn’t tell anyone. I wasn’t ready to admit that I had a goal, because once you tell someone else, it becomes real and begets accountability. It was a bit scary, thinking of this new goal in all its enormity.

When I picked up an application package, I discovered that there were ten steps. Ten very complex steps. My stomach lurched a bit (and it didn’t help that I was sitting in my car, in the hot sun, with the windows rolled up). I wondered how (and if) I would get through them.

This is where real life and “Goal Buddy Development” life collided. Big goals can be very daunting. We wondered if earlier iterations of Goal Buddy were too focused on BIG goals. What if, instead, it helped you develop small behaviour changes each day? Because little goals eventually add up to big goals, right? What if, by setting a pattern of repeatable, small, positive changes, it could help you towards much grander ambitions? We are into the programming side of that already, and now the real-life analog must follow. I set a small, first goal: go to the gym every other day. It’s a start, and once I am doing that regularly, the other steps won’t seem as huge. It’s like that adage of “how to eat an elephant.” You can only do it one bite at a time.

Posted in Goal App | Comments Off on Goals – One Bite at a Time

Stats tell you a lot…or do they?

I vividly remember my stats professor, back when I took my undergrad degree. He had a nearly unintelligible Croatian accent, barely spoke above a whisper, and liked to write on the overhead with squiggly scribbles as he spoke/whispered. In short, I could hardly understand him, hear him, or read what he was writing, but he instilled in me that statistics are among the most misused metrics out there.

I’ll explain why. It’s easy to say that “a majority of people believe in aliens.” Or that “the average weight of hamsters in Slovenia is 200 grams.” Or “90% of survey respondents agreed that a Provincial Task Force on Walking While Texting” is a good idea. What do these numbers really mean? What constitutes a “majority?” How many hamsters were weighed in Slovenia? Did the researchers take into accounts things like breed, age and sex of the hamsters? Of this “90%” did the researchers consider things like: how many people did you ask? What was the survey return rate? Are the responses liked to other influencing factors? It’s just to easy to use words like “average” or “majority” and not give the context of sample size. It makes a pretty big difference if you asked 10 people in a survey versus 1000. How would you know if those 10 people were representative of the general population?

We at Saturday Morning Productions collected some data over the past two months, regarding people’s perceptions of a Goal Achieving App. We wanted to gauge people’s interest in using a goal app, as well as ascertain what types of goals they might want to focus on.

When we looked at the raw data, we found that 85% of respondents were interested in a goal-achieving app. But when you look at the numbers behind that, it is actually 129 people out of 152 respondents. Are those 152 respondents a representative sample of the entire population? Do they equally represent age, sex, socio-economic factors, and other demographic categories that might affect the outcome? We have no way of really knowing, plus that level of detail would be something akin to a graduate thesis.

We found that 83% of respondents had set goals in the past – that’s 125/100 if you’re wondering. When people did set goals, saving money (59%), improving health (58%) and being physically active (61%) were singled out as being important. That was reassuring for us, because in our early interations of Goal Buddy, we had singled those out too. It was good to see that what we saw as important goals aligned with what most people saw as important!

The numbers dropped when we asked if people were successful in achieving those goals. Only 36% (44/124) were successful in achieving their chosen goal. When asked why they did not, motivation emerged as the most frequently implicated factor (39% of the time). We asked survey respondents what they needed to help them achieve a goal, and only 1% said an app would be the solution. Instead, people pointed out support (37%) and motivation (51%) would be more influential.

So if you look at that last set of numbers, it seems like survey respondents don’t think an app is a good idea. It might seem that way on the surface, but the whole point of an app is to provide motivation (such as the drive to keep beating your personal best when you start keeping track of what you are doing) and support (through an online community, for example). It’s not really about the app – it’s the philosophy behind it. That’s where numbers and stats don’t always give the whole picture.

As much as I enjoy analysing numbers, it’s important to keep them in a broader context. Even my stats prof hammered that point home, and he’d grown up behind the Iron Curtain where you don’t analyse numbers…numbers analyse YOU!

Posted in Fun, Goal App | Comments Off on Stats tell you a lot…or do they?

Connect to Android Emulator from VirtualBox

I do all my development inside virtual machines.  This allows me to keep separate development environment for different projects and clients.  I wanted to keep this tradition for developing mobile applications but that turned out to be a bit of challenge.

The Xamarin Android Player and the Genymotion emulators both use VirtualBox to emulate the Android phone or tablet.  This works great if you don’t develop in a virtual machine.  If you develop inside a virtual machine you run into a major problem:  you can’t run a virtual machine inside a virtual machine.

At least with VirtualBox.  It appears that other virtualization products, such as Parallels and VMWare can do this but I use VirtualBox so that was a no go.

That said, I did try installing VirtualBox inside a guest Windows 10 VirtualBox but that didn’t work.  No surprise there as all the documentation said it wouldn’t but I’m stubborn/stupid that way.

The solution is to have two separate virtual machines running at the same and have them talk to each other.  The first guest virtual machine is your development environment (e.g. Windows 10, Visual Studio 2015, etc).  The second virtual machine is the Android emulator.  To do this you will need enough RAM to run both at the same time.  I would also recommend a SSD hard drive.  In my case I use 9 GB of RAM (5 for development environment virtual machine, 2 for the Android emulator, and 2 GB for my base OS).

Memory Used

To hook into the emulator from your development environment for debugging, some VirtualBox configuration is required.  First, install your Android emulator.  During the install of the of the emulator it will prompt to install VirtualBox but you can ignore this if you have VirtualBox already installed.

Then, download and install a virtual device such as HTC One or Nexus S (KitKat).

Xamarian Android Player Installed Devices

Genymotion Installed Devices

Open up VirtualBox and you should see the emulators as machines.  I had to black out some of the machine because they are named after clients.  The Android emulators are listed at the bottom with the last one being the one created by the Xamarin Android Player and the second last one created by Genymotion.

Virtual Box With Android Emulators

Check the network settings for the emulators.  There should be two network adapters.  One set to a Host-only Adapter and one set to NAT.

Nexus S KitKat Adapter 1

Nexus S Kit Kat Adapter 2

The one setting to pay attention to is the Name setting for the Host-only Adapter.

Note: For some reason the Xamarin Android Player (at least version 0.6.5) will install a new Host-only Adapter.  So instead of saying “VirtualBox Host Only Ethernet Adapter” it might say “VirtualBox Host Only Ethernet Adapter #2”.  In either case take note of this name.

Now open up the network settings for the development environment virtual machine.  You probably only have one network adapter enabled and it will be either set to NAT or Bridged.  Whatever the case leave it as is.  Then enable a second adapter and set it to Host-only Adapter.  Then make sure the Name field is the same as the emulator name you noted above.

Ws Win10 Vs2015 Adapter 1

Ws Win10 Vs2015 Adapter 2

Now start up your development virtual machine.  In my case it’s a Windows 10 with Visual Studio 2015 with Xamarin.  Inside Visual Studio click the Open Android Adb Command Prompt button.

OpenAndriodAdbToolbarButton

Then type

adb connect <IP address to Android emulator>

To determine the IP address of the Xamarin Android Player click the gear icon.

Xamarian Android Player IP Address

To get the Genymotion IP address you need to go to the VirtualBox interface, select the running VM, and then click show.  The IP address is listed there.

Virtual Box Show Button

Genymotion IP Address

After you run the adb connect command you should see something like:

$>adb connect 10.71.34.101
connected to 10.71.34.101:5555

As you can see it uses port 5555.  If you can’t connect make sure port 5555 on your host machine is open.  In Windows you need to open this port in your public networks firewall.

Now in Visual Studio your new emulator connection should auto-magically appear.

Emulator In Visual Studio Run Button

When you click run it should compile your application and upload it to the emulator for debugging.  If everything works you should see something below.  Notice the breakpoint has been hit.

Break Point In Visual Studio

In your emulator, assuming you continued after the breakpoint, you should see your application in the emulator.

Welcome To Xamarin Forms In Emulator

Welcome To Xamarin Forms In Genymotion

Potential Problem

There is only one problem I’ve encountered.  Sometimes the uploading of the application to the emulator is very slow.  Like very, very, very slow.  So slow it’s basically stuck.  During compile and deploy in Visual Studio you will get stuck at the “Installing <something>” line.

Android Emulator Stuck In Visual Studio

You can also see the problem if you try to adb push something.  It will look like:

adb push -p <*.apk> /data/app
Transfering: 327680/16414148 (1%)

It will be stuck at some low percentage and might move up a percent in a couple minutes. For some reason if you do a pull of a large file it won’t get stuck and will be downloaded from the emulator in a couple seconds.

My guess is this is a problem with VirtualBox networking but don’t quote me on it.  Just for reference I’m using VirtualBox 5.0.8 with extensions installed.  Anyway, to fix the problem you need to refresh the Host-only adapter.

While your development environment virtual machine is still running, open up the host-only adapter configuration.  Then make a change to the adapter to force it to refresh. I usual change the Promiscuous Mode setting.  It doesn’t matter what you set it to.  Then click OK to force the refresh.

Refresh Development VM Host Only Adapter

It might also work if you refresh adapter inside the guest Windows machine but I haven’t had as much luck doing that.  If you know of a different way to fix this problem please let me know.

Posted in Code Examples, Software Development | Tagged , , , , , , | Comments Off on Connect to Android Emulator from VirtualBox

How Goal Buddy Got Its Name

We are working away on “Goal Buddy,” our goal app (also known as “your little goal-achieving friend). I’ve noticed that the most popular apps have short and catchy names (which are certainly more effective and memorable than something like thesuperbestappeverthathelpsyoubeyourverysuperbestself). Goal Buddy’s name came about back in November when I was working on some concept sketches, sitting at the dining table and hoping that some bolt of inspiration would find me.

I suppose it did – I was sketching a potential “welcome screen” for the app and I just wrote down “Goal Buddy,” thinking it would be an interim name that could be changed later when we thought up something we liked better. It stuck, though, and we liked what it evoked: a little friend that is there when you need them and helps you achieve whatever goals need achieving.

Up until last week, I did not really delve into the name’s origin more deeply, until I remembered the first month of my last year of grad school. Let’s just say that I wasn’t happy to be there. My degree took longer than I thought and seemed to be flummoxed with roadblocks every which way I turned. My supervisor wanted me to work in my office five days a week instead of working at home (I can see his point. To be fair, I’d become a little too complacent in my PJs at my apartment.). I dreaded it, though, and I wondered how I would see the process through to the end.

I shared an office with another woman who was in the same situation. We both had to finish our degrees and neither of us wanted to be there, so we made a pact. If one of us was in the office, we both had to be. No more staying home just because we didn’t really feel like going to school. We would keep each other accountable. She joked that we would be each other’s “Accountability Buddy.”

I don’t have enough space to adequately described how that year played out (let’s just say it was interesting), but having my Accountability Buddy there really made a difference. Knowing that someone cared whether I was there or not, whether I was making an effort (or not), and whether I actually finished the task I set out to do (I did finish!), was unquestionably a determining factor.

That is how GoalBuddy got its name. That name may evolve as the app evolves, but for now, it reminds me of that good friend who motivated me to finish my schooling. We hope that GoalBuddy will be the Accountability Buddy in your life too, once our little app is out there in the big world! Stay tuned.

 

Posted in Fun, Goal App | Comments Off on How Goal Buddy Got Its Name