anton

joined 2 years ago
[–] anton@lemmy.blahaj.zone 2 points 5 hours ago (1 children)

To me emojis are more age than gender coded.
For example most young people I know (with the exception of one teenage boy) are similarly sparse with emojis as I am, and if you sprinkle some of 😄😎😳🤗🥰🤩 in and you can fit in with boomers and gen x of any gender.

[–] anton@lemmy.blahaj.zone 2 points 7 hours ago (3 children)

As a cis guy, I rarely use emojis other than thumbs up, but that doesn't make me any more masculine than you.
Please don't measure yourself by toxic stereotypes like men are power hungry brutes that see any display of emotions as weakness.

[–] anton@lemmy.blahaj.zone 2 points 8 hours ago

Bis auf des Video im Regen ging es für mich, aber wie da die Laune ist, kann sehr unterschiedlich sein.

[–] anton@lemmy.blahaj.zone 18 points 11 hours ago

🏳️‍⚧️ Gratulation an Frau Lindner und die anderen zum Rauskommen 🏳️‍⚧️

[–] anton@lemmy.blahaj.zone 6 points 19 hours ago

I heard the mathematicians have a way to describe this profound relationship: Dolphins ⊂ Whales

[–] anton@lemmy.blahaj.zone 1 points 1 day ago

Auf dem Arduino kannst du keine Dateien lesen, es sei den du willst die über serial senden, deshalb musst du die Werte in dein Programm kompilieren.

will eher ungerne den User in einer C-Header Datei rum spielen lassen

Dann lass deine user deine config schreiben und generiere eine header Datei daraus.
Ich habe mal meine C-Kenntnisse raus gekramt.

#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>

#define BUFFER_LEN 1024
#define MIN_STRONG_SIZE 16
#define IN_FILE_DEFAULT "config.txt"
#define OUT_FILE_DEFAULT "config.h"

typedef struct String {
	size_t length;
	size_t size;
	char content[];
} String;

typedef struct Variable {
	String* name;
	int intPart;
	int fracPart;
	bool isNegative;
	bool hasFraction;
} Variable;

FILE* outFile;

void storeVariable(Variable variable) {
	fprintf(outFile, "#define VAR_%s ", variable.name->content);
	if (variable.isNegative)
		fprintf(outFile, "-");
	fprintf(outFile, "%d", variable.intPart);
	if (variable.hasFraction)
		fprintf(outFile, ".%d", variable.fracPart);
	fprintf(outFile, "\n");
	free(variable.name);
}

String* newString(size_t size) {
	if (size < MIN_STRONG_SIZE) {
		size = MIN_STRONG_SIZE;
	}
	String* string = calloc(1, sizeof(String) + size);
	if (string == NULL) {
		fprintf(stderr, "allocation error");
		exit(3);
	}
	string->size = size;
	return string;
}

String* appendToString(String* string, char c) {
	if (string == NULL) {
		fprintf(stderr, "null pointer error");
		exit(4);
	}
	if (string->length+1 >= string->size) {
		string->size *= 2;
		string = realloc(string, sizeof(String) + string->size);
		if (string == NULL) {
			fprintf(stderr, "allocation error");
			exit(3);
		}
	}
	string->content[string->length] = c;
	string->content[string->length+1] = '\0';
	string->length++;
	return string;
}


typedef enum ParseMode {
	VAR_NAME_START = 0,
	VAR_NAME,
	INTEGER_START,
	INTEGER,
	FRACTION,
} ParseMode;

void handleChar(char c);

int main(int argc, char** argv) {
	char* confFileName = IN_FILE_DEFAULT;
	char* headerFileName = OUT_FILE_DEFAULT;
	if (argc > 1) {
		if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) {
			printf("usage: %s config_file output_file\n", argv[0]);
			printf("if no files get specified, the defaults are: %s %s\n", IN_FILE_DEFAULT, OUT_FILE_DEFAULT);
			return 0;
		}
		confFileName = argv[1];
	}
	if (argc > 2) {
		headerFileName = argv[2];
	}

	FILE* file = fopen(confFileName, "r");
	if (file == NULL) {
		fprintf(stderr, "can't open input file %s", confFileName);
		return 1;
	}
	outFile = fopen(headerFileName, "w");
	if (outFile == NULL) {
		fprintf(stderr, "can't open output file %s", headerFileName);
		return 1;
	}

	char buffer[BUFFER_LEN];
	unsigned long amountRead = fread(buffer, 1, BUFFER_LEN, file);
	while (amountRead > 0) {
		for (int i = 0; i < amountRead; i++) {
			handleChar(buffer[i]);
		}
		amountRead = fread(buffer, 1, BUFFER_LEN, file);
	}
	handleChar('\n');
	fclose(file);
	fclose(outFile);
	return 0;
}

ParseMode mode;
Variable state = {0};

