[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 333
Thread images: 49

File: 1481225269428.jpg (1MB, 3537x3335px) Image search: [Google]
1481225269428.jpg
1MB, 3537x3335px
What are you working on, /g/?

Old thread: >>58851338
>>
>>58856389
Why was the other one deleted?
Also D
>>
File: haskellfags.png (910KB, 610x611px) Image search: [Google]
haskellfags.png
910KB, 610x611px
Why haven't you learned Haskell yet, /g/?
>>
>>58856399
>Why was the other one deleted?
fuck those who disgrace anime
>>
>>58856389
>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?
>>
File: Screenshot_2017-02-08_22-38-00.png (12KB, 1179x73px) Image search: [Google]
Screenshot_2017-02-08_22-38-00.png
12KB, 1179x73px
your average /g/ poster
>>
File: 1476339720969.jpg (106KB, 1280x720px) Image search: [Google]
1476339720969.jpg
106KB, 1280x720px
>>58856389
based anime poster
>>58856399
it's non anime trash
>>
>>58856416
I deleted the thread, actually.
>>
File: tbh.jpg (351KB, 1698x1922px) Image search: [Google]
tbh.jpg
351KB, 1698x1922px
>>58856418
haskell:

filter (`notElem` first) second


>>58856412
>>58856423
thistbqhwyfam
>>
>>58856399
Because bump limits exist.

>>58856389
Why is Shinji so gay? Did Asuka force him to crossdress or something?
>>
>>58856436
You think that's Shinji?
>>
>>58856434
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
>>
File: 6OJc4SBQvNo.jpg (73KB, 582x728px) Image search: [Google]
6OJc4SBQvNo.jpg
73KB, 582x728px
>>58856436
>Why is Shinji so gay?
>>
File: best girl.jpg (83KB, 1280x720px) Image search: [Google]
best girl.jpg
83KB, 1280x720px
>>58856389
>>58856423
good posts
@58856416
bad post

rewriting haskell in Clisp
>>
>>58856418
(set-difference a b)
>>
File: 1455807188156.jpg (43KB, 354x350px) Image search: [Google]
1455807188156.jpg
43KB, 354x350px
>>58856431
you will be remembered.
@58856435
@58856416
>being this much of a plebbitor
back to your "sub"
>>
>>58856449
friendly reminder that crossdressing shinji is canon
>>
>>58856434
>>58856474
[spoiler]I have to do it in C#[/spoiler]
>>
File: gizsxk.jpg (306KB, 816x488px) Image search: [Google]
gizsxk.jpg
306KB, 816x488px
>>58856419
she is probably just starting to learn. be nice
>>
@58856497
see second part of >>58856484
then follow the instructions
>>
>>58856497
in C# it's similar but use a lambda rather than partial application and whatever filter is
>>
>>58856497
Put spoilers in [ code ] tags and indent it with a shitton of spaces.
>>
File: 1479883677181.jpg (143KB, 833x696px) Image search: [Google]
1479883677181.jpg
143KB, 833x696px
>>58856503
>>
File: 1472366909809.jpg (23KB, 400x400px) Image search: [Google]
1472366909809.jpg
23KB, 400x400px
>>58856465
>>58856484
My custom CSS gives me (You)s even when you use @'s, suck it anime fags
>>
>>58856511
I'm only learning to program, I have no idea what that is, we're only up to methods just now.

>>58856514
I'll keep that in mind.
>>
>>58856533
My custom script gives me (You)s even when you don't reply to me.
Suck it, reasonable people.
>>
>>58856418
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.
>>
File: 1455417962468.jpg (178KB, 900x1527px) Image search: [Google]
1455417962468.jpg
178KB, 900x1527px
To::58856533
I have plenty of other methods, enjoy keeping up
>>
>>58856551
oneList.Where(x => otherList.Contains(x));
>>
>>58856418
with two nested for loops.
the first selects the number from the first array, the second performs a linear search.
>>
>>58856410
no job
>>
>>58856571
>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
>>
File: 1483583276557.jpg (16KB, 190x188px) Image search: [Google]
1483583276557.jpg
16KB, 190x188px
Dear >>58856571

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
>>
>>58856630
Tell me about Karen. Why does she wear the hairpin?
>>
File: 1484610947860.png (618KB, 738x845px) Image search: [Google]
1484610947860.png
618KB, 738x845px
>>58856678
>
>>
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.
>>
>>58856706
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.
>>
>>58856571
I wanted to make a proper email-like reply to this post however I realised that 4chan considers openpgp signed messages as spam.
>>
>>58856578
Is the list the same as an array in C#?

>>58856589
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?
>>
>>58856748
I'm not sure what you're trying to do.
>>
File: 1485902049975.gif (194KB, 200x202px) Image search: [Google]
1485902049975.gif
194KB, 200x202px
>>58856748
>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
>>
File: cosmos-programming-language.png (17KB, 616x470px) Image search: [Google]
cosmos-programming-language.png
17KB, 616x470px
>you will never program in a logic-functional prototype-based scripting language with procedural syntax
>>
File: 1486586820925.jpg (22KB, 500x396px) Image search: [Google]
1486586820925.jpg
22KB, 500x396px
>>58856410
>Hasklel
>"Although being compiled, Haskel compiler still produces slower binaries than Python."[97][98].
>>
>>58856761
Go through both of the arrays and check if there's a match in the other, if it is, increment the match by one.
>>58856766
How would you do it if you were just learning?
>>
>>58856389
chip8 interpreter in good ol' C
>>
>>58856748
just negate the equals and print first[i,j]
that should print everything that's in first but not in second
>>
>>58856787
You don't need more than 2 nested loops for this.
>>
>>58856780
Fake news.
>>
File: 1475373542497.png (215KB, 600x600px) Image search: [Google]
1475373542497.png
215KB, 600x600px
>>58856659
>implying I don't now parse lines of text numbers into actual numbers now

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

anime is DONE
>>
>>58856748
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
>>
File: 1474158024505.jpg (155KB, 500x492px) Image search: [Google]
1474158024505.jpg
155KB, 500x492px
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.
>>
File: nico hours.jpg (15KB, 626x626px) Image search: [Google]
nico hours.jpg
15KB, 626x626px
64454e336a7773521fd956c006febf2b
(You) this, dumb frogposter.
>>
>>58856779
Scheme is always the anwser.
>>
>>58856843
Most anime haters are from tumbl SJW community
>>
>>58856841
>>58856851
Who are you talking to??
>>
File: 1483367149998.jpg (156KB, 720x720px) Image search: [Google]
1483367149998.jpg
156KB, 720x720px
>>58856843
>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
>>
File: 1464512940852.png (125KB, 256x256px) Image search: [Google]
1464512940852.png
125KB, 256x256px
>>58856843
I have noticed that any anime image works just fine. All of them have about the same effect on the immigrants
>>
>>58856881
Do you know what happened to the anon making akari bbs?
>>
File: 325345t6346.png (25KB, 646x289px) Image search: [Google]
325345t6346.png
25KB, 646x289px
>>58856811
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.

>>58856808
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, /g/, 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?
>>
>>58856918
>i should wear a suit, right?
no
>>
File: 1466798243220.jpg (36KB, 482x427px) Image search: [Google]
1466798243220.jpg
36KB, 482x427px
>tfw implicit function definitions in C
>>
>>58856918
>and the interview is going to be held in a coffee shop
wat
>>
>>58856918

>coffee shop
>web dev

goodness the meme really is true, please don't take the job. The industry it already bloated to death.
>>
>>58856877
>kiddo
wew lad
>>
>>58856902
what's in your arrays? what's the expected output? you might have to use !a.equals(b) instead of a!=b
>>
>>58856918
>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.
>>
>>58856837
I'm not sure I understand what you're trying to say.
>>
>>58856964
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
>>
>>58856902
oh nevermind that won't work that way, just do what I said here >>58856556
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;
>>
>>58857057
try it out
>>
>>58857054
yeah I made a thinking mistake, check >>58857063
>>
>>58857063
should be !found at the end
>>
>>58857057
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.
http://stackoverflow.com/a/10216636
>>
>>58857057
I believe that's undefined behavior :^)
>>
File: unsigned.png (37KB, 945x569px) Image search: [Google]
unsigned.png
37KB, 945x569px
>>58857057
>>58857136
A good language would refuse to assign a negative value to an unsigned integer desu
>>
>>58857057
I don't program :^)
https://en.wikipedia.org/wiki/Signed_number_representations
>>
>>58857124
>>58857136
>>58857057
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.
>>
>>58857182
Haskellfags blown out of the water
>>
>>58857192
That doesn't seem very portable.
>>
>>58857182
Some would say a good language wouldn't have such a stupid concept as an 'unsigned integer'
>>
>>58857216
Those are stupids and ignorants.
>>
>>58857192
wouldn't unsigned -1 be UINT_MAX - INT_MAX + 1
>>
>>58856934
w-what should i wear?

>>58856941
web dev i guess

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

>>58856969
>
>>
>>58857241
Please tell me why
>>
>>58857254
>w-what should i wear?
lads...
>>
>>58857207
>>58857250
Unsigned integer representation is well-defined.
Anyway, here is the relevant part of the standard:
http://www.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.
>>
>>58857254
>w-what should i wear?

The cutest kneesocks
>>
>>58857297
i should wear lads?
>>
>>58857314
im not a tranny tho
>>
this thread is fucking retarded lmao
>>
>>58857313
>Unsigned integer representation is well-defined.
apparently not
>>
>>58857332
What are you even doing on /dpt/ then?
>>
>>58857336
once again destroyed by anime
>>
>>58856410
Because I've actually got a job as developer.
>>
>>58857345
to ask for advice on interviews
>>
>>58856780
>implying
>>
>>58856410
Because I'm not sure it's worth it to learn category theory for a toy language.
Nonetheless, I do plan to get around to it eventually.
>>
>>58857377
>Asking a bunch of tranny NEETs for JOB advice

I'm not sure what you're expecting
>>
>>58857385
>you need category theory to use Haskell
Now THIS is a spicy meme.
>>
>>58857336
>>58857351
>>
>>58857405
one or two people with actual jobs to give advice?
>>
>>58857351
no, it's because not enough traps were posted

if the trap quota is not filled, the thread is automatically shit
>>
>>58856777
>didn't READ DA STANDARD
>>
>>58857432
I have a job, but I though you were trolling with those questions.
>>
>>58857063
I don't know how to convert that to C#.
What is the |= operator?
>>
>>58857483
>What is the |= operator?
is this a joke?
>>
>>58857483
Bitwise OR:
x |= y;

is equivalent to:

x = x | y;
>>
>>58857468
no, ive just never had a decent job before, and i didnt even know coffee shop interviews were a thing.
>>
What's the most recent version released of the C programming language book?

I can't find a later release than 2002 and some of the challenges/example code in the book is non-compliant with the latest versions of C. I get compile errors a lot - which can be easily resolved by doing a little googling, but a more recent version to follow along with would be nice?
>>
>>58857506
They aren't outside of cheap startups.

If it is a startup, don't wear a suit, just don't come in with an anime T shirt and torn up jeans.

It's important to be confident, smiling, and to ask question. You're here to interview them as much as they're here to interview you.
Interviewing is a social game.

And unless you're completely unqualified, definitely negociate your compensation.
>>
>>58856824
>implying CSS is Turing complete

>>58857057
Don't do that, it will overwrite your boot sector with garbage

>>58857216
Certain quantities only make sense as signed, object sizes and memory addresses for example. You'd be wasting about half the range of an unsigned type if you use it for such a quantity. And if a CPU has hardware and instructions for unsigned integer arithmetic, you might as well use them.

>>58857332
Not yet you're not.
>>
>>58857527
"The C programming language" (K&R) only had two versions.
The original 1978 version, and the 1988 ANSI C version (now known as C89).

You can either compile in C89 mode, or just change the code slightly to become conformant, which just basically means don't use implicit int (e.g. main() -> int main()).
Otherwise, you would have to read a different book.
>>
>>58857483
it's bitwise or, but I meant to use ||=
>>
File: 1462565199381.jpg (40KB, 657x527px) Image search: [Google]
1462565199381.jpg
40KB, 657x527px
>>58857560
>that one guy who replies to a bunch of random people
>>
>>58857549
its a small business

what should i ask about? im thinking i should inquire into the specifics of what they do, their tools, etc, along with how they do things in terms of project management.
>>
>>58857527
>>58857586
Does the latest version of K&R still use "K&R syntax" for specifying function parameters? By which I mean

print(s)
char *s;
{
/* blah blah blah */
}

instead of
int print(char *s)
{
/* blah blah blah */
}
>>
>>58857385

fizzBuzz :: (Integral a, Show a) => a -> String
-- the type of fizzBuzz is (a -> String)
-- where a is any integral, showable type

fizzBuzz x =
case (x `mod` 3, x `mod` 5) of
(0, 0) -> "FizzBuzz"
(0, _) -> "Fizz"
(_, 0) -> "Buzz"
(_, _) -> show x

-- show is toString
-- _ is a wildcard that discards information
-- everything is an expression and returns something


main = mapM_ (putStrLn . fizzBuzz) [1..100]
-- (putStrLn . fizzBuzz) = \x -> putStrLn (fizzBuzz x)
-- mapM_ f container
-- applies the action f to every element in the container
>>
>>58857614
>im thinking i should inquire into the specifics of what they do, their tools, etc, along with how they do things in terms of project management.
Sure. The gist of it is you want to make sure it's a good place to work. Do they use modern tools? What about testing and continuous integration? What kind of projects are they working on at the moment? Etc.
>>
>>58857498
I know what OR is, just never seen it in that context.

>>58857499
So wait, I still don't understand the code.
found |= (a==array2[k,l]);

So found is either false or the integer on the position k,l in the array?
>>
>>58857657
I think they mention it, but prefer to use the prototype syntax.
>>
>>58857686
yeah I mistyped there, I'm kinda tired, I meant ||=
basically you set found (which should be a boolean) to false, and for every element in the second array, you set found to true if a is equal to the element you're looking at
do that for every element of the first array
>>
>>58857658
(defun fizzbuzz (n &aux (f (mod n 5))
(g (mod n 3)))
(cond ((= f g 0) 'fizzbuzz)
((= g 0) 'fizz)
((= f 0) 'buzz)
(t n)))

(dotimes (i 100) (print (fizzbuzz (1+ i))))
>>
>>58857711
please TRY to keep track of the conversation
>>
>>58857720
just wanted to show off
>>
>>58857737
ok

do "frob' next
>>
>>58857560
You can have a type that takes up the full word size, but calling it an integer is 'retarded'.
>>
>>58857745
????
>>
>>58857838
>he can't do @frob#
>>
>>58857851
explain it, i might be able to do it
>>
>>58857832
So what would you call it then? Natural?
>>
>>58857921
A natural would be in the integer set. I would prefer C's unsigned int to be called 'word'
>>
>>58857907
Nobody knows what "frob`` is.
Anon never told us.
>>
>>58857832
>he didn't learn in math class about N and Z (coloquially "Zintegers")
>>
File: frob explained.jpg (328KB, 851x1448px) Image search: [Google]
frob explained.jpg
328KB, 851x1448px
>>58857942
>>
>>58857974
delete
>>
>>58857254
>w-what should i wear?

Something more casual that makes you look good.
>>
I have a server I'd like to performance test. The way I see it, there are two possibilities.

>measure seconds per request
using a single thread, measure the average request time
>measure requests per second
using many threads, measure the maximum number of requests the server can handle before degrading

Which approach is better and why?
>>
>>58858046
both?
>>
>>58858046
Depends, if multiple people are using it, I'd go with the second
Or just do both if possible
>>
Learning Java GUIs and need a nice clean layout to use.
I want to arrange it so the label is at the top and the buttons are listed below it, possibly with labels listed underneath the top one too.

What would be a good layout/method of doing this? Would panels help?
>>
I wrote a javascript that allows the user to upload into the DOM an image, select an area from a canvas and upload the selected part to a php server that stores it.
Everything works fine of firefox, but it seems chrome is slow to refresh the event listener.
It's a known issue, or i have to make up for it?
>>
>>58857063
>>58857096
This works, thank you, followup question; can you make a number only appear once? Since it's random, on some positions it's going to print the same number twice.
>>
>>58857974
Why the fuck are you calling it a ``Frob" instead of just a node of a doubly-linked list?
>>
>>58858046
Going from req/s to s/req are just a matter of inverting the result, that has nothing to do with what you're measuring.

You want to measure the throughput in the multithreaded scenario.
>>
File: 20_qbvduk_o4750d.gif (1MB, 600x450px) Image search: [Google]
20_qbvduk_o4750d.gif
1MB, 600x450px
Post programming music

https://www.youtube.com/watch?v=IyDD7bUqVxw
>>
>>58858136
C# probably has sets, you could fill a set with the numbers instead of printing them right away, and then print the set in the end

alternatively you could replace the number in array2 once it has been matched to a number from array1, so it can't get matched again, you just have to make sure you replace with a value that can't occur "naturally" like -1 if your arrays only have positive numbers
>>
>>58858197
https://youtu.be/xAjtTdkYl4M
>>
>>58858197
https://www.youtube.com/watch?v=mCaHGPdHHCU
>>
>>58857958
> unsigned int is a subset of int
>>
>>58858095
What are you asking for exactly? Are you asking how to arrange it, shit like pic realted?
Or it's about how to generate it dinamically maintaining a layout? Libraries, dev tools?
>>
File: Untitled.png (24KB, 1306x593px) Image search: [Google]
Untitled.png
24KB, 1306x593px
>>58858261
>>58858095
forgot pic
>>
>>58858206
Thanks for that, I'll try to find some other solution as well, it's mostly the syntax that I'm uknowledgable about.
>>
Hey I know about argparse and getopt but I am using C on a Windows system and am trying to learn the basics using a simple program

What's happening, is it doesn't match with the string "-i" as it keeps requesting a file for a file specified via standard in. Can anyone point out the mistake?

I printed out a for loop enumerating the arguments and they all matched up okay.

Usage is:

program -i INPUT -o OUTPUT -c
0 1 2 3 4 5

        if (argv[1] == "-i")
{
int len = strlen(argv[2]);
if (len > 0 && argv[2][len - 1] == '\n')
{
argv[2][len - 1] = '\0';
}

strcpy(inputFile, argv[2]);
}
else if (argv[1] != "-i")
{
printf("Please enter the location of the input file\n");
fgets(inputFile, 100, stdin);
}
else
{
printf("Unknown exception\n");
}
>>
>>58858307
>argv[1] == "-i"
You're just comparing pointers here.
If you actually want to perform a string comparison, use strcmp from <string.h>.
>>
>>58858329
Thank you
>>
>>58858307
Pretty sure you can't compare C strings like that, because they're just arrays of chars, and as such decay to pointers when compared, which means two strings will always compare unequal if they are in different memory locations, even if their content is the same. You should use the strcmp() function to compare C strings.
>>
>>58858307
argv[1] == "-i"

You can't compare C string like this, you'll end up comparing their memory addresses
You want strcmp
>>
>>58858197
https://www.youtube.com/watch?v=_oUp_JjPJok
>>
>>58858307
You can't compare strings like that in C, I dont remember it well now but I think that with

(argv[1] == "-i")


compares if the two pointers (char*) are equal, which they aren't. Use strcnmp instead to compare the values they hold:

http://www.cplusplus.com/reference/cstring/strncmp/
>>
>>58858351
The 90's were objectively the best decade in human history.
>>
File: 1470266808163.jpg (10KB, 500x500px) Image search: [Google]
1470266808163.jpg
10KB, 500x500px
>https://docs.python.org
Why is this shit so unreadable? They should hire a web designer.
>>
>>58858284
Yeah, pretty much this.
I have a set layout and I want to design it basically how you did in pic related but aligned to middle.
>>
>>58857182
-1isize as usize;

where's your god now?
>>
>>58858189
Yes it does - my server has n threads. A single threaded client will only stimulate a single thread on my server. A multithreaded client can stimulate multiple threads on the server at once.
>>
i thought memory allocated by alloca was supposed to be freed when it goes out of scope but it doesn't seem to work
>>
>>58858423
Multi-threaded or single-threaded is what you're measuring.

req/s or s/req or even kilo-request frequency are just units you can use to express what you measured.

You shouldn't confuse the two different concepts, that's a beginner's mistake.
>>
how do I become less stupid
I've been doing project euler problems and I never have good intuitions about ways to solve problems. even if I consciously think about it for a while I usually don't find something halfway as elegant as the things people think of in the threads
I think the most helpful thing has been doing more of the problems so I can apply the same lines of thinking, but I very rarely have a spurt of real insight, it's usually just "oh, proceed in the same sort of way". also cs at my school is an absolute meme and has not been the slightest bit useful. should I read I2A3E seriously, or study some discussion of a paradigm or well-written project or what?
>>
>>58858454
freed on function return
>>
>>58858470
No, freed on the end of the scope.
>>
>>58858470
>>58858492
Before this devolves into a shitfest
http://man7.org/linux/man-pages/man3/alloca.3.html
>>
>>58858492
man 3 alloca
>>
>>58858510
>>58858509
Oh right, the fuckers just pop esp.
That's dirty.
>>
>>58858454
Why on earth are you using something as unportable as alloca?
Use VLAs.
>>
>>58857974
that image is so stupid
why the fuck does the name matter when it's ordered alphabetically
it doesn't matter if you do
insert(cuck, Frob("butthole"));

it will still insert alphabetically
>>
>>58858405
I think in java it's called Jpanel, or look up for a group box. You put your shit inside and use some attribute like "align: center".
I would suggest using a box for every btn-lbl couple. Then you make an anonymous function that generates those boxes
>>
>>58858197
https://www.youtube.com/watch?v=liJWv43QxMo
>>
>>58857974
nobody can do this in C lol
>>
>>58858329
>>58858343
>>58858345
>>58858383

Thank you for the tips, I used:

if (strcmp(argv[1], "-i") == 0)


Just another quick question please - is it possible to return two values of different types? Say an int and a char?

For example, I want to retrieve two values and store them in an array from the command line. Will I require two separate functions, and can I pass arguments into these two separate functions if they are not main?
>>
>>58858530
>Use VLAs
Not supported by the Microsoft compiler
>>
>>58858574
What?
>>
working on putting weebshit cancer into the oven ;))))
>>
>>58858594
there's no object orientation in C
>>
>>58858613
You don't need it to make a doubly linked list, just a struct and pointers
>>
>>58858586
>it possible to return two values of different types
Not directly.
Either you will have to return a struct which has those two types in it, or pass an extra pointer to the function and return a value in that.
struct tuple {
int a;
char b;
};

struct tuple my_fn();

void my_fn(int *ret1, char *ret2);

int my_fn(char *ret);

Or whatever you want to do.
>>
>>58858574
Are you retarded? Doubly-linked lists are trivial in C:
typedef struct frob {
char *name;
struct frob *previous, *next;
} frob;
>>
>>58858586
You can have one return in a function, and in C you can't make arrays that are not homogenous.
Shit it out as a string and then parse it
>>
Is there an unsub bot for youtube?
>>
Ken Ishii as best programming music for people that can't program to music?
>>
>>58858586
You can return a struct which contains all the types you need.
struct Tuple {
int a;
char b[10];
};

struct Tuple getPair() {
Tuple r = { 1, "lmao" };
return r;
}

void foo() {
struct Tuple t = getPair();
}
>>
>>58858613
The only "object oriented" feature the Python example requires is member functions, which you can do in C, you just need to pass the object explicitly by reference, rather than implicitly. So instead of doing
yourself.kill()
you do
kill(&yourself)
>>
>>
File: 1444222932363.jpg (68KB, 700x700px) Image search: [Google]
1444222932363.jpg
68KB, 700x700px
>tfw you are to retarded for haskell
Send help, every time I have a Haskell assignment, it takes an eternity because I overthink how complex a problem is or overlook how easy Haskell can solve it.
>>
>>58858710
>tfw no haskell class
>tfw stuck with java poo in loo shit
KillThePersonSpecifiedAssMeRightNowFampaiTM();
>>
>>58858698
When will admin fix the servers? These images are taking forever to load.

