Show HN: Server.js – A modern Express alternative - <AUTHOR> https://serverjs.io/ <comment><USER2> Rather than changing express's syntax, I would much rather have a better express boilerplate generator with an opinionated stack with good documentation/justification.

I recently started learning express/node and wasted weeks googling for blog posts for each dependency to figure out how to configure them. I guess this is somewhat valuable for end-to-end understanding but not for productivity.

There are a bunch dependencies I am now kind of decided on (not for technical reasons, but because they are clear popularity contest winners) and figured out how use:

        body-parser
        compression
        serve-favicon
        express-session
        csurf
        helmet
        cors
        dotenv
        moment
        selfsigned
        chalk
        debug

But still a bunch that I haven't gotten to googling and still need to decide on what to choose:

        logging (morgan vs winston)
        validation (express-validator, joi)
        auth (passport jwt, local, social)
        session storage (redis vs keeping it in database?)
        database (mongo/mongoose vs pg/knex/bookshelf/sequelize, graphql)
        storage (s3 vs gcs)
        ajax requests (request vs axios)
        mail (mailgun, sendgrid, mailchimp)
        error handlers
        rate limiting
        geo ip

I would be so happy if someone took away my power to choose and just forced me to use something that will "just work".

<comment><USER3> Totally a tangent but, don't use moment.js! It inherits some of the parsing and other quirks from the awfulness that is the JS Date object, the mutability almost certainly will lead to being bit by a couple of bugs before you actually internalize it, and the time zone support is kind of tacked on as an afterthought.

I highly recommend js-joda, particularly if you'll ever be computing/showing things to your users in different time zones. It actually treats dates and times rigorously, and has an api that makes it clear what kinds of operations make sense to do on a zoned vs local datetime and makes things like converting between timezones vs transposing them explicit and simple.

<comment><USER4> I've always been of the opinion that timestamps should be stored UTC datetime or unix timestamp on the server side and then displayed to the proper locale by the client's device. Is this not a good method?

