Tesla Rolling Out Autopilot Software Updates to 1000 Cars - <AUTHOR> https://www.bloomberg.com/news/articles/2016-12-31/tesla-rolling-out-autopilot-software-updates-to-1-000-cars <comment><USER2> Headline seemed a bit vague to me, so what this update does is make cars released with gen 2 hardware inline with the autopilot features of gen 1 hardware. So lane assist, crash breaking, etc for cars released late last year.

Whole point of gen2 hardware is it should allow fully autonomous cars, even in rain which others likely wont be able to do, once the software is fully figured out. Next year will be exciting to see how quickly they can push updates towards that goal, as well as how quickly regulation can catch up.

<comment><USER3> Essentially.. except possibly the most used feature: autosteer on HW1 works up to 90MPH on highway (but since the recent update it is now limited on non- highway to the current speed limit on HW1), but with HW2 and this rollout it is limited to 35MPH. This is being called "Low Speed Autosteer (Beta)".

[https://www.garyshood.com/tesla-autopilot- features/](https://www.garyshood.com/tesla-autopilot-features/)

<comment><USER4> something feels very uncomfortable about an "autosteer beta"

<comment><USER5> Also "we'll update 1000 cars first, see if it works, and then update the rest of the fleet"... Uhm yeah.. So 1000 happy Tesla owners are going to beta test it until the rest gets it. Good luck.

<comment><USER6> 1000 _willing_ owners, one presumes.

<comment><USER7> Did they also ask all the other people on the road who might be involved in crashes?

<comment><USER3> Have you tried the autopilot? If you haven't.. you really need to. It isn't as scary as you might think. It is essentially cruise control for the steering wheel. If you move the steering wheel just a few millimetres, it disengages.

The driver still has complete control, authority and responsibility. There is really no reason to assume there will be more crashes.

<comment><USER7> I think the problem with these assistance systems currently is that they lull the driver into a false sense of security and increase reaction times for situation that can't be handled by the computer. So even if they work as advertised, I'm not convinced that they are at least as safe as having a human at wheel constantly. That being said, I'm somewhat wary of running "beta" software on cars. I'd expect a complicated and costly validation step with some independent government body before modifications to these systems are allowed to go live. I don't know whether Tesla does this or not.

<comment><USER3> Whilst I only have empirical evidence to go on, I will say that when I have used autopilot.. I've felt like I am paying more attention as I am not distracted with keeping the car placed central in the lane and following the slight curves in the road. This means that more attention can be focused on situational awareness, of what is happening ON the road.

<comment><USER8> I feel the same about automatic transmissions - not having to worry about being in correct gear allows me to concentrate 100% on the road - but I'm usually shouted down by people who think that driving anything but a manual is not driving. All my cars for the past 7 years were manual, and now that I have an automatic I would never go back.

<comment><USER9> I'd argue that having to worry about the being in the correct gear actually necessitates greater awareness of the road conditions and situation. In a manual transmission vehicle you have to continuously anticipate what's about to happen (so you can select the correct gear), and so you're forced to pay attention to what's going on around you.

In general, I hypothesise that the more a system is automated, the less awareness is demanded of the operator and thus the more likely the operator is to get into some kind of trouble, whether this stems from development of a lazy habit, rustiness or just not being able to recover the situation if the automation abruptly fails. In fact, we've seen several plane crashes attributed to pilot error related to increasing automation in aircraft.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><AUTHOR> Is a Tesla bought today designed to be software upgradeable to full autonomy?

<comment><USER10> Yes, Teslas manufactured since mid-October all have the hardware for full autonomy[0]. It will be interesting to see how long it takes and what technical and legal hurdles are involved.

[0] [https://www.tesla.com/blog/all-tesla-cars-being-produced- now...](https://www.tesla.com/blog/all-tesla-cars-being-produced-now-have- full-self-driving-hardware)

<comment><USER11> Maybe, maybe not. Tesla still doesn't have LIDAR. Their sensor suite is still much weaker than Google's or Volvo's or Otto's.

<comment><USER12> Didn't the DARPA grand challenge show self driving was a software problem, not a hardware problem?

Tesla has a level 4 autonomy demonstration video on their site. Maybe computer vision is superior to LIDAR; not a lot of human drivers with laser arrays on them driving around.

<comment><USER13> Here's the winning car from the last GC:

[http://www.tartanracing.org](http://www.tartanracing.org)

Lots of LIDARs, lots of cameras.

<comment><USER14> The last Grand Challenge was in 2007. A lot has changed since then. Tesla's prototypes are doing what that car did, and quite a bit more, without any LIDAR.

Not to say LIDAR isn't essential. I think LIDAR will get cheap enough that it'll just be silly not to have it.

<comment><USER15> Tesla is doing highway driving and some turns without LIDAR. The point of LIDAR is to help you parse a complicated urban scene (and so far what Tesla has are _demo videos_ of urban driving). Of course you don't need LIDAR for the highway.

</comment></comment></comment></comment></comment></comment></comment><comment><USER16> I saw someone driving a Model X in Austin this weekend, car still had dealer tags. He was shooting selfies and clearly documenting himself riding in a car that drives itself. I'm happy he's happy... but I have to say it was annoying to drive behind him.

The software clearly didn't follow the flow of traffic; it was rigidly locked in going the speed limit. That may be OK, but it was a very empty weekend and everyone was going 10-15 miles over the speed limit. So had quite a chain of cars backed up behind him and like a half-mile in front of him before the next car.

It was clear the Tesla software wasn't smart enough to close the gap by accelerating above the posted limits, or move him over to the right-hand lane where he wouldn't block traffic -- we all ended up having to pass him on the right.

I couldn't help but think, "Great... just what we need more of... simulated old people driving slow in the left-hand lanes and cars that encourage jackasses on their phones to take pictures instead of paying attention."

But... to be clear, I still want one. =P

<comment><USER17> > everyone was going 10-15 miles over the speed limit.

Is that acceptable or are you breaking the law?

<comment><USER16> Acceptable, as long as safe. Texas allows for judgment calls up to 25 mph over posted limits.

</comment></comment></comment><comment><USER18> BSOD is now literally a scary real possibility

It gives a new meaning to the word "crash"

<comment><USER19> In the same way that some people are irrationally more afraid of flying in a commercial airline than driving the same route.

<comment><USER18> You dont make 'over-the-air' updates on avionics buddy

<comment><USER19> Which is why cockpit controls and flight planning is stuck in the 70s.

<comment><USER18> For a good reason - safety</comment></comment></comment></comment></comment>


Coffee With Startups  - <AUTHOR> http://steveblank.com/2009/08/20/coffee-with-startups/ <comment><USER2> His Rule #2 really bothers me. To test whether or not a traditional application will work on the web he suggests actually writing the application... (albeit in rapid releases)</comment>


The 3-minute SQL indexing quiz: Can you spot the five most common mistakes? - <AUTHOR> https://use-the-index-luke.com/3-minute-test <comment><USER2> Hmm, I got 5 out of 5 for the Postgres, but the questions seem pretty easy for anyone who has dealt with trying to create useful indexes in different databases and debugged slow running queries on an index.

`EXPLAIN` is probably the most useful word in all of SQL. I didn't know how to read `EXPLAIN` results for the first few months of first starting to work with raw SQL for the first time. It made life so much easier when I could just take a query, throw an `EXPLAIN` in front of it, and have an answer as to what was being used to fetch my data.

<comment><USER3> I got 5/5 as well. My only hesitations were, "Is this a trick question? Like, is there some little-know feature where they've special cased this so that something that doesn't seem like it ought to work actually does?"

<comment><USER4> I was on the fence for the "not enough information" question because I thought that for outlandish examples I thought there might be a chance the second one was faster, but I thought that the 99.5% case was covered.

I feel kinda robbed.

<comment><USER2> Yea, I was a little unsure about that one, but realized that the columns in the `SELECT` were the indexed column and a `COUNT` making it index-only scan. Even if the `SELECT` included `b` it still would've slowed down things a tiny bit, but I think I would've chosen "Doesn't really change performance" in that case.

<comment><USER5> Playing devil's advocate here, especially for Postgres this isn't a clear cut case, as because of Postgres' MVCC implementation, depending on whether the rows were already frozen or not (caused by lots of mutations ongoing and not enough VACUUMs), it might have _either_ used an index-only scan (only from 9.2 on and only if most pages are visible-for-all, so the query scanner allows the optimization). In the other cases, it would have had to fetch all rows from disk anyway, in which case "not enough information" would have been true...

<comment><USER6> Nit-Pick: Freezing of rows isn't relevant here, just whether they're all- visible.

</comment></comment></comment></comment></comment></comment><comment><USER7> I would guess that at least half of the programmers where I work would have failed. I wonder how competent developers are at other companies with their SQL databases?

I can tell you that as a production DBA when I'm brought in regarding a performance issue, the stuff that I see makes me wonder how some people remain employed as programmers. Full table scans on 50M row table, no problem. Query the database 10,000 times because you don't want to run one query and parse the results, no problem.

I just want to scream sometimes!!!

</comment><comment><USER8> If you didn't get a 4 or 5 out of 5, you should go through this website, it's pretty awesome. It explains SQL performance really well, and provides equivalent examples for whatever database you use (including Oracle and DB2 in addition to MySQL and Postgres).

</comment><comment><USER9> I got 4 out of 5 for mysql. Should have given it more thought :-)

A suggestion: also mention that the correct results with an explanation are shown at the end. It was not clear to me and therefore I decided to answer just quickly. But maybe that is intentional ;-)

</comment><comment><USER10> How to get 5/5: Visualize a B-Tree that indexes the stated columns in the stated orders. Is the query faster to answer by traversing that B-Tree (where faster means looking up fewer records, or not needing to look them up at all)? Is there a different B-Tree we could build that makes this even faster? If you have problems visualizing a b-tree: any somewhat balanced ordered binary tree has basically the same properties.

Indexes are not complicated (at this level of detail). Maybe the bad results (only 40% got >50% right) are mostly a testament to the state of computer science education around the world.

</comment><comment><USER11> I'm also getting 5 out of 5 for the Postgres, but I think these questions are helpful. I'm not a DBA, but just guess with my knowledge when I take the database implementation course.

</comment><comment><USER12> I got 4/5 (background: C++/C# programmer who sometimes works with SQL queries). The one I got wrong was the first one; I thought the query optimizer would be smart enough to spot that the date function could be turned into a range query, but apparently not.

It's interesting to compare this with the 4th question, which more or less does exactly the same thing only with text instead of dates. They both have a WHERE clause that superficially tests the result of a function call but can be easily transformed into a simple range check on an indexed column. I don't know why the optimizer seems to be able to handle one case but not the other.

</comment><comment><USER13> I got 4/5 on PostgreSQL. I selected "Not enough information" on question 5, which is supposed to be the wrong answer. But I think it's the correct answer.

Depending on the distribution of the data in the table (e.g. all rows have a = 38, but no rows have b = 1), PostgreSQL will chose a Sequential-Scan instead of an Index-Only scan for both queries. This of course leads to the 2nd query being faster due to not having to aggregate anything.

[https://gist.github.com/felixge/af97c844cb1f24ac278e0357741c...](https://gist.github.com/felixge/af97c844cb1f24ac278e0357741c4ea9)

<comment><USER14> I don't agree. The same could be said for the other questions as well.

In quizzes like these its usually assumed the worst possible scenario/dataset.

<comment><USER13> Good point. But the other questions didn't have a "Not enough information" choice. So I think the question should be improved to avoid false negatives in the results.

</comment></comment></comment><comment><USER15> I was under the impression that unlike MySQL, Postgres can use two indecies at once when doing a query. So in MySQL you could do a query like `SELECT * FROM tbl WHERE a = 1 ORDER BY b` and you'd want an index on (a, b). But in Postgres you could have a separate index on a and b and you'd get the performance gain. In fact I thought in Postgres land you'd be better off creating them as separate indecies.

Is this info now outdated?

<comment><AUTHOR> Not's not just outdated, its wrong (in context of question 2) which is about indexing both, `where` and `order by` clauses. In that case you must provide a single index to benefit from the index order (so that the database doesn't actually need to perform a sort operation).

</comment></comment><comment><USER16> I failed <100%. _shrugs_ The problem I have with tests like this is it uses syntax I've never used before and I'm not sure how it works. Also the real world involves testing out and seeing what works and what doesn't. For example,

#1 CREATE INDEX tbl_idx ON tbl (date_column) SELECT COUNT( _) FROM tbl WHERE EXTRACT(YEAR FROM date_column) = 2017

I've never used EXTRACT() in my life, so I don't know if it's index aware. I do know in real life I would write "WHERE date_column >= '2017-1-1' AND date_column <= '2017-12-31' or if I were querying a school_year or something that spanned between two years I would add another column and probably an index on that column and query by that not by the date_column.

#2 CREATE INDEX tbl_idx ON tbl (a, date_column)

SELECT _ FROM tbl WHERE a = 12 ORDER BY date_column DESC FETCH FIRST 1 ROW ONLY

Who uses FETCH FIRST 1 ROW ONLY instead of LIMIT 1? Also indexes can be ordered by ASC or DESC so there's a possibility of a small optimization there.

#4 CREATE INDEX tbl_idx ON tbl (text varchar_pattern_ops)

SELECT * FROM tbl WHERE text LIKE 'TJ%'

I thought the general philosophy regarding indexes was create the ones you know you need like on foreign keys and very common ones like last_name, SSN etc and then if you notice queries running slow add more and test. This seems like one of those examples. Do you really need an index here? How often are you making this query and what's the speedup gained if you add an index?

#5 CREATE INDEX tbl_idx ON tbl (a, date_column)

SELECT date_column, count( _) FROM tbl WHERE a = 38 GROUP BY date_column

Let's say this query returns at least a few rows.

To implement a new functional requirement, another condition (b = 1) is added to the where clause:

SELECT date_column, count(_) FROM tbl WHERE a = 38 AND b = 1 GROUP BY date_column

This seems like another case in the real world where you might test what the slowdown is, and how often you're running this query. If needed you can add another index or run a subquery first, but the answer to this question can be found out in < 10seconds in the real world more quickly by testing it than even spending the time thinking about it.

<comment><USER17> > If needed you can add another index or run a subquery first, but the answer > to this question can be found out in < 10seconds in the real world more > quickly by testing it than even spending the time thinking about it.

This is true for some situations. But understanding indexing and databases can save you from headaches that come from structural problems. Not every query performance issue can be solved by throwing more indexes on a table and using it.

It's the idea of prophylaxis. An ounce of prevention is worth a pound of cure.

And if you are using production as a testing environment and waiting for problems in production to tweak your queries, then you probably won't last long in software development.

Indexes are the basics. Everyone should have grasp of it at the basic level.

</comment></comment><comment><USER18> 5/5 for Postgres. I'd chalk that up less to being any kind of Postgres expert and more to having already read through most of that site (and having taken previous versions of the test).

<comment><AUTHOR> In that case, everything below 5/5 would be very bad ;)

</comment></comment><comment><USER19> 2 out of 5 for Oracle. But I haven't touched SQL in years, so not surprising I don't remember much. I do have to say I would have gotten 2 more correct if I wasn't so impatient :)

</comment><comment><USER20> Working without JavaScript is cool and I got 2/5

</comment><comment><USER21> Got 4/5\. Assumed that text field is text type, which doesn't let you have index, so it was an obvious bad fit..

</comment><comment><USER22> 5/5 but only because I have ran into these problems on my own in the past.

edit: MySQL

</comment><comment><USER23> EXPLAIN driven SQL programming is my motto.</comment>


It's 2012, Why Aren't You Using These Hacks In Your App? - <AUTHOR> http://blog.contactually.com/2012/06/its-2012-why-arent-you-using-these-hacks-in-your-app/

<comment><USER2> _ou've worked your ass off to fill the top of the funnel, so you better ensure that your funnel is as water tight as possible. When a user expects the slightest bit of interest in signing up, capture their e-mail address. If they don't finish the signup process within a reasonable amount of time, message them! Save their contact information to a marketing list, dedicated just for people who haven't finished. For a while, you should even consider having the system e-mail your team as well, so you can reach out to them directly. Believe it or not, this has lead to some great conversations as well._

Can I just say that this is an example of what not to do? If I choose not to sign up for your service, sending me e-mails begging pretty please isn't going to magically change my mind. If anything, it'll make me less inclined to recommend your service to someone else (as well as me putting your e-mail address into an auto-trash filter).

<comment><AUTHOR> @quanticle - There's a balance to be had there. Yes, being continually emailed by a service you had no interest in is a terrible idea. But we've found that people drop off for other reasons - technical issues, walked away and forgot, or had unanswered questions. An easily-ignorable one-time e-mail is harmless

<comment><USER3> My opinion would be that if you're getting a lot of these kinds of issues, the signup page could well be the culprit.

A much better solution is to have 2 boxes "Email address", "password" and a button to make it Go.

If you need "inside leg measurement", "first pet's tail fur colour", "crazy aunt petunia's whisker count at last birthday", you can ask for that as part of the natural flow of using your service later.

Get people in and using it, make it really clear _before_ they click the signup button what the primary benefit of your service is.

</comment></comment></comment><comment><USER4> Very nice tips. Quite a few things in there that are "obvious", yet I hadn't thought of implementing them. Very helpful.

<comment><AUTHOR> Thanks! Yes, a lot of these are "duh" moments - we just wanted to note how big of a difference it makes.

</comment></comment><comment><USER5> This is timely for me as we get ready to launch matchist.com in the next few months. Gonna bookmark this.

Thanks for the great tips!</comment>


Ask HN: What would you do differently? - <AUTHOR>

If you started all over again, what would you do differently? If we started all over again with software, that is. Imagine a scenario in which all software implementations and specifications are lost while the hardware remains intact, sort of like after a software neutron bomb. Every last Linux CD, ANSI C manual and copy of the R5RS spec is forever gone. Now starting all over from scratch we would surely avoid the worst mistakes, incompatibilities and artificial limits (think 640k). The most obvious thing to redo is a clean design, learning from our collective memory of the past attempts, making use of the best ideas in the history of computing so far.
But once we are going down the path of cutting away dead branches in the tree of possibilities and straightening out the data paths, where do we stop? Do we still want to have file systems? And should they be exposed to the average user? And what about files themselves, are they a useful paradigm? What about all the other internals that are routinely exposed to end users. I think they might be caused by the cultural geek roots of the PC business.
How about the following goal: computing that is completely transparent of location and device, with no application boundaries. No more copying files, configuring the IP, downloading the browser, etc. Would such a reset of the software world end up getting us ahead faster in the long run. I have the suspicion that might be the case. What do you think? <comment><USER2> As long as there are people with different opinions, there will be different answers to your questions. We will split up to different "religions" again, since we cannot agree even on whether command lines are a good thing, or on what amount of freedom is a good tradeoff versus security. There simply are too many variables: Power users want freedom, corporations want security, productivity, and low cost (and not even all the coprporations want that)...

Too many players, too many egos.

Right now the Mac zealot's ego prevents him from seeing anything good in a PC, and vice versa. If we started all over, people will, within a short amount of time, identify with a particular solution, and then we will have religions all over again.

I'm not saying it's hopeless, but what I am saying is that the problem's root is people, human behavior; not necessarily technology. The technological mistakes (which itself is subjective), were kept alive mainly by egos, easily justified with the cost of undoing the mistake. And don't forget every mistake is a steppingstone for a later success. IBM's OS2 was a financial mistake, but which O/S has not borrowed from it?

So I gues we might have the same kinds of problems if we start over again, with the names of the companies and people involved shuffled around.

Maybe it's just better to keep going and try to do our best.

<comment><AUTHOR> Yeah, that's pretty true (and sad). My main idea is that things we could do better, even if still in several different ways across cultures/companies, would have already emerged, but for the momentum of the legacy interfaces (in the widest sense).

</comment></comment><comment><USER3> If I could go back in time, I would make a much more serious effort to encourage people I did business with that software patents are a bad idea and that they should always insist on software for which they have sufficient source code to always allow them to legally maintain their systems without involving the original vendor.

To me that means it has to either be open source from the start or have a license that would guarantee an eventual open source release (i.e. along the lines of aladdin ghostscript).

</comment><comment><USER4> I think all the things you've objected to are 'local minimums' of some cost function.

We have Windows because it was popular, then snowballed. We have C because it was the best systems language for the 'best' computers of its day, the PDP's.

It seems that between people clustering to a local minimum, and momentum, we often get 'stuck' on less than perfect technologies.

I'm sure if we started all over again, we would encounter similar problems.

<comment><AUTHOR> I don't think we would encounter Windows Vista again, to take an example. It seems to require the path from DOS and the company culture that grew along with it.

</comment></comment><comment><USER5> If I could go back in time, there's one major thing I would do differently. I would:

START WITH THE ANSWER, THEN WORK BACK.

I wasted way too much time "coding forward" from where I was at to where I wanted to be. I should have just mocked up the final product first, worked my way back to the building blocks, filled in the rest, and fixed what wasn't right. Would have saved years.

<comment><USER6> I think thats the philosophy 37 Signals' "Getting real" gets to. Start with what it should look like, and work backwards...

Good advice though. Thanks

</comment></comment><comment><USER7> The most recent starting from scratch that I can remember was Palm. No real file system, no legacy anything, databases for everything. Rather quick for its hardware but wasn't groundbreaking.

</comment><comment><USER8> If I had to do it all over again... I wouldn't have taken my CIS classes so early in the morning. My brain cannot comprehend a linked list before 10am.

</comment><comment><USER9> I'd keep files but use tags instead of folders. I like powershell's object based cli, make sure nothing like the windows registry ever existed, the OS would only run byte code, memory would be transactional and grey would not be the default window background color.

</comment><comment><USER10> Just had to jump on this: 640k was no more an "artificial" limit than 4G is. The 8086, like all CPUs, had only a finite amount of die space. They chose to implement a 20 bit wide bus, because that fit the problem space of a contemporary minicomputer (the biggets PDP/11 had 4MB). But they didn't have space for paging or mapping hardware, so the operating system needed to reserve some space for hardware (video framebuffers, etc...) to use. So thus was born the 640k/384k memory mapping of PC-DOS. It made perfect sense given the limitations of the hardware.

Now, IBM could have chosen a different part like the 68000, which was a bigger and more expensive chip that had an internal 32 bit architecture. But they didn't, for some pretty justifiable reasons (like the need to compete with computers like the Apple II which were under $2k).

</comment><comment><USER11> "The big re-write" is a classic anti-pattern. There's hard-earned wisdom hidden in that cruft.

<comment><AUTHOR> I'm not after an implementation (i.e. code) rewrite so much as more of an interface redesign. I think that happens anyway, but at a slower pace than such a radical cut would allow.

</comment></comment><comment><USER12> Wtf? How did this masturbatory piece get modded up?

<comment><AUTHOR> Sorry if my tone or style disgusts you, I'm no pg. I'll try and say it more succinctly: I think it's possible to innovate quite a bit, simply by ignoring the status quo to a yet unknown extent. In a worse-is-better way to serve simplicity and clean interface before compatibility.

<comment><USER13> Don't apologize for your curiosities. This is the first of many times people will knock you down. Brush the dirt off and keep going if you don't see a lesson in what people tell you.</comment></comment></comment>


Show HN: App that asks you to type a valuable reason before phone unlock - <AUTHOR> Try to be more mindful with your devices :)
https://acture.app/
Android: https://play.google.com/store/apps/details?id=com.actureunlock
iOS: https://apps.apple.com/us/app/acture/id1507694725?ls=1 <comment><AUTHOR> Clickable links. [0] [https://acture.app/](https://acture.app/) [0] [https://play.google.com/store/apps/details?id=com.actureunlo...](https://play.google.com/store/apps/details?id=com.actureunlock) [0] [https://apps.apple.com/us/app/acture/id1507694725?ls=1](https://apps.apple.com/us/app/acture/id1507694725?ls=1)</comment>


