foo := "eggs"
if bar {
foo = "spam"
}
Or:
var foo string
if bar {
foo = "spam"
} else {
foo = "eggs"
}
To my eye, this just would look a lot nicer:
foo := bar ? "spam" : "eggs"
Or at least as the Pythons do it:
foo = "spam" if bar else "eggs"
The ternary operator especially shines with relatively short expressions.
Mit dieser absoluten Katastrophensoftware vor dem Herrn haben wir mal ein Studienprojekt gemacht. Die hat alle Vorurteile komplett übererfüllt. Angefangen von Fehlerseiten, die statt 4xx oder dergleichen immer mit HTTP 200 ausgeliefert wurden oder auch, dass das generierte HTML leider einfach ungültig war. Über die Implementierung von Löschen durch einen Deleted-Schalter in der Datenbank, das Speichern von Passwörtern im Klartext bis hin zu völlig umständlichen Bedienungskonzepten. Alles hat immer brutal viele Schritte gebraucht. Das Zeilennummernrumgeeier im TYPO-Script erinnerte eher an Basic. Uns kam es auch so vor, als ob man damit nicht ernsthaft was sinnvolles machen könnte.
Zu allem Überfluss hatte irgendwer noch ein ganz hundsmiserables Buch ausgegraben, das als Vorbereitung dienen sollte. Ich kann mich zum Glück weder an den Titel noch den Autor erinnern, aber ich weiß noch, wie das komplett inkonsistent geschrieben war. Anfangs gabs mehrere Seiten zu Unicode und UTF-8 wurde angepriesen, aber alle Beispiele haben dann auf ISO-8859-1 gesetzt. Gezeigter Beispielcode war häufig unterste Schublade. Selten hab ich so merkwürdige Erklärungen gelesen: „Wenn Sie die Sicherheitswarnhinweise stören, kommentieren Sie doch bitte im Quelltext die
die()
-Funktion in $ZEILE
aus.“ Oder ein anderer Klassiker: „Ausgeschrieben würde der Code wohl folgendes tun…“. War sich der Autor also nicht ganz sicher, ob sein Codeschnipsel vllt. doch in Wahrheit was ganz anderes tut.Seit diesem gigantischen Trauma (das hat mich wirklich sehr nachhaltig geprägt, wie man Dinge nicht machen sollte) hab ich erfolgreich einen Bogen um das TYPO3-Universum gemacht.
Ich kann nur hoffen, dass es zwischenzeitlich ein wenig besser geworden ist. Aber Deinem Kurzbericht zufolge scheint da ja immer noch der Wurm drin zu sein. Mein Beileid! :-(
Fingers crossed that this doesn't happen a third time today.
No, honestly, I don't think that there is anything wrong with the current approach. I don't see any wins of any of the proposals I've come across.
?
as suffix for boolean returning functions or as ternary operator (condition ? true_value : false_value
)?Interestingly, I just had to look up the first case. I was under the wrong impression that the question mark at the end would be some shortcut for chained function or method calls that handles
nil
return values in a graceful way without actually dereferencing and thus crashing. I probably never wrote more than 30 lines of Ruby in my entire life. Must have been some other language.
$ curl https://remix.girlonthemoon.xyz
curl: (35) error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error

The mother of the morons is always pregnant.
Besonders positiv hervorheben muss ich die Rohdatenansicht. Sowas hab ich mir auch schon in der Vergangenheit hin und wieder gewünscht. Wie toll es doch wär, direkt den Eintrag im Original zu sehen, ohne erst im Feed mühsam auf die Suche gehen zu müssen, was auch noch einen Wechsel auf den Browser oder den Editor erzwingt. Das werd ich mir definitiv auch einbauen. Insbesondere für die Entwicklung absolut hilfreich. Die Textarea könntest Du noch mit einem
readonly
-Attribut ausstatten.Die Gesamtbaumansicht einer Unterhaltung gefällt mir ebenfalls. Davon bin ich ja ein großer Verfechter. Nicht nur die direkten Antworten zu sehen, sondern alle. Klar, bei tief verschachtelten Unterhaltungen und sehr langen Beiträgen verliert man da doch mal den Überblick, aber die kommen in der Praxis meiner Erfahrung nur selten vor.
Die zwei Elemente in der Fußzeile eines Beitrags würde ich auch noch versuchen in die Kopfzeile zu verschieben, dann wird die Darstellung insgesamt kompakter, gerade bei Unterhaltungen könnte das von Vorteil sein.
Weiter so!
Ich müsste auch endlich mal an meinem Client weitermachen. Aber heut nimmer.
trim()
angewendet haben, bevor sich die Zeile zur näheren Verarbeitung angesehen hat. :-D
Was konkret war dann das Problem von dem zu sauberen XML in Deinem Fall? Und schön zu hören, dass Du das Gerät vor dem vorzeitigen Elektroschrotttod bewahrt bekommen hast. :-)
Zum Abschluss noch ne ganz doofe Frage, ganz offensichtlich hab ich von Radios keinen blassen Schimmer. Wieso muss denn das Ding überhaupt mit XML rumfuhrwerken? O_o
Pod.LastSeen
and Pod.LastUpdated
fields are only ever updated in the Cache.DetectPodFromUserAgent(…)
function as far as I can tell. This function is called in Cache.DetectClientFromRequest(…)
and Cache.DetectClientFromResponse(…)
.Cache.DetectClientFromRequest(…)
is only invoked when the twtxt.txt is requested and looks at the User-Agent
HTTP request header.Cache.DetectClientFromResponse(…)
is only called in Cache.FetchFeeds(…)
and looks at the Powered-By
HTTP response header. This header would be set in twtxt.txt HTTP responses from yarnd. A bunch of places invoke Cache.FetchFeeds(…)
, including a periodic job (UpdateFeedsJob.Run()
). Maybe something is iffy around these locations.

