Reply
Old Jun 20, 2008, 11:09am Default Re: Today !
ianm's Avatar
Just Cuddly Old Me™

Posts: 1,467
Karma: ianm is on a distinguished road
me too - it's driving me nuts, pains all over
__________________
blog | flickr | fazyluckers | graphic design forum | graphic design links | The Photo Forum


MCP - Troubleshooting Windows XP
MCDST - Supporting Users of XP
ianm is offline
Reply With Quote
View Public Profile Visit ianm's homepage! Send a private message to ianm
 
Old Jun 21, 2008, 06:00pm Default Re: Today = "THE ENGINE!"
APK
APK's Avatar
Elite Member

Posts: 354
Name: The Duke of URL
Karma: APK will become famous soon enough
She's ALMOST ready, Sepulchre, & here the the 'prototype' screen of it:

APK Hosts File ReWriter 1.0++:



Thusfar (I just have to pull some hardcodes, which I am going to switch to Open Dialogboxes & Save Dialogboxes, because currently I am using hardcoded locations to my files to import/scrub, normalize, & export... as to file locations & exported files (not consistent here, yet))

"The LITTLE engine, that could", & here is the "Active Ingredient" recursively called routine (not a function anymore, OR even an "inlined function" (possible in Delphi/Object Pascal, right inside of a procedure/subroutine no less)):



=============================

procedure TForm1.Button3Click(Sender: TObject); register;
var
I:Integer;
J:Integer;
begin inherited;
ProgressBar1.Min:=0;
ProgressBar1.Max:=Form1.ListBox1.Items.Count - 1;
Screen.Cursor:=crHourGlass;
ListBox1.OnClick(self); //Puts it into first entry + selected... apk
Form1.ListBox2.AddItem(Form1.ListBox1.Items[0], Self);
If GlobalCPUFlag <> 1 then Application.ProcessMessages;
BitBtn1.Enabled:=False;
Button1.Enabled:=False;
Button2.Enabled:=False;
Button3.Enabled:=False;
Button4.Enabled:=False;
DeleteSelectedItem1.Enabled:=False;
Label3.Caption:= Trim(DateTimeToStr(now));
Label3.Update;
Label3.Refresh;
Label4.Caption:= Trim('Waiting to load temporary variable for comparison to complete...');
Label4.Update;
Label4.Refresh;
StatusBar1.SimpleText:= Trim('Waiting to load temporary variable for comparison to complete...');
StatusBar1.Update;
StatusBar1.Refresh;
If GlobalCPUFlag <> 1 then Application.ProcessMessages;
try
//================================================== ============
// Main RECURSIVELY CALLED Engine/Algorithm... apk
//================================================== ============

{COPYRIGHT APK - Alexander Peter Kowalski 06/01/2008 onwards}
For I:= 0 to Form1.ListBox1.Items.Count-1 do
begin
Form1.ListBox1.Selected[i];
Form1.ListBox1.ItemIndex:= i;
//--------------------------------------------------------------
// I was using J:= 0 to Form1.ListBox1.Items.Count -1 here, but technically, it's unneeded: Just
// Go from the current record being searched for dups because the ones before it have been checked... apk
//--------------------------------------------------------------
For J:=i to Form1.ListBox1.Items.Count - 1 do //this "inner loop" does it... apk
begin
If Form1.ListBox1.items[i] = Form1.Label5.Caption then
begin
Form1.ListBox1.Items.Delete(i);
end;
end;
Form1.Label10.Caption:= IntToStr(i) + ' of ' + IntToStr(Form1.ListBox1.Items.Count);
Form1.Label10.Update;
Form1.Label10.Refresh;
ProgressBar1.Position:=i;
ProgressBar1.Update;
StatusBar1.SimpleText:=Trim(Label5.Caption) + ' being compared to ' + ListBox1.Items[i] + ' ...';
StatusBar1.Update;
StatusBar1.Refresh;
//--------------------------------------------------------------
// So far, this is an efficiency savings using i vs. 0 to on inner loop... apk
//--------------------------------------------------------------
end;
//================================================== ============
except

