/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: DPT.png (934x1000, 389K)

Other urls found in this thread:

youtube.com/watch?v=GMqQOEZYVJQ
twitter.com/AnonBabble

>BSL 1.0
So doesn't it have the copyright line with your name or whatever in it?

First for being at that point in the semester where all the scrubs can't do their own homework any more

No I just wrote:
Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:

The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

In LICENSE

stanky query language or original QL what's better

>warning: crate `rustTest` should have a snake case name such as `rust_test`, #[warn(non_snake_case)] on by
default

>should have a snake case name
>such as `rust_test`

What did Rust mean by this?

Stop using std::endl

Attached: 234279.png (460x460, 289K)

Why?

Do you have brain problems?

Have you contacted him?

You people really want to find any reason to hate this language and justify still using C++.

Just admit that your retarded shitpen of a language has been overthrown by people with basic instinct about what constitutes a good programming language.

I don't even use C++
>2018
>having to write header files
>no package manager
hahaha

>What did Rust mean by this?
That your crate should have a snake case name

youtube.com/watch?v=GMqQOEZYVJQ

No. I got scared and deleted the repo.
I don't mind it anyways. Probably should've gone with AGPL but meh, I wasn't planning to go too far with the repo anyways

>No. I got scared
Why?

Maybe because it flushes the stream? No idea really.

modules are coming Real Soon Now™

Sorry, I misread snake case name as camel case name. Forgive me, I'm a bit rustie ;)

>He wants me to get sued over patents

>modules
C++ modules aren't real modules
You still have to write header files
Now you have to write both header files and modules
hahahahaha

Yeah, that's its entire point. If you want a newline character without flushing the output, you can just use "\n"

Apparently this guy just didn't understand what std::endl was, felt betrayed when he learned it was different than he expected, and is now advocating against its use because of that?

Reminder nobody in here can program anything

>You still have to write header files
No you don't.

Not every OS uses \n, Windows uses \r.

I think the point is that endl is supposed to be platform specific, but that shouldn't be inherent to flushing.

You do on Windows but that's just Windows being so fucking archaic.

>r
r for retard lmao
who cares about windows they go wsl anyway lol

Attached: projecting.jpg (490x333, 29K)

>Not every OS uses \n, Windows uses \r.
Writing \n to a file opened in text mode will write the platform-specific newline sequence for whatever platform it's compiled for. std::endl is no more of less platform-specific than "\n" is. Its only behavioral difference is that it flushes the stream.

Yeah, I just use "\n" because situations where I have to manually flush streams just don't come up for me normally.
endl is always \n. Even though Windows officially considers \r\n its line ending, \n will still work as a newline on it.

>Even though Windows officially considers \r\n its line ending,
I hate this piece of software so much.

How much slower is literally everything in Windows because every line has an extra 2 bytes to be parsed?

Attached: image.png (620x349, 459K)

>How much slower is literally everything in Windows because every line has an extra 2 bytes to be parsed?
Not very. The bigger problem is how much shit is in UTF16 for no good reason

are you nerds seriously talking about talking to computers lol

lol I know right gurl? this is like so ugh lame xD

Attached: 1523216537874.jpg (653x363, 40K)

Nah, we're only talking about abstract Turing machines in these threads.

Lol ummm okay (=
Maybe you could come over and do my Java HW
Haha kidding but I could e-mail it to you?

Ok sure. My email is moot@Jow Forums.org.

Holy shit are you actually moot

Who?

what does it mean to flush a stream?

redpill me on tkinter
Good resource that is short, yet detailed enough to get me started?

Any logic programmers in? Is there a name for a method for computing a derivation between sequents instead of just a derivation for a sequent from nothing?

Like, I want to derive Γ ⊢ J from Δ ⊢ J', not Γ ⊢ J from ⊢.

wtf are you talking about

Which is superior?
if condition:
return True
return False

if condition:
return True
else:
return False

return condition

>Literally the same machine code

So? There is more to code than what the compiler is going to spit out.
I could name my loop variables aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa and it would still output the same machine code.

That works, and is certainly more elegant. But what if the return value is not a Boolean?

return condition ? a : b
If it doesn't fit nicely into a conditional operator (too long or more than 1 statement), just use whatever. It's not important.

when you pinch some loaves, do you flush the toilet after every loaf, or do you let the loafs accumulate, then flush?

this is easily parsed and more readable
if condition:
return True
else:
return False

i prefer
if (condition) {
a
} else {
b
}

first one, obviously. having ANY unnecessary constructs ANYWHERE is ALWAYS wrong.

Then you need to use a better language.

I'm an illogical programmer

well my poops are pretty big so i have to flush after the first loaf otherwise the toilet clogs and then i have to bring out the plunger

Looking to learn Erlang. I'm already proficient at C and other imperative languages. Where do I start?

Attached: 1540236337656.jpg (480x580, 26K)

using "return" is bad in general, it's basically a goto statement and isn't referentially transparent. you should avoid it where possible, or switch to a better language.

and i/o buffers do the same to streams of data. hope this helps. :^)

