News for hackers. Stuff that matters.

ka0lin

You should add this to the Gentoo Wiki.
Or the Gentoo-one or Debian or even the Kernel docs regarding resume=<partition>. There are a few things to consider:

- it does not work on encrypted partitions since there is no way to unwrap any key at all

- with an active state originating from an encrypted partition gives any attacker the opportunity to manipulate the hibnerated system image

- hardening tools often recommend to turn off hibernation in the kernel completely because of #2 (and the implication that this would load any crafted image into your working memory)

- recent distributions create /tmp as a tmpfs/ RAM disk which makes hibernation impossible due to power loss of RAM in this sleep state, and /tmp could be the default if nothing else is specified

- partition parameters on kernel command lines rise and fall with modules available at boot time/ through the bootloader, e.g. GRUB or Lilo. It might happen that using UUID in the case of hibernation does not work in combination with certain bootloader versions

- hardware does not support the power down sleep state, e.g. Raspberry PI or has no peripherals connected triggering a boot process (BIOS does this upon pressing for example the shutdown-key on a USB-keyboard with this enabled in the BIOS which in turn requires the USB-ports to be monitored/ enumerated and powered which isn't the case for any Raspberry)

I've been using hibernation for more than a decade on different hardware and distributions but only on that drag-around low-fi laptop ingesting ycombinator, running IRC client or Liferea. I always use the swap partition for this and it has always been /dev/sda2 with 4GByte (currently 5.4.* for Arch, Gentoo and Debian). I trust Grub, currently 2.x but also worked back in the days with 1.x since it is a kernel parameter (and the kernel self-compiled with CONFIG_HIBERNATION=y and copied with a steady hand and a magnetized needle).

Re:Generating a Java program with 90% less code on Wednesday December 04, 2019 @04:51PM (#21707549)
> Using plain functions with slightly longer but globally unique names so many issues go away.

That makes me assume two things: you work alone and your projects don't exceed 5.000 (fivethousand) lines of code. Without some namespacing and an expected method length less than 100, more likely 10 lines than 90 or more, you end up with roughly 160 names. An average human knows 150 people, maybe by their name. And while you have friends or at least parents and grandparents occupying some of the »address sace« few of your methods will not be »at hand« for your brain.

And in case you already prefix your methods with something like io_write(...), db_query(...) and you hand in context-specific references like io_write with a sort of file handle and db_query with a sort of database connection I transform all this 1:1 in an OO-style language and back.

Re:Generating a Java program with 90% less code on Wednesday December 04, 2019 @04:40PM (#21707412)
I only flew over the comments but I miss references from the past like Software through Pictures (STP, from former Aonix, riding the wave of CASE-tools) or the even older block oriented software. The latter thought of objects forming blocks that offer or consume interface and join each other through matching like LEGO.

Even big companies like Rational tried their best to generate boiler plate code from UML diagrams. Also BPMN incorporated findings from the early days.

But after nearly 30 years of programming experience I know one thing for sure: when it comes to real use cases beyond counting letters in a string only dedicated generators or very limited general ones continue to work. If it were the other way around there'd be product turning natural language directly into at least a single formal one.

And every (Java-) programmer who still repeatedly writes down lines of code doing the same boring input-processing-output did miss at least aspect orientation, Java agents and this is the most powerful of all: ANTLR. Runs right away with your BNF-grammar from Maven or a plain JDK. But be warned, this is like any other complex craftmanship, you need to start with cleaning the workshop before you can operate the heavy machinery.

Re:Ask HN: What is key to good technical documentation? on Sunday September 08, 2019 @08:51AM (#20910259)
- Which problem will be solved by the software - What is the system's context - How to Build - How to Run

The rest is in the code. And 80% of all »projects« lack at least one of the points above.

Re:Ask HN: What is key to good technical documentation? on Sunday September 08, 2019 @08:49AM (#20910240)
Is this an improvement over for example the Eclipse foundation's pile of high level architecture, bug database and here be dragons-areas?
Re:Ask HN: What is key to good technical documentation? on Sunday September 08, 2019 @08:47AM (#20910233)
Proper, like good?