/dpt/ - Daily Programming Thread

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

Attached: 1543464564800.jpg (1006x706, 163K)

Other urls found in this thread:

youtu.be/sQurwqK0JNE
pastebin.com/EisFqacf
pastebin.com/ytsixGfJ
pastebin.com/KyDKALQT
threadreaderapp.com/thread/1080069784644059139.html
apress.com/us/book/9781484230176
twitter.com/AnonBabble

>What are you working on, Jow Forums?
I'm 27 and just got let go from my comfy logistics manager job, I got severance so I'll have a period of time that I can devote to learning a language and hopefully can keep learning while I work at another job.

I'll be learning C# so right now I'm watching
youtu.be/sQurwqK0JNE
and hoping it will all click in to place since I'm a bit slow headed.

Attached: purevanilla.jpg (335x310, 15K)

Trying to learn maths.

Attached: welp.jpg (599x769, 104K)

Here's vuln.c
pastebin.com/EisFqacf

Here's the code I'm trying to get it to run:
pastebin.com/ytsixGfJ
pastebin.com/KyDKALQT

Which comes out to
\x50\x48\x31\xd2\x48\x31\xf6\x48\xbb\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x53\x54\x5f\xb0\x3b\x0f\x05

Now when I do
$ python -c 'print("\x50\x48\x31\xd2\x48\x31\xf6\x48\xbb\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x53\x54\x5f\xb0\x3b\x0f\x05")' | ./vuln
I get either a segfault or illegal instruction and it crashes. What am I missing here?

Attached: 1510618002162.jpg (620x906, 251K)

Also this shit's only 200 points and meant to be solvable by high schoolers.

Attached: Untitled.png (1150x240, 11K)

I just started learning my first language Java from picrelated. What should I focus on doing if I want to make a career out of coding? I'm learning concepts and some basics things, but I have no grasp on how this all fits into the real world. Are there some good projects I can do to get a solid footing here?

Attached: java.png (1311x514, 190K)

JavaScript rocks!

Attached: js_rocks.png (1433x779, 473K)

Isn't the stack is marked non executable? If that's not it then run it through gdb.

You can't just slap some shell code into a buffer. You need to actually manipulate the return address of that function into some memory you control (possibly with the help of a noop sled) where the shellcode is actually contained.

I miss advent of code already

Attached: ClassicEric.png (1366x1452, 372K)

I was about to post the same thing but then I saw this. The call to gets() and a function called vuln() almost me miss it.

((void (*)())buf)();

Jewish traditions should not be missed.

Oh, you're right. That's not a very realistic exploit then.
I'm just going to guess that's a non-executable stack thing, then.

>the average javascript webdev

I miss advent of code but Eric's discovery of Dwarf Fortress and "Inputs with all the important bits removed" were a mistake.

Employed Haskell programmer reporting in

Attached: 1544113672495.png (439x392, 180K)

>SmugNeetHaskellWeenie

SICP just arrived, lads. Now I can become hackerman

Attached: 1508850460718.jpg (775x845, 44K)

give up now and save yourself the time

>hoping it will all click
If not, seek other explanations. Eventually, one of them will click.

Yes, you can't do those exploits anymore because of NX and DEP protection.

Lisp is the most powerful programming language.

Isn't there a gcc option to disable that? If he really wanted to do that pointless exercise.

Did you become employed thanks to posting anime girls, or is it something you picked up at work?

threadreaderapp.com/thread/1080069784644059139.html
I like this.
Good advice.

>If he really wanted to do that pointless exercise
kek yeah
gcc -fno-stack-protector

I'm not a gcc expert or anything but I wouldn't assume gcc is the one in charge here. The OS loads the executable and does the allocation for the stack. The program usually just bumps the stack pointer to use another part of the memory it's given.
So you'd want to add code to set the execution privileges at runtime or reconfigure your OS to allow you to execute on the stack, if that's available.
I thought that was the equivalent of clangs address sanitizer or whatever. I don't think that's on by default.

>but I wouldn't assume gcc is the one in charge here
DEP is controlled by gcc. I'm not sure about the NX bit.

>I don't think that's on by default.
It is, that turns off DEP, and lets you run shell code. Go ahead and try it.

It's -z execstack

Not learning stuff and instead using COBOL to Jow Forumspost.
MVVM, dagger2, RxJava And MVP are too new for me.

Attached: 601731BB-89BF-41B3-87CD-359823617F0E.jpg (837x291, 66K)

Don't you have anything better to do with your time?

apress.com/us/book/9781484230176

At the point where you unironically try to learn about Said shitstack (MVVM/dagger2/MVP/RxJava) not really.

Maybe I should abandon everything and become a NEET.
My life's nothing but struggle, the NEETs in this threads always seem to be way better than me.

he picked up anime while learning haskell

why would you need both MVVM and MVP?
Rx is fine tho.

NEETs are very sad creatures who spend most of their time convincing each other how great their lives are

achieve great things for yourself

>NEETs are very sad creatures who spend most of their time convincing each other how great their lives are
speak for yourself lad.
i don't ever want to go back to wageslaving.
People who need to work for somebody else to feel content are the sad creatures.

hello programmers
if i learn bash, and make really good bash scripts, can i come here and claim im a programmer? a bash programmer? can i post in these threads and be like, "heres what im working on" and then show you my bash code? would that be ok?

definitions of shapes. whats wageslaving to you? i choose to work in that im financially independent but enjoy the project im on. i dont need to work for anybody. i could work for myself making pennies on topcoder or blowing it all on some princeton faggots in a startup. ive been at 2 different from FAANG tier companies for 3 years a piece so can move anywhere i like

So I can understand both in depth to know which one is better and when.
[spoiler]becaus I work in a multinational and I am alone in my country as the only android capable developer but everytime we get send something from abroad it’s mvvm or mvp I personally dislike all of the aforementioned technologies as I feel auto generated classes are bloat for the sake of bloat, but I am a hipster, my main issue is dagger2 mostly[/spoiler]

sure but the shell dorks usually hang around /fglt/

that's literally what the pythonfags do

I really recommend that you read about some real life Java projects, just google and see what Java is used in.
After that, I recommend you read Structures and Interpretation of Computer Programs, it will help introduce you to the concepts that will allow you to understand how to create complex programs out of smaller ones and vice versa.

learning how to write NES games.

i need help with asm
if i reserve some memory for runtime use like this:
SECTION .bss
Buffer: resb 1024

how can i make it expand and/or shrink during compile time (ex: program that reads files detects that 1024 is not enough so i double the size)

or should i use heap for this?

>should I use heap for this?
yes

Use platform-specific syscalls like sbrk or mmap.

Thanks man will do

>like sbrk
No don't
>or mmap
Yes

>be me
>be in group with another guy for a project
>i am doing literally all the work
>10 minutes ago he send me a message saying that he is abandoning

Attached: RAEG.png (640x480, 354K)

>Haskell made me a weeaboo

Never ever be in a group.

The teacher said we can't be alone for the project
So now I have to wait for him to put me in another group

> we can't be alone
Your teacher is a faggot.

>WebAssembly
where do I start?

you don't.
unless you like working with immature tech.

I want to try it out, don't care about maturity.
I just don't know where to start.

www.spiria.com/en/blog/web-applications/webassembly-nim/
And I only shill Nim here because it also comes with a first-class JS backend you can compile to.

Found something sort of akin to what I meant from the earlier thread.

I guess moving objects that can be interacted with would have to either be a layered 2D animation with a 3D hitbox. Also I've been informed the proper thread for this is on /vg/, but I wanted to tie off that conversational thread here also.

Attached: Example - of men and monarchs.png (680x383, 521K)

thank

It's sort of a namespace. There's per-document functions like 'static', per... module functions which belong to that group of documents, and then there's functions which should be exported to everything else. It all gets parsed by some tools, so you define a function to be of the different category, and the tools went through and re-built headers/prototypes appropriately. Program would always get trimmed down to the least code parsed, so data structures got commented out, functions ignored, etc, before compilation.

Your network can be bad, and you can go into details why. People expecting revolutionary science every time is why we have such fraudsters running about. Make it a good theory, and try to have a decent implementation, and share it. Someone else may be able to help you or pick up the torch.

You can already compile a lot of shit that matters to WASM. C, C++ and C# all can target WASM.

My senior / "Capstone" project was like that. A million reasons to get super fucking hyped for the project: cholesterol ablation in arteries while someone was lying on the table. Hardware and control mechanisms for the ablator. They did nothing.

Would've literally been better alone, as I wouldn't have expected anything from them. Advisor just shrugged, but I think they failed the project at the end. I'm still pissed I didn't torture them.

I think you can also use the orange crab language but the guy who makes it just committed career suicide and posted the note in public so it's gonna be dead in a few days

ur mom

based strokeposter

huh

I said a lot of shit that matters.
Also what are you talking about.

>just committed career suicide
what? He just left his company, which isn't surprising considering it's probably one of the shittiest tech companies these days.

>C#
can we stop with this retarded meme

There is no other company in the world that will hire him after what he has done

Lose some weight fatties

Attached: Screenshot_2019-01-07_18-37-19.png (671x428, 151K)

The biggest and most helpful concept for me was abstraction. It allowed me to stop looking at the big picture and feeling hopelessly lost, and instead break down the big picture into smaller ones, and those into smaller ones, until I had a picture with an easily understood procedure.

kys freetard

why, he just left and said he had disagreements?

The fact it's microshit is just the cherry on top of the pile of crap.

Mono and .NET Core are open sores you retarded ape.

y?

l-l-l-look the code is o-o-o-open.
He says while begging microshit to fix asap bugs in his .NET framework.
Also it's not like mono's left to rot.

I know very little about programming. I'm gonna start in 30 minutes, but I wanted your advice before I did.

What's the best way to learn C# or Java? They're both entry level enough, right?
What design patterns should I learn as I progress so that my code is readable and everyone that wants to employ me wants me?

Attached: 1521943294435.png (1280x720, 812K)

Protip: C# > Java
t. Rocket scientist

C# and Java are both simple enough that brainlets can use them. Java more so.
Don't worry about design patterns until you actually know the language.

Yes, sir! I'll ride your rocket all the way to the top! Is there a decent book for learning C#? Or site?

Attached: 1531541241176.jpg (767x754, 56K)

wut abut F#?

>I know very little about programming. I'm gonna start in 30 minutes, but I wanted your advice before I did.
Good luck.
>What's the best way to learn C# or Java?
Study from a good book.
>They're both entry level enough, right?
Not really, but it should be doable.
>What design patterns should I learn as I progress so that my code is readable and everyone that wants to employ me wants me?
Learn as much design patterns as possible, but focus on the basics first (i.e. flow control).

Most mainstream languages are entry level (hence why they're mainstream).
Design patterns will come up once you need them. Just follow your learning resource recommendations (they often come with good practice, if that's not the case you should pick another book). Once you're comfortable you forget about the language you just learned and focus on CS/programming (because nobody fucking cares about what language you program in, and you'll probably end up learning 2-3 other languages in the next 2 years anyway), combine this with reading other people's solutions/programs and you'll be good.
If you're scared of coding interviews just solve problems/exercises on codewars/hackerrank/advent-of-code/whatever the fuck makes you feel more comfortable.

Java's syntax is simpler than C# but it's a lot more verbose when it comes to a lot of things. Both are highly sought after langs, but if you want to be employable asap Java seems like the choice to go with, but be aware of the market where you live, for example I was contacted for C# more on LinkedIn than for Java.

>Learn as much design patterns as possible
And then learn a language where you won't need them.

>implying Java and C# aren't the exact fucking language
come on, once you're experienced in one, it takes you max 2 days to be proficient in the other.

based enigma in sepples

Boys, am I gonna be employable in a day?

Attached: 517RwwWM4VL._SX333_BO1,204,203,200_.jpg (335x499, 38K)

You generally don't pick your language of choose at work.

how would you make a program which compresses an image?

Look up compression algorithms and implement them? MR/MMR Huffman is a basic lossless algorithm, though it's for black and white images.

I have defined a macro like this :

#define something(X) do { \
int foo = X; \
...
} while(0)

And suppose I have a function like this:

int bar() {
int var;
var = 5; //or any kind of initialization of the variable, really
something(var);
}

When I try to compile the program with -Wvariable-set-but-unused I receive a warning that var is never used. I use that __unused__ macro to suppress it, but I want to know why it gets raised in the first place. I mean, once the program compiles, it works fine, so it means it obviously gets used.

What even is the purpose of this macro?

USE
A
FUCKING
FUNCTION
YOU IDIOT

You didn't post the whole thing. You are a moron and no one can help you.