Fine Art


I was looking at Monet art prints on eBay today, and noticed some sellers offer hand-painted replicas. “Neat,” I thought–oil on canvas, with real texture and color. But then I compared the images with the original; I was surprised by how noticeable the differences were. I guess that’s why Monet is famous and they aren’t. Can you tell which is the real “San Giorgio Maggiore at Dusk”?

The Real Thing


Advanced GTD with Remember The Milk: A Summary


Doug Ireton recently shared his finely honed GTD with RTM setup. In his guest post on the RTM blog he goes step-by-step through the lists, smart lists, tags, and locations he uses to GTD. These are presented in an evolutionary manner; I thought it would be useful to see a summary of the system all in one place. Thus, what Doug recommends is:

Lists

  • ps-Daily
  • wk-Daily
  • {a list for each personal and work project (prefixed with ps- and wk- appropriately)}
  • ps-Someday
  • wk-Someday
  • iTunes
  • Books
  • Lent/Borrowed

Smart Lists

  • @Home [tag:na AND location:@Home]
  • @Calls [tag:na AND tag:@call]
  • @Errands [tag:na and tag:@errand]
  • @Web [tag:na AND tag:@web]
  • @Work [tag:na AND (location:@work or location:@downtown) AND NOT dueAfter:"2 weeks from today"]
  • @Work-MIT [tag:na AND (location:@work or location:@downtown) AND NOT dueAfter:"1 week from today" AND (priority:1 OR priority:2)]
  • Wait-Personal (or ps-Wait) [tag:wait AND NOT location:@work)]
  • Wait-Work (or wk-Wait) [tag:wait AND (location:@work or location:@downtown)]
  • Work-WeeklyStatus [completedWithin:"1 week of today" AND location:@work AND NOT list:ps-Daily]

Tags

  • na (next action)
  • @web
  • @call
  • @errand
  • {a tag for each person who has been delegated a task from a Wait list}

Locations

  • @Home
  • @Work
  • @Downtown


One Map To Rule Them All


I recently found a great source for maps from every state: the OpenStreetMap. You can download any portion of their maps in .osm format, and they provide tools specifically for converting them to Garming .imgs! More details on the process at their wiki.

They’ve imported and done some cleaning on the entire US Census TIGER dataset as well as integrating user-contributed tracks. I downloaded the .osm for my state, ran java -jar mkgmap.jar map.osm, and ended up with a .img better than the ones I used to piece together myself, and in a fraction of the time as well.

OSMs for every state in the union are here or here. Enjoy!

Update: I’ve converted each of the .osm files into Garmin .img format. You can get them (with the exception of California, Texas, and Virginia, which were too large to convert) at http://files.ideaharbor.org/maps/. Just download the .img of your choice, rename it to gmapsupp.img and place it in your Garmin directory on the GPSr, and you should have maps!



Selecting MySQL Rows Into Columns


Sometimes it’s nice to combine multiple database queries into one to save on round-trips, or for any other reason fetch results from separate tables in a single query without actually joining each of the tables involved. This can be done by effectively selecting the results from the rows of one query into the columns of another.

First, an example table setup; let’s say we’re collecting videos and screenshots for various websites:


CREATE TABLE IF NOT EXISTS `screenshots` (
`id` int(11) NOT NULL,
`site_id` int(11) NOT NULL,
`title` varchar(255) NOT NULL
);

INSERT INTO `screenshots` (`id`, `site_id`, `title`) VALUES(1, 1, ‘Homepage’);
INSERT INTO `screenshots` (`id`, `site_id`, `title`) VALUES(2, 2, ‘Homepage’);
INSERT INTO `screenshots` (`id`, `site_id`, `title`) VALUES(3, 1, ‘Search Results’);

– ——————————————————–

CREATE TABLE IF NOT EXISTS `sites` (
`id` int(11) NOT NULL,
`url` varchar(255) NOT NULL
);

INSERT INTO `sites` (`id`, `url`) VALUES(1, ‘http://google.com/’);
INSERT INTO `sites` (`id`, `url`) VALUES(2, ‘http://yahoo.com/’);

– ——————————————————–

CREATE TABLE IF NOT EXISTS `videos` (
`id` int(11) NOT NULL,
`site_id` int(11) NOT NULL,
`duration` int(11) NOT NULL
);

INSERT INTO `videos` (`id`, `site_id`, `duration`) VALUES(1, 1, 532);
INSERT INTO `videos` (`id`, `site_id`, `duration`) VALUES(1, 2, 331);

And now, the magic query, which selects the number of screenshots and the number of videos for a single site in a single query:


select
max(if(type=’screenshots’,num,”)) as num_screenshots,
max(if(type=’videos’,num,”)) as num_videos
from (
(select count(s.id) as num, ’screenshots’ as type from screenshots s where s.site_id = 1)
UNION ALL
(select count(v.id) as num, ‘videos’ as type from videos v where v.site_id = 1)
) as foo

If you want this information for, say, all sites, we could say:


select
site_id,
max(if(type=’screenshots’,num,”)) as num_screenshots,
max(if(type=’videos’,num,”)) as num_videos
from (
(select s.site_id, count(s.id) as num, ’screenshots’ as type from screenshots s where s.site_id in (1,2,3) group by site_id)
UNION ALL
(select v.site_id, count(v.id) as num, ‘videos’ as type from videos v where v.site_id in (1,2,3) group by site_id)
) as foo group by site_id

In Oracle something similar can be achieved using the decode or case operators.


powered by WordPress     themed by Mukkamu     presented by ideaharbor.org     everything else by steve hulet