砂姫 · @FltSv
80 followers · 12320 posts · Server mstdn.jp

も追加で

#include

Last updated 1 year ago

Dan Gohman · @sunfish
1542 followers · 432 posts · Server hachyderm.io

cursed unix syscalls

NAME
setpid - set process identification

SYNOPSIS
<sys/types.h>
<unistd.h>

void setpid(pid_t pid);

DESCRIPTION
setpid() sets the process ID (PID) of the calling process. If another
process has the same ID, it is assigned a new randomly chosen ID.

#include

Last updated 1 year ago

Chung-chieh Shan 單中杰 · @ccshan
348 followers · 1529 posts · Server woof.group

/* */
/* Touch */
<stdio.h>
<stdlib.h>
<errno.h>
int main() {
int x = 0;
char old[99], new[99];
srand(arc4random());
while (1) {
int y = x + rand() % 2 * 2 - 1;
snprintf(old, 99, "%d", x);
snprintf(new, 99, "%d", y);
if (-1 == rename(old, new) && ENOENT == errno)
x = y;
}
}

#uselessprogram #include

Last updated 1 year ago

CyberAl · @openbuddha
192 followers · 712 posts · Server megalonyx.social

@neauoire Do you know why when I try to compile the Nintendo DS UXN from a freshly pulled repo, I'm getting the error with the devkitpro toolchain of:

uxn/uxnds/arm9/source/nds_keyboard.c:8:10: fatal error: gfx_keyboard.h: No such file or directory
8 | "gfx_keyboard.h"

The file list for that directory is:

emulator.c
lut_expand_8_32_flipx.inc
lut_expand_8_32.inc
nds_apu.c
nds_keyboard.c
nds_keyboard.h
nds_ppu.c
nds_ppu.h
stubs.c

and nds_keyboard.c has:

"gfx_keyboard.h"

#include

Last updated 1 year ago

新山祐介 (Yusuke Shinyama) · @mootastic
105 followers · 70 posts · Server mstdn.social

C++で、必要ないはずの <utils.hpp> を消したら実行速度が 5%低下した話。C++のabs()は内部でfabs()を使っており、int-float間の変換で速度が低下、さらにそれによるコード量の増加でキャッシュミスが起きていた。

julien.jorge.st/posts/en/weigh

#include

Last updated 1 year ago

Quin · @TheQuinbox
521 followers · 6518 posts · Server dragonscave.space

@daygar @x0 A statement literally pastes the source file in. That’s a real recipe for name collisions. If Rust isn’t for you, though, that’s totally fair.

#include

Last updated 1 year ago

loutre :verified: :verified: · @efyre
142 followers · 1270 posts · Server potate.space

i kinda despise C sometimes

some struct stuff can be done in such a way that it's way harder to understand the code 💀

like

```
<stdio.h>

struct a {
/// bla bla bla
int foo;
};

struct b {
struct a bar;
int foobar;
};

// and then you can feed b into any function that expect a (with the appropriate cast)

void stuff(struct a *s) {
s->foo = 2;
}

int main(void) {
struct b s;
stuff((struct a*)&s);
printf("%i\n", s.bar.foo);
// will fcking print 2
}
```

#include

Last updated 1 year ago

