x = File.read('puzle.txt')
y = x.split(/ \w /)
module Enumerable
def dups
inject({}) {|h,v| h[v]=h[v].to_i+1; h}.reject{|k,v| v==1}.keys
end
end
d = y.dups
require 'mathn'
dp = []
d.each {|z| z = z.to_i; dp << z if z.prime?}
dp
Elite 'hacker' group claims to hate marketing guru/bullshit tactics, then proceeds to ply the hell out of everyone to spread their concept in a viral Twitter hashtag manner.
Granted, I totally just did it because that puzzle was way too easy, but c'mon now.
In that sense, at least, the event is being held by people who understand the hack mindset. I noticed that the puzzle was very easy, and that the "elite hackers" are in fact a recruitment agency, and therefore that the main purpose of the event is probably for a recruitment agency to put their recruiters in the middle of a bunch of hackers while eliminating competing recruiters who have the same goal.
... but I still did the puzzle.
[edit] And everyone else is doing it too, and posting their solutions here! "Blazing guitarpocalypse"[1] indeed.
I might attend the event, but that's mostly because I'm in Austin and feeling curious, and not because the website convinces me the event will have a high quality.
I'm not sure if you're right or not, but if you are right it's very interesting because I've been here since almost day 1 and it's not as if my old comments routinely got down-voted. So if what you're saying is true, not only has the hivemind's up-vote heuristic changed - I've changed my posting habits.
I hate this attitude. Especially when we all know that it is impossible to be productive for 12 hours a day, 365 days per year - let alone the 16, or whatever hours, some 'hackers' claim to do
I would rather work an effective 4 hours a day (which you end up doing, or less, anyway, between all the web surfing and snarky comments on HN), take a few weeks off a year, take the odd year off, and actually enjoy life through meeting and interacting with other people.
That is a bit different then. I agree about the conference, I have never been inclined to go.
The impression that I get is that the program is full of self-proclaimed experts who pack themselves and their 2 page bio's onto panels to talk about subjects that nobody outside of that room cares about, and that nobody in the room will ever actually implement or do anything about.
I applaud the effort of setting up an area of sxsw that is more hackerish - but it would probably be better to just organize something separately, preferably in a different city and at a different time.
And indeed that is often a good solution. But it's nice to hack socially at times too. Edinburgh Hacklab had a coding event last Wednesday; I went along, got a fair bit done (the fact that I was in a different environment helped my productivity), chatted with friendly people, showed them the project I was working on, got help with some CSS stuff, etc. Overall a productive way to spend an evening.
Solved the puzzle with a couple lines of Python ;) Unfortunately, I won't be attending SXSW this year. Boo. If someone can solve that puzzle, I'll teach you all the hacks I know.
The ways everyone solves the puzzle are much more interesting than the puzzle itself. I made a mysql table with one column set as the primary key and did an insert.
For recursion vs. looping, it really depends on what you're doing. In my js experience though, most of the time looping is either faster or equal to recursion, while being significantly easier to understand at a quick glance.
In this case, the loop will outperform recursion because of all of the slice calls in the recursive version.
I'm learning Python (3) w/ MIT OCW and here's my solution (http://pastebin.com/EQevWQWC).
def dupefinder(lister):
'''Function to find first duplicate in a list; Variable to pass
to this function should be of type "list" '''
listerdupe = sorted(lister)
for index,item in enumerate(listerdupe):
if item == listerdupe[index+1]:
print('First duplicate number is {0}'.format(item))
return item
49 comments
[ 3.2 ms ] story [ 119 ms ] threadI'd consider your mention of Excel to be a hack, as I honestly don't have a clue with it beyond the basics.
Elite 'hacker' group claims to hate marketing guru/bullshit tactics, then proceeds to ply the hell out of everyone to spread their concept in a viral Twitter hashtag manner.
Granted, I totally just did it because that puzzle was way too easy, but c'mon now.
... but I still did the puzzle.
[edit] And everyone else is doing it too, and posting their solutions here! "Blazing guitarpocalypse"[1] indeed.
I might attend the event, but that's mostly because I'm in Austin and feeling curious, and not because the website convinces me the event will have a high quality.
[1]http://www.codinghorror.com/blog/2007/02/fizzbuzz-the-progra...
It's called stay home and get shit done.
Sorry for the meta, but I am missing the old HN.
I doubt we would be able to have the whole front page dedicated just to Erlang news if the need appeared.
It seems that the problem of maintaining quality of discussion in an open forum remains unsolved.
Maybe limits to entry (like the problem in the link) or ability to provide negative feedback to posters would help.
I would rather work an effective 4 hours a day (which you end up doing, or less, anyway, between all the web surfing and snarky comments on HN), take a few weeks off a year, take the odd year off, and actually enjoy life through meeting and interacting with other people.
The impression that I get is that the program is full of self-proclaimed experts who pack themselves and their 2 page bio's onto panels to talk about subjects that nobody outside of that room cares about, and that nobody in the room will ever actually implement or do anything about.
I applaud the effort of setting up an area of sxsw that is more hackerish - but it would probably be better to just organize something separately, preferably in a different city and at a different time.
Edit: relevant: http://ttk.me/t4AY6
var numbers = [];
require("./underscore-min.js"); var dupe = _.reject(numbers, function(number) { return _.lastIndexOf(numbers, number) == _.indexOf(numbers, number); }); console.log(dupe);
This reminds me of this awesome thread on Sitepoint (5 pages of different ways to output the numbers 0-9): http://www.sitepoint.com/forums/php-34/write-loop-php-prints...
var arr = (paste)
arr.sort()
for(var i = 0;i<arr.length;i++){if(arr[i+1] == arr[i]){console.log(arr[i])}}
In this case, the loop will outperform recursion because of all of the slice calls in the recursive version.
Is is each number delimited by a (random?) alphabetic letter? Is this to make parsing into Excel/an array harder?
Also, even the new 'harder' puzzle is easy to solve in Excel. Maybe that isn't a bad thing, however.