France bans unlimited sugary drink refills - <AUTHOR> http://www.bbc.com/news/world-europe-38767941 <comment><USER2> I remember my vacation in the states (in the South). I got served a absolutely massive glass of coca-cola with my dinner. When I had finally managed to finish it a waiter came and refilled the bloody thing when I wasn't paying attention. How can you enjoy your meal with that much to drink?

<comment><USER3> _> I remember my vacation in the states (in the South). I got served a absolutely massive glass of coca-cola with my dinner. When I had finally managed to finish it a waiter came and refilled the bloody thing when I wasn't paying attention. How can you enjoy your meal with that much to drink?_

Are you from a place where there is a cultural taboo against only drinking part of the beverage a restaurant serves you?

Saying that you "finally managed to finish it" implies that you were putting effort into drinking the entire glass despite not wanting to. And being put out by the fact that the waiter refilled it implies that you felt obligated to drink the refill as well.

<comment><USER4> For me, and probably many Europeans: yes, that is how we are raised. It's not su much of being taboo, more like a sense that it makes no sense to waste anything (not just food/water) and is bad for the planet in general. (well, there _is_ truth in that). My parents even had a picture of a bunch of underfed kids from Ethiopia (or so) on the wall in the kitchen. If we didn't eat our plate, they'd point to it and say something like 'You see that? They would go nuts for that bit of food that is still on your plate. Eat it.' Thinking of it now I can see that might not be regarded as best practices in education, but they meant it well.

<comment><USER5> My parents had the same attitude and I'm from the UK. My Dad passed away at a younger age than his father from obesity related conditions and it was then that I realised that my parents generation (born in the 50s) were the first in history to have access to unlimited food.

Their own parents had instilled in them this view that you must finish your plate. They had experience of rationing. My parents continued this attitude probably because this just seemed like the thing to do but really this sort of thing seems like a bad thing when many of us are overweight.

<comment><USER6>
      Their own parents had instilled in them this view that you must finish your plate. They had experience of rationing.

In the wake of WW2 clear into the 1950s, there were food shortages in Europe, with hunger and malnutrition. Even Americans were guilted into not wasting food. For example, Allan Sherman (an overweight Jewish American comedian, sort of a Weird Al Yankovic of his era) said in a song monologue:

 _' My parents would say, "clean your plate; children are starving in Europe!"

So, I would clean the plate.

Four, five, six times a day.'_

<comment><USER5> True, my Dad born in 1952 had a ration book for the first couple of years of his life.

He didn't remember that but for his parents it would all feel too recent.

</comment></comment></comment></comment></comment></comment><comment><USER7> Is it just me who's thinking that individuals in modern societies are not capable anymore of making meaningful decisions, including how much to drink? We're sacrificing freedom here because we became incapable. That scares me.

<comment><USER8> Is there evidence that lack of capability is the culprit? Is it possible that people are perfectly capable, but make informed unhealthy choices because it's what they want to do?

I can't stand even 8oz of sugary soda, but I also can't imagine judging or restraining someone (let alone with the violence of the state) who wants to.

<comment><USER9> You're asking for evidence of cognitive biases ? There's a WHOLE discipline that documented it in several thousands of articles. If you still believe humans are perfectly free of their choices, I have bad news for you : they are not.

Also, sugar is addictive.

</comment></comment></comment><comment><USER10> If I'm Coca-Cola or Pepsi or run a large restaurant chain in the US, I'm pushing this ban everywhere.

Restaurants price soda to include the cost of people who get the free refills and the margins are high because of it.

If the government suddenly banned free refills, restaurants won't lower prices because it will hurt top-line revenue and buying decisions aren't made on the price of soda with your meal. Consumption goes down but prices are stable means profits are higher, so Coke and Pepsi can raise their prices to restaurants, say both sides capture half that new margin.

Soda makers win, restaurants win, consumers win because consuming less sugar assuming they don't pay for a refill, taxpayers win by lower burden on healthcare. Sounds great.

</comment><comment><USER11> When I was living in France and Switzerland free refills were basically unheard of. About the only place that I ever found that had free refills was IKEA.

<comment><USER9> Mostly just KFC and Subway have been doing that, and it only started like 10 years ago at most, this may be why.

</comment></comment><comment><USER12> Why do they mention only the country with the _second_ lowest obesity rate?

<comment><USER13> Probably because some insignificant (read: small) country has the lowest rate. It's easier to make comparisons when the population size is in the same order of magnitude.

<comment><USER14> I wonder what the relative smoking rates are...

