/dpt/ - Daily Programming Thread

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

wiki.haskell.org/Monad_tutorials_timeline
blog.plover.com/prog/burritos.html
byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/
youtube.com/watch?v=C8voeJ9WgCw
github.com/aminroosta/sqlite_modern_cpp
en.wikipedia.org/wiki/War_of_the_Bucket
twitter.com/SFWRedditImages

Is FP a meme?

>all female workplace
>boss purposefully trashes male applicants to enforce all female workplace
>she even admits it
but it's ok when anime does it

Anyone got any experience with SDL?
Looking to create an x/y graph where users can click and plot points.

yes

hi qt u go on date with me yes

if this were real life the all-female workplace would collapse in less than a week

people need to be gassed
anglos, jews, women, minorities
all pull the tribalist shit to the detriment of humanity in the long run

shitty java assignment for uni

apparently who made this course thought java would be a good place to start :X

what uni bruh

I wonder how RMS sees himself

tell me about the gnu man, why does he carry the flute

What's the grossest pointer code you've ever seen? I remember somone here posted some disgusting five-level pointer

FPlet here
What actually is a monad?

imagine a burrito

wiki.haskell.org/Monad_tutorials_timeline

>burrito
No don't
(seriously though, what does this come from)

I've gone 4-star myself, but realistically, if you're using more than 3-star pointers, you need to rethink your architecture.

The base class in FP that all behaviour inherits from.

>SDL
>not using OpenGL

in Haskell:

A type constructor of a particular kind and two functions return and (>>=) of a particular type

What the hell is this? Why is it considered okay for a language to have no concept of pointers for POD types? Even for a pajeet language this is insulting.

>Anglos
BLIMEY!! THE BUGGERS KNOW!
SHUT IT DOWN, YOU SODS!!!!!

>The base class in FP that all behaviour inherits from.
pls

but user, it does have pointers

what it lacks is objects without pointers

Currently doing an assignment where I have to implement a set of integers as an AVL tree.
I still haven't figured out insertion. Pls send help

it came from this response
blog.plover.com/prog/burritos.html
to this essay
byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/
about the futility of learning monads from essays

>there were all male workplaces long enough for a reactionary social movement to gain traction over a few decades
>men were okay with this
>there is one all female workplace for a few years
>men lose their shit
>yfw

Is it better to have a function/file that is long because there is a lot of repeated code, or one that is long because it is over-engineered?

If you have a lot of repeated code, you should move it out into a (static/private) function.

Sauce?

both are bad and can be easily avoided

I think it's the principle of the matter.
You can't cry about lack of diversity and then attempt to exclude certain races or sexes to "promote diversity".
It's incredibly demeaning to the people being given preferential treatment, they're being told that the only reason they were hired was so whitey could fill a quota.

over-engineered

youtube.com/watch?v=C8voeJ9WgCw

>for a while people thought it was ok to discriminate against a gender
>then they realized it wasn't and stopped
>then they started discriminated against a gender again but its ok this time because of the past

delft university

>implying it isn't okay this time because of the past
>implying there isn't a score to settle
>implying past discrimination against women did not leave a persistent mark on culture that continues to skew it even now that women are treated equally under law
>implying that to attain equal treatment of the genders under law AND culture, we are not in need of a period of legal discrimination against men, which would culminate in a similar reactionary social justice movement headed by men for their rights, which, being finally appropriate, would emerge victorious and result in the equal rights of men being restored, whereupon, being that the cultural skew in favor of either gender would have once again been balanced to nil, men and women would finally be able to wholly agree to stop this silly nonsense, with no significant dissent among the ranks of either
>implying the time to stop this nonsense is now even though the cultural roles of men and women have not yet been balanced in this way
>being too fatigued of war to see it through to the proper end
get outta my army soldier

github.com/aminroosta/sqlite_modern_cpp

also figured it out, was fucking up when creating the table

Why isn't she wearing pants?

The day i discovered suckless.org I was reborn. Finally I found a group of actual SW quality autists like me!

A while back I started learning programming, I started with Python for a while, then I finished a MOOC that used Java, and lately i've been using C. I want to add graphics to my implementation of Conways Game of Life. I found what looks like a good tutorial for SDL but it uses C++. Should I learn C++ or should I stick with C for now?

sure, and we need to punish murderer's children because of the sins of their father need to be repaid in full
put em' all in labor camps
fuck off I didnt do anything wrong

A monad is an abstraction over a machine which computes functions in sequence.

Conceptually, they're the same thing.

If you have just one function that's over-engineered, you can split it into versatile sub-functions that can perform chunks of the protective checks and heavy lifting on their own, not just for the original function in which they're to be reincorporated in the form of calls, but in other functions as well that could benefit from the same caliber of engineering.

So really they're both indications of need to reduce code repetition, just existing repetition versus potential future repetition.

japanese society is still embellished in a medieval mentality of patriarchy and structural misogyny so wearing pants is forbidden for women

