My List of Android Apps

Here are some Android apps worth having. I’ll add to this as I find more:

K-9 Mail client:
https://market.android.com/details?id=com.fsck.k9

ColorNote; great task list/note taking:
https://market.android.com/details?id=com.socialnmobile.dictapps.notepad.color.note

AL Voice Recorder:
https://market.android.com/details?id=com.andlabs.vr

Alarm Clock Plus:
https://market.android.com/details?id=com.vp.alarmClockPlusDock

Andricious; if you use Delicious to manage bookmarks:
https://market.android.com/details?id=com.sherbert.delicious

Astro File Manager:
https://market.android.com/details?id=com.metago.astro

Opera Mobile Web Browser; better than default, you can actually save files to locations on SD card you want!
https://market.android.com/details?id=com.opera.browser

Barcode Scanner; useful for QR codes, sharing contacts via barcode, scanning ANYTHING:
https://market.android.com/details?id=com.google.zxing.client.android

ConnectBot; terminal emulator:
https://market.android.com/details?id=org.connectbot

Evernote App; if you don’t know what evernote is, you should check it out:
APP: https://market.android.com/details?id=com.evernote
HOME PAGE: https://www.evernote.com/

Flashlight; lets you turn on your flash LED on as a flashlight.:
https://market.android.com/details?id=com.devuni.flashlight

Hackers Keyboard; much better than default, landscape is full, normal keys:
https://market.android.com/details?id=org.pocketworkstation.pckeyboard

Handsent SMS; I wanted to customize my SMS/MMS views, layout, and this let me:
https://market.android.com/details?id=com.handcent.nextsms

Music Folder Player; just got this, my mp3s aren’t tagged well, I just want to play a whole dir:
https://market.android.com/details?id=de.zorillasoft.musicfolderplayer

AnyPost; connects to ping.fm, twitter, facebook:
https://market.android.com/details?id=com.skamped.anyposts

Xabber, XMPP/Jabber client:
https://market.android.com/details?id=com.xabber.android

Xotof; if you are hosting Gallery 3.0, this integrates super well:
APP: https://market.android.com/details?id=com.xotof
Gallery Home: http://gallery.menalto.com/

JPEF Magic!

Links to the code first!

Github: http://github.com/timbotron/JPEF-Magic

What is JPEF Magic, you ask?

JPEF (Javascript, PHP, Email Form) Magic is a package which handles email forms in an elegant and simple manner. Essentially, it lets you add email forms to your site and deploy addition email forms down the road much quicker then creating each one from scratch.

Notable features..

  • Consolidation; instead of validation and post-processing on each form page, handled with one file
  • Email generated has full text from questions on form
  • Settings for email processing (Email Subject, From, etc) are handled in hidden inputs on form
  • After success, passes all the email body to the ‘on success’ page you’ve set up
  • Allows you to have one “Form submitted successfully” page, with the users info displayed.

Why did I make it?

I come across this need all the time. I always think, “Oh I’ll just throw a form together.” but after you take care of the php to mail it, error checking, it does take time. Couple that with the fact I hate using the name value in emails as the question. I wanted a way to just have the exact language of the question on the form be what was included in the email, with minimal duplication by me. Hence, JPEF Magic was born.

Check out the demo at: http://lab.citracode.com/jpef_magic/

Installing/upgrading Firefox in a Linux environment

This is pretty simple, but I wanted to write up how to install/upgrade Firefox manually, in a Linux environment.

First thing that was tricky is, where is the “proper” place to install it? There is much debate on this point still, but I believe that installing to the /opt directory seems to make the most sense.

So we’ve downloaded the Firefox version we want to install:

[text]firefox-7.0.1.tar.bz2[/text]

It is sitting in a directory:

[text]/home/tim/downloads/[/text]

I open up a terminal and type:

[text]sudo tar -jxvf /home/tim/downloads/firefox-7.0.1.tar.bz2 -C /opt/[/text]

