Adams Bros Blog

27Feb/130

apache tomcat 7 rpm

Author: Trenton

So, I decided to get an apache tomcat 7 rpm going.  I ended up finding someone who had created one, and then made it work a little bit better.  I had one guy that used to be a fedora RPM contributor help out a bit as well.  The result is a repository on github.

If you want to help contribute, and make it better, by all means fork it and work away. :D

https://github.com/TrentonAdams/apache-tomcat-rpm

Filed under: Java, Linux No Comments
13Mar/120

Age of Empires Cannot Detect CD

Author: Trenton

I have the collectors edition, which includes AOE 1/2 and the expansions.  I was having troubles with this game, as it kept asking for the CD, when the DVD was in the drive.  This was because I applied a patch downloaded off the original site, thinking I needed to make sure it was up to date.  Well, as the story goes, the readme.txt on the DVD tells you NOT to do that, and that all the latest patches are already applied, and the ones on the website are not compatible with the DVD version.

Filed under: Uncategorized No Comments
28Feb/127

Upgrade Android SQLite Database

Author: Trenton

After fiddling with a few different styles of coding a database upgrade implementation for Android, I've settled on a fairly simple method.  Basically, I take the old version, and increment a counter until I get to the current version.  Through each iteration, I use switch on the value of the upgradeTo variable, and upgrade each cycle.  If things get too complex for your application, you can always create individual upgrade methods, for each version.

Of course this method will only work if your database version is incremented by one each time you change the database.  And, this really should be the way you version it anyhow.

    public void onUpgrade(
        final SQLiteDatabase db, final int oldVersion,
        final int newVersion)
    {
        int upgradeTo = oldVersion + 1;
        while (upgradeTo <= newVersion)
        {
            switch (upgradeTo)
            {
                case 5:
                    db.execSQL(SQLiteSet.V5_ADD_LAST_CARD);
                    db.execSQL(SQLiteCard.V5_ADD_FAILED);
                    break;
                case 6:
                    db.execSQL(SQLiteSet.V6_ADD_IMPORT_TYPE);
                    break;
                case 7:
                    db.execSQL(SQLiteSet.V7_ADD_SHORT_FNAME);
                    break;
            }
            upgradeTo++;
        }
    }

Someone asked in a comment, why we do the upgrade in a loop.  I do this because I do not know what version they will be converted from or to. So, I must either put a bunch of logic for every possible upgrade variation, such as 1 => 2, 1 => 3, 1=> 4, 3=> 4, etc, etc, or, I can loop through and do one upgrade at a time, and increment the version through each loop.  This GREATLY simplifies the database upgrade.

Filed under: Android, Java 7 Comments
13Feb/120

perltwit just release

Author: Trenton

Perl Twit is a Linux/Unix command line utility for sending twitter messages.

I've been using this for probably well over a year now, and just never managed to release it.  Today I decided to push it up to github.com, and let the world have at her.

https://github.com/TrentonAdams/perltwit

Filed under: Linux, Perl No Comments
31Dec/117

Send Email in your Android Application

Author: Trenton

I've seen a lot of examples of how to send email from an android application.  All of them result in applications coming up in a chooser list that are not appropriate for sending email.  In this post, I'll described the various solutions I found, and the solution that brings up only email clients.

Filed under: Android, Java Continue reading
7Nov/110

Conversion to Dalvik format failed with error

Author: Trenton

I went looking, and looking, and looking, for a solution to this problem. None of them seemed to fit the bill. I tried...

  1. updating proguard
  2. not using libraries I shouldn't be
  3. re-importing the project
  4. removing duplicate android jars
  5. removing all android jars
  6. a host of other "suggestions" from Eclipse Android users
Filed under: Android, Java Continue reading
22Jul/110

Eclipse Android Hello World Tutorial Video – Part 3

Author: Trenton

In third part of the android hello world video, we explain the different components of the application, and why things are done in a certain way.  This video is a bit raw.  However, rather than editing the videos, I'm going to try and improve my presentation skills as I go.

21Jul/112

Ubuntu Sluggish or Slow

Author: Trenton

I was recently having a problem where my new computer was becoming extremely sluggish while running Ubuntu Linux 11.04.  The keyboard input was very delayed and slow.  The graphics were terribly slow.  Just about everything in the system became very slow.  I've heard reports from similar problems, of complete lockups.  It seemed to be linked to when the screensaver was activated, or power management was activated.  But, after having disabled both, and continuing to have problems, I realized that wasn't it.  Keep reading for the solution to my problem; I hope it helps you too.

Filed under: Linux, ubuntu Continue reading
16Jul/110

Eclipse Android Hello World Tutorial Video – Part 2

Author: Trenton

Part 3 - Code Explained

Okay, I've finished another android development demo video.  Sorry it took so long, I got really busy with a new computer and what not, and life in general.  In the next video in this series, I will explain the details of the hello android application.  So, if you do not understand some of what is happening, stay tuned for the next video in the series.

16Jul/110

Slow SSH Login

Author: Trenton

I had slow login problems with my SSH server for many months, and never bothered to try and fix it. Finally I got sick of it, and enabled verbose mode. I noticed it was doing public key authentication, GSSAPI authentication, and then password. The authentication would fail on public key, then the GSSAPI authentication would sit there for a long time, before moving on to password authentication.

Add the following to your /etc/ssh/sshd_config

GSSAPIAuthentication no
GSSAPICleanupCredentials no
Filed under: Linux No Comments