/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: edgy_dutch_man.jpg (1200x1600, 799K)

Other urls found in this thread:

en.cppreference.com/w/c/language/struct_initialization
stackoverflow.com/questions/54056266/what-does-this-obfuscated-c-example-do
twitter.com/NSFWRedditImage

Fucking hate that cunt.

why doesn't c+=1 have this

struct thingy t = {
value: 'valu',
label: "label"
};

Doesn't have hwat exactly? Dynamic typing?

drugs make you a bad programmer

Attached: melee_donkey.jpg (480x360, 36K)

what makes one a good programmer than

What are some good things I can test list folding on?
main = list 0 sum 0:
:: list @m[8 1 2 3 4]
:: sum @fold (\a b =: + a b) 0 list 4
_i sum

clean living and church on sundays

Attached: 1550923749002.gif (482x479, 774K)

What are some programming languages for the realest of negroes?

No one is good at programming

How do I access the internet via a nodjs app? The nodejs runs a server via localhost but because it is based on electron there must be a way to access webpages right?
>inb4 nodjs & electron are shit
I know, but I didn't make that choice, it is not my project.

Please talk me out of learning Haskell

Why? It's unsarcastically a good investment tbqh.

>on sundays
everyday, if possible

Because I'm a noob with only intermediate Python experience, and my interests are primarily amateur game development. I also don't want to invest a ton of time into something with little future application in terms of transferrable knowledge. I'm very interested in Haskell, but I have no idea what I'd even do with it.

Haskell and Assembly had sex and made this

i thought she hated sundays?

>I'm very interested
Honestly, that's the only thing that matters.

Try it and see for yourself.

nobody says you have to enjoy church but you still need to go

No, "designated initializer", also using .name syntax
struct thingy t = {
.name = 65535
};

did they use the condom monad

>haskell files are .hs
>.hs = homo sexual
>.lhs = large homo sexual.

this may have been a good joke if it weren't for the fact that heterosexual is also hs

Attached: 1549724886208.png (483x487, 201K)

As someone who only uses Python to enhance the productivity of their non-coding job, how do I start to write better code when I rarely share it with someone else who knows how to program? I sometimes spot an easy refactor when I extend/reuse existing programs & scripts so I know I'm not being great with best methods.
>Also how do I learn C without spending too many hours? It will not be used a lot so I don't want to invest too much time learning something I may not use often.

Attached: Intelligent Gentleman.png (666x607, 158K)

but c has it since c99

en.cppreference.com/w/c/language/struct_initialization

DUMB frogposter

Why doesn't ++c have it

C++20 is introducing it.

No such thing as good python code. The language is designed to not be compatible with good practices. Not even the must have libraries manage to comply with the python style guide.

I've done some thorough analysis, and I don't think it can be done. There's nothing in the preprocessor, and nothing in the language. _Generic is simply unique, so I will have to use C11.
Still decent though. Better than C++.

>Dumb frogposter
>Image clearly reads "Intelligent Gentleman.png"
Clearly Jow Forums doesn't rate literacy and comprehension very highly if you're calling ME the dumb one.

Wow cool

>No such thing as good python code.
Wrong.
>The language is designed to not be compatible with good practices.
Also wrong.
>Not even the must have libraries manage to comply with the python style guide.
Also wrong.

did you ever got paid for writing python code? fucking NEETs i swear on me mum

Attached: _.png (1998x1040, 236K)

never reply to me again you stupid frogposter

use fold to create an unfold

Read professional code. It can feel like a chore, but do.
>Learn C fast
Literally just learn the syntax, which is very small, and write programs to handle files and some data structures, some based on arrays and some in pointers.
It shouldn't take long.

Literally fuck off. Python should've never existed in the first place, I still can't get over the psychological trauma after realizing that that abomination took off. I mean, how the fuck

use fold to define map, ++, product, sum, etc

dude

shut the fuck up

Why does MSDN have like 5 different versions for the same pages and it asks you to go to this or that, and not just merge them all?

Attached: 41274812374.jpg (610x662, 53K)

for(;P("\n"),R--;P("|"))for(e=C;e--;P("_"+(*u++/8)%2))P("| "+(*u/4)%2);

You have ten seconds to decipher this statement.

Attached: 1524048021388.png (713x229, 28K)

Attached: 1551033638589.jpg (600x525, 49K)

the fuck does P() do? i am also pretty sure you can't add a number to a string in C.

I'm writing an autistic automatic memory manager in C

I thought you were talking about annotations for debugging for a second

stackoverflow.com/questions/54056266/what-does-this-obfuscated-c-example-do

Spent the last 2 days trying to make the right collision in Unreal.
Doesn't matter what I do, the reflection angle is wrong.
Google turns up nothing and I'm the only one at work who has any idea how Unreal works.

...

tar xvf archive.tar

wow

Ye thanks, tho I'm just sharing what I'm working on since it's a dpg, not asking for advice.

But I'll head to agdg anyway.

I don't know much about him. Why do you hate him? Didn't he just talk about algorithms and traveling salesmans

Traveling autist problem

I guess something he liked was called harmful and now he's butthurt over it

He's the epitome of the smug mathfag.
He has never called something I like harmful, but I do hate the entire "considered harmful!!!" meme he inadvertently spawned and I hate how many programmers parrot his essays without really understanding why they were written.

>epitome of the smug mathfag.
looking up more about him and that seems right
looks like he never did anything practical in his life, didn't even own a computer

>looks like he never did anything practical in his life, didn't even own a computer
B u t A n o n

Attached: edsgerdijkstra1-2x.jpg (1200x630, 62K)

based and redpilled

Attached: 1493004554755.gif (320x240, 2.42M)

can sepples change return type based on a constexpr?

I bet Djikstra got the shit bullied out of him

>designated initializer
A constructor?

This isn't rhetoric. I'm relatively well versed in C++, and I don't know what you're complaining about

Attached: 41x4d9m5eg411.jpg (960x884, 83K)

no need, we already have rust.

1. Rust is shit
2. It's an exercise

Attached: 1551463879376.jpg (400x400, 28K)

I'm installing all my favorite compilers and interpreters on my old shitblows computer that I revived with Mint. What new languages should I try?

I need to program something that takes an image as an input and calculates the front-facing area(s) of a box, or several boxes, that are within the image. I don't even know where I would begin with something like this?

Attached: 7a53624d1b4f588adddf23020a042261.jpg (1047x854, 155K)

Ada

what's is this program for? college?

python, opencv

1. No
2. How is using `__attribute__((cleanup(X)))` an exercise

What's the best intro to logic book? Is there a logic equivalent of the SICP?

find the position of the corners -> apply an inverse perspective transformation -> calculate area

reflecting a vector is
output = input - 2 * dotProduct(input,collisionNormal) * collisionNormal

>what's is this program for? college?
it's for my wagecuck job

But he did create a 98% pure blue meth.

I'm writing it from scratch

There's one that I really liked that I took out from my university library, I'm spacing on the name but I'll look for it

c++

struct annoying {
int height, speed, intelligence;
annoying(int h, int s, int i) : height(h), speed(s), intelligence(i) {};
};

annoying thing(72, 200, 115);
// Fixed order, no labeling, magic numbers


c99

struct c99 {
int height, speed, intelligence;
};

struct c99 thing = { .intelligence = 115, .height = 72, .speed = 200 };
// Labeled, any order you want


gnu

struct gnu {
int height, speed, intelligence;
};

// etc
struct gnu thing = {
intelligence: 115,
height: 72,
speed: 200
};


I know C++ has a lot of features so if you know something, say something.

what's the point when constructors exist

...

ah, I see.
Will c++20 have named arguments or just designated initializers?

thats basic vector math friend i know how to calculate it, the problem is the reliability of the collision normal in Unreal. I put that exact formula to the test 2 days ago and it didn't work. There must be some other catch that I was not aware of, as some agdg guys pointed to physical material. I will look into it next week.

try debug drawing your normal vectors then to see if they make sense, there shouldn't be any complications involving materials

The code tags suck, come join me in my useless thread that won't solve anything.

>What are you working on, Jow Forums?
Learning clojure and figuring out this repl nonsense.

Attached: issme.jpg (485x443, 48K)

could someone give me the rundown on veriadic functions in c++?

Attached: Jang.Seungyeon.full.177328.jpg (1200x1800, 421K)

focusing on performance is pointless since memory caps out at like 1600mhz which is way slower then your cpu

Then use Assembly or even Jazzy or anything else that lets you control when you access the stack and lets you use cache awareness.

>using the CPU cache

Might as well just print out all your data and physically mail it to the NSA.

modern CPUs can recognize common pattern of memory access and requests them before they are even needed.

I am one of the few people with access to a Q right now I am working on getting the equivalent to fadd and fsub going.

>have skills but no motivation to make anything

what do

T H O T
H
O
T

>not mixing your code up to keep your CPU guessing

Project Euler.

You can't avoid the cache, dipshit. Might as well use it smart.

have no brains for that

In Python, how could I apply a context to certain classes?
i.e.
class MyClass():
def foo():
print(self.env.bar)
with MyEnvironment(bar='bar'):
MyClass.foo()
# output: 'bar'

intentionally fill it with random trash to throw the CIA off your tracks

shitpost harder

You're practically glowing in the dark

>muh terry

lmao how is your cult going