skysight-inc/HackerNews huggingface dataset:
Instead of allocating each element of the list individually you can do this one better.

Allocate an array of elements. The prev and next don't point to memory but to indexes in the array.

How do you handle empty elements? Have a special flag that means "this element is blank" and use prev and next to point to the empty elements in the list! (So you are essentially storing two interleaved lists as the same time.)

Also store the first empty (and first full) element separately of course.

You will need to initialize the memory before you use it, filling all the prev and next pointers for the empty elements.

When you "allocate" an element you just update the prev and next pointers of all 5 elements, as needed.

If you think about it - malloc also needs to store a list of unused memory areas, so despite being a bit more complex you can speed things up quite a bit by doing this.

An optimization: Since filling all the empties can allocate memory, even if you might never use it, have an optimization that if the next pointer is 0 (or -1) that implicitly means the next array index, but an uninitialized index.

By doing this you can allocate a 1GB array without worry, and allow the OS to only fault in pages as needed (i.e. there is no need to ever resize the array).
Oh, look, it's my post :)
I like intrusive lists. Another consideration is that a std::vector<FooPtr> is as fast to iterate over as intrusive list of Foos. The memory access pattern is the same. (Note: typed FooPtr instead of Foo Asterisk because the single asterisk italicized everything)

Another perk is that an element can remove itself from the list without actually having to know anything about the list. This makes a lot of shutdown code super easy and clean.

I do like intrusive lists to be inherited I think. That makes the interface for adding or removing objects from lists super clean. It also eliminates the extra obj pointer since the obj root address is known at compile time. Storing one object in multiple intrusive lists gets a little hairy and you need a tag parameter but that's a relatively rare need in my experience so it's fine.

One thing I don't like is lack of good debugging info in visual studio. For c++ at least their customization tools are seemingly nOT powerful enough to handle intrusive lists well. Not being able to clearly see all objects in the watch window is wildly frustrating. Things that make code harder to debug make me very, very cranky.
Since 1971 OPEC Oil is exclusively sold in US dollars.

https://en.wikipedia.org/wiki/Petrocurrency#Currencies_used_...

http://en.wikipedia.org/wiki/File:Oil_Balance.png
Nice comment. Anyone can be an ass. It is fascinating though that alot of people act like one. Yourself included.
As a 19 year old hacker, who has been diagnosed with type 1 diabetes for 8 years, I always had the dream of continuous blood sugar monitoring. But in the real world, a lot of sick people don't have access to these opportunities.
The sensors that monitor blood sugar are expensive. I don't mind checking my blood sugar 12 times a day, I hardly feel a thing anymore. The problem is that the insurance only pays for 4 checks a day. If they really want to solve the problem, they should implant the sensors with a surgical operation. Moreover the catheters(infusion sets) we have to wear for our insulin pumps are often faulty. When the needle hits a muscle tissue, it doesn't work, and you are subjected to high blood sugar levels and frustration.
Finally, I have to add that, diabetes has been there for years. I was a child when I was diagnosed and my parents never came to check on me every two hours. After a while your survival instincts kick in and you start to feel when something is wrong. As a person who experienced a range from 22 mg/dl to 798 mg/dl consciously, I have to say continuous blood sugar monitoring could save us the excruciating hassle of being alert all the time.
With all that technology, and all the money they ripped of from us, I think we deserve to get a secure treatment. Not a cure maybe, but something that would ensure us that we don't get any serious complications (like blindness per se).
My 15 year old brother made one of these a couple of years ago. He saw a video that demoed it with the plans available for $5 but he looked at the video and went and made it from mind.

It was so powerful, almost hilariously so!

He actually said on Facebook earlier: "I made one of these before it was cool."
This approach is more common in lower level software where each allocation is carefully managed. The Linux kernel uses them, for example:

http://www.makelinux.net/ldd3/chp-11-sect-5

as does the Windows kernel:

http://msdn.microsoft.com/en-us/library/windows/hardware/ff5...
Looks good. What is your business model?
Great article. It's wonderful to see rhythm celebrated for how it makes us feel.

