Testing post

Gonna test a ton of posts! GWAR!

Posted in Uncategorized | Leave a comment

I’m an Engineer, Not a Compiler

Recently I had a phone interview where I got asked a variety of Java questions. This kind of thing is standard, and most of the questions were somewhat standard:
Continue reading

Posted in Uncategorized | 71 Comments

Time + Computation + Thinking = Constant

Working on Project Euler, there is a problem involving dice probabilities. The forum shows a variety of different solutions, some of them involving entirely too much typing (several people literally iterated through every possible combination of dice faces), and some of them were somewhat more considered.

Reading the comments, it reminded me of something my Russian mathematical modeling professor used to say back in school:

time + computation + thinking = constant

Continue reading

Posted in Uncategorized | Leave a comment

Adding an Application Icon

One of the final steps in developing your app before submission is adding an icon. This is a straightforward process:

  • Create a 57×57 pixel PNG, name it “Icon.png”. In must be exactly 57×57 pixels and it must also be a PNG.
  • Add the file to your project’s resources.
  • Go into the Info.plist file and fill in the Value for “Icon file” to Icon.png, making sure that it matches the spelling and capitalization exactly.

Build and launch your app normally, the icon should be added and visible on your application.

Posted in Uncategorized | Leave a comment

KGS Rating Graph

The game of Go involves a ranking system to allow people at different levels of strength to play fair games. The system is widely employed in both in-person and online games, and some variation of it is used by every major Go server and organization.

The ranks go from 30k to 1k, and then 1d to 9d. 1d is 1 rank (or “stone”) from 1k, and 5k is 4 stones from 9k. There are some problems with this system (e.g., in reality the ratings are neither linear nor transitive), but they provide a good way of estimating someone’s strength before you play them for the first time.

In this essay we are going to examine the KGS rating data from 16 March 2008 for confident ranks. One of the key skills in data analysis is an understanding that data is data, and so it is a useful exercise to examine arbitrary data sets to see what you can discover. With this in mind, let’s examine the data and see what falls out.
Continue reading

Posted in Uncategorized | Leave a comment

Bush Approval Rating: 8 Years in Review

A graph of Bush’s approval rating over the last 8 years. The line represents a 5-day rolling median for his rating, which ranged between 90 and 23.

Posted in Uncategorized | Leave a comment

Checking Malloc History

Sometimes it is useful to see what malloc operations have been performed by a given application. Doing this is a fairly straightforward process that can be facilitated with the command malloc_history, but requires a little bit of setup for iPhone-specific apps since the console cannot be used directly.
Continue reading

Posted in Uncategorized | Leave a comment

Where do I…

…sign up to get paid tons of money to make statistical fallacies?

There is a fallacy I like to refer to as the “clifford fallacy” that the news media seems particularly prone to making: “If this dog keeps growing at its present rate, in five years it will be the size of Clifford!”

Posted in Uncategorized | Leave a comment

Wrappers for Numbers: NSNumber and Collections of Integers

In the Java programming language there are both raw and wrapper objects to represent numbers. For example, int and Integer, double and Double, etc. If one wanted to add a numeric object to a Collection object, it required using the wrapper object rather than the raw type.

With the introduction of autoboxing in Java 1.5, moving between these types would largely be handled by the compiler, but there is still a distinction.

Just as with null types, Objective-C also requires that you wrap raw types before inserting them into objects or using them in variable argument lists where the type id is expected. To help us with this, cocoa provides NSNumber.

Continue reading

Posted in Uncategorized | Leave a comment

Using the STL in Objective-C

One of the really powerful libraries available to C++ programmers is the Standard Template Library (STL). While Cocoa has fantastic built-in classes, sometimes it is beneficial–especially when working with algorithms where raw numbers are being used and speed is more important–to use the STL.

Using the STL in Objective-C requires that you switch the file to use Objective-C++ by changing the file ending to .mm. After that you can import the various STL libraries normally: #import .

See Also:

Posted in Uncategorized | Leave a comment