Drone hobbyists find flaws in "close call" reports to FAA from other aircraft - <AUTHOR> http://www.usatoday.com/story/news/2015/09/13/drone-reports-faa-close-call-near-miss-academy-model-aeronautics-/72064388/?AID=10709313&PID=3836173&SID=iekr385peb0004o400dth <comment><USER2> I want to know more about this drone that was supposedly pestering an aircraft during firefighting operations. 10,000 ft altitude is quite high; if it was a quad-copter type thing, I've got my doubts that it could make it to that altitude at all, much less maintain that altitude for any length of time. I'm going to assume that anything flying higher than ~15,000 ft is a military drone, and the FAA using these particular sightings to cast aspersions at private individuals is dishonest. Including incidents involving drones operated by the police is also pretty sketchy. Media are parroting this crap uncritically; I hope more of them find some gumption and ask a question or two. I can see where drones are _potentially_ a problem, especially considering that they are only getting better/cheaper; but this sham-press release thing from the FAA appears to be scaremongering and it deserves ridicule.

Links to both the FAA's press release and the AMA's response in this AMA blog post.

[http://amablog.modelaircraft.org/amagov/2015/09/14/ama- respo...](http://amablog.modelaircraft.org/amagov/2015/09/14/ama-responds-to- the-faas-drone-sighting-report/)

<comment><USER3> There is some confusion in this particular case stemming from the difference between altitude above sea level and above ground level.

The UAV in question was spotted at ~10,000ft above sea level, but it was only about 800-900ft above the local ground level at the time.

<comment><USER2> There is no confusion. I assumed 10,000 ft above sea level. Starting at 9,000 ft doesn't help much. The air is quite thin at 10,000 ft; many small general aviation aircraft have difficulty reaching that altitude. Here is a YT video showing a few minutes of someone's drone flight allegedly at that altitude. It doesn't appear to me that sustained flight for any reasonable duration is possible with that particular drone, nor do I expect any/many other drones to perform much better.

[https://www.youtube.com/watch?v=WnnlAS5Zzfg](https://www.youtube.com/watch?v=WnnlAS5Zzfg)

<comment><USER3> Apologies, your phrasing "make it to that altitude" made me think otherwise!

Multi-rotors using BLDC motors cannot really be compared to small general aviation aircraft with infernal combustion engines.

"Reasonable duration" is a nebulous phrase. Some of the airframe configurations we use here couldn't manage more than about 10 minutes at 100ft, whereas others could quite happily carry a gopro at 10,000ft for 10 minutes (assuming it didn't have to climb from sea level!)

<comment><USER2> re: my phrasing, I did assume that the drone pilot in question started from a much lower (unknown to me) altitude.

>Multi-rotors using BLDC motors cannot really be

It's got nothing to do with the type of motor or fuel.

>"Reasonably duration" is a nebulous phrase. So

So is "quite happily carry". I'll admit that it appears that it's not impossible for such a flight, but I don't agree that any drone is "happily carrying" anything at that altitude.

<comment><USER3> Well I gave a payload (gopro, 350-400grams with gimbal) and a duration (10 minutes), I'm not sure what else to say! The aircraft was completely controllable with no memorable handling differences apart from a very slightly reduced response to high thrust demands, but as we fly our platforms for stability rather than speed it wasn't something that we really noticed.

<comment><USER4> The thing is, at 10,000' you have to move a lot more air in order to maintain the thrust necessary to stay at altitude. This additional RPM requires more current and that cuts into your battery life. It would be an interesting comparison to run a number of drones at 10K' to see how they held up.

<comment><USER5> There was a post on reddit/r/multicopter a while ago of prop thrust at different air pressures with the same current. It's pretty much exactly what you're asking for.

[https://i.imgur.com/Z5toIVm.jpg](https://i.imgur.com/Z5toIVm.jpg)

Assuming air pressure at 10000 ft is ~69kpa, and sea level is ~100kpa, there really doesnt appear to be much of a difference, except for medium-sized props, which had very interesting thrust outputs- gaining efficiency at low rpm and loosing a lot at high rpm.

Anyway, point being is a 250 class quad could pretty easily fly at 10000 feet. Not particularly well, but considering 1:4 (or even 1:8) thrust ratios arent uncommon with 250 class quads they could still pull it off.

Now, idk about bigger quads like the phantom/iris, their props have quite different geometries which probably act quite differently.

<comment><USER6> At 10000ft, pressure is around 30kpa. Using the data you provided in the link and assuming a quad weighs any were around 600-800grams with camera, the multi rotor will be flighting at near 100% power. Sustained flight time would be very limited.

<comment><USER3> > At 10000ft, pressure is around 30kpa.

Do you mind if I ask where you are getting that pressure value from?

The ICAO Standard Atmosphere gives a value of 70kPa for 10,000ft.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER7> Sigh. I'm a "drone hobbyist" myself, although I mostly refer to the hobby as "RC model flying". Nothing new, because the RC flying hobby has been around for decades.

Part of me applauds the stricter rules. It's just so easy for some knucklehead to buy a quadcopter from China and fly it around the White House or an airport or over someone's backyard. Unfortunately, these people destroy the hobby, giving it a bad name.

On the other hand, the rules we have had for decades (don't fly near airports or restricted zones, don't fly too high, don't fly over crowds, etc.) are perfectly fine and reasonable. We don't need stricter rules and regulations, we need common sense from drone pilots.

Secretly I hope that drones are really a fad, and the interest will fade away. That leaves the hobby for the real enthousiasts.

<comment><USER8> "Common sense" isn't common. Lay down clear rules and get people to follow them.

<comment><USER9> Yup. If you expect a nebulous and undefined "common sense" to prevail after your hobby has entered its eternal september what you'll end up getting is a severe crackdown when shit inevitably hits the fan.

"Common sense" is mostly social norms (usually starts out as "hard-earned wisdom" until the culture forgets how it was acquired), when there's a huge continuous influx of new participants the "old culture" can't keep up, neither can its "common sense". Doubly so when a hobby lends itself to nefarious uses and mindless fuckups as much as drones do.

</comment></comment></comment><comment><USER10> As someone taking off from a runway the other day and having to actually dodge a stupid camera tied to balloons, we don't always report all that stuff. I, for one, welcome the rules. I also understand that not everyone will follow them. Welcome to the world.

<comment><USER2> That stupid camera tied to balloons wasn't by chance a permitted-in-advance activity was it? We have that at my local airport. A few times per year a prof from a nearby uni sends a balloon up mostly for the benefit of his students. You ought to hear the Saturday morning FBO free-coffee-drinkers club whine about the inconvenience of it. All GA pilots may not always report everything, but there are a few who report everything they see and everything they imagine they saw.

<comment><USER11> Usually the balloon flyers must post a NOTAM (notice to air men) which pilots request from the local tower prior to takeoff or landing.

</comment></comment></comment><comment><USER12> If there is misreporting for political reasons, that is unfortunate. How and where drones can be operated is a real concern and will become only more and more of an issue as they become cheaper, better, and more common.

</comment><comment><USER13> TLDR: the big "close call" list consist of every mere mention of a word Drone by a pilot, not the actual near misses.

</comment><comment><USER14> Near miss? It's a near hit! A collision is a near miss!

 _sound of explosions_

"Aw, will you look at that, Dave. They nearly missed."

"Yes. But not quite!"

\-- George Carlin

<comment><USER15> I greatly enjoy that bit, but it's also totally wrong. "Near" is not the same as "nearly." It's "near" as opposed to "far." It's a miss which is near.

<comment><USER14> I don't buy it. What if the miss wasn't near? Would it be a far miss? An average miss? What exactly is the point at which you go from colliding to a near miss, to any other kind of miss? It's redundant language.

<comment><USER15> Sure, if you miss by a huge amount it could be a "far miss" or a "distant miss" or similar.

The point where you go from colliding to a near miss is the point where the two things don't touch. There's no exact point where you go from a near miss to a regular sort of miss, since it's not a precision term.

<comment><USER14> But they don't far miss or distant miss. They weren't aiming for each other. "Near miss" is the only way you would ever refer to planes almost colliding with the word "miss", so the "near" part is redundant. They missed. If you wanted to say they were close, you could say they almost hit, which is not only more accurate, it's not redundant, because you can't take out either word and still express the same idea.

This isn't just to be pedantic; there's lots of redundant or incorrect language out there which Carlin talks about at length.

<comment><USER16> > there's lots of redundant or incorrect language out there which Carlin talks > about at length.

While Carlin -- as comedians often do -- used the manner in which natural language idioms are irregular as the basis for some of his humor, the irregularity of natural language idioms is not incorrectness. It may be aesthetically displeasing to people who have a strong preference for regularity -- a preference which is probably overrepresented in the HN audience -- but that's a different issue.

<comment><USER14> I'm not concerned with aesthetics. I'm concerned with incorrect language which leads to incorrect thinking. I could talk at length about a single word and how its misinterpretation by a huge subculture leads to bad decision making, but let's just say words are very important.</comment></comment></comment></comment></comment></comment></comment>


Ask HN: Anyone here experienced with e-ink monitors? - <AUTHOR> I'm thinking about switching to e-ink because its better for the eyes (for coding)<i> <comment><USER2> I have a Dasung Paperlike that I use and it's been pretty great for my eye strain. For most developer workflows it's good enough. Latency has never been a problem for coding, I think its around 10-16 fps. There's some residual ink that gets left on screen, but I don't notice it at all anymore. Obviously you can't do any color work or watch a video, but other than that I almost never have to switch to my regular screen. The only annoying part are all the cables that have to be set up to work (it requires both a USB and a displayport simultaneously).

</comment><comment><USER3> About a year ago Technology Connections on youtube tried to use an eink display and thoroughly described his experiences.

* E-Ink on Android, and other new things! [https://www.youtube.com/watch?v=ytpRnRke6I0](https://www.youtube.com/watch?v=ytpRnRke6I0)

* E-Ink for Productivity: An Introduction [https://www.youtube.com/watch?v=7NfX0vlCa4k](https://www.youtube.com/watch?v=7NfX0vlCa4k)

<comment><USER4> Such a great youtube channel

</comment></comment><comment><USER5> If you're on a budget and you don't mind some electronics tinkering, check this out: [https://www.waveshare.com/product/displays/e-paper/epaper-1/...](https://www.waveshare.com/product/displays/e-paper/epaper-1/12.48inch- e-paper-module.htm) Only $170 for 12.5"! This is for Black/White. They also do a version with Black/White/Red but it takes _very_ long to refresh so probably isn't suitable for interactive use. However I believe - don't know for sure!!! - that the B/W/R displays are just as fast as B/W if you don't use the third colour. But they do have a reddish sheen if that appeals yo you.

Also you'll have to do some coding to get this to work properly as it's addressed as 2 half displays. A bit like 4K used to work with DL-DVI.

However if you want something that just plugs in to DVI or HDMI, then get the paperlike. Huge price difference though.

<comment><USER6> I've been playing with a Waveshare display using this great little library for rendering with HTML and JS [https://github.com/samsonmking/epaper.js](https://github.com/samsonmking/epaper.js)

However I suspect the resolution (even for the 12.5") is too low to reasonably use with a code editor.

<comment><USER5> Well, it's 1304x984. Basically on-par with a 1280x1024 monitor, which were used on sizes of 15 and even 17".

</comment></comment></comment><comment><USER7> That's an interesting idea (using e-ink for coding), but I wonder if the benefit would be offset by the loss of syntax highlighting. I wonder how effective it would be to re-implement it by using varying foreground or background shades of gray, or varying widths of stroke.

EDIT: After thinking about it, I imagine the software using these displays already convert color to grayscale for images in documents, etc. I imagine that conversion would work with pre-existing syntax highlighting. Oddly, I can't find images online of source code being displayed on e-ink.

I've been looking for a reason to get a reMarkable tablet. Maybe this is the excuse I need. Since root access comes out-of-the-box, it might not be too hard to set it up as a display for coding.

Then again, maybe a display like those shared in these comments would be more cost-effective.

<comment><USER8> I imagine you could use different fonts to accomplish what color does already.

<comment><USER9> Fonts and styling: bold, italic, thin, underlines with styles, outlines, borders. A lot can be achieved with monochromatic medium.

</comment></comment></comment><comment><USER10> Download ColorVeil and knock down the brightness of your current setup, if that doesn't work then maybe go with OLED instead.

<comment><AUTHOR> I already use f.lux (even during the day), and I dont keep my screen too bright or too dark. I even bought a second pair of glasses with a weaker prescription, and try to remember to look away every 20 minutes (which is annoying when focusing)

I started a project that I focus on after work, so Im in front of screen for 10-14 hours a day now. I wont mind spending $1,xxx on a e-ink monitor if the feedback is generally good. I have a kindle and it's noticeably more comfortable to look at.

I'm also curious of the psychological effects of working from an e-ink display, since it's a very different medium.

<comment><USER10> Prob you want [http://www.dasungtech.com/](http://www.dasungtech.com/) if you're going e-ink

"Comparing the Boox Onyx Max 2, Dasung Paperlike Pro and Pixel Qi as external monitors." [https://www.youtube.com/watch?v=2QQkJGdiI1I](https://www.youtube.com/watch?v=2QQkJGdiI1I)

</comment></comment></comment><comment> non-entity From what I understand there arent any, at least nothing compared to what you think of when you think of computer monitors. there are a few, nut they're very small and rather expensive.

Obviously the refresh rate isn't good enough for most media, but i still think it would be nice for reading docs.

</comment><comment><USER11> It's easier to write code in a notebook. I frequently look at a screen for a minute, memorize what's there, and do the rest on a piece of paper. If you sum up total screen time during an 8 hour day, it's around 1 hour of bursts.

</comment><comment><USER12> > because its better for the eyes (for coding)

e-ink is great for static content, but just wondering if the high latency be a little bothersome for dynamic content like a code text window? I usually jump around a lot when I code and have to keep an eye on the debug/output window which refreshes a lot. I feel like a rock-solid image (high refresh rate LED monitor) and smooth motion would be less tiring to the eyes.

</comment><comment><USER13> You may be able to talk to the founders of Printless Plans, a Baltimore based startup that has been working with large e-ink displays.

</comment><comment><USER14> If I'm sold on trying this, and have a second VESA mount at my desk, does anyone have a solid purchase recommendation?</comment>


Ask HN: Code sandbox as an API? - <AUTHOR> I'm building an e-learning website and want people to be able to write code on the site and run unit tests on the code they've written to validate that it works.<p>Does anyone know if there's an API out there that offers the ability to run code/run tests on it as an API service? <comment><USER2> if you are talking about c++ [https://coliru.stacked- crooked.com/](https://coliru.stacked-crooked.com/)

they seem to have api: [https://docs.google.com/document/d/18md3rLdgD9f5Wro3i7YYopJB...](https://docs.google.com/document/d/18md3rLdgD9f5Wro3i7YYopJBFb_6MPCO8-0ihtxHoyM/edit)

<comment><AUTHOR> Any language really... Especially JS, Python, Ruby, PHP...</comment></comment>


Covid-19 Crisis Prompts Silicon Valley's Legislators to Bridge Digital Divide - <AUTHOR> https://www.kalw.org/post/covid-19-crisis-prompts-silicon-valleys-legislators-finally-bridge-digital-divide-0 <comment><AUTHOR> more than 9,000 families in the heart of Silicon Valley and almost 15,000 students don't have access to the Internet on a computer at home.</comment>


ISRO PSLV-C37 onboard camera showing 104 satellite separation - <AUTHOR> https://www.youtube.com/watch?v=aYf_uyHQN5o <comment><USER2> The Satellite separation starts at 1:23 or so, after the Third stage. 88 of the satellites (nanosats?) were by Planet.com and will be used for imaging as part of their Flock 3p: [https://www.planet.com/pulse/record- breaking-88-satellites/](https://www.planet.com/pulse/record- breaking-88-satellites/)

r/ISRO has the complete payload details: [https://www.reddit.com/r/ISRO/comments/5t7a75/pslvc37_cartos...](https://www.reddit.com/r/ISRO/comments/5t7a75/pslvc37_cartosat2d_mission_updates_and_discussion/)

</comment><comment><USER3> This is a fairly amazing video. I wonder what is the size of a nano satellite

<comment> happy-go-lucky A CubeSat (U-class spacecraft) is a type of miniaturized satellite for space research that is made up of multiples of 10×10×11.35 cm cubic units. CubeSats have a mass of no more than 1.33 kilograms per unit, and often use commercial off-the-shelf (COTS) components for their electronics and structure.

The term "CubeSat" was coined to denote nanosatellites that adhere to the standards described in the CubeSat design specification.

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

</comment></comment><comment><USER4> I don't understand releasing them so close: isn't the whole point of a large number of satellites to give them different orbits ?

<comment><USER5> In the case of the Planet satellites, they will be spread out using differential drag over the next few months.

[https://arxiv.org/pdf/1509.03270.pdf](https://arxiv.org/pdf/1509.03270.pdf)

<comment><USER6> Something like this?

[https://www.youtube.com/watch?v=nh0kJgHKeXo](https://www.youtube.com/watch?v=nh0kJgHKeXo)

</comment></comment></comment><comment><AUTHOR> Another slightly better quality video: [https://www.youtube.com/watch?v=cvJYSmplzXc](https://www.youtube.com/watch?v=cvJYSmplzXc)

</comment><comment><USER7> These cubesats are clustered closer than I thought they would be.</comment>


Sieve of Eratosthenes in Python (2015) - <AUTHOR> http://www.solipsys.co.uk/new/SieveOfEratosthenesInPython.html <comment><USER2> For anyone interested in implementations of the Sieve of Erastothenes, here is a very interesting paper about functional ones, which are harder than they appear at first: [https://www.cs.hmc.edu/~oneill/papers/Sieve- JFP.pdf](https://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf)

<comment><USER3> I implemented that in chez scheme recently, and it is pretty darn fast.

[https://bitbucket.org/bjoli/primes/src](https://bitbucket.org/bjoli/primes/src) (the file lazy-prime-sieve.scm)

it uses Nietzsche which can be found in my repos. On my three year old computer, it computes the first ten million primes in about 40 seconds (up to, and including 179424673). That is only about 4 times slower than the optimized non-lazy naive sieve.

<comment><USER4> Years don't tell much, what kind of CPU is it ? Still very nice to see.

<comment><USER3> It is an Ivy Bridge or Haswell mobile i7. It was pretty high en for a laptop in late 2013/early 2014.

</comment></comment></comment></comment><comment><USER5> The sieve of Eratosthenes can be adapted to build tables of other number properties: smallest prime factor, totient function, number of unique prime factors (omega), product of unique prime factors (radical).

Contains code in Python and other languages: [https://www.nayuki.io/page/the- versatile-sieve-of-eratosthen...](https://www.nayuki.io/page/the-versatile- sieve-of-eratosthenes)

</comment><comment><USER6> I first learned of this sieve while reviewing the code for the Primecoin proof-of-work. Primecoin is a cryptocurrency that tries to have its PoW provide greater utility than hashing, but its PoW otherwise is similar to hashing. The task is to produce Cunningham chains [1] of prime numbers. The reference implementation of Primecoin computes primes using the Sieve of Eratosthenes (w/arbitrary precision integer math).

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

<comment><USER7> What is the use of producing these primes?

</comment></comment><comment><USER8> Here is very concise implementation of sieve I use in algorithm contests:

      int n = 100;
      vector<int> p(n);

      void sieve()
      {
          for(int i = 2; i < n; i++)
              for(int j = i; j < n; j += i) p[j]++;
      }

      int is_prime(int k)
      {
          return p[k] == 1;
      }

<comment><USER9> There's a small optimization on the original article which I think your implementation doesn't do: "At each stage we know that every composite number up to p^2 has definitely been marked as such"..

Assuming your implementation is working fine (didn't test it), I think the change would be j = i * i on the inline for:

      void sieve()
      {
          for(int i = 2; i < n; i++)
              for (int j = i*i; j < n; j += i) p[j]++;
      }

It's tricky to explain, but take for instance the numbers from 1 to 20. When i=2, it will clear [4, 6, 8, 10, 12, 14, 16, 18, 20] as non-primes. So when i=3, you can skip 6 (which was cleared by i=2) and start directly at 9 (i * i = 3 * 3) to clear [9, 12, 15, 18]. Also, when i=4, you can skip the 8 and 12 (which were cleared by i=2 and i=3) and start on 16 to clear [16, 20]. Finally, when i=5, you can start directly at 25 (out of bounds in this case) because 10, 15 and 20 were already cleared by the previous iterations..

Edit: But as other posters are saying below, the original sieves algorithm shouldn't even have to test i=4 because the numbers it clears (naivelly [4,8,12,16,20]) have already been cleared by the previous iterations of the algorithm.

<comment><USER10> Maybe stop the outer loop as soon as i * i > n then as well.

Also, where's the check whether `i` is actually prime before you start crossing off multiples? You don't need to cross off multiples of composite numbers.

<comment><USER9> > Also, where's the check whether `i` is actually prime before you start > crossing of multiples? You don't need to cross off multiples of composite > numbers.

You are absolutely right as the original method seems to specify that. I've edited my answer to show it.

So the function would be something like (untested):

      void sieve()
      {
          for (int i = 2; i*i < n; i++)
              if (p[i] == 1)
                  for (int j = i*i; j < n; j += i) p[j]++;
      }

There's the problem, as other posters are saying, that if p[j] == 1 is because it was cleared as non-prime, but I've just tested p[i] == 1 for primality for coherence with the original author.

</comment></comment></comment></comment><comment><USER10> In C++ we do it compile time :) [http://stoppels.blog/posts/compile-time- primes#a-compile-tim...](http://stoppels.blog/posts/compile-time- primes#a-compile-time-prime-sieve-for-counting-prime-numbers)

<comment><USER11> Back about 1964, when I was learning to program (IBM 7090 in assembly language), I did it at assembly time in the surprisingly powerful IBM 7090 macro assembly language. Probably somewhat slower.

<comment><USER10> Do you still have a reference for that?

</comment></comment></comment><comment><USER12> Re: the 'more Dynamic"' version, have you seen the amazing postponed sieve generator?

This is the ' _really_ Dynamic' version, it recursively treats all previous primes as a special case.

[https://stackoverflow.com/questions/2211990/how-to- implement...](https://stackoverflow.com/questions/2211990/how-to-implement-an- efficient-infinite-generator-of-prime-numbers-in-python/10733621#10733621)

</comment><comment><USER13> This is a well written post. It's not new stuff, but the combination of the sieve, along with the python code makes it pretty accessible.

The site itself is actually really interesting, I never knew about Russian Peasant Multiplication before [0].

EDIT: Fixed typo in link, thanks!

[0] [http://www.solipsys.co.uk/new/RussianPeasantMultiplication.h...](http://www.solipsys.co.uk/new/RussianPeasantMultiplication.html)

<comment><AUTHOR> Thanks for fixing the link - I was going to remove this comment for the sake of being tidy (sys admin thinking) but it appears I can't delete it, only edit it.

So I've done that.

Cheers!

<comment><USER14> ( It's okay not to tidy up all the history.

Have a good day everyone!

</comment></comment></comment><comment><USER15> Reminds me of some code I wrote for a codeeval challenge for returning the sum of all primes up to n inclusive. IE: sum_primes(2) = 2, sum_primes(3) = 2+3 = 5 = sum_primes(4)...

It's odd that this version doesn't use a set(), but dictionary/list.

Anyway, I'll have to refactoring my code and measure against op - although I only used the python as a reference to sanity-check my naive c++ code:

[https://github.com/e12e/codeeval/blob/master/4-sumprime/prim...](https://github.com/e12e/codeeval/blob/master/4-sumprime/primes.py)

(I believe, like most(?) codeeval challenges, this is from project Euler)

[ed: should probably add that this isn't a sieve]

</comment><comment><USER16> I usually use this sieve any time I need to work with small prime numbers, but I dug deeper into probabilistic primality tests recently. If you try to run a sieve on large numbers you quickly realize that it is not feasible. Probabilistic primality tests like the Miller-Rabin are very fast and incredibly accurate, yet they are nearly as simple as this sieve. I didn't fully trust RSA until I learned enough about Miller-Rabin to convince myself the prime numbers it uses are safe.

</comment><comment> chris-laffra If you want to do your own visualizations using PyAlgoViz, check out [http://chrislaffra.blogspot.nl/2016/12/generating-prime- numb...](http://chrislaffra.blogspot.nl/2016/12/generating-prime-numbers.html)

</comment><comment><USER17> very slightly relevant:

        Upon a stack of bits, about so tall,
        just think, O traveller, what we could do
        if every other bit was set to false
        beginning with (but not including) two?

        Now take two lowly numbers, A and B
        that equal three and two. What would happen
        if they, by twos and ones respectively,
        were incremented in a nested fashion,

        And if we falsified, at every turn,
        the value offset by A groups of Bs?
        Then to the aether let those bits return,
        to fly back home to Eratosthenes!

from www.ineptech.com (the "Langston" example)

</comment><comment><USER18> The Eratosthenes sieve is pretty basic. I would expect any programmer to be able to do it on the whiteboard. Now the quadratic sieve, that is a challenge. The GNFS even more so.

<comment><USER19> These sieves are indeed much more complex, but are not really related to the sieve of Erathostenes except in name. Not clear why you bring them up.</comment></comment>


An inside look at Yandex.ru's offices - <AUTHOR> http://englishrussia.com/index.php/2010/10/23/an-incredible-dream-office/

<comment><USER2> As fantastic as this office is, I'd hate to work in a environment where anybody can freely look over my shoulder at any time. I'll take privacy and a dull office over this any time. We've managed to satisfy this concern (<http://www.mojalbum.com/popcom/popcom-office>) and I'm really happy about our office.

<comment><USER3> What are you doing at work that you don't want people looking over your shoulder? Serious question by the way - it always comes up in work environments that some people are pretty against the lack of privacy that comes along with these types of set ups, but really if you are at work there shouldn't be too much (if anything) on your screen which is private.

I'm a big fan of bull pen type environments, where it's wide open spaces and everyone is together with no walls between.

If you have that, and also offer a few "quiet rooms" where you can go if things are loud or you need to check your personal email, I don't see what the problem is.

<comment><USER4> > I'm a big fan of bull pen type environments, where it's wide open spaces and > everyone is together with no walls between.

Visual and audio noise.

They're really bad for productivity of creators. They're good for managers / coordinators / investors.

The standard argument that "you can wear headphones" doesn't work for serious design work. Pounding music is great for grinding through list-ish stuff, but not for creativity.

It's like sleep deprivation. People who are sleep deprived will insist "I'm fine -- I just need a coffee", but their performance is much lower than those who are well rested.

EDIT> I'm not responding to the over-the-shoulder question here. I find it very distracting to see others' faces, though, e.g. with back-to-back monitors. Most of us are wired to pay attention to faces, so they cause a lot of visual noise.

At this point in my career, open-concept offices with > 4 or so people are a deal breaker. It makes me hate programming.

</comment></comment></comment><comment><USER5> Wow, they're _just like us_!

</comment><comment><USER6> The images looked like they had been badly scaled with nearest neighbor in Chrome, so I reopened the page in Firefox, then looked at the original image.

Sure enough, when the photographer took the original image off their camera and scaled it down for the web, they used a low quality interpolation. For some reason. Damned unprofessional.

</comment><comment><USER7> <http://media.englishrussia.com/ya/0_59819_f6ec66d1_orig.jpg>

Looks like "Russian" from some Hollywood movies. Not a single word in real Russian :-)

<comment><USER8> both are carrying what seems to be cigarette packs. They have smoking rooms now. What happened to the conveniency of smoking right in from of the computer? Did computers riot against second-hand smoking?

<comment><USER7> Smoking at your workplace is prohibited in Russia. It's good

</comment></comment></comment><comment><USER9> What is going on here?

<http://media.englishrussia.com/ya/0_59828_2cce1aaa_orig.jpg>

<comment><USER10> The lower part is underfloor heating. I don't know what the higher part is, but I would guess that they retrofitted underfloor heating and used existing overhead pipes for the water. Normally those pipes would be well-hidden.

</comment></comment><comment><USER11> That photographer needs to learn how to use the appropriate aperture. Wrongly- focused photographs hurt my eyes.

</comment><comment><USER12> Love the plants and the open floor plan. Time to ditch the fluorescents though. That is a deal killer.

</comment><comment><USER13> Not sure if I will ever understand why anyone would sit on the floor to do anything with a computer when their is nice chairs available, and yet they designed space just for that.

</comment><comment><USER14> How much have they looked at Google and how much have this culture developed "on its own" in Moscow?</comment>


Hedging private tech valuations for entrepreneurs - <AUTHOR> https://www.pollyport.com/ask-polly-how-can-a-tech-entrepreneur-hedge-his-exposure-to-venture-valuations/ <comment><USER2> If you are in tech, hedging your financial exposure to tech valuations is a bit like betting against your baseball team: it may feel disloyal, yet it is the rational thing to do.

Probably the most easily accessible strategy is to buy Short ETFs focusing on the tech sector, such as PSQ and SQQQ. As mentioned in the article, such strategies would be a blunt instrument. And holding these for more than a few months is often a bad idea, given the high fees.

<comment><USER3> If you don't want to "bet against your own team" you could always buy sector ETFs and leave out technology which makes up 20% of the S&P. That way you diversify instead of doubling down on your tech investments.

</comment></comment><comment><USER4> Hmm interesting. Wondering if the harder part is just not holding long positions-- I generally find that I'm most excited about other tech companies-- or more able to asses their value (especially for something like AWS, although like the article mentioned, is not really the source of Amazon's total value).</comment>


How long before Anywhere.fm + Wimax kills terrestrial radio? - <AUTHOR>

We've all been subject to the abuse of radio as we know it.  My drives on my daily commute to college were brutal; repetition and uniformity in all the station playlists.  When, not if, wimax reaches wide penetration, it will likely disrupt radio as well as cell phone carriers (Skype + Wireless IP == end of cell phone bill).<p>When? <comment><USER2> What makes you think WiMax will reach wide penetration? Sprint is the only one investing in Wimax. I think all the other major architecture builders aren't bothering because it changes their current business model. I think it's more likely that a bubble of Wi-Fi appears across most urban areas.

Maybe Google will use the old TV frequencies to launch a new nationwide wireless IP network. It seems like a really good use of their market cap to take control of the old TV frequencies.

Also, devices will need better battery lives or a clever hack if you want to be able to listen to anywhere.fm wirelessly for 24 hours.

</comment><comment><USER3> Who do you think will be providing the blanket coverage Wimax and IP?

I see the value in Wimax as a technology, I just cant buy into this vision of uninterrupted IP access everywhere you roam. Its just Wifi on steroids.</comment>


Grow Your Own Picture – Genetic Algorithms and Generative Art - <AUTHOR> http://chriscummins.cc/s/genetics/ <comment><USER2> It looks like it no longer does much progresses after some time. Many years ago I wrote one of those stuff, just a few days after the famous 2008 blog post doing the same ([http://rogeralsing.com/2008/12/07/genetic-programming- evolut...](http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of- mona-lisa/)). However after some time I switched the code to use simulated annealing, and it performed better. I'm running it for a few minutes against the Monalisa image to see what happens. Btw I had a plan to release the code after some cleanup, maybe tonight is the right moment after 6 years of this code hanging on my HD.

EDIT: after 6 minutes (64 shapes) -> [http://imgur.com/gyZCjBD](http://imgur.com/gyZCjBD)

EDIT2: after ~15 minutes -> [http://imgur.com/5XMU8vH](http://imgur.com/5XMU8vH)

Now trying using just triangles, again with 64 shapes, I remember it was much better than when using circles for most images.

EDIT3: Oh, much better now, after 6 minutes (64 triangles) -> [http://imgur.com/x9E9TmK](http://imgur.com/x9E9TmK)

EDIT4: 10 minutes more and she got a nose: [http://imgur.com/bX8UTIQ](http://imgur.com/bX8UTIQ)

EDIT5: Code released! [https://news.ycombinator.com/item?id=8710418](https://news.ycombinator.com/item?id=8710418)

<comment><USER3> I took a course on this stuff in uni, it was so fantastically fun to play with.

Simulated annealing has less cachet than GAs (and other evolution-inspired approaches) but tends to perform well enough on lots of problems that you might as well skip GAs.

I haven't dug much on the linked GA, but it looks like it converges too quickly. That's a classic problem (exploration vs exploitation, aka coverage vs convergence) in optimisation problems. The problem I practiced on was Ackley's Function[1]. Even in 2 dimensions it's really good at tripping up algorithms that converge too eagerly.

Some GA methods actually make the parameters of the _system_ part of the genome, but as I recall it doesn't make a huge difference overall. Fun to think about though.

Mind you, the No Free Lunch Theorem means that there's a place for everyone in the heuristic computing tent. And simple random sampling (monte carlo method) and/or graphing can be very helpful for looking for the contours of a solution space. There's still room for humans too.

[1] [https://github.com/jchester/ruby-ackley-genetic- algorithm](https://github.com/jchester/ruby-ackley-genetic-algorithm)

<comment><USER4> > That's a classic problem (exploration vs exploitation, aka coverage vs > convergence) in optimisation problems.

The nicest approach to exploration/exploitation I've seen for simulated annealing is to run two searches side-by-side. Their relative "temperatures" (ie. probability of accepting a worse solution) depends on their relative fitness: if both are the same fitness, both have the same temperature; if one has higher fitness than the other, its temperature lowers (so it can "focus" on that high-fitness region) whilst the other's temperature raises (so it can "spread out" to find higher-fitness regions).

Also, regarding the No Free Lunch Theorems, I don't give them much thought since they don't take the computational complexity of the problem into account. They say that every search algorithm, when averaged over _all_ problems, achieves total performance that's the same as random search. The real world doesn't contain _all_ problems; in particular, we care more about (computationally) simple problems than unrealisitically-complex ones. Worrying about NFL for search is like worrying about adversaries with infinite computing power in crypto; yes your algorithm will be weak against such an attacker, but it's unrealistic to care about.

<comment><USER3> For me the two lessons of the No Free Lunch Theorem are:

1\. Stop trying to prove that your solution is the "best overall"

2\. Hooray, we can pick and choose our tools.

</comment></comment></comment></comment><comment><USER5> This guy did the same thing in 2008:

[http://rogeralsing.com/2008/12/07/genetic-programming- evolut...](http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of- mona-lisa/)

<comment><USER6> Yeah, I remember that guy and figured it would've been the same. It's not. Nice steal Chris, at least cite the main source in your site.

<comment><USER7> Hello! Chris here. I wrote this after being inspired by a GA+JS implementation by Jacob Seidelin, (attributed). Unfortunately his blog is returning a 404, but I _think_ he in turn attributed Roger Alsing. I am absolutely not claiming the idea of genetic algorithms and art to be my own, but the code is, so I think it's unfair of you to call me a thief.

<comment><USER6> You updated your page in order to credit Roger... ᕦ(ò_óˇ)ᕤ

Anyway, don't take it personal, its just that it appeared to me that it was very obvious when you even used the same seed image.

</comment></comment></comment></comment><comment><USER8> Nice to see another spinoff :) Great to see this post now since it is exactly 6 years since my EvoLisa post was released today :)

<comment><USER9> EvoLisa was a great post. I spent a few nights trying to reproduce it and I'm sure I wasn't the only one. I eventually got to the point where I was using SSE instructions (I think it was PSADBW) to speed up the fitness function. It was loads of fun. OpenGL is probably the solution to really upping the generation frequency, but I stopped messing with it before I got there.

</comment></comment><comment><USER10> I'm having fun with this, thanks for posting it.

I'd love to see reports of basic genetic genetic properties of the population. What's the variance in fitness within each generation? This turns out to be _the_ key factor in the rate of evolution [1], assuming that one defines fitness the way that geneticists do.

Also, estimates of the relative strengths of mutation, selection, and drift would be nice, as would options for distinguishing between hard and soft selection. These sorts of diagnostics and options could really improve the method's effectiveness.

[1] [https://en.wikipedia.org/wiki/Fisher%27s_fundamental_theorem...](https://en.wikipedia.org/wiki/Fisher%27s_fundamental_theorem_of_natural_selection)

</comment><comment><USER11> Why is the collection of properties for an individual mutated shard called DNA? It doesn't really have anything to do with the actual molecule, as far as I can tell...

By the same logic, this is a C2H6O simulator:

      var s = "I'm going to get drunk";
      for (var i = 0; i < 10000; i++) {
        var idx = Math.floor(Math.random()*s.length);
        var c = s.substr(idx, 1);
        s = s.substr(0, idx) + s.substr(idx-1, s.length-1-idx);

        idx = Math.floor(Math.random()*s.length);
        s = s.substr(0, idx) + c + s.substr(idx, s.length-idx);
      }

(Wow, the downvotes are aggressive these days. Relax - it's just a joke!)

<comment><USER3> > _Why is the collection of properties for an individual mutated shard called > DNA?_

By easy analogy to biological genomes, I suppose.

<comment><USER11> Well, sure... But I wonder if such a specific name is more confusing than useful because the analogy is off in so many ways.

<comment><USER7> You are right. The "DNA" label is inaccurate, but jal278 explained the reasoning perfectly. I'd be happy to hear suggestions for a better term though! ;)

</comment></comment></comment></comment><comment><USER12> A few years ago I wrote a genetic algorithm to solve a travelling salesman problem - it was a ton of fun - I need to port it to JS one day.

Ive also thought about making an algorithm that would breed JS programs to solve basic tasks - sort an array of input or find the longest consecutive group of numbers. Maybe one day I'll find the time.

<comment><USER3> > _Ive also thought about making an algorithm that would breed JS programs to > solve basic tasks_

When you do, a useful tip: in the literature, Genetic _Algorithms_ are distinct from Genetic _Programming_.

GAs evolve collections of parameters into a function or group of functions.

GPs evolve actual executable programs. Mostly as interpreter trees, though some experiments have been done with evolving strings of machine code for real and virtual machines.

So in your case, the place to start is Genetic Programming.

ps. it's freakishly slow and the GP literature is really fixated on favouring one evolution step almost to the exclusion of others (I can't remember if it's the crossover step or mutation step).

<comment><USER13> In a lot of GA applications the effects of mutation are negligible. Given a large and diverse population, crossover provides enough variation already. Mutation will only be necessary to escape if the entire population has converged to a poor local optimum, but that doesn't tend to happen often in practice, and even if it does, there's no guarantee that mutation will help; hence the lack of focus on mutation operators in general.

<comment><USER3> Oh, maybe I mixed up GA and GP myself? In terms of favouring crossover vs mutation.

</comment></comment></comment></comment><comment><USER14> It's very difficult for the algorithm to optimize the hexagons. If you change the number of vertices from 6 to 3, it runs slightly faster but the results are much better.

</comment><comment><USER15> I love genetic algorithms. I wrote one for the 0-1 knapsack problem back in school, then used a genetic-ish algorithm (didn't have enough time for a true GA) to win a rock paper scissors tourney at work.

It seems to me that one needs another genetic algorithm to manage all the variables (such as mutation rate, population size, crossover, etc) because they have such an impact on the effectiveness of the algorithm.

Gives me way more respect for mother nature. ;)

<comment><USER3> > _It seems to me that one needs another genetic algorithm to manage all the > variables (such as mutation rate, population size, crossover, etc) because > they have such an impact on the effectiveness of the algorithm._

This has been tried in the literature -- usually by adding those parameters to the genome. Basically it's a wash.

<comment><USER15> Good to know! Thanks.

</comment></comment></comment><comment><USER16> I wrote something similar- first I did a hill climbing implementation and then a genetic one. The genetic algorithm worked way better:

[https://github.com/darkFunction/PolygonPainter](https://github.com/darkFunction/PolygonPainter)

</comment><comment><USER17> Great project. Love that it's configurable and open source. The analytics are a nice touch. I'm a little confused by the fitness percentage though. 98% or even 99% fitness seems to have very little immediate resemblance to the target image.

<comment><USER7> The fitness value represents the difference between the pixels of the "goal" image and the pixels of the current individual [1]. It will not necessarily reflect the perceived similarity between two images, which will change from person to person.

[https://github.com/ChrisCummins/chriscummins.github.io/blob/...](https://github.com/ChrisCummins/chriscummins.github.io/blob/master/js/genetics.js#L207)

</comment></comment><comment><USER18> It'd be nondeterministic and quite time-consuming, but this suggests an image compression algorithm that could conceivably come up with _very_ compact representations of its input.

<comment><USER19> I tried this as a college project inspired by the Roger Alsing post. Unfortunately I didn't create anything usable. If I was doing it again I'd use a SA approach or pure hillclimbing like Alsing - as antirez points out in a sibling post, crossover between diverse individuals rarely gives viable offspring with this problem.

</comment></comment><comment><USER20> would be cool to be able to upload your own photos / pull in from instagram, etc.

you might make a little coin by piping the finished images to a t-shirt or skin printer.

we'd be happy to give a free CreditCover, credit card skin to any one who wants one using your imagery. We have a standing $10 gift code for hacker news users (hackernews) but we could make something specific for you if you like.

CreditCovers.com/DIY

cool!

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

</comment><comment><USER22> Every now and then comes an interesting algorithm implementation in javascript alas always single threaded. :/

<comment><USER23> I haven't looked at the specific source, but I can't imagine there's anything preventing this from being modified to run as a Web Worker on multiple threads.

</comment></comment><comment><USER24> For fun: start with one picture, then it run for a while, and then change the source picture

</comment><comment><USER25> This looks more like hill climbing rather than genetic.

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


Show HN: CraftedInChicago.com - <AUTHOR>

Just a simple directory I built for Chicago tech companies doing great things. <comment><USER2> I'm not sure what platform youre using but the site loads quite slowly.

</comment><comment><USER3> clickable : [http://craftedinchicago.com/](http://craftedinchicago.com/)

</comment><comment><USER4> Awesome</comment>


Ping.gg monitoring engine now open source (Go) - <AUTHOR>

Some weeks ago I "Show HNed" my project ping.gg[0] and some people asked to have it open sourced. I know it's unlikely that those guys will see this again now, but I can not comment on the thread anymore so there you go anyway[1].<p>This is the core of the system and enough to build your own private ping.gg. It's obviously really simple and limited. Adding support for HTTP status checks will require some mayor refactoring.<p>[0] https://news.ycombinator.com/item?id=8774257<p>[1] https://github.com/pinggg/pingd <comment><USER2> Thanks for open sourcing it!</comment>


A freelance remote developer on Amazon.com - <AUTHOR> http://www.amazon.com/gp/product/B00B5HR73K

<comment><AUTHOR> This is someone I have in my twitter timeline, I found his initiative fairly creative, so sharing it here.</comment>


Hacking my Diet, Day 1 - <AUTHOR> http://blog.mathgladiator.com/2010/12/hacking-my-diet-day-1.html

<comment><USER2> Maybe I don't understand the extent of the author's fear, but this seems a bizarre way to try to improve your diet. Why not just learn to cook simple, traditional foods that feature vegetables? No traditional cook would serve a big bowl of plain spinach. Why would you even want to teach yourself to eat that?</comment>


The Case for D - <AUTHOR> http://www.ddj.com/hpc-high-performance-computing/217801225

<comment><USER2> D is dandy but lacks documentation and tools.

It's a chicken and egg problem, why would you build tools for a language that's not popular, how will a language become popular without tools.

C++ answered that question by usurping C... or did C backward compatibility poison C++ ...

Python did it by being fun and easy and having great tools and great documentation.

D is not ready yet.

</comment><comment><USER3> I want to like D, but the documentation just isn't there. Good tutorials for it are hard to find, and the OS X installation instructions on the web site are just plain wrong.

If they could just get together some decent documentation, I would be using D in a snap.

(Correction: The instructions were wrong when I tried to install D about two months ago. It took a trip to the mailing list to sort out.)

</comment><comment><USER4> i've wanted to play with D for a while but didn't want to learn a new compiler... fortunately I just discovered gdc...

here's a D intro for anyone too lazy to google:

<http://www.digitalmars.com/d/>

</comment><comment><USER5> I like D as a language to learn more about lower-level domains. It tends to be (imho) easier to read than C code and there are lots of interesting projects going on over at dsource.org

Some people seem to dislike the fact that there are the two standard libraries, but I think that just adds to making the learning curve less steep (i.e. you can choose whether you want a closer-to-the-metal or a more high level flavour of the language). Reading code written in different standard libraries in itself can also be quite illuminating.

</comment><comment><USER6> As a recovering C++ programmer, this sounds exceedingly shiny. The concurrency by design is pretty neat.

However, the author does talk about the usual bias of such articles. I wonder if he's similarly biased?

But D is now on the list of things to try out on a rainy day.

<comment><USER7> Well, the author of this article is Andrei Alexandrescu. If you were a serious user of the C++ language you've probably read his "Modern C++ Design" and other stuff he's written -- so he has as deep knowledge of C++ and its stdlib as you can get, thus I judge his enthusiasm for D as in a way higher class compare to a a blog entry by someone who has just found Haskell/Erlang/or similar (but still somewhat theorethical).

D2 certainly sounds refreshingly simple. Having said that I don't fancy rewriting 125 KLOC of Python in even D. My performance critical code uses Cython. I'll have to try to use e.g. PyD (or some newer replacement) to write some code in D to interface with.

In a typical WEB app however there's usually not much stuff you can say: hey, this is totally independent CPU-bound code running for a significant amount of time on a limited set of data that can be written in a lower-level language.

(Oh, I suddenly feel so dirty for upgrading a server from 16 to 32 gigabyte to allow for bloated Python data structures!)</comment></comment>


She: The Strathclyde Haskell Enhancement - <AUTHOR> https://personal.cis.strath.ac.uk/conor.mcbride/pub/she/

<comment><USER2> My own experiences with Haskell have been... unfortunate (either I am too stupid or my brain has been damaged by imperative programming languages). But this is easily the funniest introduction to any piece of software I have ever come across.

<comment><USER3> Someone on HN suggested this guide to Haskell a few days ago: [http://en.wikibooks.org/wiki/Haskell](http://en.wikibooks.org/wiki/Haskell)

I'm finding it the first useful introduction to the language I've encountered. Like you, my experiences have been less than exemplary, and I'm way too arrogant to accept that I'm either stupid or brain damaged. Every year or so I take a run at Haskell, and this time I think I'm going to get it. I know a dozen-odd languages, including a fairly expert grasp of APL and Mathematica, both of which are a bit odd in their approach to life. Haskell is genuinely weirder than most, and the entire Haskell community's apparent total ignorance of the of the most rudimentary principles of pedagogy make the learning curve unreasonably steep.

The fact that most Haskell tutorials start out with contradictions is an example of this. Pedagogy 101: don't make false claims about the subject _in terms of the concepts you can reasonably expect the student to have_.

For example, electrical engineers should never introduce the concept of "negative resistance" by starting off talking about "negative resistance". They should first introduce the concept of _generalized resistance_ (dV/dI rather than V/I) and then show how _generalized resistance_ can be negative. To tell a student that there is such a thing as "negative resistance" when you know full well that "resistance" in the student's mind is not generalized but defined by a relation such that it cannot possibly be negative is simply incompetence on the part of the teacher.

By the same token, it doesn't matter one whit that "the language" is side- effect free when "the runtime" implements side effects when the student can reasonably expected to understand "language" to mean "language plus runtime" as it is in every other case. Actually: it does matter, and it should be explained in those terms. Otherwise students will rightly reject the language as some kind of snake-oil gibberish promoted by arrogant hucksters.

No Haskell tutorial should ever make the false claim that "the language" (as understood by any reasonable student) is "purely functional". Students aren't stupid and haven't been brain-damaged by imperative languages. They know that "the language" covers the whole package in ordinary parlance, including the runtime. When we talk about Perl or Python or C++ or FORTRAN that's what we mean. There is absolutely no basis for anyone to ever assume any other understanding on the part of the student.

So tell people "Haskell is implemented in such a way that it can be treated as a purely functional language for the purpose of static analysis even though at runtime there are various clever tricks that still allow it to implement side- effects like IO". That is a truthful statement. "Haskell is a pure functional language and for every function call the return value depends only on its arguments" is false, outside of a tortured and bizarre interpretation of the terminology that has no apparent purpose but to misrepresent reality to outsiders.

There are some pretty cool things about Haskell. The type inference system is powerful, useful and interesting. It's remarkable to see how far a nominally (but not actually) purely functional language can be pushed, and the way various hacks are used to overcome the limitations of purely functional languages is incredibly clever. The creators of Haskell should be celebrating those feats, not hiding behind false claims that the language+runtime is "truly" purely functional when it manifestly is not.

Edit: Concrete example: to be a purely functional language function values must depend only on their arguments. Here is an example of a Haskell function whose value does not depend only on its arguments:

        notPurelyFunctional :: Double -> IO Double
        notPurelyFunctional x = do
            z <- putStrLn "Please enter a number: "
            name <- getLine
            let y = read name ::Double
            return (x+y)

If we do something like:

        value1 <- notPurelyFunctional 5.0
        value2 <- notPurelyFunctional 5.0
        value1 == value2

we have no idea what "value1 == value2" will evaluate to, so either:

a) The above code is _not part of the Haskell language_ (which would be weird as it all runs just fine under GHC, and "stuff that runs under GHC" is what any ordinary person means by "Haskell")

or

b) Haskell is not a "pure functional language" the way that term is ordinarily understood, which is: "calling the same function multiple times with the same arguments will always produce the same results" (in which case "value1 == value2" must evaluate to "True", which it does not in general when running the above code).

<comment><USER4> Q: Is it true that the return value of any Haskell function depends only on its arguments?

A: Yes, barring tricks like unsafePerformIO. But you can write perfectly good programs that do IO without these tricks anyway.

Q: Okay, genius. What about functions like getLine, which reads a line from the console?

A: getLine isn't a function.

Q: What?

A: All functions in Haskell have types like "a -> b" for some a and b. But you'll notice that the type of getLine doesn't have an arrow in it, it's just "IO String".

Q What do you mean, it's not a function? I can call it right here, by doing "do name <\- getLine"!

A: That's not the syntax for calling functions in Haskell, that's monadic do notation. The syntax for calling functions is "foo x y".

Q: This is outrageous. So you're saying that getLine is just an inert value?

A: Yes.

Q: But what is that value? What's inside the type "IO String"? I'd always assumed that it was a kind of wrapper around a String, with some type system nastiness so people don't misuse it.

A: No, I'm afraid it can't be anything as simple as that. And it certainly can't contain a String, because then getLine couldn't be the same value all the time.

Q: Wait, you're saying that it doesn't even contain a String? Then what is it, really?

A: The implementation of IO types is kind of private to the runtime. But you can imagine that for any Haskell type X, "IO X" is a syntax tree of a side- effecting C program that produces an X.

Q: I see. So getLine really is the same value all the time. But how do you "run" the syntax tree that's hidden inside getLine, to actually get a String?

A: You generally don't. Instead you combine them together into one large tree and call it "main", and the runtime takes it from there.

Q: That seems like a lot of work. At the very least, why doesn't the language add some special syntax for combining syntax trees, so people don't have to deal with plumbing?

A: Yeah, that's what monadic do notation was invented for. Unfortunately, it was a bit too successful and some people started confusing it with actual imperative code :-)

<comment><USER3> "and then the runtime takes it from there" is of course the right answer, but _no one_ upon first encountering Haskell understands the distinction between "the language" and "the runtime", so all the insistence that "the language" is "purely functional" is utterly misleading.

Furthermore, the claim that "getLine is really the same value all the time" is false. If that were the case, then any operation on getLine would return the same value, which it does not.

Edit: And in any case, the question is not whether "getLine" is a function, but whether "notpurelyFunctional" is. It has the signature of a function, but its return value certainly doesn't depend only on its arguments, or we would be able to say if value1 == value2 was true or not, and we can't.

Basically, any claim with the word "really" in it evaluates to false (in philosophy claims about what is "really" or "really really" true are sometimes enhanced by what is known as "a certain percussive emphasis.")

I think monads are an incredibly clever way of working side-effects into a language while maintaining an interesting level of functional purity. But the way the concepts are presented are just not conducive to conveying them to newbs, who will rightly call bullshit based on what words like "the language" are normally construed to mean.

<comment><USER4> > _but its return value certainly doesn 't depend only on its arguments_

Note that value1 and value2 are not, and cannot possibly be, return values of notPurelyFunctional. The type of notPurelyFunctional says its return value has type IO Double, but value1 and value2 have type Double. IO Double is not Double, doesn't contain a Double, and cannot be converted to Double by a function call.

It sounds like you still think that the syntax "do x <\- foo" means something like "let x be the result of some function call involving foo". Actually it can't be anything like that, it translates to something more compicated.

> _If that were the case, then any operation on getLine would return the same > value_

Yes, and moreover, any operation on notPurelyFunctional 5.0 always returns the same value.

You have my honest word that I have some experience with Haskell and believe these things to be 100% true, with no wishy-washy philosophical caveats. I know exactly how to write an interpreter in which the machine representation of something like "notPurelyFunctional 5.0" will be immutable bit-for-bit, without using any dirty tricks like pointers to mutable memory. And I know that it's immutable in actual Haskell implementations as well.

</comment></comment></comment></comment></comment><comment><USER5> Hehe, "she". Great. I think the project would be better off with less bad jokes in the README.

<comment><USER6> The unfortunate part with regard to your wish is that Dr. McBride is a professional punmaker who was poached by Strathclyde for his side hobby in theoretical computer science.

<comment><USER7> AFAICT, this (the punmaking, and language games in general) is actually a prime attribute of PL researchers, at least in several major PL subdisciplines. It's been awhile since I've cracked open the POPL proceedings or the like, but ... wow, just wow.

One of my favorites was a (peer-reviewed, published!) paper with this gem of a footnote in the first column: _This work supported in part by cinder blocks._

<comment><USER8> I've noticed this as well. Why is PL so punny?

Related question: are there other interesting quirks of various CS subfields?

<comment><USER9> Because they are _language_ professionals, who enjoy studying languages and packing as much power as they can into a language -- computer or human.

<comment><USER8> In my experience, linguists are _not_ terribly punny, though -- what accounts for this difference?

(FWIW, my first-hand experience has mainly been with psycholinguists and functional programming folks)

<comment><USER10> Linguists are language _analysts_ whereas programming language people are language _creators_ ; perhaps this explains why the later _create_ more wordplay?</comment></comment></comment></comment></comment></comment></comment>


A tale of two cryptocurrencies: Ethereum and Bitcoin's ongoing challenges - <AUTHOR> https://tonyarcieri.com/a-tale-of-two-cryptocurrencies <comment><USER2> >So really "Segregated Witness" is about segregated signatures. Why the wacky name with the word "witness" then? I'm not sure… I think Bitcoin people just love inventing jargon.

Witness is standard term in cryptography, Bitcoin people did not invent it. For instance a signature can be a witness to the fact that you hold a particular private key[0].

>I am also confused about the security properties of the Lightning Network. What happens when one of the hubs gets popped? Can someone steal all of the unsettled transactions? Suddenly this proposed scaling element starts taking on the security properties of Bitcoin exchanges, which are notorious for being popped.

If "a hub gets popped" the attacker should be not be able to steal the unsettled transactions. If we were trusting the hubs, like say how we trust coinbase, the LN would be much much easier to design.

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

</comment><comment><USER3> >I am also confused about the security properties of the Lightning Network. What happens when one of the hubs gets popped? Can someone steal all of the unsettled transactions? Suddenly this proposed scaling element starts taking on the security properties of Bitcoin exchanges, which are notorious for being popped.

No, the whole point of LN transactions is that you do not need to trust intermediary nodes, or 'hubs', as he calls them. Every transactor has a copy of a valid Bitcoin transaction that will settle payments owed to them and these debts are collaterized by lock-timed money on the blockchain. It is theoretically totally secure.

</comment><comment><USER4> The whole blocksize debate is pretty strong evidence IMO that bitcoin's leadership is completely broken. They took what was a trivial to implement, obviously correct (in the sense of program correctness) fix: double the block limit. And turned it into two complicated solutions that do little to address the underlying issue.

It's hard to imagine a more clearcut example of exactly the sort of bad engineering practices that will doom any project.

Ethereum on the other hand has serious issues, but they seem fixable. If Vitalik is willing to seriously rethink the design of Solidity and make greater efforts towards formally verifiable contracts, and then they get proof of stake working, I think there's some chance it could actually achieve some of the hopes of cryptocurrency enthusiasts. Unfortunately i'm not sure how willing they are to modify the language to make it more verifiable.

<comment><USER5> > They took what was a trivial to implement, obviously correct (in the sense > of program correctness) fix: double the block limit.

Not to mention, 2MB was a _compromise_ from 8MB which was a _compromise_ from 20MB.

Where's the compromise from the other side?

<comment><USER4> Ya. It's absolute silliness. Rushing in these complicated solutions just to avoid some half-baked slippery slope argument about the block size. You don't need to keep raising the block size forever, just do it until you have a good, clean solution to the scaling problem.

<comment><USER5> Agree about slippery slope. There has been so much misinformation and propaganda spread that some people are now convinced that a fork to change any consensus rule could lead to the change of _any_ consensus rule - even the 21M coin cap. The result is that the community has become polarized and toxic over something that ought to be noncontroversial.

</comment></comment></comment></comment><comment><USER6> I tried to read and understand the Lightning Network paper recently. Glad I'm not the only one:

 _If I've gotten anything wrong here, it's because the Lightning Network is ridiculously complex: the paper is some 57 pages written in blockchainiac gobbledygook terminology. I'm the sort of person who reads academic papers for fun, and can attest that this is not a paper I remotely purport to understand or enjoyed reading. I think there are very few people on Planet Earth who have read this paper and understand it._

If you're one of these Very Few People and you're reading this, a question: do Lightning's channels only reduce on-chain transaction volume in the case of recurring payments (eg subscriptions)? What is the anticipated savings if the Lightning Network is rolled out -- how much of current transaction volume could be handled in channels?

<comment><USER7> I don't know Bitcoin well enough to understand the LN paper, but I've read articles on the basic ideas and think I understand enough to implement LN on Ethereum, where it's much easier.

If channels were not networked together, then they'd only be good for recurring payments.

But there's a trick that lets you network them, so A can have recurring payments to B, and B can have recurring payments to C, D, and E, and now A can pay all the others via his one channel to B. And it's done in a way that prevents B from being able to run away with money intended for C,D,E.

<comment><USER8> > LN on Ethereum, where it's much easier.

Genuine question? What makes it easier? Thanks!

<comment><USER9> Bitcoin script provides a no elegant way to invalidate old states. There are various solutions to this in lightning network tx but they end up requiring actively watching the network in case an old state is broadcast. If you have a better mechanism for invalidate the previous state, the whole system can be massively simplified.

<comment><USER8> You mean, every transaction causes an on-chain ethereum change? That seems to miss the point?

</comment></comment></comment></comment></comment><comment><USER10> Tallying pages, flowcharts and formal specifications is no basis for scientific evaluation.

Coming from a Bitcoin background, I found the Lightning paper quite a refreshing read compared to pure academia papers. The ideas behind are very clever, several implementations are under way and implementors are building interoperability standards along the way ([https://github.com/lightning- core/lightning](https://github.com/lightning-core/lightning)).

</comment><comment><USER11> Somewhat off topic, could someone post a list or examples of non-trivial (or relatively, non-trivial) decidable languages that have implemented compilers/interpreters? I should say no requirement on supported hw architectures, nor currently active development/maintenance.

<comment><USER12> Agda is a programming language where "each program in it must terminate and all possible patterns must be matched. Without this feature, the logic behind the language becomes inconsistent, and it becomes possible to prove arbitrary statements."

Since all programs terminate, reasoning about arbitrary properties about said programs becomes decidable.

<comment><USER11> Thanks for the pointer. It appears that proof assistants [0], like Aqda as you mentioned and one of its influences Coq [1], have the properties I were describing and indeed are examples of total functional programming [2].

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

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

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

</comment></comment></comment><comment><USER13> Bitcoin's challenges seem to be a matter of current implementation, while Ethereum just seems like a bad idea, implemented as well as a fundamentally bad idea could be.

<comment><USER14> Ethereum is a platform for decentralised applications, it has far more pratical use than a simple blockchain like Bitcoin, but far more risks as well. Give it a chance, it's just starting, there is a lot more development to do, don't throw it away the first bad thing that happens. Can you imagine if the early internet architects thought this way? "Oh this computer in the network got hacked, lets give up on this whole internet thing, it's a fundamentally bad idea". There will be ups and downs. IMO, right now Ethereum is the best chance we got at a truly decentralised web.

<comment><USER15> The idea of smart contracts is a good one. The design of this particular implementation (Ethereum) is a bad one, mostly for the reasons identified in the original post. The complexity -- and more importantly the undecidability -- of the contract language ensures that ethereum will never take off as a working solution. People will never be able to trust that a DAO-like attack isn't lurking just under the surface of their contracts.

<comment><USER14> Well that's the same with any software and service isn't.. If I put my company precious data on AWS, there is a chance it will get hacked, it's a matter of taking precautions and trade offs.

We need to think of better tools & practices to secure contracts. It's still all new, there will be issues, there will be improvements. The end goal is worth it IMO. My main Interest in Ethereum (and Maidsafe) like most developers in the community is not so much money but the dream of having a truly decentralised web one day. Impossible? maybe, but I'm willing to try.

<comment><USER16> As I understand it:

It's true of any platform, but Etherium is at a far higher risk of getting hacked because the language is Turing complete. There could conceivably be a smart contract blockchain with a simplified language that was still capable of most of Etherium's good sides with the safety net of static verification tools.

<comment><USER14> ALL general purpose programming languages (C++, Java, etc..) are Turing Complete and this is an essential feature for creating decentralised applications (or any software really).

<comment><USER17> Um, no, that's just factually incorrect. You can do very, very many useful things without Turing completeness. You cannot be fully general, but there's active research on how far you can get. Restricted subsets of query languages like SQL and Datalog are perhaps the most common (though more or all SQL implementations are Turing complete) and indeed quite useful.

I can easily imagine a system built on a non-Turing complete logical query language that defines data and rules for presentation. You could get pretty far with that. You can't create _any_ application, but calling Turing completeness "essential … for decentralized applications" is incorrect. It's essential for a _subset_ of applications that require Turing completeness.

I've been saying ETH is broken for a while. Its computational ability means contracts _cannot_ be formally verified. This is why I didn't buy into the DAO, and sure enough there's a bug in the DAO (ironically recursion related).

<comment><USER18> People are under the impression that _not_ being Turing complete is somehow enough to be feasibly verifiable. If we place (realizable) computational models on a scale, with 0 being no computation at all, and 10 being Turing completeness, then the computational models we can generally verify are somewhere between 0 and 1 (with 1 being, say, FSMs). A language with no loops, no recursion and just subroutines and binary variables -- i.e. it's an FSM -- is already PSPACE-complete to verify, meaning we can only verify only very short programs in that language. In other words, you need to get _very_ far from Turing completeness to be generally verifiable.

This is why in general software verification doesn't try to come up with languages where _all_ programs are verifiable, but aims to verify specific programs, sometimes regardless of the computational strength. Some programs in Turing complete languages can be verified (but certainly not all), just as some programs in FSM-strength languages can be verified (but certainly not all).

While it is certainly possible that a much bigger subset of, say, FSM programs can be verified than a subset of programs in TC languages, placing the bar at "Turing complete" is somewhat of a red herring.

Indeed, the LANGSEC link in the post[1] seems to understand that, noting that even verifying PDAs is undecidable, but it fails to note that even decidable verification tasks (for FSMs) are very often intractable, which -- for all practical purposes -- is just as bad as being undecidable.

[1]: [http://langsec.org/occupy/](http://langsec.org/occupy/)

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER19> Can someone explain to me how these decentralized systems make our current system more economically efficient? I just cannot see why anyone would actually use it outside of the illegal market.

<comment><USER20> It takes 3-5 business days for a bank transfer. Bitcoin takes 10 minutes, and ethereum takes seconds.

10 minutes is more efficient than 3-5 days.

<comment><USER21> Except that if you fail to include a transfer fee big enough, your transfer may take weeks, or never even get confirmed at all. Case in point: I've been trying to actually buy something with my BTC in the last few days, but because my wallet is an older version or something (with a small default transfer fee), my transfers are seen by just one peer and then are not confirmed. I dunno, last time , 2 years ago, when I paid / transfered bitcoins, it took 10 mins max. I guess the mining business has increased or changed since then.

<comment><USER22> Your "wallet" is a key. It's data. Upgrade your client.</comment></comment></comment></comment>


Fbbotbot.im Update Facebook from IM client - <AUTHOR> http://www.facebook.com/apps/application.php?id=118071741585200 This is a facebook application that allows you to post statuses on facebook. Its very simple add the BOT ( firstname.lastname@example.com ) to your IM client. It will ask you to allow the application, as you allow it provides you a CODE that you have to send in chat bot. If you want to delete the bot, i mean you want to stop using the application. simply send DELETE and block the bot. and remove the application from http://www.facebook.com/settings/?tab=applications<p>Created and submitted by @motyar <comment><AUTHOR> Hows it?</comment>