/dpt/ - Daily Programming Thread

Old What are you working on?

Other urls found in this thread:

youtube.com/watch?v=-JhwxTen6yA
instagram.com/ana_montana/?hl=en
twitter.com/NSFWRedditVideo

Working on my file manager.
Godverdomme

What are the advantages of continuation-passing style in functional programming?

Ensuring a certain ordering of events

I'd love getting forcefully "arrested" by her

Tell me about R.

>functional programming
>ordering of events

>muh hasklel

Eliminates the need for stack frames (if it's implemented across the board, see chicken scheme)

She a tranny

superceded

Why does every javascript book author have their head up their ass?
They all love their higher order functions and functional programming and sing it's praises and how you shouldn't bother with speed optimization because it's $CURRENT_YEAR.

>here's an incredibly contrived task that could easily be done in a nested loop
>NOW USE MAP FILTER REDUCE EVAL BECAUSE ITS PRETTY AND ELEGANT!!

Is this undefined behavior if x and y point to the same storage region?
int fill(int *x, float *y) {
*x = 1;
*y = 0.5;
return *(char *) x;
}

Gives you infinite control flow power: start over, short-circuit, or come back to it later.

dude functional lmao

/dpt/ how good are you at C?

Write a function that multiplies two ints.

Jesus fuck stop posting in these threads. Just because you're too much of a pajeet to understand how to use closures doesn't mean the rest of us are.

To the extent that it does type punning, it's implementation defined. It's not undefined tho, it can't crash... wait: not in very specific cases if sizeof int != sizeof float

int mul(int a, int b)
{
return a * b;
}

Done.

Good dog, now bark.

Does not return the correct answer for all values of a and b. Don't call us, we'll call you.

...

Of course it does.

>nested loops instead of convenient map, filter, reduce constructs

int multiply (int a, int b) {return 0;}

I really really really like this picture

long long long long long mul(int a, int b){
//original work, do not steal.
long long long long long ret = (long long long long long)a * (long long long long long)b;
return ret;
}

>not C

Dude that's dumb. It's a perfectly good interpretation of "to multiply". The thing is: in the cases where the "wrong" answer is returned, the "right" answer can't be represented in an int, contrary to the averaging meme. Besides lrn4b0U7 modulo integers, it could save your Privacy

You can download it for tonight if you want, but remember to return it first thing in the morning. I have some memeing to do before the Sun hits the zenith.

youtube.com/watch?v=-JhwxTen6yA

But it does return the "correct" answer for all a and b as specified. Of course, signed overflow is not defined, so that's not a concern.

I have an archive of about 2000 historical photos I would like to put online and make them searchable. All the photos have some form of metadata I can use to help with the indexing.

What would the best way to go about doing something like this? I know basic HTML and Linux so far, I'm still learning more at the moment.

What the fuck are you multiplying? Your mother's weight?

It's a future version, where we're using processors with support for very wide integers.. very wide like a negress's ass.

HTML is mainly for formatting Web pages, use the Linux programming language to do this (note, Linux is now available on Windows 10)

>I know basic HTML and Linux
>I know basic Linux
>basic Linux
GTFO Stallman

Pop em on google drive nigga

would you?

>how good
very good
>write a function
no problem:
public static BigInteger mult(int a, int b) {
return BigInteger.valueOf(a).multiply(BigInteger.valueOf(b));
}

Is this a trick? Is the (woman) in question actually a man?

>not undefined tho, it can't crash
undefined has nothing to do with crashing tho

isn't this tail call optimization? you don't need continuations to achieve it.

can you elaborate? i don't get it.

BTFO

That's a method you dip

In a heartbeat.

Undefined behavior means it can do anything, including nothing, crash or delete system32. Implementation defined means it remains reasonable.
Lrn2read nigger

Do you want me to post men?

regardless if this persons a tranny she's a definite sight for sore eyes, she looks amazing!

ITT degenerates

It's a function.

>not undefined tho, it can't crash
lrn2read tard

No, I like women. If the woman in the original post is actually a woman, then I would.

>not undefined tho, it can't do anything
>not undefined tho, it can't delete system32
>logic

I'd fuck him

Great, now he just looks like a pre pubescent boy

>we've come to a point where any girl posted is assumed to be a man
I posted a negress because that's what the faggot's into

>if you tell me it's a woman then I admit to be sexually attracted
m8...

doesn't work for a = 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 and b = 1

Not a man lmao.
instagram.com/ana_montana/?hl=en

(S)he's pretty good looking, anyway. I just don't want to find any surprises in he(r) underwear.

What's wrong with that? I'm only attracted to smart girls, you can't tell if a girl is smart from a picture.

got laid off yesterday guys, hold me, i dont want to do interviews again.

Why'd you get laid off?

>you can't tell if a girl is smart from a picture
lol yes you can

Java dev?

Lord have mercy! high test.

I feel like I'm going to get laid off, not because of incompetence, but because of autism

>delete("system32"); deletes system32 and it's not undefined behavior, but you said undefined behavior can delete system32.

Ok smartass.
Lightning can kill you;
Fire isn't the same as lightning;
So go Jeanne d'Arc yourself and come back when done.

Why do you bother writing such low effort bait?

>I'm only attracted to smart girls
no need to lie on the internet

Just scroll down the 'do you know this person' list of your facebook, you'll be able to judge every one correctly by their name and profile picture

>not undefined tho, it can't delete system32

What git client are you using?


inb4 CLI

>insecure babby

Hi everyone. I am trying to make an interactive Monty Hall problem in Java. The only problem is trying to set two goats and the car behind the three doors, randomly every time. Is there any way to do this that would be good. I also want to have the user's choice coincide with the door they chose. Thanks so much in advance.

Check out this retard then >It's not undefined tho, it can't crash

gitkraken

>Jeanne d'Arc

Come on now, lad. Don't go and play this omelette de grenouille bullshit, here.

>sees ellided reasoning
>can't fill in "it's not undefined behavior[; and ut doesn't explicitely tells to delete system32; therefore] it can't delete system32[; btw]"
M8...

.NET backend / Angular+bullshit front

Wasn't fitting in with company culture, expectations, etc.

I'm surprised it took this long, expected it earlier.

git

> (You) #
>Check out this retard then (You) #

Hmmm... my file manager is acting up when downloading files with an exclamation mark. Could it be URL encoding?

U mad ignorant cannuck?

>backpedaling
user...

how is it not C?

>low quality (You)

kill yourself

You're just asking for it by misinterpreting signals, are you? Slut you deserved it

why do you post if you don't know anything? the sample is undefined behavior

I'm American, my guy. I do have recent French Canadian ancestry, though.

Most Quebecqueers are total assholes, though. Glad the family moved to the greatest country on earth.

confirmed for having shit for brains

What's the best book for learning C?

>learning C
it's 2016 f am

Just side-stepping away from the flame war in this thread, is there a premade library in Python which allows users to download webpages?

For example, Ctrl + S in Chrome allows the user to download a html file, is there something similar which can be implemented in a script in Python?

Now THIS is an actual counterargument. BRAVO you did make it!
Now go to bed it's late

Just urllib senpai

you could try HTMLParser and/or urllib, but it'd be more worth it just to pip install requests like a normal person

>THIS
I know, I always have to show these faggots the size of my dick; they never learn