Search posterous

Search all posts and users. Type a name, type a favorite song title, whatever! See what comes up.
  

More posterous blogs











More recommended blogs »

Here are posterous posts filed under dev...

xeleh says...

One of the annoyances of Mac OS X is the behaviour of the "New folder" action in Finder.

Finder creates new folders at the root level of the focused window and, while this location is fine for many situations, it is not for other: what I expect when I have selected one of the folders on the list/tree and ask Finder to create a new one, is having the new folder created under my selection.

It would be nice having an alternative behaviour which could work according to these rules:
  1. If a folder on the desktop is selected, the new folder will be created on the desktop (that is, like in the original behaviour).
  2. If a folder not on the desktop is selected, the new folder will be created under that folder and it will become the selected folder.
  3. In other case, it will behave like the original action.
Now for the technical part. The solution I'm presenting is a combination of AppleScript and the power of a fantastic automation tool called QuicKeys, which I would recommend to anyone.

The main reason why such a tool is required is the limitation of AppleScript in terms of sending keystrokes to inactive applications. We will also be using this tool to assign a global hotkey for trigger the execution of the script with the version of the "New folder" action.

The rest is self-explained in the image below. As you can see, I assigned the (⌥N) hot key to a QuicKeys shortcut which executes a sequence of three steps:
  1. Execute a snippet of AppleScript to create the folder according to the new behaviour if possible. For any other case the AppleScript could not manage properly (i.e. determining which is the current active and focused window in Finder), tell QuicKeys to jump to step 3 so we can fallback on the original Finder behaviour.
  2. Type keystroke to start renaming the newly created folder and stop the flow, we're done.
  3. Type keystroke to invoke the Finder original "New folder" action for thoses cases not properly managed in step 1.
That's all. Suggestions and comments, specially about other (hopefully easier) approaches, are very welcome.

Filed under: Annoyances, AppleScript, Dev, English, Hacks, MacOSX

riduidel says...

Ces temps-ci, comme vous le savez peut-être, je ne fais plus vraiment beaucoup de Java.
Pour m'entretenir, je me suis donc dit que j'allais voir dans quelle mesure mon idée folle était réaliste ou pas. Et pour ça, évidement, la meilleure solution, c'est de tenter une implémentation "POC", c'est-à-dire pas belle, mais qui fasse tout ce que je veux.
Et je découvre avec stupéfaction que le monde ne s'est pas arrêté il y a deux ans, et qu'il y a toujours des mecs qui développent des bibliothèques très pratiques en java. Oh, bien sûr, quand il faut les inclure dans une application Java Web Start, ça augmente les temps de download. Mais je vais vous dire, depuis environ 2 ou 3 mois, faire le JAR le plus petit du monde, ça ne m'intéresse plus. Surtout quand la contrepartie, c'est l'interdiction d'utiliser la moindre ligne de code étrangère. Et donc, j'utilise des bibliothèques externes, avec joie, devrais-je dire.
J'ai donc découvert des trucs très bien, comme
  • Guice, que je connaissais déja de vue, mais qui est vraiment très agréable quand on peut réellement utiliser l'introspection.
  • glazed-lists, avec lequel je commence tout juste mes expérimentations, me paraît mériter plus qu'un coup d'oeil, tant il peut rendre de services (et éviter de réimplémentations fastidieuses).
  • google collections et guava m'ont l'air de pouvoir amener quelques jolis éléments d'écriture à la limite de la programmation fonctionnelle (ce qui va nettement me rapprocher de Ruby, et dans le meilleur sens du terme).
  • De manière plus anecdotique, jintellitype eest aussi sympatoche.
  • Et bien sûr, commons-configuration, qui devrait me permettre d'éviter (enfin) de redéfinir mon  propre format de propriétés.
Enfin, de mani-ère encore plus latérale, une fois que j'aurais fini l'implémentation Java de mon idée folle, je tenterai peut-être un truc fou : en refa

Aaaaaaaaah ! Saloperie de clavier !

J'ai accidentellement tapé sur CTRL-machin qui a envoyé le mail ! 

Bref, je disais donc, en refaire une partie en Griffon. Ca a l'air de permettre des choses assez mignonnes, et de manière très efficace (sans doute grâce à Groovy dont je m'imprègnerai aussi, et puis ça me fera mon langage de 2009/2010). 
Mais pour l'instant, je joue pas mal avec la complétion via glazed-lists, et c'est franchement chouette. 

Filed under: dev, java

Brian says...

