Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×

Comment Re:Maybe (Score 1) 381

AvE is fuckin hilarious, I wish he had a software engineer twin brother to do similar videos on the software side of things. I've learned a lot from AvE and I appreciate how he's never shy to tell you when he has no clue what he's actually talking about. Just the way it's presented makes me want to go learn more on the subject rather than being overwhelmed or bored by the initial introduction. He's the engineer you want to drink with!

Comment Re: Tesla builds shit cars (Score 4, Insightful) 146

You think that's bad, take a look at the even more exclusive sports and super cars. Ferraris with plastics that melt and become sticky after a few years, spontanious combustion, McLarens with door sensors that only work half the time, Lotuses with giant panel gaps. For a lot of these cars price is not proportional to build quality or reliability. You're paying for an experience or an image. Being able to hear the engine note of a flat plane crank V8 is well worth the cost of entry for many people, for others it's entry in to the club of ownership. Having to take the car to the garage every third drive is just part of the supercar ownership experience. Many of these cars are so mechanically high strung that they require absolutely insane maintenance schedules anyway. It's not such a huge deal to replace a few interior parts or electronic doodads when you have to take it in for a whole goddamn engine out regular major service.

Many of these problems have lessened in recent years, the build quality of these cars in the 70's through the 90's was absolutely laughable. I'm not saying its acceptable, just that is how it is. Even the Viper's domestic competitor, the Corvette has had similar issues, even in recent years, see C7 Z06 heat soak issues.

Comment Re:The FINAL "deathblow" VCL threadsafety (Score 1) 133

What if someone want's to minimize your program while it is processing? What if someone want's to move it to a different monitor while they do some other work? What if they want to close it? They can't, because you're not processing any redraw events or anything while you're working on your list! In this case it doesn't matter if Application.ProcessMessages drops events or not, it's a hack to keep your UI somewhat responsive to the window manager.

As far as the VCL not being threadsafe, that is correct, however I don't think you understand what that means. All UI updates should be handled from the main thread, which is why you do the processing in a background thread and use TThread.Synchronize to update the UI.

RTFM:
http://docwiki.embarcadero.com/Libraries/Seattle/en/System.Classes.TThread.Synchronize

Using a few cpu cycles to update your UI and process messages from the window manager isn't bad practice, it's good design. Accuracy over speed is just a silly argument, computers don't make mistakes, programmers do. The fact that you are throwing a tantrum over this tells me writing a "Host Files Engine" is most likely the biggest project you have ever worked on. I don't care if a few people on Slashdot use your program or that MalwareBytes says it is safe, I'm glad your decade of spamming, stalking, and trolling has paid off.

If anyone is interested in using a large host file to block ads I recommend checking out StevenBlack's unified host file on GitHub. It's written in what APK calls a "slow interperted language", but somehow it's still faster than his shitty Delphi app!
https://github.com/StevenBlack/hosts

Comment Re:Real /.'ers disagree (want more?) (Score 1) 133

The hourglass is meaningless when Windows has marked the program as non-responsive. If a program is stuck in an infinite loop it will show an hourglass too, how is a user going to know the difference? When I see a program labeled as "Not Responding" I give it a few seconds to sort itself out and then I force kill it. This has been a solved problem for decades now, it's terrible user interface design, and it points to piss poor coding internally.

Do better then talk? Here is the code to deduplicate a TStringList while updating a progress bar and preventing your app from being labeled as non-responsive:

    OrigStringList.LoadFromFile('names.txt');
    DedupStringList.Sorted := True;
    DedupStringList.Duplicates := dupIgnore;
    for i := 0 to OrigStringList.Count - 1 do
    begin
            DedupStringList.Add(OrigStringList[i]);
            if i mod 1000 = 0 then
            begin
                  ProgressBar1.StepIt;
                  Application.ProcessMessages;
            end;
    end;

Brain dead simple, tested on a Pentium Dual Core T4500 laptop with 2GB of memory, sample data set was 250 unique first and last names randomly distributed over 6,000,000 entries creating an 84 MB text file. In a simple console application, the file was loaded to OrigStringList and deduplicated by transferring the to another TStringList with TStringList.Duplicates set to dupIgnore using TStringList.AddStrings(). This took 43 seconds and resulted in DedupStringList containing the original 250 unique strings. For the next test the same dataset was used in a graphical application using the code above to deduplicate the list. It took 46 seconds to process, updated the progress bar, and the application remained responsive allowing the window to be moved, minimized and maximized, as was not labelled "Not Responding" by the Task Manager. That can be further spread up by increasing the number of iterations between calls to Application.ProcessMessages and how often the progress bar is updated, that can be adjusted to the number of entries be processed, the type of progress bar being updated, etc etc. Using this method you'll want to either disable the form, or better yet, disable the individual controls that you don't want users clicking during the processing. You'll definitely want to disable the De-Deplicate button to prevent inpatient users from clicking it multiple times and stuffing the message queue.

That's the Amateur Hour was of doing this, all simple intrinsic methods and minimal work on your part and still performant enough. Especially as you advertise your program as being "multi-threaded" it is just embarrassing that your UI locks during processing. That leads me to the better method, doing your processing in a background thread and updating your UI with TThread.Synchronize, but the above method is good enough for a simple list processing app. Your app ran on my desktop, an Intel i7 4790 with 16GB memory and was still not responding after MINUTES of processing. This is absolutely ridiculously under-performant when we're talking about megabytes of data, even with fancy Delphi string processing. You constantly harp on the speed of in-browser ad blocking, so ask yourself this: if these extensions (which I believe are written in JavaScript!) can run through their blacklists on every page load in seconds, if they can install and update their lists in seconds, how come your app can't process a few million entries is less than five minutes using native code? The answer is very basic knowledge of data structures and algorithms on behalf of the developers.

Comment Re: calixit (Score 3, Interesting) 1368

West Virginia separated from a confederate state. It's was definitely a bizarre situation since the Union didn't recognize the confederacy as a legitimate government. I suspect it was simply the pragmatic choice to take territory from a hostile state and a fuck you to Virginia. I hope someone more knowledgeable in civil war history can chime in with some more details. In my opinion, it's a different time and a vastly different situation, and I don't think our incoming government would be too eager to add more blue states to the Union!

Comment Re: you never know (Score 1) 134

If you're talking about the Waukesha, WI case, the girl actually survived even though she was stabbed 19 times. Being from the area, it wasn't surprising. Most of the people around there practically get their news from internet memes. Ask any random stranger in a gas station here what stood out the most from the incident, they'll say, "It's really scary that Slenderman is still out on the streets".

Comment Re:Prison Locations Are Secret? (Score 1) 143

Perhaps they'd have an issue with drones being used to study building structure and movement at the prison? In the US at least, our prisons are fully visible from Google maps, I'm sure it's probably the same in the UK, but using a drone one could get a lot better idea of what's going on at the prison. What time the prisoners go to the yard, perimeter guard locations, different inmate cell locations, etc. All of this is not only useful to people dropping contraband in to the prison, but also anyone on the outside who may be assisting prisoners with escape plans.

Slashdot Top Deals

"Ninety percent of baseball is half mental." -- Yogi Berra

Working...