Better HN
topnewbestaskshowjobs
Log inSign up

kortex

8,487 karma · joined Feb 1, 2017 (9y ago) · 2,549 submissions

Submissions

comment 6y ago · link · parent

If you don't know these things, this looks like a great crash course. Basically know enough to be dangerous as they say. It'd be great as a primer for any cs degree as well

comment 6y ago · link · parent

Ignoring runtime bugs, static typing and type hints gives me (a) autocomplete that works better (b) near-real-time linting that lets me catch dumb bloopers before my focus shifts to a different zone (c) lets me inspect objects/signatures and get up to speed on other people's code way faster than having to look up docs.

This alone gives me a huge productivity boost and I can't imagine working without it. It just so happens that anecdotally I see runtime errors inversely frequently to my discipline with using hints (go > python w/ hints > python w/o hints).

I like having some wiggle room for rapidly hacking stuff out. interface{} and Any are nice in small doses. Namely as parameter types and only when I'm the only one using the code and just need to ducktype my way through something.

comment 6y ago · link · parent

I found a .ps that generates timing wheel patterns (discs with alternating black and white radial bands). you'd plug in inner/outer radius, number of bands, and you'd get a printable document from that file. As in, the .ps file was code, which printed as an image. I now know this is the origin of pdf but it blew my mind.

comment 6y ago · link · parent

I wish there were more context here. I have no idea what `sync` is. I gather this is js. Searching "javascript sync function" yields nothing obvious. Is it a framework thing?

comment 6y ago · link · parent

Well there's this: https://github.com/ucsdsysnet/corundum But that's more intended for optical networks. Useful reference at the very least.

Really, we need more fiber optic everywhere. It's easier to hack on, because cable modems are technically radios, and run into the usual FCC red tape. Plus, fiber is just better.

comment 6y ago · link · parent

Neat! I'm gonna try both of these in my workflow.

comment 6y ago · link · parent

Why is this still such a problem? People have been talking about replacing bash with python for years, and yet trying to actually do just that, is a pain. Plumbum doesn't quite cut it.

I think in part it's because the POSIX-style shell is so tightly wound with the OS, it's extremely proficient at spawning and forking processes, working with files, and communicating, and that experience is seamless. Python feels like a different world, and doing any subproc, pipes, or file i/o always feels like crossing some boundary and back.

comment 6y ago · link · parent

I want to. I really do. I've been using python for a decade and I still have to always look up how to call subprocesses correctly and communicate with multiple processes.

Plumbum is cool, but now I have an extra [""] for every command, and I need python and a lib (which usually means an env as well) to bring an app up.

On the other hand, I try to migrate as much business logic into the app as possible, and increasingly kv as well, so bash is pretty much pointing at config files and commands.

comment 6y ago · link · parent

I really wish there were a "lexical space" (spacebar) and "semantic space" (shift-space or some other control). Use something less obtrusive for the semantic space than - or _, like the interpunct ·. It breaks visually/semantically but is lexically part of the same string.

    this·is·variable·one
Vs

    one two three
Now I just use an ergodox ez (qmk-driven) keyboard with _ in an easy spot and snake_case everything but people says it's "ugly" or some bs (camelCase, especially with initialisms, drives me nuts).

comment 6y ago · link · parent

Yup, I have the same misgivings. I hate getting locked out, but at the same time, I'm pretty paranoid and want secure passwords, don't leave copies of them around.

So I've been working on a backup plan. Current incarnation is to use a simple Go cli tool with Shamir's secret sharing algo to break a password into N/M shards. The user can then do whatever they please with the shards, give some to their family, friends, attorney, make a pirate map, get an rfid chip, anything you want.

comment 6y ago · link · parent

You are correct. The best you can do would be an activated carbon filter, which some better filters have. However, if I am reading/interpreting the graphs correctly, this is talking about over four miles from the leak. You'd be in the 2-5 ppm range (based on surveys) or less for NG (ethane and methane). so, maybe some reduction, but I doubt it would have a physiological effect.

That may be still in the range for mercaptan tracer gas olfaction, in which case carbon would decrease the smell, but that's about it.

comment 6y ago · link · parent

