[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: 318
Thread images: 50

File: 1476487280652.png (2MB, 1200x1726px) Image search: [Google]
1476487280652.png
2MB, 1200x1726px
op.image.isAnime()


Previous thread: >>57342052
>>
first for GAS ALL FAGGOTS
>>
Rust is the future C++ dead language it's official
>>
File: kekeke.gif (2MB, 356x200px) Image search: [Google]
kekeke.gif
2MB, 356x200px
>>57346374

This gay is faggot and he dont know how to c++.
I hope you get Parkinson's disease faggot.
Then i want to see you typing.
>>
File: >anti-fp fags.png (376KB, 2560x160px) Image search: [Google]
>anti-fp fags.png
376KB, 2560x160px
>>
>>57346441
I wish you a stiff neck and arms so short that you cannot scratch yourself.
>>
>>57346364
>And if it occurs for a small, trivial error - have you ever read from a socket, and there suddenly was no memory left, and you thought to yourself: "Now I need an exception to tell the caller function to give me some more memory additionally to what I already had!"? - then overloaded error handling is OK?
If you think that error occurs often enough that the constant overhead still beats the occasional cost of the exception then go for it, don't use an exception in that case.

>Do you have any idea how many trivial things can go wrong that don't fucking REQUIRE new/delete faggotry? OOM was one example.
>OOM
>trivial
That said, you can theoretically preallocate an exception although I don't think C++ supports it.

>Another would be "cannot find object in data set". Trivial stuff.
That one is tricky to quantify. It would be best to provide both or abstract over it somehow if your language is conducive to that.

>No. I have a better idea: learn how to fucking code
Coming from the dumbass that doesn't want to think about picking the right tool for the job, nah.
>>
>>57346388
if( op.image.isAnime() == true )
reply("just stop posting anime pls. I'm tired of typing this out/n>>>/a/");
>>
8th for python
>>
>>57346476
I was actually done talking to you ... but you know what?

>https://gcc.godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(j:1,options:(colouriseAsm:'0',compileOnChange:'0'),source:'%23include+%3Ciostream%3E%0A%0Aint+ec(bool+x)%0A%7B%0A++if(x)%0A++++return+-1%3B%0A++else%0A++++std::cout+%3C%3C+%22Bla!!%5Cn%22%3B%0A%7D%0A%0Avoid+ex(bool+x)%0A%7B%0A++if(x)%0A++++++throw+new+std::exception%3B%0A++else%0A++++std::cout+%3C%3C+%22Bla!!%5Cn%22%3B%0A%7D%0A%0Aint+main(void)%0A%7B%0A++bool+x%3B%0A++std::cin+%3E%3E+x%3B%0A++ex(x)%3B%0A%7D'),l:'5',n:'1',o:'C%2B%2B+source+%231',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:g62,filters:(b:'0',commentOnly:'0',directives:'0',intel:'0'),options:'-O3'),l:'5',n:'0',o:'%231+with+x86-64+gcc+6.2',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4

Compare ec with ex.
I rest my case, you are a gigantic faggot and you have no idea what you are talking about.
>>
>>57346503
if( op.image.isAnime() ^ false == false ^ ( false == false)
){ reply( "just stop posting anime pls. I'm tired of typing this out/n>>>/a/"
);}

fixed for readability ^)))
>>
File: 2016-11-01_23-33-10-1.webm (370KB, 806x508px) Image search: [Google]
2016-11-01_23-33-10-1.webm
370KB, 806x508px
bizzfuzz
>>
File: phone.jpg (98KB, 640x640px) Image search: [Google]
phone.jpg
98KB, 640x640px
>>57346455
>>57346473
The exception handlers aren't on the stack. Every function can have exception handlers associated with it, so what happens is, when an exception does occur, it repeatedly pops stack frames until it finds an exception handler.

How does it find the exception handlers without them being on the stack? It has a lookup table. It looks up each function it peeks on the callstack in this table to check if it has exception handlers associated with it at the current instruction pointer, and if so, runs that handler.

So the handlers themselves are in some part of memory that's rarely used unless you throw all the time, and gets referred to when exceptions do happen. So that means that when exceptions do happen, they have high cost (a lot of cold memory has to be loaded into the cache, the process of traversing the callstack is itself expensive, etc) - but this comes with the advantage that they're absolutely free when errors don't occur.

Keep in mind the actual implementation in practice depends on your compiler, so this is just an outline of how it can be done with zero cost.
>>
But programming with error codes is so annoying.
For every function call, check did this thig return an error? Did that thing return an error? Did my dick return an error? And if an error occured you have to relay it up the call stack, and at every level in the calstack, more is this an error yet, is that an error yet.
I hate having to code like that. It's time consuming and ugly, and makes your code a lot harder to read because two thirds of your codebase is stupid error checking. ARGH!
>>
>>57346524
>omits error handling for the error code version and doesn't even call it
It's the error handling that actually determines the cost of each option. Exceptions can be preallocated so the memory allocation cost is unnecessary.

Nice fair, unbiased example, you really showed me. Look, I'm not claiming that exceptions are always free, I'm claiming that sometimes they are the more efficient option than error codes. SOMETIMES. How is this a fucking problem to you?
>>
>>57346503
>== false
>>
Where do I learn about image manipulation, especially with python?
I want to learn how to manipulate pixels individually and do all kinds of weird stuff.
Where do I start?
Is python not a good language to manipulate images in? I can't find much about this. Just some basic "flip this image, crop blah blah" with PIL..
>>
>>57346575
Good effect systems (monads, algebraic effects, continuation passing, etc.) make both look identical. In fact, you can completely abstract over whether it uses exceptions or codes underneath it all.
>>
>>57346466

Smaller sized programs are able to better fit into the instruction cache. Larger programs that duplicate code more often will have to swap code in and out of cache more frequently, which destroys performance.
>>
>>57346584
Probably best to search for a library and its tutorials, then if you can find python binding documentation.
>>
>>57346441
What is going on in this video.
>>
>>57346673
>animetards
>VR
>gay
>>
Is there a way to keep track of how many times a recursive call happens in C without using a global variable?
>>
>>57346673
The guy in the black shirt is standing in for the girl in the VR game.
Dollar for dollar, this is a much more cost efficient way to get your rocks off than to to fug a real girl.
>>
>>57346818
Declare a static variable in the function, it keeps its value across calls. Increment it.
>>
>>57346584
Why Python? Go with Rust! Much better performance!!!

And you can help me out with my image handling library!
>>
If anyone's interested in why exception handlers are zero cost, check this out:

https://godbolt.org/g/qtz3IW

Specifically, the label after callcatch calls choose - the instructions themselves immediately return the result of choose even if it throws an exception. The handler itself is written to memory just afterward, and gets jumped to when an exception occurs.
>>
File: 1291231828153.png (236KB, 535x530px) Image search: [Google]
1291231828153.png
236KB, 535x530px
How can I traverse a tree and record each value from the tree into an array in the order that it was traversed?
>>
>>57346941
One of the functions didn't return what it was supposed to. Here's a better link.

