HNHacker News
TopNewBestAskShowJobs

jharsman

355 karma · joined August 13, 2009

I'm interested in computer graphics and visualisation, usability, and most stuff relating to programming and software development.

I work on medical/electronic health stuff.

https://ghostinthecode.net

submissionscomments
jharsman··on UTF-8: Bits, Bytes, and Benefits
If you're representing text which contains lots of characters that aren't in ASCII, like say Chinese, UTF-8 will consume much more storage than necessary. There are many languages where non-ASCII characters are extremely common.

He misses a very useful property of UTF-8 as well, it never contains null bytes. This trips up all sorts of heuristics for detecting binary files in various programs if you use e.g. UTF-16 for mostly ASCII text, since it then will contain lots of nulls.

UTF-8 is a very clever way to avoid problems on systems suffering under the mistaken assumption that text is 8-bit byte strings (cough UNIX cough), but that doesn't make it the ideal choice every time.

It is still very common for cross platform tools to not handle file names with non-ASCII characters for example. Both Mercurial and Git suffered from this last I looked.

The reason is that they treat file names as byte strings instead of text in some encoding, and therefore cannot translate to the proper encoding on platforms which treat file names as Unicode text, like Windows and OS X. OS X also uses a somewhat unconventional normalization form, which means you need to handle normalization as well.

jharsman··on Unions
This seems very US-centric. In Sweden there is a union for military officers for example.

And there are plenty of civilian employees working for the armed forces that can join unions as much as they like and presumably cause quite a bit of chaos if they go on strike.

Is the argument that teacher unions should be illegal because they somehow stifle education? That seems insane, isn't it a fundamental right to join whatever organisation you wish, not just the ones the government likes?

And there are lots and lots of countries with teachers unions that outrank the US in various quality of education rankings (e.g. Finland), so it doesn't seem like teachers unions are a big barrier to higher quality education.

But you do have the right to select any school you like here, which is considered some sort of extreme right wing thing in the states as far as I can tell. Although free choice of schools has it's own share of problems...

jharsman··on Mechanical Keyboard Guide
A Japanese keyboard layout (http://en.wikipedia.org/wiki/Keyboard_layout#Japanese) has a shorter spacebar and some extra keys instead. You might be able to remap them to extra modifier keys with suitable software.

The Kinesis Advantage (http://www.kinesis-ergo.com/advantage.htm) also has a unique layout where you hit modifier buttons with your thumbs, and it uses brown Cherry mechanical switches. It's $300 though.

jharsman··on Computers are fast
"Soon, computers will be fast."

- Billy Zelsnack

jharsman··on Poll: Do you have Silverlight installed?
I answered no, but http://www.silverlightversion.com/ claims I have 4.0 installed. Which is strange, beacause I contantly see little "Install Silverlight to view this video" buttons when browsing Microsoft sites. Maybe most Silverlight content requires a newer version or something? Or it just doesn't work in Firefox.
jharsman··on Ask HN Emacs Users: What's in your .emacs file?
If you want something that guesses indentation style automatically, you could try guess-style.el:

http://nschum.de/src/emacs/guess-style/

jharsman··on Why Users Fill Out Forms Faster With Top Aligned Labels
Having the labels above the input field can make localization easier since it allows the label text to grow or shrink without affecting layout.
jharsman··on Banana equivalent dose
A number of years ago there was an incident in Sweden where a tiny crack was discovered in a container that had been used to transport nuclear waste from one of Sweden's reactors.

This caused a lot of media attention and some politicians made statements about how this was unacceptable and that they would look into it.

One reporter interviewed an older physicist that worked with radiation protection for the government and asked him if a substantial amount of radiation had been released. He said something along the lines of:

"Well, yes there was a fairly significant amount of radiation, about the same level as you would be exposed to when standing next to several crates of bananas."

This made the media hype seem somewhat exaggerated...

jharsman··on Single menu bar for Ubuntu
Fitt's law says that the edge of screen is easier to target, that is not the same thing as being closer.

For example, if you have a very large monitor, or two monitors, you might have to move your perceptual focus far to focus on the menu bar, even though it is at the edge of the screen and easier to hit. Then you might have to move it all the way back to where you were to see what effect the command you just gave had.

jharsman··on Ask HN: How to generate random terrain
For waterways, just simulate rain and erosion. Let's say you model your terrain as a height field.

1. Add rain in random locations 2. Have the rain absorb some of the soil from the square it starts in. 3. Let the water flow in the direction of the gradient. 4. Deposit som e of the picked up soil (maybe only with some probability based on the flow velocity?) 5. Repeat

If you just want rivers and lakes you can skip the erosion step and just simulate the water flowing. If you wanted you could add sources manually and have water always flow from there.

jharsman··on What are eigen values?
If you're doing graphics or physics, calculating the eigen vector for the eigen value 1 gives you the axis of rotation for a rotation matrix.

That's a pretty straight forward application that's also obvious from the definition of eigen values and eigen vectors.

← PreviousPage 2 of 2