🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
71 messages
71 total messages Page 2 of 2 Started by ShadowTek Thu, 14 May 2009 20:11
Page 2 of 2 • 71 total messages
Re: [slrn] turbo-plonk.sl improved (Was: Can I make a rule that will auto-ignore all follow-ups to a certain author?)
#234877
Author: Troy Piggins
Date: Sat, 01 Aug 2009 00:05
32 lines
3041 bytes
* Keith wrote :
> On 2009-07-31, Troy Piggins <usenet-0908@piggo.com> wrote:
> [---=| Quote block shrinked by t-prot: 70 lines snipped |=---]
>>> () = register_hook ("article_mode_hook", &auto_kill_fups);
>>> #v-
>>
>> Fantastic!  Works beautifully!  Thankyou master!
>
>  How does this work? Is it key bound or run automatically. I don't
> see anything in the macro for a key and when I added it to slrn
> as a macro it did nothing. 

No key presses.  That's the idea.  Automatic.  You have to add an
entry in your scorefile that gives a score of -666 (default but
customisable) to a post that you want all followups to be given a
score of -9998 (default - to kill them outright, change to
-9999).

I suspect what you haven't done is saved it as a file and called
it from your .slrnrc.  I haven't thought of a good name yet, and
don't want to use turbo-plonk.sl because it's quite different
from the original.  In the meantime I've called it
auto_ignore.sl.

In your .slrnrc you need to add the line:

interpret "/path/to/file/auto_ignore.sl"

You'll also need to restart slrn.  Hope that helps.

-- 
Troy Piggins
Re: [slrn] Can I make a rule that will auto-ignore all follow-ups to a certain author?
#234879
Author: andrew
Date: Sat, 01 Aug 2009 00:49
16 lines
1875 bytes
On 2009-07-29, Troy Piggins <usenet-0907@piggo.com> wrote:

> I had a quick search, and it appears it suffered the same fate as
> several of my other newer macros and slrn pages on my homepage.
> Hard drive failed around Christmas time and embarassed to admit I
> hadn't backed up for some months.  :(

Troy it would be nice to see your slrn page back up again. Would this
provide at least a start:

http://web.archive.org/web/20080213183317/http://piggo.com/~troy/slrn.php

Andrew

-- 
Do you think that's air you're breathing?
Re: [slrn] Can I make a rule that will auto-ignore all follow-ups to a certain author?
#234878
Author: Troy Piggins
Date: Sat, 01 Aug 2009 02:06
24 lines
2498 bytes
* andrew wrote :
> On 2009-07-29, Troy Piggins <usenet-0907@piggo.com> wrote:
>
>> I had a quick search, and it appears it suffered the same fate as
>> several of my other newer macros and slrn pages on my homepage.
>> Hard drive failed around Christmas time and embarassed to admit I
>> hadn't backed up for some months.  :(
>
> Troy it would be nice to see your slrn page back up again. Would this
> provide at least a start:
>
> http://web.archive.org/web/20080213183317/http://piggo.com/~troy/slrn.php

You legend.  Yes.  That's great.

It's ugly, but I just copied that to
http://piggo.com/~troy/slrn.php

I'll try to tidy it up a little, make sure all the links work
etc, but I have a new format I want to implement for the final
page.

-- 
Troy Piggins
Re: [slrn] Can I make a rule that will auto-ignore all follow-ups to a certain author?
#234881
Author: andrew
Date: Sat, 01 Aug 2009 02:26
24 lines
2192 bytes
On 2009-08-01, Troy Piggins <usenet-0908@piggo.com> wrote:
> * andrew wrote :

>> Troy it would be nice to see your slrn page back up again. Would this
>> provide at least a start:
>>
>> http://web.archive.org/web/20080213183317/http://piggo.com/~troy/slrn.php
>
> You legend.  Yes.  That's great.
>
> It's ugly, but I just copied that to
> http://piggo.com/~troy/slrn.php
>
> I'll try to tidy it up a little, make sure all the links work
> etc, but I have a new format I want to implement for the final
> page.

I look forward to seeing the finished product and of course more 
macros :-). I am of course still making great use of your MID macro
create_msg_id.sl!

