/dpt/ - Daily Programming Thread

What are you working on?
Previous:

Attached: m18U31V7G3KRGT4jjOpvjD1vwdnNzq5pB5XmjnI5gWQ.jpg (960x762, 87K)

Other urls found in this thread:

en.wikipedia.org/wiki/TLA+
wiki.sei.cmu.edu/confluence/display/c/SEI CERT C Coding Standard
twitter.com/ManishEarth/status/1027676698068713473
youtube.com/watch?v=t62Rty9yCoY
youtube.com/watch?v=xDwGAJ4FnA8
twitter.com/SFWRedditVideos

>error handling
Pass it to the logger service and show it to the user in a messagebox.

i'm working on a crypto trading bot that uses machine learning (in node.js)

btw anime and monads are trash

JavaScript
> ["10", "10", "10"].map(parseInt)
Array(3) [ 10, NaN, 2 ]

A language designed around the methodology of writing functional specifications and refining them to imperative programs.

rust

ADA

Not with panic

"No!"

not even gonna try to figure that one out but here's the correct way to do it

["10", "10", "10"].map(x => parseInt(x))

F*

friendly reminder map is not traverse

Idris

>no eta-conversion in JavaScript
Quelle surprise.

Why

(but traverse can be map)

it's just a map that takes an applicative function and range.
wow how revolutionary.

I don't understand why OOPsies get so upset by traverse and desperately claim it's just map. Actually maybe it's because their favorite languages can sort of implement the latter but not the former.

The actual issue is that ParseInt takes two arguments.

They don't understand. Look at this brainlet >s-surely I can't be wrong again?

Attached: DdM5PONWAAAEc7W.jpg (1241x1010, 72K)

whats the difference between using CMake and a random C++ IDE (like CLion)?

That's incorrect, though.

then prove me wrong.
hint: posting a brainlet image with my post number is not.
why?

en.wikipedia.org/wiki/TLA+

How are we ever going to get them up to speed on something like lenses if they're still struggling with traverse, of all things?

Attached: test.jpg (211x119, 14K)

Your characterization of it does not match its type.

give me an example of traverse that does not match: mapping an applicative to a range and getting the new range.

>js

here is your problem

Frankly I think you're all gay

~~”0”
And just works

Attached: Capture.png (320x156, 8K)

Anyone here familiar with GCC internals?
How the FUCK do I force the linker to align sections to a 4096 byte boundary without using a custom linker script or defining it in the source of the program being compiled?

>update pull request
>CI jobs screwing up at apt-get steps randomly
>hideous gay nigger in your face to mock you

Attached: dicks.png (287x285, 50K)

traverse Const (3, "foo")

It's the same in C, !"0" == false.

why would you ever do that

js> 0 == "0"
true
js>

>he didn't it

using traverse as fold

Why does Haskell generate such huge binaries?
"Hello world" becomes a whopping 1.2 MB.

or you know just use fold.

use the lens library

read the spec
Array(3).fill("10").map(Number)

Statically linking the entire standard library. If there wasn't already libc in the OS, C programs would be huge as well.

Managed to get the feature I've been working all this week to work correctly. Did the commit&deploy&run. Still got shitloads of unit and integration tests to write.

Ah, static linking by default, I see. Why doesn't ghc use dynamic linking by default like gcc and clang do?

Daily reminder to read an follow wiki.sei.cmu.edu/confluence/display/c/SEI CERT C Coding Standard .

These people don't even understand traverse, they'd have no chance with lens

Because dynamic linking sucks.

Because that would make deplyment too complicated, for some reason most OSes don't include Haskell's standard library in the base system.

are unused symbols still in the binary if you link statically?

Daily reminder that most programmers use languages that, while shit, aren't so disastrous that they blow up like C does if you look at it wrong

I love weakest preconditions!

Have you ever used Godot Engine? Would you say it's worth learning?

Attached: sicp_nazrin_small.png (1000x1678, 2.17M)

Yes, the linking works on library basis, not per function. There is an option to compile each function into a separate object file so it would link only required function, I don't remember the name of the option, and it make compiling too slow.

Oh no, nononono.
I know what's happening. This happened with a lot of boards before. First, people with transphobia come. They acknowledge the existance of trans people and tell them to fuck off. Then the trans people come and start shitposting their trannyshit all over this board. The transphobian people shortly fuck off, saying "oh this board went to shit", without realizing that they started this shit. Slowly Jow Forums won't be about technology anymore and the board dies out.

Please. stop. this.
Ignore trannies, don't acknowledge their existance. They are NOT here.
Most of them are larpers. You don't give them a (You), you just let their threads die.
Jow Forums, please.

currently working on a GUI interface using Visual Basic to see if i can track an IP adress.

