HNHacker News
TopNewBestAskShowJobs

Elv13

763 karma · joined December 7, 2011

submissionscomments
Elv13··on Audacity 3.0
It runs like crap, that's why it isn't supported. But if really, really want to make it work, you can have your app make a surface, put a cairo surface in it, then render GTK there. I suggest you don't waste any time on this. Mozilla, Google and Samsung had many people _each_ assigned to fix it at some point. The Google gave up, bought Skia. Then Mozilla also gave up and used the now Open Source Skia. Samsung somehow kept poking at it for a few more years until they dissolved their Open Source division and scaled down Tizen. At some point Samsung make a Vulkan backend for unknown reasons.

With Qt 4/5, there is an environment variable, to play with. It sill runs like crap and is now deprecated.

edit: Of course, GTK4 have "real" backends for both Vulkan and OpenGL. They implement scene graphs like QtQuick rather than building a big bitmap like GTK2, GTK3 and QtWidgets.

Elv13··on Audacity 3.0
https://www.cairographics.org/backends/ GTK -> GDK -> Cairo -> OpenGL
Elv13··on Audacity 3.0
Same username on GitHub (public email there) and Reddit. I admit I am slowly losing the battle with my indox, so better ping on both. I would be glad to provide help where I can.
Elv13··on Audacity 3.0
I have done it several time professionally (Motif, Qt3, GTK, etc, but not wx) to QtWidgets or QtQuick. It's been a while and I pivoted to other industries.

It's a potential project killer, but it can be done. The trick is to wrap all your objects in QObject classes. You keep the old UI code as-is as long as possible.

The first Jedi mind trick is to reverse the event loop. Qt supports GLib2 loops, but only as long as they are created by Qt. So you create a dummy QCoreApplication, start the event loop. Then you coerce GTK into using the glib event loop Qt created.

After that, you populate your QObjects I mentionned above. The `Q_PROPERTY` stuff is the important part. It *has* to be fully implemented for QML to ever work. For Qt5, you need to use Qt containers. This means porting your lists and other C++ types (or glib types) to Qt. For Qt6, I think you can get away with some of that, but not Qt5.

Then, make all the signals work. It is important that all properties have signals. The signals must be reliable. QML heavily relies on events for literally everything. Without events, your UX gets out of sync and crash.

The next part is models. Turn all list with selections to models. Don't try to render stuff using for-loops in QML, this is a terrible idea and will explode in your face. Qt Models are annoying to write (and get repetitive very fast), but reliable list models really greatly simplify the QML code.

When you have all those QObject to reflect your current codebase, you make a companion app. This is a small window (or LAN/Network smartphone UI using QtRemoteObjects).

Now you are ready for the UI. Add little features, one by one. Don't try to do everything at once. Again, as long as you can, keep the wx/GTK window alive and fully functional. Your app will look wierd with 1 wx window and 1 QtQuick window. However, having the fully functional old UI let you press buttons there and see the results being updated in QML. That let you polish/debug your signal/q_property code step by step.

Once you are "done" with your port, strip the UI code from the old codebase. Then refactor/clean the logic and turn it into a library. Then start merging your QObject shims and logic classes into a single class.

If you get there, congradulation, your port is complete. Time to annoy your users with a bunch of changes.

