Unentschlossen? Der Randomator hilft dir! (Freeware)

19.07.08 | Kategorie: news | 10 Kommentare
Tags: , , , , ,
(No Ratings Yet)
Loading ... Loading ...

For all the english guys please have a look downward!

Nachdem ich inzwischen auch ein wenig firm mit Cocoa bin habe ich mal meinen Randomator in Cocoa übersetzt und er ist jetzt besser denn je!

Ich würde sogar soweit gehen zu sagen, dass es der ultimative Entscheidungshelfer ist.


German Version

Geschichte

Anfang 2008 wollte ich meiner Unentschiedenheit einen Strich durch die Rechnung machen. Lösungen per Widget hatten schnell ihren Esprit verloren, da einfach zu langsam.
Es musste also eine bessere Lösung her und ich schrieb mir ein Script, dass sich perfekt in TextMate integrieren lässt also Commando. (Programmiersprache Ruby für alle interessierten)

Im Februar, oder so, kam mich dann Sam besuchen und wollte auch einen Randomator haben. Kurzerhand entschloss ich mich das Ding als AppleScript zu portieren — sogar mit schöner “nochmaaal”-Taste und einem schönen 512×512 Programmicon.

Nun fehlte noch die Möglichkeit der Mobilität! Also nochmal das ganze programmiert in PHP.

Der “Cocoa”Randomator

RandomatorInterface.png

Nun habe ich mich nochmal mit dem Problem auseinandergesetzt und das Interface von Randomator verändert, denn meistens ist es doch so, dass man sich zwischen zwei Dingen nicht entscheiden kann. “Hawaii oder Malle?”, “Kopf oder Zahl?”, “Ja oder Nein?”, “MacBook oder MacBook Pro?” (Die Antwort lautet übrigens MacBook Pro ;) ) und so weiter.

Eurer gequälten Seele wird nun CocoaRandomator oder einfach nur Randomator helfen. Zwei Textfelder in die ihr eingeben könnt zwischen was ihr euch gerade nicht entscheiden könnt. Danach ein Klick auf “Randomate” oder einfach durch drücken der Enter Taste und schon erscheint im unteren Feld.

Wie immer Open Source. Diese steht unten. Ich verwende zur Randomisierung random(3).


English Version

Randomator is a small Freeware utility which helps you to decide between two sides.

History

In January of 2008 i was suffering under my undecideness. So i started writing a small Ruby Script which tried to help me making my decisions.
The way it was a Ruby Script allowed me to call that Script directly from TextMate.

In February someone without TextMate did ask me for a version which she can use on her computer. So i decided writing the same program again in AppleScript.

Then there was the mobility part — which my program wasn’t! I made it available as a [PHP Script](http://www.zettt.de/randomator1/index.php “Randomator PHP Port V1.0”) and made a small website around it — with CSS and a few graphics and so on.

I wasn’t pleased with the Applescript program it was starting very slow and it just says “Yes” or “No”, which is boring after a while.

Learning Cocoa for a few days now allowed me to make it more flexible then ever before. Most times you got two sides to decide from. The interface of Randomator is specially designed for this purpose. You got two textfields. Just enter your decision parts in those two fields and then click or press enter — and Boom!


Download

RandomatorIcon.png

Creative Commons License
This work is licensed under a Creative Commons GNU General Public License License.


Source

RandomatorController.h



#import

include

@interface RandomatorController : NSObject { int randomNumber; IBOutlet NSTextField * resultField; IBOutlet NSTextField *firstField; IBOutlet NSTextField *secondField; }

  • (IBAction)randomize:(id)sender;

@end


RandomatorController.m:



#import "RandomatorController.h"

@implementation RandomatorController

-(void)awakeFromNib{ [firstField setStringValue:@"Head"]; [secondField setStringValue:@"Toe"]; srandom(time(0)); randomNumber = random() % 2; }

  • (IBAction)randomize:(id)sender{

    randomNumber = random() % 2;

    if(randomNumber == 0) { [resultField setStringValue:[firstField stringValue]]; } else if (randomNumber == 1) { [resultField setStringValue:[secondField stringValue]];

    } }

@end


10 Comments

have your say

Kommentiere oder setze einen Trackback zu diesem Eintrag.
Neue Kommentare per RSS.

Be nice. Keep it clean. Stay on topic. No spam.

:

:


«
»