>inb4 comments saying this doesnt make sense
>fuggin sherlock

The benefits of the way C is designed will always outweigh the costs, as long as we don't write bad code.

Go back to your "safe space", bigot

@67089664

Attached: 1530068994244.png (466x510, 324K)

>be me
>be new to Jow Forums
>see any post i dont understand
>think im funny
>tag someone with an @
>hit post

>at this point honestly just kys

Even parrots and dolphins can understand traverse, what's your excuse?

Why in the world would you implement Machine Learning in NodeJS?

Is Discord botnet?

Webdevs refuse to learn any other language

I'm a webdev by trade and I'm learning C right now. We're not all faggots.

>proprietary software
What do you think?

This actually works!


let kek;
export default {
query: (text, params) => pool.query(text, params),

queryFirst: async (text, params) => (([kek = null] = (await pool.query(text,params)).rows), kek),


>mfw webstorm actually warns me that my code is "overly clever"

Attached: 1386460907430.jpg (1058x705, 117K)

Naturally, it's written in Rust
twitter.com/ManishEarth/status/1027676698068713473

discord != new and shiny game store that will inevitably fail along with the whole company when the investors pull out

Literally MtF outside prostitution get jobs as programmers.

Jow Forums will had more MtF that women.

I'm a professional linguist and polyglot but I'm still too hung over to figure out what fucking language you're speaking

dont need investors when you can sell so much info from dumbfucks like

Is techno the GOAT music genre for programming?

youtube.com/watch?v=t62Rty9yCoY

In contex of trans people it might mean Male to Female I suppose.

i like minimal/deep house myself.
or the occasional S Y N T H W A V E bullshit.

so it basically means faggots?

youtube.com/watch?v=xDwGAJ4FnA8

ParseInt takes two arguments, the second being a radix.
Map provides three arguments, the element, the index, and the collection.
The index feeds into the radix producing this behavior.

Non-zero numbers are truthy
Non-empty strings are truthy

Bitwise not does a type coercion to number, then another bitwise not inverts the bits again. Doing +"0" or Number("0") is cleaner.

Multiplication does a type coercion to number. Number * 0 = 0

"0" is a const char pointer to a non null location. !"0" is null, which is 0, and false is 0
If you instead did !'\0', that would be a char of value 0, not would make it 1, and it is true since true is 1

"0" is type coerced to 0, 0 == 0 is true

>Doesn't know @num is a meme to backlink without giving them a (You)
>Calls someone else a newfag
Here's a (You) for making me respond

Why would you do computation on a GPU? Isn't that what CPUs are for?

Attached: 1531001866647.jpg (732x742, 64K)

CPU - several, complex cores
GPU - orders of magnitude more, simpler cores

Would you like to have 2000 cores instead of 4? You can, just not for every kind of tasks.

cpus and gpus are good at different kinds of processing
any kind of algorithm that's gonna involve a lot of branching, you're going to want to run on a CPU

You misspoke dark ambient.

>Non-zero numbers are truthy
>Non-empty strings are truthy

var zero_int = 0;
var zero_str = "0"

zero_int == false
zero_str == true
zero_int == zero_str


true == false?

>Not anime music
Pic related, me when listening to anime music, wearing my programming kneesocks and stimulating my boipussy while programming.

Attached: 1531436291783.png (450x450, 265K)

TIL GPUs are good for doing many web requests

>just not for every kind of tasks.

>not wanting 2000 cores, one for each request

That's just pointless because web requests spend most of their time idle anyways.

wow... no one told me programming was 90% writing makefiles and trying to install libraries

In Rust it's just
[dependencies]
library = "1.0"

ahaha.... you think i'm some kind of rust noob? i'm a 1337 c++ programmer...

(just fucking kill me)

Attached: 1530663049712.png (819x716, 563K)

use a language with a package manager that most likely can also function as its builder
c/++ & make are absolute trash.

this is exactly what I'm doing right now

are you retarded?
this is like the same in almost every language

0 == false
"asdad" == true

0 == false -> false == false -> true
"0" == true -> true == true -> true
0 == "0" -> 0 == 0 -> true
If you can't understand type coercion, then use the triple equals. It's not really that hard. C++'s type coercion is many times more complex.

>What are you working on?
I'm new to programming and I'm currently learning Python, just finished the chapter on dictionaries.

I'm planning on going to Uni next year to do compsci because I'm really enjoying this, but I'm feeling overwhelmed, there's so much shit to learn and I'm late to it at 25.

Attached: 1496146372667.jpg (768x768, 418K)

I went to the web dev thread to ask about C++ for back end development and what I can use for front end to be displayed to the user and general concepts for handling it, and I was told to fuck off and learn webGL/JavaScript. Not all are gigantic faggots, but I'm inclined to believe most are.