/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: Fsharp.png (2112x4896, 821K)

Other urls found in this thread:

en.wikipedia.org/wiki/Strong_functional_programming
twitter.com/SFWRedditGifs

Attached: 1524342516914.png (3000x3000, 945K)

dumb java homework

Attached: tfw2.png (941x674, 137K)

Lisp

actual thred for another few hours





kys ure self OP
sage goes in most fields

I like gay anime girls, what language is right for me?

Attached: 1499088973208.jpg (400x400, 79K)

isPrime
| candidate divisor |
candidate := self.
candidate = 1 & (candidate

> let let let let let let let let let let let let let let

Half of it is flawed anyways.
e.g: float(32) IS single ('s' at end of number) and default floating point type is double which is ignorantly called just float and not float64 or just double.

>Car car = new Car("car");

Attached: DISGUSTING.jpg (3160x3160, 341K)

This is me

So I prefer
Car new

I can't see half the shit anyway, as OP thought it was wise to put a transparent background on it.

Dark background retard detected.

manchild

>implying I'm a male

yes. you are.

You always have a dick inside you so it wouldn't make much difference what is your gender is.

I'm an actual virgin, believe it or not.

Whatever helps you sleep at night, sweatie.

suicidese

>plan to contribute to my open source projects
>waste time checking the traffic and never commit anything
How do stop doing this?

Attached: Screenshot from 2018-04-21 17-42-46 c.png (590x972, 53K)

Show bob

stimulants
>sweatie

>open sores
Stop working for free, user.

Okay, here you go...

Attached: Bob.png (316x624, 63K)

>I am pure because I take it up the arse

If one "takes it up the ass" then one's not a virgin anymore, user. I never said I'm pure, I just said I'm a virgin.

>arse
it's ass

You forgot a comma.

So this is the power of a bagina..

>the power to not put out
Yeah, you could say it's one of its powers...

What's wrong with open source? It's good resume fodder, and it's a way to give back for all the open source projects that I use.

none of you know what you're talking about

What are 'we' talking about anyways?

tells that to Widenius who sold mysql for $1 billion to sun microsystems

Don't conflate MySQL the DBMS software with MySQL AB the company. What he sold was the company. The software is still open source.

"MySQL was owned and sponsored by a single for-profit firm, the Swedish company MySQL AB, now owned by Oracle Corporation.[8] For proprietary use, several paid editions are available, and offer additional functionality."

he sold both

If the software belonged to a company, then he probably wasn't working for free, user, which is the entire point of this discussion.

but it's who implied that open source = working for free. mysql is open source and despite that Widenius earned a lot of money.

hello frens what are some good resources for learning haskell? i'm comfortable with category theory/the math side of things, just wondering which books/sites are best

Attached: shranp.jpg (2400x1600, 591K)

Learn you a haskell
Programming in Haskell - graham hutton

I'm trying to make snake in F# and I am basically just passing the whole game state around in Observable.scan. I feel like this isn't the right way to do it but I'm not sure.

Implement a finite state machine.

can I create an opengl vbo that is made up by 2 arrays? I need 2 floats and 1 long per vertex. is that possible?

c#

I'll look into it but I do need to know the current position which might be hard with an FSM right? Wouldn't I need a state for every position?

what toolkit is that? it looks nice.

Can't be done because functional isn't Turing-complete.

What would you all recommend to learn C as someone who has two years of academic programming experience in java and python?

This. Switch to OOP.

You shouldn't conflate libre and gratis. Or copyright and license.

I'm basically doing pseudo OOP right now. Just passing a State record which right now just holds the player info through Observable.Scan

"Libre" and "gratis" may not be de jure the same thing, but they're pretty much de facto the same.

>functional
>state

Attached: 1524178498334.jpg (665x503, 39K)

That's one of the things I like the most about lisp.

Maybe I should put "state" in quotes because it is really just a value I pass to a function which then "returns" it to the next event that fires. I'm not really sure how observable works but basically when I press a key it is like I am calling a function with that value and the value of the previous event. I don't know if it really breaks the rules of functional or not.

What i'm hinting at is that for something which requires to keep and change a state at every frame (like a game) functional might the worst conceivable choice you could make, you're probably realizing that by now

Attached: 1523401962174.png (612x427, 375K)

I know it is. I am doing this just to learn how functional works because I could make snake pretty easily in a imperative language.

Functional doesn't work. It's a meme.

Well it works on my machine

So you could say it's not "functional"

Attached: carlos.jpg (600x600, 34K)

The point is they are mathematical proof of concept toys not meant for any actual use.

But they are so pretty.

I'm not disputing that.

Pure FP is still good for most everything that happens on a given frame. Only the outer loop uses state.

...

One day functional languages will rule the world.

Lambda calculus is Turing complete so functional programming is Turing complete. Finite state machine isn't though. Don't know what idiot suggested that.

(This time with better formatting) Wrote a script to launch the current dpt thread in go.
package main

import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os/exec"
"strings"
)

