Better HN
topnewbestaskshowjobs
Log inSign up

SloopJon

2,613 karma · joined Nov 15, 2013 (13y ago) · 775 submissions

Submissions

comment 5y ago · link · parent

> boost the frequencies as necessary

The trick is figuring out what's necessary. The first half of the post made me nervous, because it simply applied a gain of threshold - basedB. As he discovered, that's too loud.

What you want is a compressor. The second half of the post boosts the signal just above the threshold, but it's a little more complex than that. I haven't really studied this, but for starters you want to take into account things like the Fletcher-Munson curves.

I am intrigued by these types of projects. As my hearing gets worse, I'd like to be able to listen to music and watch movies with nice headphones, but with the assistance that comes from hearing aids.

comment 5y ago · link · parent

That's a slick cluster in a box. I'm not sure which modules I'd put on it, though. Unless you harvest them from the 2 GB dev kits, the total price pushes up against a single Jetson Xavier AGX, which is a better value (and has an M.2 slot for an SSD).

comment 5y ago · link · parent

I ported some null-heavy Java code to C++. The source frequently returns an object, or null in case of error; e.g.,

    BigInteger bi = rational.asBigInteger();
    if (bi != null) {
        ...
    }
One of the classes is essentially a node in a graph, so in my first pass its objects were wrapped in a shared_ptr, which can be null. However, objects of the other two types are typically passed by value in C++, so I had to think about that. Exactly what std::optional was designed for, but do I want to require C++17, both in the implementation and the public interface? The syntax looks nice enough:

    if (auto bi = rational.asBigInteger()) {
        ... // bi is like a non-null pointer
    }
Java has java.util.Optional, but the source predates Java 8.

TypeScript's type guard approach is really clever. Once you've checked the value, you can use it like normal. No need for a wrapper class, or different syntax.

comment 5y ago · link · parent

I don't know that I'd call it a "strange obsession," but it's a popular topic, right up there with intermittent fasting. Here are some active posts just from the last two or three months:

https://news.ycombinator.com/item?id=25289921

https://news.ycombinator.com/item?id=25261441

https://news.ycombinator.com/item?id=25113595

https://news.ycombinator.com/item?id=25077519

https://news.ycombinator.com/item?id=24912172

https://news.ycombinator.com/item?id=24768721

https://news.ycombinator.com/item?id=24734774

https://news.ycombinator.com/item?id=24607645

comment 5y ago · link · parent

For those who have glossed over the recent CentOS posts, because you don't really know what Stream is, or maybe didn't realize that Red Hat effectively owns CentOS now, this article is an accessible survey.

My question for the Rocky Linux team: if CentOS was struggling for resources before Red Hat's involvement in 2014, how is Rocky any better positioned to succeed?

comment 5y ago · link · parent

I somehow missed that Red Hat started sponsoring CentOS a while back, and owns the trademarks. I mean, money and cooperation is great and all, but how could anyone have expected CentOS Linux to continue for long when Red Hat has such a fundamental conflict of interest?

Edit: here's the HN post at the time:

https://news.ycombinator.com/item?id=7019914

comment 5y ago · link · parent

I totally agree. Code Complete was my road map to a new field, full of recommendations for other books to read. I gave away my first two copies of the first edition, and eventually bought the second edition. It didn't have the same magic. I've looked for it in other books, like The Pragmatic Programmer, The Practice of Programming, and others, but it's like The Sixth Sense (or The Crying Game or The Usual Suspects): you can only see it for the first time once.

comment 5y ago · link · parent

More cores is an obvious next step, but I'm curious to see how well Apple can scale the unified memory architecture. Can you put 32 cores (plus cache) and enough memory to keep them busy on a chip that retains the advantages of the M1?

Edit: answers to a similar question on the other thread suggest that it's NBD to move the memory off package.

https://news.ycombinator.com/item?id=25331710

comment 5y ago · link · parent

I have an Argon NEO:

https://www.argon40.com/argon-neo-raspberry-pi-4-case.html

It gets hot to the touch, so I presume that it's dissipating heat like it's supposed to.

comment 5y ago · link · parent

Yeah, min() returns the most negative int, so it seems like it should do the same for float. Then the float with the least magnitude could have been, say, smallest().

comment 5y ago · link · parent

