/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: 1486638128172.png (1280x720, 619K)

Other urls found in this thread:

build2.org/build2-toolchain/doc/build2-toolchain-intro.xhtml#guide
learnyouahaskell.com
en.wikibooks.org/wiki/Haskell
im.triggered.help/humble/functional_programming.tar.gz
twitter.com/NSFWRedditVideo

delet

threadly reminder that programming is just a subset of anime.

Moving to Nim
Looking for manual memory management reference

Attached: 1526169350366.png (600x569, 290K)

No, animeing is just a subset of programming!

>inheritance

That's composition

Anime is a burrito wrapping programming

>owo what is this?
Cargo for C++
build2.org/build2-toolchain/doc/build2-toolchain-intro.xhtml#guide

Attached: 1525988851075.png (1000x1000, 456K)

composition is has-a
inheritance is is-a

Im actualy finding es6 decent and better than python...
...
...

haskell websockets. put up one to fuck about with at faggot.chat

Attached: faggotchat.gif (334x228, 13K)

subset is `has-a`

Good resource to learn haskrill?

But user, both are roughly the same disgusting piece of shit.

A is a subset of B
every A is a B

A gun, a burrito and programming socks.

no. Apples are not subset of boxes.

learnyouahaskell.com
a bit dated
en.wikibooks.org/wiki/Haskell
there's also the haskell book

ask for help if you need it

True but while both are piece of shit es6 is slightly less shitty. I have to use it for work so my opinion is irelevant anyway

Or you can just pay a therapist to talk about your traumas.

>every A is a B

Attached: Making+good+use+of+those+new+images+from+the+recent+_0cea279451426ea1db205ad8635ef918.jpg (645x729, 40K)

let me know if you guys want the haskell books from the functional humble bundle

yeah but primes is a subset of reals

I already feel dissociated. Got job as js react + redux developer. My backround is c,c++ and scheme. REAL LIF E SUCKS REEEEE

Haskell anons always help each other.
OOP anons always troll each other.

Lisp-like anons always hug each other with parentheses.

HumBun have functional programming bundle?
Wait HumBun also bundling programming books???

>Got job
that's your mistake user.

Attached: 1509750188082.png (855x1000, 762K)

yeah i mean if you just want the whole bundle with everything i have the tarball still

Its not that bad. Codebase is semi decent. I feel that react actually makes it better with focus ln seperate components etc.
Dont get me wrong its fucking js but not as horrible as es4,5 and some shit like jquery, angular. I miss having time to make toy game engines or solving puzzles

Hmmm...
#include

