/dpt/ - Daily Programming Thread

Last Thread: What are you working on, Sup Forums?

Other urls found in this thread:

izzys.casa/posts/millennials-are-killing-the-modules-ts.html
raw.githubusercontent.com/AmyBSOD/Amylona/master/1.73/source.hsp
deals.gdgt.com/sales/pwyw-white-hat-hacker-2018
deals.gdgt.com/sales/pwyw-learn-to-code-2017-google-go
goodmenproject.com/featured-content/brand-thats-not-a-fedora-and-stop-wearing-it/
reddit.com/r/cpp/comments/69i38l/using_c_modules_in_visual_studio_2017/dh7e7v5/
twitter.com/NSFWRedditGif

Agda is the best programming language to learn first.

javascript: document.body.contentEditable='true'; document.designMode='on'; void 0

no

t.

i love idris, but they aren't good first langs.

Why not? Languages like Java and Python are far more complex with rough edges and all sorts of traps and pits that trip up new programmers.

Why not? I think it makes perfect sense that you should learn rigorously correct programming first and then learn how to apply all that (without the rigour) to a more practical language.

First for javascript for prototype based oop

...

Write-Host $whatever
Works perfectly fine

$whatever | Out-File whatever.txt
I get an empty text file

Am I retarded?

What is your favorite coding language, guys?
Mine is Python

...

What was the reasoning behind this?

Exactly user. Glad someone else understands what I'm getting at

export (foo)
export (import x)

umop apisdn
in the upside down?
how did we get here?

>export (import x)
That doesn't make any sense though, it looks like you're first importing it then exporting it.

I want to try to make a simple blackjack game.

When it comes to security and tampering prevention, how do I store and verify the player's current hand?

Do I store it in a JWT and send it back and forth?

wouldn't a JSON file work?

>it looks like you're first importing it then exporting it
you are. it's like when you include a header in a header

this guy says it's been voted out tho
>Terrible decisions have been made and reversed by the committee (just look at the whole export import syntax that was voted in and then out this past year).
izzys.casa/posts/millennials-are-killing-the-modules-ts.html

I think it's evident from the fact that newbies seem to have an easier time picking up Rust than many "experienced" programmers. I say "experienced" because an actual experienced programmer would be writing code that is mostly in line with what Rust expects already (and they will understand how to work around it when necessary), whereas someone with a couple years under their belt in a typical language will have to unlearn a lot of bad habits and will be resistant to that because "b-b-but it worked in X".

>think space station 13 code is terrible and a complete mess thanks to BYOND
>mfw finding yesterday the one for elona
I was not prepared for a single 11mb file and the many horrors lurking inside.
raw.githubusercontent.com/AmyBSOD/Amylona/master/1.73/source.hsp

header files are the worst thing

What do you mean?

WOULDN'T A JSON FILE WORK

>tfw just now getting into the differences and intricacies of programming languages
>tfw i have to correct my previously wrong beliefs about both specific points and general points
>tfw i still sometimes incorrectly think of "typing" w/r/t programming like keyboard typing (i.e. interactive), as opposed to data typing

remember to pay attention in school, kids. don't become a dummy like me.

That, plus the testimonials from people going from Rust to C or C++ for various reasons saying that they are glad they learned Rust because it taught them to think more carefully about ownership.

in a nutshell

implement it with smart contracts

> Working on leaving Bl-Ohio

I'm a software dev with 5+ years experience here in Ohio. I'm looking to leave Ohio by end of March in one of the bigger market area.s Anyone have any advice on finding companies, preparing for faggot interview questions, moving across the cuntry?

Pic related. It's Life in Ohio

Too verbose.

what part of ohio? why u wanna leave?
got a friend who codes for lexis nexis in dayton.
6 figure income, loves his job.

Damn, that's slow. If I'm gonna use SMT in my language I'm gonna have to think hard about incremental compilation at more than just the file/module level.

Then again, I'm planning on implementing the SMT solver myself instead of calling out to something massive like Z3 that undoubtedly has overhead.

>Even as recently as today (October 9th), I've seen incorrect understandings from both the C++ community and even the Rust community on what C++ modules will let us do. Granted, the Rust community is typically wrong about nearly everything when comparing their language to C++, but let's save the eval-gelism discussion for another day.

Should I get to programming or fap?

fap first. it will clear your mind. then code.

you’ve never programmed anything

Not true, I wrote a Hello World in HTML.

dumb frogposter

Trying to multiprocess a boolean function in python. Don't work with python much and have never multiprocessed anything before. Should be a good time.

Has anyone brought any courses from gdgt?

These two are on sale and thinking of picking them both up for $30.

deals.gdgt.com/sales/pwyw-white-hat-hacker-2018
deals.gdgt.com/sales/pwyw-learn-to-code-2017-google-go

>you are
No you aren't, reread the image.
It says it's the new syntax for exporting a module only (before it got voted out of course).

I'm trying to grok rank-n types.

I'll be using Sup Forums as a rubber duck, so, question:
I'm looking at some examples. Is there any function of type
forall a b. a -> b -> a


which can not be written in the form

forall a. a -> (forall b. b -> a)


As far as I can tell, they should be constrained to the identity function or bottom so they are the same. Does that change if we add typeclass bounds to a and b?

They're equivalent (in hindley-milner, isomorphic in fw), regardless of bounds

hash function guy again.
i've doubled the size of the array (user inputs size and the actual size of the array is n*2) which has brought my collision rate down to about 10%, but this still seems a bit high.
my hash function at the moment is:
int hashCode = 13;

for(int i = 0; i < word.length(); i++)
{
hashCode = hashCode * 23 + word.charAt(i); //Multiply hash by another, larger prime number + ASCII val of character (i)
}

