How do I modify a variable in Haskell? - <AUTHOR> http://www.michaelburge.us/2017/08/15/how-do-i-modify-a-variable-in-haskell.html <comment><USER2> Mr. Burge has written a nicely thought-out blog post showing an evolution of different ideas about how to write to an array in Haskell.

I don't want people trying to follow the evolution to get the impression that iterating and writing to an array is really hard in Haskell, so here is a complete Haskell program which

1\. Initializes a _10x10_ mutable array to _0_.

2\. Iterates in a for-loop from _0_ to _9_ , setting the diagonal to _1_.

3\. Freezes the mutable array to an immutable array and prints it.

      module Main where

      import Foreign.C.Types (CInt)
      import Control.Monad (forM_)
      import Numeric.LinearAlgebra (toLists) -- http://hackage.haskell.org/package/hmatrix-0.18.1.0/docs/Numeric-LinearAlgebra-Data.html
      import Numeric.LinearAlgebra.Devel (runSTMatrix, newMatrix, writeMatrix) -- http://hackage.haskell.org/package/hmatrix-0.18.1.0/docs/Numeric-LinearAlgebra-Devel.html

      main = do
          putStrLn $ unlines $ fmap unwords $ fmap (fmap show) $ toLists aImmutable
        where
          aImmutable = runSTMatrix $ do
              a <- newMatrix (0::CInt) 10 10
              forM_ [0..9] $ \i -> writeMatrix a i i 1
              return a

Output:

      1 0 0 0 0 0 0 0 0 0
      0 1 0 0 0 0 0 0 0 0
      0 0 1 0 0 0 0 0 0 0
      0 0 0 1 0 0 0 0 0 0
      0 0 0 0 1 0 0 0 0 0
      0 0 0 0 0 1 0 0 0 0
      0 0 0 0 0 0 1 0 0 0
      0 0 0 0 0 0 0 1 0 0
      0 0 0 0 0 0 0 0 1 0
      0 0 0 0 0 0 0 0 0 1

</comment><comment><USER3> I've tried to like Haskell, but when simple tasks start to look like complicated puzzles with many possible solutions, I get really put off. I want to get stuff done, not feel clever for managing to contort my algorithm into a different form whose runtime performance I'm uncertain of, all done merely in the name of avoiding a for loop.

<comment><USER4> It's a shame you feel that way. Modifying an element of an array in Haskell is easy and the blog post gives almost exactly correct code, but for some reason places it under the title "we run into trouble when we realize there's no built-in mutating assignment". But we don't run into trouble! Mutable arrays are provided in Haskell! Haskell has mutation! Here's the code

        import Data.Array.MArray
        import Data.Array.IO

        size = 10

        (!) = readArray

        main :: IO ()
        main = do
          -- 1. Declare the array
          arr <- newArray ((1,1), (size,size)) undefined
          let _ = arr :: IOArray (Int,Int) Integer

          -- 2. Initialize the array to 0
          sequence_ $ do
            i <- [1..size]
            j <- [1..size]
            return $ writeArray arr (i, j) 0

          -- 3. Set the diagonal to 1
          sequence_ $ do
            i <- [1..size]
            return $ writeArray arr (i, i) 1

          -- 4. Print the array
          sequence_ $ do
            i <- [1..size]
            j <- [1..size]
            return $ do
              arr_i_j <- arr ! (i,j)

              putChar $ if arr_i_j == 0
                        then '0'
                        else '1'
              if j == size
                then putChar '\n'
                else return ()

        > main
        1000000000
        0100000000
        0010000000
        0001000000
        0000100000
        0000010000
        0000001000
        0000000100
        0000000010
        0000000001

I've no idea why the blog post is written in such long winded style. Mutation in Haskell is not difficult!

<comment><USER5> But IO (or ST) style is also unidiomatic and simply too cumbersome. You are just not going to write "writeArray arr (i,j) k" instead of "arr[i][j] = k", and more importantly,

        v <- readArray arr (i,j-1)
        w <- readArray arr (i-1,j)
        writeArray arr (i,j) (v+w)

instead of

        arr[i][j] = arr[i][j-1] + arr[i-1][j];

No way you're doing that over and over again for any substantial performance- oriented code (where you absolutely need mutable arrays).

<comment><USER6> Doing this kind of effect sequencing in Haskell is annoying indeed. A radical library can mitigate that but that would be really unidiomatic.

Could be nice to have sugar like expr[!x] that expand to: x >>= \genName -> .. expr[genName] ..

So you could write: writeArr arr !(readArr ..) !(readArr ..)

Then if you add an operator to do the reading it becomes quite reasonable.

<comment><USER7> Well, you can add operators, though you almost certainly should think about more idiomatic solutions first, it's entirely possible to write operators to allow a statement like:

      arr .~ (i,j) .= arr ! (a,b) + arr ! (x,y)

You make orphan instances for Indexed and Num, and then .~ is just a slight tweak on the adjust function that Indexed provides and .= is literally a direct synonym for $ that just looks better in this context. This is actually more flexible than most languages, because now (arr .~ (i,j)) or (.~ (i,j)) can be named and applied to multiple things should that be desirable for some reason. Also note that this code is very weird, as arr is not an array, but an IO action describing how to produce one. Operations on it actually produce diffing instructions to be applied elsewhere. I have also not tested the performance.

These exact things are not in base because _they are discouraged_ and not supposed to be easy. Note that the lens library provides operators more or less just like this for a wide variety of data types, in a safe and composable way.

<comment><USER6> Taking IO actions just to do the bind for the caller goes against the benefits you usually get from purity.

</comment></comment></comment></comment></comment></comment><comment><USER8> isn't the whole point that you write code completely differently in functional languages? rather than writing loop code to populate an array, you'd do something like the following (in JS as I'm not a haskell programmer):

        const row = (len, onPositions) => {
            return (new Array(len)).map((item, index) => onPositions.includes(index) ? 1 : 0);
        };

        const matrixWithDiagonal = (len) => {
            return (new Array(len)).map((r, index) => row(len, [index]));
        }

the point being, that the code generates the result directly, rather than making space for values and then looping through toggling the positions that should be set to on.

note: you wouldn't really use the (new Array()) construct generally speaking (and it doesn't work with .map anyway) but it's easier than including underscore or ramda in the example.

<comment><USER3> The original example is just to try to find something where you need to modify an array. Sure, you can create identity matrices without modifying an array, but that's just changing the parameters of the problem. If you really do need to change an array, how do you do it in Haskell?

Your solution is the typical thing you do in Haskell. You might know how to perform an algorithm by modifying an array, but now you suddenly have your hands tied and you can't do that anymore. Now you have to come up with an alternative way.

It's like someone really wants to implement bubblesort in Haskell but instead the solution ends up being to implement quicksort because the bubbling is difficult or unusual in Haskell.

<comment><USER9> > If you really do need to change an array, how do you do it in Haskell? > ...It's like someone really wants to implement bubblesort in Haskell but > instead the solution ends up being to implement quicksort because the > bubbling is difficult.

