/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: __original_drawn_by_sukebewe__1855312c43245a6b8959a562079aa1c6.png (786x1403, 896K)

Other urls found in this thread:

projecteuler.net/problem=195
red-lang.org/p/getting-started.html
glassdoor.com/Interview/iFit-Interview-Questions-E1303309.htm
terralang.org/
github.com/elitexvzf/Textpx
twitter.com/SFWRedditVideos

which general purpose C library to use?
glib, qlibc, tbox, apr, the firefox utility library, ...?

C++ is the worst language ever made

i see you haven't used my programming language

the worst language ever made is one so bad you've never heard of it

any obscure langs you lads want to shill?
I've scoured github and there's nothing but JVM shitlangs.

im going through helsinki MOOC java courses as a brainlet no-code (except some C++ from an unreal game course)

C++20, it doesn't even have a compiler yet

USE MATLAB

check out rebol

this thread's project euler problem is:
(872-1)%677+1=195

projecteuler.net/problem=195

Attached: euler.jpg (480x600, 115K)

that isn't a loli
you failed OP

I actually came across Red which is a successor to it apparently, but they're a windows focused shitlang, so i'll give Rebol a better look.

I am a code, unaffected
Rain hell down onto me
ASCII encoded, unaffected
Your fool I will not be

Attached: 9614A383-3110-428D-87E7-7B3D8D8AC743.jpg (1200x800, 297K)

Delicious

Yo! Toss me some non-busted moves for a turn based RPG.

Categories: stat boosts, heals, attacks, and specials.

I've got about 50 moves total but each one I add increases the total number of movesets by a huge amount. Just adding one more would increase it by more than 10%.

Stuff themed around attack defense or speed.

Phalis engorger, adds to charisma but also adds encumberance

the one that openbsd uses

Programming Challenge

Given a list of variables and variable constraints of the form A < B, you are to write a program that prints all orderings of the variables that are consistent with the constraints. For example, given the constraints A < B and A < C there are two orderings of the variables A, B, and C that are consistent with these constraints: ABC and ACB.

Input
A B F G
A

There are only 4 stats, I could do something like that to increase attack but decrease speed. Worthy contribution. I'd call it something like stance shift, phallus is a bit grotesque for a Pokemon bootleg.

You are given two non-empty linked lists representing two non-negative integers.
The digits are stored in reverse order and each of their nodes contain a single digit.
Add the two numbers and return it as a linked list.

You may assume the two numbers do not contain any leading zero, except the number 0 itself.

Example:
Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
Output: 7 -> 0 -> 8
Explanation: 342 + 465 = 807.

Not even if you paid me. Literal pajeetware.

any suggestion for fun little app that i can build in react native while learning?

Attached: download.png (299x168, 5K)

add a b = reverse . show $ num a + num b
where num = read . reverse . concatMap show

Fuck off

This is some of the worst shitcode I've ever written
import Data.List (permutations, nub, partition, elemIndex)

