HNHacker News
TopNewBestAskShowJobs

rapala

228 karma · joined December 20, 2010

[ my public key: https://keybase.io/rahcola; my proof: https://keybase.io/rahcola/sigs/sIb3yWKlDdFiRFkLyIA7q0RyqUeceOLN168-HM9tbC4 ]
submissionscomments
rapala··on The latest chapter for the self-driving car: mastering city street driving
I think that autocars will actually surpass us in the exceptional situations very soon. Humans are notoriously bad at handling high stress, high speed situations where fast assessment and precise actions are required. Evading an animal on the road would be an example. Because such situations are by definition rare, we cannot gain experience in handling them. The few evading lessons in driving school are no way near enough.
rapala··on “Mostly functional” programming does not work
The semantics of >>= do not depend on the laziness of the language. >>= behaves exactly the same in Scala (although it's called flatMap there) as it does in Haskell. >>= does not execute effects, it only composes them. So to correct the article:

The infix application function (ma>>=\a->f(a)), commonly called bind, composes two computations. When the resulting computation is executed, ma is executed first, f is called with its result and finally the computation returned by f is executed.

rapala··on Getting Lazy with C++
I'm pretty sure C++ (and any language for that matter) has more than enough quirky features to obfuscate any piece of code. No need to read this article for that. But if 20 years of experience makes lazy streams seem unfit for production, then someone has spent 10 years burying their head so deep in the sand that their feet are barely showing. Java's iterators, Python's generators, you work with them even in C. And is it not obvious that one needs to really know what they are doing if they are working as a professional developer?

The example of the article was simple of course. But solving the problem of printing Pythagorean triples was not the aim of the article. The aim was to show what makes lazy streams tick, to show that they can be implemented in C++ and that an uniform interface can be provided with functor, monoid and monad. Finally, the simple problem was solved with the new tool to show the inversion of control.

PS. std::vector is a stateful functor.

rapala··on Scalable Program Architectures
So stage is some transformation of the file and a working directory

  data Stage = Stage (File -> File) Directory
If we want to construct chains of Stages where we can still inspect any individual Stage, a monoidal composition wont cut it for the reason you stated. But this raises the question. What is the monoidal composition of Stages?

Well first of all, we must do something about the parameter Directory because the second type parameter must be a monoid too (the transformation function all ready is). But lets assume that it is, and see what we get.

  mconcat (Stage f dir1) (Stage g dir2) = Stage (g . f) (mconcat dir1 dir2)
  mempty = Stage id (mempty :: Directory)
So so if we can create a new directory from two directories, we can compose two Stages to a new one that uses the newly created working directory. Or if the second parameter of Stage is a list of directories, the new Stage uses two working directories. They aren't the idea of chains that you had in mind, but they still sound useful, at least to me.
rapala··on Data Structures in Clojure: Binary Search Trees
Mutable fields are really hard to use correctly in any language, and that's why Clojure encourages the use of immutable data. Thus I find it really odd that the article builds a mutable binary tree. The immutable version would have been equally simple. And now you can't put that tree into any of the Clojure's reference types (ref, agent, atom).
rapala··on 0^0
The number of arrows is |students x teachers|, every student paired with every teacher. From this you get a^0 = 0, but it also follows that a^b = b^a. This defines multiplication, not exponentiation. The problem is that you cannot illustrate the assigment where Eve is not paired with Bob using an arrow, but only by not using a one.
rapala··on What it is like being the only engineer in a meeting [video]
Um, because the stereotype of an engineer is a male, Japan is often associated with engineering and having the engineer be the only one of visually different nationality emphasizes the divide between techinal and non technical. Yes, it is horrible typecasting like every character in that clip and that is the point.
rapala··on Big data: are we making a big mistake?
At first I thought so too. But it's actually easy to come up with cases where N != all. As a radical example, Facebook preserves the accounts of dead users.
rapala··on Clojure 1.6 released
I agree that contracts don't offer something stronger than unit test. They offer something different. Of course you can't write the unit test that I asked and that was the point. But it would be kind of pointless too to write the test that checks that an exception is thrown when sqrt is called with a negative argument. It's trivial to see that happens by looking at the code. How sqrt fails is not interesting either, as you are not supposed to recover from that. A pre-condition is a way to specify that. It says: "Don't call me with a negative argument, just don't."
rapala··on Clojure 1.6 released
How do you write a unit test that tries to assert that no one calls the function sqrt with a negative integer? Because that is precisely the case where pre-conditions can help.
rapala··on Objective Next
During development is probably the best use case I can think of. With editor integration an interpreter is a tremendous help when coding. At least Lisps, Ruby, Python and Haskell have this kind of "development environments' to a some degree. I think GHCI even doubles as a debugger.
rapala··on Objective Next
I don't see a reason why a modern language, static or dynamic, could not have both a compiler and an interpreter. Most Lisps have both, Haskell has both. Also, most interpreted languages actually have a compile phase before the actual interpreter.

I do agree with you on that any platform should have a staticly typed language as a first class citizen.

rapala··on Objective Next
Most of the time it's not the CPU that is using most of the energy. It's the mobile or wireless connection, the GPS and the screen.
rapala··on Before you Dual Boot – MS, OEMs and Linux
It's the classical problem of a standard that nobody actually follows. Every UEFI firmware that I have come across has behaved differently.

My current laptop has an UEFI implementation that only boots from a hardcoded path in the EFI partition. You guessed right, the path of the windows 8 bootloader.

The UEFI in my home server overwrites the UEFI boot manager list every time you save & exit the configuration tool.

If I remember correctly, the UEFI implementation of a MBP that my friend and I tried to make dual boot Ubuntu required a blessed HFS boot partition for every OS.

rapala··on Student Loans Are A Drag On The Economy
If we were to combine this and the gp's system, won't we get into a situation where it is best to burn your degrees and just claim you know phd's worth of stuff? And then sue if someone with a degree got the job.
rapala··on NYPD rejects request for its freedom of information handbook
For secrecy and privacy of course. Do you want to hold the list of undercover operatives in hostile countries? How about making public a list of people who have received social protection? I don't know about the system in USA but how would you like if a report of your earnings could be requested from the IRS?
rapala··on Lack of exercise kills roughly as many as smoking, study says
You came here angry with the world because walking 20 minutes a day doesn't make a dent in the fat and running hurts. Well, here's the response.

Of course running hurts if you are overweight. Your bones and tendons are not made to support that much weight and neither are your muscles if you have been neglecting them. Bodies get neglected, that's what happens to them when they get old. If you really love running like you said, then drop some weight and start running. Do, don't cry. Walk more. Use nordic walking poles. Swimming is an excellent low-impact sport and so is water running. Walking 20 minutes with decent pace burns around 500-600kcal for someone weighting 120kg. That's a half a can of Pringles. You need to be really careful with what you eat if you want to drop weight with just that.

rapala··on How I Ended Up In Solitary After Calling 911 For Help
Just a couple of days ago I was having a conversation with my friends about police brutality in the USA. We dug up some articles from US news papers with searches like "police shot" and "shooting". In most cases it seemed right that the police used force. In most cases the amount of force was way too much.

The latest case of a police using a firearm here in Finland was when a man was walking in a populated pedestrian way carrying a knife and a pistol. He didn't comply with orders to lay down his weapons and was shot once, in the leg. One of the first questions in media was whether an electroshock weapon could have been used in stead. The use of a firearm in a populated area was also questioned. These sort of questions didn't seem to be asked in the articles from USA.

The OP's case was from the other end of the spectrum. He may have had the smell of beer in his breath and didn't comply with the order to leave the scene. The police tackled him done and handcuffed him. One explanation given is that the officer was on a power trip. But it also seems that the police was having difficulties in adjusting their use of force. They dragged away a man who was supporting an injured person. They tackled OP for not complying with an order to leave.

After reading those news articles my friends and I started think about the training that police officer receive in the USA. How much time is used to teach giving orders? How much time for hand-to-hand combat and controlling a person with or without a weapon? How much time is spent in the firing range?

rapala··on How I Ended Up In Solitary After Calling 911 For Help
This was my first reaction as well. If a call comes in of a bicycling accident, why would the 911 dispatcher send a fire truck and multiple police squads to the scene?
rapala··on John Yudkin: the man who tried to warn us about sugar
Sometimes it seams that people are interested in these technical and highly specific debates on how to eat right to avoid responsibility. They want to "know" that eating right is so difficult and badly understood that it can't be done without a special diet. When they then select a diet and it works, they attribute it to the diet and not the utmost care that they followed the diet with.
rapala··on The Death Of Expertise
Yeah, I agree that not every subject is worth arguing about. But if discussion is what you are after, then you need to know what you are talking about, or against. The nuclear program of Iran is a great example. You have done the research to know that those who are experts in the matter don't think Iran has a nuclear weapon program. The others are not prepared for the discussion.

(This certainty about Iran was actually news to me.)

rapala··on The Death Of Expertise
> Do I need to know the 12 Astrological Houses to reject astrology? Do I need to know the King James Bible to reject Christianity? Do I need to know Mein Kampf to reject Nazism? Do I need to know the Talmud to reject Zionism?

Well, that is the catch. You don't need to know anything to reject something. But to argue against something, to have a discussion, requires you to know what you are arguing against. But things like Christianity and Nazism are poor examples. Christianity is not factual, it's personal and spiritual, unless you want to talk about theology. And about Nazism I know too much.

rapala··on Why Are There So Many Pythons?
http://www.haskell.org/haskellwiki/Heterogenous_collections lists some solutions
rapala··on Google's vs. Facebook's Trunk Based Development
But you are doing a merge possibly every time you push to the trunk, are you not? So if I got it right, the difference between branch based and trunk based style is how long you let your branches to develop, both in time and commits. The one extreme is a branch for the whole release and the other is a "branch" for just a one commit. Feature branches would be something in between.

Now the problem with long branches and painful merges sounds like a communication problem between the master and the branch, just at the level of the code. We know that at the level of people timely and terse communication is key to a successful project. So the same would kinda make sense at the code level too.

rapala··on Why I am switching to promises
It's from a retrospective on Haskell: www.cs.nott.ac.uk/~gmh/appsem-slides/peytonjones.ppt

There seems to be two arguments against laziness. Firstly, it makes reasoning about performance hard. Secondly, forcing strict evaluation is tricky, maybe harder than it would be to do optional lazy evaluation in a strict language.

rapala··on Why I am switching to promises
Then again, Simon Peyton Jones has said that were he to make a new Haskell, it would have strict evaluation. As far as I know, lazy IO is considered a pain in the butt. That beeing said, laziness does have its merits and some ideas can be elegantly stated in a lazy language.
rapala··on Go’s Type System Is An Embarrassment
So why do we pass that work from the compiler,the tool, to the programmer? Except that I think I know the reason, as I have looked upon the specification and it was not sane.
rapala··on The Online Education Revolution Drifts Off Course
Yeah, 30 is too much. I think 16 is an upper limit and even then you need to break it into groups of ~4 to actually have small group teaching. Of course the universities never have money for that many assistant teachers for the bigger courses. The point is that the group needs to be small enough so that people can get to know each other. Then you can have a relaxed atmosphere and then the real discussion can start.

I think we are on the same page about your last paragraph. You are right, you face a problem of a same kind that I wrote about when learning in a group. Someone seems to know the material well, they are confident and maybe even charismatic. They go through their solution and everyone just nods and agrees.

The trick is to get everyone tell their solution (maybe not for the same problem) and have an atmosphere where people feel comfortable correcting and getting corrected. That is a key responsibility of a small group teacher.

The "peril" in self-study is a bit different. You may find your enlightenment but how do you know that your mental model is correct?

rapala··on The Online Education Revolution Drifts Off Course
I'm just replying to your comment agumonkey as it has some key points that I want to address. Nothing personal.

I work as an assistant teacher every now and then and it is mostly small group teaching and going over the homework exercises. What I have seen is that the first couple of sessions are totally worthless subject wise. But they are extremely critical. During those sessions the students learn to know each other and me. When everyone is comfortable attending the sessions can the actually learning begin.

From this perspective I think MOOCs would need the following. Firstly, you need to create small enough groups of people that are comfortable discussing the subject with each other. Encouraging local study groups is a one way of doing this. The other thing is to encourage discussion through anonymity with forums or IRC. And you need to acknowledge that you don't reach all of your students with these methods and not rely on them too much.

> I personally like to learn in isolation, I have a tendency to quickly ~plagiarize ideas of others thinking I understand, so learning alone in my room is better.

There's nothing wrong with self-study per se, but it has a one great flaw. It is easy do the kind of plagiarization I think you are talking about without knowing. This can be remedied by getting feedback from an instructor, or going through the material with someone else and then cross checking how you understood the ideas.

rapala··on The lie of the API
The human API also exposes data objects. It also sends extensions (CSS, Javascript) to the client that allow it to present the data and make additional API calls. This idea of extending the client program is part of REST.

The machine API also handles interaction and relations. The representation of a collection object will contain URLs of the elements. There should be hints on how to compose a request that updates the object.

← PreviousPage 3 of 6Next →