int main()
{
bool x = true + true;
std::cout

Implicit conversions work differently for bool than other integer types. Also remember integer promotion.

> two trues make it false

Attached: pqafkb6d9ba01.jpg (645x729, 49K)

This. I want to get fired so I can program Hasklel full time.

So true + true results in 2 because bool gets promoted to int, and then it get truncated back down to 1 because of implicit conversion to bool?

It should. Integer addition is just xor with some extra stuff.

May I?

in boolean logic or arithmetic or w/e it is called, + is 'or' and * is 'and'

Yeah, but if it were a 1-bit integer, addition should overflow and result in 0.

>she didn't refuse all the job offers she got to keep her employment virginity for a haskell job.
Fucking sow.

Attached: 1502283654759.png (900x810, 689K)

If you try instead:
bool x { true + true };


it will fail to compile with
error: constant expression evaluates to 2 which cannot be narrowed to type 'bool' [-Wc++11-narrowing]


which is neat, I guess.

Attached: 1520121733943.png (578x560, 294K)

>sepples introducing new features as a substitute for its broken old features, but nobody uses them, because nobody in the industry uses C++11
STOP

>because nobody in the industry uses C++11
what version does the industry use then ?

Not truncated.
true + true produces int(2), and when assigned to bool, 2 is evaluated to another true, and x is stored as a bool with true state which is 1 (actually implementation defined, and in some system all number but 0 is true, so x could yield 2. But in most system it's 1)
if the true + true doesn't assigned to x before printed by std::cout, then it will be 2

C++14

Wrong. C++98

I do feel like a cheap slut programming in sepples.
I'd even settle for a Rust or a Scala job.

I see. It's kinda fucked up to have rules this complicated for a simple operation like this, but I guess it's sepples after all.

let len = len args

becomingfunctional.epub
becomingfunctional.mobi
becomingfunctional.pdf
clojurecookbook.epub
clojurecookbook.mobi
clojurecookbook.pdf
clojureprogramming.epub
clojureprogramming.mobi
clojureprogramming.pdf
functionaljavascript.epub
functionaljavascript.mobi
functionaljavascript.pdf
functionalthinking.epub
functionalthinking.mobi
functionalthinking.pdf
introducingelixir.epub
introducingelixir.mobi
introducingelixir.pdf
introducingerlang.epub
introducingerlang.mobi
introducingerlang.pdf
learningscala.epub
learningscala.mobi
learningscala.pdf
livingclojure.epub
livingclojure.mobi
livingclojure.pdf
parallelandconcurrentprogramminginhaskell.epub
parallelandconcurrentprogramminginhaskell.mobi
parallelandconcurrentprogramminginhaskell.pdf
programmingrust.epub
programmingrust.mobi
programmingrust.pdf
programmingscala.epub
programmingscala.mobi
programmingscala.pdf
realworldhaskell.epub
realworldhaskell.mobi
realworldhaskell.pdf
scalacookbook.epub
scalacookbook.mobi
scalacookbook.pdf
testinginscala.epub
testinginscala.mobi
testinginscala.pdf

happy birthday bitches.

im.triggered.help/humble/functional_programming.tar.gz

I am learning about arrays in C.

#include

int array1[10];
int array2[10];
int array3[10];
int array4[10];
int arraysum[10];

int i;

main()
{

for (i = 0; i < 10; ++i)
{
array1[i] = 2;
}

for (i = 0; i < 10; ++i)
{
array2[i] = 2;
}

for (i = 0; i < 10; ++i)
{
array3[i] = 2;
}

for (i = 0; i < 10; ++i)
{
array4[i] = 2;
}

for (i = 0; i < 10; ++i)
{
printf("%d ", array1[i]);
}

printf("\n");

for (i = 0; i < 10; ++i)
{
printf("%d ", array2[i]);
}

printf("\n");

for (i = 0; i < 10; ++i)
{
printf("%d ", array3[i]);
}

printf("\n");

for (i = 0; i < 10; ++i)
{
printf("%d ", array4[i]);
}

printf("\n");

for (i = 0; i < 10; ++i)
{
arraysum[i] = array1[i] + array2[i] + array3[i] + array4[i];
printf("%d ", arraysum[i]);
}

printf("\n");

}

Fuck that part of industry.

Please avoid use of global variables.

Attached: 1519369454856.png (500x281, 206K)

>dat domain name
Also--thanks!

Attached: 1524852889206.jpg (720x720, 79K)

i'm pretty proud of it, i own faggot.chat as well and a few other good ones.

bool x {(bool) (true + true + true) + 1 / 0};

Attached: 1499182767266.gif (425x481, 1.51M)

Yes, they will surely be his detriment in such a trivial program. Or not.

dumb frog poster

dumb frogposter

This was asked on the interview.
Assume we have 3GB of memory, and we are pushing back 2GB data in vector. Therefore, we've gotten our memory exhausted.

Why? I said because objects are copied before they're pushed. I was told "well, almost". What the fuck?

Attached: 1527538723153.png (645x729, 105K)

>want to try learning again
>start the python MIT free course
>can't even get past the first set of problems in a few hours
is this shit supposed to be hard or am i just a brainlet

I think he meant pushing one element at a time. You'll run out of memory because vector increases its capacity geometrically. It'll try to increase its capacity to 4GB on the last push.

I wish C++20 add undefined keyword as a placeholder function similar to undefined in haskell.
It's a really neat way to remind yourself of not yet implemented / completed function.

>a legitimate answer
>well almost
>as a legitimate an answer because you can use your own allocators which dont have such bad behaivor
>an even more legitimate answer
>chrome was open

I started reading "The Elements of Computing Systems", i wanted to really understand what is going on in the CPU. I might skip the high level shit if it redundant to SICP that i'm reading at the same time.
Has anyone read the two books? Is there anything redundant?

Attached: cover.jpg (311x350, 66K)

Actually, scratch that. Vector will stay at 2GB on the last push because it only needs 2GB to store its elements. Tested it
on a much smaller scale with this program:
#include
#include

int main()
{
std::vector v;
for (int i = 0; i < 16; i++) {
v.push_back(i);
std::cout

How do I make my .NET(C# or vb) GUI pretty ;3

I'm fucking them by getting my company to pay a ridiculous sum for me to maintain it.

Attached: 1513821087297.jpg (798x809, 48K)

You give your wallet to M$.

A full shell in python just for fun

Honestly I should start learning android because I want to switch career becoming an android freelancer, but zero motivation atm

Is C# a viable choice for Linux? It seems less shit than C++ or Java.

It'd be even better if the undefined keyword actually causes the compiler to produce undefined behaviour, so you can define assert(x) to be
if (!(x)) undefined;
and allow the compiler to optimise away the case where x is false.

ughhhhhh no?!

It is usable, especially now with .net core, but is not greatly supported outside of the asp.net part and very few apps use it

For example you cannot use any gui toolkit you can use on windows, and should instead work with some gtk bindings

>more opportunities to shoot yourself in the foot
STOP

the language itself is quite similar to java, but the ecosystem doesn't suffer from the same kind of cancer

>uses .NET
>doesn't want to pay

Attached: 1521101312144.png (1680x1050, 1.09M)

Except for asp.net core, I wouldn't recommend it.

im just required to from uni
Need to make project with forms for normies and shit but the default gui looks like crap

Obviously you should be able to configure it to only do ub in release builds and crash in debug.

Want to learn programming but not sure what language I should start with any ideas ?

>what language I should start with
Hindi.
You could learn lots of programming language from youtube with their " tutorial in hindi"

Nice bait

Yeah, and then it turns out you missed a bug while testing the debug build and shipped the software and attackers exploited undefined behavior in your program to get their hands on some sensitive data. This happened with C/C++ programs countless times. The correct behavior for most cases when it's "undefined" is for the program to crash. The possibility of someone accessing memory they shouldn't have access to is far more daunting that that of decreased performance because of array index checks.

Rust or C++.

Bait needs to be at least a little bit convincing to be called that. This is just a sarcastic joke.

What is the difference between Haskell Platform and ghc?
Is haskell platform basically the 'build-essential', while ghc is the 'gcc' ?

Python.

ghc is the compiler
Haskell platform is a distribution including ghc, stack (a package manager), a number of libraries often used with haskell, winghci (a program), and some other stuff

what is the notepad++ for Jow Forums?

imho just get stack, use it to install ghc/i (stack setup), find out where it installed it and add that to your PATH
You can use stack to install extra packages/libraries you want

Java

A program I can't use since I program on Linux.

what is the difference between stack and lens?
installing haskell compiler suite is really confusing

stack is a package manager
lens is just a package/library

racket

inheritance = is-a | employee is-a person
composition = behaves-like-a | robot-employee behaves-like-a person
containment = has-a | person has-a head
relation = `verb` | person likes food