[http://articles.orlandosentinel.com/2005-08-28/news/SMOKING_...](http://articles.orlandosentinel.com/2005-08-28/news/SMOKING_1_smoking- obese-human-behavior)

Some researchers have hypothesized that America's obesity rate is somewhat correlated with dropping smoking rates.

<comment><USER15> According to [https://en.wikipedia.org/wiki/List_of_countries_by_cigarette...](https://en.wikipedia.org/wiki/List_of_countries_by_cigarette_consumption_per_capita) France is relatively low on the list among EU countries.

</comment></comment></comment></comment><comment><USER16> What stops them from offer 100 refills?

<comment><USER17> In a Brazilian state a law was passed that forbids restaurants to put salt shakers on their tables, as obviously a people shouldn't be able to decide how much salt they want on their food.

The law specifically mentions putting salt shakers _on_ the tables, though. This was the response: [https://is.gd/oiQUop](https://is.gd/oiQUop)

</comment></comment><comment><USER18> The replies to the topic where people fantasize about running other people's lives for them really makes my heart ache :(

<comment><USER19> That could be early-onset diabetic heart disease.

<comment><USER18> Good point haha

</comment></comment></comment><comment><USER20> French (expat) here, can't remember ever seeing any when I lived in France. Have I always been at the wrong restaurants?

<comment><USER21> The only one chain doing unlimited drinks in France is KFC.

<comment><USER15> Someone else mentioned Quick, I can't confirm from memory. I've had free refills at Pizza Hut in France, though.

</comment></comment></comment><comment><USER22> The irony of the situation is that they can't simply ration or ban these products because we live in the era of consumerism and the market would rather slowly kill you and make money off of you than ban something that is a health concern. So this is a double standard to keep French pencil pushers employed and French people thinking that their government is doing something positive.

</comment><comment><USER23> Does it affect drinks containing sugar exclusively, or does this also affect sugar-free soft drinks?

<comment><USER24> "Interdiction de la mise à disposition de boissons à volonté, gratuites ou pour un prix forfaitaire, avec ajout de sucres ou d'édulcorants de synthèse" : it affects drinks with added sugar and/or synthetic sweeteners (e.g. Coca Cola Zero).

<comment><USER23> Oh, it's nonsense then. Artificially sweetened drinks don't create obesity.

</comment></comment></comment><comment><USER25> I guess this is more of a principle kind of thing since free refills are almost unheard of in Europe, even in American fast food franchises.

In general soft drinks are incredibly overpriced in Europe since people drink so little of them.

</comment><comment><USER26> There are no bad foods, only bad diets. Why pick on sugary drinks, but leave ice cream shops alone. Why not put a hazard tax on buffet restaurants. Imagine the government decides they don't like the way you live your life, so they make laws to screw you and people like you. Laws are the worst way to attempt to improve human dietary behavior.

You could advertise fitness, create tastier low calorie beverages, even advertise drinking a full glass of water before eating. Positive fitness outcomes can be found using non punitive means.

</comment><comment><USER27> How does this effect sugar free drinks like Diet Coke and Coke Zero?

<comment><USER28> Drinks with "added sugar substitutes" are banned as well. (From the link to the law text) [https://www.legifrance.gouv.fr/affichTexte.do?cidTexte=JORFT...](https://www.legifrance.gouv.fr/affichTexte.do?cidTexte=JORFTEXT000033922943&dateTexte=&categorieLien=id)

<comment><USER29> Sugar substitutes tends to mean things like HFCS, Agave syrup, honey, etc: things that are sugar but not always called sugar on the label.

Is that the case here, or is France really banning the artificial sweeteners too?

<comment><USER15> Yes, drinks with artificial sweeteners are also affected by the ban on refills. No, France is not "banning artificial sweeteners".

</comment></comment></comment></comment><comment><USER30> It seems like a Soda tax would be a less heavy handed approach. If you make the price high enough restaurants will stop offering refills all on their own.

<comment><USER31> Chicago is working on adopting such a tax, but for the moment only on bottled/prepackaged drinks.

[http://chicagotonight.wttw.com/2016/11/10/cook-county- approv...](http://chicagotonight.wttw.com/2016/11/10/cook-county-approves- soda-tax)

They're trying to offset the increased cost of diabetes and other health issues linked to high-calorie drinks. It's meeting heavy resistance from lobbying groups at the moment.

But

</comment></comment><comment><USER32> Relevant Parks and Rec. [http://www.dailymotion.com/video/x2oq3zt](http://www.dailymotion.com/video/x2oq3zt)

In the show, citizens are pissed because Leslie, the politician lady, decides to tax oversized sodas.

Maybe people don't deserve the "liberty" to drink gallons of sugar. And maybe companies don't deserve to offer it to people.

</comment><comment><USER33> The comparison has been made between sugary drinks and social media. Are they next?

</comment><comment><USER34> well, they can make it up to 10 ... few really drink more than 3

silly rule

<comment><USER35> 10 refills? Yeah even here in the states among the heaviest of soda drinkers that seems like a useless limit...

</comment></comment><comment><USER36> I'd rather live in a country that provides comprehensive free health care and limits soda consumption, than one that allows me the "freedom" to consume as much sugar as possible and makes me pay for the consequences.

I must be a radical hippie leftist: I think we should tax the sh-t out of refined sugar and subsidize organic vegetable farms.

<comment><USER37> I suppose I have to agree with you. You apparently want a nanny state and to tax me to pay for it.

<comment><USER38> > You apparently want a nanny state and to tax me to pay for it.

What's it with Americans and these expressions. I've heard "nanny state" used 0 times by non-Americans (non-Americans use it only when quoting Americans).

Also, you're making it sound like you're _the only one_ being taxed. He will also be taxed.

<comment><USER37> I suppose it's an American phrase. Given the way the rest of the world is going it may be an American value, too, though the US itself is moving away from that idea, too.

I'm not going to rehash old arguments about the virtues of fiscal conservatism. Suffice to say, I'm happy if people want to redistribute wealth and intrude on the lives of fellow citizens. I just wish it didn't involve me.

I am not the only one being taxed. But if my income is 5 times the median income, then I'm paying 20X the median taxes. No fun!

</comment></comment></comment></comment><comment><USER39> This is a human rights violation.

<comment><USER40> You are free to buy as much soda as you want.

<comment><USER41> And restaurants can offer as many free refills as they want, as long as the limit is less than infinity.

More of a violation against intelligence than against human rights.

</comment></comment></comment><comment><USER42> Free refills? How dare you! That stomach doesn't belong to the consumer, it's merely being rented from the state!

<comment><USER43> You are making an argument based on taking this to an extreme. But take it to the other extreme: is it governmental overreach that heroin is banned or is it a good public health policy?

The merits of this new French law can be argued, but it is not an obvious overreach.

<comment><USER44> > But take it to the other extreme: is it governmental overreach that heroin > is banned or is it a good public health policy?

Given that the most effective treatment for heroin addiction is diacetylmorphine maintenance (aka, prescription-strength heroin)[0], I'd say it's definitely governmental overreach.

[0] [https://en.wikipedia.org/wiki/Heroin- assisted_treatment](https://en.wikipedia.org/wiki/Heroin-assisted_treatment)</comment></comment></comment>


Signal Desktop Leaves Message Decryption Key in Plain Sight - <AUTHOR> https://www.bleepingcomputer.com/news/security/signal-desktop-leaves-message-decryption-key-in-plain-sight/ <comment><USER2> Kind of a rookie move IMO. Ask for a pin or something on startup and encrypt the key.</comment>


Ask HN: Why do so many companies use public information for security questions? - <AUTHOR> "What was the first school you attended?" "What is your spouses maiden name?"<p>These things can be (usually) be retrieved just by asking the government to provide public records. <comment><USER2> In 2005, Bruce Schneier noted the purpose is to provide a fallback password[1] if the primary password was forgotten, but the reality is, security questions are a much less secure protocol than passwords themselves.

While on a personal level you can fix this by using a password manager and generating another random string as an answer, other cute and terrible implementations like United[2] (calling you guys out) obliterate it, making yet another, terrible, horrible, no-good secondary protocol.

Why companies use them is because the Powers That Be(TM) _believe_ it to be a secure protocol. They localize the problem to themselves and since they haven't been exposed using their mother's maiden name, it's good enough. Also, everybody else uses security questions, even our competitors, so we have to be at least as secure as them, right? The key phrase is "at least". Then you are equivalent in policy and protocol; certainly not more secure. :D

[1] [https://www.schneier.com/blog/archives/2005/02/the_curse_of_...](https://www.schneier.com/blog/archives/2005/02/the_curse_of_th.html)

[2] [https://www.united.com/ual/en/us/account/enroll/default](https://www.united.com/ual/en/us/account/enroll/default)

<comment><USER3> Many years ago as a teenager I was opening my first bank account.

Mother's maiden name was one of the fields. This seemed intrinsically insecure. So I filled out 'banana' and made a mental note. The bank actually called home, I was not home, said the field hadn't been filled out, and requested the information from a family member.

I was stunned.

<comment><USER4> Those "mental notes" always work really well for me when lose my bank password 5 years later and try to restore the account.

<comment><USER3> Me too. For things like password, you can cycle them. For fields like maiden name, you can't.

</comment></comment></comment></comment><comment><USER5> I went into my insurance provider to talk to them. The nice lady asked me for my name, address, date of birth as proof of identity.

I said "no need, I have my driver's licence on me which has my photo and is much better proof of identity".

She refused to even look at my driver's licence, and insisted on me giving them three pieces of publicly available information to "prove" my identity. She got quite hostile about it.

I don't understand why this is a thing that companies do. But it clearly is.

</comment><comment><USER6> Why answer them witch accurate information in the first place? It's not like the company is going to check and see if you gave the "correct" answers. The answer is what ever you provided the first time. As long as you remember the answers you gave them, you're okay. (Recently, I did come across a site where the four security questions could not have the same answer, so someone figured out not every answers them accurately.)

</comment><comment><USER7> Most people have no idea about security at all. Most developers, product managers, etc are part of most people.

</comment><comment><USER8> Easy, cheap, and scalable.

There really is, as far as I know, no way to cheaply verify identify of millions of people, particularly over the internet or the phone. These questions don't actually do that, but they probably put up a good enough show for regulators and the law. At the end of the day, that's all these companies want.

Also, credit card companies are incompetent. I've have many variations of my name on my credit reports. Infuriatingly, one of them is (my first name) NULL (my last name). The credit reporting agencies refuse to remove it because some creditor keeps reporting it. They also refuse to tell me _which_ creditor.

</comment><comment><USER9> In many cases, some of these answers can even be googled for fairly easily. In other cases, like "What was the first car you had", can be guessed randomly with a relatively high chance of success (Toyota Corolla or Honda Civic probably cover a good amount of them).

Some have taken to use random gibberish as the answer of these questions. Others have pointed out that that's also not great.

What really would be good security questions? Should security questions as a concept even be a thing at all?

</comment><comment><USER10> When my bank calls me, they ask for my birthday, name, account number to verify my ID. I always ask them back, "how do I know you are my bank?". The caller always gets the idea. "Oh yeah, right!?!" I then tell them thanks for the call and I'll go to the branch to sort it out.

</comment><comment><USER11> It probably made more sense in the olden days of the Internet, before Google and Facebook for example.

<comment><USER12> No, it didn't. The fundamental reason that it's a bad idea now was just as true then.

It was a generalization of the "mother's maiden name" confirmation often used in banking, etc., pre-interview, but that _also_ had the same problem.

</comment></comment><comment><USER13> > Why do so many companies use public information for security questions?

Why do so many companies store passwords in plain text, have an 8 character password limit and/or don't bother patching their machines?</comment>


Server Side Rendering React App with Deno - <AUTHOR> https://dev.p.ota.to/post/server-side-rendering-react-app-with-deno-4qf28vm8axb/ <comment><USER2> One of the things I do like about deno is the out of the box support for typescript. Has anyone actually used it in production yet?

</comment><comment><USER3> It didn't occur to me that Deno's Typescript engine also brings with it JSX (as .tsx). That's pretty neat.</comment>


Evolving a better keyboard layout - <AUTHOR> http://klausler.com/evolved.html

<comment><USER2> I switched to the dvorak layout in my early twenties and it's been well worth it. It's not so much about speed, as it is about accuracy, and especially about comfort.

I would recommend in switching that you do NOT move your keycaps around, or draw new letters on your keyboard, or any other mental crutch, but instead simply memorize the new layout mentally. It won't take long, and that small step will hasten your transition.

There were a few interesting side effects however. For the first couple of days, I realized that I could no longer spell some words -- my life is so terminal oriented that much of my rote spelling knowledge was based on muscle memory.

In the first couple of days while feeling really inept at the keyboard, that feeling also carried over into regular voice conversations -- I had to remind myself that I wasn't speaking impaired, only typing impaired.

I easily exceeded my old qwerty performance within the first several days.

During the transition, it was an added challenge to do everything, and that reminded me the previous generation of punch card programmers describing their work. Suddenly it became more efficient to think about the problem harder before trying solutions, rather than just firing rapidly from initial thoughts until I had bludgeoned a solution.

It's amusing to secretly change some unfortunate person's keyboard to dvorak, watch the bewilderment, then type a few sentences, and walk away. "Works fine for me. I don't know what your problem is..."

<comment><USER3> I'm currently transitioning to a (German) dvorak variant - I'm about 2 weeks in and pretty happy with my typing speed. (I was never as fast as most programmers seem to be to begin with, 50-60 wpm) The reason I've switched though is recurring wrist pain. I've got all the ergonomic gear, but programming on QWERTY/QWERTZ is just plain bad. I've actually modified the layout slightly: specifically, I've mapped caps lock to be a left 'Alt Gr' key, and mapped [({<>})] to Alt-gr+homerow. All in all, hand travel is noticeably reduced.

</comment></comment><comment><USER4> I swear that when I have kids, I'm going to them multiple keyboard layouts at a very young age so that they'll be able to switch back and forth effortlessly when they're older (similar to learning a few languages at a young age). At least, I'm assuming that's how it'll work!

<comment><USER5> You assume keyboards will be still around then! Who knows... maybe they'll be obsolete in a decade.

</comment></comment><comment><USER6> I've considered switching to dvorak or colemak or otherwise, but the main thing that always holds me back is emacs. Have any of you emacs users out there used an alternate layout? What was/is your experience with it?

<comment> a-priori So I don't repeat myself: <http://news.ycombinator.com/item?id=424891>

</comment></comment><comment><USER7> I suspect touch-typing-optimised keyboard layours are not as relevant now as they would have been for the typewrite generation.

My default home position has my right hand in the conventional position, but my left hovering over the bottom left-hand corner of the screen. I spend far more time using those meta keys than typing. Ctrl+e and ctrl+y (vim scrolling keys) and alt+tab (window switching); ctrl+pageup/down (browser switching) and ctrl+a (gnu/screen escape key) than I do bulk entry of text. It also puts me closer to the escape key. In Windows I heavily use control characters based on win+r, win+e, and tab and shift-tab. I suspect the reason I have the right hand in the 'correct' position is because the dimple on the keys there allows me to consistently return to a known position in between occasional mouse usage. A small change to the keyboard layout (e.g. trying to use a UK English keyboard when I grew up with US English) is annoying not only because of the different positions of some control characters I use a lot, but also because it changes the feel of the keyboard and gives a different feel when I'm trying to return to a known position. I can't slide along the left shift there to navigate my left hand to the right position.

I suspect I'd have an easier time learning a different combination of alphabetical characters than I'd have adjusting to changes in the shape of the keys. I've not seen a typing survey about 'optimal layout' that considers such things, and given how individual it is I'm not surprised. The only reliable way to get figures out would be to take different populations of people at birth and grow them into different layours. With the entrenchment of qwerty and the tie between applications and particular layours (e.g. navigation keys in vim, popular positioning cut/copy/paste hotkeys in qwerty and the important role those keys play in users moving away from the mouse and to keyboard control) I doubt such a study would be practical.

</comment><comment><USER8> I'd like to see this done with some of the lesser-used keys that get used heavily in coding: [ ] { } " ' , . <Tab> <Esc>

I wonder if he used source code as the primary input into his algorithm, how the results would change. I can't type on the home row in qwerty, because my right hand is always shifted right about 2 keys, because I use those other keys so often.

<comment><USER9> There's a variant called "Programmer Dvorak" <http://www.kaufmann.no/roland/dvorak/>

Most relevantly, it puts the brackets, parens, and other programming symbols as primary on the number keys, and the digits themselves as the shift-modified versions.

Seems like it'd make lisp/scheme/etc a good amt easier to type :-)

I'm up for doing a conversion experiment on myself, once I figure out what my new work keyboard's going to be... And if they're going to stop me from swapping it for a kinesis.

</comment></comment><comment><USER5> I was thinking about switching, so googled up on it a bit, and found this: [http://stackoverflow.com/questions/455525/is-the-switch- to-d...](http://stackoverflow.com/questions/455525/is-the-switch-to-dvorak- worth-it)

What do people here think? Is it worth the time investment to switch?

<comment><USER10> This is kind of a holy war-ish question, FWIW. People have strong opinions, and the Qwerty vs. Dvorak thing has been tangled up in some academics' arguments about whether the Free Market is always right.

I've used Dvorak for over two years now, and in my experience:

1\. If you spend a lot of time typing on computers _you have control over_ , particularly if your career involves typing, it will probably pay off within a few months. (It works _very_ well with Emacs, IMHO.) If you spend much of your time fixing other peoples' computers or something, it probably won't help you much.

2\. If you're genuinely curious about whether it would be worthwhile, it probably will be, even if only for the experience of shaking up really deeply wired habits.

3\. Don't do it if you have deadlines coming up! Seriously, don't. Plan on a week or so of typing 5-15 wpm, and any "cheating" during the first week or two will really confuse you. (You'll probably also feel really stupid at first, like you've forgotten how to talk. It will pass.)

4\. You will be able to type on a Qwerty keyboard, but switching back and forth _within the first month or two_ will really confuse you. It's not a big deal once you're used to it, though. Having contextual associations ("my keyboard is Dvorak, the one in the school lab (or whatever) isn't") also helps.

</comment></comment><comment><USER11> I'm fast enough with Qwerty and with the tools of today (text editors with completion & snippets and such) programmers do less and less typing. Plus unless you're multiple computers and most of those aren't your own it can be difficult switching back and forth.

</comment><comment><USER12> I've got a keyboard layout kind of fetish, but I have realized there's no perfect keyboard... there should be a keyboard layout for every specific task you need to accomplish on a computer. If you are just a writer you have very different needs from a programmer, and a SOMELANGUAGE programmer will have different needs from SOMEOTHERLANGUAGE programmer. So I still have my fetish, but I just gave up looking for my own graal

</comment><comment><USER13> <http://mkweb.bcgsc.ca/carpalx/>

this is quite similar.

</comment><comment><USER14> Aren't non-QWERTY layouts strictly for people who never use other peoples' computers, and never let other people use theirs? I just swap Control and Caps Lock to their traditional Unix positions (helps relieve stress tremendously), and it already makes using someone else's keyboard incredibly painful.

<comment><USER15> No, they're for people who choose to take twenty seconds to choose a different keyboard layout in the OS control panel to save the health of their fingers, and a bit of typing time too.

<comment><USER14> It takes more than 20 seconds to install a keyboard layout switcher on an unfamiliar Linux distribution, or, for that matter, on a poorly-set up Windows installation. Also, if you just need to type for a few minutes on someone else's machine to help out briefly, it's rude to install or switch a fundamental setting like that. "Can you help me out with this..?" "Sure, let me first install my custom keyboard layout on your box."

<comment><USER15> If you're typing for a only few minutes then type QWERTY looking at the keys.

</comment></comment></comment></comment><comment><USER16> My post got a bit out of hand so I submitted a new topic: <http://news.ycombinator.com/item?id=439515>

It's somewhat related to keyboard layouts and efficiency...

</comment><comment><USER17> For anyone curious about the true history of QWERTY vs. Dvorak, check out this article:

<http://www.reason.com/news/show/29944.html>

</comment><comment><USER18> I'd be interested to see results using the Colemak layout.

</comment><comment><USER19> Having tried dvorak, I still find myself liking qwerty better. It just feels more.. right, to me.

Different strokes, I guess!

(Plus, my WPM is already plenty good. I can hit over 100WPM.)</comment>


Jack Welch: 'No Such Thing as Work-Life Balance' - <AUTHOR> http://online.wsj.com/article_email/SB124726415198325373-lMyQjAxMDI5NDE3NDIxNjQ0Wj.html

<comment><USER2> This has been said, often by women. Why is it news when Jack Welch says it?</comment>


New algorithm could transfer acclaimed photographers' styles to cellphone photos - <AUTHOR> http://newsoffice.mit.edu/2014/spruce-your-selfie <comment><USER2> Here's the original paper:

low-res pdf - [http://www.connellybarnes.com/work/publications/2014_portrai...](http://www.connellybarnes.com/work/publications/2014_portrait.pdf)

hi-res pdf - [http://www.connellybarnes.com/work/publications/2014_portrai...](http://www.connellybarnes.com/work/publications/2014_portrait_hires.pdf)

<comment><USER3> Thanks for the links, the two things that are really interesting to me are taking the makeup style from the example and applying it to the picture (preview the made up version of the face) and taking famous actors and morphing into something "like" them. This would be useful at creating props on screen where there are pictures from someone's "earlier" life, that could make them look much more realistic. Fascinating stuff.

</comment></comment><comment><USER4> The main difference of this method is doing the transfer locally - while most off-the-shelf filters only create global effects.

<comment><USER5> How does this compare to Soonmin Bae's work from a few years ago? (I can go read the paper, but maybe you have a quick summary?)

(Another of Frédo Durand's grad students who graduated a while back, [http://people.csail.mit.edu/soonmin/photolook/](http://people.csail.mit.edu/soonmin/photolook/))

Do you have any plans for future improvements which might reduce the really distracting color ringing artifacts you get in this current work?

Are there any photographers whose style doesn't transfer as well? (The ones you chose all use very high contrast and harsh lighting, with an emphasis on fine structure detail.)

<comment><USER4> Both papers use multi-scale approach to capture textures in different scales. While Bae's work is global transfer, this paper uses local transfer. This paper first uses a technique called "sift flow" in computer vision to compute the correspondences between example face and input face, and then transfer the image statistics locally, based on the correspondences.

</comment></comment></comment><comment><USER6> Url changed from [http://techcrunch.com/2014/05/30/mit-researchers-create- an-a...](http://techcrunch.com/2014/05/30/mit-researchers-create-an-app-that- turns-selfies-into-works-of-art/), which points to this.

<comment><USER7> More evidence of terrible mainstream scientific reporting. For some reason, bloggers love to blow every achievement and finding completely out of proportion.

quantum computing breakthrough ==> scientists invent lightsaber

new photograph analysis algorithm ==> MIT turns selfies into art

These people must have the best imaginations ever.

</comment></comment><comment><USER8> The lawsuits that will happen when someone implements this are going to be interesting. Artists tend to be very protective over their styles: [http://en.wikipedia.org/wiki/Leibovitz_v._Paramount_Pictures...](http://en.wikipedia.org/wiki/Leibovitz_v._Paramount_Pictures_Corp).

<comment><USER9> I don't think they can successfully copyright their style. Art is all about using and recycling other people's works. The art would not progress if there wasn't derivation. Wan't it Picasso who said "Good artists copy, great artists steal (ideas)"?

Also, artists tend to evolve over time. Few artists like to remain stuck in one style for fear of being thought as unimaginative or lazy (you could look into all the flak Ansel Adams gets). Also some like Kinkade made their style into a business and people expected a certain style so he could not get away from that.

Most successful photographers evolve their style over time --Winogrand, Friedlander, Eggleston, Atget, Frank, Moriyama, etc.

</comment></comment><comment><USER10> Right. If you want something not entirely dissimilar, and available right now for your photos, visit [http://vsco.co](http://vsco.co) or look for the VSCO Cam app on the app store.

It doesn't do based-on-image-X matchy-matching but it does good film emulation.

<comment><USER11> If you read the article it has absolutely nothing to do with global filters or film emulation.

<comment><USER12> The algorithm doesn't, but the results absolutely have.

Celebrated photographers "styles" can be two things:

a) a way of seeing (composition, sense of space, etc, etc)

b) a specific look, based on favorite film stock, preferred lighting schemes, post-processing etc.

This can immitate the second. Which you can also get, with a more manual process, from global filter/film emulation, like VSCO.

The local vs global application of the filter doesn't have as much impact in the final output. It's just a slightly more accurate (b).

<comment><USER10> It's not just that this can emulate the second. Sometimes VSCO Film _is_ the second, or at least the foundation for the second. It's kind of swept the modern photography world by storm.

That said, to the grand-parent poster: I realize that it isn't the same thing as described in the paper! However, it is available now, and I _was_ using phrases such as "not entirely unlike" which shouldn't exactly inspire a sense of precise equivalence...

</comment></comment></comment></comment><comment><USER13> In the beginning of the article I thought it was just some instagram-like filters with some buzzwords like "selfie" added. But when I saw the video showing that it can apply the style of one image to the other, that was where I started to find it awesome! Neat!

</comment><comment><USER14> This is absolutely amazing. Would love to see some demo code up on GitHub.

<comment><USER4> I'm planning to release some demo code before the presentation at August :-)

</comment></comment><comment><USER15> Someone more familiar with tools for this and located in the US should start a bounty for submitting the first _imagemagick_ implementation.

<comment><USER12> It's not like imagemagick has any tradition of these kind of things -- or that it's ever the first program to get those.

You'd might see something in Gimp long before there's any imagemagick implementation.

And usually those come from proprietary sources first.

<comment><USER15> Sure, but it would be useful. I for one would back a bounty.

</comment></comment></comment><comment><USER16> Did the title of this link change? Didn't it originally say "MIT researchers turn selfies into art", or something like that?

</comment><comment><USER17> Filters are passe but these are amazingly beautiful. They did a nice job.

</comment><comment><USER18> In my days that stuff was just called filters.

<comment><USER19> Now you can give it an example image, and it will automatically make your image look more like the example.

<comment><USER18> That's cool.</comment></comment></comment>


14 Years Old Kuwaiti Achieves 800,000 Downloads for His iPhone App - <AUTHOR> http://arabcrunch.com/2010/08/the-youngest-arab-entrepreneur14-years-old-kuwaiti-achieves-800000-downloads-for-his-iphone-app.html <comment><USER2> This is great. Congratulations!

FWIW I am a 35 year old New Yorker has 3,000,000 active users for his iPhone App (Darts). I am embarrassed by the advertisements but it pays the bills. _sigh_.

<comment><USER3> Just curious, does 3M active users generate a lot of ad revenue? One of our games is just about to go over 250k and I'm thinking of putting Admob ads in it or Google Adsense (they've approved us for beta).

<comment><USER2> Yes, it does work quite well for me. I could easily be an outlier and got lucky because of the name (literally "Darts").

Note that I am not using iAd (yet?). I started with Admob, then moved to Adwhirl and noticed that Quattro worked out the best. Now Quattro is Apple.

I am kind of an ass about the ads though since they are always present, in menus and during gameplay alike. If you read any of the reviews, my users hate me and it (used to) keep me up at night. _sniffle_. But, it helped me bootstrap a consulting business for mostly iOS work so I have taken a pragmatic view.

</comment></comment></comment><comment><USER4> [...] and Yes, and Yes, and Yes he is impressive. I love the self-starter type kids who have cool interests and do projects like these.

Side note: is this article a translation?

<comment><AUTHOR> the writer is 32 years old and not translation

</comment></comment><comment><USER5> Very cool! When I was 14 it was all about hacking apart QBasic. Strangely no one wanted to buy my Gorillas clone...

Congratulations!

<comment><USER2> My first program was a curses-like Yahtzee written in QBasic when I was 16. I recall learning about particle systems about that time. If you got a Yahtzee in the game, gratuitous explosions congratulated you. It was utterly ridiculous but fun as hell.

</comment></comment><comment><USER6> Thats a pretty awesome achievement, I hope he keeps it up and does some good with it. Goes to show what 2 weeks of complete absolute immersion into something can result in.

There's always a chance that such a thing could be a fake claim, but I do think its definitely possible.

</comment><comment><USER7> I've read several stories about kids like this but I never seem to hear about them later on. Were there any kids back in the 90's that are still active and somewhat popular today?

<comment><USER8> <http://en.wikipedia.org/wiki/Jez_San> (started as a games developer in his teens, now better known as the founder of pkr.com)

<http://en.wikipedia.org/wiki/Oliver_Twins>

</comment></comment><comment><USER9> did anyone else think this was really smirky at the end?

</comment><comment><USER10> Anyone else notice the uncanny resemblance between "doodle destroy" and "doodle vanish"?

</comment><comment><USER11> This is awesome. I've always learned by doing as well. Thanks for sharing!

<comment><AUTHOR> welcome, i got some people to help in some coding and then the rest by my self :)

<comment><USER12> Congratulations! Your results make older developers feel like excuses are just that. How did you do your marketing? Do you feel you benefitted from the rapid rise in popularity of physics-based games?

<comment><AUTHOR> I am not the developer guys who said i am the 14 years old kid :)

</comment></comment></comment></comment><comment><USER13> v ery inspiring!

</comment><comment><USER14> I wish I wasn't the one to play the skeptic, but I'm naturally skeptical about stories like this. Kids are often used as fronts for adults looking for a promotion vehicle.

<comment><USER15> If you're interested in this theme (adults using kids as promotional vehicles), I can recommend a sharp satire I'm reading at the moment:

[http://www.amazon.com/Serious-Men-Novel-Manu- Joseph/dp/03933...](http://www.amazon.com/Serious-Men-Novel-Manu- Joseph/dp/0393338592/)

Blurb from that page: "... a subtly wicked satire of subterfuge and ambition that bounces between the Mumbai tenement where low-caste Ayyan Mani lives, and the esteemed research institute where he labors as the assistant of top researcher Arvind Acharya. Forever spiteful toward his privileged superiors, Ayyan is deviously mischievous and pulls off a stunt that ends with his half- deaf (but otherwise ordinary) son being proclaimed in the local news as a boy genius. Meanwhile, Arvind is obsessed with proving his theory that extraterrestrial microbes are raining down on Earth from the upper atmosphere. "

<comment><AUTHOR> so u r saying that kids at 14 can not code? he is not the first one to be an entrepreneur at his age in the world

<comment><USER16> The game doesn't seem to involve so much coding. Actually, it's not about the game, it's about how it got around 1 million download.

If you want to show us a 14 kid coding, then get it to do some coding stuff. Example, solve a math. equation or write an algorithm or hack Windows kernel... If you show us 800K downloads, it's just the app success that happens either by good planing and marketing or a sheer luck.

<comment><USER17> If he did his own physics engine, that's pretty impressive.

<comment><USER18> Why would he bother writing his own physics engine if there are free and easy solutions already _? People who invent their bicycles don't end up shipping stuff in two weeks with no prior programming experience.

_ <http://cocos2d-iphone.org> (which uses:)

* <http://code.google.com/p/chipmunk-physics/>

* <http://www.box2d.org/>

</comment></comment></comment></comment></comment></comment><comment><AUTHOR> Kuwait is on the richest countries in the world in terms of GDP, so not everyone is spoiled do not u think so?

<comment><USER16> I think here you mean the per capita and not actually the global country GDP. However, there is no relation. Having a higher per capita or GDP doesn't relate to luxury. It's the amount of work a nation has made over a year.

For the game, I think it's more about the idea than the coding itself.

<comment><AUTHOR> yes per capita, and the idea played a big role yes :)</comment></comment></comment>


Autopsy of web apps: RegOnline, FeedBurner, Wufoo, and Blinksale (slides from SXSW -- 2MB zip) - <AUTHOR> http://particletree.com/sxsw/autopsy.zip <comment><AUTHOR> Lots of insightful numbers to learn from. Anyone who's starting a web app should give this a look.

<comment><USER2> Awesome work Daniel! You just made my day :D

</comment></comment><comment><USER3> If you like these insights you might want to give barenaked app a read. It's the story behind trying to sell dropsend and they reveal a lot of the numbers behind it. Here's a great starting point: http://www.barenakedapp.com/dropsend/number-of-users-on-each-plan

</comment><comment><USER3> Any chance of adding the 2mb zip warning into the title please?

Other than that great slides. Wish I was at SXSW :( The audio/speakers would make it more meaningful

</comment><comment><USER4> *warning*... download is 2Mb zip file (but well worth the effort). Whoever compiled this did a great job.</comment>


Memcpy vs. memmove - <AUTHOR> http://www.tedunangst.com/flak/post/memcpy-vs-memmove <comment><USER2> Linus had some strong opinions on the distinction between memcpy and memmove when it became a significant userspace issue on Linux a few years ago:

[https://bugzilla.redhat.com/show_bug.cgi?id=638477#c132](https://bugzilla.redhat.com/show_bug.cgi?id=638477#c132)

I think he's probably right that there's no reason not to alias memcpy to memmove and make the latter smart enough to do the fastest possible thing given its input. Every implementation of memcpy and memmove that I've seen has been sufficiently complicated in order to optimize for big copies that an added comparison or two for bounds checking would seem a drop in the bucket.

But I'm open to practical examples where the performance difference would become significant.

<comment><USER3> One of the commits asserts memcpy triggers extra optimisations by hinting the areas are non-overlapping: [http://marc.info/?l=openbsd- cvs&m=137026274514948&w=2](http://marc.info/?l=openbsd- cvs&m=137026274514948&w=2)

> Replace "hot" bcopy() calls in ether_output() with memcpy(). This tells the > compiler that source and destination are not overlapping, allowing for more > aggressive optimization, leading to a significant performance improvement on > busy firewalls.

<comment><USER4> The issue that caused Linus to argue memcpy should just act like memmove involved old binaries breaking with new kernels, so the compiler's behaviour wasn't an issue there.

<comment><USER5> It was a bit more than that. He implied that the performance differences were trivial, so it wasn't worth the trouble.

I think, unfortunately, Linus' argument amounts to demanding that API's conform to how they are used rather than how they are specified, which leads to O_PONIES type problems.

</comment></comment></comment></comment><comment><USER6> I was pretty surprised to learn that "the x86 architectures have a direction flag that can be set to cause the processor to run backwards".

It turns out not to be quite as dramatic as that description makes it sound: [https://en.wikipedia.org/wiki/Direction_flag](https://en.wikipedia.org/wiki/Direction_flag)

</comment><comment><USER7> I looked up nop sleds but don't see why they're used here. Explanation?

<comment><USER8> My best guess is to properly align instructions along a certain boundary, but I'm pulling that out of my hat.

You can put bcopy as a function call right before memmove, and then you don't need one function to call the other, which would cause a stack push. Maybe instructions need to be at addresses = 0 mod 16, so that's the "closest" you can get it. And spinning over ~12 NOPs might be faster than incrementing the PC by ~9.

<comment><USER9> Yeah, looks like it's for function alignment padding. It's a pretty common thing at the end of functions to have the next function start on a specific boundary. (even if the first function doesn't fall into the other)

I haven't tested, but I'd bet good money that 12 NOPs would be faster than a jmp.

<comment><USER10> You can do an unconditional jump every 1 or 2 cycles, depending on the chip, whereas no chip I know of can execute more than 4 nops per cycle. Therefore I would say the jump is probably marginally faster than 12 nops.

Smart toolchains will turn those 12 bytes into 2 multi-byte nops, e.g., a 9-byte one and a 3-byte one.

<comment><USER11> What does a 9byte NOP look like?

<comment><USER12> [https://github.com/sbcl/sbcl/blob/master/src/compiler/x86-64...](https://github.com/sbcl/sbcl/blob/master/src/compiler/x86-64/insts.lisp#L2978) has

0x66 0x0f 0x1f 0x84 0x00 0x00 0x00 0x00 0x00

That's a size override prefix, followed by the dedicated NOP instruction (0x0f 0x1f), and finally 6 bytes to encode an effective address with offset.

<comment><USER4> Multi-byte nops have compatibility issues on some of the more obscure 32-bit x86 CPUs, unfortunately: [https://sourceware.org/bugzilla/show_bug.cgi?id=13675](https://sourceware.org/bugzilla/show_bug.cgi?id=13675)

<comment><USER12> Right… you have to check cpuid for the long nop feature. I believe 0x66 0x90 is compatible (but slow, I would expect) with older CPUs.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER13> I believe that on several modern compilers, memcpy and memset are practically -if not literally- treated as intrinsics. As in, the compiler has been granted semantic understanding of those specific functions and can generate very well optimized assembly based on that knowledge. Haven't heard about the same being done for memmove.

<comment><USER14> What compilers are you thinking about? I've never seen GCC inlining and specializing a call to memcpy, it just calls the generic (but optimized) implementation in the standard library.

<comment><USER15> I take it that you are a long-time C programmer who hasn't realized that the language is no longer the one you grew up loving. That casting a float to an int to do some bit twiddling is now undefined behavior of the sort that technically entitles the compiler have it's way with your root filesystem. Although usually it will just let you off with a warning and a gaping hole where your null checking code used to be.

Believe it or not, memcpy() is now the only portable and properly defined way to cast one type to another in C. You are expected to use it with the explicit intent that no bytes actually be copied, simply as a (completely voluntary) offering to the type gods. If they accept your offering, the call will just disappear from your code, and never be made. If you fail to make this offering, they feel entitled to excise an equal quantity of other code to punish you.

Sure, you the programmer happen to know that bits are bits, and that on your system they are already in the register you want to use, but the compiler stopped playing that game years ago. If you wanted to work close to the metal, you should have chosen a language more appropriate for the task. There's a great discussion of the issues in this epic comp.arch thread: [http://compgroups.net/comp.arch/if-it-were- easy/2993157](http://compgroups.net/comp.arch/if-it-were-easy/2993157)

Search for the first occurence of 'memcpy', where you'll find a polite but beleaguered Terje Mathisen asking for the best way to portably cast a float to an integer in C. Then keep searching forward for further occurrences of memcpy as the situation becomes surreal, with a GCC maintainer Mike Stump eventually clearing things up:

      >>> So what is the blessed method?
      >>
      >> Just memcpy it, simple sweet, fast, standard.
      >
      >So what you are saying is that memcpy() isn't just magic but high magic:

      No.  What I think I'm saying is that it is standard.  See the quoted
      text above.  The word magic [ checking ] doesn't not occur in c99-tc3.
      What is defined in that standard is memcpy, it is as standard as if,
      which is also defined.

      >It looks like a function call but can be whatever the compiler wants it
      >to be, as long as the results behave as if the data was actually copied.
      >:-)

      No, you fail to grasp the totality of the standard.   The implementation
      is free to do _anything_ it wants.  The only constraint is that the user
      can't figure that it deviated from the required semantics by using a standards
      defined mechanism for figuring it out.  We call this the as-if rule, and its
      power is awesome; we could destroy the universe, and repiece it back together
      one subatomic particle at a time over a billion years, and still be compliant,
      if we wanted.

So there you have it: if you want to reuse the exact contents of a register as a different type in a way that you know will work, the correct approach is to use memcpy() to copy the data from one variable to another, and then hope without confirmation that GCC has optimized out the call to make it equivalent to a simple cast.

If you want a better understanding of the GCC mindest, the rest of Mike's posts are excellent: cutting, extremely techically accurate, and (in my opinion) completely missing the point of why some people are unhappy with the direction that C is evolving.

<comment><USER16> C11 explicitly blessed unions for type-punning as well as memcpy (actually, C99 TC2 did). That said, people should just use memcpy.

<comment><USER15> Yes, it's now in the standard (someone in the thread I linked pointed to TC3 draft, §22.214.171.124, footnote 82) but apparently there are issues with the way GCC implements in its default dialect that make it unsafe. More Mike Stump:

      >>> So what about using a union?
      >>
      >> Most people screw it up, the rules for it working are slightly odd.
      >> Those rules are not standard[1], rather they are gcc specific, so in very
      >
      >Ouch, so what you are saying is that this is one of those (according to
      >Nick M) barely defined areas of the language?

      What I am saying is that it is defined to not work in the language
      standard gcc implements by default.  There is no barely, there is no
      defined.  As an extension to the language standard, gcc implements
      (defines) a few things so that users can make some non-standard things
      always work.  I say slightly odd, as the rules are just a tad harder
      than trivial.

I prefer the union approach to memcpy() because I can more easily reason about its behaviour, but veiled warnings from GCC maintainers scare me away from it. But perhaps I misunderstand the warning.

For that matter, I prefer simple casts to unions, and while I agree the spec makes it undefined, I don't yet see why all common implementations couldn't simply make it work in all reasonable cases. I'm currently trying to get used to using memcpy() for type annotation, but it still feels unnatural to write a function I don't want executed (yes, I have trouble with setters/getters too).

What I'd like is to have a way to specify to the compiler that I want it to compile the code I give it as written as best as it can, rather than optimizing it out as undefined. As it is, I often resort to inline assembly if I actually want an operation to happen. It seems like there should be an intermediate approach, a hypothetical '#pragma "dwim"' that could avoid this.

</comment></comment></comment></comment></comment><comment><USER17> repne movsb

<comment><USER18> I guess somebody downvoted you for the shortness of your comment. You probably know this, but repne movsb is actually a fairly slow approach to copying data compared to the various SSE assembly implementations that libc and friends have. The only thing repne movsb has going for it is how short its encoding is.

It _is_ a bit bizarre that modern CPUs don't have an instruction for something as basic as "copy N bytes as fast as you can", and instead we're in a situation where library and compiler writers have to tune their assembly for different micro-architectures. (I'm not saying that it's a wrong decision, there are probably good reasons for doing things this way, but it's not something you'd expect.)

<comment><USER16> "rep movsb" (note: not "repne") actually is one of the fastest ways to copy memory on Ivybridge and Haswell (about as fast as vectorized copy implementations when the data is resident in L1/L2, and significantly faster than vector copy loops when the buffers are too large to be cache resident). On micro-architectures preceding Ivybridge, rep movsb is indeed slow.

It's still not quite "as fast as you can"; it's possible to beat rep movsb when buffers are small due to edging effects, but it's about as close as it's possible to come to that today.

<comment><USER19> _On micro-architectures preceding Ivybridge, rep movsb is indeed slow._

Actually, rep movsb/movsw/movsd has been at the top at least since Nehalem (confirmed with benchmarks), and "fast string mode" which does cacheline-sized copies has been around since the P6; you may be able to squeeze out a few % more with SSE (or MMX), but the much larger code of the SSE-based copy functions (especially for alignment) is often not a win overall. Intel only really started advertising that they made it _even faster_ with Ivybridge.

It was the fastest way to do memory copies on the 8086/8088, and might've been the fastest until around the time of the 486 and Pentium when it could be beaten by other techniques; but now it seems that it's coming back in favour.

There's an interesting discussion about this instruction on the Intel forums here: [https://software.intel.com/en- us/forums/topic/275765](https://software.intel.com/en-us/forums/topic/275765)

<comment><USER16> It was still nowhere near as fast as a good software sequence on Nehalem or Sandybridge. The startup cost to the microcode engine was simply too high, and its handling of misalignment was very inefficient. For "small" (< 1K) unaligned buffers (which are actually a large portion of memcpy usage on a live system), good software sequences were 3-4x faster than REP MOVS.

It _did_ perform competitively for large all-aligned copies, which are what most people tend to look at when they post "memcpy benchmarks", but those turn out to be a relatively small portion of actual usage in most workloads.

</comment></comment></comment></comment></comment><comment><USER20> I keep dreaming of a world where memcpy is an instruction to the memory controller _only_ and doesn't hold up the CPU at all. It feels kind of silly to have this complicated piece of silicone with all its amazing processing capabilities just sit there reading RAM into registers and then writing them back doing precisely nothing.

<comment><USER21> This is done but mostly for peripheral IO (like DACs/ADCs, disk, video or audio codecs and even between non-shared memory for processors) but can (and has) been used in the main memory hierarchy . [http://en.wikipedia.org/wiki/Direct_memory_access](http://en.wikipedia.org/wiki/Direct_memory_access)

<comment><USER22> Some game systems did this too. For instance the Gameboy Advance had DMA, and it was used all the time because if you were eating up your cycles on copying memory, you would run out of time to process your game logic before your vertical blank ended and the system started drawing onscreen.

I also saw it used to save memory. Onscreen sprites had to be placed into a small memory-mapped address range, so instead of putting every character animation frame into this space and using it all up, I saw just one block designated for the character, and it was animated by DMAing the frames sequentially into that space.

</comment></comment></comment><comment><USER23> Note that, if memory serves correctly, many vendors just alias memcpy to memmove anyways, because the performance is pretty similar and the bugs prevented are super annoying.

<comment><USER24> It's fun to benchmark memmove and memcpy on a box to see if memcpy has more optimizations or not. On Linux x86_64 gcc memcpy is usually twice as fast when you're not bound by cache misses, while both are roughly the same on FreeBSD x86_64 gcc.

Linux (2.4Ghz Xeon X3430):

./memtest 10000 1000000

memcpy took 0.575571 seconds

memmove took 1.082038 seconds

FreeBSD (2.0Ghz AMD Athlon64 3000):

./memtest 10000 1000000

memcpy took 1.487334 seconds

memmove took 1.442741 seconds

<comment><USER25> What memtest are you using? This one:

[https://github.com/UK- MAC/WMTools/blob/master/tests/memtest....](https://github.com/UK- MAC/WMTools/blob/master/tests/memtest.c)

<comment><USER24> It's one I wrote myself to test this very thing after reading the memmove manpage. I was wondering why you would ever use memcpy unless it had a big performance advantage, so I wrote a micro-benchmark to see. If you are really interested, I can put my benchmark program up somewhere.

Additional findings: Unsurprisingly using clang instead of gcc does not affect performance on FreeBSD or Linux.

<comment><USER25> Yes please. If you want share it, I'm curious how different compilers and architectures handle memmove vs memcpy.</comment></comment></comment></comment></comment>


Python's GIL implemented in pure Python - <AUTHOR> https://rushter.com/blog/python-gil-thread-scheduling/ <comment><USER2> Reading the headline I couldn't help but think "But why?". Actually quite interesting and valuable implementation info if you're ever doing threading with CPython.

<comment><USER3> > Reading the headline I couldn't help but think "But why?".

Reading the article will clarify.

<comment><USER4> Reading the rest of the post you're replying to might help.

</comment></comment></comment><comment><USER5> This is nice .. but it could be nicer with (pun intended) use of the context manager protocols, a few less empty lines and a bit of minor refactoring for readability.

Is execution_loop really meant to start and end holding the GIL?

<comment><USER6> Two empty lines before function definitions is part of the PEP8 style standard, which is widely used in the Python community. Most Python autoformatters and linters default to PEP8.

As for empty lines within code, I personally find it helpful to visually separate logical segments.

<comment><USER7> > As for empty lines within code, I personally find it helpful to visually > separate logical segments.

I see it as, if a function is like a paragraph, then the whitespace between lines deliminates sentences. I very much dislike run on sentences that are attempting to explain complex rules/topics in english and in code. Spatial grouping is very natural for the eyes and mind.

</comment></comment></comment><comment><USER8> > Note that this code will not run if you will try to execute it, because it's > missing bytecode execution logic.

So much for "implemented".

Incidentally, apparently PyPy has a GIL too[1], complete with a detailed description in a source-code comment, similar to the one quoted in the linked article[2]. It's written in C. Isn't the point of PyPy that it's written in a Python subset?

[1][http://doc.pypy.org/en/latest/faq.html#does-pypy-have-a- gil-...](http://doc.pypy.org/en/latest/faq.html#does-pypy-have-a-gil-why) [2][https://bitbucket.org/pypy/pypy/src/00f8eae1/rpython/transla...](https://bitbucket.org/pypy/pypy/src/00f8eae1/rpython/translator/c/src/thread_gil.c)

<comment><USER3> > So much for "implemented".

This comment reeks of middlebrow dismissal. The author implemented the GIL in pure Python for illustration purposes, as it says in the very first paragraph of the article, yet you complain it won't actually run. Where were you thinking of using a pure-Python GIL that this is such an inconvenience to you?

> Isn't the point of PyPy that it's written in a Python subset?

More dismissal. The point of PyPy is to be a JIT. What it's written in is incidental, not "the point".

<comment><USER8> My first point was a bit of a nitpick, sure, but I'd never describe my work as 'implementing' something unless it actually worked, in full.

As to my second point, you're reading dismissal where there is none intended. My question wasn't rhetorical. Ironically, you've just dismissed my question.

Is Wikipedia's PyPy article mistaken in describing it as 'Written in RPython'? I'll go ahead and fix it if so, or perhaps I'm missing something about the status of the C code.

<comment><USER3> What word would you use to describe writing something in a language for illustration purposes?

PyPy _is_ written in RPython. You posted a link to the RPython translator's source code.

<comment><USER8> > What word would you use to describe writing something in a language for > illustration purposes?

I'd probably go with "The GIL explained in Python".

> PyPy is written in RPython. You posted a link to the RPython translator's > source code.

But RPython is a part of the PyPy project, no?

Do you consider the Wikipedia listing to be accurate?

<comment><USER9> "PyPy" can mean two things: either the PyPy interpreter, or the PyPy project. The PyPy interpreter is written in Python, you could run Python on PyPy running on CPython if you wanted. (The PyPy folks probably do that regularly to debug the interpreter.)

Because PyPy on CPython is never going to be faster than CPython alone, the RPython toolchain is used to convert the PyPy interpreter to C code. The C code in the RPython source (e.g. the GIL implementation) is bundled together with the translated program and then compiled into machine code.

RPython is also written in Python. It works by importing the program to be translated, executing all initialization code to create classes, methods and global objects. This is no different from regular program startup. But then RPython is provided with a particular function as an entry point, and it does whole-program type inference to determine a static type for every reachable value. That only works because PyPy is written in a style that only uses dynamic Python features during initialization and is very restricted after the entry point. So PyPy is actually written in the subset of Python that RPython accepts.

If you tried to use RPython on any arbitrary Python program, it'd probably complain about a ton of type errors. RPython is really a very different language, and its feature set is tailored specifically to writing PyPy in it. It can handle certain constructs that Mypy isn't able to typecheck because they require running the program, but it also rejects many well-typed Python constructs because they don't translate to efficient C.</comment></comment></comment></comment></comment></comment>


Lithium:http_backend. Coroutine based, C++ HTTP web application framework - <AUTHOR> https://github.com/matt-42/lithium/tree/master/libraries/http_backend <comment><AUTHOR> Author here. I started this project last december in an attempt to ease the development of web apps with C++. It's almost feature complete, I fixed quite some bugs and all the performances issues I could find. It is now ranked #1 on the Techempower benchmark.</comment>


Stocks post best annual gain in 6 years with the S&P 500 surging more than 28% - <AUTHOR> https://www.cnbc.com/2019/12/31/dow-futures-last-trading-day-of-2019.html <comment><USER2> A good way to have a great annual return in year y+1 is to have a 21% decline during December of year y.

<comment><USER3> 2016: +11.96%

2017: +21.83%

2018: -04.38%

2019: +32%

(All numbers are total return, the 2019 source didn't have fractions of a %)

That's not a bad four years' return.

(Yes, December 2018 had a big decline -- but the first 11 months of the year were pretty good, and we ended only 4.38% off even with the 21% decline in the last month)

<comment><USER4> What is the significance of four years? Personally, I prefer to talk about my three year return.

<comment><USER3> I wasn't trying to make a special significance by looking back exactly four years -- I picked 2016 as a starting point because I felt that it gave enough context to show that the big drop in December 2018 was a little blip in what is actually a huge uptrend.

<comment><USER4> If that was a little blip, then the uptrend clearly started in 2009.

</comment></comment></comment></comment></comment><comment><USER5> The value of the index tells very little. You must compare market cap to something and look at the ratio.

Here is good summary of important ratios December 27, 2019 [https://www.yardeni.com/pub/valcapsales.pdf](https://www.yardeni.com/pub/valcapsales.pdf) SP500 price to sales, price to earnings, market capitalization, TOBIN'S q.

We don't know what happens, but it's certain that if you buy SP500 at current price level, you must accept significantly smaller return next 10 years than previous 10 years.

<comment><USER6> Isn't 2009-2019 gain much greater than 1999-2009 gain? What makes you think that the next 10 years will generate smaller return?

<comment><USER4> People always predict the future from the past, but there are different ways to define a pattern.

Many people think that since the US stock market returned 8-10% for the last ~30 years, then it will for the next 30. This has worried me for a long time for various reasons, but nobody seems interested in my reasons.

However, a new way of looking at things occurred to me recently. In the early 80s, 30 year treasury bonds were ~10%, and with hindsight, stocks were very good buys too. If you bought either one and held until now, you would have made a pretty similar amount. So, if the future resembles the past, maybe what we should expect is that the stock market return for the next 30 years will be the same as the interest on a 30 year treasury _today_. Nominal, not inflation adjusted, which means ~2.3% is the _best_ case scenario, and civilization collapses if inflation returns. Also, since dividends are about 2% and inflation is not zero, that means after tax returns for non-retirement funds are going to be essentially nothing.</comment></comment></comment>


Best way to get Trademark for startup? - <AUTHOR>

What's the BEST way to get Trademarks for new startup?  A tangential request would be, "What is the Cheapest and BEST way.."  I'm in the early stages of development, so I don't have a lot of money, but we'd like to go ahead and get the company name, etc nailed down, and a trademark would let us do that.
any suggestions?  Online services like LegalZoom, or Trademark specific sites.  Is there a way to tell them apart?  How bad can they mess it up?
Thanks in advance,
Travis <comment><AUTHOR> There are several services online (found by doing basic google searches) that have a price of $500 for a trademark search and the actual trademark application. And some even handle international trademarks as well.

Anyone who's done this and had a good experience with someone, site, etc.. please respond. ;)</comment>


Y2038: It's a Threat - <AUTHOR> http://www.circleid.com/posts/20200120_y2038_its_a_threat/ <comment><USER2> > MacOS does use 64-bit time values, so there shouldn't have been a problem. > But the "ls" command (and the Finder graphical application) do do some date > arithmetic. I suspect that there is old code that is using a 32-bit > variable, thus causing the incorrect display.

I was unable to reproduce that by bypassing unzip:

        % touch -t 210301010000 this
        % ls -l this
        -rw-r--r--  1 eesmith  admin  0 Jan  1  2103 this</comment>


Chowdy: Shutting Down a +$110,000/Month Food Startup - <AUTHOR> https://www.failory.com/interview/chowdy <comment><USER2> > we learned that it's illegal to use home kitchen for commercially sold food

aka "we didn't do any research at all"

> we were inspired by Uber and Airbnb to just ignore the regulators.

Those pesky food safety regulations. These guys were extremely negligent and should be glad they got out before anybody got sick.

<comment><USER3> Yes. Keeping food in a fridge for 48 hours. What a crime.

<comment><USER4> Take a look at one of their hubs: [https://imgur.com/a/PQJB09X](https://imgur.com/a/PQJB09X). Maybe around 300+ meals stuffed in there? Back-of-the-enveloping the amount of time people are opening and closing those doors, I'm a little dubious they're staying at refrigerator temperature the whole time. I'm not surprised someone looked at this and thought, "That's an e. coli outbreak waiting to happen."

<comment><USER3> The more full the refrigerator the longer it will maintain temperature.

<comment><USER5> That's only true assuming there's enough time for the contents to reach the target temperature.

</comment></comment></comment></comment></comment><comment><USER6> When I lived in New Caledonia growing up, we had a similar service which used reusable food "boxes" that would get delivered to your front door or to your work every lunch. It would be left on your door step and it was up to you to grab it quickly and refrigerate it. This was in a tropical country. No one ever got sick. Seems like regulatory overkill, especially in a place where half the year the outside temperature is colder than most fridges.

(Link in French for those curious, it's called "la gamelle" and it's still going strong today, albeit with throwaway plastic containers.[http://lafamilletortue.com/gamelle-nouvelle- caledonie/](http://lafamilletortue.com/gamelle-nouvelle-caledonie/) )

</comment><comment><USER7> "with almost half quitting after the first week"...to me this sounds super critical...no amount of funding or a partnership with even god him/herself, can't make it work unless this is fixed.

<comment><USER8> Yeah he didn't really talk about food and menu. 6 to 7 dollar per meal isn't anything to scoff at. It'd better be tasty on consistent basis.

</comment></comment><comment><USER9> I'm wondering if they would have been able to convince the food regulators if the fridges themselves had sensors and such.

Concept would be to create an audit trail of the fridge itself from the sensors.

</comment><comment><USER10> "The average lifetime of a subscriber was 9 weeks, with almost half quitting after the first week.". I wonder if someone tried to find their reasons to do so. He also notes that "consumers have no loyalty to food brands; they will happily try a bunch and switch to another service if they can get a better deal.", but knowing which criteria they use may be vital(?) The "lower price" can't be their sole criterion when it comes to food they consume.

<comment><USER11> Having tried multiple food services, I've frequently tried because of an intro price, discovered the quality was meh, and immediately quit after the first week.

<comment><USER10> Many test this way. Chowdy's food quality may have been not as high as expected by (most/a too high fraction) of their customers.

</comment></comment></comment><comment><USER3> These people built a business that provided a lot of value and a bunch of bureaucrats killed it because they didn't like the thought of something being in a fridge for less than 48 hours.

This is the message of these regulations: don't try to do anything in the real world. Solve only ephemeral, virtual problems.

This guy is working on a travel information app now. He has gotten the message.

<comment><USER12> I hear you but it sounds like the concern was that no one onsite with the refrigerators could be considered responsible for monitoring for possible tampering with the food.

<comment><USER13> That's what tamper proof seals are for aren't they?

Cameras in fridge + CCTV could also have worked.

Fridge/unattended issue is a solved one. Japan has vending machines for food.

I think their biggest mistake was turning down the dragon funding. They would have avoided most issues especially the one that led to their shutdown.

With food vending machines, better pricing, and new location deals, this might work out. E.g. A vending machine in an office building.

I bet they would do well in silicon valley or any other location with high startup density.

</comment></comment></comment><comment><USER14> I think this would work extremely well in most developing countries.

In fact, I have read about some system in India or Japan where a lot of people get home make food, distributed in stacked containers.</comment>


What is the best comment in source code you have ever encountered? - <AUTHOR> http://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered/

<comment><AUTHOR> Some of my favourites:

        // somedev1 -  6/7/02 Adding temporary tracking of Login screen
        // somedev2 -  5/22/07 Temporary my ass

        //When I wrote this, only God and I understood what I was doing
        //Now, God only knows

        Exception up = new Exception("Something is really wrong.");
        throw up;  //ha ha

</comment><comment><USER2> From Unix, Sixth Edition:

        /*
         * If the new process paused because it was
         * swapped out, set the stack level to the last call
         * to savu(u_ssav).  This means that the return
         * actually returns from the last routine which did
         * the savu.
         *
         * You are not expected to understand this.
         */

</comment><comment><USER3> My favorite would be a comment in some generated html (no other comments around it

<!-- this are some comments -->

Later it was "fixed"

<!-- these are some comments --></comment>


Shoe-fitting Fluoroscope - <AUTHOR> https://en.wikipedia.org/wiki/Shoe-fitting_fluoroscope <comment><USER2> > Three shoe salespersons have been identified with rare conditions that might > be associated with their chronic occupational exposure: a severe radiation > burn requiring amputation in 1950,[10] a case of dermatitis with ulceration > in 1957,[11] and a case of basal-cell carcinoma of the sole in 2004.[8]

There was more information in the following quite interesting article linked from the references:

[https://web.archive.org/web/20100326182352/http://staff.tamh...](https://web.archive.org/web/20100326182352/http://staff.tamhigh.org/lapp/xray.pdf)</comment>


Sold, For Just Me - <AUTHOR> http://al3x.net/2010/01/12/selling-downfor.html

<comment><USER2> I found this part interesting:

 _I also don't have their permission to disclose the amount of the sale, but suffice to say that it was proportional to the amount of time and effort I've put into it (that is, not much)._

He clearly didn't build it to make money, but why would it be proportional to the amount of time and effort put in? This doesn't seem to me like the most important thing to consider when selling your work, unless it's a contract job ;)

<comment><USER3> Well if he was making $300/month would it make sense to sell it for less than $7200 (i.e. 2 years revenue, all profit I assume)?

</comment></comment><comment><USER4> I used your site many times over the years. Its amazing how much it comes up.

I stopped using it when I found out it was tweeting my inputs. I often checked my own sites, and didn't like it broadcasting that the site was down, much less without permission. Just my .02.

Kudos on the sale.

<comment><USER5> "This feature has been inactive since November 2008."

</comment></comment><comment><USER6> "PS The source for the site is open once again."

<http://github.com/al3x/downforeveryoneorjustme>

</comment><comment><USER7> My website isn't public yet, but I want some people to see it so it's sitting behind a simple htaccess login. downfor tells me my site is down.

I guess I'm outside the use case, but saying the site is down doesn't seem right either.

<comment><USER8> You could always start upformebutdownforeveryoneelse.com

<comment><USER7> I'd make 1/300th of a dollar on it every month.

<comment><USER9> You could do like cperciva and use picodollars. It would look much more impressive that way.

</comment></comment></comment></comment><comment><USER10> I use <http://Alertra.com>

</comment><comment><USER11> You got TechCrunched: <http://www.techcrunch.com/2010/01/12/down-for-new- owner/>

</comment><comment><USER12> Did they make you sign a non-compete? :)</comment>


Portland.. the repo - <AUTHOR> https://github.com/mrzarquon/portland <comment><USER2> Nice. Theres a great website for finding punk and metal shows for portland as well (generally multiple per night, its a great scene) , I forget the name but its googlable</comment>


1,000 Reviews and a Near 5-Star Value: Our "Good Listener" Approach - <AUTHOR> http://blog.mailtrack.io/2014/12/10/1000-reviews-a-near-5-star-value-our-good-listener-approach/

<comment><USER2> Comparing the ratings of a year old bootstrapped startup and the ratings of a multi-year well-funded startup is like comparing apples to oranges (especially since you are comparing Chrome Extension ratings, which are not the primary focus of any of the comparative businesses). Drawing inference from this difference is not good statistics and is hitting on the correlation-implies- causation fallacy.

<comment><AUTHOR> Hey! While your observation is valid, I'd invite to compare MailTrack's review rate per 1,000 installations with other couple-of-year-old startups. I guess you'll get to interesting conclusions. Thank your for your feedback! Conrado</comment></comment>