Hacker Newsnew | past | comments | ask | show | jobs | submit | jodrellblank's commentslogin

leftpad was a focused custom implementation of a specific feature, instead of a library full of generalized functionality. At the time it was pulled, the leftpad code (JavaScript, Node, NPM) was:

    module.exports = leftpad;
    
    function leftpad (str, len, ch) {
      str = String(str);
    
      var i = -1;
    
      ch || (ch = ' ');
      len = len - str.length;
    
    
      while (++i < len) {
        str = ch + str;
      }
    
      return str;
    }
A newer version was: https://github.com/left-pad/left-pad/blob/master/index.js which cached common cases and improved on the loop performance, before String.prototype.padStart() became a thing https://www.npmjs.com/package/string.prototype.padstart

Both old and new versions return a string longer than `len` if the padding char is multiple characters, e.g. leftpad('a', 3, '&&&&') will be longer than 3. That feels like it shouldn't happen.


I realize I may have made it seem like I was saying leftpad was a general-purpose library. My aside about it was to note that even widely used libraries can still have bugs. That’s orthogonal to their scope.

That's almost the first literal exercise with strings you'll learn with "The C prog lang 2nd ed" ebook. One of the most trivial cases among writting a word/space/tabs counting program (wc under Unix).

> “My gut feeling on this is that this is either resolved in hours (they have airgapped backups and can be working as soon as they can spin up new servers)

What good is having airgapped backups and spinning them up, if they are instantly vulnerable to the same attack again?

It does depend on what the attack is, but how do people approach that scenario?


That's an interesting question and one I'd like to know an answer to as well.

Have you seen Linus Torvalds' comments on ZFS from 2020?

https://www.realworldtech.com/forum/?threadid=189711&curpost...

".. there is no way I can merge any of the ZFS efforts until I get an official letter from Oracle that is signed by their main legal counsel or preferably by Larry Ellison himself .. Don't use ZFS. It's that simple. It was always more of a buzzword than anything else, I feel, and the licensing issues just make it a non-starter for me. .. The benchmarks I've seen do not make ZFS look all that great. And as far as I can tell, it has no real maintenance behind it either any more, so from a long-term stability standpoint, why would you ever want to use it in the first place?"

BTRFS: RedHat has removed all support for BTRFS and deprecated it: https://access.redhat.com/solutions/197643

BTRFS, "Linux's perpetually half-finished filesystem" by ArsTechnica: https://arstechnica.com/gadgets/2021/09/examining-btrfs-linu... with many problems still unaddressed in 2021 dating back to 2009.


I definitely understand why he doesn't want to merge it in and risk potential litigation from Oracle, but I think he's kind of wrong about the rest of what he says.

I don't know what people on Solaris use, but I'm pretty sure everyone in the Linux and BSD community is running OpenZFS, which does get frequent updates and has been pretty stable as a kernel module for quite awhile. My main server in my house is running a RAID-Z2 on Linux and has been for more than six years, and I haven't really had any issues. I run scrubs regularly and things seem to work just fine.

I do wish that Oracle would give written permission to let Linux include it into the kernel, since I think it would make it easier to run ZFS on root (which I don't bother with, I just use btrfs on root and that's fine for single-drive systems, like a laptop).


It isn’t about the hacker ethos; in the 1970s Pong was the arcade game. In the 1980s there was room for Pong in the home, on Atari and Amiga and Commodore64 and Spectrum. In the 1990s there was room for Pong on PC, in CGA, in VGA, in multimedia, on CD-ROM. In the 2000s there was room for Pong online and mobile Pong and Pong in emulators of older systems.

Pong is a placeholder for all software, there.

Anything one person could do, has been done over and over. Except things that only Fabrice Bellard could do, progress now needs a team of people and a longer time horizon and a large budget. nobody is satisfied with Pong anymore and if they are they already have as much Pong as they need.

We’re already in Vernor Vinge’s age of programmer-archaeologists.


My comment from 3 years ago still something I agree with https://news.ycombinator.com/item?id=34925145

https://old.reddit.com/r/NoStupidQuestions/comments/x7btd6/w...

