/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: okay.png (480x480, 265K)

Other urls found in this thread:

github.com/github/explore/pull/563/files
youtube.com/watch?v=E4RarTAZ2AY
developers.google.com/ads/
en.wikipedia.org/wiki/Psychological_projection
perf.rust-lang.org/
learnxinyminutes.com/docs/python3/
github.com/ghc/ghc/blob/a5373c1fe172dee31e07bcb7c7f6caff1035e6ba/libraries/ghc-prim/GHC/Tuple.hs#L170
overapi.com/
rosettacode.org/
better-dpt-roll.github.io/
twitter.com/SFWRedditVideos

First for C

congrats

What've you been working on?

clojure

Do u guys think that frog is a girl(female)?

I can imagine that it's way easier to verify something that uses and mutates a bunch of class members, though.
After all, you can come up with a fitting class invariant, encapsulate the state and maintain the invariant through the limited access provided by methods.
State in Java seems way less problematic than actual global state, and I'm not sure if reasoning about well designed classes is really as difficult as you claim it is, assuming that we're not dealing with code that exposes every class member through an accessor.
Properly annotating an invariant for a parameter that you mutate shouldn't be that much of a deal either.
So I'm not convinced that program verification is incompatible with OOP or Java, just with insane OOP.
It's certainly not incompatible with imperative code that describes a pure function, either - so except for that stuff about Haskell encouraging purity, I don't see a huge difference.

Just started python. Have experience in HTML from the good old days

Anyone in robotics here? I’m getting my start self taught

Any recommendations?

Attached: EAC9905A-84F1-49C2-AA5B-1AE26FA70C3E.jpg (4032x3024, 3.06M)

pushing dead memes github.com/github/explore/pull/563/files

yes, thanks to atrazine

Friendly reminder to use AppImages to package your software across all Linux distros.

Attached: AppImages rock.jpg (868x6656, 724K)

Why

nice cat & good luck

Any fag on mobile dev here? How I monetize my fellow android users?

youtube.com/watch?v=E4RarTAZ2AY

developers.google.com/ads/

>each package includes libc and xorg
woah brilliant

Scala and Go are better. But really there's no reason to not just use mainstream. Clojure nobody uses that

>nobody uses that
Walmart uses it for every receipt.

FROGPOSTERS FUCK OFF

no, you go away. racism is not allowed on Jow Forums.

Can black people code?

Yes.

Attached: davidnolen.jpg (1280x720, 103K)

>being this white hat

I mean the real methods you fag

there are so many things wrong with this image
ugh

en.wikipedia.org/wiki/Psychological_projection

You gonna work for em? How? It's not possible you get a job. I need a job someone help me

Making a simulation of diblock polymerisation. Trying to figure out how Python multiprocessing works but first I need to adjust my model so that it accounts for concentration, temperature, etc. First pass looks sensible.

Attached: MarkovPolymerSim.png (1872x1311, 213K)

The current prodigy in the senior class at MIT is black.

>while n

What's his major/area of interest?

Isn't that the best way to do it if I might later on iterate through many values instead of just a static number?

The idiomatic way to do that in Python is:
for n in range(1000):

perf.rust-lang.org/
Based
Are other languages even trying?

Fair enough. Thought you were going to tell me there is something fundamentally wrong with Python while loops.

I'm not the same guy. I'm just guessing that was his complaint.

#include

char b[] = "\x19\x12\x1A\x23\x2C\x39\x19\x12\x1A\x23\x3C\x3F\x18\x12\x1A\x23\x2C\x3C\
\0%d\0%s\0\
c bottles\0 of beer\0 on the wall\0, \0.\n\0\
Take one down and pass it around, \0n\0N\0o more\0\
Go to the store and buy some more, ";

void r() {
for (int i = 0; b[i]; i++) {
char p = b[i];

switch (p) {
case 24:
b[25]--;
p++;
case 25:
printf(b + 19, *(b + p));
break;
case 27:
b[33] ^= b[34] ^= b[33] ^= b[34];
p--;
default:
printf(b + 22, b + p);
}
}
}

