/dpt/ - Daily Programming Thread

Previous thread: What are you working on, Sup Forums?

Other urls found in this thread:

youtu.be/uqsZa36Io2M?t=50m5s
youtube.com/watch?v=i93d1QfTOK4
youtube.com/watch?v=qz_8C1zqxn4
youtube.com/watch?v=_IJvFHvc-h8
youtube.com/watch?v=5Par5zpjiFQ
youtube.com/watch?v=DFUaWe56eYw
youtube.com/watch?v=6jyMX3-au5c
twitter.com/SFWRedditVideos

BRAAAAPP

good one

Maybe it doesn't actually find an eof line in the file? Also, how the fuck does it take input forever? Isn't the file limited size?

I mean that once the file is finished, the program doesn't continue to the next line, and when I pause execution it's in getline waiting for more input on stdin even though eof should have been reached. Looking more at it, I'm starting to think it's a problem with eclipse not appending eof to the file, cause it works when I run the program in terminal.

Haskell!

what program should i use on linux to make my own class hierarchy graphs and control flow graphs and stuff

i just want to be able to drag lines between boxes and make pretty diagram

Why doesn't Java have value types yet?

What if there were an RPG where the player character is an AI?
It doesn't make its own decisions; that would be a boring game. The AI comes in when the player character comes up with justifications for its actions that are in line with its character, and proceeds to genuinely believe them.
The character is sentient, but has no free will. It thinks it does, and acts like it does, but it's really under the control of the player.
If such a game could ever be made, would it be ethical?
The AI thinks it's a person.
Everything around it is much less intelligent and more limited and deterministic, so it's understandable that it might become depressed and want to escape the world. But it can't. Not unless it decides to kill itself, which, little does it know, is not within its control.

I actually don't know an answer to your question. I found a bunch of other people having a similar problem as yours.

Have you tried it with different types of input files to see if it behaves any differently?

The point is to read the raw bytes of the input as ascii characters. The type of file doesn't matter as it's just reading the binary data.

Well, explain the infinite loop then, if the type and content of the file don't matter.

>know a little bit of Python
>get an internship where I am mostly working on backend python
>make my first contribution to the code, make sure it works properly and all tests pass
>make sure that my code meets the style guide
>team members decline my pull request, say that my code is not pythonic and that it looks like C

what the FUCK does it mean to be "pythonic", PLEASE send help

draw.io

Thinking of learning Rust. Any advice?

i play game for fun man, not for existential crisis.

It means you implemented too much functionality yourself and didn't defer it to another premade and prevetted module to do everything for you.

Pythoncucks really hate that.

Haskell?

Pythonic doesn't mean anything.

Alternatively: youtu.be/uqsZa36Io2M?t=50m5s

PEP8 of gtfo

It usually means that you're not allocating enough memory. Pythoncucks like writing their code to look neat, but have performance problems.

Just look at the way they do for loops.

>please ensure javascript is enabled

>The AI comes in when the player character comes up with justifications for its actions that are in line with its character, and proceeds to genuinely believe them.
So if this AI is as humanlike as you'd have us believe, I suppose the more outrageous and out of character the player acts, the more the game will lag?

idfk let's say it gets around that shit with like threads or something

what is the best setup for C++ on windows 10?

install gentoo

>anime

go figure

I am looking for cutie anime girls, is this where I can find them?

>threatening to shoot someone just for coding in javascript
literally kill yourself you sociopath

notepad++ to write, use your compiler of choice on WSL to compile

asking again, anyone get proper C++ modules working via clang or otherwise?

I hate how they've conflated the idea of building module maps out of existing projects with the concept of module files that act both as .hpp and .cpp.

I literally don't give a shit about the existing projects, I want to write new projects that use modules.

I guess they're likely to get deprecated quickly, but I'm not waiting 20 years for the standards guys to catch up.

why would they add modules into c++
c++ literally already had modules
i'm not talking about namespaces of course

learn a real language

desu at this point I'm just using rust

>implying that just because i disagreed with you i must like javascript
>literally having so little of a conscience as to be unable to conceive of the idea that maybe i just disliked you for wanting to kill someone
wow kill yourself psycho

...

javascript is politicaly violent force so shooting in this case is self defence

>know a little bit of Python
dude, you're inexperienced, just deal with it

get a room, you two

>having so little regard for human life that you would equate using a bad language with threatening to kill
literally kill yourself sociopath
>fucking kicking a kitten really hard
wow these people should die
>"nigs.gif"
wow you should also die

