HNHacker News
TopNewBestAskShowJobs

arnehormann

83 karma · joined March 7, 2013

submissionscomments
arnehormann··on Ask HN: What's the "best" book you've ever read?
Try "Best served cold" by Joe Abercrombie. Followed by The Heroes. And to avoid minor spoilers, read the First Law trilogy first. All good books are great, The heroes is probably the best!
arnehormann··on A band you can book via GitHub pull request
you are replying to the original poster.
arnehormann··on Go-Restructure: Sane regular expressions with struct fields
A struct tag is just a string literal - according to the spec. The tags can only be accessed by reflect. The reflect api docs mention the convention. https://golang.org/pkg/reflect/#StructTag
arnehormann··on Go-Restructure: Sane regular expressions with struct fields
It is specified - a struct tag is just a string literal after a struct field. See https://golang.org/ref/spec#String_literals

If you use backticks, the tag must not contain another backtick. On anything but a struct tag, you could get by by concatenating literals, but that's not allowed for struct tags: https://golang.org/ref/spec#Tag You could use double quotes instead of backticks, but that leads to a dark corner of escaping hell and an utterly unreadable mess.

Thankfully, the language strongly nudges you to very, very simplistic and light uses of struct tags.

arnehormann··on Repair is a Radical Act
Superfish is a root certificate installed by crapware in the preinstalled windows version. It can be uninstalled or removed by a fresh OS install. I guess someone replacing hardware components in a notebook doesn't keep the preinstalled OS for long.
arnehormann··on 37 rental cars – 2 days – 185,000 miles earned
It's a non-classical example of arbitrage.
arnehormann··on Don't use || to set default values in JavaScript
I use "var undef;" at the top of a function and never set it to a value. Comparison with === is the same as with undefined. And it's nice for minification.
arnehormann··on Amazon Home Services
And what about signal jamming or drones being shot down? Not only for package theft, also to strip or steal the drones themselves? I'm really curious how robust this delivery method is against external manipulation and general human misbehavior. Or say there's a defect - some structural damage - and a drone crashes or loses its 10 kg package into a front screen of a car driving on the interstate. Honestly, I don't see a way this could work. Not because delivery by drone in densely populated areas is economically and technically unsound. Because of... other stuff.
arnehormann··on .Trashes, .fseventsd, and .Spotlight-V100
you have missed

mkdir -p ~/.config/git

arnehormann··on Interface Upgrades in Go
You should use switch v := i.(type) so you can access v as the type in a case.
arnehormann··on Aurora - New MySQL-Compatible Database Engine
MariaDB enabled Cassandra as a storage engine: https://mariadb.com/kb/en/mariadb/documentation/storage-engi...
arnehormann··on Half a decade with Go
My Java is getting rusty... I read about this sometime somewhere but forgot it, thanks! I should have picked something like "String getText()", then.
arnehormann··on Half a decade with Go
Because of the implicit thing! The api designer doesn't have to write the interface, you can do it yourself. As long as naming conventions are kept to and the signature matches, you can apply this anywhere.

Imagine a close() interface in Java. There isn't one - but having a try {...} finally { x.close(); } can be very useful sometimes. But having interface graphs made of granular interfaces makes everything slow and causes a lot of complexity when you try to think about your type hierarchy. That's why interfaces always just grow and you can't use them any longer because other classes only implement part of the api. Something usable for all of awt, swing, file handling, random foreign libraries? Unthinkable. Also, adding something in a later release (like CharSequence in 1.4) can have a wide ranging impact and requires you to change a lot of code.

In Go, you just add an interface from the union set of multiple structs api - and you can use it. No matter who wrote those structs. The value is enormous. Think of it as something like dependency injection at compile time.

arnehormann··on Death by Inches: The battle over the metric system in America
There's a great video treating imperial measurement units. I instantly fell in love with it: http://www.youtube.com/watch?v=r7x-RGfd0Yk

I landed there after watching one on paper sizes on the same channel. Also pretty much worth it!

arnehormann··on TweetNaCl.js
I really doubt that, where does it say so? AFAIK, he supported the TweetNaCl in C. That does not mean anything concerning this port.
arnehormann··on Go is boring
The costs: allocating the memory, having it set to zero values and keeping the garbage collector a little busier. All of that more than once if you don't keep the conversions down. Profile and disassemble your program, Go comes with pretty great tools!
arnehormann··on Go is boring
I believe that's a good thing - I prefer a small api surface to a large one and I don't want to spend time digging through never ending functions to locate what I have to use.