scp
/rsync
for me. :-) But I remember there is one server that only provides SFTP access. :-/
What's your favorite dialect?
<div>
and class nonsense. I can't remember with which editor I started out with, but I upgraded to Webweaver (later renamed to Webcraft) quickly. Yeah, this were the times when there was just a single computer for the whole family.Free hosting on Arcor, Freenet and I don't know anymore how they were all called. Like this author, I uploaded everything via FTP. Oh dear, when was the last time I used that? And I had registered plenty of free
.de.vu
domains.Being on Windows at the time, everything was ISO-8859-1 for me. No UTF-8, I don't think I've heard about it back then.
Later, I wrote my own CMSes in PHP. Man, were they bad in retrospect. :-D Of course, MySQL databases were used as backends. I still exactly know the moment I read the first time about SQL injections. I tried it on my own CMS login and was shocked when I could just break in. The very next thing I did was to lock down everything with an .htaccess until I actually fixed my broken PHP code. Hahaha, good memories.
I swear by Atom or RSS feeds. Many of my sites offer them. I daily consume feeds, they're just great.
Luckily, the most important development platform still worked for me, so I could actually do something, review code, pull and push, etc. But the calls with the screenshares were nightmares. Can't see shit on such a tiny display with today's extreme monitor sizes people use. Looking at logs, hahahahahahaaa…
Oh, for sure! Complexity will definitely go through the roof and beyond with optimizations, no doubt. Maybe with the very simplest of the easy ones it might be still reasonably straight forward, but I also imagine that this has the potential to escalate very quickly. :-D
And as I've forseen the other day, we have to deliver yet another workaround hotfix, once the other team eventually gets their stuff integrated that we should rely on. Good riddance it's the weekend now!
Haha, eleven bytes, how mean is that!? :-D But I already see you working on that as well at some point in the near future. :-)
@movq That was the only time I left the house today.

@aelaraji Yeah, a sore neck is always a win. :-P Here's nothing really to see, all cloudy. And also a bit cold at -2°C. I don't feel like standing still all that long outside at the moment. :-D
pre-wrap
even! https://git.mills.io/yarnsocial/yarn/pulls/1186
code { white-space: pre }
in their CSS themes to render things as they're supposed to look like.
shellcheck
: https://github.com/koalaman/shellcheck It points out common errors and gives some suggestions on how to improve the code. Some details in shell scripting are very tricky to get right at first. Even after decades of shell programming, I run into "corner cases" every now and then.E.g. in
getlyr
's line 7 it warns:echo -e $(gum style --italic --foreground "#f4b8e4" "'$artist', '$song'")
^-- SC2046: Quote this to prevent word splitting.
For more information:
https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt...
Most likely not all that problematic in this application, but it's good to know about this underlying concept. Word splitting is basically splitting tokens on whitespace, this can lead to interesting consequences as illustrated by this little code:
$ echo $(echo "Hello World")
Hello World
$ echo "$(echo "Hello World")"
Hello World
In the first case the shells sees two whitespace-separated tokens or arguments for the
echo
command. This basically becomes echo Hello World
. So, echo
joins them by a single space. In the second one it sees one argument for the echo
command, so echo
simply echos this single argument that contains three spaces.
The first thing that came to mind when I woke up was that I didn't catch the logical flaw in my dream: absolutely no water was coming out of the burst pipes. The whole scenario took place in summer, so the water couldn't be frozen either.
@nick@domain
thing that yarnd invented) and be done. It's really that simple.When yarnds peer with each other, the odds of actually having come across that feed URL in the past are higher than with traditional clients that only have their local set of subscribed feeds. One additional improvment would be to also look at all the mentions and see if somebody used a nick for that URL and go with that.
Yeah, yarnd currently renders some really weird shit when the mention contains just a URL, but I'd call that a bug for sure.
Personally, I do not like the
@nick@domain
syntax at all. It looks silly to my eyes. What might have also contributed is the fact of this mentions syntax gotten screwed up so many times by yarnd in the past. But that's a totally different topic.
# This is hosted by a Yarn.social pod yarn running yarnd ERSION@OMMIT go1.23.4
^^^^^^^^^^^^
Looks like the first letters of the version and commit got somehow chopped off. I've no idea what happened here, maybe @prologic knows something. :-? I'm not familiar with the templating, I just recall @xuu reporting in IRC the other day that he's also having great fun with his custom preamble from time to time.
That "broken" comment doesn't hurt anything, it's still a proper comment and hence ignored by clients. It's just odd, that's all.
tt
currently supports all three forms: @<nick url>
, @<url>
and even the illegal @<nick>
. The difference between the last two is whether the token in angle brackets looks like a URL or not. Whenever a nick is available, the nick is rendered. In case there is just a URL, it tries to resolve the nick from the subscriptions. If that also does not work, it displays the URL.