News for hackers. Stuff that matters.

mockery

Re:Cosine Implementation in C on Friday March 31, 2023 @10:58AM (#35388098)
Can someone shed light on these two steps in the approximation?

  *         since cos(x+y) ~ cos(x) - sin(x)*y
  *                        ~ cos(x) - x*y,
For the first, maybe it's an approximate identity I'd never heard of?

For the second, it seems like it relies on X being small, but in this code... Y might be small enough for sin==identity approximation, but X isn't, is it?

Re:Zelda: A Link to the Past (SNES) re-implemented in C on Tuesday January 31, 2023 @10:30AM (#34596311)
SongTable won’t compile (on any modern compiler) because the number of initializers (36) doesn’t match the declaration (32)
Re:Why is Rosetta 2 fast? on Wednesday November 09, 2022 @01:06PM (#33535508)
In addition to the sibling comments, one simple opportunity available to a JIT and not AOT is 100% confidence about the target hardware and its capabilities.

For example AOT compilation often has to account for the possibility that the target machine might not have certain instructions - like SSE/AVX vector ops, and emit both SSE and non-SSE versions of a codepath with, say, a branch to pick the appropriate one dynamically.

Whereas a JIT knows what hardware it's running on - it doesn't have to worry about any other CPUs.

Re:Postgres WASM on Monday October 03, 2022 @01:39PM (#33070946)
Thanks, those are specific requirements I could definitely see WASM struggling to meet.

In my experience in a large+mature enough codebase (particularly one that is already multi-platform, like Postgres appears to be) many of those requirements are wrapped in an abstraction layer to allow targeting new platforms, but some requirements (like memory mapping) could definitely be dealbreakers if the target platform doesn't naturally support them.

This solution still seems awfully complex (and probably not very efficient) but I certainly see why it's probably the "easiest" option.

Re:Postgres WASM on Monday October 03, 2022 @11:19AM (#33068738)
The first thing to point out is that our implementation isn't pure WASM. We attempted to compile Postgres for WASM directly from source, but it was more complicated that we anticipated.

Crunchy's HN post provided some hints about the approach they took, which was to virtualize a machine in the browser. We pursued this strategy too, settling on v86 which emulates an x86-compatible CPU and hardware in the browser.

I’m out-of-domain but very curious about this part - it seems like a pretty extreme solution with a lot of possible downsides. Does this mean the “just compile native code to WASM” goal is still far off?

Re:The Balloon Learning Environment on Monday April 25, 2022 @11:53AM (#31156634)
The word expert is not being used in the colloquial sense, but in the technical sense of an "Expert System": https://en.wikipedia.org/wiki/Expert_system
Re:The bottom is dropping out of Netflix on Friday April 22, 2022 @01:22PM (#31124844)
So if I make a new, identical copy of a GPL'ed codebase - should I feel free to use it for whatever purpose I want and ignore the GPL?
Re:Play Half-Life in the Browser on Wednesday March 09, 2022 @10:13AM (#30615283)
The full game isn't playable on that page. I believe all three sets of assets (HLDM, Uplink, Hazard Course) are from demos or free products.

Making the full game playable would probably be less OK.

Re:CXX-Qt: Safe Rust bindings for Qt on Wednesday March 02, 2022 @12:55PM (#30530374)
It's totally reasonable to lament duplicated effort, but it's worth pointing out that this particular attempt is from a company[0] whose business is Qt consulting - so it's easy to imagine that they might succeed (due to expertise, size, and motivation) where others have not.

The post also explains why they started from scratch vs. existing approaches - I'm not qualified to evaluate the claims, but I think they deserve some credit for explicitly talking through their reasons.

[0] https://www.kdab.com/

Re:Should You Kill the Fat Man? on Saturday February 12, 2022 @07:47PM (#30317937)
I think GP is reacting to the word "obligation" (I certainly did.)

I'd claim there are actions that may be "morally justifiable" yet not raise to a level that creates a "moral obligation." The word "obligation" implies (to me at least) some sort of guilt or culpability if you don't undertake the action.

In fact my instinct is that most morally justifiable actions aren't weighty enough to be obligations. Consider any "morally neutral" action (for example, eating an apple instead of an orange for a snack) - I would label such an action "morally justifiable" (since applying the rules of morality does not argue against it) but it's certainly not a "moral obligation" (even ignoring the fact that the alternative is also morally justifiable!)

You could perhaps argue there is no such thing as a "truly neutral" action to an omniscient observer, who can measure and predict the impact on total human happiness of any action with certainty. Such an individual would indeed have a much more restrictive set of "morally justifiable" actions available to them - fortunately we mortals aren't burdened with that level of insight or certainty!

Re:Landing a new syscall, part 1: What is futex? on Wednesday February 09, 2022 @10:24AM (#30273663)
Not GP, but the code in the article passes 'unsigned int mutex' by-value, and then operates on its address (which will potentially be at a different stack address on each invocation, and will certainly be different for different threads.) It won't serve its purpose at all.

To my eye, the code is fundamentally broken in a way that's surprising for an article trying to teach threading, and it's likely confuse someone unfamiliar with these concepts.

Re:Prime Video Uses WebAssembly on Friday January 28, 2022 @10:46AM (#30116071)
Perhaps confusingly, the term "immediate mode GUI" usually describes an API style. NOT an implementation detail.

It suggests a particular implementation, but in practice most nontrivial "immediate mode" GUI libraries (including egui [1] and the famous Dear-IMGUI [2] [3] ) retain some "shadow state" between frames. The existence or scope of that state is a (sometimes-leaky) implementation detail that shouldn't distract from the fact that the API presented is still "immediate mode."

[1] https://github.com/emilk/egui#ids

[2] https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#q-a...

[3] https://github.com/ocornut/imgui/wiki/About-the-IMGUI-paradi...

It seems like the brownout should be publicized on the front page of github.com - or at least githubstatus.com ?

(Although I'm not an active git/github user, so maybe there's an even more more obvious place a naive user having issues would go to figure out what their problem is. Hopefully there's a helpful commandline error explaining the situation.)

> Education is insanely overfunded

Can you cite a source for that claim? Genuinely curious, because I don't know if I've ever heard someone suggest it. (Conversely, the idea that education is substantially underfunded is generally assumed - at least in my bubble.)

Re:Mapping Perlin Noise to Angles on Monday July 12, 2021 @11:30AM (#27811282)
Variations on the Bridson paper you linked are commonly implemented in games and graphics circles under the name "Curl Noise" - for example Houdini[1] or Unity[2]

Google that term for many examples, but [3] looks like a good starting point.

[1] https://www.sidefx.com/docs/houdini/nodes/vop/curlnoise.html

[2] https://docs.unity3d.com/Packages/com.unity.visualeffectgrap...

[3] http://petewerner.blogspot.com/2015/02/intro-to-curl-noise.h...

Re:PSD is not my favourite file format (2009) on Thursday January 28, 2021 @09:40PM (#25953030)
Perhaps, but it's quite convenient for any software that wants to ingest PSD files without the (nigh-intractable) challenge of reimplementing the entirety of Photoshop's parser and rendering systems!
Re:PSD is not my favourite file format (2009) on Thursday January 28, 2021 @05:21PM (#25950265)
Most* PSD files contain a "preview" copy of the fully-flattened document (which is compressed.) Flat white image compresses far better, so that portion of the file doesn't take as much space.

Depending on what your layers look like (how many, how much they cover, etc.) it's not too surprising that the preview image could take a substantial fraction of the total file size (sounds like ~20% in this case!)

* I believe this behavior can be toggled off with an option.

Re:Tether price manipulation on Friday January 08, 2021 @10:56AM (#25685912)
Seems to me like you're tacitly agreeing with GP here - you're just making a claim about which currency system you trust more! (And attempting to convince others of the same position.)
Re:Raytracing won't simplify AAA real-time rendering on Monday December 28, 2020 @02:02PM (#25562078)
Using GP's definition: "custom" engines -- i.e. engines that are not provided commercially by third parties it's pretty easy to argue Fortnite also uses a "custom" engine. (And that's not pedantry - they obviously have knowledge and access that no licensee could dream of.)

That said, tere are a decent set of AAA games that license Unreal (PUBG, State of Decay, Borderlands series, Arkham series, XCom series) but it's rare among the absolute biggest titles ("AAAA" if you will.)

Re:Rehex – Reverse Engineers' Hex Editor on Friday November 13, 2020 @08:42PM (#25089568)
Yes! The 010 Editor's templating language is a nearly unique (in my experience) hybrid between C-like declarations and imperative flow that's exactly what I want for parsing arbitrary binary files.

The template executes like a script (with conditionals and looping) and a line like "int32 myNum;" is actually just syntactic sugar for "read 4 bytes from the current file pointer and label it myNum." Their example probably does a better job explaining it than I can:

  struct FILE {
      struct HEADER {
   char    type[4];
          int     version;
          ushort  numRecords;
      } header <bgcolor=cLtGray>;
  
      struct RECORD {
          int     employeeId;
          char    name[40];
          float salary;
          if( file.header.version > 1 )
              int      numChildren;
          if( file.header.version > 2 )
              time_t   birthDate;
      } record[ file.header.numRecords ];
  
  } file;
( From: https://www.sweetscape.com/010editor/templates.html )
Re:The Jim Roskind C/C++ Grammar (2018) on Friday October 09, 2020 @12:51PM (#24731814)
I've always seen it called "justified" alignment, which appears to be the common term: https://en.wikipedia.org/wiki/Typographic_alignment#Justifie...
Re:Dark Web Price Index 2020 on Tuesday July 14, 2020 @11:52AM (#23833369)
It's important to remember that "beyond a reasonable doubt" means exactly that: no "reasonable" person would doubt it. (The definition of reasonable is left to the jury.)

Some people seem to think "beyond a reasonable doubt" means the same as "beyond any shadow of a doubt" - but they are very different standards!

Where on Wikipedia did you see 1 in 50 for Spanish Flu? I'm seeing a much higher number: "an estimated 10% to 20% of those who were infected died' [1]

[1] https://en.wikipedia.org/wiki/Spanish_flu#Around_the_globe

I didn't read the parent post as using it that way - I believe they're saying that any claim that "supply chain security" (of videos) will combat deep fakes* isn't necessarily a credible model of security considering that the "real" supply chain (of physical goods) isn't apparently particularly secure.

I don't think I actually agree, however. Things like hashing and cryptography make me inclined to believe a digital 'chain of custody' is easier to prove and validate than a physical one.

( *I'd never heard this before, but it's an interesting claim )

Re:Codec2: A Whole Podcast on a Floppy Disk on Saturday June 23, 2018 @04:20PM (#17383238)
None of the audio samples play for me (In neither Chrome nor Edge... Other sites play just fine.)

Makes it very hard to evaluate claims of codec quality, which seems like the primary purpose of the blog post. :(

Re:Spectre and the end of langsec on Thursday January 11, 2018 @03:08PM (#16127329)
A mispredicted branch is incredibly likely to perform operations that would normally fault (consider misprediction of a null pointer check, for example...) I don't think it's feasible to have a (useful) version of speculative execution that can trigger a true fault, because the mispredicted branches are going to violate all sorts of software invariants.
Re:Announcing the New AWS Secret Region on Monday November 20, 2017 @08:44PM (#15744923)
"With the new AWS Secret Region, we are bringing the same tools and workflows that are already available for Top Secret workloads to customers with Secret datasets and workloads."

Does this mean they already had an AWS "Top Secret" Region?

Re:Chefs and Soldiers Make Good Product Managers on Thursday August 03, 2017 @10:11PM (#14925819)
Tangent: What's an XFN? (Google and Wikipedia don't seem to provide plausible answers, and I'm pretty sure you don't mean "XHTML Friends Network"...)
Re:Nuts and Bolts of Multithreaded Programming (2011) on Sunday July 02, 2017 @11:56PM (#14685732)
But GPUs aren't SIMD. (In some sense they're almost the opposite.)
By 'optical flow calculations' do you mean a linear extrapolation of the projected 'image-space' position of the ball?

If so, that seems like it would be insufficient since a thrown object doesn't move linearly, let alone its projection.

If not, then I'm curious what you're describing, and how it's much simpler than integrating an ODE?

Older »