HNHacker News
TopNewBestAskShowJobs

St-Clock

721 karma · joined October 9, 2010

Creator of Py4J, pylinkvalidator, and Partial Program Analysis for Java. CTO at Resulto http://www.infobart.com https://github.com/bartdag/ http://www.resulto.ca/
submissionscomments
St-Clock··on MongoDB 2.0 Released
The system you describe, recording events and replaying events to get the actual state of the system, usually assumes that you can only write one event at a time (writes need to be super cheap). If you can write multiple events in parallel, you won't have isolation and you may read tension documents that will be voided (in your example).

You could use optimistic concurrency control to ensure that only one tension document is written at a time while ensuring that your constraints are respected:

  current_id = atomic increment global state_id
  create tension document (but with active bit set to false)
  check constraints
  atomic:
    if global state_id = current_id
    set active bit to true
  if active bit is false:
    delete tension document and report error
This would provide isolation (you don't see tension documents that are not yet validated) and consistency (your balance is respected).

The atomic operation in RDBMS is usually implemented in one very simple and fast SQL UPDATE query. I believe mongo must provide something similar too.

Although my bank would allow me to overdraw from my checking account, I have a higher margin/tolerance than my brother, so they must perform some constraints check ;-)

St-Clock··on Krugman on BitCoin
> I'm not sure Krugman's reputation is as reputable as you suggest

I know that winning the Nobel Prize is not the end of the world and that there are often political motives behind these prizes (Obama anyone?), but between believing a guy who won a Nobel Prize in economics vs. believing a random guy on HN with no real argument, the choice is easy (to me at least).

To the best of my knowledge, Krugman rarely (if ever) hurls ad-hominems: he always tries to explain why he strongly disagrees with conservatives, tea party, or Obama. The adjective he uses for them almost always fit his explanations.

St-Clock··on Python Tools for Visual Studio
Thanks for the tips. I may be working soon in a windows shop (who deploys on Linux.. ahhhh) and I'm looking for these tips to stay sane.
St-Clock··on Python Tools for Visual Studio
> what additional tools to you want

A real POSIX shell that isn't slow. A fast gcc and the like.

It is a pain to compile psycopg2 and lxml on windows compared to linux. Cygwin and virtual machines are unfortunately too slow when you are used to working in a non-virtualized Linux environment.

I'm heavily biased though because once you are addicted to the command line, it becomes very hard to live on Windows :-(

St-Clock··on Java creator James Gosling joins ocean robot maker Liquid Robotics
I'm really glad for James Gosling. It is always sad when you see these brains wandering around and not knowing what to do with their skills.
St-Clock··on Learn Vim Progressively
Yes, I don't see these often and it seems that they are powerful learning aids. Full-fledged videos/screencasts are hard to search and index while screenshots are bad to show actions.
St-Clock··on Current Mobile Patent Suits - Graphic of the Day
The graphic would be much more interesting if we could see the indirect links targeting Google. I believe that patent suits targeting B&N and Samsung (a subset maybe) are really targeted toward Google.
St-Clock··on To my fellow Hacker News contributors
Yes. Even if I partly disagree with you, I upvoted you. Actually, I find myself upvoting comments that are in a negative territory and that present a valid point more often than good comments that are in a positive territory!

I believe we need upvotes for the reasons hugh3 mentioned. Regarding downvotes, there should be a cost, like with StackOverflow where each downvote costs you one reputation point.

Another orthogonal dimension to voting could be agree/disagree. I saw this on a national news forum and it's quite useful (e.g., 5 people agreed, 100 people disagreed).

St-Clock··on Rob Pike on regular expressions in lexing and parsing
I agree and disagree:

"If I were to write out an explicit loop over the characters of the string, I would be a lot more sure that I wasn't accidentally dropping characters due to an inadvertent failure to make the regexp exhaustive"

This is why regex comments exist. For any non-trivial regex (more than a two or three characters), you should break down and document your regex. Otherwise, it's worse than a 1000 character-long perl one-liner.

"it's a lot easier to accidentally write an exponential-time algorithm in a regexp than in a nested loop"

So true. I did not realize it was possible until I made that mistake. Debugging these cases is extremely difficult. For two strings that look similar, the same regex can go crazy on one. But this happened to me only once in the past three years (time when I started to heavily rely on regular expressions for a project).

St-Clock··on Thoughts on Designing a new Web Apps Language
clojure is not statically typed.
St-Clock··on How To Become A Better Programmer By Not Programming
You are right: genetics can certainly give you an edge and this is briefly mentioned in the book.

But do you mean that someone without the right genetic sequence can't play music? Or do you mean that someone with the right genetic sequence but who never does deliberate practice will be better than someone who has practiced 6 hours per day for the past 20 years under the best masters?

I think you don't mean that and the book did not mean that everyone can be star.

I'm sure some programmers are advantaged by their genes, but saying that all the bad programmers don't have the right genes and should look elsewhere is another thing. I would prefer to look at their learning practices and motivations before studying their genes. I'm sure I would have a lot more success than a geneticist in this case.

