/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

stackoverflow.com/a/10216636
en.wikipedia.org/wiki/Signed_number_representations
open-std.org/jtc1/sc22/WG14/www/docs/n1570.pdf
twitter.com/SFWRedditVideos

Why was the other one deleted?
Also D

Why haven't you learned Haskell yet, Sup Forums?

>Why was the other one deleted?
fuck those who disgrace anime

>reporting the thread so you can repost it with anime
fucking anime fags

Say you have two 2D arrays(5, 10), filled with integers.

How would you check which numbers are located in the first but not in the second and print them?

your average Sup Forums poster

based anime poster
it's non anime trash

I deleted the thread, actually.

haskell:

filter (`notElem` first) second

thistbqhwyfam

itt: retarded losers (aka. animetards)

Because bump limits exist.

Why is Shinji so gay? Did Asuka force him to crossdress or something?

You think that's Shinji?

whoops, misread
filter (`notElem` second) first
i.e., the first array filtered such that every element remaining is not an element of the second array

>Why is Shinji so gay?

good posts
@58856416
bad post

rewriting haskell in Clisp

(set-difference a b)

you will be remembered.
@58856435
@58856416
>being this much of a plebbitor
back to your "sub"

friendly reminder that crossdressing shinji is canon

[spoiler]I have to do it in C#[/spoiler]

she is probably just starting to learn. be nice

@58856497
see second part of then follow the instructions

in C# it's similar but use a lambda rather than partial application and whatever filter is

Put spoilers in [ code ] tags and indent it with a shitton of spaces.

...

My custom CSS gives me (You)s even when you use @'s, suck it anime fags

I'm only learning to program, I have no idea what that is, we're only up to methods just now.

I'll keep that in mind.

My custom script gives me (You)s even when you don't reply to me.
Suck it, reasonable people.

sort the second one into a size 50 1-D array, and binary search each element of the first one, if you can't find it print it

@58856533
@58856554
good. no retard will ever accept counterfeit currency.

To::58856533
I have plenty of other methods, enjoy keeping up

oneList.Where(x => otherList.Contains(x));

with two nested for loops.
the first selects the number from the first array, the second performs a linear search.

no job

>implying it doesn't identify replies based on post number and then intelligently add the preceding identifiers to a list of valid reply tokens
intelligent people:1 anime fags:0

Dear I hope this letter finds you in good health.
I am incredibly grateful for the animated media format for which you have chosen to attach to your telegram.
Are your parents doing well? I hope so.
Please find enclosed an image of similar quality and make.

Yours faithfully
Anonymous

To -> V88V6V33
assuming this is true you wouldn't have made this post in the first place.
either way, you're just getting pleb tier currency like the plebeian you are

->FiveEightEightFiveSixSixOneNine
Thanks for the (You)s

Tell me about Karen. Why does she wear the hairpin?

>

Working on a Vulkan FFI binding generator for Rust. It's not a traditional generator that parses headers or a registry, but rather the API is specified as abstract syntax and then written out to a Rust file in a build script.

Also I am aware that vk-sys exists but tomaka says it's not suitable for production. Also it has weird names, statically links (which I don't want), and doesn't use actual unions even now that Rust has them.

I wanted to make a proper email-like reply to this post however I realised that Sup Forums considers openpgp signed messages as spam.

Is the list the same as an array in C#?

I did that in the previous thread, but I worded it wrong. Code related.

for (int i = 0; i < 5; i++)
for (int j = 0; j < 10; j++)
for (int k = 0; k < 5; k++)
for (int l = 0; l < 10; l++)
if (first[i, j].Equals(second[k, l]))
matches++;

I got how many matches are there in the arrays, now I want to check which numbers that exist in the first, don't exist in the second, can I do that in the inner most for loop or do I have to change the code?

I'm not sure what you're trying to do.

>all those loops
UNROLL

why did nobody tell me that c++ doesn't initialize things to a default value. at least these mysterious bugs which never occurred when working with big files now make complete sense

>you will never program in a logic-functional prototype-based scripting language with procedural syntax

>Hasklel
>"Although being compiled, Haskel compiler still produces slower binaries than Python."[97][98].

Go through both of the arrays and check if there's a match in the other, if it is, increment the match by one.
How would you do it if you were just learning?

chip8 interpreter in good ol' C