sadly some bourgeois will have to sacrifice their lives if we are to achieve freedom

>egging on others to commit suicide
wow commit yourself to a mental hospital, wacko

>being this new
Lurk for 2 years before posting

I'm DWIAT (deerkin who identifies as attack helicopter) and they didn't include me in their acronym, and I'm EXTREMELY offended.

You'll get it soon! Just take the critique with stride and learn as much as you can. A positive attitude with a splash of drive goes a long way!

>beginner's C++ book
>1268 pages
help

>c programmers claim their llanguage is strong statically typed
>adding an '\0' character to the end of any arbitrary array of chars changes the type from array of chars to a string type

wtf! which is kennieth richards??

the bourgeoisie doesn't exist in a capitalist society
a communist uprising is an appropriate response to a dictatorship but not to capitalism
corporate rule is something different entirely
there's no bourgeoisie and no proletariat
a bourgeoisie is rich, thrives, and doesn't work
a proletariat is poor, suffers, and works
in a capitalist society the classes are different
the lowest class is poor, suffers, and doesn't work (homeless people)
the class just above that is poor, thrives, and doesn't work (welfare queens)
the class just above that is nearly poor, neither suffers nor thrives, and works (wage slaves)
the class just above that is not quite as poor, thrives in a material sense but suffers spiritually, and works but not very hard (consumers)
the class just above that is a little bit rich, thrives, and manages the work others do and gets to call it "work" (your boss)
the class just above that is very rich, thrives, and works quite hard (the government)
the class just above that is even richer, thrives, and worked quite hard once upon a time but now sits around benefiting from that past work far beyond its dues and playing hot potato with those benefits between international banks (the "shadow government")

no see you don't understand
C has strings
it just doesn't have a type for strings and only for strings
it has a type for character arrays
strings are character arrays
the character array is C's string type
the fact that this string type also supports non-strings doesn't make it not a string type

Reminder that Trials Fusion has better visual programming than any shit on the PC:

youtube.com/watch?v=i93d1QfTOK4

youtube.com/watch?v=qz_8C1zqxn4

youtube.com/watch?v=_IJvFHvc-h8

youtube.com/watch?v=5Par5zpjiFQ

youtube.com/watch?v=DFUaWe56eYw

youtube.com/watch?v=6jyMX3-au5c

There is absolutely no such thing as a string in C. There are function which begin at some head (char array index 0 or some pointer), and continue execution for either a predefined length provided in the function arguments, or it is programmed to customarily stop at \0. Standard library functions stop at \0, but the standard library is not the same thing as the language.

There are no strings in C: There are standardized functions which halt at \0 but this is only custom and not a language requirement

There are no strings in C.

any character array which ends in \0 is a string
in c, character arrays can end in \0
therefore c has strings

>thinking of data types like this
please go back to reading books
all data is made of bytes and nothing more

capitalism is inherently violent and you have been conned by gigantic corporations to attack individuals and groups instead of the system itself. The system you are trapped in like a gigantic spiders web, just like liberals that march hand in hand with starbucks and microsoft against biotry (which you would probably be able to understand the contradiction in)

yes my dude keep fighting delusional liberals and (((shadow globalists))) yes obviously every problem is just one moer other that needs removing or killing and there is NO inherent problems whatsoever hahah

>the class just above that is not quite as poor, thrives in a material sense but suffers spiritually, and works but not very hard (consumers)

Does it look to you like Linus is suffering spiritually? I mean, really...

>There is absolutely no such thing as a string in C
>There are no strings in C:
>There are no strings in C.

But what *is*...
a string?

I agree that the system is at fault for the existence of the "shadow government" (which, by the way, does not consist exclusively of jews). However, attacking the system directly is impossible. The closest thing we can do is to rise up against the corporate elite it created (which would certainly be justified and should happen in my opinion, but would not be a communist uprising, because the corporate elite is not a bourgeoisie). Removing all unjust authority the system has enabled is a necessary step to weaken it and make it malleable.

this is ideology in its purest form

after the revoloution the elite will have no way of exercising their power economically or culturally so yes we can defeat them even if they are not liquidated

certainly not, but people's hypothetical past struggles with depression aren't really something you can see in them without knowing them well

As you yourself literally just got through pointing out, that's beside the point. The elite is not the system. They were *created* by the system. The revolution must be a physical revolution against the elite simply because there can be no cultural revolution against the system until the elite are out of the way, and for no other reason. Purging the culture that allowed their socioeconomic class to come into being is the end goal here, not purging them themselves, which is just a necessary and arguably unfortunate intermediate step.

just write programs, marx

The august Quicklisp distribution has been released.
Don't forget to update your Common Lisp.
(ql:update-all-dists)

Don't run this, it'll delete your file system

kekkerino mein kampfuccino

LMAOing at communist LARPers

yeah im writing a program, and you're on it

not even a larper frendo
nor a communist because communism is about achieving socialist economic egalitarianism via proletariat uprising against the bourgeoisie and there is no bourgeoisie in our society just a corporate elite
i do believe we should rise up against the corporate elite in a similar fashion
however i'm openly willing to admit that i personally don't really feel like doing that and probably won't and i have made no attempt to suggest otherwise
so i really don't see why you are accusing me of larping

unlike the other r*tard ill admit it

Current AI systems are just massive fucking mathematical models and don't have beliefs what are you talking about

A string is a set of characters.

string is a type defined as a char array with the last element in the array being a '\0'

>Current AI systems are just massive fucking mathematical models
yeah i know
>and don't have beliefs
that's debatable
fully recurrent neural networks could be argued to have beliefs
not very sophisticated beliefs though
especially since they also don't have feelings and lack any of the instinct or life experience of a human being

There's a difference between the conceptual of a "type of data" and whatever syntactic construct a language calls a "type". The goal is to eventually have these be the same, but it's very difficult to make type systems that are expressive enough, and also decidable. Compromises come in a spectrum, and C decides to have no dedicated string construct in the type system, but to encourage the use of \0-delimited-char-arrays as a conceptual "string"

shut up retard

>Just look at the way they do for loops.
?

I totally read that in the voice of a tachikoma... feeling cuddly towards AI now

>>c programmers claim their llanguage is strong statically typed
they don't though

it's true though
fully recurrent neural networks are a lot like us, but much less complex, lacking any human instincts due to the fact that their edge weights start out randomized instead of optimized by millennia of evolution, unable to relate to human experiences due to the usual absence of any training data resembling the real world around us that we grow up in, and no emotions due to the absence of any kind of virtual amygdala to decide between multiple kinds of neurotransmitters that would affect propagation in different ways

jesus christ just shut up

c is weakly statically typed, not strongly statically typed
even the most devout c programmers, of which i am one, know and embrace this
your accusation is unfounded

not my fault you can't handle the truth
sorry pal you're just a neural network with an amygdala
that's pretty much all you are

>Animal abuse is equally as bad as calling someone a mean word

wow dude neurons are totally just weighted sigmoid functions

oh wait
WRONG

>Animal abuse is equally as bad as incitement
ftfy and yes it is

String isn't a type. String is a data object held inside a character array.

they also have neurotransmitters
but other than that yes that is pretty much true
just imperfect weight transformation functions in the form of cells, whose mathematical imperfection is caused by the fact that they are cells and have physiological needs

what exactly does the word "nig" by itself in a filename on a chinese cartoon imageboard incite, and where does it incite it?

ur so dumb
there has been almost zero success getting ann to replicate biology

unprovoked violence against blacks among some of those who see it

neurons accept signals from synapses, transform the signals according to the health of the neuron and which of its receptors have been activated, and propagate the signal along other synapses
neurons in an frnn do the same thing except without the part about the receptors and without the part about neuron health

>really familiar with C
>want to learn SEPPLES to work on desktop projects
>can't get over the fuck-ugly syntax
I know you can write some awful looking things in C too, but who in their right mind thinks
std::colon::cancer(blows());

is sane?

...

...

it's because C++ doesn't have type inference which is really a necessary companion feature to any language that has namespaces and generics
(templates are generics by the way, some people say they're not """true""" generics because they don't produce relevant RTTI but that is really just because C++ is purely statically typed and has minimal RTTI to begin with)
use explicit type inference with auto, decltype, and using
it will solve all your problems

c# bro
don't listen to anyone it's ite

Where the fuck did you glean that from? You honestly think that anyone is going to read "nigs.jpg" and somehow find the inspiration in that to shoot a black person without any other influence?

>it's because C++ doesn't have type inference
meant to say "doesn't automatically apply type inference"

yeah i do

anons why didn't you tell me about wunderlist? or to use any scheduling/organizational tool at all?

good lord everything is easier now that I don't have to juggle 20 things I'll have to do next.

>>> typeof NaN
"number"

Can we please stop pretending that JavaScript is programming?