Follow Slashdot stories on Twitter


Forgot your password?

Slashdot videos: Now with more Slashdot!

  • View

  • Discuss

  • Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).


Comment: Re:Ahhhh, C++ (Score 1) 757

by byuu (#49231635) Attached to: Was Linus Torvalds Right About C++ Being So Wrong?

I don't know why you want to modify strings in-place

Because I care about performance? Memory allocations are extremely heavyweight. Doing that in a tight loop (say, an assembler building a large project) can really bog down your performance. It's nice to offer both, but you'd need some kind of naming convention since they can't both be called replace. So when I don't want in-place, I just say auto copy = string{mystring}.replace("from", "to"); and move semantics avoids the extra copy.

std::string doesn't offer either version of replace (in-place or new copy), it just has a version that is basically memcpy with bounds-checking. That assumes you already know where the string is, and that from/to are of equal length.

Making it a template just because a bunch of loonines thought that you could not do Unicode unless you made all the characters the same size was another mistake. Not only is the code unreadable and impossible to optimize, those idiots ended up with UTF-16 which is variable sized anyway. Duh.

Oh, don't get me started on UCS-2/UTF-16, wchar_t and A/W (Windows) nonsense. I've built wrapper functions for basically every Windows function so that I can use UTF-8 like sane people. I can't believe all that BS still exists, even after surrogate pairs came about.

Comment: Re:Ahhhh, C++ (Score 1) 757

by byuu (#49228971) Attached to: Was Linus Torvalds Right About C++ Being So Wrong?
This exactly. When I tried to use the STL and Boost, I hated the language as well. The STL is so crippled that std::string is basically std::vector<char>. If you want to replace "foo" with "bar" in a string, you have to write your own function to do it, because std::string::replace is just a glorified memcpy wrapper. Same goes for char transform, string reverse, split/explode, etc.

And since C++ lacks unified function call syntax, you can't extend std::string unless you subclass it (and then everyone does that, and they're not compatible with each other.) So instead, people revert back to treating C++ like C with shit like "replace(mystring, "from", "to")" instead of "mystring.replace("from", "to")". Yet it goes out of its way to offer esoteric features like custom allocators.

Qt is a rather buggy toolkit, because it tries to do way too much for its own good. (seriously, you can apply a CSS stylesheet to do a radial gradient effect on the text color of a QLabel. Yes, that's cool, but there's so much code that it's 40MB of run-time DLLs, takes hours to compile said library DLLs, and is just full of bugs that vary per platform.) However, once you get past moc/signals/slots (function pointers, and now lambdas, work for 99% of the cases you'd encounter), the API is truly a thing of beauty. (you might even like signals/slots, but I personally can't stand all the added build rules, or the "just use qmake" crowd.)

Since I've started just writing my own C++ libraries, I've found the language to be a thing of beauty. The obvious downside is that the system won't work if everyone uses their own libraries (Qt does this as well, eg QString, QList, etc.) C++14 really needs a renaissance, where a new team builds a new run-time library from scratch, with clean designs as with Qt.

Comment: Solution (Score 1) 113

by byuu (#49228063) Attached to: UK ISPs Quietly Block Sites That List Pirate Bay Proxies
Easy. Start posting the links on major portals that even the UK govt wouldn't dare block. Link them behind HTTPS (so partial URI blocking isn't possible) of Twitter, Facebook, etc.

You could probably link to said Twitter feed or whatever from your actual site, unless they start banning links to links to proxies to sites. But once people find out about the major portal accounts, they'll just start going there instead for updated proxies.

Comment: Re:Question from a non-Linux user (Score 1) 765

by byuu (#49209417) Attached to: Ubuntu To Officially Switch To systemd Next Monday
You're welcome to tell yourself whatever narrative you want to ignore the criticism. I really don't care, even if you are right (and I still think you aren't.) I abandoned Linux for the BSDs over this, as I suspect many others have, and I'm not looking back. I found a system that was far cleaner, far leaner, less dogmatic about licensing (eg I don't have to run broken-as-hell cdrkit, I can use the proper, working cdrtools; firefox isn't renamed to something stupid like iceweasel; etc), with a better file system, network packet filter, with better all-around design (of eg /dev/random, no /proc, etc) and superior leadership (luminaries such as PHK.) Of course, the more people that follow suit, the more unanimous you'll think systemd support is. But oh well.

Comment: Re:FreeBSD (Score 1) 765

by byuu (#49209371) Attached to: Ubuntu To Officially Switch To systemd Next Monday
With the MTRR tweak, I can even watch video at 2560x1600 at 60fps. I've benchmarked it and I can get up to 95fps of solid memory copying into VRAM. Compositing works fine, but I turn off all but shadows. It also helps to run at 16bpp (half the bandwidth needed per screen fill), which only really hurts you when you're working with artificial gradients, or are a photo editor. Kind of sucky to give up the color detail, but I'll take twice the speed over colors the majority of which I cannot distinguish. The one thing I lament heavily is that there's no Vsync support. It's impossible to even add it manually: the video card doesn't provide Vsync timing info at all (even tried probing the VGA ports and looking at the VESA timing extensions ... they don't work on this card.)

I've also been thinking about running a headless server for stability reasons, but haven't gone that far yet. If Xorg+Xfce eventually falls apart entirely over systemd; then I'll probably resort to running my own basic apps (text editor, file manager, terminal emulator, MP3 player) using FreeBSD's ioctl's for setting VESA mode right from the console. Then I'll just use my Windows box next to it for web browsing, movie watching and gaming.

Unfortunately, I doubt we'll see a lot more pushback on this. Linux users are quick to complain when Windows/OS X software doesn't run on Linux, yet are surprisingly hypocritical to not care when Linux software doesn't run on other systems (BSDs, Haiku, etc.) The BSD ports trees are littered with patches for pointless Linuxisms. They won't even add trivial compatibility features like SO_NOSIGPIPE to their system. Of course in the case of systemd, I really couldn't be happier that Poettering has a raging hate-on for it. I don't want his shit running on BSD either.

Comment: Re:FreeBSD (Score 1) 765

by byuu (#49202717) Attached to: Ubuntu To Officially Switch To systemd Next Monday
I switched to VESA. I'm not shitting you, either. I found a card that handles my native widescreen resolution, and I'm going to keep that card as long as humanly possible. I might even go buy a few more of them for backups. VESA is slow out of the box, but when you use tools to set the MTRR to write-combine (FreeBSD ships such a tool called memcontrol), then it speeds up by more than an order of magnitude (no exaggeration.)

So long as you're not playing hi-res 3D games (I'm not), problem solved. I don't have to deal with nVidia binary blob kernel panics, I don't have to deal with AMD rendering bugs, I don't have to deal with Intel GPUs only coming on certain motherboards and lacking PCIe cards, etc.

I suspect that what's going to happen with systemd requirements will be a combination of systemd emulation (OpenBSD already working on it), patching out code, and eventually just freezing ports at older versions. The most major software programs aren't going to become dependent on this crap, because they already need to run on Windows, OS X, etc. Even in the worst case scenario, we're going to be fine for at least another decade.

In the very, very long-term ... the solution could well end up being that FreeBSD and Linux diverge to their own display servers and software stacks. I've been starting on some work to that effect, myself, but am going about it top-down (starting at the UI toolkit) rather than bottom-up (from the display server.)

Comment: Re:Question from a non-Linux user (Score 1) 765

by byuu (#49202691) Attached to: Ubuntu To Officially Switch To systemd Next Monday
It's good not to think of it as "a small number of detractors, and a lot of supporters." The real breakdown is, "a small number of proponents, a small number of detractors, and a huge swath of people who don't know or care enough to have an opinion on the matter." The real question is, "what's the breakdown of people who actually know and care enough?" In that regard, it's a lot closer to 50/50, and honestly, I'd suggest the anti-systemd crowd is in the majority here. People who don't care about an issue shouldn't be counted as "on your side", because they'd just as easily be "on their side" if you weren't the default choice.

Comment: Re:FreeBSD (Score 1) 755

by byuu (#49065011) Attached to: Removing Libsystemd0 From a Live-running Debian System
That's fine by me. I'm not opposed to a better init system (although BSD's rc system is already way ahead of SysVInit ... I can set up a new service by making a text file with four lines in it.) I am opposed to a poorly documented (often times no documentation at all exists), monolithic design that consumes dozens of daemons that are unrelated to an init system (did you see the recent cache poisoning bug in their DNS resolver?) and offers absolutely ridiculous functionality (like a web server that spits out QR codes.) I'm opposed to the move to corruptible, binary log files. I am greatly opposed to the politics that pushed this on nearly every distro, and the forced dependencies added so that you need systemd to burn a CD with Brasero, or to run unpatched Gnome. I'm opposed to totally writing off anything but Linux. I'm opposed to the cavalier attitudes of their lead developers. And on and on and on ...

FreeBSD would never do this, and even if by some horror they did, then I'd move over to Open/Net/Dragonfly instead.

Comment: FreeBSD (Score 3, Informative) 755

by byuu (#49061723) Attached to: Removing Libsystemd0 From a Live-running Debian System

forcing people to consider abandoning the GNU/Linux of their choice and to seriously consider using FreeBSD

I did just that. It took a few weeks to figure out how to work around all the kinks (as FreeBSD is primarily targeted at the server space), but I'm really glad I did. I have a full Xfce desktop with all of the programs I was using on Wheezy before. Rock solid stability. Might be a bit easier to try PC-BSD to get one's feet wet.

I've also really grown to like all of the new features: ZFS for easy multi-disk mirroring, encryption, and snapshots; pf for firewall rules; etc. There's also DTrace, jails, etc. The integration with the base utils is wonderful, and the documentation is top notch. I've also found the new package system to work as good as apt-get (pkg install {program-name} and you're done.) I liked it enough that I've even started using it for my servers as well.

Definitely give it a try if systemd bothers you as well.

Comment: Re:It looks like a good idea. (Score 1) 88

by byuu (#49023827) Attached to: Google Chrome Will Adopt HTTP/2 In the Coming Weeks, Drop SPDY Support

I would imagine it to be something like MsOffice has deciding to switch to ODF as the only supported format.

This is more like if Microsoft went to the ISO and handed them a minimally tweaked version of OOXML, called it ODF/2, and the ISO, fearing irrelevance, rubber-stamped it as quickly as possible.

Comment: Re:No plans (Score 2) 88

by byuu (#49023819) Attached to: Google Chrome Will Adopt HTTP/2 In the Coming Weeks, Drop SPDY Support
In addition to greatly increasing costs (there are no free wildcard certs, and encryption does increase CPU workload, which decreases scalability), it also increases the barrier for writing your own tools to interoperate with the web (HTTP servers, clients, proxies, aggregators, etc.) If you've ever looked at the SSL libraries out there, all but the OpenBSD-only LibreSSL are a complete clusterfuck. This is the GnuTLS API, for instance. I won't even get into the security ramifications like Heartbleed. Whereas HTTP/1.1 can be spoken to by a human being using a telnet terminal, and even Commodore 64's have been made to serve up web pages.

Sadly, modern developers have completely lost touch with the value of making things small and simple.

Comment: Re:never heard of the RadioShack kit (Score 1) 61

by byuu (#48750603) Attached to: DuinoKit Helps Teach Students About Electronics (Video)
It's dreadful. Seriously.

I bought it. Lesson 1 was, "here's how you light up an LED! Connect the LED, a resistor, and the power source!"

So I think, great! I've got this. Okay, what's next? Lesson 2, "build this IR transmitter that communicates with your personal computer" ... fffffffffffffffffuuuu~

(not exactly that, been a while so I don't recall the specifics, but it was about that bad. It's the art instruction equivalent of this.)

If you can't understand it, it is intuitively obvious.