You nailed it! As a math major myself, I completely empathize with this pov. The vast majority of languages present themselves as minor tools that can be used to solve your problem. The goal is to solve your problem, not figure out the tool. If I want to decompose a matrix via cholesky or schur or QR or LU or what have you, I just want to be able to set arrays willy-nilly without thinking so much about how to accomplish the same thing without setting the array. The Haskell way of "let's not really set the array, it's not what you want" which a bunch of comments have expressed here, focuses the attention on the tool, not my problem at hand. I honestly don't give 2 shits about your tool, whether you call it C or python or octave. I care about my problem, not your tool. So your tool should just stand aside, let me do my thing & not complain. That's exactly why the vast majority of applied researchers in math stick to matlab/octave or ml researchers to python or vision/robotics guys to c++ or insert your speciality here... In each case, the tool is one tiny minor part of the problem solving process. As a quant,I would worry about convergence of pde's and getting the term structure right - yes the whole thing is in c++ but I don't spend days and nights thinking about what does c++ want, I just care about the math. With Haskell, I do have to stop what I am doing and focus on the tool. The language says, lets think about a nice function composition that elegantly yields this transform without dirty mutation. I know such a transform exists,but looking for it is not my day job. Most applied math & applied ml work is seriously messy and highly imperative, for which such elegance is a mismatch, because of time constraints imposed by capitalism. If we were all working with plenty of free time, yes I could concoct the perfect elegant transform every single time, but I don't have that kind of luxury. Haskellers who advocate pausing a bit and rethinking the problem, solving a different problem instead, or expressing the computation recursively with function transforms etc. to suit their language are perfectly honest and right - it's just that I don't have the fucking time to do those things. So yeah, the language is great, but I don't get paid enough to rethink every dirty thing I do with these dirty imperative languages so that it becomes a neat elegant exercise I can marvel at. There is honestly not enough time in the world or money to compensate for the amount of time it would take to rework all the dirty mutable spaghetti that constitutes the majority of day to day work. We all try, but outside of textbook examples and a few select domains, nice fp doesn't scale. It's not a language issue. It's just the times we live in.

It's all quite sad, because when I was in school, I actually led a talk using John Hughes' famous fp advocacy paper, where I expanded his examples into finmath, but once you work in industry and see the frantic pace and general messiness of the code base, you realize even the second coming of Jesus Christ won't get us anywhere.

<comment><USER8> I think you're missing the point. The reason for functional programming isn't just that it looks pretty - immutable data makes state conflicts and shared data problems more explicit and forces you to handle them, function composition encourages designing small composable units that make coding faster as you go, that sort of thing. Functional programming tries to force you onto the more long-term-beneficial line on this famous graph: [https://martinfowler.com/bliki/images/designStaminaGraph.gif](https://martinfowler.com/bliki/images/designStaminaGraph.gif)

The ironic thing about the example you linked is that if you're trying to implement bubble sort and Haskell pushes you into quick sort, that's a _good thing_ because bubble sort is objectively incorrect. The oldest excuse in the book for bad design is that one does not have time, and while it is often objectively true, it's also true that good design actually saves you time in the long run. Awful spaghetti code is the fastest code to write but in a year's time when it takes a month to get a 2-point story completed because of all the hacks and //TODOs and workarounds you'll wish you wrote it right the first time.

<comment><USER3> I regretted using bubblesort as an example because the O(n^2) performance is not relevant to my point. Let's consider a Knuth-Fisher-Yates shuffle instead. Pretty easy to describe by mutating an array, and I don't think it's _wrong_ or pigheaded to implement it that way or that I'm just being too stubborn to see how great it is to implement it in a Haskell way.

<comment><USER8> I think the important point is that functional programming languages push you to immutability because it's a more sensible default. You can still write mutable code but the fact that code is always mutable in other languages can cause problems where none should exist.

</comment></comment></comment></comment></comment></comment><comment><USER10> If you want immutable data structures that simulate the behavior of mutable data structures look into Zippers. In this case, a list zipper.

<comment><USER10> For example, this problem of modifying the diagonal of a matrix can be solved quite easily:

      type Zipper a = ([a],[a])

      cursorOnDiagonal :: [[Int]] -> [Zipper Int]
      cursorOnDiagonal matrix = map (\(n,x) -> splitAt n x) (zip [0..(length matrix)-1] matrix)

      flipToOneAtCursor :: [Zipper Int] -> [Zipper Int]
      flipToOneAtCursor = map (\(ys,x:xs) -> (ys,1:xs))

      backToList :: [Zipper Int] -> [[Int]]
      backToList = map (\(ys,xs) -> ys ++ xs)

If matrix == [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]], then:

      backToList . flipToOneAtCursor . cursorOnDiagonal $ matrix == [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]

</comment></comment><comment><USER11> For those with access to another language, an alternate solution would be something like:

a = 1; a = 2;

Kidding. Really interesting write-up!</comment>


Your Platform Must be Compelling - <AUTHOR> http://www.jonmaddox.com/2011/09/05/your-platform-or-language-must-be-compelling/ <comment><USER2> I think this article is poorly named. If it were titled "Your API must be Compelling" it would make sense (but only as much as "if the sun is up it's daytime" makes sense).

The term platform is way overused and poorly understood.

When I think of a platform I think of something that enables a virtuous cycle of participation from 3rd parties.

A virtuous cycle will never be created if there isn't something in the mix that is compelling.

Very rarely (if ever) is the compelling thing the platform itself.

It is, instead, almost always some value proposition delivered to end users.

