/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 1543577654331.jpg (850x1189, 270K)

Other urls found in this thread:

youtube.com/watch?v=4jh94gowim0
insecure.org/stf/smashstack.html
twitter.com/SFWRedditVideos

nth for nim!

>not opting for the child stealing strategy

Attached: Screenshot from 2018-12-03 23-46-27.png (1670x1366, 218K)

Attached: police.jpg (848x480, 47K)

N + 1 for Go!

Stealing continuations is better.

First for Scala.

Attached: rins.jpg (600x800, 356K)

>scala
youtube.com/watch?v=4jh94gowim0

based

How to decrease character stroke weight in Android studio?

Attached: 1543807486337.png (1201x825, 97K)

can you fags please post what you're currently doing so I can reply it with "nobody cares" and such
thanks in advance

I'm working on ur mom

nobody cares
next?

>next?
ur sister

Thank you my friend I will give his videos a watch

Is modules standardized yet? Does clang have modules support (not their failed design)

Actually very cheap, but don't like the idea of being in a small room surrounded by 1000 poojeets.

The standardisation process is long and awkward. It won't strictly be standardized until the final edition of the standard is published.
However, the committee is pretty confident about the design presented at the San Diego meeting (aka the feature freeze for major features) and it's very likely to make it in to C++20 in its current state or with minor changes to the standard's wording.
AFAIK only a custom proof of concept branch of GCC supports these modules.

C++20 is a bit optimistic. I personally fear it will be C++23. A ton of other features seem to be the focus of C++20.

Yeah, Bjarne was really autistically obsessed about concepts this year.

>C++23
You mean 2123, right?

Something has to go wrong for modules to miss C++20. They're on track. The only way they won't make it is if there is a massive defect that nobody has been able to spot yet.

How the fuck do the browsers handle utf8 perfectly when C++ sucks major balls in handling unicodes?

easy
they don't use C++

>browsers handle utf8 perfectly
They don't.
What do they use?

wrong

DSLs all the way down

I will post my code for the printing function once I get out of class, thank you for the reply.

Meant for

Employed scalie programmer reporting in.

Attached: 1538756095743.jpg (598x598, 36K)

i didn't know karen had webbed hands

import myproject.Date

//... ...//
//if the first line in a file is a date, use that in the program
//if it isn't, use today's date

Date date;
try{
date = new Date(firstline);
}catch(NotADateException err){
date = Date.today()
}

Attached: 1539442393785.jpg (850x800, 65K)

Here comes the sun do do do do

A price of race-mixing.

>myproject.Date
wat

Mutation is a crutch for incompetent programmers.

Enjoy your unnecessary allocations, you clueless mongrel

nvm I misread your post

What's the average salary for Haskell programmers with Anime avatars in their GitHub profile?

Attached: 1471761644797.jpg (500x500, 96K)

-1

Haskell programmers are unemployed PERL programmers

started to learn springboot
hope its gon be good

Attached: 1532264782744.png (436x329, 191K)

They run the world

How come provably-correct languages like Haskell aren't used for security critical applications like cryptography where performance isn't that emphasized?

Typical imperative programmer. Writing before understanding.

>Haskell
>provably correct

As opposed to understanding after writing that it's useless in practical applications?

Java-shit

Except that's an incorrect assertion.

Understanding after writing is the same as writing before understanding.

understanding after writing and understanding before writing are not mutually exclusive.

functions are pure! pure!

>He can't into linear types

JavaScript rocks!

Attached: js-rocks.png (1000x494, 369K)

If it ain't total it ain't a function. Sorry bub.

Haskell is not functional.

What do you expect from imperativelets and OOPsies?

