Texas Is Latest State to Pump the Brakes on Red-Light Cameras - <AUTHOR> https://www.nytimes.com/2019/06/08/us/texas-cameras-red-lights.html <comment><USER2> I grew up in Australia with red light cameras and super high penalties for running red lights. Seeing drivers run red lights there is quite rare. I didn't think much of it until I moved to the Bay Area where I seem to see someone run a red, sometimes seconds into it on what seems like a weekly basis. It's so common that now when I'm at the front of traffic and the light turns green I inch forward and look both ways, something I never used to do. As a cyclist it terrifies me as getting hit by a driver running a red would most likely be fatal.

It's probably an unpopular opinion here in the US but I'd like to see more red light cameras and higher penalties for what is a really dangerous traffic violation that is easily preventable with a change of drivers' attitudes.

<comment><USER3> I just moved from a city with a heavy police presence and no red light cameras to one with them placed sporadically throughout the place and almost no police presence (massively understaffed department) and I see far, far more runners in my new city. I see a handful a day. I quit walking to work. I think it's got a lot to do with driving culture/police presence as well. People get surprised when they get red light tickets. Maybe the cameras should look more obvious.

<comment><USER4> In Europe, automated traffic enforcement isn't hidden, it's actually clearly announced by signs. It effectively tells the driver: "if you break the law here, you will certainly be caught by a machine and fined". The goal is to get people to follow the law, not to write more tickets.

<comment><USER5> In the US, it seems to me that the goal is to fine as many violators as possible, so there is less incentive to warn drivers.

</comment></comment></comment></comment><comment><USER6> What's the problem in flashing yellow for a longer period of time? Make a delay long enough for a driver to safely react. Otherwise why bother with flashing yellow anyway?

We have such thing in Ukraine(and probably other ex USSR) countries. There's no surprise red light. You always know when it's going to come and have enough time to finish a crossing.

<comment><USER7> It's alleged that cities will reduce the length of the yellow so that people will misjudge and run a red, thus increasing the revenue.

> The annual report for Suffolk County, N.Y., shows that revenue from the red- > light cameras was about $28.9 million in 2017, with about $9 million of that > paid to the vendor.

<comment><USER8> This is the issue. Yellow light lengths are also inconsistent: I don't know what to expect. Could be long, could be short. It's not always safe to suddenly stop, and we don't know which is which.

<comment><USER9> In which country?

Isn't there some sort of a regulation on the yellow light duration depending on the max allowed speed on the road?

Living in a country with yellow lights, I never had a situation when I could complain that it was too short or too long.

I was taught that yellow means "stop if you can do so comfortably", and the very few times I ran a red was definitely my bad call.

<comment><USER10> its federally mandated to be between 3 to 6 seconds. towns are free to choose anything in between. some towns that had 5 second yellow lights will change it to 2 seconds after installing a red light camera and make good amount of money from locals who knows the length of the yellow and attempt to blow thru

<comment><USER9> So cities change timings in an illegal way? How is this possible :O

<comment><USER10> no, typo. they basically change it within limits just to get drivers trapped

</comment></comment></comment></comment></comment></comment></comment><comment><USER11> Americans should consider shorter junction cycles instead. My experience in the US is that traffic light cycles are long, leading to impatience, and long queues building up at lights when they turn red, which may even spill into a junction further down, leading to further congestion.

That's in comparison to Europe, where the traffic light cycles are short, meaning less cars get through on each cycle of green, but at least everyone feels they don't have to wait quite as much. Red-light cameras are also rare in Europe, I have only encountered them in Germany, but they could be elsewhere.

<comment><USER12> I dont know how this helps. We do probably need an adaptive cycle, so that it can adjust based on traffic. On major roads, it can keep ot green for longer.

In south bay, el camino comes to mind, and it can be much better.

<comment><USER11> A lot of junctions in the US have 'intelligent lights' (I don't know the exact term), where there are plates on some lanes, so it only turns on for a lane if there are cars in it. That is mostly noticeable for left-turning lanes.

But in Europe, most traffic lights are programmed to act differently based on the time of day, hence allowing a smoother traffic in rush hour. Or in some European cities, the lights will switch to flashing yellow at night.

I don't think traffic lights need to be that smart, just scheduled. I have definitely not heard that European traffic should be significantly worse than US traffic.

<comment><USER13> The US uses all of those methods in conjunction.

<comment><USER11> And in my opinion, the problem is that the cycle itself is too long. If they merely tweaked that, the impatience would be lowered, and you might even get smoother traffic.

<comment><USER14> The cycle is entirely up to the local Department of Transportation be it a city, town or state. Where I live we have short cycle lights at heavy intersections and long cycle lights at intersections where keeping the primary/heavy road going longer is 100000% more worth it than some side secondary road with 3 cars every hour. There are also plenty of complex areas where all the lights on a road are interconnected for miles and the timing is set to match between them to more efficiently feed cars onto highways and move them along.

</comment></comment></comment></comment></comment></comment><comment><USER15> My city implemented these in a responsible way. They did not change yellow light duration and the police department selected the placement.

The result has been most ok, they missed their financial targets and there is a moderate reduction in certain types of accidents, although it's hard for me to tell if that was due to the camera or the "no turn on red" at those intersections.

But the other benefit that few people realize is that these cameras are always on (including the LPR), and retain video for 30 days. It's pretty difficult to leave the city without being recorded. It makes it easier for police to get camera footage admitted in court as the traffic cameras are a reliable index to correct time.

It's not as integrated and creepy as something like the NYPD DAS system, but also doesn't get discussed when these systems get set up.

<comment><USER16> >But the other benefit that few people realize is that these cameras are always on (including the LPR), and retain video for 30 days. It's pretty difficult to leave the city without being recorded.

That's a _good_ thing?

<comment><USER15> I was missing the quotes around "benefit"!

</comment></comment></comment><comment><USER17> I would be OK with the cameras if they caught only dangerous egregious violations. I got a ticket from one of these once simply for stopping too far short of the right turn line, then it thought I didn't stop when I proceeded to turn. No human cop would ever ticket that.

<comment><USER18> Something like 1/10 injuries due to red light running are due to failing to stop on a right turn. There's a reason you're supposed to stop before the line, a pedestrian can appear seemingly out of the blue and suddenly you run into them going 10-15+mph.

Should it be a lesser infraction? Probably, but I see far too many cars speeding through right turns without even looking to the right for pedestrians every day.

<comment><USER19> From What I understand he's saying he _did_ stop before the stop line, but a little too early, so when he then made the turn it appeared as is if he hadn't stopped.

<comment><USER18> In that case OP should definitely contest the ticket (assuming OP didn't stop too far back as to not be able to clearly see the intersection). They'll have video that can be reviewed.

<comment><USER20> Video? Do red light cameras have video now?

</comment></comment></comment></comment></comment><comment><USER21> The $75 in the article is piddling compared to the bay area. I got a red light camera ticket here (not debating the ticket itself, I failed to stop before turning right) and the minimum fine was around $350 plus driving school.

<comment><USER22> Yeah but median salary in bay area is probably twice to three times what it is in most urban texas areas. so $350 isn't a big deal.

<comment><USER23> Tell that to the person who drove an hour into the city to serve you your coffee.

Its double regressive. They have to drive more (so risk more tickets) and the wealth differential makes their fine higher.

</comment></comment></comment><comment><USER24> Minnesota's supreme court shot down such cameras years ago and as far as I know it didn't turn into mad Max on the roads compared to other states.

It doesn't seem like there is a great deal of benefit.

<comment><USER25> Yea I haven't really ever seen anyone run red lights. Is it even a problem?

<comment> frosted-flakes I don't think it's common to blatantly run a red light. In fact, it's extremely frowned upon in Western society, to the point that 99% of people will wait for the green signal even if it's the middle of the night and there's no-one around (compare that to, e.g. India, where I've heard that traffic signals are mere suggestions).

But stretching the green past the yellow and into the red? That happens all the time, and I suspect it's the vast majority of what these cameras catch. People justify it because "oh, it was just a few seconds" or "but it was still yellow!".

<comment><USER9> The all-famous "dark-yellow" :)

</comment></comment></comment></comment><comment><USER26> This is from New Zealand, but if the cameras operate the same in the US then I think some of the people in this article might not be being completely truthful...

"For the camera to not be triggered, the vehicle must stop behind the white stop line, or already be fully in the intersection when the light turns red."

"Two photos are taken. The second one is taken approximately one second after the first one and proves whether a vehicle continued through the intersection or just happened to not quite stop before triggering the camera. Police at the Traffic Camera Office determine whether an offence was committed."

