Delete a member of an array

Here’s a quickie: Need to delete a member of an array in JavaScript? The traditional way is with the splice() method. Here’s an alternative using filter(): var deleteFromArray = function(array, valToRemove) { return array.filter(function(member) { return member !== valToRemove; }); }; Demonstrated in the JavaScript console: The filter() method examines each member of your array… Read More »

Web site relaunch

I’ve set up WordPress as part of an overall site refresh. I migrated a few of my past Tumblr posts, the ones that were worth keeping. Much of my former site’s contents are gone. Sorry for the 404s but a lot of that content has been around for so many years that it is totally… Read More »

ADB hung? Restart it without closing the emulator

I find that occasionally adb loses touch with the fact that an emulator is running. I build my project only to get an error that adb timed out waiting for the emulator. I used to close the emulator, rebuild the project in Studio to relaunch the emulator, and wait, and wait. I discovered that you… Read More »

Is your Titanium app running on a tablet?

On a recent Titanium Mobile project, I found my app’s layout got all screwy when running on an Android tablet. To be more precise, on 10-inch class tablets (like the Xoom or ASUS Transformer), buttons and other elements were not positioned correctly. For whatever reason, the 7-inch tablets seemed to be fine. The problem is probably caused… Read More »

Scaling the Android emulator

You can resize a running Android emulator by setting the window’s scale factor. You’ll need to telnet to the running emulator. Then, just enter the window scale command. Enter telnet localhost port_number Then, enter window scale some_fractional_size See the picture for examples of those commands in action. Pretty cool.