AutoHotkey Community

It is currently May 26th, 2012, 12:39 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: March 18th, 2006, 5:35 am 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Version 1.5 is uploaded to the original place, with a minor bugfix.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 8th, 2006, 9:09 pm 
Laszlo,
We have a huge Courier email sent box that we spend hours cleaning duplicate email addresses out of.

We're new with AHK.
Can you offer any help or suggestions to adapt this code to searching a 50MB or so Courier email sent box for duplicate addresses?

Many thanks!
Michael Talley

Laszlo wrote:
Here is the third part, removing identical items from lists. The script below is faster than sorting. For each item in the list a local variable is generated, named by the hex representation of the name of the item (which could contain illegal characters for a variable name, like "."). If this name is new, it is the first occurrence of the item, otherwise we cut this item off the list.
Code:
Hexify(x)         ; Convert a string to a huge hex number starting with X
{
   StringLen Len, x
   format = %A_FormatInteger%
   SetFormat Integer, H
   hex = X
   Loop %Len%
   {
      Transform y, ASC, %x%   ; ASCII code of 1st char, 15 < y < 256
      StringTrimLeft y, y, 2  ; Remove leading 0x
      hex = %hex%%y%
      StringTrimLeft x, x, 1  ; Remove 1st char
   }
   SetFormat Integer, %format%
   Return hex
}

ListUniq(ByRef list)          ; Remove repeated items from list
{
   list = %list%,
   c = 0
   Loop
   {
      StringGetPos d, list, `,,, %c% ; search from c
      IfLess d,0, {           ; No more ","
         StringTrimRight list, list, 1
         Return
      }
      StringMid item, list, % c+1, % d-c
      hex := Hexify(item)     ; Item might not be a valid name
      IfEqual %hex%,, {       ; 1st occurrence
         %hex% = 1
         c := d + 1
         Continue
      }                       ; Already found
      StringLeft      left, list,% c-1
      StringTrimLeft right, list, %d%
      list = %left%%right%
   }
}
Test it with
Code:
list = 0,1,2,1,3,02,4,2,1
ListUniq(list)
MsgBox %list%


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 8th, 2006, 10:04 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Although, in theory, the ListUniq function is faster than sorting, in practice the hexify steps eat away this advantage. Because of its simplicity I would use the following approach, after reading in the variable "emails" all the email addresses:
Code:
emails = name@abc.com,name@bcd.com,name@abc.de,name@abc.com,namf@bcd.com,name@abc.de
sort emails, UD`, ; replace "`," with the actual delimiter char, like "`n"
MsgBox %emails%   ; write emails back to disk


Report this post
Top
 Profile  
Reply with quote  
 Post subject: where is the file?
PostPosted: December 19th, 2008, 3:53 am 
Offline

Joined: June 18th, 2006, 8:47 am
Posts: 346
Location: Phoenix, AZ
Laszlo,
I don't see the file in the linked location. The first post doesn't seem to show the most recent developments.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2008, 4:35 am 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
The library was written 4 years ago, and AHK has evolved much since then, so one can code the same functions faster and simpler now. For the last 3 years no one showed interest in using the library, so I did not bother maintaining the code. If there were a few requests, I would update it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2008, 5:12 am 
Laszlo wrote:
The library was written 4 years ago, ... If there were a few requests, I would update it.

Laszlo, It is always a pleasure to read and (try to) understand your scripts. It seems that every new post you make, there is something to be learned from it. I would certainly like to see an update of you list functions.

Thanks for all of your contributions to these forums. :D


Report this post
Top
  
Reply with quote  
 Post subject: remove x lines
PostPosted: December 19th, 2008, 8:26 am 
Offline

Joined: June 18th, 2006, 8:47 am
Posts: 346
Location: Phoenix, AZ
Laszlo, I was specifically looking for "ListDel" I think. Some easy way to remove the first item in a list anyway. To use while I make a script using some other code you posted :D .

Making a script to track keystrokes. I'll post what I have there.
http://www.autohotkey.com/forum/topic2919.html


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: where is the file?
PostPosted: December 19th, 2008, 7:32 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
keybored wrote:
I don't see the file in the linked location.
I uploaded both files to AutoHotkey.net and updated the url's in the first post.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 3rd, 2009, 4:17 am 
Offline

Joined: February 17th, 2008, 5:01 pm
Posts: 303
Hi, Laszlo,

Thanks a lot for posting the links to the normal and experimental versions on Autohotkey.net. They are going straight into lib folder. Would love to see any updates you make.

JS


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 3rd, 2010, 5:00 pm 
Laszlo wrote:
The library was written 4 years ago, and AHK has evolved much since then, so one can code the same functions faster and simpler now. For the last 3 years no one showed interest in using the library, so I did not bother maintaining the code. If there were a few requests, I would update it.


i'd love an update, if you think its worth it. otherwise these are good :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 3rd, 2010, 5:09 pm 
for example i think this

Code:
ListRemove(text,opt,list)


should be like so:

Code:
ListRemove(text, ByRef list, opt=0)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 3rd, 2010, 5:19 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Thanks for the interest. However, since AHK is not developed any further, its bugs are not getting fixed, writing AHK scripts for anything but very simple Windows automation tasks is wasting our time. The new flavors of the language require different logic, so this library might not be needed for them at all. We have to move on... :cry:


Report this post
Top
 Profile  
Reply with quote  
 Post subject: move on to?
PostPosted: August 5th, 2010, 11:08 am 
I haven't followed any discussions about alternatives. May I ask what you intend to move on to? It's sad to see that AHK isn't updated anymore :(

Laszlo wrote:
Thanks for the interest. However, since AHK is not developed any further, its bugs are not getting fixed, writing AHK scripts for anything but very simple Windows automation tasks is wasting our time. The new flavors of the language require different logic, so this library might not be needed for them at all. We have to move on... :cry:


Report this post
Top
  
Reply with quote  
 Post subject: Re: move on to?
PostPosted: August 5th, 2010, 6:27 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Anonymous wrote:
what you intend to move on to?
I am learning Java. It is designed for different purposes, but very powerful, fast enough, good libraries, free. My first simple app runs on my DroidX, on my PC and probably on Linux and OSX (which I don't have to test).


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Cerberus, Exabot [Bot] and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group