>FPlet here
>What actually is a monad?
A monad is just a monoid in the category of endofunctors

>the absolute state of C

while (strcmp("Quit", option));

lads, need to had a refresh button on a my android App, so that if the data from the device doesn't load, i click the button and it tries to get the data again.

Any books where i can find this information or sources?

It executes the query in the destructor, like I have guessed. A destructor which is allowed to except. Is such a thing in C++ even valid?
The goal of this hackery is apparently to support operatorop is found, but not if an exception
is in mid flight */
if(!used() && !_has_uncaught_exception && _stmt) {
execute();
}
}

>sure, and we need to punish murderer's children
No, because murderers, as a collective, haven't created a cultural skew in their favor.

If there were an analogous thing to say, it would be this: we need to punish murderers' children to regain cultural ground lost to the murderers, and also to create outrage among said children, so that they will revolt and reclaim their rights, thus preventing us from regaining too much cultural ground and skewing our culture in the opposite direction.

But this same logic actually does not apply because there is no cultural ground lost to the murderers to regain. On an individual level, murderers hurt a great many people, but culturally, they only hurt themselves.

you're literally insane. you're suggesting we punish an entire class of people for things they have never done. you are scum.

I don't know what you guys are talking about, but we should punish communists.

That's my 2 cents.

>cultural skew
Which implies that there is one "true" culture.

SDL is written for C, so you should be fine sticking with it.

...

This guy doesn't want to punish communists, he wants to punish the entirety of eastern yurop and russia for having the gall to have great-grandparents who had to bow down to communists once. Quite literally too, since communist leaders were known to be murderers and it's a fact they lost much cultural ground in the places where they reigned.

Not punish per se. That was perhaps a poor choice of words. Punish suggests there's an individual level of justice at work. There isn't; as you've said, they've done nothing wrong. Rather, injustices must be committed against them.

1) Men committed legal injustices against women on a mass scale, creating cultural injustice against them.
2) Women reclaimed legal justice for themselves. Cultural injustice persisted.
3) Women must commit legal injustices against men on a mass scale to reclaim cultural justice.
4) Men will then reclaim legal justice for themselves. Cultural justice will persist.

Think of legal justice as like the acceleration to cultural justice's velocity along a frictionless surface. Acceleration was zero, and then men tilted it in favor of their gender, thus increasing velocity in that same direction. Women then titled the acceleration back to zero. This did not tilt the velocity back to zero; it merely caused it to stop increasing. Women must tilt the acceleration in favor of their gender to decrease velocity back to zero, at which point men should tilt the acceleration back to zero, so that the object will be, and remain, at rest with respect to the surface.

how about we just literally kill all the women and solve inequality once and for all

No, because that would simply increase the velocity more, and there would be no one to reverse the direction of acceleration to bring the velocity back to zero.

Also the human race would die out.

i'll kill you

Pssh, no you won't.

pkill $YOU

Ack, urk, oh I have died. Alas, poor user. I knew her well, user.

>if I take an eye for an eye then my opponent will call it quits and there will be peace
You're quite the fruitcake. Here's what would happen if everyone had your mindset in reallife
en.wikipedia.org/wiki/War_of_the_Bucket

Does the parity bit usually come right before the stop bit?

More like, my opponent took my eye, so I took his eye, but he still has the satisfaction of being the first one to take a first eye, so I'll take his other eye, thus gaining the satisfaction of being the first one to take a second eye, and then HE of course will take MY other eye, and then I'LL call it quits, which I can control because I'm me, whereas I couldn't necessarily expect HIM to call it quits because I'm not him.

... While well articulated, that idea is fuckin retarded, user. A change, or even a set of changes, does not create some kind of "social velocity" that can correct or must be corrected for. Social customs are not vectors; they are bounds. Changes to those customs are not accelerations; they are new bounds. What you're talking about is vengeance. Vengeance and justice are very different, which is why the justice system has been structured such that impartiality is maximized. I don't suppose that you believe that justice as we know it is also busted.

>Social customs are not vectors; they are bounds. Changes to those customs are not accelerations; they are new bounds.
But in sets of customs, and in sets of changes, various partitions of elements tend to share themes which express underlying sentiments. I hold that THESE, the sentiments, are vectors, which can correct and be corrected. Customs are the product of how the general population feels about certain partitions of its constituents, which, sadly, is in turn the product of who has "won" lately.

And then he takes your left arm as compensation for taking his second eye AND his first eye, since taking your first eye wasn't really his fault according to him, so you now have to take both of his arms to compensate, and maybe his left leg too to teach him never to continue taking things from you, whereupon he'll take all of your limbs to compensate, and then at the end of the day you both have an awful fleshwound and nobody gained anything. Wonderful idea.

I like you

If that happens, he'll have revolted too late. I must be sure to provoke him to revolt sooner, by making sure to ONLY take his remaining eye from him and nothing more off his body, so that my other eye will be all he'll be inclined to take in turn.

P R O G R A M M I N G