What is this command? Let’s break it down:

  • sudo – “The following commands we are going to run as super user”, necessary for putting things in the opt directory.
  • tar -jxvf – The tar program is what can compress and uncompress archives. We are using the options jxvf
    • j – the compression method that was used is bzip2
    • x – We are going to be extracting the archive.
    • v – We want the output to be verbose, so we’ll see every file extracted.
    • f – We are going to tell it the file to extract.
  • /home/tim/downloads/firefox-7.0.1.tar.bz2 – The full path to the Firefox archive we are going to be installing.
  • -C /opt/ – We want to specify the directory /opt/ as where it is going to be extracted to.

Then, bam Firefox should be extracted to the /opt/firefox directory. Then what do we need to do? Well, depending on your Linux distribution, you need to add a shortcut to that to your menu somewhere, so it’s easy to get to. The program the shortcut should point to is:

[text]/opt/firefox/firefox[/text]

UPGRADE: For upgrading your Firefox install you have in the /opt/ dir, you do the exact same thing. :)

Now I don’t have to spend the 1 min remembering how to do this every time a new version of Firefox comes out. Hope it helps others.

Handling the URI structure change when moving to new CMS

I recently worked on an internal project that replaced a current web app. The new one had a cms behind it, and was overall a better product. So, we made it live, and moved the old tool. And all heck broke loose, since staff had bookmarks pointing to the old location all over the place.

Here is an example of the old link structure:

http://example.com/sub_dir/filename.html

The new link to the same content:

http://example.com/sub_dir/view.php?doc=filename

Now, sure I could try searching and replacing everywhere those links could live, but that sounds like a disaster. Instead I leveraged the mighty power of the mod rewrite in Apache.

I created a .htaccess file in the sub_dir/ directory. Then I added:
[text]
ReWriteEngine on
RewriteBase /sub_dir
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*).html view.php?doc=$1
[/text]

1) We are turning on the rewrite engine. 2) setting the base directory as sub_dir. 3) Saying “If the requested file is not found..”. 4) “Grab the text before the .html, and put it where the $1 is”.

And bam! All those old links, when hit, point to the correct page. I thought this would be much harder than it was. I’m trying to tag the heck out of this post, so if others are looking to do the same thing, it is here for them.

What appears to be a sweet payment system

I am sure people already know all about this service, but I didn’t so I thought I’d share. Stripe is a payment system for web apps, where everything lives on their servers, you don’t need to store any sensitive info yourself. That is very appealing to me. Also, their API looks really straightforward.

The cost is reasonable as well. 2.9% of the transaction, plus 30 cents.

Soon, I hope to have a reason to build their services into a web app. :)

I don’t like it.

I’m looking at my blog, and I am totally uninspired to write.

I look at my blog circa 2004 and I totally want to write on that! Why is that?

I miss the old internet. There was less concern with slick-looking pages, and more excitement about just getting content up there. Part of it is too, it reminds me of my excitement I had back then for my blog.

I’m redesigning my site to make it look like my old Movable Type site. Maybe then I will post more. And I don’t care that it won’t look slick, this blog is primarily for me, after all.

Actual Nickelpinch news!

Link first, to the project on github.

So, I spent time this weekend working a little on Nickelpinch. Saturday, I haunted the Lafayette Library’s halls and coded away, and have a pretty good finished product for what the new database structure will be like. See the model in PDF.

Then last night and today I worked with jQuery Mobile to start on the mockups of the new interface, optimized for mobile/tablets.

  1. Start here
  2. The starting page. click login at the top left
  3. The login page! just click submit
  4. The overview page. You are viewing a users info, they have four categories (rent, food, fun, utilities) Click on any to open the details of the category. It will show the Reserve (how much they’ve allocated to that category), Tally (how much they’ve spent so far this month in that category), and Limit (The limit of how much they want to spend on that category). The color coding should be mostly self-explanatory. Then click add, on the bottom left
  5. The Add Entry page. It’s where you’ll be able to add a new purchase. I believe it’s pretty user friendly, though it needs a date picker.
  6. End of tour

Holy moly is it cool!

