/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

en.wikipedia.org/wiki/ML_(programming_language)
github.com/sophiebits
imgur.com/a/vAsNc.
twitter.com/SFWRedditImages

I like Perl.

python/JS don't count, lad.

What's Perl really like? Does it see any real usage anymore?

I pretty much passed it over when I was a kid.

I understand every single one of these concepts better than the autists that preach them, so I can say authoritatively that you're an autistic fizzbuzzer.

>I understand every single one of these concepts
Evidently not.

>Does it see any real usage anymore?
Doubling the question

Tell me about monads without using the usual answers.
Tell me why totality would be desired by someone with a different opinion than yours.
And give me an example of a dependent type.

You're free to pick one of these, or all.
Hardmode: No google.

stay mad autistic fizzbuzzer

>Evidently not
The only thing evident is that anyone who preaches your memes as suitable for general-purpose programming is a non-programmer.

>is a non-programmer
Interesting given my current job as a programmer.

Leviticus 20 13

Romans 17 49

any cute feminine programmers in this thread? i want to teach you C on my lap

Germans 14 88

we're all men here, definitely not women pretending to be men

I like Lisp.

C was a mistake
ML was robbed

It didn't have to be like this

Fact: XNOR is the gayest logic gate.

>ML
?

Hi I write mail bomb app in python

am i hacker now?

>Tell me about monads without using the usual answers.
>without using the usual answers.
What is that even supposed to mean?

>Tell me why totality would be desired by someone with a different opinion than yours
To ensure that the program terminates, which is required for a consistent type system.

>an example of a dependent type
Anything that uses the type system to encode a property that depends on a value. "4 is odd" could be a dependent type. "5 < 6" could be a dependent type. etc.

en.wikipedia.org/wiki/ML_(programming_language)

Bad move, kiddo.

>To ensure that the program terminates
To be more precise, to ensure that it's impossible to construct a program that doesn't terminate.

what useful thing have you made with your meme language(s)?

>Anything that uses the type system to encode a property that depends on a value.
i don't like those choice of words, but close enough i guess.

Why do people still bother with OCaml?

Pls dont tell

Fuck K & R. I am /prata/ now.

why not just go to your gmail and send an email to every recipient?

why use a program?

Satisfiability modulo theories and refinement reflection will save formal verification.

>why not just go to your gmail and send an email to every recipient?
>why use a program?

We have almost 3000 contacts in our organization and we need to check their validity, as some of the contacts are up to 10 years old.

I just send everyone an e-mail and collect the delivery failures.

also:
>why use a program?
Because Gmail doesn't allow me to send 500 mails (=daily limit) at once. I think the max is like 20 or something like that.

>useful
Did you forget what website this is?

Most email providers have whitelists. Good luck getting through on your home connection.

>using gmail for an organization
what are you even doing, user?

I'm using Google's SMTP with a freshy created gmail account. They will ban the account within hours, but by then I will have collected all delivery failures and just create a new account. works perfectly fine.

yeah 95% of the posters just circle jerk

but every now and then there are some good posts about programming here

>i don't like those choice of words
What's wrong about that choice of words? It's a proposition about a value, whereas mainstream type systems can be thought of as dealing with propositions like "there exist values of type T" or "a proof that there exist values of type A implies that there exist values of type B".

>>using gmail for an organization

Except that we're not. see

>browsing GitHub looking for repositories
>came across this one: github.com/sophiebits
>think: "this girl has an impressive portfolio"
>ok look: she has a website
>go to website
>see August 26, 2017 entry

every time

let me guess: she already has a boyfriend?

did you expect to hit it off with this person or something

...

and? i already saw this

Why do you even care?

I sometimes think these people genuinely do think that. Even if they were perfect for each other is the idea that he'd send a PR with some cheesy pickup line?
Yes it's obvious did you not see the picture?

When programming socks go too far.

Updated Agda fizzbuzz to be more robust using a "decidability" type. Here's the final implementation:


_divby_ _notdivby_ : (x n : ℕ) → Set
x divby n = x mod n ≡ zero
x notdivby n = x mod n ≠ zero

data FizzBuzz (n : ℕ) : Set where
fizz-buzz : (n divby `3) → (n divby `5) → FizzBuzz n
fizz : (n divby `3) → (n notdivby `5) → FizzBuzz n
buzz : (n notdivby `3) → (n divby `5) → FizzBuzz n
number : (n notdivby `3) → (n notdivby `5) → FizzBuzz n

fb : (n : ℕ) → FizzBuzz n
fb n with (n mod `3 ≟ `0)
fb n | yes p3 with (n mod `5 ≟ `0)
fb n | yes p3 | yes p5 = fizz-buzz p3 p5
fb n | yes p3 | no p5 = fizz p3 p5
fb n | no p3 with (n mod `5 ≟ `0)
fb n | no p3 | yes p5 = buzz p3 p5
fb n | no p3 | no p5 = number p3 p5

>2018
>browsing with images enabled

How often do you use memoization?
Seems like it'd be used all the time.

