/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?
Old:

Attached: om5han_On_Lisp_Advanced_Techniques_for_Common_Lisp.jpg (506x666, 63K)

Other urls found in this thread:

poker.cs.ualberta.ca/publications.html
twitter.com/NSFWRedditImage

for me, it's zig

Attached: for zig, it's me.png (386x122, 8K)

Cute anime image.

Attached: 1489268801010.jpg (250x250, 38K)

nothing atm, need something new to work on, but i'm out of ideas right now.

hey me too

things on stm discovery 32 with freertos

Would Cirno like Plan 9?

chiru NO

Is RPA a meme? Is it worth learning?

post your code

Attached: _.png (1054x702, 98K)

Disgusting

>Xlib
Jesus christ user, if you're going to do X11 programming, at least use XCB.

Attached: 1389547666532.png (786x745, 423K)

your style is bad and you should feel bad

His style is mostly fine.

>423 KB

Attached: 1542924195334.png (786x745, 141K)

I don't do shell scripting. I have a backup.sh file that just invokes rsync with all the arguments I require. I'd like it to use --dry-run by default, but remove --dry-run if I pass an argument eg. "./backup.sh y". How can I do this in a nice way? Obviously I could write out the command twice and use a conditional to pick between the two but that is gross.

Store the rest of the command in a variable and use that in the conditional

That is a very good book, so good in fact that upon not finding a copy I printed it and made a friend bind it for me. Good taste OP.
Today OP was half a fag.

cringe

I think that's GNU's C style.

What made you cringe? please pray tell.

No, it's not. GNU's style is the stuff of nightmares.
He's using a modifier K&R/kernel style.

Yikes.

You could store --dry-run in a variable and just empty out the variable when you say y and run rsync like rsync $dry --other-options ...

that if condition inside 'case XA_WM_TRANSIENT_FOR'.. jesus man, at least create separate function to calculate this condition. It's like You've never seen any readable code before

do("yikes").from("me").to("dawg");

I like you, uhyun~~ Do that some more.

owo

>muh code standards
shut up baby

Feels like playing with the neighbors' retarded mongoloid child. You're cute though.

What do you think about exceptions vs error codes?

>Feels like playing with the neighbors' retarded mongoloid child

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

if your language has exceptions it's shit.

You're right, I didn't notice the { on the same line as the else if, just saw the type a line before the function name and assumed GNU.

throw new AnonIsAHugeFaggotException(exc)

You'd think someone would... to a mongoloid retarded kid. wew lad, you gave me goose bumps.

would what, newfriend?

Attached: 1471900898275.jpg (577x622, 45K)

does C has exceptions?

had a brilliant idea to make battleships in haskell but by representing the state of a board with functions that can be plotted

Attached: file.png (1207x853, 143K)

Whatever requires police intervention.

showcase

Attached: file.png (197x464, 12K)

someone did this for some experiment for the military with programming languages, it was about classifying regions
great minds think alike

>Haskell
watch this

Attached: scrot.png (3840x2105, 909K)

>unironically using arrows
ok grandpa it's time to go to bed

monadic error handling is the best, this is a solved problem

wrong

Not an argument.

I actually saw that video some time after making the plotting skeleton (about a month ago) and honestly it didn't surprise me as this was the first idea that came to my mind.

Exceptions are just gotos with lipstick.

can you post some cheatsheets?

What editor is this?

Gay answers (gratz on the hitler dubs tho)

After a bit more googling I found this pretty little thing:

${dryrun:+ --dry-run}

Worked on my gui again. The part on the bottom right is new, it's not yet completely done. The main work was the dynamic resizing, I also have to do some more work in Illustrator, the images are far from done.

Attached: 2018-11-22_22-54-01.webm (1024x870, 1.35M)

Is it appropriate to describe C++20's concepts (and thus typeclasses) as a form of composably defined duck typing for statically typed languages?

What is this, some kind of probability simulator?

It is similar to duck typing, yeah.

Looks like a riced-out emacs

How does that work?

It computes a Nash equilibrium for user specified poker situations.

I don't know shit about statistics but that sounds cool

Pretty sure the point of concepts was to constrain template parameters. I.e. less duck typing.

Elixir or Go, which one is better?

Rust

Today I did the Hackerrank problem security-tutorial-permutations.
Here is my solution:
#include
#define ARRSIZE 100 //vararray size

int main() {
int n;
int vararray[ARRSIZE];
//Scans variables
scanf("%d", &n); //Gets number of values
for(int i = 0; i

Attached: Yuki-Using-Computer-GIF-yuki-nagato-38663943-311-360.gif (311x360, 136K)

Haxe

Erlang. But if it must be between the two, Elixir by far.

This on guy told me to roll my own security.

nobody cares

except you

>One is created and used by Google
>The other is used by pinterest and Discord
Gee I wonder which one would get you a better job.

Lisp

>which is better
>which would get me a better job
not the same question

JavaScript rocks!

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

I've nearly finished writing a program that calculates mathematical expressions in the form of strings, such as: "(1 + 1 + 5/(4 + 1))^(2*2)"
It was way more complicated than I expected.

a parser and calculator

Obligatory post about wayland to trigger that one user's autism.

Attached: 1375773299400.jpg (425x419, 19K)

MISAKA is not happy about this

Separation logic will NOT save systems programming.

wtf
did user lie to me

I think there are better ways to reason about aliasing.

Lisp is the most powerful programming language.

dependent linear types will though.

no u

What algorithm are you using?

Monte Carlo CFR

I also use an abstraction technique in order to be able to solve the game from the preflop round and for multiplayer games, it's based on several papers by the University of Alberta.

poker.cs.ualberta.ca/publications.html

cool

(eval "...")

1 + system("/bin/sh")

I've been using some CFR based techniques for a game AI I've been working on. I've had problems with larger game variants because I've been storing my regrets/rewards/whatever tabularly and I've been running out of memory. I've been looking into using ML to build models instead of storing every result.

Solving large games is pretty hard, a Nash equilibium gives you nice guarantees, but it's not the best for every usecase.
One interesting thing that came out fairly (like 1.2 years go) recently was the DeepStack algorithm. You don't have to store everything, but it has other problems, you need a very poweful GPU and you have to create some training data beforehand, but at least that can be done over a period of time. Might be worth looking into, but I think for game AIs ( I assume something like video games) it's more reinforcement learning.

>pub fn main() !void
Dropped

Neither they dont fill the same niche.

Both are used extensively by all three.

My will to die is growing stronger. I need a project to do to fight my boredom. Please respond.

Attached: 1396571416586.jpg (278x278, 34K)

Post something dumb from your code.

Attached: z.png (225x225, 5K)

live

just a teaser

template
void heap::bubble_down(iterator elem, iterator last) {
auto parent = elem;
auto left_child = left_child_of(parent);
auto right_child = right_child_of(parent);

// stop at last
while (left_child < last || right_child < last) {
// find maximum of parent, left_child, right_child
auto max = parent;
if (left_child < last)
if (comp(*max, *left_child))
max = left_child;
if (right_child < last)
if (comp(*max, *right_child))
max = right_child;

// heap property fixed
if (parent == max) break;

// swap with the greater child
using std::swap;
swap(*parent, *max);
parent = max;
left_child = left_child_of(parent);
right_child = right_child_of(parent);
}
}

How can I store the contents of a text file so I can print it like this:

//from hello.txt
char* hello;
cout

Attached: 1542578392246.jpg (870x705, 330K)

Attached: 1483899740618.png (600x558, 276K)

Just use std::getline and loop everything into a std::string.