https://godbolt.org/g/XmtCrG

Not that the actual assembly regarding the exception is different, but the program as a whole makes more sense.
>>
>>57346962
By...doing exactly that? I don't know how to break it down any more.
>>
>>57346962
What

you literally just described how to do it
>>
How do I assign regex matches to a variable in bash?
Everything I'm finding is only used in an if/else configuration to basically print "yup, that matches!" or "no it doesnt", never actually doing anything with the found matches
>>
>>57346941
>The handler itself is written to memory just afterward, and gets jumped to when an exception occurs.
That's a lot of bytes loaded into the instruction cache that are rarely exercised.
>>
File: 1415606413213.jpg (20KB, 251x231px) Image search: [Google]
1415606413213.jpg
20KB, 251x231px
>>57346973
>>57346990
I can't figure out how to code it up in C.

int *preCheck(node *pre, int *arr, int i)
{
if(pre == NULL)
return arr;

arr[i] = pre->data;
i++;

preCheck(pre->left, arr, i);
preCheck(pre->right, arr, i);
}


What I've written isn't working.
>>
>>57347009
You don't seem to understand passing by value vs. passing by reference (pointer).
>>
>>57347009
Maybe you should stop posting anime and pick up a textbook
>>
>>57347009
void *preCheck(node *pre, int *arr, int i)
{
arr[i] = pre->data;

preCheck(pre->left, arr, i + 1);
preCheck(pre->right, arr, i + 2);
}
>>
>>57346388
https://www.mediafire.com/folder/mcoahtucqx177/Programming_Books
>>
File: 1474305312419.png (129KB, 314x278px) Image search: [Google]
1474305312419.png
129KB, 314x278px
if [ "foo" = "foo" ]; then
echo "Dicks"
fi

>Syntax error: "fi" unexpected (expecting "then")

?????
>>
>>57347076
Don't think bash supports '=', isn't it something like -eq ?
>>
>>57347076
>[ "foo" = "foo" ]
Assignment?
>>
>>57347096
>>57347097
Same problem
=. =~, ==, -eq all spit back the same "fi unexpected".
>>
File: inthebag.jpg (56KB, 358x429px) Image search: [Google]
inthebag.jpg
56KB, 358x429px
>>57347004
At very worst only 63 bytes will be placed in the instruction cache due to the size of cache lines in x86. And the handler itself in this case is less than 64 bytes anyway.

>>57347046
You can do both.

>>57347050
That's even worse; it has no base case and will just segfault. You just need to have a pointer to i, otherwise the indices will be wrong.

>>57347118
Works on my machine.
>>
>>57347073
No offense, but why not Mega? And why not in a single archive?
>>
>>57347124
Yeah I just ssh'd onto a different box and it worked without issue.
wtf
>>
>>57347124
Okay. How about this.
Kindly kill yourself
>>
File: lhluhn.png (66KB, 237x222px) Image search: [Google]
lhluhn.png
66KB, 237x222px
>>57347138
Which one are you that I replied to?
>>
>>57347150
>>57347046
>>
>>57347076

rubyist@Overmind:~$ if [ "foo" = "foo" ]; then
> echo "dicks"
> fi
dicks
rubyist@Overmind:~$


Works for me.
>>
>>57347124
What do you mean by have a pointer to i?
>>
>>57347167
Works from the terminal for me too
What the actual fuck is going on, it just doesn't work from the damn .sh file
>>
File: 1477736317445.jpg (119KB, 777x656px) Image search: [Google]
1477736317445.jpg
119KB, 777x656px
>>57347009
Why is it an int function? You're not returning anything worthwhile. If I was you I'd make the increment counter global and take it out of the method call. Working with increment counters inside recursive functions is asking for trouble.
>>
File: bookaboo.jpg (688KB, 975x1789px) Image search: [Google]
bookaboo.jpg
688KB, 975x1789px
>>57347150
>>57347157
Alright, why should I kill myself? I have a good career ahead of me, anime to watch, and traps to fap to.

>>57347177
Pretty sure this is right, but I haven't compiled it. Pass it a pointer to the value 0 for i initially. Also since you're modifying arr, I changed the return type to void.

void preCheck(node *pre, int *arr, int *i)
{
if(pre == NULL) return;

arr[*i] = pre->data;
++*i;

preCheck(pre->left, arr, i);
preCheck(pre->right, arr, i);
}
>>
>>57347197
I need to return an integer array to compare it's values to an array with values from a different tree.
>>
>>57347197
fuck off anime degenerate
>>
>>57347207
>anime to watch, and traps to fap to.
exactly those reasons and that we are not here to do your homework.
>>
>>57347193

rubyist@Overmind:~$ vim /tmp/foo.sh
rubyist@Overmind:~$ chmod +x /tmp/foo.sh
rubyist@Overmind:~$ cat /tmp/foo.sh
#!/usr/bin/env bash
if [ "foo" = "foo" ]; then
echo "dicks"
fi

rubyist@Overmind:~$ /tmp/foo.sh
dicks
rubyist@Overmind:~$
>>
>>57347197
>global
>ever
And he's not returning an int, he's supposedly returning the array for no reason. If he actually returned an int, he could return the counter.
int preCheck(node *pre, int *arr, int i) {
if(!pre) return i;
arr[i] = pre->data;
i = preCheck(pre->left, arr, i + 1);
return preCheck(pre->right, arr, i + 1);
}
>>
>>57347222
>we are not here to do your homework.
What? I've been answering people's questions, not asking them.
>>
>Using Qt when gtkmm exists
>>
>>57346388
>draw a girl
>>
>>57347238
>What? I've been answering people's questions, not asking them.
Then you're just making the problem worse by making them dependent on us
>>
>>57347222
This. Also please stop posting, I can't add anything valuable to this thread.
>>
>>57347222
not him, but unless they're flat out asking you to code up an entire assignment, I don't see what the problem is in asking for some help if you're stuck on something you did yourself.
>>
>>57347250
What do you want to happen in this thread, then? No, this isn't a homework Q&A session. But if you can't ask questions (for any purpose) and neither can anyone else answer them, how are people supposed to learn?

>>57347255
>I can't add anything valuable to this thread.
Why is that my problem?
>>
>>57347193
Forget your shebang?
>>
File: 1459440027185.png (178KB, 2624x2432px) Image search: [Google]
1459440027185.png
178KB, 2624x2432px
How can I code a program that brings back my will to live?

I know C, Python and a bit of bash scripting.
>>
>>57347294
Sorrryyy didn't meant to quote (you)
>>
>>57347294
>What do you want to happen in this thread, then?
preferably arguements over
 == true 


