Putting Mobile Ad Blockers to the Test - <AUTHOR> http://www.nytimes.com/2015/10/01/technology/personaltech/ad-blockers-mobile-iphone-browsers.html <comment><USER2> It's a pity that all these articles comparing iOS ad blockers look only at the paid apps, some of which have some dubious backgrounds (like selling out to whitelist specific sites). A comparison with free ad blockers would do a whole lot of good instead.

<comment><USER3> I suspect it's because there are too many to pay attention to in these short articles. There's 21 listed at [http://www.loopinsight.com/2015/09/16/a-list- of-content-bloc...](http://www.loopinsight.com/2015/09/16/a-list-of-content- blockers-for-ios-9/) and it's probably not a complete list. Purity, Peace, Crystal and later 1Blocker were all day-one appearances, so they got the most coverage, including here on HN.

There's even a long list of open source ones -- and having just looked into this now, I'm thinking of switching to one of these:

[https://github.com/krishkumar/BlockParty](https://github.com/krishkumar/BlockParty) [https://github.com/yene/CBlocker](https://github.com/yene/CBlocker) [https://github.com/saagarjha/OpenAdblock](https://github.com/saagarjha/OpenAdblock) (will work on iPhone 5 and 5C, it claims) [https://github.com/dgraham/Ka- Block](https://github.com/dgraham/Ka-Block) (for Safari on OS X) [https://github.com/jlnr/SansFonts](https://github.com/jlnr/SansFonts) (kills web fonts on iOS)

</comment></comment><comment><USER4> I'm not surprised they specifically call out boston.com

I've been reading that site weekly / daily for a few years now. On Desktop browsers its pretty painless (with an ad blocker on), but recently on my ipad the usability of the site has dropped to zero.

It constantly loads an ad that redirects me to the app store, while my browser sits on a blank page. If you hit the back button, boom forward to blank page, context switch to App store.

And the apps it wanted me to download were highly questionable in nature.

I'm amazed that a site of that high of brand recognition would stoop to that level (auto-redirect to crappy app store app). Will be finding a new site for my Boston news after that.

<comment><USER5> This is due to ad arbitrage. Boston.com is not the problem, the ad network behind is. They're just slow to catch it I guess.

</comment></comment><comment><USER6> Mobile does not mean Apple, which is what the entire article is about.

<comment><USER7> Yeah, the title made me think there would be an overview and comparison of existing ad-blocking options now that iOS can be included with Apple- sanctioned software.

Instead it was just an overview of some iOS ad blocking apps. I was actually interested in how the new iOS stuff compared to the usual adblock/ublock/etc. for mobile Firefox (even if they ignored more system-wide options that require superuser on Android or running unsigned code on jailbroken iOS).

</comment></comment><comment><USER8> I thought it was ironic that they called out Boston.com. Until a few years ago, The New York Times owned Boston.com (online domain for The Boston Globe). Back to New York/Boston rivalry as usual?

[https://en.wikipedia.org/wiki/The_Boston_Globe](https://en.wikipedia.org/wiki/The_Boston_Globe): "The company was acquired in 1993 by The New York Times Company; two years later Boston.com was established as the newspaper's online edition. In 2011, a BostonGlobe.com subscription site was launched. In 2013, the newspaper and websites were purchased by John W. Henry, a businessman whose other holdings include the Boston Red Sox and Liverpool F.C."

</comment><comment><USER9> Would be interested to find an ad blocker that is aware of my available bandwidth. If I'm using my phone/phablet on 3G/EDGE connection then block ads (especially on the kind of ad payload being reported in this article). But when I'm at home on fast Wifi connection then I'll take the additional bandwidth to display the ad as my part of the bargain on reading the content.

<comment><USER3> Sounds like a feature Apple should add in a future iOS release, especially if they redesign the Content Blockers section in Safari Preferences on iOS to allow extensions to put their settings in the Preferences menu directly. It's rather annoying right now to open an app, go to preferences, then open the app to change the preferences...

</comment></comment><comment><USER10> I'm not too sure about the methodology of their battery test - presumably if they loaded the web pages in an endless loop an ad blocker would just result in more page requests in the same timeframe (causing more data to be downloaded and more processing time to be used).

</comment><comment><USER11> Hmm... so is nytimes conspicuously missing from that list or did I miss it?

The guardian gets more and more of my respect every day, not just for the lack of ads, but for the depth and choice of their articles - that's one publication I would not mind paying for.

<comment><USER12> _> Hmm... so is nytimes conspicuously missing from that list or did I miss it?_

It's there, 15th from the bottom (2.5/4.3)

</comment></comment><comment><USER13> So iOS ad-blockers only work in the browser? They don't block ads in apps?

<comment><USER14> why would apple want you to block ads in apps? ;)

<comment><USER13> Why does it matter what Apple wants? Oh yeah, it's Apple's phone, I'm just temporarily using it.</comment></comment></comment>


Data flow syntax: The missing piece for the success of functional programming? - <AUTHOR> http://bionics.it/posts/fbp-data-flow-syntax <comment><USER2> Reading the title I was expecting some Lisp/Haskell...

While you can do that, Python doesn't make your life easier if you want to go functional, really. There's only map/reduce/filter, one-line lambdas (that get really messy really fast), no currying, etc. (however, comprehensions are fine)

I appreciate the effort of the OP in questioning the fact of dataflow implementations, and I suggest him to further explore the world of functional languages - it's huge and resourceful, while the quality of the content written is surprisingly high on average - as he may even find a working implementation for the problem he was trying to solve (happens way too often to me).

BTW, a quick google brought me to this [1] - I'm not sure if it's exactly what we are talking about, but seems related.

[1]: [https://github.com/kennytilton/cells](https://github.com/kennytilton/cells)

<comment><AUTHOR> Well, I've done a tiny bit of lisp/scheme too, but felt that lazy-evaluated generators (which I happen to know the best in python) are a bit more "state of the art" FP than the call/return semantics I've seen in lisp/scheme (Clojure has async.io though, which is a whole other story, much more data flow like, AFAIK).

Thanks for the cells link, will have to check!

</comment></comment><comment><USER3> I work on IBM Streams, which has its own language, SPL (Streams Processing Language), which solves the same problem. You can check out a small SPL application here: [https://github.com/IBMStreams/streamsx.demo.logwatch](https://github.com/IBMStreams/streamsx.demo.logwatch)

And a direct link to the SPL source code for the application: [https://github.com/IBMStreams/streamsx.demo.logwatch/blob/ma...](https://github.com/IBMStreams/streamsx.demo.logwatch/blob/master/language/com.ibm.streamsx.demo.logwatch.language/LogWatch.spl)

</comment><comment><USER4> I'd say Elm goes a long ways toward practical dataflow syntax and operation in its rather small language. Making a series of comprehensions lazy doesn't quite go far enough to make composition natural. While it seems like there are ways to improve it, the Signal.Mailbox record type and the Elm architecture have surprisingly good composition properties.

<comment><AUTHOR> That's interesting! I've been watching Elm a small bit, but hadn't seen that they also have the concept of "ports", which is so useful in FBP! (The "example.ports.prices.send(42);" part in [http://elm- lang.org/docs/syntax](http://elm-lang.org/docs/syntax) )

</comment></comment><comment><USER5> Have you looked at reactive streams? There are some interesting semantics for splitting and combining data and only describing the different flows independently that handle the data as it flows through.

[http://doc.akka.io/docs/akka-stream-and-http- experimental/1....](http://doc.akka.io/docs/akka-stream-and-http- experimental/1.0-M2/scala/stream-graphs.html)

There are split semantics where the tuples are simply fed into other flows. And then merge semantics where flows recombine into a single flow for further processing.

<comment><USER6> What if the program is constantly altering the plumbing beneath the streams? Isn't this kind of programming not becoming a bit "messy" then?

<comment><USER5> I don't know - maybe I don't see the argument clearly. If you want to keep state, then look at the actor model. If you want to talk about functional programming, then we can assume things are immutable.

If you want to deal with multiple streams of data, I think combinators do just fine. If you want to choose which function to pass into higher order functions at runtime, then indeed you can define functions and just reference them. If you want to split data up, you can use all of the nice function composition and pattern matching available in languages like scala and haskell.

To split a string, take half to upper and half to lower, you can use tuples, or zip and unzip, partition etc. Stuff like that. None of it seems messy but I'm probably not understanding this article correctly.

</comment></comment></comment><comment><USER7> The post is interesting and highlights a true fact : it is not always easy to chain map/filter/reduce transformations when the processed values are compound and call for processing that are specific to each part.

Nonetheless, the proposed solution is most in the component/object realm rather in the functional world.

As an evidence the use of _nouns_ rather _verbs_ as in :

        splitter.input = hi_generator.his
        lowercaser.input = splitter.left_part
        uppercaser.input = splitter.right_part

This is not a judgement, just a remark. A functional solution would rather use transformation combinators to propagate a transformation on a specific value part. For instance :

        input |> map split_two_halves
              |> map_fst to_lower
              |> map_snd to_upper

Or even better, use lenses as a generic way to unpack a specific part of a data structure and to repack an updated value:

        input |> map split_two_halves
              |> map_lens fst to_lower
              |> map_lens snd to_upper

</comment><comment><USER8> A (python) library that does alot of this (the parallelism, data-flow, flow construction from task units, remote execution, resumable execution...). I'm one of the authors, it's used in various openstack projects (and more)... This article was very much along the ideas of it, so thought it useful to share.

\- [http://docs.openstack.org/developer/taskflow/](http://docs.openstack.org/developer/taskflow/)

\- [https://wiki.openstack.org/wiki/TaskFlow](https://wiki.openstack.org/wiki/TaskFlow)

We recently had a brown-bag (with a community member from HP and myself from yahoo) that is shareable and maybe useful to folks @ [https://docs.google.com/presentation/d/1EZoY4FE2SDjfCqMCgBRr...](https://docs.google.com/presentation/d/1EZoY4FE2SDjfCqMCgBRrwo7ovHF4vYZFGKjjvFvWHIE/)

</comment><comment><USER9> This is a problem I've experienced (and partially solved for my self) when working with streams of events on UI's in js.

e.g.

      applyStoreFilterStream.recv(function () {
          // do some stuff
        })
        // when either removing a filter or adding a filter
        .compose.serial(removeStoreFilterStream, applyTypeFilterStream)
          .recv(removeAllElements)
          .recv(pager.reset.bind(pager))
          .recv(requestProductsStream.send);

This was using an in house streams library (before i'd found Rxjs).

I did find that, because there is only one line at a time within which to express a dependency (from one stream to another) it was quite difficult to conceptualize the graph structure being created. I think perhaps having editors that can interpret this sort of code into a visible graph structure and conversely, compile a graph structure down into this form, would be interesting.

</comment><comment><USER10> Please excuse my ignorance, but maybe someone can help me convince that I'm wrong.

This article illustrates a problem I have with FP in general, coming from procedural / OOP codebases: For the generator example, how can I be sure that the initial generation of strings isn't getting executed twice? Will python analyse that I'm only ever reading from "left" or "right" within the gen_uc / gen_lc loops, thus optimizing away the the other side in the upstream generator? So I'm basically trusting the runtime to optimize for me? Do we have benchmark showing the overhead for this runtime analysis? Does it work consistently with JITed pythons like pypy?

So far I'm just always too skeptical that I could program myself into a performance hole that require complete rewrites to get out of, so I stick with code where I know what will happen on the machine. Python for me is just the toy language to try these concepts before diving into actually performant ones, but not finding any significant Haskell/F#/.. benchmarks that can perform as well as good C or Fortran code, hasn't helped in reducing my skepticism. IMO the thinking of "correctness now, performance later" is a fallacy in that the choices I'm making in the design phase can lead to complete rewrites in order to get something performant - in the worst case switching between languages.

<comment><USER11> You can be sure it doesn't execute twice because the generation is lazy/on- demand. When you create a generator, nothing gets actually done, it just sits there waiting for you to pull elements from it, and which point it'll actually generate one element (and wait for you to request another).

This is in contrast with list comprehensions, which have a similar syntax, but which generate a full list immediately after being declared.

<comment><USER10> I know that this is true in general, but this case here seems tricky to me. Look at the following line:

> yield (s[len(s)//2:], s[:len(s)//2])

I'm aware that the generator is being called lazily, but here we're actually calling each yield _twice_ \- once the left side is thrown away, once the right side downstream. Now, are you still sure that left and right is generated only once?

<comment><USER11> Oh, right, I missed that. No, it's actually generating both every time. CPython can't eliminate one of the sides, since the calls (either to len() or to the slicing method of 's') might have side effects.

In this case, I think it'd make more sense to divide gen_splitted_his into two functions (or one which accepted a parameter), for generating one or the other.

<comment><USER10> I have been toying around now with this second python example for a bit.

Here's my conclusion: Not only is it not efficient, it doesn't even work. The generator cannot be rewound after it has been iterated over for lowercase - the uppercase version will never be executed. You essentially run into the problem described here: [http://stackoverflow.com/questions/1271320/reseting- generato...](http://stackoverflow.com/questions/1271320/reseting-generator- object-in-python) .

It only works once you actually generate twice

> lc_his = gen_lc_his(gen_splitted_his(('hi for the %d:th time!' % i for i in > xrange(10))))

> uc_his = gen_uc_his(gen_splitted_his(('hi for the %d:th time!' % i for i in > xrange(10))))

It seems to me for this toy example, generators are simply not the right tool.

<comment><USER11> Yes, but I think the author realizes that, which is why (s)he wrote above _" this will produce an error, since running a generator function twice is not allowed, and this would not re-use the same items in memory anyway, which is kind of the main point with stream processing_".

The solution being proposed at the end is actually not using generators at all.

<comment><USER10> Oh I see, I missed that this "limitation" also applies for his DPI example that I was toying with.

</comment></comment></comment></comment></comment></comment></comment><comment><USER12> If you're interested in this kind of stuff in python, you should check out datastreams: [https://github.com/StuartAxelOwen/datastreams](https://github.com/StuartAxelOwen/datastreams)

<comment><USER13> Why is `datastreams` better than using generators and comprehensions, plus the itertools module in the standard library?

<comment><USER12> It makes working with iterators easy - this way you're always talking about one thing at a time, instead of the whole collection/iterator, making efficient computation easy.

Also, the abstraction allows for optimizations like delegating to Apache Spark or other processes/threads.

</comment></comment></comment><comment><USER14> How is functional programming not already successful? All new languages claim to be functional, old languages add functional features. FP is seen as the best way to use multicore and keep improving software.

How is it not successful already?

<comment><USER15> I think they meant "not successful" in the sense of not showing up on popular indexes, such as:

[http://www.tiobe.com/index.php/content/paperinfo/tpci/index....](http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html)

I'm only pointing to Tiobe because it is popular, not because it is accurate, but you could use any other popular index and you would get similar results: a whole lot of imperative languages, but none of the officially Functional languages.

</comment></comment><comment><USER16> Considering the philosophy of Python, how likely is it that this idea of return/parameter independence be introduced into the language (via a PEP or whatnot)?</comment>


Tuning in to unconscious communication - <AUTHOR> http://web.mit.edu/newsoffice/2008/signals-1021.html

<comment><USER2> I love this kind of stuff. Does anybody know if the book is good? I'd be curious to hear a couple of examples of the results it contains - the article is weak on specifics.

It's interesting that this researcher has a background in both psychology and signal processing.</comment>


Ask HN: Bitcoin owners—how many of you have actually *bought* something with it? - <AUTHOR>

I think there's little question that bitcoin is unsustainable unless an ecosystem emerges for spending it.<p>So how many of you actually transact in bitcoin? What for? And if you haven't, why not? <comment><USER2> There's no incentive to purchase something with BitCoin if the value continues to go up. Would you spend $5 on a sandwich knowing that by the end of the day if you don't spend you may have $10 instead? BitCoin is not a currency. It's a commodity or "virtual good". The speculation around BitCoin will be its undoing.

<comment><USER3> That's a flawed argument, because you can by the sandwich for $5 worth of BTCs, and then immediately buy the BTCs back with cash.

Of course, that seems excessive for the individual user, which is why your wallet service provider will do it on your behalf and assume the risk. I imagine Coinbase will do this very soon.

Assuming that in a couple of years there will be a functioning derivatives market, the wallet service provider can then offload that risk to investors.

Speculation isn't a "bad thing", it's a natural thing that is necessary for an efficient market.

<comment><AUTHOR> Your logic is bewildering. In your scenario, you're still essentially transacting in USD and using BTC as an investment or a store of value. You're not actually _spending_ BTC, since you expect the value to continue rising, and you buy back the BTC. Another way of looking at it is that there's no exchange of goods in BTC, since the BTC you sell doesn't transfer to a merchant, but to another investor.

Either way, this implies BTC doesn't have intrinsic worth. The OP's argument stands: deflationary forces make it even harder to create a market in bitcoin since no one wants to trade an asset that they think will appreciate in value.

</comment></comment></comment><comment><USER4> I've purchased domains (NameCheap), food (Foodler), work (contractors), and countless other little things. Checking out with bitcoin is incredibly simple and easy when compared to using credit cards. I also don't need to worry about my credit card information being compromised if someone I buy from is cracked.

<comment><AUTHOR> Were you worried about giving up bitcoin that could dramatically grow in value later? Or did you buy back bitcoin after spending it?

<comment><USER4> I'm fairly invested into bitcoin. I buy bitcoin on a regular basis and often get paid in it. I'm not too worried about the bitcoin I spent going up in value later.

I like to think of myself as a user of the currency, not necessarily an investor.

<comment><USER5> That is cool that you're paid in BTC. If you only have BTC, then it can become your primary currency, because you have no other option.

However, as long as people have access to cash in their local currency, it doesn't make commercial sense to spend BTC. Bitcoin is a self fulfilling prophecy because of this...

</comment></comment></comment></comment><comment><USER6> I've bought stuff at least a couple of times. Most notable was when a client paid money onto a Namecheap account (for a domain name) but accidentally missed a sub-charge (and I forgot about it too). This meant that the account balance was a few pennies short of the price of a domain. If I used my credit card or Paypal not only could I end up linking my card with someone elses account but there was also a minimum of $5 charge (you could not add pennies). So I added the remaining pennies in Bitcoins and just a few seconds latter the balance had gone up and I could buy the domain name. :) I had a very good experience and it was a lot faster than even logging in with Paypal. I would also strongly recommend Namecheap to anyone. It's a very good company.

</comment><comment><USER7> I bought a laptop recently.

The price was a little higher than if I had paid old fashioned money, about $700 instead of $680-690. But I needed one. I guessed the price of Bitcoin would be likely to go down temporarily, which was right. It was one way of taking some profits from the increase in value

I earn money in Bitcoin, so it is a closed loop for me.

</comment><comment><USER8> I've bought a few ASIC miners with bitcoin. I bought two BFL Jalapenos when they came out, for $150/ea, and I just preordered a Coincraft miner for abour $3k.

I've also bought two 4TB hard drives, for about $300.

(The prices are all in USD, and the price of bitcoin when I bought each thing varies.)

</comment><comment><USER9> I bought a used Macbook Pro for ~$300 worth of bitcoins a couple of years ago. those bitcoins are worth ~$20K. My argument for why he should accept the deal was, "they will probably go up in value". I'm happy I did it.

</comment><comment><USER3> Yes, mymodafinil.net

Basically, merchants who benefit from Bitcoin are those that VISA/PayPal don't want to touch.

<comment><USER10> > Basically, merchants who benefit from Bitcoin are those that VISA/PayPal > don't want to touch.

Interestingly, that site has Visa and Mastercard logos on the home page.

</comment></comment><comment><USER11> lots of people are already using it to buy drugs and do online gambling.

it can also be used by people in countries that restrict internet access to buy vpn services.</comment>


Is CSS or HTML a programming language - <AUTHOR> http://naijafixer.com/webmaster/is-css-or-html-a-programming-language/msg84/?topicseen#new <comment><USER2> I find the argument for HTML/CSS being a programming language as more of a status issue. People want to be called programmers.Not every language is a programming language.

<comment><AUTHOR> But i feel css can later turn into a programming language in the future</comment></comment>


How to get the wine you really want - <AUTHOR> http://www.economist.com/news/science-and-technology/21709491-how-get-wine-you-really-want-war-terroir <comment><USER2> Twenty years ago I was a tea-totaller, but there was a group of people I wanted to hang out with who would get together to drink wine so I decided to try to develop a taste for it. I eventually got to be a pretty hard-core wine snob. My wife and I even ran a wine-tasting group for several years. Then one day we decided to start doing blind tastings, and we soon learned that there was very little correlation between what we liked and what the wine critics and the market liked. The real turning point came when we did a blind tasting of Cabernets, all from California. The wines ranged from a $5 bottle of Barefoot cab up to a $100 bottle of Silver Oak. There were twelve of us in the group and every single one rated the Silver Oak dead last, and the Barefoot either first or second. Since then we've repeated similar experiments many times, usually with similar results. We can still freak out wine snob friends on occasion by sneaking a bottle of Barefoot in to a high-end tasting.

On another occasion we were at a bed-and-breakfast that served afternoon wine and cheese. The whole room (including us) was raving about how complex and delicately nuanced the white wine was. It turned out to be Gallo Rhine Wine in a box.

(BTW, it's absolutely not the case that all cheap wines taste good. We tried the notorious two-buck chuck and thought it was absolutely horrible.)

The point is: wine snobbery is bullshit. Find what _you_ like and drink that, and don't pay attention to anything that anyone else says. If Beringer white zinfandel is what turns you one, more power to you. (Actually, the worst possible outcome for a real wine fan is to discover that they really do enjoy Romanee Conti or Screaming Eagle. I really like Opus 1, but I wish I didn't :-)

So I think this roll-your-own-wine blender is a terrific idea. I can't wait to try it. (I wish I'd thought of it!)

<comment><USER3> I don't quite understand why you winos take your critics so seriously in the first place.

Critics are just people with opinions. Sometimes they can provide good justification for why whatever they're reviewing is good or bad. But not one of them is impartial enough that their opinion can be taken at face value, specially if you're not into the stuff they're pushing.

This is more obvious with film and videogame. It wouldn't matter at all if a critic I liked ever said that there's this one Adam Sandler movie that everyone should totally watch. I'm not into that crap.

<comment><USER4> A good friend of mine is actually a food/wine critic. He has said (and I think this applies to all good critics) that there's nothing special about the tastes of a critic. Some people may be more sensitive than others but critics are pretty much in the same population as the rest of us. The difference between a good critic and someone flapping their gums on Yelp is the ability TO WRITE something worthwhile about the subject, be it wine or food.

Boiling what a critic says down to "good/bad" or "like/dislike" means the reader hasn't taken the time to really understand what was said-- or the critic wasn't very good.

<comment><USER5> I don't fully buy this. I expect my chosen jazz critic to be knowledgeable, like, a lot. Same for food and wine. I want to read the words of someone who has eaten on more places, more foods and more flavors than me, not less.

Your friend might be too humble.

<comment><USER6> But even then, they're not any better at 'tasting well'. You don't have to care about the fancy properties of the wine, just whether it tastes good to you.

<comment><USER7> The same argument can be brought when comparing top 40 pop music and jazz, say. There isn't an objective truth to aesthetics, but that doesn't mean that everyone's opinions has equal depth or nuance.

Some things you get more out of if you choose to spend time with them, but will in turn change your own sense of it, and the experience you are having.

So in some sense you actually do become "better " at tasting/listening well - or at least you become more sophisticated. Which doesn't invalidate the enjoyment that someone else can get from a more superficial engagement, at all.

</comment></comment></comment></comment></comment></comment><comment><USER8> Winemaker here. I would like to try those wines, but I don't think you will get good results out of it.

Taste of wine is mostly structural thing: it is created during fermentation by polymerisation of different compounds. Even mixing different wines don't give you good results, unless you fiddle with different ratios (I do as much as 10 for cuvee of two wines, trying to find sweet spots) and then letting it settle for some time.

Well, it might be fun activity, but I am sceptical that you will create wine that you will actually like.

<comment><USER9> If I understood the article correctly, this machine will probably not create wine that you (dejv) will actually like, but may well succeed in doing so for the >99.9% of people who are not winemakers :-)

<comment><USER8> Well, I am sure given enough time I will likely find some ways to get good enough results out of it.

The quality of end product will be mostly determined by quality of base wines. But the problem is that wine is multidimensional => say you want sweeter wine for which they use Muscadet. This wine is not just sweet, you are also adding whole set of new tastes to the mix: there will be some acidity and different set of smell.

Will this taste good? I don't know, you might get lucky and find good recipe or you might mix some weird combination. The thing is that taking 100 ml of light body wine and 100 ml of heavy body wine will not give you 200 ml of medium body.

Anyway, I think they will get enough customers just for novelty of it and some wines might even taste good.

<comment><USER10> I would say the odds improve as you have more options. Worse case the ideal mix is 100% wine X. But, given a set of wines odds are some mix will end up being better.

</comment></comment></comment></comment><comment><USER11> I guess I'm spoiled. I get the wine I really want by living in Portugal.

There's so much good wine here that even the cheap stuff is good quality (we're talking $3 for a bottle). Unfortunately, I've found myself slightly allergic to reds (unless I only have a single glass) so a lot of the local market is off-limits thus I stick to white and 'green' (sweet wine).

I know of some local places here in Lisbon where a small glass of red is 75 cents. The best are Porto's wine 'caves', though, where one can try some really great varieties - five for 12 bucks. Great value for the quality and with prices that don't break the bank, it's of course possible to explore more of what the national market has to offer.

</comment><comment><USER12> I have developed a new theory about wine and selecting bottles you/I like.

The theory is that pallets for wine develop over time as you drink more, similar to how beer will change. When I was 16, all beer tasted terrible. Then at 19 we 'upgraded' to bud light.

Now 15 years later I drink for taste and I like IPAs,or other non standard pilsner.

For me, I'm a beginner wine drinker so I do not want the complexity of fancy wine. I ask for 'beginner, fruit forward' and not expensive wine and have had amazing results. The problem is that pallets are different so blind taste tests won't solve the problem

In 15 years, I'll probably 'upgrade' again.

<comment><USER13> There are also physiological changes that affect this and perception of anything (and our other senses affect taste).

So really, you can just reduce it down to your age.

<comment><USER12> Good point.

</comment></comment></comment><comment><USER14> I have that Asian gene that limits how much alcohol I can drink, so I never drank more than a few sips of wine until I was well into my 30s. One day some friends and I went to a nice restaurant to celebrate a milestone, and we ordered a ~$120 bottle of syrah based on an app that showed critics' ratings.

It was a revelation. Whenever I had had wine before, I always picked wines that were considered "approachable." Sweeter, fruitier, and so on. But this wine was different, highly complex and paired beautifully with food (a first for me). Afterwards I chased down the wine online and found one of the few places that sold it, and had a few bottles shipped from across the country. Trying it again later with my wife, who also rarely drank, she agreed it was something special. Since then I've explored other wines and have found that my favorites are generally not the ones that are pushed as approachable for beginners.

I guess the lesson is, if you want to understand what the fuss is all about, don't be afraid to try ones that have more to offer than fruit and sugar. Tannins, full-bodied structure, and balance can be extraordinary.

I have found that there tends to be a sweet spot around $40-100/bottle for the best quality/price. Though to be fair, there are plenty of good wines for less, and plenty of duds in that range and above.

</comment><comment><USER15> Before reading the article I thought it was going to be about taking people's DNA samples and using that to select the wine ([https://www.thedrinksbusiness.com/2016/10/us-startup- claims-...](https://www.thedrinksbusiness.com/2016/10/us-startup-claims-it- can-match-wine-to-your-dna/)) or using the phase of the moon ([http://archive.fortune.com/magazines/fortune/fortune_archive...](http://archive.fortune.com/magazines/fortune/fortune_archive/2004/08/09/377901/index.htm)) but it actually sounds quite sensible.

I occasionally drink wine (in the restricted sense, i.e. made from grapes), but I prefer beer. There's a lot more variation in flavour (because there are at least four ingredients in beer, and umpteen different recipes), and even the very best beers - things like Trappist ales - aren't obscenely expensive.

</comment><comment> noir-york Quelle horreur!

 _They found that most customers are stick-in-the-muds. Instead of sampling different regions, grape varieties and vintages, they tend to order the same plonk every time they go out._

And the solution isn't the Vinfusion, its getting rid of the snobbery and not making people feel like fools for not knowing their wine.

</comment><comment><USER16> I was hoping this would be a guide to tweaking the linux wine. This does sound neat though, kind of like the paint mixing machines at department stores with a personality test on top. I wonder how far this could go, maybe something could suggest different ingredients based on your mood, and what mood you want to be in. Or maybe even using various biometrics to determine your overall "state" and the best way to alter it.... Just Friday afternoon musings.

</comment><comment><USER17> > Traditionalists may be appalled by all this, but they should not be. In Mr > Wimalaratne's mind, the function of the Vinfusion system is in principle > little different from the blending of grape varieties that goes on in many > vineyards, to produce wines more interesting than those based on a single > variety.

After spending a couple weeks in central coast and napa recently, tasting probably ~100 glasses, this kind of sounds insulting. Especially after seeing how much effort goes into cultivating the grapes, crafting these wines, and how they're stored and aged.

I get it though and perhaps this will work for some bar/restaurant. Whatever happened to house red or house white for those who don't care or know?

<comment><USER18> Yep, it's insulting in just the same way it's insulting that people now program computers with high-level languages like C++, Java, Erlang, Python, Lua, etc., instead of using patch cables or punch cards. Or in the same way that people now just get on a jet airplane for $200-500 and fly across the country, instead of using a covered wagon and worrying about being attacked by natives.

The "house red" isn't something that everyone likes. Would you go to a restaurant that only has one dish for dinner, with no choices at all? I wouldn't. Most people seem to like dry wines; personally I hate those. Ordering "house red" is likely to get me something I don't want to drink, so why would I do that? That's like going to an ice cream shop where there's no choices, and I get served some tapioca with nuts in it (i.e., ice cream I really hate).

<comment><USER17> > it's insulting in just the same way it's insulting that people now program > computers with high-level languages like C++, Java, Erlang, Python, Lua, > etc., instead of using patch cables or punch cards

It's hardly the same thing. Someone still has to produce the wine and then it's blended by the machine. For a software comparison it's probably the difference between hand crafted software by a group of professionals and someone picking a wordpress template and adding plugins.

> The "house red" isn't something that everyone likes. Would you go to a > restaurant that only has one dish for dinner, with no choices at all?

The "house red" is still a glass of wine from a bottle, just not chosen by the patron. There's still a wine list to choose from for the more picky customers. Restaurants also have something called the "special of the day" or "chef recommended" and that's basically what we're talking about here. You can go to the menu or take the "special."

</comment></comment></comment><comment><USER19> There's an excellent opportunity to apply machine learning here to automatically let you discover what you like. Starting from a set of varietals and/or random blends, it would generate new blends based on your rating feedback, eventually converging towards your preferred tastes. In addition to arriving at your optimal wine(s), a further analysis of the results (plus qualitative labels from experts) could also generate knowledge useful to you elsewhere, like "You like full-bodied left-bank Bordeaux, and also California Merlots. You dislike light-bodied wines in general."

</comment><comment><USER20> The article mentions the customer configuring 3 sliders of wine characteristics, that might be too much decision making for me at a restaurant.

I'd still ask a sommelier standing nearby to pick something for me.

</comment><comment><USER21> The trouble I have with wine is that I pretty much like all wine. I don't like extremely sweet wines, or very light in color wines because they're usually too sweet. But in my range, I can't really tell the difference.

So the $3.00 WalMart Oak Leaf is just fine with me.

I've read wine snob reviews of it, and they tend to be "hey, not bad."

</comment><comment><USER22> There are wines that suit your taste and wines that don't.

I'm acetic that all wine recommendations are good.

</comment><comment><USER23> The "70% disappointed" figure has nothing to do with anything but the fact that 95% of UK restaurants and pubs sell _appalling_ wine. A merlot is a merlot, but if you can only order shit merlot you'll be disappointed regardless.

</comment><comment><USER24> In South Africa, our family troll past-time at parties was to re-label wine we brought. We used the same wine everytime (our personal favourite) and disguised it with some fake fancy label.

</comment><comment><USER25> > Instead of sampling different regions, grape varieties and vintages, they > tend to order the same plonk every time they go out.

Of course they do! The problem with wine is that the _user experience of selecting one is shitty_. If you study how users work, to get them to explore, you need a couple of things:

1\. They need signals and affordances to give them hints as to which new actions are most likely to be what they want.

2\. After they have made a choice, they need to be able to quickly get feedback to determine if it was what they wanted.

3\. They need to be confident that if they try an action and it isn't what they want, that they can retract their attempt easily and without negative consequences.

Wine fails at pretty much all of these.

1\. The packaging and terminology around wine is inscrutable. The labels usually mention brand (sometimes), location, and variety. As far as I know, most of those have little internal correlation. Two wines from the same winery can taste totally different. Likewise, two wines from the same area, and using the same variety. If I like, say, Chateau LeBlah Merlot from Bordeaux, that doesn't give me much confidence that I can predict what Chateau LeBlah's Cabernet is like, or a Bordeaux with a different variety, or whatever.

The label also tells you the year and the price. Again, those numbers often do not correlate with anything I can easily discern in the taste of the wine.

2\. This is half there. I can take a sip and tell if I like it. Well, except that doesn't work out as well as you'd expect. Food and environment has a huge impact on taste. There is also the social experience of drinking. If a friend says, "Oh my God, you have to try this, it's amazing!" then it probably will taste better to me.

If I like a glass, did I really like it, or did I just like the experience? Or did I feel pressured to like it? Or did the high price tag convince me I _should_ have liked it and if I didn't I just don't have a refined enough palate? Should I stick with it to see if I acquire a taste and understand what all the fuss is about?

3\. In theory, most restaurants let you try a taste before you commit. But that in itself is a high pressure social act. The rest of my companions will watch my taste it and pass judgement. It's stressful being on the spot.

Usually, I just pick something and stick with it. If I'm not enthused about it, I'll slowly work my way through it sip by sip. I would feel weird ordering something else with a full glass sitting there. And I don't want to just gulp it down to move on to another glass because I don't want to drink too much.

If I'm buying wine at a grocery store, there's less social pressure, but I'm even more committed. I have to buy a whole bottle, and I can't return it.

Of _course_ people stick with the one or two wines they know. The whole system points directly to that as rational behavior.

<comment><USER26> Applying usability to wine is a great way to improve the experience. Great post.

Someone in Japan tried to tackle the problem by setting up a sake tasting room with 120 vending machines:

[https://www.youtube.com/watch?v=OM8pMZrBGRI](https://www.youtube.com/watch?v=OM8pMZrBGRI) (Japanese video)

[https://www.youtube.com/watch?v=NxNRvfMihI0](https://www.youtube.com/watch?v=NxNRvfMihI0) (English video)

It solves a few of the usability problems: there's a top ten most popular sakes list on the wall, you're buying it from a machine which removes any peer pressure, each sake has notes on the front about the type and acidity level, and they give you a cucumber to cleanse your palette in between drinks.

</comment></comment><comment><USER27> I worked at a very high end restaurant for a while. To me it appears that wine tasting is an attempt to justify going out and drinking for most people. Wine snob sounds better than functioning alcoholic.

</comment><comment><USER28> The awesome thing about wine is that you don't know what you want until you accidentally find another great wine.

</comment><comment><USER29> I'm looking at a set of areas in which information acquisition is difficult, and in which choices or decisions have very strongly social implications. These are quite frequently areas in which choice is very strongly ruled by fads or fashions -- strong and often rapid shifts in preferences, but without a long-term persistence -- a winner in any one period will be likely to revert to mean in another (though other influences may sway this).

The areas I've identified:

1\. Clothing and fashion -- the _practical_ reasons for distinctions are few, and often _counter_ the popular choices. But these have a _very_ high signalling rate for social status and alignment.

2\. Management practices. Here, the problem is that determining _actual_ quality is quite expensive, most especially in time (results may take years, and there's a high noise element to measurement). At the same time, adoption signals group allegiance and has strong carry-on effects with in a market (consulting services, training, education, organisational systems, etc.).

3\. Programming languages, tools, operating systems, editors. As with management tools, measurement is hard and takes a long time. At the same time, there are network and lock-in effects which can develop, as well as organisational and market-signalling effects.

4\. Food and diets. "Fad diet" is a well-developed concept, going back to the 1960s. The concept of food as a social identifier is much, much older, and can be an element in keeping social groups separate or allowing for their integration. The segregation of Chinese and Muslim populations in Indonesia, for example, derives in part from the affinity for pork by the first and absolute aversion by the second group. That's contrasted to the situation in Thailand, where the Buddhist indigenous population doesn't have a pork aversion and mixes far more freely with the Chinese immigrant elite (from Amy Chua, Harvard scholar and author).

5\. Pop music. Beyond a certain base musicality, hit tunes in the 1940s - 2000s were largely a result of both highly focused marketing and some degree of organic development. Experiments with "artificial" hits (within selected group populations) has seen different choices evolve within different groups, from the same base set of songs. Again, music is very highly associated with social identity.

6\. Wine. Fads emerge here because it seems so difficult to objectively identify _and communicate_ distinguishing characteristics among different wines. The market offerings are huge, and quite confusing, with information aquisition by individuals difficult and expensive. Choices are very strongly influenced by advertising, marketing, and chance exposure.

There are numerous other goods or behaviours which could be treated similarly. Sports choices, physical fitness training modalities, books (like wine: expensive to judge), etc., etc.

</comment><comment><USER30> Not a fan of wine in general, it's too sweet. Even the dry ones.

<comment><USER31> Poe's law strikes again. I honestly can't tell if this is satire. Entertaining either way on several levels.

</comment></comment><comment><USER32> I've had a lot of fancy bottles in a lot of fancy places, but all things equal, I've never tasted a good wine in poor company.

</comment><comment><USER33> Most wine I have in a restaurant is good. If they do a good job picking wines there shouldn't be a problem and you should trust their staff. If they don't have good wine selection I guess you could get a glass of wine from this thing, but it's probably a better idea to get something they do a good job of selecting. After all not much sense in trying to find the best wine in a beer bar.

If they don't do a good job selecting things then why are you there?!

</comment><comment><USER34> I want a WINE that runs all the Windows programs in Windows without a hiccup (Adobe Suite included) but then again as a HACKER WINE means Wine Is Not an Emulator.

[https://www.winehq.org](https://www.winehq.org)

<comment><USER35> But does WINE scale out smoothly?

Can you find staff who know how to work with WINE, once you land that fat VC series A check and are ready to hire?

And can anyone afford WINE in the Bay area, given the housing situation?</comment></comment>


Tofu – Twitter bot - <AUTHOR> http://tofuproduct.net/ <comment><USER2> Without viewable source code, or a solid explanation of the algorithm at play, this feels a bit like the Turk.[1]

[http://en.wikipedia.org/wiki/The_Turk](http://en.wikipedia.org/wiki/The_Turk)

<comment><USER3> I'm not so sure it works well enough for us to be at all suspicious of that...

I just got my tofu tweet: "As a few words. rocking wearing? I injured my syntax highlighting =D? I gotta!"

</comment></comment><comment><USER4> I made a very similar bot a few years ago. [http://twitter.com/markovator](http://twitter.com/markovator)

</comment><comment><USER5> Um.. so Tofu just seemed to snip a few words from my recent tweets, and string them into nonsense: [https://twitter.com/tofu_product/status/409054279328993280](https://twitter.com/tofu_product/status/409054279328993280)

<comment><USER6> It seems like a simple generator like [http://www.wisdomofchopra.com/](http://www.wisdomofchopra.com/)

</comment></comment><comment><USER7> How is something like this made? What's the math going on behind the scenes?

<comment><USER8> These kinds of systems almost always use an n-gram model to generate text. It's a fascinating and surprisingly effective tool (the surprise is that implementing one is extremely simple).

Basically, it's based on collecting data from a corpus about probabilities of word transitions -- the probability of the "next word" given the n preceding words. So n-gram models often produce sentences that appear correct in small areas of a few words, but as a whole don't make much sense. The higher the "n", the more the generated sentences come to resemble the writing in the corpus. Once you get to quadrigrams, usually the model simply produces exact sentences verbatim from the text because the data becomes very sparse (how many times do you see "then I turned" in a corpus of tweets, for instance?), unless you have a very large corpus.

Like many NLP models, the n-gram model has seen many variations and tweaks that have differing levels of effectiveness, where often different tweaks produce more believable results for different corpora or variety thereof.

The math is quite simple. Let's take n=2, also called "bigrams", also called "Markov chains". In Pythonic pseudocode (because math notation doesn't work on HN) you could create a frequency distribution with:

      for i in range(1,words.length):

        model[words[i-1]][words[i]] += 1

assuming that "model" is a nested dictionary where keys have a default value of 0. then normalise:

      for prior,words in model:

        n = sum(words.values)

        words.values.map(lambda x: x / n)

<comment><USER7> Thanks! I'm taking an information retrieval course right now and I'm interested in applying what I've learned to a cool pet project. I don't think we ever touched on n-gram models for some reason

<comment><USER9> This isn't information retrieval. This is data processing. Information retrieval is a subset of data processing.

Retrieval specifically needs an algorithm to determine document relevance. Everything you're learning is to understand how different parts of that algorithm affect the results. It's a very difficult problem, even if you assume that the corpus isn't sapient.

Stuff like n-grams are more about reshuffling in order to expose patterns. It's a little bit like regressing some noisy data to see the trend of correlation.</comment></comment></comment></comment>


Amazon soya and beef exports 'linked to deforestation' - <AUTHOR> https://www.bbc.com/news/science-environment-53438680 <comment><USER2> I always feel like I have to point out that something like 80% of soya world wide goes to animal feed(I think the oil may be extracted first as well).

</comment><comment><USER3> Here's an interesting thought experiment for meat-eaters:

Why not stop eating beef?

your response might be a knee-jerk "but I really like it!". Everyone knows the huge environmental costs we are responsible for when eating meat. But it's really interesting to pursue the tension in your own personal logic-brain vs lizard want-it-brain.

I've stopped eating most refined sugar and massively cut down on meat in the past few years. But the mental battles I had with myself in the process were surprising.

<comment><USER4> The problem is the availability of vegetarian / vegan meals in western society. Sophisticated food culture revolves around meat. It requires planning and work (in addition to dealing with the lizard brain).

In particular, as a gym-goer I want my protein, and if soya is out too, then it's quite a bit more difficult. Excuses, I know.

<comment><USER5> How many calories are you eating daily and how many grams of protein? Unless you're a bodybuilder at the end of a cut it wouldn't be very hard to get enough protein on even 2000 calories. I know this because I'm a large, military serving man who has been full vegan and now chooses to eat vegan where possible.

The big loss is food culture. It revolves around meat and animal products.

<comment><USER6> I've looked in to eating more non meat meals. What I struggled with is getting the macros right.

For example to hit 190g of protein a day, eating vegan my carbs would be way up compared to my current diet. At the moment I'm trying to drop body fat and from dexa scans/metabolic test they recommend I keep my protein high, increase fats and try to reduce carbs. I've tried doing the macros on a few vegan recipes but struggled to get the numbers right without increasing calories which I can't do when trying to drop body fat.

When I have more flexibility in calories i.e bulking some of the vegan recipes look quite good as calorie dense when you add beans, lentils, nuts, oils etc. I reckon I'll do better on this than when I was eating 5kg of beef a week as the dexa scan then was terrible with high visceral fat.

<comment><USER7> From a quick search, common dietary recommendations for protein seem to be 0.8g to 1.4g per kg bodyweight per day. 190g per day would likely be way more than most people need, being that both a) a lot of people weigh less than 190/1.4 (much less 190/0.8) and b) a lot of people won't need more than the standard dietary requirements of protein.

Definitely seems like you're not in at least one of these sets, though, so definitely not going for a "I know more about a healthy diet for you than you do", because hahaha no I don't. Mostly just posting to emphasise to casual readers that they (likely) don't need to target 190g protein per day.

<comment><USER6> Yes, I do strength training and also trying to cut body fat.

I'm on 2.5g protein per kg body weight which is high as I'm trying to maintain muscle while on a calorie deficit.

If I didn't need to be in a deficit on lower carbs it does look like I could achieve the macros I need from vegan meals. It's not I need 190g protein right now, it's I need to aim for 190g on about 2300-2500 calories with a bias towards gaining those calories from protein/fats. Hitting 190g protein would take me above 2300-2500 calories due to the amount of carbs consumed from vegan protein sources.

</comment></comment></comment></comment></comment></comment><comment><USER8> well, otherwise it would get expensive pretty fast with rainforest soil. I mean, you learn this in highschool around here (rainforest soil=most often bad for agriculture, so one must take means to mitigate that → one must move the crop...), so what do people expect?

</comment><comment><USER9> Personally, I take my proteins in lentils. And yeast.

I completely cut my soya some times ago on health considerations: phytoestrogens and poor fat quality of soya.

<comment><USER10> Why are you afraid of phytoestrogens? they are lowering estrogen levels and don't affect testosterone.

<comment><USER9> I admit it is only a speculation, but I made a link between the phytoestrogens and some health problem I had.

I had a scare with a autoimmune problem, but luckily it was benign. However I learnt that estrogens weaken the mechanism by which the body learns to avoid fighting itself, and that it was explaining why women had a lot more of some kinds of autoimmune diseases than men. And the missing puzzle piece was when I understood that my autoimmune problem started a few years after I discovered Japanese food culture, and as I had always been in fond of soy drinks, soy creams, tofu, etc, when I was in Japan I was drinking/eating/dreaming soy every meal of every day (this for a few years).

Are you sure about they are lowering estrogens level?

To draw you the picture, I was drinking tonyu (soy drink) all the time so there always was some in my stomach (except when I was sleeping). Maybe the mechanism by which phytoestrogens lower blood level estrogens works only when you give it time to overcompensate after your last intake.

<comment><USER10> You can read about estrogen lowering effect of soy milk here (studies included) - outline.com/5UkBSS

<comment><USER9> Thanks a lot! :) My fear is gone.

After reading the article, it turns out not all phytoestrogens have this estrogen-lowering property: this is a particularity of soy's phytoestrogens.

Beer for example has different phytoestrogens and they are not good.

</comment></comment></comment></comment></comment><comment><USER11> I think the title should be 'Brazilian soya and beer exports linked to deforestation' because surly ALL amazon exports of soy and beef would be linked to deforestation.

</comment><comment><USER12> Is this even news? It's been known for at least 40 years.

</comment><comment><USER13> Interesting

</comment><comment> quixoticelixer- Water 'linked to wetness'</comment>


The Deep History of Email Scams (2013) - <AUTHOR> http://theappendix.net/posts/2013/10/the-deep-history-of-email-scams <comment><USER2> Back in 1993, my family computer business in Pittsburgh received a 419 scam physical letter actually mailed from Nigeria. It was hand written, hand placed stamp, and mailed to our company PO box. I found it fascinating, kept it for several years as an intriguing item. I can only assume they had sent out hundreds to businesses listed in the phone book. We certainly didn't have a website yet in 1993.</comment>


Actionable Ways To Get Startup Ideas - <AUTHOR> http://christopherdbui.com/post/2013/10/25/Actionable-Ways-To-Get-Startup-Ideas.html <comment><USER2> I've never met a successful entrepreneur who sits around trying to come up with business ideas. At the risk of sounding negative and grumpy, groan. Another one of these blogadoodoos. What follows is my $.02, some might disagree.

From what I've seen it goes "I have experience in this area" -> "Wow there are under-served market needs here" -> "I have some relevant experience to start a company that addresses it and can attract talent" -> startup.

Not "I'm a wannabe entrepreneur" -> "I have no domain specific expert knowledge" -> "let's randomly find something we guess people care about and overspecialize" -> start coding blindly or find a Rails dev on Odesk. Seen that one fail innumerable times.

One other thing. If you have to go searching for ideas, you probably have no business experience. Let's say you manage to find a good idea using something like the techniques of this blog post. You manage to secure some funding. The startup starts to do well. You then become a sitting duck to be ejected by your investors, as you've built the product, but are inexperienced in business, and they specifically will want you out for that reason.

An exception to this is incubators like Y Combinator, who are more concerned with team chemistry than idea. If they weren't buying the concept but want to give you a shot, they might stick your team on an idea other than yours. But they probably already have an appropriate idea in mind, they don't have to go hunting.

Another possible exception is Stanford MBAs, specifically.

So much advice on blogs. Be careful.

<comment><USER3> >>Not "I'm a wannabe entrepreneur" -> "I have no domain specific expert knowledge" -> "let's randomly find something we guess people care about and overspecialize" -> start coding blindly or find a Rails dev on Odesk. Seen that one fail innumerable times.

What kind of domain specific expertise did Mark Zuckerberg have when he wrote Facemash (Facebook's predecessor)?

The answer is "none." It was a pure hobby project - he didn't even plan on monetizing it. Yet here we are.

<comment><USER4> I don't really agree with your domain knowledge point - he was a college kid and it was aimed at college kids.

</comment></comment></comment><comment><USER5> The only upside to "looking for startup ideas" is that it is better than sitting and doing nothing or watching 13 episodes of house of card on netflix for example. The key is to not commit to an idea that was generated in this essentially random manner. Treat such ideas as "projects" where your main objective is to learn. Perhaps do a few in parallel. Experience naturally follows and then real ideas can spring forth. The mistake is to "come up" with an idea and then blast full steam ahead when there is no basis for real conviction.

</comment><comment><USER6> You don't ever seem to find startup ideas. Startup ideas seem to find you. That's why it's important to always be listening - if you listen often enough then problems will "appear out of nowhere" and you'll be in a good place to understand their potential.

<comment><USER7> I thought the author made a good point though, actually said what you're saying. This is just if you are in a pinch or need to pivot. I thought it was a good article, wish he had written a little more,

</comment></comment><comment><USER8> What's the difference between "Actionable Ways" and plain "Ways"?

<comment><USER9> ac·tion·a·ble ˈakSHənəbəl/ adjective

        1. giving sufficient reason to take legal action.

        2. able to be done or acted on; having practical value.

Up until about 10 years ago, it was nearly exclusively used in the first sense. The second sense was popularized by pop-business gurus promoting with proactive dynamic enterprise synergistic actionable best-practices...

<comment><USER10> Yep. I still laugh at the 2nd usage. When I went to school this headline would have meant "Ways to get sued getting startup ideas".</comment></comment></comment>


TI, ST-Ericsson share their mobile SoC strategies - <AUTHOR> http://confidential.eetimes.com/news-updates/4233772/TI--ST-Ericsson-Mobilize-for-Mobile-SoCs For $4.99 get a glimpse into the thinking of two players in smartphone and tablet chips, courtesy of EE Times Confidential <comment><USER2> So...after reading this piece, i realize that I was wrong, thinking that all the ARM-based apps processors for smartphones are more of the same...

</comment><comment><USER3> paywall :(</comment>


Who should I follow on Twitter? - <AUTHOR>

Hey guys,
I want to start using Twitter as a means of finding good web software content. I'm a big javascripter. Love reading about interesting new frameworks/libraries/tools, opinions on why things are sucky/awesome, or general how to become a better engineer style articles. I mostly use HackerNews and Flipboard for finding content. An example of someone on Twitter that is posting relevant material is David Walsh. Love the stuff he tweets.
So, my question is: who are some great Twitter users for filling my feed with interesting web content? <comment><USER2> Here's the twist: The big names in JS that are on Twitter almost never tweet about JS. They usually rant, like normal people.

Here's some names:

\- Douglas Crockford (grandfather/Chuck Norris of JS)

\- Nicholas Zakas (Scalability and maintainability)

\- Addy Osmani (Modularity, Material Design)

\- Paul Lewis (Performance)

\- Paul Irish (Chrome, HTML5, performance)

\- John Resig (jQuery)

\- Pete Hunt (React)

\- David Nolen (ClojureScript)

\- Christian Heilman (Firefox)

If you're into frameworks, I suggest you follow framework accounts. If you're into vanilla JS, then you're better off following the DevTools and alpha build accounts (Canary, Aurora, Beta) since they usually tweet about new APIs and tools.</comment>


Reasons to love SQLAlchemy - <AUTHOR> http://pajhome.org.uk/blog/10_reasons_to_love_sqlalchemy.html <comment><USER2> One of the best things about SQLAlchemy is SQLAlchemy Core in my opinion. It is the layer on which SQLAlchemy ORM is built. There are often times when an ORM is overkill or when you really just want a lot of control over your SQL or you just don't want to learn yet another ORM and just want to write SQL with the added advantage of it being safe, easily composable and which can be passed around as Python objects.

So if you are thinking about using SQLAlchemy you should make a conscious decision whether Core or the ORM are better suited for the problem at hand.

<comment><USER3> The core is a killer feature for sure, and essential in some cases. With a bit of pre-planning it doesn't need to be an either-or proposition though.

<comment><USER2> Good point. It's true that you can successfully use Core and the ORM in the same project. Since the ORM is basically just a higher layer of abstraction (and is cleanly separated), you can always drop down to Core, if that's required. You only have to be careful in some situations when you do something "behind the back" of the ORM, so that it doesn't get confused. But that's usually also pretty straightforward in my experience.

</comment></comment></comment><comment><USER4> SQLAlchemy really is great. Alembic (the schema migration toolkit) still lacks some functionality compared to e.g. the Django "South" package, especially concerning the handling of cyclic dependencies (where it just "bails out") and some things that are still not correctly implemented for various database backends (such as Enum fields), but apart from that it's a really really great tool. Recently I have used it to implement MongoDB query sntax on SQL which was not only possible using SQLAlchemy but even enjoyable (for those who are interested in running Mongo queries on SQL: [https://github.com/adewes/blitzdb](https://github.com/adewes/blitzdb) -> see feature/sql_backend branch, which is still not 100 % stable though).

What makes it especially amazing is that Mike Bayer has written 90 % of the code base by himself ([https://github.com/zzzeek/sqlalchemy/graphs/contributors](https://github.com/zzzeek/sqlalchemy/graphs/contributors)), which somtimes makes me wonder if he is a real person or just a pseudonym under which a group of talented programmers publish code ;)

<comment><USER5> Even more amazing, at the time Mike started SQLAlchemy, his day job was working in Java... So SQLAlchemy was a total side project. I don't know if that has changed.

Mike is a master.

<comment><USER6> I believe I read that someone hired him to work on SQLAlchemy full time.

<comment><USER7> I work for Red Hat in the Openstack group. I can spend part of my time working on SQLAlchemy upstream as it is a core component of Openstack. But we still take donations!! [http://www.sqlalchemy.org/](http://www.sqlalchemy.org/) :) :)

<comment><USER8> Hi man,

Do you plan on adding await/async support to mako ?

Cheers

</comment></comment></comment></comment></comment><comment><USER9> I'm pretty comfortable in SQL but I've found myself lazily reaching for SQLA recently to run queries that I would normally do in SQL. For example

        session.query(Thing1).join(Thing2).join(Thing3).filter(Thing3.name.like('%easy%'))

I'll be in the middle of firing up psql and then I'll think about writing out my joins and laziness wins out. For more complex stuff I normally go back to SQL, but mostly because I'm less familiar with constructing some of the more complex queries in SQLA (though I'm slowly pushing myself to learn more).

<comment><USER10> I use Ruby for the same thing, especially when it's spanning databases. Sequel+Pry are a pretty decent environment for quickly anlayzing, syncing and updating stuff. Maybe I'll have to take a second look at SQLAlchemy's query builder plus ipython/bpython...

In actual code, I'm actually pretty content with raw SQL (wrapped in Perl's DBIx::Simple these days), as I prefer to move the more complicated things to functions/views before constructing elaborate abstractions in-place. Complex ad-hoc queries are another issue, of course...

</comment></comment><comment><USER11> SQLAlchemy is great, but for those who are looking for something lighter, I highly recommend Peewee ([https://github.com/coleifer/peewee](https://github.com/coleifer/peewee)). It's a very well maintained alternative.

<comment><USER12> I haven't tried it, but the choice to include the entire application in one file is ... interesting.

[https://github.com/coleifer/peewee/blob/master/peewee.py](https://github.com/coleifer/peewee/blob/master/peewee.py)

<comment><USER10> Between that, bottle and maybe sqlite, you've got your whole setup in a directory without requiring modules, packagers etc. That can be a big boon for internal or embedded stuff, when you don't have total control over your environment.

<comment><USER13> I can't think of an example of when you would want "embedded stuff" running a webserver. Do you have any examples? (Not saying its not needed, but I am struggling to see where)

<comment><USER10> Maybe not the apocryphal Forth washing machine controller, but components used in automation often employ web servers for remote configuration and statistics. If it isn't a PLC (although there are some devices that basically mix a small embedded RT PC with a PLC). Connect to the device via ethernet, and the device then communicates with a machine through some kind of bus.

If you've got wifi/ethernet, configuration through web servers comes naturally.

</comment></comment></comment></comment></comment><comment><USER14> The wonderful ORM support in Python is one of the big reasons why we are working on a Python GraphQL implementation [1].

[1] [https://github.com/dittos/graphql-py](https://github.com/dittos/graphql- py)

<comment><USER9> Cool! I'm actually following along with that project to see how it goes. I'll see if I can find the time to even do something useful on it.

I did a bit of research into the Relay stuff but found it hard to find examples that explain the api/protocol clearly. So long as you were using the facebook libs you could follow the examples but I'm more interested in understanding the mechanics – do you have any pointers of where to look.

<comment><USER14> Relay is actually a pretty simple specification that sits ontop of graphQL. As far as the server is concerned, just look here[1]. Don't be alarmed if there's not a lot to read. There isn't much to the spec[2][3][4].

Also a great place to ask questions is in the GraphQL slack [5]. #python is where the discussion for the python port is happening.

[1] [https://facebook.github.io/relay/docs/graphql-relay- specific...](https://facebook.github.io/relay/docs/graphql-relay- specification.html#content) [2] [https://facebook.github.io/relay/graphql/objectidentificatio...](https://facebook.github.io/relay/graphql/objectidentification.htm) [3] [https://facebook.github.io/relay/graphql/connections.htm](https://facebook.github.io/relay/graphql/connections.htm) [4] [https://facebook.github.io/relay/graphql/mutations.htm](https://facebook.github.io/relay/graphql/mutations.htm) [5] [https://graphql-slack.herokuapp.com](https://graphql-slack.herokuapp.com)

<comment><USER9> Brilliant. Thanks for that - will start having a read through this evening.

</comment></comment></comment></comment><comment><USER15> I've been enjoying the Perl version as well: [https://metacpan.org/pod/DBIx::Class](https://metacpan.org/pod/DBIx::Class)

It has built in support for SQL::Translator: [https://metacpan.org/pod/SQL::Translator](https://metacpan.org/pod/SQL::Translator) which means you can call ->deploy() on just about any database.

<comment><USER16> DBIx::Class is amazing. I wouldn't think I'd work with a SQL db without it.

</comment></comment><comment><USER17> One of many things I love about SQLAlchemy (or could I say the data mapper pattern) is that it doesn't try to map the column of underlying schema one-to- one to the object model. This pattern allow for much more flexibility for building the object model compared to say, the active record pattern.

For example, in SQLAlchemy there is `column_property`[1] which allows me to do something like:

        class User(Model):
          id = Column(Integer, primary_key=True)
          first_name = Column(String(50))
          last_name = Column(String(50))
          name = column_property(first_name + " " + last_name)

Querying this model will yield the SQL among the line of:

        SELECT
          user.id,
          user.first_name,
          user.last_name,
          user.first_name || " " || user.last_name AS anon1
        FROM users;

This example may not seems very useful (and of course joining a string in the database is not very exciting), but the same pattern could also be used for doing subqueries with SQLAlchemy Core[2], e.g.

        User.post_count = column_property(
          select([func.count()]).where(Post.user_id == User.id)
        )

Which yields:

        SELECT
          user.first_name,
          user.last_name,
          (SELECT COUNT(*) AS count_1 FROM post WHERE post.user_id = user.id) AS anon_1
        FROM users;

How SQLAlchemy decouple the object model from the schema and only _map_ them after they are retrieved makes its ORM very flexible and powerful. Ability to easily building SQL is one thing, but how SQLAlchemy is designed to allow me to embrace SQL when necessary rather than trying to hide everything away from me makes me really love it.

[1]: [http://docs.sqlalchemy.org/en/rel_1_0/orm/mapping_columns.ht...](http://docs.sqlalchemy.org/en/rel_1_0/orm/mapping_columns.html#using- column-property-for-column-level-options)

[2]: [http://docs.sqlalchemy.org/en/rel_1_0/core/tutorial.html](http://docs.sqlalchemy.org/en/rel_1_0/core/tutorial.html)

<comment><USER18> In this example, if you select a user object "Bob Smith" and then set first_name="Jim" but haven't flushed yet, will name be "Bob Smith" or "Jim Smith"? I haven't worked much with column properties but based on how unflushed relations+foreign keys work, I'm guessing it'll still be "Bob Smith"? With a normal @property it would return "Jim Smith".

<comment><USER17> Yes, in that case it would still be Bob Smith.

</comment></comment></comment><comment><USER19> I've been using SQLAlchemy for some time now. I found two things that are just great:

1\. sqlacodegen ([https://github.com/ksindi/sqlacodegen](https://github.com/ksindi/sqlacodegen)) - Creates a single Python file with the SQLAlchemy model from your existing database.

2\. Bulk inserts:

new_people = []

for person in list_of_new_people:

        new_people.append({'name' : person.name, 'age' : person.age })

People.__table__.insert().values(new_people)

I've prototyped databases in under 30 minutes using the combination of:

1\. MySQL Workbench for design and database creation

2\. sqlacodgen to create SQLAlchemy Python model

3\. SQLAlchemy's bulk insert to populate the database

</comment><comment><USER20> Postgres + SQLAlchemy + Flask + Flask-Restless -> one-page CRUD Restful API

<comment><USER3> I've had a better experience with Flask-RESTful, even though it also obviously needs a lot more work. Did you happen to compare the two?

<comment><USER9> I'd be interested in hearing other peoples' experiences too. I've tried both flask-restless and flask-restful previously but didn't get along with either of them.

I recently created a new API and went for a very simple flask.Methodview along with Marshmallow [0] for (de)serialization. I then wrote a simple replacement for marshmallow-alchemy since it wouldn't do object loading without a lot of flapping about.

I found Marshmallow really nice to work with (I'd been using Schematics in the past).

[0] [https://github.com/marshmallow- code/marshmallow](https://github.com/marshmallow-code/marshmallow)

<comment><USER3> I've taken to using an intermediate 'service' layer (in the parlance, but not structure, of overholt) to manage metadata on fields and inform serialization. It looks a bit like Marshmallow, but baked in as a Flask extension.

I've been kicking around different approaches to this for over a decade, going back to Castor (Java data binding), and with Python, SQLAlchemy, and the libraries mentioned here I'm finally feeling optimistic.

Request parsing in Flask-RESTful seems bolted on, and the fields in WTForms seem frustratingly redundant given that almost everything I do is going through the API anyway. Maybe focusing more on the Fields themselves will help tie it all together.

</comment></comment></comment></comment><comment><USER21> I keep telling Rubyists how much greater Alembic is than ActiveRecord::Migration. If there's a side by side comparison that would be great to know about!

<comment><USER22> I'm a happy user of ActiveRecord::Migration, so I'd love to read that comparison. What do you keep telling the rubyists :)?

<comment><USER21> It forces you to resolve conflicts.

Two developers create a migration on the same day, but they get merged later. Alembic stops you and ask which goes first. ActiveRecord::Migration runs them both. This is particularly bad when one migration is a table drop and another is an add_column on the same table.

And that's just one short coming. Our monkey patched ActiveRecord::Migration doesn't do this (yet), but we've done quite a few other improvements to it.

Another significant difference is the migration generation. Once you've generated migrations with alembic, it's hard to tolerate anything else.

</comment></comment></comment><comment><USER23> I don't know if SQLAlchemy is unique among ORMs for this, but it seems to that it cleanly, and extensible abstracts SQL. At my previous job, our other programmer (who had more experience in Java than Python) was able to implement a soft-delete feature in a couple of days.

</comment><comment><USER24> constructing queries in python is one of the disadvantages of using ORM. It takes away all the sql power that a DB can give you. Not to mention the magic that goes behind constructing the query that could be written in a more optimized way.

.join.filter.like.order_by etc.. is crazy imo. It's often more complicated than that and doing it in a non-sql way is suboptimal/unmaintainable.

<comment><USER25> >" _It 's often more complicated than that and doing it in a non-sql way is suboptimal/unmaintainable._"

It's also more composable, if you ask me. I like to think of it like "building" SQL statements using smaller components. Just like you do with code, you essentially compose a complicated business process using smaller blocks.

It's beautiful in it's simplicity. Even if the syntax requires some extra work/learning.

<comment><USER9> I've just been using this to my advantage on a system I'm working on.

I've created a bunch of base queries that map from my user account table to each different table that users have access too. I can then use these base queries as a starting point to make sure people don't access records that don't belong to them.

        bq = db.query(Obj).join(ParentA).join(ParentB).join(User).filter(User.id==bindparam('user_id'))

        q = bq.filter(other_rules).params(user_id=1)...

It's a really flexible system.

</comment></comment></comment><comment><USER26> Just to clarify on why people generally dislike ORMs (I think): at one point you find yourself struggling with the abstraction (the ORM) to get at some features that the underlying database engine might allow, or even worse using the abstraction incorrectly, and creating highly inefficient queries. ORMs are often mixed with for loops to bad effect.

They obviously have great value for CRUD applications however, and they prevent you from making mistakes that others have encountered (and fixed).

That said, I really want to try out the Postgres + SQLAlchemy + Flask + Flask- Restless (as mentioned by others) combo. I usually end up writing my own queries

<comment><USER3> Concerns about the SQL that SQLAlchemy generates are usually referring to the most basic use of the ORM. The real strength of the framework is that you can build complex queries directly, yielding optimal SQL, without resorting to plain text manipulation. This approach is actually most helpful as applications grow beyond straightforward CRUD operations.

<comment> X-Istence Not only that, but you can write your optimized queries, and still use the ORM. So you can get the best of both worlds.

<comment><USER3> Absolutely.

</comment></comment></comment></comment><comment><USER27> How does SQLAlchemy compare to the Django ORM (if it would be a stand-alone package, which it sadly isn't)?

<comment><USER28> Things that I've used in sqlalchemy that(by a quick search) aren't in django (as far as I know):

        composite primary keys
        complex indexes (functional etc)
        arrays + json(these are in django, but I think only recently and before that in contrib)
        server side cursors
        the non-orm part(the lower layer)
        sqlalchemy-alembic (also in django, but only recently I think, still probably less features)
        server_default (define a default value for a column that will be applied to the sql-schema and not just model.field)
        more customization to the lower level db driver(psycopg2, maybe this is also supported in django)
        Use the models + library outside of your web app (ex: in several non-request-serving processes )

There are alot more features that I haven't used/don't know/didn't need.

<comment><USER29> A few minor points:

1\. Django's built in migrations are essentially South 2.0 and a poster above implied that South was more featureful than Alembic. I couldn't say for sure.

2\. "Use the models + library outside of your outside of your web app" \- not sure why this can't be done with the Django ORM? I use the ORM for many background and batch tasks

It would be interesting to know What SQLA afficianodos think of the new goodies in Django 1.7/1.8:

[https://docs.djangoproject.com/en/1.8/ref/models/conditional...](https://docs.djangoproject.com/en/1.8/ref/models/conditional- expressions/)

[https://docs.djangoproject.com/en/1.8/releases/1.8/#query- ex...](https://docs.djangoproject.com/en/1.8/releases/1.8/#query-expressions- conditional-expressions-and-database-functions)

[https://docs.djangoproject.com/en/1.8/releases/1.7/#custom-l...](https://docs.djangoproject.com/en/1.8/releases/1.7/#custom- lookups)

Obviously the main reason to love the Django ORM is it's tight integration with Django but I think nowadays it's rather undeserving of it's "SQL Alchemy's poor cousin" reputation.

</comment></comment></comment><comment><USER30> SQLAlchemy is black magic, and I love it. Over the summer for my internship I needed to implement a small database in the backend of my application, and using SQLAlchemy made everything crazy easy.

I'm a huge fan of this library!

</comment><comment><USER31> ASK SQLAlchemy Lovers: Flask or Django for a web app (not API)?

I'm building an app to facilitate more code giving to nonprofits, and help nonprofits move to the open source world. It will match GitHub coders to nonprofit projects based on skills, interests and other things. It will provide an interface for less-technical people at nonprofits, many of which can't afford tech salaries, to communicate needs and requirements. It will do as much as possible via GetHub (e.g. Pull Requests) so for coders there will be no added friction over the already low friction giving GitHub enables.

<comment><USER32> I've been using Pyramid for a few years: [http://www.pylonsproject.org](http://www.pylonsproject.org)

It's a pretty thin WSGI wrapper around a bunch of best-in-breed Python libraries including SQLAlchemy.

</comment></comment><comment><USER33> I love SQLAlchemy because I had formally learnt MySQL in high school and I never seemed to understand why I wouldn't use Excel instead.

SQLAlchemy + Python (preferably using Flask) and the Mega Tutorial by Miguel Grinberg is the best way to get started in web development. I realize every body has different methods that work for them, but not only did this work for me, it also was very well explained by Miguel and also as OP said, the documentation on SQLAlchemy.

It was sad to bid adieu to SQLAlchemy recently, as I picked up MongoDB (you should check out MongoEngine if you haven't!)

</comment><comment><USER34> What I like about SQLAlchemy is that it gives me a choice. I went with Core because I wanted the sense of security from building SQL queries with a library instead of out of strings.

Since the ORM wasn't forced on me, I was able to come around to it on my own. I've started to warm up to it recently even though I can't say I'm totally sold on it. The nice thing I can say about the ORM as of right now is that I don't feel like I'd be throwing away my core experiences to embrace it.

</comment><comment><USER35> Nice, exactly the same arguments can be said for Entity Framework.

<comment><USER36> Or Fluent NHibernate, which is just lovely.</comment></comment>