For me, next to everything from Microsoft is an example for a horrible api, the one from Javas standard library is rather meh and Go is pretty much the greatest thing since bread came sliced.

arnehormann··on Go is boring
It doesn't need to. You could also write type Runes []rune but the struct variant has the advantage that you can get the array back without any conversions - it's pretty cheap. And you can embed it. That's an advantage if you e.g. don't define Less on Runes but define it on RunesAsc and RunesDesc. See http://golang.org/pkg/sort/ -> Examples (SortWrapper)
arnehormann··on Go is boring
The setup needs a little boilerplate, but it's definitely possible. And it can support different sort orders after writing the boilerplate once. For those wanting to test drive it: http://play.golang.org/p/I_Vu34hUoV
arnehormann··on SigmaVPN: Stateless OpenVPN Replacement Using NaCl Encryption Library
I wrote a ruby script to help with OpenVPN.

https://gist.github.com/arnehormann/9744964 There's a usage howto in the comments and this should be short enough to fully grasp what it does. No third party requirements, just ruby core + openssl.

It creates client and server configuration and creates and manages CA and CRL.

The VPN uses tun mode over UDP. Required changes on the server are written down in comments at the beginning of the server configuration.

If there is sufficient interest, I can make it a real repo so it can get issues and pull requests.

arnehormann··on The Most Expensive One-byte Mistake (2011)
Length could be encoded differently, as a varint. As long as the highest bit is set, the next byte is also part of the length - just left-shift the result so far by seven and add the 7 lower bits, as soon as the highest bit is 0 we have the final length. The processing overhead is low, 127 bytes only cost 1... Not such a big issue.
arnehormann··on Your Game Doesn't Need UDP Yet (2013)
TCP and UDP use the same underlying wire and the same hardware. If UDP would lose a packet or it would arrive late, the same could happen to TCP. TCP will retransmit and you lose a little bandwidth. But in both cases, you can't use the late data anymore - audio has about the hardest timing restrictions you can have when dealing with humans. Lateness means forced loss. TCPs ACK packets don't help there either, you want to keep down latency because your data can not be used any longer if it's dropped or late. Reliability becomes increasingly irrelevant, latency is everything.
arnehormann··on Inside the Guardian’s CMS: meet Scribe, an extensible rich text editor
And how about Codemirror? It's mainly used for monospace code editing and it's missing a UI and editing widgets, but the configurability and maturity should blow everything else out of the water. A demo showing it's not only usable for monospace fonts in a single font-size: http://codemirror.net/demo/variableheight.html
arnehormann··on Losing graciously
Right now they say replace all occurrences of "upstart" with "Mir" and all occurrences of "systemd" with "Wayland". I can't see how that would work.
arnehormann··on Losing graciously
They will continue to provide it. Part of what he wrote: > We’ll certainly complete work to make the new logind work without systemd as pid 1.
arnehormann··on Losing graciously
Your regexps are wrong, these replacements don't make any sense at all.
arnehormann··on OpenSSH 6.5 Released
ChaCha is a little faster and apparently a little more secure. Dig through http://www.ietf.org/mail-archive/web/tls/current/msg10843.ht... for reference.

EDIT found a better one: http://www.ietf.org/mail-archive/web/tls/current/msg10630.ht...

arnehormann··on Another go at Go failed
Also look at a list of proposed ways to add generics (and why they didn't make it): https://github.com/remyoudompheng/go-misc/blob/master/generi...
arnehormann··on Another go at Go failed
This is too late to help you, but still...

BitSets: look at math/big - not that intuitive, but what you need is probably there.

Sets: I wrote https://gist.github.com/arnehormann/6234573 while thinking about an api. It's not a regular repository because I never needed a set type myself, but it should work.

Like another commenter said, the cpu usage statistics in the Java program are most likely due to Java threads you didn't start yourself, e.g. the garbage collector. If your code involved creation and disposal of a lot of Objects, Go is at a serious disadvantage compared to the JVM. But that can be mitigated with a little effort and will probably disappear in due time.

arnehormann··on GoConvey: Go testing in the browser
You should take a look at the code. It uses quite some subpackages, each importable on its own. I didn't look INTO it, but the dependency information from http://godoc.org/github.com/smartystreets/goconvey and its subpackages paint another picture, it is probably a lot less monolithic than you think... Still, I didn't look at it in depth myself, yet.
Page 1 of 2Next →