Andrew
-- 
Do you think that's air you're breathing?
Re: [slrn] turbo-plonk.sl improved (Was: Can I make a rule that will auto-ignore all follow-ups to a certain author?)
#234882
Author: Whiskers
Date: Sat, 01 Aug 2009 12:50
28 lines
2788 bytes
On 2009-08-01, Troy Piggins <usenet-0908@piggo.com> wrote:
> * Keith wrote :
>> On 2009-07-31, Troy Piggins <usenet-0908@piggo.com> wrote:
>> [---=| Quote block shrinked by t-prot: 70 lines snipped |=---]
>>>> () = register_hook ("article_mode_hook", &auto_kill_fups);
>>>> #v-
>>>
>>> Fantastic!  Works beautifully!  Thankyou master!

[...]

> I haven't thought of a good name yet, and
> don't want to use turbo-plonk.sl because it's quite different
> from the original.  In the meantime I've called it
> auto_ignore.sl.
>
> In your .slrnrc you need to add the line:
>
> interpret "/path/to/file/auto_ignore.sl"
>
> You'll also need to restart slrn.  Hope that helps.

How about "hyper-plonk"?

-- 
-- ^^^^^^^^^^
--  Whiskers 
-- ~~~~~~~~~~
Re: [slrn] turbo-plonk.sl improved (Was: Can I make a rule that will auto-ignore all follow-ups to a certain author?)
#234884
Author: Whiskers
Date: Sat, 01 Aug 2009 13:32
31 lines
2829 bytes
On 2009-07-31, Troy Piggins <usenet-0908@piggo.com> wrote:
> * John E. Davis wrote :
>> On Sat, 01 Aug 2009 00:16:22 +1000, Troy Piggins <usenet-0907@piggo.com>
>> wrote:
>>> Let's pick -666 as the score.  Upon entering a group, any article
>>> with a score of -666 will automatically cause any articles with
>>> it's Message-ID in their References to be killfiled.
>> [...]
>>
>> Here is a version that deals directly with the scorefile and should be
>> a bit faster.  --John
>>
>> #v+

[...]

>> () = register_hook ("article_mode_hook", &auto_kill_fups);
>> #v-
>
> Fantastic!  Works beautifully!  Thankyou master!

Ditto  :))  I can see this improving several groups.

It occurs to me that the same script could be used with minor 
modification, to score-up responses to interesting posters too, even when 
they lack personally identifiable MIDs.

-- 
-- ^^^^^^^^^^
--  Whiskers 
-- ~~~~~~~~~~
Re: [slrn] turbo-plonk.sl improved
#234886
Author: Mike Yetto
Date: Sat, 01 Aug 2009 15:48
33 lines
3278 bytes
Bada bing Whiskers <catwheezel@operamail.com> bada bang:
> On 2009-08-01, Troy Piggins <usenet-0908@piggo.com> wrote:
>> * Keith wrote :
>>> On 2009-07-31, Troy Piggins <usenet-0908@piggo.com> wrote:
>>> [---=| Quote block shrinked by t-prot: 70 lines snipped |=---]
>>>>> () = register_hook ("article_mode_hook", &auto_kill_fups);
>>>>> #v-
>>>>
>>>> Fantastic!  Works beautifully!  Thankyou master!
>
> [...]
>
>> I haven't thought of a good name yet, and
>> don't want to use turbo-plonk.sl because it's quite different
>> from the original.  In the meantime I've called it
>> auto_ignore.sl.
>>
>> In your .slrnrc you need to add the line:
>>
>> interpret "/path/to/file/auto_ignore.sl"
>>
>> You'll also need to restart slrn.  Hope that helps.
>
> How about "hyper-plonk"?
>

I'd like to go off the board with "thread_burner.sl", may it
please ya.

Mike "Drew Carey & Steven King in one sentence, wow" Yetto
-- 
Pluralitas non est ponenda sine necessitas.
 - William of Ockham
My dysfunctional attemp
#234889
Author: ShadowTek
Date: Sat, 01 Aug 2009 19:44
187 lines
8359 bytes
On 2009-07-31, John E. Davis <jed@jedsoft.org> wrote:
>
> Here is a version that deals directly with the scorefile and should be
> a bit faster.  --John

