HNHacker News
TopNewBestAskShowJobs

YSFEJ4SWJUVU6

67 karma · joined December 10, 2016

submissionscomments
YSFEJ4SWJUVU6··on Antarctic Snow Cruiser
The engine actually only made 150hp, but luckily there were 2 of them.

Yes, they were certainly less efficient than modern engines. However, ICE engines have always had trade-offs between power output per size, mechanical efficiency and reliability, and for this vehicle the last one was certainly of most importance.

YSFEJ4SWJUVU6··on Beating C with one line of Brainfuck
That fwrite writes the contents of output to stdout.

output probably contains all the output that doesn't depend on input (which this program doesn't have).

YSFEJ4SWJUVU6··on Code Pages, Character Encoding, Unicode, UTF-8 and the BOM [video]
>since UTF-8 doesn’t have a “magic number” to identify itself, the convention is to use the BOM codepoint

Neither does any other of the hundreds of existing text encodings.

It's debatable how much of a magic number it's supposed to be anyway, considering that few people have insisted on having magic numbers in text files, and that you get the BOM at the beginning by simply naively converting a UCS-2/UTF-16 file codepoint by codepoint (and vice versa, enforce it to be there if you ever happen to do the conversion the other way around because of course you're conversion couldn't include that extra logic in it).

