/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: 1512723957669.png (773x1056, 398K)

Other urls found in this thread:

github.com/kibook/s1kd-tools
citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.8.3283
youtube.com/watch?v=1PhArSujR_A
gmplib.org/manual/Initializing-Integers.html#Initializing-Integers
twitter.com/SFWRedditImages

Attached: remember - no objects.png (1280x720, 1.26M)

data Gender = Female | Nothing

>anime op
excellent

Attached: 180219afvkahsywtuv.jpg (811x695, 96K)

>What are you working on, Jow Forums?
this:
github.com/kibook/s1kd-tools

Attached: man.png (540x197, 29K)

why are there people still using gcc in the year 2018 of our lord

shoo proprietary software person

data Gender = Male | Irrelevant

>duhhh clang/llvm is proprietary because it's not guhnoo

>Male
There's no such thing. Did you mean Malé?

>pls let me use it under bsd/mit license!!!
take your parasitism elsewhere

let's just leave Gender as an abstract type

Imagine the smelle

type Gender = ()

Studying IC's and breadboards because my professor assumes I know what I'm doing during labs and he can't really explain anything too well with his accent.

This fucking degree better be worth it. I've heard some horror stories of people leaving school and not finding work for years but I have to hope they are either stupid or have shit resumes.

Attached: help.jpg (900x900, 56K)

abstract class Gender
{
abstract bool HasDick { get; }
}

data Gender = Void

Guys where do i go to learn about type derivatives? (Not the hasknewfag from the other thread btw, saw the conversation)

A product type is a record and a sum type is an either-or, right? So would that mean that type difference is something like disambiguation / casting, and type quotient is something like member selection?
e.g. (AxB)/A = B, (A + B) - A = B

And functors are functions over types, right?

So would a type derivative be like this?

F'(a) = lim b->0 (F(a + b) - F(a))/b

