HNHacker News
TopNewBestAskShowJobs

pdenton

764 karma · joined October 4, 2020

submissionscomments
pdenton··on Heterosexual HIV diagnoses overtake those in gay men for first time in a decade
Numbers don't prove anything. Can you be 100% sure you're heterosexual? There's no scientific test for sexual orientation.

In reality, there are 2 kinds of orientations: bisexual, and closet bisexual.

pdenton··on How to know if you’re addicted
The worst of the bunch is tobacco. The effect is basically nothing, but it hurts ones health and wallet.

I've done cocaine, marijuana, mdma, speed, xtc pills, and some research chemicals. Protips: don't smoke, and never combine any two drugs. If you really want a certain substance, do at least the first session with someone sober to keep an eye on you. Never accept drugs from strangers and don't give in to peer pressure (which can be pretty tough at times when self-confidence is lacking).

pdenton··on On Cat Pictures
Came fur cute kittehs.

I am disappoint.

pdenton··on KDE: A Nice Tiling Environment and a Surprisingly Awesome DE
Wow, I installed the tiling extension and it's much more pleasant than vanilla kwin.

I first used KDE over 20 years ago, version 2.x. KDE 4 was awful, and I moved to Gnome. Since version 5 I'm back on KDE and most notably, the battery life of my laptop is twice as much! And it's configurable. And beautiful.

pdenton··on Cassowary – Run Windows Apps on Linux using a VM as if they were native apps
Waydroid https://waydro.id/
pdenton··on GTA 6 Confirmed
Meanwhile, re3 is still DMCA'd and development has stopped. I've already completed master and miami, going to play lcs next. Changing the source is half the fun! At one point, I tried to make the player ped move faster and accidentally ended up making non-player peds run stupidly wild. The police would glitch exiting their vehicle still sitting around as if they're driving. And that's just the stuff that went wrong. Being completely OP is something that did work and some missions were difficult regardless.

But if they want my money, they'll have to stop filing silly DMCA requests and open up the source at some point in the future (like ID did).

pdenton··on The Big Mac index: Our interactive currency comparison tool
Is the article hard to read for anyone else? The font looks terrible with jaggies everywhere. After removing "Charter" from the variable "--ds-type-system-serif" on :root, the page became legible. FF96 on void.
pdenton··on LibreOffice 7.3
I've been using LibreOffice since StarOffice 5.2 (which had its own taskbar).

It really is amazing. The best trick in Writer is to use the "Styles" sidebar and apply document-wide styles to the document like you would in CSS. This makes layout in large documents a breeze.

If you don't like the UI, there's "View > User Interface..." where you get to choose between 7 different UI layouts.

pdenton··on Retrospective and technical details on the recent Firefox outage
Ah, that explains it. Thank you. I recommend https://ffprofile.com/ which was posted earlier here on HN. Makes it easier to deploy Firefox with saner defaults.

You know I moved from Netscape 3.0 Gold to later versions, to Mozilla, to Phoenix, Firebird, and then Firefox. I tried other browsers but it's always a subpar experience for me. My only gripe is that they kept changing the UI.

pdenton··on Retrospective and technical details on the recent Firefox outage
I haven't noticed anything and I use Firefox every day. Nor have any of my clients where I deployed Firefox called. Is this because I always disable data collection in settings?
pdenton··on Pwnkit: Local Privilege Escalation in polkit's pkexec (CVE-2021-4034)
On Debian and derivatives, one can override the setuid bit permanently as follows:

    dpkg-statoverride --update --add root root 0755 /usr/bin/pkexec
pdenton··on Programming in 1987 versus Today
Thank you for your detailed explanation. I think this would be worthy of an HN submission of its own.

Also, I'd prefer a language with slow incremental changes because it eases the maintenance burden.

pdenton··on MusicForProgramming();
I'm too young to have witnessed the Amiga 800 but I love the sounds people produced with it. E.g.: https://jontracker.bandcamp.com/album/absolute-amiga-compila...

Also I like to play old stuff from modarchive.org in milkytracker like NOFACE.S3M

TFA music didn't play for me in FF95 on Linux unfortunately, just chirps.

pdenton··on web0 manifesto
The page uses HTML5 and it's responsive, so it's at least web 2.0
pdenton··on Ask HN: Do we need JavaScript web frameworks?
I build all my client side JS with this: http://vanilla-js.com/

(And a copy of the ECMAScript specification.)

pdenton··on How new Linux users can increase their odds of success
People are spoiled nowadays. Computers used to come with a set of books. When I started with GNU+Linux 20 years ago, I read Running Linux 2nd edition back to back.

GNU+Linux worked just fine back then, and it still does now. KDE was already a thing. To start with computers, I'd recommend the GNU Manifesto. Free software is important. These days, anyone using a computer without a FLOSS operating system on it is just ignorant. There's been TV ads. CDs by mail were free. There are magazines. Arch has a wiki.

And to those who are willing to make their computer work for them again: welcome to the FLOSS community. Hope you enjoy it!

