Stories
Slash Boxes
Comments

SoylentNews is people

Log In

Log In

Create Account  |  Retrieve Password


sudo rm -rf (2357)

sudo rm -rf
(email not shown publicly)

Journal of sudo rm -rf (2357)

The Fine Print: The following are owned by whoever posted them. We are not responsible for them in any way.
Thursday October 22, 15
11:54 AM
/dev/random

Not sure, if this is interesting for SN, so I will post it in my little journal. If you landed here by accident, please click here

Last week in the Guardian:

Asterix and Obelix are back in a new edition of the famed comic book, this time fighting their Roman foes in a propaganda war alongside a character inspired by WikiLeaks founder Julian Assange.
Two years after Asterix and the Picts saw the duo head to ancient Scotland, the Gauls are back home for their latest adventure as a tribe resisting Roman occupation, the 36th book in the hugely popular series.
Asterix and the Missing Scroll is the second book by writer Jean-Yves Ferri and illustrator Didier Conrad, who took over from original co-creators Albert Uderzo and Rene Goscinny.

Friday September 25, 15
02:09 PM
Hardware

While trying out where I would land if I typed in the soviet TLD (.su)[1], I found this neat collection of pictures from soviet era (+- a few years) calculators, computers and other electronic devices: The Soviet Digital Electronic Museum, a private collection of a guy named Sergei Frolov.
http://www.leningrad.su/museum/main.php?lang=0(english version)
Great stuff!

[1] After a bit of searching I learned that .su is still in use and adminstrated by the Russian Institute for Public Networks.

Friday August 21, 15
10:48 PM
Soylent

I'd like to take this oppurtunity to express my thanks to all the Hordes of Ultra Geeks, Groups of Rabid Barbarians, Teams of Overworked Monkeys, Cadres of Elite Robots, Barrels of Orange Soylents, Swarms of Psycho Ninjas and all the others I fail to remember now for working tirelessly on the generation of this wonderful page. Just for me!

This page was generated by a Swarm of Roaming Mongols for sudo rm -rf (2357).

Monday July 06, 15
04:17 PM
Code

Disclaimer: I work as a PHP developer.
While browsing the upgrade notes of PHP 7 alpha 2, I found a few changes a bit concerning. (In order of appearance)

The func_get_arg() and func_get_args() functions will no longer return the original value that was passed to a parameter and will instead provide the current value (which might have been modified). For example

function foo($x) {
        $x++;
        var_dump(func_get_arg(0));
}
foo(1);

will now print "2" instead of "1".

While I never use func_get_args(), I know a lot of frameworks do, a quick search over an old project (symfony 1.4) results in 129 matches. Even worse, a few lines further down it says:


function foo($x) {
        $x = 42;
        throw new Exception;
}
foo("string");

    will now result in the stack trace

            Stack trace:
            #0 file.php(4): foo(42)
            #1 {main}

    while previously it was:

            Stack trace:
            #0 file.php(4): foo('string')
            #1 {main}

Why make debugging harder than it is already? I want to know what parameter was passed and caused the exception! Especially in long stack traces. Or am I completely misunderstanding something?
The next one should throw a warning at least:

Left bitwise shifts by a number of bits beyond the bit width of an integer will always result in 0:
var_dump(1 << 64); // int(0)

At least it is consistent for all CPU architectures.

There are now two exception classes: Exception and Error. Both classes implement a new interface Throwable. Type hints in exception handling code may need to be changed to account for this.

ARRGH!

Calling a method on a non-object no longer raises a fatal error; see also: https://wiki.php.net/rfc/catchable-call-to-member-of-non-object.

Really? I mean: WHAT? I hate that error like the next guy, but it *should* be fatal. I hate to see every little method call surrounded by a try-catch block.

Nevertheless, a lot of the other stuff that will change looks interesting to me, e.g. Added null coalesce operator (??). looks fun and can short-circuit functions!


function foo() {
        echo "executed!", PHP_EOL;
}
var_dump(true ?? foo());

// outputs bool(true), "executed!" does not appear as it short-circuited

Wednesday June 10, 15
03:36 PM
/dev/random

A lot of times I get distracted by little details in comments, and through extensive link-hopping, I sometimes end up with things that are simply too offtopic to post on the stories.

So for today:
The bite force quotient.
Bite force quotient (BFQ) is the regression of the quotient of an animal's bite force divided by its body mass. (do.)
For example, the american black bear (Ursus americanus) has a BFQ as low as 64, only slightly higher than a domestic cat (Felis sylvestris catus) with BFQ of 58.
(Source: Bite club: comparative bite force in big biting mammals and the prediction of predatory behaviour in fossil taxa)