>how are people supposed to learn?
preferably they don't so I won't get replaced by pajeet trannies
>>
Pretty noob here, learning C. My code stops working if I hit an invalid character, sending it into an infinite loop if I don't limit the loops to the array size. So if I input something like:

 5 2 16 33 abc 10 5 EOF

it will hit the abc and scanf will return 0 forever never getting to the 10.

Shouldn't the scanf in the while statement move onto the next item in the input? Whether that be a number or EOF.

while( ((check = scanf("%i", &current)) != EOF) && (i < max_length) ){

if( check ){
if( items < max_length )
x[items++] = current;
else{
printf("Array is full, flushing excess data.\n");
while( (check = scanf("%i", &current)) != EOF )
;
}
}
else
printf("Invalid input, moving to next value.\n");

printf("%i\n", check);
i++;
}
>>
>>57347310
When I'm in dark places sometimes I write girlfriend chatbots in python. It only goes so far anon.. it only goes so far u_u
>>
>>57347310
Do you think if we'd know the answer we'd still be here?
>>
>>57347318
>Implying everyone asking help in this thread with a cute anime face is a pajeet
Oh gosh... I'm so manipulable... r--ree
>>
>>57346388
Who is this trap
>>
>>57347330
How many times do you retards want to ask the same fucking question? I had the same fucking question ten years ago, but unlike you pathetic lot I actually used google:

http://stackoverflow.com/questions/16882489/why-does-scanf-get-stuck-in-an-infinite-loop-on-invalid-input
>>
File: mslain87.gif (273KB, 500x370px) Image search: [Google]
mslain87.gif
273KB, 500x370px
>>57347310
Write a program with a small userbase that regularly commits and submits issues to the repository.
>>
>>57347385
Write a program that program better than most pajeet.
>Capitalism fixed
>>
>>57347397
Build an anti pahjeet wall.
>>
>>57347377
I actually did google it, but I googled what I was trying to do rather than what was going wrong.

Anyway, thanks my man.
>>
>tfw can't figure out how to return the selection from a single mysql column in php, instead of giving me errors it just returns the entire row
>tfw my getSchedule() function will break if the person's usename is \"Schedule":
>tfw can't be fucked to fix it
>>
>>57347397
That's not hard. I had programs generating program code that I'd then insert in my actual program code.

The problem is that it takes a non-pajeet to actually program such programs and to actually understand them.
>>
>>57347417
You forgot to mention all those SQL injections that you haven't even discovered yet.
>>
Using gcc to compile my C programs on Windows.

How do I get it so when running the .exe on the cmd, it prints out the return value without using printf like it does for Python?
>>
>>57347425
True that. It's not hard. The only reason nobody does that is because it's useless and uncreative... l-like ... most pajeets.
>>
>>57347294
>>57347313
Lied and I feel bad about it. Good night folks
>>
>>57347486
wat
>>
Alright /g/ I need some help. I need to make c++ a program that draws a 2d shape's surface area with stars for example (a rectangle. input the length and width. 6 4. So the program outputs

******
******
******
******
. Where do I begin with the algorithm?
>>
>>57347491
Na. For me, I stopped doing this because I found a way to statically initialize string objects in arrays without using strlen.
>>
>>57347525
Nope pajeet. Post cuter anime girl and I might help you.
>>
>>57347545
Loops.
>>
>>57347545
allocate a 2d array of dimensions length and width, and then populate said array with stars.
>>
>>57347573
Why? He's just supposed to print them out, not actually having such an object in memory.
>>
>>57347545
What algorithm?
>>
>>57347596
oh, true

I just had a flashback to an assignment where I had to make a chessboard and do stuff with it, so it's the first thing that came to mind.
>>
Is there a way to replace the linux console by the pyhton one?
>>
>>57347486
what why would it print out the return value lmao
>>
>>57347830
Doing Project Euler questions with parameters in cmd.
>>
I have a question

will SICP make me good compared to other learning materials in 2016?
>>
>>57347810
Yes.
sudo nano /etc/passwd

find
user:x:1000:1000:Name,,,:/home/user:/bin/zsh

and replace
/bin/zsh
with
/usr/bin/python3


Dunno if it'll work tho
>>
>>57347840
So print the return value, with print. There is a difference between "return" and "print". That is the point of "return" and not "print". If you would like to see a value outputted during execution of the program use a function provided to "output".
>>
>>57347451
yeah this is just for a school project so i don't think i can be assed to do any of that shit. i'll just tell the other guys that a person's username and other data can't contain certain characters
>>
>>57347846
ye as long as you don't give up. slow and steady wins the race
>>
File: 1458497196026.png (29KB, 717x581px) Image search: [Google]
1458497196026.png
29KB, 717x581px
>>57347810
>>57347859
Holy shit, I just tried it out myself. I honestly can't believe it worked
>>
>>57347073

>mediafire

>you have to have an pro+ account to download enmass.

just put in on mega already.
>>
>>57347876
You make your fellow-pajeets proud, I think.
>>
>>57347937
indians are the most powerful race in the world
>>
Tcsh is shit?
>>
>>57347968
You mean, they shit on the streets because they are afraid of breaking the porcelain when they launch their power shits?
>>
>>57347009
I don't even know C, but holy shit you're dumb
 
int
foo(struct tree * t)
{
extern int arr[];
extern int index;

if (t != null)
{ arr[index++] = t->value;
foo(t->left);
foo(t->right);
}
}
>>
>>57348246
>random ass indentation
>>
>>57348246
>Horstmann

Well that's something I haven't seen in a long-ass time.
>>
>>57348376
>random
>>
>>57348388
its literally the best choice

for (whatever) {
code here...
}


is unreadable
>>
I've been using vim for years, but I recently got into spacemacs and I really like it!
I want to install it onto my mac shit laptop that my work forces me to use through brew, but all all key input when emacs is focused gets sent to the terminal I launched emacs from.
Does anyone know why this would happen?

>Your ban expired on december the 12th 2013
What year is it?
>>
>>57348388
>>57348394
>Horstmann
It's not. He indented the braces of the if statement arbitrarily, and then the block contents itself a level beyond that.
>>
File: openssl.jpg (76KB, 732x802px) Image search: [Google]
openssl.jpg
76KB, 732x802px
>>57348439

>Implying superior OpenSSL style isn't superior
>>
>>57348465
And not to mention he has no newline after the second curly brace. If it's not random, that's even worse.
>>
File: noooooo.jpg (23KB, 669x197px) Image search: [Google]
noooooo.jpg
23KB, 669x197px
>>57348478

Consider yourself triggered.
>>
>>57347310
>and a bit of bash scripting
Well there's your problem.
Unlearn bash and you might get your will to live back.
>>
>>57348465
i was on phone nigger
here's real code I do
coord
no_input(void)
{
extern direction way;
coord ct;

switch(way)
{ case up: ct = (coord) { snake[0]->y-1, snake[0]->x }; break;
case down: ct = (coord) { snake[0]->y+1, snake[0]->x }; break;
case left: ct = (coord) { snake[0]->y, snake[0]->x-1 }; break;
case right: ct = (coord) { snake[0]->y, snake[0]->x+1 }; break;
}

return ct;
}
>>
Please enjoy my code.

