Messages - Jabberwock [ switch to compact view ]

Pages: prev1 2 3 4 5 [6] 7 8 9 10 11 ... 16next
26
FARR Plugins and Aliases / Alias: convert units (with Units)
« on: July 15, 2010, 03:14 PM »
Someone asked for this so nicely:  :P

https://www.donationcoder.com/forum/index.php?topic=8071.msg212665#msg212665

that I have patched up a simple unit converter alias with the use of GNU units program

http://en.wikipedia.org/wiki/Units_%28software%29

(wiki lists the windows binary link - you need to install it and/or GNU-WIN).

Here it is:

1000>>>units>->showmemo Result:;;;appcapappendmemo C:\Program Files\Editing\GnuWin32\bin\units.exe "$$1" "$$2">+>units (.*) to (.*)

Naturally, you may need/want to modify the path and the expression.

Usage:

units 100 miles/hour to km/hour

Result:
* 160.9344
/ 0.0062137119

27
Was/is there a unit converter plugin for FARR or am I imagining things?

If there is not, I suggest one... I suppose it could work similarly to FCalc (which I absolutely love!), i.e. you type in:
convert 5 meters to inches
and you see the result in the results pane.
Unit autocompletion would be nice.

Wait... just had an idea - type in just "convert 5 meters" and 10 most frequently used conversions (from meters, of course) show up automatically!

Edit: Just found this:
http://units.sourceforge.net/

I am not sure how usable it could be for a plugin...

28
Finished Programs / Re: organize text
« on: July 15, 2010, 04:13 AM »
Could it be a Microsoft Word macro?

The simplest way I can see is to open a document and then a selection of other documents to paste into. A macro would cut selected text and ask for user input (? in Word status bar). The user would input the filename, e.g. "1" and the text gets sent to the open "1.doc" (or "1.txt") document.

Advantages:
1. You stay in Word which might be useful for other word processing tasks you need to do with the text.
2. You have direct preview of all appended files, so you might clean them up immediately.
3. If the document names are short and easy to handle, no need to remember the shortcuts - log entries go into "Log", comments into "Comments" etc.
4. It should be simple - short code, no need for an external app to be running, etc.

Disadvantages:
1. You need Word (duh).
2. The document names may be either informative/usable etc. or easy to enter. I mean if you choose file names "1.txt", "2.txt" (for easy input) you have to rename them later anyway.

Edit: Could you describe the "automated" part of the request in more detail? What would be the criteria for parsing which you mention later (first you write about cutting etc.)?

29
Find And Run Robot / Re: FARR prevents DiRT 2 from starting
« on: July 15, 2010, 03:43 AM »
I use Ctrl+`. It's quite convenient as it does not require looking at the keyboard (I could not do e.g. Win + function or Pause like that) and still does not interfere with my more frequently used shortcuts (I use it a lot, but not as often as my "work" cuts).

I might be a bit obsessive about it, but I don't like to move my fingers from where they belong, i.e. the home keys (yes, I know, the sentence just invites all those NSFW comments ;) ). As my work requires quite a lot of typing - I am a translator - I prefer to have everything close to my fingertips. In my work applications I have most of the commands available as Left Alt + home-or-near-home keys, i.e. JKL;UIOPNM (<- that was easy to type  :D ). At some point I had even arrow keys redefined as Ctrl+JKL: but it turned out they were not used that much.

Sorry for that aside, but I think it's still on the topic, considering that FARR is all about eliminating that productivity-killing monster i.e. mouse + desktop, menus etc.

30
OK, here it goes... It's very simple, but it has manual confirmation built-in - the distance measurement is not always correct. Any tips for improvement are welcome, of course.


use Text::Levenshtein qw(distance);

# Change to your file dir, naturally

opendir (DIR, "N:/Cartoons/New");

@files = readdir(DIR);

foreach $filename (@files) {
print $filename;
$dis = 1000;

# Your filename list text file here

open (INFILE, "Filenames.txt");


while (<INFILE>) {

chomp $_;

if ($dis > distance ($_, $filename)) {
$dis = distance ($_, $filename);

# All my files are avi, you might want to check the extension, too

$best = $_ . ".avi";
}
}
print "$filename = $best \n";
print "OK?";
$response = <>;
chomp $response;
if ($response eq "y") {
rename ($filename, $best);
print "renamed";
}

}


Pages: prev1 2 3 4 5 [6] 7 8 9 10 11 ... 16next
Go to full version