<comment><USER5> It is not good enough. All the major browsers that I tried do not properly handle the timezone offset, as I discovered a few days ago (I put a more complete answer about this in a stackoverflow answer, but I don't know if putting the link would count as self-promotion so I will leave it out)

In short, the ES5 specs [1] say that

        The implementation of ECMAScript should not try to determine whether the
        exact time was subject to daylight saving time, but just whether daylight
        saving time would have been in effect if the current daylight saving time
        algorithm had been used at the time. This avoids complications such as
        taking into account the years that the locale observed daylight saving time year round.

This means that if your country handled daylight saving differently in the past, converting the timestamp to string may give you a wrong answer (this would be the case of a number of european countries during WWII).

The spec has been improved starting with ES6 [2], but to my knowledge no browser has fixed the issue:

        An implementation dependent algorithm using best available information on
        time zones to determine the local daylight saving time adjustment
        DaylightSavingTA(t), measured in milliseconds. An implementation of
        ECMAScript is expected to make its best effort to determine the local
        daylight saving time adjustment.

        NOTE It is recommended that implementations use the
        time zone information of the IANA Time Zone Database
        http://www.iana.org/time-zones/.

A solution is to use a JS library that has its own timezone database.

[1] [http://www.ecma- international.org/ecma-262/5.1/#sec-126.96.36.199](http://www.ecma- international.org/ecma-262/5.1/#sec-126.96.36.199) [2] [http://www.ecma- international.org/ecma-262/6.0/#sec-daylight...](http://www.ecma- international.org/ecma-262/6.0/#sec-daylight-saving-time-adjustment)

<comment><USER6> It's good enough (and correct) to store unix timestamps. For displaying the date - your comment applies...

Unix timestamp refers unambiguously to single point in time. Interpretation of this point in time in different timezones is complicated but it's outside of it.

<comment><USER5> I agree that storing unix timestamps is a good approach.

My issue was with "then displayed to the proper locale by the client's device." I mean, by itself it is ok, but in the case of a web client one cannot unfortunately just use the Date object and convert the timestamp to a human readable string.

</comment></comment></comment></comment></comment></comment><comment><AUTHOR> It _is_ built on top of express to keep all of the good things, but it adds basic middleware and some more advanced functionality like websockets through socket.io and security through helmet by default.

It is designed to work perfectly with Promises and async/await, the _new_ ES7 features that makes asynchronous code awesome. Also, I put a lot of work into making the documentation extensive and clear and I'll keep working on that for the future while preparing for the 1.1.

Edit, release notes: [https://medium.com/server-for-node-js/server- js-1-0-released...](https://medium.com/server-for-node-js/server- js-1-0-released-12a419ab187a)

<comment><USER7> Why socket.io instead of just plain websockets? Socket.io adds a lot of complexity in the client and the server. What commensurate benefit does it provide?

[http://caniuse.com/#feat=websockets](http://caniuse.com/#feat=websockets)

<comment><USER8> Socket.io adds rooms/namespaces as a feature, automatically reconnects with effort to not have all clients reconnect at the same time, covers compatibility edgecases, heartbeat, timeouts, custom events, multiple transport methods, server side implementations in multiple languages, supports non-ws fallback for reasons that might not be browser compatibility, and a good API.

</comment></comment></comment><comment><USER9> I'd argue koajs was the first modern express alternative, although it's arguably more of a connect alternative. I've been happily using it since generators were available under a flag with node 0.11 and it has always been a joy. There's a huge list of middleware [0] on their wiki, and you just pull in whatever you need.

It means that your initial setup takes a bit longer, but it forces you to understand all the moving parts.

The session in production tutorial makes no mention of secret rotation, which I'd consider an important detail for a production environment. The docs don't mention the feature either, but if you look at the underlying express-session library you see that the secret can either be a string or an array of strings.

Although redis is an amazing tool, I disagree with recommending it as the first choice for a session store. Unless you really need it or plan on using it for more stuff, you'd probably be better off keeping sessions in whatever data store you're using for the rest of the application. That lets you avoid having to setup and maintain yet another tool.

No documentation at all for how the socket.io stuff is supposed to be configured. Chat tutorial assumes a single-node environment, which I'd consider unreasonable for anything outside of a hackathon. Wouldn't you at the very least want a process per core?

[0] [https://github.com/koajs/koa/wiki](https://github.com/koajs/koa/wiki)

<comment><AUTHOR> I didn't know about that middleware list, thanks for sharing.

About session rotation, it was my impression that it is a smaller problem compared to how it can be exploited if we're using cookies [1][2], could you share some more info about it please?

About Redis, I totally agree. You can add any store that you want with the plain `{ session: { store: ... } }` option. There is an issue though for some of them that need the original `session` passed in which I'll have to fix. So the main fix would really to improve the documentation to explain how to use the appropriate store.

Finally about socket.io, I also agree. I am not a large-scale system expert, so this is part of my limitations and that's why I recommend server.js for small-to-medium sized projects. Long-term I am working on improving on my knowledge here, but not the highest priority right now (compared to security for instance). Also, socket.io right now is not stable officially, so use with care. I'd love any help in here if you want to share some of your expertise.

[1] [https://stackoverflow.com/questions/2846401/does-session- id-...](https://stackoverflow.com/questions/2846401/does-session-id-rotation- enhance-security)

[2] [https://www.owasp.org/index.php/Session_fixation](https://www.owasp.org/index.php/Session_fixation)

<comment><AUTHOR> Note: socket.io is stable; I mean the internal glue for using socket.io with server.js

</comment></comment></comment><comment><USER10> > Note: this option can be ignored and server.js will work with both .pug and > .hbs (Handlebars) file types.

[1] : [https://github.com/franciscop/server/blob/master/package.jso...](https://github.com/franciscop/server/blob/master/package.json)

I think around express 3 the guys decided to go with a modular approach and decouple the server from any of those heavy ( render ) libraries, as well as body-parser ( once it was core module in express itself ).

My really friendly feedback is that I think express carries so much experience that it will be really hard to replace it with something so monolithic. I use express for REST APIs as well as full web app, where I need no render engine and having this installed on my server is an overkill.

Best approach I would think of is having someone rewrite express from scratch and call it express 5, while keeping the same balance of core and extra functionality, as well as new async / promise goodies.

<comment><USER11> Basically what I find Koa does for me: [http://koajs.com](http://koajs.com)

<comment><USER12> I am in the Koa boat as well, does Express have anything that Koa does not? (not trying to start a framework flamewar, honestly!)

<comment><AUTHOR> IMHO, and one of the reasons I decided to go with server, _simplicity_ is a feature and the advantage of express over Koa. It is hard enough for new users to get started on Node.js, but to have to handle all of the new middleware concepts, PLUS to have to learn a lot more advanced features like generators is a no-go for my framework of choice.

\- server: return something to reply to the browser. Can use `async` for more advanced features.

\- express: reply.send() is fairly straightforward. next() for middleware is a new concept but conceptually in the right place (when you are digging a bit deeper in the middleware).

\- Koa: yield, function with asterisk, etc.

So I think Koa is fine for devs who have been a while in JS dev, but the learning curve is too steep to get started. Same as what happens with React and the reason create-react-app has become so popular.

<comment><USER11> Koa has been doing async for a while. It's basically connect with promises instead of callbacks: `app.use(async (ctx, next) => { await next(); });`

<comment><USER13> As long as you're on Node >=v7.9, you can also use `await` in Sails, Koa, or any other tool that supports promises. There's some work we had to do to make it feel nicer, and we had to update docs and stuff, but for the most part it was pretty painless-- all thanks to the JavaScript engine.

And `await` is so much easier and safer than callbacks in userland code! Really excited about Node.js in 2018, now that `await` is supported in the LTS release. Callback hell is finally dead.

(Diff showing a refactor of an example app from traditional callbacks to async/await: [https://github.com/mikermcneil/chatkin/pull/4/files](https://github.com/mikermcneil/chatkin/pull/4/files))

</comment></comment></comment></comment></comment></comment><comment><USER14> This is OK but a hello world app requires 203 modules and that's not really a safe position to start new apps.

[https://github.com/ChALkeR/notes/blob/master/Do-not- underest...](https://github.com/ChALkeR/notes/blob/master/Do-not- underestimate-credentials-leaks.md)

</comment><comment><USER15> Fastify is a similar project that aims to be faster than Express and adds a number of API improvements like baked-in schema validation for routes, logging, and async-by-default APIs.

Haven't used it in production but replaced Express with it in some side projects.

Since server.js is built _on top of_ express it might even be possible to build a variant of it on Fastify instead and get those benefits as well.

[https://www.fastify.io/](https://www.fastify.io/)

</comment><comment><USER16> So it's just another express abstraction rather than an alternative then, considering express is a dependency.

</comment><comment><USER17> This might be somewhat negative, but I don't quite see what problem the library is solving.

It looks like as if Express wanted to become more like Koa (obvious from the context object). Frankly, it has missed out - koa's simplicity and elegance is unmatched. The routing and middleware syntax is particularly clunky.

Documentation seems really nice though.

<comment><AUTHOR> No problem, didn't sound negative. The main difference with Koa would be having a starting point with default middleware, security and websockets. I do agree with your points, Koa is probably the most elegant library out there, probably followed closely only by express.

But that is not why I created server. It is not about library elegance and simplicity, it's all about making it easy to use. Both of Express and Koa involve external middleware that the user has to manage manually, and there is a subset that is really common for most situations. Server.js is all about usage simplicity, including this subset by default and making things work by default.

Context was inspired initially by the way Promises work with a single return value, but then expanded further (and named after) Koa's context.

<comment><USER18> Isn't koa flexible enough for you to build a framework on top of it to accomplish your goals of elegance and simplicity? That way you could take advantage of the ecosystem that already exists, instead of trying to bootstrap your own.

</comment></comment></comment><comment><USER19> Title should say wrapper rather than alternative. Since it's built on top of express.

</comment><comment><USER20> Coming from Python, my understanding is that Express is sort of like flask (add your own everything), and something like sails.js is like Django (bundled, convention over configuration). I am wondering, why, unlike, Python and Rails, Django-type frameworks did not take off in Node.js? I would like to have a popular "Django.js", so I am rooting for this project.

<comment><AUTHOR> My opinion is that Node.js follows a lot more the philosophy of small reusable modules, which is a lot more flexible with the disadvantage of a lot more initial work. I still don't think server.js is Django.js-like, since it leaves most decisions up to the developers. The main difference is that Django, Rails, Sails, etc are opinionated about both the libraries AND the code structure, while I tried to keep server opinionated only about some basic functionality, but leaving the more advanced and code structure totally up to the devs using it.

But I do try to do batteries-included, because express-like workflow involves following a bunch of steps that are basically the same for most projects.

Edit, maybe you are interested on Sails: [https://sailsjs.com/](https://sailsjs.com/)

</comment></comment><comment><USER21> As a side thing... is anyone getting a little wee tired of reading the following magical statement about every framework that comes out? :)

> [insert the latest framework here] that just works so you can focus on your > awesome project

<comment><AUTHOR> Ah I didn't even think about it being a thing, thanks for the feedback. I did make server so I wouldn't have to worry about so many middleware pieces any longer and could work on my actual projects, but I see how this is fairly common wording.

</comment></comment><comment><USER22> If you're just looking for a barebones static file server try this: [https://github.com/zeit/serve](https://github.com/zeit/serve)

</comment><comment><USER23> Imagine googling for stuff about this project... (issues, bugs, tutorials etc) Must be a nightmare, with such a generic name

</comment><comment><USER24> Express is ripe to be replaced. It has the weirdest syntax I've ever seen and is basically designed around call back hell.

I can't wait till somebody rebuilds it in Typescript or at least around async

<comment><USER25> [http://koajs.com/](http://koajs.com/)

In Koa, handlers don't respond to the request. Instead, they update a representation of the response and return a promise. The response bubbles up to the top-level where the `res.send()` is done.

This way you have real middleware. You can post-process the response or do something else entirely after the downstream has run.

        const middleware = async (ctx, next) => {
          console.log('request going down')
          await next()
          console.log('request coming up')
        }

<comment><USER24> Haha this is exactly how I pictured it working! Made by the makers of express too.

</comment></comment></comment><comment><USER26> It's very interesting watching node developers re-implement the PHP ecosystem.

<comment><USER27> it's very interesting watching php composer developers reimplement the npm ecosystem ;)

<comment><USER28> It's very interesting watching both of your comments XD

</comment></comment></comment><comment><USER29> Are there docs or maybe a blog post that identifies the value-add on top of Express? While I see the API design example (which applies to me), we already do that with Express v4 (it's more code organization than anything else.)

I'm super-interested, but I'd like to know at a deeper level what this gets us over plain Express.

</comment><comment><USER30> I think a lot of people still haven't seen [https://feathersjs.com/](https://feathersjs.com/). Has been around for a while and offers all of this and more AND is drop in replacement for Express.

</comment><comment><USER31> Is there any Node.js web-framework/app-server like Express, that uses XML as backend, rather than JSON? Or, that can have this plugged in, at least? I'd like to use BaseX (XML document database) as a backend to something like Express.

</comment><comment><USER32> This pulls in over 200 dependencies, with a total weight of 37MB. I'll pass.

<comment><AUTHOR> Only 37MB? I expected more TBH, I guess I am too used to the dev side of it. 37MB is really cheap compared to the hours that you save by not doing everything manually, even more when you consider the quality of the underlying libraries from a security point of view.

Long-term I would like to reduce this and have some ideas in mind, but right now this is not an issue.

</comment></comment><comment><USER33> Does it support automatic documentation generation for the API (kinda like what swagger + express.js does)? That's the biggest missing feature in Express.js for me.

</comment><comment><USER34> Does passport plug into this?

<comment><USER33> Passport can be quite easily used with any framework, but of course an existing library can make it even easier. Though to be honest Passport.js is trivial enough that I don't see a need for it usually..

</comment></comment><comment><USER35> Surprised at their choice of socketio instead of leveraging http2 streams.

</comment><comment><USER36> no mention of TLS, which is unfortunate

<comment><USER37> Why? TLS/SSL termination is normally (at least on every project I've worked with) handled by the web server.

<comment><AUTHOR> Exactly, it was initially intended to be a core feature but after searching around (and from my experiences) I found out it is rarely done at the language-level.

</comment></comment></comment><comment><USER38> > npm install server

How could the package name "server" be available all these years :D?

<comment><USER39> Asking the real questions! I wonder if deleted package names are made available again. It makes sense that they did, but it's also a security issue, if one package is removed an attacker could add a new package with the same name and with a malicious functionality.

<comment><USER40> In theory, no. Unless you have the magic power like what Laurie Voss have. Remember he saved the world by resurrecting left-pad[1]?

[1] [http://blog.npmjs.org/post/141577284765/kik-left-pad-and- npm](http://blog.npmjs.org/post/141577284765/kik-left-pad-and-npm)</comment></comment></comment>


A Three-Year Journey at .00037 mph - <AUTHOR> http://www.time.com/time/health/article/0,8599,2088306,00.html

<comment><USER2> I remember watching Spirit and Opportunity land on mars, sitting next to my uncle,the day he was diagnosed with lung cancer, and I still remember the prediction that the rovers would die in 3 months due to buildup of dust. I couldn't help but wonder that my uncle was, at least, going to outlive them. I was wrong.

</comment><comment><USER3> "NASA engineers were counting on it to function for just three months" and it is still functioning 8 years later? What an impressive accomplishment.

<comment><USER4> If I recall, they assumed the solar panels would end up fully covered in dust after 3 months, but the wind just keeps clearing them off.

</comment></comment><comment><USER5> .00037 mph = 0.0065 inches/sec = 0.165 mm/sec

</comment><comment><USER6> I don't see Mars-rover races being a spectator sport any time soon. That must require a _lot_ of patience - not sure I care to have that much.

<comment><USER7> The three year average might be low, but the average speed of the Opportunity rover over the past eight years is over 2700 mph.</comment></comment>


Ask HN: Has anyone managed to regain their attention span/ability to focus? - <AUTHOR> My attention span is absolutely terrible. I can spend maybe 30 minutes focused on Deep Work (as coined by Cal Newport).<p>Has anyone managed to regain their attention span to a point where they can engage in deep work for large blocks of time? If so, how did you do it? <comment><USER2> For me personally there are a number of areas that affect my ability to do deep work:

\- General internet/news consumption patterns

\- Availability of social/news apps on my phone + computer

\- Sleeping at least 8.5 hours a night

\- Exercising at least every few days

\- Meditating for a few minutes in the morning

\- Level of burnout eg. have I been overworked or working on unrewarding things for long periods of time

If I do all of these consistently my ability to do deep work increases notably. If I slack in any area it reduces my capacity by some degree. Sleep and burnout are probably the largest contributing factors here. I've found that I just can't cheat on sleep long term without negative consequences, and that if I'm burnt out the only fix is to basically stop working/pushing myself for at least a week until I feel recovered.

I find also that having intention to my day rather than starting out in a reactive mode is key to getting deep work done. If I spend most of my day reacting to things I have trouble doing deep work later in the day, but if I start out with deep work it comes naturally throughout the day.

<comment><USER3> This is sage advice. You have basically boiled down tons of self help material into a single comment. Thanks.

<comment><USER4> Yep, favorited this post solely for this reply. Excellent job

</comment></comment></comment><comment><USER5> I lost the ability to read after a suicide attempt. I was reading Nietzsche before and after I was struggling to read comic books. Maybe it was just shock but I slowly taught myself to read again. Since then I managed to graduate, start my own business, and slowly learn programming.

In my experience, it's just effort. I try to grow 1% every day and then eventually you'll get wherever you're trying to go. So baby steps + consistent effort is what works for me.

Focus is a muscle and with enough practice you'll be able to do it longer and longer? I could be completely wrong, but that is my experience with focus and discipline. People say there are optimal lengths of time for deep work but after removing distractions, don't beat yourself up and do the best you can. Over time, months or years, you probably will improve.

<comment><AUTHOR> I'm glad you're doing well.

</comment></comment><comment><USER6> What happens for you at the 30 minute mark? Do your thoughts start wandering? Does your ability to critically reason drop? Do you get feelings of boredom?

In my experience, focus can definitely be trained like a muscle. These days I easily get absorbed in a technical problem for 10+ hours, losing track of time, tiredness, and hunger.

My process is pretty much quinticentially stoic, in the philosophical sense. The idea is to just roll with the punches. For me Deep Focus isn's so much a lack of distraction, boredom, etc. instead it's simply recognizing when I'm off track and geeting back on.

If you're a bit relentless in this process, before you know it the distractions seem to wane off or, at least, one gets better at simply ignoring such thoughts and feelings.

Anyway, there is surely hope in your case!

Full disclosure, I'm formally trained in zen meditation---briefly lived in a temple for a couple yeas---so my method is heavily influenced by that, too.

In general, you might get some mileage out of a meditation practice. Probably easiest to find some local group of practitioners doing things you resonate with.

Anyway, 2cents from a fellow interneter.

</comment><comment><USER7> About five years ago, I realized that my day not only can be broken up into several periods with differing levels of focus, but I should structure my activities to match that focus. So, low-value tasks, quick tasks, and tasks that don't require much thinking take place in the early morning and early afternoon. Planning takes place in the shower or during daily walks. Writing and other activities requiring deep concentration usually takes place in the late afternoon or at night.

I also learned to take advantage of situations that I once considered a waste of time to be used for the higher-focus tasks. I actually appreciate being forced to sit in a subway or airplane seat for 30 minutes or 3 hours with limited Internet access, as I can really get stuff done on the laptop.

I also deleted Facebook and Twitter from my phone, and set up browser blockers on my laptop for known time-wasters.

</comment><comment><USER8> The advice about good diet, sleep, exercise is all good and it will cure the problem much of the time. But it's possible to go too far and stray into perfectionism.

Discipline is simply habit. Habit is simply following patterns. Your brain sees a trigger, and it will initiate a pattern until completion.

It's dangerous to force yourself to do a lengthy preparation routine. I got demotivated if the conditions weren't ideal. It then becomes a habit to procrastinate until you can get the ideal conditions.

What I'd recommend is setting up some really simple conditions. Design a habit for when you sit in a room. Design a habit for when you get distracted. Sometimes you have to repeat a mantra to snap yourself back in. This is also why the Pomodoro Technique works so well - the ticking noise reminds you to get back to work until the bell rings.

</comment><comment><USER9> Everyone is different but for me it's about being driven by something I deeply believe in, while getting quick results along the way (to maintain the momentum for a long period of time). As an example, working for someone else in order to get a paycheck is a recipe for failure. Hard to focus and be motivated enough.

So again, it's different for everyone. Another thing I usually do that works super well for me is to go for a run (30-40min). I solved some of my toughest problems while running because I focus on breathing and nothing else. Not by reading forums or books or even watching videos. Everything gets sorted in my head and I come back home, write down my ideas and chill for a second.

I read that running is one of the best therapy for ADHD people.

</comment><comment><USER10> Exercise, hard, multiple times a week, like your life depends on it (because it does!). If you are overweight, lose weight to a healthy level.

I can say since I've started regularly, my anxiety problems just sort of melted away, I'm happy, confident, I sleep well, and what I thought were huge problems are a lot easier to manage

</comment><comment><USER11> One technique: Pomodoro. It is very effective technique.

I just recently started and I am on track. After a day you will see how ineffective you were and how you can improve.

I slightly modified it. Prioritize the things you want to start. Do not divide the tasks.

Technique: 1\. Set the timer for 25 minutes. You can use any app.

2\. Take 5 mins break.

3\. Tell yourself I will not use any internet or any other thing for 25 mins.

4\. If you have to do anything say to yourself will do in 5 mins break.

I admit my first pomodoro were quite hell. But I refrained myself from using any distractions.

</comment><comment><USER12> By disconnecting from the internet! As evidenced by me posting this comment, I'm in my five minutes tops mode, but without the internet it's 10+ hours straight.

</comment><comment><USER13> Mine has been impacted by a few significant health blows, followed by the death of a thousand cuts.

Health problems inhibiting, interrupting sustained focus and "flow".

Environments that have become increasingly distracting. Audible and visible noise, more and more inescapable. Some sick environments -- physical toxins.

Compounded, co-morbid symptoms that have made it difficult to sort out what is actually a factor and to what extent.

Co-morbid stress and eventual "depression" or whatever you want to call it. That remarkably and relatively quickly lifts, when I get out of these circumstances for a bit.

I now know and believe I have some significant if not permanent, long-term damage.

For some time, I've been saying "next year", but another "crisis" inevitably comes along (mostly those of other people in my life).

Well, next year. Somehow, I'm going to move. And I'm going to find ways to simply not work for and with people who promote these conditions.

Stop the cuts.

P.S. I write this so that if it rings true for other people, they don't wait so long to "get out" and break the downward positive-reinforcement loop.

</comment><comment><USER14> I had this problem too, my "fixes"

\- proper sleep \- walk for 30 minutes before my "grind" \- plan my three work items the night before. \- no alerts (mute phone, email, slack, etc) \- grind.

The hardest parts are just not getting interrupted, by internal or external forces.

Sleep and walking help your brain. The list keeps me on task.

It took years to work back to be able to "grind" for just 3h.

</comment><comment><USER15> Forget having the ability of being able to constantly get chunks of my time focused on deep work, I am having trouble focusing for more than 15 to 30 mins on even trivial stuff like watching a video or reading an article. I can barely get through 15mins of anything before my mind seems to wander off. No wonder it takes me a couple of days to finish a movie. I gave up on even the thought of going to an actual movie theater. I constantly have to pause and come back to whatever I am watching/ doing.

I had ADHD as a kid, it gradually seemed to have gone away over the years, it's been a while since I've taken any sort of meds. But lately, for the past year or two, I've been struggling with this. I need to change my lifestyle a bit, take up some meditation, or maybe even go to the doc again. Or a combination of all. It's just frustrating.

</comment><comment><USER16> Yeah I've had terrible focus and attention span for a long time. It can improve dramatically but takes time to get to crazy long hours per day. Deep work suggestions are good, don't use the internet too much etc. but for me the biggest difference has been meditating for 1-2 hours day, doing some light sprints late at night, and focusing for at least a few hours everyday. If I focus everyday my deep work hours start to improve, if I take even a day of it reduces. So consistency with all your habits is key. I would say that in a couple of months you could probably get up to 4-5 hours per day.

</comment><comment><USER17> Are your interruptions actually valuable inspirations for other projects or are they perhaps revolts against "excessive" focus, which is to say you need a break? If so, then perhaps they are beneficial.

</comment><comment><USER18> A while ago I quantified how I spent my day. Every. Single. Minute.

A good day was about 6hr out of 8hr of work. The other 2hr was spent fluffing about - having coffee, hallway conversations, reading HN. Some of it valuable, but not totally focussed.

Then I had a kid.

Never been so focussed at work before. Easy to ignore all the noise, and easy to concentrate on whatever tasks come up during the day. I've found similar traits in other parents.

P.S. Not recommending you have a kid to solve your Deep Work problem, because they ruin all ability to concentrate _outside_ of work.

</comment><comment><USER19> For me a lot of this comes down a lot to how interesting my work is at the time. Interesting work keeps me motivated. Pomodoro seems like a reasonable solution for less interesting work (breaking it down into half hour chunks with a 5 minute reward break at the end).

On a more practical note, meditation will help with your attention span and stop you getting distracted as easily.

Saying that I am on HN posting responses right now. Anyone who has truly solved this problem probably isn't here. :)

</comment><comment><USER20> I did; I'm not sure if it was a change of climate, a return to a freerunning sleep schedule, a reduced workload (incl more free time and more sleep), or more frequent contiguous blocks of sleep (with good sleep hygiene: cool, dark room).

It could also be the NAC I have started taking daily, or my reduced caffeine tolerance (making it much more effective when I do use it).

I can manage for an hour or three now, which is a lot more than the 15-30 minutes I used to be able to expect on good days.

</comment><comment><USER21> If you're using any mind/mood-altering substances, at least evaluate what role they might be playing in your ability to focus. I've found stimulants, including caffeine, to have an impact. Also recreational drugs like MDMA can have serious derimental effects in areas of focus, memory, and cognition.

</comment><comment><USER22> I've gone from 10 minutes of attention time (measured by length of unbroken meditation) by several things. Limiting time I spend on social media to 30 minutes a day. Long distance running and daily meditation. Also focusing on being present when someone is talking to me or having a conversation.

</comment><comment><USER23> Is your attention span terrible for everything, or is there some activity or hobby where you can become immersed? If the former, you may have a physical problem, perhaps a vitamin or mineral deficiency, sleep deficiency, or ADD, if the latter, it's probably more of a motivational problem.

</comment><comment><USER24> Yes, keep the amount of noise to minimum. I subscribed to daily newsletter of HackerNews and check it only then no more. I deleted my accounts on other social networks that I never really used. Remember, Internet is like TV nowadays, everyone is fighting for your attention because attention is money. One thing to practice the ability to focus is reading books, I've seen it first hand how hard is it to read a book after being immersed in various shallow activities and how it gradually improves when practiced daily.

There are also tricks that you can use to get your mind to focus, for example working in fixed blocks of time (pomodoro technique). Having fake deadlines makes the mind focused to finish the task at hand but it requires a little bit of planning.

</comment><comment><USER25> Since starting a new job with a quiet office, less pressure and no time logging required, I've been able to focus much better. It may not be you, but your environment.

</comment><comment><USER26> My ability to focus returned after taking a multivitamin and fixing nutrient deficiencies.

You could look into NutrEval, a comprehensive hormone panel, a thyroid panel, and maybe even genetic testing. Or, as you're trying to regain rather than gain, just start taking a multivitamin, D & K, and chelated/TRAACS magnesium supplement.

</comment><comment><USER27> Maybe you focus too much :) try a different approach, perhaps, like the one in "The Inner Game of Tennis".

</comment><comment><USER28> I try to take the advice on new from the 4 hour work week.

I use the pomodoro technique combined with keeping a list of what I need to get done. This has probably been the best strategy I have discovered so far.

At the end of each day, I plan everything for the next day so I can hit the ground running.

</comment><comment><USER29> I have had numerous attempts, but the approach that really worked for me was getting rid of EarPods and installing numerous site blocking services on my devices.

I was able to force myself to spend more of my time in my own thoughts.

</comment><comment><USER30> Small and progressive milestones can help a lot in that sense.

</comment><comment><USER31> I use Pomodoro technique since 2010 and it works for me.

<comment><USER32> I get really tired when I use it. Like the five minutes is not enough and I burn out. I get better just losing myself but I would like to be able to be better at it.

<comment><USER31> Well it is strongly encouraged to get longer breaks (15-30min) after 4 pomodoros or roughly every 2 hours.

</comment></comment></comment><comment><USER33> Become self-employed - focus or starve

<comment><USER8> Self-employed here. There's a middle ground where you do neither. Work 2 hours a day, enough to feed the family.

<comment><USER25> The middle ground sounds awesome.

<comment><USER8> Well, it is a good way to get really complacent. Not really a solution like parent proposed. I even switched to a lower paying job with 60 hours/week for a while to try to get disciplined, but it didn't help.

</comment></comment></comment></comment><comment><USER34> Get enough sleep.

</comment><comment><USER35> Nootropics can help with this too esp. as you get older -

www.getmindsync.com

DM me if you would like to try some for free.</comment>


An Update on Eclipse Android Developer Tools - <AUTHOR> http://android-developers.blogspot.com/2015/06/an-update-on-eclipse-android-developer.html

<comment><USER2> Does this mean that Google will insure [https://code.google.com/p/android/issues/detail?id=82716](https://code.google.com/p/android/issues/detail?id=82716) is fixed by the time support is dropped? If I had to do Android development for my job I'd be out of luck based on Google's lack of consideration of accessibility for there developer tools.

</comment><comment><USER3> Well it's nice to see the cancer that is eclipse being 86's from one platform at least.</comment>


The $5000 Compression Challenge - <AUTHOR> http://www.patrickcraig.co.uk/other/compression.htm <comment><USER3> I absolutely believe Mike should have paid Patrick.

On the simple premise that since Mike was hosting a bet that he KNEW was impossible (i.e. under no circumstance, ever, would he have to pay the 5000$), then literally the only point of the game is to find any loopholes. Otherwise it's just Mike preying on unsuspecting victims.

If you design an impossible game, the only possible thing for anyone to do is to break it. If you then complain that THAT is cheating, you're a pedantic idiot - one of those annoying kids in middle school who loses a bet and then tries every possible way to weasel himself out.

To add fuel to the fire, his obnoxious replies such as "I tried running the first two files and it didn't work", make my blood boil, as it's a clear attempt to try and belittle the contestant.

<comment><USER4> > If you design an impossible game, the only possible thing for anyone to do > is to break it. If you then complain that THAT is cheating, you're a > pedantic idiot

I feel the same way when casinos bust card counters. You use math to take money from suckers. When other people use your rules and better math to take money from you, that's suddenly deeply immoral.

<comment><USER5> I don't think anyone feels that card-counting is deeply immoral. It's more like, "we lose money when people do this, so we will do everything in our power to prevent it."

</comment></comment></comment><comment><USER6> Mike Goldman originally wrote the challenge such that it calls for one file and one decompressor.

However, when subsequently asked whether there can be multiple files, he agreed; thereby he was arguably duped. He didn't say "okay, but there will be a 256 byte size penalty per additional file", he just plainly agreed.

This means that the original formula for adding the size of the solution applies: just the file sizes added together.

Goldman should accept that he foolishly rushed into a careless amendment of his original challenge and pay the money.

That said, it obviously is cheating to have the archive format or file system hide the representation of where the removed bytes are! If a single file is produced, it has to include a table of where to insert the bytes that were taken out. If multiple files are produced, the archive format or file system stores that information for you at considerable expense.

If both people are wrong, the contest should be declared invalid and Goldman should return the $100.

If only Goldman is wrong, he should pay $5000.

Under no interpretation is Goldman strictly right and the contestant strictly wrong.

So he is wrong to keep the $100 in any case.

<comment><USER7> Nope, perfectly acceptable for Goldman to keep the $100. Craig tried to play a game of semantics, and lost because semantics let Goldman weasel out by pointing to O/S meta data.

The challenge clearly, repeatedly, stated that Goldman would give $5000 to anyone who could _compress_ a datafile such that the combined size of file and decompressor was smaller than the original datafile.

Craig did not compress the data stored. He split the file up into multiple smaller files and using "5" as the boundary. However, by creating 218 files, he increased the amount of space required to store this data. Ergo, the combined size of the "compressed" files and the decompressor exceeded the size of the original file. It is only by excluding the space taken up by the meta data that the "compressed" files are smaller. Furtheremore, elsewhere it was noted that: "The FAQ clearly outlines that filesystem exploits are not true compression."

<comment><USER8> This interpretation is inconsistent with Goldman's own statement about the original data that "the file size is 3145728". He didn't say "the file size is 3145728 plus some file system overhead", so by file size he was thinking of the number of bytes in the file ... until he was outsmarted.

It's hardly a filesystem exploit if - again by Goldman's own statement - gunzip is allowable.

<comment><USER6> I suspect that if the challenge had been solved with a single file, Goldman would try to get out of paying by claiming that the program's size should include the size of the interpreter for its language, and the libraries linked to that, the size of the command line needed to invoke it (including the pointer vector and null termination), not to mention the underlying kernel ...

<comment><USER9> I don't know goldman, and I bet you don't either - but there's a pretty big difference between this solution (which clearly cheats the aim of the challenge, and a solution that actually compresses. People hate to reward cheaters, even if it's a fun kind of cheat from the outside. But that doesn't mean he wouldn't have payed out for a real solution, which likely would have been quite interesting (and not quite as impossible as it's being made out to be, since we don't know whether his random source is truly random).

<comment><USER10> What does "actually" compressing mean?

Replacing every "5" with EOF is apparently bad.

What if he replaced every "5z" with EOF? Fewer bytes there.

What if he had a variant of LZ77 doing dictionary encoding followed by a range encoder that outputs symbols in the range -1 through 255? Even counting the EOF as a character, this would give an output 2K characters smaller. Sounds like compression to me. It's finding common sequences and uncommon sequences and rescaling them based on probability to remove redundancy.

</comment></comment></comment></comment></comment></comment><comment><USER11> Quote from Mike:

        > Rather, you simply split the file into 218 parts ending with the
        > character "5" and then stripped that final character from each part.  Thus the
        > "decompressor" is nothing more than a reassembler,
        > concatenating the parts and reappending
        > the character "5" after each.

Well, that's exactly the definition of lossless compression. Look at e.g. how js crunch works: you create a dictionary of common sequences, split the file on those sequences recursively and then reassemble it by joining in reverse. Gzip, bzip2, &c, &c, it's all the same thing. Split the file by a common sequence and reassemble it by that. Patrick just created a customized compressor that went only 1 level deep.

Normally you'd need a delimiter to separate those chunks, a delimiter that doesn't occur in the chunks e.g. through padding or escaping. That, in turn, increases the filesize, and now you're in trouble. What Patrick did was to use EOF as a new fresh "delimiter" that doesn't occur anywhere, and at a cost of zero bytes, no less.

Cheating, or inventive.

<comment><USER12> The EOF is not at a cost of zero bytes; it costs as much as storing the length of each constituent file. The extra space used is in the file system accounting.

<comment><USER10> It's at a cost of 0 competition score bytes. Mike screwed up by allowing an alphabet of 257 symbols and then only counting 256 of them. Pretty much any compression or repacking algorithm could have been used at that point.

<comment><USER13> Dylan16807, that's a very concise way to put it, thanks for making that comment.

</comment></comment></comment></comment><comment><USER14> The point of the challenge was to tempt people who do not understand compression as well as Mike into putting themselves into a position for Mike to mock and/or shame them. From that respect, it seems to me like it was a trick.

In my experience, people who set up such tricks do not usually respond well when the tables are turned.

There are some people in the world who take it personally when other people don't understand their area of expertise as well as they do. They get angry and offended at naive questions, and seek to punish the idiots. This is a great way to take an interesting subject and ruin it for everyone.

One of the best aspects of the HN culture is that experts here tend to incline more toward teaching and less toward chastising. It's a nice change from Usenet.

<comment><USER15> Why do you think that rather than Mike is genuinely interested in novel compression methodologies, and willing to pay some money to make interested people attempt to discover them?

<comment><USER16> Because that's pretty much what he says in his post to comp.compression, where he announces that someone accepted the challenge. Let me quote:

> Before naming the individual and giving additional details of our > > correspondence, I would like to give him some time to analyze the > data I > will be sending him. It would be very easy to point out to > him the > impossibility of his task, but far more interesting to see > how long he > will struggle with the problem before realizing it for > himself. > > I am > supposing that one of his fellow co-workers probably referred > him to my > challenge, as I cannot fathom that someone would read the > comp.compression > faq first and then want to participate after > understanding the futility of > the effort. On the other hand, some > people just don't understand > information theory too well. > > I'll try to give him a complete explanation > of his error after a > week or so, I guess. :)

So Mike is just smug about how clever he is, how stupid the other person is, not even suspecting there might be a loophole in the challenge.

I see no sign of interest in learning what the other person is up to, or even admitting that there might be something to learn.

</comment></comment></comment><comment><USER17> A trick similar to the recursive Barf compressor (add information to the filename). [http://mattmahoney.net/dc/barf.html](http://mattmahoney.net/dc/barf.html)

A longer running challenge is [http://www.drdobbs.com/architecture-and- design/the-enduring-...](http://www.drdobbs.com/architecture-and-design/the- enduring-challenge-of-compressing-ra/240049914) No entry fee, $100 prize, and just as unfair.

A completely serious compression challenge with serious consequences for AI and NLP: [http://prize.hutter1.net/](http://prize.hutter1.net/) up to 50.000$ prize money, but severe restrictions on memory and running time.

You can not beat Goldman's troll-ish challenge (certainly if the rules are retro-actively clarified in favor of the organizer). You could however try to put the challenge in limbo by creating a decompressor which bruteforces a solution, 'till some hashes match or the final heat death of the universe or the halting problem is solved, whichever comes first. Goldman will not be able to ever verify your solution, and when he does (theoretically it is not impossible), it means you win.

Or, instead of above Schrödinger's Compressor you can send a good random number generator back as your solution. If Goldman wants his file to be random, any random file should do. Why does he want exactly his own random file? Why does he want to do a diff between two random files, is he perhaps looking for order where there is none? But that's the same foolishness he accuses his participants of.

<comment><USER18> > A longer running challenge is [http://www.drdobbs.com/architecture-and- > design/the-enduring-...](http://www.drdobbs.com/architecture-and-design/the- > enduring-..). No entry fee, $100 prize, and just as unfair.

At the 10-year scale, a whole new set of tricks opens up. Invent a sufficiently popular programming language, or contribute a lot to the linux kernel, and start surreptitiously hiding bits of the file on his OS (the easiest would be for you language to have a builtin function that spits out a small part of the file).

<comment><USER9> That was explicitly forbidden :-)

</comment></comment></comment><comment><USER19> AFAIK, information theory requires the _Expected_ size of a 'compressed' file be at least as large as the original.

So we could create an encoding that compressed N/50 of the strings with lg(N/50)=lg(N)-lg(50) bits. That would save us lg(50) > 5 bits with 2% chance. In this game we have 50 tries (5000$/100$) so we'd be pretty sure to win.

The correct price for this game is probably closer to 200$.

<comment><USER10> The problem is that even the most trivial linux-compatible decompressor will add a few bytes, and there's almost no chance of saving that many bytes. But sure it wouldn't hurt to require it be 100+ bytes smaller.

</comment></comment><comment><USER20> I think Patrick sums it up quite well. Perhaps the interesting thing is imagining how this would go down 15 years later in 2015: Patrick asks if the bet is available; it is. They enter into a 2-of-3 bitcoin transaction with 3rd-party escrow. Patrick and Mike sign the terms (probably written in pseudocode or python) using their sending bitcoin addresses (or GPG keys). Filesharing is an order-of-magnitude easier than setting up FTPs with personal IP addresses. The bet is promptly won by Patrick.

Ah, how things have changed in 14 years

<comment><USER21> They could have used an escrow service 15 years ago and the challenge terms could have been defined as a Python program since Python is 24 years old.

<comment><USER22> Getting someone with domain expertise on the matter to provide escrow is non- trivial. Escrow trust accounts are heavily regulated in most parts of the world, and require licensing, bonds and lawyers. I highly doubt they would find someone willing to go through all this. The cost for (legally) operating an escrow is probably higher than the entire bet... (he could also do this without licensing, and take on the legal risk, I guess. this might go under the radar for small things like that, but doesn't really work at scale.)

Bitcoin improves on that by not requiring a trust account - their trusted third party would simply hold one key in a 2-of-3 multi-signature scheme, giving him the authority to resolve disputes and adjudicate between them, but without holding any funds under his full control.

I find the legal implications of Bitcoin smart contracts very exciting - <USER2> significantly lowers the entry barriers for providing many kinds of financial services and opens up these markets for competition in a way that was simply impossible before. There's lots of room for innovation and disruption with that.

Disclaimer: standard IANAL/TINLA apply, but I'm the founder at a startup that facilitates exactly that ([https://www.bitrated.com/](https://www.bitrated.com/)) and received extensive legal guidance on the matter.

<comment><USER23> Bitcoin makes the technical process easier but doesn't help with the hard problem (as you said): finding a third party with domain expertise, whom they both trust, who is willing to adjudicate at very low cost.

It sounds like your startup is trying to solve that and create a "Trust Marketplace". Godspeed. Establishing trust between strangers is a very hard problem.

And while you may find a way to innovate around existing laws, new laws will be written.

<comment><USER22> > finding a third party with domain expertise, whom they both trust

I would say that in this specific instance, they could've quite easily agreed on a reputable user from the comp.compression newsgroup whom they both trust.

> adjudicate at very low cost.

It makes sense that arbitrators for niche markets with considerable domain expertise could charge a premium for their services. Say, $50-$150 for that specific case doesn't seem like a stretch.

Also, note that the fee could be charged only in case of dispute. (and indeed, many trust agents on Bitrated offer their services for free or nearly-free when there's no dispute and no work on their part. 0.1% base fee + 2% for disputes seems to be a popular fee structure.)

> Establishing trust between strangers is a very hard problem.

Indeed! This is the main problem we're trying to tackle, which is arguably much harder than providing the technological platform for payments.

> And while you may find a way to innovate around existing laws, new laws will > be written.

The thing is, we aren't taking advantage of some "loophole" or anything like that. The escrow regulations exists for a reason and makes a lot of sense - holding funds on behalf of others should have strict regulations attached to it. Escrow providers are trusted to keep the funds safe from thieves, not to "run away" with them, and to resist the temptation to invest user funds to make a (potentially quite high) profit while holding them (which could result in losing them, even in relatively "safe" investments).

With multi-signature, none of that risk exists, and so it makes sense that the regulation won't either. Even when new laws gets written to address that, they're likely to be much less strict.

The legal situation with multi-signature is very similar to a binding arbitration clause, so we anticipate regulations to be based off of that (and arbitration is significantly less strictly regulated than escrow).

</comment></comment></comment></comment></comment><comment><USER24> Previous discussions:

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

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

</comment><comment><USER25> "I still think I compressed the data in the original file. It's not my fault that a file system uses up more space storing the same amount of data in two files rather than a single file."

I don't really agree with that, given the fact that he used the information about the size of the files.

</comment><comment><USER26> Mike Goldman is now immortalized on the internet as someone who welches on bets...

<comment><USER27> It's not so clear cut, The filesystem really was acting as a "table" of index values on where to replace the characters that were removed.

</comment></comment><comment><USER28> Can someone explain why this is not possible? I understand why sending a decompressor beforehand is not possible for all inputs. I don't understand this formulation of the problem, where it only needs to work for one input that you get before you need to create the decompressor.

<comment><USER29> Some simple explanation

Compression exploits redundancy in a data stream (basically). You basically get "all symbols" (and how you define this varies according to your compression method: you could do all letters in the case of text, or even text snippets that repeat, etc) and reassemble them in a way that the ones that repeat the most take less space (and you also need to start from a basic dictionary known by all uncompressors or ship it with your compressed file)

One simple analogy is writing with abbreviations, but if you write e.g. the reader has to know what "e.g." means or you have to put in the beginning "e.g. = example" (and this also takes space)

Now, a randomly generated file ideally has all symbols repeating with the same frequency, (we say all symbols have the same entropy - I'm not sure about this exact wording), hence you can't take a symbol that repeats more or less and make it take less space in your compressed file

<comment><USER30> what if instead of using your own dictionary, you use an index into an existing dictionary? such as an index into a subsequence of pi. Couldn't you then find a sequence of bytes in the file in which the index into pi takes less bytes and then replace them all with the index? If you couldn't find any in pi use e or another such number? What am I missing

<comment><USER29> In this case your dictionary either doesn't have everything or to adequately point to it you take as much space as not using it.

While Pi has all pairs of 2 digits, your index would take more space than storing the pairs itself (because you might need to go beyond position 99)

For one situation you might "get lucky" and find a coincidence, but this won't scale generically

<comment><USER31> See also: [https://github.com/philipl/pifs](https://github.com/philipl/pifs) and [https://github.com/philipl/pifs/issues/23](https://github.com/philipl/pifs/issues/23)

I admit this fooled me for a bit. Good news is, I won't be fooled again by something similar :)

</comment></comment></comment></comment></comment><comment><USER32> In theory, I quite like the solution mentioned in the earlier threads: request a file that's a few kilobytes, then get two or three different hashes of the file, and write a "decompressor" that generates random files and checks the hashes.

It's just a shame that the heat death of the universe will probably occur before your program finishes.

<comment><USER33> Sorry, but no. There are far more files with a given hash than just the one, if the file is longer than the hash. And having multiple hashes doesn't help until the hashes exceed the length of the file.

<comment><USER17> Chances of getting a collision is higher than getting a good solution, but having multiple hashes does help in increasing the chance at a good solution. With a hash 1 bit less than the length of the file, we put two pigeons inside one hole, and have a 50% chance at picking the right pigeon. The fewer/smaller hashes, the more we get "sorry, but no".

<comment><USER34> It's easier to just drop the final F bits from the N-bit input stream and, at decompression time, guess what they are than to go through this exercise of generating hashes that have N-F bits in total and hunt for bit streams having those hashes.

</comment></comment></comment></comment><comment><USER35> yeah, he should have been smart enough to spot what was coming when he was asked about multiple files... or at least asked some more directed questions than 'what do you think you have that will solve this problem'

<comment><USER36> Or insisted it was a single file, tar files allowed.

<comment><USER37> Tar files have a decent amount of overhead. Source: I wrote a streaming untarring library in C for a streaming video product. You would definitely add WAY more than 1 byte of overhead per file, which is what is required for this trick to work.

<comment><USER36> But it rules out other kinds of tricks like storing info in file names. If all the metadata is counted in the length of the tar file, these tricks don't stand a chance. There's way more than 1 byte of overhead per file in the file system and Mike needed a rule that counts all of them.

</comment></comment></comment></comment><comment><USER38> The file ordering contains information (done with filenames, _comp.$i_ , but could use other file metadata).

Mike can escape his unthinking agreement to multiple files by the rules forbidding information in filenames.

</comment><comment><USER39> Here's a more risky solution. Chose an arbitrary large file size. Have the decompressor search the local file system for a file of that specific size and make a copy of it as output. This presumes he's going to have the uncompressed file on the system to verify the output of the decompressor. That may turn out to be a false assumption, but what if...

<comment><USER40> Or just have the decompressor log onto a server and download the original file. Only risk then is internet connection.

</comment></comment><comment><USER41> You should re-read this and imagine Goldman's messages being read in Vizzini's voice.

</comment><comment><USER42> I remember a "fractal compression" hoax one time. It would compress a file ridiculously (like 1 1mb file down to 100 bytes), and decompress it flawlessly. Of course it just moved the file to some other place on the harddrive and created a "compressed file" full of junk and restored the file on decompress. Good one...

</comment><comment><USER4> If you want to hear some stories from the master of proposition bets, there's an old autobiographical article in SI by Titanic Thompson:

[http://www.si.com/vault/1972/10/09/618832/soundings-from- tit...](http://www.si.com/vault/1972/10/09/618832/soundings-from-titanic)

(The risk being that half of it is made up, but he definitely had a reputation for this sort of thing.)

"You might wonder why, if I was the best golfer in the world, like I say I was, I didn't turn pro and win all the championships? Well, you were liable to win a golf bag if you won a tournament in those days. A top pro wouldn't win as much in a year as I would in a week as a hustler. People would get to know a pro, and I wanted to keep my skill a secret as far as possible. I didn't care about championships. I wanted the cash."

</comment><comment><USER43> I didn't see anything that mentions run-time in the challenge. I think a good compression challenge should mention about run-time. Theoretically, it would be possible to hash parts of the file and then brute force the hash in the decompressor. This would take a lot of time but would work.

<comment><USER44> Except if the hash is smaller than the source data, then with a good hash, there will be multiple source datasets that hash to the same result, which makes your decompression program unreliable. You could well bruteforce the wrong answer.

<comment><USER43> Do you mean that there could be two 3K files with the same sha256 hash and the probability of hitting the collision is greater than the probability of finding the correct hash for the file ? Let's divide the 3 mb file into 1000 parts, each having a ~3k size. Take sha256 hash of all 1000 parts and sha256 hash of the actual file. The size of these hashes are less than the actual file + leaves ample room for a decompressor. Now start brute-forcing and assume we have all the run-time power and time. Would the probability of collision happening in all 1000 parts be very low then ? Given a good hashing function could it be so low that we can disregard it ? If 1000 is not enough, can we increase the splits to 2000 or 3000 ?

<comment><USER45> It's not that there _might_ be a collision, but that collisions are _guaranteed_. How many 3Mb files are there? 2^(3M _8) = 2^25165824. How many distinct hashes are there? 2^(256_ 1001) = 2^256256.

By the pigeonhole principle, we can't fit 2^25165824 objects into 2^256256 holes; indeed each file will have on average 2^24909568 other files that share the same set of 1001 sha256 hashes.

The reason that we are able to work with hashes, and that compression works in practice, is that we _don 't_ have to deal with _every_ 3M file. Most of these files are gibberish and will never be seen, and finding two files that match even one hash is incredibly difficult. But once we start talking about brute- forcing, we start encountering problems -- and having to dedicate an awful lot of processing power to the problem isn't the biggest one...

<comment><USER43> There is just one 3MB file and we divide that file into 1000 parts. I agree there will be collision per hash (for each part). But I'm skeptical that all 1000 hashes will produce such bits so that the final file will cause collision on the hash of the original file (remember we do have hash of the original file). If the final hash does not match the hash of original file we would have to recompute all the hashes again by randomly generating the bits for each 1000 file-parts. Do you mean to say that the collisions are guaranteed and that the collision inside any file-part will also cause a collision in the original file hash when the parts are combined ?

<comment><USER45> Not every collection of 1000 correctly hashed parts will make a correctly hashed whole, but there are an awful lot of different collections of parts that will hash correctly (2^24909824 permutations of them) and of those, one in 2^256 will also match the full-file hash.

</comment></comment></comment></comment></comment></comment><comment><USER46> I'm confused about the challenge. Why wouldn't simply using gzip work? I must be missing something obvious.

<comment><USER47> If you're given perfectly random data, gzipping it will (almost) never reduce the size so much that you could fit the gunzip binary in the reduced space. In the extremely rare occurrence that the generated random data has, say, a repeated string longer than the gunzip binary, the challenger could be on guard for that and just regenerate random data until that's not the case.

To be more formal, the challenger is finding what he believes to be a string that is Kolmogorov-random, and betting (quite safely) that the challenged party can't prove him wrong.

[http://en.wikipedia.org/wiki/Kolmogorov_complexity#Kolmogoro...](http://en.wikipedia.org/wiki/Kolmogorov_complexity#Kolmogorov_randomness)

<comment><USER48> > that you could fit the gunzip binary in the reduced space

What's funny is that Patrick (the challenger) asked if a bash script consisting solely of a call to gunzip would suffice as the decompressor. In other words, all he had to do was compress the file by more than the amount of the _script_. Mike allowed it, knowing that even a tiny "decompressor" that really just called out to the real thing, would still be larger than the compression achievable on a well-crafted random blob.

</comment></comment></comment><comment><USER49> I am actually surprised that Patrick did not compress the original data to 0 bytes by keeping all the data in filenames. That would be the ultimate troll ;)

<comment><USER50> I disagree. You could legitimately say he just stored the data in the metadata fields. But files have a size, even as a stream, completely regardless of metadata. I think this is a more clever hack.

<comment><USER49> Maybe, I don't know. One way or another you're storing _some_ data (chunk ordering in Patrick's case, all data in my case) in file names.

</comment></comment></comment><comment><USER51> >It's not my fault that a file system uses up more space storing the same amount of data in two files rather than a single file.

Even without a filesystem - just sending data over the wire - you have to be able to delimit files in some way, and there's going to be overhead associated with that.

Another way to think of this is that any particular volume could be viewed as a single big file. How much space in that big file is he taking up?

<comment><USER52> That just invites more ways of implicitly sharing and hiding data. Like, have each of 230 hosts have one part of the file. Instructions for running the program are "Go to %part1url. Download the file as `foo.1`. Go to %part2url. Download the file as `foo.2`." and so forth. That's exploiting the fact that the instructions for running the program aren't counted as part of the program size.

</comment></comment><comment><USER53> In terms of behavior, we know Mike acted in bad faith: before he saw the approach, he had agreed that the challenger could use multiple files. But once the challenger had posted them, he proceeded to download only a single file to verify its functionality, not touching the others. It shows bad faith on the part of Mike when he chose to ignore the other files.

By the way in a theoretical sense Mike lost when he said he would allow multiple files and count their sizes: this is because [] is not the same as [[][][]], but consists of 3 empty sets. You can theoretically encode a file into just a bunch of 0-byte files, without using the order of the files or their names. He shouldn't have agreed to count only their sizes.

For the theoretical encoding into 0-sized files, you can simply interpret the input file as a binary number, and then create that many empty files.

This is not a practical solution of course - you can only compress two bytes down to 0-byte files this way, as 2^16-1 is already up to 65535 empty files. For three bytes it's up to 16,777,215 files.

If you wanted to store 9 bytes in unary as the number of empty files, you would need 2^72-1 = 4.7 sextillion (million quadrillion) files. Obviously that is not actually possible. But even 9 bytes is hardly enough to interpret the files as binary again. (Unless you can somehow get Mike to agree to the invocation - since the decompression program itself doesn't need to store any information and theoretically could be 0, 1 or 2 bytes.) But theoretically you don't need anything other than what Mike foolishly agreed to: allowing multiple output files counting their sizes.

2.

There is also another theoretical way to make money off of Mike, but it is not practical. (It doesn't work.) If we were not limited to bytes but could use bits, you could shave up to 5 bits off of every input file, if you figured out a way to decompress it by always prepending the bits 00000. (Theoretically there is only 1 pigeonhole to decompression, so you do not need to store any information in the decompression algorithm and it has no minimum size).

If Mike is using a random source for the files, this would result in a correct decompression in 1/32 of cases. But Mike is giving 49:1 odds (risk $100, get $5000), which is better than 31:1. So you could simply repeat the game with Mike thousands of times, always using the same decompression algorithm, until you have all of Mike's money. This works better if Mike is a computer, of course.

And it doesn't work at all on any actual systems, as a nibble is less than a byte and would not count as savings even if you could encode the decompression algorithm into a 0-byte (or up to 3 bit) invocation.

</comment><comment><USER54> He also doesn't state that the output should be right at first decompression try. By using this you could encode multiple bits and then generate various wrong archives, knowing that after 1000000 tries he would get a correct decompressed file.

</comment><comment><USER55> Does the decompressor have to be wholly hosted locally? Could it just be a shim that pulls a more complex program from the net?

There are grey areas here. Does a decompressor that depends on linked libraries count? Do things like libc count towards the total decompressor size?

I know this was written 14 years ago, but we had the net then, and shared libraries aren't exactly a new thing. Where do you draw the line? Can _any decompression code call an external dependency_ and not be disqualified in the same way?

I'd say that using the filesystem to "hide" bytes is the least of the possible loop-holes with this challenge, if you were being pedantic about the rules.

<comment><USER48> > Does the decompressor have to be wholly hosted locally? Could it just be a > shim that pulls a more complex program from the net?

The judge can disconnect his computer from the Internet, attempt to run the submitted decompressor and file, and declare failure when it doesn't work. Nothing in the challenge guarantees Internet connectivity on the machine.

> Does a decompressor that depends on linked libraries count? Do things like > libc count towards the total decompressor size?

Nope. In the email exchange, Mike said that just a script that called out to gunzip would be fine, and that he'd only count the size of the script as the decompressor size

> Where do you draw the line? Can any decompression code call an external > dependency and not be disqualified in the same way?

Yup, as long as the dependency is already on the machine I suppose.

That's what's so enlightening about this challenge. Even a tiny, tiny script that calls to other programs still can't compress a "pathologically" random file by more than a few bytes.

<comment><USER55> >Yup, as long as the dependency is already on the machine I suppose.

That's exactly what I was getting at.

If gzip was allowed, then any common decompression utility should be allowed.

If that's the case, and said utility relies on an external library, should that library be included as part of the size of the decompression utility?

It's arguable that the "fabric" over which the data is delivered shouldn't matter. If shouldn't really matter if the linked library comes from the same SSD as the executable, or from a server on the other side of the world.

We currently define "the machine" as the internals of a box. Would this count if you were running the executable from a removable drive? If not, why does "network storage" trigger the disqualification, and not "USB storage"?

I understand the original premise of Mike's challenge, but considering a loophole is being discussed here, I'd like to know where people see that the boundaries of similar loopholes lie.

</comment></comment></comment><comment><USER56> (2001) tag?

</comment><comment><USER57> If you printed the files each on a sheet of paper, it would 'use more trees' than printing the original file (paper being the 'filesystem').

I agree that it shouldn't matter what the filesystem does to store it, if the rules state that file size is determined by a specific command to count all the inodes, then he lost. If the command is 'du' or 'wc', then he won.

</comment><comment><USER58> My money is on Hooli winning this one.

</comment><comment><USER59> I don't think it is 100% foolproof, even if no filesystem trickery is used. The random number generator used is likely not perfect and so the data should be compressible. I mean it would probably be quite difficult, but maybe possible.

<comment><USER60> From random.org, used as a source for the data:

> RANDOM.ORG offers true random numbers to anyone on the Internet. The > randomness comes from atmospheric noise, which for many purposes is better > than the pseudo-random number algorithms typically used in computer > programs.

<comment><USER59> Ah missed that. Yeah then it may be good enough randomness.

<comment><USER9> But yeah - it may well be not entirely random, and if someone actually managed to build a compressor based off any slight bias, I think they deserve the 5000 :-).

</comment></comment></comment></comment><comment><USER61> By Patricks thinking, I could just store the last N bytes of each file in the filename! Clearly he can see this isn't compression?

</comment><comment><USER62> Can't he just send you a Kolmogorov-random file? The definition of randomness (in Kolmogorov sense) basically corresponds directly to his challenge.

Also, Kolmogorov-random sequences vastly outnumber non-random sequences in general, so with a long-enough file, I wonder how certain he can be that he has generated such a file.

[http://en.wikipedia.org/wiki/Kolmogorov_complexity#Kolmogoro...](http://en.wikipedia.org/wiki/Kolmogorov_complexity#Kolmogorov_randomness)

<comment><USER63> How do you determine whether the file is kolmogorov-random?

The only approach is to try a perfect kolmogorov compressor, which doesn't exist (well, excepting brute force over the space of possible turing machines).

<comment><USER62> I bet that with longer strings, the odds of drawing a kolmogorov-random string are high enough that he's guaranteed to make money from his Challenge

</comment></comment></comment><comment><USER64> Why wouldn't binary run length encoding work here? E.g. "compressing" 11100110 to 30020 for example?

<comment><USER65> Compression relies on entropy. There's not enough entropy in the random file your your run-length encoding to work.

I think the data is available so you can always try to beat the bet.

<comment><USER66> I may be completely misinformed, but I think you meant to say there's _too much_ entropy.

A binary string of all ones followed by all zeroes has very low entropy, while a purely random binary string has high entropy. (I think. I'm skimming the Wikipedia article on entropy now)

<comment><USER65> Yes, sorry!!

</comment></comment></comment></comment><comment><USER67> See also section [9] of the comp.compression FAQ for more on the history of compression of random data:

[http://www.faqs.org/faqs/compression- faq/part1/](http://www.faqs.org/faqs/compression-faq/part1/)</comment>


Prime Minister claims laws of mathematics 'do not apply' in Australia - <AUTHOR> https://www.independent.co.uk/news/malcolm-turnbull-prime-minister-laws-of-mathematics-do-not-apply-australia-encryption-l-a7842946.html <comment><USER2> Without having read the article, I'm going to bet he or she did NOT say, "The laws of mathematics do not apply in Australia."

<comment><USER2> OK, I was wrong: "The laws of mathematics are very commendable, but the only law that applies in Australia is the law of Australia."

<comment><AUTHOR> Never underestimate the power of politics. :)</comment></comment></comment>


Docker and Windows Server Containers: A First Look - <AUTHOR> https://www.conetix.com.au/blog/docker-and-windows-server-containers-first-look <comment><USER2> This really is unrelated to regular containers. Containers in Linux are basically a continuation to UML, which are kind of like Jails. Non-Hypervisor virtualization is great, but it should be standardized...</comment>


Face Recognition with Python, in under 25 lines of code – Real Python - <AUTHOR> http://realpython.com/blog/python/face-recognition-with-python#.U7yDJGHTgRQ.hackernews <comment><USER2> You've submitted this 3 times in the past few days with impressively blatant attempts at avoiding the dupe detector. There's no need to submit so frequently.

<comment><AUTHOR> oops. i just changed over my share utilities and was testing some analytics on it. my bad.</comment></comment>


Ask HN: How do I solve problems/code outside of the book I used to learn python? - <AUTHOR>

I learned python (2) via LPTHW about 2 months ago and have had some serious procrastination but now I'm aiming to get back into the swing of things. However, I now remember what triggered my procrastination: My inability to code outside of the book! It's as if I can't solve any programming problems.
For example:
I'm looking to try and solve this on /r/DailyProgrammer: http://redd.it/341c03 but I just can not do it for the life of me. I can go through all of codecademy and LPTHW but I can't figure out something this simple!? Damn it. In my head this is how I would solve it:
First you need to grab user input and store it Next you need to define what consonants are and create a list If user input contains any of the letters defined in the list (regardless of case) place an 'o' after the specific letter and add the consonant Return to above command and check for any other characters, once every character is checked return new output and exit.
---
But for some reason I just hit a blank wall and can't apply this to python, it's as if I learn the syntax but not problem solving, or its like I haven't really learned programming. Any advice at all would be appreciated as I really want to start being able to do interesting stuff! <comment><USER2> Hello,

You need to break the problem into small steps. One step at the time. Then you _unify_ the code. This is not a straight-forward process. For complex problems you might try to grab a problem from many different angles... That's why each user on Reddit gave a different solution. Not all solutions follow the same logic... But that's the good thing with programming, there are usually more than N solutions for each problem. Of course some are faster than others, some are _better_ than others...

To give a practical example to the problem you're trying to solve:

1\. Given a text, we need to separate the words. So we do need to 'split' a phrase into words.

2\. It would be nice to have the words into an 'array'. Arrays are a very handy data structures for this kind of problem.

3\. Now we need to iterate through the words and given a word, find the consonants. In order to do that, we need to split each word in to letters.

4\. Then we need to iterate through each letter of the word, test if it's a consonant. How will you do that? I would create a list of consonants.. (Another Array! Too many Arrays you might think right?) and try to 'match' each letter with that 'array'.

4.1 Now if the 'letter' doesn't match with any item listed in 'consonants' array, do nothing. If it does match, substitute the consonant following the rules given from the problem.

6\. Now we need to 'join' our letters together, with our substitutions.

7\. Then we need to join the 'words' together adding spaces in between to re- form the phrase.

8\. Then we need to print the final output.

That's a first version of this program which you can optimize later on... Until you end up with something that you like.

Later you might add exceptions and checks. Then you might find another way to make your program iterate through each letter/word faster using an algorithm (well python will do that for you probably, I wouldn't know as I am a ruby programmer but... I can guess it has already optimized functions for all these actions).

Good luck!

<comment><USER3> As another commenter (iovar) wrote, "try to solve this in your head with pseudo code do not overcomplicate it". There's actually nothing about this problem that requires splitting the input into words or storing the words in an array. You can just read one input character C at a time and either write CoC to the output (if a consonant) or copy C to the output (if any other character: vowel, white-space, punctuation, etc.). If a consonant character is capitalized, the one you write after the 'o' should be lower-cased. (Think of it as a Unix filter that copies a transformed version of its standard input stream to its standard output stream, like the Unix 'tr' command.)

Clickable link to original problem: [https://www.reddit.com/r/dailyprogrammer/comments/341c03/201...](https://www.reddit.com/r/dailyprogrammer/comments/341c03/20150427_challenge_212_easy_r%C3%B6varspr%C3%A5ket/)

</comment></comment><comment><USER4> Being a progtammer is being a problem solver. The language hardly matters.

Try to solve this in your head with pseudo code and do not overcomplicate it. It's a very simple problem. Also at your level, don't think of the language string handling facilities or other advanced Api's. Just control structures and arrays.

Finally, it's fine to ask for help when trying to build something, but when trying to learn, it's cheating yourself of the opportunity to have that moment were you actually understand the problem.

So my advice is, go back to solving the problem and don't come back here to see for possible answers until you have it and just want to compare solutions.

</comment><comment><USER5> A few things I would suggest to anyone learning to program:

1\. Seek out peers to learn with. You don't _need_ to go to school to find this, but it is a great place to start. Reddit, forums, local meetups, etc are all also good places to look.

The one thing I want to stress here is that you want quality over quantity. If you can find 1-3 people who you work with on a regular basis, that will have a much larger impact than meeting with 100 programmers. You generally want to find people who are around the same level as you are so that you can all learn together and teach one another. This is actually the most valuable aspect of college in my opinion - you start off with a group of peers who are (for the most part) at about the same level as you are, you make friends, and you progress at roughly the same rate. In doing that, you learn to teach one another, learn from each other, and you end up teaching each other nearly as much as the professor teaches.

If you do absolutely nothing else I mention, just do this. Find people to learn with.

2\. Learn from as many sources as you can. You already read LPTHW, so now go to codecademy and try the python track, look for (and attempt to solve) more daily challenges on reddit, go to [https://projecteuler.net/](https://projecteuler.net/) and spoj.com to find problems and attempt to solve them. When you run into trouble, use those peers from (1), or if you don't have any yet, post to reddit explaining where you got stuck.

You can even try doing different things - you can try creating a website and follow tutorials on that. The point is you shouldn't read a single book, but you should read everything you can get your hands on.

3\. Program constantly. Even if it seems like something you already know how to do, do it anyway. Make sure you can write that code without referencing a single book or snippet of code. If you have that, look for something else to code and see if you can do it. Tweak your code to see if you can solve the problem in another way.

My guess is if you aren't coding at least 15 hrs per week, you likely aren't coding enough. Programming isn't something you can do 1 day a week and get great at. People who get great at programming get consumed by it. Every great programmer I know spent 10+ hours every week working on side projects, learning new things, and simply coding. The bad programmers I know are the ones who only coded when they had homework or some other assignment, and the difference is astonishing.

4\. Don't just program mundane things (eg formatting HTML and CSS), but try to solve new problems. This is why I mentioned spoj, project euler, and suggested learning from as many sources as you can. Solving new problems will teach you how to be a better problem solver, and you also need to practice expressing your solutions to a problem in code.

Now if you truly want to solve that problem, feel free to email me - my HN username @ gmail.com - and I will be happy to try to help you break it into smaller parts and solve it.</comment>


North Dakota, socialist haven? - <AUTHOR> http://www.salon.com/2013/03/29/north_dakota_is_bringing_socialism_back_partner/

<comment><USER2> State-owned banks of state-owned anything have nothing to do with socialism. Enforcing the opposite, i.e., not allowing state owned companies at all is right-wing extremism.

Many free market countries do perfectly fine with a mixture of independent and state owned companies, even within the same sector (banking, public transport, medical care). Socialism has fuck all to do with it. It's called _pragmatism_.

<comment><USER3> Socialism has been redefined in the United States to mean state interference with any industry. But ownership of a corporation by the state is better labeled as Social Democracy.

The traditional definition:

1\. a theory or system of social organization that advocates the vesting of the ownership and control of the means of production and distribution, of capital, land, etc., in the community as a whole.

2\. procedure or practice in accordance with this theory.

3\. (in Marxist theory) the stage following capitalism in the transition of a society to communism, characterized by the imperfect implementation of collectivist principles.

\- <http://dictionary.reference.com/browse/socialism>

<comment><USER4> Depends if the state is democratic... The US government interferes all the time with private-owned industries by putting in place laws (e.g. anti-trust) and monetary policy. So this is socialism by the US definition...

There's neither free market today in any country, nor there has been one ever.

<comment><USER3> Socialists of the latter definition would argue the same stating there has never been a `pure` socialist society without interference from an authoritarian government.

It's utopian to expect either ideology to be implemented in `pure` form.

</comment></comment></comment></comment><comment><USER5> First of all, this has nothing to do with socialism. It does not matter which banks hold the money or issue _loans_ \- Federal _or_ private. Issuing a loan to a private company (using tax dollars or otherwise) is the opposite of socialism, which tends towards de-privatization.

Secondly the author seems to push for socialism based on bank-bailouts. There is nothing wrong with private banks, but there IS something wrong with bailing them out using government money. Private enterprise must be able to fail, regardless of how "big" it is, in order to represent a properly capitalistic economy.

In shorter words, real capitalism = no government bailouts. Government bailouts = crony capitalism.

</comment><comment><USER6> _Through its Partnership in Assisting Community Expansion, for example, it provides loans at below-market interest rates to businesses if and only if those businesses create at least one job for every $100,000 loaned. If the $1 trillion that now flows to Wall Street instead were deposited in public state banks in all 50 states using this same approach, up to 10 million new jobs could be created. That would effectively end our destructive unemployment crisis._

He lost me here. Something that works at a small/sample scale, doesn't necessarily (and almost certainly) work at a large scale. There is a finite number of jobs in a certain economy (depending on its capacity and size). Providing more or less money doesn't help create jobs.

<comment><USER7> I'm sure it doesn't scale perfectly. However, it is not unreasonable to think that lending small businesses money can spur job growth. If you need that 100k to expand your shop and pay for a new hire to help, it totally can work. This is how capitalism and economics work in general. Someone borrows money to start/expand a business. They hire someone to work, that person makes money that they then spend at other businesses, which then gives those businesses more money to expand and hire. If lending money didn't create jobs, we'd be back with horses and wagons.

</comment></comment><comment><USER4> Right-wing social policies + state-owned economy = fascism, or national- socialism (nazism), as Germans called it.

</comment><comment><USER8> Great article, but totally misleading title. It's about a secret Trans-Pacific Partnership (TPP) agreement which Wall Street may use to kill one very sound state bank.

</comment><comment><USER9> Some context: a libertarian think tank recently named North Dakota the freest state [1]. Salon ran an article on this disagreeing somewhat [2].

[1] <http://freedominthe50states.org>

[2] [http://www.salon.com/2013/03/28/libertarians_name_north_dako...](http://www.salon.com/2013/03/28/libertarians_name_north_dakota_most_free_state/)

</comment><comment><USER10> The article says that the bank creates jobs by offering below market rate loans if and only if the debtor creates a job for every 100K borrowed. And then the author concludes that if 1T of states money were deposited in the state banks under the same conditions then 10M jobs were created.

How can this possibly make sense to anybody? What if I offered a loan bellow market rates if and only if the debtor cures a case of cancer for every penny borrowed? 10 grand under the same condition would cure a million people of cancer... not.

<comment><USER11> The article makes the plausible claim (but perhaps incorrect) that Dakota is tapping less than 1% of the addressable market, and has shown a sustainable MVP.

The cancer example does not have these qualities.

<comment><USER10> No, the article makes a fantasy claim that an intent is as the same as the reality. This is the same magical thinking I observe on the Left routinely.

An intent to give a loan under certain conditions does not mean these conditions will ever be satisfied even less so that these conditions will be satisfied for any amount of the loan.

</comment></comment></comment><comment><USER12> Please. Enough with the essayists who don't understand something feeling free to wave their hands around as if they had something interesting to say.

As another commentator pointed out, the role of banking and the state has fuck-all to do with socialism. This is click-bait intellectual junk food. It's the third article in as many days on the front page of HN where the author has no idea what he's talking about. (There were probably more. I only clicked on a couple each day.)

Yes, I understand if you squint your eyes the right way "socialism" can be damned near anything. But I fail to see why yet another argument on the definition of socialism interest me as a hacker. Or a discussion about state- run banks that's framed in idiotic terms.

If there was something redeemable here, I'd let it go. Hell I'm extremely liberal about topics on HN. I think we can take on just about anything as long as we're civil. But I feel that this kind of stuff, where the subject and title are spun in such a way purposely drive out criticism about things we will never agree on? It just tears communities apart. It does not help build them.

<comment><AUTHOR> "Please don't submit comments complaining that a submission is inappropriate for the site. If you think something is spam or offtopic, flag it by going to its page and clicking on the "flag" link. "

<comment><USER13> But you can be punished for that. Flag enough links and you lose your ability to flag links. Perhaps that makes people reluctant to do it.

</comment></comment></comment><comment><USER14> Heh, I always find it amusing how Americans go berserk at the word "socialism". Marx would be proud :)

Yet at any rate, socialist policies are virtually non-existent in the U.S (well, except the oldies like 8-hour workday or paid vacations). The fear of it is so strong that people prefer to slave themselves out to the Wall Street overlords rather than allow a hint of _social_ in the sacred capitalism.

</comment><comment><USER15> And as soon as a bunch of other states follow suit so will the Wall Street-ers and then we'll all be in trouble again. The bank works not because it's state owned, but because it's small enough that none of the rape-and-pillage bankers work there. If California did something like that it'd be big enough to get on their radar and it'd blow up just like LTCM or the 2008 bubble pop.

</comment><comment><USER16> What does this have to do with tech?

<comment><USER17> On-Topic: Anything that good hackers would find interesting. That includes more than hacking and startups. If you had to reduce it to a sentence, the answer might be: anything that gratifies one's intellectual curiosity.

<http://ycombinator.com/newsguidelines.html>

</comment></comment><comment><USER18> What is called red in the US is laughable compared to the socialism going on in Europe. Discuss.

<comment><USER19> I'm always annoyed when Norway is called socialist. It's social democracy (which I think could be called socialst-capialist democracy). I think the same applies to many european countries.

<comment><USER18> In Belgium, if you have studied engineering at university for 5 years, you get a pay not that much higher than those who immediately start working without university, at least in technical/programming jobs. It's, after taxes are removed, not that much higher than the minimum wage in fact. Except that you have had 5 years less of pay due to the studying. You also pay 60% income taxes, when taking everything into account. And where does it go to? Definitely nothing that benefits the people who actually work. Definitely not roads and other public infrastructure, because when driving from another country into Belgium you immediately notice the difference in road quality and trains are unreliable. If those who want to work, those who study to work more complex jobs, do not get appreciated, while not working gives you benefits, and in some cities they have a "tolerance policy" for criminals, then tell me how that isn't socialist. Quality of schools is dropping, because there is more equality if the curriculum is lowered. They still call Flanders a "knowledge economy". I think they're not seeing something.

<comment><USER20> "In Belgium, if you have studied engineering at university for 5 years, you get a pay not that much higher than those who immediately start working without university, at least in technical/programming jobs."

And in the US, whatever extra pay you get by virtue of having a degree gets eaten up by the loan debts...

<comment><USER11> Sshh. Benefits that I get are human rights. Benefits that other people get care socialism.</comment></comment></comment></comment></comment>