"rockcutterstream.hpp"
std::future<bool> suggest_kichiri(){
std::orcstream orc;
orc << " :kichiri: 行きませんか?";
auto is_ok = co_await std::async(std::launch::async, []() -> bool { return orc.send(); };

return is_ok;
}

int main(void){
suggest_kichiri();

return 0;
}

#include

Last updated 1 year ago

"rockcutterstream"
std::future<bool> suggest_kichiri(){
std::orcstream orc;
orc << " :kichiri: 行きませんか?";
auto is_ok = co_await std::async(std::launch::async, []() -> bool { return orc.send(); };

return is_ok;
}

int main(void){
suggest_kichiri();

return 0;
}

#include

Last updated 1 year ago

Steven Tattersall · @tattlemuss
121 followers · 183 posts · Server mastodon.gamedev.place

screaming at why "shader_x_y_z.sl.h" didn't find my file shader_x_y_z.sl..h

#include

Last updated 1 year ago

ゆらのふ · @eulanov
469 followers · 73110 posts · Server m.eula.dev

はじめてプヨグラミングを学習したときに意味も分からず

<stdio.h>

と書き続けていた人間が考えることと、学習しようと思ったときには多様化しまくる言語を選びたい放題な時代に生まれた人間の違いですかいねー。

#include

Last updated 1 year ago

ハゲ · @hagehagehage
27 followers · 1388 posts · Server mstdn.jp

"chimpo.h"

#include

Last updated 1 year ago

Wanja · @muvlon
70 followers · 323 posts · Server hachyderm.io

SYNOPSIS
<stdio.h>
char *gets(char *s);

DESCRIPTION
This function is not a function of honor.
No highly esteemed functionality is implemented here.
No bounds are checked here.
What is here was dangerous and repulsive to us.
This message is a warning about danger.
The danger is still present, in your time, as it was in ours.

#include

Last updated 1 year ago

valoisa kvarkkitehti · @valoisa
265 followers · 7783 posts · Server eliitin-some.fi

@annakansalais <iostream>

using namespace std;

int main () {
bool working = true;
char proot[6] = {'E', 'n', 'j', 'o', 'y', '\0'};
while(working) {
cout << proot << endl;
}
return 0;
}

#include

Last updated 1 year ago

L'exiliat professor Grappa · @giorgiograppa
291 followers · 246 posts · Server mastodon.la

UNA SOLUCIÓ ALS PROBLEMES ORIGINATS PEL CANVI EN L'ESTRUCTURA DE REPOSITORIS D'ARCH LINUX (DE MAIG DE 2023) SOBRE LES SEUES DERIVADES

Al mes de maig, Linux va anunciar una modificació en l'estructura dels seus repositoris.

archlinux.org/news/git-migrati

Aquest canvi, és clar, va afectar totes les distros derivades d'aquella, entre les quals , que tinc instal·lada en tres màquines. Les instruccions que vaig trobar per a adaptar-se a aquells canvis (i poder continuar actualitzant de forma normal), o bé no estaven completes, o bé no eren clares o bé, simplement, no les vaig entendre bé. Com a resultat, després de fer-ne una aplicació (que, ara, puc suposar que va ser només parcial), els paquets propis d'EndeavourOS no s'actualitzaven (per sort, els que depenien directament d'Arch Linux, sí). Després de tres mesos llargs, he aconseguit solucionar el problema en les màquines, així que m'ho deixaré apuntat per ací, per si ho necessite més endavant i per si encara hi ha algú que no se n'ha sortit.

PAS 1

Com a root, editar el fixer /etc/pacman.conf i comentar (afegir # a l'inici de les línies) els repositoris que desapareixen:

#[community-testing]
= /etc/pacman.d/mirrorlist

#[community]
= /etc/pacman.d/mirrorlist

PAS 2

Assegureu-vos que el repositori propi d'EndeavourOS hi és:

[endeavouros]
SigLevel = PackageRequired
Include = /etc/pacman.d/endeavouros-mirrorlist

(Em sembla recordar que hauria de ser aquest el primer repositori definit.)

PAS 3

Deseu el fitxer i sortiu.

PAS 4

Sempre com a administrador, actualitzeu el sistema amb:

# pacman -Syyuu

(Després, feu el mateix amb yay per a actualitzar els paquets aur, si n'havíeu instal·lat algun.)

Tanmateix, és aquí on em vaig trobar amb un maldecap de claus no signades; si us passa el mateix, aneu al pas 5.

PAS 5

Sempre com a administrador, actualitzeu l'anell de claus d'EndeavourOS (no tinc ni idea de què vol dir això):

# pacman -Sy endeavouros-keyring

A continuació, proveu d'actualitzar (pas 4). Si el problema persisteix, actualitzeu també les claus d'Arch Linux:

# pacman-key --refresh-keys

[Davant de «refresh-keys» hi ha dos guionets: de vegades, el navegador en mostra un de més llarg.]

I torneu a actualitzar (com en el pas 4).

En el meu cas, cada màquina s'ha comportat de forma diferent: en una, he acabat amb el pas 4; en una altra, he hagut de fer el primer ajust del pas 5 i, en la tercera, tots dos ajustos.

CONCLUSIÓ

Probablement, la font de tots els problemes ha estat la meua insuficient formació (no conec bé el funcionament profund de pacman i els repositoris) i el meu pèssim anglés. Però estava força convençut que, en un lloc o en un altre, trobaria les instruccions completes i clares. Disculpeu, això sí, que us enllace les fonts: he anat saltant d'una màquina a una altra totes aquestes setmanes i no tinc forma de recuperar les adreces que he llegit.

#arch #endeavouros #include

Last updated 1 year ago

ハゲ · @hagehagehage
15 followers · 752 posts · Server mstdn.jp

"oppai.h"

#include

Last updated 1 year ago

Kincaid · @kincaid
91 followers · 882 posts · Server mendeddrum.org

@DJDarren PartyCannon

#include

Last updated 1 year ago

Carl Schwan :kde: · @carlschwan
1615 followers · 1392 posts · Server floss.social

@alatiera the issue was

<dirent.h>

Which I replaced by

<filesystem>

There is also getopt which I replaced by a dump version which only support -v

#include

Last updated 1 year ago

SWEEPING_GENERALITY.h

#include

Last updated 1 year ago

🐧MEU REFÚGIO NERD🍥 · @MeuRefugioNerd
941 followers · 12188 posts · Server mastodon.com.br

Quem estiver com problemas em compilar os módulos do Virtualbox no Kernel 6.4.0-3-amd64(pacote versão 6.44.11-1) tem que acrescentar a linha abaixo

<net/gso.h>

logo abaixo de /usr/share/virtualbox/src/vboxhost/vboxnetflt/linux/VBoxNetFlt-linux.c

depois tentar /sbin/vboxconfig novamente.

#include

Last updated 1 year ago