I just released version 1.2 of my Textmate Trac bundle.  It includes an awesome new Preview command contributed by Tudor Marghidanu.  While editing a Trac wiki page, just hit command-option-control-p (same as Markdown, etc.) to pop up an HTML formatted preview of the page.  Seriously useful.  Thanks Tudor!

The command requires the Text::Trac perl module, which you can install from CPAN by running the following in Terminal:

sudo perl -MCPAN -e 'install Text::Trac'

If this is the first time you've used CPAN, it will probably ask you a few questions, and accepting the defaults usually works out well.

Enjoy.

Filed under: dev, textmate, trac

xeleh says...

A requirement from one of my latest projects for the iPhone: needed pixel-perfect versions of some (a lot, actually) of the best apps in the AppStore.

The lazy solution: to code a simple tool which extracts the icon of an app given its ID or iTunes Link and saves it as PNG, making the task hopefully painless.

By the way, the name of the iPhone project I made this tool for was Best Apps, an app that has been already rejected two times by different reasons, including wrong accusations of scrapping. Maybe someday I post the whole story.

Download

Filed under: AppStore, Dev, English, iPhone, Tools

Martin says...

Starting with the upcoming version 9.0, IntelliJ IDEA will be offered in two editions: Community Edition and Ultimate Edition. The Community Edition focuses on Java SE technologies, Groovy and Scala development. It’s free of charge and open-sourced under the Apache 2.0 license. The Ultimate edition with full Java EE technology stack remains our standard commercial offering. See the feature comparison matrix for the differences.

Briefly, in the free Community Edition you’ll get all the Java code support — various refactorings and code inspections, coding assistance; debugging, TestNG and JUnit testing; CVS, Subversion and Git support; Ant and Maven build integration; and Groovy and Scala support (through a separate plugin). To learn more and download the Public Preview of IntelliJ IDEA 9 Community Edition, please visit the IntelliJ IDEA Community Edition site.

The IntelliJ platform, the common foundation for all our IDEs (IDEA, RubyMine, WebIDE or MPS), is being open-sourced under the APL 2.0, too.

Filed under: dev

Martin says...

Retwis is a very simple clone of Twitter, as a demo for the Redis key-value database. Key points:
  • Redis is a key-value DB, and it is the only DB used by this application, no MySQL or alike at all.
  • This application can scale horizontally since there is no point where the whole dataset is needed at the same point. With consistent hashing (not implemented in the demo to make it simpler) different keys can be stored in different servers.
  • The source code of this application, and a tutorial explaining its design, is available here.
  • PHP and the Redis server communicate using the PHP Redis library client written by Ludovico Mangocavallo and included inside the Redis tar.gz distribution.

Filed under: dev

Martin says...

(January 12, 2009) Today in Washington, DC, experts from more than 30 US and international cyber security organizations jointly released the consensus list of the 25 most dangerous programming errors that lead to security bugs and that enable cyber espionage and cyber crime. Shockingly, most of these programming errors are not well understood by programmers; their avoidance is not widely taught by computer science programs; and their presence is frequently not tested by organizations developing software for sale.

The impact of these programming errors is far reaching. Just two of them led to more than 1.5 million web site security breaches during 2008 - and those breaches cascaded onto the computers of people who visited those web sites, turning their computers into zombies.

Filed under: dev

appfreak says...

I kept this one in Instapaper for a while. 2D Boy came to the iPhone news arena with the announcement that they are developing a app of their award winning and massively fun 'World of Goo'.

This article posted in the studio's blog explains the result of their Happy Birthday sale, were you could buy the game paying pretty much whatever you wanted. Similar to Radiohead's album download scheme. http://bit.ly/1UZaJA

The graphics include info about price paid, sales timeline and even a poll about desired price and price paid. Everything has good comment about profitability, owner's cut and issues with the server.

This reminds me of this tweet from last week:

appfreak I got @2dboy World of Goo in their "pay whatever you think it's worth" week http://2dboy.com/games.php
7 days ago from Tweetie

If you haven't done yet, I suggest you grab a copy while you can!

Filed under: analysis, dev, external, games, iphone, new media, trends

white says...

Rails in a Nutshell

This is the draft of upcoming O'Reilly book. Feel free to read and comment. :)

Filed under: dev, rails, ruby, rubyonrails

Martin says...

I dare say that it has all to do with the success of the IPhone. I for one learned Objective-C solely for the purpose of being able to write software for IPhone and IPod touch.

Filed under: Dev