In this context it means the alt-right manosphere who 'woke up' to realise that there's no such thing as love, caring, a monogomous committed relationship; that women are conniving shallow cheaters, and that your goal as a 'real man' is to sleep with as many female-objects as possible, no matter what it takess. Your tools are deception, negging, (insincere) flattery, looksmaxing, etc. to present as a 'high-value Alpha male' without actually having to develop a personality or think about others or anything difficult. A book on slick talking influencing people sounds like it fits into that world.


I don't think the modern "anti-capitalist" trend is disparaging "performing a skilled role that's useful for your tribe". It's disparaging various of these things:

- being arm-twisted to perform a low-skill, low-utility, role because economic weirdness and bad luck makes it the only work that you can get. Your tribe could use your <furniture making skill>, but it's cheaper to import furniture from China, so tough. Your tribe might like your music, but you aren't as good as Adele, so shut up. You could grow decent fruit but it doesn't pay well enough for you to afford the land to do it, and farms using illegal migrants can undercut your work, so find something else.

- systems parasitically exploiting your desire to provide useful work, to extract maximum value from you beyond what is satisfying and fulfilling, while treating you as disposable waste. You like cooking? Become a chef for 14 hours a day including evenings and weekends, or get out. From Amazon warehouse workers to programmers in the video game industry; intense grind, burnout, fired. Tribes don't tend to do that to people they value.

- systems distorting skills and responsibilities, e.g. not providing good tools, Kafka-esque bureaucracy, firing people in your 'tribe' at will, having your day micromanaged so your skilled work is entirely at the behest of other people, taking away agency from your work, demanding lower quality but faster, demanding higher quality and faster, demanding higher quality and paperwork, so that even if something is using a fulfilling skill, it actually doesn't feel that way.

- removing options to do multiple things; a job is usually a reduced to one role from day start to end. There's not much room for someone who is the local baker, tends the canal lock, sells eggs in the market, and does mountain rescue or whatever.

- taking over your life; e.g. controlling your days off, providing your healthcare, owning all the land so there aren't 'commons' you can opt to live off, lobbying and bribing the lawmakers, mandating 37 pieces of flare, setting your start and finish time, making you justify sickness, demanding you be on-call or available at night.

Consultants with high-demand skills still have some opportunity to avoid this, but huge numbers of people don't.


> "China is doing R&D on a partial-vacuum train (basically Musk's hyperloop thing) with a target of 1,243 mph"

When the vacuum fails - mechanical failure, human error, natural disaster, attack - air is going to rush into the tube. The speed of sound is how fast air molecules move, so train doing 1243mph might hit into a wall of air coming the other way at 767mph for a 2000mph collision. Don't think "wind isn't that fast", think vacuum implosion[1][2]. The weight of 60+ miles of atmosphere pushing down trying to force air into the tunnel. The principle that moves atmospheric steam engines. The train will then be blown backwards into the train coming behind it for another 1000mph+ collision.

This will be the Hindenburg of the Hyperloop.

[1] https://www.youtube.com/shorts/j-s5Ut5cm50

[2] https://www.youtube.com/shorts/if9xxrRouRY


> "I remember the book saying something like "a person's name is the most beautiful sound in the world to them.""

Nobody made fun of my name particularly, it's not like anyone famous, I just don't like it very much. I don't call myself by my name in my head, or on the internet. For most of my life my friends and coworkers had nicknames for me and I prefered that. I associate my name with official paperwork, formal situations, negative situations, aquaintances, and salespeople.

Perhaps because of this I have a bit of fixation on names (people, places, and products) and judging them to sound good or bad. Some names sound great or fine and it's no surprise to me if 'Robert' likes his name and likes hearing it. But I struggle to imagine that people called 'Helpless' or 'Abuse-not'[1] thinking those are the most beautiful sound in the world.

[1] https://slate.com/human-interest/2013/09/puritan-names-lists...


When CEOs and shareholders take all the money out of a company while doing none of the work, you think it's fine. When workers do the work and get the money, you think it's "bleeding the company dry".

Unions are one of the more effective ways for workers to fight back against "divide and conquer". Unions work to slightly adress the massive power imbalance between employer and employee; that's why the wealthy hate them and spread negative propaganda about them.


LOL the company is dead.

Management being the "buck stops here" people, being in their position because they claim to be good at running a company, being paid more to take responsibility for the safe running of the company. And now washing their hands of responsibility and blaming the employees.

Why are you being hoodwinked by this?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: