HN user

zigzigzag

1,415 karma
Posts0
Comments563
View on HN
No posts found.

And how about if the vote had been phrased as "do you wish to remain in the EU", with a 2/3rd requirement to meet the bar, meaning 1/3rd was sufficient to trigger Brexit? Would that have seemed fair?

Democracy evolved as a shortcut to avoid fights. Just count and you got a rough idea of which side has the most people and thus, is more likely to win if it came down to it. Once you start tipping the threshold in order to bias things towards your preferred decisions, you increase the risk of the losing side thinking ... wait a minute. We could win this. That's far worse than any other outcome.

The EU and its supporters constantly warp the system to try and make it hard for people to leave, hard for the people to reject their policies. It is fundamentally undemocratic.

To not only use UTF-8 as the internal string encoding but practically mandate it, if you want to remain safe.

UTF-8 is a fine transport format, but for raw runtime performance it's obviously going to be an issue if you ever need to iterate over characters, do substring matches, things like that because you can't do constant time "next char" or indexing.

UTF-16 doesn't let you do that either in the presence of combining characters, but they're pretty rare and for many operations it doesn't really matter.

That seems like a really unfortunate design decision. I used to think that Java's use of UTF-16 for strings was just a problematic legacy thing, but compared to this it seems quite good. Strings are pretty high performance and there are no complex calculations to do indexing or bounds checks. And in Java 9 the JVM can switch between UTF-16 or Latin1 encodings on the fly, which both uses less RAM and speeds things up simultaneously. There are no memory safety issues caused by character encodings.

The direction of the nation is decided by less than a majority in every vote. So why would this one in particular require "special measures"?

I think what you're getting at here is you support the EU, so would prefer if attempts to leave it or defy it were harder to implement than normal decisions.

But are you roaming in those places? For reasons I don't understand fully but are presumably billing related your IP traffic gets tunnelled back to your home ISP when roaming, or at least, it used to.

The problem with insisting on roundness, which has been a focus of the education system for years, is that it generates tons of generic shapeless people who specialise in nothing and find themselves unable to obtain the best, high paying jobs.

In my family, myself and my brother have been successful by focusing on one or two skills and honing them. That was made much harder by the education system, which fought us the whole way, because it sees specialisation as some sort of problem when it is in fact the solution. In my brother's case the school tried to insist he went to university. He didn't, as he knew full well what he wanted to do and reckoned, correctly, he would do better without being a student. In my case the university insisted that I take non-CS classes despite that I was paying them for a CS course. The classes were interesting, but marked arbitrarily (i.e. one essay at the end and who knows how it's evaluated?). I nearly got kicked out of CS because of a single essay written on archaeology!

As I go through life, I constantly encounter people who thought they were "learning how to learn" or "learning how to think" when they went to university, only to discover after graduation that they had no particular skills and were seem as essentially worthless by the job market. It's tremendously depressing for them and creates constant, lifelong insecurity.

Critical thinking abilities are something you want on top but are not a substitute for actual, hard skills. And they are certainly not something a university can teach - please. All the stats and studies show that universities are incredibly ideologically homogenous and rapidly stamp out any political thought that deviates from their left wing consensus. Universities teach people that thinking and disagreement are dangerous, that opinions are "triggering", and speaking out loud leads to exclusion. They're the last place on earth I'd expect critical thinking skills to emerge unscathed.

You're comparing the UK to the USA there and assuming the USA is saner.

The origin of the USA's prohibition against self-incrimination was people who were tortured into confessions and other forms of undermining their own freedom. The original logic for this right does not apply to divulging encryption keys. It's not clear what higher purpose is being served by allowing people under investigation to halt those investigations by using encryption: it's not like they can be tortured into revealing incorrect information inside the encrypted files.

I've never liked May's authoritarian tendencies - no way does that stuff remain restricted to targeting Islamism - but your last paragraph is in fact exactly what they are doing.

Having asked the question of "why do they want to kill random strangers", the answer they arrived at is "because they were brainwashed by religious fundamentalism they found on the internet".

Obviously nobody knows yet the specifics of this case, but I'm not sure why they think that given that the Ariane Grande event seemed to be radicalisation through family. It wasn't clear the internet played much role.

However, the UK Government has made repeated references to plots that were foiled (no details provided). If those plots were investigated and the root cause was frequently identified as "spent too much time surfing jihadi ideology" then I can see why they'd conclude the answer is internet regulation.

They did that. It was the first iteration.

The problem is that - as described above - many websites use ads from multiple networks, so actually even if you paid, most ads did not disappear. It was more or less random. Also, it turns out ads make sites a lot of money (who knew), so to get even that sketchy coverage required you to pay a LOT.

I know for a fact mine weren't, because the profs tended to tell us so. Also, many of the academics could barely code themselves. Instead they found creative ways to set mark schemes such that the code didn't matter, even for programming assignments.

I seem to recall that in prior HN stories about CRISPR some poster was saying he believed CRISPR didn't work the way people thought it worked. He said it was simply killing cells that didn't have the desired mutation and biologists weren't realising that because of design errors in the experiments (or rather, sometimes mass cell dieoffs were being reported but not dwelled upon).

If CRISPR isn't actually editing the DNA but rather just selecting natural mutants that happen to have the desired edit, would that cause what's seen here?

That's completely wrong I'm afraid. ART is a standards compliant JVM and Android has supported the native development kit (NDK) for C/C++ apps for years. You can't do everything you can with the Java APIs, but you can open windows and get a GL context with it, which is all most games care about.

The speed of Java is very dependent on the sophistication of the compilers used. Java will walk all over Objective-C if run on a fast server class machine with an advanced JVM like HotSpot.

Well, I hope we're not getting sentimental about Win16. I've written more than my fair share of Windows API code and even though some of the concepts are now coming back into fashion again, largely due to the limits of browser engines, it really isn't an era I'd return to at all. Those models were all abandoned for solid reasons and Apple's failure to do so in time nearly killed the company.

I'm not sure your description of COM is quite right. The way I remember it, windows (HWNDS) were and still are objects with thread affinity. COM had the notion of a "single threaded apartment" which basically meant the COM server received RPCs using regular Window messages, and the MTA that you mention simply meant no inter-thread marshalling was done at all i.e. the object was inherently thread safe using locks or whatever. But Windows never changed to a model where the controls library was thread safe: changing the contents of an edit box from another thread, for instance, always required a context switch.

COM's usage and abusage of the window message system for fast inter-thread switching was only ever an ugly hack, which caused all kinds of weird problems and glitches. Most obviously it caused Windows' reliance on actually having a GUI layer to deepen considerably because now inter-thread/inter-process RPC - that on Linux and MacOS were well modularised into things like Mach IPC, SunRPC, DBUS etc - were totally tied to the windowing system.

IIRC the entire apartment concept was also stupidly designed, so there were constant problems with Microsoft using COM internally to implement some APIs, which would by default enter an STA and require the _caller_ of the API to pump the message queue otherwise the API they'd just used would silently fail to work. In the era I was working with it that fact wasn't always properly documented, I think.

There is/was an extension that did that at some point, but it was never used (on Linux) due to poor implementation and a desire to target low RAM machines. Mac's backing store implementation was quite heavily optimised - macOS can do on the fly memory compression and the window server uses shared memory to obtain the window bitmaps.

I found the article a little confusing to be honest. I wonder if the author has written a traditional widget toolkit that isn't Firefox oriented.

In old widget toolkits, going back to the 90s here, there was a single UI thread per app that did all drawing and sending of commands to the graphics hardware. Keeping the UI responsive on such toolkits simply meant doing things as much as possible in the background. Touching the UI data structures from other threads was forbidden.

This architecture was adopted due to painful experiences with attempts to build thread-safe toolkits in the 80s such as Motif and the original Win32 widget library. None of it worked very well. Motif apps tended to be deadlock prone and Win32 was just a total API nightmare because it tried to hide the thread affinity of the underlying widgets, but didn't do a good job of it.

Some systems in the 90s like NeXT and BeOS started experimenting with moving the rendering into a separate process, the window server. Note that X Windows, despite having a window server, did not use "retained mode" rendering and still required the app to respond to do every repaint such as if an occluded window was moved to the top. Systems with this sort of retained mode rendering pushed "draw lists" into the window server so the OS could draw the window from memory without having to wait for the app to respond. This used more memory but meant that overall window UI stayed responsive and fluid even if apps were under heavy load. However, anything that could change the UI like needing to respond to user input, of course stayed in the app and on the UI thread.

MacOS X introduced a variant of the design, which I know less about, but I believe it basically just stored fully rendered copies of the image. Very RAM intensive and one reason MacOS X was considered very slow and heavy in the early days, but it made it possible to do things like the genie effect and exposé later on where the window server could animate the contents of windows without the app needing to be responding.

All that is OS level compositing. The app itself did not do any asynchronous compositing. So dragging windows around was fast, but animations inside the app didn't benefit.

So the next level of asynchronicity is toolkits that push app level rendering into a separate thread too. iOS, JavaFX, modern versions of Qt and modern versions of Android work this way. In these toolkits, the app's GUI is still constructed and manipulated on the primary/UI thread, but when the main thread "renders" the UI, it doesn't directly draw it, it constructs a set of draw lists for the apps own use. Again, these draw lists look a bit like this:

1. Clear this area of the window to this colour.

2. Draw a gradient fill from here to there.

3. Draw texture id 1234 with that shader at these coordinates, at 50% opacity.

4. Invoke remembered draw list 111.

5. Remember this set of instructions as draw list 222.

Once these lists are created they're handed off to a dedicated render thread which starts processing them and turning them into commands to the GPU via an API like OpenGL or Direct3D. Note that these APIs are, in turn, simply creating buffers of commands, which eventually get dispatched to the GPU hardware for actual rendering. Because the render thread doesn't run any callbacks into app code, and because it's cooperating with the GPU hardware to remember and cache things, it doesn't have that much actual work to do and can process simple animations very fast and reliably.

However, responding to user input is still done on the main thread. If you block the main thread, your UI will continue to repaint and may exhibit simple behaviours like hover animations, but actually clicking buttons won't work. That's because the most common thing to do in response to user input is change the UI itself in some way, and that must still be done on the main thread.

I hope that helps.

I looked there. It doesn't explain anything beyond mentioning that the exploit involves heap manipulation.

The Metasploit eternalblue module simply runs an interpreter for a long set of commands that send massive binary blobs over the wire in a particular sequence. To me this looks like a cleaned up WireShark trace rather than anything based on true understanding of what it really does. As far as I can tell the only people who understand what these packets are doing to Windows are TAO and probably one or two developers at Microsoft.

Yes they did. Nobody so far has posted a reverse engineering of exactly how EternalBlue works (I saw an article in Chinese but it was hard to tell if it had a real explanation given the auto-translate). WannaCry is simply using the actual NSA exploits, compiled, direct from the ShadowBrokers leaks, along with the DOUBLEPULSAR "implant".

What I don't get is how Chinese people don't already know this. I know nothing about fighting at all but from the article and the comments on the NYTimes site it seems it's common knowledge in the west that MMA fighters always win against other styles, it's practically scientific fact. Does the government censor information about martial arts too, or what's going on here? How can so many Chinese people be ignorant of the basic facts of fighting that seeing a fight of the kind that has been happening for decades causes some scandal?

That's the thing we should be discussing here. Not martial arts, but how such an asymmetry in information came about.