Recent submissions

Comment · 7 years ago
It is impressive, but you can buy items (with the in-app currency you get from finishing lections) that allow you to skip single days (or even whole weekends, IIRC).
Comment · 9 years ago
... and "Merkle" trees, not "Merkel".
Comment · 9 years ago
> In Icelandic, a compass is a direction-shower, and a microscope a small-watcher.

I find this somehow very poignant :) What exactly does the author think "microscope" means? From Wikipedia:

> microscope (from the Ancient Greek: μικρός, mikrós, "small" and σκοπεῖν, skopeîn, "to look" or "see")

Comment · 10 years ago
> As far as I can tell, the network is trained on a specific geometry and must be re-trained if the geometry changes.

The model is trained on a "training set" of various 3D models, and tested on a "test set" of different 3D models. The network can generalize to other 3D models and does not need retraining (see e.g. last part of abstract).

I think what they mean is that they would need to retrain the model if the boundary conditions at the outer boundary of the "studio" (the simulation domain) changed.

Comment · 10 years ago
Comment · 10 years ago
If I just want to unpack a function's tuple result, I use "std::tie":

  tuple<int, bool, char> t = make_tuple(1, true, 'a');
  int  n = get<0>(t);
  bool b = get<1>(t);
  char c = get<2>(t);
can be written as

  int  n;
  bool b;
  char c;
  std::tie(n,b,c) = make_tuple(1, true, 'a');
This is not necessarily better or more dynamic, but at least it looks more pythonic (to me). One can even write

  std::tie(n,b,std::ignore) = make_tuple(1, true, 'a');
if not all results are needed!
Comment · 11 years ago
Good question :)

I needed a quick way to hack the output of 2D float data (pixel annotations to complement some image) into some legacy C without adding dependencies.

Thanks to CImg, I can read and display the PFM files in 10 lines of my own C++. I thought about just writing a width/height-annotated binary blob instead, but then realized that's really what PFM already is.

I have no idea if anything is really using PFM. I certainly have not found any "big" compatible programs.

Comment · 11 years ago
I've been using the PFM format (http://netpbm.sourceforge.net/doc/pfm.html) for a project recently.

It's the most obscure member of the Netpbm family. Almost no image viewer understands it, and no image editor can read or write it. Luckily there's the incredible CImg (http://www.cimg.eu/) lib.

PFM is stored in left to right, bottom to top order pixel. It has exactly one or three channels. One pixel is four bytes. There's an obscure "scale/endianness" parameter to tell you the byte order.

I love it, and I hate it.

Comment · 11 years ago
"It was a tool for me," Metcalf said. "Like Mom's hot skillet; don't stick your hand on it. Like Dad's power saw; don't stick your finger in it. A gun; don't stand in front of it."

I honestly do not understand how these things are comparable. A skillet is a tool for making food. It does not hurt or kill unless used incorrectly. A power saw is a tool for shaping useful objects. It does not hurt or kill unless used incorrectly. A gun is a tool for killing. Unless it is used incorrectly, it always destroys or hurts or kills.

Would you argue the same way about being allowed to carry mustard gas? Or smallpox? That the freedom to do so is worth more than the immense hurt it is guaranteed to bring on the world?

The U.S.' obsession with firearms is utterly beyond me (I am from Germany). Just my 2 cents.

Comment · 11 years ago
And for Android, there's "Twilight" :)

Wonderful tools

Comment · 12 years ago
------------------------------------------------------

  Did I ever tell you that Programmer McCave
  Had twenty-three variables and named them all `a`
   
  Well, the programmer did. And that wasn't a smart thing to do.
  You see, when the programmer wants to add `a` to 2
   
  The programmer doesn't get a number oh no no no
  All twenty-three `a`s cause a buffer overflow
   
  This makes things quite difficult at the McCaves'
  As you can imagine, with so many `a`s.
   
  And often the programmer wishes that, while coding,
  The programmer hadn't ignored that sense of foreboding
   
  And called one of them runCount, And one of them lastNum
  And one of them allSales and another roundSum
   
  And one of them lastId, and another userNames
  And one subnetMask, or numStartedGames
   
  Any old names would actually do
  even if they were just `bar` or `foo`
   
  And adding hyphens or humble underscores
  The programmer could have come up with so many more!
   
  Like read_app_config_from_this_file_name
  But no, the programmer went and called them all the same
   
  If only the programmer hadn't given into the hype
  And used a language strongly typed
   
  The programmer would have avoided this horrible fate
  But didn't and so now it's too late. 
------------------------------------------------------

There, FTFY. People will still think the programmer is a male, but now it's their own damn bias at fault :)

Comment · 12 years ago
Ah, good call, thanks!

I now think we both got it wrong (but me more so than you): Table 2 specifies "1 min/frame", but the source frame selection happens for output frames, not input frames. Table 1 lists a total of 2189 output frames for the 23700 input frames of the "BIKE 3" sequence, so I guess we're looking at 2189 minutes?

Correct me if I misread anything. Again.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton