/dpt/ - Daily Programming Thread

What are you working on?
Previous:

Attached: loli.jpg (1388x926, 243K)

Other urls found in this thread:

opengl-tutorial.org/
twitter.com/NSFWRedditGif

>when you write ten lines of code without compile errors

Attached: .png (700x700, 825K)

>download very large .txt file
>basically a bit list of words
>open file with notepad
>words are in one block, unseparated by any blank characters
>open up powershell IDE for the first time in months (second time in over a year)
>want to write simple script to separate the words with a return character
>it takes a while because I'm unfamiliar with the language and had to look up a lot of basic shit
>finally done after one hour
>ready to actually use it on my .txt file
>open the file with notepad++
>it opens correctly without having done anything to it

Lost an hour for nothing and I'm embarrassed it took me so long to do something so simple.

Welcome to the CR-LF vs LF struggle

forgot my image

Attached: thank you jesus.jpg (504x470, 103K)

moral of the story: never use notepad, use other text editors.

3 versions:
CRLF
CR
LF

Wordpad is more than fine and is able to load large file

Any good online resources for learning kotlin?

It's not a struggle. You just need to ignore stupid winfags.
I don't believe any system using a single CR as a newline.

Doesn't mac use the CR for newlines?

Hey, I use linux on my second computer. It could have happened to anyone!

no one interested with this problem?

wordpad isn't the same as notepad

> a single CR as a newline
i think some old system use CR.

my co-worker wrote LFCR (\n\r) in one of his code. he might be smoking something when he wrote it.

>when you write something in c for the first time
look at this guy hacking the NSA
those were the simpler times...

What's wrong with using \n and \r in code? I do it all the time

Woah no shit.

The C standard library will automatically convert '\n' to a platform-specific line ending when writing to a file in text mode. There is absolutely no good reason to explicitly write both, except for the rare case when you're using a network protocol or some shit.

ironically, just join the arrays, and make a priority queue and take 5 items and reverse the underlying vector.
Fuck writing efficient code.

???

what order should i join the array? based on their original index? why priority queue? what priority should i use?

isn't the proper order \r\n? he used \n\r as new line.

Join 'em, bubble sort 'em after 5 elements were sorted return it

I misread what he meant

i see what you mean. at first I thought like that too. it's just taking k elements from a sorted joined arrays. but the 3nd last sentence made me think it's not that simple.
read this part:
the relative order of the digits ...

make a copies of the arrays and then work on them. Close the source and pretend it's superior lmao

>Close the source and pretend it's superior lmao
Found the Oracle database engineer

I don't get the task then. In the example it loses the relative order of digits

I think we need a second example to be clear.

Or any closed source software selling company, really. With enough shilling, if you make your program look pretty people will eat your shit up, trust me.

Attached: mslogo.jpg (1200x800, 18K)

kek

Too close to home

How the hell does m + n (4 + 6) equal 5 in this instead of 10?

Attached: 1510692292126.jpg (403x448, 64K)

>always worked on projects form the start
>now I have to work on something that already started
>have issues understanding the code in general, 0 commenting and have to ask a college to explain me what the fuck is going on
Is this normal? I feel like a brainlet out of a sudden

kill yourself retard

k

God you are stupid

5

12 bing points have been deposited to your online microsoft defence campaign fund, rajesh

>shits on oracle
>b-but m$!!!
90 rupees have be designated to your oracle EE account

read the sample. k = 5.

i'm not gonna bother arguing with you about equals 1.

But how does he end up with that result is my question? 5

Don't feel bad, I also had to read it 5 times before I realised it wasn't an arrow but less than

It means k can't be larger than m+n

I understand it isn't arrow, what I don't understand is how does the expression k

Oh, I guess I get it now. So 5 must be a user defined value, like a function parameter. I thought it was a result from the equation.

That's to be expected since the documentation is ass

No, that's pretty typical. It's even worse if the programmers before you are shit.

Fuck off and die, MIDF drone

Seeing how memory leaks are so common in GNOME, GC was probably not a mistake. At least GC will reclaim some memory.

No need to get upset, Oracle database engineer
:^)

Pls halp: I want to write a snake game in c++ (the aim is to show I know some c; looking for a job and trying to find ways to stuff my empty CV with shit). What graphics library do you recommend?

Attached: __kouhai_chan_getsuyoubi_no_tawawa__a8566c65357a37b15196a6476db431b7.webm (1280x720, 2.27M)