SaveNewListtoDisk1.OnClick(Application.MainForm); //This stalls all the buttons f'ing up
//& saves file "on-the-fly"... apk
Screen.Cursor:=crDefault;
BitBtn1.Enabled:=True;
Button1.Enabled:=True;
Button2.Enabled:=True;
Button3.Enabled:=True;
Button4.Enabled:=True;
DeleteSelectedItem1.Enabled:=True;
StatusBar1.SimpleText:= Trim('Executing Recursive Function...');
StatusBar1.Update;
StatusBar1.Refresh;
If GlobalCPUFlag <> 1 then Application.ProcessMessages;
ListBox1.Selected[0];
ListBox1.ItemIndex:=0;
ListBox2.Selected[0];
ListBox2.ItemIndex:=0;
ListBox1.OnClick(self); //Puts it into first entry + selected... apk
Button3.OnClick(Self); //CREATES THE RECURSION EFFECT VIA USING ERRORS/ABENDS TO DO SO & IT WORKS... apk
If GlobalCPUFlag <> 1 then Application.ProcessMessages;
end;
Screen.Cursor:=crDefault;
If GlobalCPUFlag <> 1 then Application.ProcessMessages;
BitBtn1.Enabled:=True;
Button1.Enabled:=True;
Button2.Enabled:=True;
Button3.Enabled:=True;
Button4.Enabled:=True;
DeleteSelectedItem1.Enabled:=True;
Label4.Caption:= Trim(DateTimeToStr(now));
Label4.Update;
Label4.Refresh;
StatusBar1.SimpleText:=Trim('DONE Removing Duplicates (file normalized)...');
StatusBar1.Update;
StatusBar1.Refresh;
ShowMessage(Trim('Now, rightclick on right pane for popup menu to save disk and you are done normalizing the HOSTS file vs. repeat entries'));
If GlobalCPUFlag <> 1 then Application.ProcessMessages;
end;

=============================

That's the 'recursively self-calling' engine I ended up using Sepulchre... & SHE WORKS (all of it) - It now will (as far as features):
  • 1.) Format & "scrub", + import ANY other custom HOSTS file out there, into the MOST efficient format line by line I know of ( 0.0.0.0<singlespace>IPAddress<cr+lf> )
  • 2.) Check your HOSTS file for entries into it (new ones, either rejecting them as already existing, OR, adding new one if NOT present already)
  • 3.) "Normalize" (remove repeat entries, that often occur by importing the hosts file entries of others) the entire HOSTS file, F A S T (or, rather, faster & more efficiently than I had before, due to better "engine/algorithm" I use above)