The Guardian had an article a few days ago on an emerging emphasis of bridge rather than chorus, and the role of repetition, in recent blockbuster hits by Ariana Grande, Iggy Azalia, Nicki Minaj and others.

The article has a great quote from the founder of Motown:

"Don’t bore us, get to the chorus!” Berry Gordy once joked, understanding that this is what listeners truly gather around.

http://www.theguardian.com/music/musicblog/2014/dec/22/2014-...
map (\x -> chr (x + 32)) [45,69,82,82,89,0,35,72,82,73,83,84,77,65,83,1]
Kind of weird the dude tried to hide his identity—is he doing anything illegal by treating himself?
Given that Rails started 9 years ago, and the whole fad with JS frameworks nowadays, I'd imagine 3 years exp could land you a mid-level job.
Usually cheaper hotels have free WiFi. It's the expensive ones that tend to charge extra.
Nonsense. You need that stuff for localized releases. Allowing worldwide purchase of the English/US version (take it or leave it) is perfectly possible and is easier.

Did you somehow miss how software or SaaS is sold these days? Worldwide?

The real reason is probably something mentioned elsewhere here: distribution contracts already in place.
Cheap oil is a costly holiday present
Present day Russia is very much a laissez faire capitalist society. Money and power are pretty liquid, taxes are low, and self-interest is everybody's assumed motive. Perfect system of incentives, no?

(This is why the political scene is so hard to decipher, nobody in russia pays any attention to the stated aims or motives and conspiracy theories are the default mindset)
Great post! This is by far the best way to learn a language for people who can already program in another language.
'general quality of life for the average American is worse than many places in Western Europe'. Maybe but here's food for thought - Fraser Nelson of the UK Spectator found that if Britain were to somehow leave the EU and join the US it'd be the 2nd-poorest state in the union. Poorer than Missouri. "Poorer than the much-maligned Kansas and Alabama. Poorer than any state other than Mississippi, and if you take out the south east we’d be poorer than that too."

http://blogs.spectator.co.uk/coffeehouse/2014/08/why-britain...
explain :)
Flash has a retained mode graphics API and a fantastic scan-line rasterizer. Each pixel is drawn once which is not the case for HTML Canvas where there is usually a lot of overdraw.

It's all about graphics perf, not AS3 vs JS anymore.
A tip bot that charges commission.
Hey man congrats on you new job!
I have one keyword for you: "mindfulness". Start practicing it.

Cheers,
—A
Infographic: How to build a human
Supermassive Black Hole at the Centre of the Galaxy May Be Wormhole in Disguise
Data tables are extremely fast but I think their concision makes it harder to learn and code that uses it is harder to read after you've written it. It's very reminiscent of APL.
Does anybody know what would the performance gain be in this case?
This type of dissonance is actually quite common and may be nothing personal. This article details some of the sociology issues involved.

The Unforeseen Costs of Extraordinary Experience

http://pss.sagepub.com/content/early/2014/10/01/095679761455...

FWIW if you are successful in other endeavors in life, down the road, you'll potentially deal with these situations time and time again.

Good luck.
Javascript

[45, 69, 82, 82, 89, 0, 35, 72, 82, 73, 83, 84, 77, 65, 83, 1].map(function(x){ return String.fromCharCode(x +32)}).join('')
I did the new grad assessment test last week for Amazon, I am more than positive I aced both sections, especially the coding questions (passed all tests). Yet somehow I still didn't advance. I have other interviews in the pipeline that were way tougher and I didn't get the solutions 100% yet I still advanced.
Copy-paste in your browser console -

// Merry Christmas
console.log(
[45,69,82,82,89,0,35,72,82,73,83,84,77,65,83,1]
.map(function(i) { return i + 32; })
.map(function(i) { return String.fromCharCode(i); })
.join("")
);
It's called – stutter edit.

> The stutter edit[1] is a musical production technique, most often known for its use in electronic music, in which fragments of audio are repeated in rhythmic intervals.

Electronic musician Brian Transeau (better known as 'BT') developed the "technique", coining the phrase, and later released it as a standalone plug-in.

