2,676 karma · joined Nov 28, 2019 (7y ago) · 1,131 submissions
comment 2y ago · link · parent
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
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
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
comment 2y ago · link · parent
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
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
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
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
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
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
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
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
comment 2y ago · link · parent
"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
[1]: https://www.mountsinai.org/health-library/special-topic/m-ni...
comment 2y ago · link · parent
// 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)