YSFEJ4SWJUVU6··on Code Pages, Character Encoding, Unicode, UTF-8 and the BOM [video]
BOM is only a problem with strict syntaxes, which robots.txt is not an example of. If the "consumer" simply ignores invalid or meaningless lines, you can avoid issues from invisible characters by not having anything meaningful on the first line of your file.
YSFEJ4SWJUVU6··on Gyrocar
>A motorbike will generally [...] brake faster than a car in a straight line (mostly because it's light)

That's generally not true. At best you'd roughly match an average car when balancing your weight perfectly; but typically you can only expect worse results when comparing the two.

YSFEJ4SWJUVU6··on Clang Format Tanks Performance
Yes and no. Technically that results in UB with many inputs with platforms that use a signed char type.
YSFEJ4SWJUVU6··on The 40% Keyboard
>Higher accuracy isn't the only reason, you'll get chronic wrist pain within a couple of months if the mouse movement comes from your wrist.

Or you could just move the mouse with your fingers. Other positives include requiring much less space and not looking silly flailing around. (My preference is maybe 1–2 cm corner-to-corner, with no wrist related issues a couple decades in; and obviously, mouse acceleration is a great idea.)

YSFEJ4SWJUVU6··on Intel disables Hardware Lock Elision on all current CPUs
> to avoid things exploding because a zero length variable might exist is a stupid and ugly hack.

That has less to do with POSIX compliance, as opposed to working around quirks with less-compliant historical implementations. Also, I think you'd have to dig pretty deep to find a test that doesn't support zero-length arguments; you'd be safe as long as you quote your variables.

The actual problem of ambiguity arises from variables that are also syntax, like '(', or '!', when using compound expressions (which you should avoid anyway).

  # this is bad (also obsolete)
  [ "$var" != foo -a "$var" != bar ]
  # this is good (and fully POSIX compliant)
  [ "$var" != foo ] && [ "$var" != bar ]
  # you probably don't need to care for systems where this was necessary
  [ "X$var" != Xfoo ] && [ "X$var" != Xbar ]
YSFEJ4SWJUVU6··on Going from macOS to Ubuntu
>10 years later, copy-paste is still a horrible user experience. Different apps use different clipboards :scream: Even for copying these commands from Firefox to the terminal with keyboard shortcuts (CTRL INSERT, SHIFT INSERT, as CTRL C has a different meaning in terminals), you'll need copy-paste fixed already.

IMO this thing is way overblown. What applications these days do not simply use primary and clipboard selections in a consistent way? (FTR I like them separate very much as I would hate to have my clipboard contents change by simply selecting some text.) Middle click is not a shortcut for Ctrl+V!

Ctrl-C is indeed used to send SIGINT to the foreground processes in terminals and thus terminal emulators, and the established alternative for terminal emulators is to replace Ctrl-C/V copy/paste with Ctrl+Shift+C/V (I think that's how even cmd.exe works these days). Copying and sending a SIGINT would hardly be a useful default.

YSFEJ4SWJUVU6··on JavaScript Is C
>I have to disagree about implicit functions not being a part of C anymore. I've yet to see one generate an error;

This is not really a debatable matter. There's an international standard for what is, and what is not a part of the C language.

Errors as you seem to understand them are optional for everything else except for the #error preprocessor directive. For all the other invalid C programs, only a diagnostic (like the warning you got) is required, and a conforming implementation is free to complete translating the invalid translation unit. I don't see why that would be an issue, as it's very easy to switch those warnings into translation errors if wanted.

YSFEJ4SWJUVU6··on JavaScript Is C
>yes some compilers don't give warnings by default for implicit functions

Broken or ancient compilers. That's as much C's fault as it's Intel's fault that Windows 10 doesn't run on Pentium MMX. Implicit functions are not part of C; they were gotten rid of back in 1999!

YSFEJ4SWJUVU6··on Beating C with Futhark Running on GPU
See https://git.io/JeEjB
YSFEJ4SWJUVU6··on Beating C with Futhark Running on GPU
>It might still turn out to be, if you see if you can get a faster C version of wc.

You definitely can, at least if you allow manually vectorized code.

On my system, with a 1.661GB file (256 times big.txt from the original Haskell post) GNU wc takes about 6.5s (real time), a stripped down version of Apple's implementation about 4.1s, and a single-threaded vectorized wc (written in C) only 0.27s. (These times are of course only with a hot cache. For reference, catting the same file to /dev/null takes about 0.18s.)

edit: corrected the time for the BSD-derived implementation

YSFEJ4SWJUVU6··on We posed as 100 Senators to run ads on Facebook. Facebook approved all of them
>We don't allow unlimited free speech, but we don't view that as censorship.

Speak for yourself. I certainly think blasphemy laws are certainly way past their due date, and more extreme restrictions (e.g. like in Germany, but notably not everywhere in Europe) definitely at least borderline on the dystopian side.

And as to what an average citizen might think: perhaps an average Chinese considers their “free speech” laws, or their closest equivalent, quite reasonable after having been taught so all their life. Europe could certainly do with freer speech.

YSFEJ4SWJUVU6··on Finland to end basic income trial after two years
Talking about disruptive things... to provide an unconditional monetary equivalent of the benefits any unemployed people are currently entitled to (rent, minimum income, supplementary welfare) to everyone, or even every adult would by itself cost more than the entire current government budget, including current welfare costs – so you would really need to rework the whole tax system. Disruptive, perhaps? Or very simple to go ahead and “just try it”?
YSFEJ4SWJUVU6··on Finland ends Basic Income trial
In Finland, all unemployed are guaranteed “free money” even if they choose not to seek employment. The difference from UBI is that this final security net, so to speak, only guarantees a minimum level of income – any earned wages (or existing wealth) directly affect the welfare payments on this level.

edit: the whole system is more complicated than this, of course, but the point here is that this safety net is permanent – you can not lose it even if you are unemployed for a long time (recently, a tiny reduction of welfare payment was introduced for those who do not meet certain criteria for activity; however, you are in any case entitled to certain level of income, and government-paid rent, etc., in any case.)

YSFEJ4SWJUVU6··on Time to rebuild the web?
You can watch uBlock's logger when using the web player to see what it does. AFAIK the blocking rules are imported from EasyList.

However, as far as user experience goes, I don't share your experiences at all – the web player is almost unbelievably bad, with frequently malfunctioning (disabled) player keys, volume slider jumping all over the place and common problems when resuming playback after a while. (Also, the desktop application has more features, including the ability to select multiple tracks to perform an operation on, and naturally the support for media keys.)

YSFEJ4SWJUVU6··on Newer C++ features can create a lot of system yak shaving
That's very unlikely to happen, ever. (Too many "int var;" out there.)
YSFEJ4SWJUVU6··on Schools Struggle with Vaping Explosion
Oh, I'm certainly under no impression that nicotine might not have any health benefits, but with various inconclusive research it's hard to assess the complete picture and net effect. I think it's partly this way because nicotine has been studied quite little disconnected from tobacco research. (It is my understanding that there is indeed no conclusive evidence of nicotine being greatly harmful to health, and I do use nicotine products myself.)
YSFEJ4SWJUVU6··on Schools Struggle with Vaping Explosion
I don't think it's quite that clear – however, I think it is considered clear that nicotine is nowhere near as harmful as tobacco smoke.
YSFEJ4SWJUVU6··on Tesla crash victim had complained about auto-pilot in same location
>Trains are perfectly capable for bringing me from A to B while I am sleeping for years now.

For a very limited subset of points A and B, though...

YSFEJ4SWJUVU6··on Avoid Else, Return Early (2013)
Why would you ever half-indent a block? For alignment you should of course use spaces (for whole alignment, not just the end, to be very clear).
YSFEJ4SWJUVU6··on Avoid Else, Return Early (2013)
Well, he shouldn't have, considering it's the other way around.. :-)
YSFEJ4SWJUVU6··on Omaha man ‘liked’ a tweet, then lost his job
A dictatorship like China raising the issue over Tibet is the equivalent of (an alternative universe) powerful Nazi Germany getting someone fired in the U.S. over liking a tweet about Jewish rights issue.
YSFEJ4SWJUVU6··on Tempe Police Release Video of Uber Accident
First of all, I don't think we are. Also, I live in a modestly sized European city of about 650k citizens (excl. metro), and even we do have some sections of road with 4 lanes in each direction, and in intersections, even more. I'm quite sure bigger cities have more of those, even in Europe.
YSFEJ4SWJUVU6··on BMW says electric car mass production not viable until 2020
I love how every time there's a discussion about car operating costs here, at least someone mentions oil changes as if they were a substantial part.

Many European cars with a long-life oil change program have oil changes as far as 18,000 miles apart. While I haven't averaged quite that high, for me oil changes still account for only about 2% of the fuel costs. With any new car the depreciation in value dominates most other individual costs anyway. (Also, a modestly sized car might only need one brake service if you use it for, say, 12 years, although this is more dependent on driving habits.)

YSFEJ4SWJUVU6··on Tempe Police Release Video of Uber Accident
You've never seen a median-divided road that has two lanes going to each direction? Have you actually ever been to Europe?
YSFEJ4SWJUVU6··on Self-driving Uber car kills Arizona woman crossing street
How often? How often you'd manage to go through the intersection before the lights change, and gain even more?

(edit: just to be clear, I'm not in support of speeding, however I do value good logic.)

YSFEJ4SWJUVU6··on Quick explanation of how a Kalman filter works
The page breaks back button.
YSFEJ4SWJUVU6··on Is vitamin D really a cure-all, and how should we get our fix?
>Why don't they have a mortality rate affected by skin or other cancers?

Do you have a source for that? A source that compares people from further North living in the Mediterranean region compared to further North for skin cancer?

Page 1 of 7Next →