deoplete or YCM?

Attached: 1526277909757.jpg (396x353, 24K)

>the aim is to show I know some c
Then why the hell would you use a completely different language?
>What graphics library do you recommend?
SDL, or maybe GLEW if you're going to use OpenGL.
Or be a real man and write it using your native graphics library (xlib/libxcb, libwayland-client, etc.).

took you long enough.

>GLEW
GLFW I mean. I always get my OpenGL-related libraries mixed up.

> mfw doing a partner programming assignment for uni and my partner is fucking useless with programming so i have to do it all on my own

Attached: 1524916897666.png (601x601, 277K)

ycm

you'll be more surprised when you graduate and have co-workers who can't code in a software development company

Is she cute at least?

Attached: 1524852889206.jpg (720x720, 79K)

Ok, I am going for openGL. This tutorial opengl-tutorial.org/ any good?

Attached: 68726490_p0.png (600x982, 363K)

Oh i've already experienced that in my internships

Attached: Blade-Runner-2049-review-featured.jpg (970x545, 130K)

> girls
> compsci

Attached: lXSWGjR.png (1092x1037, 65K)

>co-workers who can't code in a software development company
How do I get hired by these companies? Being paid to do nothing sounds like a dream job.

don't ask me
ask them
maybe BSing

dumb frogposter

>is he cute?

Attached: 1526292690875.jpg (333x293, 40K)

I'm throwing together everything I ever learned and some more and build a cryptocurrency trading bot.

It isn't - you'll get bored and depre... oh who am I kidding?

That's a good thing, partner programming is a retarded fucking meme, you just turned it into a regular assignment

listed in some options as "mac".

Which is kind of funny from the historical point. Linux would just start the next line indented to the previous position
Windows would start the next line correctly at the leftmost position
Mac would just write over the same line over and over

Skimming over the first few parts, it looks fine.
They're using modern OpenGL (that is, using shaders; it's not actually that modern).
I'll warn you that OpenGL can be a bit weird to get your head around when you first start.

I fucking can't, I would if i could
> muh assignment requirements

Also i know the guy outside of uni, i'm trying to help him through uni but holy shit it's hard
> mfw showing him anything programming related

WE'RE FUCKING SECOND YEAR HOW ARE YOU STILL SO SHIT

/rant

Attached: 1510333553744.png (230x219, 7K)

>having friends
You don't belong here

>Linux would just start the next line indented to the previous position
No, a \r would bring the cursor to the start of the current line. You're describing a vertical tab (\v).

maybe friends isn't the right word
"people who really only talk to you when they need help"

Attached: 1525778814934.png (596x502, 256K)

>OpenGL can be a bit weird to get your head around when you first start.
Why?

Attached: DcjN5U7UQAAqY7O.png (715x1000, 477K)

that's right
never forget that Jow Forums has no friends

but you're all my friends

Attached: 1526118412037.jpg (400x388, 34K)

Nobody's going to reply to some autist spamming anime in this thread.

dumb frogposter

nice user

cute anime

that's not mutual. you think you're friend with someone. that someone might not think you're his friend.

her oppai is sugoi

agreed

just use SFML and you'll be done in an hour

agreed with which statemant? friends with pepe or ai-chan's sugoi oppai?

pls no bulli

Attached: __ai_chan_getsuyoubi_no_tawawa__755c9b76f0066f39bc052aeb95e5be6f.webm (1280x720, 2.96M)

That's kinda defeating the purpose of the exercise?

SDL2

It's just a complicated system, and you need to understand and do a fair bit to even get something basic working.

You may want to check where you are. Anime is always welcome and appreciated.

the author made some hentai doujins. wish he continues doing those hentai doujins. i love his arts.

>C++
If I have an object with a member x, is there any difference between (*this).x and this->x?

historically, both signals are needed, because the standard comes from wired typewriters. \n just pulls the paper in one line.
You also needed to physically return the printing head carriage to starting position (\r is "carriage return" for a reason)
It's of course entirely redundant in a non-mechanical computer system, but it's still interesting.

He's supposed to show he knows the language, not an arbitrary library.

oppai obviously dumb frogposters are subhuman and don't deserve to live

>oppai obviously
mah nigga

just use this->x there's no difference but the former is pointless

They're identical most of the time. I think you can overload them (or at least one of them) so sometimes not.

>I think you can overload them
C++ was a fucking mistake.