Shared posts

14 Apr 08:40

Cigarettes, damn cigarettes and statistics

by Tim Harford
Undercover Economist

We cannot rely on correlation alone. But insisting on absolute proof of causation is too exacting a standard

It is said that there is a correlation between the number of storks’ nests found on Danish houses and the number of children born in those houses. Could the old story about babies being delivered by storks really be true? No. Correlation is not causation. Storks do not deliver children but larger houses have more room both for children and for storks.

This much-loved statistical anecdote seems less amusing when you consider how it was used in a US Senate committee hearing in 1965. The expert witness giving testimony was arguing that while smoking may be correlated with lung cancer, a causal relationship was unproven and implausible. Pressed on the statistical parallels between storks and cigarettes, he replied that they “seem to me the same”.

The witness’s name was Darrell Huff, a freelance journalist beloved by generations of geeks for his wonderful and hugely successful 1954 book How to Lie with Statistics. His reputation today might be rather different had the proposed sequel made it to print. How to Lie with Smoking Statistics used a variety of stork-style arguments to throw doubt on the connection between smoking and cancer, and it was supported by a grant from the Tobacco Institute. It was never published, for reasons that remain unclear. (The story of Huff’s career as a tobacco consultant was brought to the attention of statisticians in articles by Andrew Gelman in Chance in 2012 and by Alex Reinhart in Significance in 2014.)