just negate the equals and print first[i,j]
that should print everything that's in first but not in second

You don't need more than 2 nested loops for this.

Fake news.

>implying I don't now parse lines of text numbers into actual numbers now

>implying I don't find the closest match in the current thread for a string of fragmented integers

anime is DONE

add a variable as a flag, when that if condition is true, set the flag as true (we found it). when you finish the 2nd inner loop 1: check if the variable is false, if it is, it is missing
2: set the variable to false

that's pretty cool. now parse this, plebbitor

OK, fuckers.
You had 1 (one) chance to show any respect to the local culture.
You didn't.
Anime is the fundamental part of imageboard culture and being disgraceful to the anime must be a punishable offence.
Embrace the anime era, it will come soon.

In all honesty, the only true pic of /dpt/ is Yuki Nagato pic, so I'd better be posting that picture but not others.

64454e336a7773521fd956c006febf2b
(You) this, dumb frogposter.

Scheme is always the anwser.

Most anime haters are from tumbl SJW community

Who are you talking to??

>In all honesty, the only true pic of /dpt/ is Yuki Nagato pic, so I'd better be posting that picture but not others.
that's where you're wrong kiddo

I have noticed that any anime image works just fine. All of them have about the same effect on the immigrants

Do you know what happened to the user making akari bbs?

Why? If you only use two for loops, it's only going to check if the value of first is the same as second on the same position, it doesn't go through the whole array really.

If I change the code to like this

if (first[i, j] != second[k, l])
Console.Write(first[i, j])

How do I consolidate this?

i have my first interview tomorrow, Sup Forums, any advice? its a full stack web dev job, and the interview is going to be held in a coffee shop.

i should wear a suit, right?

>i should wear a suit, right?
no

>tfw implicit function definitions in C

>and the interview is going to be held in a coffee shop
wat

>coffee shop
>web dev

goodness the meme really is true, please don't take the job. The industry it already bloated to death.

>kiddo
wew lad

what's in your arrays? what's the expected output? you might have to use !a.equals(b) instead of a!=b

>coffee shop
i hope you're ready for sexual favors. cause that's exactly what "coffee shop" is code for in the web""""dev"""" scene.

I'm not sure I understand what you're trying to say.

Oh, integers are in the arrays, from 1 to 100, output should be just the integers not located in the second array.

In C if I have an unsigned int, if I set it to something like -1 will it just be binary 1 with everything else 0s or will it still set the negative flag all the way on the left

oh nevermind that won't work that way, just do what I said here easier version would be along the lines of
for i,j :
a = array1[i,j];
found = false;
for k,l :
found |= (a==array2[k,l]);
if found print a;

try it out

yeah I made a thinking mistake, check

should be !found at the end

Depends on how your implementation represents signed integers. If you want all the bits to be 1, use ~0.

Also, I looked on Stack Overflow and found an answer to a question about signed literals for unsigned variables in C++ that recommended Boost.
stackoverflow.com/a/10216636

I believe that's undefined behavior :^)

A good language would refuse to assign a negative value to an unsigned integer desu

I don't program :^)
en.wikipedia.org/wiki/Signed_number_representations

It will underflow to UINT_MAX and is perfectly well-defined behaviour.
There are even a couple of standard library functions that return (size_t)-1 and (size_t)-2 as error codes.

Haskellfags blown out of the water

That doesn't seem very portable.

Some would say a good language wouldn't have such a stupid concept as an 'unsigned integer'

Those are stupids and ignorants.

wouldn't unsigned -1 be UINT_MAX - INT_MAX + 1

w-what should i wear?

web dev i guess

i need money senpai, and i tick all their boxes save for PHP and Ruby

>

Please tell me why

>w-what should i wear?
lads...

Unsigned integer representation is well-defined.
Anyway, here is the relevant part of the standard:
open-std.org/jtc1/sc22/WG14/www/docs/n1570.pdf
>ยง6.3.1.4
>2
>Otherwise, if the new type is unsigned, the value is converted by repeatedly adding or
>subtracting one more than the maximum value that can be represented in the new type
>until the value is in the range of the new type.[60]
>[60] The rules describe arithmetic on the mathematical value, not the value of a given type of expression.

>w-what should i wear?

The cutest kneesocks

i should wear lads?

im not a tranny tho

this thread is fucking retarded lmao

>Unsigned integer representation is well-defined.
apparently not