Welcome Guest.   Make a donation to an author on the site October 26, 2014, 02:04:40 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Your Support Funds this Site: View the Supporter Yearbook.
   
  Forum Home Thread Marks Chat! Downloads Search Login Register  
  Show Posts
      View this member's profile 
      donate to someone Donate to this member 
Pages: Prev 1 ... 19 20 21 22 23 [24] 25 26 27 28 29 30 Next
576  Main Area and Open Discussion / General Software Discussion / Re: USBDeview - Guaranteed eject of your USB drive on: March 21, 2008, 09:05:51 AM
Great idea for a FARR plugin! It would be great if when typing "eject " FARR lists all devices in the results list for the user to choose from. Some filters would also be useful. For example, I have a usb tv card that I never ever want to eject so it would make sense if I could exclude that.
577  Main Area and Open Discussion / Living Room / Re: Who else is sick of difficult word verifications on the web? on: March 20, 2008, 03:36:15 PM
I share the resentment towards having to go through so many of these. Worst of all are forums that both have really hard captchas (often rotated similar letters like lL1i oO0) and that reset ALL entered information when there is some minor error when clicking submit.

But I still see them as necessary in many cases. Better (less bad) alternatives are hard to find.

Here's an excellent Wired piece on the captcha pioneer Von Ahn: http://www.wired.com/tech...f_humancomp?currentPage=1  Now you have an individual to mentally direct all your captcha frustration towards cheesy . The articles covers not only recaptcha but also many other examples where everyday necessary human task could be tapped into as a productive resource. That's what I love about the recaptcha project - you know that the captcha itself has some purpose (apart from blocking spammers) and that makes it less irritating.
578  Main Area and Open Discussion / General Software Discussion / Re: JabRef: Nice Open Source Bibliography Tool (like EndNote) on: March 13, 2008, 04:48:36 PM
The latest JabRef is looking good! I will install and try it out a bit.

Yeah, the aggregated cost of EndNote licenses for academic institutions all around the world must be staggering by now! ohmy Imagine what a great FOSS program those resources could have fueled instead.

Another project of interest is OpenOffice Bibliographic (OOoBib), http://bibliographic.openoffice.org/ . They request programmers:
Quote
When will this wonderful facility be available ?  Development work for Bibliographic enhancements to OpenOffice is expected to commence from late 2007, and probably available for users in OpenOffice version 2.x/3.x (mid-late 2008 ???) see feature timeline. Also see a blog on plans for Writer.

See our development plans on the Developers' Wiki and the list of project tasks below.