Simonoids. It's 'Simon' in an Altoids can powered by Arduino - <AUTHOR> http://blog.jgc.org/2012/05/simonoids-its-simon-in-altoids-can.html

<comment><USER2> Sorry, am I missing something here? It just seems like one of many simple electronics projects, nothing strikes me as very special about it.

<comment><AUTHOR> You're not missing anything, except, perhaps that simple is ok. For some people projects like this are quite complex, for others trivial. My personal purpose in building this is that it was fun, the blog post is there so that others can see how they themselves might build something like this.

</comment></comment><comment><USER3> I'm curious how he tackled the issue of the random number generator in the arduino. The fairly simple one included in avr-libc would be prone to repeating after a power off.

There's two ways I can think of to deal with that, save the state in the EEPROM so that it doesn't repeat, or add a hardware based random number generator, i'd like to know which he ended up going with.

<comment><AUTHOR> It's in the source code on github ([https://github.com/jgrahamc/simonoids/blob/master/simonoids....](https://github.com/jgrahamc/simonoids/blob/master/simonoids.ino)). I use a combination of reading the microsecond time (hoping that there'll be some variation because of the ADC conversion time), reading floating ADC inputs and storing random values from previous execution in the EEPROM:

      // Set the random number generator from a seed generated by reading from a
      // floating analog pin or two

      long seed = micros();
      for ( int i = 0; i < 1000; ++i ) {
        seed += analogRead(0);
        seed += analogRead(1);
        seed += micros();
      }

      // Use EEPROM locations to store a value from the random number generator so that from
      // switch on to switch on the seed will change even if the above loop always gave the same
      // value

      for ( int i = 0; i < 4; ++i ) {
        seed += (long)EEPROM.read(i);
      }

      randomSeed(seed);

      for ( int i = 0; i < 4; ++i ) {
        EEPROM.write(i, random(0,255));
      }