I’m totally wiped right now, otherwise I’d write more.

Date-storing tests in MySQL; Part 2

The results are in. First, there was a little thing I forgot about when describing the test to you earlier. Namely, storage size. The amount of storage required is also another thing to think about.

The relevant sizes of MySQL data types:

  • DATE: 3 bytes
  • INT: 4 bytes

Looking at my 3 ideas, one should be thrown out right away. Having three integers, even reducing them to 2 TINYINT’s (1 byte) and 1 SMALLINT (2 bytes), we are still talking 4 bytes, and thats with a lot of extra complexity. So that was out.

I generated a dataset with a little over 7 million rows, with data looking like:

[sourcecode language="sql"]
mysql> SELECT * FROM crunchme LIMIT 10;
+————+————+———-+——–+———+——-+
| idcrunchme | a_date | tim_date | a_year | a_month | a_day |
+————+————+———-+——–+———+——-+
| 12111 | 2009-01-01 | 20090101 | 2009 | 1 | 1 |
| 12112 | 2011-03-03 | 20110303 | 2011 | 3 | 3 |
| 12113 | 2008-11-19 | 20081119 | 2008 | 11 | 19 |
| 12114 | 2009-07-16 | 20090716 | 2009 | 7 | 16 |
| 12115 | 2008-10-19 | 20081019 | 2008 | 10 | 19 |
| 12116 | 2009-04-22 | 20090422 | 2009 | 4 | 22 |
| 12117 | 2009-04-03 | 20090403 | 2009 | 4 | 3 |
| 12118 | 2011-06-10 | 20110610 | 2011 | 6 | 10 |
| 12119 | 2009-06-01 | 20090601 | 2009 | 6 | 1 |
| 12120 | 2008-08-24 | 20080824 | 2008 | 8 | 24 |
+————+————+———-+——–+———+——-+
[/sourcecode]

Let’s see what happens when we run some queries!

[sourcecode language="sql"]
mysql>SELECT SQL_NO_CACHE count(idcrunchme) FROM crunchme WHERE tim_date >= 20100101 AND tim_date <= 20110514;

+——————-+
| count(idcrunchme) |
+——————-+
| 2388242 |
+——————-+
1 row in set (2.96 sec)

mysql>SELECT SQL_NO_CACHE count(idcrunchme) FROM crunchme WHERE a_date >= ’2010-01-01′ AND a_date<=’2011-05-14′;
+——————-+
| count(idcrunchme) |
+——————-+
| 2388242 |
+——————-+
1 row in set (3.61 sec)
[/sourcecode]

So, the integer solution is faster, by roughly 22% at this level. However, here is where it gets fun. It is larger, by one byte. Also, it will mean having to add extra code when I’m working with dates in my CodeIgniter app.

After all this, I am going to go with the MySQL DATE type. I was surprised to see the time difference being so low.

I hope this helps someone else out!

Date-storing tests in MySQL; Part 1

Data, what fun it is!

My issue is this, I’m working on a web app, which uses CodeIgniter, with a MySQL DB. My question was, since all I am storing for a date time is the year, month and day, what is the best way to do this? I’m going to be making a lot of queries like “select all entries from user bob from March to May of this year”.

As I see it, there are several options:

  1. Use the DATE data type in MySQL, which stores as “YYYY-MM-DD”.
  2. Generate 3 attributes, each an integer, one “year”, one “month”, and one “day”.
  3. My new idea, to store it as an integer, in a “YYYYMMDD” format. It will allow for decent queries, since the hierarchy of time still works. (May still comes before March, 20110301 < 20110501).
  4. Use the time function in php, which returns the number of seconds since 1970. A lot of people go this route, but I think it’s crap because in 2038 it will restart, causing issues . Y2K38 people! I’m going to pretend you didn’t even bring this up.

I’m writing a script that will generate about 10.000.000 rows of data, each with every date recording option I mentioned above, then I will make some pretty bar graphs and we shall see what we shall see.

My guestimate is that my integer idea (“YYYYMMDD”) will be the fastest, but let’s see.