HNHacker News
TopNewBestAskShowJobs

aplusbi

1,410 karma · joined April 29, 2009

I'm an unremarkable programmer who, unremarkably, keeps a blog: http://www.aplusbi.com

I hope to one day be remarkable.

submissionscomments
aplusbi··on Howfuckedismydatabase
This reminds me a story...

At my last job we used Postgres on a Windows server. Whoever initially set up the database pretty much stuck to the defaults.

Whenever we would read/write text to the db in code we were using functions that basically returned raw data. All of our text was encoding using UTF-8.

When using the Windows Postgres Admin tool to run a query that returned text, you'd occasionally see some weird characters (café), sometimes you wouldn't (café). Sometimes the query would fail due to invalid characters.

When I looked into it I quickly realized what was wrong - on Windows Postgres defaults to Win1252 encoding (which is a form of extended ascii). Normally when you are writing text to the database Postgres will convert the encoding but since we were writing raw bytes we skipped this part.

Win1252 contains some undisplayable characters which occasionally show up in a multi-byte UTF-8 character, explaining the failed queries. However it didn't explain why sometimes we got café and sometimes we got café.

It turned out that there were some scripts/apps that were reading file names on Windows and inserting them into the database without converting it to UTF-8. Windows uses UTF-16, although somewhere this was auto-magically being converted to Win1252.

This meant that our Win1252 encoded database contained both Win1252 text and UTF-8 text. I ended up doing a text dump of the database and writing a Perl script that would run through it all byte-by-byte and convert all characters above ascii 127 that were not part of valid UTF-8 sequences into UTF-8. This was then used to create a new database correctly encoded as UTF-8. It actually worked (although there were a few snags - we were getting some data from this service that would randomly include the sub character (ctrl-z) occasionally which would cause cat/split to stop running).

aplusbi··on Developer Productivity - The Red Pill
I love this! I use dtach (with dvtm) instead of screen, but it's serves the same purpose. I'll be working at my desk and then have to head to a meeting (with my laptop) to another floor. My ssh connection will drop but once I log back in I just need to reattach and I'm right where I left off.
aplusbi··on Call phones from Gmail
I was really lucky in that I got a Gizmo5 account shortly before they were acquired by google. They created an Android app called Guava that did just that (limited to 3 minutes at a time unless you pay). It comes in handy when I'm traveling internationally as I can make free 3 minute phone calls to the US.

Since Google owns Gizmo5 now and I'm assuming that this new browser calling feature is a result of the acquisition I wouldn't be surprised if an Android app is going to be out soon.

aplusbi··on NASA to announce 'intriguing planetary system' discovery on Thursday
Maybe they discovered a planet that orbits a binary star but whose orbit doesn't match what physics would predict for planets in a binary system. Almost as if the planet itself were adjusting and compensating...
aplusbi··on Things I've Learned from Traveling Around the World for Three Years
Yeah, I'm really glad I brought antibiotics to Peru with me, and Peru isn't even particularly bad. I wouldn't say I got violently ill there, but I did get a case of Gringo's Bane (aka Machu Poopoo) and was moving my bowel 10-15 times a day. Other than that I felt fine, but not being able to leave the proximity of the bathroom cost me two days.
aplusbi··on Things I've Learned from Traveling Around the World for Three Years
I'm an American who has never been to Canada, but I think I get what the author meant. He compared the difference between American and Canadian culture to the differences between states or regions. There is a huge difference between Northern US culture and Southern US culture, East Coast and West Coast, etc. But there are a lot of similarities and those similarities make up "American Culture."
aplusbi··on Why You Should Switch to the Dvorak Keyboard Layout
I've been thinking about switching to Colemak but the fact that I use Vim daily has kept me from seriously considering it.

While I certainly can remap some keys in Vim, I'm not sure if that's such a good idea in the long run. Some keys, such as h,j,k and l are no-brainers - those should be remapped. But what about w, b and e? When I'm using those keys it's all muscle memory, but should I really change w to y (word to yank)?

