topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday November 21, 2025, 8:00 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Recent Posts

Pages: prev1 ... 95 96 97 98 99 [100] 101 102 103 104 105 ... 113next
2476
FARR Plugins and Aliases / Re: FARR plugin: Bakko
« Last post by ewemoa on March 02, 2009, 07:10 PM »
Right.  Thanks mouser for adding this hotkey!  Very helpful :)
2477
FARR Plugins and Aliases / Re: FARR plugin: Bakko
« Last post by ewemoa on March 02, 2009, 07:05 PM »
FWIW, what I tend to use the plugin for are the following transformations:

  • wikimedia http URL -> https URL
  • evaluator
  • prime factorization

The evaluator just hands things to Javascript to evaluate -- so although the examples documented in the OP are for mathematical calculations, one can actually do a fair bit more.  What I tend to use this for is small bits of testing.  For example, recently mouser added %APPDRIVE% support for FARR and I wanted to see if it worked.  What I ended up doing to test this was to type the following into FARR's main window text edit field:

FARR.getStrValue("resolve:%APPDRIVE%");

and then choose the "Evaluate" context menu item.  This saved me a tiny amount of time and effort changing code in a plugin and reloading it.

I did something similar to test mouser's implementation of %PLUGINDIR% too :)
2478
FARR Plugins and Aliases / Re: FARR plugin: Bakko
« Last post by ewemoa on March 02, 2009, 06:49 PM »
Thanks for the feedback :)

On the off-chance that a little more exposition might spark additional interest, below are some more comments.

To give a more concrete sense of what transformations look like, I'll post source to a couple. 

First, consider the amazon.com URL "sanitizer" (really all it does is to remove everything starting at the ref= portions of many an amazon.com URL):

Code: Javascript [Select]
  1. /*global params, pu */ // jslint be quiet
  2. (function () {
  3.   var name;
  4.   // NOTE: no spaces in name
  5.   name = "SanitizeAmazonURL";
  6.   function caption(stxt) {
  7.     return "Sanitize Amazon.com URL";
  8.   }
  9.   function hint(stxt) {
  10.     return ""; // XXX
  11.   }
  12.   function icon(stxt) {
  13.     return pu.pidir + "\\icons\\sanitize.ico";
  14.   }
  15.   function launch(stxt) {
  16.     return "farr://pcommand " +
  17.            aliasstr + " " +
  18.            "xform " +
  19.            name + " " + // NOTE: no spaces in name
  20.            stxt;
  21.   }
  22.   function display(stxt) {
  23.     var m;
  24.     m = /^https?:\/\/.*\/ref=.*$/.exec(stxt);
  25.     if (m === null) {
  26.       return false;
  27.     } else {
  28.       return true;
  29.     }
  30.   }
  31.   function code(argtxt) {
  32.     var m;
  33.     // http://www.amazon.com/Mythical-Man-Month-Software-Engineering-Anniversary/dp/0201835959/ref=stuff
  34.     // ->
  35.     // http://www.amazon.com/Mythical-Man-Month-Software-Engineering-Anniversary/dp/0201835959/
  36.     m = /^(.*\/)ref=.*$/.exec(argtxt);
  37.     if (m === null) {
  38.       pu.displayAlertMessage("Failed to sanitize URL");
  39.       return null;
  40.     } else {
  41.       return m[1];
  42.     }
  43.   }
  44.   return {name: name,
  45.           caption: caption,
  46.           hint: hint,
  47.           icon: icon,
  48.           launch: launch,
  49.           display: display,
  50.           code: code};
  51. } ());

Next, consider the following which attempts to convert some wikimedia (e.g. wikipedia.org) http URLs to corresponding(?) https URLs -- note, that this one is not yet available in the archive.