pdenton··on How to use dig
drill is a nice replacement for dig and it's packaged in most distros. Look for ldns
pdenton··on VPN for Security
All VPNs are terrible, except the ones you create yourself with your own hardware on premises you can trust.

My advice to you would be: defense in depth. Get yourself a good firewall (e.g. pf). Follow security best practices. Be diligent. Keep separate computers for separate tasks. Omit binary blobs as much as possible.

You can practically consider yourself already owned these days.

pdenton··on A Website for Learning Vim
Thanks, but I'd rather spend the $25 to help poor children in Uganda.
pdenton··on OS X-KVM: Run macOS on QEMU/KVM
Quickemu already does this and many more operating systems too. https://github.com/quickemu-project/quickemu
pdenton··on Making Websites Small
Nothing saves as much as just writing the HTML, CSS, and JS by hand. No build step or anything but an editor. No need to minify anything, keeping it nice and simple.

Responsive images are kind of funny in the sense that my webpages are nearly twice the size on mobile vs my laptop. The screen may be smaller, but the CSS pixel ratio is 1 on my laptop vs 3 on an iPhone.

pdenton··on Firefox is the alternative to a Chrome hegemony

    > Mozilla need to [...] build a new browser
See The Book of Mozilla, chapter 11.

    >and a “browser toolkit” to let other people build their own
XULRunner was essentially this.
pdenton··on Show HN: I made a movie recommendation app based on your mood
Oh this is good! Thank you and your dad!
pdenton··on My Custom CSS Reset
This reset does too much IMHO, the rest of the CSS will become dependent on these styles. That said, I'm guilty of this myself. Here's mine: http://0x0.st/-7gE.css

To me, having reset styles feels like using unwanted globals in a programming language. Styles on html and body are ok though, as there's only 1 of them on a page.

pdenton··on GetElementById vs. QuerySelector
Interestingly, getElementById was 62% slower than querySelector on my computer with FF94. I reckon this is a moot issue as neither of these is likely to be a bottleneck for a web application.
pdenton··on PHP 8.1.0
* A database abstraction layer that's instantiated with a certain access level

* A hydrator/extractor that changes the type of the value it handles

* A task or job that has a certain priority to it

pdenton··on PHP 8.1.0
That was easy to test, and no. class_exists returns false for traits and they can't be used as parameter types. It throws a TypeError when I do that (even though the instance I pass uses the trait).
pdenton··on PHP 8.1.0
If by "kinds" you mean abstract classes, yeah. I just checked, there's no special handling for those since requesting them from the container makes no sense. I suppose a constructor could depend on an abstract type and expect an actual implementation, though. I haven't thought about that use case actually, but it's possible to configure a substitute for this case. Other IoC containers may handle this one better, since you may want to have different implementations depending on the current scope.

If you mean classes with private constructors, those are technically illegal. According to the PHP manual, constructors must be declared public. The fact that private constructors work at all should be considered an implementation detail.

Breakage occurs when something is said to be a class, yet isn't a class but still appears in the parameter list of a constructor. The container would instantiate a ReflectionClass of whatever is being requested and pass that around. At some point it'll call newInstanceArgs either with configuration-provided arguments or with auto-wired dependencies. The first case could still work, but foregoes auto-wiring.

pdenton··on PHP 8.1.0
Question: does class_exists still return TRUE when given the QCN to an enum?

Because it's not possible to instantiate an enum, if one appears in the constructor of a class it'll break auto-wiring. I've written my own IoC containers and one fundamental assumption in them is that when class_exists returns true, it is what it says on the tin. Using a specialized factory would still be possible. I wonder if other containers would break on seeing enums as well, but I hope they fixed this because it's not mentioned in the breaking changes. The documentation for class_exists doesn't mention enum.

pdenton··on Modern PHP Cheat Sheet
Thank you. I don't need any of those, though. $immutable->getAttr() is easy to mock, easy to override, and allows for custom behavior (e.g. return clone $this->Attr).

Static return type, useful but since I use interfaces for everything it's not really needed. Union types, also not really needed because either 2 interfaces share a common ancestor or I'll have separate methods for different types. But most of the time, I encapsulate things behind interfaces that do one thing, so having different methods per type can often be avoided.

Named arguments are a pain for me since now I can't change parameter names anymore. This is particularly annoying with different coding styles in dependencies vs my own code. My code ends up not conforming to the coding standard that I've used since it was introduced (PSR-2R).

Exceptions as expressions is a nice to have, but exceptions in general are a thing to avoid doing. Not that things can't go wrong, not that chugging along in the face of errors is good, of course it's not. But if you have a lot of exceptions in your code, that's a smell of bad design. I've got 13 different exceptions used 20 times in total, over 4683 LoC on my current project. Mostly, whenever one of them is triggered, whatever I changed last was incomplete and led to an inconsistent configuration.

That said, your use case for PHP is probably very different. Especially since I don't care much at all about performance anymore. I used to, but CPUs are so much faster nowadays and PHP itself has improved.

← PreviousPage 3 of 5Next →