Topic: Permutations macro (1 of 20), Read 43 times
Conf: VEDIT Macro Language Support
From: John H
Date: Sunday, November 06, 2005 04:03 PM

Hi,

Has anyone written a permutations macro for vedit?

I am wanting to do something like:

char elements ^ string length --> list of results

EG:

elements: A, B & C
result length: 3

Output the 27 unique, 3 char length, strings.

--
John
VEDIT SN: 95651
VEDIT (DOS) Ver. 6.13.1 01/25/05
VEDIT (32-Bit) Ver. 6.13.1 01/25/05
VEDIT Pro (64-Bit) Ver. 6.13.1 01/25/05
Windows 2000 (5.0.2195 Service Pack 4)

 


Topic: Re: Permutations macro (2 of 20), Read 28 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Sunday, November 06, 2005 07:06 PM

On Sun, 06 Nov 2005 16:03:00 -0500, John H wrote:

>Has anyone written a permutations macro for vedit?

I've done it. Yet this night ;-) Just for fun.

It works, but needs some translation, some more documentation and much
more comfort...

But now it's really too late for more playing around!

Christian



//
// Permutationen Ch.Ziemski 06.11.2005
//
//
// e = Elemente 10 0..9
// n = Anzahl 3
//
// Permutationen = n ^ e 1000 000..999
//

// Speicher für n = 1..9
// jeder Speicher kann Werte von 0..e enthalten
// x zeigt auf den gerade zu prüfenden Speicher

#1=0
#2=0
#3=0
#4=0
#5=0
#6=0
#7=0
#8=0
#9=0

// Strings als Ausgabe

Reg_Set(10,"A")
Reg_Set(11,"B")
Reg_Set(12,"C")
Reg_Set(13,"D")
Reg_Set(14,"E")
Reg_Set(15,"F")
Reg_Set(16,"G")
Reg_Set(17,"H")
Reg_Set(18,"I")
Reg_Set(19,"J")

#90=1 // x
#91=3 // n
#92=10 // e


do {

do {
for (#99=#91; #99>0; #99--) { Reg_Ins(#@99+10) } Ins_Newline(1)
#103=#90 Call("add1")
} while (#104)

do {
#90++ // nächst höhere Stelle versuchen

#103=#90 Call("add1")

if (#104) { // bei Erfolg ...
#90=1 // ... wieder bei niedrigster Stelle weitermachen
break
}
} while (#90<#91) // solange noch nicht höchste Stelle erreicht

} while (#90<#91)

return

//-------------------------------------------------------------------

:add1:
// IN: #103 x
// OUT: #104 1=o.k.
// MOD: #@103

#104=0
if (#@103 < (#92-1)) {
#@103++
#104=1
} else {
#@103=0
}

return

 


Topic: Permutations macro (3 of 20), Read 36 times
Conf: VEDIT Macro Language Support
From: John H
Date: Monday, November 07, 2005 07:25 AM

On Sun, 6 Nov 2005 19:07:38 -0500 GMT, Christian Ziemski wrote:

> On Sun, 06 Nov 2005 16:03:00 -0500, John H wrote:

>>Has anyone written a permutations macro for vedit?

> I've done it. Yet this night ;-) Just for fun.

> It works, but needs some translation, some more documentation and much
> more comfort...

Hi Christian,

Nice! Glad to see you have put limited input data for the test, it
doesn't take too many options to consume a system generating these.
My binary version of a generator, piping output to a text file had
sucked up all my available drive space in a couple minutes. :-)

I guess technically I don't mean permutations as the permutation
formula isn't what I am doing. This is more like a brute-force
password generator, however I am using it to try and ferret out
available 3 letter domain names. :-)

Maybe a nice start to an anagram engine or game for Vedit.

--
John

 


Topic: Re: Permutations macro (4 of 20), Read 55 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Monday, November 07, 2005 10:22 AM

At 07:27 AM 11/7/2005, you wrote:
>I guess technically I don't mean permutations as the permutation
>formula isn't what I am doing. This is more like a brute-force
>password generator, however I am using it to try and ferret out
>available 3 letter domain names. :-)

John:

I can assure you there are no available 3-letter domain names and probably few (if any) 4-letter domain names. There should be some 5-char domain names, especially if you include digits and "-" in the domain name.

In our anti-spam business we monitor and analyze all domain names and their owners. A "bunch" of companies immediately register all short domain names and then attempt to sell them at a profit. I also notice that spammers register many short domain names, especially strange names with digits.

Ted.

 


Topic: Re: Permutations macro (5 of 20), Read 88 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Monday, November 07, 2005 10:39 AM

At 07:27 AM 11/7/2005, you wrote:
>I guess technically I don't mean permutations as the permutation
>formula isn't what I am doing. This is more like a brute-force
>password generator, however I am using it to try and ferret out
>available 3 letter domain names. :-)