>>58858710
>tfw too smart to fall for the FP meme
>>
>>58857659
thanks senpai

>>58858043
which is?
>>
>>58858764
>which is?
full rick
>>
>>58857658
Does not scale to more factors

fizzbuzz :: (Integral a, Show a) => a -> String
fizzbuzz x
| null str = show x
| otherwise = str
where str = concat [tag | (n,tag) <- tags, x `mod` n == 0]
tags = [(3,"Fizz"), (5,"Buzz"), (7,"Baz"), (11,"Biz")]

main = mapM_ (putStrLn . fizzbuzz) [1..100]
>>
>>58858787
rick?
>>
>>58858197
https://www.youtube.com/watch?v=C9jxWZMiw2Y
>>
take a look at this regex
(http\:\/\/\w\.\w+\.\w+\/\w+.(jpg|png|jpeg|gif))


to see if i understood, if i have the url: :
i.imgur.com/rVReab8.jpg

the first \w matches : imgur
the second \w matches : com
the third \w matches : rVReab8
the forth \w matches : jpg
>>
>>58858901
The \w matches the i, second the imgur, etc
>>
File: 1468347897621.jpg (31KB, 456x320px) Image search: [Google]
1468347897621.jpg
31KB, 456x320px
>>58858729
My class/exam covers java and haskell but I'm simply too retarded for haskell.
>>58858734
I think I will start to program only in Haskell in the future simply to torture the people that forced me to learn it in the first place.