functions are basically goto statements when you think about it
so are loops and ifs
fuck programming is hard

what? functions aren't goto statements at all, pure functions are referentially transparent so

>call a function
>it goes to a seperate part of the program

what's "it"?

the instruction pointer

>execute a line of code
>instruction pointer goes somewhere else
???

kek

>goes
>goto
hmmmmmmmmmmmmmm

Then I guess every line of code is a goto statement

funclets. when will they learn?

Attached: 57379537435.jpg (1280x540, 69K)

Attached: 1541519831254.jpg (1931x1300, 1012K)

>his macro doesn't expand to 136 lines of code

Where should I start?
I want to be able to create programs to make my work/life easier. I have a dexamphetamine script and enjoy that kind of robotic/autistic shit so at the very least it'll give me a hobby.

>he has a complete separation of graphs and matrices
>because he's a """programmer""" ie secretary
god I love math
god I love bootlicking codemonkeys

Attached: 1539987990972.gif (844x720, 726K)

I swear every fucking time no matter how good phone cameras are these days every single one of the faggots will use a phone with a piece of shit 144p camera

:think:

how does it feel to be a codemonkey?
Ever just want to quit your job and make videogames?

>no I feel if I perform well enough, master will promote me
Hahahahahaha

>just found out averaging two numbers is patented
I WANT TO KILL THESE FUCKING PATENT JEWS SO MUCH FUCK!

Attached: 1538759723990.png (832x868, 371K)

patents dont mean shit anymore

is this your RSS feed of other Jow Forums threads?

>a Jow Forums RSS feed
Actually a good project idea

Attached: 1540486335644.jpg (544x638, 34K)

>typing in "codes" all day
Wow hahahahha
Nice work if you can get it.......... I guess?

>tfw you work a shit job, but it's easy, and you live in a poor area, and have more take-home than your friends who chased that west-coast fantasy
Hahahahah

Attached: realdoll con.jpg (275x183, 10K)

where did HR touch you?

scrumm put its dick in my butt
and then laughed at me

Attached: 1541533041763.jpg (3024x3570, 1.37M)

I'm trying to justify implementing a function which takes a thunk (no argument function) and collects the output of the thunk until the output passes some arbitrary predicate test (which is also given as another function
function call would like so
(f thunk predicate)


My question is, in what contexts would you use this function?
Also, what's a good name?

a function with no arguments is useless, so, none

id name it "fucking stupid imperative shit im bad at coding"

wow who is this anime
it's definitely not a hideous male

thanks for the programming-related post btw

Functions aren't procedures, dummy.

I'll be a cute girl and a great programmer by the end of the year >:3

maybe it returns different values for each call, you dumb retard gorilla nigger

That means it's imperative.

There are legitimate uses for noarg functions in in certain pure functional programs but this isn't one of them.

how the fuck else am i supposed to work with ports

imperative != bad
restricting self from certains styles of coding "just because" is stupid
that said, I don't mean one should violate the spirit of the language

a function that returns a different value each time you call it is a misbehaving function.

it's not just because nothing, it's """just""" because it's the inferior programming paradigm.

i think these functards think their code is executed in la-la-land or something and not a von-neumann machine

you can do monads in scheme or whatever other lisp that is

what did he mean by this?