Notch's 48-hour game: Prelude of the Chambered - <AUTHOR> http://s3.amazonaws.com/ld48/index.html <comment><USER2> Notch's game appears to be a reinterpretation of "Chip's Challenge".

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

<comment><USER3> Easily the best game to ever be included with Windows.

</comment></comment><comment><USER4> Here's my entry: 'Harvest' - On g+ as ludumdare.com seems to be down. [https://plus.google.com/117952639955495935037/posts/DyEXjhmF...](https://plus.google.com/117952639955495935037/posts/DyEXjhmF43U)

Edit: Notch's entry keeps saying "Click to focus" for me. Even when I click to focus... hmmm.

<comment><USER5> Reloading helped for me.

— edit: That's a great little game you made there. A lot of fun!

</comment></comment><comment><USER6> For those who didn't watch the stream:

The game is a Zelda-inspired, first person, 2.5D dungeon crawler written in Java.

__Modus operandi:__

1) He first built a robust engine, very powerful from a game developing standpoint. Building the various types of blocks (walls/grounds/objects) and entities (player/ennemies/bullets/boulders) needed remarkably little code afterwards.

2) He used Paint.NET as a level editor, and color-coded the blocks and entities. He used the alpha channel to identify the switches, the doors, the ladders and the ennemies (from 255 downwards). Doors and switches are automatically linked by id. This allows to put all the level design logic on the map.

3) The most important: short iterations. He spent more time play testing the game than writing it, systematically retesting the old stuff when he introduced a new feature, or even after changing a detail.

4) He's sharp, knows his tools, edits the code very fast and makes few mistakes. He also has a lot of experience, which allowed him to make good initial decisions that facilitated the development process.

__The platform:__

Java+Eclipse turns out to be an excellent platform for writing games.

While it doesn't have a REPL, its debugger allows to patch the code while it is running, offering a very dynamic environment, especially to tweak the gameplay. It felt very lightweight. I wonder if the other JVM languages have similar debugging facilities.

The simplicity of the language makes the code easy to read and modify (provided you have a sound initial code base). Once you get used to it, the boilerplate becomes transparent (like the parentheses in Lisp).

The refactoring abilities of Eclipse are excellent.

The speed of the JVM allows to write fast low level code, and its object system make it straightforward to organise the high level logic.

__Some tricks/hacks:__

All textures are drawn in 4 shades of gray, then colored when they are loaded. It allows to reuse the wall textures for all levels, and to differentiate the bosses from the normal ennemies, at no cost, etc.

His playsound function creates a new thread every time it is run.

If I counted properly, there is at most one level of inheritance, even where more would have made sense from an orthodox OO design standpoint. There's some code duplication, but he only duplicated robust, well tested code.

The low resolution and limited palette allows the rudimentary graphics to look good (old school). The animations have only two frames.

.

.

On a side note: Did someone save fist few hours of the stream, when he wrote the 3D engine? I couldn't watch the process, and his Livestream account has been deleted.