Do I want to spend my time learning a new keyboard layout AND relearning how to use Vim? Ultimately I've decided that Qwerty is good enough for me. I don't have RSI and I can type at a max speed of over 90 wpm (I probably average in the 70s for "real world" typing).

aplusbi··on Portal as a required college text
A lot of colleges/universities require/provide laptops to students. They also usually have computer labs.
aplusbi··on Math Lessons for Locavores
A better point would be that home storage costs are the same for local foods as they are for shipped foods.
aplusbi··on Kindergarten enrollment dates affect ADHD diagnosis rates
You are probably being downvoted because you are making the claim that ADHD is not a real disorder and that treatment for it is comparable to homeopathy.
aplusbi··on Kindergarten enrollment dates affect ADHD diagnosis rates
You are correct that these traits would apply to any arbitrary group of young children with a one year age spread. Kindergarten is an ideal such group, not only because it encompasses a one year spread of young children, but also because it is a group that is being observed for signs of ADHD.

But yeah, I'm not trying to say that the title isn't misleading - there is a correlation between Kindergarten enrollment dates and ADHD diagnosis and that's it. The article makes this pretty clear but the title does not.

aplusbi··on Kindergarten enrollment dates affect ADHD diagnosis rates
That's not quite it either. The reason Kindergarten is important is because it's examining kids among their peers. Kids who are on average 6 months younger than their peers are more likely to be diagnosed with ADHD.
aplusbi··on Kindergarten enrollment dates affect ADHD diagnosis rates
Generally kids who are 5 years old (if I'm not mistaken) are in Kindergarten. Some kids start Kindergarten at 4 because their birthday is later in the year. However there is a cut-off date (probably in November or December) and students born after that cut-off date are enrolled in next years Kindergarten class.

So if the cut-off date is December 1st, kids born on December 1st will start Kindergarten a year earlier than kids born on December 2nd.

aplusbi··on Stop Calling Yourself a Rockstar and a Ninja
Unless of course, you actually are a rockstar.
aplusbi··on Too much time on his hands
Nobody ever says to someone watching Law & Order reruns that they have too much time on their hands.
aplusbi··on Ask HN: How are you securing your laptops in public places?
The bystander effect doesn't have much to do with this because you asked first. The simple act of asking changes peoples perceived personal responsibility.
aplusbi··on Why did the US Government claim Kindle violates civil rights?
I wonder if there is a market for a braille-based ebook reader. Refreshable braille displays already exist and it doesn't seem like it would be that difficult to build one in an ebook form factor that could read ebook formats.

Edit: I looked into it a bit. The refreshable braille displays on the market are very bulky, primarily so they can deal with the necessary wear and tear. While I'm sure a smaller, lighter version is possible (especially since it doesn't need features like cursor location) I wonder how small you can actually make it before you drastically cut down on its life.

aplusbi··on New York will always be a tech backwater, I don’t care what the VCs say
He cited five that he had personal experience with. You can't use that as a metric.
aplusbi··on New York will always be a tech backwater, I don’t care what the VCs say
I've seen several programmers working in cafes in Brooklyn. I don't really hang out in cafes in Manhattan that much (occasionally Subtletea back when I worked in the area) so I can't comment on the state of Manhattan cafes.
aplusbi··on New York will always be a tech backwater, I don’t care what the VCs say
Maybe you're right. I grew up in NYC (the Bronx, and I currently live in Brooklyn) so my experience is far from typical.
aplusbi··on New York will always be a tech backwater, I don’t care what the VCs say
"Three years in New York, and I went north of 14th St maybe three times. Trips to the Met excepted, of course"

I'm supposed to believe this guy knows anything about New York when his definition of New York is "Manhattan south of 14th st."? Believe it or not there are people who manage to live in NYC without hemorrhaging money, who know where and how to eat and don't hang out in the financial industry social scene.

I don't doubt that NY's tech scene is no where near Silicon Valley but he has a pretty skewed view of this city.

aplusbi··on My Google Interview
My experience (having interviewed at Google NYC twice, turned down both times) was that if I asked what language I should, they would always reply with either C, C++ or "C-like."