See my blog post on this subject here: "Be Either an App or a Platform" [http://ceklog.kindel.com/2011/08/24/be-either-an-app-or-a- pl...](http://ceklog.kindel.com/2011/08/24/be-either-an-app-or-a-platform-not- both/) (<http://news.ycombinator.com/item?id=2925566>)

Which got some discussion here: <http://news.ycombinator.com/item?id=2912794>

</comment><comment><USER3> Let me check this for MobileWorks platform:

Low effort, high reward: You can use MobileWorks' simple API to use humans to do some tasks for you which may not even be possible for complicated AI algorithms. So, check.

Enable multiple points of value for free The first 100 tasks are free. You can get a lot done with that. So, check.

Make it accessible MobileWorks is REST-based. Uses simple auth over https and no API key. So, check there too.

Tooting my own horn aside. I think it comes down to reward/effort ratio. If a programmer can get a lot of reward for limited effort that's great. It he can get little reward for no effort, that's good too. But high reward low efforts works well enough too. I think that's the only metric programmers look at.

<comment><USER2> I don't know much about MobileWorks other than spending 5 minutes browsing the website. But it does not appear to be a platform to me. It is a service. The value of the service is connecting developers to armies of humans who can do manual tasks. Developers pay MobileWorks for that value. Some part of that money gets passed onto the humans who do the work.

This is a service. Not a platform. There is no virtious cycle where multiple 3rd parties derive value from each other through the platform.

<comment><USER3> That's a great point and fairly accurate from a bird's eye view.

However, MobileWorks does much more than connecting developers and humans. MobileWorks lets developers define the tasks and then makes sure that the workforce comes to the right conclusion. In some manner it lets people negotiate on the answers. However, this is completely transparent to the developers. For a developer, it is more on the lines of 'call an api and get an answer'.

I think MobileWorks is closer to something like Heroku than to say AirBnB.

</comment></comment></comment><comment><USER4> I'm not so sure about this. Many platforms attract developers without being compelling.

</comment><comment><USER5> I don't see how the api key requirement will push devs away. If you have a simple ways to demo the api, like Facebook, Foursquare and YouTube all do, then it's easy to see the output you'll get. Assuming that happens, a key for tracking and preventing (serious) abuse seems necessary. Much harder to add security later as you'll break the apps from original ecosystem members.</comment>


Consequences of Tidal Dissipation in a Putative Venusian Ocean - <AUTHOR> http://urn.kb.se/resolve?urn=urn:nbn:se:uu:diva-384066 <comment><USER2> Skimming just the abstract:

> Consequently, an ocean tide on ancient Venus could have had significant > effects on the rotational history of the planet

The implication seems to be that we could answer whether Venus once had water, based on the orbital history of the Earth (over very long time frames), I guess?

<comment><USER3> I may be wrong but I don't think so. It is not suggested in the article. You'd need to know precisely how fast Venus was spinning when it had oceans. NewAtlas [0] interprets this as ancient ocean possibly being the culprit of Venus' extremely slow rotation period (~243 d.)

[0]: [https://newatlas.com/ancient-venus-ocean-slow-down- rotation/...](https://newatlas.com/ancient-venus-ocean-slow-down- rotation/59808/)

</comment></comment><comment><USER4> > The associated tidal torque is about 2 orders of magnitude below the present > day Venusian atmospheric torque

That never occurred to me before this moment, but of course the dense atmosphere would tend to exert some tidal drag. The above sentence indicates the atmosphere alone suffices to explain the slow rotation.

But that would seem to flat-out contradict everything else said here. The atmosphere, not the ancient ocean, is the explanation. What am I missing?

</comment><comment><USER5> I think a subtext here is that the moon has saved Earth from that fate.

Such a moon must be very rare, for rocky planets in the Goldilocks zone. There is a plausible argument that life would not have developed at anything like its pace, without.

That might resolve the Fermi paradox, unless warm gas-giant moons are common and not all bathed continuously in ionizing radiation.

</comment><comment><USER5> I would have titled it "posited", not "putative", I think.</comment>


The Con Artist Hired to Clean Ebola - <AUTHOR> http://www.buzzfeed.com/alexcampbell/how-new-york-city-hired-a-con-artist-to-clean-up-ebola

<comment><USER2> _The city says it is reviewing "this situation," but officials have defended Bio-Recovery's work cleaning Dr. Spencer's apartment. The company was hired because "they had the requisite skills in blood and body fluid assessment and cleanup,"_

When they say things like this, it's no wonder that people don't trust their politicians.

</comment><comment><USER3> From his mortgage scamming days:

 _He still fought his mortgage scam case, though in February 2012 a judge approved a request from his own attorneys to withdraw from the case. Those attorneys, the judge noted, said Pane had intentionally given them incorrect contact information._</comment>


Why does Apple habitually mistreat developers? - <AUTHOR> Writing iOS apps is hard - I've been there.  Every other day we see a story about an app being pulled from the store arbitrarily by Apple - yet again.  Sometimes we see Apple pull entire groups of apps (apps using the dropbox SDK?) without any notice, warning, or chance to make things right before the app is pulled.
People work LONG hours on these apps, and each great app makes Apple's mobile devices more valuable.
Apple's behavior toward app developers is simply RUDE.  There is no other word that describes their attitude.  It loses people both money and time.  Often Apple seems to remove apps because it plans to introduce a competing app at some later date... HOW IS THIS OKAY?  That is literally forced monopoly.
I realize this is Apple's private playground because they make the devices but this is NOT a way to treat any human being - much less humans who write code night and day for the devices that support that playground.
We need to wake up to this ridiculous treatment, and tell Apple that this has to change.
TLDR; I love building iOS apps, but Apple is treating developers like pawns on an unacceptable level. <comment><USER2> Apple's developer model for iOS is sharecropping. Wanting to develop for iOS is like wanting to farm in Mississippi in 1913. You can't buy title to the land, only rent it for whatever cut of the profits the landlord thinks the market will bear.

Historically, Apple has never pursued a B2B model for relationships and this translates into the current iOS environment. Apple treats iOS developers like any other consumers - it provides a small range of products, a single set of terms, and customer service commensurate with the price. It's a sound business model and leverages their core competencies.

Developers are a necessary evil in the pursuit of selling more hardware, not something about which top management is passionate - Cook is focused on logistics not making happy hackers.

</comment><comment><USER3> Apple isn't forcing anyone to develop for iOS. People have a large sense of entitlement these days-- if you're not happy with it make android or windows mobile apps! The thing is, developing for iOS is generally more profitable, and more fun due to the controlled and tight environment. That's why we're seeing reports of the Amazon app store being more profitable then Google play. The rules, guidelines, and even the pulling of apps is all for a reason. It generates the experience Apple wants it's consumers to have (and they're willing to pay for), and if your app isn't part of that experience then to bad! It sucks when situations like this happen, but you shouldn't feel like Apple owes you anything.

</comment><comment><USER4> > tell Apple that this has to change.

They've already ignored everyone else who has said this. What are you going to use to force them? Threaten to take your apps to the other iOS appstore? There isn't one. Threaten to not write apps at all? There's a pile of devs a little more starving than you, waiting in line to replace you.

<comment><USER5> I'm also an iOS dev, and I also love developing iOS apps, but you have to realize - you are a pawn in their game, where they stand between you and potential income.

<comment><USER6> "a pawn" is an overestimation here! In chess a pawn has a chance to become something more and with a much greater role. In Apple's enclosure there are no pawns, just cattle. They pull the yoke and maybe grazing something until Apple decides otherwise.

</comment></comment></comment><comment><USER6> I think that it serves you right. We all know Apple and it's values/philosophy/principles. You, like all Apple clients are asking for it and you should be grateful when you're getting it!

</comment><comment><USER7> So has this unfair treatment happened to you, Infinitivium? Anything that you can share to help clarify what went wrong?</comment>


Kommen – Schedule an Uber Ride - <AUTHOR> http://www.trykommen.com <comment><AUTHOR> Schedule an Uber Ride for later with the Kommen App.

</comment><comment><USER2> What is the price?</comment>


Ask HN: Understanding the Mystery of Adwords QS - <AUTHOR>

I'm not asking what goes into Adwords QS or why mine is always low. I just about have never had any success with any thing I've tried to advertise on Adwords.
But, I'm posting this question because of one main thing. I've come across a large amount of ads that rank very high (position 1-3 consistently; which means they much have a good QS), that feature landing pages with little to no text at all.
How could adwords possibly assign them a high QS for a page that is 95% images?
Examples: https://www.demandbase.com/signup_freetrial_a.html http://www.centraldesktop.com/l?sr=googs&sy=col_onl_np https://www1.gotomeeting.com/t/gg/online_collaboration-Broad/NAPPC/g2msem3 http://campaign.mindtouch.com/C/Download_MindTouch_Deki/4?copy=4
..you get the point <comment><USER2> The demandbase.com landing page is mostly pics, but they do have a lot of alt text for the pics, and decent meta data. They also have their phone number on the page, which Google is supposed to love.

The centraldesktop.com and gotomeeting.com pages seem to have plenty enough text on the pages for Google's bots to make quality assessments.

</comment><comment><AUTHOR> links

<https://www.demandbase.com/signup_freetrial_a.html> [http://www.centraldesktop.com/l?sr=googs&sy=col_onl_np](http://www.centraldesktop.com/l?sr=googs&sy=col_onl_np) [https://www1.gotomeeting.com/t/gg/online_collaboration- Broad...](https://www1.gotomeeting.com/t/gg/online_collaboration- Broad/NAPPC/g2msem3) [http://campaign.mindtouch.com/C/Download_MindTouch_Deki/4?co...](http://campaign.mindtouch.com/C/Download_MindTouch_Deki/4?copy=4)

</comment><comment><USER3> Maybe it is based on whether the user immediately pressed the back button or not.

<comment><AUTHOR> huh?

<comment><USER3> Maybe I understood your question wrong. What I thought you meant is "how can QS be so high, even though Google cannot parse the landing page because it is just images". So I assumed there must be some other factor besides landing page text which affects the QS, such as how long the user spent on the page.</comment></comment></comment>


Shipments of almonds, walnuts, and pistachios are being stolen in California - <AUTHOR> https://www.outsideonline.com/2186526/nut-job <comment><USER2> Nuts are very expensive by weight. Take shelled walnuts... those can be quite expensive. If I remember right an 18-wheeler carries about 50 metric tons of goods, so at $15/kilo for shelled walnuts that's $750,000 sitting on a truck that seems to be protected by a little $100 GPS tracker that can be easily disarmed.

$750,000 is a lot of money for a truck full of nuts. Even if you just skim 13%, that's a hundred thousand dollars. If you're selling consumer electronics, you attract attention. If the police see your car full of iPhones, or if they open a basement and find thousands of iPhones, that's suspicious. But if they see a basement full of walnuts? They'd just close the door and move on. Nobody suspects walnuts to be stolen unless you're actively looking for them. It's not as if the walnut farm can blacklist the walnuts' IMEI or something either. Just go around to a bunch of small, independent grocers and ask if they want to buy $2000 of walnuts for half the usual price.

Or, even more brilliantly, start an online walnut selling business. Grocers might turn you in for your obviously stolen nuts, but some random Internet walnut buyer? I'm someone who eats a lot of nuts and I have no idea how I'd even check if my nuts were stolen. What am I gonna do, call them? "Hello, do you sell stolen walnuts?" "Nope" "Ok thanks!"

<comment><USER3> > But if they see a basement full of walnuts? They'd just close the door and > move on

I mean, I think that'd at least lead to a casual question or two.

<comment><USER4> Likely dodge-able. One can, for example, play a nut "the world food supply chain is breaking up, GMOs are everywhere, etc. This makes me keep a few years' worth of calories in all natural foods close by."

<comment><USER2> Which leads me to my second favorite thing about nuts: calorie density! That shipment of nuts would have 327 million calories. Assuming you're 30, will live to 100, and eat 2,200 calories per day, you'll only consume 56 million calories in the rest of your life.

That shipment of nuts could be passed down in your survivalist family. First, it would be all the food you ate for the rest of your life. Then, your first child would be born and would start eating the nuts, continuously, until they died at 100 years old. They would have a child - your grandchild, and your grandchild would eat only nuts until THEY turned 100 and died (having a kid along the way.) Your grandchild's first kid would be born (your great- grandchild), start eating nuts the day they were born, have a kid, and die at 100. This final kid, your great-great-grandchild, would eat only nuts for their entire life, slowly whittling down the stockpile that lasted five generations. Eventually your great-great-grandchild would die in this basement, at the age of exactly one hundred years old like their ancestors, surrounded by the remnants of the one single truck of walnuts that their great-great-grandfather stole hundreds of years ago.

Nuts are insanely calorie dense. If you disaster-plan with a more conservative 80 year lifespan, are 30, and eat 2200 calories per day, you'll only consume about 6 metric tons of walnuts for the rest of your life. If you put that in peanut butter, which is (like walnuts) very calorie dense, you'd fit enough calories for the rest of your life into 5.5 cubic meters, roughly the size of a small bathroom.

(Not that the police officer would be likely to know the calorie density of walnuts, of course. Also, I love the pun.)

<comment><USER5> Nuts go rancid. Bad idea for a survivalist story. [http://ucanr.edu/datastoreFiles/234-2753.pdf](http://ucanr.edu/datastoreFiles/234-2753.pdf)

<comment><USER6> The almonds there last 10 months, long enough to grow and harvest some fruits/vegetables in a suitable climate.

Typical emergency preparedness guidelines suggest stocking food for maybe a week. What kind of scenarios are you preparing for?

<comment><USER5> I was following the parents fictional account that mentioned subsequent generations eating this shelles walnut stockpile.

</comment></comment></comment></comment></comment></comment></comment><comment><USER7> _...the Crain theft, along with similar heists in 2011 and 2012, ... were committed by people who appeared to understand the trucking business, identity theft, and computer security._

Pretty much the textbook example of an organized crime operation.

<comment><USER8> Meh, not necessarily. I used to be a truck driver (paid my way through college), and I know computer security well enough to execute some basic hacks, and I've read quite a bit about identity theft due to suspicion of an attempt made against me. I wouldn't say the right set of skills in a single person is common, but it certainly isn't so uncommon that it doesn't exist.

The bigger clue that it is origanized is that they've stolen 370,000 lbs of it. That is a huge amount of warehousing and movement...no way it could be done by one person. I'd be willing to bet they're working with a mid-size walnut farmer or distributor who can "launder" the stolen goods fairly easily into something that can be wholesaled without being obviously tracked.

The curious thing for me is that the trucks haven't been recovered. If I were doing this, I'd drop the trucks off at the side of a country road in the middle of nowhere. You can't really scam your way through a quick cash sale of a stolen tractor like you can with a Honda Accord, and driving it off to Mexico to be chopped adds a lot of risk to what seems like a relatively low risk operation.

<comment><USER9> What are the odds they just drive a truck full of nuts to Mexico?

According to [https://ops.fhwa.dot.gov/publications/fhwahop12015/ch2.htm](https://ops.fhwa.dot.gov/publications/fhwahop12015/ch2.htm) there is random inspection on the US side for theft and then random customs in Mexico. Prior to the US starting theft inspections, an insider on the Mexico side would make it work pretty well.

Another possibility is faking the identification and paperwork when picking up a shipment. Disappearing a fake truck is probably easier than disappearing a real one.

<comment><USER8> > What are the odds they just drive a truck full of nuts to Mexico?

Not very likely, but certainly possible. I don't see the advantage though (could exist, but I just can't think of it). I've never seen US theft enforcement and Mexico doesn't have border _controls_ like the US, but they do have traffic stop inspections and lead-based enforcement. Any box trailer can get stopped at any time and asked for customs documents and manifests. If you stay just within the Central Valley, you'll likely never get stopped, unless you're visibly overweight. And I'm not sure the market is there in Mexico...you'd probably end up re-exporting to the US where the documentation from the origin would have the same problem (how do we make it look like we grew this instead of stole it?).

</comment></comment></comment></comment><comment><USER10> I know someone who grows and processes walnuts. They own everything, the land, picked and cultivated the trees, bought equipment, hired workers, some on temporary (seasonal basis) some permanent. Apparently shelled and sorted high quality walnuts are pretty expensive and a good profit maker. Especially in the EU market. Or at least they were more expensive than I'd expect.

When they said how much a truck full of packaged shelled walnuts is worth, I also surprised they are not sending guards with those trucks.

<comment><USER11> Yes, a truck load of nuts is worth millions.

And it may be easy to steal. But it also takes a whole truck to run away with the loot.

<comment><USER12> And you need someone to unload it to (pun a little intended). I'm not sure how big the shelled nuts market is, they might know each other .

Interesting insight, though.

</comment></comment></comment><comment><USER13> "Boudreaux said nut theft had outstripped drug crime as his top priority and promised an aggressive investigation."

Looking on the bright side, at least the police actually have something useful to do for a change. Great article, BTW.

<comment><USER6> They have plenty to do pretty much all the time. But priority usually goes to the flashy cases (that would make the department look good/bad) or revenue collection (writing tickets etc.). [http://www.copblock.org/1250/police-and- priorities/](http://www.copblock.org/1250/police-and-priorities/)

</comment></comment><comment><USER14> >Several counties even ban the sale of nuts before harvest is complete, to discourage black-market sales.

Wouldn't that create a black-market for people who want the nuts before harvest?

<comment><USER15> Yeah this confused me as well. If they didn't ban it, then it wouldn't be illegal, and thus not a black market but just a 'market'

<comment><USER16> I think the idea is that it means that anyone selling before the harvest is doing so illegally, and the nuts are maybe stolen, because they couldn't be on the market legitimately. So if you were caught selling, you'd be subject to arrest. If there were no ban, it would be easier to fence stolen nuts.

<comment><USER17> I think it also prevents crimes of opportunity, since you'd have to hold on to the nuts until you could legally sell them.

So if you went to somebodies farm in the middle of the night and loaded up a semi, you'd have to stash that semi somewhere for a month rather that selling it the next day.

For a more urban example I live in a city and there are scrappers who driver around in pickup trucks all over. It is commonly known that some will steal things made out of metal from your yard unless it's bolted down. They also steal copper wire from building sites, etc.

Now generally by the time someone notices that the scrap is missing the person has already turned in their scrap for money. And if the police figure out who did it and where they took it, the evidence has already been shredded and mixed with similar metals.

If you had to hold on to scrap for a month before you could sell it, you'd be way more likely to catch people red handed.

</comment></comment></comment></comment><comment><USER18> A relatively homogenous, high-value good with minimal security controls? I'm honestly surprised that theft wasn't a problem long before this.

<comment><USER19> Probably the average criminal just didn't think of nuts as being particularly valuable (even though they clearly are).

Wasn't there a case in Canada a few years back where someone stole a huge amount of maple syrup? That stuff is pretty pricey, too.

Edit: yep, $18 million worth. They were caught, eventually.

[https://www.thestar.com/news/canada/2017/01/27/men- convicted...](https://www.thestar.com/news/canada/2017/01/27/men-convicted-in- quebec-maple-syrup-theft-should-face-stiff-penalties-crown-says.html)

<comment><USER20> Hard to off load 18 million of maple syrup.

<comment><USER21> Right, the natural barrier to a lot of these crimes is the difficulty of unloading that much product on the black market without attracting attention.

<comment><USER22> Organized crime won't have much problem, you mix it with other goods of the same type and offload them over a period of time.

<comment><USER23> Nuts go rancid.

<comment><USER22> 1+ years refrigerated, 2+ frozen.

</comment></comment></comment></comment></comment></comment></comment><comment><USER24> > he discovered that one person of interest in the case had cosigned a loan to > a Los Angeles County official worth $5 million.

Neat. Default on loan payments, cosigner picks up the tab.

Are the IRS on to this sort of stuff?

</comment><comment><USER25> Wisconsin has also had issue with cheese thefts in recent years:

[http://www.nydailynews.com/news/crime/thieves-46-000-worth-c...](http://www.nydailynews.com/news/crime/thieves-46-000-worth- cheese-wisconsin-heist-article-1.2695976)

[http://www.nbcnews.com/news/us-news/wisconsin-thieves- swipe-...](http://www.nbcnews.com/news/us-news/wisconsin-thieves- swipe-160-000-worth-cheese-n503526)

</comment><comment><USER26> Once autonomous trucking becomes ubiquitous, how often will these vehicles get hacked to just deliver their shipments to the criminal's warehouse directly? "Disrupting" organized crime by cutting out the middleman!

<comment><USER27> Redirecting the truck seems unlikely, but dropping a couple traffic cones in front of one in the middle of nowhere and calmly unloading it with no driver to hassle you will be a lot easier.

</comment></comment><comment><USER28> This was a surprisingly amazing lunchtime read. Very interesting and nut theft? Never thought something like that would fall into organised crime, this was a real eye opener!

</comment><comment><USER29> This reminds me of some bandits in my region that used to aim Saffron shipments and storages. Saffron usually costs more than 30/gram in a shop.

</comment><comment><USER30> With $0.5MM shipments going out wouldn't it be wise to bury some satellite trackers in the containers?

<comment><USER31> > When I visited Horizon, Squire told me that one processor, concerned about > publicity, tried hiding GPS trackers in its shipments instead of calling the > police. The company still lost two loads to thieves.

</comment></comment><comment><USER32> brain food so why not!!

</comment><comment><USER33> Interesting story.

Great web page design, I was able to read without a box popping up asking me to subscribe (which was available on the bottom of the page). No video ads.

<comment><USER34> Outside magazine has a lot of very high quality long form articles. I ended up subscribing to them since they do not nag, and produce a great product. I want to support sites like theirs.

</comment></comment><comment><USER11> Maybe this is an explanation for how the 45th president lost his nuts.

</comment><comment> brian-armstrong > In California, millions of dollars' worth of almonds, walnuts, and > pistachios are disappearing.

That's a lot of nuts!

<comment><USER35> This whole story is nuts</comment></comment>


Nashville is unexpected third-place winner in Amazon HQ2 - <AUTHOR> https://finance.yahoo.com/news/nashville-unexpected-third-place-winner-amazon-hq2-162152894.html <comment><USER2> I work two blocks away from where they're constructing the Nashville Yards complex that will house Amazon, and this is a huge disappointment.

That location was already in high demand, but according to the Tennesseean (our paper of record) the state and city promised Amazon $102 million to move in anyway.

We should let companies who want to invest in our city do so without competing for space against subsidized giants like this.</comment>


The Labors of Leisure - <AUTHOR> http://chronicle.com/article/Time-to-Imagine/149395

<comment><USER3> I think that leisure, perhaps, has the wrong kind of connotation with it.

I spend much of my own free time designing, writing and tinkering with things that I find interesting. To many of my coworkers, it appears that I am working, but to me it's working on something I enjoy—and more importantly things that other people may one day enjoy.

The challenge is to get more people to pick up an instrument, work on a new project, learn something new in their free time instead of starting at a television.

<comment><USER4> > _The challenge is to get more people ..._

Why do you think this is an important goal? If we really could have a world in which machines could do all the work, would it really be that bad if some people sat around and watched TV all day?

I certainly don't buy the argument that society would stagnate if this happened. There are many people - you and me are probably in that group - <USER2> probably _wouldn 't_ be able to sit around and do nothing all day. It just seems so _boring_. And if you look back in history, for example imperial England, a lot of the "idle rich" did take up the pursuit of art, science and technology.

I also really don't care what other people do with their time. First, there's a moral issue, it's not for me to decide how other people should be spending their time. And if some people want to sit around and watch TV all day, well, good for them. It's no skin off my nose.

I also know a lot of people who seem think that somehow "work" is noble and is worth pursuing as an end in itself and I really don't like this idea. It seems very analogous to management that values effort over results. And more importantly, if we dislike the idea of people being idle as a sort of moral hazard, then why isn't there a big backlash against the millionaires who've inherited their wealth, the royalty, the sheikhs of the middle east, the reality TV stars and so forth. A lot of these people seem to have money vastly disproportionate to their net contribution to society and they're able to sit around doing basically nothing. And yet it's only when the possibility of us plebs being idle comes up that we start here these cliches about hard work and dedication and so forth and everyone gets all worked up about it. Something to think about, I'd say.

<comment><USER5> >> The challenge is to get more people ... > Why do you think this is an important goal?

The purpose of banding together in communities is to provide better lives for those who join. At the most basic level, communities provide protection against predators (and other communities!). A more sophisticated benefit comes later with specialization of labor. Recently (the last 500 years or so) significant economic advantages have been had by members of larger communities.

So if physical needs are satisfied, why shouldn't a community concern itself with other ways to make its members happier and live more fulfilled lives? That might might include finding ways to encourage members to, as the OP says, learn instruments, languages, etc.

That requires us to assert that some things (art, music, kayaking) are better than others (reality TV, talk radio). I'm OK with that.

<comment><USER6> If you think that and other people you know think that, you should be free to voluntarily form your own community, protect yourselves, work hard and do the things you want.

But I'm not OK with your opinions of what activities are better than others and so I don't think it's fair for you to force it on others.

I'll take talk radio and TV over kayaking any day. You'll never get people to agree with all your thoughts. That's why we need to be free to form our own communities.

</comment></comment></comment></comment><comment><USER7> I think the article missed a step here... it spends a lot of time wondering why people would not want more leisure time, and spends time boggling at why people would be upset about having their hours cut.

Well... you know, as a journalist-type piece, did you consider going out there and, you know, _asking someone_?

Because all the answers that leap to mind based on what I've seen out in the world in my circle of acquaintance, which (as I don't live in the valley) is not full of computer programmers, pretty much make the piece an entire waste of time because it fundamentally misses the mark. The people complaining about not having jobs and getting their hours cut are not people who are all well- to-do and just working because "what the heck else are they going to do?".

It also boggles my mind that one could write an article like this without examining the question of marginal value of time... if one _is_ in the "leisure class" and has a job that pays $200/hour, when examining how much the person chooses to work one can't miss the fact that they have an option _to make $200 /hour_. It shouldn't be _that_ surprising that one might choose to work a bit more at that valuation.

<comment><USER8> > spends time boggling at why people would be upset about having their hours > cut

I don't think this is fair. From the original article:

> [...] the Affordable Care Act might result in millions of workers' scaling > back from full-time to part-time jobs.

The implication is that millions of workers would be _voluntarily cutting back_ their hours, since they no longer need to be employed full-time to get health care -- not that these workers would be having their hours cut. It's people like Rand Paul and talk-show hosts who are complaining complaining that _other people_ might start choosing to work less hours overall ("adding insult to injury").

If people who are currently fully employed choose to reduce their hours, that means more work is available for those who are interested in working more -- there's no conflict of interest here.

<comment><USER9> The implication is that people who used to have a full time position would now be forced to take a part time position. The ACA employer mandate only applies to companies with more than 50 full-time employees, incentivizing employers to have less than 50 full-time employees. The thought is that some companies around this limit will avoid the mandate by making a greater percentage of their employees be part-time.

That said, the employer mandate has been delayed until 2015 for companies with >100 employees, and until 2016 for companies with 50-99 employees.

<comment><USER8> Following the link through to the Politico article:

> Never mind that, reading the fine print, it's clear the CBO was talking > about workers voluntarily reducing their hours in response to the law—not > getting laid off or seeing their shifts scaled back. [0]

I don't mean to take a position on how the changes in health care law will affect employment; but I think it's clear that the article is talking just about the forecast of _voluntary_ reductions, along with the corresponding press.

[0]: [http://www.politico.com/magazine/story/2014/02/jobs- leisure-...](http://www.politico.com/magazine/story/2014/02/jobs-leisure- republicans-want-us-to-work-all-the-time-103282.html)

<comment><USER9> Ah, didn't realize that there was this dimension to the debate. Sorry for the hasty/inaccurate comment, and thanks for correcting me.

</comment></comment></comment></comment></comment><comment><USER10> During the industrial revolution, the goal of progress in technology (and machines to be more specific) was always to, one day, have no humans working to survive, but living lives and do whatever they want.

Progress in technology is now fueled by capitalism and better productivity rather that original goal and it's sad that people have forgotten that goal.... Society needs to continue push the chnage and accept to progressively give up their jobs to machines.

<comment><USER11> > During the industrial revolution, the goal of progress in technology (and > machines to be more specific) was always to, one day, have no humans working > to survive, but living lives and do whatever they want.

No, that's actually propaganda.

The goal was always to show those pesky, skillful, artisans their true place in society. The means was to embed as much as possible of their tacit knowledge either in machines or in soft, human, procedures/standards/rules/policies. Then, the owner class would go back to control all the means of production and have the destinies of their faithful serfs on their hands.

The fact that this process brought unprecedented prosperity was a happy side effect that nobody gave much thought at the time. Then the whole process was rationalized on those bases when the social sensitivities of the serfs became too self conscious.

</comment></comment><comment><USER12> "There is a bit of a contradiction, Hunnicutt admits, between the dream of leisure and preparing students for new business opportunities, but he believes that an experience industry might encourage a new paradigm. If better and better experiences are out there, there will be more and more demand for free time in which to enjoy them. "It's the good old-fashioned free market," he says. "I have no trouble with that. We are in the business of reawakening the American dream.""

I find this argument to be false in that I don't think people work long hours because they can't think of anything they would rather be doing.

I wonder if "work" hours are not shorter because culture dictates it, so many people shift their habits to surf the web (i.e. leisure activities) while at work. Not that they wouldn't rather meet with friends, paint a picture or whatever, but they can surf facebook from their cube.

<comment><USER13> > I wonder if "work" hours are not shorter because culture dictates it, so > many people shift their habits to surf the web (i.e. leisure activities) > while at work.

I think you're right and this is similar to what David Graeber wrote somewhere. In former communist countries, the working class people actually had more leisure at work, except they had to pretend they don't. This was probably part of the reason why these systems were so economically inefficient, compared to first world countries.

</comment></comment><comment><USER14> "In February he published an article in Politico celebrating a projection that the Affordable Care Act might result in millions of workers' scaling back from full-time to part-time jobs."

This would be great if it was voluntary! But if it's the result of employers purposefully reducing hours for their employees with the goal of dodging providing benefits, then it's a lot less awesome. Because that means that people are going to both make less money (reduced hours) AND have to pay for health insurance out of pocket (in the exchanges). It's a double-whammy that might cause people to forego coverage; the exact opposite effect of what was intended.

<comment><USER15> As I recall, that was based on the number of people surveyed who say that they work full-time solely because it gets them benefits.

</comment></comment><comment><USER16> Here's what I've observed, as a software programmer. We were supposed to get leisure with increasing economic growth. Instead we get waste and mismanagement.

There's a saying that 90% of work exists to correct other work. In software, that's certainly true. 90% of the work is maintenance, communication overhead, political positioning, and just plain cleaning up messes. 90% of the work is maintenance because almost none of the work is done right the first time.

We fill 8-10 hours, while little gets achieved, because we let The Business dictate terms (you have to use this language in which I could hire 50 mediocre developers tomorrow) and cause this arrangement in which most of the job is cleaning up crap.

So how have we compensated for the increase in productivity? Not by working less. Not by us workers being paid more more (which would, in the long term, given them leverage). Instead, the ones in charge spend this surplus on letting workplaces get monstrously inefficient. Perversely, this isn't great for shareholders but it gives a lot of power to the executives (principal- agent problem). By making work unnecessarily unpleasant, they get status and power over people, which they can use to advance their own causes, and take the lion's share of the profits from the past 35 years of technical growth.

<comment><USER17> That, sir, is OFFENSIVE. Not saying it's false, just that it's offensive.

I've enjoyed your rants, by the way :-)</comment></comment>


Ask HN: does scarcity lead to better design? - <AUTHOR>

Maybe it is a no-brainer, but I just thought about this while pondering the switch from Eclipse to Vim. On the one hand being used to an IDE, I am worried that I won't manage so well with complex tasks. On the other hand the problem might not be the development environment, but the programming language and framework (can't handle Java without IDE). So using a more restricted development environment (not saying Vim is, I don't know it yet), I would automatically aim for more simplicity and tractability in my code.
On a related note, if Oil had always been scarce, SUVs (epitome of ugliness, bad taste and atrocious design) might never have been created.
On the other hand, presumably one can't simply state "the more scarcity the better", there is some kind of sweet spot? <comment><USER2> This is something you have to figure out for yourself. As long as you are very aware of the things the IDE does for you, it does not necessarily end up in worse design. As for the opposite, using only a text-editor will not make your software better automatically. You have to find your own balance.</comment>


Ask HN: How fast can you go from idea to first line of code? - <AUTHOR>

Hey fellow hackers,
I'd like to know how fast you can go from a startup/side-project idea to its first line of code?
And what language, IDE, framework, tools, software, OS etc. you are using to do so?
Would be great if some of you could describe their workflow.
Thanks! <comment><USER2> That all depends on exactly what popped into my head. Let's say it's a pretty obvious idea that's almost fully formed, like "let's wrap a web form around OpenSSL so the support techs can make certificate requests". That comes together as a couple of blocks in my head.

One block is "have a basic FORM as the UI" - basic HTML, no big deal, easily done. The second block is "have something to handle the incoming POST data" - libraries I had already written, so again, no big deal.

The third block was "somehow pass it to OpenSSL and get back the data". This is where all of the unknowns lurked. I had to actually play with it to see if it had a reasonable way to be controlled by another program. It turned out that it could be done without too much trouble, and with that known, the third block was considered possible.

Finally, the fourth block would be to take the results and render them on the page returned by the POST handler. That's just a bit of HTML and other CGI magic - easy enough.

When the idea first comes to me, 1, 2, and 4 are fully-formed in my head, and 3 needs elaboration. A few minutes of poking on 3 convinces me it's possible, and thus with everything seeming reasonable, I start in on it.

Total time elapsed from "hey, we need this" to "hey you, try this thing I just wrote" was about 25 minutes. I only know this because it happened with a nicely timestamped chat log, and I worked backwards to figure it out.

That's not quite an answer to "how long until first line of code", but it does give you a window: under 30 minutes, if it's a situation like this.

As for the tools, back then: C, pico/nano, home-brewed CGI helper libraries, Linux, Apache.

These days, it's the same, only with (a specific subset of) C++ in place of C. I can elaborate on which bits if you really care. Use whatever language works for you.

Workflow is basically this: open two xterms or similar. Open an editor in the top one, write code. Open bottom one, use it to "make && ./prog". Open other windows as necessary for research or experimentation (like fiddling with the OpenSSL stdin hookup, reading man pages, etc).

The whole workspace (fluxbox) is nothing but terminals. Browsers and other stuff go off to another workspace. My chat window stays on another screen/system, and is sometimes hidden when uninterrupted cycles are needed for a short burst.

Hope this helps.

<comment><AUTHOR> Great answer! Thanks for your insights.

</comment></comment><comment><USER3> I don't think it's so much a matter of how fast CAN you go from idea to first line of code, but rather, how fast SHOULD you go from idea to first line of code. Starting writing code for an idea is often as simple as opening your text editor or IDE. So on the order of single to double digit seconds?

That doesn't mean that jumping straight into writing code is a good first step. Figuring out what you're building, why you're building it (is there demand?), how it will work from a user perspective, and how you will architect it, are often useful questions to answer before diving in.

</comment><comment><USER4> I think the question is not how fast you can go from idea to first line of code but how long until you find out that your ideas is worth a line of code.

That is an interesting question in itself and would start a whole discussion how easily you could test the feasibility of an idea without writing a single line of code.

</comment><comment><USER5> It really does depend on the idea, but I think a good rule of thumb is to try to have something in the hands of users between 2-3 months.

1\. Map put all the ideas for the product on paper 2\. Build a basic form of a UI through wireframes (Balsamiq etc.) 3\. Analyze the product roadmap and trim down the product features to something that is achievable in 2-3 months. 4\. Make two graphical layouts for the UI, one which should be as simple as possible, and one which is pretty to look. The reason is good design takes time and can often hinder the project. That is why a simple graphical layout is good to have while coding so that the basic functionality is there. 5\. Start programming towards the specific trimmed down feature set 6\. Make it pretty 7\. Rinse and repeat

</comment><comment><USER6> I usually spend time in a research phase. Writing out the main goals/ideas, writing pseudo-code, then actually coding. I find it works much better than the hack it all out approach, but takes a little longer before I actually start coding.

Many people don't like this because it takes some of the fun out of it. But, I usually end up with less re-writes and bugs in the end.

</comment><comment><USER7> The question should be: How good is this first line of code and for how long will it stay?

</comment><comment><USER8> I usually spend about a day considering my idea's merit, then I get started. I use ruby (I prefer Sinatra to Rails), on OS X, and Chrome as my browser. I use Sublime Text 2 as my text editor.

</comment><comment><USER9> Too fast. Concentrate on your marketing plan first; it's a crying shame if you let your talent go to waste on a failed project.

<comment><USER10> On the other hand, I've had a few projects where I spent a lot of time building up documentation and marketing presentations and by the time I got around to writing the code I realized that the project really had no legs. It's very easy to hype yourself up to create a project and convince yourself of everything it's going to do, but before you do you need to understand if the project will work out.

I've had a lot of "wow, I don't know how to implement this" or "this isn't nearly as interesting as I thought" moments. Marketing tends to focus on the best aspects of the project, getting down to coding it makes you understand the challenge you're actually facing.

</comment></comment><comment><USER11> cd projects

rails new myidea

cd myidea

rm public/index.html

git init

git add .

git commit -m"Initial Commit"

vim config/routes.rb

</comment><comment><USER12> (defclass idea () ()) ; 6 seconds</comment>


Gold will become "Reddit Premium" - <AUTHOR> https://www.reddit.com/r/beta/comments/9731n6/gold_will_become_reddit_premium/ <comment><USER2> I know that the gilding feature has been a major part of the Reddit culture and I can also understand that the rebrand now somewhat destroys that.

But dear god it's hard for me to comprehend how people get so angry about this stuff.

</comment><comment><AUTHOR> More: [https://www.reddit.com/r/changelog/comments/95z263/hey_rchan...](https://www.reddit.com/r/changelog/comments/95z263/hey_rchangelog_today_were_sharing_some_upcoming/), [https://www.reddit.com/r/changelog/comments/95z263/hey_rchan...](https://www.reddit.com/r/changelog/comments/95z263/hey_rchangelog_today_were_sharing_some_upcoming/e3zvg04/)</comment>


ISPA Withdraws Mozilla Internet Villain Nomination and Category - <AUTHOR> https://www.ispa.org.uk/ispa-withdraws-mozilla-internet-villain-nomination-and-category/ <comment><USER2> ...after Mozilla chickened out and removed the upcoming DoH default for UK users.

The ISPA is veiling this under the guise of caring about user freedom/control.

I want to like Mozilla but they keep on making decisions that undermine themselves.

</comment><comment><USER3> That they would even consider such a new technology as a "threat" is a laughable matter, and that they invoke children (i.e. by referencing content blockers) is pure alarmism. That DoH obsfucates DNS logs from the ISP is probably another red flag to their desire to collect data.

The problem lies in the fact that Firefox is a browser, not an OS, and that a savvy kid could bypass local DNS filters by configuring Firefox. But even if locked out of OS settings they could enable a web proxy or use a free whois tool and hope for http. Or, even easier: they could use public wifi.

While it would be nice for Firefox to add a child lock for this to appease ISPA, the Internet is interconnected and impossible to divide into sections. Technology is not a solution for social problems, and thus is a terrible replacement for a parent.

</comment><comment><USER4> You have to love how all their "thoughtful criticisms" of DNS over HTTPS have nothing to do with the things they cited in their nomination of Mozilla as villain. Their issue was explicitly "bypassing UK filtering obligations" not that load of flaming horseshit they just pulled out of their ass in response to the backlash.

<comment><USER5> Yeah, noticed that ;)

The UK's Internet authoritarianism is horrible enough. But the idea that an association of ISPs would support it, rather than just complying under duress, is bizarre.</comment></comment>


If You're Paying for It, It's Not Earned Media - <AUTHOR> http://adage.com/article/guest-columnists/paying-earned-media/291786/ <comment><AUTHOR> Favorite line: "getting enough honest, heartfelt, sincere and organically earned impressions that offer the necessary audience reach is a pipe dream for most brands"</comment>


OCaml for Haskellers - <AUTHOR> http://blog.ezyang.com/2010/10/ocaml-for-haskellers/

<comment><USER2> In addition to the mutable records mentioned in the post, arrays and references are also mutable in OCaml. Aside from objects, I consider this impurity to be the biggest difference in practice. Mutability allows simple OCaml solutions to problems that would otherwise demand monadic gymnastics in Haskell.

FWIW, I've also never been able to design a large project in Haskell (a la darcs), whereas I could write fairly large projects in OCaml without much awkwardness. I suspect the ability to "cheat" with mutability outweighs in practical terms the theoretical elegance and enjoyment of programming in Haskell.

<comment><USER3> "Cheating mutability" is trivial in Haskell. You import Data.IORef or Data.STRef and do your thing. (unsafePerformIO is just runST for "real world" actions.)

You'll find, though, that it's very easy to make a sequence of mutations become one pure operation, and the ST machinery lets you keep that sequence encapsulated. This is how building a vector works. In a new state thread, you allocate the vector. You run a pure function to generate the nth element. You bit-bang that into memory. When you're at the end of the vector, you freeze the vector into an immutable vector and return it. The final signature is "Length -> (Index -> Value) -> Vector of Values". Totally pure to the outside world, mutable internally. And the type system keeps the mutation part safe!

So while the first approach you try with Haskell should be actual pure code, you still have the tools you need to be as impure as you need to be. And you can still keep your program type safe, if you want.

<comment><USER4> It's most of the way there, but not quite. For example, one frequently wants to do a hybrid approach to mutability where construction of the data structure is destructive, but then further manipulation is persistent. ST-backed arrays will get you part of the way there, but there's no easy way to efficiently unsafely freeze (the unsafe coercion from mutable to immutable) recursive mutable structures into persistent structures. You have to very carefully make sure the internal representations match up, and it's tricky enough that it's not done very often. I guess my real point is there is a cognitive cost for respecting the fine distinctions that Haskell makes you think about, which discourages certain styles of programming, but is good for the mind. :-)

<comment><USER3> IORef is exactly equivalent to any other mutable variable.

If you want to write C in Haskell:

        import Foreign
        foo = mallocBytes 42 $ \p -> do
            whatever <- peek p
            poke p $ f whatever
            ...</comment></comment></comment></comment>


SpaceX and NASA detail cause of Dragon test failure - <AUTHOR> https://techcrunch.com/2019/07/15/spacex-and-nasa-detail-cause-of-dragon-test-failure-crewed-flight-this-year-looks-increasingly-difficult/ <comment><AUTHOR> I find it incredibly surprising how poorly written and edited this article is.

Here are two example sentences that have basic grammatical errors:

 _Crew Dragon designed to be the first crew-carrying SpaceX spacecraft, and is underling a number of test to prove its flight-readiness to NASA._

and

 _Koenigsmann explained that thanks to identifying burn marks around a check valve in the system that's meant to separate the oxidizer and fuel components under pressure._</comment>