<comment><USER7> (I can't access YouTube at the moment to verify the link)

Notch coding "Escape" - 20.8.2011 livestream

www.youtube.com/watch?v=QYBUCYUNn3Q

<comment><USER8>
      Unfortunately, this video is not available in Germany
      because it may contain music for which GEMA has
      not granted the respective music rights.

I hate these music industry pricks. Why did they block this? Because he's listening to some web radio in the background? That's ridiculous.

<comment><USER6> What about this?

[http://v4.cache2.c.youtube.com/videoplayback?sparams=id%2Cex...](http://v4.cache2.c.youtube.com/videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Cratebypass%2Coc%3AU0hQSVBQUl9FSkNOMF9ISlZB&fexp=914033%2C907605&itag=45&ip=0.0.0.0&signature=9AC92F7005004BF5805F0B033014FEA84A062E42.A1A24CFA769B5E197538875C96D00FFDAD98282B&sver=3&ratebypass=yes&expire=1314054000&key=yt1&ipbits=0&id=41805409850d9f74&redirect_counter=2)

It works in Firefox here (HTML5 video)

Edit: you may have to be signed in and enable the HTML5 beta. I'm saving it and will upload it later.

Edit2: It's uploading right now. It is a 720P screen capture of the live coding being played fullscreen at a higher resolution. The text is blurry but readable.

Edit3: Here you are!

<http://www.megaupload.com/?d=X9H8XYZB>

<comment><USER7> Worth its bytes in gold :) Thanks.

</comment></comment></comment></comment></comment><comment><USER9> Source code is here:

<https://s3.amazonaws.com/ld48/PoC_source.zip>

</comment><comment><AUTHOR> Hint: At the beginning punch through the wall with the space bar.

</comment><comment><USER10> May as well plug my game too:

Escape Artist: [http://www.ludumdare.com/compo/ludum- dare-21/?action=preview...](http://www.ludumdare.com/compo/ludum- dare-21/?action=preview&uid=3187)

Right now the only way to run it is to run main.py through python. I'm working on standalones.

</comment><comment><USER11> I ran out of time to do my game this weekend (Other insanities were going on, unfortunately. I managed to only spend about 5-6 hours on it all in all), but I might as well show what I did make for those curious. It's more of a concept than anything else, but I did make a couple of things that I can carry on to my other FlashPunk project, so it's all good in the end! It was a lot of fun and I wish I could have done something more, or at least relinquish myself to a simpler idea.

<http://crowbar.ripsystem.com/projects/ld21/> \- Arrows Move, A shoots.

<comment><USER12> Chromium 13.0.782.107 (Developer Build 94237 Linux) Ubuntu 11.04 user here.. just want to report that Arrows don't move, A doesn't shoot. Looks interesting though!

<comment><USER11> Noted! I'll have to check that out. I didn't do a whole lot of testing outside of the flash player/in firefox, so it may be a bug inside Flashpunk for all I know. If so, gives me a chance to do a little bug fixing for the community. :D Thanks!

<comment><USER13> FYI Chrome and Flash have a bug with Action script 2. So if you're using AS2 for that game that's why his controls don't work. <http://www.newgrounds.com/bbs/topic/1265535> second paragraph.

</comment></comment></comment></comment><comment><USER14> It was definitely fascinating to watch for a while. I would actually love to watch live coding with commentary of some good programmers, I imagine you could learn a lot from it.

<comment><USER15> On peepcode.com you can find several screencasts where you can watch experienced developers working on a mini-project while thinking out loud The series is called "Play by play". Here's the one with Zed Shaw: <http://peepcode.com/products/play-by-play-zed-shaw>

The others can be found here: <http://peepcode.com/screencasts>

Furthermore, there's <http://www.cleancoders.com/> by Bob Martin. For several of the available episodes there are screencasts available in which he TDDs on some task, e.g. here: [http://www.cleancoders.com/codecast/clean-code- episode-3/sho...](http://www.cleancoders.com/codecast/clean-code- episode-3/show) Those screencasts are bonus material, so to speak, the actual episodes are well worth the watch, too.

All those screencasts cost money - but imho they're very well worth it!

<comment><USER14> Thanks for the links, I'll definitely check them out.

</comment></comment></comment><comment><USER16> Trust Notch to make a low-fi 3D game about punching bricks. Pretty awesome though!

</comment><comment><USER17> I know one could watch the complete livestream, but I wonder if the source is also available somewhere. I'd love to dive in and understand some of the complexities without time constraints. Great game.

<comment><USER18> So you don't miss it, <http://news.ycombinator.com/item?id=2911794>

</comment></comment><comment><USER19> I wish more people would have joined the competiton than just watch Notch, but I guess thats just how things go. This was my first Ludum Dare competition and I had a lot of fun.

<comment><USER20> eh? there's usually several hundred _completed_ entries in any LD48.

<comment><USER19> And there was tens of thousands of people who watched notch at some point.

<comment><USER21> Tens of thousands of non-programmers. A few minutes spent in the livestream chat feed was enough to drive a sane man to madness. 50% of comments were asking if the stream was minecraft 1.8, the other 50% were rude comments about Notch's marriage/weight/work ethic/etc.

<comment><USER22> Many of the people asking if it was Minecraft 1.8 were just doing it to bother others.

<comment><USER23> The MC 1.8 people were, but a LOT of people were also "what compiler is he using?" and other similar questions that showed the one asking had little to no knowledge of programming. I'd bet at LEAST 60% and probably more like 80 had minimal to no knowledge of how to write real code.

</comment></comment></comment></comment></comment></comment><comment><USER24> can anyone actually get their browser to give the applet focus?

<comment><USER22> Yes. Firefox on Linux with OpenJDK works for me. You could try downloading <https://s3.amazonaws.com/ld48/index.html> and <https://s3.amazonaws.com/ld48/PoC.jar?v=9>, then running it with `appletviewer index.html` from a terminal.

The controls are WASD+QE (or arrow keys), space, and the number keys to switch items.</comment></comment>


Ask HN: How do you come up with ideas when your to-do list is empty?  - <AUTHOR>

Fellow entrepreneurs. What do you usually do when you are out of tasks? Where do you get new ideas? Actionable advices preferred, thanks. <comment><USER3> To quote _Alice in Wonderland_

`Cheshire Puss,' she began, rather timidly, as she did not at all know whether it would like the name: however, it only grinned a little wider. `Come, it's pleased so far,' thought Alice, and she went on. `Would you tell me, please, which way I ought to go from here?'

`That depends a good deal on where you want to get to,' said the Cat.

`I don't much care where--' said Alice.

`Then it doesn't matter which way you go,' said the Cat.

 _What are your goals?_ If you break your goals down, you generally end up with more tasks than you can possibly action, which is where time management and methodologies like lean come in.

Those methodologies generally break down to one question "what is the best thing you can do now to advance you towards your goals?", where best is tricky to measure but includes reducing uncertainty, maximising reward, minimising investment, and so on.

 _What is the best thing you can do now to advance you towards your goals?_ Once you know that, why would you want to work on anything else?

Remember not to fall into analysis paralysis: meta-tasks like working out your goals or which task is best are tasks too, so evaluate them against your goals too. Don't be afraid to go with your gut and re-evaluate afterwards.

</comment><comment><USER4> Grab a notebook or keep your phone handy. Write down some inefficient or problem you are faced with or observed.

OR....

Partner with an "idea" guy and steal... borrow? s/he ideas :) ha! - <USER2> seriously, there are a TON of real problems that just need a better technical solution. - Go attend a conference or meetup that you would never think about - Nontechnical - e.g. education/teachers or a space your interested in working in - city council meetings.

Just a thought - good luck!

</comment><comment><USER5> Take a quick look at the news (in your sector/from your competitors), and then take a walk. It's amazing what will mix around in your head while you're out doing something else, away from a screen.

</comment><comment><USER6> Watch a user use your widget. If that doesn't generate ideas of things to improve you're just not paying close enough attention.

</comment><comment><USER7> Check out the competition.</comment>


Can you solve it?  The Greplin programming challenge - <AUTHOR> http://challenge.greplin.com <comment><USER2> Seems like I may be the only person to have used a bioinformatics approach to the first problem! bl2seq to the rescue!! I'll explain my approach if anyone seems interested... as I am not sure if posting solutions is acceptable here.

Edit: As others seem to be posting gist/snips etc. so I guess it is OK.

Step 0 - Copied parent string to file: p1.txt

Step 1 - Used python to reverse the entire string and copy to second file: cat p1.txt | python -c "print raw_input()[::-1]" > p2.txt

Step 2 - Formatted the two files, so as to be parsed as FASTA, by adding sequence name headers.

Step 3 - Use bl2seq (blastp) locally or online to align the two "sequences". Final alignment shows only one major chunk of identity, i.e. the answer.

So, in essence, a dynamic programming algo would work.

<comment><USER3> If bl2seq gets the longest common subsequence I did exactly the same thing. In haskell it just seems the right thing to do. Actually it would be damn interesting to see if there are patterns in the solutions for every programming language.

</comment></comment><comment><USER4> _"Even if you're not looking for a job, we'd love to hear what you thought about the challenge."_

I would be curious how many people did you lose because of phonecall requirement (before you changed it).

Also CSV for just a list of 22 numbers wasn't really necessary.

If you do web puzzle, the best is to keep everything self-contained, no downloads, no using external channels, just copy and paste.

FYI another Python cheater here (+Wolfram Alpha & Wikipedia, I'm lazy :).

<comment><USER5> I don't think trivializing the combinations with Python's builtins, looking up the fib primes with OEIS, or computing factors with Alpha is cheating. I hope, in fact, it's the whole point of the exercise: choose the right tools for the job. If you're writing code to test primeness or generate Fibonacci numbers, I sure as hell don't want to hire you.

<comment><USER6> _If you're writing code to test primeness or generate Fibonacci numbers, I sure as hell don't want to hire you._

Maybe you should have called it the "Greplin Challenge," then, instead of the "Greplin Programming Challenge." It's not a real task, after all; the reward comes from accepting a completely artificial challenge. I'm going to do the challenge before dinner tonight, and before I leave work I could get source code for the solutions from the guy down the hall from me who did the challenge as soon as it was posted -- and you certainly don't want to hire a guy who recodes other people's work for no reason, right?

<comment><AUTHOR> Maybe we have a different hiring mindset than dschoon - we're equally happy with people who find the answers or create the answers. In a production system, we certainly wouldn't want hand-rolled primeness checking. But in a programming challenge, we think it's fun to write it for yourself.

<comment><USER6> Oops; I wrote my comment under the assumption that dschoon was with greplin, and in retrospect I'm not sure why. Sorry about that.

</comment></comment></comment></comment></comment><comment><USER7> I think this would've been a better filter for hiring if the magnitude were larger (e.g. huge string, more numbers for the combination, etc) or if there was a strict time limit. As it is right now, I don't think the hardcore hackers you're looking for will be that enticed.

<comment><USER8> I think that you'd be surprised at the sheer number of applicants a very basic programming challenge can weed out. The company that I work at has a simple test to parse a csv file and a surprising amount of people who appear to be good candidates bomb it.

</comment></comment><comment><USER9> Do I get bonus marks for solving this without writing any code?

<comment><USER10> I immediately went to Wikipedia, found out what type of CS problem the first challenge was, then followed the external links at the bottom of the page to find the Perl module I needed and installed it from CPAN.

I quit because this seemed like cheating but now I'm thinking... Maybe it was the point? To see if I would try to find something off-the-shelf to solve the problem quickly. Still not sure it was, because if so the challenge certainly doesn't demonstrate that I have any CS chops. :-\

Spoiler alert: I believe this module will do the trick [http://search.cpan.org/~gray/Tree- Suffix-0.21/lib/Tree/Suffi...](http://search.cpan.org/~gray/Tree- Suffix-0.21/lib/Tree/Suffix.pm)

<comment><USER9> I didn't solve the problems using existing code either. All three are entirely solvable by pencil and paper (or just inspection in the first case).

<comment><USER11> How do you go about solving #2 on pen and paper? Well, calculating the Fibonacci sequence, ok. The sum of prime divisors of X+1, I guess... though it gets slightly harder for me after dividing by 2, 3 and 5. But how do you know for sure that X is prime?

Based on bd's link, I'll just assume that you have super powers. (or I'm approaching the problem the wrong way)

edit: I was starting to think about what to write for #1, but ended finding the answer by looking at it as well.

<comment><USER12> You can use the Sieve of Eratosthenes to generate primes with pen and paper very easily. Or, you could find a roll of paper and evaluate any computable function (assuming unbounded paper). ;)

<comment><USER11> It doesn't seem to make it especially easy: you still have the same problem of having to eliminate the multiples of 61, 79, 89, etc. which are not obvious. Yes, you can count, but it looks very time-consuming.

The problem still stands that one needs to go in the 500,000s for that problem (thus 700s for the square root). That's still a long way to go…

I'm really curious about how cperciva did it. You're supposed to find the first Fibonacci prime over 227,000. The first Fibonacci number over that is obviously not prime (multiple of 3), but the one after that is not obvious even if you have the list of primes obtained with that method.

</comment></comment></comment></comment></comment></comment><comment><USER13> Nice and short Haskell solution to #3: <http://gist.github.com/617675>

Ruby solutions to #1 and #2: <http://gist.github.com/617676> <http://gist.github.com/617678>

<comment><USER14> Nice, but don't compute the length of a list if you don't have to.

(not . null) instead of (\x -> length x > 1) is shorter, and works on infinite lists also.

Edit: well, in case you would test for x>0.

</comment></comment><comment><USER15> That was fun, good waste of time while my code was compiling. I just used C++ and hacked up a prime seive for #2 and for #3 used a combination generator I had previously used before - <http://photon.poly.edu/~hbr/boost/combinations.html>

<comment><USER9> _for #3 used a combination generator_

Congratulations, you just used an exponential-time algorithm for a polynomial- time problem.

<comment><USER16> Congratulations are in order, he sacrificed 400ms CPU time to save at least a few minutes of coding time.

<comment><USER9> I wasn't being entirely sarcastic. It never occurred to me that you could use a non-polynomial-time algorithm.

<comment><USER17> All the solutions posted here seem to involve generating all subsequences. Could you say more about your approach?

</comment></comment></comment></comment></comment><comment><USER18> I'm usually pretty bad at these kind of challenges (lately I tried registering at one mind-challenges site, but I couldn't even get past the five entry-level questions, which would have allowed me to even register), but this was surprisingly easy. Simple brute-force methods worked for each of the three tasks. I was totally surprised that the first time I entered the answer for each of the tasks, it was indeed the correct one.

But then again... these are all pretty standard computer science problems, nothing that I hadn't in some way done before.

On a side-note: Interestingly I used recursion for each of the three problems. Well... actually for the primes-problem I got stack overflow and rewrote it to not use recursion, but still, at least in principle :=)

<comment><USER19> Agreed - I was laughing as I was writing some of my code because it was so bad. These sort of questions are designed around algorithm design, but a one- off problem with these small of sample sets doesn't need an elegant solution - a hatchet job does just fine. I'm not a CS grad and my math skills are a bit iffy, but I was able to solve all three challenges in a pretty reasonable amount of time.

</comment></comment><comment><USER20> Uh ... call a phone number? No thanks.

Edit: Excellent! Back to hacking.

<comment><USER21> I'm curious to know why calling a phone number was a deal-breaker.

It seemed eminently likely (to me) that it would be an automated system, but, even if it wasn't, talking to someone isn't that big a deal to me. I certainly wasn't concerned about long-distance charges, but I suppose that might be a problem for some.

I thought it was a nice little twist in the problem set.

<comment><USER22> _but, even if it wasn't, talking to someone isn't that big a deal to me._

A lot of people struggle with the phone. I certainly have, though I'm getting better at it. I've noticed many people become spookily compliant on the phone, endlessly listening to and being polite to even the most annoying callers instead of just hanging up.

</comment></comment></comment><comment><USER23> Oh my god, Haskell is so pretty. This is the first time I've used it to solve math problems. Is it kosher to share solutions?

<comment><USER24> I gist'd one because I saw others sharing. I'd be curious to see how you did things in Haskell.

</comment></comment><comment><USER25> Damn, I have to go in to work early today or I could continue this. The first one only took a minute or two of coding to solve in Perl. The search string was several times longer than my code, even with use warnings & use strict in there.

I'd write a bit of code to memoize the function before I'd do the Fibonacci numbers, though, and I just don't have time to continue right now, even though it's pretty easy. Are the rest of the tests like that? Do they force you to use more efficient code, rather than simpler brute force tests so that your code has a decent runtime?

<comment><USER26> brute force seems to be sufficient

<comment><USER27> you also probably don't want to memoize, you aren't going to re-use, so why waste the memory?

<comment><USER25> I wrote that right before leaving for work, so I hadn't spent any time thinking about the problem.

Coming back, I see that I really don't need to be very efficient for any of these problems, which I honestly find a little disappointing.

</comment></comment></comment></comment><comment><USER28> So what languages did everyone use?

I decided to try a different one on each level, so I used Python, bash (letting GNU coreutils 'factor' do the hard work), and Haskell, respectively.

<comment><USER18> Ruby was my main choice + some command line tools to do bits of extra work, like 'sort' to find the largest palindrome and 'wc' to count the results in last exercise, and even Python command line to just manually sum the primes in second exercise.

<comment><USER29> Ruby has Array#sort, no command line required.

</comment></comment></comment><comment><USER30> Wow the G. Address was horribly mutilated.

Four score and seven years ago our _faathers_ brought forth on this _containent_ a new nation conceived _inz_ Liberty and dedicated to the proposition that all men are created equal Now we are engaged in a _greaht_ civil war testing whether that _naption_ or any _nartion_ so conceived and so dedicated can long endure We are _qmet_ on a great _battlefiemld_ of _tzhat_ war

<comment><AUTHOR> This was intentional - we had to tie break the longest palindrome and we didn't want a quick diff to be able to see what we changed.

<comment><USER31> Never mind that finding the actual text, removing the spaces and caps, and running diff would probably take longer than coding and executing a brute force algorithm :P

</comment></comment></comment><comment><USER32> The last question isn't that difficult if you brute force it and have loads of memory. I tried to do it in python using itertools on my work thinclient and got a memoryerror. If you however break up your combinations.. you're good to go!

Fun, made my day. Good idea greplin dudes!

<comment><USER33> Not sure what you'd need the loads of memory for?

        int[] nums = {...}
        for i = 1 to (2^length(nums) - 1)
            int[] possibility = { nums[x] where (2^x bitand i) > 0 }
            test possibility and perhaps increment hit counter

<comment><USER32> I was at work on a crappy thin client and first tried to run list(itertools.combinations(sequence)), which was crapping out. After I switched it to itertools.combinations(sequence,i) and put that right into my for loop it was fine.

</comment></comment></comment><comment><USER34> I've generally done well on job-interview programming challenges and gotten interviews afterwards. But looking on these quiz things, I'm still frustrated by them.

You see, all the "ordinary" question involved in job-fitting still have to be asked and answered so sometimes I've done great in ability part only to have really basic "culture" or requirements issue hit later when they could have been caught immediate.

And so, even though I've enjoyed and learned something on these quizzes, the employer who _begins_ a relationship with a quiz seems to be saying they can demand some piece of my time without any investment on their part and this isn't setting a _tone_ reciprocity, something I'd look for in a future employer.

</comment><comment><USER35> Too easy to solve by brute force. I'd suggest looking at Project Euler for inspiration.

<comment><USER6> I'm a little bored with Project Euler after solving the first 40+ problems with brute force or near-brute force algorithms. If I wasn't using it to learn a new language, I would have quit already. As it is, after solving one problem I usually quit for the day instead of moving on to the next. When do the problems pick up?

<comment><USER35> Well that depends on your level of expertise :-) I start to have unsolved problems around #60, but found I had to start getting pretty clever long before that. The highest number I've solved is 112, and the one before that is 102. YMMV.