Only once was a particular language required (I was asked to implement memcpy, in part because the interviewer wanted to test my knowledge of low-level C and void pointers).

That said, I did write one of my solutions in OCaml even though the interviewer did not know the language (I asked him if I could, and he got the gist of my solution).

aplusbi··on Start seeing magnetic fields
I have some friends in the body modification industry including a NY-based practitioner who happened to have silicon-coated magnets. He has a habit of discounting everything for his friends so he only charged me the cost of the magnet ($50-60).

Aftercare was very minimal - once implanted your left with a sutured incision to take care of. I just kept it clean and tried not to use that finger much (which made typing very hard). The incision was completely healed in a couple of weeks.

I chose that finger because I'm left-handed and figured that was my least used finger.

I first heard of them in 2004 (I think) and was set to get one around 2005. However at that point most of the people with magnet implants started having complications due to the silicon coating getting damaged. I mostly forgot about it until 2008 when I read that the coating process had been greatly improved (the first generation implants were dipped in silicon, the newer ones are injection-molded).

At this point the novelty has worn off and for the most part I don't even notice it or mention it (although people who know I have it love showing it off). However I still think it's amazing and have no regrets. And it comes in handy whenever I drop a pin or paperclip.

EDIT: If you want to experience it temporarily, tape a small rare-earth magnet to the tip of your finger. I recommend putting your hand close to a motor (like in a fan) and putting it close to an AC-adapter that's plugged in.

aplusbi··on Start seeing magnetic fields
Yeah, I can't feel it. In general I have to be really close to the source to feel any field.
aplusbi··on Start seeing magnetic fields
I had a magnet implanted in my right ring finger a little over two years ago and I can answer any questions if any of you are interested.

The basics though are: it doesn't affect hard drives, credits cards or (surprisingly) CRTs. I can feel AC-DC converters and motors though I can't feel current. The implant has a small degree of mobility so it will flip over when exposed to a magnet (which is unfortunate, it means I can determine the polarity by feel).

aplusbi··on Student makes his own Air Conditioner to beat the summer heat.
I get where you are headed, but you should probably think about the ice as "fuel." The cost (in terms of heat/energy) of freezing the ice can be spent during times when you are not in the room and/or not using the "air conditioner."

Actually there are commercial HVAC systems that use ice as a coolant - the water is frozen at night when electricity demands are lower and then is used to cool the building during the day.

aplusbi··on American Dream is Elusive for New Generation
I think my friend Dan (who is on HN incidentally) summed it up perfectly:

"American Dream Elusive for New Generation": get political science degree, apply to finance jobs, reject entry-level positions -> fail.

aplusbi··on Fake Explanations
I don't think it's blind deference to authority, I think it's a result of over-active pattern matching. We see patterns all the time, but that doesn't always mean there is a pattern.

For example, in a science class students are typically presented with a phenomenon, asked to speculate about it, and then presented with a scientific explanation. Do this often enough and a clear pattern emerges - phenomenon -> scientific explanation.

In the case of the article, it was actually phenomenon -> human interference, but it shouldn't be surprising that the students assumed it would fit the usual pattern.

aplusbi··on Fake Explanations
This reminds me of the candle problem:

You are given a candle, a book of matches and a box of tacks. You need to mount the candle on the wall in such a way that the candle won't drip on the table below it.

When the problem is presented as above people struggle to come up with a solution. When you simple changes the description of what you are given to: "You are given a candle, a book of matches, a box and some tacks." people are able to quickly solve the problem.

aplusbi··on Think You're Operating on Free Will? Think Again
I believe very strongly that free will is tied to the existence of randomness. Without randomness there can be no free will.

From the little I've read it appears that true randomness does exist, in that there are experiments where all causally relevant variables are controlled and yet the outcome is still uncertain.

I'm not convinced that there is true randomness in the universe however, and I guess that means I subscribe to some sort of hidden variable theory with regards to the aforementioned experiments.

← PreviousPage 12 of 15Next →