Elv13··on Audacity 3.0
(sorry, can't reply directly, marcan_42 comment is too deep in the tree)

> which tells me this isn't a simple pixel pushing problem but rather something more profound in Audacity.

That's probably because of the cursor animation (when you play). Audacity has to redraw the entire track widget each time the needle moves unless they implement special double buffering + special damage area slices. By default, Qt/GTK/wx are too dumb to understand layers properly. They will redraw the entire rectangle if you try to stack things with any transparency or non-rectangle clips. Even with proper double buffering, combining both frame buffers is still done on the CPU. That's 2x4x{width}x{height}x{fps} bytes up load to the GPU per second. for a 4k ARGB8888 video frame @ 60fps, that's like 4GB/s of raw transfer if you rasterize each frames in the CPU.

(disclaimer: former KDE dev)

edit: If you run KWin, you can enable the redraw compositor plugin and see for yourself which area of the window are repainted.

Elv13··on Audacity 3.0
Those "classic" UI toolkit as raster engines. Both GTK/2/3 and QtWidgets 4/5/6 have OpenGL backends, but they are slower than the raster.

This is because the state machine that drives the draw context is synchronous. Every line, pixels (or anything, really) takes some CPU cycles.

Newer toolkits (QtQuick2, GTK4, Skia-based-ones) are hardware accelerated. They are slower of standard DPI, but much faster on HiDPI.

So, yes, they cannot be as snappy on HiDPI, the number of pixel gets bottlenecked by the single thread performance of the CPU. Those barely grow year-over-year, while the number of pixel went up a cliff overnight.

Elv13··on Robinhood, in Need of Cash, Raises $1B from Its Investors
Stocks don't belong to you, unless you have the actual physical stock. Everybody borrow them from 3rd party who borrow them from 3rd party who borrow them from 3rd party, who actually lended them multiple time to short the stock, who borrow them from a 3rd party, who actually have the physical piece of paper in a vault somewhere.

I am not even joking.

And it's the same for transactions or your bank balance. The bank doesn't keep your money and give it back to you. At least, for banks, they are backed by the government and IMF. For stocks and gift card balance, I am not so sure.

Elv13··on Pidgin – A Universal Chat Client
On the contrary, the analogy is very good. The steam engine represents power. Power can be used for a limitless number of applications. The steam engine is the CPU. You input energy (pressure/electricity) and extract work (mechanical/computational).
Elv13··on LibreSSL Languishes on Linux
Gentoo has USE flags to use gnutls+compat_layer rather than openssl. This is/was possible because they was a strong-ish push a decade ago by GNU aligned projects to force this down the throat of each package because OpenSSL had a problematic license exception deemed incompatible with GPL by some. The heathbleed fiasco helped this push. Then with LibreSSL, diversity survived a bit longer.

However, now that OpenSSL work to solve "all the problems" is starting to get into releases distribution actually can use (OpenSSL 1.1.1*) and will eventually be able use after extensive effort (OpenSSL 3), I don't think this support for TLS diversity will survive very long. The technical and licensing being solved, only the philosophical/political ones remain, which isn't enough for the large effort required to support multiple TLS libs.

Elv13··on Is there still somebody in the Cairo community who is able to make a release?
Says the one who made the best/most_complex open source one rather than use QPainter ;)

But really, QPainter suffers from a lot of the same issues as Cairo (and then some). The main "problem" with them is that they are CPU bound. Both of them have OpenGL backends, but they are not "really" faster. There is also the fact that the Qt Company doesn't invest in it anymore since QtQuick2 was released. Because of that, it doesn't get some of the newer Skia features. So Cairo/QPainter are pretty good at server side rendering. Qt was never popular for that use case. Cairo used to own that market, but it's usage is declining due to the maintenance inactivity issues. Also, once upon a time Cairo was used in Firefox and Chrome, so it's SVGs tend to be rendered more accurately in modern browsers than Qt ones.

Skia itself is an unsustainable library to depend on. Its API and behaviour isn't stable. Google doesn't really care about non-Google use cases, so the CMake is broken 90%+ of the time. It adds a large maintenance burden on projects trying to use it. Distributions also hate it for being impossible to package reliably. In turn, it makes hard for smaller projects to migrate away from Cairo because users have an easier time getting their hands on Cairo than Skia.

(bias disclaimer: I worked with both as a KDE dev and as the AwesomeWM co-maintainer, a Cairo based project. A lot of the recent unreleased Cairo commits originates from the AwesomeWM community, but not from me)

Elv13··on A68 iceberg on collision path with South Georgia
> The test ban absolutely would prevent it

Not quite. The Soviets used nukes with USA blessing (and on-site monitors) on several occasions for geo-engineering jobs. Mostly to plug burning oil wells. The CTBTO would not be happy, but depending on who built the nuke and how deep it is in the iceberg, this is boilerplate approvable.

https://en.wikipedia.org/wiki/Nuclear_Explosions_for_the_Nat...

That being said, it's silly to nuke an iceberg and it wont achieve anything. The current will push the chunks back together and the shockwave will kill all the penguins.

edit: Another "funny" USSR use case for fission reactors https://en.wikipedia.org/wiki/Subterrene . The mind boggling detail is that apparently it just worked (until it didn't).

Elv13··on Blender Conference 2020
Out of the top of my mind:

* Gets good enough, but not great. Then most contributor lose interest and the pace slows. It makes the original roadmap impractical and more devs lose interest, which spirals into a dormant project (Inkscape)

* Maintained flawlessly, but no new groundbreaking features get added and there is a slow exodus of users toward new-shiny until it is a perfectly bug-free irrelevant piece of code (most JS stuff, GnuPG, some crypto libs, OpenBSD).

* Maintained into the ground by aggressive/oppressive/elitist/cultist/dogmatic core team followed by a split of the community (pre re-merge of glibc/eglibc, GCC/EGCS, ffmpeg/libav, Gnome/MATE/Cinnamon/Unity, Vim/NeoVim, all of Suckless, most of GNU)

* Fancy/overkill roadmap made at a time when there is plenty of contributors, but so hard to achieve most of them give up before the finish line (KDE4, GIMP 2.10)

* Unresponsive/exclusive community toward new contributors and/or SJW attempts accidentally FUDding a previously functional community (lets not point fingers and start a flame war)

* Unwillingness to break things or pay up the tech debt in order to stay relevant (EMACS, pre-LLVM-era GCC)

* Break everything consistently and often and/or remove your contributions because of a dogma (Gnome)

* The Free-software people and the commercial contributors revolt against each other (OpenOffice/LibreOffice/StarOffice/CollaborraOnline, OwnCloud/NextCloud)

* Misguided attempts at making money by breaking things for your users (GhostScript, eLive, Mepis, Mandrake, every project who moved to AGPL)

* No attempt at ensuring the project can exist without its founder (CentOS, all single-person-army projects out there, all BDFL who refuse to let go when they lose interest)

* Sabotage (ion3, ffmpeg, Cyanogen)

* Suicide by committee (many Apache/Eclipse foundation projects like Apache OpenOffice)

* Make a major incompatible upgrade with no clear migration paths (Python, GTK, KDE, Gnome, AwesomeWM)

* Promise a major upgrade, tell your users to wait for it, then backtrack (Perl)

* Maintain multiple branches of your software forever until you fragment your user base so much you compete with yourself and lose to new-fancy (OpenSSL, pre-rolling Firefox, MySQL, most "enterprise grade stuff")

* crazy rebranding ideas leaving most of your users unaware of the new project (Apache OpenOffice, my own SFLPhone->Inutchuk->Ring.cx->GNU Ring->GNU Jami->Banji fiasco, KOffice).

Elv13··on Material Shell – A modern desktop interface for GNOME
Patches welcome :P

But really, someone went quite far a couple year ago. Unfortunately he lost interest before the finish line. There is no such thing as a WM port from X11 to wayland. It's a full backend rewrite.

The design that would have worked (after like 4 rewrite), but wasn't completed, was to have a WLroot process, then some custom protocols to talk to an awesome "client". This was a fork of the old codebase with the X11 code stripped out and the implementation of those little private protocols between the wlroot "server" and awesome "client".

Using this model, the event loops lived in different process and AwesomeWM could restart without losing all applications. It did render stuff, including the wibar and clients (without titlebars). But that's about it. It never got to the point you could dog-food it.

Elv13··on Material Shell – A modern desktop interface for GNOME
You can have both! https://github.com/material-shell/material-awesome

This was an earlier version of Material Shell based on AwesomeWM. At some point the author wanted more animations and custom menu handling. Those are 2 areas AwesomeWM doesn't really handle well.

Elv13··on Material Shell – A modern desktop interface for GNOME
(one of AwesomeWM maintainer here)

This is a rather common issue for all OS, but even more annoying for tilling WMs since it messes up with the layouts.

The good news is that a lot have been made to fix this in AwesomeWM git-master and more is coming.

What's there:

* If you set the `-- awesome_mode: api-level=5:screen=off` modeline at the top of `rc.lua`, all screens will be virtual rather than tied to a physical screen. In practice this means you can block and act upon physical screen removal. Previously, once the screen was gone, it was gone. Now you can either have full control or have the default handler

* Screen swap: You can swap your primary screen back yo your laptop screen when disconnecting. So at least you don't lose everything.

* Screen splitting: If you have a extra wide or double width monitor, you can split it in multiple virtual screens. This helps since it allows you to have the "main" virtual screen the same aspect ratio as the laptop screen. It means nothing moves when you switch back to the laptop mode.

* Full signals and handlers for everything: By default it's still not perfect, but at least there is sane ways to plug your own logic everywhere in the screen removal and addition process.

* Better mixed DPI: It is now easier to ignore the DPI X11 think it has and override it before the screen gets created. This way, you can ensure your laptop and main screen use something sane when in mirror/presentation mode.

* Tags (workspaces) have a `request::screen` to "save" them when a screen is gone. So you can send them to a screen that still exists without losing the layout.

What's coming:

* There will be rules to apply can screen changes (https://elv13.github.io/declarative_rules/ruled.screen.html). This will allow a declarative syntax to define the behavior on screen change.

* The ability to have "sets of workspaces" you can share across screens (XMonad style). This is an interesting solution to the problem. Since the same "state" can be shared by more than 1 screen, then adding and removing a screen doesn't destroy the state. However this is really complex to bolt on the current design and I have been trying for like 2 years to make it perfect and backward compatible.

Elv13··on China Launches a 'Reusable Experimental Spacecraft'
> To create power plants that use space as cooling and project power back?

Space is the absolute worst place for thermal power plant. 1) It's not cold unless you are in earth shadow. 2) You need to use EM radiation for cooling, which is like < 1% as good as thermal conductors cooling.

Elv13··on Building a Home Lab Beginners Guide
120mm + closed loop watercooling makes almost no noise. 140mm makes no noise (compared to background), but don't fit in the standard "U" format. 3U (ATX) can fit a full 120mm, but not a closed loop. 4U (ATX) take a lot of space, but the airflow and WC flow is easy to get right. I used to be a self employed embedded system (Linux) engineer and had to compile whole OS images all day long on air-gapped, on premise, systems, so I ran my own "semi-pro home lab" for a few years.

Another trick is to have 5v, 12v and 48v DC lines with silent PSU like Corsair RM series directly feeding some servers so they didn't have to use an internal PSU, that leaves only the CPU and GPU as "hot" components (and the NAS, but that's another story and a solved problem).

https://imgur.com/a/cGYxIPW

Elv13··on QTile – An XMonad-like tiling WM written in Python
> whereas awesome has virtual desktops that cover all screens at once.

(disclaimer: Awesome co maintainer here)

I am not sure what you mean. Awesome tags are per screen and can be moved to other screens (since pretty much day 1). Can you be more specific? In any case, I am slowly adding support for Xmonad style "shared" tags across screen, so I am collecting comments/use_cases on how to make tags better.

Elv13··on Ask HN: Any resource on how to repair MacBook logic board?
That's the "there is some wizard in the Internet that did it so many time they can get away with half the tools" part ;). The vacuum chamber is also required only for ipad/iphone/touchbar/apple_watch, not most macbooks.

IMHO, most of these projects end up with "I will totally do this" -> "I am blocked for now, but will come back to this tomorrow" -> "I don't want to lose parts, so I will put the pieces in a plastic bag and 4 ziplocks" -> "I need to move this out to clean my desk" -> "2 years pass" -> "what is that bag, oh, my broken laptop" -> "I will never finish this, there is some room in the trash I need to fill".

/me Looking in from of me and my old ThinkPad W541p stares back at me in pieces. (and yes, I dismantled it yesterday to replace the screen cable and cooling unit. Only to find out the new cooling unit has the wrong connector and fan voltage scaling despite being "a factory part for the W540p")

edit: The last time I did a MBP board was my 2007 Santa Rosa 15". I actually did reflow the GPU with a heat gun, but this was very scary. You move even a tiny bit and kiss the board goodby. I wish I had a reflow oven (I still don't have one big enough). BGA reflows are a nightmare.

Elv13··on Ask HN: Any resource on how to repair MacBook logic board?
https://www.youtube.com/user/rossmanngroup

But be warned, repairing a Pentium desktop motherboard and repairing a recent Apple laptop are 2 different leagues. I did repair a lot of capacitors / magic_smoke on old desktop/vintage motherboards. You just need an acceptable soldering iron (with real temperature control, not just any junk), a tabletop EE heatgun (not the ones looking like a hair drier), a solder suction pump, your eyes and your nose.

However for modern laptops, you need a digital oscilloscope, logic analyzer, microscope, large reflow oven, vacuum chamber a dozen screw drivers and 5-15k$ worth of professional tools. Good luck with that. In my case, I can't even get my hands steady enough to do the smaller surface mount jobs. There is some wizards on the net who did it so many time they can do away with half of the tools, but unless you did it 500x time on the same model, you wont.

Elv13··on Running postmarketOS on iPhone 7
The iPhone 3G and original iPhone both had Android ports. Back then the (internal) hardware was mostly off the shelf, so it was easier. Still, this is neat.
Elv13··on The Nucleon, Ford's 1958 nuclear-powered concept car that never was
The Russians claim to have made such a system. They also claim nuclear powered torpedoes. It is not 100% clear how far they really are. However, there was detectable accidents, so they are at least really trying. It ain't all bluff.
Elv13··on The Unreal Engine Wiki is now permanently offline
I am the co-maintainer of an OpenSource project called AwesomeWM. I took down our wiki years ago due to:

* Constant vandalism

* Dubious user created content rendering computer non functional

* Trolling edits to cause breakages to people copy/pasting shell commands

* SPAM

* Maintaining the wiki

Before that we forced users to log-in for edits, then forced moderator approvals for everything, then forced moderator approval for new account. Then gave up and retired the Wiki.

So no, wiki are not free content. They are a pain, especially when your community tend to have many trolls/hostile individuals like the gaming community. It's not "downright lies" all the time.

Elv13··on FCC will require phone carriers to authenticate calls by June 2021 [pdf]
* Not directly related to SPIT (phone SPAM), but one is https://www.wired.com/story/sim-swap-fix-carriers-banks/ .

* Carrier maintainer blacklists and other tools have also been used by providers for a long time.

* My provider, Voip.ms, enforces a provenance whitelist by default. This block all SPIT calls coming from unspoofed caller ids. That may not sound like a lot, but yes, many of those calls are just random poeple picking their phone or mobile apps using the real phone number. Having regulation to track internal sources of SPIT (and enforcing it) helps too.

* In Canada, you can subscribe to a non-telemarketing list. That doesn't help for scammer, but it helps for unsolicited ads, political spam and private surveys. This works when enforced with actual penalties for all parties involved.

Elv13··on Antique 4x5 camera creates 20 micron photolithography masks [video]
As a member of Foulab, home of Thought Emporium, and as an avid watcher of many channels (yours, Thought Emporium, RedNile, BlueNile, etc) which you contributed ideas, knowledge or/and hardware over the years: thank you for spreading such tech around the hackspaces, youtube and homelab community! The content you inspired, made or indirectly contributed to is what makes YouTube the such an amazing platform.
Elv13··on Things you can do with a browser in 2020
In AwesomeWM (a linux window manager), we have APIs to lie to windows. Telling youtube it is in fullscreen mode when it isn't is very useful. A lot of websites have much better fullscreen / mobile modes.

(disclaimer, I am one of the dev)

Elv13··on The Samson Switchblade flying car
Cherry Red Roadster*

* Rocket not included. Your millage is guaranteed unlimited after the first 30 minutes. Prone to rapid unscheduled disassembly.

Elv13··on The Samson Switchblade flying car
And a fourth: Ballistic cars
Elv13··on Two new ways to read a file quickly
My point is that this limitation can be bypassed if you are smart enough. The Linux kernel is more complex than any single BPF program, it has side effects.

For example, let say that I am an attacker who which to execute a loop to brute force a key using a new side channel from kernel space. eBPF programs are now available to userspace with "insert new shiny here". I add one as a performance tracepoint, then one in the packet filter, then one modifying a vtable somewhere. Now, I manage to make them oscillate and call each other while never leaving kernel space. I now "deadlock" the kernel with my small BPF programs until I manage to extract what I am after, then let the "deadlock" go away.

It take only 1 bug to make this happen. Each BFP program individually return, but only to be called again. If you let users put these in the kernel, this will happen eventually. This kind of tricks has been used over and over with other technologies.

Elv13··on Two new ways to read a file quickly
> it's not Turing-complete

On their own, but there is more than 1 way to insert BPF programs.

If there is a key learning from ROP style exploits, is that you can assemble surprising constructs out of thin air. Linux 5.6 adds way for eBPF programs to write vtables. That one alone is an exploit waiting to happen. You just have to connect the calls just right and poof, eBPF programs calling each other: Turing completeness achieved.

← PreviousPage 2 of 8Next →