St-Clock··on How To Become A Better Programmer By Not Programming
Since I'm recommending books today, I really liked "Thank You for Arguing" by Jay Heinrichs. Very fun and instructive intro to rhetoric.

I can see how rhetoric (and religion!) can come into play in design meetings :-)

St-Clock··on How To Become A Better Programmer By Not Programming
I completely agree with you that some people, right now, cannot think in abstract terms. My point though, is that they could learn it through deliberate practice, unless they have a severe medical condition that affect the way they think.

Maybe they don't know they can learn it (possibly because others have told them that they would never get it), maybe they try hard but fail to do deliberate practice (which is different than programming every day), maybe they aren't interested and still want to have a programming job (that's a problem and they should be redirected to a more appropriate position).

Another book I really like to recommend for people who hate maths or don't understand them is Innumeracy by John Allen Paulos. It really helps you get a more positive view on maths. The sequel, Beyond Numeracy, is less groundbreaking though.

St-Clock··on How To Become A Better Programmer By Not Programming
"I agree with Bill. From what I've seen, there's just no crossing the skill chasm as a software developer. You've either got it, or you don't. No amount of putting your nose to the grindstone will change that."

This is a very condescending look on humanity and I did not know that Jeff had said such things.

To anyone thinking the same, let me introduce you to the concept of deliberate practice (how to really improve a skill) and please, even if it wasn't published then, read "Talent Is Overrated" by Geoff Colvin. This will probably change your perception on things like excellence, creativity, so-called "talent" and whether it's true that you must be born a genius to become one.

And by the way, that does not mean that everything is an american dream and that anyone can become a self-made person. Geoff shows through many examples and studies in his book that superstars in music, sports, and science had an exceptional learning environment in their childhood. They did not suffer from hunger and extreme poverty. He also talk about a study that demonstrated that ordinary people could increase their short term memory (remembering up to 100 items if I recall correctly, no pun intended) by doing deliberate practice.

St-Clock··on Apprenticeships - Employers Must Get Past Degree Snobbery
"What you fail to realize" <- ?

First, I believe there is a cultural difference between Canada and the US. In Canada, a Master's degree is typically not a professional degree and you usually cannot buy a M.Sc. Typically, half of the credits come from courses and the other half (often even more) comes from your thesis. I don't know about the situation in the UK, the author's country of origin.

Second, I TAed and taught programming, algorithms, and software architecture courses for undergrads, Master's and Ph.D. students so I'm well aware of the advantages and limitations of higher education. I saw students in an advanced architecture course who did not know what a thread was or who had never written a single SQL query. Well, they learned it in my course.

The graduate students that I described aren't rare. At least 75% of the Master's and Ph.D. students in the SE lab and PL lab at my university match that description. Maybe they would have a hard time building a web application in a day, but I think they have demonstrated that they can learn pretty complicated things and that they will learn how to solve your particular technical problems.

I felt the article was really about "degree snobbery", meaning that the author promoted snubbing people with degrees. I understand the frustration of people without degree who need to prove every time that they don't need one. But I don't believe that having a systematic negative bias on candidates with a degree is wise either. Honestly, does it make sense as the author says that someone with a bachelor in C.S. don't know how to implement a binary search (see [1] for a possible explanation)?

Regarding the vocational training that needs to be removed from higher education, I believe a compromise is needed. I agree that you cannot efficiently learn development process and all the latest languages and frameworks at school. But you need to learn some good programming skills and software engineering practices, otherwise, it is a lot harder to understand and play with more complex concepts and it is also more difficult to bring a significant contribution if you do a Master or Ph.D. later.

[1] http://www.skorks.com/2010/10/99-out-of-100-programmers-cant...

St-Clock··on Apprenticeships - Employers Must Get Past Degree Snobbery
Well, here are a few quotes from the article that seem to target students who have more than a bachelor degree:

"So much so that, for some subjects, employers now require at least a Master's degree."

"I think CS and SE lecturers could learn a thing or two from me about writing good software."

"Many of the CS graduates I know suck as software developers, too."

"Hiring a computer science graduate for a programming role is, to me at least, like hiring a theoretical physicist to fix your car. "

"Just as there are countless CS graduates who have a theoretical grasp of compiler design but have never design a language or implemented a compiler."

St-Clock··on Apprenticeships - Employers Must Get Past Degree Snobbery
So the solution to increased cost of education is apprenticeship? Is this part of the current trend at bashing higher education to make sure that we become obedient but efficient drones?

There is a lot of things broken in higher education, but saying that hiring a CS/SE graduate for a developer position is like hiring a theoretical physicist to repair a car is disingenuous at best.

Guess what, graduate students who write a compiler as part of their course, who are working on a vm for matlab, who are improving IDE auto-complete based on all sorts of algorithms, who are devising a new distributed merge algorithm and evaluating its performance through hardcore network simulation, well, they know how to program! As a bonus, they know how to apply the scientific method and be rigorous when they report a result or an improvement. They have been exposed to all sorts of things that an undergrad don't even suspect their existence.

Sure, some grad students aren't good. Sure, people who don't go to college/grad studies can end up being way better and knowing more than grad students, but don't discredit a degree because you believe that it's too theoretical. Just ask about the homeworks, the projects, and the thesis the grad student worked on.

St-Clock··on Google Buys Motorola For $12.5 Billion
Maybe Google did this partly to acquire patents from Motorola mobility (I don't know if they have any, but they must).
St-Clock··on Secure your browsing using a home VPN
Hum, I see this on your privacy policy page:

INFO WE COLLECT

From Clients of our Service

Date and time you connect/disconnect to/from the service. Source IP you use to connect to the service. Bandwidth usage E-mail provided by Paypal. Paypal payment data.

And then this:

DISCLOSURE

If under subpoena, PrivateInternetAccess.com may release data in order to comply with legal obligations or in order to enforce the PrivateInternetAccess.com Terms of Service and/or other agreements.

PrivateInternetAccess.com may release data in order to protect the rights, property and/or safety of PrivateInternetAccess.com, its constituents, and/or other visitors and clients.

St-Clock··on Google Please Hire Me
I think you are. I took the mustache very seriously.
St-Clock··on Vim & Python: Making yourself at home
Actually, I found vundle (https://github.com/gmarik/vundle) to be slightly easier to use.
St-Clock··on Sublime Text 2 Build 2091
For an updated thread on vim bindings: http://www.sublimetext.com/forum/viewtopic.php?f=6&t=221...

Github code: https://github.com/lunixbochs/sublimevim

Will try it later today.

St-Clock··on NoSQL is What?
I really like this idea of basing your decision on the need to normalize or not. It certainly fits document-oriented databases and key-value stores, but I'm less sure about column-oriented databases (I have no experience with them, except many hours trying to understand them...).

The single-purpose vs. multi-purpose that comes from denormalization vs. normalization would explain why certain companies stick to RDBMS for their main data and use NoSQL only for certain specific scenarios.

St-Clock··on Stop hating Java
You did not hear about observer, but you probably heard about publisher/subscriber (most gui frameworks use this, even wxPython with pubsub).

Adapter is a generic name. Compatibility modules that enable python code to run with python 2 and python 3 are adapters. For example: https://github.com/bartdag/py4j/blob/master/py4j-python/src/...

As for the visitor pattern: http://docs.python.org/library/compiler.html#module-compiler...

St-Clock··on Stop hating Java
You are right. The GoF only promoted bloated code. Who in their right mind would use patterns like the Observer, the Adapter, or the Visitor?</sarcasm>

Not sure if you know the history, but the authors of the book really only collected the patterns that they had seen around them in Smalltalk and C++ code. They wrote a catalog so we could all refer to the same name instead of using different names for the same concept. They identified the common problems that these patterns tried to solve and they also identified the trade-offs. Oh yes, they identified trade-offs!

Unfortunately, many developers thought that they had to put as many patterns as possible in their code, which was not the intent of the GoF. Ralph Johnson said that they received emails like "I have now used 15 patterns in my project, do you think we should use more?"

Andrzej mentions in his blog post that Java (and C++) lacks dynamic capabilities so this is why sometimes, you need these design patterns to make your code more easily extendable. Other patterns are good even with dynamic languages (observers...).

St-Clock··on Stop hating Java
"it didn't really live up to the promise of write-once-run-anywhere"

Care to explain this one? All the code I have written for the past 10 years do not need to be recompiled and can run on Windows/Linux/Mac/*BSD 32 bit/64 bit. And I used IO, NIO, sockets, threads, files (not necessarily high-level stuff).

St-Clock··on Why I Hate Frameworks
I commented on that elsewhere. It's more like a continuum. Many libraries will offer callbacks and some are just based around callbacks. Some frameworks need to be called too. For example, IoC frameworks in Java often needs to be called/initialized/configured first (and then they do their magic).
St-Clock··on SQLAlchemy and You
Look at the trend for Britney Spears compared to PostgreSQL (http://www.google.com/trends?q=britney+spears%2C+postgresql&...). I'm not sure what to make of it because Britney Spears and mongodb do not offer a tenth of the features of postgresql, yet they are clearly more popular.

In computer science, I believe everything can be seen as a graph so of course, graph databases are a great fit for every problem. Object databases were also a great fit for objects. But where are object databases now compared to relational databases?

It's great to have so many options now and it's great to see nosql databases giving ideas to sql databases (http://momjian.us/main/blogs/pgblog/2010.html#April_10_2010_...). Although relational databases might be less elegant for immediate programming problems, they are far more flexible when new needs emerge and their ACID properties have a far better track record than most (if not all given their age) nosql databases.

St-Clock··on Nginx established as a company
I believe nginx users are more likely to build nginx from source than apache considering that nginx modules need to be specified at compile time and the more you add modules, the more your performance might suffer (unless this has changed lately).

This is probably why there are many nginx packages in ubuntu repositories (nginx-light, nginx-full, etc.).

St-Clock··on Nearly Half of All College Grades Are A's
I agree with you that a machine may someday make a more "rational" vote than the average voter. We had quite an experience in Quebec recently...

That being said, your solution does not improve humanity. It does not make the voters (or the students) better understand their world. It's just a bandaid to hide their ignorance.

← PreviousPage 4 of 6Next →