That means that the original post can't be killed, right?

I was trying to build my own script, but I couldn't find any way to do it
that would allow me to kill the original post, since it needed to be
visible for its Message-ID to be read.

Anyway, I was building my own script that made use of a seprerate file
to store the From and Message-ID headers, and everything seemed to be
working great towards the end, but then it started failing to apply
itself to all threads correctly. It's a shame, since it seemed like it was working
perfectly there for a while. I m not sure if I screwed something up
towards the end, or I had simply been missing something all along, but
either way, I'm tired of screwing with it.

I'll go ahead and post my last version of it in case anyone can or wants
to do anything with it.

Remember, *this version is NOT working properly*.

Contents of slrn_superplonk.sl:
#v+

% Last updated: 2009/07/31

%% Summary %%

% The purpose of this script is to provide a way to identify  and score
% all posts by and followups to
% a particular individual.

%% Installation Instructions %%

% Add the following lines to slrnrc, and change the "user" part of the
% path of slrn_superplonk.sl to your home directory.
%	interpret "/home/user/slrn_superplonk.sl"
%	setkey article "superplonk" "^k"

%% Usage Notes %%

% When viewing an article that is posted by a person that you want to
% SuperPlonk, press "Control K" to add thier
% From header to $HOME/superplonk_from.txt. That file will be used each
% time you enter a group to check all 
% From headers and add the Message-ID of each matching header to
% $HOME/superplonk_mid.txt. That file will then be
% used to scan all headers when entering a group. If headers with a
% matching Message-ID are found, they are marked
% read, and expunged by default (that can be changed if you prefer to
% leave them visible).

% Default behavior is to exit the current group once someone has been
% SuperPlonked, since re-entering the group is
% needed for the chenges to take effect, but this can be disable by
% commenting it out below.

% SuperPlonk will also add the poster's From header to the scorefile,
% and assign it a score of -9000. The can also be changed
% below. Also, this script depends on being able to see all headers, so
% it won't work on anyone who has a score of -9999.
% Since the default behavior of this script is already set to
% automatically expunge all low-score headers when
% entering a group, it will serve as a sort of killfill for them anyway.
% This auto-expunging can be commented out below.

% $HOME/slrn_superplonk_from.txt and $HOME/slrn_superplonk_mid.txt will
% both be created automatically, and
% can be deleted at any time.

% I'm not how big *mid.txt would have to get before it would cause any
% noticible system lag, but you can
% just delete it if it does. All the stored From headers are in
% *from.txt, so *mid.txt will just start rebuilding
% again automatically as you download more headers.

define check_mid ()
{
	variable home_str;
        variable home_file = popen ("echo $HOME", "r");
        () = fgets (&home_str, home_file);
        () = pclose (home_file);
	home_str = substr (home_str, 1, (strlen (home_str)) - 1);
	variable mid_file  = fopen (home_str+"/slrn_superplonk_mid.txt",
"a+");
	() = fclose (mid_file);
	mid_file = fopen (home_str+"/slrn_superplonk_mid.txt", "r");
	variable line_str = fgetslines (mid_file);
	() = fclose (mid_file);
	variable line_total = length (line_str);
	if (line_total == 0) return;
	variable line_current;
	while (header_up(1)){}
	do
	{
		line_current = 1;
		variable ref_hdr = extract_article_header
("References");
		while (line_current <= line_total) {
				if (ref_hdr, is_substr (substr
(line_str[line_current -1], 13, strlen (line_str[line_current - 1]) -
13)) != 0 ) {
					set_header_flags(get_header_flags()
| HEADER_READ);
				}
			line_current = line_current + 1;
		}
	} while (header_down(1));
	return;
}