Code: Javascript [Select]
  1. /*global params, pu */ // jslint be quiet
  2. /*
  3.    A number of Wikimedia-provided http URLs appear to have https
  4.    counterparts.  This transformation attempts to provide a
  5.    bridge between these.
  6.  
  7.    Examples:
  8.  
  9.      http://en.wikipedia.org/wiki/Magnetite
  10.        ->
  11.          https://secure.wikimedia.org/wikipedia/en/wiki/Magnetite
  12.  
  13.      http://ja.wikipedia.org/wiki/Test
  14.        ->
  15.          https://secure.wikimedia.org/wikipedia/ja/wiki/Test
  16.  
  17.      Although note that FARR may not handle some non-ASCII so well...
  18.  
  19.      http://en.wiktionary.org/wiki/test
  20.        ->
  21.          https://secure.wikimedia.org/wiktionary/en/wiki/test
  22.  */
  23. (function () {
  24.   // XXX: select text after transformed?
  25.   var name, snametable;
  26.   // NOTE: no spaces in name
  27.   name = "SecureWikimediaURL";
  28.   // What is currently handled...
  29.   //      *.wikipedia.org
  30.   //      *.wikisource.org
  31.   //      *.wikiversity.org
  32.   //      *.wiktionary.org
  33.   //      *.wikinews.org
  34.   //      *.wikiquote.org
  35.   //      *.wikibooks.org
  36.   //
  37.   // XXX: what to do about:
  38.   //      mediawiki.org
  39.   //      commons.wikimedia.org
  40.   //      meta.wikimedia.org
  41.   //      wikimediafoundation.org
  42.   //      species.wikimedia.org
  43.   //      incubator.wikimedia.org
  44.   snametable = {
  45.     "wikipedia": true,
  46.     "wikisource": true,
  47.     "wikiversity": true,
  48.     "wiktionary": true,
  49.     "wikinews": true,
  50.     "wikiquote": true,
  51.     "wikibooks": true
  52.   };
  53.   function caption(stxt) {
  54.     return "Secure Wikimedia URL";
  55.   }
  56.   function hint(stxt) {
  57.     return ""; // XXX
  58.   }
  59.   function icon(stxt) {
  60.     return pu.pidir + "\\icons\\secure.ico";
  61.   }
  62.   function launch(stxt) {
  63.     return "farr://pcommand " +
  64.            aliasstr + " " +
  65.            "xform " +
  66.            name + " " + // NOTE: no spaces in name
  67.            stxt;
  68.   }
  69.   function display(stxt) {
  70.     var m, sname;
  71.     m = /^http:\/\/([^\/]+\.)*([a-zA-Z]+)\.org\/wiki\//.exec(stxt);
  72.     if (m !== null) {
  73.       sname = m[2];
  74.       if (snametable[sname]) {
  75.         return true;
  76.       }
  77.     }
  78.     return false;
  79.   }
  80.   function code(argtxt) {
  81.     var m, lname, sname, what;
  82.     // XXX: synchronize (more?) w/ regexp in display()?
  83.     m = /^http:\/\/([a-zA-Z]+)\.([a-zA-Z]+)\.org\/wiki\/(.*)$/.exec(argtxt);
  84.     if (m === null) {
  85.       pu.displayAlertMessage("Failed to 'secure' URL");
  86.       return null;
  87.     } else {
  88.       lname = m[1];
  89.       sname = m[2];
  90.       what = m[3];
  91.       return "https://secure.wikimedia.org/" +
  92.              sname + "/" +
  93.              lname + "/" +
  94.              "wiki/" + what;
  95.     }
  96.   }
  97.   return {name: name,
  98.           caption: caption,
  99.           hint: hint,
  100.           icon: icon,
  101.           launch: launch,
  102.           display: display,
  103.           code: code};
  104. } ());
2479
Great to hear it's working  :Thmbsup:
2480
I tried uninstalling Python 2.6.x and installing Python 3.x -- didn't seem to work here [1], but may be other people will experience differently.

There's a bit at:

  http://activestate.com/activepython/python3/

that says:

Many 3rd-party modules and extensions that you may depend upon may not yet be available for Python 3. [Currently this includes the Python for Windows (pywin32) extensions that are a default part of ActivePython on Windows.] As a result you may want to continue to use Python 2 for the time being. However, you can safely install both ActivePython 2.6 and ActivePython 3.0 side-by-side on your computer so that you can experiment with Python 3 while still using Python 2 for your current code.
Python 3.0 is Python's future, however the Python 2.x line will continue to see new releases for some time to allow for a long and smooth transition. ActivePython 2.6 is the latest ActivePython 2.x release.