I used intmax_t just yesterday in an ODBC type conversion test. I wrote a template for use in a Google Test typed test to find the highest and lowest values supported by the client and server type. Something like:

  max(
    static_cast<intmax_t>(
      numeric_limits<T>::lowest()),
    static_cast<intmax_t>(
      numeric_limits<U>::lowest()))
I tried std::common_type first, but it didn't quite do the trick.

comment 5y ago · link · parent

> > Long ago "modern" C++ crossed into a territory that I will never understand or use.

> Do you know where the line is? C++11? Later versions?

It's funny to read this, because I purposely avoided C++ for the better part of twenty years after dabbling with it in college--not worth it to deal with so much complexity. I've started using it in the last couple of years for work, and the modern part is what makes it bearable.

C++ is a big beast, so there is a cost to each new standard simply by virtue of adding features. However, the types of things I want to use in C++14 are pretty simple and worthwhile; e.g., better constexpr functions, and the _t aliases (like std::enable_if_t<>, rather than typename std::enable_if<>::type). Similarly, C++17 has a few new templates, like std::optional and yes, std::variant, along with ergonomic improvements like the _v aliases (like std::is_floating_point_v<>, rather than std::is_floating_point<>::value).

Now that the glacial pace of standardization has been replaced with a three-year cycle, I almost want something like LTS releases. I use C++11, and a bit of C++14, but when is it safe to use C++17 or C++20?

comment 5y ago · link · parent

Do I understand correctly that you cracked about half of the 12,000-iteration PBKDF2 hashes using a first-gen ThreadRipper and a GTX 1060, and would have cracked more except for a formatting problem in the hashes? That's eye opening.

Is Word Machine publicly available, or is it the sort of thing that has an audience of one?

comment 5y ago · link · parent