define check_from ()
{
	variable home_str;
        variable home_file = popen ("echo $HOME", "r");
        () = fgets (&home_str, home_file);
        () = pclose (home_file);
	home_str = substr (home_str, 1, (strlen (home_str)) - 1);
	variable from_file  = fopen
(home_str+"/slrn_superplonk_from.txt", "a+");
	() = fclose (from_file);
	from_file = fopen (home_str+"/slrn_superplonk_from.txt", "r");
	variable line_str = fgetslines (from_file);
	() = fclose (from_file);
	variable line_total = length (line_str);
	if (line_total == 0) {
		check_mid();
		return;}
	variable line_current = 1;
	while (header_up(1)){}
	do
	{
		while (line_current <= line_total) {
				if (substr (line_str[line_current -1],
13, strlen (line_str[line_current - 1]) - 13) == extract_article_header
("From")) {
 				variable mid_file = fopen
(home_str+"/slrn_superplonk_mid.txt", "a+");
 				() = fputs (strftime ("%Y/%m/%d")+"
"+extract_article_header ("Message-ID")+"\n", mid_file);
 				() = fclose (mid_file);
				}
			line_current = line_current + 1;
		}
		line_current = 1;
	} while (header_down(1));
	check_mid();
	return;
}

define superplonk ()
{
	variable home_str;
        variable home_file = popen ("echo $HOME", "r");
        () = fgets (&home_str, home_file);
        () = pclose (home_file);
        variable from_file = fopen (substr (home_str, 1, ((strlen
(home_str)) - 1))+"/slrn_superplonk_from.txt", "a+");
	variable from_field = extract_displayed_article_header ("From");
	%if (read_mini ("SuperPlonk "+from_field+" ? y/n  ", "n", "") ==
	%"y") {
	if (get_yes_no_cancel ("SuperPlonk "+from_field+" ?") == 1) {
		() = fputs (strftime ("%Y/%m/%d")+"  "+from_field+"\n",
from_file);
		set_input_string ("-9000\n+9999"); % Change these to
affect score results. (score/days-to-expire)
		set_input_chars ("fan");
		call ("create_score");
		call ("quit"); % Comment out this line to disable
auto-apply of SuperPlonk while in article mode.
		message (from_field+" has been SuperPlonked");
 		}
		else message ("Action cancelled.");
	() = fclose (from_file);
	return;
}

() = register_hook ("article_mode_hook", "check_from");

#v-

Preferably, a working version of this would be able to do the job *and*
"kill" the affected posts, including the one with the original
Message-ID.
Re: My dysfunctional attemp
#234890
Author: Mike Yetto
Date: Sat, 01 Aug 2009 20:58
26 lines
2936 bytes
Bada bing ShadowTek <ShadowTek@invalid.invalid> bada bang:
> On 2009-07-31, John E. Davis <jed@jedsoft.org> wrote:
>>
>> Here is a version that deals directly with the scorefile and should be
>> a bit faster.  --John
>
> That means that the original post can't be killed, right?
>

You have to see the original post to decide you no longer wish to
see the poster or anyone who replies.

> I was trying to build my own script, but I couldn't find any way to do it
> that would allow me to kill the original post, since it needed to be
> visible for its Message-ID to be read.
>

If there is an identifiable portion of the MID this workaround is
not needed.  Just use the MID and References with the unique
portion.  Second stage filtering such as this is to allow for
filtering on non-identifiable MIDs. 

Mike "see Oakham's Razor" Yetto
-- 
Pluralitas non est ponenda sine necessitas.
 - William of Ockham
Re: [slrn] turbo-plonk.sl improved (Was: Can I make a rule that will auto-ignore all follow-ups to a certain author?)
#234891
Author: Troy Piggins
Date: Sat, 01 Aug 2009 21:26
38 lines
3330 bytes
* Whiskers wrote :
> On 2009-07-31, Troy Piggins <usenet-0908@piggo.com> wrote:
> [---=| Quote block shrinked by t-prot: 7 lines snipped |=---]
>>>
>>> Here is a version that deals directly with the scorefile and should be
>>> a bit faster.  --John
>>>
>>> #v+
>
> [...]
>
>>> () = register_hook ("article_mode_hook", &auto_kill_fups);
>>> #v-
>>
>> Fantastic!  Works beautifully!  Thankyou master!
>
> Ditto  :))  I can see this improving several groups.
>
> It occurs to me that the same script could be used with minor 
> modification, to score-up responses to interesting posters too, even when 
> they lack personally identifiable MIDs.