>mfw it took me half an hour to figure this shit out
diff :: [Int] -> [Int] -> [Int]
diff xs [] = xs
diff [] ys = ys
diff (x:xs) (y:ys) = [x | x <- (x:xs), x `notElem` (y:ys)] ++ [y | y <- (y:ys), y `notElem` (x:xs)]
>>
>>58858910
oh shit

you're right

thanks
>>
>>58858901
Group 1
1) i
2) imgur
3) com
4) rVReab8

Group 2
1) jpg

Really that regex isn't doing anything useful, you may as well just put down
(http\:\/\/\w+.*?\.(jpg|png|jpeg|gif))
>>
>>58858901
That regex would not match that string.
>>
GET IN THE THREAD (not new, just girls and books)
>>58858168
>>
>>58858940
yes it would

look closer
>>
Anyone here work for Amazon? Know if mechanical turk is a good place to work?
>>
>>58858459
I'm not confusing them, I'm asking which one to use.
>>
>>58858965
Holy shit, no it isn't. Why would you ever say otherwise.
>>
>>58858961
>http\:\/\/
>>
File: tomoko lite uses thinkpaddu2.png (775KB, 1026x1038px) Image search: [Google]
tomoko lite uses thinkpaddu2.png
775KB, 1026x1038px
>fixed bug that's been throwing me off for weeks
>didn't even think twice about the solution
>the bug fix was adding a three star array of pointers to pointers to char arrays