</comment></comment></comment><comment><USER36> 1-2 hours! Great...now my productivity will be shot for the day.

</comment><comment><USER37> Here's mine: <http://gist.github.com/618459>

I didn't see the point in doing this in anything but C. I tried it without cheating, and to make it as interesting to myself as possible. Also did it after a week of writing briefs, so that was a nice way to unwind from that! Pretty Fun.

Anyway, if I'm applying for a job (which I wasn't), the last thing I'm going to do is send in a bunch of one-liners.

</comment><comment><USER38> This really doesn't reflect a programmers skills in anyway. I managed to write ruby to solve the problems, but I approached it to do for fun. Brain teasers aren't going to weed out the good from bad.

Also, considering the instructions explicitly say "write code to..." I would say using tools that give you the answers is in fact cheating. It's like math test where you have to show your work.

</comment><comment><USER39> IMHO, these contrived puzzles, while fun, are really unrealistic and don't map well to problems you'll encounter on the job which requires knowledge, experience and creativity and do not have just one answer.

Of all of the jobs-page challenges, thesixyone's is probably the most practical and I've seen:

<http://www.thesixtyone.com/static/jobs>

</comment><comment><USER40> What about a puzzle system system -- Companies can post/host questions and then review the answers. I've drafted a quick blog post if anybody wants to comment more directly... Maybe I'll make it this weekends projects (since my frid.ge clone was killed by Facebooks new groups).

<http://bit.ly/b6GC6F>

</comment><comment><USER41> Python powerset() with max(), list.remove(), and sum() builtins made the last problem's solution ~5 lines long :)

<comment><USER24> I don't know about powerset(), but challenge 3 was pretty trivial using Python's itertools module: <http://gist.github.com/617663> (warning: spoilers)

</comment></comment><comment><USER42> I thought the challenge was to solve everything with "grep" because of the "Greplin" title.

</comment><comment><USER43> Here's better-than-brute-force solution to Q1 <http://gist.github.com/617715>

Is there a better algorithm? Dynamic programming of some sort? I guess we'd need a longer string to tell the difference.