Yeah, I was thinking the same thing.  You could use it to score
followups ups to yourself if you don't have a unique M-ID, or, as
you say, to interesting posters.  At the moment you'd need to
copy the macro, rename it, and have one for killing posts and one
for interesting posts.  I'll have a tinkle to see if I can mod it
to work all from the one macro.  Certainly possible, but the way
he's been going lately, JED will probably have it done before I
can say "boo".  What a legend.

For the above reason of being able to use it to do more than just
plonk, I'm thinking a more apt name than "turbo-plonk",
"hyper-plonk" etc.  "Thread-burner" is good.  Maybe
"Thread-scorer"?  Nah, I like "Thread-burner" better.

-- 
Troy Piggins
Re: [slrn] turbo-plonk.sl improved
#234892
Author: Troy Piggins
Date: Sat, 01 Aug 2009 21:27
15 lines
2352 bytes
* Mike Yetto wrote :
> Bada bing Whiskers <catwheezel@operamail.com> bada bang:
> [---=| Quote block shrinked by t-prot: 19 lines snipped |=---]
>>>
>>> You'll also need to restart slrn.  Hope that helps.
>>
>> How about "hyper-plonk"?
>
> I'd like to go off the board with "thread_burner.sl", may it
> please ya.

I like it.  Catchy.

-- 
Troy Piggins
Re: My dysfunctional attemp
#234893
Author: John E. Davis
Date: Sat, 01 Aug 2009 21:48
163 lines
6026 bytes
On Sat, 1 Aug 2009 19:44:12 +0000 (UTC), ShadowTek <ShadowTek@invalid.invalid>
wrote:
> Anyway, I was building my own script that made use of a seprerate file
> to store the From and Message-ID headers, and everything seemed to be
> working great towards the end, but then it started failing to apply
> itself to all threads correctly. It's a shame, since it seemed like it was working
> perfectly there for a while. I m not sure if I screwed something up
> towards the end, or I had simply been missing something all along, but
> either way, I'm tired of screwing with it.
>
> I'll go ahead and post my last version of it in case anyone can or wants
> to do anything with it.
>
> Remember, *this version is NOT working properly*.

Below you will find a modified version that I believe works the way
that you intended.  My main purpose here is is to provide some
working examples of slang code.

[...]
> 	variable home_str;
>         variable home_file = popen ("echo $HOME", "r");
>         () = fgets (&home_str, home_file);
>         () = pclose (home_file);

The best way to get the value of an environment variable is to use the
getenv function.  The above should be replaced by:

    variable home_str = getenv ("HOME");

[...]

Here is the code.  I hope you find it instructive.  Thanks, --John

#v+

private variable MsgID_File = "$HOME/slrn_superplonk_mid.txt"$;
private variable From_File = "$HOME/slrn_superplonk_from.txt"$;

private define read_message_ids (file)
{
   variable msgid_list = Assoc_Type[];
   variable fp = fopen (file, "r");
   if (fp != NULL)
     {
	variable line;
	while (-1 != fgets (&line, fp))
	  {
	     % The format is: YYYY/MM/DD msgid.  Break it at the space
	     variable fields = strtok (line);
	     if (length (fields) < 2)
	       continue;
	     msgid_list[fields[1]] = fields[0];
	  }
	() = fclose (fp);
     }
   return msgid_list;
}

private define read_froms (file)
{
   variable from_list = Assoc_Type[];
   variable fp = fopen (file, "r");
   if (fp != NULL)
     {
	variable line;
	while (-1 != fgets (&line, fp))
	  {
	     % The format is: "YYYY/MM/DD from..."
	     variable date = substrbytes (line, 1, 10);
	     variable from = strtrim (substrbytes (line, 12, -1));
	     from_list[from] = date;
	  }
	() = fclose (fp);
     }
   return from_list;
}

private define write_message_ids (msgid_list, file)
{   
   variable fp = fopen (file, "w");
   if (fp == NULL)
     throw OpenError, "Error opening $file"$;
   
   variable date, msgid;
   foreach msgid, date (msgid_list) using ("keys", "values")
     {
	if (-1 == fprintf (fp, "%s %s\n", date, msgid))
	  throw WriteError;
     }
   if (-1 == fclose (fp))
     throw WriteError;
}