[https://www.driverknowledgetests.com/learners-permit- questio...](https://www.driverknowledgetests.com/learners-permit- questions/car/intersections/726-which-statement-is-correct/)

</comment><comment><USER27> We need more automated traffic enforcement. This is my dream for automated HOV lane enforcement: [https://m.youtube.com/watch?v=4lseF6UClbE](https://m.youtube.com/watch?v=4lseF6UClbE). The trap belt would go to a re-education camp.

</comment><comment><USER28> Do people want it to be easier to break the law? I don't understand.

This reminds me of the commenters defending the would-be car thief on the Amazon Ring video yesterday.

<comment><USER29> In the US you have a right to face your accuser. This is often impossible with red light cameras.

<comment><USER27> The Sixth Amendment only provides for a confrontation right in "criminal prosecutions." Speeding and red light camera violations are always administrative citations that carry no criminal penalty.

<comment><USER29> That's wrong in many jurisdictions for speeding issues by an actual officer. Red light cameras are indeed civil penalties, which is my point. It's extra legal and you have zero recourse.</comment></comment></comment></comment>


Men Have No Friends and Women Bear the Burden - <AUTHOR> https://www.harpersbazaar.com/culture/features/a27259689/toxic-masculinity-male-friendships-emotional-labor-men-rely-on-women/ <comment><USER2> I thought this seems largely correct: ""Men don't usually put the effort into maintaining friendships once they're married," Johnson says. "The guys at work are the only people other than me that my husband even talks to, so when some of these men retire, they expect their wives to be their source of entertainment and even get jealous that they have a life."" A variety of posts about loneliness have been popular on HN, so I think this strikes a chord.

</comment><comment><USER3> Men are toxic and evil, and women are noble and put-upon —- what a fresh and interesting idea, why haven't I heard about it before!

<comment><USER4> This is such garbage.

>Most men feel increasingly devalued in a society where student debt, declining job security, firsthand experience of the instability of modern marriages, the ravages of increasing obesity, and wacky dating space have put them on unstable ground >but the problem is "toxic masculinity"

The usage of "toxic" has become toxic itself!</comment></comment>


Learning From Churn: Getting Feedback When Customers Leave - <AUTHOR> http://blog.hipmob.com/post/74184823096/learn-from-churn-get-feedback-when-customers-leave

<comment><AUTHOR> OP Here - this is the first of a few posts where we share some twists and turns in our story (particularly around our failures, losing customers, botching product launches and the like). Hope it helps and if you have any questions direct them to me (ayo @ hipmob).</comment>


Zirtual: What Happened and What's Next - <AUTHOR> https://medium.com/@marenkate/zirtual-what-happened-and-what-s-next-f9bd493ecc49

<comment><USER2> "Oops, burn!" is not an excuse. Keeping silent without telling your employees is not an excuse, either.

There's a reason so many investors and employees try to promote a culture of transparency at a company... Because to do anything less is a sign of (a) gross incompetence, and (b) greed.

It is often extremely uncomfortable to stand in front of your employees and say "Hey, we've got 3 months left unless we hit this milestone. Let's work together on this and if you can't commit, we'll help you deal with it." It sucks to say and feels terrible, but better than an overnight blow-up.

<comment><USER3> This is an easy thing to say, but I can understand why a leader would choose to do otherwise. The risk that employees will give up and bolt thus turning failure from a likelyhood to a certainty are very real. You can't just ignore that.

<comment><USER2> Do you warn employees and possibly risk losing those with a low risk tolerance? Or do you hide this from them and lay them off with the legally minimum notice and possibly no safety net?

I prefer to be a leader that promotes respect and care for employees, and assume the former choice is thus a better one.

<comment><USER3> Have you every actually been a leader in this situation? I dunno, maybe you have and you followed through. If that's the case, then all the high fives to you.

But I sure haven't. And I look at it and I see a 10 out of 10 management challenge. You've got the weight of the world on your shoulders as a leader here. The lives of your employees, the faith of your investors, the very life of a company you've put your all into for years. And in this case the CEO was a first time founder with (rumor has it at least) not a lot of support from her board.

Maybe she did the wrong thing. Maybe she didn't. But this shit ain't easy, and I'm not one to judge too harshly.

<comment><USER2> I will say that I have actually been in this situation and have chosen to be transparent with our employees. It was really, really hard but it was also the right thing to do, in my mind.

Thanks for the comment about board support, harryh. There is another angle to this, which is that the investors / board should also be there to provide support / help as necessary. If they didn't do so, that is also very unfortunate.

</comment></comment></comment></comment></comment><comment><USER4> I'm glad it was explained what happened and that startup.co may be getting a lot of these jobs back but it's unacceptable for a founder to explain that they didn't tell anyone about this because they had HOPED fund raising would work.

In my opinion you should talk to your employees around 6 months left. Just an open and honest talk about 6 months left of runway, here's what I'm doing about it, etc. Then after that, until you gain more than 6 months of runway, you keep employees constantly updated. Yes you risk people jumping ship but many appreciate the honesty and it will help them face the worst case scenario versus not being prepared at all.

</comment><comment><USER5> How is it acceptable under any circumstance to not let your employees know until the final hour when you need to shut the doors that the company is facing financial trouble? This isn't a simple 'shit I screwed up'. It shows a fundamental lack of respect and empathy for your employees who expected to show up to work Monday for _your_ company and get paid. Even a simple, 'we are running low on money and be here at your risk' a month out would have been sufficient.

I do wonder if VCs need to require first-time founders go through a crash course in Business, Finance, and Ethics 101.

</comment><comment><USER6> Posted this on another thread as well.

It's important that one of the key lessons here is that the CEO of Zirtual, AND their investors, failed in their responsibilities during this whole fiasco.

The CEO:

Jack Dorsey has a fairly good description of what the CEO's role is - that of an editor ([http://www.quora.com/What-is-the-role-of-a- CEO](http://www.quora.com/What-is-the-role-of-a-CEO)). The CEO should do 3 things:

\- Build and nurture the team

\- Communicate internally and externally

\- Make sure there's money in the bank

It looks like Zirtual's CEO screwed up all three of these - it's inexcusable and ludicrous to think she didn't know how much money was in the bank, and the burn rate. She probably knew exactly what was going to happen, she saw the writing on the wall, and tried her best to figure out an outcome for the company and team.

It could be that the Startups.co acquisition was the perfect thing to do, but to do it after missing payroll, breaking user and employee trust, and in such a ham-handed way is ridiculous. She played chicken with cash flow, and she lost. 400 employees who thought they had a job had to suddenly go through a stressful shake up, and start worrying about bills, insurance, and their livelihood, right before school season starts.

The Investors:

According to Crunchbase, this company raised $5.5M from VCs like Mayfield.

Don't these investors have an obligation/responsibility to their Limited Partners to invest their money wisely? Don't these investors ask the CEO for monthly or quarterly financial statements (or something simpler like - "How much money in the bank? What's your Accounts Receivable? What's your monthly burn rate?").

Why didn't someone say something 6 months ago? Why didn't someone say something 1 month ago, so that there could have been a more orderly pause in the business while trying to sell it?

What's the point in simply investing in deals and not spending any time to advise/help start-ups? The CEO of Zirtual could be super talented, but she's not run a start-up before. Shouldn't investors spend some time with her making sure things don't go off the rails?

It's events like this which erode trust in start-ups, investors and founders.

</comment><comment><USER7> How is this different than Tesla? [http://blog.sfgate.com/energy/2014/02/28/tesla-from-the- brin...](http://blog.sfgate.com/energy/2014/02/28/tesla-from-the-brink-of- bankruptcy-to-auto-pilot-cars/)

It was near death yet Musk is now a SV hero?

<comment><USER8> Near death and dead are very different.

<comment><USER3> Only in hindsight.

</comment></comment></comment><comment><USER9> "the loss of your first startup will always live with you..." why is this the culture now? that failing is okay and fucking over employees and customers is fine cause "lol startups"?

</comment><comment><USER10> > Burn is that tricky thing that isn't discussed much in the Silicon Valley > community because access to capital, in good times, seems so easy.

Huh?

[http://www.wsj.com/articles/venture-capitalist-sounds- alarm-...](http://www.wsj.com/articles/venture-capitalist-sounds-alarm-on- silicon-valley-risk-1410740054)

[http://www.bothsidesofthetable.com/2014/09/28/what-is-the- ri...](http://www.bothsidesofthetable.com/2014/09/28/what-is-the-right-burn- rate-at-a-startup-company/)

[http://avc.com/2014/09/burn-baby-burn/](http://avc.com/2014/09/burn-baby- burn/)

[http://www.businessinsider.com/sam-altman-email-startup- burn...](http://www.businessinsider.com/sam-altman-email-startup-burn-rates- are-frightening-2015-4)

> And at the end of the day… "burn" is what happened to Zirtual.

This is, for lack of a better word, lame. Burn didn't happen to Zirtual, like it's some sort of disease that lurks in the exposed brick walls of overpriced SoMa startup offices, secretly coming out to infect innocent startups when employees leave for happy hour.

Burn is something people manage and are responsible for. Clearly, Zirtual was run by people who couldn't competently manage the company's burn. To put it another way, incompetent management happened to Zirtual.

> The reason we couldn't give more notice was that up until the 11th hour, I > did everything I could to raise more money and right the ship.

Based on the description of Zirtual's finances (more money going out than coming in) raising more money would not have righted the ship. Unless Zirtual found a way to operate profitably, an infusion of cash would have only delayed the inevitable.

I think a good number of early-stage startups in Silicon Valley are operating with less runway than many of their employees would believe, but waiting until the 11th hour to do right by your employees in the hopes that investors will essentially bail you out to make payroll is in my opinion inexcusable.

<comment><USER3> I know basically nothing about Zirtual but it's worth pointing out that not all failure comes from incompetent management. Building a business is hard. Success is guaranteed to no one.</comment></comment>


Finding time for side projects and keeping marketable skills current - <AUTHOR> I'm six years into a CS-related career and I can't complain. I chose an industry that provides not only big salaries in a somewhat-low COL area, but quite a bit of stability due to the nature of the work and the restrictions on who can be hired to get it done.
Anyway, I'm finding it hard to get going on side projects and I'm finding it harder to keep my marketable skills current. After my wife and I get our two kids to bed at night I have at most 3 or so hours to myself— on a good day.
And in that 3 or so hours I have to choose between hacking on a fun side project in a domain of my liking (e.g., low-level C and asm hacking; image/video restoration filters) or learning a boring-as-hell skill (e.g., Apache Spark) I can market in my industry.
On most days I can't decide and wind up focusing on one of my other hobbies instead: 35mm film preservation; collecting Laserdiscs. Three hours flies by. Sleep. Rinse. Repeat.
So I really haven't gotten anything done. I'm a bit better of a programmer compared to myself in 2010 and I know a bit more CS, but the last project I worked on that I was truly proud of was my undergrad thesis.
The problem is that I have the ambition. It's there. Hell, it's swelling inside of me, but I just don't know what to do. I have this desire to hack up something I'm proud of, but with such a limited amount of time I feel like I should be spending it on something that will help me keep my job long-term.
And I'm doing neither.
And I'm not learning more CS which I would prefer to either one.
And I feel like I'm decaying into a husk of my former self.
Help? <comment><USER2> Totally agree with setting a schedule, even better make that public atleast to your trusted circle of friends. I have seen writers tweet number of words written everyday on their latest projects. Having an accountability buddy helps a lot, even better if you have a community. Faced with a similar problem, I am building a network of people with cognitive surplus and the drive like yourself, We are launching on Feb 8th. Check out crowdraising.co Not .Com Thoughts and feedback appreciated

</comment><comment><USER3> Sounds like me. I always need pressure to actually get work done.

This probably does not help you very much, but you could try to find a job working at the stuff you would want to do in your freetime - combining the pressure of a work environment with the fun subject you care about. Not easy though and might kill the fun in it...

</comment><comment><USER4> Why not do both? Set yourself a schedule. Marketable skills Monday and Thursday. Fun project Tuesday and Friday. Hobbies Wednesday and Saturday. Sundays whatever you feel like, or nothing.</comment>


Seven Ineffective Coding Habits of Many Programmers (2016) - <AUTHOR> https://www.youtube.com/watch?v=ZsHMHukIlJY <comment><USER2> #0: encoding what is, in essence, an essay, into video - to be viewed precisely at author's pace. Is there a transcript?</comment>


Ask HN: What are the chances of Apple buying Tesla or a majority stake in it? - <AUTHOR> <comment><USER2> Apple doesn't care about Tesla. Apple will buy Juul.

It's a drop-in team of industrial designers, QA testers, and fabricators that's identified the next viable physical platform.

<comment><USER3> Which Juul? All I can find with an admittedly short google are the vape guys.

</comment></comment><comment><USER4> It's SoftBank.

[https://markets.businessinsider.com/news/stocks/tesla- stock-...](https://markets.businessinsider.com/news/stocks/tesla-stock-price- elon-musk-met-softbank-ceo-about-taking-private-report-2018-8-1027443866)

<comment><USER5> It's not SoftBank. It's dumber money than even that. (!!). It's almost certainly the Saudi Sovereign wealth fund increased by seized/nationalized funds.

<comment><USER4> I don't think so. The SSWF reached the holding threshold that required public disclosure, and while it helps Musk with the share price driven up by that disclosure, it doesn't seem to be the play he'd make.

<comment><USER5> Voilà!

<comment><USER4> Indeed! The Saudis were who Musk was referring to when he infamously tweeted "Funding secured".

</comment></comment></comment></comment></comment><comment><USER6> I don't see Apple being that interested in jumping into something as big as car industry. Dealing with auto suppliers, labor stuff, etc is a bit out of their usual business.

<comment><AUTHOR> Apple don't have to do that. Tesla have already figured that out

<comment><USER6> I think those things are a long term thing, not so much "figured out" and finished. Also had they figured it out enough... we wouldn't be talking about Apple buying them.

</comment></comment></comment><comment><AUTHOR> Wondering why this post got flagged?</comment>


Apple's Blu-ray fiasco: the iTunes conflict  - <AUTHOR> http://blogs.zdnet.com/Apple/?p=5928

<comment><USER2> I have been holding off buying a new Mac because I need Blu-Ray for burning and watching edited hd video. My old G5 is now getting 6 years old. If Macs do not come with Blu-Ray in this first quarter of the year, I will have to buy a Windows PC. I cannot hold off any longer. With Windows 7 being a better operating system (compared to Vista), this a a very realistic option.

</comment><comment><USER2> I have been holding off buying a new Mac because I need Blu-Ray for burning and watching edited hd video. My old G5 is now getting 6 years old. If Macs do not come with Blu-Ray in this first quarter of the year, I will have to buy a Windows PC. I cannot hold off any longer. With Windows 7 being a better operating system (compared to Vista), this a a very realistic option.

</comment><comment><USER3> That was the worst justification of tech spending I've ever heard. He "had" to buy a blu-ray player just to play Disney movies for his kid in HD, and it's better than buying it from iTunes because it comes in a case.

It's pretty much the opposite conclusion I came to for my kids and I've been ripping things mainly to keep their grubby fingers off the discs.</comment>


Was Email a Mistake? - <AUTHOR> https://www.newyorker.com/tech/annals-of-technology/was-e-mail-a-mistake <comment><USER2> Discussed yesterday:

[https://news.ycombinator.com/item?id=20623562](https://news.ycombinator.com/item?id=20623562)

</comment><comment><USER3> This title is clickbaity. The article asks whether replacing meetings with async digital messaging was an improvement.

[edit:] I suggest modifying the headline. Perhaps to something like: "Was Email an Improvement Over In-Person Meetings?"

</comment><comment><USER4> It's weird that tech people think that just because they invented something, they can just as easily make it go away.

</comment><comment><USER5> Was posting this item again a mistake?</comment>


Keras-based molecular autoencoder - <AUTHOR> https://github.com/maxhodak/keras-molecules <comment><USER2> One of the authors of the original paper [https://arxiv.org/abs/1610.02415](https://arxiv.org/abs/1610.02415) here.

From a machine learning point of view, we simply glued together two techniques: text autoencoders and Bayesian optimization. That is, we trained an autoencoder to transform a text representation of chemicals (SMILES) to and from continuous vectors. Then "chemical design" is just maximizing a function of a continuous variable, something that we already know a lot about.

We also showed off some of the nice things that one can do with continuous latent representations, such as interpolation. This had already been done for images by many people, and for text in [https://arxiv.org/abs/1511.06349](https://arxiv.org/abs/1511.06349)

Of course, our paper is just a proof of concept. For instance, instead of encoding to and from SMILES, it would be much better to encode to and from graphs directly. We know how to encode graphs into vectors, but I don't know of a good way to decode a vector into a graph.

Another open problem is that it's hard to know what to optimize. Our initial experiments optimizing for specific chemical properties produced suggested molecules with crazy structures, such as giant rings. Human chemists have a great intuition for what is easily synthesizable or stable, and it's hard to articulate all the properties we want the molecule to have programmatically. Alternatively, we could enforce the optimizer to only look at molecules similar to ones we've already seen, but this is unsatisfying too - after all, the best result of exploration is when you find something unlike what you've seen before.

<comment><USER3> I think one of the biggest potential for molecular autoencoders is that they can be used to generate inputs for virtual high throughput screening campaigns to predict new drugs. The idea would be to train models to predict compounds that can be evaluated with more physically realistic molecular docking simulations --> in vitro activity assays --> animal models --> and then clinical trials as it goes through the pipeline.

Here is an example from our lab using virtual screening to develop PZM21 to treat pain [1]. where we screened 3M compounds. We would have liked to have screened 10^6 fold more compounds to cover easily synthesizable chemical space in this as well as other campaigns, but that is currently computationally infeasible. If molecular autoencoders could help us more efficiently screen this space, it would be huge.

I'm co-organizing a free, 1-day workshop for deep learning for chemoinformatics at Stanford Nov 11th. We've got ~75 mostly computational chemistry researchers coming. I would love to have more machine learning researchers come as well. The website is deepchemworkshop.docking.org, or PM if any of you think you may be interested.

[1] Manglik, et al. Structure-based discovery of opioid analgesics with reduced side effects (doi:10.1038/nature19112)

<comment><USER4> Someone with PZM21 knowledge! Intriguing! Would there be any point to using low-granularity approximations of 'disjoint-class-ish' molecular backbones and building upon best candidates, doing some kind of low-res hill-climbing in effect, before increasing granularity with the best ones?

Granularity might be some kind of "well we need some kind of phenol or phenol- derived ring here, why not just replace that with some sort of representation of 'phenol-like-ring-here'" or something to that effect.

Also, about PZM21 -- will it ever experience the same fate of U47700, or the likes of the orphaned opioids resurfacing from their watery graves?

<comment><USER3> In theory I think you are right--there should be a tower of representations from low-res/fast to high-res/slow. Though in practice it has been hard to make multi-resolution modeling work together. For example for proteins, where the backbone is much more regular than small molecules Rosetta has "centroid mode" and "full atom mode". There is also MM/QM models where just the active site is modeled with higher level of theory representation.

For virtual screening it is possible to speed things up by say not taking into account receptor flexibility or ignoring explicit interactions with water.

As for lower resolution representations of small molecules, there is ROCS[1] and friends which represents small molecules with a set of gaussians.

One of challenges with low-resolution representations is that the aims of virtual screening is often to find novel backbones that may interact with the protein. So any low-resolution representation should mix different backbones into the same cluster, but finding such a representation is difficult, given the diversity of small molecules.

As for U47700, finding the mechanism of action for drugs that treat complex processes like pain is quite difficult. Also small molecules often interact with numerous targets so deconstructing how it works is non trivial. Part of the motivation for PZM21 is to try to separate out the downstream effects of hitting the mu-opioid receptor as a "biased" ligand. I think PZM21 with its new scaffold will help disentangle the effects of classical opioids.

[1] [https://www.eyesopen.com/rocs](https://www.eyesopen.com/rocs)

<comment><USER4> Any concerns that PZM21 will be an even 'better' designer drug than U47700, O-DSMT, MPP, hell even heroin? Especially due to the adversarial nature of clandestine chemists and their respective nations' law enforcement agencies. Then again, taking a peek at PZM21's shape, good luck out there to all the non-sigma aldrich tier chemists who want to make their own, lol.

</comment></comment></comment></comment></comment><comment><USER5> This is the future of computational chemistry. The field of "Molecular Dynamics" could easily be swept aside by machine learning. It is why I switched from running "Molecular Dynamic" simulations as a graduate student to modelling genomic data with TensorFlow as a Postdoc.

<comment><USER6> How do you suppose the questions you've answered working on ion channels would be addressed with machine learning? I get the impression by "swept aside" that you feel the field of molecular biophysics is not meaningful in the study of health and medicine.

<comment><USER5> The neural network community uses proper "training"/"validation"/"test" datasets to asses model performance, and has developed algorithms to fit complex models to large amounts of data using relatively little computing power. I think it is possible to build completely new and accurate models of biophysical systems with neural networks with relative ease.

Using models like variational autoencoders it might be possible to draw _truly_ independent samples in a single step, instead of relying lots of MD steps to find novel conformations.

I could go on, but I have to get to bed now :-)

<comment><USER6> I like the idea, but I wouldn't call it "relative ease". Are we talking about making better force fields, or training a recurrent neural network for generative dynamics that obeys the laws of physics (can be used to calculate ensemble averages) for arbitrary length proteins/folds? How do you construct a VAE for protein dynamics when you only have a single structure? There's a serious lack of data that prevents these things.

</comment></comment></comment></comment><comment><USER4> It might be interesting if there were some routine that could 'reverse-decode' drug-like properties, i.e. producing Lipinski's rule of 5 from nothing but "drug-like" and "not-drug-like" labeled training set.

<comment><USER7> We did something like that for a more continuous property, like logP, which is easy to predict with cheminformatics. We are working on metrics that reflect drug-likeness better.

<comment><USER4> Interesting. If I'm not mistaken, logP is a type of property where it is easy to look up constituents' "contribution" for the purpose of predicting logP with substitutions/alterations of the example molecule.

<comment><USER7> Exactly, we have a good understanding that logP is additive (as a matter of fact, one predicts it using group contributions). The AE noticed this and started adding halogens to already high logP molecules.

The interesting part is that it stops before going totally crazy and per- halogenating the molecule. This is probably because it has an intuition about how molecules look like and hasn't really seen that kind of substitution pattern.

<comment><USER8> Wait, what is logP? I assumed you meant log probability, since that is the standard error metric for text prediction tasks like this.

<comment><USER7> It's the water-octanol partition coefficient, a basic molecular descriptor of the physiological distribution of a drug. It is one of the multiple targets one aims to optimize in a novel drug-like compound.

[https://en.wikipedia.org/wiki/Partition_coefficient](https://en.wikipedia.org/wiki/Partition_coefficient)

</comment></comment></comment></comment></comment></comment><comment><USER9> The author of the github repo doesn't seem to be an author on the ArXiv pre- print. Anyone knows why?

<comment><USER7> One of the authors here. Mostly he was just faster than us! Most co-authors are busy right now starting jobs at new places (plus trying to get published at an old school journal for the comfort of chemists out there).

Max has done a very good job writing a neat implementation of our autoencoder. I encourage everyone to go invent some new molecules!

</comment></comment><comment><USER10> The chart in the readme makes the text completely unreadable on mobile. I'd suggest putting it on top or bottom of the text.

</comment><comment><USER11> I did Computer Aided Drug Design for my undergrad. I wish I knew this</comment>


PuTTY 0.63 released, fixing four security holes - <AUTHOR> http://www.chiark.greenend.org.uk/~sgtatham/putty/ <comment><USER2> The security holes are not critical but of course you should upgrade anyways.

3 of the holes have the following notice: We are currently unaware of any way in which this can lead to remote code execution.

4th hole is that putty does not cleanup sensitive memory when it could.

<comment><USER3> 3 better-safe-than-sorry-in-improbably-scenario ones and one that requires an attacker to have physical access to your machine (or just to your memory and a good freezer, if you remember that hack hack :)

Seems like the best time to upgrade is in a few weeks after the crypto community had some time to analyse the changes. Maybe upgrading in a rush is as bad nowadays than not upgrading, with all the ... terrorism?... going on.

</comment></comment><comment><USER4> Since starting to use Windows 8, I found that the grouping behavior of the taskbar combined with a dozen open PuTTY windows drove me insane. There's a multiple-tabbed PuTTY shell, but it was hard to get used to as well. I finally switched to the Chrome SSH client, which has been much better (though it doesn't have nearly the features of PuTTY, of course).

<comment><USER5> It's been a while since I was stuck on a Windows box, but I found the combination of Console2 (tabbed terminal emulator) with Cygwin[1] was quite nice. Then you can use `ssh', `scp', etc. like you would on a Unix machine. You might want to try this approach if you're willing to go as far as to do this from your browser (which gives me shivers). This was on Windows XP but I imagine it still works.

[1] [http://sourceforge.net/projects/console/files/](http://sourceforge.net/projects/console/files/)

<comment><USER6> Console2 looks good.

I played with "Putty Session Manager" for a while before moving entirely to Mintty under Cygwin.

</comment></comment></comment><comment><AUTHOR> Some other projects who depend on PuTTY like FileZilla have new builds too: [https://filezilla-project.org/](https://filezilla-project.org/)

</comment><comment><USER7> Is there a client that has UTF8 as default and something different than the courier font?

<comment><USER3> It's two clicks after you install putty.

select Default, go change those two options (recommend the Mensch font, but that's purely personal). Go back to the sessions screen, save this as default.

done. now every session you create will have UTF8 and a decent font by default.

I also suggest you change scroll back to 999 or 9999. And change the color of bold blue to something readable.

<comment><USER7> Those are actually more than two clicks and sadly enough to frustrate me every time.

There must be a fork with sane defaults out there somewhere.

<comment><USER8> You could probably export a Registry file that has all your settings and then import on a new machine.

<comment><USER9> The last time I used windows a bit (I think it was around the Planetside 2 launch...), I noted down this:

# set up for putty: # From: [http://mshnitzer.wordpress.com/2009/10/09/export- putty-setti...](http://mshnitzer.wordpress.com/2009/10/09/export-putty- settings-with-a-single-command/) comment:

reg export HKCU\Software\SimonTatham putty.reg reg import putty.reg

I'm not sure what's the standard now, but I also always set "use ssh protocol v2 _only_ " \-- and you probably should too (on the off chance that you have some ancient device that doesn't handle version 2, you should probably make an exception in that profile).

</comment></comment></comment></comment></comment><comment><USER10> As an alternative to PuTTY, MinGW with the OpenSSH package has been great.

</comment><comment><USER11> I was using Putty Connection Manager (puttycm) to allow for tabbed browsing of multiple windows, and after upgrading Putty I now get issues. Loads nothing but a grey screen.

I'm working my way through it, but just wanted to pop in to see if anyone else had an issue.

Circling back. Here's the solution:

=> open Putty Connection Manager

=> select Tools > Options

=> select Plugins > Putty

=> select "Enable additional timing for PuTTY capture (ms): set to 300ms

=> select Apply & OK

</comment><comment><USER12> I wonder if the diff will apply cleanly to Futty/PuTTYTray - they're still based on a 2012 build of 0.62.

Edit: Blergh, SVN.

</comment><comment><USER13> PuTTY's pretty much relegated to the emergency usb key these days. Runs on pretty much any Windows and without installing, but not really ideal for heavy use imho.

Cygwin + urxvt + clusterssh is the choice of Windows-mandated champions.

</comment><comment><USER14> If anyone is looking for a Putty alternative, check out ZOC. It's great but it costs money.

</comment><comment><USER15> It's 2013. Why the fuck is anyone still using Windows?

<comment><USER16> I know this is a troll statement, but I feel Windows does a lot of things well.

* For large organizations, domain controls make managing a large number of desktops much easier.

* I feel MS Office on windows is a better product than the mac version (if you do a lot of document work).

* Gaming. Windows is still dominant for desktop games.

* Windows isn't the walled garden that Mac is going towards.

* Backwards compatibility. Software written 10+ years ago for Windows still has a good chance of working on Windows 8.

* Familiar. People are used to it. I'm not going to force my parents to learn a Mac and all the weird behaviors that go with it.

* Isn't tied to hardware only made by Microsoft (which makes hardware a commodity).

I'm sure there are a number of other points I'm missing, but it's the ones that I like. But there are a number of things I really dislike about it:

* It's not unix based. So the filesystem layout differs, I can't share perl/bash scripts as easily across them. / vs \ for filesystem paths. EOL characters in ascii files.

* It took too long to get a good command line. Powershell is nice, but just too different than what I'm used to with Bash that I get on OSX and Linux.

* Many developer tools today are becoming OSX focused. Windows has a lot of great software still, but many of the smaller nitch tools that I discover are OSX or Linux focused.

<comment><USER17> Would you mind explaining what domain controls offer? I've never worked with a large windows desktop install base, so I have no idea what domain controls do exactly.

<comment><USER18> A "Domain Controller" is basically a server that has authority for a domain. A domain in Active Directory is really the same thing as a "normal" internet domain (in fact is uses DNS) in that it can have sub domains where authority can be delegated to other DCs etc.

Each domain can have a collection of resources such as other servers and printers/storage etc. So once you authenticate against the domain controller (usually by logging into a computer using a pattern like \\\Domain\Username rather than just username) you get a secure signed "token" back from the DC.

This token can be sent to other computers on the network that are members of the domain (or sent to web apps via a cookie) and it will identify the user as a member of that domain and also provide information as to what levels of access should be allowed without having to authenticate separately with each system.

That's kind of hand wavey though and Active Directory provides too many features to be enumerated here.

[http://en.wikipedia.org/wiki/Active_Directory](http://en.wikipedia.org/wiki/Active_Directory)</comment></comment></comment></comment>


Performance Comparison: Java vs. Node - <AUTHOR> https://www.tandemseven.com/blog/performance-java-vs-node/ <comment><USER2> Another article that wants to compare io blocking java code with non blocking node code. What a farce of a comparison. I wonder if the author has heard of Spring's React framework that abstracts servlet code into non blocking code.</comment>


Show HN: Weekend Project – My first blockchain wallet. Comments welcome - brown-dragon https://github.com/theproductiveprogrammer/luminate <comment> brown-dragon Hi HN! I've been working with the Stellar blockchain recently and I found it hard to get a simple, open and transparent wallet that would let me keep my accounts on my local machine. So I wrote my own and made it available for everyone. I've tried to keep the code simple and clean and I would appreciate any feedback. The goal is it should be a simple, powerful wallet that any dev can pick up - be confident how it works and be able to hack in 5 minutes.

<comment><AUTHOR> Yeah, you showed us yesterday already:

[https://news.ycombinator.com/item?id=17863814](https://news.ycombinator.com/item?id=17863814)</comment></comment>


What Is Monero? The Cryptocurrency where privacy matters most - <AUTHOR> https://www.bitcoinbeginner.com/blog/what-is-monero/ <comment><USER2> How is Monero viewed right now in the cryptocurrency community? Is it just another asset class or can it actually function as a currency? I have been disillusioned by all the offerings out there but I'm intrigued by Monero.

<comment><USER3> The dark net market space has been going through a lot of upheaval in the past ~year (lots of markets going down etc) but there is a meaningful shift away from bitcoin to monero going on.

</comment></comment><comment><USER4> The creators seem to be Esperantists -- "Monero" means "coin" in Esperanto, and their implementation of the I2P network is called "kovri" which is the Esperanto verb "to cover".</comment>


Batch Processing Millions and Millions of Images - <AUTHOR> http://codeascraft.etsy.com/2010/07/09/batch-processing-millions-of-images/ <comment><USER2> The problem of resizing all these images is an "embarrassingly parallel" one, right? You don't care about how fast any individual image is resized, only how fast they're resized in aggregate, and each image is a nice small chunk of work.

The author spends time tuning the number of workers and the number of OpenMP processes per worker for GraphicsMagick on his 16-core machines. Isn't this type of tuning a waste of time? Even using just two cores instead of one seems to introduce inefficiency. Wouldn't he have been better off just using 16 workers, each compiled without OpenMP so that it would run serially (and more efficiently)?

<comment><USER3> You really nailed it. Yes, yes and yes!

This is the sort of stupid batch task that can be done with a shell-script using all the machines in the office after hours. Cut out the middle ware, cut down the threads and fancy IPC, and hunker down with good ole minimal number of processes on a bunch of machines.

Heck, they might even see a big win if they use a different "server" memory management algorithm that's more tailored to batch, not-so-responsive applications.

<comment><USER4> Barely even a shell script; you could do it in a one-liner. Let's say you had 16000 images and 16 cores,

        $ cat filelist.txt|xargs -n 1000 -P 16 ./myconvertprog

I do "batch" compression like this all the time.

<comment><USER5> Thanks for pointing out the '-P' argument for xargs!

</comment></comment></comment></comment><comment><USER6> Several years ago I had to do something similar (10 of thousands instead of millions though).

Our problem was that we were making a composite image but sometimes the 'background' image content was shifted to the left or right. (e.g. All images were the same size with a white background but some were made from different source template and so the actual content sometimes started at pixel 25 and other times at pixel 35.) To make it worse they were all JPEGS.

I ended up writing a program to find the bounding box of the content (with a fudge factor to account for the JPEG dithering) and identified the bad images to be fixed by hand. It was a nice diversion from SQL and ASP.

<comment><USER7> What tools did you use and how long did it take?

<comment><USER6> This was in 2002 and I used Python with the PIL module. It didn't really take all that long, less than a day for the whole project. Probably 2-3 hours of run time on my desktop. I wasn't actually doing anything but identifying the bad images so I wasn't pounding the disk with alternating reads/writes.

<comment><USER8> PIL is fucking amazing, I've never seen anything like it for any other language. Last year I used it to write a computer vision utility for doing black-box UI testing on embedded medical devices, and I can't imagine having used anything else. Right now I'm fighting RMagick on another project, I would have set the building on fire if I'd had to deal with it's bullshit on the CV project.

It links directly with libjpeg, libpng, etc. instead of via some imagemagick bullshit. Instead of being fucked if what you want to do doesn't line up with an existing magick command, it gives you the tools to do it yourself, and even pretty performantly since it can give you numpy arrays.

</comment></comment></comment></comment><comment><USER9> Call me naive, but I think for any serious processing, you need to dig into the actual underlying algorithm and implementation to made difference. The hardware difference between generations are huge, different arch can have a big impact in term of performance (really down to the detail: cache-line, bandwidth, and SIMD inst, image processing is sensitive to all these above). Tuning your custom implementation can suddenly be worthwhile.

</comment><comment><USER10> Mmh

 _"In fact, the research phase of this project took longer than the batch processing itself. That was clearly time well spent."_

I'm not so sure about this. A sufficiently parallelized but otherwise unresearched script could have been created in a fraction of the time. So you would just generate the correct thumbnails on new uploads and then let the batch job run for, say, two weeks. That naive approach will take you around a days worth of development time.

The time you gained by doing it the naive way you then put into the rewrite of that legacy component that prevented you from on-the-fly generating the images.

What you have done here is, IMHO, wasted time in a legacy solution and you wasted hardware resources for storage of the additional pictures of which probably only a minority will actually be seen anyways.

Don't get me wrong: I'm sure you had a lot of fun and there's little more exciting things than seeing your code perform magnitudes quicker than the initial approach. But in the context of your quote, I have to disagree.

Unless there's more background you didn't tell us about.

</comment><comment><USER11> Good, detailed post. I just did about 250K images using ImageMagick and a shell script. It was across 3 boxes and I noticed quite a performance difference between an older and newer version of IM. It could have been another factor, I suppose.

One thing I'm skeptical about:

 _"We found out, almost by accident, that using the previously down-sized "large" images resulted in better quality and faster processing than starting with the original full-size images."_

Obviously, the processing speed will be faster with a down-sized image, but I can't see how starting with a smaller image will give you better quality. Unless the original image was so large that downsizing caused a lot of detail loss (in which case the image should have been sharpened).

<comment><USER9> If you use a wrong algorithm, that can be a case. For example, when you use bilinear interpolation to "down-size" image, for large image, you can end up interpolating between two far away pixels whereas if you use a smaller image, the two pixels you use are already averaged (interpolated), thus, can get a more pleasing result.

</comment></comment><comment><USER12> If you want to make the "pick which setting is better" optimization a wee bit better, it is about two hours of work to rig up "Which do you like: image A, image B, or 'They're the same'?" and then simulated annealing your way to victory. Randomize which side you place the "better" setting on, obviously.

I'd almost be tempted to spend a few more hours and hook it up to mechanical turk rather than actually doing the classification myself. (Partially because I get bored easily and partially because I have all the artistic appreciation of a mole rat.)

</comment><comment><USER13> Did you investigate resizing them on the fly with some kind of caching layer? As one of the posters notes, it seems likely that a lot of those images will be very rarely seen, if ever.

<comment><USER14> Certain details of our (legacy) image system made the batch resize necessary. The explanation would probably be tedious, but maybe Mike will cover it when he rewrites the damn thing.

</comment></comment><comment><USER15> Nice article. FWIW Perl is often called the "Swiss army chain saw," not "Swiss army knife." Thanks for sharing your experience.

</comment><comment><USER16> Hate to be the Monday morning quarterback but hey, it's Saturday morning and I'm stuck in a Starbucks in Benicia. So, this is a nice walk through the optimization process but it is a fundamentally unscalable system. When the workload triples next year, does it make sense to scale up the hardware? (No)

This system doesn't scale out without ad-hoc partitioning. I think Etsy's approach here should have been informed by the New York Times' project a few years ago. They converted 4 TB of scanned tiffs (their article archive) into PDFs on a hadoop cluster running on ec2 and s3. Parallelizing the process across hardware nodes is the scale free way to do this, exactly what hadoop was intended for.

All that said, I know there are smart folks at Etsy. I'll give 'em the benefit of the doubt; there may be a good reason not to go that route but this write up didn't make that clear.

<comment><USER17> I am informed by the NYT project. :) For practical reasons, that approach wasn't right for us... at the time. Those details (for sake of clarity and sanity) didn't make it to the article.

</comment></comment><comment><USER18> I hate to say this, but for some reason I can't help myself.

This looks like a problem for which I could write the code in 15 minutes. Assuming Markham's Rule of Estimating (double the number and go to then next larger unit), that's about 30 hours of work.

This is a problem just begging for a functional solution. If you've got a language that already has a bunch of libraries, like .NET, you just wire it up, pipeline it, and send it out to as many workers as you want. The image tweaking, worker nitpicking stuff just isn't worth the time. If you're doing millions of everything, then I'm sure you've already got some broker parallelization thing going on. Shouldn't need to redo that every time. If you want to be truly anal, do some tests to determine the fastest way to compress. But aside from that, it's all big old hunks of immutable data splaying out into the universe, running on as many cores as you need.

I probably missed something. These things always look simpler from the outside.

</comment><comment><USER19> Why did you do this as a batch job? Do you run batch jobs instead of resizing them when a user uploads the pictures? Thanks for sharing.

<comment><USER20> This was for a site design after the images had been uploaded.</comment></comment>


Tech Making Traditional VCs Obsolete - <AUTHOR> http://www.wired.com/techbiz/startups/news/2008/08/portfolio_0829

<comment><USER2> Somehow angelsoft has slipped under my radar. This is seriously cool, I am soo applying.

Basically, this is one place where a lot of angels congregate, attracted by convenient deal-tracking software and a social network. Entreprenuers can discover angles and apply in a centralized fashion. This aligns with PG's vision of turning demo day into an auction, it's not quite there yet but it's on the right track - creating a global market place for the statups and capital.

Thank you waleedka for posting this.

</comment><comment><USER3> Why couldn't a <http://www.donorschoose.org/> be put together for startups? Since the costs are so small, why couldn't a website be created that says, I want to sell a 1000 shares of my company for 10% of the equity, and the shares are $20 each, and this is my business plan?

Actually, thinking about it there are two big problems. First is that I'm suggesting a community made of anyone, not just accredited investors.

Secondly, I understand that being new, small and unknown in a marketplace is important. As Matt Maroon put it:

"There was a section in the application that asked founders something like "why would your project be hard for one of your competitors to clone." Our answer was that technologically it wouldn't. And unless you're building something like Zenter or maybe Loopt, that's going to be largely true for you too. There isn't much Yahoo or Google programmers couldn't pump out in a relatively short period of time, and anyone who says otherwise is either lying or delusional.

"And that's fine, because we can all name ten times they've made a technologically equal (or even superior) clone of some popular website only to watch it flounder. So explain why, even if they did clone you, you really wouldn't be hurt by it."

So obviously Google could scour the site and find ideas.

Having said all that why isn't there community based, micro finance type (think kiva) of website for web startups? Would that work?

<comment><USER4> I think it's an innovative idea, but speaking form just a tiny bit of personal experience, buying and selling pieces of companies (excluding the stock market) can be terribly confusing. Am I buying 10% for my $20,000? Then why is it, one year later (and more stock has been issued/other investors have come in), I have less than 10%?

It could be possible, and thinking about it, it's might even be largely educational for people who became interested in it. But getting people up to speed on the procedures and terminology may be initially difficult.

<comment><USER5> > Then why is it, one year later (and more stock has been issued/other > investors have come in), I have less than 10%?

Because other stock has been issued.

Companies can sell "new stock" or "old stock". Selling new stock dillutes. Selling old stock doesn't.

Suppose that you own 20 out of 200 shares. If the company sells 100 of those 200 shares, you still own 10% because the number of shares hasn't changed. If the company creates 100 and sells new shares, you now own 6.66% because the number of shares has changed to 300.

<comment><USER4> I was using the question to illustrate a point, but thank you for that wonderful explanation :)

I simply meant to point out that there are things that are not immediately obvious to people who are not actively involved in this area, and it may take several dozen well-written paragraphs such as yours to bring people up to speed.</comment></comment></comment></comment>


There Are Three Programming Paradigms (2013) - <AUTHOR> http://wiki.c2.com/?ThereAreExactlyThreeParadigms <comment><USER3> Logic programming really falls in to two main categories: search and constraint satisfaction. In that light, there's really only two programming paradigms: Temporal and Spatial.

Imperative programming is programming with time. Functional programming projects time on to space. When you add concurrency, either effectively becomes logic programming: Search runs multiple spatial processes in parallel. Constraint satisfaction treats each constraint variable as its own timeline.

We only don't think of it this way because we've traditionally linearized logic programs. You can linearize search with backtracking and you can linearize constraint satisfaction with a constraint propagation queue.

<comment><USER4> Can you expand on this? I'm not sure I follow..

<comment><USER3> I can try, but I'm not just going to guess what your misunderstanding is. What specifically would you like me to expand upon?

<comment><USER4> I don't understand what you mean by:

> Imperative programming is programming with time. Functional programming > projects time on to space.

and:

> Constraint satisfaction treats each constraint variable as its own timeline

<comment><USER3> Think about a mutable variable. In an imperative program X can start with A, then become B, then become C, etc. In a functional program, you can say that X doesn't change, instead there's really a subscript: X0=A, X1=B, X2=3. That is, you're projecting the time dimension, which is implicit, linear, etc, on to a space dimension: The name of the variable expands from ["x"] to ["x", 1] etc.

Monads are the (an?) ultimate exploration of this idea. You project the timeline of the entire world on to a space dimension. Each "bind" operation builds up a new world and you can have many forks of the world, as it's just a model, not the world itself. This model doesn't do anything until you "run" the monad by handing it off to some higher level interpreter.

As for constraint satisfaction, check out Sussman's talk "We Really Don't Know How To Compute" <[https://www.youtube.com/watch?v=O3tVctB_VSU>](https://www.youtube.com/watch?v=O3tVctB_VSU>) \- Even though they implement the propagator networks with a message queue and a single thread, you could in theory run each propagator in parallel, sending messages back and forth.

<comment><USER5> Writing another comment, I had the thought that time is still present in the functional paradigm, though not in the same way as it typically presents in the imperative paradigm. This is a great way of thinking about it, thanks.

</comment></comment></comment></comment></comment></comment><comment><USER6> Last time I visited C2 it was just a site that served up HTML, what is this new async loader business it's doing?

As a result, I can't see the actual content... I assume the three paradigms were:

1\. Imperative

2\. Functional

3\. Logic-based?

<comment><USER7> This is what they taught at University in Australia 20 years ago.

Wikipedia's programming paradigms page has ummm, more than is worth easily counting.

[https://en.wikipedia.org/wiki/Programming_paradigm](https://en.wikipedia.org/wiki/Programming_paradigm)

It also features Homoiconic programming paradigm that so many interviews ask questions about these days.

<comment><USER8> > _Homoiconic programming paradigm that so many interviews ask questions about > these days._

What? You're telling me that companies discovered Lisp?

<comment><USER9> Rebol...and upcoming Red/RedSystem are homoiconic too and might be more accessible if you aren't a big lisp fan.

<comment><USER8> Sure, but besides maybe Clojure, I don't know of any homoiconic language that'd be popular enough in the industry that you'd expect questions about this showing up on interviews...

<comment><USER9> You won't get an argument from me there. If it's a standard business logic Java/C# shop you won't get those questions.

</comment></comment></comment></comment></comment></comment><comment><USER10> A must-read if you're interested in the topic: _Programming Paradigms for Dummies: What Every Programmer Should Know_ [1]. (Visual summary thanks to Wikipedia: [2])

In short, in this view, programming paradigms are traits of languages, or more precisely a programming paradigm is the particular combination of traits that you include in your language.

A single addition or removal of one language trait can make the language feel quite different.

[1] [http://www.info.ucl.ac.be/~pvr/VanRoyChapter.pdf](http://www.info.ucl.ac.be/~pvr/VanRoyChapter.pdf)

[2] [https://en.wikipedia.org/wiki/File:Programming_paradigms.svg](https://en.wikipedia.org/wiki/File:Programming_paradigms.svg)

<comment><USER4> > A single addition or removal of one language trait can make the language > feel quite different.

I agree with this, and in this is why I, to some degree, disagree with the idea of a 'polyglot programmer', in the sense of an experienced programmer having general "software engineering skills", appreciation of OOP principles etcetc with the idea that they can quickly pick up _any_ language from having a base set of sw skills.

In reality, understanding the _specific_ implementation of many languages (all of which differ), and the nuances of the features of the languages are important. A single trait can make a significant difference the way you should use a language, not to mention differently-evolved community standards/expectations.

<comment><USER11> I think most people mean "polyglot programmer" when they do in fact know several languages in detail. I've got a number of languages for which I am not "a world-class expert" but I am certainly an "expert", able to structure significantly-sized systems with best-practices and a fairly detailed understanding of all relevant costs and benefits I'll get from it. Precisely because I've picked up so many languages, I also know that the hardest part of that is what you point out, that every single difference ends up affecting the best practices. With the exception of the very heavily bondage-and-discipline languages (Haskell, Rust, Ada, Idris), the mere act of learning syntax and most of the semantics of most languages is often a less-than-one day task.

<comment><USER4> True, but I've known people use it to mean something like language-agnostic technologist, with the idea that they have enough experience in one or two languages that they could pick up anything else at senior level.

> Precisely because I've picked up so many languages, I also know that the > hardest part of that is what you point out

This is exactly it. The people I describe have a few similar languages under their belt, and simply extrapolate from this.

I wouldn't, for example, assume a experienced senior java dev could pick up Scala at the same level within a few months, despite the similarities; they simply lack experience with the new traits.

</comment></comment></comment></comment><comment><USER12> a pete peeve i've had about "goal based programming": it always sounds like people are just arguing for a higher level of abstraction. is that essentially what it is? people always say "i want to tell the computer _what to do_ not _how to do it_ ", and i feel like that ignores the fact that right now you are able to do that to some degree. in my chosen languages, i dont have to allocate memory when i make an array. isn't that me saying "i want an array, i dont care how you do it" and the computer obeying? help me understand how "goal oriented programming" is a difference in kind and not degree. to me, it just looks like an argument to walk higher up the ladder of abstraction.

<comment><USER13> One of the canonical examples of goal oriented programming would be sorting a list.

Rather than expressing how to take an arbitrary list and rearrange the elements so that they're sorted you express what means for a list to _be sorted_ and let the algorithm figure out how to get there.

* An empty list is sorted.

* A single element is sorted.

* If one splits the list into its first element and its remainder then it is sorted if the remainder is sorted and the first element is less than or equal to the head of the remainder.

This doesn't lead to an efficient sort but it is enough for an algorithm to take any list and produce its sorted form. You can, with the right constraints, get a goal oriented system to carry just about every sorting algorithm and the benefit is that they're really concise and they read like the high level pseudocode you might see in an algorithms class.

<comment><USER12> i dont see how this is different from any other built in function, or external library really. perhaps it seems different because there are alot of well known sorting algorithms that have different strengths and weaknesses? there are any number of ways of summing a list (most of them stupid), does sum() qualify as goal oriented? i dont think what your saying is without merit, but i do think the taxonomy needs to be discarded if thats what its referring to.

<comment><USER13> The difference is that those three statements encapsulate the entire source code required to perform a sort. It's not calling any kind of built-in sorting function. From those constraints the system is able to logically derive the sorted list.

<comment><USER14> > those three statements encapsulate the entire source code required to > perform a sort.

It is calling the resolver system though and all the accompanying functions that actually do the sorting.

Not sure what is your definition of "source code", but I'm pretty sure nobody counts external library function implementations as source code for the program. Same as you don't count OS kernel as part of your program's source code.

<comment><USER15> Yes, but the resolver is not specific to sorting. The runtime of Prolog contains no list sorting code. (Or if it does, it does so as an optimization.)

</comment></comment></comment></comment></comment></comment><comment><USER16> I think there is a fourth category not covered by the OP, which is Generative Programming[0].

This paradigm does not have a fundamental reduction nature (the opposite, actually), is not concerned with memory cell manipulation, and is not limited to predicate calculus (though its products can certainly be used for such).

Well known examples include C++ templates, Scala macros, JavaScript/Perl/Ruby evaluation of text blocks, Aspect Oriented Programming[1], amongst others which I am sure I have unwittingly omitted.

0 - [https://www.amazon.com/Generative-Programming-Methods- Tools-...](https://www.amazon.com/Generative-Programming-Methods-Tools- Applications/dp/0201309777)

1 - [https://en.wikipedia.org/wiki/Aspect- oriented_programming](https://en.wikipedia.org/wiki/Aspect- oriented_programming)

<comment><USER17> Maybe this could be seen as a form of term rewriting system? That's the paradigm behind languages like Maude and Pure.

<comment><USER18> You beat me to it. That's exactly what I was thinking. It would be rooted in equational logic or something like that. The K Framework they did the C semantics and KCC compiler in comes to mind. There's also term rewriting languages like Stratego that do everything that way. LISP's as used by Alan Kay et al are like a hybrid of that, functional, and imperative programming that made for great productivity with DSL's.

So, it may be a subset of something else or its own paradigm. Worth people thinking on. Plus, I think the style doesn't get enough attention given the results I've seen its practitioners pull off with little code.

</comment></comment></comment><comment><USER19> After watching the loading (?) animation for awhile, I'm guessing the three paradigms are:

* Plain text.

* HTML.

* Gratuitous javascript.

<comment><USER20> Web assembly will be the fourth.

<comment><USER21> Web assembly is just a different interpretation of gratuitous javascript.

<comment><USER22> Specifically, it's the ability to compile other languages into gratuitous JavaScript.

</comment></comment></comment></comment><comment><USER23> working link: [http://web.archive.org/web/20160709095702/http://c2.com/cgi/...](http://web.archive.org/web/20160709095702/http://c2.com/cgi/wiki?ThereAreExactlyThreeParadigms)

<comment><USER24> Thanks, I wanted to save the page to my local computer, but I couldn't figure out how to do it..

</comment></comment><comment><USER25> I wonder if the author would consider genetic programming (generating random code and executing it to compare it against a fitness function, sometimes used in computer game bots) an example of their "missing paradigm" \- it fits the description they give.

</comment><comment><USER26> Thomas Kuhn and I have been secretly collaborating on a paradigm shift, rendering this discussion irrelevant.

</comment><comment><USER27> Three shall be the number of the paradigms and the number of the paradigms shall be three.

</comment><comment><USER28> This is the original Wiki from 20 years ago , recently restored from backups and thus probably not expecting to be Slashdotted^H^H^HHacker Newsed ...

<comment><USER22> It's a good thing we're not Slashdothacker Newsing it, then :)

</comment></comment><comment><USER29> Would it be possible for someone to post a portion of the text? Even when I whitelist the site in NoScript, it doesn't seem to load up

<comment><USER30> See also: archive.org's archive of the old wiki page: [http://web.archive.org/web/20160709095702/http://c2.com/cgi/...](http://web.archive.org/web/20160709095702/http://c2.com/cgi/wiki?ThereAreExactlyThreeParadigms)

FunctionalProgramming

* where the value of an expression is computed, usually close to the lambda calculus.

* or to put it differently: where the fundamental operation is reduction (of applicative terms).

ImperativeProgramming

* where cells in some sort of memory are filled and overwritten with values. Inspired by the TuringMachine and curiously never mentioned in the above table (or to put it differently: where the fundamental operation is assignment.)

* Actually, this generalizes to the fundamental operation being communication. The common case is simply communication to a cell maintained by some memory service (you send either a 'set' or a 'get', or possibly an 'apply-function' as needed for atomic ops or fast XOR processing). The more general case can consist of sends and receives on a fully networked, distributed model.

* * (different author replying) Actually, this "generalization" sound much more like the ActorsModel, which is no where near ImperativeProgramming, actually the actor model is much more similar to FunctionalProgramming than it is to imperative programming.

LogicProgramming (and ConstraintProgramming)

* where a solution to a set of logic formulas is sought; very declarative and incorporating some sort of search strategy like backtracking.

* or to put it differently: where the fundamental operation is satisfaction of a predicate.

* ConstraintProgramming envelopes LogicProgramming, since any logic domain can be expressed in terms of a constraint system, but the inverse is not often easy to express (due to the more strictly typed variables in LogicProgramming). However, the fields are disparate enough to have been split into LogicProgramming, ConstraintProgramming, and ConstraintLogicProgramming. (ConstraintAndLogicProgramming). This sort of programming is also called 'DeclarativeProgramming', but the word 'declarative' is somewhat overloaded.

That's it! Everything else is built on one of these three paradigms (Functional, Imperative and Logic), while sometimes incorporating elements of the others.

<comment><USER29> Thank you.

</comment></comment></comment><comment><USER31> The site is down. I wonder which paradigm covers "build for scale"?

<comment><USER32> Changing C2 to a JS-backed website that runs a lot more slowly is probably one of the worst things to happen to hacker heritage in the last few years.

If I'd known Ward wanted something more modern I would've volunteered to do a rewrite for something that was faster myself.

</comment></comment><comment><USER33> This article it good but misses the most common programming paradigm - <USER2> programming. Not all programmers know this powerful paradigm and tend to write code instead of solving problems.

</comment><comment><USER34> c2.com is unusable js crap. Hoped I'll never see that in my lifetime.

<comment><USER35> The largest thing it downloads with a XHR is names.txt, a 641 kB (265 kB gzipped) list.. of names. 36852 names to be precise. Baffling.

Apparently it's to make links clientside in the text. [https://github.com/WardCunningham/remodeling/blob/master/sta...](https://github.com/WardCunningham/remodeling/blob/master/static/index.html#L129)

</comment></comment><comment><USER36> My prediction was that the article would talk about: abstraction, application, and variables.

[https://en.wikipedia.org/wiki/Lambda_calculus](https://en.wikipedia.org/wiki/Lambda_calculus)

</comment><comment><USER37> I feel like some sort of Deep Learning oriented programming might be the "new logic programming". Instead of the horn clause engine you get the DL engine. Essentially you have a "universal mapping function" and "parameter fitting". Instead of defining facts you provide data, instead of rules you provide mappings and you also get the "inference for free" (which is sort of the battle cry of Prolog). Instead of logical deductions you get probabilistic deductions. Are there any dedicated machine learning/deep learning languages or DSLs that work at this level of abstraction?

<comment><USER22> I reckon that's closer to "goal-based programming" (the proposed "missing" fourth programming paradigm on that page). Basically (as I interpret it at least) defining test cases / behavior specifications for what you want the software to do, then letting an artificially-intelligent sort of "autoprogrammer" automagically generate a program that conforms to that specification.

Software like Cucumber [0] might be part of that particular paradigm once the missing pieces around AI/ML take proper form.

[0]: [https://en.wikipedia.org/wiki/Cucumber_(software)](https://en.wikipedia.org/wiki/Cucumber_\(software\))

</comment></comment><comment><USER38> Anyone else having trouble accessing this site.

<comment><USER39> Error:

Trouble Encountered [http://c2.com/wiki/remodel/pages/ThereAreExactlyThreeParadig...](http://c2.com/wiki/remodel/pages/ThereAreExactlyThreeParadigms) can't fetch document

See github link: [https://github.com/WardCunningham/remodeling/issues/2](https://github.com/WardCunningham/remodeling/issues/2)

</comment></comment><comment><USER40> Wouldn't SQL count as goal based, by their logic?

<comment><USER16> In the categorization presented in the OP, SQL would be categorized as "constraint programming" as described here[0]. Essentially, SQL conforms to a subset of predicate calculus[1] whose operations are quantified by relational algebra[2].

HTH

0 - [http://lambda-the-ultimate.org/node/4370](http://lambda-the- ultimate.org/node/4370)

1 - [https://en.wikipedia.org/wiki/First- order_logic](https://en.wikipedia.org/wiki/First-order_logic)

2 - [https://en.wikipedia.org/wiki/Relational_algebra](https://en.wikipedia.org/wiki/Relational_algebra)

</comment></comment><comment><USER41> tldr = Haskell+C+SQL

<comment><USER42> +Prolog

</comment></comment><comment><USER43> This is a question I've thought about a lot this year. How many programming paradigms are there? How will we know if/when we've discovered them all? Is there a way to arrange them so that gaps in the table predict yet-to-be- discovered paradigms in the same way the periodic table predicted elements or the square of R/C/?/L predicted memristors?

After reading some of Greg Egan's hard science fiction that explores the consequences of a universe where time is a spacelike dimension or another where there are two timelike dimensions, I wondered if programming paradigms could be categorized according to what kind of world lines data or variables may have.

For instance, in some mathematical spacetimes, the future looping back on the past is not a construct you can create. In others (such as Egan's Orthogonal universe), it is quite possible for world lines to arbitrarily loop back on the past. This could be analogous to in a programming paradigm whether statements not yet reached can affect the statement you're looking at. For instance, whether a logic program supports constraint satisfaction.

Mutability and immutability could be analogous to various ways of resolving the Grandfather Paradox. If the result is the timeline is changed/overwritten, that is analogous to a mutable programming paradigm. If the result is that you either are prevented from doing it or doing it results in spawning a duplicate timeline where history is changed, then that is analogous to an immutable or functional paradigm.

Finally, it should be noted that the program and it's entire execution state- space could be regarded as a "four dimensional object" the same way you could consider the universe + its history as a four dimensional mathematical object. (Not really "4" because the space of the program isn't necessarily 3 dimensional, but using the term as a metaphor.) In this sense, you could see the _actual execution_ i.e. the _implementation of the execution_ of the program as a vector or walk through this time-state-space that does not necessarily have to follow the (human) conceptual vector of time through the program! (Not to mention the lexical order of the program text.) For instance, a SQL engine might build a query plan that approaches the execution of a SQL "program's" time-state-space in a much different direction and order than what a human would call the "time vector" through the program.

In Egan's Orthogonal universe he deals with the question of how can living beings experience local time when a universe has all 4 dimensions as spacelike by making a distinction between the arrow of time defined by entropy versus "timelike" dimensions. In our universe the entropy arrow of time usually aligns with the timelike dimension, but in the Orthogonal universe the entropy arrow of time _could_ point along any dimension, but which dimension is the "time" dimension is set by the combined entropy of the local surroundings. Similarly, in a programming paradigm you can choose to define the "time dimension" in many different ways, but there is also an entropy arrow of time.

As an example, imagine a simple imperative programming language that conceptually executes from top to bottom. You could, in principle, make a bizarre implementation that executes backwards, starting with the last instruction and all possible result states, and searches for precondition states that could have caused that result. Repeat for the second to last statement for all of the candidate results, and so forth, until we reach the most initial state.

It's clear that this is _possible_ to implement if the language is restricted enough (for instance if it has few states, or if the only allowed operations are of a certain type). It's also clear that the big-O time/space complexity of this implementation strategy is astronomical for most complex programs. But it is instructive to look at _why_ this is: it is because this time-reversed execution implementation strategy is going backwards against the entropy arrow of time! This is reflected in the enormous amount of energy it would require to compute (drawing on the entropy of an outside system's energy source to reverse local entropy), and/or the gargantuan amount storage it would require (increasing the entropy in space of an outside system in order to reverse local entropy).

Yet at the same time, no one would bat an eye at certain classes of "programs" "running backwards", such as a linear equation solver, or a layout engine, or a logic constraint solver, etc. (One wonders whether a nominally imperative assembly language for a machine based on reversible computing would also fall into this category.)

What I'm getting at is that there are myriad "potentially timelike" dimensions in programs: lexical order, call stack, real execution time, the programmer's conception of how time flows in the conceptual program, etc. And there's also an entropy arrow of time related to how hard/easy it is to reorder the operations. Finally, I view the execution implementation as sweeping a hyperplane (or hypermanifold) through the four dimensional time-state-space of the program & the result of its execution. Depending on the ways that the time-state-space of the program are connected (or connectible) determines along which direction(s) that sweep may or must proceed.

Programming paradigms may be understandable as rules governing how this time- state-space may be connected up, which in turn affects what the entropy arrow of time looks like in execution-implementation-space.

</comment><comment><USER44> It would be awesome if he/she used whichever one would best enable it to actually withstand being posted on hacker news and still work. I'm not even sure what its doing while its playing that loading animation because it ought to be static content one would think. Unfortunately it never loads and is also not available in the internet archive. Anyone have a copy of the text?

<comment><USER45> It's _the_ original wiki. The article was written by a variety of people, probably in a conversational style.

I believe the wiki was recently rearchitected, which would explain why it doesn't scale any more :P.

<comment><USER46> Is c2 a fedwiki now? That's a work in progress I think.

</comment></comment></comment><comment><USER47> I really hate the new C2 wiki.

</comment><comment><USER48> Waste of time. Sounds like an architecture astronaut. First he mentions Functional programming and then under imperative he babbles and then says this: Actually, this "generalization" sound much more like the ActorsModel, which is no where near ImperativeProgramming, actually the actor model is much more similar to FunctionalProgramming than it is to imperative programming.

Just a bunch of incoherent CS speak IMHO.

<comment><USER49> C2 was the very first wiki. It has a great deal of historical significance.

"CS speak"? Having a formal education in CS should not be derided. Algorithms, data structures, and other components of computer science are important, and programmers lacking a knowledge of these areas can't really be trusted to work in the more demanding corners of our industry. (Many interviewers select based on these criteria.)

<comment><USER48> I didn't mean to deride CS terminology, but in TFA it's incoherently thrown around like someone who wants to sound like an expert but can't make solid case for anything and keeps changing their mind about what concepts even apply. I'm not sure where you were going with the trust and interviews thing, but I wouldn't hire the author of this piece (turns out its not one author though, it's a wiki).</comment></comment></comment>


Raft consensus algorithm in JavaScript - <AUTHOR> https://github.com/kanaka/raft.js <comment><USER2> I've seen a lot about Raft lately. I've recently built a Python library for stream processing that uses multiprocessing to manage the stages of the data pipeline and the thing I'm most interested in next is figuring out the best way to distribute it across a cluster of machines and am curious using something like Raft would be beneficial in managing the cluster of processes in some way.

Also remember seeing Google's Millwheel which is of great interest considering my current project.

</comment><comment><USER3> Why? (I mean, why in JavaScript?)

<comment><USER4> Because, sadly, browsers are the most portable runtime we have available.</comment></comment>