<comment><USER27> I can't read ruby, but here's something a little smarter than brute force in C (on its way to DP, but I couldn't be arsed to work out the recurrence so I just iterated until it stabilized): <http://gist.github.com/617854>

<comment><USER43> It looks similar to mine, but you got lucky (or unlucky depending on how you look at it) that the longest palindrome had an odd character count.

The confusing bits in the Ruby are actually just the definition of an even and odd palindrome finder, which are the same except for two seed values for where the first comparison is conducted and it's length.

<comment><USER27> oh whoops nice catch thx

</comment></comment></comment></comment><comment><USER44> Took < 10 minutes. The problems were very, very easy. If they expect people to take 1-2 hours and have trouble with this, then the message that I would take away from this is that their hiring bar is quite low.

<comment><USER45> [http://www.codinghorror.com/blog/2007/02/why-cant- programmer...](http://www.codinghorror.com/blog/2007/02/why-cant-programmers- program.html)

</comment></comment><comment><USER46> <http://codepad.org/rdSirAkD> \-- Solution to third problem in 26 lines of ruby _without_ using combinations. It's pretty fast too, gives the answer in 0.020s.

</comment><comment><USER47> Any points for solving part 1 just scanning the text for something that stood out?

Seriously though, this is awesome. I'd love to know how you guys do in terms of # of applicants and the end-result (any hires?).

</comment><comment><USER48> solutions in python <http://gist.github.com/617686>

about 30 lines of code in the tersest style, 40ish in the readability- obsesssive style I prefer

<comment><USER25> I see that you did brute force primality testing, too. Am I the only one who at least only divided by _odd_ numbers (and two) in their brute-force is_prime function? Technically, you only need to test divide by all primes less than or equal to sqrt(n), after all.

I guess I could have used a faster primality test, but I didn't feel like writing anything that complex. I know there's a website out there that has a test that works for anything under about 10 billion, if memory serves, by using the probabalistic tests and doing a special check for the only exception. Heck, it even gives you the factors for the largest number in its range...

<comment><USER48> this code solved the problem in under 1 second.

I would say for code that is executed one time ever, even including the sqrt(n) part is premature optimization (though I did include it)

</comment></comment></comment><comment><USER49> I did the naive implementation for problem 1. (double loop, O(n __2)), in Javascript. Took chrome about 1 minute to compute the comparisons of all strings. I'm so lazy.

</comment><comment><USER50> Difficult level is about the same as Project Euler's problems 1x

</comment><comment><USER51> Anybody else browsing by mobile try to do Level 1 by inspection?

<comment><USER52> Brute works here because of bad test case. Author could have generated a smart test case and then optimal algorithm could be using suffix array which takes O(n), brute would take O(n!). However a bit smart brute gave the answer in approx 3-4 minutes ( computation + coding time). And yes, Python FTW.

<comment><USER53> Isn't brute force just O(n^3)? Loop over each character to start potential palindrome, loop from start character to end, reverse substring and compare. But yeah, the test input should be longer and/or smarter. Ditto on the third problem.

<comment> brown9-2 _reverse substring and compare_

D'oh! My _is_palindrome(word)_ just got a lot shorter, thanks :)

</comment></comment></comment></comment><comment><USER54> Um, no answer on the phone. I let it ring for over a minute.

<comment><USER55> Did you forget the 1 before the area code? I did.

</comment></comment><comment><USER56> damn it had a typo in the fib generation for the second number and lost a lot of time trying to factor a _massive_ number that was obviously the wrong one :)

</comment><comment><USER57> numbers ="3,4,9,14,15,19,28,37,47,50,54,56,59,61,70,73,78,81,92,95,97].split() numbers = [int(i) for i in numbers]

def sum_eq(lst,k): total = sum(lst) if total == k or k==0:return 1 elif total < k or len(lst)==1:return 0 else: n1,nr = lst[0],lst[1:] return sum_eq(nr,k-n1) + sum_eq(nr,k)

def sum_all_eq(lst): total = 0 for k in range(1,len(lst)): total += sum_eq(lst[0:k],lst[k]) return total

</comment><comment><USER58> My C is terribly rusty, so I decided to not cheat with python: <http://sprunge.us/GiDD>

How terrible is it?

</comment><comment><USER59> Spoiler alert.

Here is my Part 1 implemented in Ruby. <http://gist.github.com/617566>

</comment><comment><USER60> Anyone know other 'challenges' like this one?

</comment><comment><USER61> My solutions, in ruby:

<http://gist.github.com/617672>

Any improvements welcome!

(warning - contains the answers!)

</comment><comment><USER62> Anyone else read Q2 as (sum of the prime factors of X) + 1? Confused me for a good 10 minutes :(

</comment><comment><USER53> Done, as usual with these things using Python feels like cheating.

<comment><USER63> The last problem was really simple in Python. I was all psyched up for a big bad end-level boss! Still, it was fun to play.

</comment></comment><comment><USER64> 35 mins, but in less than 40 lines of ruby

<comment><USER29> I used Ruby, too. Nothing else required.

I think Clojure might've made things a tad easier (given all its sequence functions), but I'm just learning it, so Ruby all the way.

That said, finding the palindromes in Ruby took me about 12 lines of code (less if I didn't structure it using methods).

</comment></comment><comment><USER65> 30 minutes. Would have been less but the IVR response was a little confusing. Took about 40 lines Ruby code to solve.

</comment><comment><USER66> what did you put as answer for the first level?

</comment><comment><USER67> too easy. about 30mins and 100 lines of C#.

</comment><comment><USER68> There are only 31 known Fibonacci primes (plus a handful probable primes)...

</comment><comment><USER69> Problem 1: 2 minutes for 5 lines of PHP code. Problem 2: 1 minute of Google and Google (why reinvent the wheel?). Problem 3: half a minute of brainwork, 15 minutes worth of tedious PHP snippet.

I got the impression that this particular test was not a good one for finding apt programmers. The questions and the solutions were just so very "off".

</comment><comment><USER70> suckers ... no really, you are.</comment>


U.K. National Grid status - <AUTHOR> http://www.gridwatch.templar.co.uk/ <comment><USER2> Interestingly, there is also a version to watch French's grid [http://www.gridwatch.templar.co.uk/france/](http://www.gridwatch.templar.co.uk/france/)

It looks like France is exporting to neighbouring european countries (including to the UK), the equivalent more than the UK's total current nuclear supply (~7.89GW).

I had no idea it was possible to transport such power by submarine link (2GW power to the UK).

<comment><USER3> Somehow ironic that Germany stopped their own nuclear plant to buy energy to France (mostly nuclear)

<comment> chestnut-tree Also interesting to note is that the UK and Germany top a list of the EU's most polluting coal-fired power stations. These were the findings from a recent report by environmental campaigners. The report called "Europe's dirty 30" looks at CO2 emissions from coal power plants in the EU.

From the report:

 _" Germany and the UK are the self-declared climate champions of the EU. However, Germany uses more coal to generate electricity than any other EU country, while the UK comes third in absolute coal consumption for power after Poland;"_

Here's the 10 most co2-polluting thermal power plants in the EU according to the report

      1. Bełchatów, Poland
      2. Neurath, Germany
      3. Niederaussem, Germany
      4. Jänschwalde, Germany
      5. Boxberg, Germany
      6. Drax, United Kingdom
      7. Weisweiler, Germany
      8. Agios Dimitrios, Greece
      9. Brindisi Sud, Italy
      10. Lippendorf, Germany

The full ranking of 30 power plants is in the following report (3.1 mb) [http://awsassets.panda.org/downloads/dirty_30_report_finale....](http://awsassets.panda.org/downloads/dirty_30_report_finale.pdf)

Or you can read the summary from this Guardian report [http://www.theguardian.com/environment/2014/jul/22/germany-u...](http://www.theguardian.com/environment/2014/jul/22/germany- uk-poland-top-dirty-30-list-eu-coal-fired-power-stations)

<comment><USER4> I'm not sure I understand what the point of that list is, Drax is the UK's largest coal-fired power station, of course it emits the most CO2! Were it replaced by two power stations of exactly half the capacity it wouldn't be in the list anymore, yet the end result would be the same.

</comment></comment></comment></comment><comment><USER5> I work on collecting (ETL) data of European power data sources and supply them to clients via web service (in almost real time). For the client i work on - wrote cloud based distributed ETL system to collect data from approx 100 importers and exporters of power, gas, wind, nuclear. Its quiet possible to collect this data in real time as EU regulations asks each of them to provide data on their websites. For some of the websites - i use selenium which is much better than using webrequest via http/s

<comment><USER6> Do you have a link with more information about the service?

<comment><USER5> My client argus media sells this data via product called fundalytics. Get in touch with sales.

We scrape power and gas data from various sources - we are also working on to get fertlizers , bio fuels and other data from across globe.

</comment></comment></comment><comment><USER7> Fascinating, thank you for sharing.

As I write this, it appears that the UK grid is running around 30GW, of which about 55% comes from local fossil fuels, 29% nuclear, nearly 10% imported from France and Holland, and a mere 5% or so from the major (non-nuclear) renewable sources.

There is an interesting note that coal (only 15% right now) is still the largest contributor to the UK grid overall, but used more in winter because running hours are restricted for environmental reasons so they do more in winter when it's more profitable.

I am surprised (and, honestly, disappointed) to see that so little of the total is still drawn from clean, renewable sources after all the concern about both fossil fuel supplies and environmental effects in recent years. Having just been on holiday to a country not a million miles away where they have essentially no native fossil fuels and so almost everything is run on relatively clean renewables, it's clear that we still have a long way to go.

<comment><USER8> Which country runs almost entirely on renewables? I am assuming nuclear is not a renewable in this case?

<comment><USER7> Iceland. Its unique situation gives it a lot of geothermal, but there's quite a bit of hydro as well. Of course most of us are in much bigger countries, often with higher population densities, and not sitting on such convenient geography, but it was more the different mindset that I noticed than any specific technology.

Try and put up a new onshore wind farm anywhere in the UK, and every NIMBY and countryside group for a hundred miles will turn up to complain. Propose a new nuclear power station, and it'll be 200 miles, even though not far away in continental Europe there are nuclear power stations that could pose just as big a threat here if anything catastrophic happened. No doubt the same people will be the first to complain if they can't afford a guaranteed 100% electricity supply and have to put up with rolling blackouts in a decade or two. (If you're in the UK, I encourage you to do the maths and consider the geopolitical situation; that isn't as implausible a future as we'd all like to believe.)

Meanwhile, it looks like Wikipedia has several whole articles about the remarkable achievements of the Icelandic in this area (though I think the figures we heard while there were actually slightly better than even what is cited there):

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

<comment><USER8> Technically true, bu this is a bit like "Single German City runs entirely off bio-mass". My favourite author on this (David McKay - [http://www.theguardian.com/environment/cif- green/2009/apr/29...](http://www.theguardian.com/environment/cif- green/2009/apr/29/renewable-energy-david-mackay)) is clear on the need for making the sums add up at scale.

</comment></comment></comment></comment><comment><USER9> State of the Nordic Power System (Click 'Table' for more information): [http://driftsdata.statnett.no/Web/map/snpscustom](http://driftsdata.statnett.no/Web/map/snpscustom)

The data seem to be a few minutes old, and doesn't have history (which would be nice).

<comment><USER10> It's interesting to see all the export/import flows, like exporting to Germany yet importing from DenmRk. I guess it's due to price sifferences?

<comment><USER11> The imports and export are changing all the time, depending on the production or demand of each country, to keep the production and consumption in balance. It's sometimes easier/faster to import power when you need it (when there is a demand spike) than start your own generators to match the demand with internal production. Then when the other country has a demand spike, you pay them back with your production. In many cases no actual money change hands, these are kept as "power debts" that will be paid later.

It can also be easier/cheaper to import power for one point near the border than transport it from farther production facilities.

</comment></comment></comment><comment><USER12> CCGT = Gas, in case anyone was wondering.

<comment><USER13> It's actually specific to combined cycle gas turbine plants where the waste heat from the GT is used to generate steam and eventually additional energy. This is opposed to simple cycle GTs where the mechanical output gas turbine is the only source of energy to the grid.

<comment><USER14> Sounds like the "big brother" of the condensing gas fired boiler you find being fitted in the UK these days.

</comment></comment></comment><comment><USER15> UK's load balancing has some quirky features that always fascinated me, like the fact they require a unique calibration for the end of each episode of Eastenders, right after which millions of households put the kettle on.

[http://www.bbc.co.uk/britainfromabove/stories/people/teatime...](http://www.bbc.co.uk/britainfromabove/stories/people/teatimebritain.shtml)

</comment><comment><USER16> The frequency one would scare me a bit--it is 49.960 as I see this. So long as you can control the entire grid from a central point (not possible in North America, I think--much more complex) it is probably ok.

Otherwise, a generator that lags in phase becomes a motor.

<comment><USER17> They have isolators to stop that from happening - the generators can't draw a current.

<comment><USER16> No, electrically generators and motors are the same circuitry. If you have two generators hooked to the same output line, and one gains a few degrees of phase angle on the other, the one lagging draws power from the leader in proportion to the phase angle difference.

<comment><USER17> Yes but with a bit of electronics you can stop this from happening. Source: Institute of Physics.

<comment><USER16> Curious what electronics will prevent a flow of AC electricity.

<comment><USER17> This is what is used in the UK: [http://en.wikipedia.org/wiki/Synchronization_%28alternating_...](http://en.wikipedia.org/wiki/Synchronization_%28alternating_current%29)

</comment></comment></comment></comment></comment></comment><comment><USER18> This is awesome, thanks.

Is it actually up to date and accurate?

I wonder if wind player a major role somewhere where they really have a lot of turbines. Like Netherlands or Germany perhaps.

Would be really interesting to be able to compare different countries with the same sort of data.

<comment><USER19> FWIW, wind power occasionally peaks above 80% of total electricity usage in Denmark. Long-term average is 25-30% and rising IIRC.

<comment><USER20> It's important to note that wind power in Denmark only works at that scale because they can export it to Norway and Sweden. Those neighbors can absorb variable power output while load balancing their grid with hydroelectric dams.

Hydroelectric is currently the only economical "grid-scale battery", and it is not available everywhere.

[http://www.theoildrum.com/node/1735](http://www.theoildrum.com/node/1735)

</comment></comment></comment><comment><USER21> More data than you could possibly want, if your browser can cope with it, is published here: [http://www.bmreports.com/bsp/bsp_home.htm](http://www.bmreports.com/bsp/bsp_home.htm)

</comment><comment><USER22> Here's a nice video about the UK national grid:

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

</comment><comment><USER23> One data point I'd like to see is the wholesale cost of electricity throughout the day.

(Very interesting page. Thanks.)</comment>


[Show HN] ToDo app with local storage (built with react.js) - <AUTHOR>

Hi there,
Just thought I'd share the source code of a little project of mine: https://github.com/lollipierre/react-bullet-app
There are a ton of apps that you can use to manage your to-do list. The main difference with this one is that, despite living in your browser, no info is ever sent over the internet about this secret project of yours. Also the UI / approach is slightly different from more complicated apps. Anyways, it suits my professional needs.
Nothing too fancy, if you want to try it live you can go here: http://rawgithub.com/lollipierre/react-bullet-app/master/index.html
It was meant to be a personal app to start with, but some colleagues are starting to use it so I thought I'd share it with HN.
Feel free to hack and send pull requests, there are still some missing features. But for now it fits my needs.
Feedback appreciated (on the app and/or the underlying code), thanks :) <comment><USER2> It seems you have used some Unicode for the buttons, but most of them don't appear on my navigator (latest Firefox on Win 7x64).

I tried to play with the page encoding but it didn't change anything.

[https://www.dropbox.com/s/e0ih0ztk7k8wiq1/ui.jpg](https://www.dropbox.com/s/e0ih0ztk7k8wiq1/ui.jpg)

</comment><comment><AUTHOR> Link to test the app: [http://rawgithub.com/lollipierre/react-bullet- app/master/ind...](http://rawgithub.com/lollipierre/react-bullet- app/master/index.html)

</comment><comment><USER3> Less is more !</comment>


Oracle Lays Off Java Mission Control Team After Open-Sourcing Product - <AUTHOR> https://www.infoq.com/news/2018/06/open-source-jmc <comment><USER2> I don't see a big issue with this. I don't like Oracle as much as the next guy, but when the community votes to de-corporate project I think it is reasonable to lay off the people performing corporate maintenance. Surely those who voted to "community-ize" it (which I agree with) will re-hire these people to continue their effort lest they think these things just magically maintain themselves. Granted Oracle was one of those who voted. I think these are just reasonable ebbs and flows of businesses and shuttering or devolving yourself of products.

I think most of people's hate will come from hating Oracle or emotionally hating the idea of layoffs. In this particular case it's a damned if you do damned if you don't. One side wants Oracle to open everything and stop exercising control over things (e.g. their own branded JDK which was only differentiated by support and these kinds of tools). Another side lambastes Oracle for not keeping the people around to do the work. We all want less Oracle control over the JVM yet we all secretly want them to keep working on it and paying the people to do so.

<comment><USER3> I think that what irks a lot of people is that Oracle has almost 300 open positions in the US for Java developers.

Why lay off experienced developers instead of moving them to currently unfilled positions?

<comment><USER4> I wonder if they are actually filling those roles?

<comment><USER5> Can't speak for other parts of the org, but Oracle Cloud Infrastructure (OCI) is growing fast. Most teams have a target to double+ staffing within 6 months, and from what I've seen, they're roughly succeeding with their goals.

I don't know that Oracle specifically works to transfer staff around (not been in a situation to know). The job boards _are_ open and available internally, and some of the OCI growth is happening via internal transfers. People from across the company are specifically reaching out to hiring managers.

<comment><USER6> Anyone else remember far enough back to when OCI referred to the Oracle Call Interface (C library)?

<comment><USER5> There's little traces of "OCI" with different meaning all over the place in Oracle, so far as I've seen. Guess it's just one of those useful TLAs that keep repeating.

</comment></comment></comment></comment></comment></comment><comment><USER7> Is Oracle legitimately trying to kill the Java ecosystem or is it just a happy accident? They're almost going out of their way to unravel almost everything Sun stood for and what Java was meant to be...

The sad irony is that if this continues, and C# Core keeps getting better, people might move not because C# is inherently better but just to escape Oracle's influence.

Java is a lot less "free" than many like to claim see:

[https://www.theregister.co.uk/2016/12/16/oracle_targets_java...](https://www.theregister.co.uk/2016/12/16/oracle_targets_java_users_non_compliance/)

You might say: "Well just don't use that stuff then!" sure, fine, but what if a vendor you use used them? You still owe Oracle money.

Microsoft might be bad, but Oracle is worse, and Java is Oracle.

<comment><USER8> > Is Oracle legitimately trying to kill the Java ecosystem or is it just a > happy accident? They're almost going out of their way to unravel almost > everything Sun stood for and what Java was meant to be...

How does one come to such conclusion after corporate open sources a project?

<comment><USER7> By looking at Oracle's management of Java in the larger scope. Here they're destroying a popular Java product used to support other Java products to save money.

</comment></comment></comment><comment><USER9> Perhaps this is a good opportunity to highlight the OpenJ9 team (i.e there is another). IBM is investing in them and the project has been open-sourced under the Eclipse Foundation.

More use of OpenJ9 incentivizes more features, support and more devs being hired.

[https://adoptopenjdk.net/?variant=openjdk8-openj9](https://adoptopenjdk.net/?variant=openjdk8-openj9)

<comment><USER10> Why do I see this: `There are no releases available for openjdk9-openj9`? I'd love to play with it, but I would rather use JDK 9.

<comment><USER11> JDK 9 and JDK 10 are in nighty builds

[https://adoptopenjdk.net/nightly.html?variant=openjdk9-openj...](https://adoptopenjdk.net/nightly.html?variant=openjdk9-openj9)

</comment></comment></comment><comment><USER12> I think Microsoft is about to take off.

Businesses are going to move to Azure and use dotnet core. Today we've visual studio on mac too. Plus, visual studio code on Linux.

Who wants to deal with Java BS when their master pisses of people with these idiotic moves.

Not to mention Rider IDE.

<comment><USER13> From what I've been told C# is really great to work with and fixes a lot of issues people had with Java.

Can anyone who's used both recently comment?

<comment><USER14> I am a relatively recent transplant from C# to Java. I'm still getting my bearings, but my general sense is that Java has an amazing ecosystem in the large scale, and that makes it much easier to tackle the hard problems, but is the absolute pits to work with for everyday challenges. IOW, Java makes the hard problems easier and the easy problems harder.

Concrete example: .NET has nothing comparable to the Hadoop ecosystem, or to International Components for Unicode.

Concrete example: Compared to what's in .NET, a lot of stuff in the core Java libraries feels very half-baked. Streams, for example is missing a lot of useful features that I am used to seeing in every comparable library. There's not even a mapi in there. Bifurcating it from iterables and the rest of the collections API also creates some ergonomic annoyances that don't exist in, e.g., .NET or Scala's equivalents.

<comment><USER15> From what I recall .NET has built in almost all of International Components for Unicode features. You can still use ICU from C# if you want to, but I have never personally seen anyone do so.

See: GenICUWrapper A tool that generates a rudimentary C# wrapper around the C API of ICU4C. ICU Dotnet - .NET bindings for ICU [http://site.icu- project.org/related](http://site.icu-project.org/related) or [https://github.com/sillsdev/icu-dotnet](https://github.com/sillsdev/icu- dotnet)

There are also .Net options for Hadoop so I am not sure what you mean exactly?

<comment><USER14> There are options, there are always options, but they are typically 2nd class, incomplete, poorly supported, or otherwise substandard.

For example, first line of the readme for icu-dotnet (emphasis mine):

> icu-dotnet is the C# wrapper for _a subset of_ ICU4C

<comment><USER15> ICU4C has quite a bit of cruft at this point, so the useful subset is perfectly reasonable. You can always add anything to these layers you want, but it's really not worth the effort.

</comment></comment></comment></comment></comment></comment><comment><USER16> It seems like Oracle has struck on a way to not just get the community to help with their maintenance and development, but a way to trick the community into doing all their work for them.

If I had to guess, I would bet that the license requires contributors to give up rights to their work so Oracle can still use it in proprietary products with little or no stipulations.

<comment><USER17> There is a word for any engineer that subsequently contributes code to this project. We need some solidarity in this industry.

</comment></comment><comment><USER18> A real class act all the way. /s

</comment><comment><USER19> > _Hirt confirmed that of the JMC team, only three were left at Oracle, > including himself._

... and then quotes Hirt's statement that, quite clearly, _does not_ say that _only_ three people were left, but merely names three people out of an unstated number possibly larger than three that were left.

</comment><comment><USER20> Every time I read something about Oracle, I think this shop should be rebranded as Asshole Inc.

<comment><USER21> Yep, but neither Google after torpedoing Sun, nor IBM or any other Java relevant company cared to save Java assets from Sun.

So here we are.

<comment><USER22> IBM supported Apache Harmony which Oracle forced to shutdown. Google used harmony and they are still in legal quagmire.

<comment><USER21> If Google had given a penny to Sun for each Android device, Sun would still be around.

<comment><USER23> If companies had to give a penny to Sun for every device which used Java, nothing would be written in Java.

<comment><USER21> Google is the only company that refused to do it, trying to find a workaround around Java licensing.

So yeah, companies were paying much more than pennies to Sun, until Google came around and offered them a (free beer) Java fork, thus torpedoing Sun profits regarding Java.</comment></comment></comment></comment></comment></comment>


Mass cellphone surveillance experiment in Spain - <AUTHOR> https://cfenollosa.com/blog/mass-cellphone-surveillance-experiment-in-spain.html <comment><USER2> Following the link on airplane mode:

>"Every phone has two operating systems," explains Gary S. Miliefsky, CEO of SnoopWall, "One that connects to cellular networks, and one that interfaces with the consumer. Airplane mode may only disable features in the consumer facing operating system, such as Android or iOS, but not in the OS used between the phone and the carrier network. A phone may be giving out a 'ping' and you'd never know it."

Surely that defeats the whole idea behind airplane mode. i.e. stop the phone from sending crap that (supposedly) messes with airplanes?

<comment><USER3> As an RF engineer who has tested frequency spectra and radiated powers of various consumer electronics including cell phones, I've never seen a cell phone (specifically an iPhone 5, A Nexus, a Samsung Galaxy S4, and a razr flip phone) transmit with airplane mode turned off.

It's not just airplanes that could be susceptable to cell phone emissions, but back in GSM days, the number of handoffs while in flight would effectively jam the cellular network in a 200mi radius. Nowadays cell phones are much smarter and don't do that, and the EMC risk in aircraft is extremely low.

<comment><USER4> No way to tell if it's listening though. It could be silent and still be processing every it can detect.

Who knows if there are secret commands that can be sent to it to override airplane mode settings, or instructions to do other nefarious things and broadcast once out of air plane.

<comment><USER5> Why would they be listening to audio anyway when all phones have always-on speech recognition?

<comment><USER6> He means listening to the radio. A phone might have special baseband firmware that, e.g., turns on for a minute every hour and listens for a particular coded sequence (such as the date, and a mask of serial numbers, encrypted to a key in firmware etc), which would then cause the phone to do a number of things, such as turn on the radio for rx, or tx the RSSI of nearby towers, etc. All without telling the main CPU.

<comment><USER7> Colour me dubious. If the phone is in airplane mode then the carrier doesn't know where it is. Are you suggesting they broadcast this information on all their cell towers? Or that they have a secret system to predict/guess where a dark handset might be so they can target it? Either sounds extremely unlikely.

<comment><USER6> Well, lots of the NSA kit seems extraordinary.

As to the practicalities, it wouldn't need to use the carrier network, just put it in a plane. Like the plane they have circling D.C. right now, or a drone. And your location is often known approximately.

[https://www.buzzfeednews.com/article/peteraldhous/spies- in-t...](https://www.buzzfeednews.com/article/peteraldhous/spies-in-the-skies)

Someone should point a good signal analyser at these.

</comment></comment></comment></comment></comment></comment></comment><comment><USER8> > It is unclear whether enabling airplane mode stops this tracking. The only > way to make sure is to remove the SIM card and battery from the phone.

It is possible for a handset to attach to a network without a SIM card for the purposes of making an emergency call. Please don't think removing or swapping your SIM card stops tracking.

I've yet to see 2G or 3G phones try and talk to a local network in aeroplane mode (though you shouldn't believe me). I did see some oddness years ago when testing an early and proprietary LTE handset, but I'm not sure I'd believe that either.

<comment><USER9> It also seems like phones have their own tracking ids that they report, it's not just the sim card.

There was a great talk about some of this from black hat; how the CIA renditioned Abu Omar out of Italy and how they were found out: [https://youtu.be/BwGsr3SzCZc](https://youtu.be/BwGsr3SzCZc)

<comment><USER10> All GSM phones have at least one of these (multi-SIM devices have multiple), they uniquely identify devices with SIMs and are held in databases shared intentionally amongst many nations for blacklisting and such.

If a phone is reported stolen in the UK and reported, it's IMEI can be added to this list and the device becomes useless in participating countries, say for example, Spain, or Germany or the US.

My point is, it's a globally unique identifier; tempering with, modifying or cloning them is illegal in some countries.

The SIM itself is almost irrelevant, but, with the information mobile providers hold, it's trivial to link a SIM account, a device identifier and a person (particular given some countries require ID by law to obtain a SIM).

<comment><USER11> Furthermore, being criminalized in some countries has caused discussion of how to change IMEIs to be censored in technical forums _everywhere_. The obvious draw is stolen phones, so nobody wants to touch the topic with a ten foot pole, despite its straightforward relevance to privacy.

<comment><USER12> >censored in technical forums everywhere

everywhere? I found this in 1 minute.

[https://forum.xda-developers.com/android/general/how-to- rest...](https://forum.xda-developers.com/android/general/how-to-restore-lost- imei-t2936696)

<comment><USER11> And yet there is also this: [https://forum.xda- developers.com/showthread.php?t=2652022](https://forum.xda- developers.com/showthread.php?t=2652022)

That attitude reflects the dead ends I've experienced when looking around for how to change IMEIs for various phone models I was interested in. Also note all the disclaimers in the thread you linked.

Maybe recent phones are still so straightforward with QPST that any time the question is actually asked it's bound to get flooded with crap? It certainly doesn't feel that way. Eventually I'll get around to setting up another Windows VM and seeing what modern QPST can actually do.

</comment></comment></comment></comment></comment></comment><comment><USER13> The solution will be to have a slider that physically disconnects the networks. Slide it down and the hardware is no longer physically connected. The phone still have all it's no-connection features. Slide it up and you are back online.

We cannot trust software to actually disconnect as advertised. It is not in the network operator's interest. Unfortunately, it is also not in the phone manufacturer's interest to have you disconnect. Wake up, this is only a dream.

<comment><USER14> Or put the phone inside a Faraday Cage phone pouch.

Just because there is a physical control presented to the user doesn't mean there won't be any hidden connections inside the phone still.

<comment><USER15> A faraday cage works for incoming signals, but not so much for outgoing. It also depends on the wavelength vs size of mesh.

I think using a solid cage is the best bet.

<comment><USER16> Hi 'm463, you seem knowledgeable about this subject, so I have a few questions. Could you please answer the questions below or direct me to where I can learn more?

1\. If a phone is off e.g. iOS's General->Shut Down, then can it still receive and transmit signals?

2\. What is the best kind of cheap case / enclosure for a cellphone that would prevent signals from being transmitted or received? Can I just wrap a cellphone in aluminum foil and place said wrapped cellphone in a Tupperware / plastic sandwich container?

3\. What is an effective way for an RF layperson like myself to detect whether or not my phone is transmitting or receiving signals while it appears to be off e.g. RF tool or measurement device?

I just want a way to know and be completely certain that "off" means "off".

<comment><USER15> Those are good questions and I'm not an expert. I was a part of a discussion once where someone mentioned that faraday cages mostly work for signals entering.

However:

1a) You don't know (because your phone can pretend to be off). You need to remove the battery (and also remove hidden batteries)

1b) some phones support NFC, which can theoretically be used when the phone is off.

2) I suggest being familiar with: [https://en.wikipedia.org/wiki/Faraday_cage](https://en.wikipedia.org/wiki/Faraday_cage) and your cellphone before making a decision

3) I don't know, but this would help with #2

</comment></comment></comment></comment></comment><comment><USER17> A few comments here claim that aggregated data is fine. An interesting read is [1]. It discusses how trajectories of individuals can be recovered from aggregated mobility data with high accuracy. It's a great read because it breaks down the approach into small logical steps, but the end result (recovering individual's trajectories from aggregated data) sounds bizarre at first.

[1]: [https://blog.acolyer.org/2017/05/15/trajectory-recovery- from...](https://blog.acolyer.org/2017/05/15/trajectory-recovery-from-ash- user-privacy-is-not-preserved-in-aggregated-mobility-data/)

<comment><USER18> People are often able to get personally identifiable information from aggregated/anonymized data. At this point, I think people should be automatically skeptical that their personal habits are protected when a company claims they only collect/use/sell aggregated/anonymized data. In practice, it might not be protected at all.

</comment></comment><comment><USER19> Having gps trajectrories and two locations in the city, like home and job address, it should be quite easy to find corresponding trajectory and thus deanonymising a single person. No need for imsi or any other data. Therefore to make data anonymous it should be encoded in terms of number of subscribers in given time and area. My guess would be it isn't

</comment><comment><USER20> [UPDATED. It seems that the recording will happen after the elections, not before, so apparently spying the political preferences of people would not be the motive (yet). I had removed those parts]

Is easy to stablish a probable connection between this sudden need to watch all phones in relation to the disturbs in Catalonia coordinated by sms messages and apps.

Would be trivial to connect the pool of "people that went to the place X at the day Y", and the part of the city or neighborhoods where they mainly go to sleep after the disturbs. Many other sensible things can be disclosed from that, like how many people came from Euskadi to join the disturbs for example, and if they joined to eat before in a special place).

Nobody signed to accept to participate in this, and there is not a way that allow you to be excluded.

Is totally "1984" level, is outrageous, breaks many red lines all "in your face european parlament", and somebody should pay for that.

</comment><comment><USER21> go to etsi.org go to the search form for standards and enter "lawful interception" without quotes. Read / browse all the relevant standards (titles and content). This has been going on for years and years

<comment><USER22> Thanks for the link!

 _There are 1130 results:_

[https://www.etsi.org/standards#page=1&search=lawful%20interc...](https://www.etsi.org/standards#page=1&search=lawful%20interception&title=1&etsiNumber=1&content=1&version=0&onApproval=1&published=1&historical=1&startDate=1988-01-15&endDate=2019-10-29&harmonized=0&keyword=&TB=&stdType=&frequency=&mandate=&collection=&sort=1)

<comment><USER22> I've posted the link to HN, so as to not derail this thread, but there's a clear conversation starter there!

[https://news.ycombinator.com/item?id=21390968](https://news.ycombinator.com/item?id=21390968)

</comment></comment></comment><comment><USER23> Also in Spanish news: there was a separation movement leading to the arrests and jailing of separatist leaders after 90% of the population votes for separation. The leaders got something like 15 years of jail time. There have been massive protests for weeks now

[https://www.bbc.com/news/amp/world- europe-50194846](https://www.bbc.com/news/amp/world-europe-50194846)

<comment><USER24> How is that related to this piece of information?

Spanish Constitution does not allow regions (Autonomous Communities in Spain's legal jargon) to make referendums. What's the issue here?

<comment><USER25> Wildly inappropriate sentencing? The question of whether it's really appropriate to deny a kind of democratic participation is also worth discussing.

<comment><USER24> I'd say the sentencing is right because they broke the law.

<comment><USER26> 15 years in prison? that's nuts. that had better be manslaughter or armed robbery or stealing zillions of pensions etc...

there is no way you can present holding a controversial referendum as worthy of a jail sentence at all, let alone 15 years. "broke the law"... i mean, crossing the street when the light is red is "breaking the law". buying weed is "breaking the law".

it is a provocative heavy-handed foolish move by the Spanish Supreme Court, that will only serve to inflame tensions, as it now provides an air of martyrdom.

it's all thoroughly unnecessary and gratuitous. it would be enough to say "well that referendum result doesn't count, sorry. nope." and you'd have a bit of protest and another "illegal" referendum every few years, but you wouldn't be feeding the popularity of the Catalonian independence movement.

it was a stupid move. hubris appears unattractive to the global lens.

mind you, I couldn't have given 2 hoots about any of this, just reporting on how it appears on the world stage.

<comment><USER27> Secession movements have a big chance of killing a ton of people and violating the civil rights of many more, so a 15 year sentence is very plausibly appropriate, in comparison to armed robbery.

<comment><USER25> This was the the peaceful independence movement. They have not killed anyone and have no declared intention to.

<comment><USER27> That would be a great argument if it meant there was no chance of future violence. But it doesn't, so it's not.

<comment><USER28> So basically you're saying that somebody should be jailed for N years because maybe, in the future, someone else related with the same movement might use some level of violence to achieve... something we still don't know, in circumstances we still don't know? Wow.

<comment><USER27> Actually, no, but if you want to pretend I did, have at it.

<comment><USER28> You were the one talking about "future". Can you explain better what did you mean?

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER29> I thought that something like this would not be allowed due to the general monitoring clause as per article 15 of the directive 2000/31/EC.[0] But reading it again I'm not sure anymore.

[0] [https://eur- lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX...](https://eur- lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:32000L0031:en:HTML)

</comment><comment><USER30> Solution: Faraday cage. They can't make radio waves break the laws of physics! (that I know of...)

<comment><USER31> Better make sure it's off before you stick it in there, or it will be dead when you take it back out.

<comment><USER32> Why would a Faraday cage kill a phone? It's not EMP.

<comment><USER33> Some (older) phones will burn a lot of power searching for a cell signal when there is none.

<comment><USER34> Still wouldn't do nothing except waste battery power.

I had all kinds of older phones, and in older times 20-25 years ago there were tons of places with zero signal (villages, islands, places out of the city, national parks, and so on) and the phones survived just fine.

That's as zero as in a faraday cage, as far as the phone is concerned -- no tower to talk to at all, 0 bars for hours or days on end.

<comment><USER33> I took "dead" to mean a dead battery.

<comment><USER34> A, probably. Sounded like the parent meant something more ominous, as that's no biggie to warn about, you recharge and are as good as new.

<comment><USER31> Yes, I meant a dead battery. The "solution" I was replying to was suggesting keeping your phone in a Faraday cage to thwart government surveillance, presumably a small portable cage that you would take with you wherever you go. If you leave your phone running in there, there's a pretty good chance that the battery will be dead when you take it out to use it, which defeats the entire purpose of carrying a phone in the first place.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER35> Controlled compromise of privacy for the sake of scientific insight seems like a good idea, until you realize that we either get profoundly non-replicable junk "science", or continued and unlimited re-breach of privacy for the sake of replication. Neither is any good.

I'm reminded of Raj Chetty who publishes papers based on exclusive access to IRS tax return data. ([https://www.sciencemag.org/news/2014/05/how-two- economists-g...](https://www.sciencemag.org/news/2014/05/how-two-economists- got-direct-access-irs-tax-records)) Not real science unless you can have access to that data, too. You can't.

<comment><USER36> While I'm normally all for access to raw data used in research, that's pretty hard to do with IRS data without massively violating Americans' privacy and exposing them to identity theft. It's fair to be skeptical of anything using locked-up data, but I don't see a good way around the problem.

</comment></comment><comment><USER37> The problem is that carriers have being retrieving this data for a long time. This news is that they're giving the data to the government for statistical analysis and we cannot do anything about it...

<comment><USER38> it is very innocent to believe that the carriers would not provide these data already to the government if asked (e.g. by a court order), and they have probably been asked many times.

<comment><USER39> More likely, they proactively give everything to the government and let the govt. figure out what they want to do with it.

</comment></comment></comment><comment><USER40> "With a court order, this data can be used to identify and track an individual... ... which means that it is stored de-anonymized in the carrier servers"

No, it does not mean that it's stored de-anonymized. It means that it _can_ be de-anonymized if required by a court order.

EDIT because all the downvotes, this is not nitpicking. The deanonymizing data is ELSEWHERE, not on the servers. It takes a court order to obtain it, employees cannot use it. It's an important point.

<comment><USER41> Can you explain this to the layman? How does it work? Does it mean they store IMSI hashes with location data in one database and customer names and their IMSI in another and nobody supposedly should have access to both databases at the same time?

<comment><USER42> That's the explanation I'd expect the answer to be. In Europe it'd be classified as pseudo-anonymous, and would still be personally identifiable data in the legal sense, and therefore not truly "anonymised".

</comment></comment></comment><comment><USER20> An interesting point is that they have yet the data of the phone owner, because is required by the new laws that you send they your name, phone number and your email in order to receive some notifications from the government. This has happened since the last two years or so.

</comment><comment><USER43> A good article but I'd like to offer one minor correction.

>The only way to make sure is to remove the SIM card and battery from the phone.

You only have to remove the battery, not the battery and the SIM. You aren't being tracked if your phone has no battery.

</comment><comment><USER44> Hasn't this been going on in most countries and most carriers for years?

</comment><comment><USER45> Just shut it down and wrap it in aluminium foil if you're concerned.

</comment><comment><USER46> Well, you would think this kind of mass surveillance would help Spanish authorities put Russian mobsters (with connections to Putin and Co.) in jail... but instead they get acquitted:

[https://www.bbc.com/news/world- europe-45907655](https://www.bbc.com/news/world-europe-45907655)

[https://www.propublica.org/article/fighting-russian-mafia- ne...](https://www.propublica.org/article/fighting-russian-mafia-networks-in- spain)

<comment><USER47> This information won't be useful to track any individual.

</comment></comment><comment><USER48> RIP privacy!

</comment><comment><USER49> This seems a bit exaggerated. I work for one of these ISPs, but I'm not involved in this project.

GDPR explicitly states that no permission is required if the data is anonymised. The data shared with the INE will be movement of batches of at least 5000 people. The movements will be between 3500 zones. There are more than 60.000 cell phone towers in Spain, so they could have made the movements much more precise if they wanted (at the cost of anonymity of course). If less than 5000 people cross from a zone to another it will not be shared. No IMEI/IMSI/MSISDN will be shared.

I understand that there might be concerns of de-anonymisation, but it makes no sense. If the Spanish government wanted to track someone they already can, with a court order. Spanish phone providers are required by law to store this data for 6 months minimum up to 2 years maximum. ([https://www.boe.es/buscar/doc.php?id=BOE-A-2007-18243](https://www.boe.es/buscar/doc.php?id=BOE-A-2007-18243)). The government is going to receive data from 4 working days, 1 weekend day, a holiday and two days in Summer. Tying this with Tsunami Democratic is a bit strange. There is an ongoing investigation, so they can already track people tied with the movement as long as they have some form of personal information (IMEI, IMSI, MSISDN). Honestly, a massive protest one of those days might throw off the statistics in Catalunya.

And by the way, this data is already being sold to third parties for profit:

[https://www.orange.es/empresas/grandes-empresas/internet- of-...](https://www.orange.es/empresas/grandes-empresas/internet-of-things- big- data?internal_source=orange&internal_medium=homeGrandesEmpresas&internal_term=home+soluciones+internet+of+things+big+data)

[https://www.vodafone.es/c/empresas/grandes- clientes/es/soluc...](https://www.vodafone.es/c/empresas/grandes- clientes/es/soluciones/cloud-colaboracion/big-data-analytics/)

[https://www.business- solutions.telefonica.com/en/products/bi...](https://www.business- solutions.telefonica.com/en/products/big-data/business-insights/smart-steps/)

Sometimes, unfortunately, it's being sold without anonymisation too and leaks have happened. Just one example in the USA:

[https://www.vice.com/en_us/article/nepxbz/i-gave-a-bounty- hu...](https://www.vice.com/en_us/article/nepxbz/i-gave-a-bounty- hunter-300-dollars-located-phone-microbilt-zumigo-tmobile)

<comment><USER28> > I understand that there might be concerns of de-anonymisation, but it makes > no sense. If the Spanish government wanted to track someone they already > can, with a court order.

Bingo! Is there a court order here?

<comment><USER47> You don't need a court order here because you can't track and identify an individual with this information.

<comment><USER50> With a timeline of location data? There is no such thing as anonymity with such a data set.

</comment></comment></comment></comment><comment><USER51> Since October 14th, there are ongoing mass protests in Catalonia (a part of Spain with a strong pro-independence sentiment), demanding freedom for their political prisoners jailed by Madrid (for 9–13 years). Hundreds of thousands people are on the streets. Barely reported by media. Barcelona Airport was overtaken for one day.

So yes, looks extremely convenient these days.

<comment><USER52> The fact that a prisoner was a politician does not make him/her a political prisoner.

<comment><USER38> And most of the current prisoners are not politicians and have never been.

Regarding the politicians, may these traitors rot in jail. They betrayed their people and surrendered themselves when everybody was on the streets ready to fight.

</comment></comment></comment><comment><USER53> This "experiment" might be somehow related with [https://tsunamidemocratic.github.io](https://tsunamidemocratic.github.io) ?

<comment><USER54> That was my first thought too but seems the dates are between 18 and 21 november. If they wanted to track the current widespread protests in Spain, they would have done it right now.

<comment><USER38> they are of course tracking us right now. This announcement is just an explicit reminder that they can do so, to try to scare the people. The dates are irrelevant.

</comment></comment></comment><comment><USER24> I'm sorry but this post seems like scaremongering.

As long as data is not de-aggregated and de-anonymized there is no issue here.

I see no relationship with the GPDR as this law applies to personal data and the agreement explicitly stated that data must be aggregated.

As long as it is used to know people flow or for statistical purposes, I see no wrong here.

The other political statements and comparisons he makes, well are unrelated and sincerely looks like political propaganda to me.

<comment><USER55> "As long as data is not de-aggregated and de-anonymized there is no issue here"

Awfully hopeful there.

"The other political statements and comparisons he makes, well are unrelated and sincerely looks like political propaganda to me."

I would say the same about your assertions of innocence and presumption that the data can not be de-anonymized. If the "propaganda" is supporting user privacy I'd say you're on the wrong side of this discussion.

<comment><USER24> Do you have any idea about law in this matter? It is illegal to de-anonymize data without a court order.</comment></comment></comment>


Ask HN: Is S3 down? - <AUTHOR> <comment><USER2> I'm in Boston, and one of our IT guys reports "problems across the East coast... Reports of a fire in NY that's had an effect on multiple Tier 1 ISPs." It's affecting multiple services for us - not just S3.

Can't find the news sources he's pulling from, though...

</comment><comment><USER3> We're having issues with packet loss between S3 and EC2 (US-EAST) this morning for at least the last hour or so.

It might be someone else in the pipe between our office (pennsylvania, comcast ISP) and AWS because I've only had one customer (Boston) report any problems so far.

<comment><AUTHOR> Good call. We're on Comcast in Boston. No issues switching to a different ISP.

<comment><USER3> Thanks - your response clears part of that. Our Boston customer was feeling it way before we did and appears much worse for them.

</comment></comment></comment><comment><AUTHOR> I can log in to the Management Console, but I'm having issues downloading from buckets in US-East.</comment>


Fujitsu completes Post-K supercomputer CPU prototype - <AUTHOR> http://www.fujitsu.com/global/about/resources/news/press-releases/2018/0621-01.html <comment><USER2> It's a crying shame that no ordinary human will ever be able to purchase these chips. I personally think that it might be very interesting to see what a very small build out might be capable of, say ca. €5-7K worth.

<comment><USER3> I suspect there might be a wider market...we'll see. To keep costs down there would have to be a commercial pathway, but that'll probably mean just data center.</comment></comment>


Maps Comes To OS X Mavericks, Syncs With Your iPhone - <AUTHOR> http://techcrunch.com/2013/06/10/maps-comes-to-os-x-mavericks-syncs-with-your-iphone/ <comment><USER2> I'm excited to see this; as a decided non-fan of web applications, I've often thought that a first-class desktop maps application would be something really great.

<comment><USER3> It isn't new- Windows 8 had this at launch.

<comment><USER2> Cool, didn't know that thanks.</comment></comment></comment>


Naming a Startup - <AUTHOR> https://failory.com/naming-a-startup <comment><USER2> My favorite is Wix.com -- "wichsen", which is pronounced like "wixen", means "to jerk off" in german.

Also, the german car company Opel named their SUV "Pajero", which apparently translates into "wanker" in spanish.

<comment><USER3> Pajero[0] is a SUV made by the Japanese car company Mitsubishi, not by Opel.

0\. [https://en.wikipedia.org/wiki/Mitsubishi_Pajero](https://en.wikipedia.org/wiki/Mitsubishi_Pajero)</comment></comment>


Ask HN: What is your source on world news? - <AUTHOR> <comment><USER2> I prefer crowd-sourced sources like wikipedia. I'm not interested in getting the latest speculation or gossip around a story; instead I want facts. Wikipedia is slow in terms of 'breaking news' but is a good source of facts.

Having said that, I think that the BBC has the best world news.

</comment><comment><USER3> I compare multiple international sources in my feed to try and get a comprehensive view. It's hard to get unbiased stuff nowadays...</comment>