A macro to sort by string length would be useful.

In case someone wants to try it, I "think" the algorithm would be:

1. Select a maximum string length, say 100.

2. Make all strings the same length by inserting spaces before the string.

3. Sort using the command Sort(0,File_Size).

4. Remove all the spaces at the beginning of each string.

I "think" that the strings will then be sorted by length, and within the same length, be sorted in alphabetic order.

If someone wants to create this macro, I will run it on all registered domain names and provide any desired portion of the list.

We download all domain names every day. Here are the results from yesterday:

COM Domains: 98085643
NET Domains: 14703401
ORG Domains: 8953666
BIZ Domains: 2884377
INFO Domains: 6597290
--------------------------
Total Domains: 131224377

Then, you could create a macro to generate all possible domains names, and then compare the two lists. That would help you find short domain names.

Ted.

 


Topic: Re: Permutations macro (6 of 20), Read 89 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Monday, November 07, 2005 12:05 PM

On Mon, 07 Nov 2005 10:39:00 -0500, Ted Green wrote:

>At 07:27 AM 11/7/2005, you wrote:
>>I guess technically I don't mean permutations as the permutation
>>formula isn't what I am doing. This is more like a brute-force
>>password generator, however I am using it to try and ferret out
>>available 3 letter domain names. :-)
>
>A macro to sort by string length would be useful.


Fritz and I created a sort-by-length macro in 2001:

http://www.ziemski.net/vedit/macros/sortlength.vdm

Perhaps it's useful here.

Christian

 


Topic: Re: Permutations macro (7 of 20), Read 92 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Monday, November 07, 2005 12:25 PM

At 12:06 PM 11/7/2005, you wrote:
>Fritz and I created a sort-by-length macro in 2001:
>
>http://www.ziemski.net/vedit/macros/sortlength.vdm
>
>Perhaps it's useful here.

That looks very promising; I'm sorry I forgot about it.

Assuming it works well, I will add it to the {EDIT, Sort} submenu.

Ted.

 


Topic: Re: Permutations macro (8 of 20), Read 93 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Monday, November 07, 2005 12:43 PM

On Mon, 07 Nov 2005 00:25:00 -0500, Ted Green wrote:

>At 12:06 PM 11/7/2005, you wrote:
>>Fritz and I created a sort-by-length macro in 2001:
>>
>>http://www.ziemski.net/vedit/macros/sortlength.vdm
>
>That looks very promising; I'm sorry I forgot about it.
>
>Assuming it works well, I will add it to the {EDIT, Sort} submenu.

Immediately _after_ sending my original message above I fixed the
macro to be compatible with Vedit-Pro64 too (Numbers by Num_Ins() are
19 digits instead of 10 in Vedit32...).

But I think you already have seen the fixed version when you looked at
it some minutes ago!?


Christian

 


Topic: Re: Permutations macro (10 of 20), Read 95 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Monday, November 07, 2005 01:00 PM

At 12:44 PM 11/7/2005, you wrote:
>Immediately _after_ sending my original message above I fixed the
>macro to be compatible with Vedit-Pro64 too (Numbers by Num_Ins() are
>19 digits instead of 10 in Vedit32...).
>
>But I think you already have seen the fixed version when you looked at
>it some minutes ago!?