Agreed. There are countless things in ROS1 which feel like a less polished version of X. I believe ROS2 is trying to use a more commodity stack for IPC and serde.

comment 6y ago · link · parent

That's really clever. Only real downside is underwater maintenance is a PITA.

Although I suspect for the quantities involved, it still may be impractical.

comment 6y ago · link · parent

I have an electric weed wacker, and for my purposes it works great. But even for more industrious weed wacking demands, I don't think small gasoline engines are contributing that much to global carbon.

Pollution and smog, otoh, two strokes are notorious for polluting.

comment 6y ago · link · parent

Last I checked, about a year ago, they were still developing, albeit producing documentation at a pretty slow rate.

I think they are still iterating a fair bit on the micro tractor. But overall it seems there was a flurry of activity around 2014 but then it has tapered off.

IMHO, I think they set their sights a bit too high, with the whole construction set. Would have been better to focus on just the tractor first, getting the documentation really hammered out. It is such an essential piece of farm equipment. But as it stands, nothing on their wiki is really viable to contribute to, because you can't really work off of it.

comment 6y ago · link · parent

> Zero-copy formats usually turn out to be worse for use as in-app data structures, because they have to carefully control memory allocation and layout in a way that makes it hard to mutate an already-constructed message.

Oh, I never thought of it that way, but that makes perfect sense. I guess I just assumed messages would be collections of pointers and buffers living "somewhere" in memory, but of course the actual layout can make a ton of difference.

I guess there is an implicit rule that if you are dealing with inbound structures in a read-only fashion, passing around the serial structure is OK for when the field access cost is minor compared to the copy cost, but if you want to mutate it, or doing lots of access operations where that isn't trivial, it makes sense to copy into your own data structure.

comment 6y ago · link · parent

Exactly.

TODOs should be an adjunct to the issue tracker. An issue could be "Clean up/resolve all TODOs in module qux". but each of those comments on there own are rarely worth the issue on their own.

Also not every project has the FTEs or the scope to hit every TODO in the first pass. Maybe it's all a glorified demo and these are "Road closed" points to be enhanced/hooked in to in the future.

comment 6y ago · link · parent

Very much so. As a dev with ADHD, that focus knob is more external than most. But I definitely have noticed the phenomenon where deep focus and verbal/social fluency are rather orthogonal.

comment 6y ago · link · parent

Slow is smooth, smooth is fast.

This applies to surprisingly many tasks in life.

That said, I've been pushing to hit 100 wpm typing with minimal typos for years just because it's a nice round number and I keep ending up just shy. Character typos aren't even that big of a deal, as I find a good chunk of mistakes are actually "thought-os" where I type in the completely wrong giraffe. So being able to recover dynamically from misakes is valuable too.

comment 6y ago · link · parent

> Is there a better way to utilize the convenience of python for experimental code without running into the scalability issues of large python codebases?

Type hints and doctests.

If that doesn't get you to pretty big static typing wins, then you are probably just dealing with a toxic codebase or something.

comment 6y ago · link · parent

The amount of mental overhead that type hints reduce is staggering. I love being able to interrogate a variable, function or class and learn about its properties right in the IDE, or have autocomplete let me mangle the name of an attr and tab-complete and correct it (regardless of lang). The alternative is going back and forth from documentation to code, and having to type everything perfectly.

Even just a smattering of type hints helps dramatically, as a few well placed hints on the APIs I know the least, gives me a huge boost.

comment 6y ago · link · parent

Yeah I've seen i3 and it looks cool but does it work with regular graphical X window applications? It seems like it's mostly text based though I have seen images in panes.

comment 6y ago · link · parent

Oo, this looks excellent! Definitely want to try magic mouse at some point, and this seems like a great ajunct for that.

comment 6y ago · link · parent

Karabiner is great, but my daily driver is an Ergodox EZ, and it's truly the best. I can edit nearly everything in the web configurator gui, but if I wanted to get crazy, the gui can export the QMK source code and I could compile myself.

The thing that my workflow really needs now is a way to organize/focus specific windows (e.g. a particular IDE window or browser). like I want to be able to assign (on the fly) hotkeys like Alt-1 Alt-2 etc to specific windows.

