#printf
Explore tagged Tumblr posts
byteofsoup · 4 months ago
Text
Tumblr media Tumblr media Tumblr media
Slugcat stat sheet in the style of @littleguysdaily ... feel free to make your own!
Tumblr media
61 notes · View notes
draggoplush · 1 year ago
Text
Tumblr media
TeeTurtle - Reversible Dragon (Purple + Galaxy) - 4"
9 notes · View notes
fortunatelycoldengineer · 1 year ago
Text
Tumblr media
C language MCQ . . . . write your answer in the comment section https://bit.ly/3UA5nJb You can check the answer at the above link at Q.no. 20
3 notes · View notes
tinchicus · 7 months ago
Text
C++ / printf
Hoy veremos una de las funciones heredadas de C. Sirve principalmente para mostrar informacion pero con la opcion de formatearlo. Si lo aprendes a dominar, es una herramienta increible. Espero les sea de utilidad!
Bienvenidos sean a este post, hoy veremos otra forma de mostrar informacion. Como mencionamos esta funcion tambien nos pemite mostrar informacion en pantalla como si fuera cout pero con la ventaja de poder formatearla a nuestra necesidad. Esta funcion es heredada de C pero no quita que muchas personas la sigan utilizando al dia de hoy. Cuando la veamos en accion, veremos porque es muy popular y…
0 notes
ams-puppy · 2 months ago
Text
made some stuff for sugar and waffles
—Lain
159 notes · View notes
bynux · 11 months ago
Text
In a URL, yes. However, many C-style programming languages have a formatting syntax for interpolating variables into strings.
In the case of Scala, $i%4d means "put the integer value of i here in the string, leaving blank space for up to four digits and justifying the number to the right".
So for each iteration of the loop, you get:
1: I will not use code to cheat. 2: I will not use code to cheat. 3: I will not use code to cheat. (...) 998: I will not use code to cheat. 999: I will not use code to cheat. 1000: I will not use code to cheat.
This syntax originates from C/C++ (or at least that's where I first saw it), where functions like printf() are used to output calculated data in a human-readable format.
Microsoft has a more detailed rundown of how this syntax works on this site here. Scala is a little different in having the "$varName" before the format string, but the basic idea is the same!
/* Filename: Discipline.scala */ for (i <- 1 to 1000) { println( f"$i%4d: I will not use code to cheat." ); } // >:3
50 notes · View notes
cups-official · 2 months ago
Text
I love spending like 10 minutes trying to fix a bug when the bug is actually in my test
0 notes
sed-official · 3 months ago
Text
i saw this post and decided that i had some time spare, i could give AI another go. (link to post https://www.tumblr.com/dibelonious/778852078032404480/now-that-ai-made-troubleshooting-ridiculously. dont harass the poor old sod obviously.)
Tumblr media
i hear a lot of people irl at uni and some online say ai is great for coding, and so every couple months i try it out. sometimes with a very small project in a popular language (python or c, usually. though im forgiveful with c as everyone fucks up c.), sometimes with something simple (i.e. a couple lines tops with a naive approach if written idiomatically) but in a more unusual language with full documentation online. (like sed! yay!)
but every single time i come to the conclusion that even with being handheld chatgpt could not do what it was asked to do. even if someone tells it every issue in its outputs, itll remember for only one prompt. even if someone tells it the solution, itll find a new way to fuck it up.
below the cut is me trying to get chatgpt to make a working sed script that prints "meowwwwwwwwwwwwwwwww..." (long post warning)
(if anything reads weirdly, this was originally a reblog to the screenshotted post, then i decided to make it its own post. so that may be why.)
i cant remember the last time i ran into an issue that i couldnt fix in like ... 5 minutes. but knowing what chatgpt is like, any ask i give it will give me issues to troubleshoot. (yes this example is code, not linux proper. but its more of the same doing that.)
the other day i decided to write "meowwwwwwwwwwwwwwwwwwwwwwwwwwwww....." in many different languages, after seeing @brainfuck-official do it in BF. (link to post https://www.tumblr.com/brainfuck-official/773510105608192000) as is my blog, i asked it to do this in sed.
Tumblr media
great! this script doesnt work! it doesnt even come *close* to working, giving me plenty to try out chatgpt's troubleshooting skills! it also just doesnt make much sense. why the shebang but not making it executable? and why are the flags different (ones -f, ones -nf). also a counter? why though? thats not what im asking for? (you can see tags for a brief explanation on how to add a counter)
after telling it the script doesnt work (and why, something someone troubleshooting likely wont know) it just adds in a P. a command that prints a damn newline. but it lies about it printing a newline.
Tumblr media
(if you dont believe it prints a trailing newline and believe the AI instead, just try echo -n foo | sed -n 'P ; P')
anyways it alternated between no print statements and printing with newlines for the next ... 8 prompts, by which time i felt sorry for the poor bugger and told it to use e to print without a newline.
all the while it was trying to be more useful and add a count - making it print my string after n repeats instead of the infinite that i asked for. it was trying to subtract 1 with effectively s/[0-9]+/&-1/ which just appends the string "-1" to a number!
anyways, i tell it to use "the e command". there are three different versions of the e command in sed, and only one of them makes sense here. which did chatgpt use? none! it used the e regex modifier! which executes your pattern hold, then turns the output into the new pattern hold. and does not print anything.
ill just screenshot the last couple interactions minus only the useless exposition it adds to every response so you can see how stupid it is
Tumblr media Tumblr media Tumblr media Tumblr media
ignoring sed's requirement for an input this is equivalent to the python
Tumblr media
to be fair i never said there shouldnt be infinite meows, and this does have infinite Ws. but come the fuck on. this is clearly not whats being asked for.
#linux is best - yes. but learn to troubleshoot properly.#blindly copying code online without understanding it isnt troubleshooting.#regardless if that code came from stackoverflow or chatgpt.#anyways maybe it wouldve been better to write the equivalent in C with gotos and labels?#but at least everyone knows python#and i dont need to write c this way#also decided to see if it could find any info about me if i give it my name and county of origin#which is identifiable information but its outdated as ive changed my name (trans :3) and moved away.#anyways it thought i was from l*nd*n.#i told it where i was from (West Country. Very Much Not london.) and it thought i was a londoner. what in the hell.#yes if i said the name of most counties to an american online theyd probably think its in london.#but thats before they google the damn place! and this bot has access to the whole internet!#(for the yanks: it did the equivalent of calling an appalachian a californian)#(or at least i think thats close enough. im not really all that sure about what happens over the pond. and i like my ignorance here.)#wait the documentation tells you how to make a counter. at least twice.#IT COULD COPY CODE FROM THE INFO PAGES FOR THE COUNTER AND IT STILL GOT IT WRONG EVEN AFTER BEING TOLD WHY ITS WRONG#oh my god.#anyways in the docs they wanted to print the number. you can just hold n chars and remove one each loop#then break the loop when your hold is empty.#thats the easiest way ive found of looping n times (if you need the hold do this on a prepended line)#(not efficient but you can make it more efficient if you want. the docs explain how to! but its more effort and easy to fuck up soooooo...)#printing n ws though? just use e printf like it bloody demonstrates itself#no need to do inefficient shit in sed when someones written it in c for you.
0 notes
springcatalyst · 10 months ago
Text
teaching myself basic code and immediately just making 69 jokes to learn how integers and return variable work
1 note · View note
algumaideia · 1 year ago
Text
If anything, I think im learning to debug codes
1 note · View note
veiledinviolet · 2 years ago
Text
programming tip: if you want to square a number, write 'x * x', not 'pow(x, 2)'. maybe your compiler will optimize the latter to the former, but maybe it will stick with a generic implementation like 'exp(y, log(x))', which will fail for x < 0, resulting in Fun figuring out why your shader looks weird
1 note · View note
byteofsoup · 1 year ago
Text
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
Compilation of freaklets
148 notes · View notes
saintly67 · 3 months ago
Text
Okay i figured it out
Tumblr media
Terrible time trying to convert an integer representation of a binary number into something i can print into stdout to look like yhe hexadecimal representation like im going crazy for real
1 note · View note
fortunatelycoldengineer · 1 year ago
Text
Tumblr media
C language MCQ . . . . write your answer in the comment section https://bit.ly/3UA5nJb You can check the answer at the above link at Q.no. 33
0 notes
comicaurora · 1 year ago
Note
In your asks and other outside-of-comic statements, you seem to draw on parallels to programming a lot when talking about lacrimas.
And this makes me think as a programmer: the primordial rules that are used in Auroras to do magic and lacrimas are part of the primordial language. You are literally telling the primordial's dead bodies what to do, and they obey.
Yet, the difference that comes to my mind is that Primordial was at one point a language actually spoken. Used to communicate in day-to-day life by normal sentient beings. That's quite different from programming languages, which aren't meant to be talked in at all, and are built from the ground up purely to convey a series of precise instructions. They're very formalised and structured. There are no synonyms, no double meanings, no altering of word order, no redundant information etc. It's extremely rigid, much unlike languages people actually talk in, for which a degree of fluidity and ambiguity is essential.
And in Aurora it would seem the latter is being used as the former.
Have you ever thought about this tension/contradiction/conflict? How it affects the world, how it affects your writing, etc?
Or has this distinction never crossed your mind?
Or was this something you have noticed, but never really had the right knowledge to engage with much?
Or any other thoughts on the subject, really
So! This is an interesting thing I have actually thought about.
When the Elder Races were first created, they were born knowing and speaking a language innovatively called the First Language. Every new Young Race is also initially created speaking this language. The language then drifts over the generations, developing into regional dialects and then into separate linguistic descendants if given enough time.
The Ancients spoke a close descendent of the First Language for most of their time in existence, and made a writing system of their own very early on, which has no innate power. But in the early days of the world, the generally accepted story is that a god granted the three elder races knowledge of the written Runic language, which could command the elements. The Ancients acquired it late and used it very sparingly, only for the programming of lacrimas, but for the Elves and Humans living in the depths of the Caves, this was their first and primary writing system. It's even possible that a rare cave-dweller brave enough to venture to the surface was the one who taught the Ancients these runes in the first place.
It's posed an obvious question, of course. Why does this one specific form of writing manifest as a language of magic? Why can it command the dead Primordials? Why is it so well-suited to the phonemes of the First Language that every child of this world is created speaking?
The predominant theory - and, with two living primordials to check with, one which is potentially on the cusp of being proven - is that the First Language and its runic writing system are the language that the Primordials spoke. Its words, written or spoken, can be understood by the remnants of thought that still linger in the sleeping, dead-but-not-entirely-gone primordials that make up the world.
Primordial magic is different from programming in one key way: real computers are entirely unthinking entities. They are not in any way smart - not even smart enough to be stupid. A computer parsing a program cannot observe a missing parentheses and compensate like a human could do in their sleep - it simply fails to parse, because the mathematics don't work out.
Magic in this world is like what every programmer wishes programming could be. Tell the computer what to do, and it might be a little confused, but it'll get the gist. Tell Fire to burn in this direction - Fire, even if it's just running on an echo of a seven-thousand-year-old memory, knows what that means. Tell the wind to printf this statement to this recipient, it'll try to find them and send the message. Tell Life to make this body do what it's doing faster, it can do that. It's simple executions of simple commands, almost reflexive - things that require no complex higher thought from a being that is no longer alive enough to have them. They're not as unthinking as computers, and that means the nuances of language can actually have an effect on them. Some mages think more poetic and emotionally-charged spell invocations can lead to better, more efficient results - an appeal to a long-dead emotion might be easier for the Primordial to execute than an appeal to a half-forgotten complex thought.
When a mage takes direct control of a magical energy and funnels it into an elemental effect, their own higher thought allows the element to do more complicated things - Fire can't transmute on its own like it could when it was alive, but it can when bent to a mortal will. No need to translate a spell into the language of magic when the mage can simply use their own mind to shape the effect. This is the primary advantage mages have over lacrima-users - flexibility, complexity, and speed.
Another interesting factor. Alinua's dynamic with Life demonstrates what a living Primordial's living thought can do when in the hands of a mortal. A normal, simple healing spell cast by anybody but her just accelerates a body's own healing, but with Alinua's guidance steadying Life's hand, they can do much more complicated things of her own free will - things Life knows how to do that no mage knows how to command her to do.
282 notes · View notes
ams-puppy · 3 months ago
Text
Tumblr media
edgar doodles for art fight. I'll be putting izzy's au up!
printf("Sugar and Waffles!"); fans.. where yall at!
40 notes · View notes