Perhaps the part in bold-face is related...

Ah, I didn't mention this earlier, but my sense of the corrupt text was that this happens if some of certain variables (e.g. releasedatestring) are not defined.


[1] I didn't even notice the plugin appearing...
2481
Thanks for the info concerning 1.15 :)

The following works for me - I haven't tested in-depth, but my suspicion about what made things work out is the signature for onSearchBegin -- I added a couple of more parameters after looking at the "Available Callbacks" section of:

  http://e.craft.free....rr/FScript/help.html

Code: Python [Select]
  1. displayname = "TESTPython"
  2. versionstring = "0.0.1"
  3. releasedatestring = "March 2nd, 2009"
  4. author = "Author"
  5. updateurl = ""
  6. homepageurl = ""
  7. shortdescription = "TESTPython"
  8. longdescription = "Python Test Plugin, you know?"
  9. readmestring = ""
  10. iconfilename = "FScript.ico"
  11. aliasstr = "ttt"
  12. regexstr = ""
  13. regexfilterstr = ""
  14. keywordstr = ""
  15. scorestr = "300"
  16.  
  17. # type
  18. UNKNOWN = 0
  19. FILE = 1
  20. FOLDER = 2
  21. ALIAS = 3
  22. URL = 4
  23. PLUGIN = 5
  24. CLIP = 5
  25. # Postprocessing
  26. IMMEDIATE_DISPLAY = 0
  27. ADDSCORE = 1
  28. MATCH_AGAINST_SEARCH = 2
  29. # search state constants
  30. STOPPED = 0
  31. SEARCHING = 1
  32.  
  33. def onInit(currentDirectory):
  34. #  FARR.setStrValue("DisplayAlertMessage", "onInit")
  35.   return
  36.  
  37. def onSearchBegin(querykey, explicit, queryraw, querynokeyword,
  38.                   modifierstring, triggermethod):
  39. #  FARR.setStrValue("DisplayAlertMessage", "onSearchBegin")
  40.   if not explicit:
  41.     return
  42.   FARR.setState(querykey, SEARCHING) #start search
  43.   #   return result to farr (queryID, title, path, icon, entrytype=FILE, resultpostprocessing=2, score=300)
  44.   FARR.emitResult(querykey, "python TITLE", "python PATH", iconfilename, ALIAS, IMMEDIATE_DISPLAY, 5000)
  45.   FARR.setState(querykey, STOPPED) #stopped search
  46.  
  47. def onSetStrValue(name, value):
  48. #  FARR.setStrValue("DisplayAlertMessage", "onSetStr: " + name + " " + value)
  49.   return
  50.  
  51. # the following seems to work
  52. #FARR.setStrValue("DisplayAlertMessage", "loaded python test plugin")
2482
The following worked a little bit better for me -- though I didn't end up seeing onBeginSearch getting invoked.