I read Gruber frequently even though he annoys me (he's sort of like John Dvorak that way), and this piece is kind of emblematic of why he does. To be clear, the ARM Macs are way more exciting than I expected, and I'll probably buy one at some point. I also do not think Moorhead's Fortune article was perfect, but Gruber's righteous indignation is grating.

These statements are pitted against each other, even though they are both very much true:

> emulating or translating apps ... is necessarily going to be ... somewhat incompatible at best ... But Apple’s Rosetta 2 ... is a technical marvel.

He's upset about this quote from Moorhead's review:

> there were some very positive things about the new laptop. The new M1 processor is impressive, but far from perfect — it has many warts

Moorhead perhaps punctuated this poorly, but I think it's reasonable to assume that the warts refer to "the new laptop" in general, not just "the new M1 processor" in particular. Yes, his problems are generally software related (although he cited fan noise as a complaint), but that's a huge part of the product. Lots of people would love to use an M1 Mac without macOS, including one particular Finn.

Gruber can say, "There is no 'Well, here’s the downside' with regard to the state of Apple Silicon," but that remains to be seen. How much of the M1's advantage is due to a trillion dollar company buying up every last bit of TSMC's 5nm production capacity? Can they scale the unified memory architecture much beyond 16 GB? If they can, great; they've truly lapped the field.

> There is no balance, if by balance, you’re looking for a story that says any PC hardware, ARM or x86, is competitive in any way with the M1 Macs for low-energy computing.

This review wasn't about "low-energy computing." It was about using a new Mac as a replacement for an old Mac. This is a real, shipping product, not a beta. You can snicker at Moorhead's Microsoft-centric workflow and choice of apps., but that's his perspective.

comment 5y ago · link · parent

It's hard to discuss in the abstract, especially with bad names like MinorFunction1() and MinorFunction2(). In style C, you may have to scan over lower levels of abstraction than you care about:

  MajorFunction() {
    // fast inverse square root
    float x2 = number * 0.5F;
    float y = number;
    // several more lines of code

    // find decimal point
    char *c = input;
    while (*c && *c != '.')
      ++c;
  }
A goal of style A or B is for the names of the minor functions to make the shape more obvious, ideally self documenting:

  MajorFunction() {
    y = Q_rsqrt(number);

    char *c = strchr(input, '.');
  }
This is the kind of advice you'll find in, say, Code Complete. Although I generally accept the premise, there is a readability cost to indirection. The bigger and more complex MinorFunction() is, the more likely I'm going to have to jump into it and remind myself what it does.

There are two concepts that underlie DRY: coupling and cohesion. There are good expositions on this in old writings on structured programming and design (e.g., Yourdon and Constantine). If MinorFunction() is cohesive, and MajorFunction() is appropriately coupled to MinorFunction(), then style A/B is likely to be superior to style C. One of Carmack's points is that "very little of our real code" ends up that way.

comment 6y ago · link · parent

I've been noodling with Hans Boehm's constructive reals package since the "Toward an API for the Real Numbers" post:

https://news.ycombinator.com/item?id=24700705

The Android calculator app. got some nice usability improvements by using a combination of rationals, as described in this story, and recursive (aka constructive or computable) reals.

A previous post on Microsoft's calculator brought my attention to an old package it uses called Ratpack (aka ratpak), another implementation of rationals:

https://news.ycombinator.com/item?id=19321217

It has some nice properties for use in a calculator, but it can be quite slow.

When I come across a library with, shall we say, an exotic numeric representation, it's nice to have a library of mathematical functions included. I see that python-cf indeed includes a solid batch.

comment 6y ago · link · parent

In Python 2, int and long were separate types, where int was either a 32- or 64-bit signed integer, and long was arbitrary precision. Python 3 unified the types under the name int:

https://www.python.org/dev/peps/pep-0237/

This was a nice enhancement with very few drawbacks, but I can see how it wouldn't necessarily be appropriate in Go.

comment 6y ago · link · parent

Although the source for the fourth edition is not available, the man page for the ctime(3) library function is:

https://minnie.tuhs.org/cgi-bin/utree.pl?file=V4/man/man3/ct...

It confirms that the day of the month element was one based. This function is different in earlier editions:

https://minnie.tuhs.org/cgi-bin/utree.pl?file=V3/man/man3/ct...

https://minnie.tuhs.org/cgi-bin/utree.pl?file=V1/man/man3/ct...

comment 6y ago · link · parent

> Apple did not promise anything wrt. 3rd party apps

Of course they did: "With the introduction of Rosetta 2, M1 and macOS Big Sur seamlessly run apps that haven't yet transitioned to Universal versions. So without updating, you can keep working on Fusion360 projects or reach the next level in your favorite game."

Rosetta 2 (and Rosetta before it) may be an amazing technical accomplishment, but it's entirely fair for a reviewer to say it doesn't cut it for him. As funny as some of his choices are (Edge on a Mac, on purpose?), he's not reaching; this is what he uses everyday. It's also fair to point out that if your favorite game doesn't happen to be Rise of the Tomb Raider, your mileage may vary.

I think the reviewer is a little unfair in his emphasis on "Apple-chosen" reviewers, but this frankly is the kind of thing I look for. Five-star reviews are rarely as useful to me as three-star reviews.

comment 6y ago · link · parent

For those who read the comments before the article, the initial batch of comments are burying the lede:

> The new tensorflow_macos fork of TensorFlow 2.4 leverages ML Compute to enable machine learning libraries to take full advantage of not only the CPU, but also the GPU in both M1- and Intel-powered Macs for dramatically faster training performance.

This isn't about being locked in to some Apple framework. TensorFlow for Mac is accelerated again. (As Gruber likes to say: finally!)

comment 6y ago · link · parent

Surrogates are technically a UTF-16 only thing. Realizing that sometimes they nevertheless escape out into the wild, WTF-8 defines a superset of UTF-8 that encodes them:

https://simonsapin.github.io/wtf-8/

To be clear, this is not an official Unicode spec. It's a hack (albeit a pretty natural and obvious one) to deal with systems that don't do Unicode quite right.

I recently came across some old code that narrows wchar_t to UCS-2 by zeroing out the high-order bytes. Even though my test was careful not to generate any surrogates in the input, they showed up in the output when a randomly generated code point like U+1DF7C was mangled into U+DF7C.

A corrupted value like that is not necessarily a great example of something you want to preserve, but it's the sort of thing that late 90s code assumed about Unicode.

comment 6y ago · link · parent

Indeed, the author writes of the captain she worked for:

> Originally from Connecticut, she worked one summer on a whale-watching boat in Bar Harbor, saw the lobstermen, and thought: I want to do that, that looks real.

comment 6y ago · link · parent

One of my round tuit projects is to set up a Snow Leopard VM to run PowerPC apps. with Rosetta, and a Mojave VM to run 32-bit Intel apps.

comment 6y ago · link · parent

Note that .NET 5.0 is not an LTS release:

> .NET 5.0 is a current release. That means that it will be supported for three months after .NET 6.0 is released. As a result, we expect to support .NET 5.0 through the middle of February 2022. .NET 6.0 will be an LTS release and will be supported for three years, just like .NET Core 3.1.

comment 6y ago · link · parent

Here's a page to download Linux binaries:

https://developer.amd.com/amd-aocl/amd-math-library-libm/

The license there looks much less friendly than the 3-clause BSD on Github.

I was unable to build this on macOS 10.13, because "aliases are not supported on darwin".

I'm curious to see the tests, which have not been checked in yet. There was a story a month ago about the Android calculator's library, and how it is used to test java.lang.Math:

https://news.ycombinator.com/item?id=24700705

I wonder what this library's accuracy tests look like.

I'm also curious, of course, to see what kind of performance difference there is. An old post by Agner Fog shows an 85% reduction in run time relative to glibc on AMD hardware:

https://www.agner.org/optimize/blog/read.php?i=209

comment 6y ago · link · parent

That actually wasn't true when I bought a Canon MG6000-something. When the price of the printer went below the price of ink, I bought a second one and stuck it in the attic, which came in handy when the first one died. Both printers came with standard ink cartridges.

The HP laser printer I bought recently, on the other hand, did come with starter cartridges with a smaller amount of toner. My impression is that starter cartridges are more common with toner than ink.

comment 6y ago · link · parent

If I understand correctly, it's a printf-style function for which the %g format code outputs the shortest decimal string that round trips. This implies that it would output no more than seventeen significant figures, regardless of the requested precision.

The first thing I notice is this comment in a later changelog:

> I believe we have a very fast numerical conversion that appears to be reliably generating about 15 to 16 digits out output [last digit may be off by 1 or 2 in typical case].

If the last digit of a fifteen- to sixteen-digit output is off by one or two, are we sure it round trips?

Second, the test coverage for this feature in tests/format.cpp looks pretty sparse, and it's not obvious to me how the output is verified.

Interesting find. I may play around with this later.

Edit: I tried the test cases from here:

https://www.exploringbinary.com/the-shortest-decimal-string-...

Here's the result:

format="%.30g" output="0.1"

format="%.30g" output="50388143.06823721984"

format="%.30g" output="54167628.18"

format="%.30g" output="9161196241250.051072"

The first and third cases output the correct string. The second case outputs nineteen digits, instead of seventeen, and does not round trip (i.e., it rounded incorrectly). The last case outputs nineteen digits instead of fifteen, but does round trip.

comment 6y ago · link · parent

I think Python was the first to bring this into my consciousness. See this enhancement request, which changed the float-to-string conversion from seventeen significant figures to shortest:

https://bugs.python.org/issue1580

After they did that, I learned that Scheme specifies similar behavior. In fact, I think it was added to R4RS after the Steele and White paper. As the article says, this behavior spread across languages, so that it's weird to see something different now.

If you want to nerd out on this, here are a few other posts that explore the topic:

https://www.exploringbinary.com/the-shortest-decimal-string-...

https://www.exploringbinary.com/the-shortest-decimal-string-...

https://www.exploringbinary.com/java-doesnt-print-the-shorte...

comment 6y ago · link · parent

I'm in the market for a new car with decent driver assistance, so a round up like this is just what I've been looking for. One of the first things that stands out is what Mazda told Consumer Reports about its Lane Departure Warning System with Lane-keep Assist:

> Mazda responded that its system was not designed or intended to center the vehicle in a lane and that the automaker doesn’t believe its vehicles are equipped with technology that meets the criteria CR is using in its evaluation.

Not necessarily something I would have understood from its website or brochure. This probably takes the CX-5 off of my short list.

Incidentally, the submitted title casts this as Cadillac vs. Tesla, but the actual title is "Cadillac's Super Cruise Outperforms Other Driving Assistance Systems." In fairness, their 2018 article did have a similar title: "Cadillac Tops Tesla in Consumer Reports' First Ranking of Automated Driving Systems."

comment 6y ago · link · parent

I definitely have some password manager anxiety. I'm not too concerned about hacks or losing my password database. For me, it's more about the sense of independence, and being able to log in to my accounts using just my noggin. I might be able to remember one or two strong passwords, but not dozens, which is kind of the selling point of a password manager.

I use KeePassXC with a password and key file. I sync the database, but not the file, using Syncthing. On the whole a satisfied customer, although the browser integration isn't perfect.

1
91011
26