TextMate TODO tag syntax highlighting

As a brief note to self, I like the way the TODO tag is highlighted when using TextMate, so I dug around to see how it worked so I can make other words be highlighted the same way it is. The short answer is that in TextMate, click the Bundles menu, select Edit Bundles, then scroll down to select TODO near the bottom of the list, then Language Grammars and TODO. The last few steps are shown in the image.

Example: How to use javapackager to build a MacOS application bundle

Table of Contents1 - Building a MacOS application bundle with javapackager2 - The longer story3 - The Mac/Java class4 - The three scripts5 - javapackager notes6 - A “Production” javapackager script

I recently learned how to use the Java javapackager command to build a macOS application bundle — i.e., a regular macOS application — from a Java application. In this tutorial I’ll show how to create a Mac application bundle from a simple Java class, in this case a Java Swing class.

Getting a Mac/Java app ready for Apple’s Mac App Store

Over the last two days I’ve gotten a Mac/Java app ready for Apple’s Mac App Store, including bundling the application as a macOS “.app” application bundle, and signing it so it can be submitted to the Store.

A relatively quick look at my browser history shows that I needed to hit over 260 URLs to get that done. As a wise professor once told me, “Keep learning, keep learning.”

How to insert text with a custom TextMate Bundle snippet

As a quick note to self, I just created a TextMate Bundle snippet to insert some text at the current cursor position. Using TextMate 2.0.x, I did it with the following steps. I’ll go through these steps quickly as I’m just writing this for myself:

A custom TextMate 2 bundle to underline the current line alvin May 6, 2016 - 10:31pm

I just created a TextMate 2 bundle to underline the current line, and this image shows how I created that bundle. The dashed-line will be the same length as the line the cursor is currently on (the current line). I do this a lot when I use TextMate to write notes and even Markdown text, so I wanted a little script/bundle like this.

FWIW, the result of this bundle/command is that I can have the cursor be on a line like “Hello, world,” as shown below, press [Command][u], and end up with this:

Hello, world

Source code for an Android ViewPager example (Activity and Fragment)

This is a little unusual for me, but I'm putting the following code here so I can remember how I implement a ViewPager in my current Android application. I want to put this code out here in its current state before it gets more complicated. In fact, I only wish I had copied it out here earlier, before I made it as complicated as it is.

The only things that are important to know are:

Notes on using static fields in Android

Here are a few notes on using static fields in Android, from this SO page. (Note: Some of the stuff on that page is very wrong.)

Because static fields live until an Android app is killed (while instance fields are destroyed a lot), I’ve been using static fields to persist some of my Android app’s “state” data, but I was just thinking that I can probably do the same thing at the Activity level using onSaveInstanceState(Bundle) and then restoring the state with onCreate(Bundle) and onRestoreInstanceState(Bundle). The correct approach really depends on the problem you’re trying to solve.

Android Handler and ProgressBar example

This is an Android Handler and ProgressBar example, from the excellent book, Beginning Android 3. (See the URL that I have linked to.)