if(hashCode < 0)
hashCode *= -1;
out.println("Hascode is: " + hashCode);
return hashCode % tableSize;

any way this could be improved? even with java's built in string.hashCode(), i get the same problem when i modulo it.

Cool.

But say, these two are different right?

foo :: (forall a. a -> a) -> (Char,Bool)


foo :: forall a. (a -> a) -> (Char,Bool)


So does that mean I can always move a forall a. past the curried arrows to the first occurrence of a ?

If it occurs on the left hand side of an arrow, you can't move it, i.e.

(forall ... ) -> ...

That includes

... -> (forall ...) -> ...
which is
...
->
((forall ...) -> ...)

Also you mean the const function

type Thingy = forall a. (Num a) => forall b. a -> b -> a

const :: Thingy
const x _ = x

foo :: Thingy
foo x _ = x + 1

Anyone else who started programming because they wanted to look like a cool hacker?

No

What other reason would there be?

Why would you want to be a hacker?
That's some fedora shit

I wanted to LOOK like a cool hacker.

You wanted to wear a fedora?

how the FUCK does i become 257 if it's not supposed to get past 253?

Actual fedoras are pretty cool.

Hipster "hackers" wear black trilby's without knowing that they aren't fedoras, which is not nearly as cool.

>fedoras are pretty cool

see

Have you seen a real one? My grandfather had one, but they weren't that common because they were actually quite expensive.

The hat worn by the fat guy that often get posted as a memepic on here is not a fedora.

>actually that's not a real fedora

goodmenproject.com/featured-content/brand-thats-not-a-fedora-and-stop-wearing-it/

you sure you dont need a parentheses around "sz - 3"?

...

reddit.com/r/cpp/comments/69i38l/using_c_modules_in_visual_studio_2017/dh7e7v5/

I hate that picture so much. People who wear cheap trilby's should be purged from the earth, unless they are effeminate enough that it fits them. It is a crime against

This guy at least seems to be wearing a reasonably high-quality homburg.

Asking in new thread:

Asking about psuedocode.
How would you go about searching through a sequence of reals A, a real k & an int i which is used to record what part of the sequence is being considered. which also when i =0 its the empty sub sequence of A that is considered.

Which returns a pair consisting of the sum of values in A that are greater than or equal to k.
And the number of values in A which are greater than or equal to k.

The reason I'm struggling is that I'm not sure how to do this without a loop.

Thanks in advance.

ugh i'm still using firefox because of the broken captcha bullshit

the rectangle tabs look like shit. atleast round the corners. it's like they're trying to copy microshart or to put an "original" twist to what chrome is doing. jeez.

or lower the contrast a bit i don't need the tabs to switch between near white and near black to be able to distinguish which tab i'm on

Cleveland. I work for one of the three major health systems here. It's just boring work with people who don't want to do anything. This isn't just my team. It's the entire health system.

Weather sucks.
People suck.
Pay sucks.
Benefits are nothing compared to other 'tech' jobs.

/dpt/ was a mistake

opengl was mistake

what do you have against opengl

Whats the best programming socks?

i like opengl

sheer stockings

The more I read Hui, the more I hate the guy.

>What are you working on, Sup Forums?

Exploring the deepest, darkest corners of Racket. Advent of Code 2017.

>not just making a type representing a player's hand

I tolerate OpenGL.

Little tired of my shaders following every single instruction/standard available and then randomly finding one popularly-used context that it fails compilation because the most asinine reasons, though. I don't know if it's because some graphics cards are accepting things they shouldn't or if others aren't accepting things they should but in essence there's no friggin standardization and I feel you need an entire office of test machines to ensure compatibility.

It'd be nice if I could just write something and I'd know "it'll work in all implementations GLSL 110-130" but it just won't work that way.

>in essence there's no friggin standardization
yes there is. there's extensions and implementation-specific behavior but it's as simple as programming to e.g. the C spec.

I'm about to punch myself in the face.
Using regex, I'm matching against a given URL. I can successfully get the info after the last /, e.g myurl.com/stuff/stuffthatIwant
however, this has a bunch of extra shit on the end. Extensions and whatnot.
How can I take this
/\/([^\/]+)\/?$/
And make it stop matching after it finds a period? I tried adding \. into the negated set in the group matching but it doesnt work. Right now I have to run two separate regex matches, the one above followed by a separate call to /([^\.]+)/

It's fine if you're going #version 330 or later, but if you're targetting earlier versions, trust me, I've been digging around for 5 years, there is effectively no standardization before that. There's an "official standard" (at least something that as far as I can tell is supposed to be that), but no one supports it and no two GPUs support the same thing and NONE fail gracefully.

It'd be like coding in C if every different machine had different names for the base types and every standard function had different types.

Will learning emacs lisp make it easier to learn common lisp later?

kind of. At least learning emacs lisp was really easy once you knew common lisp.

Whats the role of a string scoring function that measures how likely a string is apart of a name or address?

Where can I look which cards support OpenGL4.3+ drivers?

this

Ugh. I'm trying to find a new language to expand my horizons again. I've experienced a fair share of languages, both functional and imperative. From Java to Haskell. with many in-between.
tldr; -> What do you think of these (F#, Elixir, Rust, D, Crystal) languages that I've picked? Any insightful opinions?

F# and D are pretty run-of-the-mill.

They are the most concise though

Try Nim, it's better than all of those.

malbolge

J?

Rewriting miniKanren in elixir and idris to learn more about it

Nice maymay

Wow. This one seems great. Will inspect it in detail.

Encountered it. Since I love to fuck around point free in Haskell it might be a fun time, though not very productive.

Where's the best place to apply for jobs?

What kind of jobs? Also what qualifications do you have?