What I used:

  • Python 2.6.x (ActiveState)
  • FScript.dll version 1.13.0.0 (at least that's what I saw via the properties dialog box in explorer)
  • FARR 2.48.0.1
  • Windows XP

Uncommenting the last line shows that some bits seem to work for me.

Ah, I also have a vague memory that czb had a Python plugin -- may be asking him might shed some light on the matter.  I think a thread w/ the plugin mentioned in it says something about it being discontinued, but he still seems to have a page for it:

http://czb.dcmembers.com/TodoTXT.html

Code: Python [Select]
  1. displayname = "TESTPython"
  2. versionstring = "0.0.1"
  3. releasedatestring = "March 2nd, 2009"
  4. author = "Author"
  5. updateurl = ""
  6. homepageurl = ""
  7. shortdescription = "TESTPython"
  8. longdescription = "Python Test Plugin, you know?"
  9. readmestring = ""
  10. iconfilename = "FScript.ico"
  11. aliasstr = "ttt"
  12. regexstr = ""
  13. regexfilterstr = ""
  14. keywordstr = ""
  15. scorestr = "300"
  16.  
  17. # type
  18. UNKNOWN = 0
  19. FILE = 1
  20. FOLDER = 2
  21. ALIAS = 3
  22. URL = 4
  23. PLUGIN = 5
  24. CLIP = 5
  25. # Postprocessing
  26. IMMEDIATE_DISPLAY = 0
  27. ADDSCORE = 1
  28. MATCH_AGAINST_SEARCH = 2
  29. # search state constants
  30. STOPPED = 0
  31. SEARCHING = 1
  32.  
  33. def onSearchBegin(querykey, explicit, queryraw, querynokeyword):
  34.   FARR.setStrValue("DisplayAlertMessage", "woohoo")
  35.   FARR.setState(querykey, SEARCHING) #start search
  36.   #   return result to farr (queryID, title, path, icon, entrytype=FILE, resultpostprocessing=2, score=300)
  37.   FARR.emitResult(querykey, "python TITLE", "python PATH", iconfilename, ALIAS, IMMEDIATE_DISPLAY, 5000)
  38.   FARR.setState(querykey, STOPPED) #stopped search
  39.  
  40. # the following seems to work
  41. #FARR.setStrValue("DisplayAlertMessage", "loaded python test plugin")
2483
Developer's Corner / Re: Anyone tried Google Code Search?
« Last post by ewemoa on March 02, 2009, 12:18 AM »
It has been helpful for me when trying to locate code samples -- e.g. if I come across some function or method for which I find the documentation or other samples lacking, there have been times when this service has turned things up that have helped my understanding.
2484
Find And Run Robot / Re: Latest FARR Release v2.107.04 beta - Sep 23, 2012
« Last post by ewemoa on February 26, 2009, 07:47 AM »
Thanks for the new features :)

%APPDRIVE% seems to be working nicely here, hurray!

BTW, any examples for the following?

In an alias contents you can now specify #filecontents fullfilenamewithpathhere (can use %ALIASDIR%), to have the contents of the file dumped into the alias results when searching.
2485
Living Room / Re: Tech News Weekly: Edition 08-09
« Last post by ewemoa on February 24, 2009, 07:39 AM »
Thanks for this week's :)

Re: 3: Too bad the approach of producing a lot of "chaff"/"decoy" data probably won't help...M-x spook ;)
2486
FARR Plugins and Aliases / Re: Problems with installing plugins in FARR
« Last post by ewemoa on February 23, 2009, 05:14 AM »
I don't know if this would help with diagnosing the issue, but is it practical to try to reproduce the problem under another account on the same machine?
2487
FARR Plugins and Aliases / Re: FARR plugin: Akete
« Last post by ewemoa on February 21, 2009, 09:58 AM »
it could be a completely different plugin with no connection whatsoever

It's not clear to me that doing it in a separate plugin will help -- it might, but it isn't clear to me how yet (if it indeed is helpful).

i will not ask for a refund if it creates some after effects ;)

Well, you might not, but it's not entirely unlikely that it would bother me -- I use the plugin too and at least currently, I look after the code.  I think it would be kinder to the current and potential future maintainers if the plugin's design and implementation are clear and coherent ;)

with the Akete.folders ;) plugin i just do :

Actually, this wasn't meant as a separate plugin -- user variables under [Akete.Folders] are accessible to any plugin as far as I understand.  I had thought that placing the settings in a separate section might simplify the design and configuration.

so my suggestion is : if you do it, do it any way you see fit  :D

I do not see a way that is fit just yet -- however, who knows what the future may bring?
2488
FARR Plugins and Aliases / Re: FARR plugin: Akete
« Last post by ewemoa on February 19, 2009, 03:59 AM »
I might consider working on an implementation, but at a minimum I think I'd like to convince myself of a coherent design.  If I don't understand how it is supposed to work, I'm not going to have an easy time getting it to work, nor maintain :)

Another potential issue that occurred to me is precedence.  It's not clear to me yet whether a folder setting should take precedence over a file extension setting or vice versa.  If "it depends", then coming up with a way of expressing which setting "wins" for a particular situation or for certain situations seems like a possible way out.