void handleChar(char c) {
	if (c == ' ') {
		return;
	}
	switch (mode) {
		case VAR_NAME_START:
			if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')) {
				state.name = newString(20);
				state.name = appendToString(state.name, c);
				mode = VAR_NAME;
			} else {
				fprintf(stderr, "error on '%c': variable names must start with a letter", c);
				exit(2);
			}
			break;
		case VAR_NAME:
			if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') || (c == '_')) {
				state.name = appendToString(state.name, c);
			} else if (c == '=') {
				mode = INTEGER;
			} else {
				fprintf(stderr, "name error on '%c': variable names consist of alphanumeric characters and underscores", c);
				exit(2);
			}
			break;
		case INTEGER_START:
			if (c == '-') {
				state.isNegative = true;
				state.intPart = 0;
			} else if ('0' <= c && c <= '9') {
				state.intPart = c - '0';
			} else {
				fprintf(stderr, "number error on '%c': expected digit or '-'", c);
				exit(2);
			}
			break;
		case INTEGER:
			if ('0' <= c && c <= '9') {
				state.intPart = state.intPart * 10 + c - '0';
			} else if (c == '\n') {
				mode = VAR_NAME_START;
				storeVariable(state);
				Variable empty = {0};
				state = empty;
			} else if (c == '.') {
				mode = FRACTION;
				state.hasFraction = true;
			} else {
				fprintf(stderr, "number error on '%c':  expected digit or '.'", c);
				exit(2);
			}
			break;
		case FRACTION:
			if ('0' <= c && c <= '9') {
				state.intPart = state.intPart * 10 + c - '0';
			} else if (c == '\n') {
				mode = VAR_NAME_START;
				storeVariable(state);
				Variable empty = {0};
				state = empty;
			} else {
				fprintf(stderr, "number error on '%c':  expected digit", c);
				exit(2);
			}
			break;
	}
}

Man sollte es wahrscheinlich in header und source aufteilen, und die strings sind vielleicht overkill, aber für ein one-of pass es schon. Wenn die variablen nach dem parsen anders verwenden willst, musst du nur storeVariable abändern.

[–] anton@lemmy.blahaj.zone 2 points 1 day ago

Doing regular physical sports is certainly a thing some esports teams do, but 30m seems a little short.

[–] anton@lemmy.blahaj.zone 3 points 3 days ago* (last edited 3 days ago)

I like self directed research, it's mostly rust stuff, but has some really interesting topics mixed in.

[–] anton@lemmy.blahaj.zone 6 points 4 days ago

There needs to be a clear legal standard, and 18 Years is the arbitrary line we agreed on.
When a 17 Year old go to war, they are child soldiers, and when they get bombed/starve, they count towards the children death toll.

 

PS: Ich habe erst beim Verfassen dieses Post gesehen, das da Schächten und nicht Schlachten steht.
Schächten ist rituelles Schlachten, wie es im Judentum und Islam praktiziert wird. Da es oft ohne Betäubung durchgeführt wird, wird es von Tierschützern kritisiert. Das Verbieten von Schächten war eine der ersten Formen der Diskriminierung Nazis gegen Juden, jetzt wird es gegen Muslime ins Feld geführt.

 
 

cross-posted from: https://lemmy.ml/post/27833143

context

transcript

DISRUPT INTERNATIONAL SHIPPING NOW!!

OGEY

Niche ocean carrier Atlantic Container Line is warning the fines the U.S. government is considering hitting Chinese-built freight vessels with would force it to leave the United States and throw the global supply chain out of balance, potentially fueling freight rates not seen since Covid.

“This hits American exporters and importers worse than anybody else,” said Andrew Abbott, CEO of ACL. “If this happens, we’re out of business and we’re going to have to shut down.”

[...] U.S. is no position to win an economic war that places ocean carriers using Chinese-made vessels in the middle. Soon, Chinese-made vessels will represents 98% of the trade ships on the world’s oceans.

Hey, Abdul-Malik Badr Al-Din Al-Houthi, how'd I do?

Thank you Mr. President, that's exactly what I meant. But why-

Another day, another banger

 

Bildbeschreibung:

Magie Karte mit Titel Sitzungsvorstand

Textblock:
{t}{1} Ordnungsruf: Plaziere einen Ordnungsrufzähler auf einer Karte auf dem Feld. Wenn eine Karte 3 oder mehr Ordnungsrufzähler hat, kann sie nicht angreifen und keine Fähigkeiten aktivieren.
{t}{X} Sitzungsausschluss: Verbanne eine Kreatur mit Kosten X oder weniger, für X Runden. Wiederspruch X: diese Fähigkeit kann für X gekontert werden.

 

Sometimes I come across links to communities or posts on instances that are not in the list of links the app recognizes as lemmy. Instead they open a browser tab. Given lemmys growing and decentralized nature it's unreasonable to expect devs to keep up with that. Please enable users to add to that ever growing list, at least for their own account. I understand that such a feature is may be far in the backlog or may never come at all, in the meantime I would be happy if you added the feddit.org domain to the list as feddit.de seems to be migrating there.

Workaround: Apparently it works with the ! community @ instance links like !ich_iel@feddit.org but not normal links feddit.org/c/ich_iel

 

This is what the bot posted:

This is the best summary I could come up with:


The Reuters Daily Briefing newsletter provides all the news you need to start your day.

Sign up here.


The original article contains 18 words, the summary contains 18 words. Saved 0%. I'm a bot and I'm open source!

view more: next ›