I'm a 3 star programmer now!
>>
>>58858983
What's wrong with it?
>>
Doing some string parsing in C
#include <stdio.h>
#include <string.h>

#define MAXLINE 1024

int main()
{
char* token;
char buffer[MAXLINE];

fgets(buffer, MAXLINE, stdin);
token = strtok(buffer, " \n");

//bunch of other shit that's not important


So I take in stdin, put it into an array, and use strtok to tokenize it on spaces and newlines. Later, I want to call getcwd() to get the current working directory of the process. However, if I try and put that into the buffer array, it will truncate random parts of the token variable.
I assume this has something to do with the token being a pointer? How would I resolve this so I don't have a second char array for getcwd()?
>>
>>58858986
are you retarded?
>>
>>58858983
I mean working there as a dev, not as someone taking quizzes for money
>>
>>58859004
Disregarding the fact that Amazon treats its own employees like the worthless replacable cogs they are, the whole purpose of Mechanical Turk is paying people nothing to do thoroughly unrewarding work. That would be your place in the world.

No part of that sounds like a dream job, not even close.
>>
>>58859025
The fucking matching string doesn't have http:// in it, so it's not going to match.
How can YOU be this fucking retarded?
>>
>>58859005
Token will be a pointer to somewhere inside 'buffer', do if you modify buffer, it's going to change what you get from token.
>>
>>58859060
THAS BECAUSE I FORGOT TO PUT IT THERE
OBVUISLY THE STRING IS IN THE FORMAT

http://i.imgur.com/OQFPdyM.jpg
>>
>>58859042
Like I said, I meant as an engineer. Does amazon treat their engineers poorly in general?
>>
>>58859086
I understood, yes. No need to repeat yourself.

Some people get up everyday and work to solve interesting problems, you role would be essentially promoting a scam that borders on slavery.

>Does amazon treat their engineers poorly in general?
They don't exactly have the greatest reputation, would be the euphemism of the century.
>>
http://icube-icps.unistra.fr/img_auth.php/d/db/ModernC.pdf
Is this good material to learn for beginner in C?
>>
>>58858912
import Data.List
diff = (\\)
>>
File: comfiness incarnate.jpg (795KB, 2941x1946px) Image search: [Google]
comfiness incarnate.jpg
795KB, 2941x1946px
>>58858467
bls resbond
>>
>>58859103
It would at least look good on my resume right? And I'd work with competent people?
>>
>>58859239
Yes, it would look pretty good.
You would work with people who don't mind working in this kind of shitty environment, which is typically shitty people, desperate people, or people who didn't know what they were getting into and are just waiting for a reason to switch jobs.
>>
>>58859005

As
>>58859081
said both strtok() and getcwd() modify the input string, so not possible to use the same variable to hold two informations simultaneously, unless you do some bookkeeping.

What's the problem of having a second char array for getcwd()?
>>
is there anything wrong with this code?

from functools import reduce
def unique_digit_products(a):
return len(set([reduce(lambda x, y: x * y, p) for p in [[int(i) for i in x] for x in [list((str(i))) for i in a]]]))
>>
File: c++ programmers in russia.jpg (32KB, 317x372px) Image search: [Google]
c++ programmers in russia.jpg
32KB, 317x372px
please rate meme
>>
>>58856410
Most of us probably have learned it.
We just have no reason to use it.
>>
File: file.png (77KB, 1030x1049px) Image search: [Google]
file.png
77KB, 1030x1049px
I made a single-header FFT library and a "realtime" "formant extractor" (which is what I actually wanted to make and needed the FFT for)

https://github.com/wareya/fft
http://pastebin.com/Vz1X4b1q
>>
>>58859212
Happiness helps; the mind works in mysterious ways, but you definitely can't learn anything if you're too busy wallowing in self-pity.

Stop giving a fuck if you suck, sucking is the first step to getting good and everyone has to go through it.

I enjoy learning, it's fun. And I'm not better than anyone.
>>
>>58856419
No that makes perfect sense.
When you use crufty languages you have to write a whole bunch of needless shit at the top that can be difficult to remember off the top of your head.

That's why all students should be taught Scheme first. If you start with Java or C it gives you the impression that you are indeed learning a literal language with vocabulary and shit that needs to be rote memorized.
>>
File: 1486401224033.jpg (61KB, 1280x720px) Image search: [Google]
1486401224033.jpg
61KB, 1280x720px
>>58859166
>mfw i didn't know that this function exists
Would that even work? If I understand the documentation correctly \\ only subtracts the first occurrence of an element. The assignment was that list c only has elements that are in either a or b.
>>
>>58859283
no its correct
def uniqueDigitProducts(a):
product = 0
products = []

for i in a:
temp = i
product = 1
while (temp > 0):
product *= temp%10
temp /= 10

if product not in products:
products.append(product)

return len(products)

from functools import reduce
def unique_digit_products(a):
return len(set([reduce(lambda x, y: x * y, p) for p in [[int(i) for i in x] for x in [list((str(i))) for i in a]]]))

print uniqueDigitProducts( [1,2,3,4,5,6,7,8,9,10,11,12,13])
print unique_digit_products([1,2,3,4,5,6,7,8,9,10,11,12,13])



output
10
10
>>
>>58859298
I mean I'm not whipping myself over it, it's more of a general consciousness that I'm not very good. I really enjoy programming, especially stuff like project euler where the path to the answer isn't obvious and the feedback loop of writing/running/correcting is short and not obfuscated, and I think I'm usually happy when making my solutions, I just want to know what else I can work on to get better, given I've kind of plateaued like 20 problems in and think a sort of cross-training would probably be worthwhile
>>
>>58859283
extra edginess
unique_digit_products = lambda a: len(set([__import__('functools').reduce(lambda x, y: x * y, p) for p in [[int(i) for i in x] for x in [list((str(i))) for i in a]]]))
>>
Why is Shinji dressed as a girl in the OP?
>>
>>58858613
You absolutely don't need object-orientation to do this.
Just write a struct and some helper functions and you're good.
>>
>reading a book on Prolog
>it appears to be a comfy language with pretty cool intentions
>mfw I hated it only because some asshole prof taught me it
I feel exhausted, to be honest.
>>
I've seen people here making serious projects with Go.
Is anyone actually using Rust here?
>>
>>58859989
Yes but I keep restarting and going about things a different way after a day or so.
>>
>>58859989
>using anything but C or nim as a compiled language
???
>>
>>58859989
I'm making a thing with Rust, it's pretty neat.
There's some borrowck fighting as expected, but the language is pretty great for something so new.
>>
>>58855684
>haha i posted le skitsofren maymay again haha so funny xD
fuck off back to (r)eddit, you brainwashed nigger-cattle
>>
>>58860016
C++ has namespaces, they're useful.
>>
>>58860016
>Nim
HAHAHAHA
>>
>>58860028
namespaces are overrated, and just cause ABI problems.
>>
>>58860048
>cause ABI problems.
But that's not true. The ABI is already complicated, namespaces are the simplest part of it.

t. faggot who can demangle things on sight
>>
>>58860062
It's the reason that C would never introduce that pointless feature.
>>
>>58860043
Let's be honest anon. It's a godsend. Performance like rust and go but with python syntax? Can we PLEASE make nim a thing?
>>
>>58860076
I don't think that you're thinking clearly, or you're misinformed.
>>
>>58860087
About what?
Yes, I know C technically does have namespaces, but not the type of namespaces that sepplesfags think of.
Unless you're talking about the nature of this discussion itself.
>>
>>58860082
I dislike Python syntax immensely.
>>
>>58860082
>python syntax
How on earth is that a good thing?
Python's syntax is fucking terrible.
Significant whitespace.
Shit lambdas.
Tries too hard to be like english.
Shit like __this__ littered all over the place.
etc.
>>
>>58857658
So does "case ( ... )" return an expression (or consist of an expression) to which the "of" operator is applied? Or is "case ... of ..." a special syntax thing?
>>
File: dpt-poll.png (13KB, 660x249px) Image search: [Google]
dpt-poll.png
13KB, 660x249px
Reminder that you're all using the wrong language
>>
>>58860119
Like you said, C already has its own ABI quirks, although it's still pretty simple.
Namespaces in C++ don't make the ABI significantly more complicated, so that's not at all a reason to reject the feature.

C++ does have some thorny ABI issues, for example the layout of standard classes makes inter-compiler or even just inter-compiler-version compatibility impossible right from the start.

Adding namespaces to C wouldn't have caused any ABI problem.
It's too late to add it now, because the standard ABI is set in stone, but that says nothing about the complexity of adding it.
>>
>>58860164
Wow, you voted 5 times on your own poll. Great.
>>
>>58860161
It's special syntax that lets you do pattern matching.
>>
File: 1371853377299.png (223KB, 352x359px) Image search: [Google]
1371853377299.png
223KB, 352x359px
>>58860176
>Wow, you voted 5 times on your own poll. Great.
4 times actually.
>>
>>58856389
Go (golang)
https://tour.golang.org
>>
>>58860226
Ew.
>>
>>58860230
>https://tour.golang.org
just try it m8
>>
Why are there no good LISP implementations?

Racket is sane but slow as molasses, and SBCL is fast but CL is horrendous.
>>
>>58860239
If I wanted a minimalistic language, I'd use C.
If I wanted a language that takes me for an idiot, I'd use python.

If I wanted both at the same time, I'd kill myself first.
>>
>>58860015
>>58860024
Alright, this gives me a bit of motivation to continue reading the docs.
Things are flying over my head really fast.
>>
>>58860239
Go is absolute garbage. It has no redeeming features.
>>
>>58860260
It has a networking library as part of it's standard library, but that's it.
>>
File: rus meme.jpg (83KB, 638x706px) Image search: [Google]
rus meme.jpg
83KB, 638x706px
Hello from brchan

#include <stdio.h>

int main(void)
{
fputs("\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x21\x0a", stdout);
return 0;
}


Bring your hello: http://brchan.org/crypto/res/272.html
>>
>>58860226
>no local imports
>forced formatting because they cant be fucked with a flexible parser

M E M E
E
M
E

L A N G U A G E
A
N
G
U
A
G
E
>>
>>58860258
It's a systems programming language AND a cutting edge research project at the same time, so there's a lot of new concepts if you're not familiar with any of that.

Coming from C++, it all makes a lot of sense.
Except maybe for the nazi compiler that rejects valid code, but I hear they're working on it.
>>
>>58860273
So does Java. Woopty-fucking-doo.
>>
>>58860289
Yeah, I believe non-lexical lifetimes based on liveness are high priority.
>>
>>58860277
Are you a beginner?
That's some pretty simple stuff here, not sure what you're trying to do.
>>
>>58860279
>they cant be fucked with a flexible parser
Please please tell me that's not the reason for gofmt.
>>
I'm trying to do concurrency in Go but it just isn't working, that's really all I can say about it, it does not work.

I have a function that just loops over a slice and calls a function with "go" on each of the elements. The problem is that it just doesn't execute all of them, just a very small random amount of them and I only know this because I have a println in the function saying which argument it got called with.

The function does http fetches so maybe there's something limiting amounts of requests I can send? I honestly don't know.
>>
>>58860309
i'm trying to hack the mainframe
>>
>>58860308
I can't wait for it to happen but it's been what, four years? And it's still a rough sketch of an idea.

Thankfully it seems to be on the agenda this year, so maybe we'll see some progress.
>>
>>58860309
Nothing, its only a hello.
>>
>>58860326
I guess it was one of those things they were waiting for MIR to do? Dunno. Personally I'm excited for stable procedural macros.
>>
>>58860308
When's it going to get HKTs? It's worthless as it is now.
>>
>>58860334
Didn't procedural macros 1.0 just go stable?
I hear all the cool libraries are going out of nightly now.
>>
>>58860252
>>58860258
>>58860260
>>58860273
>I'm too lazy to follow a 2-hours (tops) tutorial, so I'll pretend I'm a elite programmer

>>58860279
>I'm a code artisan that cares about formatting and other dumb shit, so I'll call it a "meme"

right now, all your shit programs/scripts are being converted to Go by some Go dev
C, Python, C++, Java, C#, ... programs are being replaced simply because Go is fun and better than those langs
>>
>>58860279
>>58860317
It's probably harder to write a parser that expects a very specific format and give error messages about it, instead of just a free-form parser.
I think they did that because of their cargo-cultist nature.
>>
File: 1432164169261.png (289KB, 586x634px) Image search: [Google]
1432164169261.png
289KB, 586x634px
>>58856748
You're checking if the two matrices have the same numbers AND that they're in the same position.
>tfw this is the extent of codemonkeys' understanding of a problem
>>
>>58860309
What you're trying to do?
>>
>>58860364
>you need to use go more before you're allowed to say whether it's shitty
>you need to live in india more before you're allowed to say whether it's shitty
>>
File: 6K85tMG.jpg (212KB, 2382x458px) Image search: [Google]
6K85tMG.jpg
212KB, 2382x458px
>>58860364
>>
>>58860370
why do you feel this need to mock someone who obviously started learning so recently, he literally just learned what a method is, are you that pathetic mate
>>
>>58860424
/dpt/ isn't for beginners. You want /wdg/ for that.
>>
>>58860323
Here's a cute trick for haxoring into the pentagon:

This is a valid C program that returns the answer to Life, the Universe and Everything:
const main = 0xC300B0 + ('*'<<8);
>>
>>58860462
>This is a valid C program
No it's not.
>>
>>58860480
It's technically not, but it works. Probably.
>>
>>58860424
Oh shut the fuck up retard samefag.
>>
>>58860483
>It's technically not
No, it's definitely not.
Even if it was a freestanding program where main() doesn't need to be defined and is of no special significance, you still have the implicit int, which is not valid anymore.
>>
>>58860153
>>58860125
It's incredibly intuitive and forces you to write clean code
>>
>>58860496
Who said it was C11?
This is pre-classical magic, dear.

And freestanding or not, just defining main that way is illegal so that's not in question.
I mispoke and of course someone jumped to correct the obvious mistake.
>>
>>58860462
$ cc test.c 
test.c:1:7: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
const main = 0xC300B0 + ('*'<<8);
~~~~~ ^
test.c:1:1: warning: variable named 'main' with external linkage has undefined behavior [-Wmain]
const main = 0xC300B0 + ('*'<<8);
^
2 warnings generated.
$ ./a.out
$ echo $?
42
>>
>>58860514
>It's incredibly intuitive and forces you to write clean code
Wrong on both counts.
>>
>>58860462
DONT RUN THIS IT MAKES MUSTARD GAS
>>
>>58860519
Will this code work on non-x86 machine?
>>
>>58860515
>Who said it was C11?
The current standard is C11. They said it was a C program, so it's completely reasonable to assume that they meant C11.

>>58860514
No it's not.
I've been plenty of extremely shitty and hard-to-read python code.
>>
New thread:

>>58860551
>>58860551
>>58860551
>>
>>58860546
No, that constant is x86 machine code.

>>58860549
>The current standard is C11. They said it was a C program, so it's completely reasonable to assume that they meant C11.
It would be reasonable if not for the obvious clue that this isn't valid C11, so that couldn't have been meant.
Don't be purposefully autistic.
>>
>>58860245
>CL
if you knew anything about CLOS, you'd be able to implement your own language through metaobject protocols
>>
>>58860529
This, it's also shit as actual pseudo code.
>>
File: what is this.jpg (101KB, 356x421px) Image search: [Google]
what is this.jpg
101KB, 356x421px
I have a code like this
label1:
while(blah1)
{
blah;
if(true)
{
goto label2;
}
}
goto label3;

label2:
while(blah2)
{
blah;
if(true)
{
goto label1;
}
}
label3:
return;

and it literally doesn't run the first while conditional. I'm at my wit's end here.
>>
>>58860672
If all your code is this shitty, it's no wonder it's full of bugs.
>>
>>58860672
Replace blah1 with just 1, and put a print statement at the start of the loop for sanity checking.
Then if it works, revert to the old code, run it in a debugger, and figure out why blah1 isn't true - or why the while statement isn't reached at all. (Put breakpoint on the while loop, etc.)
You should be able to figure it out pretty quickly.
>>
>>58860672
Bad use of goto.
Rethink the whole thing.
>>
>>58859286
Are Russian programmers some kind of meme?
>>
>>58860076
It's trivial to simulate namespaces in C though. Just give your functions gibberish names and access them through function pointers in global structs.
>>
>>58860742
In Soviet Russia, computer programs YOU.
>>
>>58860756
What advantage does that have over just prepending something to the start of the name?
It's just extra pointless code and adds a layer of indirection when calling those functions. The compiler MIGHT be able to inline them, but I wouldn't be certain about that.
>>
File: weird_goblin.png (35KB, 196x361px) Image search: [Google]
weird_goblin.png
35KB, 196x361px
>>58860710
I have a print statement at the top of the first while loop, and it's never printed, and the while loop condition is literally just something like "abs(thing1 - thing2) > thing3", where thing1 and thing2 are defined such that their difference is larger than thing3 explicitly at the start of the run.
>>58860715
This is more likely desu. How do I fix?
>>
>>58860563
Is it generic machine code? Or does it depend on OS syscalls? Most programs where main is defined as a hex number that I've seen are OS dependent.
>>
>>58859398
what so you want to delete all elems found in ys from xs?
diff = foldr (\y -> filter (/=y))

you may need the signature
Eq a => [a] -> [a] -> [a]
though
>>
>>58860833
It's cross-platform since the only assumption it makes is that the OS will take the return value as the exit code.

If you want more hacky dark magic, try to follow what this innocent looking C program is doing:

#include <stdio.h>

void test() {
int a = 8;
printf("This is b%d%n\n",a,&a+a);
}

int main(int argc, char* argv[]) {
while (argc == 1) {
test();
}
printf("This is reachable.\n");
return 0;
}
>>
>>58860790
Please step through it with a debugger. Whether you've accidentally reversed thing1 and thing2 in your subtraction, or have some other problem it's impossible to diagnose given what you've printed, stepping through in a debugger will give you the solution.
>>
>>58861207
Absolute value doesn't care about the order at which you subtract the arguments.
I'll try to look at what the program does at each of the steps, but I highly doubt it's something cause by the conditions not being fulfilled in the while loop.
>>
File: Haskell.png (2KB, 352x34px) Image search: [Google]
Haskell.png
2KB, 352x34px
>>58860878
well, my code works but i wonder if it would have been possible to get pic related with the \\ function.
The assignment was that list [a] compares it's elements to [b]'s elements, the unique elements will go to list [c], the same goes for list [b].
>>
>>58856748
Wtf are you doing o shit. If you are just running through the array just use 2 for loops.
>>
>>58857368
Because you couldn't get a research position.
Thread posts: 333
Thread images: 49


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.