Wednesday, June 06, 2012

I finally hooked up my Wizard Scorecard app to update the Wizard Stats site automatically.  Here's how I did it:

  • Changed the Wizard Scorecard app so there's an option to output a .json file attached to an email
  • (The user fills in the To: field (it's a subdomain of ericdsouza.com) and sends the email)
  • Configured the MX records for the subdomain so the mail goes to my Amazon EC2 instance
  • Configured Postfix to pipe emails for the virtual email address to a php script
  • Added a php script that reads the .json file and updates the Wizard stats database
Lots of help from Google and other people who posted tutorials on the various steps.

I used email to transfer the file (rather than say a direct connection from the app to the database) because the app is public, and the stats site is for personal use. Other users of the app can output a .json file and use it for their own stats.  Although, I'm expecting to get requests to output as a .csv because I suspect most people will want to dump it into Excel.

Making sure the whole thing was secure took up more time than actually making it work.  I won't go into the details cause that will make it less secure, but it should be good enough.  

...

My ankle (technically, my talus) is feeling better every day.  On Sunday I was running at about 90%, and cutting / defending at about 60%.  I had physio yesterday and Karen said I could go further.  I'll see how it feels today.  Luckily we just had a downpour this afternoon, so if it also rained up at the school we play at today, the field should be soft.  A couple weeks ago we played on a such a dry field it was like running on pavement with cleats.

I should get ready for Ultimate. 

Wednesday, May 09, 2012

So it's been a week of learning more web stuff.  I set up a virtual Linux server in the Amazon cloud, and installed the LAMP stack (Linux, Apache, MySQL and PHP).  Surprisingly, I actually got the Apache welcome page when I browsed to the site!  I didn't think it would all work the first time around without an error.

The last couple days were googling around to make sure the site is locked down and secure.  My ericdsouza.com & laumoda.com sites are on Amazon S3 -- they're just static content; Amazon provides the web services so I don't need to worry about security.  However, for the virtual Linux server, it's the same as if I set up a physical server at home that's accessible to the web -- I need to take care of patching and security etc.

I have yet another 'Hello World' page up today, this one generated from PHP.  Next is to create a database, load it with test data from the Wizard Stats spreadsheet, and then display the results of a query on a web page.  Thanks to all the free tutorials on the web, this looks to be straightforward, although security will probably be more work than the web page itself.

...

Today's Heather's birthday, and we're having dinner at home.  At first it was going to be a multi-course meal, south american inspired, with ceviche to start and then grilled chicken with quinoa.  But when I was buying the halibut I forgot it was just for one course and bought 380g.  So we changed the menu and we're having ceviche as the main.  It's 'cooking' right now, in lime juice, garlic and coriander in the fridge.

...

I'm cleared to play Ultimate again this Sunday!  I hurt my right foot in hockey three months ago (to the day -- Feb 9).  My talus bone took most of the impact, and stretched the ligaments that hold it into place.  Scar tissue built up, holding the talus in not exactly the right spot, blocking my ability to bend my foot properly.  With physio they're trying to break down the scar tissue, and have the muscles build up to keep it in the right place.  I'm okay to play this Sunday, with a brace.  I'll have to use the brace for about a year when I play sports or go for long walks.  (Hockey is okay cause the skate provides the same ankle support as the brace).

...

Well I have to go chop up some more coriander and the like for dinner.

Friday, May 04, 2012

I migrated my ericdsouza.com domain from enom to GoDaddy, mostly because it's way cheaper ($60 / year at enom vs $15 for the same service at GoDaddy).  It takes a few days to process once you request it.  I also opted for anonymous registration, which means a 3rd party actually registers the domain (for all internet domains, you can look up whois databases and get details about the registrar, which causes spam amongst other bad things).  The transfer occurred earlier this week, and the next step was to set up a new website for ericdsouza.com using hype and hosted on AWS.  In the past I've used Google / Blogger to host websites (cause it's free), but the templates are limited, and there's Blogger and Google badges on the site.

You can check out my new ericdsouza.com site!

So the next little project is to automate the stats for Wizard (the card game that my Ultimate friends play).  We keep annual stats and have a trophy (which I've won once).  The stats are a bit complex, 50% for wins (weighted for number of players), and 50% for percentage points of the winner (so if the winner had say 200 points and you got 150 points, that's 75%).  We added the percentage points because too many people were playing favourites if they were out of the game.  Now at least there's a reason to keep playing for yourself.

Currently the stats require manual data entry of the game's scores into a Google spreadsheet, which then has a bunch of formulas and a manual sort step to create the leaderboard.  The leaderboard is shared out over the web (it's just a checkbox on Google docs to activate).  It's at bit.ly/WizardStandings2012.

I'd like to change the Wizard app so that it can output a data file as an email attachment.  I'll need to set up an email pipe to a script, which then updates a database.  The leaderboard is then driven from the database.  There's also some sort of security needed to prevent anyone from uploading a datafile.  You'd need to know the email address, which is probably good enough for our use case; I was thinking of something additional like using gmail rules to forward only emails with specific details onto the pipe.

The idea is to do this in AWS so that I can learn how to use it.  The good part is it's all free!  Amazon has a free usage tier for the first year, and after that, almost all of it would continue to be free because it's below the threshold where Amazon starts charging.

...

We only had 8 skaters for our hockey game last night, and we were on the big ice (Rink A).  I was more tired after last night than the four games in three days over the tournament last weekend.  (I probably had more total ice time last night than the tournament).  We lost 5-4, I had at least an assist.

...

The WD40 store on Queen St E near Carlaw that looked like it was going to be an Irish pub is up for lease again.  I wonder if the liquor license application was turned down?  Anyways that's too bad, it's a great place for a pub.  We've been amazed at how popular WAYLA (right beside the WD40 store) has become.  There's been line-ups with a bouncer outside the last couple times we've walked by at night.  Line-ups!! In Leslieville!

We're having veal loin chops with arugula for dinner tonight, I have to go chop up the garlic.  It tastes better if the garlic's added to the veal a couple hours before grilling.

Thursday, April 26, 2012

I've decided on laumoda as a company name.  I'm surprised at how easy it is to set up the digital part of a company.  Here's what I've used in case anyone else is looking to do the same:

  • I bought the domain name (laumoda.com) from GoDaddy.com.  It was one of the lower priced sites, plus a lot of other sites have built-in interfaces with GoDaddy (such as setting up Google Apps).
  • I'm hosting the site on Amazon Web Services.  It's free for a year, and then about $5 - $10 month depending on what I'm using (space, bandwidth etc).
  • I set up email using Google Apps.  Because I went with GoDaddy, I didn't even need to edit the MX records myself; it was just a couple clicks.  If I'm using the @laumoda.com email addresses, I just sign into gmail with the account, and then it's the same as using gmail.
  • I built the website using hype.  I was looking at cloud-based html5 content creators, but they all charged between $5 - $10 / month if you wanted to remove their logo from your site.  I'd be okay with a free site with the logo (e.g. this blog has a blogger logo) for a personal site, but its looks decidedly unprofessional for a business site.  Hype is an installed software app that was $40.  One limitation of Hype is that it only does fixed-dimensions (so you have to define components in pixels, as opposed to say 100% width).  I was trying to figure out the optimal width, fortunately there's cool sites like this one that have a lot of data. 
  • I built the favicon (that's the little icon that appears in the browser tab) using a free website (just google, there's a lot).  .jpg in, .ico out.
That was it!  

Monday, April 23, 2012

I'm trying to choose a name for my company.  I have four criteria, in order of priority:
  • .com is available
  • if you google the name, you'll likely find my company (which rules out names such as "digital solutions" with 294,000,000 search results)
  • there's minimal confusion on how to spell the name once it's seen (which rules out things like "travelers.com" or "travellers.com")
  • it has a meaning behind it.
To find names that fit my criteria, I was following the example of kijiji, which is swahili for "meeting place". The finalists are all words from esperanto, which as a language works particularly well with criteria #3.

I'm running a survey to see how the name fares; I'm more influenced by the survey if the name is generally disliked (the first selection of names all polled very poorly; based on that I came up with different names).  If you'd like to vote, go ahead!


I'm nearly done with the wobbly table app.  It was working great on the iPhone, but when I tested it on the iPad none of the text showed up.  I finally figured out it's because I used a font that's only available in iOS5 but not iOS4 (I've upgraded the OS on my iPhone but not the iPad, cause I want a device running both for testing, and this a great example of why).  I wish there was some sort of error message if the font isn't available, instead of just showing blank text.  Anyways I changed to a font that's available in both iOS4 & 5 and that fixed that problem.  Except I caused some other problem with all the changes I made trying to troubleshoot, which I now have to find and fix.


It was a almost winter again today, although the forecasted snowstorm did not materialize.  Call off the army!  But it was a good day for spaghetti and meatballs, with a caesar salad.  Mmm good.


I had physio again today for my foot (which I hurt at hockey almost three months ago).  I now have an ankle brace, and with it I can run without pain (yay!)  So I'll be good for Ultimate in three weeks when the spring seasons start up.  My ankle doesn't bother me at hockey, I think because the skate boot has the same effect as an ankle brace. 

Thursday, April 19, 2012

I forgot to mention, our hockey team (the Rockets) won our division!  We're champions of Thursday D2 Men's 30+ hockey!  The summer season starts today, but we also get to continue the winter season in the facility championships next weekend.  (They should come up with a more exciting name than "facility championships"). There's four D league teams from the various nights that play at York, and we're all in a playoff to go onto the regional playoffs.  Every team plays each other, so next week we'll have our regular summer season game on Thursday, then the facility championship games which includes one game on Friday evening, two on Saturday, and then Sunday if we are in the top two teams.  Five games in four days!  I'll be in good shape after that.

Well I figured out the math for my app.  The iPhone accelerometer provides the acceleration along the x-, y- and z-axis.  If the iPhone is laying flat, the x- and y- values are 0, and the z- value is 1 (because gravity is pushing down with a force of 1).  If the iPhone is static but tilted in various directions, the accelerometer returns the appropriate x- y- and z- co-ordinates.  I use the following formula to figure out the angle of the iPhone's plane relative to a world frame:


radians = atanf(z/sqrtf(pow(x, 2) + pow(y, 2)))


The next step is applying a low-pass filter to the readings, there's a lot of noise that I need to average out.

Yesterday MC and Robin dropped by before dinner, they were out taking Corben (their 4-week-old) for a short walk.  They looked really rested for new parents.  Corben is very cute, with a full head of hair.  We chatted for a few minutes, it was good to see them.



Tuesday, April 17, 2012

I'm on to my next app, this one is to figure out how to use the accelerometer.  The previous one (which was about InApp purchases) is with Lloyd and his kids for testing.

This new app is to measure how to fix tables that aren't balanced.  In theory, I should be able to get the position of the iPhone in both the balanced and unbalanced states.  Next theoretical step is to get the angle of difference between those two planes.  Then, based on how far apart the legs are, I can figure out how much to raise a leg (ie, how thick do you need to fold the coaster to fix the table?)

I've got to the point where I've captured the two table positions.  The next step is the math part.  If I have it figured correctly, I'm trying to covert the iPhone's accelerometer coordinate system to Euler angles.  I think.  This is one of the few times in my life I've had to put my math degree to use.

This evening is our last Tuesday Ultimate game.  It's at 11pm, so the team's going out before the game for dinner.  I'm still out with my ankle / foot injury.  We're heading to Bar Vespa, beside Brazen Head.

On Sunday Heather and I went to the new Scottish pub on Gerrard near Jones (McGuggan's).  We had tried their food a couple times, and it's been pretty good, except almost all of it is deep-fried, or a salad.  There's no real in-between choices.  On Sundays, however, we figured they'd have a roast beef special (it must be a law for pubs).  It was really enjoyable, the yorkshire pudding was one of the better ones I've had.