Mon 16 July, 2007
Sun 15 July, 2007
Sat 14 July, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
Biberach in Hochstimmung—es ist wieder Schützenfest!
Das neue Bierzelt wollte sich gleich mal beliebt machen und verteilte daher in Stadt größere Mengen an Gutscheinen für Halbe, deshalb war im Bierzelt gestern schon ordentlich was los. Schützen wirkt generationenübergreifend und es ist keine Besonderheit, wenn frische Abiturienten zusammen mit Ehefrauen von Bankvorstandsvorsitzenden auf Bänken und Tischen neben ehemaligen Schuldirektoren tanzen.
Im Bierzelt darf natürlich eins auf gar keinen Fall fehlen: der Böhmische Traum.
Geheimer Schützenhit ist bisher jedoch Gebroeders Ko – Boten Anna (Brutalst geekig übrigens, in der IRC Interpretation (en)).
Heute dürft ihr nicht die Schützenübergabe und den
FaschingsJahrgängerumzug verpassen.
Rund um mich her ist alles Freude, und ich wunsch euch
Scheene Schütza!
NP: Funny van Dannen—Urbanhafen
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
“ Yeah, it’s kind of the ‘Myst’ of websites. Real pretty to look at, but don’t try to move or anything. ”
Alan Francis on the new project.ioni.st archive feature
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
#!/bin/bash
#
# 修正 Ubuntu 7.04 fc-cache failed to write cache
#
sudo touch /usr/share/fonts
sudo touch /usr/share/fonts/X11
sudo touch /usr/share/fonts/X11/100dpi
sudo touch /usr/share/fonts/X11/75dpi
sudo touch /usr/share/fonts/X11/Type1
sudo touch /usr/share/fonts/X11/encodings
sudo touch /usr/share/fonts/X11/encodings/large
sudo touch /usr/share/fonts/X11/misc
sudo touch /usr/share/fonts/X11/util
sudo touch /usr/share/fonts/truetype
sudo touch /usr/share/fonts/truetype/arphic
sudo touch /usr/share/fonts/truetype/baekmuk
sudo touch /usr/share/fonts/truetype/freefont
sudo touch /usr/share/fonts/truetype/kochi
sudo touch /usr/share/fonts/truetype/openoffice
sudo touch /usr/share/fonts/truetype/thai
sudo touch /usr/share/fonts/truetype/ttf-arabeyes
sudo touch /usr/share/fonts/truetype/ttf-bengali-fonts
sudo touch /usr/share/fonts/truetype/ttf-bitstream-vera
sudo touch /usr/share/fonts/truetype/ttf-dejavu
sudo touch /usr/share/fonts/truetype/ttf-devanagari-fonts
sudo touch /usr/share/fonts/truetype/ttf-gentium
sudo touch /usr/share/fonts/truetype/ttf-gujarati-fonts
sudo touch /usr/share/fonts/truetype/ttf-kannada-fonts
sudo touch /usr/share/fonts/truetype/ttf-lao
sudo touch /usr/share/fonts/truetype/ttf-malayalam-fonts
sudo touch /usr/share/fonts/truetype/ttf-mgopen
sudo touch /usr/share/fonts/truetype/ttf-oriya-fonts
sudo touch /usr/share/fonts/truetype/ttf-punjabi-fonts
sudo touch /usr/share/fonts/truetype/ttf-tamil-fonts
sudo touch /usr/share/fonts/truetype/ttf-telugu-fonts
sudo touch /usr/share/fonts/type1
sudo touch /usr/share/fonts/type1/gsfonts
sudo touch /usr/share/X11/fonts
sudo touch /usr/share/X11/fonts/100dpi
sudo touch /usr/share/X11/fonts/75dpi
sudo touch /usr/share/X11/fonts/Type1
sudo touch /usr/share/X11/fonts/encodings
sudo touch /usr/share/X11/fonts/encodings/large
sudo touch /usr/share/X11/fonts/misc
sudo touch /usr/share/X11/fonts/util
sudo touch /usr/local/share/fonts
sudo touch /var/lib/defoma/fontconfig.d
sudo touch /var/lib/defoma/fontconfig.d/A
sudo touch /var/lib/defoma/fontconfig.d/B
sudo touch /var/lib/defoma/fontconfig.d/C
sudo touch /var/lib/defoma/fontconfig.d/D
sudo touch /var/lib/defoma/fontconfig.d/E
sudo touch /var/lib/defoma/fontconfig.d/F
sudo touch /var/lib/defoma/fontconfig.d/G
sudo touch /var/lib/defoma/fontconfig.d/H
sudo touch /var/lib/defoma/fontconfig.d/J
sudo touch /var/lib/defoma/fontconfig.d/K
sudo touch /var/lib/defoma/fontconfig.d/L
sudo touch /var/lib/defoma/fontconfig.d/M
sudo touch /var/lib/defoma/fontconfig.d/N
sudo touch /var/lib/defoma/fontconfig.d/O
sudo touch /var/lib/defoma/fontconfig.d/P
sudo touch /var/lib/defoma/fontconfig.d/R
sudo touch /var/lib/defoma/fontconfig.d/S
sudo touch /var/lib/defoma/fontconfig.d/T
sudo touch /var/lib/defoma/fontconfig.d/U
sudo touch /var/lib/defoma/fontconfig.d/V
sudo touch /var/lib/defoma/fontconfig.d/a
sudo touch /var/lib/defoma/fontconfig.d/j
sudo touch /var/lib/defoma/fontconfig.d/m
sudo touch /var/lib/defoma/fontconfig.d/u
然后运行
sudo fc-cache -f -v
出现succeed就可以了。
eiffelqiu还提示说有个桌面效果,我试了一下,我的机器用起来还行,有些动画的效果,和vista类似,看上去挺有趣的。...
add to del.icio.us. look up in del.icio.us.
add to furl
Copying and pasting in OS X from Ruby
IO.popen('pbcopy', 'w+') do |clipboard| clipboard.write('Hello') end # ^V # => "Hello" IO.popen('pbpaste') do |clipboard| puts clipboard.read end # => "Hello"
add to del.icio.us. look up in del.icio.us.
add to furlFri 13 July, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
I have been a consistent user of the nightly builds of the WebKit project for some time now. For those of you who don't know, WebKit is essentially the work-in-progress that will be the next production version of Safari. I like the nightlies because they are extremely fast, and while they occasionally have problems, that's OK.
The point of that discussion was to say that I have stopped using Firefox on my Mac, because the nightly builds of WebKit are so much faster. But there's one problem. In Firefox I could click a tab with my middle-mouse button, and it would close. Safari doesn't have that feature, and that's the one feature from Firefox that I really miss.
So, I've been trying to solve this problem using SIMBL. What SIMBL does is let you write a standard Cocoa bundle and have it load into another program, like Safari. Once loaded, you can replace methods in the application with your own versions, in a way known as "method swizzling." I have successfully written a Cocoa bundle, made the approrpriate changes to make it loadable by SIMBL, and have loaded it into Safari/WebKit. I have logging statements at various points in the bundle, and I can see these on the system console, thus I know it's loading.
Once the bundle was loading, I needed to pick the objects and their methods that I thought would be most likely to let me do what I needed, and then swizzle in my changes. Using F-Script Anywhere I was able to identify a single tab as an instance of TabButton. Using class-dump I was able to generate header files for Safari that would let me see the methods on TabButton and it's parents. My first thought was to override mouseUp:. This works, and I can now trap mouse events when you click on any tab. According to the Apple docs, once I get a mouse event, I should be able to call [theEvent buttonNumber] to figure out which button was pressed. Well, maybe. No matter if I clicked with the left- or middle-mouse button, [theEvent buttonNumber] always returned 0. Further digging in the docs turned up an event called NSOtherMouseUp that is sent when a button "other" than left- or right-mouse is clicked. Supposedly, I should be able to override otherMouseUp: to get those events. I have successfully swizzled this method, but it never gets called. I know that TabButton had a version of this method, because when I swizzle, I can tell if there was already a method there, and there was. I'm just not sure why it isn't being called.
So what did I get working? Well, after working a long time trying to get the middle-mouse detection working, I decided to punt for the moment. I added some code to the mouseUp method to check the event for modifiers and if the user held down Command while clicking, then I will close the tab. This is close to what I want, but nearly as sexy as just middle-mouse clicking. In case you're interested, my TabButton.m looks like this:
1 #import "TabButton.h"
2 #import "WebKit/WebKit.h"
3
4 @implementation TabButton (MCCSwizzle)
5 - (void)_mcc_mouseUp:(NSEvent *) theEvent
6 {
7 NSLog(@"_mcc_mouseDown");
8 int buttonNumber = [theEvent buttonNumber];
9
10 NSLog(@"buttonNumber: %d", buttonNumber);
11 NSLog(@"type: %d", [theEvent type]);
12 NSLog(@"modifierFlags: %d", [theEvent modifierFlags]);
13
14 if ([theEvent modifierFlags] & NSCommandKeyMask) {
15 NSLog(@"Cmd-Click!");
16 [self closeTab: theEvent];
17 } else {
18 [self _safari_mouseUp: theEvent];
19 }
20 }
21 @end
and then the swizzling looks like this:
1 #import <WebKit/WebKit.h>
2 #import "AppController.h"
3 #import "MiddleClickClose.h"
4
5 typedef struct objc_method *Method;
6
7 struct objc_method {
8 SEL method_name;
9 char *method_types;
10 IMP method_imp;
11 };
12
13 BOOL MCCRenameSelector(Class _class, SEL _oldSelector, SEL _newSelector)
14 {
15 NSLog(@"OLD: %s", _oldSelector);
16 NSLog(@"NEW: %s", _newSelector);
17
18 Method method = nil;
19
20 // Look for the methods
21 method = (Method)class_getInstanceMethod(_class, _oldSelector);
22 if (method == nil)
23 return NO;
24
25 // Point the method to a new function
26 method->method_name = _newSelector;
27 return YES;
28 }
29
30 @implementation MiddleClickClose
31 + (void) load
32 {
33 int rc;
34
35 rc = MCCRenameSelector([TabButton class], @selector(mouseUp:),
36 @selector (_safari_mouseUp:));
37 NSLog(@"RC: %d", rc);
38
39 rc = MCCRenameSelector([TabButton class], @selector(_mcc_mouseUp:),
40 @selector(mouseUp:));
41 NSLog(@"RC: %d", rc);
42
43 rc = MCCRenameSelector([TabButton class], @selector(rightMouseUp:),
44 @selector (_safari_rightMouseUp:));
45 NSLog(@"RC: %d", rc);
46
47 rc = MCCRenameSelector([TabButton class], @selector(_mcc_rightMouseUp:),
48 @selector(rightMouseUp:));
49 NSLog(@"RC: %d", rc);
50
51 NSLog(@"MiddleClickClose loaded");
52 }
53
54 + (MiddleClickClose*) sharedInstance
55 {
56 static MiddleClickClose* plugin = nil;
57
58 if (plugin == nil)
59 {
60 plugin = [[MiddleClickClose alloc] init];
61 }
62
63 return plugin;
64 }
65 @end
Line 35 renames Safari's original mouseUp: method to _safari_mouseUp: and then line 39
renames my _mcc_mouseUp: method to mouseUp:. The otherMouseUp: method is handled
on lines 43 and 47, but as I said otherMouseUp never gets called.
What's especially frustrating about this is that I know Safari knows how to bag a middle-click, because I frequently will middle-click on a link in a web page, and Safari will open that link in a new tab. So, why can't I get a middle-click in the TabButton instance? Does anyone have any ideas on this? I'd appreciate any pointers. I feel like I'm thiiiiiiiiiiis close to getting this working, but there's some small piece of info that is eluding me.
add to del.icio.us. look up in del.icio.us.
add to furlThu 12 July, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
- Hans Roslings talks at TED
I really loved his poverty gap visualization - these are links to videos of his talks at TED
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
Two years ago today, Scott Barron published the first episode of the Ruby on Rails Podcast. —Geoffrey Grosenbach
Wow, has it been two years already? Geoffrey’s been a major positive force in the Rails community even longer then that, starting with the humble Pluralizer, which helped us all figure out what table names our ActiveRecord models were supposed to be using. For his next podcast, he’s turning the tables and letting himself be interviewed by Dan Benjamin. Be sure to send in some challenging questions (see Geoffrey’s blog post for details).
Congrats on the milestone, Geoffrey, Scott, and everyone else that’s been involved with the Rails Podcast!
add to del.icio.us. look up in del.icio.us.
add to furl
I’ve mentioned it to some people in the Phoenix tech crowd, but thought I should mention it here, too.
I’m quite pleased to say that I’ve joined Rising Tide Software.
If you’re curious, you can get an idea of the culture behind the company from David’s recent post.
We’re a wicked cool team of skilled, smart people, so keep an eye on future announcements.
add to del.icio.us. look up in del.icio.us.
add to furl
Planning is underway for Desert CodeCamp 2007. It will be held Saturday, September 15th, 2007, at the University of Advancing Technology in Tempe. Presentation proposals are being accepted now (see previous link).
I’d like to give talk, but I’m not sure what I want to talk about.
Here’s what’s running through my mind:
- Trac: A Crash Course
- Beyond Ruby: A Potentially Hasty Intro to Haskell, Erlang, and Io.
- Nothing. Be a spectator and razz Josh and David
Comments and suggestions invited.
add to del.icio.us. look up in del.icio.us.
add to furl
“ Food first, then morality. ”
Bertolt Brecht
add to del.icio.us. look up in del.icio.us.
add to furlWed 11 July, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
“ The past is not dead. It’s not even past. ”
William Faulkner
add to del.icio.us. look up in del.icio.us.
add to furl
Super happy Phoenix Dev House has arrived.

