Technology

The Seashore image editor

I tried Seashore to do some very simple image. It was perfect for my simple usage and looks to be able to handle more:

Seashore is a free, open-source image editor for built entirely in Cocoa. It features advanced tools like multiple layers and alpha channel editing, alongside basic tools like gradients, textures, text (with subpixel rendering) and brushes

Technology

iPhone4 and FaceTime

I’d been surprised about Apple emphasizing FaceTime in advertising. I don’t think it’s very compelling — I don’t know enough people with an iPhone4, I rarely have a Wi-Fi connection when I want to talk to them, and I don’t find video chats very compelling anyway. After all, how often do you video iChat or Skype?
Anyway, TechCrunch had an interesting perspective about it when they compared it to a scene from Mad Men (official site. They are getting people to make an emotional connection with the iPhone rather then the analytical one of feature X vs. feature Y.

Technology

Switching keys in values in a map

A functor that reverses a pair: first becomes second,
second becomes first. Useful for switching
from a map to another map (or multimap in this example) where
the value becomes the key and the key the value.

std::map<std::string, int> m;
std::multimap<int,std::string> m2;
m["a"] = 0;
m["b"] = 1;
m["c"] = 0;
std::transform (m.begin(), m.end(), std::inserter (m2, m2.begin()),
                pair_switch());

And the actual code:

template<class PairType>
struct pair_switcher : public std::unary_function<PairType, std::pair<a,b>
{
 typedef std::pair result_type;
 typedef PairType argument_type;
 result_type operator()(const argument_type &p) const
 {
     return result_type (p.second, p.first);
 }
};
Technology

WordPress 3.0 update

Update to 3.0 went pretty smoothly. I’m having some problem with images (added how to fix below)

  • Ran my custom backup script:
$ cd ~/Desktop/wp-backup
$ ./backup
  
  • Downloaded wordpress 3.0:
$ cd ~/Desktop/src/downloads/pkgs
$ curl -O http://wordpress.org/latest.tar.gz
$ mv latest.tar.gz wordpress-3.0.tgz
  
  • Make sure you know the WP administrator user password as WP 3.0 uses a “Super Admin” interface.
  • No real special requirements for my site for wpmu upgrade most a lot of warnings about plugins and themes not necessarily being compatible.
  • Follow the directions or these even better directions
    • Disable plugins from site admin web page
    • Remove (save somewhere else) wp-admin, wp-includes
    • Extract the wordpress-3.0.files
    • Fix permisions (this is Apple’s Snow Leopard Server)
$ cd /Library/Webserver/Documents
$ mv wp-admin wp-includes ~/tmp
$ tar xzvf ~/Desktop/src/downloads/pgks/wordpress-3.0.tgz
$ chown -R _www:_www .
  
  • remove blogs.php
$ cd /Library/Webserver/Documents
$ rm wp-content/blogs.hp
  
  • Modify .htaccess to add the rule for wp-files (replacings blogsphp):
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]
  
  • Upgrade the site (site.com/wp-admin/upgrade.php). Login as the administrator user, if you don’t see “Super Admin” you aren’t the right user.
  • My site admin had some extra steps to perform like getting rid of blogs.php and adding some code
    for the cookies.
  • Update the plugins
Technology

Jeopardy playing computer

From NY Times is this article Smarter Than You Think – I.B.M.’s Supercomputer Challenges ‘Jeopardy!’ Champions – NYTimes.com about how IBM has built a machine that does pretty well playing Jeopardy.

Neither, as it turned out. Both were beaten to the buzzer by the third combatant: Watson, a supercomputer.

For the last three years, I.B.M. scientists have been developing what they expect will be the world’s most advanced “question answering” machine, able to understand a question posed in everyday human elocution — “natural language,” as computer scientists call it — and respond with a precise, factual answer.