[1]: http://en.wikipedia.org/wiki/Stutter_edit
I'm to lazy to do the math (substract and look for ascii code), but it should be "Merry Christmas". clue: look where "r" is i the string.
Python equivalent for convenience:

map(lambda x: chr (x + 32), [45,69,82,82,89,0,35,72,82,73,83,84,77,65,83,1])

Just paste it into a python terminal and run it :)
Telco (FSVO "telco") may well not be able to fix CLID, broken as it may be - they can replace it for all the good it does. But it's always aggravated me that they can provide ANI to 8xx customers. Way different service I'll grant.
No wonder they recently launched a money transfer service!
This may or may not help. I read this recently and am thinking about it a lot.

http://therumpus.net/2014/12/the-sunday-rumpus-essay-get-rej...
Perhaps someone will suggest a review that takes down Mark Steyn's After America but I haven't seen it.

There is nothing virtuous about “caring” compassionate” “progressives” demonstrating how caring and compassionate and progressive they are by spending money yet to be earned by generations yet to be born.

http://www.davemanuel.com/us-national-debt-clock.php
; Racket version
(apply string (map (λ (x) (integer->char (+ x 32))) '(45 69 82 82 89 0 35 72 82 73 83 84 77 65 83 1)))
Probably doesn't want to be harassed for his solution.
Weekend Project: A flight comparison application for Nigerian domestic airlines
메리 크리스마스 HN. Thanks for all the insights, day in and day out. Love ya.
read schumaker's book THE CORRUPTION OF REALITY.

His thesis is that human beings are evolved to be able to go into trance state and thus compartmentalize/rationalize their foreknowledge of death. This helps them cope and better survive.

This ability to enter a trance state was evolved by mankind and is facilitated by ritual ceremony accompanied by music.
That picture of ZZT was a kick in the nostalgia. That game did more to get me into programming than just about anything else.
Thanks! Any other resources you can recommend? I'd be especially interested in related books/online courses if you know any.
JSMESS Virtual Reality Arcade (with playable cabinets)
> You can easily implement e-voting without letting anyone prove that they voted a certain way.

How? Someone could be standing behind them with the proverbial gun to their head, watching everything they do. They could even be forced to use some other computer to use to cast the vote. In conclusion, i sincerely doubt your bald assertion.
Good chance that the creator of Elm, has heard of google thou
No idea. I just like bulding software tools. If enough people like this tool, it might grow into a more useful product.

I am considering adding either a cloud storage option, or some kind of private cloud (like Aerofs). The current version is just a prototype, no redundancy.
Ironically, there's plenty of worry about the integrity of their Wi-Fi - in a few, highly-targeted cases they've had state-of-the-art attacks (courtesy of the South Korean government).

http://securelist.com/blog/research/66779/the-darkhotel-apt/

I think the big takeaway lesson is: always assume the network's untrusted, let's strengthen our protocols accordingly to ensure they're encrypted and authenticated whenever possible and deprecate the weak ones which are easy to manipulate like HTTP and Telnet. And happily, that's beginning to happen…
Is this the same source of secret information that said Iraq had vast stockpiles of WMDs?
Thanks for referring git-annex. I like their "what git-annex is not" section. All I wanted is to have a secure backup/archiving solution with a GUI and thumbnails for large and raw picture files.
Seriously, don't make it responsive. I'm already shortening my eyesight by reading HN compulsively on a large iPad, I can't imagine the effects of reading it on a phone.
Do you think it will ever be possible for humans to control devices reliably and quickly with EEG input (or noninvasive BCIs in general)?
Merry Christmas and thanks for being with me every single day in 2014.
I used Julia for both a machine learning course and a neural networks course this past semester, and I really enjoyed the experience of developing in the language. I found it really a lot faster than python/numpy and a lot more sane than Matlab. Some key syntactical structures are also very purposefully kept similar to Matlab so it was very easy to translate code between the two, which is incredibly useful in scientific computing. I definitely recommend people check it out; however, I will warn any potential users that the run times of Julia programs right now (as of 0.3.x) are incredibly slow if you need to include any third party libraries. I understand they're working on this for a future release (maybe 0.4), but even including a simple plotting package in your code currently causes a 20-40 second overhead before your code actually starts running because the packages aren't precompiled.

Oh, and one more tip for OSX users wanting to try out Julia. You might want to just use the app bundle provided on the Julia homepage rather than compiling from the homebrew tap. I spent close to an hour waiting for all the dependencies to compile before giving up when I realized I don't want to be doing this every time it's updated.
Tiffany Rings Outlet on Sale
Why Smartphone companies focusing on Selfie phones?
Team opens new frontier of vast chemical 'space', makes dozens of new chemicals
Um, regulating the use of spectrum to prevent interference is exactly what the FCC are for, isn't it?

If you're trying to kick another user of the spectrum off it, that is jamming - specifically ECM, given it's taking a more technical approach than just filling the band full of noise. Many military jammers are pretty technical in their nature, but it's absolutely not an OK thing for a hotel to run, that's just ridiculous.
No arms race. The problem has already been solved with protected auth frames. The only thing that really works agains t that is to violate the protocol and actually jam the signal.
I read HN since 3 years. I've created my startup 1.5 year ago. I think that says it all. Oh and I had revenue from day 70, currently cash-flow-positive, and I've taught a lot of people what bootstrapping means. Thank you, community.
Firefox had things (XULRunner, and later running it via Firefox via WebRT). I have no idea about Chrome.

Experience learned during the XULRunner era is that Mozilla doesn't really want to be a platform, so they don't care very much about API changes. This means that using a shared runtime means apps will randomly break as the runtime is upgraded. Alternatively, you can attempt to keep multiple versions of the runtime around (.Net-style); but since releases are every 6 weeks and downloadable applications don't tend to have that kind of release cadence, you end up with essentially one copy per app anyway.

If the platform actually acts like they want to be a platform (the way Qt does, with supported stable releases spanning years as an app gets developed), that might work?
Why Santa Claus Is a Big Deal in Ukraine
Using the science of motivation to foster creativity
We think alike, I looked him up online as well.

1. WWI hero who was left for dead on the battlefield, captured and then escaped German captivity twice

2. Foreign correspondent

3. Worked for a Congressman which explains his D.C. connections

4. Rigged up a wireless set with car batteries and reported live from a Miami hurricane

Sounded like he was a larger than life guy.
Wow this is awesome. It takes me back to my own BBS days from when I was only 6 years old+!

What's a shame is how much people in the beginning created to share with people -- it cost money to run these BBSes let alone call into others. The Internet as a whole was built similarly where protocols like email allowed a diversity of providers and people to talk regardless of implementation/account.

Now I'm seeing a complete commercializations of all communication, from Facebook owning a giant chunk of social to now even with slack I see on product hunt some list of semi-public channels replicating what IRC has done for years. Attempts as decentralized social networks haven't gone anywhere because it's been protocol first, implementation & network effect later (not to mention all trying to clone fb or Twitter versus having a differentiated experience). Plus everyone in a mobile non-html world just wants to own the next big thing.

We need more Mozillas out there doing things beyond the web to get communication out of the hands of individual companies and into the greater public. With blockchains, oauth, json, and cloud storage the tech is there to do interesting stuff. We need now someone that already has the network to step forward.
This is all well and good but there are significant safety issues here. Insulin will kill you if you get the dose wrong. Or more worryingly, won't kill you but will kill your child. As a children's diabetes doctor I know this more than most. This article suggests that the only people interested in fixing the closed loop are a bunch of amateur parents - there are large studies going on in several centres across the world looking at exactly this issue - the algorithms to match insulin to glucose are not straight forward: insulin absorbs slowly, with peak action at 2 hours, gone by 4 hours. In children absorption is less predictable - I have a baby on my ward now whose 'insulin-on-board' is 6 hours. The closed loop is the holy grail for T1 diabetes and there is a lot of time, intellect and money being thrown at it. While open source hacking from intelligent and able programmers is always welcome, experimenting on your own children is dangerous and ill-advised.
That's a good point - if Uber should fall under Taxi law, so should SuperShuttle and various other airport shuttle services. Once there is already a consumer relationship in place, there is no need to protect consumers more than with the normal anti fraud protection.
Thank you! Merry Christmas to all of you :-)

And thank you for being a big part of my small world :-)
I find it amazing how well working-class unions have been demonized in modern American society. Especially when this[1] is happening. There was a comment on another post a few days/weeks ago about how the AMA and bar associations are basically unions for professionals that have avoided this demonization and that the software industry ought to consider something similar to prevent the fixing of wages and the depressing of wages using foreign workers. If such unionization directly benefited you, would you be in support of it then? (honest question)