private define check_message_ids (msgid_list)
{
   call ("header_bob");
   do
     {
	variable ref, refs = extract_article_header ("References");
	foreach ref (strtok (refs, " "))
	  {
	     if (assoc_key_exists (msgid_list, ref))
	       {
		  set_header_flags(get_header_flags() | HEADER_READ);
		  break;
	       }
	   }
     } while (header_down(1));
}

private define check_from ()
{
   variable msgid_list = read_message_ids (MsgID_File);
   variable from_list = read_froms (From_File);

   call ("header_bob");

   variable today = strftime ("%Y/%m/%d");

   variable dirty = 0;
   do
     {
	variable from = extract_article_header ("From");
	if (assoc_key_exists (from_list, from))
	  {
	     variable msgid = extract_article_header ("Message-ID");
	     msgid_list[msgid] = today;
	     set_header_flags(get_header_flags() | HEADER_READ);
	     dirty = 1;
	  }
     } 
   while (header_down(1));

   check_message_ids (msgid_list);
   if (dirty) write_message_ids (msgid_list, MsgID_File);
}

% You can bind this to a key
public define superplonk ()
{
   variable from = extract_displayed_article_header ("From");
   if (1 != get_yes_no_cancel ("SuperPlonk " + from + " ?"))
     return;
   
   variable fp = fopen (From_File, "a");
   variable today = strftime ("%Y/%m/%d");
   
   if ((-1 == fprintf (fp, "%s %s\n", today, from))
       || (-1 == fclose (fp)))
     throw WriteError;

   set_input_string ("-9000\n+9999"); 
   set_input_chars ("fan");
   call ("create_score");
   call ("quit"); 
   
   message (from + " has been SuperPlonked");
}

() = register_hook ("article_mode_hook", &check_from);

#v-
Re: [slrn] turbo-plonk.sl improved (Was: Can I make a rule that will auto-ignore all follow-ups to a certain author?)
#234894
Author: Whiskers
Date: Sat, 01 Aug 2009 22:01
34 lines
3275 bytes
On 2009-08-01, Troy Piggins <usenet-0908@piggo.com> wrote:
> * Whiskers wrote :
>> On 2009-07-31, Troy Piggins <usenet-0908@piggo.com> wrote:

[...]

>> It occurs to me that the same script could be used with minor 
>> modification, to score-up responses to interesting posters too, even when 
>> they lack personally identifiable MIDs.
>
> Yeah, I was thinking the same thing.  You could use it to score
> followups ups to yourself if you don't have a unique M-ID, or, as
> you say, to interesting posters.  At the moment you'd need to
> copy the macro, rename it, and have one for killing posts and one
> for interesting posts.  I'll have a tinkle to see if I can mod it
> to work all from the one macro.  Certainly possible, but the way
> he's been going lately, JED will probably have it done before I
> can say "boo".  What a legend.

He is that.

> For the above reason of being able to use it to do more than just
> plonk, I'm thinking a more apt name than "turbo-plonk",
> "hyper-plonk" etc.  "Thread-burner" is good.  Maybe
> "Thread-scorer"?  Nah, I like "Thread-burner" better.

... particularly if the same script can both raise and lower scores.

Are you familiar with the planet Pern?  

-- 
-- ^^^^^^^^^^
--  Whiskers 
-- ~~~~~~~~~~
Re: [slrn] turbo-plonk.sl improved (Was: Can I make a rule that will auto-ignore all follow-ups to a certain author?)
#234895
Author: Troy Piggins
Date: Sat, 01 Aug 2009 22:16
30 lines
3056 bytes
* Whiskers wrote :
> On 2009-08-01, Troy Piggins <usenet-0908@piggo.com> wrote:
>> * Whiskers wrote :
>>> On 2009-07-31, Troy Piggins <usenet-0908@piggo.com> wrote:
>
> [...]
>
> [---=| Quote block shrinked by t-prot: 7 lines snipped |=---]
>> copy the macro, rename it, and have one for killing posts and one
>> for interesting posts.  I'll have a tinkle to see if I can mod it
>> to work all from the one macro.  Certainly possible, but the way
>> he's been going lately, JED will probably have it done before I
>> can say "boo".  What a legend.
>
> He is that.
>
>> For the above reason of being able to use it to do more than just
>> plonk, I'm thinking a more apt name than "turbo-plonk",
>> "hyper-plonk" etc.  "Thread-burner" is good.  Maybe
>> "Thread-scorer"?  Nah, I like "Thread-burner" better.
>
> ... particularly if the same script can both raise and lower scores.
>
> Are you familiar with the planet Pern?  