void printBoard(char **board, int size){
for(int i = 0; i < size; i++){
for(int j = 0; j < size; j++){
cout

Attached: code.png (845x422, 16K)

>He can't into graphs

anglojap masterrace get +10 to swimming

If the array is 7 by 13 what happens if you try to access board[7][0]?

Attached: 1543473347912.png (728x577, 212K)

ducktyping > OOPsie nonsense

twins

Attached: kujos.png (1275x843, 1.13M)

You're right past the end.

are you passing 7 or 13 as the size argument to your printBoard function?
if the two dimensions are different, why doesn't it accept separate width and height arguments?

Woops I answered that like it's a standalone question. Didn't see . I stand by my answer tho

Get off my board, immigrant
Google it, there is probably a thread on official JetBrains' website about it

Attached: racist.gif (265x236, 478K)

I am passing 7 as the argument. According to the assignment we can only have one size argument passed. I go to a mediocre state university so they just kind of shit this out last minute for our last project grade.

I am too much of a brainet, I cant figure out where I am accessing [7][0]. I thought if size is 7, i

Because they took so god damn fucking long to put it in.
But anyway, who the fuck cares about modules and concepts,
WHERE THE FUCK IS MY STATIC REFLECTION AND METACLASSES? PLEASE DON'T MAKE ME WAIT UNTIL 2026 FOR THE BEST FEATURES YET

Attached: 1530280821637.gif (477x440, 455K)

im self taught and am about to finish working on my programming language, i wrote a compiler for it

what are my chances of getting a job, provided i do some interview questions and brush up on my algorithms

i also have some other presentable, albeit smaller projects - they are NOT fizzbuzz tier either

How do I learn low-level hacking in C? This level of hacking insecure.org/stf/smashstack.html

100% if you're looking for entry level positions
75% if you're looking for positions requiring x years of experience
30% if you're looking for senior developer positions

>Why might this produce a segmentation fault?
I'm not totally sure how it works but if you're allocating a new pointer for each row in the board then it probably won't be contiguous, so maybe board[i][j] doesn't work right?

>I thought if size is 7, i

extremely problematic language

Disagree. It's true that the array isn't continuous, but as long as i and j are in their proper bounds that shouldn't make a difference. (And intentionally using the continuity, ugh)

Are you a white male?

learn assembly and spend some time doing reverse engineering
then work on a few small projects where you add features to programs at runtime by modifying asm instructions, adding hooks, etc using a debugger

at that point it's similar to SQL injection on websites
you can find places in C programs (or any other program) where inputting a certain sequence of bytes results in injecting asm instructions that then get executed

thx, i'll take that with a grain of salt since the language is more proof of concept than anything

it's untyped and garbage collected and revolves around passing around closures, so it is more or less FP if you exclude input output operations which are special forms - essentially
the interface of the compiler is written in python, while special forms and the garbage collector is written in C as C is the target language
not according to /sjwpol/
unfortunately, yes, as far as hiring practices are concerned

sjw

Where does /dpt/ "buy" their "books"?

Amazon.

can anyone here testify if actually buying the book and having a CD that comes along with it is a better learning experience than just pirating the book and not have the CD

libgen

What if I pirate the cd too?

Do web servers/browsers normally do
>1 socket for requesting and receiving all files on a website
or
>1 socket per file to be requested and received

idk
i'd assume 1 socket/file so you can download multiple files from a website simultaneously

doing advent of code here, how the FUCK do I write an unboxed vector instance for this easy ass data type?

Attached: asdf.png (1263x301, 20K)

dudes,
I want to learn how to program
show me

I'm pretty new to programming, currently doing a bootcamp-type thing and teaching myself a bit of C++ on the side because I'm finding myself with a lot of time to spare.

I haven't dealt with any compiled languages before this, so if anyone has any tips or suggestions (for example, a good compiler to use) I'd appreciate whatever people can offer.

Also - the course I'm on has everyone using a mac because it has a command line and normies with no previous programming experience are more likely to be comfortable with apple than linux, but in the long term I have no interest in sticking with mac OS. I'd been planning on dualbooting ubuntu alongside windows 10, but I recently noticed you can get a bash shell for windows and it might be that would suit me better for now. I don't know that much about the details of either, though - does the bash shell work properly, is its functionality broad enough to let me develop properly on windows?

I'm a bit confused with C
I have this:

char test1[10];
somefunction(test1);

The function somefunction writes some amount smaller than 10 of characters into the char array.
All is good.

But then i have this:

char* test;
somefunction(&test);

It also works. So what confuses me is that since i never defined the size of the test array, where are the characters written into by the somefunction?

>It also works.
it doesn't
you are writing to memory that doesn't belong to your program, which is an error

i suggest using valgrind to test this sort of thing

sudo apt install valgrind
then run your program with 'valgrind ./myprogram'

it will report for you memory access errors, leaks and all sorts of useful things

arent they written into the pointer itself? the first call writes it into the 10 chars since you pass in a pointer to the 10 chars, the second call would write to the pointer address itself since you pass it in (&test) right?

also &test is a pointer to your pointer test, not the pointer test itself, so already there it doesn't work, but i assume you meant test and not &test

gcc would warn you, but it would still compile some meaningless binary

>you are writing to memory that doesn't belong to your program
the program is wrong but doesn't the memory belong to the program assuming that they don't write over the 4 or 8 byte pointer?

Well it's working though, i am using a code from a 3rd party library which does it though:

char *wifiPassword;
preferences.getBytes(WifiPasswordPref, &wifiPassword, 64);

Could it maybe be that instead of modifying char array test* is pointing to, it creates a new char array and then just changes the adress the test* points to?

Signature of getBytes:
size_t Preferences::getBytes(const char *key, void *buf, size_t maxLen)

>2018
>not using an ide
>using meme terminal editors instead

Attached: 1529835688815.png (1029x1000, 1.04M)