Better HN
topnewbestaskshowjobs
Log inSign up

MathMonkeyMan

2,676 karma · joined Nov 28, 2019 (7y ago) · 1,131 submissions

Submissions

comment 2y ago · link · parent

Don't feel bad, we all use it wrong.

comment 2y ago · link · parent

I guess we need terse, distinct pronunciations for each of the symbols. I heard a Physics youtuber say "nabla" the other day -- I didn't know that symbol had a name.

On the other hand, conventions for reading formulae out loud are difficult and prone to ambiguity.

One more idea. Even in ASCII, there are programming language notations that are hard to say. What is Go's "<-" symbol called? "Arrow"? "Send or receive"? What about C++'s "::"? "Colon colon"?

It is a neat linguistic puzzle to assign sounds to “{ ⊃ ⍵ ⊇⍨ ↑⍒≢¨ ⍵ /⍨ 2≥ (⊂"aeiou") (+/∊⍨)¨ ⍵ }”.

comment 2y ago · link · parent

That's a good point, but honestly I don't know what the net effect would be.

Remember that in the US, drug companies market to patients, even though it's the doctor that must prescribe the medication. In other countries, this is illegal.

Maybe the barrier of a doctor's visit is not so relevant. Or, maybe it's what prevents things from becoming completely unhinged...

comment 2y ago · link · parent

"If you enjoyed this video, then you're a freakin' nerd."

Guy knows his audience.

comment 2y ago · link · parent

That suggests an interesting idea.

Figure out what might be meant by "a good employee." This is hard. Maybe factor in tenure, promotions, projects delivered, peer evaluations, etc. Develop of set of measures for an employee's overall all-time job performance.

Now take each candidate's "interview binder" and map it to some set of ratings (coding proficiency, favorite ice cream flavor, etc.). Set thresholds for each rating initially to reach hiring targets and some vague notion of an acceptable employee profile.

Always allow some small percentage of candidates below the thresholds to receive an offer.

Correlate the interview rating dimensions with the set of employee performance measures as employees work through the job.

Adjust the interview thresholds and experiment with adding or removing dimensions as you learn which things in the interview are correlated with "good employees."

Maybe this is how it's done when it's done properly, but it's the "extend offers to a few people below the cut, and see if they fare worse" idea that I like.

comment 2y ago · link · parent

I don't think it will be a problem: <https://fossil-scm.org/home/doc/trunk/www/hashpolicy.wiki>

comment 2y ago · link · parent

Just need to require a 4 year degree in more jobs that don't need it. Problem solved.

comment 2y ago · link · parent

I know nothing, but maybe some three letter agencies know more. Or it could just be politics.

comment 2y ago · link · parent

Wasn't Soyuz the only way to get up there for a while?

Also, what better way to say "let's not nuke the shit out of each other" than to cooperate on civilian space programs?

comment 2y ago · link · parent

Yep, common use case for what I work on is BLAH_BLAH_THINGY_CONFIG_FILE in the environment being a path to some file that the library will open to read config, instead of having the config itself in the environment (maybe it's a large unwieldy JSON thing).

https://github.com/DataDog/dd-trace-cpp/blob/6dacac2922d08f4...

It's not secure, but I'm not worried about bad actors monitoring /tmp in my test container so they can make my tests fail anyway.

It would be nice if there were a "file paths that start with a null character belong to an ad hoc in memory file system specific to the process," or something. /tmp/tmp.eJaVgxtV0x/ is close enough.

Open to code golfing suggestions on the code linked above.

comment 2y ago · link · parent

It took me longer than I'd like to admit.

The lapping cat operator is truly inspired. Being a sucker for for pattern matching, I'm more likely to write

    foo, = seq
or

    foo, *_ = seq
than

    assert len(seq) == 1
    foo = seq[0]
or

    foo = seq[0]
Though I vaguely call past colleagues disagreeing, or at least insisting on parens around the "foo," in the first one.

comment 2y ago · link · parent

All that text is heavy to push out of the way when you insert a new line break.

Also, the feeling of accomplishment as the job's entire history whizzes by when you press ctrl+end each morning.

comment 2y ago · link · parent

I sketch all of my ideas on yellow legal pads for the same reason. It's my playground. Mostly diagrams and code snippets. Playing around with the names of things.

For my "TODO/notes," though, I still use a plain text file in gedit. No timestamps, no nothing. When I want to remember how to build Envoy with bazelisk, I search for "bazelisk" and see the most recent, oldest, and all intermediate attempts with my notes (e.g. "runs out of memory, but if you're not building the tests, you can get away with 6 cores"). I've gotten into the habit of "tagging" potentially useful information with words that I might search for later.

Need to save an error message for possible later reference? notes.txt. Meeting notes? notes.txt. TODO? notes.txt. Rough draft of slack message? notes.txt. You get the idea.

comment 2y ago · link · parent

They can tell you, but they don't have to.

comment 2y ago · link · parent

The quote's use of "against" and "where" confuses me.

comment 2y ago · link · parent

There are the kinds of defects that people notice, and then there are the kinds of defects that people don't notice. Crashes are usually noticed, while nonsense calculations and undefined behavior are sometimes not noticed.

I worked at a company that sold a product that some customers used to make decisions involving a lot of money. A program misbehaved, or gave the wrong answer, or returned from a function too soon, or something. It didn't crash. A customer lost a lot of money, and we were liable.

It turned out that the bug was a symptom of undefined behavior that would have been caught by one of the flavors of assertions built into standard releases of the core C++ libraries. The team in charge of the app in question had long ago disabled those assertions because "they keep crashing the code."

Infrastructure within the company then went through a small internal crisis about whether to force assertions down people's throats or to let it be wrong on prod. The compromise was to have the assertions expand to loud warnings on prod. Ops then had a tool that would list all of the "your code is provably broken" instances, and that went to a dashboard used the shame the relevant engineering managers.

Not sure if it worked, but when you have a _lot_ of C++ code, a great deal of it is broken and "it's fine." Until it isn't.

comment 2y ago · link · parent

Yep, the [numerical tower][1].

Python's int is a bignum, but in Scheme you even have rationals built in. There's a notion of which numeric values are "exact" and which ones are "inexact" (i.e. floating point).

[1]: https://en.wikipedia.org/wiki/Numerical_tower

comment 2y ago · link · parent

I've seen a few programs that misbehave due to a comparison function that doesn't have all of the necessary properties.

Maybe what's notable from a security perspective is that here's a contract about the behavior of an algorithm (comparison function) as opposed to the value of an argument (null pointer, negative, bigger than N, etc.).

Still qualifies as passing an invalid parameter.

comment 2y ago · link · parent

I hardly wrote any Clojure, but the only thing that bugged me was the startup time of the repl. It's been talked about enough. Yes, that problem goes away if I use a proper setup with a language server or whatever, and yes it doesn't matter for "situated" production applications, but it still peeved me.

What do I care if it's in the JVM? Sure, a JVM instance uses a lot of memory to help the garbage collector, but that doesn't bother me. JVM is just an old, mature ecosystem. Every runtime we work with (browser, nodejs, CPython, your decades of hand-written C++, the Go standard library) shares design tradeoffs with the JVM. Nothing inherently off-putting about it.

comment 2y ago · link · parent

That's not to mention the zombies. There was a huge cover up.

comment 2y ago · link · parent

I've read (don't remember where) that Android's kernel barely resembles upstream Linux.