The project urgently needs some experienced C++ developers to get this important work to the programing stage.
579  DonationCoder.com Software / FARR Plugins and Aliases / Re: google dollar exchange rate plugin -- sketch on: March 11, 2008, 01:26:35 PM
Thanks for the feedback mouser & czechboy & ecaradec!  Thmbsup
Here is a new version with these improvements:
- the user chooses the input and output currency (stored in options.xml ). If the input/output phrase works in google, it should work in this plugin.
- the plugin uses google only once after each FARR restart, thereafter it uses the cached exchange rate which means lightning fast results. (I'll look into writing the exchange rate to a file later, but I suspect the current in memory cache is enough for most usage)

code for fscript.js :
[copy or print]
// plugin script :
displayname="Currency Converter Mini";
versionstring="1.02.01";
releasedatestring="11.3.2008";
author="nod5";
updateurl="";
homepageurl="";
shortdescription="Convert from one currency to another via google.";
longdescription="To run the plugin, type \"ex 50 \" but replace 50 with the amount you want converted.\nSet input/output currency in advanced plugin options. (examples: $ £ GBP SEK canadian money )\nTest your input/output first by googling \"1 __ in __\", where _ is your input/output.\nAfter a FARR restart the first conversion uses google. Later conversions use the cached exchange rate.\nThe alias \"ex\" stands for exchange rate. The plugin converts one way, between two fixed currencies.\nFor other conversion needs just use google.";
advconfigstring="Currency Converter Mini";
readmestring="Currency Converter Mini";
iconfilename="favicon.ico";

aliasstr="ex";
regexstr="^ex ((?:\d|\.|\,)*?) $";
scriptregex=/^ex ((?:\d|\.|\,)*?) $/;
regexfilterstr="";
keywordstr="";
scorestr="300";

// type
UNKNOWN=0; FILE=1; FOLDER=2; ALIAS=3; URL=4; PLUGIN=5; CLIP=5;
// Postprocessing
IMMEDIATE_DISPLAY=0; ADDSCORE=1; MATCH_AGAINST_SEARCH=2;
// search state
STOPPED=0; SEARCHING=1;

var pre_string = "{\\rtf1\\ansi\\ansicpg1250\\deff0\\deftab709{\\fonttbl{\\f0\\fnil\\fcharset0 Arial;}}{\\colortbl ;\\red255\\green0\\blue0;}{\\*\\generator Msftedit 5.41.15.1507;}\\viewkind4\\uc1\\pard\\lang2057\\f0\\fs18 ";
var post_string = "\\par\n}";
var history = "";
var exrate = "";

function doQuery(querykey,querynokeyword){

querynokeyword = querynokeyword.replace(/,/g,'.');

if(exrate == ""){
  var url = "http://www.google.com/search?hl=en&q=1"+myinputcurrency+"+in+"+myoutputcurrency;
  var xmlhttp=new ActiveXObject("MSXML2.XMLHTTP");

  xmlhttp.onreadystatechange = function(){
    if (xmlhttp.readyState == 4) {
      var string = xmlhttp.responseText;
      string = string.match(/<b>1 .* = (?:\d|\.|\,)*? /g);
      var splitstring = string[0].split("=");
      var exrate = splitstring[1].slice(1,-1);
      string = exrate * querynokeyword;
      string = Math.round(string);
      string = querynokeyword+" "+myinputcurrency+" = "+string+" "+myoutputcurrency;
      FARR.setStrValue("statusbar","Currency Converter Mini");
      FARR.setStrValue("window.richeditmode",pre_string+string+post_string);
      }
    }
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
}
else {
var string = exrate * querynokeyword;
string = Math.round(string);
string = querynokeyword+" "+myinputcurrency+" = "+string+" "+myoutputcurrency;
FARR.setStrValue("statusbar","Currency Convert Mini");
FARR.setStrValue("window.richeditmode",pre_string+string+post_string);
}

}

myinputcurrency="";
myoutputcurrency="";
function onOptionsChanged() {
    var options=new ActiveXObject("MSXML2.DOMDocument");
    options.load(currentDirectory+"\\options.xml")
    myinputcurrency=options.selectSingleNode("options/myinputcurrency").getAttribute("value");
    myoutputcurrency=options.selectSingleNode("options/myoutputcurrency").getAttribute("value");
}

function onInit(c) {
    currentDirectory=c;

    var options=new ActiveXObject("MSXML2.DOMDocument");
    if(!options.load(currentDirectory+"\\options.xml") ||
        options.selectSingleNode("options/myinputcurrency").getAttribute("value")=='' ||
        options.selectSingleNode("options/myoutputcurrency").getAttribute("value")=='') {
        options.loadXML("<options>\n"+
                        "<myinputcurrency label='exchange from :' value=''/>\n"+
                        "<myoutputcurrency label='exchange to :' value=''/>\n"+
                        "</options>");

        options.save(currentDirectory+"\\options.xml");
        options=null;
        FARR.showOptions();
    } else {
        onOptionsChanged();
    }
}



function onSearchBegin(querykey, explicit, queryraw, querynokeyword) {
  if(!explicit) {
    if(aliasstr.indexOf(querynokeyword)!=-1) {
      FARR.setState(querykey,1);
      FARR.emitResult(querykey,aliasstr, aliasstr, iconfilename,ALIAS,IMMEDIATE_DISPLAY,300);
      FARR.setState(querykey,0);
    }
    return;
  }
  FARR.setStrValue("statusbar","Currency Converter Mini");
    display = pre_string+"Type amount and hit \\b space\\b0"+post_string;
  FARR.setStrValue("window.richeditmode",display);
}

function onRegexSearchMatch(querykey,querynokeyword) {
  var match_reg = querynokeyword.match(scriptregex);
  doQuery(querykey,match_reg[1]);
}

edit:
- Can I add a title or description to the settings popup? (the one that stores the input/output in options.xml)
- I tried using escaping $ to \$ but still couldn't get it to work as an alias. Are you sure that it is possible in FARR?
580  DonationCoder.com Software / FARR Plugins and Aliases / CurrencyConverterMini (plugin) [renamed thread] on: March 07, 2008, 02:29:32 AM
edit 080813: thread renamed to "CurrencyConverterMini (plugin)" from "google dollar exchange rate plugin -- sketch" /nod5

While the donationcoder server was down I tried to put together a plugin based on the javascript SDK that takes a number as an input and queries google what that amount of dollars exchanges to in swedish kronor. In the finished plugin that swedish kronor part should of course be customizable to whatever currency the user prefers. Below is the fscript.js I've put together so far. It works, but is a bit messy and lacks some things. To try it, make a copy of the Ninjawords plugin folder (for example) and replace the fscript.js script code with the one below. type "ex ___ " to run it, where ___ is some amount . Example: "ex 50 " . The plugin currently treats "ex 50.10 " and "ex 50,10 " as identical (50 dollars and 10 cents).

This is only a sketch version of the script. I'd love some assistance on a few things:

help1: How do I most easily let the user choose the output currency and make the plugin remember that?

help2: I want the plugin to go through these three steps: First, if there is a cached daily exchange rate, use that to calculate and display output. Second, if not, query google, parse, display output and cache exchange rate. Third, if the google query failed (i.e. offline), see if there's a cached older exchange rate, use that to calculate and display output plus a note that N days old rate was used. Now, how do I best do I best cache the exchange rate through javascript in the plugin? I basically need to read and write to a text file I guess but I don't even know how to do that I'm afraid ohmy

help3: I used "ex" as alias only because I couldn't get "$" to work (I wanted "$50 " to run the script for example). Is there some way to use "$" as an alias?


Quote
// plugin script :
displayname="Google exchange rate";
versionstring="1.01.01";
releasedatestring="5.3.2008";
author="nod5";
updateurl="";
homepageurl="";
shortdescription="Google exchange rate";
longdescription="the plugin queries google how many swedish kronor you get for the inputted amount of US dollars";
advconfigstring="Google exchange rate";
readmestring="Google exchange rate";
iconfilename="favicon.ico";

aliasstr="ex";
regexstr="^ex ((?:\d|\.|\,)*?) $";
scriptregex=/^ex ((?:\d|\.|\,)*?) $/;
regexfilterstr="";
keywordstr="";
scorestr="300";

// type
UNKNOWN=0; FILE=1; FOLDER=2; ALIAS=3; URL=4; PLUGIN=5; CLIP=5;
// Postprocessing
IMMEDIATE_DISPLAY=0; ADDSCORE=1; MATCH_AGAINST_SEARCH=2;
// search state
STOPPED=0; SEARCHING=1;

var pre_string = "{\\rtf1\\ansi\\ansicpg1250\\deff0\\deftab709{\\fonttbl{\\f0\\fnil\\fcharset0 Arial;}}{\\colortbl ;\\red255\\green0\\blue0;}{\\*\\generator Msftedit 5.41.15.1507;}\\viewkind4\\uc1\\pard\\lang2057\\f0\\fs18 ";
var post_string = "\\par\n}";
var history = "";

function doQuery(querykey,querynokeyword){

      querynokeyword = querynokeyword.replace(/,/g,'.');

  var url = "http://www.google.com/search?hl=en&q="+querynokeyword+"$+in+sek";
  var xmlhttp=new ActiveXObject("MSXML2.XMLHTTP");
  xmlhttp.onreadystatechange = function(){
    if (xmlhttp.readyState == 4) {
      var string = xmlhttp.responseText;
      string = string.replace(/\\n|\\t/g,'');
      string = string.replace(/<font size=-2> <\/font>/g,'');
      string = string.replace(/.+US(\$ = (?:\d|\.|\,)*?) Swedish kronor.*$/g,'US$1');
      xpos = string.search(/US(\$ = .*)/g);
      string = querynokeyword+" "+string.slice(xpos)+" SEK"
      FARR.setStrValue("statusbar","Define");
      history = string;
      FARR.setStrValue("window.richeditmode",pre_string+history+post_string);
      }
    }
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
}

function onSearchBegin(querykey, explicit, queryraw, querynokeyword) {
  if(!explicit) {
    if(aliasstr.indexOf(querynokeyword)!=-1) {
      FARR.setState(querykey,1);
      FARR.emitResult(querykey,aliasstr, aliasstr, iconfilename,ALIAS,IMMEDIATE_DISPLAY,300);
      FARR.setState(querykey,0);
    }
    return;
  }
  FARR.setStrValue("statusbar","$ to SEK google converter");
    display = pre_string+"Type $ amount and hit \\b space\\b0"+post_string;
  FARR.setStrValue("window.richeditmode",display);
}

function onRegexSearchMatch(querykey,querynokeyword) {
  var match_reg = querynokeyword.match(scriptregex);
  doQuery(querykey,match_reg[1]);
}
581  News and Reviews / Official Announcements / Re: The site is now back online (March 6th, 2008) on: March 07, 2008, 02:08:12 AM
Donationcoder back online - great great great!  Thmbsup
582  DonationCoder.com Software / Find And Run Robot / Re: idea: give double space the same function as \ (backslash) on: February 27, 2008, 04:57:54 AM
Sure:
[copy or print]
~Space::
IfWinActive %A_Space%Find and Run Robot v2
 if A_PriorHotkey = %A_ThisHotkey%
  if A_TimeSincePriorHotkey < 400
   sendinput \
return
But I started this thread more in a missionary mode of mind, thinking that a double space command might be handy enough for many users of FARR to be built in.
583  DonationCoder.com Software / Find And Run Robot / Re: idea: give double space the same function as \ (backslash) on: February 26, 2008, 05:15:16 PM
/ is shift 7 on my layout, which is even more tricky since it takes two hands. \ (AltGr +) can be pulled off with one hand at least.
http://en.wikipedia.org/w..._layout#Swedish.2FFinnish

Neither \ or / is of course extremely slow to hit or anything. But the advantage of double space is not so much speed as not having to look at the keys. Many people find the space key immediately (regardless of what keyboard layout they use I would imagine) but many need to look for \ or / .
584  DonationCoder.com Software / Find And Run Robot / idea: give double space the same function as \ (backslash) on: February 26, 2008, 11:57:31 AM
Today we can narrow a search in FARR to folders only by adding "\" (backslash). Example: compare a search for "program" and "program\"

But on some keyboard layouts the backslash is tricky to reach. For instance, on my swedish keyboard I must press AltGr + (plus key) to get a backslash. Since the space bar is easy to reach on all keyboard layouts I've seen, why not let a double space do the same thing as the backslash currently does? Of course if the user has a lot of files with double spaces in their names then this idea would mean trouble. But I suspect file naming is extremely uncommon.

edit: alternatively, multiple spaces could be tied to some other function. For example, FARR could see any sequence of spaces that is even (2,4,6...) as identical as the +sall command, but see uneven number of spaces as a deactivation of that command. That way, the user could very quickly toggle the +sall functionality on and off. Other uses are possible also I guess but the double space sequence seems so quick and easy to remember that it should be used for something! smiley
585  DonationCoder.com Software / Find And Run Robot / Re: Ninjawords on: February 25, 2008, 05:15:08 AM
czechboy: confirming that it works. But I think your latest version (1.01.05) missed to include one previous line needed for displaying the history (@ line 58):
[copy or print]
history = string + ((history == "")?"":"\\par -----------------------------\\par ") + history;
586  DonationCoder.com Software / Find And Run Robot / Re: Ninjawords on: February 24, 2008, 05:42:51 AM
Well the Definr plugin also works fine. It gives somewhat longer definitions. So it depends on what you prefer I think. Why not testdrive both for a while? I'll myself do just that. If I later still prefer Ninjawords then I'll tie the handy "df" alias (much easier to remember than "nw") to it on my local mod of the script.
587  DonationCoder.com Software / Find And Run Robot / Re: Ninjawords on: February 23, 2008, 12:35:03 PM
The temporary history works fine. thumbs up I can see some neat uses for a feature like that. Someone might want to do a lot of separate lookups and then export all of the definitions in one go. They now only need to select all and copy and paste.

Did you try the alternative code for grabbing the definition that I posted http://www.donationcoder....12350.msg103138#msg103138 ? It works fine here and I see no drawbacks. Possible advantages:
1. It seems slightly faster, but that might just be wishful thinking. :-)
2. it adds a dot and a space before any examples in the definition, which the old code didn't do.
regular code:
Quote
  red
