Tuesday, June 14, 2011

Android must-have list

I'm using a phone on virgin mobile. There are a few apps I'd suggest people try on android.

  • Gaia (for offline maps)
  • Backcountry navigator (another offline map app)
  • Amazon appstore
  • Quick Settings (just in case this reveals some settings)
  • Kindle reader
  • Runkeeper (there are others but this is what I'm using)
  • Google Earth (IF your phone can run it)
  • Firefox (for webgl etc, again, if your phone can run it)
  • Barcode scanner (to read the 2d barcodes you see)
  • Facebook
If you have some suggestions, post a comment.

Tuesday, April 5, 2011

Passing data into a facebook iframe app

When you send someone to your facebook app, you probably want to be able to track that referral. Obviously, since your app runs in an iframe, you can't see the parameters that were used to reach the parent page.

Fortunately, facebook allows you to get data sent into your application. Add the parameter "app_data" to the url that is used to reach your page...


Now, use the method in my last post to access the signed request and you can find your referral information in


Whew! Another coding disaster averted.

Wednesday, March 2, 2011

Facebook fan/like gate from rails

Every facebook example is always written first in php. For example, detecting a fan.
Some are never translated. For the record, here's a rails version. This goes in the controller (or even better, a helper).

p = params['signed_request'].split('.')[1]
json = Base64.decode64(p + "=" * (4 - p.size % 4))
data = ActiveSupport::JSON.decode(json)
liked = data["page"]["liked"]

Note the encoded string needs to be padded with = signs until it's a multiple of 4 bytes long.

The background on this is facebook has disabled static/fbml tabs from being added to fan pages. Instead, create an app and add the app to your page. This is to cover what people used to do with the fb:visible-to-connection fbml tag.

Wednesday, May 19, 2010

from your parasite, with love

I am fascinated with the idea that a parasite might help with autoimmune disorders. In the UK studies have been conducted researching the effect on MS and crohn's disease.

I know it is creepy to think about, but the kind of worms they are talking about here do NOT reproduce or significantly grow in the host. They happily latch on and enjoy the ride and if you live in a place with even the most basic sanitation, the parasites will eventually die out. Tragic.

One study found that when the parasite was present, the immune system responded measurably. It shifted the T cell production toward a type of defender that is less likely to damage the body but could still effectively fight infection. What a way to embrace a new guest.

Some autoimmune disorders strike suddenly and have devastating effects before you could respond with this kind of therapy. It seems type 1 diabetes (maybe even type 2) would fall into this group. This would be a case where you need to show a commitment in advance--not in sickness but in health.

When the UK studies were finished and the experimental group was offered the drug to kill off the parasites, some participants said no thanks... they wanted to affirm their relationship. I'm sure the worms felt the same way.

Sunday, May 2, 2010

For the record, my diet

A couple of family members have asked about what I'm doing with my diet. It is pretty sane really and I just want to put it down for the record.

I ran through a diet like the south beach diet and afterward wanted to maintain my weight. This is what I'm doing now to hold things steady. I've mostly tried to replace the worst things I was eating before with good stuff.

Doughnuts, cake, cookies
Wheat toast, sugar-free jam
Snacky foods, chips, etc
Apples, carrots, grapefruit
Juice, soda, sweet drinks
Water, low-sugar hot cocoa
Worst of the fast food... fries, soda, shake
Stick with a hamburger

One reason it was such a no-brainer to leave sweets out of my diet is after going through the south beach diet twice, I never want to do it again. It is a pretty miserable few weeks. Sugar is an addiction and eating it makes you want to eat more of it after the high passes. I felt a real feeling of withdrawal when I gave it up during the no-carb phase. If you try south beach or something like it, I'd suggest you get a friend to do it at the same time. Both times I had a pact with a coworker and had to show I could stay with it.

Juice may be derived from something "natural" like fruit, but it's just a slightly less refined form of sugar than the pure stuff. No one should argue with the idea that it's better to just get the good stuff direct from the fruit.

I discovered I need to take a multivitamin. The corners of my mouth get tender and painful if I don't keep that up, a vitamin B deficiency. I suspect I'm getting less fortified flour, possibly the only redeeming value in cake, etc. I miss out on now.

On exercise... exercise without fixing your diet isn't likely to work. While waiting to see dad finish the St. George marathon, I was amazed to see runner after runner cross the finish line who were clearly carrying an extra 30, 40, 50 pounds. It's quite possible to be fit and still overweight. I've started exercising recently but most of the weight loss was before I started that.

Saturday, January 10, 2009

CES report: ASUS T91 and D200

There was a lot of glitz at CES this year. More than one booth had dazzling white light streaming down from overhead, apparently to invoke awe. The one booth I felt had something worth bathing in this kind of highlight was run by ASUS. (Thankfully they just had normal lighting :)

First, the T91 is the touchscreen convertible laptop, revamped from their 9" laptop. The staff was quick to mention this was a prototype and might not be exactly the same in a shipping version, due around March.

The T91 is on the left and my p1510d, for comparison, is on the right. They are similar but the T91 is thinner.

  • the "bump" under the previous eee models is gone! The T91 is a sleek, symmetrical slab
  • it was suggested the machine will run about $500
  • the windows version should have 16GB internal ssd, no word on Linux model
  • will include a GPS and TV tuner (!)
  • apparently the antenna connector on the right side is for TV signals
  • model on display had an integrated web cam
  • stereo microphones, one on each side of the camera
  • SD slot in front
  • VGA output in back
  • apparent SD slot on left, covered by a door marked "disk-expander"
I'm excited to get one of these to try it out! It should be a great use of the Atom CPU.

The other interesting model is the D200. This is apparently meant to be like a media player machine, but it also includes a wifi access point, two slots for drives, and a 4-port switch. Very interesting stuff.

Monday, September 8, 2008


My favorite usergroup around here has to be the Utah Ruby User Group. The topics are often related to rails, but there's usually some good topic that wanders beyond rails.

Surgeworks sponsors the group and gives out technical books at our meetings. I got the pragmatic bookshelf erlang book. It's quite fascinating. It was fun to see footnotes comparing erlang with prolog and ruby. I like learning about computer languages and it was great fun sitting down with this book.

erlang "objects" if you can call them that are sort of artifacts of the language rather than explicit constructs. It reminds me of the way one of my college instructors "discovered" objects with us in a scheme lecture.

I carefully read the first part of the book and skimmed the rest. The second part of the book has a good level of detail that requires you to be in a project to make best use of it. Hopefully some day I will :)

Finally, erlang has the absolute best name for its included db, "Mnesia".