News for hackers. Stuff that matters.

nousermane

Re:JMAP – a much needed modern email open standard on Tuesday May 30, 2023 @02:53PM (#36128965)
Yep. If you go and register a new gmail account today, there will likely be no option to enable IMAP access for that account, altogether.
Re:You can serve static data over HTTP on Tuesday May 30, 2023 @04:37AM (#36122497)
> glue together some massively bloated thing that they have absolutely no understanding of

Relevant: https://xkcd.com/1988/

Re:Clever Code Considered Harmful on Monday May 29, 2023 @06:34AM (#36112576)
> writing "return condition" instead of "if condition then return true else return false end"

> using the conditional-value ("ternary") operator in any capacity

Looks like author of some code I had to review recently, had that among guidelines. Said code was replete with:

  if(function_that_returns_boolean()){
    return true;
  }else{
    return false;
  }
...and...

  if(foo()){
    return true;
  }else{
    if(bar()){
      return true;
    }else{
      return false;
    }
  }
Re:Return oriented programming on RISC-V – Part 1 on Friday May 05, 2023 @08:14AM (#35828246)
I don't get it. When designing a new CPU architecture, it would be trivial to add a check, after executing a return, if previous instruction was a call. Then fault if it wasn't.

Minimal performance penalty (certainly less than all that "Pointer Authentication" malarkey). And would eliminate 95% of gadgets, including most all of short, easy-to-use ones.

Or am I missing something?

With newer android versions, you might want to check the "disable adb authorization timeout" option too. Otherwise, phone will "forget" your computer's adb key after a week.
Re:Electricity Prices by Country on Saturday April 08, 2023 @04:36PM (#35497358)
Indeed.

Don't see Netherlands in either TFA of your source. Over here, current average consumer price is ~68 cents per kW*h (€0.409 base price [1], plus €0.1524 energy tax [2], plus 21% VAT)

[1] https://www.energievergelijk.nl/energieprijzen/stroomprijs

[2] https://www.anwb.nl/huis/energie/energiebelasting

Re:Fascination of Awk on Friday March 24, 2023 @09:49AM (#35289053)
That is quite nifty implementation of reverse HTML escaping. But in python that could be done with much less work:

  import html
  print(html.unescape(foo))
And the best part - you don't need to debug/update the (g)sub list every time you stumble upon new weird &whatever; too. And there are a lot of those out there:

https://www.freeformatter.com/html-entities.html

Hug of death from HN visitors.

For fellow website admins, this is your regular reminder to use static site generators, where possible, and server-side cache where not.

Yep:

  $ cat foo.tsv

  name    foo     bar
  Alice   10      8888
  Bob     20      9999

  $ cat foo.tsv | sqlite3 -batch \
    -cmd ".mode tabs" \
    -cmd ".import /dev/stdin x" \
    -cmd "select foo from x where bar > 9000;"

  20
Re:Show HN: My Failure Resume on Thursday March 16, 2023 @12:29PM (#35184256)
> work long hours, under stress

Sounds like a recipe for getting utter garbage out of the door.

This reminds me of (now deleted) twitter thread where IE 4.0 developer was retelling account of engineers taking heavy personal toll - working 16 hours a day, sleeping in the office and ruining families - all for sake of shipping product on time, with full features.

Punchline is - many users hated IE 4.0, and for MS themselves, that product brought little else, than attracting some pretty heavy antitrust scrutiny.

Compilation is not some sort of watershed, it's a spectrum - on one end you have gigantic codebases that are rebuilt at once, taking many CPU-hours each time - Android being such behemoth for example:

https://source.android.com/docs/setup/build/building

...somewhere in the middle, there are software components small enough to be complied in a second or two, so you can do things like do away with DSLs and complex config files, and instead just change source code, recompile, and restart - every time configuration change is required, much like you can do with "interpreted" language code:

https://dwm.suckless.org/customisation/

...and all the way on the other end - there are JIT compilers, where "rebuild" is not a (separate) thing at all - just a number of small pauses spread throughout runtime.

Talking about tricks to make python faster, there is an interesting one that is essentially exact polar opposite of what Nuitka does:

Micripython's "viper" just-in-time compiler. It can only be applied to one function at a time, restricts what you can do in such a JIT-ted function quite severely, but resulting speed is pretty much native:

https://docs.micropython.org/en/latest/reference/speed_pytho...

> tried qemu, and spent many days trying to figure out the correct set of parameters

It's really not that hard, once you get used to it. Or, if you rather not spend that precious time, there is a GUI tool that would configure those parameters for you:

https://virt-manager.org/

Bonus: once started with virt-manager, run "ps ax | grep qemu", et voila - you have your qemu parameters, ready to copy-paste, should you wish to run exact same VM later from a script, or something...

Re:Understanding British Money: What's a Quid? A Shilling? on Saturday March 04, 2023 @03:34AM (#35019271)
> a Ton for 100

Over in the Netherlands, "ton" is a similarly semi-obscure reference for 100_000 (hundred thousand). I wonder is that's coincidence or borrowing.

Re:Today I discovered an xterm feature by mistake on Friday March 03, 2023 @04:09PM (#35015021)
To search very long texts by the "text shape". Same idea as some popular editors show on the right, next to the scrollbar:

https://www.ultraedit.com/wp-content/uploads/2023/01/ue-img-...

Re:Bizarre and Unusual Uses of DNS on Sunday February 26, 2023 @05:36AM (#34944528)
That's clever - let PKI (via letsencrypt or other ACME) deal with trust, by getting a certificate there.

It's a shame that OpenSSH can't use those directly. "ssh-keygen -i" can import individual keys, but alas - SSH certificate signatures are generated differently from X.509 certs.

Re:Shrinkflation, SanDisk Style on Wednesday February 15, 2023 @05:25AM (#34802020)
Unlike RAM, where you always get exact power-of-2 number of bits, modern flash storage normally ships with defects, plus error-correction codes to deal with those.

Number of defects vary. Chips coming from the same factory, even same batch, will have different number of defects, and will be binned accordingly.

Devices with larger (but manageable) number of defects will simply have larger ECC region reserved - leaving smaller space to show to host computer. OP's new USB stick is like that, that's it.

Same kind of basic programming that was "threatened" by no-code/low-code solutions before that.
> given the right prompts and constraints

Yep, that seems to be the key, and some realized that already: https://news.ycombinator.com/item?id=34463061

You'd probably want to first check that /etc/resolv.conf is a real file, first. SystemD has a nasty habit of replacing it with a symlink. That prevents "chattr" trick from working.
Element names in different languages are weird. Element "N" (nitrogen) in Germanic languages has remarkably folksy names, what could be translated as "suffocating stuff" - "kväve" in Swedish.

And conversely, same languages call element for "K" - "kalium". But English goes for for "potassium", from "potash", mineral name.

Re:Samsung bets on MicroLED and 8K for its premium 2023 TVs on Thursday January 05, 2023 @07:38AM (#34258881)
Talking about energy efficiency. In GP's linked article, power consumption for one such TV is given as:

  186 kiloWatt * hour / (1000 * hour)
What are hours doing here? Same for 1000 multiplier? Whole thing just says "186 watts", right? Or am I missing something?
Re:Relive: 50 years of C, the good, the bad and the ugly on Friday December 30, 2022 @09:12AM (#34185135)
> Linux kernel is written in C

Not exclusively in C, not anymore: https://docs.kernel.org/rust/index.html

It might take another decade for a C-free build to be possible, though.

Me too - never met a person that commits an immigration+welfare fraud. There are some well-documented historic precedents, though. For example:

https://nl.wikipedia.org/wiki/Bulgarenfraude (in Dutch, google translate does a passable job)

Re:The X11 Conservancy Project on Sunday December 25, 2022 @08:22AM (#34127020)
Terrible name indeed.

That being said, are we at that point yet, where X11/X.org server implementation enters firmly into "legacy" software category, and special conservancy effort would be required to keep it alive?

[0] suggests that Xserver is doing well for now - newest version (21.1.6) was released just earlier this week.

[0] https://www.x.org/releases/individual/xserver/

Re:Cash must be king, Italy PM Giorgia Meloni tells shoppers on Friday December 02, 2022 @03:46AM (#33828249)
In addition to tax-dodging, or selling off-the-books, there is one other, small legitimate reason for a vendor, to avoid card payments:

Most banks/payment processors would charge a fixed amount per small transaction. Amount varies a lot, but as an order of magnitute, say - €0.15 or something like that. This means customer that bought cup of coffee for €1.50 and insists on paying with a card, will cost vendor whooping 10% extra (it is not allowed for vendor to pass on card transaction cost to customer).

Of course, for a larger purchase, €30, €60, and more - transaction charge is negligible.

Re:Tiniest x86-64-Linux emulator on Sunday November 20, 2022 @05:27AM (#33679839)
I wish more apps would be like that - thin, efficient glue logic around system calls and standard libraries.

Many of real-world ones, especially "desktop" apps, are not like that at all. At times you'll get an electron or qt5html app that run Opus codec, DSP algorithms (echo cancellation) and custom cryptography inside JIT-ted javascript, and regular recent x86 CPU is barely fast enough to run it. Zoom Linux app is like that, among others.

You're right, but I'd argue this problem is already here.

Thanks to glaciers melting, earth rotation is (temporarily) accelerating. Because of that, positive leap seconds, regular before, didn't happen since 2017 - so there could very well be (recent) software out there that has that code-path broken, and nobody noticed yet.

And due to exact same geophysical effect we might see a negative leap second - something that never ever happened before. What are the odds that every single piece of software gets that one right?

TAI - atomic clock, ignores earth rotation.

UT1 - based on Earth's rotation only, strictly 86400 seconds per day; length of each second varies; takes a heck of a lot of effort (and time) to measure accurately.

UTC - has same length of a second as TAI, but (for now) tracks UT1 to a precision of +/- 1 second. To achieve that, can have days that are 86399, or 86400, or 86401 seconds long.

None of 3 is planned for scrapping. The only change discussed in TFA is to fix UTC day to 86400 seconds (at cost of letting it drift further away from UT1).

...but UTC is still offset from TAI by 37 seconds. Any plans to do anything about that, I wonder?

Older »