[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: 46

File: 1472109979150.jpg (19KB, 499x499px) Image search: [Google]
1472109979150.jpg
19KB, 499x499px
Previous thread: >>56288576

What are you working on, /g/?
>>
>>56295464
Trap aesthetics
>>
>>56295464

computer generated antics using a banter engine
>>
>>56295464
Thank you for not using an anime image
>>
a full-fledged game is mostly about the story, art and content in general, the engine can only help with rendering and physics and such, especially for simple 2d and 2.5d games you really don't need to use a pre-built game engine
>>
>>56295464
writing a linear lisp compiler ala http://home.pipeline.com/~hbaker1/ForthStack.html
>>
asyncio & python, why?

>'_UnixSelectorEventLoop' object has no attribute 'create_task'
>>
File: 1444452276554.jpg (57KB, 567x561px) Image search: [Google]
1444452276554.jpg
57KB, 567x561px
>>56295654
...aaaaaand that's why you're a NEET instead of a game developer
>>
>>56295763
Nvm, fixed it.
>>
>>56295804
lol k tard, you think the game engine is some magic black box, you don't know how simple (and poorly designed in the case of unity) the programming behind it actually is
>>
>>56295834
You have to be 18 to post here

Based on your propensity to lie in the last thread, you're clearly underage
>>
>>56295883
i haven't lied you delusional fucking faggot, but yeah i'd be better off just closing this thread because you insufferable faggots are just a waste of time
>>
>>56295905
>i haven't lied
Then show me your amazing greenlit game that you made all by yourself without using a third party engine.
>>
>>56295924
that anon wasn't me and even if it was me i wouldn't dox myself just to prove some shitty 4chan fag wrong
>>
>>56295935
Why are you so angry?
>>
>>56295985
why are you so passive aggressive?
>>
What's the ultimate book on C++ for someone who isn't a complete tard?

I found C++ For Everyone as well as Accelerated C++ on the wiki, which is best?
>>
trash here
how do I print my output from a loop in a single line?

I'm writing a clock in C that counts up to 24 hours and then adds 1 day which I will use for something else, but I want the hours, minutes and seconds to keep increasing in a single line.
>>
>>56296348
http://www.stroustrup.com/4th.html
>>
>>56296353
you can try to send a "clear" command to the system using
system("clear");

that will clear the whole screen and lets you overwrite it.
For more sophisticated programs you could use ncurses, which is a library for creating text-based GUIs in the terminal
>>
>>56296353
Something like this, maybe, not sure if it's the best way to do it.
for(whatever)
{
printf("%d-%d-%d\r", hour, minute, second);
}
>>
>>56295816
Kill yourself
>>
>>56296457
ty
That's for windows right?
and I assume ncurses would work on linux as well right?

>>56296465
ty as well
>>
>>56296489
"clear" is for linux, i'm not sure about windows, if clear doesn't work, try "cls".

ncurses in linux only afaik, but might work on windows with MinGW.
>>
why isn't there anime in the op
>>
>>56296555
because your timing sucks
>>
>>56296353
>how do I print my output from a loop in a single line?

'\r'
>>
What book for learning C
>>
File: 9780393979503.jpg (22KB, 372x400px) Image search: [Google]
9780393979503.jpg
22KB, 372x400px
>>56296720
>>
>>56296720

K&R.
>>
>>56296457
>Recommending stupid non-standard shit
>>
>>56296720
>>
Recommend me a language to learn, I can only write C and C++
>>
if i don't have any experience, should i not even have an experience section on my resume? i feel stupid putting "Lifeguarding" in there. what about using my former lifeguard boss as a recommendation though?
>>
>>56296807
()
>>
>>56296816
you can mention the lifeguarding and use him as a recommendation but also talk about your programming experience (even if you haven't had a programming job) like which languages you know and what you did to learn them, which projects you've worked on
>>
>>56296828
So... lisp?
>>
>>56296777
>Just nagging on answers, instead of complementing them.
hard work anon, you should take a break from time to time, you earned it.
>>
>>56296816
Put your programming projects there, that's what I'm doing right now.
>>
>>56296859
Other people have already posted the correct answer. There is no need to do it again.
>>
>>56296816
>if i don't have any experience, should i not even have an experience section on my resume?

Yeah. If you're applying to tech jobs, leave out all non-tech stuff.

I've seen resumes of recent grads where they try to talk stuff up. One guy listed his time as a bouncer as having learned people skills. Nope. It was *only* a negative in my book.

I only want to see internships and relevant experience. If you have zero experience at all, maybe try some open source contributions and list that.
>>
>>56296816
Work experience and job-relevant experience can be separate. Especially if you're a burger flipper programming on the side.

Talk about your job-relevant side projects under a Technical Experience section. If any were paid projects, be sure to note it.
>>
>>56296807
Racket or Common Lisp.
>>
>>56296885
sure, if they clumsily try to talk up their own competence as being more than it actually is then that's a negative, but you can still mention your previous work experience
>>
>>56296781
>>56296767
Memes
>>56296741
Thanks!
>>
Microsoft's build system for its .NET command line utilities and powershell are fucked. They depend upon .NET themselves, so require downloading a previous version, running that, and using it to build the next version. Unfortunately, this makes it impossible to built the command line utilities on ARM because they don't have native binaries already existing on ARM. Or, well... it's possible to build just the CoreCLR, but they don't integrate this shit well. There's no make install to just put shit into some standard locations in the $PATH and forget about it.

How the hell is Microsoft completely incapable of making a decent build system?
>>
>>56297167
It's all Pajeet-tier anyway.
>>
Why is Haskell's IRC channel so much more helpful than that of any other language?

I mean, there is no time of the day where you can't get an expert level answer to your questions within seconds by asking there. It's pretty crazy.
>>
>>56297296
>there is no time of the day where you can't get an expert level answer to your questions within seconds
Because they are unemployed.
>>
>>56297296
Racket's IRC channel is also pretty nice. A lot of the people who idle there work on the language itself, so the responses are as expert as can be.
>>
File: comedy gold.jpg (11KB, 228x221px) Image search: [Google]
comedy gold.jpg
11KB, 228x221px
>>56297319
kek'd
>>
>>56296807

python because you'll find for many projects it allows you to get them working very quickly

also you can into the internet with python very easily
>>
File: 1471106124296.png (919KB, 960x1440px) Image search: [Google]
1471106124296.png
919KB, 960x1440px
>>56295509
This is an anime site wtf are you doing here post code or stfu.
>>
File: ss+(2016-08-28+at+02.49.02).png (5KB, 467x112px) Image search: [Google]
ss+(2016-08-28+at+02.49.02).png
5KB, 467x112px
It's not possible to do this ?
VS says that the expression must have a constant value
>>
So I have a Python script that reads a stream of Unicode messages and passes them to another protocol whose client only supports ASCII. How should I go about converting the string while simply dropping anything above ASCII?
>>
File: waht.png (393KB, 587x438px) Image search: [Google]
waht.png
393KB, 587x438px
>50 years from now we will have programmed God

This shit blows my damn mind
>>
>>56297486
nothing has changed since 1970, majority still program in a C-like way
don't count on it
>>
>>56297440
is it because you're doing int table[4] = {1, 2, 3}, 3 things in the array and tablecopy[4] = {1}, 1 thing in the array?
>>
>>56297500
No, C will fill the array with 0
>>
from the other thread
i was stuck on recursion
well i fucked it off and realised i can iterate everything better
fuck recursion
if you use it fuck you
>>
So I'm new to C, and I have a problem. How do I check if an element of a char * vector is null ? I though that something like
*p[0] == NULL || !*p[0] || *p[0] == '\0'

would suffice but apparently its not.
>>
>>56297516
>The birth of a haskell-hater.
>>
>>56297453
>he still doesn't know how to copy-paste everything from stackoverflow
lmaoing @ ur life

http://stackoverflow.com/questions/2365411/python-convert-unicode-to-ascii-without-errors
>>
File: smug anime girl (2).jpg (97KB, 865x720px) Image search: [Google]
smug anime girl (2).jpg
97KB, 865x720px
>>56297516
>i'm stupid
>fuck you
>>
>>56297516
Tail calls are the purest form of iteration. The two are not necessarily mutually exclusive.
>>
>>56297516
u retarded m8?
>>
>>56297516
t. Pajeet
>>
>>56297516
C style for loops are disgusting
>>
Sometimes I like to post progress in dpt to keep me motivated. It especially works when people reply or are interested in what I'm making....but I feel kinda guilty at times doing it since it makes me feel like I'm blogging.
>>
>>56297516
what kind of recursion
>>
>>56297541
 if (strcmp(*p[0], "") == 0) 
>>
>>56297627
i was doing the quicksort algorithm
>>
>>56297623
Nice blog there newfriend, but where do I upvote It? Anyway, I'm Anxiously waiting for your Patreon.
+1
>>
>>56297640
that's not exactly what i mean but ok, how the fuck is it harder to do quicksort with recursion than iteration?

the algorithm is naturally recursive
>>
Does the C++ standard library have a built in function for comparing if floats or doubles are equal with margin of error? I just want to use the standard implementation if it exists
>>
>>56297650
exactly
>>
>>56297623
Well at the beginning of the thread we could've used some programming related posts to stop the derailing. And the OPs are traditionally asking: "what are you working on?" so it's completely valid to post programming progress.
>>
>>56297516

You learned something today. Good job.
>>
>>56297677
no, your blog is shit
even >>56297623 is better
>>
>>56297541
>
!*p[0] || *p[0] == '\0'

These two
>>
>>56297719
Okay. I'll continue shitposting elsewhere.
>>
Are there any decent COBOL IDEs?
I just started working at a new company and they dropped the bombshell that they make their web applications in COBOL.
>>
>>56297677
>IT
IT is shit
>>
>>56297677

IT = Technician
> noun
> 1. a person employed to look after technical equipment or do practical work in a laboratory.

you fucking hapa cuck memekid shitboi hack excuse of a pajeet nigger
>>
>>56297296
#rust is great, too.
>>
File: C# devs.jpg (786KB, 1200x800px) Image search: [Google]
C# devs.jpg
786KB, 1200x800px
>>56297167
>>
>>56297673
can't you just do
f1 > f2 - margin && f1 < f2 + margin
?
>>
>>56297791
The fuck are they burning, that's cow's poop?
>>
>>56297673
There's not really a constant uncertainty. For instance, the uncertainty of A+B is the uncertainty of A + the uncertainty of B.
>>
>>56297650
he's retarded is why
>>
File: Disgaea_4u.jpg (299KB, 935x529px) Image search: [Google]
Disgaea_4u.jpg
299KB, 935x529px
One of my classes is getting pretty big, currently is 607 LOC, d-doshio.
>>
>>56295464
I was fucking around with the linux framebuffer and then realized why nobody uses it.
>>
>>56297812
>that's cow's poop?
yep
>>
>>56297802
>>56297820
I mean, you have to choose the degree the two numbers can be different anyway
if you want them to be equal to the second number after the decimal point you'd use 0.01 as the margin. if you need them to be closer to equal, use a smaller number
>>
>>56297791
*takes a big sniff of the air*
Ahhhh....
>>
>>56297874
LOC or SLOC?
>>
>>56295464
for (int i = 0, j = n; i  < n; i++) {
printf("%d", a[i][j]);
j--;
}

Would this work at all? I want j to decrement at the same rate that i is incrementing.
>>
>>56297999
ye
you can even place it next to the i++ after a comma
for (... ; ... ; i++, j++)
>>
>>56297999
why not
for (int i=0,j=n; i<n; i++,j--) {
printf("%d", a[i][j]);
}
>>
>>56298025
>>56298029
Thanks familias.
>>
>>56297951
Isn't the same?
>>
File: 1465667475406.jpg (154KB, 540x936px) Image search: [Google]
1465667475406.jpg
154KB, 540x936px
>>56298029
>no spaces around compound operators
>>
can someone help me with a matlab problem?
>>
>>56297802
>>56297820
>>56297909
I was wondering if there was a function that you could give the margin yourself. Of course it is trivial to implement, I just thought it would have made for cleaner code.

Anyway, I've got an actual problem now. I've made a struct for handling vectors on a 2d plane and I've overridden some operators. I try to use const wherever possible, but now I'm getting an error: 'passing "const PlaneVector" asd "this" argument discards qualifiers'

// header
struct PlaneVector {
float x, y;

const PlaneVector operator+(const PlaneVector other);
const PlaneVector operator+(const AngledVector other);
const PlaneVector operator-(const PlaneVector other);
const PlaneVector operator-(const AngledVector other);
// omitted most irrelevant declarations;
};

// source (only the relevant function)
const PlaneVector PlaneVector::operator- (const PlaneVector other) {
return const PlaneVector{x - other.x, y - other.y};
}

// function that is causing this error
bool linesIntersect(const PlaneVector apos1, const PlaneVector apos2,
const PlaneVector bpos1, const PlaneVector bpos2) {
PlaneVector segment1 = apos2 - apos1; // ERROR!
PlaneVector segment2 = bpos2 - bpos1; // ERROR!

float delta = segment2.x * segment1.y - segment2.y * segment1.x;
// etc etc.
}

I should only be reading from those parameters, not writing to them, what am I doing wrong?
>>
>>56298097
from wikipad
Lines of Code (LOC)
Auch Physische Lines of Code genannt. Anzahl Zeilen inklusive Leerzeilen und Kommentare. In obigem Beispiel 7. Wird oft stellvertretend für eine der anderen Berechnungsarten genannt.
Source Lines of Code (SLOC)
Anzahl der Codezeilen ohne Leerzeilen und Kommentare. In obigem Beispiel 5.


>>56298112
>takes two hands to carr a cub
>doesn't lift pinky while drinking
you're in no position to talk yuri-relief character
>>
>>56297732
>>56297628
Well, I tried both but I keep getting errors. Just gonna post the whole code.

#include <stdio.h>
#include <string.h>

typedef struct List
{
float value[2];
char *names[2];
} List;

int check(List one)
{

int i = 0;
int mult = -1;

for(i=0; i < 2; i++)
{
if (!*one.names[i] || *one.names[i] == '\0')
{
mult=i
break;
}
}
return mult;
}

int main(void)
{
List A;
A.names[0] = "John";

printf("\n %d \n", check(A));

return 0;
}
>>
>>56298195
wow that is so racist like omg do you realize that she is japanese, they drink tea with two hands? not everyone lives in the west you privileged fuck I bet your a white cis male kys seriously
>>
>>56298253
>that indention
wow

>!*one.names[i] || *one.names[i] == '\0'
1: These two mean the same thing so you should only put one
2: You should not put the * in neither of them.
>>
>>56298195
fuck me, thats the wrong fucking language.
In short LOC = count every line, SLOC = count only lines with actual code, no empty lines, no comments.
>>
>>56298332
>count only lines with actual code
What about split lines or lines with multiple operations?
>>
which one?

A
char test[16];

memcpy(test, "stringer", 8);



B
A
char test[16];

strcpy(test, "stringer");
>>
>>56298253
>>56298332
kk, then it's LOC with whitespaces.
>>
>>56298118
post it!
>>
>tfw read and did all exercises in C++ Primer

am i ready to be a programmer yet?
>>
>>56298345
Dun goofed, the first post was meant to quote.-> >>56298195
>>
For javascript, what does it mean to make a function like this, and how do you call it?

(function(){})


I don't know if I'm doing it right, but I see stuff like these in frameworks I use. I want to write good javascript and not just a bunch of functions that aren't pleasing to look at.

What's the best way to write javascript that's organized and looks nice?
>>
>>56298340
I believe A is wrong.
char test[16];

memcpy(test, "stringer\0", 9);
>>
>>56298288
Did that, but I keep getting segmentation fault.
>>
>>56298380
No, you must first grok SICP and GoF.
>>
>>56298490
And you are wrong.

>>56298340
I generally prefer memcpy however it is tedious in this case.
>>
>>56298545
>GoF
?
>>
>>56298490
String literals in C are already null terminated. There is no point specifying it yourself.

>>56298340
If you're working with strings, you may as well use the str* functions.
>>
>>56298167
Whoops,
return PlaneVector{x - other.x, y - other.y};
not
return const PlaneVector{x - other.x, y - other.y};

Not that it makes any difference.
>>
>>56298562
GoFuckyourself
>>
>>56298340
A doesn't copy NULL-terminator, B does, so if you want test to be NULL-terminated use B if not, use A

>>56298345
Just asking since a class with e.g. doxy-style commenting can easily have 5 times the comment lines than actual SLOC
>>
>>56298563
>String literals in C are already null terminated. There is no point specifying it yourself.
Yes, but "test" is not zero initialized, and memcpy will copy N bytes, he specified 8, which does not include the terminator.
Granted, the '\0' in my post is unnecessary, he'll still have to
memcpy(test, "stringer", 9);
// or
memcpy(test, "stringer", 8);
test[9] = 0;
>>
>>56298450
not a js guy, but...
I know you call it like (function(){})(arguments)
it's anonymous function, so you just write that if you want to use it once but you don't want to make up a name for it

>>56298490
t. pajeet

>>56298562
Gang of Four, something about OOP patterns
>>
>>56298619
Oh so the functions runs by itself automatically like a constructor?
>>
File: image.jpg (24KB, 447x296px) Image search: [Google]
image.jpg
24KB, 447x296px
>my favorite languages are C and Haskell
>Java and C# are for Indians because I'm too dumb to learn them
>>
File: our guy.jpg (15KB, 516x94px) Image search: [Google]
our guy.jpg
15KB, 516x94px
>>56298710
>>
>>56298617
Or just
memcpy(test, "stringer", 8);

He does not HAVE to nul-terminate it.
>>
>>56298634
No, you call it.
foo = function() { window.alert("Hello, world!"); };
foo();

There's also newer syntax:
foo = () => { window.alert("Hello, world!"); };
>>
>>56298726
Racism is against the global rules, stormtard.
>>
File: When-in-Doubt.jpg (93KB, 1280x853px) Image search: [Google]
When-in-Doubt.jpg
93KB, 1280x853px
Imagine you don't know C.
if you start to write/ learn C everyday for a few hours, during 6-8 months, could you put on your resume that you know C?
>>
>>56298774
kys
>>
>>56298788
Yep, since I know how to program, and I know other C-like languages, catching up with C it's a matter of just learn the standard library and the specific things of C.
>>
>>56298736
>memcpy to copy strings
what the fuck am i reading lol
>>
>>56298634
(x => x + 5)(4)

is the same as
f = (x => x + 5); f(4)

but with the latter, you're left with the f function
>>
>>56298831
Something that makes a ton of sense but because you are a retard you are unable to understand.
>>
>>56298751
Oh, but what about like jQuery and other frameworks that straight away start with an anonymous function? And sometimes put their whole code inside of it?
>>
>>56298774
Neither are off-topic replies.
>>
>>56298850
You're passing the function as a callback. It gets called by the framework.
>>
>>56298848
>Something that makes a ton of sense
why?
>>
>>56298848
there is literally no reason to use memcpy to copy a string you fat fuck. if you want a bounded copy use strncpy.
>>
>>56298878
Why not? You are copying data, this is what memcpy is for.
>>
>>56298879
>there is literally no reason to use memcpy to copy a string
There is if you do not want the \0 bloat.

>if you want a bounded copy use strncpy
strncpy is a disaster, I don't know why would anyone suggest it.
>>
>>56298879
if you know the size of the data to be copied, then memcpy() should be as fast or faster than strcpy().
Otherwise, memcpy() can't be used alone, and strcpy() should be as fast or faster than strlen() followed by memcpy().


A lot of implementations of memcpy() and/or strcpy() and/or strlen() are designed to efficiently handle large amounts of data. This often means additional startup overhead (e.g. determining alignment, setting up SIMD, cache management, etc) and makes these implementations bad (slow) for copying small amounts of data (which is far more likely in well written code). Because of this, "should be as fast or faster" does not necessarily imply "is as fast or faster". For example, for small amounts of data an memcpy() optimised for large amounts of data may be significantly slower than a strcpy() that wasn't optimised for large amounts of data.

Also note that the main problem here is that generic code (e.g. memcpy() and strcpy()) can't be optimised for a specific case. The best solution would have been to have multiple functions - e.g. memcpy_small() that's optimised for copying small amounts of data and memcpy_large() that's optimised for bad code that failed avoid copying a large amount of data.
>>
>>56298788

Yes.
>>
>>56298256
>implying lifting the pinky finger when drinking tea is a western habit
pls say to me this am bait
>>
>>56295464
Thank you for posting that image. My son was diagnosed with terminal cancer and that made him laugh. The doctor said that these "nigger may mays" are the only thing he has left in this world.
>>
>>56295464
Fuck you for posting this image. My son is an HIV-positive gay black Jewish cripple and that pissed him off. The doctor said these "nazi frogs" triggered the epigenetically passed memories of the Holocaust in his mind.
>>
>>56299079
I is bait
You is bait
He be bait
She be bait
It be bait
We is bait
Youse be bait
They beez bait
>>
>>56299079
>lifting the pinky finger when drinking tea
for what purpose
>>
>>56299213
it's pretty hard to get banned for racism around here
>>
File: Oh no cirno frog.jpg (19KB, 193x187px) Image search: [Google]
Oh no cirno frog.jpg
19KB, 193x187px
I've noticed that through my commits I've used the word "pollute" instead of "populate" when filling data/variables. baka desu senpai
>>
>>56299079
>>56299116
>>56299116
>>56299165
>>56299193
>>56299200
>>56299213
>>56299231
>programming
>>
>>56299240
>being this new
>>
>>56299240
anime website
>>
>>56299213
I know, right? So many newfags think they can just say anything they want here because hey want to stick it to their parents. But we fellow oldfags know there are standards here.
>>
>>56298920
the compiler can optimize it
>>
>>56299308
t. rajesh
>>
I feel like when I look at resumes, they always list like they know 10 + languages, but no projects or anything that shows they know them.

I am trying to learn Javascript, but still not sure on a project that will tell employers that I am competent in it.
>>
Decided to build the CoreCLR on my Raspberry Pi. It built, but nothing ran. Even a simple Hello World doesn't run.
>>
>>56299295
Right you are, ken
>>
>>56299337
>
memcpy(test, "stringer", 8);

look at the disassembly, i double dog dare you
>>
>>56299116
>>56299165
HoW Do I KNoW WHo To SyMPaTHiZE FoR
HeLP
>>
>>56299426
>sympathizing with niggers, jews or faggots
>let alone nigger jew faggots
>>
Why doesn't this work?
(niggerjews '(= (+ 2 2) 4))
>>
>>56299490
Only oldfigs will remember (((:^)))
>>
Getting back to freelancing because dad refuses to give me food because I disagreed with him on something
I think he wants to teach me that I can never question what he says and accept I am somehow inferior mentally
I wish I had decent parents
>>
>>56299466
oh, I see. Thank you friend

>>56299516
>implying subjugation is not the best form of parenting
>>
>>56299490

rubyist@Overmind:~/build/tinyscheme-1.41$ ./scheme
TinyScheme 1.41
ts> (niggerjews '(= (+ 2 2) 4))
Error: eval: unbound variable: niggerjews

ts>
>>
>>56299571
it is indeed for someone who can't get respect from his peers lel
>>
>>56299641
>implying peer respect matters

you seem like the kind of person who would confide in others lmao
might as well hand everyone knives and blindfold yourself
>>
>start learning common lisp
>don't want to program in any non lisp language now

What the fuck do I do now
>>
>>56299681
Pick up another Lisp? Racket is quite nice and I hear good things about Clojure
>>
I stopped caring about computer science when I was introduced to the concept of Big O notation. What a crock of shit. If your algorithm can only be analyzed by inventing an asymptotic limit that can't exist, like some kind of computer science deity , then you are fucking wrong and the computer science is flawed.
>>
>>56299743
You're a retard.
>>
>>56299741
Forgot to add. I am not competent enough in lisp to do anything substantial.
>>
>>56299673
sounds like you're really emotional about this, I guess you don't get alot of love and respect from people in your life. Hence why you wanna make a kid do it, I feel sorry for you kind of. Hope a therapist fixes you and makes you feel better.
>>
>>56299681
>>56299763
yeah me too
I'm reading paradigms of ai programming and really like the lisp way of solving problems
the language is great for being so flexible, but the function names are awful
>>
>>56299781
>arguing with the carposter
>>
File: image.jpg (2MB, 3264x2448px) Image search: [Google]
image.jpg
2MB, 3264x2448px
Who /learning c++/ here?
>>
>>56299839
>arguing
>not just poking at him
>>
>>56299843
umd?
>>
>>56299516
what did you disagreed with him on?
>>
>>56299743
>can only be analyzed via Big O
no, Big O is not analysis, it's a worst case scenario approximation of runtime complexity
>>
>>56299843

no just a normalfag with a shit job learning in his spare time
>>
>>56299851
He said that I should let the door open to my room
I said I don't want his smoke coming in because I quit 3 years ago and dont wanna relapse
I think he's just trying to sabotage me so he doesnt feel bad about being too weak to quit
>>
>>56298899
>strncpy is a disaster

it's a complete disaster, along with strncat it's why strlcpy and strlcat was invented
>>
>>56299843
>sublime text
lad...
>>
>>56299902
(it's VS)
>>
>>56299890
Let's make a family together anon, I could pretend to be your oneechan who takes care of you as a mother because our parents died.
>>
learning linked lists in c for class.
What's a good book to learn about linked list in c?
>>
File: smm.jpg (473KB, 800x533px) Image search: [Google]
smm.jpg
473KB, 800x533px
>>56296807
Rust
>>
>>56299911
I'll be your imouto chan and climb on your lap anon :3
>>
>>56299763
Ah, well. In that case, just keep on trucking. There are plenty of CL projects on github you could lose yourself in.
>>
>>56299849
>>56299870

oops meant to quote you
>>
>>56299913
The Art of Programming has an entire chapter on linked lists, otherwise http://www.cs.cmu.edu/~rjsimmon/15122-s16/lec/10-linkedlist.pdf
>>
>>56299913

google and a whiteboard is all you need
>>
>>56299913
Also note, this pdf: >>56299963
is done in C0 which is a pseudo C language, but essentially the function bodies are the same.

There's also this book, which covers basically everything you've ever wanted to know about x64 hardware+C+compilers http://csapp.cs.cmu.edu/
>>
>>56296807
Based on your post, you're clearly capable of writing several more characters than C and +.
>>
whats the best way to compare 2 variables or member functions that return a value? i want to count how many unique items there are. So 1, 2, 2, 3 would return 3 since there's 3 unique numbers in that list.
>>
>>56300049

meant to say more than 2
>>
>>56300049
iterate over unaligned items, put them in array, if the item is already found in array, next iteration, then count items in array
>>
>>56300073

forgot to mention im in c++ and getting input for those variables and i can just a while loop for getting input then just comparing them there

is that better you think?
>>
>>56299890
>He said that I should let the door open to my room
how old are you dude

hotpockets doesn't come through here don't worry
>>
>>56300124
13
>>
>>56299781
There's a difference between a lack of and a disregard of affection.

Although I guess the emotionally unstable wouldn't understand :^)
>>
>>56300208
Ofc, not everyone hides their emotions to cope with being rejected and not allowed to feel :^)
>>
>>56300119
Easy, use a hashmap (unordered_map in c++). Make the key integer or whatever value you expect to get, then make the value char so it's small size. put shit in if it exist, otherwise don't. At end do unordered_map::size() to get unique items.
//semi-pseudo-code
unordered_map map<int,char>;
while there are input{
a <- input
if a in map
continue;
else
map[a] = 1;
}
print map.size();
>>
Dumb frogposter

>>56300119
std::length(std::unique(std::begin(x), std::end(x)));
>>
>>56300214
only those who believe they'd be attacked if they showed emotion would hide it.
only those who seek sympathy would allow their emotions to overpower them

however, there are those who don't sympathize, so they can remain clear-minded.
so tell me, what's it like crying in front of another person, because your womb clouds your judgment?
as is the stereotype, negative emotions are a result of drama, which obviously you take part in too often.
>>
>>56300305
>
so tell me, what's it like crying in front of another person, because your womb clouds your judgment?
as is the stereotype, negative emotions are a result of drama, which obviously you take part in too often.
damn, so you've been shamed and mocked for feelings and think they only exist due to your own actions and never others. i now feel better about my own trauma, thanks.
>>
File: vomit.jpg (90KB, 650x650px) Image search: [Google]
vomit.jpg
90KB, 650x650px
>>56300280
>std::length(std::unique(std::begin(x), std::end(x)));
>>
>>56300379
I know
>>
>>56300360
actually I've never been shamed for feelings, but nice job projecting your trauma
>>
>>56300379
>>56300386
Whoops, it might be std::size

you would need to include algorithm and iterator
>>
File: what the fck am i reading.png (26KB, 400x400px) Image search: [Google]
what the fck am i reading.png
26KB, 400x400px
>>56300305
>>56300360
>>>/adv/
>>
>muh data structures
>muh algorithms
>>
>>56300645
> >muh
>>
File: santiago.jpg (15KB, 300x314px) Image search: [Google]
santiago.jpg
15KB, 300x314px
>mfw snort adderall
>>
>/dpt/ slow as fuck tonight
>>
>>56300756
cause im not here to keep the party going
>>
>>56300756
It's 6:40 am
on a sunday

(in the US it's like fucking 1 or something)
>>
>>56300756
Cuz the night is the best time to program.
>>
>>56300772
cadr => the
>>
>>56300772
>It's 6:40 am
no it's not
>>
>>56300824
>what are time zones
>>
>>56300870
clearly you're the one who doesn't understand timezones because you said it's 6:40 am
>implying the majority of /g/ lives in bongistan
>>
File: Extra5.jpg (56KB, 600x955px) Image search: [Google]
Extra5.jpg
56KB, 600x955px
I'mm so fucking drunk right now
>>
File: 1470789626656.gif (46KB, 100x155px) Image search: [Google]
1470789626656.gif
46KB, 100x155px
>>56300891
What should I code
>>
File: koMX1LT.png (324KB, 579x458px) Image search: [Google]
koMX1LT.png
324KB, 579x458px
how do people even program on windows with that shit tier command line and no package manager?
should I use an IDE for everything?

I don't want to use *nix tools (cygwin or mingw) for everything if I'm working on windows though
I wanna try the windows way
>>
File: Extra3.jpg (99KB, 773x893px) Image search: [Google]
Extra3.jpg
99KB, 773x893px
>>56300916
I can't stop feeling myself
>>
>>56300891
dis dik in your mouth
>>
>>56300925
rLinu8ux is fine m9
>>
File: 1466634860211.png (392KB, 832x832px) Image search: [Google]
1466634860211.png
392KB, 832x832px
>>56300932
thxn
>>
>>56300925
windows way is all IDEs
>>
File: Sif.gif (35KB, 230x200px) Image search: [Google]
Sif.gif
35KB, 230x200px
>>56300968
fuck windows
>>
>>56299902
>Being this retarded
>>
File: 552bd86ab4ae6.image.jpg (22KB, 512x341px) Image search: [Google]
552bd86ab4ae6.image.jpg
22KB, 512x341px
>>56300974
it sucks
>>
>>56300959
oh, no need to be polite, I'm doing this to make up for my past sins
just go ahead and suck bb
>>
File: BRtiiw.jpg (44KB, 618x362px) Image search: [Google]
BRtiiw.jpg
44KB, 618x362px
>>56300981
u2
>>
    int i;
int &ri = i;
i = 5;
ri = 10;

cout << i << " " << ri << endl;


if i understand references correctly, the reason this outputs "10 10" is because the reference "controls" the variable its pointing to? if the reference gets changed, so does the variable?
>>
>>56300981
Faggotry is a sin too, degenon.
>>
File: 1461005231404.jpg (687KB, 826x1167px) Image search: [Google]
1461005231404.jpg
687KB, 826x1167px
>>56301002
guck off fuggot
>>
>>56301000
yes
>>
>>56301007
it's ok bb, he cant part us
>>56300990
sure, you first tho, because you're the bottom bitch :3
>>
>>56301000
god, why do pointers in c++ suck ass
>>56301017
fuck off
>>
>>56301000
That's just syntactic sugar for
int i;
int *ri = &i;
i = 5;
*ri = 10;
>>
>>56301023

ive yet to really understand them i just got to references, pointers are later
>>
File: deloused.jpg (120KB, 600x600px) Image search: [Google]
deloused.jpg
120KB, 600x600px
>>56301037
my man
kill urself
>>
>>56297439
Nah, I'm not autistic
>>
>>56301037
Pointers are a lot like references that can be null

>>56301023
Keep your /pol/ trash on its containment board
>>
File: 2000px-Haskell-Logo.svg.png (36KB, 2000x1412px) Image search: [Google]
2000px-Haskell-Logo.svg.png
36KB, 2000x1412px
>>56295464
fuck fjava
we should all learn haskell haskell
>>
Question


Pajeet made an app for me

sent me the source codes

Ends in .tar.gz

How do I open?
What program?

Thanks
>>
File: 1416928491388.gif (731KB, 200x202px) Image search: [Google]
1416928491388.gif
731KB, 200x202px
>>56301061
>using a language that can't even treat code as data
More like hasklel
>>
File: Extra1.jpg (79KB, 599x684px) Image search: [Google]
Extra1.jpg
79KB, 599x684px
>>56301074
tar -xzvf
>>56301054
no u
>>56301080
my dick is data
>>
>>56301050

suck a dick bitch i am pupper i just started
>>
>>56301074
>>>/g/sqt/
7zip opens pretty much any compressed file
>>
>>56301025
No, references are different from pointers. Pointers can be reassigned while references can only point to the same memory location from when they are created. There are a couple more differences.

>>56301023
>god, why do pointers in c++ suck ass
C++ has the same pointers as C, those are references.
>>
File: HaskellRoadCover.jpg (20KB, 322x475px) Image search: [Google]
HaskellRoadCover.jpg
20KB, 322x475px
>>56301087
rea pic related, it'll help
>>56301094
FUCK
>>
>>56301054

why use a reference or a pointer to change a variable though? why not just change the variable itself? to protect its data?
>>
>>56301101
when you want to modify it or pass it without copyin it

>>56301080
Avatarfagging is against the rules
>>
File: wut.png (7KB, 188x322px) Image search: [Google]
wut.png
7KB, 188x322px
>>56301084
>>56301088


alright im in

now what?

Is this written in java?

What program will read it?
>>
>>56301101
He's probably just learning the basics of references and pointers so he's doing trivial stuff with stack allocated memory.

They can be used with function calls as well to prevent copying large objects/structs.
>>
>>56301099

looking at haskell code makes me wanna puke i'll stick with based c++
>>
File: 1403766818980.gif (982KB, 400x299px) Image search: [Google]
1403766818980.gif
982KB, 400x299px
>>56301113
>code as data
>data as code
>hasklel as shit
It's not avatarfagging if it's a pun

Also reminder that lisp > hasklel
>>
File: Screenshot_2016-07-14_19-41-44.png (1MB, 1920x1079px) Image search: [Google]
Screenshot_2016-07-14_19-41-44.png
1MB, 1920x1079px
>>56301115
google gradle faggot
>>56301137
kill urself (my man)
>>
File: launch terminal loli.jpg (22KB, 298x268px) Image search: [Google]
launch terminal loli.jpg
22KB, 298x268px
I think I'm going to fall for the Lisp meme since Stallman praises too much. What's the best way to start with it? I guess SICP, but that uses Scheme, and I don't know if I should use Lisp, or Scheme or Common Lisp.
>>
>>56296348

C++ Primer Plus by Stephen Prata. Then read Stroustrup's book.
>>
>>56301115
Android Studio
or try looking in App (i think)

56301137
>It's not avatarfagging if it's a pun
When you go to every thread, spam the same post and always use the same character as an image, you are an avatar fag

Contribute something to the fucking thread you fucking worthless (you)monkey
Nobody gives a shit about lisp v haskell, it's like saying "piss is so much better than shit!!!11"
You aren't even funny
>>
>>56301168
no
>>
>>56296741

C Primer Plus by Stephen Prata. Then read K&R
>>
>>56301168

thats what i have here:

>>56299843

Except its just c++ primer not primer plus. It covers a lot of ground and isn't for a complete beginner. I like it so far.
>>
>>56301115
click .bat file and see what happens

tell him to send you a .jar file (or .apk if it's for android)
>>
File: 1471923253223.png (451KB, 1264x900px) Image search: [Google]
1471923253223.png
451KB, 1264x900px
>>56301171
>Android Studio


thank you
|
|
|
one last question

Pajeet said he would send me a copy of the ios source code but he never did.

I have the beta files, will xcode open the app?
>>
File: 1425593845210.jpg (51KB, 473x555px) Image search: [Google]
1425593845210.jpg
51KB, 473x555px
>>56301163
Clojure is pretty good if you want a modern lisp implementation with good third party support so you can make real-world applications.

Then you too can treat code as data.
>>
>>56301163
>Lisp, or Scheme or Common Lisp
When people say just "Lisp", they're usually talking about Common Lisp.

I would say start with "The Scheme Programming Language" by Kent Dybvig. That and "Little Schemer" were pretty good reads for starting out. "Little Schemer" is geared more toward new programmers in general, rather than people new to Scheme. That being said, if you go the Scheme route, you may as well use Racket. Racket has an amazing documentation website and a great community in both the mailing list and the IRC channel.
>>
i'm gonna learn some rust
>>
>>56301163
>>56301198
Also, if you go the clojure route, "Clojure for the Brave and the True" is a good book. It's even available for free online.
>>
>>56301217
It's neat at first, but once your actually try to write something, you'll realise that the ownership system is a massive pain in the ass and always gets in your way.
>>
>>56301198
>>56301201
>>56301219
Thanks, I guess I'll start with Scheme just because SICP, then if I like it enough I'll move to Clojure or Racket.
>>
Any good resources for learning go?

Already did the go tour and currently busy with gobyexample but I don't quite get some things and need more resources to learn from.
>>
>>56301236
As a side note, Racket has a
#lang sicp
that you can use for perfect compatibility with the code you see in the book.
>>
>>56300716

just take it normally anon, dont wanna fuck shit up
>>
>>56301242
there's the book from Kernighan
>>
>>56301242
go sucksd
>>
File: rekt.gif (406KB, 300x231px) Image search: [Google]
rekt.gif
406KB, 300x231px
reminder that hasklel's autistic type system is fundamentally broken
https://wiki.haskell.org/Monomorphism_restriction

reminder that hasklel still can't even treat code as data
>>
>>56301320
reminder that u suck
>>
>>56295464
Next thread has anime please
>>
This thread seems like it used to be more popular in the past..

What happened?
>>
>>56301340
you posted
>>
>>56301340

maybes people are actually programming and not being autistical sperglords of the 2nd power
>>
File: images.jpg (12KB, 326x400px) Image search: [Google]
images.jpg
12KB, 326x400px
>>56301163
start with pic related if you're a real hardcore hacker

scheme is easy even a retard could learn it (but, it's good)
everyone praises clojure. it's well designed, has cool features, java libs

i think clojure is more functional (and concurrent) programming, and common lisp is a more lispy style: it's un-opinionated, you can just as easily write functional code as OOP, it's easy to modify the language to handle other styles

(scheme is an academic/educational language :^)))
>>
>>56301343
wtf I hate me now
>>
what does binding mean?
>>
>>56301477
rope play
>>
>>56301477
http://docs.sencha.com/extjs/5.1.3/guides/application_architecture/view_models_data_binding.html

Googled it for ya ;)
>>
File: lookoflels.gif (2MB, 300x300px) Image search: [Google]
lookoflels.gif
2MB, 300x300px
>mfw const pointers chapter
>>
>>56301357
Will give it a look, but desu AI seems like too much for me (I readed the AI: A modern approach several years ago and couldn't read past more of a few pages).
>>
who /energy drink/ here?
>>
>VS requires you to sign in to use the """free""" version
wtf reddit? you never warned me
>>
NEW THREAD!!

>>56301575
>>
>>56301566
so does windows
>>
>>56301577
thank you hime
>>
>>56301577
i hate you
>>
>>56301303
Thanks, do you know if it's any good? Never read a book from that guy.
>>
>>56301587
windows 10 requires a microsoft acount?
I never caught the part where the community version is actually a trial, after which you have to make a botnet acount
>>
>>56301577
kill yourself anime autist
>>
File: 430654045.jpg (46KB, 429x584px) Image search: [Google]
430654045.jpg
46KB, 429x584px
>>56299843
Man, how pleasant, learning C++ by the books, with your laptop out, your mechanical keyboard and razer mouse mat, probably going to uni, living a relatively comfy life.

My life is a fucking circus and the only way to go is down.

You on github? Post some code?
>>
>>56301477
It means some data is associated with other data.
Usually only implemented by libraries managing state, for instance networking libraries like boost::asio, or with OpenGL where glBindBuffer can bind to any one of the buffer binding points.
>>
Im reading relational database. why does it feel like everything is made much more complex and difficult than it needs to be??
>>
>>56300023
Dad?
>>
File: 17428.gif (1MB, 392x400px) Image search: [Google]
17428.gif
1MB, 392x400px
Building a text adventure game in C++ I'm new to the language so it's gonna suck ass. Still have no idea when and how to use pointers. Any good tutorials?
>>
Why is operation overloading consider bad?
>>
>>56301516
>const pointers
And there are also pointers to const.
Thread posts: 318
Thread images: 46


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