(adj): having red as its colour; of hair, having an orange-brown colour"the girl wore a red skirt."
alternative code:
Quote
  red
(adj): having red as its colour; of hair, having an orange-brown colour. "the girl wore a red skirt."
3. When doing multiple lookups ("nw one,two ") the alternative grabbing code places the definition for "one" at the top of the FARR results window and the definition for "two" below it. That seems more intuitive to me. The regular code (and the regular ninjawords.com searchbox) gives the definitions in the reverse order ("two" at top, "one" below it). I guess an advantage with the regular code is that it gives a consistent search history ordering: the latest entered searchphrase always gets it definition displayed at the top. I still prefer the alternative code's ordering though.

Oh and at the top of this thread it says "Authors: Nod5". I'm proud to be mentioned but clearly you should also be there czechboy!
588  DonationCoder.com Software / FARR Plugins and Aliases / Re: Definr.com plugin on: February 22, 2008, 08:29:28 AM
I gave the alternative page for grabbing the definitions ( http://ninjawords.com/definitions/getdef/test ) a go after all. Do you notice any difference in speed? Also, since the definitions are grabbed blazingly fast, maybe it's best to remove the "Please wait..." text completely? It just causes FARR to flicker a very brief moment but is almost not readable.

edit: this cuts off some words it seems, will troubleshoot that later. edit2: works now, I earlier forgot to escape \ at one place
[copy or print]
function doQuery(querykey,querynokeyword){
  var url = "http://ninjawords.com/definitions/getdef/"+querynokeyword;
  var xmlhttp=new ActiveXObject("MSXML2.XMLHTTP");
  xmlhttp.onreadystatechange = function(){
    if (xmlhttp.readyState == 4) {
      var string = xmlhttp.responseText;
      string = string.replace(/\\n|\\t/g,'');
      var splitString = string.split('\\074dt class=\\"title-word\\"\\076');
      var string ="";
      for (var i=1;i<splitString.length; ++i){
        if (i > 1) {
          string +="\\par -----------------------------\\par ";
        }
        splitString[i] = "\\b " + splitString[i];
        splitString[i] = splitString[i].replace(/", query: ".*?$/,"");
        splitString[i] = splitString[i].replace(/\\074dd.*?\\076/g,'\\b0 \\par\\par ');
        splitString[i] = splitString[i].replace(/ :\\074\/span\\076/g,": ");
        splitString[i] = splitString[i].replace(/\\074div class=\\"examples\\"\\076/g,"\. ");
        splitString[i] = splitString[i].replace(/\\074.*?\\076/g,"");
        splitString[i] = splitString[i].replace(/\\u2014/g,"-");
        splitString[i] = splitString[i].replace(/\\u2019/g,"'");
        splitString[i] = splitString[i].replace(/&mdash/g,"-");
        splitString[i] = splitString[i].replace(/more&raquo;\,/g,"");
        string += splitString[i];
      }
      FARR.setStrValue("statusbar","Define");
      FARR.setStrValue("window.richeditmode",pre_string+string+post_string);
      }
    }
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
}
589  DonationCoder.com Software / FARR Plugins and Aliases / Re: Definr.com plugin on: February 22, 2008, 07:43:55 AM
Great. I'll try it now.  edit: works fine"  Thmbsup

Two more things:
- the ninjawords plugin page says "nw - to start Definr plug-in" when you really mean "nw - to start Ninjawords plug-in".
- note that: "nw school, wall " is not needed for multiple lookups. "nw school,wall " is enough. That way the plugin accesses the Ninjawords site only once compared to twice.

Using http://ninjawords.com/definitions/getdef/test from the beginning would probably have been best, but I'm not sure if its needed now.
How many milliseconds do you think we'll save by using it? Grin
590  DonationCoder.com Software / FARR Plugins and Aliases / Re: Definr.com plugin on: February 22, 2008, 07:14:23 AM
I just tried your version of the Ninjawords script. It did not run here. After entering the search string I get "please wait..." and then nothing happens. Not sure why. Does it work for you? I updated my version some more based on your code (simplified the replace steps, made each search phrase bold). Feel free to use it.
[copy or print]
function doQuery(querykey,querynokeyword){
    var url = "http://ninjawords.com/"+querynokeyword;
    var xmlhttp=new ActiveXObject("MSXML2.XMLHTTP");
    xmlhttp.onreadystatechange = function(){
      if (xmlhttp.readyState == 4) {
        var string = xmlhttp.responseText;
string = string.replace(/\n|\t/g,'');
var splitString = string.split('<dt class="title-word">');
       
        var string ="";

for (var i=1;i<splitString.length; ++i){

    if (i > 1) {
               string +="\\par -----------------------------\\par ";
               }
splitString[i] = "\\b " + splitString[i]
        splitString[i] = splitString[i].replace(/<\/dl>.*?$/,"");
splitString[i] = splitString[i].replace(/<dd.*?>/g,'\\b0 \\par\\par ');
        splitString[i] = splitString[i].replace(/ :<\/span>/g,": ");
splitString[i] = splitString[i].replace(/more&raquo;/g,'');
splitString[i] = splitString[i].replace(/&mdash;/g,'-');
        splitString[i] = splitString[i].replace(/<.*?>/g,"");
string += splitString[i];
}
         
        FARR.setStrValue("statusbar","Define");
        FARR.setStrValue("window.richeditmode",pre_string+string+post_string);
      }
    }
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
}

I forgot to mention one more advantage with Ninjawords: if you spell a word wrong it automatically guesses the word and shows the definition - try "nw footbaall ". Definr on the other hand shows a list of terms and forces the users to choose one.

As for that XML thing I think I understand what you mean. Promising. I can already think of several websites that I'd want FARR to grab specific content from and display to me in an instant. But I'm not sure if people will prefer that over site specific plugins. And I don't know how to write XML so I can't help much I'm afraid.

edit: I now saw that you created a new thread ( http://www.donationcoder....m/index.php?topic=12421.0 ). The ninjawords version on your page does return definitions. But I think there is some error in the parsing code. Try "nw test,gone " and "nw gone,test ". In the first case, the bold "gone" is missing. In the second case, both "gone" and it's definition is missing. I'm not sure what the cause of that is.
591  DonationCoder.com Software / FARR Plugins and Aliases / Re: Definr.com plugin on: February 22, 2008, 04:08:44 AM
czechboy,
It's better that you do it since I based my version on your code and you have a page set up already.

I'm myself more and more convinced that ninjawords is better than definr. It is noticeably faster from my location. It also gives definitions that are shorter and more to the point (which is almost always enough). It also allows multiple lookups in one search. The only drawback I can find with ninjawords is that it gives errors when the search phrase contains dots (try searching for "i.e."). I'll email the ninjawords dev about that.

Perhaps in the future your plugin could be expanded with some option where the user can choose what definition site to use (Definr, ninjawords, possibly others...)? Since some might still prefer definr.

I also must make a general exclamation: these javascript plugins (and the underlying javascript SDK) has really opened up my eyes to how great FARR can be at interacting with the web (doing queries, grabbing content...).  Thmbsup
592  DonationCoder.com Software / FARR Plugins and Aliases / Re: Definr.com plugin on: February 21, 2008, 04:20:11 PM
czechboy,
I've now testdriven the plugin some more. The searches are not always incredibly fast, despite what definr.com claim. Pretty often they take several seconds.

I found a similarly clean site, http://ninjawords.com/ , that seems faster (at least from my location). We're only talking slightly faster, but still. So I tried to learn from your fscript.js to grab definitions from ninjawords.com instead. The resulting code follows below. Do you spot any errors? It at least seems to run ok but I don't really know javascript or the FARR javascript SDK so there might be errors. The many replace functions look very messy but I'm not sure how to simplify them.

Also, a general question (maybe mouser or someone else can answer this too): is it possible to make some phrases in the grabbed text into hyperlinks when displayed in FARR?

edit: I tweaked it some more so that it now supports multiple lookups at once. Just type "nw word1,word2 " (see http://ninjawords.com/info/about/ for more on that)

[copy or print]
// plugin script :
displayname="ninjawords.com";
versionstring="1.0.0";
releasedatestring="21.2.2008";
author="nod5 (based on Definr plugin by Oldrich Svec)";
updateurl="";
homepageurl="";
shortdescription="ninjawords.com";
longdescription="defines words through http://ninjawords.com";
advconfigstring="ninjawords.com";
readmestring="ninjawords.com";
iconfilename="";

aliasstr="nw";
regexstr="^nw (.*?) $";
scriptregex=/^nw (.*?) $/;
regexfilterstr="";
keywordstr="";
scorestr="300";

// type
UNKNOWN=0; FILE=1; FOLDER=2; ALIAS=3; URL=4; PLUGIN=5; CLIP=5;
// Postprocessing
IMMEDIATE_DISPLAY=0; ADDSCORE=1; MATCH_AGAINST_SEARCH=2;
// search state
STOPPED=0; SEARCHING=1;

var pre_string = "{\\rtf1\\ansi\\ansicpg1250\\deff0\\deftab709{\\fonttbl{\\f0\\fnil\\fcharset0 Arial;}}{\\colortbl ;\\red255\\green0\\blue0;}{\\*\\generator Msftedit 5.41.15.1507;}\\viewkind4\\uc1\\pard\\lang2057\\f0\\fs18 ";
var post_string = "\\par\n}";

function doQuery(querykey,querynokeyword){
    var url = "http://ninjawords.com/"+querynokeyword;
    var xmlhttp=new ActiveXObject("MSXML2.XMLHTTP");
    xmlhttp.onreadystatechange = function(){
      if (xmlhttp.readyState == 4) {
        var string = xmlhttp.responseText;
string = string.replace(/\n/g,'\\par');
var splitString = string.split('<dt class="title-word">');
       
        var string ="";

for ( var i=1, len=splitString.length; i<len; ++i ){

    if (i > 1) {
               string +="\\par -----------------------------\\par ";
               }
        splitString[i] = splitString[i].replace(/<\/dl>.*?$/,"");
splitString[i] = splitString[i].replace(/<dd.*?>/g,'\\doublepar ');
        splitString[i] = splitString[i].replace(/ :<\/span>/g,": ");
splitString[i] = splitString[i].replace(/more&raquo;/g,'');
splitString[i] = splitString[i].replace(/&mdash;/g,'-');
        splitString[i] = splitString[i].replace(/<.*?>/g,"");
splitString[i] = splitString[i].replace(/\t/g,'');
splitString[i] = splitString[i].replace(/\\par\s*?(\S)/g,'\\par$1');
splitString[i] = splitString[i].replace(/\\par/g,'');
splitString[i] = splitString[i].replace(/\\doublepar/g,'\\par\\par');
string += splitString[i];
}
         
        FARR.setStrValue("statusbar","Define");
        FARR.setStrValue("window.richeditmode",pre_string+string+post_string);
      }
    }
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
}

function onSearchBegin(querykey, explicit, queryraw, querynokeyword) {
  if(!explicit) {
    if(aliasstr.indexOf(querynokeyword)!=-1) {
      FARR.setState(querykey,1);
      FARR.emitResult(querykey,aliasstr, aliasstr, iconfilename,ALIAS,IMMEDIATE_DISPLAY,300);
      FARR.setState(querykey,0);
    }
    return;
  }
  FARR.setStrValue("statusbar","Define");
  FARR.setStrValue("window.richeditmode",pre_string+"Type what you want to search and hit Space"+post_string);
}

function onRegexSearchMatch(querykey,querynokeyword) {
  FARR.setStrValue("statusbar","Define");
  FARR.setStrValue("window.richeditmode",pre_string+"Please wait..."+post_string);
  var match_reg = querynokeyword.match(scriptregex);
  doQuery(querykey,match_reg[1]);
}

593  DonationCoder.com Software / Find And Run Robot / sort matches strictly based on date created criteria? on: February 20, 2008, 04:15:33 PM
Is this possible in the current version of FARR: The user does a regular search which yields N number of matches. Because a special command was added to the search FARR sorts the matches strictly based on the date the files where created (the newest are displayed first). This date sorting should override any other ranking rules.

Just to make things clear, I only want this for some special searches, not for most searches, so I'm looking for some extra command to use in such special cases.
594  DonationCoder.com Software / FARR Plugins and Aliases / Re: Definr.com plugin on: February 20, 2008, 01:56:43 PM
Nice work czechboy! Very useful plugin!  Thmbsup

A small suggestion: it takes me more time to find the "," key compared to the space key. I managed to tweak your fscript.js so that "df football " triggers the search instead of "df football,". The plugin can still look up definitions for space separated phrases: "df foul ball ". It starts to search for "foul" but interrupts that when new non-space characters are entered and then searches the whole phrase "foul ball" when the next space is entered. I hope you'll consider using space for triggering the search in your official version.

I just changed:
[copy or print]
regexstr="^df (.*?),$";
scriptregex=/^df (.*?),$/;
To:
[copy or print]
regexstr="^df (.*?) $";
scriptregex=/^df (.*?) $/;

edit: I also decreased the font size (from f26 to f18) to lessen the number of linebreaks in the definition texts

595  DonationCoder.com Software / FARR Plugins and Aliases / Re: Google Translation Plugin on: February 17, 2008, 04:48:18 PM
This translation plugin looks great! It is quicke to use compared to having FARR opening a page in the browser. Has anyone thought about writing a similar plugin that replaces/supplements the default "define" action in FARR? Example: typing "df football" could trigger a plugin that shows the english definition for the english word football (="the greatest sport ever") in the FARR results field, similarly to how the translation plugin works. The definitions could be pulled from definr.com or from one of the site used in the current define action in FARR.
596  DonationCoder.com Software / Coding Snacks / Re: my app to quickly save page URL, title and tags to .url -- anyone interested? on: February 17, 2008, 03:44:42 PM
Tourl version 080217
The .zip file attached to this post contains
the compiled tourl.exe (md5 = dfc0b825750d78efe1146afd06ef532a)
the source code tourl.ahk (md5 = 36aab907237edce66a60d0a5f49f874b)

changelog:   - Added instruction for editing and compiling tourl.ahk to do site specific title replacement actions

Read "tourl_replacement_actions_instruction.txt" for details.
The .txt has replacement action code for: donationcoder , boingboing, askmetafilter, wikipedia
If you write some useful replacement actions then please post them to this thread!  Thmbsup

edit 080331: removed attachment, get latest tourl at http://nod5.dcmembers.com/tourl.html
597  Main Area and Open Discussion / General Software Discussion / Re: How many of you use encryption? on: February 09, 2008, 02:41:36 PM
F0dder,
You are right. I wasn't thinking (not enough anyway  cheesy) when I wrote that about CPU-heavy activities.
I want keyfile support only because it is so much more convenient, not more secure.
598  Main Area and Open Discussion / General Software Discussion / Re: How many of you use encryption? on: February 09, 2008, 07:53:13 AM
After doing a disk repair through the SeaTools for DOS boot-CD ( http://www.seagate.com/ww...upport/downloads/seatools ) I've now gotten truecrypt 5.0 system encryption to work.  Thmbsup

I've experience no performance hit and have no other major drawbacks to report either. But I haven't yet tried any CPU-heavy activities like gaming.

The system encryption supports passwords only, not keyfiles. I hope they add some smart support for that in the next version so that the bootloader at startup autosearches for a file with a certain name on any connection usb device and then tries to use that as a keyfile.
599  Main Area and Open Discussion / General Software Discussion / Re: How many of you use encryption? on: February 06, 2008, 05:23:33 PM
Great that it is released!

Has anyone gotten the new system encryption (WDE) to work yet?

I tried twice to do it on a test system with and without secure overwriting but got a CRC-error half way through each time. I did a chkdsk inbetween these two attempts and that showed no errors. Maybe something else installed on that machine is interfering with TrueCrypt.  huh Tomorrow I'll put an image of a clean XP install on the same testmachine and see if I succeed with system encryption on that.

Some interface issues for the new features definitely needs to be improved. For example, it would be very useful if TrueCrypt could give you an estimate of how long time the encryption will take BEFORE you start the actual encryption. That way, the choice of what level of overwriting you want would be easier to make. TrueCrypt currently only gives a scary fixed estimate saying that opting for overwriting (3, 5 or 35 times I think) may mean that encryption can take a week to complete, or something like that. Not very helpful.
600  DonationCoder.com Software / Post New Requests Here / Re: IDEA: Batch read nfo files in RAR archives on: February 05, 2008, 04:22:19 PM
I think the command line tool UnRAR , http://www.rarlab.com/rar_add.htm , can do what you want, at least in combination with some scripting language like autohotkey.

this command line phrase would extract only .nfo files from the archive:
[copy or print]
unrar e -n*.nfo ARCHIVE_NAME.rar
I don't have time to put together a working script at the moment. embarassed But hopefully you or someone else can do it.
Pages: Prev 1 ... 19 20 21 22 23 [24] 25 26 27 28 29 30 Next
DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.064s | Server load: 0.13 ]