const gCatalog = ".json"
const dptThreadURL = " 0 {
// print out a URL to feed into chrome
_ = exec.Command("google-chrome", fmt.Sprintf("%s%d", dptThreadURL, threadNum)).Start()
} else {
log.Println("There is no dpt thread up right now")
}
}

func findDPTThread(threads []map[string]interface{}) int {
for _, page := range threads {
threads := page["threads"].([]interface{})
for _, p := range threads {
post := p.(map[string]interface{})
sub, exists := post["sub"]
if !exists {
continue
}
if strings.Contains(sub.(string), "dpt") {
return int(post["no"].(float64))
}
}
}
return -1
}

func checkErr(err error, message string) {
if err != nil {
log.Fatal(message, " ", err)
}
}

Anything that isn't FP is good for everything all around without making stupid concessions

What concessions are being made? You just have to separate pure from impure (monads), and there are benefits to be reaped from doing so. For instance, easy parallelization of the pure fragment.

>doing intro to programming final
>"Please take a moment to explain briefly the one most important concept you learned in this class, AND how you learned it."
>tfw I haven't learned shit besides basic functions and ezpz programs

15 mins left pls help

how do I answer this

Weak functional programming is Turing-complete. Strong functional programming isn't.
en.wikipedia.org/wiki/Strong_functional_programming

There's only two options:
make up a bullshit answer
or drop out and become a plumber.

Are arrays an important concept?

I hate poop

Answer the most important concept you learned was recursion. Claim it's the most important because recursion is the most important. Say you learned recursion by learning recursion.

>Weak functional programming
>Strong functional programming

the fuck

How functions allow for improved efficiency due to being able to be called multiple times and in a vairety of places wiuhtout ahving to rewrite code.

dumb frogposter

that's forbidden love

Previous thread is still not dead

The link actually redirects to total functional programming, which is the proper term. Then weak -> partial.

does it matter knowing this?

i think its more for computer scientists than programmers tho

Well, more people are likely to know it as total/partial than strong/weak.

im i get swol af will women like even if im a nerd?

what about a sense of humor? People say that women like a guy with a sense of humor but i really think they just laugh at handsome guys

>swol
no, but being fit in these sense that you're in shape and won't fall over by lifting a toaster is always a attractiveness multiplier.

>humor
humor is always an attractiveness multiplier.

personality traits won'ts make you not look like a gremlin though.

I fail to see what this has to do with programming though.

social programming

BTFO

At what point do classes start actually getting difficult

they don't

i just want you guys to know that you are my best friends :)

Got hard for me around 3rd year with security courses teaching forensics.

Still hit or miss.

They're not supposed to be hard though, that's why you take classes. Because they know how to give you the information in a way that can be easily learned and digested.

Can you post the assignment? I'm learning Java and would appreciate the practice.

holy shit f# looks comfy

sup patrick

OS was hard but I had an asian teacher with a thick accent. Its like fighting 2 people at once

Fag _you_ = new Fag();

it is very comfy

Do you guys use an IDE or a text editor? Does an IDE restrict memorization of syntax for languages? I'm afraid of using one.

I program by moving single electrons at a time on my hard drive

IDEs are better if you have the option, vim is pretty decent too.
Using a pure text editor is straight up retarded though, and IDE will allow you to ignore syntax if you choose, it just tells you that you're ignoring syntax.