Ask HN: How can I prepare for a coding interview in a week? - <AUTHOR> I am from ECE background, been working in machine learning, and data analysis fields for couple of years, and have decent coding experience in Python and C/C++.
I am about to be interviewed by one of the big five (they reached out to me, I wasn't actively preparing for interviews).
Not being from a CS or software engineering background, I never took an algorithm and data structure course, and from what I know the coding test mainly involves those.
I know there are a ton of resources online for coding interview preparation, but I wanted to seek suggestions on an efficient/quick resource given that I have strong coding skills but not familiar with data structure/CS algorithm. <comment><USER2> Truthfully, you don't have enough time. There are so many candidates who basically eat and breathe Data Structure and Algorithm for at least few months so that they can get into big five that your last one week preparation might not match up to them, especially without any prior experience like a course. I don't want to demoralize you, but how about you tell them that you aren't prepared right now, and would like to interview after 4-5 months. I think these companies are always looking for good talent, and don't mind interviewing someone later if they find the profile interesting.

<comment><USER3> This sounds like great advice, but it's very funny from a distance. "I think I'm a great candidate for the work you need done, but your interview process has nothing to do with that. As such, I'll need to reschedule so I can spend a few months gaming that process."

I'm excited to be interviewing programmers in the near future as our company grows. I have to think through a lot of things, but I'd like to focus on: Have you successfully deployed an application before? How have you overcome the technical challenges of programming on a team. How have you improved your abilities over time. Explain something you're proud of creating in the format you're most comfortable with. How do you power through losing passion about a project? How comfortable will you be learning new frameworks and paradigms? Prove to me that you're an able programmer in whatever format you'd prefer. Etc.

All questions available ahead of time. Try to keep things comfortable for the candidate. Enough depth and variance to figure out if they have the technical skills you need. You get to see how they like to work.

<comment><USER4> An honest question for HN: has anyone really been in a project whose primary reason for failure was the lack of engineering talent? I have worked in micro/small businesses and large enterprise environments, and this has never been the case. The projects I have seen fail usually do so due to poor management, poor performers are typically fired unless they can pull one over management to make themselves seem more competent than they really are (not that difficult with bad management)

<comment><USER5> I have. It's a long and interesting story, full of intrigue, backstabbing, hacking, and corporate espionage. But in summary:

Owners started tech business using trust-fund money. They were extremely non- technical, scared of computers to be honest. They hired people that were like them (also non-technical), and didn't have the ability to properly vet candidates. Tech staff was hired basically off of Craig's List with very little interviewing. Tech was built and company got large enough to get a couple contracts (heavily influenced by owners' existing personal connections).

As you'd expect, tech stack started creaking under the load. At first tech staff thought they had everything under control (strong Dunning-Kruger effect, bolstered by early successes). Eventually tech staff realized how badly things were going and started lying to management to cover for their own incompetence.

Decent tech management was hired (I think by accident) and the tech staff saw the writing on the wall. The entire tech staff just didn't show up to work one day. Left without any notice or warning (the more intriguing stuff tangents off here). New, more capable tech staff was hired (including me). At this point the system was hemorrhaging data and users. We triaged, stemmed the bleeding, and built out a decent infrastructure with a decent tech stack.

Unfortunately for them that was too late. The contracts had fairly stiff penalties for non-compliance, and the company was in non-compliance for a looooooong time. The owners had made some false statements about the assets of the company, and settlements offered were based on those statement, far too high for the company to pay. Other companies were pissed about that and took it to court. Owners ended up getting taken to the cleaners and lost pretty much everything, including a bunch of assets that they had owned before but transferred to the company (including real estate) in some fairly shady tax dodge scheme.

Ultimately the world is a better place now that this company doesn't exist. It operated in an extremely sketchy manner, and I left when I found out the gist of what was going on. I learned the earlier and later parts of the story from personal connections.

Does that count? I mean, ultimately I think if you have poor engineering talent then it's management's fault. But you can make that argument for any corporate issue: it's management's fault for not recognizing the problem and addressing it soon enough.

</comment></comment></comment></comment><comment><USER6> I'm in a similar situation RN, and this is my battle plan:

𝗗𝗮𝘆 01

* Backtracking - know how to solve 1 problem (Knight's tour)

* Tree - implement BST

* Tree traversal - implement DFS, BFS & DFS iterative

𝗗𝗮𝘆 02

* Quicksort - know how to implement

* Mergesort - know how to implement

* Binary search - know how to implement

* Min/Max Heap (priority queue) - know how to implement

𝗗𝗮𝘆 03

* Graph - implement adjacency list

* Graph traversal - implement DFS, BFS & DFS iterative

* Graph algo - implement "Prim Minimum Spanning Tree"

* Graph algo - Implement "Detect Cycles algo"

𝗗𝗮𝘆 04

* Graph algo - Implement "Detect Connected Components" algo

* Graph algo - Implement "Lowest Common Ancestor" algo

* Graph algo - Implement Djikstra single shortest path algo

𝗗𝗮𝘆 05

* Sets - Determine all subsets of a set

* Sets - Determine Maximum consecutive subarray sum

* Sets - Determine 2 sets intersection

𝗗𝗮𝘆 06

* String - Implement Levensthein Edit distance

* String - Implement Polynomial Hash

* String - Determine all substrings

* String - Find anagrams

𝗗𝗮𝘆 07

* String - Implement KNP algorithm for pattern matching

* Basic DS - Implement Queue, Stack, Dynamic array, Linked list absolutely cold

\----

I chose javascript as the language for all this brushing up (no need to manage memory, and I can focus on the algo)

It's a big list, but it's a traversal of the CS engineering domain that makes sense to me, and it's only a fraction of the expected knowledge for that kind of interview.

\----

Edit: I pushed some of the code of this list on GH here: [https://github.com/netgusto/brushup](https://github.com/netgusto/brushup)

I struggle to implement each concept in the smallest, simplest way possible. I'll keep adding code as I write it.

<comment><USER7> Why would you want to work for a company which asks these question in the interview?

<comment><USER5> I can't speak to other companies, but I do know my [unofficial] experience interviewing (on both sides) at Google.

As an interviewee, you know that you're going to have a handful of different interviewers. What you don't know is how much of an effect each of those interviewers is going to have on the hire/no hire decision. Is one bad interviewer enough to torpedo you? Two? And you have no idea what kind of questions each interviewer will ask. So, let's say only 10% of interviewers ask these kinds of questions (I'm guessing that's low). That's a ~41% chance that you're going to have to answer this, and if one bad interviewer is all you need, then you'd be foolish not to prepare just in case.

As an interviewer, we're given surprisingly few guidelines on how to interview. You take a one day class, then shadow half a dozen interviews, and that's it. We aren't given specific questions to ask, and specific questions get banned all the time (any time they're "leaked" as a Google interview question).

Once someone is hired it's _really_ hard to force them out, so approving someone who talks a smooth game but can't back it up is extremely costly. I've seen teams get stuck with multiple people for well over a year because it takes a long time to get them out, they won't leave willingly. Meanwhile they're taking up headcount and letting them actually touch code is dangerous. In fact, I've seen teams spend an additional engineer training them to the point where they are productive, just because that's cheaper.

So you want people to actually prove themselves with some kind of an algorithm question, but you get no real guidance on how to provide these and you constantly have to come up with new ones, but they have to be the kind of question that take less than 45 minutes to explain and solve. I have no doubt that some people fall back on these kinds of questions.

Yeah, I get that these questions suck, and I try not to be _that interviewer_. But as an interviewee I would consider it extremely foolish to not brush up on it, just in case.

<comment><USER8> You said it yourself "they're taking up headcount and letting them actually touch code is dangerous". My question is, how did they managed to get into Google if they apparently don't know how to write code? The only way to get into google is to go through a huge set of 45-min whiteborad crap. Not once, not twice, we're talking about 7-8 times! Going over the same stupid 45-min "technical screen" where only the original question varies. You need to know all the CS basic stuff + ability to scale (if possible). Like they all say in Silicon Valley - the only way for us to know if you're a rockstar is if you manage to crack a few meaningless problems on a whiteboard. Oh... and make sure to pick your favorite language. Your Resume tells us you have a MS in CS but we don't believe it. So we're gonna put you back into a college-like exam to make sure your degree isn't fake.

To me, that's step zero. I still can't believe companies like Google, etc get stuck at step 0. They don't seem to care about step 1, 2, 3, 4. It doesn't matter if you have 1 year or 10 years of experience, we all go through step zero (again, even though we got an MS in CS a few years back).

So, if Google ends up in a situation where "teams get stuck with multiple people for well over a year because it takes a long time to get them out", it's because the hiring process at Google sucks. If it is that costly and painful to hire the wrong people, then why Google hasn't put more resources to actually innovate and think beyond college-like evaluations. It is OK for people with zero experience, it is not OK for people with at least one work experience (which I call step 1). Of course, if you have 10 years of experience they need to use a different language in order to interact with you. So, unless someone just graduated from college looking for a job, you can't hire someone exclusively based on step 0 because it simply doesn't tell you if a candidate knows how to write code, build features, work in a collaborative environment, deal with requirements from product team, reuse exiting code, handle code reviews and feedback from peers, create frameworks or adopt new frameworks. All it tells you is if your CS degree is fake or not...

<comment><USER5> > The only way to get into google is to go through a huge set of 45-min > whiteborad crap.

This is not the _only_ way to get into Google.

> Not once, not twice, we're talking about 7-8 times!

When I interviewed I had one 15 minute phone screen, and one round of in- person interviews. The in-person set was 5 people. Of those I think I cratered on one of them, did adequate on two, and stellar on the last two.

> Like they all say in Silicon Valley - the only way for us to know if you're > a rockstar is if you manage to crack a few meaningless problems on a > whiteboard.

Very few people get hired as a "rockstar", and the ones that do tend to be hired for non-coding roles.

> Oh... and make sure to pick your favorite language.

Yeah, the point is for you to answer the question and not get hung up on language semantics that you aren't comfortable with. I interviewed in C# despite ~0.1% of code at Google being C#. I had a very in depth conversation about contract differences between C# and Java that I think impressed the interviewer, despite me not knowing a single line of Java and him not knowing a single line of C#. If you pick the language and still struggle with the semantics of it, that's a huge red flag.

> Your Resume tells us you have a MS in CS but we don't believe it. So we're > gonna put you back into a college-like exam to make sure your degree isn't > fake.

An MS in CS doesn't, by itself, qualify you for a role at Google. I have plenty of friends who have the degree who I like very much, but I wouldn't want them on my team.

> I still can't believe companies like Google, etc get stuck at step 0. They > don't seem to care about step 1, 2, 3, 4. It doesn't matter if you have 1 > year or 10 years of experience

Yeah, I came in with 15 years of experience across 7 different firms. And I went through the same thing. I've also worked with people who have been in the industry for all kinds of timeframes, up to 35 years, and I've seen little to no correlation between "experience" and ability.

A higher-touch process with more "describe what you did at company X" would be nice. But it also feels easier to game. I read design docs for projects at all levels at prior roles, including rationale, alternatives, etc. If I wanted to pass one of those project off as my own through an interview I don't think it'd be very hard. I also don't see any other companies that hire at the rate that Google does (well over 100 software engineers per week) that manages to do that.

> So, if Google ends up in a situation where "teams get stuck with multiple > people for well over a year because it takes a long time to get them out", > it's because the hiring process at Google sucks.

So now you're arguing for a _more_ stringent review process, but one that doesn't require actually demonstrating any abilities? Also, this is less of an issue with hiring, and more of an issue with staff management.

> you can't hire someone exclusively based on step 0

I'm not sure why you think that Google is "stuck" at step 0, or that we stop there. There is generally no feedback to a candidate about why an offer isn't extended. You're assuming that it's because of a whiteboard coding issue when it might be that your experience doesn't really mesh with what's needed.

There are a wide variety of factors that candidates are scored on, and there are plenty of them that have nothing to do with the code that's written on the board. I've had plenty of candidates that have gotten a "hire" recommendation despite not having an optimal, or even a correct answer on the board. I was confident in their abilities because they demonstrated that they recognized there was a problem, usually due to running through test cases, and that given enough time they would solve it. I've had candidates that have gotten a "no hire" because, despite have a correct and nearly optimal answer, they refused to listen when told that "result &= true;" is a no-op in Java.

Is the interview process perfect? Of course not. Perfection isn't achievable. And I'm happy to listen to suggestions on how to improve the process. But your suggestions seem to be: 1.) Don't ask whiteboard questions at all (which I have yet to be convinced of), 2.) Don't stop at asking whiteboard questions (which we don't).

</comment></comment></comment></comment></comment><comment><USER9> I'm doing a lot of interviewing at a big five company, but speaking personally and unofficially - when it comes to code, I'm looking for fluency more than anything else. At the phone screen level (which I assume is where you're at), the questions I ask are in the same complexity ballpark as fizzbuzz (ie the task will be fully specified in 5 sentences and assumes no prior knowledge), and I expect a candidate to be able to implement that without having to google for "how do I access an array element in <language that the candidate has freely chosen and claims to have mastered>?". The bar for on-site interviews is somewhat higher, but for the first round of interviews, just "do they struggle with basic syntax" is enough to filter out a remarkably large number of people...

Also (again personal opinion) - python is the most practical language for doing interview questions, because interviews are heavily time-constrained and python allows the developer to go from idea to implementation in the shortest amount of time. I'm not going to penalize anyone for their language choice, but somebody who completes the task in 5 minutes and then spends 25 minutes getting bonus points for things like "what if the input data is larger than RAM?" is going to come across stronger than someone who spends 30 minutes on parsing the input and runs out of time before they get to the algorithm.

<comment><USER10> > python is the most practical language for doing interview questions, because > interviews are heavily time-constrained and python allows the developer to > go from idea to implementation in the shortest amount of time.

i'm not sure if python is the best, but it's a very strong choice. python also has a lot of built in data structures that are relatively non-broken and highly useful for the archetypical algorithm-prototyping interview questions

e.g. if you are using a language that only lets you use strings or ints as keys for dicts/hashmaps - instead of say letting you use immutable compound values as keys, or a language that doesnt give you set data-structures which support basic set operations (contains, equal, subset, superset, intersect, union, etc), or a language that requires you to write a paragraph of OOP- boilerplate to encode e.g. a list of pairs of values, you're making life harder for yourself than necessary.

also, i claim without evidence that prolonged and continuous exposure to working with languages that dont offer sensible data structures, or only offer broken data structures, may over time hamper your ability to think and problem solve clearly.

</comment></comment><comment><USER11> I was in this exact position a month ago and I landed a great job because of doing very well in two technical interviews. I also am a strong Python programmer who was rusty on the classic CS stuff. Go to Codility's programming lessons page:

[https://app.codility.com/programmers/lessons/1-iterations/](https://app.codility.com/programmers/lessons/1-iterations/)

and try to do at least two exercises from each lesson up to lesson 15 if you can. The open reading material at the top of each section is excellent and discusses all the CS theory you will need.

Good luck!

</comment><comment><USER12> Read chapters 2-5 of Skiena's book, then do leetcode eight hours a day until your interview. Start with high-pass-rate mediums, then work your way up, and try to solve some hards. Spend about half an hour on each problem, and if you can't think of an answer, look at the solution, reimplement it, and think hard about the underlying concepts.

This will not guarantee you a pass — honestly, some people spend months preparing for the big 5 interviews — but it may give you a fighting chance, and either way it will give you a good foundation for future interviews.

<comment><USER13> Leetcode is a good idea.

[https://leetcode.com/problemset/all/](https://leetcode.com/problemset/all/)

And frankly, given your lack of background in this area, it would do you a world of good to get more time to prepare. Try to push the interview back a bit. Even one extra week would be an improvement.

</comment></comment><comment><USER14> I'm surprised nobody mentioned LeetCode. You can start solving 100 most popular interview questions (sort them by difficulty first):

[https://leetcode.com/problemset/top-100-liked- questions/](https://leetcode.com/problemset/top-100-liked-questions/)

If you've never took any algorithm course and have only a week for preparation, it would be very difficult to prepare for coding interview. But I think you can at least finish all easy problems from this list. In this case, you may at least pass screening coding interview.

Right now, I'm very actively interviewing with pretty selective high-frequency trading companies. I can say that LeetCode has pretty relevant set of interview problems.

One more thing. Even if you solved a problem, always look at description of solution, if there is no description of solution, you should look at discussion.

From there, you can find references to common algorithms/themes like binary search etc.

</comment><comment><USER15> You aren't going to gain the skills gained by a four year education in a week. And if you try it will likely be obvious. Interviewers (at least the good ones) aren't looking for someone who knows a particular algorithm by memory, they are looking for someone who is familiar with the concepts. And familiarity is easy to distinguish from rote memorization.

The good news though is that unless you lied on your resume, they already know that and are still interested in you. So you likely have other characteristics they are interested in.

I would concentrate instead on learning about the company you are interested in. That's something you can do in the course of a week.

<comment><USER16> >You aren't going to gain the skills gained by a four year education in a week.

I know someone who was able to pull it off in 2 weeks, though they were unemployed at the time. They got into Google with 7 years of prior experience at the time. He admits a lot of it was luck. But it's possible.

<comment><USER15> I'm guessing it's the 7 years of experience that impressed Google, not the two weeks of cramming.

<comment><USER16> Your background only matters for getting the interview. Whether or not you are hired depends on your actual performance during the onsite.

<comment><USER15> Yes, but his performance was more aided by his 7 years of experience than his two weeks of cramming.

</comment></comment></comment></comment></comment><comment><USER17> Ask your recruiter what the test contains and how it relates to the position they are interested in hiring you for, and then just strait up tell them, that you are not strong in algorithms and data structures, but you are strong in ECE and machine learning, and they should hire you for those things.

</comment><comment><USER18> You could try reading/skimming over the book "Cracking the code interview" to get some insight in how the company handles interviews. The big five are in there so you'd get more information that way. Besides that, a week should be okay if you study hard and got good resources.

</comment><comment><USER19> Man, I've never studied for an interview...

I turn up on the day, but then these interviews asking difficult algorithm question seem to be a rarity in the UK, thankfully.

Our interview process seems to be much more reasonable.

<comment><USER20> Because it's insane. You will not use of those algorithms in your job, and even if you do, they are ready to use in modules already.

It's just a way to see who can learn those algorithms because the big five need to filter out most people somehow. This is their method of doing it.

<comment><USER15> More likely they aren't testing your knowledge of the algorithm but testing your ability to write code.

</comment></comment></comment><comment><USER21> Coderust has been an invaluable resource to me. Yes, it won't give you what a CS degree gives you, but it's enough to make you feel confident in a week or less.

[https://www.educative.io/collection/5642554087309312/5679846...](https://www.educative.io/collection/5642554087309312/5679846214598656)

</comment><comment><USER8> Based on what you've described (not familiar with data structure/CS algorithm) the answer is very simple - you can't prepare in a week. Don't do it.

Tell the recruiter you need a month to prepare or they will have to skip the CS basic screen for you in order to fast forward the process. If you're one of these niche developers (python/C++), you might have a little power when it comes to asking you the right questions. Same goes when a company originally contacted you, you're in a position of power.

<comment><USER22> Sorry, are you saying knowing python/C++ makes OP a niche developer? I was under the impression these were very common languages at the big-N? Or is it something else about their background?

Not trying to correct you, I'm really just curious since I have a similar background and an in a similar situation to the OP.

</comment></comment><comment><USER23> [https://www.interviewbit.com](https://www.interviewbit.com) is a good platform to practice algorithm and data structure questions as if in an interview environment.

<comment><USER24> +1 for interviewbit. But it cannot be completed in a week if OP tries to solve all the problems. Instead focus should be on solving few questions from each category.

</comment></comment><comment><USER25> Glassdoor is a decent website to guage the type of questions you'll get during an interview for a specific position.

Ive had interviews that re use the exact same questions (fortune 100 companies)

</comment><comment><USER26> Not that this answers the question, but if they're big 5 they should be willing to give you more time. Ask them for a month and see what they say.

</comment><comment><USER27> I would postpone the interview. Give yourself at least 2 months to study this stuff. If you can't postpone it, then I would go ahead and do the interview anyway. There are some good suggestions below, try to spend at least a few hours each day. Hopefully a few hours in the morning, then a break, and then a few more hours. Get plenty of sleep.

When you do the interview, do your best and try not to care about the outcome. If you don't care about the outcome, you won't be nervous and you'll likely do better.

</comment><comment><USER28> If the company is Google, be aware that they contact pretty much everybody. You shouldn't feel special because they contacted you.

Why not stick to data science, which is very hot right now?

<comment><USER29> You think for data science position they won't test you with the usual algo questions?

</comment></comment><comment><USER30> You can't gain the knowledge of a CS degree in a week, but you can calm your nerves.

Have some friends conduct a few mock interviews every day, giving you some questions you don't know the answer to. Then have them give feedback on your poise, especially with difficult questions.

You will be calmer and more confident in the rough patches of the interview.

</comment><comment><USER31> Can anyone with experience with "big 5" interviews tell me what to expect out of web development job application process?

As someone who is coming from another web dev job, not coming right out of college.

Will I still be quizzed on data structures and algorithms? Or will it be more on-topic subjects like frameworks, patterns, architectures, etc?

</comment><comment><USER32> [https://www.educative.io/d/InterviewPrep](https://www.educative.io/d/InterviewPrep) has courses to brush up on DS/Algorithms and problems to practice coding interviews.

</comment><comment><USER33> I would recommend 'the imposter syndrome".

[https://shop.bigmachine.io/products/the-imposters- handbook](https://shop.bigmachine.io/products/the-imposters-handbook)

</comment><comment><USER34> [https://codesignal.com](https://codesignal.com) has a good intro-level course, make sure to focus on the "medium" difficulty and above problems

</comment><comment><USER35> [https://www.interviewcake.com/](https://www.interviewcake.com/)

Perfect if you want to crack something in a week

</comment><comment><USER36> You can opt for some mock interview practice app such as MockRabbit which I generally use

</comment><comment><USER37> Probably good to know git

<comment><USER38> yup. "git push -f" \- allow it or ban it? Should git hooks run all tests locally?

<comment><USER39> \- Ban it for everyone; if you need it, temporarily grant power to the admin to fix something.

\- Only if they take a completely trivial amount of time

</comment></comment></comment><comment><USER40> Prepair on theoretical level as well, O notations, and such.

</comment><comment><USER41> I know this is going to come across as a stupid question, but I would like to ask what the point is of studying for an interview? I am self-taught (under guidance from a mentor) with no formal training, and don't understand why one would prepare for an interview by studying. Isn't that dishonest in a way? Shouldn't an interview determine if you are comfortable providing a service and (ultimately) generating profit for the company hiring you?

<comment><USER42> I'm not a programming professional, but as I understand it: you study for interviews because the biggest tech companies used to ask difficult data structure & algorithms-based questions, plus some difficult/tricky questions which require a particular style of thinking. Now nearly everyone does it, and YouTube and textbooks offer lots of help... Which has started an 'arms race' in knowledge about DS&A and answers to tricky problems between interviewers and interviewees.

At some point I think it was intended to be like a 'coding-oriented IQ test', after you'd passed a set of HR checkboxes. Obviously an IQ test you study carefully for is not a broadly applicable measure of relative performance. As far as I understand, many of the top companies are shifting away from this interview paradigm, but it'll take the rest of the industry which adopted it a long time to catch up (I imagine).

<comment><USER43> You're mostly right. Also, big companies want to

* Minimize the time spent by their engineers interviewing candidates,

* Standardize the process as much as possible, so that anyone can run the interview.

I'm convinced there are many reasons for smaller shops not to blindly follow Google's practices. But as a candidate, what can you do... it's their loss, I guess.</comment></comment></comment>


Building Web Applications with Elixir - <AUTHOR> http://carlwoodward.com/elixir/

<comment><USER2> Mistake in the "With pattern matching you can save a few lines:" section, the clause matching nil should probably go first, otherwise the user variable ends up being bound to nil.

<comment><USER3> Good point, pushing an update.

</comment></comment><comment><AUTHOR> @cjwoodward do you see elixir becoming to go to language for an API based web applications with an ember / angular front end?

<comment><USER3> Absolutely. That is the use case that I am working with and it works really well. As with any new languages/frameworks there are quirks to deal with but I am finding it a joy to work with.

The added bonus of working in a new space is you get to contribute back more. I've committed more open source fixes and changes then previously when working with other languages.

The eco-system is coming together as well. Check out [http://expm.co/](http://expm.co/).</comment></comment>


The NY Times endorsed a secretive trade agreement that the public can't read - <AUTHOR> http://www.washingtonpost.com/blogs/the-switch/wp/2013/11/08/the-new-york-times-endorsed-a-secretive-trade-agreement-that-the-public-cant-read/ <comment><USER2> Two random comments:

First, the NYT is engaging in the standard Brooksian/Friedmanist technique of supporting something with apparent qualifications, but actually engaging in unconditional support. That is, using the Iraq War as an example:

\- I support the Iraq War, if it is done this way (describe reservations)

\- The Iraq War is not done that way in the slightest

\- Given the above, I support the Iraq War

The NYT supports TPP with qualifications; the TPP will not have those attributes; given the above, the NYT will absolutely support the TPP. It's a way to deflect criticism - if anyone criticizes your support, you just point to your expressed reservations.

Second, free trade has proven to be not good for the bulk of the public. Most HN commenters, having been immersed in right-wing economics, have the belief that it is somehow scientifically proven that free trade is beneficial for all, but that's not actually what the science says. The results of decades of "free trade" agreements have been to overrule local decision-making; they are profoundly anti-democratic. They've resulted in a massive transfer of wealth from the bulk of the population to a very few, very wealthy individuals. Free trade agreements are a substantial cause for the fact that most workers in the United States are making less money now than they were 30 years ago, even though their productivity has gone up massively in the meantime.

If an action X takes away $1 from each of nine people, and gives $15 to the tenth person, the total benefit for society in dollars is theoretically positive (-$9, +$15) but nine out of ten people have been harmed by it, and it's not clear that the real benefit is positive at all, because of the declining marginal utility of money. That's pretty much what "free trade" represents. Add in the anti-democratic aspects and it's clear to me that modern "free trade" agreements, negotiated in secret between the Aspen corporate elite, are something that should be roundly opposed.

<comment><USER3> Free trade agreements aren't. Really. If they were free-trade, they wouldn't need thousands of pages of legalese. What it is is "managed trade", an agreement essentially made to benefit certain large corporations (as you pointed out), but also to restrict and to make many exceptions. It ends up being complex enough that only a large entity with a legal department can take advantage of it, rather than small and medium-sized entreprises.

<comment><USER4> _If they were free-trade, they wouldn 't need thousands of pages of legalese. What it is is "managed trade", an agreement essentially made to benefit certain large corporations (as you pointed out), but also to restrict and to make many exceptions._

Indeed.

These kinds of agreements are like DRM for economics.

</comment></comment></comment><comment><USER5> Executives using treaties to alter domestic law is going to be one of the defining issues of the 21st century. One take on the problem was starkly put in antifederalist #75 in 1788 by a person using the name Hampden (who had been a figure in the English civil wars, of which the American revolution in some ways was an extention). Well worth taking two minutes of your time to read.[1]

The stakes are highest in the EU at the moment as it is made of treaties and there are significant forces who see that process as an illegitimate way to make a federation. The time frame there is 5-10 years where besides the 'muddle through' we often see in Europe, which is very possible, an implosion of the whole thing, a federation or both are all possibilities with massive consequences due to the inherent logic of monetary union. Unfortunately contemporary television and print journalism is not well calibrated to exploring these issues.

[1][http://www.thevrwc.org/antifederalist/antiFederalist75.html](http://www.thevrwc.org/antifederalist/antiFederalist75.html)

<comment><USER6> Treaties are ratified by Congress, so they have a veto.

<comment><USER7> But only by the Senate, not the House, as pointed out by the link the other poster had. (not that I agree with the extreme right-wing views of the linked site)

<comment><USER5> That was not a deliberate choice it was just the first hit on Google for AF#75, there is an edited compilation in print but you can't link to it.

<comment><USER7> Ah, hopefully no hard feelings, then. The article did make some good points, though, as said.

</comment></comment></comment></comment></comment><comment><USER8> Countries involved:

Japan, Vietnam, Malaysia, Brunei, Singapore, Australia, New Zealand, Canada, United States, Mexico, Peru, Chile.

[http://americablog.com/wp- content/uploads/2013/11/TPP_map.pn...](http://americablog.com/wp- content/uploads/2013/11/TPP_map.png)

Discussion on Bill Moyers

 _A US-led trade deal is currently being negotiated that could increase the price of prescription drugs, weaken financial regulations and even allow partner countries to challenge American laws. But few know its substance. The pact, the Trans-Pacific Partnership (TPP), is deliberately shrouded in secrecy, a trade deal powerful people, including President Obama, don't want you to know about. Over 130 Members of Congress have asked the White House for more transparency about the negotiations and were essentially told to go fly a kite. While most of us are in the dark about the contents of the deal, which Obama aims to seal by year end, corporate lobbyists are in the know about what it contains. And some vigilant independent watchdogs are tracking the negotiations with sources they trust, including Dean Baker and Yves Smith, who join Moyers & Company this week. Both have written extensively about the TPP and tell Bill the pact actually has very little to do with free trade. Instead, says Dean Baker, co-director of the Center for Economic and Policy Research, "This really is a deal that's being negotiated by corporations for corporations and any benefit it provides to the bulk of the population of this country will be purely incidental." Yves Smith, an investment banking expert who runs the Naked Capitalism blog adds: "There would be no reason to keep it so secret if it was in the interest of the public."_

[http://vimeo.com/78324869](http://vimeo.com/78324869)

Edit: Missed Brunei (fact it is slightly smaller than Delaware, notwithstanding)

<comment><USER9> This is fairly worrisome, but I have to disagree in a minor way with this particular bit:

 _There would be no reason to keep it so secret if it was in the interest of the public._

The public generally hates free trade, but free trade is in the public interest. It's one of those things.

<comment><USER10> _The public generally hates free trade, but free trade is in the public interest. It 's one of those things._

In a representative government, the public should decide what's in the public interest.

<comment><USER11> Then why have representatives? You're describing direct, not representative, democracy.

<comment><USER7> Maybe it's time for a hybrid form of government, then. Replace the Senate with direct democracy to ratify or reject bills and such, and use the representatives in the House as specialists to write legislation.

Of course, there might be some issues with having weekly ballot referendums, but look at the mess we have now.

</comment></comment></comment></comment></comment><comment><USER12> The nice thing about the NY Times is that its reporting offers a general indication of what powerful interests in the US want.

</comment><comment><USER13> Previous discussion regarding the original EFF article: [https://news.ycombinator.com/item?id=6692833](https://news.ycombinator.com/item?id=6692833)

</comment><comment><USER14> Is anyone else reminded of "Network", near the end (spoilers, for a 40 year old film), in which the Howard Beale character goes off on a rant about a secretive global merger, causing the public to flood the government with protest, which then earns Beale a meeting with the company CEO and a lecture on free trade and the insignificance of humanity?

If you haven't seen "Network", it's the movie from which, "I'm mad as hell and I'm not going to take it anymore" comes from. However, the movie is not really about standing up for your rights, it's more about modern American media, and of all the satirical movies I've ever seen, it's the one that comes closest to predicting what has come to pass. It's a brilliant, brilliant movie...the only one, I believe, to have nominees in all four Oscar acting categories (it won 3 of them).

[http://en.wikipedia.org/wiki/Network_(film)](http://en.wikipedia.org/wiki/Network_\(film\))

<comment><USER15> It's fucking free trade. Done even only semi-competently it brings about wealth, freedom and peace. It's quite harmless, actually.

<comment><USER16> How has the average American worker done since NAFTA was passed? There used to be a time when an autoworker could support a wife and two kids on a single income.

Free trade is great when it's fair. What we have today is free movement of capital, semi-free movement of goods, and non-free movement of people. Not the best combination.

<comment><USER17> Well, we don't have free movement of capital, as any American citizen who has recently tried to open or maintain a foreign bank account can tell you. My US- based commercial bank account no longer even supports outgoing wires. So whatever's going on doesn't involve increasing economic freedom across borders.

 _How has the average American worker done since NAFTA was passed?_

No complaints here. But NAFTA was ratified a long time ago. TPP is not NAFTA.

</comment></comment></comment></comment><comment><USER18> One of the most worrying trends of the last century has been the President abusing his treaty powers to end-run around the democratic process domestically. It's a surrendering of our sovereignty to internationalist interests.

<comment><USER19> How so? Treaties only take effect once they've been ratified by Congress. How are treaties less democratically legitimate than any other legislative act of Congress?

<comment><USER18> The major difference is that treaties aren't subject to the Presentment Clause. Ordinary legislative acts originate in one of the houses of Congress and must be approved by both houses before being presented to the President. Some congressman or senator is on the hook for having written and sponsored that bill. International treaties are given to the Senate on a take it or leave it basis, and do not require any approval from the most democratic chamber of Congress: the House.

Treaties are undemocratic by design. The framers worried that a democratic republic would not be able to present a unified front internationally. But the purpose of treaties was to govern international relations, not submarine domestic legislation under the guise of international relations.

<comment><USER20> >>The major difference is that treaties aren't subject to the Presentment Clause.

Most treaties are CEA agreements that are subject to the presentment clause.

>>International treaties are given to the Senate on a take it or leave it basis,

Regular Treaties can certainly be amended by the senate that then makes ratification conditional.

>>and do not require any approval from the most democratic chamber of Congress: the House.

Hence the two thirds voting requirement for an international agreement that governs foreign relations.

</comment></comment></comment></comment><comment><USER21> It's secretive because politicians can't have discussions and make deals if everything they say is picked over by their constituents and enemies. While they may end up at a trade deal that people want, they won't necessarily like how it ends up there.

For example, there may be a version 0.5 of the document where New Zealand must give up their single-buyer drug plan (Pharmac). This is, I believe, FATAL to the treaty in New Zealand. However, the US demands that it is there. They've got several drug companies who are able to see the agreement and they want it in. It will be gone by 1.0, but to do that some horse trading needs to happen.

So, everyone throws their wish list into the pot and then they negotiate to see what is on a requires list.

Now imagine what would happen if all that happened in front of the voters. Imagine if the first thing that you heard about the agreement was that Pharmac (the drug buyer) was going to be made illegal, and your drug costs were going to go up by a factor of 10.

Yeah, it'd be dead right out of the gate. New Zealand definitely doesn't want that, they want to ship food (milk solids) to the US. The US doesn't want that either... China has a free trade agreement with NZ, and since signing has become NZ's second largest export market, bigger than the US by 50%.

<comment><USER18> The basic premise of this sort of argument is that "the people don't like free trade, we couldn't have free trade if the people had input into the process." Well we shouldn't have free trade if the people don't want it.

Democracy >> economic theories.

<comment><USER22> It's not that people don't like free trade, it's that everyone wants something different out of trade, and so there needs to be some process for working out a compromise.

Every multiparty negotiation starts this way. Corporate mergers are negotiated by management and then jointly presented to stockholders. Union contracts are negotiated by union and business leaders and then presented to union members for ratification. Domestic legislation is heavily negotiated by staff before it is introduced as a bill in Congress. Etc.

</comment></comment></comment><comment><USER23> Is it common to have keep the contents of a trade agreement under wraps until it ships? I can't understand why anyone would want to hide the deal. If it's going to get that much backlash before it's signed, wouldn't there be similar amounts of angry response after it was inked?

<comment><USER22> Yes, it is the way trade deals are negotiated almost all the time.

The TPP would not "ship" until Congress passes it; the text would be public, and most likely amendable, at that point.

The Korea FTA, for example, was negotiated in private at first, but then spent more than 3 years working its way through Congress.

<comment><USER24> Except there's effort by the Obama administration to do this "fast track", which means Congress gets it as a "take-it-or-leave-it" deal, without the possibility to amend anything.

And you can mostly rely on republicans to NOT obstruct the process, because it serves their donors well to pass this ASAP.

(Not being partisan here - I think all congresscritters are equally bad here, it's just that right now it's the dems turn to hold the "make this into law" stamp)

<comment><USER7> Alas, it does increasingly seem that the biggest difference between the two parties is which corporations they favor. Neither gives a rip about the 99% of the non-billionaire population. One side occasionally gives a nod to the fact that even the rich need non-toxic air and water, but that's about as far as it goes.

</comment></comment></comment></comment><comment><USER25> There are thirteen other multilateral free trade agreements like the TPP. And twenty-four others that have been proposed.

The word "integration" seems rarely used in the US. These agreements represent the 2nd stage of a seven stage process known as economic integration. The seventh stage is 'Complete Economic Integration', some type of federalized supranational political union; the EU2050.

North American integration is promoted in order for the US to be economically competitive with the EU, China etc. Whether or not these are the right policies, I don't know. More interesting is that globalization seems solely defined by them without any alternatives.

[http://en.wikipedia.org/wiki/Economic_integration#Stages](http://en.wikipedia.org/wiki/Economic_integration#Stages)

<comment><USER7> My God, that's creepy.

 _If_ and when economical space travel (i.e. - portable fusion) is ever developed, I can only imagine the brain drain that will commence to get the Hell out of this New World Odor.

Otherwise, I guess I for one should welcome our (not so) new Multinational Corporate Overlords.

</comment></comment><comment><USER26> I wonder how the EFF and many readers here would feel about the secret convention that created the Constitution of the United States. There were arguably good reasons for having it done in such a manner.

<comment><USER6> Did anyone endorse the Constitution before they read it?

<comment><USER27> Yes, but not the people for whom its used as a justification of law. Nobody alive today has consented to the constitution if you simply use the same standard of consent as used in common contract law.

</comment></comment></comment><comment><USER28> This isn't an endorsement, if anything it's just positive coverage of this agreement. Take your EFF fear-mongering back to when this was posted yesterday.

<comment><USER29> > it's just positive coverage of this agreement

As the article mentions, it's very likely that New York Times hasn't seen the agreement. Otherwise they could just leak it to the public. So _what_ do they endorse?

<comment><USER22> The concept of a trade agreement with these nations.

However one might feel about IP enforcement, reducing tariffs and aligning similar but slightly different regulations can help economic growth in all the nations.</comment></comment></comment>


Usenet, updated in real time as it was thirty years ago - <AUTHOR> http://olduse.net/ <comment><USER2> The nostalgia that this makes me feel is unbelievable. Some things about old Usenet are probably lost forever:

1\. The feeling that "this matters". Usenet wasn't just one discussion forum among millions, it was The One. 2\. The life of the mind - the all-text nature of the old Usenet was somehow incredibly conductive to treating people as pure intellects. "On Usenet, it doesn't matter if you're a dog." Somehow even forums like HN don't capture that feeling today.

Also, a decent newsreader is still ahead of all modern browser-based software by a mile when it comes to following many discussion threads. For me, nothing today compares with trn.

Yeah, I know Usenet is still out there, and I can even be found there sometimes, but it's not the same feeling anymore, not of intellectual wonder and horizons and of being a pioneer. Probably, that's hard to explain to the youngsters who weren't there - wow, the internet has produced its crop of old- timers.

<comment><USER3> > Also, a decent newsreader is still ahead of all modern browser-based > software by a mile when it comes to following many discussion threads. For > me, nothing today compares with trn.

You're far from the only one who feels this way. I'm not quite sure why it is, but I think it's because trn's tree is basically drawn "orthogonally" (if I might use that word), with siblings stacked vertically, and children moving off to the right.

A "normal" newsreader uses the standard indented list, which gives the whole thread a "meandering set of diagonals" shape, and has a less strong visual connection between siblings (which is an important connection, because they're all replying to the same parent.)

So I was just looking for a screenshot of trn for people who didn't know what it looked like, and I found this blog entry talking about exactly this (with screenshot):

<http://cafbit.com/entry/the_lost_art_of_threaded>

<comment><USER2> Yeah, but it's by no means just that. I was thinking of the simplest things, like messages you've read not showing up again (unless asked for), using a single key to advance to the next message, pressing a key to mark a thread read. The advanced threading and killfile features were great, of course, but the web interface is just so fantastically less convenient for basic stuff - it's unbelievable.

Imagine going to the HN front page, clicking on all the threads you're not going to follow and marking them read or killed (meaning they don't show up again), and then clicking on the threads you want brings you to the last UNREAD messages in those threads. And you press space to go the next unread message. Imagine all forums being like that.

Give me that, and I don't care if you give me a vertical or a horizontal tree display (tho' I prefer the trn way). It seems so simple that I almost can't believe I'm not missing something subtle.

<comment><USER4> The simple things that you're describing are all in gmail.

<comment><USER2> Have to disagree, even though I'm a big gmail user and I do like it way better than the other webmail systems. A thread in gmail looks more like a pile than a real thread - it's nowhere near as smooth as navigating in a newsreader. It presents newer messages on top, and I sometimes find myself confused when I can't tell if certain text is new or quoted in an old message.

And there is no "kill thread" - you can set up a filter, but that's a longish operation and I don't think it lets you say "I don't want to follow this particular discussion" as opposed to "filter out this subject/author".

It all comes down to gmail being a mail system, not a forum system. And goog's forum system, groups, is pretty sad.

<comment><USER4> You should really read through <http://mail.google.com/support/bin/answer.py?answer=6594> to find out what gmail does that you don't know it does. For instance the "kill thread" functionality that you don't think exists is called mute and is available by pressing _m_.

I stand by my previous comment. Every piece of basic functionality that was requested is actually present in gmail. The aesthetics are not the same, and some things require hitting two keys (for instance _y_ then _o_ to archive the current message and move to the next - keeping the current one from showing up again unless you look for it). But the basic functionality is all there.

<comment><USER5> Is there a way to get gmail to highlight posts on mailing lists that are replies to one of your own messages to the list? That's one of the main features of newsreaders I miss (HN's threads?id= view is kind of a clunky approximation).

<comment><USER4> Not reliably, but here is the best substitute that I am aware of.

Click on the icon at the top left, select Email Settings.

Search for _Personal level indicators_ and turn them on.

Save changes.

You'll now have indicators of which emails were sent to you personally, and a stronger indicator of emails sent only to you. When people respond to you they tend to reply to you, so it tends to work out reasonably well.

<comment><USER5> That's pretty useful, thanks! It seems like they ought to be able to directly mark messages which are reply to one of my messages via message-ids, but this does catch the majority of them.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER6> What's sad is that there is no serious replacement for usenet in the internet of today. Usenet was a place where top talents of the world used to talk together with amateurs on the more disparate topics. Back then the internet was for an elite, and that sucked as universal access to the net is really important, but at the same time it is sad to see most of the internet reflecting the fact that today it is a "mass" thing.

<comment><USER7> > _Usenet was a place where top talents of the world used to talk together > with amateurs on the more disparate topics._

Twitter has adopted some of these functions: it allows anyone to hold open conversations on any topic (albeit limited to 140 characters); enough (important) people are on Twitter and use it with enough frequency to make this possible.

<comment><USER8> When I hear Twitter being compared to the golden age of Usenet, I reach for my pistol.

Nothing of real substance fits into 140 characters. Which is unfortunate, really, since Twitter is so popular these days.

<comment><USER9> 100% agree, but ironically the most read single post on olduse.net so far actually fits in a tweet: <http://identi.ca/notice/75500867>

</comment></comment></comment></comment><comment><USER9> Here's my announcement post, which is, I hope, worth reading for some context of what's going on in 1981 "now":

<http://kitenet.net/~joey/blog/entry/announcing_olduse.net/>

Also, if you see a blank box where the newsreader should be, yeah, inviting the whole web in to run tin on my server is not a completely scalable thing. nntp.olduse.net is where it's at.

<comment><USER10> joeyh's git repo for this neat hack:

<http://git.kitenet.net/?p=oldusenet.git;a=summary>

</comment></comment><comment><USER9> This was just posted in the "hacknews" newsgroup. Its resemblance to my day is uncanny.

      Message-ID: <email@example.com>
      Newsgroups: hacknews
      Path: utzoo!henry
      Date: Fri Jun  5 15:44:20 1981
      Subject: morning crash
      From: henry
      X-OldUsenet-Modified: added From; converted from A-news;   fixed Message-ID; added
      Xref: dummy dummy:1

      Crash this morning, a mass of multiple panics suggesting
      some sort of catasstrophic failure.  Hardware glitch?
      Reboot and rebuild (by Laura) succeeded with no problems.

</comment><comment><USER11> Updated in real time? So I have at least ten years before my embarassing newbie posts arrive.

I want a fork of this that allows me to reply to me. ;)

</comment><comment><USER12> This is before the Great Renaming, I don't even know the structure...

</comment><comment><USER13> Wow...this is seriously cool. I like how the old threads are preserved in the newsreader interface. There is also something about having the clock advance in "realtime" that makes it more fun to run that just skimming through the old archive.

Nice work Joey.</comment>


Blast from the Past: Run Unix V7 in a VM - <AUTHOR> http://www.nordier.com/v7x86/index.html

<comment><USER2> I have DOS 6.22 running in a VM just so that I can play Ultima IV. =)

It took a bit of work but I was pretty amazed that it just kind of worked.

<comment><USER3> How about dosbox for that kind of job ?

<comment><USER4> dosbox is awesome; from time to time, I play a game of Master of Orion and still have so much fun. Being able to play it on my ubuntu box and android tablet is cool... ok, it's cool to me.

Back to topic: I wouldn't mind playing around with that old UNIX vm image, though I better wait until I'm home.

</comment></comment></comment><comment><AUTHOR> I'm actually curios if anyone can decode the secretmail in the VM image! I'm slammed right now no time to play but for those who might want to try the command was xget and the secretmail files are in: /usr/spool/secretmail

I quickly tried xget and "password" but got a core dump.

</comment><comment><AUTHOR> Ran across this by accident. I remember working on PDP-11 many moons ago, is fun to see it booted in a little window on my machine.. Utilizing all of 32Mb of memory and 1 core and tiny amount of disk. Amazing how far we've come in such a short time.

<comment><USER5> Ha! It was great running the Unix 7 machine. Not sure what practical value it will turn out to be, but it sure gave me a little thrill. :)

</comment></comment><comment><USER6> "Most of the source code is under a Berkeley-style license."

Oh the irony of that :-)

</comment><comment><USER5> Thanks for sharing. Adding another piece of history in my VM collection.

<comment><USER7> I'm interested in what else you have in a historic VM collection, I quite like the idea of opening up my VM manager and seeing a list of historic systems?

Can you elaborate a little?

<comment><USER8> I have BeOS running on VirtualPC but I would love to have Nextstep on a VM. In some ways, I like it more than Mac OS X.

<comment><USER9> There's a torrent out there of a fully patched OpenStep 4.2 ready to run in a VM.

<comment><USER8> Thanks for the head's up. I'll look for it.

<comment><USER5> There are torrents for NeXTstep 3.3 as well. I'm downloading it right now, let's see how they work. :)

Any more suggestions for VMs of other classic systems worth pursuing (and available for download)?

</comment></comment></comment></comment></comment></comment><comment><USER10> The good old days!</comment>


Addictive slideshow for events (beards included) - <AUTHOR> https://instashow.tv

<comment><USER2> Wonderful idea

</comment><comment><USER3> Great work!</comment>


Selected articles from the Viva64 website for C/C++ programmers - <AUTHOR> http://www.gamasutra.com/blogs/AndreyKarpov/20120921/178053/Selected_articles_from_the_Viva64_website_for_CC_programmers.php

<comment><AUTHOR> I've decided to pick out some materials that programmers may like most. I'm asking those of you who have already read them – please don't tell the rest about it and don't give negative marks. I want you to understand that the audience is changing quite rapidly. One year later, in a certain group of people, there will be one person familiar with an article against 5 persons unfamiliar with it. Thanks.</comment>


China Conducted Nuclear Blasts in Tibet to Divert Brahmaputra River - <AUTHOR> http://tibet.net/2013/08/29/china-conducted-nuclear-blasts-in-tibet-to-divert-brahmaputra-river-report/ <comment><USER2> Fuck China. What the hell do they want? They already have all the resources, a very big landmass, world largest workforce and what not...

</comment><comment><USER3> China and India are not exactly best friends and water wars are one of the reasons. So while China might have done them (they've done worse things,) I'd take these reports with a grain of salt. US agencies, if I'm not mistaken, can detect these and we probably would have heard from some US newspaper.

<comment><USER4> You have missed few important parts:

1) It (supposedly) happened in March 2005, when world's (and US agencies') eyes were on Iraq war.

2) "<...> US authorities admitted to their Indian counterparts the complete failure of their satellites to detect the blasts"

Which is quite believable if nuclear blasts were low-yield as stated in the article.</comment></comment>


Day of the Triffords: A live coding performance in Scheme with Impromptu - <AUTHOR> http://vimeo.com/2735394

<comment><AUTHOR> It starts with quiet howls and hums, but gradually gathers in strength into layers of heavy industrial beats.

The whole piece is coded right in front of your eyes, in Scheme. The code controls various synth and samplers (no real time audio synthesis here). The first 1min45 is silent, because the piece is coded from scratch.</comment>


Ethereum, a virtual currency, enables transactions that rival Bitcoins - <AUTHOR> http://www.nytimes.com/2016/03/28/business/dealbook/ethereum-a-virtual-currency-enables-transactions-that-rival-bitcoins.html <comment><AUTHOR> (cross-post from another HN discussion) The way i think about Ethereum is that it's a cloud computing platform upon which the whole world can see which program the server is running. The usefulness of this is that if you want to run a computing service that administers something of great value to others (such as a vote-counting service or a property registry), other people might be suspicious that you will use your administrative access to the server to corrupt the system. With Ethereum, the service provider doesn't have any admin access (and neither do the people upon whose hardware the program is ultimately running on); the cloud computer just runs the program you upload, and everyone can see what program that is.

In addition, it runs your service robustly, and preserves the entire history of the computation forever. The downside is that these transparency and robustness features make the service a lot more expensive than ordinary cloud computing, as well as more difficult to program on.

It doesn't really have much to do with Bitcoin or currency (except that (a) like Bitcoin, Ethereum uses blockchain technology to achieve these things; but that's an implementation detail (b) a Bitcoin clone is one of the many things you could build as an Ethereum application (c) for technical reasons you buy Ethereum server time via purchasing server-time-credits called "Ether").

As a project, Ethereum is very technically ambitious (they are not just working on a cloud computing platform, but also trying to advance blockchain technology in general, eg developing a new proof-of-stake algorithm, and eg developing a way to not have to replicate computations on every node on the network). They are trying to do a lot of new things at once, which is risky (but awesome).</comment>


The Art and Science of Great Code - <AUTHOR> http://queue.acm.org/detail.cfm?id=2063168 <comment><USER2> What separates good code from great is emphatically _not_ style. It's the fundamental architecture. The omniscient vision to create a program that is somehow much more maintainable, much less likely to have bugs, or much more extensible than dozens of other potential solutions that any competent programmer would agree are "good". Great code can come from a combination of repeated iteration and deep thought, or it can be serendipitous, only emerging as great through the test of time. It's not only great programmers that write great code, and being a great programmer is no guarantee of producing great code consistently. It arises at an ideal intersection of mathematics, cognition, and utility. I hope to write some, someday.

<comment><USER3> Yeah, when I was a less experienced programmer, I spent a lot of time formatting code. I made everything ultra-nice looking.

But you can only get 10% more readability this way. Any style is readable as long as it is consistent. You get used to reading non-aligned code, and the advantage of faster editing/diffs makes it better IMO to stop aligning it (I used to do that).

The real difference comes when you learn to break down your problems correctly, and control dependencies. Another way of saying this is to make the program structure matches the problem, rather than manually compiling lots of irrelevant details.

Part of the benefit is that you literally will have fewer lines to read. There will be fewer lines of code, and you will have to read and understand a smaller portion of the code to make a given change.

Code formatting is just a small part of maintainability. I agree this article seems "small".

</comment></comment><comment><USER4> Failure to use proper spelling in code is a cultural disease. Misspellings in English are looked down upon so why do we put up with it in code? Well I don't.

The authors code examples go back and forth between spelled correctly and not spelled correctly so I'm not quite sure what hes advocating. Figure 13 is especially hilarious.

pload: I have no idea what 'p' is

qload: I have no idea what 'q' is

numBuses: should have been busCount probably

numTransLines: what is 'trans' ?

systemName: ah a good one!

gens: should have been generators but even in that case its basically useless. I already know its a vector of Generators, what is its higher level function?

transLines and buses: same as 'gens', just a name of the type.

<comment><USER5> I couldn't agree more.

Take any book you haven't read that is openly available online. Remove all vowels in worlds longer than 4 characters. Replace commonly used words (like 'the') with your favorite abbreviation (like 'T'). Truncate extra long words (9+ characters). Then try to read it. Horrible, isn't it?

Reading abbreviated (or worse, one-letter) variable names is like translating from a made-up language.

<comment><USER6> As a Teaching Assistant for a first year computer science course, I have actually been using the example of writing an essay and keeping within a page limit by randomly cutting vowels out of words and thinking up ways to abbreviate words which aren't meant to be abbreviated.

Everyone quickly agrees that it would be ludicrous to do that. By stressing over and over, "try to write code which anyone could understand at a glance", I think they're getting it. Glad to see some like-minded thoughts!

</comment></comment></comment><comment><USER7> A standard argument against aligning multiple similar lines of declarations as a table is that you constantly need to re-align when you add/remove declarations. One implication is that source diffs become larger than necessary as they will now include lines that haven't actually changed content-wise, only layout-wise.

<comment><USER8> In emacs, one can take out the drudgery of manually aligning and realigning your variables in tabular fashion using the align commands[1].

In certain revision control systems, one doesn't keep differences, but whole objects, so the point is moot there unless you have some serious bandwidth concerns.

[1] <http://www.emacswiki.org/emacs/AlignCommands>

<comment><USER9> It's not only about bandwidth concerns, it's more about making commit diffs readable. If you have ten lines of tabular assignments and you changed the sixth, but that made you realign everything, then you'll see 10 green lines + 10 pink lines in your commit diff, even though you should only see two lines in total.

<comment><USER7> Unless you have the option to blend out whitespace-only changes, e.g. <https://github.com/blog/967-github-secrets>

</comment></comment></comment></comment><comment><USER10> Forgive my bluntness, but why is ACM publishing a couple of academics' personal choice of lightweight coding standard, and why are so many Hackers upvoting it? Is there some hidden depth here that I'm missing, or some underlying research that shows these preferences are objectively better than some of the alternatives?

<comment><USER11> ACM Queue is not an academic journal. It's the ACM's venue for publishing opinion pieces by both scientists and people from industry.

</comment></comment><comment><USER12> This reminds me of a blog post I read several years ago where the author connected the concision of code to the experience the author of the code had. More experienced coders needed less comments and could read higher-density code with less mental effort.

Wish I could find that blog post again, I've thought of it from time to time over the years.

edit: speeling.

edit2: Yegge strikes again. Wow. Amazingly influential guy for me.

<comment><USER13> This is interesting, and not something I'd consciously thought about before, but quite often I will go back after I've finished something and add some white space and (sometimes quite thorough) comments to the code I've written. I especially do this with open source code that I plan to release.

My reason for doing this is that I want to make it clear to whoever ends up maintaining the code after I've left the project. I have no idea what their skill level might be and getting up to speed on someone else's code can be tedious. Apparently this also makes me look like a less-skilled developer?

<comment><USER14> I've spent quite a bit of time working on systems that became untenable and had to be partially re-written or completely re-written. The result is the original code was either a baseline or a reference. I will say, without a doubt, comments are a code smell. Any comments.

If you write a piece of code and think you need to comment it because it won't be clear for the next guy. It is good at best.

Furthermore, comments rarely help. They are written while you are in complete comprehension of the program or that part of it. The next person (assuming the comment is something they are using to figure it out) won't be.

That said, if you can do nothing to improve the quality because of time, lack of interest or necessary complexity. At least, make your best effort to comment what it does. Appreciating the fact that this is a minimal quality improvement action. Sometimes it is just a piece of code that has to be optimized, explain why so the next guy doesn't refactor/re-write it.

<comment><USER13> Thanks very much for the perspective.

Personally, I think (and judging from the reactions of the people I work with, they seem to agree) that my code is solid; efficient, well organized, logical, descriptive, but not too verbose, etc.

Your comment has made me go back and re-evaluate some things, though, and look over some of those comments - and it was at that point that I realized that a lot of them are superfluous and serve no real purpose other than to restate what's already clear in the code. Others in the particular code I was looking at were about things like UI customization and how one might extend the existing code in order to do that, which more correctly belongs in the documentation (and would have wound up there eventually).

Again, most of this had been in open source PHP/Ruby/JavaScript code, where I'd assumed that the average tinkerer wouldn't be as well-versed in the language, but now that I think about it, if they're not, they need to learn before tinkering, rather than me trying to "dumb it down" to their level, which probably just invites disaster on multiple fronts.

So in my attempts to make things tidy and easy for the next person to come along, I was instead just injecting garbage that didn't need to be there.

Which kind of sucks to realize, but on the other hand, I suppose it's better than realizing you've been commenting the hell out of everything because the code actually _doesn't_ make sense without the comments.

<comment><USER14> I am glad the comment (heh) helped you in some way.

</comment></comment></comment></comment></comment><comment><USER15> Is it just me, or does this read like pages randomly plucked from _Code Complete_?

Not that that's a bad thing. But I'd expect better from the ACM.

<comment><USER16> What's wrong with _Code Complete_? You might pick a couple of nits, but these things have to be explained somewhere, and Steve McConnell does a good job there.

<comment><USER15> I was criticism the article, not _Code Complete_. I love that book, I still have my first edition.

</comment></comment></comment><comment><USER17> With regards to figure 1 I'd argue that avoiding duplication is far more important than alignment. When I first looked at figure 1 I paused to see if duplicating the case was what was meant or whether each line should match lower case and upper case. To me that signifies less readable code since I've had to re-read it to try to understand it.

</comment><comment><USER18> It amuses me it goes straight from making the point that tabular layouts are clear to a rather confusing table in Figure 4 where what should be a header looks like normal text.

</comment><comment><USER19> Bravo! Brilliant satire. _I hope_

</comment><comment><USER20> Maybe the key to writing great code is to not use Java.</comment>


Luxury toilet users warned of hardware flaw - <AUTHOR> http://www.bbc.co.uk/news/technology-23575249 <comment><USER2> People have been shitting on toilets for years.

Now that they're getting smarter, we should not be surprised that toilets are now fighting back.

</comment><comment><USER3> This is a toilet of a story! In order to effect the "hack" you'd need to be close enough to flush it by hand! Yikes, my toilet at home is susceptible to attack by the same method.

I think if you have an hacker in your bathroom, you have bigger problems.

Flip side: will this spurn a new army of "sanitary hackers" who break into unhygienic bathrooms and flush toilets that the owners have neglected to attend to? Brown-hat hackers?!

<comment><USER4> I think it is a slightly larger risk than that because a joker could plant say an arduino with a bluetooth shield, or an old throwaway android phone somewhere and script a program of actions, or maybe use a bluetooth antena (do those exist?)

Also, is this a specifically short range bluetooth? Because my old junky bluetooth headset still gets enough range to reach my phone in my room from the bathroom nearby.

I agree with you that the short range makes the threat much smaller, but it doesn't completely eliminate it.

</comment></comment><comment><USER5> Previously posted, 28 comments:

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

</comment><comment><USER6> I will be awarding life points to the first person who hacks one of these today!

</comment><comment><USER7> just put a stupid button to initiate Bluetooth pairing, like any other Bluetooth device on earth</comment>


Jill Tarter: Why the search for alien intelligence matters (TED Prize winner) - <AUTHOR> http://www.ted.com/index.php/talks/jill_tarter_s_call_to_join_the_seti_search.html

<comment><USER2> wow... I love the "here... here... here..." part</comment>


What's in a gTLD? - <AUTHOR> http://www.economist.com/blogs/babbage/2012/01/internet-domain-names

<comment><USER2> I'd like to hear more about the trademark and geographic protections.

Trademarks in which country / how do they plan to cope with conflicting trademarks?

Geographic protections, .norfolk - does that refer to the county in the UK or to one of the places in the US, or else where?

<comment><USER3> The geographic protections are mainly at the top level, i.e. you can't apply for a new gTLD of .unitedkingdom for example. The geographic restrictions are mainly in three parts, you can't apply for 2 ASCII character gTLDs (this in effect protects any potential new countries that come into existence). You can't apply for a gTLD that is either the proper full name or short form name of a country or anything that is confusingly similar, i.e. no .unitedstates. And finally if you want to apply for a name that is a city or region name you need at least a letter of non objection from the constituent governments.

Trademark protections come in three parts. At the top level a trademark holder can object to you applying for a TLD that is an exact match for a trademark they hold in any jurisdiction. There are provision for trademark front running as well here. At the second level registries are required to provide protection for trademark holders both at registry start up (sunrise and landrush) as well as for ongoing operations. The protections during sunrise and landrush are stronger than during ongoing operations.

During sunrise and landrush registries are required to restrict registrations that are an exact match to marks in the trademark clearing house. They are also required to implement the Uniform Rapid Suspension (URS) during sunrise and landrush and the first 60 days of general availability. There is also a requirement for the UDRP for ongoing operations but this is almost exactly the same for other existing gTLDs (ccTLDs are a different matter).

Obviously there are corner cases to the above and there are a large number of details involved. If you want more information a good starting point is the Applicant Guidebook which you can get from this link:

<http://newgtlds.icann.org/en/applicants/agb>

EDIT: added information about UDRP.

</comment></comment><comment><USER4> _Right now you can guess that a company's web address is probably companyname.com, but .companyname alone can't be a web address._

Not true, and you can see it yourself:

<http://ac/>

<http://ai/>

<http://tm/>

Nothing technically _prevents_ a TLD from having an A record, it's just uncommon. So there could very well be <http://microsoft/> or <http://apple/>, which would appear as "microsoft" and "apple" in FF and Chrome, at least.

<comment><USER5> Are you sure about that? ac, ai and tm do not resolve:

      nslookup tm
      Non-existent domain

Browsers are able to reach them by forwarding to ac.com, ai.com or tm.com

<comment><USER6> It does have an A record:

      % dig a tm

      ; <<>> DiG 9.7.3 <<>> a tm.
      ;; global options: +cmd
      ;; Got answer:
      ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41011
      ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

      ;; QUESTION SECTION:
      ;tm.				IN	A

      ;; ANSWER SECTION:
      tm.			86366	IN	A	184.108.40.206

      ;; Query time: 1 msec
      ;; SERVER: 192.168.66.32#53(192.168.66.32)
      ;; WHEN: Thu Jan 12 10:20:15 2012
      ;; MSG SIZE  rcvd: 36

And also an open http server:

      % nmap tm.
      Starting Nmap 5.00 ( http://nmap.org ) at 2012-01-12 10:24 BRST
      Interesting ports on serv213.icb.co.uk (220.127.116.11):
      Not shown: 997 filtered ports
      PORT    STATE  SERVICE
      80/tcp  open   http
      113/tcp closed auth
      443/tcp open   https</comment></comment></comment>


ScienceBeam – using computer vision to extract PDF data - <AUTHOR> https://elifesciences.org/labs/5b56aff6/sciencebeam-using-computer-vision-to-extract-pdf-data <comment><USER2> PDF is a pretty interesting format. The spec is actually a great read. It's amazing how many features they've needed to add over the years to support everyone's use cases.

It's a display format that doesn't have a whole lot of semantic meaning for the most part. Often every character is individually placed so even extracting words is a pain. It's insane that OCR (which it sounds like this uses) is the easiest way to deal with extraction.

I highly recommend having a look inside a couple of pdfs to see how they look. I've posted about this before but the trick is to expand the streams.

        mutool clean -d in.pdf out.pdf

<comment><USER3> Each character needs to be individually placed for the best possible typesetting (e.g with microtype).

Nevertheless, copying text from a PDF works in many cases, so there has to be some support for that, no? Or is everything done in the reader?

<comment><USER2> Text is a funny thing in PDF.

Sometimes, there's real text broken into lines and then you're pretty good. Often it's a subset font where the codes used in the script don't correspond to their visual glyphs. When that happens there might be a unicode map that lets you know which internal char maps to which external char (used for copying text from the PDF by viewers). Sometimes that's missing and you can rebuild it from other encoding information attached to the font. Other times you can't get the relationship and all you're left with is the randomly selected codes for each character — at that point it's not too dissimilar from a simple Enigma machine problem I guess.

I sometimes see documents in which the same font has been subset again and again, once for each word. If you have a unicode map for each one, that's fine, if not it's not going to be much fun. In that case every word is going to look like random characters in the PDF and those character-glyph relationships are going to change from word to word.

Other times the glyphs are rendered as vector paths at write time and you're down to trying to find the character from the outline it the shape. I deal with this a lot and there are common patterns but normally each glyph will be broken into several bits itself, so you have to find which bits go with which glyphs before you even start.

Does anyone have a technical paper to hand, we could crack it open and take a look for fun.

EDIT If you're trying to reliably convert everything, in a way you're better off catering for the lowest common denominator so you can do it consistently. Here, that means assuming you don't have any raw text data to work with and you have to do everything with image recognition. Either way, it's a fun problem.

</comment></comment></comment><comment><USER4> Some time ago I came to a similar conclusion: In most cases, the only way to properly process PDF files is to render them and work on the raster images.

I was involved in a project where we needed to determine the final size of an image in a PDF document.

This seemed simple: Just keep track of all transformation matrices applied to the image, then calculate the final size.

But we underestimated the nonsense complexity of PDF: The image could be a real image or an embedded EPS, which are completely different cases. The image could have inner transparency, but could can also have an outer alpha mask by the PDF document. Then there are clipping paths, but be aware of the always implicitly present clipping path that is the page boundary. Oh, and an image may be overlapped by text, or even another image, in which case you need to to the same processing for that one, too. And so on.

After wasting lots of time almost rebuilding a PDF renderer accidentally, we decided to use an existing renderer instead.

Turned out the only feasible solution was to render the PDF twice: with and without the image, and to compare the results pixel by pixel.

I'm afraid the modern web might develop in a similar direction.

</comment><comment><USER5> This looks really cool and is badly needed. Our company would kill for a PDF to semantic HTML algorithm (or service) too, using machine learning based on computer vision. Existing options just vomit enough CSS to match the PDF output, rather than mark up into headings, tables and the like.

</comment><comment><USER6> Good stuff.

What I think would be a really nice killer app would be using OCR to extract formulas directly into Matlab code. Would be awesome for reproducibility studies or just people trying to implement algorithms for whatever reason.

Anyone know if there's an app for that already?

<comment><USER7> How about PDF to Latex? Matlab allows Latex strings.

[https://www.mathworks.com/help/matlab/creating_plots/text- wi...](https://www.mathworks.com/help/matlab/creating_plots/text-with- mathematical-expressions-using-latex.html)

<comment><USER8> At that point, why work with the pdf at all? Why not just work with the tex source?

<comment><USER9> The problem is usually not having access to this, just the pdfs.

</comment></comment></comment></comment><comment><USER10> How do you address older PDFs that are scanlations and have no actual textual data at all, just embedded images?

In my experience, this is true for every PDF version of articles originally published before about 1990.

<comment><USER11> This project seems to convert the PDF into an image before doing the semantic annotation, so it would work on scans as well. This doesn't give you the text, but it gets you halfway there. The other half is can be done by passing the discovered regions into an OCR engine to pull out the text.

The one time I needed to turn a scanned PDF (600+ page book) into searchable text, I used this Ruby script [https://github.com/gkovacs/pdfocr/](https://github.com/gkovacs/pdfocr/) , which pulls out individual pages using pdftk, turns them into images to feed into an OCR engine of your choice (Tesseract seems to be the gold standard) and then puts them back together. It can blow up the file size tremendously, but worked well enough for my use case. (I did write a very special purpose PDF compressor to shrink the file back, but that was more for fun.)

</comment></comment><comment><USER12> I havnt had a chance to read through this completely yet, but I'm curious if this method is agnostic to how the PDF was created originally (LATEX, Adobe, scanned images). It reads like that doesnt matter (treating it as an image) but I wanted to make sure.

</comment><comment><USER13> Interesting. You can also try OCR and document layout analysis to do the same thing (without GPUs).

Shameless plug: if you're interested in that sort of stuff, drop me a line, I might be able to help.

</comment><comment><USER14> couldn't you use a pdf converter and convert to html or something else and translate that to your XML format?

<comment><USER15> my experience with pdf is that its a pretty open-ended, and thus pretty difficult, format to work with. There's not a whole lot in the way of "what is this thing supposed to be" semantics encoded into the spec. Even pdf-to-html is kind of a crapshoot.</comment></comment>


In defense of digital freedom - <AUTHOR> http://www.marietjeschaake.eu/2013/05/in-defence-of-digital-freedom/

<comment><USER2> A European Politician with Digital expertise. An interesting read with a grasp of the ongoing issues.

Did I die and goto heaven?

<comment><USER3> That's a common reaction when confronted with the Dutch :)

<comment><USER4> That's such an arrogant thing to say :(

<comment><USER3> Does it seem less arrogant when I tell you I'm not Dutch and I don't live in the Netherlands?

<comment><USER2> Political rhetoric reached peaks with Wikileaks, Stuxnet and now it seems Pentagon subcontractors got hacked by China years ago.

So digital freedom is taking a pounding (while Wilders is being forgotten already). The security industry did not have their own security in order, that's more an internal Pearl Harbour. [http://www.bloomberg.com/news/2013-05-01/china-cyberspies- ou...](http://www.bloomberg.com/news/2013-05-01/china-cyberspies-outwit-u-s- stealing-military-secrets.html)

Disclaimer: I'm Dutch and live there.

</comment></comment></comment></comment></comment><comment><USER5> I never expected to click this link and see a politic party. Much less a Dutch one. Much less the party that I wanted to vote on - last elections I was allowed to vote for the first time - but didn't because my parents both voted something else, and I thought they'd probably know better. In hindsight I think choosing D66 would actually have been smarter...

</comment><comment><USER6> I found this part to be interesting:

" _These companies may well be complicit in grave human rights violations. A criminal case against a French company for exactly this business behaviour is now under consideration of a Paris court and could set an important precedent for others. Can we hold companies and their executives accountable for complicity in human rights violations and creating security threats by knowingly selling digital arms to repressive regimes?_ "

Should/Can we hold weapons manufactures accountable for helping aid nation states/organizations in their conquests or for individuals during crimes?

Somehow this comes off to me as these tools are only ok for some ...hardly digital freedom.

I also like how there is little (or no) discussion on about individuals and the role they should take in ensuring their digital freedom. I guess only nation states and corporations are the enlightend despots who must insure freedom upon us. Sounds kinda doublespeaky to me.

<comment><USER7> I don't know the details of the French case, but there is a valid question here:

If I make some widget, that turns out is used widely, and happens to be used by an oppressive regime, am I helping commit opression?

What about if I make a tool that really only has uses that look like oppression, but some of those cases are not opression and some are (say web filtering - parents can use it to protect their children, and opressive regimes can use it for censorship)?

What if I create machine learning software that finds activists and determines the best time to arrest them?

What if I work with a regime on custom extensions to a medical program that helps find the optimal torture times and methods to break people the fastest?

At some point the use of "your freedom" is just a shield behind which one tries to hide complicity in removing others' freedom.

<comment><USER6> _At some point the use of "your freedom" is just a shield behind which one tries to hide complicity in removing others' freedom._

Unless one happens to find themselves on the side of the people who get to define what is "oppressive regime" and "others freedom".

It's not as clear cut as one may think when you consider the perspectives of other societies and the people in power there (even as individuals who learn how to create their own tools for their own means become more powerful). The whole UN regulation issue makes light of this [[http://blogs.cfr.org/patrick/2012/12/04/un-control-of-the- in...](http://blogs.cfr.org/patrick/2012/12/04/un-control-of-the-internet-an- idea-whose-time-will-never-come/)].</comment></comment></comment>


How To Optimize Your Site With HTTP Caching - <AUTHOR> http://betterexplained.com/articles/how-to-optimize-your-site-with-http-caching/

<comment><USER2> This is a good writeup, though I'm surprised no-one has mentioned the holy grail of caching with HTTP. That of course is good old RFC 2616: <http://www.ietf.org/rfc/rfc2616.txt>

There's an entire section in there devoted _just_ to caching in HTTP. Very well worth reading in its entirety.

<comment><USER3> <http://tools.ietf.org/html/rfc2616> adds errata, RFCs that update it and hyperlinks (it is a web after all)

Direct link to Caching in HTTP <http://tools.ietf.org/html/rfc2616#section-13>

</comment></comment><comment><USER4> This is a great article for an introduction to HTTP caching. It's well-written and even covers how to set up caching in Apache.

<comment><USER5> Thanks for the kind words (I'm the author). My main, ever-evolving goal when writing tutorials is to try to write what I'd like to see:

1) Explain the underlying concept

2) Show variations

3) Explain how to do it yourself

4) Show how to verify you did it correctly

5) Meta: be as concise as possible, maximize bang for the buck

<comment><USER6> I've always enjoyed your writings kalid. I esp liked [http://betterexplained.com/articles/a-visual-intuitive- guide...](http://betterexplained.com/articles/a-visual-intuitive-guide-to- imaginary-numbers/). Thanks so much for your site!

<comment><USER5> Thanks, I appreciate it!

</comment></comment></comment></comment><comment><USER7> Be careful with ETags if you're serving content from a web-farm - <http://developer.yahoo.com/performance/rules.html#etags>

<comment><USER8> In the same spirit, there's a lot to gain and very little to lose if you activate ETags _and_ serve content from just one source.

</comment></comment><comment><USER9> A pretty basic write up. Static caching is standard these days. The article doesn't help with speeding up today's dynamic sites.

</comment><comment><USER10> Article from 2007

<comment><USER5> Yep, I was surprised too to see it on HN :).

I think one of the meta-takeaway is that understanding the fundamentals of web caching can help with your general CS knowledge ("There are only two hard problems in Computer Science: cache invalidation and naming things." -- Phil Karlton).

Looking at Apache, we see a few strategies:

      * Include last-modified metadata
      * Include content metadata (eTag/md5 of content)
      * Include explicit expiration date
      * Include a max-age
      * Include metadata about who can cache (public/private/no-caching, i.e. users can cache but proxies cannot)

These approaches could be used when designing data flows with Memcache, Redis, etc.

<comment><USER11> One thing I don't understand. If the server has asked the client to cache an image for a year, and the image is indeed updated in that time, is there some way of telling the client to download that image anyway?

I'd take it to Google, but I have no idea how I'd ask that in Google query form.

<comment><USER12> This is actually referenced in the article. You can use the Last-Modified date and the server will either return a 304 (Not Modified) or the modified image if it is newer.

<comment><USER11> I read that, but if you say "this image won't change for exactly one year" and the client doesn't even request that resource from the server any more, how do you start that dialogue again?

pork has offered that you add a junk parameter to the end of a GET request and that should disrupt the cache, I'll need to read in to this. I'm interested in optimizing web speed as much as possible and this sort of thing and caching has always been something I've understood poorly.

<comment><USER5> Yep, that's the problem with long expiration dates -- the client may never check again (that's what we wanted, right?). The workaround is to request a new url which restarts the process.

Separately, the easiest way to get started with all these optimizations is to run the page speed check online:

<https://developers.google.com/pagespeed/>

and follow the recommendations, most important to least.

<comment><USER11> I've actually been playing around with this stuff all day, pretty much since my last comment above. I've enabled smarter caching on my website, replaced multiple image requests with a single spritesheet, optimized my images, and cleaned up my CSS file to remove unused code. Google's PageSpeed has been an invaluable tool, as well as webpagetest.org which breaks down the data in an intelligent way.

Turns out Google Analytics is actually doubling my page load time, but the data is too valuable to give up.

Anyway, thanks for the tips.</comment></comment></comment></comment></comment></comment></comment>


Ask HN: Anyone interested in a hack night in the SF Bay Area Peninsula? - <AUTHOR>

Anyone out there interested in getting together once a week or two and working on our own individual projects for 4-6 hours?
I have some side projects I'd like to finish up and this would help with my motivation for them, plus I'd get to meet some people from hacker news and we'd have some people with common interests to bounce ideas off of.
We'd have to meet up somewhere on the Peninsula, near Redwood City/San Mateo area. <comment><USER2> Always up for carving out time to work on side projects. contact info in profile.

<comment><AUTHOR> Cool, sending an email.</comment></comment>


Show HN: Stylebot Social, share custom styles for sites - <AUTHOR>

I did this project to allow people to share their custom designs for websites. In addition, it is integrated with my earlier project, called Stylebot, which was a Google Chrome extension that allows users to customize site designs and save them persistently (http://news.ycombinator.com/item?id=1716889)
You can browse styles contributed by other users and bookmark them for later use. You can install these styles as part of Stylebot or as userscripts.
I will love to get feedback and ideas on its implementation, UI and ease of use. Don't forget to check out the styles for Hacker News!
URL is: http://stylebot.me
Thanks! <comment><USER2> This is probably my favorite WYSIWYG CSS customization tool. It has allowed me to increase the value of websites by 10 fold.

</comment><comment><USER3> Clickable <http://stylebot.me/>

</comment><comment><USER4> Brilliant - I love it. Thanks for sharing!

</comment><comment><USER5> This is great.</comment>