[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Edit][Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
4chan
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1771929386415.jpg (106 KB, 1200x1200)
106 KB
106 KB JPG
What are you working on, /g/?
Previous: >>108194628 →
>>
>>108226774 (OP)
unbased and gae. Why are you gae?
>>
>>108226814
Cocks are delicious.
>>
>>108226829
I have to admit, that's true.
I am not really gay, but sucking a huge dick is a lot of fun. I do it regularly
>>
I'm carving your mother with my pork chisel if you catch mi drift.
>>
>I'm sharing this general with autists and faggots and autistic faggots
>>
File: 1770369153948136.png (256 KB, 735x656)
256 KB
256 KB PNG
>>108226868
Programming is autist-coded.
>>
>>108226878
I'm starting to realize that. You can't teach them jack.
>>
>>108226890
>teach them
wow you're so full of yourself
>>
>>108226895
Hard not to, considering this general.
>>
File: mycock.png (10 KB, 576x347)
10 KB
10 KB PNG
>>108226868
I do feel very agitated in the past few days.
But I have also started to eat more trash sugar again.
So I don't know. Maybe my hyperfocus is wearing off or I should really unironically quit bad sugar for good now. Tho I am craving hard again in the past days :(
Doesnt feels THAT good.
Thank you for reading my tweet
>>
NIGGA I'M GONNA LEARN SEE SHARP
>>
>>108227992
ok just learn rust then
>>
>>108228435
Eww no.
>>
File: gamewiki.png (659 KB, 1009x2426)
659 KB
659 KB PNG
I am configuring a mediawiki site for cataloging video game cameos in movies and TV. So if a character is sitting on the couch playing a video game, I add the game to the film's wiki page and it generates a table in the game's wiki page automatically.
>>
>>108228491
>Mediawiki
They hate white people.
>>
>>108227992
>NIGGA I'M GONNA LEARN SEE SHARP
c# is super gross. microsoft and unity is a shit pile. they're both garbage tier companies. there's never a usecase for c#. just do unreal engine or godot or lua or anything else for games. for web or scripting literally any other language is decent.
>>
>>108228491
do it with fossil instead: https://fossil-scm.org/
>>
>>108228491
Honnestly very cool anon, I hope you get to make the public and that it grows.
It's nice to have a wiki but you should also make a database right from the start so that it can be queried by date, game, movie, etc.. Like imdb, imcdb (Internet Movie Cars Database), tunefind, etc..
>>
>>108228774
I'm gonna use it with Monogame to make funny little 2D games.
>>
AH GOD HELP ME I LEARN PROGRAMMING FROM TIME TO TIME JUST BECAUSE I CAN I HAVE NO USE FOR IT AAA
>>
>>108226774 (OP)
my launcher is now fully featured i think. spent a few days refactoring all the stuff do do with building the app grid as it was pretty laggy kek
>>
>>108230508
>I'm gonna use it with Monogame to make funny little 2D games.
okay but just check this for one second. this is how you're gonna have to do animations. with xml ( ew gross)
https://docs.monogame.net/articles/tutorials/building_2d_games/09_the_animatedsprite_class/index.html

this is how godot does it ( just ui fun ):
https://docs.godotengine.org/en/stable/tutorials/2d/2d_sprite_animation.html

and this is how love2d does it ( simply cute )
https://www.love2d.org/wiki/Tutorial:Animation

the choice is yours. but bros warn bros about xml.
>>
>>108232352
>https://docs.monogame.net/articles/tutorials/building_2d_games/09_the_animatedsprite_class/index.html
>XML
>Test Your Knowledge
SOVL
>>
>ask claude to create some sample data for testing
>creates fake users and customers with the names of my family, their surnames and the actual cities some of my family lives
>creates a test user with MY NAME and MY CITY but genderswapped

how the fuck did it know????
>>
>>108233309
Well, you use Claude, so you and/or your family are probably certified retards who put their personal information into everything.
>>
Write a program that reverses the words of input string:

Enter a sentence: you can cage a swallow can't you?
Reversal of sentence: you can't swallow a cage can you?


Programming in C: a modern approach chapter 8 project 14
For some reason this took me longer than I care to admit.
>>
>>108233348
#![feature(iter_intersperse)]

fn main() {
let text = "you can cage a swallow can't you?";
let rev = text.find(['.', '?', '!'])
.map(|p| text.split_at(p))
.or(Some((text, "")))
.map(|(text, suffix)|
text.split(' ')
.rev()
.intersperse(" ")
.chain(Some(suffix))
.collect::<String>())
.unwrap();
println!("{rev}");
}
>>
>>108233348
>everses the words of input string
>you can't swallow a cage can you?
it says the function operates on a "string", but the test has it reversing the words of a sentence, preserving grammatical features that "string" does not at all imply.
typical C to be vague about types like this. Go be vague about the length of an array, jerk. Go be vague about whether a pointer is to mapped memory or not.
grug ocaml:
let rev_words s =
let r = Buffer.create (String.length s) in
let j = ref (String.length s) in
for i = String.length s - 1 downto 0 do
if s.[i] = ' ' then begin
Buffer.add_substring r s (i + 1) (!j - (i + 1));
Buffer.add_char r ' ';
j := i
end
done;
if !j > 0 then Buffer.add_substring r s 0 !j;
Buffer.contents r

let () =
assert (
rev_words "you can cage a swallow can't you"
= "you can't swallow a cage can you");
assert (rev_words "yes" = "yes");
assert (rev_words "zero-length word: " = " word: zero-length");
assert (rev_words "is this stupid?" <> "stupid this is?")
>>
>>108233450
you have "you hates google.com" reversing to "google hates you.com"
>>
>>108233450
this does however absolutely murder OCaml in performance in a very normal microbenchmark like 5000 consecutive reverses of a 10000-word, 93k byte string.
even I reuse a Buffer for all of that it's 950ms to 34ms.
>>
>>108233450
>#![feature(iter_intersperse)]
I don't know man.
Rust sounds, from the concept, like a cool language, but how would one know all these stupid features and require and shit like that? Why can't they just get rid of this stupid shit? No one ever understands when and why they are needed.
it's worse than gcc directives
>>
>have an idea
>start working on it
>realize even if you know what you're doing it still takes dozens if not hundreds of hours to make the most basic usable app
>claude is next to useless and hallucinates bullshit 60% of the time and the other 35% of the time it spits shit out that doesn't work
yeah like no wonder all of the people talking about "running 20-30 claude instances in a cluster" never produce anything lmao
>>
>>108234907
In 95% of my interactions with LLMs I just end up calling them useless cucks ad infinitum.
Good thing I'm not on a plan.
>>
File: 1749384253074648.png (64 KB, 863x305)
64 KB
64 KB PNG
Grok CLI soon, maybe
>>
>>108233348
I thought you just reverse the order of letters, "you can" -> "nac uoy".
>>
>>108235225
Isn't that literally how Vietnamese works?
>>
>>108233628
It's a very simple thing to fix.
#![feature(iter_intersperse)]

fn main() {
let text = "you hates google.com!";
let (text, suffix) = text.rfind(|c| !matches!(c, '.' | '?' | '!'))
.map(|p| text.split_at(p + 1))
.unwrap_or((text, ""));
let rev = text.split(' ')
.rev()
.intersperse(" ")
.chain(Some(suffix))
.collect::<String>();
println!("{rev}");
}


>>108234680
>Why can't they just get rid of this stupid shit? No one ever understands when and why they are needed.
Rust is not designed behind closed doors, you can just read about it:
https://github.com/rust-lang/rust/issues/79524
The feature is not that new so and it was about to be stabilized. However it is in conflict with itertools::intersperse.
https://github.com/rust-lang/rust/issues/88967
Every new change in Rust is being tested against all known source codes, and it turns out this would break some crates that rely on itertools. In order to fix this and potential future conflicts they need this feature:
https://github.com/rust-lang/rust/issues/89151
And that feature is about to be stabilized. It's in the final comment period:
https://github.com/rust-lang/rust/pull/148605
Once this gets stabilized, the stabilization of intersperse will begun, after which feature gate will no longer be necessary and you will be able to use it in the stable compiler.
Rust is just very cautious to not cause any breakages and to not stabilize halfbaked solutions. Any unaddressed concern bumps things back to the scratchboard. Fortunately things can progress independently so you do not have to wait for Rust++28 or have something bad being rushed out.
>>
>>108235444
>It's in the final comment period:
Oh, it's literally being released right now:
https://github.com/rust-lang/rust/issues/152802
>>
>>108235267
.oN
>>
>>108232352
Unfortunate, yes... BUT WHERE ARE YOUR CAPITAL LETTERS YOU GODDAMN DOOFUS
>>
>>108236204
nta but it looks to me like you stole them all
>>
>>108236249
You are that anon, spiritually.
>>
File: 1740935345190634.png (1.28 MB, 1462x1814)
1.28 MB
1.28 MB PNG
>>108233348
let res = inputString.components(separatedBy: CharacterSet(charactersIn: " .!?"))
.compactMap { $0 != "" ? $0 : nil }
.reversed()
.joined(separator: " ")
return [".", "!", "?"].contains(inputString.suffix(1)) ? res + inputString.suffix(1) : res
>>
>>108236260
i will take that as a compliment.
lowercaser gang represent
>>
>>108236268
>>108233628
oops

var res = inputString.split(separator: " ")
let suffix: Substring = {
guard let last = res.last, [".", "!", "?"].contains(last.suffix(1)) else { return "" }
res.removeLast()
res.append(last.prefix(last.count - 1))
return last.suffix(1)
}()
return res.reversed().joined(separator: " ") + suffix


//you can cage a swallow can't you? -> you can't swallow a cage can you?
//you hates google.com -> google.com hates you
>>
>>108236448
Tranny
>>
File: 1770542417029208.png (15 KB, 90x90)
15 KB
15 KB PNG
>>108236455
what's trooncoded about swift?
>>
>>108233348
 print("${"you can cage a swallow can't you?".split(" ").reversed}");
>>
>>108236918
and this is why you niggers NEED child-proofed languages.
>>
>>108236918
you? can't swallow a cage can you
>>
>>108236939
not my problem thats bad input
>>
What's the fastest way of doing lots of small reads from a file on disk? Memory mapping?
I have a table of floats stored in row-oriented format and need to extract only a few columns out of 10000 and there's around 7000 rows. So I need to read through the rows and extract 5 floats from each one.
>>
>>108236918
this is the type of person that complains about leetcode interviews btw
>>
>>108233348
#include <stdio.h>

int main(void)
{
char input_string[256];
char c;
int length = 0;
char punctuation = '\0';

printf("Enter text: ");

while ((c = getchar()) != '\n' && length < 255)
{
if (c == '!' || c == '.' || c == '?')
{
punctuation = c;
}
else
{
input_string[length++] = c;
}
}

input_string[length] = '\0';

int word_end = length;

for (int i = length - 1; i >= 0; i--)
{
if (input_string[i] == ' ')
{
for (int j = i + 1; j < word_end; j++)
putchar(input_string[j]);

putchar(' ');
word_end = i;
}
}

for (int i = 0; i < word_end; i++)
putchar(input_string[i]);

if (punctuation != '\0')
putchar(punctuation);

putchar('\n');

return 0;
}
>>
>>108236997
yes
also switch to a column-oriented database
>>
>>108237090
That is in fact the program that I am writing
The row-oriented format comes from legacy software from the 80s. The vendor refuses to touch the Fortran core because it's so battle-tested.
>>
File: lain rat.jpg (715 KB, 2048x2048)
715 KB
715 KB JPG
fixed
    String input = "you can cage a swallow can't you?";
print(
"${[for (int i = 0; i < input.substring(0, input.length - 1).split(" ").length; i++) input.substring(0, input.length - 1).split(" ").reversed.toList()[i]].join(" ")}${input[input.length - 1]}",
);
>>
  String input = "you can cage a swallow can't you?";
bool hasPunct = ["?", "!", "."].firstWhereOrNull((punct) => punct == input.substring(input.length - 1, input.length)) != null;
print(
"${[for (int i = 0; i < (hasPunct ? input.substring(0, input.length - 1).split(" ").length : input.split(" ").length); i++) (hasPunct ? input.substring(0, input.length - 1).split(" ") : input.split(" ")).reversed.toList()[i]].join(" ")}${hasPunct ? input[input.length - 1] : ""}",
);
>>
>>108233348
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "sds/sds.h"

int main(int argc, char *argv[])
{
char *line = 0;
size_t size = 0;
sds *tokens;
int count = 0;
getline(&line, &size, stdin);
if(!line)
return -1;

tokens = sdssplitargs(line, &count);
for (int n = count - 1; n >= 0; n--)
printf("%s ", tokens[n]);
puts("");
sdsfreesplitres(tokens, count);
free(line);
return 0;
}




[Advertise on 4chan]

Delete Post: [File Only] Style:
[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Edit][Settings] [Search] [Mobile] [Home]
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.