I’ve quickly thrown together an SQLite database containing the information found within the Periodic Table of the Elements. I was able to put together this information using the CSV file found here, and I’ve uploaded that file as well. See the downloads below.
Continuing my posts on UVa problems, let’s take a look at Problem #499. Skipping the nonsensical lead-in, we’re given an input like so:
When riding your bicycle backwards down a one-way street, if the
wheel falls of a canoe, how many ball bearings does it take to fill
up a water buffalo?
We’re asked to list the most frequent characters on each line of text, along with their count. Here’s the output for the above:
That’s a bit ugly, isn’t it? It’s actually an encoded message. Decoded, it says:
*CDC is the trademark of the Control Data Corporation.
Encoding messages can be useful for protecting your message from those who don’t know the algorithm to decode it. This encoding is a rather simple one using ASCII manipulation. By adding/subtracting a number from a
char, you can change that character to another. This is because it’s simply performing these simple math operations on the Decimal value of that character. Consider the ASCII table:
I’ve been trying to dabble a bit more in C++ lately, so I wrote this simple code. It checks if the parentheses in the given string are balanced (meaning, there’s a closing bracket for every open bracket). The code itself is straightforward, and it uses iterators to check each character of the string.
I’m a bit late to posting this, but Stack Overflow launched 5 years ago. If you’re on my blog, it’s likely you already know what Stack Overflow is. If not, it’s a wonderful question-and-answer site for programmers that allows beginner developers to interact with experts and get the answers to the questions they need. What’s more is that, in doing this, they’re actually adding to the mass of information that’s on the Internet already (in a very clean, easy-to-read format). Being at the top of most programming-related Google searches, it’s been a wonderful asset to many programmers’ around the world, myself included, and I’d like to personally congratulate them on their immense success. This is the kind of resource that makes the Internet a better place.
Since my last post on Friday, I’ve pushed two updates to Pokédex for Android (the most recent update was pushed just now, so it might take a bit to show up). The first was to fix the bug that prevented images from showing up. The second was to fix a few more bugs, including the one that prevented images from showing up right away upon searching a Pokémon, as well as a few layout bugs.
See below for the entire version history up to this point:
I’ve just published an update for Pokédex for Android that adds pictures for each Pokémon. You should be able to see the update soon. Here’s the Play Store link. I’ve been reading the reviews and hopefully will have more to post on this matter in the near future.
On another note, the iPhone Pokédex is coming along. Since I’m learning as I go, and I’m also pretty busy with other things, it’s been a slow process. So far, it’s running much better than the Android version. I’m hoping to improve the aesthetics in this version as well, so it could be a little while before there’s anything to show.
If you find yourself working directly with SQLite in Objective C…stop. It works, but it’s messy and not ideal. Instead, I recommend using FMDB (Flying Meat Database…yeah…). It hugely simplifies SQLite interaction, which will save you hours of frustration in the long run.
Just a quick update for anyone who’s following. I’m currently going through the Stanford lectures on iOS Development (which I highly recommend, by the way) which are hosted on iTunes U. My first iOS app will be a new version of my Pokédex app (like the one I’ve released for Android and in a web interface as well) built from scratch for iOS. I’m still going to aim for a locally stored data file, but if that doesn’t work out (users may not like the size of the app, for example), I’ll look at some way to host it online.
In addition, I’ve surpassed 1000 active users on Pokédex for Android! I know there are some bugs, and I’ve also heard some suggestions (such as adding images, which is already ready to go), so hopefully I can get around to that soon.
That’s all for now. I’m hoping to have more to report in the near future.