Gierad Blogs

because he dreams for the wisdom of an owl, but has a memory of a goldfish

Merry Christmas!

December26

christmas-puppychristmas_kitten

Ho Ho Ho! Merry Christmas!

Wishing everyone a very merry Christmas! There is no place I’d rather be on Christmas than Cebu. I’m delighted to be here with my pLong pLong :-)

Benford’s Law

December7

I was listening to the Numbers episode of Radiolab and came across a very interesting topic: Benford’s Law.

In its simplest form, Benford’s Law says that there is a distinctive pattern on the “population” of numbers. If you gather all the numbers in the world (from numbers found in stock prices, to newspapers, height of buildings, temperatures, cash registers, etc.), approximately 30% of them start with # 1. Let me repeat that, about 30% of numbers in the world start with #1.

But wait there’s more!

About 18% of all numbers in the world begin with #2. About 13% begin with #3. See the pattern?

And here’s the entire gamut:

  • #4:  9.7%
  • #5:  7.9%
  • #6:  6.7%
  • #7:  5.8%
  • #8:  5.1%
  • #9:  4.6%

Visualizing this pattern, we get:

BenfordsLaw_graph

So what’s so significant about Benford’s Law? Surprisingly, the natural distribution of numbers is so universal that it can be applied to any numerical context (i.e. finance reports, random numbers). Any deviation from this pattern denotes that the numbers have been manually modified. In fact, Benford’s Law has been used to detect accounting fraud and other related crimes (see example below).

benfordsLaw_fraud_example

Lesson: don’t mess with numbers (unless you follow Benford’s Law).

Have you seen a GIANT Red Balloon??

December3

balloon_small

UPDATE: Results are in. MIT Red Balloon Team has won the competition. Great effort! I’m curious to know how teams approached this problem.

If you have seen one, please let me (or our team) know!

This Saturday (December 5), DARPA, The Defense Advanced Research Projects Agency, will release 10 red balloons at fixed locations. The challenge is to FIND THEM. The first individual or group to locate all 10 balloons will receive a $40,000 cash prize. This task may be harder than it seems so we need a lot of help!

Join our team. Click here to join our Facebook group.

Pass it along! Tell your friends, your girlfriends, your girlfriends’ girlfriends, and your girlfriends’ girlfriends’ grandparents!

More information on the DARPA Network Challenge

iPhone SDK: Dealing with .plist Files

November28

Loading Contents of .plist file to an Array

The most straightforward method for dealing with .plist files is +[NSArray initWithContentsOfFile:path]. However, you need to specify the correct path of the plist file via [NSBundle pathForResource:plist ofType:].

- (NSArray *)arrayFromPlist: (NSString *)plist {
     NSString *path = [[NSBundle mainBundle] pathForResource:plist ofType:@"plist"];
     NSArray *array = [[NSArray alloc] initWithContentsOfFile:path];
     return array;
 }

Loading to a Dictionary

To load the contents of a .plist file to a dictionary,  instantiate a NSDictionary or NSMutableDictionary and initialize it with [NSDictionary initWithContentsOfFile:]

- (NSDictionary *)dictionaryFromPlist: (NSString *)plist {
 NSString *path = [[NSBundle mainBundle] pathForResource:plist ofType:@"plist"];
 NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path];
 return dict;
}

Writing to a .plist

The easiest way to write values to a .plist file is to use a NSDictionary and modify its contents using -[NSDictionary setObject: forKey:]. To save the contents to a .plist file, use -[NSDictionary writeToFile: atomically:].

Atomically writing to a file guarantees that the file, if it exists at all, does not become corrupted even when the system should crash while writing.

NSString *path = @"Path to Plist.plist";
 NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path];
[dict setObject:@"Gierad" forKey:@"name"];
[dict writeToFile:path atomically:YES];

Lastly, if you want to read/write small configurations for your app, NSUserDefaults is recommended. It contains methods to easily handle key-value pairs including floats and other objects.

New Domain Name!

November21

I am proud to announce that gierad.com has been successfully registered! I am planning to move all my old stuff from digitalvent.com to gierad.com.

I am still planning to keep digitalvent.com, but I hope to slowly transition to using my new domain name.

I am also setting up email accounts for gierad.com to use Gmail. At the moment of writing, Gmail is waiting for the MX records to fully propagate across the Internet (which could take up to 48 hours).

I will post updates when they come.

Converting .MOV to .WMV

November21

I was joyously creating a short movie clip for a presentation at work using iMovie.  After exporting the project into the default QuickTime format (MOV), I suddenly realized that Desktop workstations at the office were primarily Windows-based and locked-down (meaning you can’t install any other software besides what’s  pre-installed). Ergo, no QuickTime player. Like all Mac users who want to run things on Windows, I came across an inevitable issue: how do I convert .MOV to .WMV?

After hours of scouring the Internet for a potential FREE solution (believe me, it’s not easy), I found the perfect tool for my task: Prism Video Converter for Windows.

It’s a multi-format video converter for Windows, and it’s FREE (for non-commercial use).

To anyone out there who may come across the same problem as I did, hopefully this blog entry will save you time.

Home Page: http://www.nchsoftware.com/prism/index.html
Direct download linkhere

posted under Creative | No Comments »

My BlackBerry Runs on the Simulator, Now What?

November21

BlackBerry Code Signing

Update: Companies that are part of the BlackBerry Trial Premier Support can obtain signing keys for free. Contact your BlackBerry Account Manager for more details.

You create apps for the BlackBerry and it runs perfect on the simulator. Now you want to deploy it on an actual device. It may sound easy, but if your app is using specific BlackBerry API’s, your program will not function if they are not code-signed. You need to sign-up for API keys from RIM.

So you want to run your app on a BlackBerry device? Start reading!

Basically, you need to do three things:

  1. First, you need to fill out the BlackBerry signing keys request form. You can fill out the form here. There is a $25 fee for requesting signing keys. During registration, you will be asked for a security PIN. REMEMBER THIS PIN!
  2. Once the form is complete, you will get an email from RIM with attachments (.csi) within 48 hours to 10 business days. You will get three keys in three separate emails.
  3. Finally, install the keys on your machine by running the BlackBerry SignatureTool. This program is located under the BlackBerry JDE installation directory. To run SignatureTool, use the command prompt and type the following:

    java -jar <BB JDE Dir>\SignatureTool.jar <.csi file>

    This will take you to the SignatureTool registration wizard. The wizard will ask you for the registration PIN mentioned in Step 1. It will also ask you for a personal password. Make sure to remember this personal password since you will be asked for it whenever you compile you BlackBerry app.

That’s it! The steps might be a bit intimidating at first, but its very straightforward. I still honestly think that RIM should streamline the key signing process similar to the iPhone Developer Program.

Additionally, you may also want to read this article from Chris Crowe.

First Blog Entry!

November21

Welcome to my new Blog!

This is my very first post. I hope to make this blog as lovely and as enticing as possible. Stay tuned for exciting stuff!

posted under Random News | 3 Comments »
Newer Entries »