Sweet logo. ;)
Saturday August 4th, 2pm – 1am
21469 East Lords Way, Queen Creek AZ
Only an hour drive from my home.
Phoenix Dev House hopes to become the greater metro Phoenix premier hackathon event mimicking the now famous Bay Area SuperHappyDevHouse.We’re about rapid development, ad-hoc collaboration, and cross pollination. Whether you’re a l33t hax0r, hardcore coder, or passionate designer, if you enjoy software and technology development, Phoenix Dev House is for you. Code in Ruby? PHP? Java? .NET? Perl? It doesn’t matter.
Phoenix Dev House is not a marketing event. It’s a non-exclusive event intended for passionate and creative technical people that want to have some fun, learn new things, and meet new people. In this way, we’re trying to resurrect the spirit of the Homebrew Computer Club. We also draw inspiration from the demoscene as one of the only intentional getting-things-done computer events in the world.add to del.icio.us. look up in del.icio.us.
add to furl

Jason Perry has started a survey at http://railsforge.com/, asking for community feedback on whether a Rails-specific forge-site would be useful or not. What are your thoughts? Head on over and let him know!
add to del.icio.us. look up in del.icio.us.
add to furl
The Haml team recently announced the release of Haml 1.7, which is an alternative markup system that you can use in Rails, instead of the default ERb-based markup. Version 1.7 is significantly faster than previous releases (and is almost as fast as Rails’ default system, now!). There are a few other new features, too: read all about it in the release notes. Great work!
add to del.icio.us. look up in del.icio.us.
add to furlTue 10 July, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
“ Implicit is better than explicit, if you and computer feel same way. ”
Matz
add to del.icio.us. look up in del.icio.us.
add to furl
ActiveReload has just released Warehouse, a simple subversion browser written using Rails. It sports a beautiful UI and can handle the mundane task of user and permission management for you. It’s also being distributed in a unique fashion for most Rails applications. Instead of being hosted, it is sold and downloaded to be installed on your own server.
If you’re interested, check us out at the Warehouse site.
add to del.icio.us. look up in del.icio.us.
add to furlMon 09 July, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
- Madonna's got a blog?!
I should have expected this, but I'm still blown away that she's got a blog. I found it when I was looking for some more info about Hey You.
add to del.icio.us. look up in del.icio.us.
add to furl
Some well-done vids at Cannes Lions Live
(found via Reddit)
add to del.icio.us. look up in del.icio.us.
add to furl
Michel Barbosa has completed his bachelor thesis Delivery of the Key Adoption Factors and Key Characteristics of Companies Using Ruby on Rails. It presents research he has done and conclusions the why and who of switchers.
I’m happy to see that “Joy in Development” was a key adoption factor for 92% of the people interviewed.
add to del.icio.us. look up in del.icio.us.
add to furl