int main()
{
while (b[25] > 2) {
r();
}

b[14] = 0x1B;
r();
b[12] = 0x62;
b[13] = 0x66;
b[14] = 0x1B;
r();

return 0;
}

ay solaried lite

I only come to /dpt/ only to bully C fags.
When is the next lang-war? I want in.

Attached: 1546391014434.gif (434x360, 671K)

Bully me.

If your program is designed in a way that you can find a nice invariant, yeah, but if you don't have some nice properties that are relatively simple, it can get very tough.
Your state can get pretty complex. Objects that have different behaviour depending on state aren't all that uncommon and so are objects that depend on others (even bidirectionally), so you may need to actually account for local program behaviour. If you have concurrency, it get's even worse, because you have to prove that the state of objects isn't going to change/this change has no effect. It's just pretty messy.
>well designed classes
depends on how you define well designed. An object with a complex state isn't bad for OOP, but makes it hard to work with for verification.
>So I'm not convinced that program verification is incompatible with OOP or Java, just with insane OOP.
It's not an inherent sin of OOP or Java, but OOP just lends itself well to that style, so it's used often enough. Most enterprise Java I've seen is insane enough that I wouldn't want to touch it with a ten foot pole.
>so except for that stuff about Haskell encouraging purity, I don't see a huge difference
But that -is- the big difference! Idiomatic haskell tends be quite pure because it seperates impure and pure functions. With OOP there are a lot of traps (in regards to verification) that you can fall into, whereas with Haskell you would have to almost certainly intentionally set out to recreate them.

I'm writing an application for work (my main job role isn't software related), and I need make it so that users can log into the application using the same windows username/password that is used by all of our IT infrastructure. How do I do that?

Attached: 1545366496013.jpg (500x375, 49K)

One line
fn main() {
(0..100).rev().for_each(|n| {
match n {
0 => {
println!("No more bottles of beer on the wall, no more bottles of beer.");
println!("Go to the store and buy some more, 99 bottles of beer on the wall.");
},
1 => {
println!("1 bottle of beer on the wall, 1 bottle of beer.");
println!("Take one down and pass it around, no more bottles of beer on the wall.\n");
},
_ => {
println!("{0:?} bottles of beer on the wall, {0:?} bottles of beer.", n);
println!("Take one down and pass it around, {} bottles of beer on the wall.\n", n-1);
},
}
});
}

If you find what endpoint encryption they use, you can use the same communication protocol to request to make your outgoing data look like a normal log-in request. Hopefully end-to-end salted encryption established some way, then send the username/password, and they return an encrypted confirmation/deny, and let you start requesting data.

That sounds like total bullshit. There is clearly some sort of API for doing this, because we have several applications from other vendors that have the same sort of shared login capability that I am describing.

Does anyone know of a web page, or any resource, with examples of how to do the basic constructs/syntax of each language, or at least pthon/bash? One that you can just search with ctrl +f for what you want, like "increment", "while", "for", "array", "global", etc.
I don't really care to learn the language at all (ie python), I just need to see some basic examples of how to format shit/syntax. I always end up making a few files with examples of such things by manually searching for each one online one by one, it is a pain in the ass.
Bash is probably the best example, most people just want to make a for loop or something and get back to the non-bash project at hand.

Attached: Frederic Edwin Church (1826–1900) Oosisoak - oil on canvas 1861.jpg (1095x1488, 2.08M)

learnxinyminutes.com/docs/python3/
?

github.com/ghc/ghc/blob/a5373c1fe172dee31e07bcb7c7f6caff1035e6ba/libraries/ghc-prim/GHC/Tuple.hs#L170
>the state of FP tards

Attached: 1549755834302.jpg (425x283, 18K)

>make
>errors
>make clean
>make
>no errors
Never failed me once

Attached: 1483924575282.jpg (510x624, 208K)

#include