Yes, I have your a Pro64 aware version.
However, I don't think it is needed as VEDIT could not
handle single lines longer than 2 Gigs anyway.
Your changes might slow down the sorting.

Ted.

 


Topic: Re: Permutations macro (11 of 20), Read 96 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Monday, November 07, 2005 01:12 PM

On Mon, 07 Nov 2005 13:00:00 -0500, Ted Green wrote:

>Yes, I have your a Pro64 aware version.
>However, I don't think it is needed as VEDIT could not
>handle single lines longer than 2 Gigs anyway.
>Your changes might slow down the sorting.

But somehow the macro has to be able to insert a fixed number of
digits in both the 32 and 64 bit version.
Up to the allowed maximum and without BAD PARAMETER errors.

I'll play with Num_Ins() a bit.

Christian

 


Topic: Re: Permutations macro (14 of 20), Read 89 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Monday, November 07, 2005 04:36 PM

BTW:

>[sortlength.vdm]
The birth of that macro in 2001 is documentated here:
http://webboard..../read?4512,29

Funny! (Isn't it, Fritz? ;-)

Christian

 


Topic: Re: Permutations macro (15 of 20), Read 89 times
Conf: VEDIT Macro Language Support
From: Fritz Heberlein
Date: Tuesday, November 08, 2005 03:58 AM


>The birth of that macro in
>2001 is documentated here:
>http://webboard..../read
>?4512,29
>
>Funny! (Isn't it, Fritz? ;-)


It is, but Peter's beers are still pending
(cf. http://webboard..../read?4512,29e#4512)

Fritz

 


Topic: Re: Permutations macro (19 of 20), Read 81 times
Conf: VEDIT Macro Language Support
From: Peter Rejto
Date: Thursday, February 09, 2006 05:07 PM

On 11/8/2005 3:58:34 AM, Fritz Heberlein wrote:
>
>>The birth of that macro in
>>2001 is documentated here:
>>http://webboard..../read
>>?4512,29
>>
>>Funny! (Isn't it, Fritz? ;-)
>
>
>It is, but Peter's beers are
>still pending
>(cf.
>http://webboard..../read
>?4512,29e#4512)



Yes, Fritz,

I do think that it is funny! That is to say, it is funny that a question that was totally esoteric a few years ago, now has a perfectly good motivation.


Well, being a mathematician, I think that it is my job to ask esoteric questions. At the same time, I would like to thank all of you who gave generously of your time answering my esoteric questions. Especially, the ones which were also uninformed.


-peter

 


Topic: Re: Permutations macro (12 of 20), Read 91 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Monday, November 07, 2005 01:38 PM

At 12:06 PM 11/7/2005, you wrote:
>Fritz and I created a sort-by-length macro in 2001:
>
>http://www.ziemski.net/vedit/macros/sortlength.vdm

I have added it to the {EDIT, Sort} sub-menu in future versions.

I changed this line:

Sort_Merge("1,11", 0, File_Size) // sort the whole text (by the leading number)

to:

Sort_Merge("1,80", 0, File_Size) // sort the whole text (by the leading number)

as it then also sorts lines with the same length by alphabetic order.

Thank you again for this very clever way of sorting by length.

-----------

Speaking of future versions, I am documenting the new ftp support now, and when done, I will make a beta-test available.

Ted.

 


Topic: Re: Permutations macro (13 of 20), Read 95 times, 1 File Attachment
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Monday, November 07, 2005 04:22 PM

On Mon, 07 Nov 2005 13:38:00 -0500, Ted Green wrote:

>[sortlength.vdm]
>
>I have added it to the {EDIT, Sort} sub-menu in future versions.

Nice!

>I changed this line:
>
> Sort_Merge("1,11", 0, File_Size)
>to:
> Sort_Merge("1,80", 0, File_Size)
>
>as it then also sorts lines with the same length by alphabetic order.

A good idea!

So the sort() uses 80 columns regardless of the 10 leading digits of Vedit32 or 19 ones of Vedit64 and makes that if() obsolete.


I didn't find a solution of making Num_Ins() behave the same way (regarding the number of digits) in both VEDIT versions and for all numbers.

From the docu (a bit abbreviated):
Numbers 0 < n < 99999 are right justified in a field of 5 columns.
Numbers 99999 < n < 2,147,483,647 use a field of 10 columns.
FORCE: Use a field width of 10 columns for all numbers; ...
...

Not (yet) in the docu:
Vedit64 uses 15 for bigger and 19 columns for even bigger numbers
FORCE uses 19 columns for all numbers
...

If you are already in the process of documenting...


I again reduced the macro. It's attached.


Christian

 
SORTLENGTH(2).VDM (1KB)

 


Topic: Re: SortLength.vdm macro (20 of 20), Read 72 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Wednesday, March 22, 2006 03:29 PM

At 04:23 PM 11/7/2005, you wrote:
>From: "Christian Ziemski"
>I didn't find a solution of making Num_Ins() behave the same way (regarding the number of digits) in both VEDIT versions and for all numbers.
>
>>From the docu (a bit abbreviated):
> Numbers 0 < n < 99999 are right justified in a field of 5 columns.
> Numbers 99999 < n < 2,147,483,647 use a field of 10 columns.
> FORCE: Use a field width of 10 columns for all numbers; ...
> ...
>
>Not (yet) in the docu:
> Vedit64 uses 15 for bigger and 19 columns for even bigger numbers
> FORCE uses 19 columns for all numbers

Beginning with 6.15 03/22/06, the Num_Ins() and Num_Type() command have new and revised options to behave identically in the 32 and 64 bit versions. All documented in the on-line help.

Therefore, this thread should now be closed.

Ted.

 


Topic: Permutations macro (16 of 20), Read 91 times
Conf: VEDIT Macro Language Support
From: John H
Date: Wednesday, November 09, 2005 03:37 PM

On Mon, 7 Nov 2005 13:39:51 -0500 GMT, Ted Green wrote:

> Speaking of future versions, I am documenting the new ftp support
> now, and when done, I will make a beta-test available.

Sounds nice, perhaps a long-shot but will it be capable of 'FTPS' -
AUTH TLS and or SSL connections?

--
John

 


Topic: Re: Permutations macro (17 of 20), Read 91 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Wednesday, November 09, 2005 04:10 PM

At 03:38 PM 11/9/2005, you wrote:

>Sounds nice, perhaps a long-shot but will it be capable of 'FTPS' -
>AUTH TLS and or SSL connections?

John:

Not yet. This is just the first step. :-)

Since our anti-spam business operates about 80 remote servers, we have plenty of interest in secure ftp too.

Ted.

 


Topic: Re: Permutations macro (18 of 20), Read 93 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Saturday, November 26, 2005 08:32 AM

On Mon, 07 Nov 2005 13:38:00 -0500, Ted Green wrote:

>At 12:06 PM 11/7/2005, you wrote:
>>Fritz and I created a sort-by-length macro in 2001:
>>
>>http://www.ziemski.net/vedit/macros/sortlength.vdm
>
>I have added it to the {EDIT, Sort} sub-menu in future versions.

Then it's a good idea to reload it from my site.

I found a funny, big bug in it:

Wrong: Num_Push(#103,#103) Num_Push(#103,#103)
Correct: Num_Push(103,103) Num_Pop(103,103)

That might have caused some problems...


Christian

 


Topic: Re: Permutations macro (9 of 20), Read 40 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Monday, November 07, 2005 12:49 PM

On Mon, 07 Nov 2005 07:25:00 -0500, John H wrote:

>>>Has anyone written a permutations macro for vedit?
>
>> I've done it. Yet this night ;-) Just for fun.
>
>Nice! Glad to see you have put limited input data for the test, it
>doesn't take too many options to consume a system generating these.

It's a prototype, not more.

>I guess technically I don't mean permutations as the permutation
>formula isn't what I am doing.

In German the thing we are doing here seems to be "Variation" and not
"Permutation".
(I'm not a Mathematician, I simply consulted Wikipedia a bit.)


>Maybe a nice start to an anagram engine or game for Vedit.

Any volunteers? ;-)


Christian