A little more about UBports...

It's not like you can use /dev/video to use the video camera on a Linuxified phone. Instead, the system is a Debian wrapper around Android, and Android is used to get access to the proprietary device drivers. Those capabilities are then exposed to the Qt-based SDK.

So, to take a picture with the camera every few minutes, instead of running a command on a cron job I had to write a whole [GUI app][1]. Either I manually start the app using the phone's touchscreen, or I think I can launch it in dev mode remotely using tools on my laptop, but the phone still has to be manually unlocked.

To top it all off, there's a memory leak in some camera-related Android service, so the app crashes after a few hours. The bug is allegedly in the Android code, so the UBports maintainers can't do much about it (maybe backport a patch onto the source from which the Android base image is built? Who has time for that?).

For all I know, it's a good phone, but for my hacking use case it's less than ideal.

Still, any old phone camera is way better than the webcams I have lying around.

[1]: https://github.com/dgoffredo/ubuntu-touch-intervalometer

comment 2y ago · link · parent

> This was the standard way to compute in the 60s. But we have evolved. Nowadays, you buy a computer and nothing keeps you from doing anything with it.

Depends on the specifics of "you," "nothing," and "anything."

> Wake me up when Linux is ready for everyday phone use, because Google is a poor alternative.

I have UBports (i.e. Ubuntu Touch) installed on an old Pixel for use as a remotely controlled camera, but I don't use it as a daily driver. It's a thick wrapper around Android, though. There's no getting around proprietary hardware, firmware, and drivers.

comment 2y ago · link · parent

The implementations of vector, list, and unordered_map in every standard library I've used have been sufficient for every C++ library I've worked on.

There are special cases, and there are engineering politics, but it's all basically fine.

comment 2y ago · link · parent

Maybe so, but if the logic is sound, then that's a reasonable estimate of rape pregnancies, and the interesting observation is that the number of legal abortions in that time was way smaller. More interesting would be to know what percentage of rape pregnancies were aborted before a state made abortion illegal.

comment 2y ago · link · parent

mass * velocity * velocity has units of energy. It's twice the kinetic energy.

comment 2y ago · link · parent

I figure we'd leave it to the build/deploy/CI/development whatever system. I also don't want to extend or embed my application with a full-blown runtime if I don't have to.

"source" config --> convert to JSON config "on the fly" --> app that expects JSON

edit: I worked on a C++ team that used `std::system` to invoke the system python interpreter when loading a config file. My teammates weren't morons, either, it's just the simplest thing that worked and they knew that the config script and the surrounding file system were secure.

comment 2y ago · link · parent

Reducing salt might help with symptoms[1].

[1]: https://www.mountsinai.org/health-library/special-topic/m-ni...

comment 2y ago · link · parent

How is it trivially false? I know nothing about it.

comment 2y ago · link · parent

Solutions abound, but one option is to use either Javascript (config.js):

    // comments!
    ({
       no_quotes: [1, 2, (() => /* code! */)()],
       ...
     })

Or, let the whole thing be a function. Then your config can have parameters, maybe mapped from environment variables or something.

    ({foo, bar, ...kwargs}) => ({
      datacenter: foo === 'old' ? 'useast1' : 'uswest',
      ...
     })
Can do as Crockford says, and write in the JSON subset of Javascript, but with comments, and convert it to JSON by running it through a JS minifier. I think you need parens around the object, though, or else it looks like a code block (boooo...):

    ({
      // This is very much like JSON
      "foo": [1, 2, "bar"]
     })
Python also has JSON-like syntax, so you could use config.py:

    {
      'foo': [1, 2, 'bar']
    }
That would require a wrapper script. Or, you can have the self-contained convention:

    import json
    import sys
    
    # Yay, comments!
    json.dump({
      # more comments!
      'foo': [1, 2, 'bar']
    }, sys.stdout)

comment 2y ago · link · parent

As a New Yorker, I wouldn't dare try, but I see your point.
1
242526
38