Thread: Today !
View Single Post
Old Jun 26, 2008, 02:32pm
Default Re: Today ! "THE ENGINE IS 'NEARING COMPLETION', @ last"... apk
APK
APK's Avatar
Elite Member

Posts: 368
Name: The Duke of URL
Karma: APK will become famous soon enough
Today, I "knock the 2 of 3 slated tasks out", from my 2nd list below (since it's raining outside, & that means NO cutting the grass, OR, washing my car)!

Here is how it appears, thusfar:



-----

This program will {COPYRIGHT APK - Alexander Peter Kowalski 06/01/2008 onwards}:
  • 1.) Build you a CUSTOM HOSTS FILE that is in * THE * MOST EFFICIENT FORM THERE IS (0<singlespace>URL<cr+lf>) line-by-line format, so the file loads as FAST as possible (since it is tinier on disk, e.g.-> going from 127.0.0.1 to 0.0.0.0 alone? Well, I went from 19mb to 14mb - & THEN, in going from 0.0.0.0 to 0?? I went from 14mb to 11mb size on disk), AND also consumes the LEAST RAM in your local DNS cache...with NO repeat entries & alphabetically ordered.
  • 2.) It builds the CUSTOM HOSTS FILE that secures you vs. the threats on bad sites &/or adbanners out there too
  • 3.) Also, in addition to speeding up your websurfing (by NOT loading adbanners (again, especially malware infested ones) & such) - it will also optionally speed-up your fav. websites, by your hardcoding your fav sites into it, as far as IP to URL conversions - doing this, locally, is FAR faster than calling out to DNS servers (which can be poisoned, or "man-in-the-middle" attacked, too)).
  • 4.) It will graphically allow you to search thru a HOSTS FILES' listings (mine are done in alphabetically-arranged order, so if you choose to do them in notepad.exe even, it is simpler) in their "sites to block" list, for adding in new ones (or, it will reject them as already existing, preventing repeat entries, aiding further in "normalization" (lack of repeats)).
  • 5.) It will also, in BOTH the original list to process (on left) & in the "FINAL LIST" (on right) for save to disk, allow you to selectively remove elements in its lists, @ YOUR discretion, prior to saves to disk (easy to do, via rightclick on list popup menus)
-----

I took out the progressbar, it was a LOT of graphic & cpu overhead, vs. the simple text output of it noted above (what record it is comparing to the rest of the list dataset array, to remove repetitions for normalization)

PLUS, ProgressBar's properties (vs. listbox count, for total max array elements) no longer "meshes" w/ the code loop engine I redid (diff. than shown here earlier on last page now in fact, even BETTER!))...

THUS, THESE 2 TASKS * SHOULD * GET DONE, TODAY:

-----
  • 1.) 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!): ADDITIONALLY, this very thing, can secure you vs. DNS poisonings &/or "man-in-the-middle" attacks too!
  • 2.) 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).
-----

LEAVING ONLY THIS 1 TASK, REMAINING:

-----
  • 3.) 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!
-----

(And, this last remaining task? It's far from "impossible to do" (the base code is MOSTLY the same, repetitive, just diff. things to replace) - It's more just TIME-CONSUMING (in testing the data outputs is all - bit 'touchy'))...

-----

* Nicest part is, so far?

The dataset gets SMALLER each run, & thus, like a "TESLA TURBINE"? It gets MORE EFFICIENT, each iteration of the loop, the more data you "shove thru it"... This happens, because since each time it runs, it grows smaller (just "good physics", in its engine/algorithm, really)!

E.G.-> This test dataset run? Was operating @ 2005 records per minute (@ the start, mind you), & FAR faster once it passed the "midpoint" of the dataset/array in the lists above!

(Which I use (listbox controls) for "graphic debugging" (so I can literally SEE what is going on) as 'dynamic arrays', vs. non-gui arrays))

That is - for now: See, I know if I did this in charmode/DOS tty term mode, OR, using "true non-visible dynamic arrays"?? I would have literally 10x this speed (did already w/ sepulchre in this thread, showing him that optimization method)... but, nobody today wants console mode apps though!

(+, the more repeats there is? The FASTER it operates there, too - because as it vectors thru the array, it pulls HUGE swathes of repeats, & the more of them there is?? Faster she goes, because the dataset gets smaller by removing said repeats (during normalization - the process of removing repeats))!



(Heh, it's "ALL IN KEEPING WITH MY SIGNATURE" below, lol - this thing's like a dog (man's best friend) albeit online! To quote Reese from the film "THE TERMINATOR" - "Dogs... we use them to spot terminators..." & sometimes, imo @ least?? Dogs are BETTER PEOPLE, than people...)

APK

P.S.=> So far, since it is largely about string comparison, via math (which Delphi EXCELS @, more than 2-3x as fast as MSVB + MSVC++ even, in BOTH strings &/or math processing work)?

I am also using the VERY BEST & FASTEST language combination I know of for this type of work (Delphi 7.x optimized by hand AND compiler code, CPU priority assignments (optional), Win32 API code, & inline Assembler code)

-----

In fact, the last version of this program I did (circa 2002 or so)? Took me over 150++ lines to do what I am NOW doing, in under 20 lines of "active ingredient" code... pretty cool!

(That only tells ME, personally, that I have 'grown' (gotten better @ this stuff), since then in the past nearly 7 intervening years!)

Neat... THUS, programmatically/algorithmically? She's turning up JUST how I was hoping it would (i.e.-> pretty fairly "elegant" & efficient)... apk
Attached Images
File Type: jpg APKHostsFileRewriter4.jpg (93.7 KB, 34 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:54pm.
APK is offline
Reply With Quote
View Public Profile Visit APK's homepage! Send a private message to APK