class Hello {

public static void main(String[] args) {

boolean hasGF;

while (hasGF) {
System.out.println("tfw no gf");
}
}
}
>>
>>57348505
ignore this, look at pic
>>
File: Untitledsafasg.png (4KB, 818x62px) Image search: [Google]
Untitledsafasg.png
4KB, 818x62px
Can anyone tell me what this means?
>>
>>57348534
>Uninitialised variable
Yes, a feelfag would be that stupid.
>>
>>57348545
You ignored the return value.
>>
>>57348491
They cannot be serious.

They cannot be fucking serious.

What kind of imbeciles are WORKING on this fucking piece of shit!?
>>
>>57348546
Default is false anyways, but probably should have initialized it.
>>
>>57348545
>Wunused-result

WOW what a supreme pain in the ass that would be

Please tell me this isn't the latest gcc
>>
>>57348546
Also:
while(true) print("false");


People just cannot code anymore.
>>
>>57348505
>>57348542
So you do Horstmann with the open brace Pico style? I actually can get behind that. Not my
personal choice, but I'm fine with most styles as long as it's consistent and doesn't waste vertical space. I actually usually do K&R.

>>57348534
>Uninitialized variable
>outputs no gf when hasGf would be true

>>57348491
Hooooly shit. Wow. That is awful. This has been running on millions of devices globally?
>>
>>57348590
I can't be fucked testing it, but I'm pretty sure java fails to compile if a variable might be uninitialised before it's used.
>>
>>57348572

Ericson. This runs just about every phone exchange in the country.

