I can't read the article now, but in my opinion the fact that it's so difficult to write robust shell scripts above a very basic level of complexity (e.g. do this, then do that, then do that, then quit) really means you should be scripting in perl/python/ruby/etc instead.
Yes, the overhead for anything quick and dirty is higher, but if you're writing libraries, you only have to write them once.
The only real benefit to writing something complex entirely in a shell script is if you can't control the environment it will run in, and you need it to run everywhere, and you can't make users install an interpreter, which are increasingly rare requirements, and even then you have to write it in `sh` anyway.
As someone who can't draw a thing, there's a phenomenon I've noticed that might apply. Every time I need to draw something out, I try to hold it clearly in my head, where it looks so complete, but of course it never works. My suspicion is that instead of actually seeing the details of what I want to draw in my head, my brain has filled them in with "here be details," which makes for a nice mental image but that doesn't really play so well on paper.
I also think the same thing happens when we write software with loose mental maps. Our brains fill in the gaps with "yadda yadda yadda," to make it feel complete, but really there's nothing there at all.
Practical suggestion that has worked for me is to use graph paper. Having the grid to align and separate things makes a huge difference. My non-graph-paper sketches look like something from a lunatic's diary in comparison.
I would be eager to try a whiteboard with a consistent faint grid to it.
+1. I can't draw a smiley face. Plain old graph paper has had a huge impact on my ability to put together satisfactory mockups. I have a pile of it sitting right next to me in fact. :-)
I know there are some asshole IP contracts out there, but I think even so a company would have a hard time claiming ownership of a project an employee did for someone else, in his own time.
> I wouldn't say the signup is prohibitive in any way
I would. I didn't sign up. The concept looked interesting, but there was no real information on this side of the sign-up wall. For me, there really is a mental effort in establishing One More Relationship with One More Website.
how about sticking an image of what the calendar will look like on the main page? there is really all that much to explain about the site otherwise -- it's simple. (the mental energy of having to deal with one more site we hope is mitigated by the fact that we email you, you don't have to remember to check out our site.)
"Never ascribe to malice that which is adequately explained by incompetence"
When I first learned to program (err, actually just to press buttons in an IDE, anyway), I had a "great" idea how you could make a site like Facebook, just simpler and better. Thankfully the friend I explained my idea to was more sensible than me at the time.
If a user logs in, and their work factor is the low one, authenticate them, and then calculate the new hash with the higher work factor, and save the new hash and work factor.
I don't think there's a local optima here. The gradient with respect to the individual characters always points you at the solution, from all states. Pathologically so, even. But it makes for a good learning problem since the problem space actually fits in human heads and you can clearly see what the GA is doing. When you fire a GA at a real problem you won't have that luxury.
> I don't think there's a local optima here. The gradient always points you directly at the solution, at all times, in all states.
Well, there are no local optima but plenty of global optima other than the correct answer, I think: "Hello, World!" and "!dlroW ,olleH" have the same fitness for example. So no, the gradient won't necessarily lead you to the solution.
Now, suppose we defined the fitness function instead as the number of correct characters plus the number of characters in the right place, then we'd have local optima and a better chance of getting to the optimum.
There is only one global optima with the defined fitness function, and is the one with f=0. There are different local minimum when there is no mutation (for example, if all chromosomes on the initial population don't have the letter W, it will be impossible to create the target unless mutation is used).
The other answers that you are thinking on have different fitness (the comparison is target[i] ?= guess[i]).
In any case, I like this examples because they currently show the process that the GA has to converge in a way easy to see/understand. Of course, in real life it is more used when there is no information of the function to minimize (optimize), or the function is not convex in our search domain, which can lead to getting stuck in a local minimum using other search methods.
I have always felt that the fancy name increased the interest on the topic.
Update Looks like the guy's description of his function is different from his actual function. You're right, there is a single global optimum and no local optima.
I guess "local optimum" wasn't the right word. I got suck in a configuration in which my breed() method couldn't get closer to the goal, because it was just shuffling around characters that existed at the start. (I had started with 1001 randomly generated 13-byte sequences.)
With GAs, you're frequently better allowing your breeding / mutation to make insane changes. Mimic reality: some changes flat-out kill the offspring immediately. Sure, you need letters... but allow breeding to slice the binary strings representing those letters. Otherwise you rely too heavily on mutation for changes, which is typically very slow.
Yes, the overhead for anything quick and dirty is higher, but if you're writing libraries, you only have to write them once.
The only real benefit to writing something complex entirely in a shell script is if you can't control the environment it will run in, and you need it to run everywhere, and you can't make users install an interpreter, which are increasingly rare requirements, and even then you have to write it in `sh` anyway.