It seems to me that the idea (as I currently understand it) is not well-defined enough for an attempt at an implementation.  Perhaps I'll think of something -- or may be someone else will ;)
2489
Living Room / Re: My 5000 posts commemorative DC mug
« Last post by ewemoa on February 18, 2009, 09:15 PM »
2491
Somewhat related...my local installation of PopupWisdom gave me the following Larry Wall quote today:

Perl is designed to give you several ways to do anything, so consider picking the most readable one.
--In the perl man page

I checked an online version of a perl man page and didn't see it though...

Another reference:

  https://secure.wikim...e/en/wiki/Larry_Wall
2492
Living Room / Re: What are you getting for your Special Other for Valentines Day?
« Last post by ewemoa on February 17, 2009, 11:51 PM »
If you were to try celebrating the day using a Chinese calendaring system, you could have the day be different pretty much every year:

http://www.asia-home...a/cncaps.php?lang=en

Then you can both forget ;)
2493
FARR Plugins and Aliases / Re: FARR plugin: Akete
« Last post by ewemoa on February 17, 2009, 08:36 AM »
Interesting idea.

If this were to be implemented, I wonder if it might work better to do it with something like:

[Akete.Folders]
C:\Documents and Settings\Administrator=C:\Program Files\Notepad++\notepad++.exe

One thing to consider is what to do about files in subfolders...

On a tangential note, I wonder if having something like:

[Akete.Variables]
$np=C:\Program Files\Notepad++\notepad++.exe

might allow one to do something like:

[Akete.Folders]
C:\Documents and Settings\Administrator=$np

If this were doable, it might make some of the existing functionality a little nicer.  That's off the top of my head though -- probably a good idea to explore the consequences and practicality a bit more.
2494
Thanks again!

I hope doing a more frequent release becomes practical, but also easier -- have my fingers crossed that technology can be appropriately leveraged ;)
2495
General Software Discussion / Re: Windows editors - do they have to be so bad?
« Last post by ewemoa on February 16, 2009, 11:44 PM »
As with programming languages, my leaning these days is to not try to do everything with a single choice -- there is some overhead in switching temporarily, but often enough I have found it worthwhile.

Recently I have found the following to be useful: emacs, vi (various flavors), notepad, notepad++, pspad, and wordpad.

My two local currency units ;)
2496
Living Room / Re: What are you getting for your Special Other for Valentines Day?
« Last post by ewemoa on February 16, 2009, 07:51 AM »
We decided to prepare a special meal together.

vmeal.png
2497
Living Room / Re: Tech News Weekly: Edition 06-09
« Last post by ewemoa on February 14, 2009, 03:19 AM »
From the article related to 12:

Since the Soviets launched Sputnik in 1957, it is estimated about 6,000 satellites have been put in orbit.

Satellite operators are all too aware that the chances of a collision are increasing.

Perhaps people will start betting on collisions in the not-so-distant future...

Nicholas Johnson, an orbital debris expert at the Johnson Space Center in Houston, was quoted by the Associated Press as saying that the Hubble Space Telescope and Earth-observing satellites at higher orbits and closer to the collision site were at greater risk of damage.

Wow, I guess I should have expected it, but there are "orbital debris experts"?

Thanks -- and it's nice to see space-related things again  :Thmbsup:
2498
Site/Forum Features / Re: Ignore Thread and Improved Bookmark Mod Implemented
« Last post by ewemoa on February 13, 2009, 08:25 AM »
I noticed that there is a "MARK" button between the "REPLY" button and the "NOTIFY" button -- and that clicking on it brings up a little menu.  Nice :)

Now, if we could get a similar menu for "UNREAD POSTS"...

What would it have?

I'd put at least the following:

2499
Living Room / Re: Going Into Frugality Mode -- What are your Tricks and Tips
« Last post by ewemoa on February 13, 2009, 06:55 AM »
PS - Why do you need a mirror in the shower with you to shave?
I compared shaving with and without a mirror -- the results seemed noticeably better with the mirror.
2500
Javascript / Re: Excellent online tutorial
« Last post by ewemoa on February 12, 2009, 06:39 AM »
May be you will find the following thread to be of interest:

https://www.donation...ex.php?topic=16045.0
Pages: prev1 ... 95 96 97 98 99 [100] 101 102 103 104 105 ... 113next