https://github.com/erlang/otp/blob/86d1fb0865193cce4e308baa6472885a81033f10/erts/epmd/src/epmd_cli.c#L147
>>
What do I need to get starting with simple embedded systems? (like what's a good line of cheap microcontrollers, and anything i might need with them) What's a ~good~ source of information on this?
>>
>>57348623
It does fail
>>
File: JUST.jpg (93KB, 792x612px) Image search: [Google]
JUST.jpg
93KB, 792x612px
>>57348478
>return type and function name on same line
>explicit casting
>a billion members in a struct
>>
>>57348534
how to not ruin your lame joke by being terrible at programming:

bool HasGF()
{
return false;
}
>>
File: rule30.webm (343KB, 736x384px) Image search: [Google]
rule30.webm
343KB, 736x384px
Implemented Rule 30 in Haskell for funsies
>>
>>57348624
Completely ignoring the fact that you should have your very own module dealing with IPv4 and IPv6 shit in a way that you DON'T have to deal with it ever single fucking time you want to establish a connection ... this makes me actually think that no one there is actually aware of how incompetent those programmers are.

Holy fuck.
>>
>>57348667
how
>>
>>57347927
>having to import sys every time just to navigate around
>>
>>57348673

It's surprising. A guy recently modified LLVM's fuzzer to work with Erlang and fuzzed bejesus out of the whole codebase. He also had to write patches for Valgrind to make it work with OTP. Out of the whole exercise he never found a single bug.
>>
>>57347237
>>global
>>ever
>I have never worked on a real piece of software in my life
>>
>>57348478

>Using #if 0 to just comment out all old code without ever removing it.
>>
>>57348736
>it's weel software so it has to be shit
>>
File: opensslwtf.jpg (98KB, 870x784px) Image search: [Google]
opensslwtf.jpg
98KB, 870x784px
>>57348478
>openssl

What the fuck am I looking at?
>>
>>57348689
>>57347927

yea, not sure why you would want to do this
>>
>>57348686
Recursion over a list to create tuples of neighbors, then applying the rule to each of them to generate the next iteration
>>
>>57342139
Shame the only options are just marginally better.
Linux API is shit too.
>>
Does passing NULL make a default argument go off in C++, or will it just make the parameter NULL?
>>
>>57348689
>>57348828
That's not the point. Any user who has python3 as a shell would probably be chrooted to a jail anyway.

To think of one just one possibility, it could used to get a portable beaglebone/raspberry pi calculator

If it doesn't have to be a shell, and can be any executable, then it could be used to preform a script whenever someone logs in, either to update someone or send an email, then it can open the real bash.

Instead of just updating someone, they can just write their own commands and parse it.
>>
>>57347009
int *flatten(node *n, int *A)
{
if (n) {
A = flatten(n->left, A);
*A++ = n->data;
return flatten(n->right, A);
} else
return A;
}
>>
>>57348993
Passing null is passing null (null usually just being a #define for 0 anyway).
Omitting the argument makes the parameter default.
void foo(char* string, int b=10){
return b;
}
int main(){
foo("hello"); //returns 10
foo("anon",0);//returns 0
foo("hello","anon");//error, second argument is not an int
}

Default arguments only do something when you omitt the argument.
>>
>>57349030
>>57348246
I figured out the problem, thanks. I just used a static variable.

Now the only problem is when I try to do the same thing but with a post order traversal, I get a segfault when I try to access the array after calling the post order function.
>>
data Tree a = Leaf | Node a (Tree a) (Tree a)
flatten Leaf = []
flatten (Node d t1 t2) = flatten t1 ++ [d] ++ flatten t2

>>57349071
>I just used a static variable.
Not a good thing.
I remember Kernighan's "Practice of programming" contained examples of tree traversal in orders in C. Go take a look.
>>
File: chess_screenshot.png (28KB, 632x606px) Image search: [Google]
chess_screenshot.png
28KB, 632x606px
>>57346388
making a little chess game
>>
were my lisp ppl @
>>
>>57349272
Are you 12 years old?
>>
>>57349007
I guess you could build your own pseudo bash by preloading a python script with variables
>>
>>57349245
What's wrong with static variables?
>>
File: fH80kCF.png (871KB, 650x4377px) Image search: [Google]
fH80kCF.png
871KB, 650x4377px
>>57349283
mayb
y u ask?
>>
>muh indentaion
>muh casing

you guys are retarded
i bet you write your waifu's names for your global vars.
>>
>>57349368
Stop typing like a literal retard, you fucking faggot.
>>
>>57349405
>oop fags
>>
>>57349361
They make your functions stateful. Which is always a bad idea because it hinders establishment of invariants and prevents useful ways of thinking about computation.
What is the use of a function that you can call only on one object?
>>
>>57349447
That has literally nothing to do with what I said, you illiterate fuck.
>>
>>57349472
I mean I'm just using it to see how many times the function is called...
>>
>>57349272
Lisp is love, but I agree with the other guy.
>>
just learning haskell
how do make a parameter have a default when not given?

in common lisp, one can do
(defun foo (&optional bar)
(whatever))


how to do in haskell?
>>
>>57349528
> just learning Haskell
Why would you ever do this?
>>
>>57349568
whats wrong with it?
>>
>>57348465
>He indented the braces of the if statement arbitrarily

So that makes it GNUmann
>>
>>57349592
> he is actually learning Haskell
Listen. Unless you're a professor at MIT, there is little to no reason to know Haskell
>>
>>57349604
how are you so sure about this, what about the fun one has?
>>
>>57349528
http://stackoverflow.com/a/7781350/721868

Looks like a pretty clean way to do it
>>
>>57349604
also, please tell me whats wrong with it, you seem to know alot about this, so tell me
>>
>>57349622
> fun

>>57349627
> what's wrong with it
Everything
>>
>>57349496
Well, I guess, then it's fine, unless you use many threads or handle signals.
>>57349528
There is no native way to omit a parameter (it makes type checking ugly). You may want to consider Ocaml if keyword and syntactically optional parameters are so important.
If you need the functionality but not the syntactic convenience, then Maybe monad is what you need.
>>
>>57349604
>>57349635
So what's your functional language of choice?
>>
>>57349635
thats not very specific
can you outline things which make the language a bad one
>>57349643
now that I think about it
haskell is more about equational reasoning
which is why it needs inputs every time
this makes me think that what I want can be ignored and a haskell like solution exists
>>
why is it programming attracts a bunch of anime weirdos?
>>
>>57349667
> he fell for the functional meme
Listen, I understand that there are some uses for recursive functions. But for heaven's Hell m8, any recursive function that can be optimized with tail call recursion is literally just compiled into iterative. Best just to use that.

For the 1% of functions that require recursion, use it then, but otherwise, don't use it at all

>>57349678
See above. Also it's worthless
>>
Should i continue learning python or just fuck it and move on to something else.
>>
>>57349694
I think it's just this shit hole that attracts anime weirdos
>>
>>57349719
so, fp is about recusion?
>>
File: dungeon.png (817KB, 2000x2000px) Image search: [Google]
dungeon.png
817KB, 2000x2000px
what do you guys think of the dungeons for my roguelike
i used cellular automata to generate it
>>
File: morphman.jpg (19KB, 334x302px) Image search: [Google]
morphman.jpg
19KB, 334x302px
>>57349719
what if i told you linear recursion *is* iteration
>>
>>57349719
Sure, bc that's how current architectures are. It's a cool way of looking at and solving problems, though, so it's fun to learn, anyway.

Plus, list comprehensions are dank.

>>57349733
As a CS major, trust me, they're everywhere in CS. I have to talk to furries on a daily basis ffs.
>>
>>57349719
Is functional a meme? At my shitty Java job every faggot has to show off how fucking functional they are by using fucking lambdas for every single goddamn line of code that could easily be done with a for loop but nope muh right arrows
>>
>>57349823
Glad I'm not in cs
>>
File: RREEREEEEEEEE.gif (2MB, 216x150px) Image search: [Google]
RREEREEEEEEEE.gif
2MB, 216x150px
>>57347207
>café in the bookstore meme
I have a closer comparison for ya
>be zuckerberg
>make a site for college kids to chat on
>site grows exponentially
>site turns into a general social media site rather than just for college students
>mfw uniboos start making irrelevant college posts on the Dank Nutshack Memes page under the guise of Facebook being a college website
>>
>>57349856
>>>/reddit/
>>
>>57349828
compare
for (int i = 0; i < size_that_you_had_to_declare; i++)
som_func_that_can_modify_or_not(arr[i]);


with
map f xs
or
mapM function_with_io xs
>>
>>57349272
>>57349368
>>57349447
(let ([your-moms-decision  (call/cc (lambda (k) k))])
(when (eq? your-moms-decision 'abort)
(displayln "shitposter aborted"))
(your-moms-decision 'abort))
>>
if (op.image.isAnime) = true
cout << "Block" << endl;
>>
>>57349900
jesus christ i'm gonna chunder
>>
>>57349872
That's a stale non-argument, Anon.
>>
>>57349883
I love watching your gay Lisp shit get fucking boned hard by 4chan's syntax highlighter. Suck it down, every drop. Owned.
>>
>>57349743
Looks pretty dope. What automaton did you use?

>>57349743
It's a common paradigm in functional languages. Basically the goal is to write code that has all the "side effects," e.g. I/O in one place.
Lots of math people like it because fp functions are usually more similar to math functions. f(x) = 2x + 3 returns a new value, and fp follows the same pattern. In contrast, in C, f(x) could change x in memory, which can cause bugs, etc.
>>
>>57349743
Do you want to get into semantics now?

>>57349772
That's what I said. It compiles to the same thing

>>57349823
Literally can be using any other language to do shitty recursive functions

>>57349828
Sometimes, it's really helpful to solve a particular problem. But most of the time imperative is better.

There are a few examples where recursion is needed and cannot be substituted for iteration, eg Ackermann function. And there are solutions that are much easier to think about recursively (see mergesort/i think quicksort too)

But most of the time you should be writing imperative
>>
itt, shit you hate about langs you're familiar with
>common lisp
>(mapcar (lambda (x) (blah))
>instead of (mapcar (\x (blah))
>packaging system is fucknuts and gets in the way at first (if you don't know about it, but you have to read like 50 pages worth to understand it)

>haskell
>no ternaries
>io creeps into your code even though they usually say that "io is contained"
>won't get me a job
>ghc is 1 fucking gigabyte
>not expressive enough in its standard form (you need lenses and monad fuckeries to be able to program something a worth)
>binaries are bigger than 1.5mb guaranteed
>no decent tui libraries (brick library makes binaries bigger than 8mb, guaranteed, WTF)
>>
>>57349883
>call/cc
REEEEEEEEEEEE
>>
>>57349944
>dude, fp is about recursion lmao
>yeah, ignore
>making functions first class
>partial application
>function composition
>pattern matching
>monads
>abstracting patterns
>useful features like equational reasoning or referential transparency
>but its all about recursion lamo

don't share your opinions anymore
>>
>>57349944
>That's what I said. It compiles to the same thing
Ok good. Then why is an imperative loop better than linear recursion?
>>
>>57349928
So they want y = f(x); over f(x,y); ?
If so, how do you deal with multiple outputs?
>>
>>57349964
I write a fair amount of utilities at work in Haskell
Binary Bloat is a fact of life, a couple larger libraries and it's gonna be 8MB+ at minimum
I don't consider it a significant problem though, hasn't really caused any headaches for me

Two realities of Haskell life for me have been
1) Learning a new library's idiosyncratic ways of usage
Both a downside and an upside to the expressive power of Haskell, there's very little uniformity in how libraries approach situations, making for a lot of learning
Not to mention all the bespoke, artisanal monads which in turn end up with you having to lift a bunch of your IO actions into that monad (or, god forbid, mixing two different library's special sauce monads)
2) Wrangling laziness
Oh, whoops, your program is now eating a gibibyte of RAM because that one little change you made to a function made it fully consume all of the datastream at once before it could go the next stage of the pipeline
On the upside, making a program that can process at large file and do it in only a few megabyte of RAM without having to explicitly do it chunk by chunk as you would in other languages is really quite cool
3) Confusingly Over Eager Concurrency?
I'm not sure if you've met with this one, but it's strange enough that I'd like to mention it
Sometimes asking the compiler to go threaded and use as many cores as it finds (for the sake of some usually small aspect where you need that concurrent spice) ends up with the whole program going slower because now it's something mangled a fundamentally single threaded set of operations into some frankenstein of concurrent machinations
>>
>>57350065
pairs (similar to python tuples)
f (x,y) = (x+y, x-y)
>>
File: output.webm (3MB, 280x497px) Image search: [Google]
output.webm
3MB, 280x497px
Do you think I will be able to make any money out of this shitty game /g/?

it has non-annoying ads (only banners only on pause and game-over screen), Also I will sell "remove ads" for $0.99.

Any tips?
>>
>>57349944
> There are a few examples where recursion is needed and cannot be substituted for iteration
Dude do you not know what a stack is? Any recursion can be done iteratively, and vice versa.

>>57350065
You return a data structure, such as a list or a tuple. It takes more memory, but the compiler can optimize it away well enough that performance is similar.
>>
>>57350128
no anime hotties
no buy
>>
>>57350138
this
next time have anime hotties
>>
>>57350128
>>57350138
Consider adding anime hotties as the player character
>>
File: 1460684113123.jpg (96KB, 698x667px) Image search: [Google]
1460684113123.jpg
96KB, 698x667px
>>57350141
>>57350138
Great idea guys, I think I will be drawing an anime hottie, a qt little girl that will sell the space-ships and items at the game store.
>>
>>57350130
>Any recursion can be done iteratively
An important asterisk to this is that the iterative implementation of a recursive operation is not always obvious.

Check out Leslie Lamport's excellent talk, "Thinking for Programmers"
https://channel9.msdn.com/Events/Build/2014/3-642
Around the 35 minute mark, he goes into a discussion about making an iterative version of the famous recursive Quick Sort we're all familiar with
>>
File: mscat29.jpg (102KB, 800x569px) Image search: [Google]
mscat29.jpg
102KB, 800x569px
>>57350160
Can't go wrong with a cat!
>>
>>57350108
tell me about those utilities
also, isn't concurrency supposed to make it faster?
wtf
>>
File: asfasfgh.png (5KB, 970x317px) Image search: [Google]
asfasfgh.png
5KB, 970x317px
the fuck does this mean?
>>
>>57346388
Damn, i finally read that doujin.

I think i might be gay.
>>
File: Capture.png (44KB, 753x428px) Image search: [Google]
Capture.png
44KB, 753x428px
>>57346388
I've been making a shitty roguelike that runs in browser dev consoles.

I've just hit sort of a creative dead end trying to think of more features or interesting items to add.
>>
>>57350508
make it an hgame
>>
>>57349921
(let ([your-moms-decision  (call/cc (lambda (k) k))])
(when (eq? your-moms-decision (quote abort))
(displayln "shitposter aborted"))
(your-moms-decision (quote abort)))
>>
>>57350356
Assert in malloc.c fired.
The conditions were somehow met and the program was aborted.
>>
>>57349967
Don't worry, Anon. I have protection.
http://stackoverflow.com/questions/29838344/what-exactly-is-a-continuation-prompt/29838823#29838823
>>
File: Capture2.png (25KB, 460x721px) Image search: [Google]
Capture2.png
25KB, 460x721px
>>57350549
Monospace text has its limits, anon.
>>
https://hackage.haskell.org/package/transformers-0.5.2.0/docs/Control-Monad-Trans-Cont.html
>>
>>57350364
>please stick it in my ass
>sticks it in his ass
>you stuck it in my ass!
lmao, every single time without fail
>>
Currently working on developing an algorithm for class. The algorithm is supposed to comeup with a n log n way of making the union of multiple arrays of strings
>>
>>57350674
Where N is?
>>
File: (You).png (403KB, 521x520px) Image search: [Google]
(You).png
403KB, 521x520px
>>57350677
>>
>>57350677
that's what i was thinking about too the prof left it kind of ambiguous i'm guessing they meant it was the total number of strings from each array
>>
>>57350684
Seriously anon?
>>
File: 1473616416748 (1).jpg (688KB, 1181x1748px) Image search: [Google]
1473616416748 (1).jpg
688KB, 1181x1748px
>>57350703
no sorry that was rude
>>
>>57350674
so uh...do the log n algorithm n times...as in...line by line...

come on, anon...
>>
>>57350674
>Add all of the strings to binary tree (ignoring duplicates, if found)
>Read the strings out of the binary tree
>n log(n)
>>
>>57350728
>binary tree
I should probably be a little more specific, thinking about it.
An ordered binary tree. Preferably one with some height balancing.
>>
>>57350721
The internet is saying that a merge sort is a O( n log n ) algorithm. Give that a try. The internet also said that you don't want to do it using a loop because stack exchange overlord pajeet nord said so. That you want to do it recursively.

I would recommend ignore them since the loop ends up the same anyway. But, really, it all depends on how hard you want to fit in.
>>
>>57350728
>>57350728
>>57350734
We're supposed to do it without additional data structures.
>>
>>57350728
>>57350734
Why even use a stupid ass datastructure for stupid nerds who don't care about performance when you want to construct an algorithm that optimizes for execution speed?
>>
>>57350739
I was looking at modifying a mergesort and then ignoring duplicates, but it's just weird because I don't know how many arrays of strings i have so i don't know how to set up the actual pseudocode.

for example

for i =0 to n// but it is unclear if this is the number of arrays or total number of strings within all the arrays. I guess i'm juust going to ask for additional information tomorrow.
>>
>>57350740
Algorithms and data structures go hand-in-hand.
Banning the use of data structures is inane.

If the arrays are sorted (which I was assuming wasn't the case before), you could just merge them, like you would in mergesort, but check for duplicates.
>>
>>57350768
I didn't assign the problem. I just have to figure it out breh.

What if sort using merge and then merge again over all of them? would that work? or would the time complexity be higher?

Sorry but I'm really new to actually analyzing algorithms.
>>
>>57350791
>What if sort using merge and then merge again over all of them? would that work?
Probably.
>or would the time complexity be higher?
It would be O(n log(n) + n).
"n log(n)" for the sort and "n" for the merge.
However, since we only care about the most significant term with algorithm complexity, it would still be O(n log(n)).
>>
>>57350805
Ok i'm gonna just get started using that thanks for the help m8
>>
What's the point of developing algorithms from the perspective of the kind of complexity anon has here?
It doesn't make things fast or faster compared to finding a good solution that fits the device.
So why?
>>
>>57350128

To be honest, I'd rather just pirate touhou for free and play it on my laptop. Those graphics look pretty terrible, and there's not enough bullets on the screen.

>>57350356

You have corrupted memory, probably some sort of private data used by the malloc and free functions.
>>
>>57351132
>pirate touhou for free
There's a paid version of touhou?
>>
>>57351136

I'm pretty sure Zun never gave out any of the games for free. There's a reason the man is able to consistently afford beer. It's all of those Japanese people paying for the game.
>>
>>57351212
>tfw you donate to a developer and he destroy his brain with alcohol
>>
>autistic trigger warning

How much do Java people care about styling/is the default styling in Eclipse "standard"? I'm doing something with NDK and the Java part is triggering me to no end.
>>
File: oneslowgtp.jpg (102KB, 500x1200px) Image search: [Google]
oneslowgtp.jpg
102KB, 500x1200px
>>57346503
>>
Has anyone tried using a 21:9 monitor for programming?
>>
amb in python
rate
class Amb(object):
def __init__(self, *args):
self.vals = args

def combine(left, arrays):
if left == len(arrays):
return [[]]
ret = []
for i in range(len(arrays[left])):
elt = arrays[left][i]
old = combine(left+1, arrays)
for res in old:
ret.append(res + [elt])
return ret

def require(test, *args):
arrays = []
for var in args:
arrays.append(var.vals)
combs = combine(0, arrays)
candidates = []
for i in combs:
candidate = i[::-1]
if test(candidate):
candidates.append(candidate)
return candidates

def test(sentence):
prev = sentence[0]
for i in range(1,len(sentence)):
word = sentence[i]
if word[0] != prev[-1]:
return False
prev = word
return True

def pythagorean_triple(triple):
return triple[0]**2 + triple[1]**2 == triple[2]**2

def print_triples():
for i in require(pythagorean_triple, Amb(1,2,3,4,5,6,7,8,9,10), Amb(1,2,3,4,5,6,7,8,9,10), Amb(1,2,3,4,5,6,7,8,9,10)):
print i

print_triples()
>>
File: s.jpg (33KB, 600x552px) Image search: [Google]
s.jpg
33KB, 600x552px
How's the gf situation, lads?
>>
>>57351913
>>>/r9k/
>>
So is C++ just a bloated version of C?
>>
>>57351942
C is a deprecated version of C++ for people who can't master a richer language.
>>
>>57351932
I'll that as a not so good.

Me neither, anon.
>>
File: 20161102_065115.jpg (323KB, 1732x974px) Image search: [Google]
20161102_065115.jpg
323KB, 1732x974px
>>57351699
>tried

I use one now, I don't see why it would be a source of contention.

It's pretty nice, I've got a 35" 3440x1440 monitor, with a secondary at 1920x1080.

Good for games, too.

Pic related is my setup at work, though. Main VS window on left, 1-2 pages code tiled in center, documentation and Stack Overflow™ on right.

>>57351913
This isn't even tangentially related to programming, or even /g/.
>>
File: 9512428.jpg (52KB, 500x500px) Image search: [Google]
9512428.jpg
52KB, 500x500px
>This isn't even tangentially related to programming, or even /g/.
Sorry for taking an interest in your lives. I'm sorry I even asked.
>>
Are most GUIs made using qt? I don't think i've ever seen any other relevant framework for GUIs, besides the one for microsoft applications.
>>
>>57351987
Pretty much yeah, but these days all the beginners are doing web apps with the JS framework of the week.
>>
>>57351987
Most GUIs for Linux specifically?

Lots of GTK there, I believe.
>>
File: br.gif (994KB, 200x200px) Image search: [Google]
br.gif
994KB, 200x200px
>>57351913
>>
ALERT

GitHub Game Jam has begun! Theme is hacking, modding and/or augmenting.

https://github.com/blog/2274-game-off-theme-announcement
>>
>>57351994
Well, not specifically for linux, in general really. Most things that are not from microsoft are usually cross platform anyway.
>>
File: 9000 hours in mspaint.png (162KB, 360x544px) Image search: [Google]
9000 hours in mspaint.png
162KB, 360x544px
>>57351956
>>
>>57351995
>that spider has touched more tits than you
>>
>>57351995
she's lucky the T didn't kick hair, mine would
>>
>>57352002
If you're talking about "most GUIs" from a pure market share perspective, it's a combination of WinForms and WPF.

Windows has the lion's share of the overall OS market share, and there are an uncountable number of programs written with regular windows forms GUIs, within and outside of the enterprise.

For example, a popular RMM tool that IT companies use (LabTech) runs a combination of WinForms and WPF for it's technician client, and each company that uses it manages thousands and thousands of computers that have an agent that utilizes WinForms.
>>
>>57351987
pretty sure GTK+ has been more used
>>
File: 1443505857806.jpg (64KB, 584x759px) Image search: [Google]
1443505857806.jpg
64KB, 584x759px
Hey math nerds, is it possible to get the slope of a line from its angle in degrees, and if so what's the formula?
I've read it's just taking the tangent of the angle, but when I calculate the slope with (y1-y0)/(x1-x0), it's usually not in the bounds of a tangent, and even if it is it's not even close to the calculated slope.
>>
>>57352041
Obviously, I'm leaving out web-based GUIs in this post, before anyone spergs out.

The most common GUI used on a daily basis would be something built upon web technology.
>>
File: 2841733072_7d51a3b5b1.jpg (93KB, 500x400px) Image search: [Google]
2841733072_7d51a3b5b1.jpg
93KB, 500x400px
>>57352019
>She touched that spider more than me.
>>57352026
G. pulchra are known to be less hair-flicky, than other new world cuties.
>>57352047
Tangent is a surjective function with signature R - {pi*k/2 | integer k} -> R. About what bounds are you talking?
Also, don't forget to check, if your tan function takes degrees or radians.
>>
>>57352071
pi*(2k+1)/2 fix
>>
>>57351956
That's a nice setup senpai. I use an 16:9 monitor and a laptop at work. It gets the job done.
I currently use a 16:9 and 4:3 monitor at home, but I was thinking on replacing both of them with a single 21:9 monitor.
>>
>>57351951
>richer
No, bloated fits perfectly.
>>
File: sicppatt.jpg (66KB, 800x534px) Image search: [Google]
sicppatt.jpg
66KB, 800x534px
/dpt/-chan, daisuki~

>>57352041
You should not underestimate how java awt and spring are being/have been used by the industry.

>>57351987
>>57351994
>>57352044
>>57352048
On archlinux,

gtk2 is required by 321 packages
gtk3 is required by 283 packages

total 604

qt4 is required by 152 packages
qt5-base is required by 169 packages

total 321

>>57351942
No

>>57347846
Yes but decent alternatives do exist.

>>57346388
Thank you for using an anime image.
>>
>>57352117
Thanks.

Yeah, don't do that. Even if you have a massive nice monitor, you still want a secondary.

Some things just really like to be fullscreen, and it's easier to work with two monitors overall.
>>
>>57352124
Fuck off op.
>>
File: Untitled.png (49KB, 251x925px) Image search: [Google]
Untitled.png
49KB, 251x925px
>>57352071
I'm passing my degrees in radians to cmath's tan(), which takes an angle in radians.
I just don't know what the fuck I'm calculating anymore.
>>
>>57352145
show a diagram
>>
>>57352150
Of what?
>>
>>57352145
I don't know either. Your angles (less 180, more 90) point to the second quadrant, so slopes should be negative at all.
>>
dumb animeNEETs
>>
>>57352134
I thought so.
I do like my dual monitor setup, but I don't like the secondary 4:3 monitor. I guess I'll swap that one out with a 16:9 monitor in portrait if we have a surplus at work.
I tried taking a picture of my work setup, but it's an open office so it's hard not to capture confidential shit.
>>
File: coder rage.jpg (130KB, 1024x740px) Image search: [Google]
coder rage.jpg
130KB, 1024x740px
World, why are you so cruel? Good, nice and great technologies emerge faster than I can learn them. I have too many options to use any one of them. And even if I can decide which one to use — I can't do it right now, because new is not mature enough. I'm willing to wait until it is ready for production, but I have to do my work right now. I have to use tools that are worse than tools that are already there.
This drives me nuts. I want to abandon my job. But programming is too good to live without it. I am mad. I am damned. I feel that I'll eventually become a lunatic like Terry A. Davis or worse.
Fuck! Fuck fuck fuckfuck!
>>
>>57352250
>Terry
>a lunatic
excuse me?
>>
File: 41234317284.jpg (16KB, 400x300px) Image search: [Google]
41234317284.jpg
16KB, 400x300px
>simple hello world-like for ndk
>don't change anything at all while doing this
>compile a few times and it works
>suddenly compile and doesn't work
>error with command: ... unknown reason
>compile again and it works
>repeat
I genuinely hope eclipse devs die violently
>>
>>57352250
>not spending your days prototyping neat things with new technologies while never actually delivering a finished product but it's good enough for your manager to keep their manager happy so you basically have a blank check to just play in a veritable technological sandbox all day at work which helps to fill the gap left by your increasing disconnect with society that spawned from your slow mental separation of what's deemed socially acceptable and this caused you do alienate yourself but you have alcohol and a nice apartment and you travel sometimes and your cat likes to sleep in your lap but he's going on 12 so you wonder what it would be like to have no cat or if you want to go through the anguish of losing yet another proxy of affection in your life
>>
>>57352266
He is mentally ill. It is a known fact.
>>
>>57352305
>>>/cia/
>>
>>57352266
>"People" think Terry Davis is anything more than a shitty 8gag meme that went out of control
>>
>>57352285
This is a longest sentence I've read today. Thank you.
>>
/dpt/ is so slow nowadays
>>
>>57352425
How many times have we gone over this?

It's morning in freedom land. The thread picks up as us burgers begin to roll out of bed.
>>
>>57352425
Fucking NEET
>>
>>57352425
Your mother's slow brah
>>
>>57352425
in spite of it being slow, it's full of r9k and pol shit stains posting their irrelevant outbursts of emotion

imagine if those were gone, it'd be even slower, which isn't necessarily a bad thing
>>
>>57352472
>r9k and pol shit stains
They're the best posters desu.
>>
>>57352425
blame discord
>>
I am pulling this JSON file into my android app: https://localbitcoins.com/bitcoinaverage/ticker-all-currencies/

I want to get the value of GPB>rates>last as a double.
How can I access it using, for example, JSOObject?
https://developer.android.com/reference/org/json/JSONObject.html
>>
>>57352532
Discord and dead and doesn't talk about programming anyway.
>>
>>57352520
Yeah, gotta stick up for the underage neo-4chan "dank memer" crowd.
>>
>>57352433
>sleeping at night and not coding and browsing 4chin
do amerifags really do this?
>>
>>57352472
Objection! My outburst of emotion was relevant to programming. Abundance of half-ready tools makes my soul bleed.
>>
>>57352561
I program and browse 4chan during the day at work, so I can get paid to do it.
>>
File: Capture.png (61KB, 1242x299px) Image search: [Google]
Capture.png
61KB, 1242x299px
I just saw one of my programs do something truly beautiful.
I made an algorithm which could decide what cellular automata patterns were interesting and not interesting, and the pattern that would give the maximum "interesting" value would be if the board was cleanly divided between black and white.

While it does not happen consistently, the very first time I ran the program with certain parameters, it seemed to quite elegantly yet chaotically find that state.
>>
>>57352613
Whoops, wrong image!
>>
>>57352595
>4chan during the day at work
>at work
>work
kek, there still people who waste their life with a job?
>>
Are there any rust coders? What is an idiomatic way to chain Options or Results? Haskell has do-notation, what about Rust?
>>
>>57352629
Suit yourself.

I work less than 30 hours a week, take vacations when I want to, and enjoy what I do. I've got enough money to buy lots of nice things and travel often.

Everyone likes different things and has different lifestyle preferences. I think this whole "you're either NEET or a slave" thing is actually pretty interesting, because I can't imagine how such a mental dichotomy could be formed.
>>
>>57352674
NEETs trying to justify not having money.
>>
>>57352674
how much is your annual income?
>>
>>57352691
>>57352674
I suppose it's understandable from a "coping" standpoint.

If you buy something, there's a common phenomenon that causes post-purchase justification, where the purchaser claims the product is good and has the expected value, regardless of its deficiencies.

Similarly, someone in a particular situation has an easy way to cope and discard other possible situations: lash out and insult them. It's extremely easy and satisfying to justify your life choices by saying
>Well those people with jobs are slaves and they hate their life anyway!
and even to go further by taking some sort of awkwardly justified moral high ground, claiming that working for a corporation is morally wrong.

On the flip side, someone who is employed could say
>Well those NEETs can't even buy a new Audi so they surely can't be happy with their life!
even though there are plenty of unemployed folks on benefits that are perfectly happy with their situation.

Any way, I think there's many facets of the issue, and there certainly are many unhappy people, whether they're employed, in school, or NEET.

Luckily, some programming jobs allow you to maintain a NEET-like life with a few commutes during the week, which is right up my alley.
>>
>>57352729
I am around the ~97th income percentile in relation to my country, age, and gender.
>>
>>57352613
Ran another few dozen tests, and I saw it do the same again.
It's rare, but sometimes it manages to make the perfect form for maximum interestingness score.
>>
When will I be able to program my own robot trap gf?
>>
NEW

>>57352823

>>57352823

>>57352823

>>57352823
>>
File: hplchln.gif (906KB, 500x375px) Image search: [Google]
hplchln.gif
906KB, 500x375px
>>57352777
i hoped for a more precise number. social welfares of my country give me 15 386 €/years + social health care (dental included) + retirement plan.
>tfw living in western europe
Thread posts: 318
Thread images: 50


[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.