This is Ubuntu 18 though if such a thing is easier on Mac I could make that my main dev environment (I'm thinking of switching soon anyways once I port my workflow)

comment 6y ago · link · parent

Do you know if flatbuffers can be used as data structures in applications? That seems to be a shortcoming of protobuf, all the ser/de code makes it suboptimal for in-app data transport.

comment 6y ago · link · parent

You can generate stubs for mypy with this tool but yes this should be something supported out of the box.

https://github.com/dropbox/mypy-protobuf

comment 6y ago · link · parent

Python3 relative import syntax was flat out broken for years [0][1]. It's workable finally (not sure which PR fixed it) but it's still a monster to try to get protoc/grpc plugin to emit _pb2.py files which a) have correct import syntax b) have a top-level package name c) are readily packageable for pip install d) do all the above in a reproducible and uninstallable manner e) also be able to import 3rd party protos f) all the above without any post-processing.

Like, yes python constrains package names to the folder names. But why not check a flag so I can let the emitted python structure dominate the folder structure? Or, easier, just let me ignore the folder structure and specify a dang top-level-package in the emitted _pb2.py and let me wrangle it with setup.py?

[0] - https://github.com/protocolbuffers/protobuf/issues/90

[1] - https://github.com/protocolbuffers/protobuf/issues/1491

comment 6y ago · link · parent

(2018) Original thread here: https://news.ycombinator.com/item?id=18188519

Protobufs are the worst (de)serialization format, except for all the others.

My chief complaints are:

- Protoc is very obtuse and tricky to use for anything where you want packaging, especially with python

- The gRPC compiler plugin is even more frustrating in this regard

- It's very optimized for compactness on the wire, at the expense of serving as a useful structure within programs (I can't find the source, I think it's somewhere in the protobuf dev docs, but I've had multiple coworkers tell me this)

- The gRPC server python implementation does weird things with multiprocessing under the hood that I do not understand, which interferes with other modules trying to use multiprocessing.

- I still have not found an ideal way to organize files to work well with importing and still compile correctly with protoc/grpc plugin, and generate python files with correct import syntax. If anyone knows the "correct" way to do this that doesn't require too much setup.py hackery, please let me know.

External schema '.proto' files is a feature, not a bug.

The complaints in the article about the type system are pretty silly to me. I mean, they are great features, but they are not really in the sphere of the engineering goals when Google set out to make pb/gRPC.

Here's what I love about it though:

- Support, in particular gRPC's support across so many languages.

- Language agnostic data structure contracts

- Shallow learning curve to get a smoke test hello world put together - I found it a lot easier than Thrift to get up and start playing

To quote hardwaresofon:

> in combining three solutions (schema enforcement, binary representation and convenient client/server code generation), they've created something that's just easier to use

Specific comparisons:

Cap'n proto looks great on paper but at the time (about a year ago) it had some issues with python2.7 and 3.6, which made it a nonstarter for the application at the time.

MsgPack-RPC might work well but I'm a bit dissuaded by the unhealthy looking repo of the python/go/cpp implementations.

Anything over HTTP - you have the binary-to-text issue. Which, if there are better solutions for this nowadays, let me know.

I believe that XML is dead/dying as a ser/de format (outside of the markup domains it has already demonstrated to be very proficient at). Similar lack of binary support.

That leaves Thrift and Avro, which have juuust enough of a barrier to entry, with my lack of time to dig into alternatives, that I have not been able to research thoroughly yet.

comment 6y ago · link · parent

Ding ding ding.

People are getting savvy to bots (used here to mean all variety of inauthentic social media accounts). The one-track tweets approach doesn't cut it anymore, you need a modicum of authenticness. That's why we are seeing Deepfake profile pics and much more effort going into fleshed out bot accounts, getting friends and followers, and multifaceted story feeds.

It's a classic infiltration technique. Get in, silently grow your roots under the radar, before deploying the payload.

comment 6y ago · link · parent

Yes, but I don't think it's just "health cults". Locus of control and learned helplessness are very powerful drivers. If you have a person that has derived benefit from an intervention, placebo or otherwise, and you challenge that mental model, you cause a mighty cognitive dissonance in their brain. That challenge must be "dealt with", the usual outlet being arguments over the internet.
1
777879
85