<comment><USER3> Ah I had missed the link to the github code in there. I like the idea of reading some floating analog pins to get some entropy.</comment></comment></comment>


I can't believe I'm praising Tcl - <AUTHOR> http://www.yosefk.com/blog/i-cant-believe-im-praising-tcl.html? <comment><USER2> About Tcl and the embedded world, a few years ago I wrote a single-file Tcl interpreter that is mostly compatible with current Tcl implementations (something is missing like namespaces, something was added like anonymous functions):

<http://jim.tcl.tk/index.html/doc/www/www/index.html> (source code is here: <https://github.com/msteveb/jimtcl>)

Now maintained by Steve Bennett, and actively used by some embedded folks.

</comment><comment><USER3> If one looks at the EDA industry you will have to appreciate the breadth of applications Tcl is used in. Usually there is a Tcl interpreter with custom commands written in C for optimization.

The ease with which one can quickly create interfaces between different tools I think is one of the contributing factors to its success. That and of course, the legacy codebase.

</comment><comment><USER4> You can get lisp to interact more like a console language. Write a parser to accept python-ish whitespace syntax (whilst still allowing parens syntax), and transform that s-expressions so you can pass to the interpreter

To imply:

        (define (fn a b)
          (list (car a) (car (car b))))

You could type:

        define: fn a b
          list:
            car a
            car (car b)