(As a last feature, probably in a tabbed interface setup as I am running out of 'screen real estate' there above - I am going to add a "PINGER" to it also, so folks looking to speed up their websites favs. can add THOSE too, & have the convenience of a 'built-in' ping for getting IP Addresses of various URL's too, quick & easy!)

Right now though, I'd like it to go faster, & maybe by turning to another method, I MAY get it (vs. the line-by-line, "brute force" compare engine I use now, currently)... but, we'll see!

Neat "innovation" in it too, IF you noticed, on its "inner loop", sepulchre: - That's one of it NOT going back thru the ones above the current entry being examined, presently/already!

(As the ones above it have already been checked, vs. itself + all others in the list/array, further "sieving down" the dataset it has to 'vector thru' in those listbox arrays, every iteration (each run, it gets smaller & F A S T E R))

* In fact, I illustrated that VERY EFFECT to my pal Jack last night, with a smaller 'test dataset' which HE put the repeat entries into it, 3,000 items worth, with around 100 repeat entries from multiple diff. sites... not a single repeated entry remained, of 10 diff. sites put into the HOSTS file test dataset we built (2004 records long).

It tore thru that, 205 records a minute, during normalization (removal of repeat items, its SLOWEST part no less) @ the start, which is its slowest point to work on (MUCH faster once past the midway point), & GOT FASTER once it got past the 1/2 way point... I told him it would (& we proved it, not just in theory!)

APK
Attached Images
File Type: jpg APKHostsFileRewriter.jpg (98.4 KB, 15 views)
__________________
"I'm Reese: Sgt. TechComVN38416, assigned to protect you - You've been TARGETTED FOR TERMINATION!"

Last edited by APK; Jun 28, 2008 at 10:53pm.
APK is offline
Reply With Quote
View Public Profile Visit APK's homepage! Send a private message to APK
 
Old Jun 21, 2008, 10:17pm Default Re: Today !
Flamingo Rinse's Avatar
Elite Member

Posts: 561
Name: nick
Karma: Flamingo Rinse will become famous soon enoughFlamingo Rinse will become famous soon enough
I'm just getting over a bad hit of 'flu with horrible conjunctivitis in both eyes. Aaaarrrggghhh. And got bitten by a baby rat that my cat caught & dragged in still alive this morning. Oh how I laughed.
__________________
My Opera Blog
Flamingo Rinse is offline
Reply With Quote
View Public Profile Send a private message to Flamingo Rinse
 
Old Jun 22, 2008, 06:01am Default Re: Today !
ianm's Avatar
Just Cuddly Old Me™

Posts: 1,467
Karma: ianm is on a distinguished road
i have a sore throat
__________________
blog | flickr | fazyluckers | graphic design forum | graphic design links | The Photo Forum


MCP - Troubleshooting Windows XP
MCDST - Supporting Users of XP
ianm is offline
Reply With Quote
View Public Profile Visit ianm's homepage! Send a private message to ianm
 
Old Jun 22, 2008, 11:30am Default Re: Today !
Babe

Posts: 2,477
Name: Cindy
Karma: Cat-tranz is a jewel in the roughCat-tranz is a jewel in the roughCat-tranz is a jewel in the rough
Awwww honey you need to keep warm (body heat is good for that )
__________________
New members - before you post please read the TNT Rules
Cat-tranz is offline
Reply With Quote
View Public Profile Send a private message to Cat-tranz
 
Old Jun 22, 2008, 11:48am Default Re: Today !
ianm's Avatar
Just Cuddly Old Me™

Posts: 1,467
Karma: ianm is on a distinguished road
lend me some body heat then cat
__________________
blog | flickr | fazyluckers | graphic design forum | graphic design links | The Photo Forum


MCP - Troubleshooting Windows XP
MCDST - Supporting Users of XP
ianm is offline
Reply With Quote
View Public Profile Visit ianm's homepage! Send a private message to ianm
 
Old Jun 24, 2008, 01:35pm Default Re: Today !
APK
APK's Avatar
Elite Member

Posts: 354
Name: The Duke of URL
Karma: APK will become famous soon enough
How the HECK did I get a double post of the one below? Oh well...

APK
__________________
"I'm Reese: Sgt. TechComVN38416, assigned to protect you - You've been TARGETTED FOR TERMINATION!"

Last edited by APK; Jun 24, 2008 at 03:40pm.
APK is offline
Reply With Quote
View Public Profile Visit APK's homepage! Send a private message to APK
 
Old Jun 24, 2008, 01:36pm Default Re: Today !
APK
APK's Avatar
Elite Member

Posts: 354
Name: The Duke of URL
Karma: APK will become famous soon enough
4 things left to do, to the program I am creating above... & that'll be later tonite after work (which I cut out of early today, put in way, WAY too many hours the past few weeks in fact, + I need the 'mental break', OR, I WILL BREAK so-to-speak):

-----
  • 1.) Allow the option (in the "file format scrub" portion, topmost button) to generate HOSTS files that use either 127.0.0.1 (slowest/largest option, BUT most compatible), 0.0.0.0 (next largest/slowest option, less compatible across diff. OS', but, is faster loadtime & smaller RAM occupancy in the local DNS cache your OS + tcp/ip stack keeps than 127.0.0.1) & lastly a NEW more efficient format I am using ( 0<singlespace>URLtoBLOCK<cr+lf> ) that actually WORKS for bad adbanners/sites,,, it quite literally shaved my HOSTS file down from 14mb size, to 11mb, already, yet yields FULL blocking function!
  • 2.) The ability to PING a list of sites in a .txt file, for folks that like to use the HOSTS file to speedup access to their fav. websites, which I for one, do, since it takes less time to get an IP resolution from your local DNS cache OR the HOSTS file, than it does taking time to call out to a DNS Server, many orders of magnitude faster in fact (I have this code already having written MANY apps like it) into another tab - &, to "merge it" with the blocking section format scrub output file from #1 above also!
  • 3.) Storing my PREBUILT 11mb HOSTS file in another tab & memo field for save to disk overwriting ones folks have stored, as an option, for save to disk (either I will do it THIS way, OR, store it as a programmatic resource to extract, which I do in my APK Doctor Who ScreenSaver (w/ its .avi file it plays)).
  • 4.) Stop the use of hardcodes, & use FileOpen + FileSave dialog box controls instead
-----



* So far, so good... almost done/ready, for "public consumption"...

To quote the "Foo Fighters" from their tune "ALL MY LIFE" (listening to it now):

"Done, done, & I'm onto the NEXT ONE!"

APK

P.S.=> I was NOT going to put this out for the general public initially, & I was only going to use it myself (hence, why I initially 'hardcoded' file locations to files to scrub, HOSTS file location, etc. et al), but... it's getting to the point where it is good enough, especially after the above list, for the 'general public'... & my pal Jack was like "This is good stuff, put it out there", which is how any other app I have ever done & put out online came to happen - folks I knew liked them, & suggested I do so... apk
__________________
"I'm Reese: Sgt. TechComVN38416, assigned to protect you - You've been TARGETTED FOR TERMINATION!"