I wasn't, but am now.  ;)  So you're suggesting "Threadscore" as
a name?

-- 
Troy Piggins
Re: [slrn] turbo-plonk.sl improved (Was: Can I make a rule that will auto-ignore all follow-ups to a certain author?)
#234896
Author: Whiskers
Date: Sat, 01 Aug 2009 23:02
35 lines
3287 bytes
On 2009-08-01, Troy Piggins <usenet-0908@piggo.com> wrote:
> * Whiskers wrote :
>> On 2009-08-01, Troy Piggins <usenet-0908@piggo.com> wrote:
>>> * Whiskers wrote :
>>>> On 2009-07-31, Troy Piggins <usenet-0908@piggo.com> wrote:
>>
>> [...]
>>
>> [---=| Quote block shrinked by t-prot: 7 lines snipped |=---]
>>> copy the macro, rename it, and have one for killing posts and one
>>> for interesting posts.  I'll have a tinkle to see if I can mod it
>>> to work all from the one macro.  Certainly possible, but the way
>>> he's been going lately, JED will probably have it done before I
>>> can say "boo".  What a legend.
>>
>> He is that.
>>
>>> For the above reason of being able to use it to do more than just
>>> plonk, I'm thinking a more apt name than "turbo-plonk",
>>> "hyper-plonk" etc.  "Thread-burner" is good.  Maybe
>>> "Thread-scorer"?  Nah, I like "Thread-burner" better.
>>
>> ... particularly if the same script can both raise and lower scores.
>>
>> Are you familiar with the planet Pern?  
>
> I wasn't, but am now.  ;)  So you're suggesting "Threadscore" as
> a name?

I wasn't, but I am now  :))

-- 
-- ^^^^^^^^^^
--  Whiskers 
-- ~~~~~~~~~~
Re: My dysfunctional attemp
#234898
Author: ShadowTek
Date: Sun, 02 Aug 2009 02:42
30 lines
2966 bytes
On 2009-08-01, John E. Davis <jed@jedsoft.org> wrote:

> Below you will find a modified version that I believe works the way
> that you intended.  My main purpose here is is to provide some
> working examples of slang code.

*My* biggest problem with trying to learn s-lang by using the
documentation was that there is a *lot* of stuff that is left
out, as if the person is already supposed to know these things by being
thoroughly familiar with C#. That means that in order to use s-lang to
any great degree, you have to constantly consult C# documentation in parallel to
s-lang's.

Take my previous query about those regular expressions for example.
Much of that information can only be obtained outside of s-lang's
documentation.


> The best way to get the value of an environment variable is to use the
> getenv function.  The above should be replaced by:
>
>     variable home_str = getenv ("HOME");

I tried that but it didn't work, but I think I might have been trying "$HOME".


>> Here is the code.  I hope you find it instructive.  Thanks, --John

I'll look through it when I get a chance to sit down for a while.
Thanks.
Re: My dysfunctional attemp
#234899
Author: John E. Davis
Date: Sun, 02 Aug 2009 03:59
42 lines
3720 bytes
On Sun, 2 Aug 2009 02:42:56 +0000 (UTC), ShadowTek <ShadowTek@invalid.invalid>
wrote:
> *My* biggest problem with trying to learn s-lang by using the
> documentation was that there is a *lot* of stuff that is left out, as
> if the person is already supposed to know these things by being
> thoroughly familiar with C#. That means that in order to use s-lang to
> any great degree, you have to constantly consult C# documentation in
> parallel to s-lang's.