int
main (void)
{
int beers = 99;

while (--beers > 1) {
printf("%d Bottles of beer on the wall.\n %d Bottles of beer, take one down, pass it around, %d bottles of beer on the wall!.\n",
beers, beers, beers);
}

printf("%s\n%s\n",
"One bottle of beer on the wall, one bottle of beer, take one down, pass it around, no more bottles of beer on the wall!",
"No more bottles of beer on the wall, no more bottles of beer! Go to the store, buy some more, 99 bottles of beer on the wall!"
);

beers--;
return beers;
}

Use overapi.com/ if you want lots of info about one language at a time.

Use rosettacode.org/ if you want to see the same algorithm in many languages.

YES. THAT IS WHAT THEY DO. They know what the proper protocol is, use a library which uses that protocol, and then after a successful login, request data.

Er, I was playing with where to put the decrement and it needs to start with 100. Someone always drinks one on the way back from the store.

>int
main (void)
when did this shit start, and why are C/C++ dweebs trying to emulate FP type signatures?

This shitlang was a mistake.
#include
main(t,_,a)
char *a;
{
return!0

>look mom I ran it through an obfuscator that makes the language bad!! xD ^^

you can save half a second finding the function name on-screen if it's always at the margin

Excellent, thanks gents. These are all great.

Ctards code in C for the smug factor and fp languages are more smug than C but they’re too stupid to learn Haskell so bringing Haskell bullshit to their already shitty C programming is the next best thing.

I learned it from work, a company which has existed for 30 years. Why did Haskell copy C writers?

>a company which has existed for 30 years
ML is older than c, baka.

I’ve seen tons of bullshit in “””””””professional“”””””” C code.
int
main
(
int fuck_you,
char** whoever_has_to_read_this
)
{
/* unhelpful one line comment in multiline syntax */
return(0);
}

uninitialized for her pleasure

That is one cute image user

I'm going to design a language that lets you program in smugness directly.

Pictured: a C program that a reasonable human being would write

Should I learn Go or D?

What's the difference?

It needs monads and manual memory management.

What languages do you know so far?

>when did this shit start, and why
It's so you can grep for ^function_name and find the definition. It has nothing to do with FP.

based

Can someone post the images that help you pick a project to work on?

In return I shall post delicious instagram thot ass.

Attached: 1546108065861-pol.jpg (1080x1080, 104K)

>3D
kill yourself

Post a cute 2d anime girl and I might help you out

no, but I can recommend you make a list of programs you could actually use and pick from those

Looks like none of us here are going to get what we want then.

>3dpd
this aint /mu/ or /tv/

Attached: 1545222660165.gif (640x360, 439K)

Sorry user I forgot this is now a tranny discord board.

R

Is category theory and abstract algebra worth taking in university if I want to improve my functional programming skills?

>3d
yuck, what the fuck are you doing?

What goals do you want to achieve?

Can someone post the images that help you pick a project to work on?

Here's a smug anime girl in return.

Attached: 1444452040180.jpg (700x988, 85K)

Smug's good enough
better-dpt-roll.github.io/

Can't you do that just grepping for the (type) (function_name)?

Job

image is on like v4 now, but here's an old one.

Attached: 1501240887109.png (3840x2160, 1.61M)

>Manuel says: Including one more declaration gives a segmentation fault.
wut

nvm i'm retarded

Only if you already know the return type.

Go is probably more employable than D because companies trust Google to know technology.

You could look at job listings for a more reliable source of information than a Jow Forums user though.

If C++ is better than Rust then why does reddit make such good Rustshill memes?

Attached: s3xx2dnzprf21.jpg (627x680, 90K)

>haha remember that childhood show you used to watch?
zzzzz

Holy fuck, you're all redditors. I check r/programmerhumor and it's filled with /dpt/ memes.

roll

rollarino

just started using source control(P4V) with ue4
everything is so confusing and i'm not sure if i'm doing anything right

What the fuck, do people actually find this shit funny? Why does that sub even exist. Who are these people?

retards, use random.randrange(1, 146) in python instead of spamming the thread with rolls

Attached: 3f5.gif (640x360, 1.79M)

There is literally nothing wrong with using reddit and people who constantly sperg out about redditors are redditors trying too hard to fit in.

Prove me wrong