Archive for the ‘tech’ Category

Recently, I found myself in a situation… After uninstalling an application from my Macbook Pro, its icon was still visible in the Launchpad. Clicking the icon would do nothing.

How do you get rid of orphaned Launchpad icons? Thanks to Google and Stack Overflow, I discovered that Launchpad icons are stored in a SQLite database in /private/var/folders with

com.apple.dock.launchpad in the name. The find command is useful:

sudo find /private/var/folders -name com.apple.dock.launchpad

finds the directory /private/var/folders/m4/hh39vth91396mblmwt46crkw0000gn/0/com.apple.dock.launchpad. A little poking around with ls reveals that the database itself is db/db.

ls -l /private/var/folders/m4/hh39vth91396mblmwt46crkw0000gn/0/com.apple.dock.launchpad/db
total 22656
-rw-r--r-- 1 shanglin staff 7495680 Dec 1 10:26 db
-rw-r--r-- 1 shanglin staff 32768 Nov 29 00:27 db-shm
-rw-r--r-- 1 shanglin staff 2290752 Dec 3 22:05 db-wal

Let’s use sqlite3 to see what’s in the database:

sudo sqlite3 /private/var/folders/m4/hh39vth91396mblmwt46crkw0000gn/0/com.apple.dock.launchpad/db/db

sqlite> .tables
app_sources dbinfo image_cache widgets
apps downloading_apps items
categories groups widget_sources

sqlite> .schema apps
CREATE TABLE apps (item_id INTEGER PRIMARY KEY, title VARCHAR, bundleid VARCHAR, storeid VARCHAR,category_id INTEGER, moddate REAL, bookmark BLOB);

The rogue app had the name “Spelunky” in it. We can use a SQL wildcard to find apps with the word “Spelunky” in the title:

sqlite> select * from apps where title like '%Spelunky%';
<p class="p1">92|Spelunky HTML5|com.google.Chrome.app.Default-mhagnkphcmpkmabhocgimoncfaihkpof|||519537375.0|book

Let’s delete Spelunky’s entry:

sqlite> delete from apps where title='Spelunky HTML5';

After exiting the sqlite shell, I restarted the dock:

killall Dock

and the Spelunky icon was gone. Success!


Read Full Post »

On the second Thursday of each month, the SGVLUG (San Gabriel Valley Linux Users Group) meets at Caltech, usually for a Linux-themed presentation. Afterwards, the meeting moves to Burger Continental for dinner, discussions, and other fun. On Thursday I attended this month’s SGVLUG meeting, which was about LaTeX. This month the Burger Continental dinner doubled as a Slashdot party, celebrating the 10th anniversary of Slashdot. The party broke up around 11pm. The next day, I learned from an email that Burger Continental caught fire less than two hours after the party and suffered extensive damage to the front. WTF! Fortunately, nobody was injured, and Burger Continental plans to reopen soon.

Read Full Post »

Debugging web pages

I just finished debugging a web page. It was an old school layout based on tables, lots of tables. I needed to add an entry to the page and delete old entries. Everything would have been fine if the sidebar hadn’t suddenly moved to the bottom of the page instead of staying in the sidebar. Yes, I should be able to use a WYSIWYG editor to fix everything, but the fact is, I’ve never figured out how to modify an existing table in Frontpage’s normal view without screwing up the layout one way or another. That meant it was time to whip out ConTEXT and wrestle with tables. I finally fixed everything by pasting the old entries back into the web page and deleting them one by one until I found the code that shouldn’t have been deleted. Needless to say, it was misplaced table tag:

<table class=”infobox” cellspacing=”0″>
<table class=”spacer” cellspacing=”0″>
<td class=”infoboxtop”>

In addition to ConTEXT, I also used the Web Developer Toolbar and Firebug Firefox extensions. The Web Developer Toolbar’s table outline feature draws colored boxes around tables and table cells, so you can see what belongs where. It also has a handy “Validate HTML” shortcut in the Tools menu. Your web page doesn’t really have to be 100% valid to work, but sometimes validators can catch mismatched or malformed tags that will solve your problems, so validate away.

Read Full Post »