I am unfamiliar with C# so I am unable to comment on its resemblance
to slang.  Many open source interpeters such as slang make heavy use
of the C standard library and provide wrappers around those functions
in one form or another.  For this reason, it is helpful, but not
necessary, to be familiar with the C standard library.  For example,
in the code that I posted, I made use of a number of functions that
have C counterparts, including fopen, fgets, and strtok.  Despite the
similarity in name and function, the semantics can and often do
differ.  For instance, strtok returns an array of values whereas the C
version would require multiple function calls to achieve the same
result.  Hence in order to actually use such a function in a slang
script, it is necessary to look at the slang documentation for the
function.

Links to the slang documentation are available from
<http://www.jedsoft.org/slang/docs.html>.  The language itself is
documented at <http://www.jedsoft.org/slang/doc/html/slang.html>.  The
runtime library documentation is at
<http://www.jedsoft.org/slang/doc/html/slangfun.html>.  This is where
you will find documentation for getenv, strtok, etc.  And since you
are using the interpreter within the context of slrn, it is important
to read the documentation for the slrn intrinic functions at
<http://slrn.sourceforge.net/docs/slrnfuns.html>.

Feel free to ask slang questions pertaining to slrn on this newgroup
or on the slrn-users mailing list.  Generic slang question should go
to alt.lang.s-lang.

There is a learning curve, but I do not believe that the documentation
is a big part of it.  

Good luck,
--John
--
#234901
Author: _
Date: Sun, 02 Aug 2009 14:19
6 lines
1480 bytes
J. Davis, I'd like a full-screen shot of you editing a post;
like this screenShot of me editing a post (in Visual Studio):
  www.JeffRelf.F-M.FM/Visual-Studio.PNG

P.S. Thanks for the code, you rock ! I enjoyed the links:
  jedSoft.ORG  slrn.sourceForge.NET
Re: J. Davis, I'd like a full-screen shot of you editing a post.
#234916
Author: Peter J Ross
Date: Tue, 04 Aug 2009 19:18
27 lines
2297 bytes
In news.software.readers on Sun, 2 Aug 2009 14:19:14 +0000 (UTC),
_@Jeff_Relf.Seattle.inValid <_@Jeff_Relf.Seattle.inValid> wrote:

> J. Davis, I'd like a full-screen shot of you editing a post;
> like this screenShot of me editing a post (in Visual Studio):
>   www.JeffRelf.F-M.FM/Visual-Studio.PNG

You can probably find screenshots of jed (the text editor that JED
wrote) if you look for them.

You can also install and use jed yourself.

<http://jedsoft.org/jed/download.html>

Notice that Windows binaries exist.

> P.S. Thanks for the code, you rock ! I enjoyed the links:
>   jedSoft.ORG  slrn.sourceForge.NET

I thought you preferred C++ to C?


-- 
PJR :-)
slrn newsreader v0.9.9p1: http://slrn.sourceforge.net/
extra slrn documentation: http://slrn-doc.sourceforge.net/
newsgroup name validator: http://pjr.lasnobberia.net/usenet/validator
--
#234921
Author: _
Date: Tue, 04 Aug 2009 22:05
22 lines
2234 bytes
I wanted to see  Exactly  what J. Davis sees when he edits a post;
I wanted to see his setup, not the default.  Oh well... no luck.

I enjoy “good” code, no matter the language.

Naturally, S-Lang is more like JavaScript than C or C++.
I write both scripts (a.k.a. “macros”) and compiled code
―― it's not a matter of preferring one over the other.

Specifically, I write Visual Studio and Excel “macros*1”.
( *1: VBA, Visual Basic for Applications )

Via OLE, my Visual C++ 9 code “automates*2” Visual Studio and Excel.
( *2: X.EXE has macros which automate Visual Studio, my editor )

For example, see:
  news:_@Jeff_Relf.Seattle.2009_Jul24.5.20am.Wc
  news:_@Jeff_Relf.Seattle.2009_Jul19.3.50am.Oc

At Google, the 2 links (above) are:
  www.Google.COM/groups?selm=_@Jeff_Relf.Seattle.2009_Jul24.5.20am.Wc
  www.Google.COM/groups?selm=_@Jeff_Relf.Seattle.2009_Jul19.3.50am.Oc
Page 2 of 2 • 71 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads