Benenits (for straight men) dating trans-women


Sensitive content

Jordan B. Peterson's Twitter channel has been banned


I expected this to happen sooner or later, not because of #JordanPeterson (sorry to miss the B. here), but because of how these increasingly dangerous #narcissistic (radical) activists are operating. But watch it for yourself:

Twitter bans Jordan B. Peterson's channel

#Twitter #Woke #LGBTQ #CancelCulture



Nein


Das wichtigste Wort der deutschen Sprache ist das Wort „Nein“. Es ist ein Wort, das aufzeigt, wie frei man lebt. Wenn man dieses Wort ohne Angst sprechen kann, wann immer man etwas nicht haben oder tun möchte, ist man frei; wann immer einem keine die Persönlichkeit bedrohende Konsequenz fühlen muss, wenn man „Nein“ sagt, wird man vom anderen als freier Mensch behandelt und respektiert. Niemand hat ein Problem damit, wenn ihm zugestimmt wird, die Möglichkeit des Bejahen-Könnens zeigt gar nichts. Aber wenn das „Ja“ von einer Drohung erzwungen wird, wenn es unter Angst gegeben werden muss, weil ein „Nein“ übermäßige, untragbare Konsequenzen hätte, denn ist das „Ja“ auch noch ein Zement der Knechtschaft, eine Illusion der Zustimmung, die sich der jeweilige Gewalttäter und Angstdressierer leicht als Illusion gefallen lässt, um seine eigene Rolle dahinter zu verstecken. Das Maß der Unfreiheit, Knechtschaft, Drohung, Menschenverachtung und Bereitschaft zur Gewaltanwendung wird erst klar, wenn „Nein“ gesagt wird.

Deshalb Mensch: Sei nicht schnell, „Ja“ zu sagen. Und. Sag, wann immer es möglich ist, ein deutliches und klares „Nein“, wenn du etwas nicht willst.

#Freiheit | Zweitverwertet aus Lumières dans la nuit

Why I don't like/use PHP's empty() function


PHP has a function called empty() which can only return a boolean value, which is good at this point. The purpose of the function is to check if a variable "is empty" ...

You can check out it's documentation or try this example to see what is all considered as "empty".

<?php
echo 'empty(true):'       . (empty(true)       ? 'true': 'false') . PHP_EOL;
echo 'empty(false):'      . (empty(false)      ? 'true': 'false') . PHP_EOL;
echo 'empty(0):'          . (empty(0)          ? 'true': 'false') . PHP_EOL;
echo 'empty((float)0.0):' . (empty((float)0.0) ? 'true': 'false') . PHP_EOL;
echo 'empty(null):'       . (empty(null)       ? 'true': 'false') . PHP_EOL;
echo 'empty():'           . (empty('')         ? 'true': 'false') . PHP_EOL;
echo 'empty("foo"):'      . (empty('foo')      ? 'true': 'false') . PHP_EOL;
echo 'empty(object):'     . (empty(new stdclass()) ? 'true': 'false') . PHP_EOL;

With 7.4.21 I'm getting this result:
empty(true):false
empty(false):true
empty(0):true
empty((float)0.0):true
empty(null):true
empty():true
empty("foo"):false
empty(object):false

And hopefully with other versions of #PHP you get the same result. But if not, then there is the problem. Users can have a variety of versions installed, even those being marked as End-Of-Life (which as a software developer you should never support, get your system updated, lazy arse!!!).

So do you want ...
1) Your coder relies on a PHP function that has a change of behavior (other returned result than before updating PHP)?
2) Don't/Can't update PHP and get stuck with a EOL version?
3) Or maybe rewrite it in a way that when an incompatible update happens you only have to change a little bit?

Sure empty() is maybe not changing so fast in the near future, but who knows? Surely you and me don't have a magic orb at home where you can see it coming ... LOL

For the last option, I had introduced DBA::isResult() which does this exactly for you. It keeps your code easily upgradeable because you might only have to change that method (if properly used everywhere). But there is a drawback in Friendica's code:

- If a boolean is present in $array (mixed type parameter of it), it simply returns it (even when it is true, so your code "thinks" that the record is found ...
- On successful retrieval of the record either an object or array can be present in $array. So they both need to be checked individually.

What I found troubling (confusing) here is that why so many different types can be returned from the DAL (the class Database/Database|DBA is some kind of DAL) and not always a single result class, e.g. QueryResult which contains the whole result, how many records have been found or being affected and so on.

This is a WAY much cleaner approach and you are more object-oriented and not lesser. If it was me, I would rewrite the entire code of #Friendica around this issue towards that class.

And if it was me, I would make sure that (no matter how important the table is) method invocations are correct, means e.g. no null for an id column or valid id number (you can always call DBA::exists() before!). And if this causes to much redundant queries, you can always cache the result and just return the cache instead.

Sure this increases memory footprint, that's the deal you have to make: More cache or more SQL queries.