Indisputably, smoking causes lung cancer and various other deadly conditions. But the problematic relationship between correlation and causation in general remains an active area of debate and confusion. The “spurious correlations” compiled by Harvard law student Tyler Vigen and displayed on his website ( should be a warning. Did you realise that consumption of margarine is strongly correlated with the divorce rate in Maine?

We cannot rely on correlation alone, then. But insisting on absolute proof of causation is too exacting a standard (arguably, an impossible one). Between those two extremes, where does the right balance lie between trusting correlations and looking for evidence of causation?

Scientists, economists and statisticians have tended to demand causal explanations for the patterns they see. It’s not enough to know that college graduates earn more money — we want to know whether the college education boosted their earnings, or if they were smart people who would have done well anyway. Merely looking for correlations was not the stuff of rigorous science.

But with the advent of “big data” this argument has started to shift. Large data sets can throw up intriguing correlations that may be good enough for some purposes. (Who cares why price cuts are most effective on a Tuesday? If it’s Tuesday, cut the price.) Andy Haldane, chief economist of the Bank of England, recently argued that economists might want to take mere correlations more seriously. He is not the first big-data enthusiast to say so.

This brings us back to smoking and cancer. When the British epidemiologist Richard Doll first began to suspect the link in the late 1940s, his analysis was based on a mere correlation. The causal mechanism was unclear, as most of the carcinogens in tobacco had not been identified; Doll himself suspected that lung cancer was caused by fumes from tarmac roads, or possibly cars themselves.

Doll’s early work on smoking and cancer with Austin Bradford Hill, published in 1950, was duly criticised in its day as nothing more than a correlation. The great statistician Ronald Fisher repeatedly weighed into the argument in the 1950s, pointing out that it was quite possible that cancer caused smoking — after all, precancerous growths irritated the lung. People might smoke to soothe that irritation. Fisher also observed that some genetic predisposition might cause both lung cancer and a tendency to smoke. (Another statistician, Joseph Berkson, observed that people who were tough enough to resist adverts and peer pressure were also tough enough to resist lung cancer.)

Hill and Doll showed us that correlation should not be dismissed too easily. But they also showed that we shouldn’t give up on the search for causal explanations. The pair painstakingly continued their research, and evidence of a causal association soon mounted.

Hill and Doll took a pragmatic approach in the search for causation. For example, is there a dose-response relationship? Yes: heavy smokers are more likely to suffer from lung cancer. Does the timing make sense? Again, yes: smokers develop cancer long after they begin to smoke. This contradicts Fisher’s alternative hypothesis that people self-medicate with cigarettes in the early stages of lung cancer. Do multiple sources of evidence add up to a coherent picture? Yes: when doctors heard about what Hill and Doll were finding, many of them quit smoking, and it became possible to see that the quitters were at lower risk of lung cancer. We should respect correlation but it is a clue to a deeper truth, not the end of our investigations.

It’s not clear why Huff and Fisher were so fixated on the idea that the growing evidence on smoking was a mere correlation. Both of them were paid as consultants by the tobacco industry and some will believe that the consulting fees caused their scepticism. It seems just as likely that their scepticism caused the consulting fees. We may never know.

Written for and first published at

14 Apr 16:17

Roll up to school like… [video]

Roll up to school like… [video]

18 Apr 05:00

Comic for 2015.04.18 - Home of Cyanide and Happiness

More from Explosm



Did you know by creating an account you can favorite comics and shorts, automatically bookmark the last one you saw, and more? Learn more about it here!

All content is Copyright © 2000–2015 of Explosm, LLC.

Log in or Register

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at

18 Apr 15:11

Saturday Morning Breakfast Cereal - Modern Art


17 Apr 20:00

pdlcomics: Good Times

15 Apr 02:21

RT @PaulBromford: Meetings: a type of virus that use humans as hosts to replicate...

by Pai Osias
Author: Pai Osias
Source: Buffer
RT @PaulBromford: Meetings: a type of virus that use humans as hosts to replicate via @whatsthepont…
16 Apr 02:05

I can’t unsee it. (images via percussiongirl)

I can’t unsee it. (images via percussiongirl)

15 Apr 19:00

Italian Man's Quest to Fix Toilet Led to Amazing Archaeology Discoveries

by Sarah Zhang

Fifteen years ago, Luciano Faggiano of Lecce, Italy sent his sons out digging for a broken sewer line. They didn’t find the pipe, but they did find “a Messapian tomb, a Roman granary, a Franciscan chapel and even etchings from the Knights Templar,” writes Jim Yardley in a story for the New York Times.


09 Apr 11:15

Criptografia nacional pronta para funcionar em qualquer smartphone e tablet

by Augusto Campos

Enviado por zeuslinux (zeuslinuxΘyahoo·com):

“"A ZTEC, empresa de Brasília e credenciada como Empresa Estratégica de Defesa do Governo, desenvolveu o cartão MCI SD (Módulo Criptográfico Interno com interface SD), que funciona no lugar de um cartão de memória nos celulares e tablets e proporciona uma rede de comunicação criptografada.

Solução requer o sistema operacional Android. Isso porque, explica Raimundo Guimarães Saraiva Júnior, é necessário ter acesso ao código-fonte para blindar o modelo, o que não é permitido pelo iOS, da Apple, e pelo Windows, da Microsoft. Governo já está usando a ferramenta, mas o nome do cliente não pode ser revelado. Produção dos cartões será feita no Brasil, dentro de unidade própria da ZTEC.

"O importante dessa solução, que levou dois anos para ser feita na nossa área de Pesquisa e Desenvolvimento, é que os fornecedores de terceira camada, com hardware criptográfico, são de origem estrangeira e trazem os vícios de origem de segurança. Agora há software e hardware 100% nacional, aptos para proteger o Estado brasileiro e todo o mercado", explica o executivo da ZTEC, em entrevista exclusiva ao portal Convergência Digital. Vale lembrar que a camada 1 é de aplicação. A camada 2 é de Sistema Operacional blindado e a camada 3 é a de hardware criptogrado.

Guimarães Junior explica que já existia uma versão do MCI SD, mas ele não não possuia as dimensões atuais que permitem a inclusão dele em qualquer dispositivo móvel, como smartphones e tablets vendidos no mercado. "O cartão entra como se fosse um cartão de memória. É simples e fácil de manuseiar. Ele vai funcionar como um cofre guardando as chaves e os algoritmos criptográficos que a aplicação de segurança vai rodar", diz.

Para o executivo, o governo possui celulares especiais - desenvolvidos para os órgãos públicos, como o Zcell, da própria ZTEC, que já estão rodando o novo cartão. Há 200 celulares já em atividade em órgãos govenamentais, mas o nome da autarquia ainda não pode ser revelado. Mas a grande aposta, agora, é ampliar a presença no mercado privado de segurança.

Como o cartão se adequa a qualquer dispositivo, a expectativa é que se possa vender um solução de comunicação privada e criptografada. "Estamos unido software e hardware com segurança. Nossa ideia é vender num modelo de licenciamento na nuvem, para que os custos sejam adequados às empresas", projeta Raimundo Guimarães Saraiva Júnior.

Nos últimos dois anos, a ZTEC investiu cerca de R$ 4,5 milhões em Pesquisa e Desenvolvimento e, embora não revele a sua projeção de fabricação desses novos cartões, o executivo garante que a produção será local. "Temos estrutura. As empresas brasileiras de segurança não devem nada para as internacionais", completa"” [referência:]

O artigo "Criptografia nacional pronta para funcionar em qualquer smartphone e tablet" foi originalmente publicado no site, de Augusto Campos.

16 Apr 09:54

Comics: Tourists

by Cale Grim

Tourists are fucking everywhere. OMG I hate tourists why are they everywhere, FUCK I'm leaving. Oh, why, hello foreign land, I will take your photo from my tour group's stroll on this fine day. I'm totally in the right.

The post Comics: Tourists appeared first on Things in Squares.

17 Apr 14:28

will5nevercome: Aww, cheer up! You’re not even close to rock...


Aww, cheer up! You’re not even close to rock bottom yet!

16 Apr 19:03


by Daniel Lafayette


13 Apr 07:00


by Enzo


16 Apr 07:01

The Challenge

by Doug
28 Mar 03:22

Playing Seductive

15 Apr 07:01


by Doug


Dedicated to Herb Trimpe.

Here’s more hockey.

14 Apr 15:35

137 - Vested Interests

Walt: After numerous texts, messages, emails, and phone calls from one concerned
employee, I'd just like to assure you all that we are not being bought out by a telecom.
| Cube Drone: Yay!
Lain: Yay!
Miloslav: Boo!
| Miloslav: What? I have stock options.
also one concerned fax, and a few concerned singing telegrams
13 Apr 07:10

Comic for April 13, 2015

14 Apr 20:00

fuckyeahdementia: here human, stop wasting my time


here human, stop wasting my time

14 Apr 20:56

One Company’s New Minimum Wage: $70,000 a Year

The idea began percolating, said Dan Price, the founder of Gravity Payments, after he read an article on happiness. It showed that, for people who earn less than about $70,000, extra money makes a big difference in their lives.

His idea bubbled into reality on Monday afternoon, when Mr. Price surprised his 120-person staff by announcing that he planned over the next three years to raise the salary of even the lowest-paid clerk, customer service representative and salesman to a minimum of $70,000.

“Is anyone else freaking out right now?” Mr. Price asked after the clapping and whooping died down into a few moments of stunned silence. “I’m kind of freaking out.”

If it’s a publicity stunt, it’s a costly one. Mr. Price, who started the Seattle-based credit-card payment processing firm in 2004 at the age of 19, said he would pay for the wage increases by cutting his own salary from nearly $1 million to $70,000 and using 75 to 80 percent of the company’s anticipated $2.2 million in profit this year.

Employees reacting to the news. The average salary at Gravity Payments had been $48,000 year.

The paychecks of about 70 employees will grow, with 30 ultimately doubling their salaries, according to Ryan Pirkle, a company spokesman. The average salary at Gravity is $48,000 year.

Mr. Price’s small, privately owned company is by no means a bellwether, but his unusual proposal does speak to an economic issue that has captured national attention: The disparity between the soaring pay of chief executives and that of their employees.

The United States has one of the world’s largest pay gaps, with chief executives earning nearly 300 times what the average worker makes, according to some economists’ estimates. That is much higher than the 20-to-1 ratio recommended by Gilded Age magnates like J. Pierpont Morgan and the 20th century management visionary Peter Drucker.

“The market rate for me as a C.E.O. compared to a regular person is ridiculous, it’s absurd,” said Mr. Price, who said his main extravagances were snowboarding and picking up the bar bill. He drives a 12-year-old Audi, which he received in a barter for service from the local dealer.

“As much as I’m a capitalist, there is nothing in the market that is making me do it,” he said, referring to paying wages that make it possible for his employees to go after the American dream, buy a house and pay for their children’s education.

Under a financial overhaul passed by Congress in 2010, the Securities and Exchange Commission was supposed to require all publicly held companies to disclose the ratio of C.E.O. pay to the median pay of all other employees, but it has so far failed to put it in effect. Corporate executives have vigorously opposed the idea, complaining it would be cumbersome and costly to implement.

Mr. Price started the company, which processed $6.5 billion in transactions for more than 12,000 businesses last year, in his dorm room at Seattle Pacific University with seed money from his older brother. The idea struck him a few years earlier when he was playing in a rock band at a local coffee shop. The owner started having trouble with the company that was processing credit card payments and felt ground down by the large fees charged.

When Mr. Price looked into it for her, he realized he could do it more cheaply and efficiently with better customer service.

The entrepreneurial spirit was omnipresent where he grew up in rural southwestern Idaho, where his family lived 30 miles from the closest grocery store and he was home-schooled until the age of 12. When one of Mr. Price’s four brothers started a make-your-own baseball card business, 9-year-old Dan went on a local radio station to make a pitch: “Hi. I’m Dan Price. I’d like to tell you about my brother’s business, Personality Plus.”

His father, Ron Price, is a consultant and motivational speaker who has written his own book on business leadership.

Dan Price came close to closing up shop himself in 2008 when the recession sent two of his biggest clients into bankruptcy, eliminating 20 percent of his revenue in the space of two weeks. He said the firm managed to struggle through without layoffs or raising prices. His staff, most of them young, stuck with him.

Aryn Higgins at work at Gravity Payments in Seattle. She and her co-workers are going to receive significant pay raises.

Mr. Price said he wasn’t seeking to score political points with his plan. From his friends, he heard stories of how tough it was to make ends meet even on salaries that were still well-above the federal minimum of $7.25 an hour.

“They were walking me through the math of making 40 grand a year,” he said, then describing a surprise rent increase or nagging credit card debt.

“I hear that every single week,” he added. “That just eats at me inside.”

Mr. Price said he wanted to do something to address the issue of inequality, although his proposal “made me really nervous” because he wanted to do it without raising prices for his customers or cutting back on service.

Of all the social issues that he felt he was in a position to do something about as a business leader, “that one seemed like a more worthy issue to go after.”

He said he planned to keep his own salary low until the company earned back the profit it had before the new wage scale went into effect.

Hayley Vogt, a 24-year-old communications coordinator at Gravity who earns $45,000, said, “I’m completely blown away right now.” She said she has worried about covering rent increases and a recent emergency room bill.

“Everyone is talking about this $15 minimum wage in Seattle and it’s nice to work someplace where someone is actually doing something about it and not just talking about it,” she said.

The happiness research behind Mr. Price’s announcement on Monday came from Angus Deaton and Daniel Kahneman, a Nobel Prize-winning psychologist. They found that what they called emotional well-being — defined as “the emotional quality of an individual’s everyday experience, the frequency and intensity of experiences of joy, stress, sadness, anger, and affection that make one’s life pleasant or unpleasant” — rises with income, but only to a point. And that point turns out to be about $75,000 a year.

Of course, money above that level brings pleasures — there’s no denying the delights of a Caribbean cruise or a pair of diamond earrings — but no further gains on the emotional well-being scale.

As Mr. Kahneman has explained it, income above the threshold doesn’t buy happiness, but a lack of money can deprive you of it.

Phillip Akhavan, 29, earns $43,000 working on the company’s merchant relations team. “My jaw just dropped,” he said. “This is going to make a difference to everyone around me.”

At that moment, no Princeton researchers were needed to figure out he was feeling very happy.

Bookmarked at brandizzi Delicious' sharing tag and expanded by Delicious sharing tag expander.
15 Apr 12:57

Interview - PHP's Creator, Rasmus Lerdorf

Adam Victor Brandizzi

Old but still inspiring.

The membership of the SitePoint community forums recently got together and produced a bunch of questions for PHP’s original creator, Rasmus Lerdorf. In reviewing his responses, I was pleased to discover that the man who originally put the PHP machine in motion maintains an unclouded vision of what the open source movement is all about.

He is quick to play down his contribution to what PHP is today, instead attributing most of PHP’s success to the vast community of developers that have signed on to the project over the years. In a sense, Rasmus today is simply PHP’s biggest fan.

But enough from me; let’s hear what Rasmus had to say!

In the beginning…

SP: What was your first contact with the Open Source movement, and what is it about Open Source that got you hooked?

RL: Well, back in the early and mid-90′s the term "Open Source" did not exist.

"Free Software" existed, of course, and I had been playing with Linux almost since the very first release in 1991. Previously I was using QNX and Xenix and then started to fiddle with Minix until Linux rescued me.

I don’t think I was ever really "hooked" by a "movement". When you don’t have the money to buy SCO Unix and you can download something that works and even find people who can help you get it up and running, how can you beat that? Religion never really played a part.

SP: What led you to develop PHP? And what do you think this language has to offer that others don’t?

RL: The first version of PHP was a simple set of tools that I put together for my Website and for a couple of projects. One tool did some fancy hit logging to an mSQL database, another acted as a form data interpreter. I ended up with about 30 different little CGI programs written in C before I got sick of it, and combined all of them into a single C library. I then wrote a very simple parser that would pick tags out of HTML files and replace them with the output of the corresponding functions in the C library.

The simple parser slowly grew to include conditional tags, then loop tags, functions, etc. At no point did I think I was writing a scripting language. I was simply adding a little bit of functionality to the macro replacement parser. I was still writing all my real business logic in C.

In the end, what I think set PHP apart in the early days, and still does today, is that it always tries to find the shortest path to solving the Web problem. It does not try to be a general-purpose scripting language and anybody who’s looking to solve a Web problem will usually find a very direct solution through PHP. Many of the alternatives that claim to solve the Web problem are just too complex. When you need something up and working by Friday so you don’t have to spend all weekend leafing through 800-page manuals, PHP starts to look pretty good.

SP: Looking at the usage figures, there are now over 9 million domains using PHP. Did you have any idea that PHP was going to become this big? How does it feel to know that your product is probably the best alternative to Microsoft’s solutions for the Web?

RL: First, to be clear, I did not develop the PHP we know today. Dozens, if not hundreds of people, developed PHP. I was simply the first developer.

PHP is very much a collaborative project. Think of it this way: you have a Web problem. You can either go to the store and buy an expensive shrink-wrapped product that may or may not solve most of your problem. Or you can get together with a couple of thousand people who have the exact same problem as you, and work out a solution that works for all of you.

Not only will you get a solution that addresses your exact problem, you’ll also become part of a like-minded community where ideas and experiences flow freely. That beats any commercial product you can go buy at a store, and to me is the best way to develop this type of software.

So when people ask me what it feels like to have developed something that millions of people use, it doesn’t really fit with how I view things. In the end, I am simply the first member of a community that has arisen around one approach to solving the Web problem.

SP: Who would you call your hero? Which people in or outside of IT have inspired you?

RL: I don’t really get inspired by people in the metaphysical sense. But I definitely appreciate and respect a slick solution to a tough problem.

SP: During your years of PHP development, what do you think was the most important decision you had to make? Are there any decisions you made that you now wish you had decided differently?

It is tough to ask me to second-guess decisions that were made 6 or 7 years ago when PHP was used by a grand total of 1 person. Don’t forget that I did not sit down to write a scripting language that would be used by 9 million domains: I sat down to solve a problem. Solving the problem by 5pm so you can go to a movie with your girlfriend leads to some aspects that aren’t ideal 7 years later, when thousands of people have to work around that late-night hack you added.

The most important decision I made along the way was probably to give up control. To open up the project and give just about anybody who asked full access to the PHP sources. This brought in a lot of excellent talent, and people tended to feel a real sense of ownership. The PHP project is probably one of the biggest out there when it comes to the number of people with commit access to the CVS repository where the code and documentation lives.

The Open Source movement

SP: The Open Source movement is still portrayed by many as "anarchistic" and some kind of "threat to society". Do you feel it will ever gain mainstream acceptance? If it does, how will the Open Source community deal with that?

RL: I guess there are two parts to this question.

As far as being mainstream, the product of this "movement" is most definitely mainstream. The "movement" built the Internet as we know it today. It built the TCP/IP stacks used in most of the operating systems people use (yes, even Windows). It built the most popular Web server in the world, along with the DNS and MTA systems that make the Internet tick. Heck, if you go back a bit, it built the entire industry. The first operating systems were all open source, because that was the only sane way to do things. You could not sell someone a big mainframe without providing the source to the brains of the thing. It was only later on that the concept of not providing the source code was introduced.

But I guess your real question is what I think of Microsoft’s attempt to convince the world that large groups of people collaborating to solve problems somehow threatens the very fabric of the society we live in. And I don’t think there are "many" people making this claim, as it is complete crap — I would like to think that the world is a good place and not full of people who would propagate such a ridiculous idea. Let’s put an end to all meetings of large groups of people while we are at it. They might be evil anarchists out to destroy the world.

In the end, mainstream acceptance is not the goal. The goal for most people who work on free software and open source projects is the technology itself. It is building a tool that solves the problem. It is not about ideology for most of us, and as such, mainstream acceptance only involves mainstream use of the technology. This has been achieved on many fronts already, with many more still to come.

SP: PHP gets very little mention in the mainstream IT press. Do you feel that PHP is being deliberately ignored outside of Open Source circles?

RL: PHP is not very exciting and there isn’t actually much to it. It is a thin glue layer between your Web server and all the various things you might want your web server to talk to.

In the old tradition of UNIX, we rely on small specialized add-on libraries to do all the heavy lifting with as little interference from PHP as possible. ASP, JSP and Cold Fusion all have large companies with large advertising budgets behind them and the products themselves get bigger and more complex with every release so that customers will feel they got their money’s worth. Who is going to spend $10,000 for a floppy and a 2-page manual?

That floppy and the 2-page manual might actually be exactly what they need to solve their problem, and as such it might very well be worth spending $10,000 on a small targeted solution like that. Small targeted solutions are of little interest to large software companies. The concept doesn’t scale. Small targeted solutions with no advertising budget are of little interest to the trade rags.

So no, I don’t think it is deliberate that PHP gets very little press. PHP is about as exciting as your toothbrush. You use it every day, it does the job, it is a simple tool, so what? Who would want to read about toothbrushes?

SP: The move away from GNU public license from PHP v3.0 to v4.0 has caused a stir among the Open Source community. Do you feel the new licensing model has now been accepted and understood as the best direction for PHP to take?

RL: PHP 3 was dual licensed actually. So we didn’t actually move from the GPL to something else, we simply dropped the GPL part.

I don’t really see the point of dual-licensing, and it causes a lot of confusion. By putting PHP solely under the Apache-style license it is under today, a lot of this confusion was resolved.

Dual-licensing doesn’t really work as far as I am concerned — the less restrictive of the 2 licenses is what people are going to use anyway. The various protections that the GPL offers are quite pointless when people can simply choose to use the software under the less restrictive Apache-style license. So it made sense to just go with the less restrictive of the two licenses.

If you take a look around, there are no significant scripting languages that are GPLed. And by GPLed I mean strictly GPLed in the single license sense. Perl is dual-licensed with the completely unrestrictive artistic license. Python has its own license. Ruby is dual-licensed with its own license. Tcl is under a BSD-style license. I don’t see why PHP not being under the GPL would upset anybody.

Like the other scripting languages probably realized somewhere along the line, the GPL is not really needed. I would have no problems with Microsoft abandoning ASP and moving completely to PHP. They might embrace and extend it, sure, but at that point we would be in a purely technical race with them. That’s a fight we can win, and in the end, having PHP everywhere would be a cool thing for the PHP community.

PHP today

SP: To what would you attribute PHP’s success? Do you feel that PHP has any major weaknesses (in comparison to other languages)?

RL: People like PHP because it solves their Web problem. As such, I don’t see any weaknesses. It does the job it was designed to do.

Some people might argue that certain aspects of PHP are not as mature as those in other languages. The OOP support in PHP is an example. But in the end this has very little to do with solving the Web problem and more to do with aesthetics and language purism.

SP: Are you still actively involved in PHP development today?

I am still quite involved. I don’t spend 20 hours a day on it like I did in the first couple of years, but I still fix bugs, argue with the other developers about features, and occasionally jump in and add the odd new bit here and there.

SP: Which Web server runs PHP the best? Apache – or something else? And which platform runs PHP the best? Linux/Intel, Solaris/SPARC, or another?

RL: This all comes down to what gets the most attention, I think. Most people use Linux/Intel with Apache. This means that bugs on that platform are discovered by the developers themselves early on, and the end-user is unlikely to hit something that the developers haven’t run into already. Other mainstream UNIX platforms such as Solaris/SPARC and FreeBSD/Intel with Apache are right up there as well.

SP: PHP is usually paired with MySQL. How much co-operation is there between the two teams in terms of development?

RL: We know the MySQL folks very well. The first database code in PHP was written for the MySQL predecessor called mSQL. The MySQL API was completely compatible with mSQL’s when it came out, so right from the early days of MySQL, PHP had good support for it. The pairing works because PHP and MySQL tend to take a minimalistic and very direct approach to solving problems.

In terms of cooperation at the development level, there isn’t that much actually. But not much is needed. PHP provides a thin layer that simply exposes the MySQL API to the PHP user. We bundle the MySQL client library with PHP, but that library is completely maintained by the MySQL team with little involvement from us — except when they break the build, of course.

SP: Do you think PHP is becoming a replacement for Perl?

No, Perl is a general-purpose scripting language. PHP is specifically geared to the Web problem.

SP: What are your views on Magic Quotes and Register Globals?

RL: Register Globals is one of the features that brought people to PHP. The simplicity of creating Web applications when form and other variables were automatically available could not be beaten.

I was personally not in favour of turning Register Globals off by default. It adds very little to the overall security of an application. If people do not check data coming from the user then with or without Register Globals enabled that application is going to be insecure.

The only time having Register Globals off helps is when you forget to initialize a variable before you use it and someone who knows your code exploits that. By changing the error reporting level you can have PHP find these cases for you automatically. So in the end, all I think turning Register Globals off has done is make writing PHP apps more complicated.

And it has of course also generated 10-20 questions/bug reports per day from users who are confused about this change.

Magic Quotes stems from the days when PHP was used almost exclusively for database-driven applications. These applications would take form input and stick it into a database. Even today, a large chunk of the PHP scripts out there do little more than this.

You always have to escape quotes before you can insert a string into a database. If you don’t, you get an ugly SQL error and your application doesn’t work. After explaining this simple fact to people for the 50th time one day I finally got fed up and had PHP do the escaping on the fly. This way the applications would work and the worst that would happen is that someone would see an extra on the screen when they output the data directly instead of sticking it into the database.

Often people didn’t even notice this extra since it did not cause any fatal SQL errors and thus I wouldn’t get confused emails asking me what was going on. This was a very good thing.

Even today you still see the odd site where it is obvious that the author didn’t realize that data needed to be escaped before being inserted into a DB, and you see the odd extra here and there. Each of those is a support message we didn’t have to answer.

The clueful who don’t like this feature can simply turn it off and handle all escaping themselves. And the clueful who write portable apps can simply check the setting using get_magic_quotes_gpc() and add an addslashes() call when appropriate.

SP: Do you think there is a successful balance between the commercial and open source elements of the PHP community?

RL: I think it works out ok. The various commercial entities pay individuals to work on parts of PHP — and that benefits everybody.

SP: What’s been the most surprising or innovative use of PHP you’ve seen on the Internet?

RL: I keep seeing new and weird things, the latest being Wez Furlong’s ActiveScript SAPI module, which lets you do client-side PHP like this:

 <script language="ActivePHP">  
   function clickit() {  
 <img src="..." onclick="clickit();" />  

Alan Knowles’ PHPMole IDE for PHP written in PHP-GTK is quite impressive as well. There are plenty of other cool PHP things out there, but these are probably the furthest from what I started out doing.

The Future of PHP

SP: Are there any plans for server-side, stateful variables in PHP? It would be useful to place instantiated objects in shared memory so that users didn’t have to incur large overhead due to class instantiation.

RL: The Alternative PHP Cache (APC) project can already stick instantiated classes in shared memory, so that one has been solved by APC and others.

Personally I think if you really have performance issues, you should either simplify your code a bit or have a look at writing the critical parts in C. Extending PHP at the C level is actually much easier than most people think.

SP: Current ‘session’ variables use disk space (e.g. /tmp) which is no good for high-traffic sites. Are there plans to remedy this?

RL: Right from day one of the session support in PHP, we provided a shared memory backend session handler. Just set your handler to mm instead of files in php.ini. However, for high-traffic sites this is not the solution. The real solution is to load-balance the site across multiple servers.

Having session data in memory on a single machine doesn’t solve anything. For this, you write yourself a session save handler and stick your session data into a central database of some sort. See

SP: What about database connection pooling? Persistent connections are not nearly good enough – are there plans to implement connection pooling in the future?

RL: A pool of connections has to be owned by a single process. Since most people use the Apache Web server, which is a multi-process pre-forking server, there is simply no way that PHP can do this connection pooling. It has to be done by a dedicated standalone process and is quite outside the scope of PHP itself. Both SQLRelay and SRM can be used to solve this problem.

If/when the common architecture for PHP is a single-process multithreaded Web server, we might consider putting this functionality into PHP itself, but until that day it really doesn’t make much sense. Even Apache 2 is still going to be a multi-process server with each process being able to carry multiple threads. So we could potentially have a pool of connections in each process.

SP: Are there plans to improve OOP? Users feel there should be less overhead in instantiating classes; and the provision of encapsulation so that they can keep member variables hidden (promotes better programming). Are there any plans to this effect in the pipeline?

RL: Yes.

SP: Sybase and MS SQL Server provide support for multiple result sets returned from SQL stored procedures. PHP does not support this! When can users expect it?

RL: When someone contributes the code to do it.

SP: Database queries are currently buffered in memory before being available to the client. Can PHP programmers expect this behaviour to change so that queries are available immediately as rows are being sent from the server, so they do not have to wait?

RL: When the various database API’s support this, sure they can. We already support this with MySQL through the mysql_unbuffered_query() call and have for quite a while.

SP: ZendEngine2 has plans for a number of exciting new features, such as Exception handling and mature OOP support. Can you give us a rough estimate as to when PHP users can expect a release – at least in terms of months or years?

RL: Nope. It will be released when it is ready.

SP: Do you see a future in PHP-GTK, with popular desktop applications being written in PHP?

RL: I see PHP-GTK mainly being used in cases where you need to provide both a Web interface and a GUI interface to the same application. Being able to use the same backend code for both is a big win.

SP: Is development of PHP and Apache now running in parallel? And is it likely that the two projects will merge in some way, in the future?

RL: PHP and Apache have always been quite closely linked since they are both pieces of the puzzle that solves the Web problem. As such there are a number of developers who work on both projects. But no, the projects will definitely not merge. That wouldn’t make much sense.

SP: Do you think major corporations will use PHP in their environments instead of J2EE and .NET in the future?

RL: Some do, so yes.

SP: What would you say to young developers who are considering starting an Open Source project themselves?

RL: I am not sure it is possible in that sense. Sort of like sitting around watching your phone, trying to will it to ring. It always rings when you are in the shower or at some other inconvenient time.

I don’t think you really sit down and decide to start an open source project. This "movement" is a bit of a myth that people like to glamorize and assign all sorts of unrealistic characteristics to. Nobody is going to join your project if all you have is a cool idea. Everyone has cool ideas.

People will pool around your efforts if you build something that is useful enough that they find it easier to take your code and extend it a little bit to solve their problem. If your stuff is half-baked then people are likely to dismiss what you have done, and just solve their problem themselves or by using something else out there.

So to start an open source project, first assume that you are completely on your own and solve some problem that has been bugging you for a while. That means months and months of work to get something that actually works and solves the problem. At that point you can start considering whether you might want to give up control and let others join your effort.

The key phrase here is "give up control". Starting an open source project does not mean you suddenly get a staff of programmers you can boss around. In fact, to get it off the ground you will have to be very receptive to suggestions from early adopters and do everything you can to make your tool more useful to a broader audience. And then you give it all away and let people do just about whatever they want with your code. Now you have started an open source project.

SP: What other open source initiatives have you got planned? Given infinite time (and 100 extra pairs of hands) what would you love do?

RL: Well, I didn’t plan PHP. I think in terms of solving problems, not in terms of software projects. I actually hate programming, but I love solving problems. So what problems would I like to solve if I had lots of time and resources?

Having recently become a father I had grand plans to build a smart-crib. Live video, audio and various other gadgets that could be viewed and controlled remotely to let remote friends and family interact with the kid. Of course, once the baby actually arrived finding enough time to just sit and read a book is nearly impossible, never mind building a smart-crib!

Another really cool project would be the ultimate distribution building system. One where I could specify that I had a device with an 80486 processor, a certain type of NIC, and whatever other hardware specifics along with the type of media and ram, and this thing would crank out a small Linux distribution tailored exactly for my device.

Then, to extend that, be able to say that I want it to act as a firewall, mp3 server, browsing station or whatever. Basically get to the point where you can take almost any hardware device and stick Linux on it and have it be useful. I have a lot of devices around the house that I know I can put to better use simply by putting more powerful software on them, and I’d like to find a way to do this without having to spend 6 months on each one.

The SitePoint community and I would like to take this opportunity to thank Rasmus for his time and detailed answers to the inquiring minds in our community. He may no longer be the controlling force behind PHP, but he definitely shines as a member of the team that is working together all over the world to take PHP to the next level.

Bookmarked at brandizzi Delicious' sharing tag and expanded by Delicious sharing tag expander.
12 Apr 22:21

Filha de pastor é primeira transexual a usar nome social em escola do Vale | Pavablog

Thifany tem o direito também de usar o banheiro feminino da escola. (Foto: Nicole Melhado / G1)

Thifany tem o direito também de usar o banheiro feminino da escola. (Foto: Nicole Melhado / G1)

Publicado no G1

Ele nasceu Israel, mas escolheu ser Thifany. O novo nome é pronunciado na chamada da escola e também consta na carteirinha estudantil. Filha de pastor evangélico, a transexual de 17 anos mora em Jacareí, e é a primeira aluna a usar o nome social em uma escola da rede estadual no Vale do Paraíba. Em todo Estado, são apenas 44 casos como o dela.

O direito de transexuais e travestis de ser chamado pelo nome social no âmbito escolar foi conquistado por meio de uma resolução estadual de 2014. No caso de adolescentes, como Thifany, é necessária autorização dos pais.
Para ela, mais que um direito, a possibilidade de ‘trocar de nome’ é uma forma de vencer as barreiras do preconceito. “Tive que vencer muitos preconceitos durante a minha vida escolar, passei por muitas coisas, inclusive já fui ameaçada. Nessa escola fui bem recebida, me sinto aceita pelo que eu sou e tenho já muitos amigos”, afirmou a jovem que usa cabelos longos e não descuida do visual.

O primeiro desafio de Thifany para adotar o nome social foi convencer o pai a autorizar a mudança. Apesar de ter convicções pessoais diferentes, o pastor acatou o pedido do filho. Ele confessa que enfrentou críticas por sua postura, mas acredita que agiu corretamente. “Meu filho estava irredutível. Não queria mais estudar. Só sorriu quando fomos fazer a matrícula e eu autorizei a mudança de nome”, recordou o pastor Rubem Borges.

Por conta do trabalho de evangelização do pai, a jovem, que é baiana, já mudou de cidade e também de escola muitas vezes. Para a transexual, cada mudança era um novo desafio para ser aceita entre os novos colegas.

Antes do início das aulas de Thifany, em Jacareí, a diretoria de ensino promoveu uma ação pontual de dois dias sobre a diversidade de gêneros na escola onde ela foi matriculada. “Além dos alunos, a orientação foi feita com professores, gestores e funcionários. O preconceito é justamente a falta de conhecimento. Não pode haver qualquer discriminação no âmbito escolar”, explicou a orientadora pedagógica Fernanda Rezende.

Em todas atividades escolares, a resolução estadual garante que o transgênero seja chamada pelo nome social. A medida só não abrage documentos como diploma, declarações e histórico escolar – neste caso, o nome de registro é mantido.

Uma resolução da Secretaria de Direitos Humanos da Presidência da República, publicada neste mês de março, é ainda mais abrangente e permite que estudantes transgêneros possam escolher se querem usar o banheiro masculino ou feminino e o tipo de uniforme escolar de acordo com a sua identidade de gênero.

O aluno pode ainda ter o nome social com o qual se identifica inserido em todos os processos administrativos da vida escolar, como matrícula, boletins, registro de frequência, provas e até em concursos públicos.

A resolução não tem força de lei, mas é uma recomendação para que as instituições de educação adotem práticas para respeitar os direitos de estudantes transgêneros.

A pedagoga que fez o trabalho de integração de Thifany na escola em Jacareí disse que o tratamento adequado dado ao grupo na escola é importante para reduzir a evasão escolar, já que muitos travestis e transexuais deixam de estudar por contada discriminação. Além disso, segundo ela, o abandono da família leva muitos às ruas, ao consumo de drogas e à prostituição. “Sozinhas nas ruas, sem estudos, para algumas a prostituição é a única forma de sobrevivência”, disse.

Orientadora pedagógica Fernanda Rezende acredita que o preconceito precisa ser desconstruído. (Foto: Nicole Melhado /G1)

Orientadora pedagógica Fernanda Rezende
acredita que o preconceito precisa ser
desconstruído. (Foto: Nicole Melhado /G1)

Thifany conhece pessoas que vivem essa realidade e disse ser uma pessoa feliz pelos preconceitos vencidos, pela a amizade dos colegas e amor da família. “Meu pai nunca ameaçou me mandar embora de casa, eu sei que ele não gosta [da minha opção sexual], mas me aceita”, afirmou.

Para o pastor Rubens, o amor pelo filho sempre falou mais alto. “No meu trabalho tiro pessoas da rua, como poderia colocar meu meu filho para fora de casa? Ele é uma pessoa boa, carinhosa e estudiosa, agora ele quer fazer um estágio e vamos conseguir isso também”, disse o pai.


Bookmarked at brandizzi Delicious' sharing tag and expanded by Delicious sharing tag expander.
11 Apr 23:30

4gifs: Now they have our technology. [video]


Now they have our technology. [video]

26 Mar 06:49

Curves of Constant Width

by Greg Ross

Trap a circle inside a square and it can turn happily in its prison — a circle has the same breadth in any orientation.

Perhaps surprisingly, circles are not the only shapes with this property. The Reuleaux triangle has the same width in any orientation, so it can perform the same trick:

In fact any square can accommodate a whole range of “curves of constant width,” all of which have the same perimeter (πd, like the circle). Some of these are surprisingly familiar: The heptagonal British 20p and 50p coins and the 11-sided Canadian dollar coin have constant widths so that vending machines can recognize them. What other applications are possible? In the June 2014 issue of the Mathematical Intelligencer, Monash University mathematician Burkard Polster notes that a curve of constant width can produce a bit that drills square holes:

… and a unicycle with bewitching wheels:

The self-accommodating nature of such shapes permits them to take part in fascinating “dances,” such as this one among seven triangles:

This inspired Kenichi Miura to propose a water wheel whose buckets are Reuleaux triangles. As the wheel turns, each pair of adjacent buckets touch at a single point, so that no water is lost:

Here’s an immediately practical application: Retired Chinese military officer Guan Baihua has designed a bicycle with non-circular wheels of constant width — the rider’s weight rests on top of the wheels and the suspension accommodates the shifting axles:

(Burkard Polster, “Kenichi Miura’s Water Wheel, or the Dance of the Shapes of Constant Width,” Mathematical Intelligencer, June 2014.)

The post Curves of Constant Width appeared first on Futility Closet.

11 Apr 13:18

What if it was all true?

by boulet

11 Apr 17:25

The First Schizophrenia Medication Was Developed As An Antihistamine

The First Schizophrenia Medication Was Developed As An Antihistamine

Thorazine, or chlorpromazine, was the first antipsychotic. It freed many people with severe schizophrenia from mental asylums, but that's not why it was developed. It was first tested because it's an antihistamine. Yes, like the allergy medications.

The incessantly itchy eyes and noses that some people get in the spring is the result of their body desperately trying to keep them alive. It senses an invader, and kicks into gear to fight this invader off. The fact that the invader happens to be harmless pollen cuts no ice with the body, so often the best way to tamp down the reactions is to tamp down the bodily system.

Antihistamines are good at that. They decrease the body's response to a lot of different signals. Sometimes this causes allergy sufferers more agita, as the antihistamines suppress body systems that are responsible for things such as salivation and alertness.

In 1949, a Henri Lavorit, a French doctor working in Tunisia, saw huge potential in antihistamine's suppression of bodily systems — including the autonomic nervous system responsible for many unconscious body responses. Too many patients were dying during surgery, due to the body's natural responses to being cut open, manipulated, and stitched back up. If Lavorit could suppress that response, he could save many lives.

One particular antihistamine, known as chlorpromazine, seemed to do a good job lowering blood pressure, but it also rendered patients utterly indifferent to their upcoming surgery. Lavorit wanted to use it on nervous surgical patients, but he was stymied when it did too good a job lowering blood pressure. The patients fainted.

Looking for a useful application for this drug, he tried psychiatrists treating schizophrenic patients. Up until then, the psychiatrists had been doing nothing more than knocking their patients out with sedatives, which were the only known way to treat mania and schizophrenia. When a schizophrenic patient took chlorpromazine, he was calm and rational in three weeks. In another few weeks, he went home. This was something that no one had ever seen before.

Today, the most popular theory is that chlorpromazine, better known as Thorazine, treats schizophrenia by doing just what antihistamines are meant to do — blocking an overactive bodily response. Too much dopamine can cause visual and auditory hallucinations. Thorazine blocks dopamine receptors. Some doctors disagree, and the "dopamine theory" of schizophrenia isn't universal, but few disagree with the notion that chlorpromazine was a revolution in psychiatric treatment at the time.

Top Image:

[Sources: Shrinks: The Untold Story of Psychiatry, Fifty Years of Chlorpromazine, Pharmacology Weekly.]

Bookmarked at brandizzi Delicious' sharing tag and expanded by Delicious sharing tag expander.
07 Mar 18:37

A Universal Language

by Greg Ross

The Swedish pop group Caramba has an odd claim to fame — their eponymous 1981 album consists entirely of nonsense lyrics. No one’s even sure who was in the band — the album sleeve lists 13 members, all using pseudonyms. It was produced by Michael B. Tretow, who engineered ABBA’s records, and singer Ted Gärdestad contributed some vocals, but these are the only two participants who have been named.

The band broke up (apparently) after the first album, so we’ll never get more of this. Here are the lyrics to the single “Hubba Hubba Zoot Zoot”:

Hubba hubba zoot zoot
Deba uba zat zat
A-hoorepa hoorepa a-huh-hoorepa a-num num
Hubba hubba zoot zoot
Deba uba zat zat
A-hoorepa hoorepa a-huh-hoorepa a-num num
Hubba hubba zoot zoot
Deba uba zat zat a-num num
Hubba hubba zoot zoot
Deba uba zat zat a-num num
A-hoorepa hoorepa a-huh-hoorepa a-num num
A-hoorepa hoorepa
A-huh-hoorepa a-num num
Hubba hubba zoot zoot
Deba uba zat zat a-num num
Hubba hubba zoot zoot
Deba uba zat zat a-num num
A-hoorepa hoorepa a-huh-hoorepa a-num num
A-hoorepa hoorepa a-huh-hoorepa
A-num num
Hubba hubba zoot zoot
A-huh zoot a-huh
Deba uba zat zat a-num num
Hubba hubba zoot zoot
Deba uba zat zat a-num num
A-hoorepa hoorepa a-huh-hoorepa a-num num
A-hoorepa hoorepa a-huh-hoorepa a-num num
Deba uba zat zat
A-hoorepa hoorepa a-huh-hoorepa a-num num
Hubba hubba zoot zoot
deba uba zat zat
A-hoorepa hoorepa a-huh-hoorepa a-num num
Hubba hubba zoot zoot
Deba uba zat zat a-num num
Hubba hubba zoot zoot
Deba uba zat zat a-num num
A-hoorepa hoorepa a-huh-hoorepa a-num num
A-hoorepa hoorepa a-huh-hoorepa a-num num
Hubba hubba zoot zoot
Deba uba zat zat a-num num
Hubba hubba zoot zoot
Deba uba zat zat a-num num
A-hoorepa hoorepa a-huh-hoorepa a-num num
A-hoorepa hoorepa a-huh-hoorepa a-num num
Hubba hubba zoot zoot
Deba uba zat zat a-num num
Hubba hubba zoot zoot
Hubba hubba mo-re mo-re
Deba uba zat zat a-num num
A-hoorepa hoorepa a-huh-hoorepa a-num num
A-hoorepa hoorepa a-huh-hoorepa a-num num

(Thanks, Volodymyr.)

11 Apr 06:00

NGC 2903: A Missing Jewel in Leo

Adam Victor Brandizzi

Realmente é linda.

Discover the cosmos! Each day a different image or photograph of our fascinating universe is featured, along with a brief explanation written by a professional astronomer.

2015 April 10
See Explanation.  Clicking on the picture will download
 the highest resolution version available.

NGC 2903: A Missing Jewel in Leo
Image Credit & Copyright: Tony Hallas

Explanation: Barred spiral galaxy NGC 2903 is only some 20 million light-years distant. Popular among amateur astronomers, it shines in the northern spring constellation Leo, near the top of the lion's head. That part of the constellation is sometimes seen as a reversed question mark or sickle. One of the brighter galaxies visible from the northern hemisphere, NGC 2903 is surprisingly missing from Charles Messier's catalog of lustrous celestial sights. This colorful image from a small ground-based telescope shows off the galaxy's gorgeous spiral arms traced by young, blue star clusters and pinkish star forming regions. Included are intriguing details of NGC 2903's bright core, a remarkable mix of old and young clusters with immense dust and gas clouds. In fact, NGC 2903 exhibits an exceptional rate of star formation activity near its center, also bright in radio, infrared, ultraviolet, and x-ray bands. Just a little smaller than our own Milky Way, NGC 2903 is about 80,000 light-years across.

Tomorrow's picture: Venus in the west < | Archive | Submissions | Search | Calendar | RSS | Education | About APOD | Discuss | >

Authors & editors: Robert Nemiroff (MTU) & Jerry Bonnell (UMCP)
NASA Official: Phillip Newman Specific rights apply.
NASA Web Privacy Policy and Important Notices
A service of: ASD at NASA / GSFC
& Michigan Tech. U.

Expanded from APOD by Feed Readabilitifier.
11 Apr 15:31

Brain Sarcasm Centre "Totally Found"

A new study published in the journal Neurocase made headlines this week. Headlines like: “Sarcasm Center Found In Brain’s White Matter“. The paper reports that damage to a particular white matter pathway in the brain, the right sagittal stratum, is associated with difficulty in perceiving a sarcastic tone of voice.


The authors,  studied 24 patients who had suffered white matter damage after a stroke. In some cases, the lesions included the sagittal stratum in the right hemisphere, and these individuals performed worse on a test in which they had to decide whether statements like “This looks like a safe boat!” were sincere or sarcastic, based on the tone of voice.

So – do these findings mean we’ve found the brain’s sarcasm center?


Here’s why. First off, the sagittal stratum isn’t a ‘center’. If it’s anything, it’s a bridge. It’s a white matter nerve bundle that relays information between two grey matter structures, the thalamus and the cerebral cortex. White matter doesn’t detect or process anything: grey matter does. White matter connects the grey matter areas. The detection and understanding of sarcasm probably happens somewhere in the cortex, since this is where most social and perceptual processing happens.

So if the sagittal stratum is required for sarcasm perception, its role is to relay information to and from the relevant part of the cortex – and we don’t know where that part is. There might be multiple areas involved in sarcasm detection, for that matter – there might not be “a center”.

Also, I’m not sure how solid the result is. The sample size was fairly small, and the authors considered the integrity of eight different white matter tracts as predictors of sarcasm impairment, finding one significant association at p = 0.039. This raises a multiple comparisons problem:


ResearchBlogging.orgDavis CL, Oishi K, Faria AV, Hsu J, Gomez Y, Mori S, & Hillis AE (2015). White matter tracts critical for recognition of sarcasm. Neurocase, 1-8 PMID: 25805326

CATEGORIZED UNDER: funny, media, papers, select, Top Posts
11 Apr 15:31

Brain Sarcasm Centre "Totally Found"

A new study published in the journal Neurocase made headlines this week. Headlines like: "Sarcasm Center Found In Brain's White Matter". The paper reports that damage to a particular white matter pathway in the brain, the right sagittal stratum, is associated with difficulty in perceiving a sarcastic tone of voice. The authors,  studied 24 patients who had suffered white matter damage after a stroke. In some cases, the lesions included the sagittal stratum in the right hemisphere, and