[1] http://www.economist.com/blogs/graphicdetail/2014/11/daily-c...
Man Arrested After Google Tips FBI to His YouTube Comment
Walter, I still don't know how you make money :)
You can also make these using this structure:

template <class T>
struct node { node<T> *next, *prev; };

template <class T>
struct intrusive_list : private node<T> { };

Your type foo then subclasses the node<foo> type, and in some places intrusive_list<foo> has to statically cast them back down.

This means you don't need that messy "T *owner;" pointer anywhere.

The downside is that if you want your type to be a member of multiple intrusive lists, you have to make spurious parent classes and inherit from those.
Are you talking about loanwords from English in the Korean used in North Korea? Korean was already borrowing words from English decades before the division of the peninsula, as you can see in writings from the Japanese colonial period. So North Korea inherited a lot of these same loanwords. It has nothing to do with South Korean influence, if that's what you're suggesting, as the language communities of the North and South have been effectively cut off from each other since the war.

However, there are often differences in the spelling of such loanwords between the North and the South. So you have 프로그람 (p'ŭrogŭram) in the North but 프로그램 (p'ŭrogŭraem) in the South for "programme", 텔레비죤 (t'ellebijyon) in the North but 텔레비전 (t'ellebijŏn) in the South for "television", and 미싸일 (missail) in the North but 미사일 (misail) in the South for "missile". This is due to the fact that the standardized spelling of loanwords (a problematic and much debated area of Korean orthography) was frequently reformed in South Korea, and probably in the North as well, so the principles of spelling have turned out quite differently between the two. Also, as North Korea uses a lot of loanwords from Russian, even loanwords originally from English tend to be absorbed in the Russian pronunciation, such as 땅크 (ttangk'ŭ) for "tank" or 뜨락또르 (ttŭrakttorŭ) for "tractor" as opposed to SK 탱크 (t'aengk'ŭ) or 트랙터 (t'ŭraekt'ŏ) which is closer to the English pronunciation.

The official language policy in both the North and the South tends to discourage loanwords from English, but it seems a bit more successful in the North, especially when it comes to post-1945 loanwords. If you only focus on the differences between the North and the South, then you see many cases where North Korea uses native Korean words whereas South Korea uses loanwords from English. But you can't extrapolate from that and conclude that North Korea doesn't use loanwords from English at all. This would be a misconception, just like the false notion that North Korea doesn't use Sino-Korean words.
Downvote. This is a waste of energy/time that could be put to making the world a better place than tearing it down. I dont understand how people with technical talent want to do something so negative with their limited time on earth.
Срећан Божић!
No it's not. A stutter edit is about much shorter pieces, and notably not about repetition. I'm not sure where Wikipedia got that from. It's about adding little silent gaps to tracks.
Top NBA Plays: December 23rd
Here's another example [1] of the same. Blizzard games from WC2 to SC2 use this code nearly verbatim (testing 1 instead of INT_MAX for 64-bit compat in newer titles).

1. http://www.codeofhonor.com/blog/avoiding-game-crashes-relate...
How to Protect Home Networks
Thanks for the detailed writeup! I've done a lot with the Reactjs-esque elm-html, but have yet to try out the graphics libraries.

This was a nice introduction to that part of the ecosystem, and I definitely plan to revisit this post when I get around to taking Elm's graphical capabilities for a spin.
And BSD / OS X. Check out queue(3).