HN user

thelastnode

76 karma
Posts4
Comments28
View on HN

Yes, the initial parts of the example could be accomplished with awk and xargs, but as the article goes on to demonstrate, even doing something like printing every nth element would be difficult.

I think the intent was for this to be more of a demonstrative example, and with a more complex, evolving, real-world processing pipeline, Akka streams could be really useful.

It looks like the TodoMVC[1] example has a bug:

1. Create an entry "foo"

2. Check the box, observe strikethrough on "foo"

3. Check the "check/uncheck all" box (left of input box)

4. Observe strikethrough still present on "foo"

Digging in to the code[2], it looks like the "model-less" tenet caused the CSS class on the text and checkbox to go out of sync. In React, this would be a re-render and change in the virtual DOM, or in Angular, both would be bound to a shared model/scope.

If the simple TodoMVC example has a bug like this, the framework might not work too well for larger applications.

[1] http://t3js.org/examples/todo/

[2] https://github.com/box/t3js/blob/gh-pages/examples/todo/live...

True, but sometimes there isn't a choice, e.g., working with a clowntown library, poorly designed legacy code, etc.

I like to put a summarizing comment in the code for lines that require justification like the ones you mention. That way the discussion happens on GitHub and the conclusion is in the code, where future developers will see it.

Overthinking 14 years ago

Even in the movie 3 Idiots, at the end of the movie, the man with the pen points out that there's a reason for the complexity: bits of graphite flying around in zero gravity near instrument panels and people's eyes, etc.

Simplicity is great, but sometimes complexity is warranted. More importantly, assuming other smart people (many other smart people) are wrong without deep thought is not a good idea.

Why?

While I have worked through a decent amount of CLRS myself, I think there are much better ways to learn how to solve algorithmic problems. For example, programming competition books like Programming Challenges[1] forces students to solve real-world-ish problems according to performance constraints - a time constraint, either artificial (e.g., problem statement requires execution within 2 seconds) or actual (e.g., choosing an algorithm that is too slow means the sun will burn out before the algorithm terminates).

Books and contests of this nature teach algorithmic thinking, which is far more important than the actual algorithms themselves. It also provides a context for implementing these algorithms, which means the student gets to see the more practical aspects as well: testing it on corner cases, fighting with the chosen implementation language, relying on compiler optimization, etc.

If the goal of the undergraduate program is to develop practitioners of computer science, or even graduates headed for academia, algorithmic thinking is essential. I don't think CLRS is necessarily the best way to teach that, and it certainly isn't the only way.

[1] http://www.programming-challenges.com/pg.php?page=index

Regarding the Coffeescript-Javascript difference, Coffeescript and Javascript can be used transparently in node. Once require('coffee-script') is run, the module replaces the require function with one that can load both Coffeescript and Javascript.

This means that if there is a file ./lib/foo.coffee, the following code in bar.js will work:

    require('coffee-script');
    var foo = require('./lib/foo');
Yes, some people may not like Coffeescript anywhere in their project, but this functionality makes it easy to add Coffeescript to an existing Javascript project or use Coffeescript modules as a blackbox in a Javascript project.

How does this compare to Heroku?

Neither seem to support WebSockets (though the Heroku article I found was a bit dated[1]) for the time being.

From the article, it seems like AppHarbor doesn't automagically pull in the dependencies from the package.json, which Heroku does.

Add-ons wise, there is a lot of overlap, but Heroku definitely has more at the moment.

Heroku lets you run one-off processes, which is nice for debugging. I couldn't find this functionality on AppHarbor.

[1] http://blog.heroku.com/archives/2011/6/22/the_new_heroku_2_n...

Code Year 15 years ago

A fix to the halting problem?

Jokes aside, timing out would be useful.

For find, you need to use single quotes so your shell doesn't automatically expand the .java glob into the names of all the files. Also, find uses one dash for parameters, and can take an exec parameter: find . -name .java -exec wc -l {} \;

The {} means "replace with filename" and the semicolon (escaped so your shell doesn't eat it). This will run wc -l <filename> for every file that matches.

The -regex flag lets you do the same thing as -name with regular expressions.

The problem with this is we run n different wc's, as opposed to just one with all the parameters. We can use xargs to fix this: find . -name .java | xargs wc -l

This even gives you a total!

The really* simple solution (which is probably best) is to just use shell globbing: wc -l *.java

While find and xargs are definitely useful, the easy solution here works better

This is an interesting alternative to StackOverflow, though I think that you might be able to hit a wider and more skilled audience in an already established community.

This also works with live camera feed because of how OpenCV handles video streams. You can extract frames from the stream and then run the same face detection code on those extracted frames.

This is a great post given that a lot of the OpenCV functions, while powerful, are either missing documentation or have outdated documentation.

I definitely agree; it's just a matter of finding the right people.

Anecdote: attending some of the tech talks that companies give at Tech, there is always a gradient of people, from the people that are there for free food to the people that are there to ask questions and get something out of it. These tech talks are thinly veiled recruiting events, and the latter set of people are always approached afterwards for interviews or networking purposes.

No idea where this came from (or if it's a good idea to feed the trolls; "hn_is_dumb" - really?), but Tech does have the policy to accept most and then fail out those who don't belong there. Only 29% of incoming freshman graduate in 4 years.

I'm glad Tech has this policy because there are lots of bright people here that did the same thing I did in high school and they do well here for similar reasons.

This is the problem that I had when I was applying to colleges: I used to ignore classes that bored me but were required and instead spent time that should have been spent on homework, etc. doing programming side projects and learning CS concepts.

When application season rolled around, I had to compete with candidates who had a much shallow understanding of their area of study, but had a much stronger overall GPA, loads of random APs, etc. While I did mention my side projects and depth in my area of interest, I didn't think to submit code or the actual projects; I usually just mentioned it in the questions or essays (which I'm not certain anyone even reads). This lead to quite a few rejections.

I'm at Georgia Tech now and doing well, because all my classes, more or less, are related to what I'm interested in. While I'm very happy here, I'm curious if I would be as happy if I wasn't accepted to Tech, and were instead studying in a place without such abundance of opportunity. I'm sure there are others in similar situations.

The regular way to do this would be just trudging through them after grouping by date or something.

A cooler way (albeit significantly harder, at least until it's working) way to do this would be to consider it an AI classification problem... maybe with enough training (as you go, since you'll be organizing anyways), it can start to suggest categories, so you can just hit accept as you fly through your pictures!