intredasting

If you don't need it, then the hashtables are just taking up needless space

Best python IDE?

>Best * IDE?
emacs

>space
Space is pretty cheap though.

>emacs for Windows
shiggydiggy

There is the overhead of looking up the saved result.

Mmm... I forgot that my header defines default window procedure to accept ASCII.

PyCharm

>windows at all

Community good enough?
Any person working in the industry uses Windows, unless it's a startup.

I'm making a program that targets traps and repeatedly calls them a faggot.

>Any person working in the industry uses Windows
Lol

I want to learn C. C++ spoiled me enough.
is Learn C The Hard Way a good starting material than K&R? Suggestions!

t. Brainlet

I use windows all the time at home, so I'm not being a purist or memey or anything, but I cannot even fathom why anyone would accept, let alone want to, dev in a windows environment. It gives me dread and makes my eye twitch just thinking about it.

>Community good enough?
Yes.
>Any person working in the industry uses Windows, unless it's a startup.
The fact that you had to ask for a Python IDE should make you think you're not qualified to know how programmers work in real life, user.

And Mumbai doesn't count.

I develop in one, and it sucks.

also brainlet question. What is the equivalent of winapi for linux? All i need is just creating window and do basic shits. Where should i look for that, Xorg source code?

Xlib or XCB

What's the difference between windows or any other OS for developing? I mean, you barely interact with it. You're being a sperg.

...

>I mean, you barely interact with it.
Yes, if all you write is JS, Python and PHP.

Is it wrong to make a game in Rust?

It's wrong to make anything in Rust.

Depends how much you are comfortable with writing yourself. I mean, there are libraries for cross platform graphics, input, and audio, there's nphysics, but that's about it.

What do you write, and how does it increase your interaction with the OS?
I would also argue that you interact more with it, if you use those language, since you spend more time in shitty browsers.

Anything involving epoll or even file manipulation.

>using git in windows

Still used a lot in systems.

thank you user! I'm a vague fucktard and by "do basic shits" i meant doing really basic 2d drawing. Will Xlib + GLX (OpenGL) be enough for such task?

Sure. Xlib also has some built in drawing functionality.

some of us folks have started an IRC channel

#Sup Forumsdpt on rizon

disgusting

Alot of people here talk about programming languages like they write EVERYTHING with that one language.
Why do that to yourself? lmao.

Been building some utilities for my hentai decensoring network. I've been thinking about the best method of distributing this thing to users. Hosting a server is no good since I don't to shoulder any costs, so everything needs to be done on the user's computer. I tried building a GUI with tkinter, but that library is absolute garbage for any kind of image editing.

I've also tested the limitations of the neural network. It does great for simple decensors like the first 2 images of imgur.com/a/vAsNc. But when complete sections of the vagina or penis are gone, it struggles to fill in anything meaningful like in the last 2 images of imgur.com/a/vAsNc.

Poisson blending doesn't improve color smoothness between the AI-generated region and the rest of the image.

i use one language at home

okay, but what are you doing at home?
I do alot of things at home.

as opposed to using multiple languages at work

>android

Explaining python kids how to use partials in this toppic.

The whole point of using multiple langs at work is to make whatever you're working on easier. Could be that it's an entire pre-existing massive system of java, obviously use java. Could be you're gonna be working on an embedded system, use C. Could be held at gunpoint, forced to reimplement pthreads in awk, use awk.
Why not at home?

>tkinter
Why not Qt?

i don't really like programming in anything else
it isn't so much a matter of ease for me

I thought tkinter would be better since it's included in python installations by default so there's less to install for people who want to run my code. Plus I hate installing anything on Linux since something inevitably goes wrong and I have to hunt for a solution.
But I'm switching to PyQt.

Fuck you Zed your books suck

Personification of logical gates is wrong.

If you didn't made being competition, maybe straight people would be still here.

Follow up on Managed to make it type safe(r) using std::variant. It was tricky producing a different typelist form the original.
#include
#include
#include

template
struct append { };

template
struct append {
using type = TT;
};

template
struct transform {
typedef void (*F)(T*, const T&);
using type = typename append::type;
};

template
struct transform {
using type = TT;
};

template constexpr void fill(C &, size_t) { }

template
constexpr void fill(C &c, size_t n) {
c[n] = { +[](T *here, T const &other){ new (here) T( other); } };
fill(c, n+1);
}

template
constexpr auto getCopyCtors() {
using v = typename transform::type;
std::array result;
fill(result, 0);
return result;
}

struct Foo { Foo(const Foo&) { } };
struct Bar { Bar(const Bar&) { } };

template struct overloaded : Ts... { using Ts::operator()...; };
template overloaded(Ts...) -> overloaded;

int main(int, const char* [])
{
auto n = getCopyCtors();

for (auto& v: n) {
std::visit(overloaded {
[](void (*)(Foo*, const Foo&)) { puts("fcopy"); },
[](void (*)(Bar*, const Bar&)) { puts("bcopy"); },
}, v);
}
}