only_before :: Eq a => (a, a) -> ([a] -> Bool)
only_before (x, y) as = and (( [(String, String)]
read_constraints = map (\x -> fmap tail $ splitAt (foldr const 0 $ elemIndex '

forgot to turn into digits but whatever
just compose with map ((read :: String -> Int) . (:[])) at beginning

Dart

Attached: logo_dart_1080px_clr.png (1080x1080, 47K)

Rebol is propietary and dead. Red is also not windows focused. It's pretty good cross platform wise actually having a pretty good GUI toolkit.
It's still a shitlang because the core devs fell for the cryptomeme.

The most boring language ever made.

isn't this literally the question 1 on leetcode?

>Red is also not windows focused.
They don't even have a Linux GUI backend.

Not sure if -> is necessary in the input, but if it isn't then this works:
(defmacro linked-lists (first f second)
`(unparse (,f (parse ,first) (parse ,second))))

(defun parse (list)
(parse-integer (apply 'concatenate (cons 'string (loop for i in (reverse list) collect (write-to-string i))))))

(defun unparse (n)
(reverse (loop for c across (write-to-string n) collect (digit-char-p c))))

(linked-lists '(2 4 3) + '(5 6 4)) => (7 0 8)

There's probably a way more elegant, less spaghettified way to do this, but this is my minimum viable solution.

you mean drat GOT EEEEMM

Linked lists are the ugliest thing in existence
function* traverse(list) {
for (let node = list; node; node = node.next) {
yield node.value;
}
}

function sumLinkedLists(...lists) {
const gens = lists.map(traverse);
const next = x => x.next();
const done = x => x.done;
const adder = (a, b) => a + (b.value | 0);
const head = { value: 0, next: null };
for (let tail = head, carry = 0, first = true;;) {
const steps = gens.map(next);
if (steps.every(done)) {
for (; carry > 0; carry = carry / 10 | 0) {
tail = tail.next = { value: carry % 10, next: null };
}
break;
}
const number = steps.reduce(adder, carry);
if (first) {
first = false;
tail.value = number % 10;
}
else {
tail = tail.next = { value: number % 10, next: null };
}
carry = number / 10 | 0;
}
return head;
}

I tested it some time ago on os x and it worked without problem. I'd be really surprised if they support windows and os x but not linux.
Could you tell me what made you think this? Did you test it yourself?

Well, I am having a good time right now.

Hoping someone can help with this, too brainlet to figure out why using an add method for the object won't work.

Attached: 1350755259160.gif (130x98, 655K)

Anone, I brought my doll to the JavaScript lesson! You do not mind, right?

Attached: 139da51ab39f74d178803911069ceef3.jpg (600x800, 58K)

>Could you tell me what made you think this? Did you test it yourself?
i did, also a github issue where the dev said they just don't have one.
and on the example page
>If you are running Red from Windows, you can also use the built-in GUI system and make a more appealing HelloWorld:
red-lang.org/p/getting-started.html
Why in the world they release linux binaries, but don't have a fucking linux backend for their main feature, is pretty silly.

This sums up all multiplies of 3 or 5 below ten.
(reduce + (filter #(or(= (mod % 3) 0) (= (mod % 5) 0)) (range 1 10)))

Is this how I'm supposed to use Clojure?

i'm yet to meet a programmer that isn't an autistic piece of shit

Attached: 1557708253646.png (250x250, 54K)

(define (add a b)
(define (recur a b s)
(cons (modulo s 10) (go a b (quotient s 10))))
(define (go a b c)
(cond
((and (null? a) (null? b)) (if (= c 1) '(1) '()))
((null? a) (if (= c 1) (recur a (cdr b) (+ (car b) c)) b))
((null? b) (go b a c))
(else (recur (cdr a) (cdr b) (+ (car a) (car b) c)))))
(go a b 0))

Do brown girls program in java?

looks like magic

>$90K starting

Attached: 1563997685410.png (2110x1096, 227K)

Seriously?

nah jk
seems like a shitty company

glassdoor.com/Interview/iFit-Interview-Questions-E1303309.htm

>more than 90% of Jow Forums can do
This is like those old fizzbuzz threads

I have no clue what dart is, but they should pivot on the name to something pirate like.
>fart

But that's our child.

Too hot here to do anything complex.
Just added a cli to my zip archive manager and took care of a few bugs.
Next steps are to write a few decent tests and add multithreading where possible.

I also have a good chunk of my golang test boilerplate generator done.

why is it called A*

because you're a star

because programmers are autists with no imagination

I'm going to write a lang called C:
That's pronounced see colon

Maybe the * is like a wildcard so it's searching through a graph effectively.

>curly braces
>first class functions
>metatables
>interop with native languages is easy as fuck, and even easier with luajit
i really like lua

it's a good language

OCaml rulez.

Attached: colour-logo.png (2187x601, 39K)

Goal % 5

Give Terra a look then.
it's a pretty snazzy lang where you meta-program with lua
terralang.org/

>luajit
Outdated as fuck. Fragmentation in Lua is mindnumbing. It's all shit.

I'm not the best with mathematical language. What's the line over x implying here and what is Realnumbers to the power of n?

Attached: file.png (378x74, 17K)

Imagine using a language without async/await

R^n is an n-vector of R
the bar is probably indicating that each is a vector

think again with c++ classes

>Just requires modulus operator and an if statement
Doh

If you're writing a library you should be designing your interface around the COM anyways which makes super easy ffi with luajit a non-issue.
Plus normal lua ffi with C++ is still pretty easy, even if you don't use a no thinking required tier wrapper like sol.

Alternatively, nothing is stopping you from writing something to enable easy importing, itanium is standardized and the unnamed microsoft ABI has been reversed engineered and at least documented.

list *add(list *a, list *b, int carry)
{
if (!a && !b && !carry)
return NULL;

list *d = malloc(sizeof(list));
int sum = (a ? a->val : 0) + (b ? b->val : 0) + carry;

d->val = sum % 10;
d->next = add(a ? a->next : NULL, b ? b->next : NULL, sum / 10);

return d;
}

How can you even return -1? 0 is an acceptable amount of small bags to use. Do they plan to say they're inputting negative kg into the function?

there is a fixed number of bags

very dumb post. it works fine and you don't need anything but luajit + ffi

Ah got you, the program doesn't say the number of bags already.

you fucking nerds need to get on programming realistic emotions/personalities for androids. I'd gladly pay $100K for an android chocolate elf waifu

right now we're just doing smug brown anime girls
eventually the cycle will shift back to techloligy, i just hope we don't have to go through more shotafag shit before then

it's weirdly formatted but if you look at input and re-read the description you see that the number of small and large bags are also a parameter

Your elf waifu cheats on you. Will you pay for her
>A Abortion
>B Boyfriend's Child

Anybody know how to save an object in session state on ASP.NET using Visual Studio '17? I'm trying to store a "reservation" object in the session state so I can pull up the info later in another page.

I mean you can do it a bunch of different ways. You could make array and if it's outside the array it's going to return -1 by default.
Or just -1 as a string if you want to not get the job.

This
Your function should have 3 parameters
# of small bags
# of large bags
And total bags needed.
It's easy though because as long as you use the "/" with math.floor and the modulus operator it's just about making sure you start to use small bags when you run out of big ones.

>implying I'm going to get the womb/incubation chamber add-on

It came used.

never. My android waifu shall be brand new. She'll be all embarrassed when I slowly peel the cling film off of her, going extra slow over her nipples.

Im stuck trying to make a progress bar

Im given two numbers, the max progress and the progress made, but my progress bar only accepts values between 0 and 1, so, how do i convert my progress into a decimal number that fits into the progress bar range?

do you only use a big bag if you can fill it completely?

Find a new career path.

That makes perfect sense, thank you.

I think the most simple answer would be that you should ask google how to normalize values to a range. But I'm pretty sure you could figure this out if you sit down and think about the extreme cases. How do I get my minimum value to be a 0 and how do i get my maximum value to be a 1. Using math. It's a better idea in the long term than just looking it up.
You'll realize how silly you're being or you'll probably be served by

Conservative GC is deeply flawed

All GC is deeply flawed.

I'm working on a chip8 emulator and I just read that memory leaks are not considered harmful. So should I free any memory when the program exits or just let the OS clean up? I know valgrind will complain but I want write software on the bleeding edge.

Attached: ey28apggoc931.jpg (1080x1350, 1.5M)

Introducing textpx

github.com/elitexvzf/Textpx

brown smug lolis is the sweet spot

How do I read .json that has square brackets? Like Im trying to call an api in c#, what would my model class for this example be if I was to only consider the elements with square brackets:

{"response_code":0,"results":[{"category":"Animals","type":"multiple","difficulty":"medium","question":"What type of animal is a natterjack?","correct_answer":"Toad","incorrect_answers":["Bird","Fish","Insect"]},{"category":"Animals","type":"multiple","difficulty":"medium","question":"The now extinct species "Thylacine" was native to where?","correct_answer":"Tasmania, Australia","incorrect_answers":["Baluchistan, Pakistan","Wallachia, Romania","Oregon, United States"]},{"category":"Animals","type":"multiple","difficulty":"medium","question":"Which of these species is not extinct?","correct_answer":"Komodo dragon","incorrect_answers":["Japanese sea lion","Tasmanian tiger","Saudi gazelle"]},{"category":"Animals","type":"multiple","difficulty":"medium","question":"What dog bread is one of the oldest breeds of dog and has flourished since before 400 BCE.","correct_answer":"Pugs","incorrect_answers":["Bulldogs","Boxers","Chihuahua"]},{"category":"Animals","type":"multiple","difficulty":"medium","question":"What is the scientific name of the Common Chimpanzee?","correct_answer":"Pan troglodytes","incorrect_answers":["Gorilla gorilla","Pan paniscus","Panthera leo"]}]}

Is it a class model that has an array of results as a property and then a result class that has an array of strings property called incorrect_answers?

>using boost
disgust for plebs

are the go opencl libraries worth using?
I'm falling for the GPU compute meme but I also want to do shit in go

Anything conservative is deeply flawed

Whats wrong with boost? I use it all the time

Conservative considered harmful