Last edited by APK; Jun 24, 2008 at 03:30pm.
APK is offline
Reply With Quote
View Public Profile Visit APK's homepage! Send a private message to APK
 
Old Jun 25, 2008, 01:28pm Default Re: Today !
APK
APK's Avatar
Elite Member

Posts: 354
Name: The Duke of URL
Karma: APK will become famous soon enough
Going to TRY to find time to finish off this program that I've been documenting here in this post

(By putting in the last 4 things in it which I noted above that I feel need doing)

Plus, my buddy Jack's reviewing it over @ his place now (just got off the phone w/ he & he is looking it over, offering critiques of its various features later, so it has the input/feedback of others going into its design - best thing a software developer/programmer/engineer can get imo)



* Still, first? Well - I have to do a lot of "chores" today that need doing though!

(... & that, as per usual, "gets in my face" & takes precedence though - laundry, grass needs cutting on yard, car needs a bath, & garden needs watering)...

So - "drudgery" is the name of my game today/this afternoon, most likely though, before I can finish up this program...

APK

P.S.=> I figure that I'll try to multitask that work on the program as I do laundry tonite, most likely (hopefully, I get it done, & don't just "zonk out" & crash that is, bit tired today), this is my "plan" today, & hopefully, I can stick to it! apk
__________________
"I'm Reese: Sgt. TechComVN38416, assigned to protect you - You've been TARGETTED FOR TERMINATION!"
APK is offline
Reply With Quote
View Public Profile Visit APK's homepage! Send a private message to APK
 
Old Jun 25, 2008, 10:15pm Default Re: Today !
APK
APK's Avatar
Elite Member

Posts: 354
Name: The Duke of URL
Karma: APK will become famous soon enough
Pfagh!

I only accomplished 1 thing from that list on my program so far, but, it was worth it for MANY other "little things" in it that needed cleaning up that I was NOT aware of (not so much bugs, but better try-except errtrapping & also try-finally "batch commits" of various ops, too):

ALL THAT REMAINS LIST:

-----
  • 1.) Allow the option (in the "file format scrub" portion, topmost button) to generate HOSTS files that use either 127.0.0.1 (slowest/largest option, BUT most compatible), 0.0.0.0 (next largest/slowest option, less compatible across diff. OS', but, is faster loadtime & smaller RAM occupancy in the local DNS cache your OS + tcp/ip stack keeps than 127.0.0.1) & lastly a NEW more efficient format I am using ( 0<singlespace>URLtoBLOCK<cr+lf> ) that actually WORKS for bad adbanners/sites, as it quite literally shaved my HOSTS file down from 14mb size, to 11mb, already, yet yields FULL blocking function!
  • 2.) The ability to PING a list of sites in a .txt file, for folks that like to use the HOSTS file to speedup access to their fav. websites (which I for one, do, since it takes less time to get an IP resolution from your local DNS cache OR the HOSTS file, than it does taking time to call out to a DNS Server, many orders of magnitude faster in fact (I have this code already having written MANY apps like it) into another tab - &, to "merge it" with the blocking section format scrub output file from #1 above also!)
  • 3.) Storing my PREBUILT 11mb HOSTS file in another tab & memo field for save to disk overwriting ones folks have stored, as an option, for save to disk (either I will do it THIS way, OR, store it as a programmatic resource to extract, which I do in my APK Doctor Who ScreenSaver (w/ its .avi file it plays)), as a "CUSTOM HOSTS FILE" folks can use as a GREAT starter one for themselves, if need be (it's VERY complete/comprehensive).
-----



* Well, "looking @ the 'bright-side'" of this? @ least I got 1 thing accomplished... & out of the yardwork?? LOL, only the watering of the garden (but, the laundry's 'under way' now as I write this)...

APK

P.S.=> It's TRUE what they say about multitasking... nothing really ever gets done? Untrue... you will get things you planned getting done, some partially done (some not @ all), & maybe 1-3 of the total # of things done you want to, TOTALLY... so much for "to-do" lists eh? You never actually get them ALL completely done though - not enough hours in a day! apk
__________________
"I'm Reese: Sgt. TechComVN38416, assigned to protect you - You've been TARGETTED FOR TERMINATION!"

Last edited by APK; Jun 25, 2008 at 10:20pm.
APK is offline
Reply With Quote
View Public Profile Visit APK's homepage! Send a private message to APK
 
Reply
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search





All times are GMT -4. The time now is 08:15pm.

RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML


Copyright © 2006 - 2008 by The New Tech

vBulletin, Copyright © 2000-2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC5