I'm a little surprised the examples don't require fiddling with X permissions, which I always had to do when not using ssh.
270 karma · joined January 30, 2018
I'm a little surprised the examples don't require fiddling with X permissions, which I always had to do when not using ssh.
The example above is writing and reading every X11 message over a socket, and not reaching into /dev on the host, else it would need additional parameters added to the docker command.
I'm not current on Wayland, but as of a few years ago all attempts to run it non-locally required the X11 back-compat layer. I have no idea what /dev nodes would be required to be shared for wayland to run in a chroot.
Sadly there haven't been many AAA games with Linux compatibility (that I wanted to play) since then. Valve is still pushing it though.
Don't get me wrong, it will be nice to have another manufacturer to choose from with excellent Linux support, but as it sounds, they aren't there yet with this new distro. So... I'll keep using ThinkPads for now.
Also I despise glossy screens. So I'll probably never want a macbook anyway.
The whole thing with Wayland is just a new generation of coders saying "hey all this pile of new apis on top of old apis on top of older apis spanning back 40 years designed for hardware that no longer exists is insane. We need to start over." They aren't wrong, but they also haven't reached feature parity with the old stuff yet, because doing hardware accelerated 3D graphics over a pipe to a remote host was a pretty amazing feat of technology.
Edit: to be a little more specific, Silicon Graphics company's whole business was accelerated graphics, and they were in business since 1982, and invented most of X11, or at least its extensions.
"Work is defined to start at 8am so lets have everyone call solar 7am '8am' so we can get everyone to go to work an hour earlier."
Now "high noon" will occur at 1pm and the middle of the night will be 1am. In Ohio (or west edge of any time zone) the middle of the day will be 2pm and middle of the night 2am. Sunburn zone in ohio? 12pm-4pm.
The problem is the "consistent yardstick" actually. People are accustomed to start work at "8am", and react badly to being told to start work at "7am". So we change the clock so that their yardstick "8am" occurs at solar 7am and people get out of work earlier. And people now are like "lets keep summer time" which is the exact equivalent of "lets always go to work at solar 7am".
It will all become more ridiculous 20 years from now when popular demand has lead to offices and schools opening at 9am in the winter and people start calling for a new daylight savings time to get more hours of light in the evening.
Making a library more portable in C usually means making the code an ugly mess of macros. So, first decide how much time and code clarity you want to sacrifice vs. the systems you want to be able to run it on. I have a large scale personal project data encoding library that I never finished in part because I tangled myself up in trying to make it 100% defined behavior C code. The world only has 3 major compilers: gcc, clang, and visual studio. If your code works on all 3, and its a hobby project, that's probably good enough. There are also vanishingly few big-endian systems left, aside from some embedded ARM processors. Also, declaring :62 will be a compile error on a 32 bit system, so that's maybe your biggest portability concern? But again, 32 bit is either old or embedded, so maybe not worth worrying about.
I believe that to make this portable to big-endian or 32 bit, you would need to make a macro to access the pointer and flags. Then you need to detect the endianness in preprocessor directives and set the macro to either a shift or a mask.
This code is assuming that on little-endian, gcc pulls 62 bits from the low bits of the word, and on big-endian that gcc pulls from the high 62 bits of the word. It might actually be what gcc does, but I don't think any of that is guaranteed.
Another way to look at it is that the combined lifespans of the organisms of a food chain are shorter than the time it would take for one mis-folded protein to be likely to occur and then also cascade to a degree that would affect the health of the top organism. Prion diseases only show up when you introduce a loop in the food chain.
Just to clarify, my main point was the speed at which it would compile the code, which was an order of magnitude faster than anything else.
It doesn't surprise me to hear it was written in asm.
You seem to indicate they have lots of money, but most of their wealth is assets, much of which is ownership of their own companies. If they "spent" that it would mean selling pieces of the company to someone else, and they would lose power to make the sorts of decisions that made the company successful in the first place. Letting a lot of middle class people's retirement savings managers make all the board decisions for Microsoft is not going to provide the same level of innovation as letting Gates have a large vote. The only reason those stocks have any value at all is because of the size and market position of the company. There is no benefit in letting this form of wealth have "money velocity".
Maybe you left Musk off the list on purpose, but what he's "doing with his wealth" is trying to make humans a multi-planet race, and he literally doesn't even care what his company shares are worth to other people. Is it really "money" if he doesn't intend to sell it? His recent sale of lots of Tesla was only because he had options to buy more of the company and immediately sell it. (and now he'll pay a few billion in tax, on that, since it was actually income) Until he did that, all his "wealth" was a mental fiction invented by him and the hard working people in his company. The real money just moved into his account for the first time in a long while, as he drained your retirement account in exchange for the idea that they now have a tiny piece of control over Tesla.
In the case of insulin, it was in fact invented with nothing more than research grants and the promise of fame and nobel prizes. But it also took 30 years from the first hints of what might solve diabetes until they produced a drug for it. It's an open question whether that could have happened faster with a profit-motivated company pushing the research.
For what it's worth, Perl lets you freely mix C methods with pure-perl methods in the same object. I also don't think Python has an equivalent for Inline::C
https://metacpan.org/pod/Inline
Getting back to the Moo topic though, you seem to hate the idea of reading user-module documentation to use an object system, but I see that as one of Perl's strengths. Perl's native object system is nothing more than data elements (usually hashrefs, aka dicts) "blessed" with a method table, and the method tables are nothing more than a dict of methods and variables. And you can use user-written modules to generate those packages, and create whatever syntax you like with the user-written modules without depending on core perl to add features. Reading the @cached_property Stackoverflow pages, it sounds like the way to implement this has changed several times over the past decade of Python versions. Moo works as-is on all perls since 5.8, released in 2002.
The ability to take some basic mechanics and build on top of that is what I like. There are dozens of object systems available in Perl because people were free to experiment. Moose was the first one that gained a lot of traction because it solved a lot of common needs. Moo gained a lot of traction for solving most of the same problems while being much lighter weight. I don't think it's any worse to read the manual for Moo than to read the manual for the decorators that Python provides.
For an example of taboo runtime changes, suppose you have one module which operates on a tree of data, like converting to JSON, and another type of object within that tree which does not have a built-in serialization to JSON, like DateTime. (there is really no way to universally serialize a DateTime to JSON because JSON only supports strings arrays and objects, and representation of dates will be application-specific). Perl lets you temporarily inject a method into a class for the duration of a scope, in this case the TO_JSON method which the JSON module looks for:
sub export_as_json($data) {
local *DateTime::TO_JSON= sub($date) { $date->ymd };
JSON->new->convert_blessed->encode($data);
}
After that scope, the DateTime package is restored to normal, without a TO_JSON method. How would Python solve this problem?Lets play Rosetta Code for lazy attributes:
package Something;
use Moo;
has hostname => ( is => 'lazy' );
sub _build_hostname { chomp(my $x= `hostname -f`); $x }
How would those look in Python or Ruby?Meanwhile there are many things not on that page which Perl can do and Python and Ruby can't. (most related to taboo runtime changes of global state which are not recommended, but come in very handy when debugging)
In short, any code that is intended to work on a wide variety of systems is usually littered with conditional compilation directives and macros that make the code extremely difficult to follow without a extensive study of the author’s “setup”. This is because to compile/run on a wide variety of systems, you actually need wildly different C source code, and what is written in the C source file ends up being more like a template for a program than the actual program.