As it's a console, in practice you'll mostly be typing commands like this:

        load x y z

but you have good mechanisms for going deeper. And if you just want to write in s-expressions you still can.

<comment><USER5> The aside in the linked article about avoiding shifting and parens just to type a simple command is even more true once a command spans multiple lines. Say what you will about syntactic attempts to remove the parens from Lisp, I think it's a secondary issue for a command language.

There are some good observations about design pressures on command languages vs. programming languages in Olin Shivers's "A Scheme Shell", as well.

</comment></comment><comment><USER6> IMHO, nothing beats Tcl/Tk when you need to write a small distributable application with a GUI. The last ones I wrote were for purging files acording their date and for compiling Forms/Reports. With freewrap I can build an executable with no effort at all.

</comment><comment><USER7> I think it was antirez who said that Tcl had one of the best C codebases he had ever seen. Since then it's on my code reading list.

<comment><USER8> Another recommendation for your reading list: The Plan 9 kernel (could be considered a modernized version of a classic code reading which is also highly recommended: Lions' UNIX 6th Edition commentary).

The Go compilers and stdlib are also a great read. Is no coincidence that Ken Thompson was involved in all those projects.

More on topic: I agree it is sad how underrated Tcl is, perhaps not the best language ever created, but deserves much more attention and credit than the latest JS-flavour-of-the-week.

Tk is also great and IMHO still the best portable GUI toolkit around.

<comment><USER9> Tk is _great_. What I don't get is why people are still making applications that don't use ttk and it's modern theme. It's Motif look on linux is the single biggest complaint I hear about it today and that problem was solved what, a decade ago?

As an aside, LTK, which is basically just lisp bindings for talking over a socket to wish is the only lisp gui that I've had work on all platforms and all lisp implementations.

</comment></comment></comment><comment><USER10> I spend a lot of time using Tcl (I have to) and I spend almost as much time wishing I could be using Perl instead. This is partly because of weirdness, as described by the author of this article, and partly because I routinely run into things that seem to be far more difficult to do in Tcl, than they ever would be in Perl.

Can I get one of the Tcl adherents in this thread to comment- have I got things completely wrong? Need I simply become better with Tcl? Or does it truly lack things like powerful string handling and hash tables?

<comment><USER11> For hash tables you have two options: the dictionary[1] or the Tcl array[2], which is more or less like an Awk array.

Can you give me an example of _powerful string handling_?

string[3] for the usual string manipulations.

subst[4] when you want weird string substitutions (works like a template).

regsub[5] and regexp[6] for regular expressions.

[1] <http://www.tcl.tk/man/tcl/TclCmd/dict.htm>

[2] <http://www.tcl.tk/man/tcl/TclCmd/array.htm>

[3] <http://www.tcl.tk/man/tcl/TclCmd/string.htm>

[4] <http://www.tcl.tk/man/tcl/TclCmd/subst.htm>

[5] <http://www.tcl.tk/man/tcl/TclCmd/regsub.htm>

[6] <http://www.tcl.tk/man/tcl/TclCmd/regexp.htm>

</comment></comment><comment><USER12> I'm not as fond of the language as some, primarily because it is unnecessarily hard to debug errors and unnecessarily hard to read code and data.

For example the interpreter can basically say "there's a syntax error somewhere in this giant block of yours" and not have _any idea_ where.

A related issue is that a single delimiter (the brace) is bad for readability, even if it's easy to parse. Just try reading a gigantic dictionary; it isn't anywhere near as clear as Python/JSON-style can be (where there are obvious commas, colons, quoted strings and more to show you exactly what you're looking at).

Another headache for debugging is that commands frequently accept the _names_ of variables. In unfamiliar code you can't even answer simple questions like "where are all the places 'xyz' is used?" because a reference to 'xyz' could be hiding almost anywhere. You can change something and not fully understand the effects that your change could have. While I'm sure this allows for very clever code to be quickly _written_ , it fails the more-important test of producing code that is easy to _read_.

It is even possible for commands to silently accept mistakes and seem correct, with major consequences. Suppose "x" just happens to be a one-element list containing a number, '{0}'. With this input, "lindex 0 $x" is legal (even though "lindex $x 0" is the correct argument order). Worse, the wrong form _returns something that seems reasonable without error_. In this case what it _actually_ does is grab the index that it found by magically looking inside the _list_ ($x) and return one of the values from _the implicit list containing "0" that was given on the command line_ ; it returns a "0" but not the "0" that you'd think it does!

While one can argue that each language has "best practices" and intended usage, the examples above are largely pulled directly from built-in commands and data types. These are things that people encounter all the time, they are not caused by any particular TCL programming practice.

</comment><comment><USER13> Circa 1999, I wrote a simple reminder script - which I still use - that brings a popup on the desktop, in like 3 lines of Tcl/Tk using the wish shell. I shed a tear at how easy it was compared to anything else at the time. I am not even sure if it's that easy with anything else today.

</comment><comment><USER14> Tcl is one heck of a Swiss-army knife solution. The core team is of the first order. The best thing is that it's so easy to use pipes to integrate a 'C'/C++ console mode program and control it via stdin/stdout/sockets. That turns out to be a significant architectural plus - rather than using some MVC C++/Java type library, you get complete seperation of concern. You don't even have to integrate it tightly with 'C' code; just use stdin/stdout and wrap a Tcl package to build a pipe around it.

Tcl might have been _too_ easy. I also recall ESR dismissing it at one point in favor of Python.

</comment><comment><USER15> My introduction to TCL was in the mid-90's via Expect:

<http://www.nist.gov/el/msid/expect.cfm>

</comment><comment><USER16> Isn't that what Ousterhout and his students designed Tcl for? I fooled around some with AOLServer years ago, and have used it with Oracle's "Intelligent Agent".

But I didn't know how much I liked it until I Googled for "PHP upvar" and found a forum thread with bunch of people telling some guy that he was a language fascist for wanting such a thing.

</comment><comment><USER17> Tcl is an interesting beast indeed, since it takes its extreme love for strings so far, it's actually homoiconic.

<comment><USER18> What would you get with the choices set as:

        - everything is a literal
        - everything is an expression

Is there a Tcl variation that's a functional language?

<comment><USER19> Forth or Factor perhaps

<comment><USER18> That's way off base. Wrong language family.

</comment></comment></comment></comment><comment><USER20> Tcl was lua before there was lua. It pops up under the cover as the scripting language of so many useful tools.

<comment><USER21> What's often not as exposed is that Tcl was node.js before there was node.js (or, well, Twisted, POE etc.) . It has a pretty powerful event loop (moved out of Tk into the core language originall, if I remember correctly), and it's very easy to tie in scripts to add functionality. So it became quite popular for system that had to communicate with lots of different devices, gathered information from a lot of sources etc., centralized information processing hubs. Nevermind that it was very easy to add GUIs to monitor it or enter information. Back in the days, quite a few companies had pretty huge Tcl-based infrastructure, and despite the lack of support for "programming in the large", they were surprisingly easy to decipher and extend.

I still don't know why Tcl had problems entering the WWW age. It started out pretty well, the aolserver was/is a pretty capable and performant system and they even had browser plugins (i.e. as a Java rival), but once the plethora of web services hit the landscape and we all went "Web 2.0", the lack of a proper CPAN equivalent and the slightly outdated Tk look caused some exodus to more hip scripting languages. The sad thing is that since quite a while Tcl overcame all those troubles (modules, packages, native look and feel), but probably a bit too late.

<comment><USER22> I also wish I understood why Tcl was not more widely used in the early days of the Web. HTML is a string-based protocol, and Tcl is optimized for handling strings -- it's an absolutely natural fit.

Bugzilla, for example, was originally written in Tcl; but for reasons I have never been able to discover, it was completely redone in Perl. Anybody here know why?

<comment><USER21> Well, Tcl enjoyed a bad reputation for a while, mainly due to the "everything's a string" mantra leading some to believe it's not much use beyond that, RMS's flame war against it (which is why we're all using Guile now), and mostly the simple, but slightly odd syntax (expr, array and list functions).

Then you've got to remember that for a while, Sun owned Tcl. Pretty much the same period when they were hyping Java…

Also, the core Tcl distribution was still focused on scripting (embedded or not) and GUI programming with Tk. Modularity back in the days often involved separate interpreters with added featurs (TclX for example).

Compare that to PHP: Basically the same situation regarding additional modules, but they had everything related to simple web development in one package - parsing requests, handling pictures… You could use PHP to do scripting and even GUIs, and you could use Tcl to do web development. But once you're written off as a niche language, it's hard to escape that trap.

We've got a whole bunch of interpreted languages out there, but only a few of them are considered all-purpose languages. Ruby and Python mostly, even Perl has to fight a bit against the Unix scripting preconceptions.

Tcl wouldn't be the first scripting language of that period "lost". Anyone remember Pike or Icon?

<comment><USER23> As for Icon, it might not be such a bad idea for folks to read about its interesting conditionals.

<http://www.cs.arizona.edu/icon/docs/ipd266.htm>

</comment></comment></comment></comment></comment><comment><USER24> I used to really like Tcl and it have one the nicest communities but I think it needs two things 1- a CPAN 2- Killer app (and no aolserver or openacs are not)

</comment><comment><USER25> I work for a medium-large technology company supplying mission critical software (very large amounts of money are involved). We use Tcl for the vast majority of our software. We may head towards Java in the future, but not so much due to any failings of Tcl, more because it is easier to recruit Java programmers.

I think the general consensus at our company is that Tcl was the right choice, although our programmers do occasionally gripe at some Tcl shortcomings.

<comment><USER26> @scrid -- curious to hear more.

</comment></comment><comment><USER27> I love the TCL foreach loops. TCL is the only language that lets you iterate through multiple data structures with the same loop. It is actually really useful. Just try this statement with any other language:

foreach animal { "dog" "cat" "bird" } color { "brown" "black" "red" } { puts "See the $color $animal?" }

<comment><USER28> This is fun.

      (loop :for animal :in '("dog" "cat" "bird")
        :for color :in '("brown" "black" "red")
        :do (format t "See the ~a ~a?~%" color animal))

      See the brown dog?
      See the black cat?
      See the red bird?

How far can we take the example?

      (loop :for animal :in '("dog" "cat" "bird")
        :for color :in '("brown" "black" "red")
        :for count :from 2
        :do (format t "See the ~a ~a ~as?~%" count color animal))

      See the 2 brown dogs?
      See the 3 black cats?
      See the 4 red birds?

How about this?

      (loop :for animal :in '("dog" "cat" "bird")
        :for color :in '("brown" "black" "red")
        :for count :from 2 :sum count :into total
        :do (format t "See the ~a ~a ~as?~%" count color animal)
        :finally (format t "See all ~a?~%" total))

      See the 2 brown dogs?
      See the 3 black cats?
      See the 4 red birds?
      See all 9?

Anybody?

<comment><USER27> Okay, so I am impressed that you can also do this in lisp. I never really paid any attention to the language. Maybe it is worth checking out.

<comment><USER28> To be fair, LOOP isn't really Lisp so much as an embedded DSL for loops that exists because of how easy Lisp makes embedded DSLs.

People either love or hate Common Lisp's LOOP. Lispy types who prefer recursion often abhor it. I'm a lover.

</comment></comment></comment></comment><comment><USER29> a scheme repl could borrow a leaf from tcl's book by preprocessing everything you typed in to let you (a) omit the outermost parens and (b) mix () and [] freely. would be an interesting experiment to see if it had a better feel for this sort of interactive scripting

</comment><comment><USER30> Tcl is a bloody good language+ but seems to have languished in obscurity. I can't count the number of times I've heard people in the Python and Ruby (and Lua and Processing, and node.js, for that matter) communities announce some wizzy new thing that Tcl had 5 or 10 years earlier. I've never understood why that is. The problem with the computing community in general is that it can't see over its own shoulder. Every few years, we reinvent the wheel.

\+ By this I mean you can get a lot done, in not very much code, and maintain it afterwards, and read and modify other people's code easily.

<comment><USER31> A programming language runtime is a whole package; just because some elements of previous system designs are reused does _not_ mean that we are "reinventing the wheel."

To pick Lua (my favorite of the technologies you listed), it has the following things that Tcl does not have:

      - strict ANSI C implementation
      - small implementation (15k sloc vs. 110k-160k for Tcl, depending on how you count)
      - a fast implementation, with an even faster JIT

If you follow your argument to its logical conclusion then everything is just a reinvention of Lisp (including Tcl). But we have tools available to us today (like Lua) that are strictly better than Lisp or Tcl for some use cases.

<comment><USER32> An honest question: for which use cases is Lua strictly better than Lisp?

<comment><USER5> Lua is designed specifically to provide a scripting/extension language for projects in C or C++, or projects where interop with C is key. This is where it really shines -- where most Lisps expect to be the primary language, but have FFIs to C for performance and integration reasons, Lua _expects_ to be used for writing plugins, configuration, and the like. It handles those tasks well, and otherwise stays out of the way.

While it's good as a standalone language, it's an _outstanding_ extension language. It's small, trivially portable, and has excellent interop with C. It's not competition for Lisp in general so much as Emacs Lisp or vimscript, designed for systems that have a core written in C but need a lot of customization layered on top. Configuration for window managers, scripting enemy behavior for game engines written in brutally optimized C++, that kind of thing. Systems with a "hard and soft layer" architecture (<http://c2.com/cgi/wiki?AlternateHardAndSoftLayers>). (Incidentally, Tcl was also designed with this use case in mind.)

That said, if you're using Lua as your primary language but are proficient in C, you can add a lot of power to it pretty easily. The emphasis on C interop goes both ways. (Also, the implementation is very intelligently engineered, and is worth study if you're interested in language design or virtual machines.)

<comment><USER32> Thanks for the comprehensive reply; however, a quick search turned up a couple of small, portable and embeddable Lisp dialects (Hedgehog, PicoLisp, ECL) that all seem to target the same niche Lua is apparently designed for. Admittedly, Lua has probably been developed for a longer period of time, but small Lisp interpreters shouldn't be very complex, so I guess they are pretty stable.

Lua is probably going to be faster, but one wouldn't exactly use a scripting language for math heavy stuff etc either.

<comment><USER5> Lua has had a long time to slowly and deliberately evolve, informed by feedback from a gradually growing group of users.

It's kind of the opposite of Javascript, which went from 0 to release in a few weeks and had a bunch of design errors become permanent as a result. Lua and Javascript have a lot in common, and studying Lua may be a good way to see where Javascript is going in the long term.

Lua is significantly smaller than ECL, and a bit smaller than PicoLisp. According to sloccount, they weigh in at 432,818 (ECL), 15,018 (PicoLisp), and 14,309 (Lua).

</comment></comment></comment></comment></comment></comment><comment><USER33> I did my first professional programming in Tcl/Tk used by a trading system. It was awesome and even though most people have not heard of it when I talk to friends/clients, glad to see this post.</comment>


Mozilla Test Swarm Alpha Open - <AUTHOR> http://ejohn.org/blog/test-swarm-alpha-open/

<comment><USER2> I have a Windows 95 here with IE3, but it doesn't look like Test Swarm works with it :/

</comment><comment><USER3> The only problem I see here is that a business developing some web application won't want to run their code on something as public as TestSwarm where people donate their own CPUs, because it can potentially give too much away about their POSSIBLY top-secret product or top-secret upcoming features.

BUT that being said, TestSwarm is open source, so a company could easiy grab the source code from github (linked below) and set it up on their own private cluster behind their corp firewall.

<http://github.com/jeresig/testswarm>

<comment><USER4> That's fine because I don't particularly want commercial projects running on TestSwarm.com. I'm keeping it exclusive to large, trusted, open source projects. Honestly, if commercial projects wish to get help from general users who donate machines they should be willing to pay for the service.

But, as you noted, it's also completely open source and anyone is perfectly welcome to run their own swarm on their intranet or public site.

</comment></comment><comment><USER5> Love it!

It would be nice to have a desktop "app" that launches all/some of the installed browsers and automatically opens the required tabs. This way it will be much easier: I'm going away...better share some CPU first...double-click, I'm done.

Update: on a second thought, it can even prioritize, e.g. open the browsers that are "Most Wanted" in the moment.

<comment><USER4> I'm actually starting to work with some developers on this (likely a Java app). I absolutely agree that having this tool be made available to those running the clients would be very useful.

</comment></comment><comment><USER6> Almost everyone is splitting their tests by browser; are we (IMVU) the only ones who have to horizontally shard because of test times?

Granted, our list of fully supported platforms is small (effectively IE6, IE7, IE8, and FF3.5) considering our downloadable client is currently windows-only.

<comment><USER4> If I'm understanding you correctly, TestSwarm handles this, actually. If you watch the video walkthrough you can see the tests being split apart and run against multiple browsers simultaneously. Not only does this allow the results to complete faster but it also helps to make error correction easier (only re- running a sub-section of tests to try and get a good response, rather than re- running the entire suite).

<comment><USER7> Running tests more than once at the same time by default is a very good idea.

</comment></comment></comment><comment><USER8> Phenomenally cool, it's an instant testing infrastructure without having to juggle VMs.

I really hope they start a pay-version for commercial projects soon.

<comment><USER4> I've thought about it, but it just seems too tricky. Businesses want guarantees of security and privacy that a "wild west" cloud like TestSwarm.com can't provide.

Instead, I just opted to release all the software as open source. If a corporation wants to use it for their commercial projects they can set up their own swarm and worry about those issues.

It definitely seems like there could be a profit strategy here but I can't quite see it yet (nor am I hugely interested in heading down that path).

<comment><USER8> I think there's a big potential for a commercial product here. Couldn't all of the security and privacy issues be addressed by just buying a bunch of hardware, setting up the VMs and then selling testing time?

Rather than fully distributed make it more (pardon the buzz word) cloud-like?

With the amount of javascript being written these days, I think the instant testing infrastructure with zero maintenance would be a huge sell for small and medium size companies.

edit: Although, for that matter if you're going to own the hardware/configuration, you could just as well go with Selenium and sell time on that. Either way, I think people would buy time on either sort of a setup.

<comment><USER4> If you're doing that then you might as well use Selenium Grid: <http://selenium-grid.seleniumhq.org/>

Granted it doesn't have the nice continuous integration view or the error correction that Test Swarm has but everything else is there.

</comment></comment></comment></comment><comment><USER9> There's a bug on my user page, which says I connected a test instance "Connected 2 hours ago" when it was a couple of minutes.

<comment><USER4> Yeah, time zone issue: <http://github.com/jeresig/testswarm/issues#issue/1></comment></comment>


Grooveshark Remote for iPhone and Android - <AUTHOR> http://gsremote.com/ <comment><USER2> I made this with my classmate from Edinburgh Uni. Thanks for submitting it!</comment>


99% Genetic?  Individual Differences in Executive Function Are Almost Perfectly Heritable - <AUTHOR> http://scienceblogs.com/developingintelligence/2008/05/99_genetic_individual_differen.php <comment><USER2> Oh noes, genes might control our behaviour. Why is this issue always so sensitive?

Here's one interesting study that suggests genes to a large extent determine happiness: [http://www.sciencedaily.com/releases/2008/03/080304103308.ht...](http://www.sciencedaily.com/releases/2008/03/080304103308.htm)

<comment><USER3> because of racism and sexism.

</comment></comment><comment><USER4> a claim of 99% is too high for me to resist posting the following URL:

"Why Most Published Research Findings are False": [http://www.marginalrevolution.com/marginalrevolution/2005/09...](http://www.marginalrevolution.com/marginalrevolution/2005/09/why_most_publis.html)

and

"Most scientific papers are probably wrong": <http://www.newscientist.com/article.ns?id=dn7915>

</comment><comment><USER5> to preempt common criticisms:

1) 99% is not unbelievably high, given that they used factor analysis to improve the reliability of the measurements 2) this doesn't preclude a) environmental influences that interact with genetic profiles nor b) environmental influences which act on the mean value of a twin-pair's score (the study's concerned with deviations from means within twin pairs).

thanks for the interest guys.

</comment><comment><USER6> it looks like it's saying they only tested twins that shared the same households. that might have an effect on the results (by not testing the same genes in diverse environments.) though i can't grasp the statistics at a glance

</comment><comment><USER7> heritable does not imply genetic! it could just as well be due to parenting. (i realize it's a twin study, just replying to the title)

and genetic does not imply the relevant genes being inherited have anything to do with executive function. they could just as well be for, say, the right appearance to cause parents to think they are smart and thus help them become smart.

<comment><USER5> i have trouble seeing how these comments apply to the content of the post - parenting influences are largely controlled (as you seem to indicate) and I don't see how these heritability estimates could reflect something unrelated to executive function. that's the whole point, they clearly have something to do with executive function. one would assume that something like appearance would show large unshared environment since kids dress differently, etc/

<comment><USER8> I found this essay (<http://cscs.umich.edu/~crshalizi/weblog/520.html>) very helpful in understanding what "heritability" really means, and why it's so hard to control studies like this.

The short version is: think about how heritable something like "number of arms" would appear in a study like this. It would appear that variance in arm count is 100% environmental, since the only people who don't have two arms lost one in an accident of some kind. Arm count is therefore not controlled by genes!

<comment><USER7> very good link! thanks.</comment></comment></comment></comment>


Ask HN: What to make of weird iPhone app rating distribution? - <AUTHOR>

I recently released an iPhone app (check my profile for details) and it has gotten 8 ratings
4 five stars 1 three stars 3 one star
I should also note that the people who rated it five and three stars left a review. The three who rated it one star left no review, they just rated it.
What should I make of this rating?
1) Is it really that polarizing that people either love it or hate it?
2) Are some competitors rating it a 1 on purpose, to keep the average down? (Do people do this?)
3) Are there not enough ratings to give us a statistically meaningful distribution, and so any distribution we see early on should be taken with a grain of salt?
4) Other? <comment><USER2> You don't have a lot of data- but the data is clearly bimodal (Hartigan dip test value: 0.1875, which is "large"- so this is a very unlikely pattern from a unimodal distribution). The question that can't be answered from this data alone- is the different sub-population of 1-stars due to something in your app (like a bug only they encountered) or something about them (older iPhone, or competitors entering harmful scores).

<comment><USER2> Okay that was the "stat" answer (which brings in too many irrelevant details). The "business" answer is think in terms of something like <http://en.wikipedia.org/wiki/Net_Promoter> and say "the middle scores are just noise- so the only meaningful summary you can pull out is the net difference in 4 and 5 star reviews against 1 and 2 star reviews."</comment></comment>


DNA Friend - <AUTHOR> https://dnafriend.com/ <comment><USER2> Is there an enterprise behind, interested in people mouth data?</comment>