/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

godbolt.org/g/lNsRMn
esr.ibiblio.org/?p=7294
github.com/torvalds/linux
okmij.org/ftp/
github.com/wrvc/misc/blob/master/roman.c
twitter.com/NSFWRedditImage

First for C++ is complete shit.

Depends which industry we're talking about. There's a demand for both C++ and Java programmers. But they're both easy enough to learn that you don't need to pick one over the other.

First for D.

why

Good one
godbolt.org/g/lNsRMn

I-it's only temporary, D will rule the world.

If you have 2 activities equally (for example programming and drawing), and you want to do it professionally both, which one would you choose?

Programming, and drawing after work.

Well professionally I would want a job that didn't involve drawing furry art for autists for a living, so programming. Then drawing as a hobby. Also, don't you think this is an incredibly biased place to ask such a question?

Programming, draw for commissions(if you're good enough)

>import std.stdio;
Talk about fucking stupid.
Also why the hell is the output making two calls to fprintf?

What compilers and languages existed back in times of MacOS 8.1 for m68k Macintoshes?

>What are you working on, Sup Forums?
Attempting to trick the NVMe driver into making the SSD DMA blocks into an arbitrary bus address.

You should make porn games. It's what I'd do if I could draw.

>trick
w-why?

for fun and games, but also for profit

Can make the SSD write directly into GPU memory (RDMA), instead of having to transfer first to RAM and then to the GPU.

interesting. What would the purpose of this be though?

> involve drawing furry art for autists for a living
You have a misunderstading of modern drawing, take a look at ArtStation, there are a lot of artists who draw concept art for games and films.

It was a joke.

esr.ibiblio.org/?p=7294
Tension is rising

It will be faster and require less synchronization between disk driver, OS and GPU driver.

Quicker for what function? I can only imagine this would be quicker if the data set was significantly larger than the available RAM. If the data set could be cached in RAM then doing a transfer from SSD to GPU would be slower and therefore redundant. Unless you were crunching very large sets of data, this wouldn't be much faster.

Is is actually practical though? Bypassing the OpenGL driver sounds like begging for trouble.

I didn't get it.

Sup Forums cool kids club checklist

[x] hate OOP
[x] hate IDEs
[x] use only Haskell
[x] never produce actually useful software (this is important)
[x] wear knee socks
[x] tiling window manager
[x] dark-like-my-soul customized colors
[x] hate popular Linux distributions (far too intelligent for them)

I wrote some hacky shit code. It returns -1 if n1

int f(n){
return n.compare(0.0) & n.compare(1.0)
}


Whaddya think?

>[x] hate OOP
>[x] hate IDEs
>[x] use only Haskell
>[x] never produce actually useful software (this is important)
>[ ] wear knee socks
>[ ] tiling window manager
>[x] dark-like-my-soul customized colors
>[x] hate popular Linux distributions (far too intelligent for them)

I think its also extendable for any a>b

so basically
return (n

you forgot:
[x] regard others as shit because they didn't read SICP

Resources for wrapping my head around continuations?

[x] hate OOP
[x] hate IDEs
[ ] use only Haskell
[ ] never produce actually useful software (this is important)
[ ] wear knee socks
[x] tiling window manager
[x] dark-like-my-soul customized colors
[x] hate popular Linux distributions (far too intelligent for them)
OOP as in Java OOP.

not quite, if n is between 0 and 1, return 0

>[x] hate OOP
>[x] hate IDEs
>[] use only Haskell
>[] never produce actually useful software (this is important)
>[x] wear knee socks
>[] tiling window manager
>[x] dark-like-my-soul customized colors
>[x] hate popular Linux distributions (far too intelligent for them)

Post CV fodder projects, need to fill up my githubs. Cool repos to contribute to also appreciated.

Flashy looking simulation, shows that you're ""full stack""

github.com/torvalds/linux

Looks shit

What kinda simulations are we talking about here? Like those webgl physics memes?

Unsafe, better rewrite it in Rust :^)

Serious CS knowledge dump here:

okmij.org/ftp/

If you want an actual suggestion, when I was in uni, we coded a fabric simulation over a sphere. You don't have to code a full physics sim, just push the fabric outside a given radius every tick.

The fabric is basically an array of points. Apply gravity to points, use hooks law to simulate a spring between adjacent points, repeat ad infinitum.

I made every square a different color and it looked like a million bucks. If you've had experience coding, it'll take you a couple of afternoon.

What is your stance on parenthesis in mathematical operations? Would you write
y = a + b * c;
or
y = a + (b * c);

SHUT IT DOWN

Don't be daft, Simon loves that shit.

>[ ] hate OOP
I use a purely object oriented language.
>[x] hate IDEs
Yep! Software should be simple and easy to navigate.
>[ ] use only Haskell
I don't use Haskell at all!
>[x] never produce actually useful software (this is important)
When I write code, it's mostly because I find it interesting. Or it's coursework.
>[ ] wear knee socks
Knee socks are for people who get down on their knees too often.
>[ ] tiling window manager
Nah.
>[x] dark-like-my-soul customized colors
Easier on the eyes.
>[ ] hate popular Linux distributions (far too intelligent for them)
I use Ubuntu. Less hassle.

depends. More often than not, I'll do the latter. I find the first one readable enough, but when things get more complicated it makes more sense just to add parenthesis everywhere to make it easier to follow. So even for simple ones I just add the parenthesis to keep everything consistent.

>;

But knee socks are not just for the homosexuals, Ruby.

The second option. As much as I want the you dont need math to code, everyone should learn to code XXD subhumans to struggle[spoiler]die[/spoiler], it's much more obvious at a glance.

I expect my coworkers to know the order of mathematical operators.

Always the second one.

You're right, they're also for women!

Women can be homosexuals too, Ruby.

>Knee socks are for people who get down on their knees too often.
But what if it was a game theory scenario? Two people are in seperate and isolated booths, unable to see each other but able to communicate through a walkie talkie system. If they both leave the booth without wearing the knee socks, then they're both pronounced "totally not gay", but if one of them wears the socks, then they're both pronounced "gay as fuck". Then they have to communicate and do all that shit.

Second one, every time. I have a paranoia about it, even with calculators. I feel that if I don't explicitly state it then it'll be interpreted wrong because of some Chinese fuck who doesn't understand order of operations.

For a straight guy, you spend a lot of time thinking about knee socks...

Welcome to /dpt/.

Wearing knee socks tends to do that to you. I'm pretty fucking gay.

That is true. But women can be heterosexual and wear knee socks.

Walk out without kneesocks. Even if you are pronounced gay as fuck, at least everyone know's who's the bitch in the relationship :P

...

But straight men can wear knee socks too, Ruby.

we can't let them have the knowledge

I do not know too many who do.

Do you know many people who wear knee socks?

About the same amount who identify as homosexual. Coincidence?

I know a few. They're all at the very least bi... or straight women.

What about women?

Someone should write up a simulator for different colours and patterns of knee socks. /dpt/ needs it by the looks of it.

So you know at least one? Who is it? Louis XIV?

Women are just gays with nice faces, everyone knows that.

But what about you?

I wear solid black crew socks.

You've never experimented?

C fags explain to me argc and argv
Very sleepy, don't have the energy to read and understand it from the book

Also, explain to my when a person would use stdout, stdin, stderr

Thank you

argc is an int and argv is a char**

Fuck you. Type it into google. Programming requires effort.

>inb4 int main(int argv, char** argc) {

Bunch of shit handed to the whatchamajig by the thingymabob that did the diddle.

You use STDout when you want to give someone and STD, and STDin when you get an STD. STDerr is thrown when you die due to an STD.

Google answers homework questions.

I do this because it's one less character to type.
You can use it the same way, so what's the difference?

>C fags explain to me argc and argv
argc -> size of argv
argv -> program name + arguments

Who else here /can't program for shit/?

Leave your knee socks by the door.

just you

good place to learn tho

Rude

too smart to program

>tfw to intelligent to program for shit

Crew socks are comfy enough for me, and take less time to put on and take off. Moreover, the nature of living in Washington is that your socks WILL get destroyed by water seeping through your shoes, so expensive socks are not a very economic choice. This, of course, does not stop a lot of people.

If you are too sleepy to understand it from a book, you will be too sleepy to understand it from our explanations. I should probably head to bed soonish myself, because it is 6 AM.

Please, I want to get this done before I sleep, I'm almost done with this C bullshit
Explain in laymen terms wtf it's used for
Actually help someone for once in your lives you useless faggots

Fuck you, I was helping you.
Not gonna anymore.

Who the fuck do you expect to help you with that piece of shit attitude? If you can't figure out basic stuff by yourself just drop programming already

In the time you spent replying to us you could have Google'd it and understood it. That reply isn't going to help.

Whats your major, freshman?

rate program lads
github.com/wrvc/misc/blob/master/roman.c

But knee socks are not just for homosexuals, Ruby.

Replace goto START; with continue;
Don't you ever use goto or labels ever again.

You can literally Google the answer in a few minutes.

goto is cancer, it hasn't been used in modern programming for decades. It can create unintended behavior. Gimme two secs

0/10 that won't help me seige Constantinople.

Programming newfag here, why is goto considered cancer?