also readable as: the limit of (((an F of (instances of union of a and b)) disambiguated to exclude the possibility of (an F of (a's))) but only those members of it that are not (b's)) as type b approaches void

is this accurate?

that's not substantially different from

is isomorphic to

data Gender
or
type Gender = Void

fixed

>hasknewfag
You broke my heart.

it's ok hasknewfag, i'm a hasknewerfag than you

Which would be better: a unigender world or an agender world?

No difference. Gender is a social construct, so if everyone identified and presented as the same gender then there would be no reason for such a concept as gender and everyone would think they were agender anyway

Unigender. All womyn, of course.

T-thanks I guess...

A Jewless world

this world is better to both

a bigender world

t. 99.9% of the people

I'm gonna prove you wrong by making the world a better place

>a big-ender world
so you're saying 99.9% of people like big butts & cannot lie
cool i can get behind that

Which would be better: a big endian world or an little endian world?

I recognize Linus and Carmack

Anders Hejlsberg and Simon Peyton-Jones?

Big endian. Then I wouldn't have to deal with checking the binary every fucking time.

Worse: In normal definitions, BYTES are always big endian, but multi-byte terms are big endian or little endian. I'm not joking. It's why when stuff is in little endian it's not completely backwards if you are given hex.

the one who you can only see the back of the head of is the agda guy
i don't remember his name

I just learned Hello World in C++!

Attached: 1467100196095.png (1024x768, 915K)

Trust me, you will drive yourself crazy trying to work it out that way. It's better to start with the idea that f'(a) is the slope of the tangent line (the best linear approximation) to f(x) at x = a. This is a good paper to get the meaty details of what this means:
citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.8.3283

Me too!
God, is it awful. What the hell. "std::cout".
Even worse: std::string

How is std needed for a fucking basic type such as string but not for int? Who shat this garbage language into existence? God, I hate C++ so much.

Because it's not a primitive type, it's a class

there are many, many problems with c++

none of these are actual problems

Attached: brainlet.png (645x729, 56K)

Where can I collect my 300k Haskell paycheck?

Attached: 1471380861178.jpg (1280x720, 74K)

C# user here. I fixed the SOAP program and got it to connect. I had to go into the App.config and check the endpoint to use the WSDL provided by the document. Once I changed that, the proxy class was able to connect and display the information properly, no need to worry about JSON or XML parsing. I pretty much was looking at the endpoint the wrong way this entire time.

In my butthole

I'm learning C# programming from pic related. It's written very well and easy to understand. I just wish it had practice problems. Do you Jow Forumsents know of a good resource for c# practice problems so I can better imprint the concepts in my brain?

Attached: 51tk+47M6QL._SX376_BO1,204,203,200_.jpg (378x499, 27K)

anyone ever use this book? It's by Bjarne himself so at least he knows the material well

Attached: xPPP2frontNback.jpg.pagespeed.ic.fKTSbiRWEV.jpg (1170x677, 113K)

simon peyton jones on the mailing list
tell him about your anime waifu

I am learning C++ on my own and I am stuck on multidimensional arrays. I want the program to take in the user's inputs and make a 2d array size of a[x][y]. PLz help.

#include

int x, y;
void get(int a[][y]);
void initialize(const int a[][y]);

int main()
{
int a[x][y];
get(a);
initialize(a);
}
void get(int a[][y])
{
std::cout > x >> y;
std::cout

Attached: 1533505303129.jpg (1024x788, 98K)

dumb frogposter

I awnt to be smart too user

Attached: 1518937679215.png (656x755, 57K)

I'm doing something with a python server, and I need to choose a database.
I want to have a list of users and a list of rooms. A user can be in any amount of rooms (0-infinity).
What's the best possible db for me? I want to get fast lookup that's either by user or by room (show all users in a room) but don't want to waste space with storing both individually.

>initialize does not initialize the array
>x and y start as global uninitialized variables
>you create an static array on the stack with its size being two uninitialized variables
>you give x and y values from the standard input
>you attempt to read from this unknown size array with your now defined values
hope this helps

youtube.com/watch?v=1PhArSujR_A

stupid frogposter

int a[x][y] doesn't work because a and y have to be compile time constants. You have to allocate it on the heap via "new" or even better use an std::vector

variables with static storage duration are implicitly zero initialized user

it'll work on some compilers, it simply shouldn't

Thanks frens
fuk u

Attached: 1534385333928.png (271x186, 7K)

Idris and Scheme are the future tbqh lads. Scheme for quick n dirty stuff, Idris or a DSL written in it for everything else

Android UI: I want a FloatingActionButton (Google's implementation) to be a parent for another one. Is that not possible? When I do that the app keeps crashing.

>Android

I just want the elegance of Scheme and the static typing of Agda. Is that really too much to ask?

Yeah, use Agda.

Kill yourself you nigger, Android dev belongs in /dpt/

...

engage ramming speed

Anyone got a userscript or something similar that always chooses my preferred Jow Forums style?

I want to always use the tomorrow theme and currently use this custom css:
@import "

>Android
>dev
Pick one and only one

Repoastan.

Niggas I need good code intelligence to make up for my lack of human intelligence

Which IDE or text editor or shit has the best code intel? The feature has no standardization whatsoever, so it seems like every software has its own schema and only some of the features. I figure the full features should be: calltips or links to web docs; code navigation ("go-to declaration", "list references" and shit); code completion; type inference; indexing the user's code and adding it to the code intel.

Is there a single software on this gay Earth who can do all five things? Not a problem if it requires plugins. I'm doing JS at the moment, I have to keep adding libraries and dependencies, so an IDE that can properly index that new code and add it to its intel would be a godsend.

>VSCode is great for JS/Node.js and TS
Intredasting.

Any plugins to recommend? Not just code intel but anything else too.

Attached: twitter.com_2018-07-24_01-05-53.png (586x340, 32K)

I installed GMP in Fedora by following the manual instructions ./configure; make; make check; make install

I'm trying to build

#include
#include

void main(void)
{
mpz_t num = 1000000000000000000000;

printf("%d", num);
}


using

gcc -o untitled untitled.c -lgmp

And I'm getting the error

warning: integer constant is too large for its type
mpz_t num = 1000000000000000000000;
^~~~~~~~~~~~~~~~~~~~~~
untitled.c:7:17: error: invalid initializer

What's wrong here?

Why don't you try reading the error message?

gmplib.org/manual/Initializing-Integers.html#Initializing-Integers

Nevermind I'm retarded

what the fuck did I do wrong

Attached: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (1902x490, 175K)

adding "char" changes the error to something a lot more familiar but I still don't get it

Attached: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (1838x269, 60K)

The book is for people who have never programmed before and want to learn C++. If you already know how to program read The C++ Programming Language by Bjarne.

Remove that ; after main definition and see everything being fixed.
Probably.
Those color schemes are giving me eye cancer.

works in visual studio, maybe try a real compiler instead of that gnu garbage

show your command to compile
also char string name isn't valid, it's either char name or string name

What if a parrot learned to program?

>also char string name isn't valid
I was throwing shit at the wall and hoping something would stick.

see above, I tried that on a lark because someone suggested it from google.
It's a bone-stock debian VM because I can't be assed to set up a dev environment on Windows, ergo no rice or dark themes

Attached: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (1905x565, 188K)

did you apt-get install build-essentials ?

Yeah.
Ok, not quite bone stock.

oh wait you fucking nog you're supposed to use g++ not gcc for c++

try g++ name.cpp -o name

ayy we got a weiner
I'm retarded

Attached: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (1403x287, 54K)

Okay I'm back guys and it was a bit easier to just put them all into one function
#include

void get_xy(int x, int y);
int main()
{
int x, y;
get_xy(x, y);
}
void get_xy(int x, int y)
{
std::cout > x >> y;

int arr[x][y];
std::cout

wtf is this supposed to do? Do you want to create a 2D array and set one (1) value at coordinates x;y?
Because that's not what this is doing at all, you're setting values one by one from 0;0 to x;y

I wanted to write a program that
> gets user input x and y
> double array has user inputted values [x][y]
> user inputs values to fill in the double array
> prints out double array
> x amount of rows, y per row

Attached: 1534931376180.png (343x300, 138K)

NEW /DPT/ RULES

>no proprietary software
>no OOP
>no webdev

int[x][y] may work on some compilers but it's not valid C++. See

Help a retard out, please? Hope my code isn't pure cringe I'm new to this

Why can I do this in C++
bool CheckTags(const FGameplayTagContainer* Container, FGameplayTag Tag) const {
return Container->HasTag(Tag);
}

template
bool CheckTags(const FGameplayTagContainer* Container, FGameplayTag FirstTag, Args... OtherTags) const {
return CheckTags(Container, FirstTag) * CheckTags(Container, OtherTags...);
}


But not this
bool CheckTags(const FGameplayTagContainer* Container, FGameplayTag Tag) const {
return Container->HasTag(Tag);
}

template
bool CheckTags(const FGameplayTagContainer* Container, FGameplayTag FirstTag, Args... OtherTags) const {
return CheckTags(Container, FirstTag) * CheckTags(Container, OtherTags...);
}


Is there any way I can make it explicit that the arguments have to be FGameplayTag?

An SAPGUI script that my company needs, on a completely unrelated note I feel dead inside.

They don't really need it. They only think they do. What they probably really need is for you to dive into type theory for about six months. If only they could be made to understand that.

I am making a 4chinz scrapper, and I want to know how exactly I can make a progress bar/timeleft conceptually?
>writing the image to a buffer
>current length / size
is this it? or is there a better way to approach this?

Attached: doesntgetanythingatall.jpg (750x516, 76K)

Progress bars are harmful. Less harmful alternative is:

Scrapping image 1/69 Done.
Scrapping image 2/69 Done.
Scrapping image 3/69 Done.
Scrapping image 4/69 ...

what if I wanted to make a GUI for it?
I just want to know how to implement it conceptually.

Attached: yuuki thinking carefully about this one.jpg (818x720, 78K)

Gui is harmful.

FUCK me I'm so used to vim I always press escape will writing an answer and it closes my quick reply window window without saving
And I'm just too lazy to rewrite all the shit I explained to some anons

go back to your grave, Uriel

Okay, I'm a brainlet. Does this solve the problem?
static int const x=0, y=0;
void get_xy(int x, int y);
int main()
{
// ...
}
void get_xy(int x, int y)
{
// ..
}
They're set to 0, but I change their values in get_xy function with std::cin, right?