We are talking about programming though. Social programming.

nigga would you not wear pants at work if you were alone and could do so?

Maybe if I was a cute girl?

>he'll be inclined
Nigger, you pull this on the wrong person and he'll take your whole damn body for himself. Don't assume you have more power over someone else than they do over you.

It's more complicated to use opengl like said but it'll make you a better programmer.

I forgot the SDL blitting functions but I can upload some boilerplate SDL_GL code for you to play with to make graphing software if you'd like.

>Don't assume you have more power over someone else than they do over you.
Well of course not. I don't have to. That's what taking his other eye is setting out to accomplish.

Look at a sine wave. Think of positive as men being in power, negative as women being in power, and the integral as the cultural climate around gender. Right now we're at theta = pi. The function itself -- the measure of who's in power, and by how much -- is at 0, but where's the integral at -- the favor of the cultural climate? It's positive, i.e. in favor of men. And you're suggesting we stop here, rather than progressing to theta = 2pi, where the function and the integral will both be 0.

>he thinks men have institutional advantages
See you in divorce court nerd. Pay my welfare nerd.

I've gotten some .v0 files from a mobile game, trying to extract the music.
Anyone ever heard of this file extension? No idea what it is/how to convert/use it.

Dumb answer, but what does the 'file' command tell you?

>rather than progressing to theta = 2pi, where the function and the integral will both be 0.
Wait, no, that's not accurate. -cos(2pi) = -1.
I don't understand how that makes sense, though. The area under the first half of a sine wave perfectly fits the area over the second half, so why is the integral between them -1?
Not asking, just thinking aloud.

'file' isn't a recognised command.
Am I being an idiot/using Windows or something?

Kind of. The 'file' command on Linux will tell y- I don't actually care enough to explain this. Here's the start of the man page.
FILE(1) BSD General Commands Manual FILE(1)

NAME
file — determine file type

SYNOPSIS
file [-bcEhiklLNnprsvz0] [--apple] [--mime-encoding] [--mime-type] [-e testname] [-F separator] [-f namefile]
[-m magicfiles] [-P name=value] file ...
file -C [-m magicfiles]
file [--help]

DESCRIPTION
This manual page documents version 5.22 of the file command.

file tests each argument in an attempt to classify it. There are three sets of tests, performed in this order:
filesystem tests, magic tests, and language tests. The first test that succeeds causes the file type to be printed.

The type printed will usually contain one of the words text (the file contains only printing characters and a few
common control characters and is probably safe to read on an ASCII terminal), executable (the file contains the
result of compiling a program in a form understandable to some UNIX kernel or another), or data meaning anything else
(data is usually “binary” or non-printable). Exceptions are well-known file formats (core files, tar archives) that
are known to contain binary data. When adding local definitions to /etc/magic, make sure to preserve these keywords.
Users depend on knowing that all the readable files in a directory have the word “text” printed. Don't do as Berke‐
ley did and change “shell commands text” to “shell script”.

Wait, no, never mind, it makes perfect sense. For the definite integral from 0, C just has to equal 1, because -cos(0) is also -1.

Why do nerds always try and explain things with calculus analogies?

use the FTOC baka.

-cos 0 - (-cos 2pi)

>>being too fatigued of war to see it through to the proper end
without spooks, tell me why i'd fight a "war" against myself?

No, not institutional. Cultural. Institutionally, we are currently equals. Women may even have a bit of an advantage, which is good, because it will help deconstruct the cultural advantage of men, who will revolt against our growing institutional advantage as we once did against theirs, and reclaim their institutional equality just in time to stop us from skewing the culture too far the other way. The trigonometry says so.

I did it and all it said was:
some_file.v0: data

Then you might be fucked. Try 'strings'.

Thanks, I forgot.
Because math is useful and fun.
Good point. Please continue to see things the way you do, it'll make good fuel for the necessary masculist revolt to keep us from going too far.

They call it a revolution because you're going in a big circle and nothing changes.

How often do you read the docs for new tech you've got to learn for work?

Everytime?
Or do you just get an understanding by building some kind of basic application, and leave the docs for when you need to reference something you haven't come up against yet?

You're a fuckin' retard user. The people who are in power are men. Zero female presidents. Male dominated congress.

The advantages being conferred to women are being conferred BY men. Welfare was created BY men for unmarried women without children. Why? Because women have had had the cultural advantage for about 150 years.

The only battle of the sexes is a war started by feminism.

??????

Things have already changed. We want to get back to the point where nothing has changed from the point when nothing was wrong, because then nothing will be wrong. Then, we want to stay there.

According to the sine wave analogy, staying there will be the hard part. To make it work, we'll have to consciously adjust our response to the inevitable masculist revolt to reshape the sine wave right at the end and give it something like a horizontal asymptote.

> read the docs for new tech you've got to learn for work?
never. I learn to do simple example and expand my knowledge on that. Not the best option but gets the shit done without learning details that won't matter anyway

>the point when nothing was wrong
user, I...