[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: 322
Thread images: 31

File: cancer.png (8KB, 512x512px) Image search: [Google]
cancer.png
8KB, 512x512px
What are you working on, /g/?
cia niggers wanna know.
Previous thread: >>61398050
>>
Idris is the only practical language today
>>
Reposting because I'm still clueless:
I wish to learn about https://gitlab.com/xonotic
It's a very impressive game in some ways and it's completely open source, so that's nice.

But I don't see where I should start learning about this project. How do you approach something like this? I don't have any specific goals aside from figuring out how the warpzones (https://www.youtube.com/watch?v=ORh6NfQRDxg) work so smoothly (this video isn't a good representation since it's recorded from a demo perspective, ingame it's completely free of artefacts). But I'd also like to get a general gist of the engine.

Should I run some graphing tools on it? What do I do?
>>
>>61404746
install gentoo
>>
File: 1491031741878 (1).gif (152KB, 400x267px) Image search: [Google]
1491031741878 (1).gif
152KB, 400x267px
>>61404703
What does this OP image have to do with anime or programming?
>>
>>61404746
>t https://gitlab.com/xonotic
doesn't even include a description of the project

how am i supposed to know what is this
>>
>>61404783
>how am i supposed to know what is this
It's an open source game written mostly in C.
https://github.com/xonotic/xonotic is perhaps a little better.
I don't know where to start. If anyone could share their general approach for teaching themselves about large projects that'd be nice.
>>
>>61404746
Ask the dev if there's anything to do.
>>
>>61404776
>saving two times the same image
>>
>>61404874
I'm just looking to learn, not to contribute, yet anyway.
>>
after i finish reading K&R i'm going to include it on my resume as one of the languages i'm fluent in, so that'll make 2 along with python. i want an OO language to include in there as well to round things out. i already have passing knowledge of java and C++. what OO language should i pick to learn in depth?
>>
>>61404891
if you want to be employable? Java. Save C++ until you have a strong understanding of C and Java.
>>
>>61404891
html
>>
Does eating hot peppers enhance programming ability?
>>
>>61404884
That's the only copy, actually
>>
>>61404886
You can learn by contributing.
Stop being autistic and ask if they need any help.
>>
>>61404912
only if they're red and with chili
>>
>>61404907
not exactly employable per se at the moment, i'm looking to go to grad school for information security. but i would want a well paying internship over the summer to bridge the gap both on the resume and to make ends meet
>>
I know Java, C, and some Python.

Is it worth it to start tackling some C++, or am I wasting my time?
>>
>>61404916
not really
>>
>>61404922
Why not just raw peppers without any impurities added
>>
>>61404941
No, I have (1)
>>
>>61404940
It's a good idea. Just remember that C++ is its own beast, and shouldn't be written as C with classes or Java without GC.
>>
>>61404940
>i know c
no you don't
>>
>>61404957
C with RAII/templates/exceptions is the best way to write C++
>>
>>61404703
>ask any questions about Java
>is ignored
Ok
>>
>>61404964
c's not a big language. it was made with minimalism in mind. i don't know why people make it out to be so difficult
>>
>>61404968
>exceptions
>>>/b/
>>
>>61404964
You know nothing about me.
>>
>>61404968
Exceptions make me uncomfortable, but they're essentially necessary once you introduce RAII and constructors.
>>
>>61404983
there's only one think i know about you: you don't know C.
>>
>>61404976
what have you made in c?
fizz buzz?
>>
>>61404998
nice troll m8!
>>
>>61404999
- Compiler with three levels of optimization (C -> ASM)
- Transpiler (JavaScript -> C)

you?
>>
>>61404999
i've not made a large application in C because no one does except when /g/ makes another project which will never be finished. but i know the language. not even the guy you were initially accusing of not knowing C btw, i just interjected because you seem like a dick who thinks C is super hardcore
>>
>>61404998
>think

exactly, you can think whatever you want
>>
>>61405026
thanks
>>
>>61405018
do you have any resources you'd recommend for stuff like that? i took my operating systems class with my mentor who's a bit disdainful of low level stuff (along with all 12 faculty of the csci curriculum at my uni) and he's ALSO teaching my high performance computing class this semester. which i was pumped up for since i wanted to go ham into assembly and now i'm certain he'll neuter it. it's like they're trying to actively undermine low level at this place. i've never built an assembly program or a compiler
>>
File: 4k.jpg (37KB, 1280x720px) Image search: [Google]
4k.jpg
37KB, 1280x720px
>>61405021
>>
>>61404746
this kind of warp zone is simple and done at the map level (it's just a transparent teleport). if you want true portals, have a look at prey which did it first and is open source.

about xonotic, it seems most of the game has been coded in a custom programming language for a virtual machine. teleporters logic is here
https://gitlab.com/xonotic/xonotic-data.pk3dir/blob/master/qcsrc/common/triggers/teleporters.qc
>>
think i'm going to learn C++ instead of java because i want to go into security, not app development. thoughts on this? i also kind of want to learn ruby since people who use it make it seem fun but if i follow that logic i have no reason to
>>
>>61405085
That works.
>>
writing a program that can teach me how to love
>>
>>61405085
c++ is a horrible language
it's made more horrible by the fact that horrible programmers use it
stay horrible
>>
>>61405115
have fun doing that
>>
File: smug greened.jpg (72KB, 456x402px) Image search: [Google]
smug greened.jpg
72KB, 456x402px
Why exactly does /g/ think "knowing" C is some sort of impossible feat?
>>
>>61405115
>>61405115
$ man love
$ No manual entry for love
>>
>>61405142
"Knowing" C isn't all that difficult. Doing all those clusterfucky things people who have merged with the machine do with void pointers is.
>>
>>61405142
is this program valid?
struct {
int foo, bar;
} baz;

int *example()
{
return &baz.foo;
}
>>
File: herdanigger.jpg (267KB, 640x480px) Image search: [Google]
herdanigger.jpg
267KB, 640x480px
>>61405142
>>
>>61405142
this place is full of kids, what did you expect?
>>
>>61405142
I didn't think C was hard until I took an OS class where it took me ours to debug my code and I felt like an idiot. It probably helped me as a programmer though.
>>
>>61405174
It compiles, if that's what you mean by valid.
>>
>>61405193
Fuck I meant to say hours.
>>
>>61405178
does he leave home?
>>
>>61405174
Not him but I would say the &baz would give you the memory location of the struct baz but I don't think .foo would work on that because it is acting on a pointer to a struct and not a struct.
>>
>>61405231
I'm pretty sure . binds more strongly than & because -> binds more strongly than *
>>
>>61405170
And why would you do "clustryfucky things"?

I work with C, maintaining and developing a program with roughly a million LOC (level 1 and 2 systems in the process industry). I came straight from uni and had no troubles getting into it.
>>
Who is the ultimate meme slob and why is it C++
>>
>>61405239
Are you saying . has greater precedence over &?
>>
>>61405231
What is the memory location of the struct baz?
>>
>>61405255
Yes
>>
File: easy.png (23KB, 942x217px) Image search: [Google]
easy.png
23KB, 942x217px
>>61404703
>What are you working on, /g/?
still project euler.
Problem 39 was easy.
We are getting close to >50 where problems finally get above 5% dificulty rating

#include <stdio.h>
#include <math.h>

int solutions[1000] = { 0 };

int main()
{
int a, b, c = 2, p;

for(a = 1; a < 1000; a++) {
for(b = 1; b < 1000; b++) {
for(c = 2; c <= 1000; c++) {
if(a + b + c > 1000 ) {
break;
}
p = a + b + c;
if(sqrt(a*a + b*b) == c) {
solutions[p-1]++;
}
}
}
}

int max = 0;
int index = 0;
for(int i=0; i < 1000; i++) {
if(solutions[i] > max) {
max = solutions[i];
index = i+1;
}
}

printf("val: %d, solutions: %d\n", index, max);

return 0;
}

>>
>>61405283
Ah okay, so it would work fine then.
>>
>>61405255
. has higher precedence than * so it'd follow for it to have higher precedence than &
>>
>>61404703
If I have a typedef
typedef float vec3[3];

And I put it in a struct
typedef struct {
vec3 n;
vec3 p;
} s;


Are n and p pointers or are they arrays?
>>
>>61405329
Test it with sizeof and find out.
>>
>>61405072
>this kind of warp zone is simple and done at the map level (it's just a transparent teleport). if you want true portals, have a look at prey which did it first and is open source.
This is not just teleporters.
See the video I posted. There's teleporters and warpzones in xonotic. Warpzones are similar to prey except there's none of the weird changing of what's actually up/down or scale (I dunno, maybe I was just fooled).
What are you saying is wrong with these compared to preys teleporters?
>>
sqlite3_exec(*,"SELECT * FROM TABLE",*,*,*);

Is it wrong that I think using literal human-readable strings to communicate with my database is just the teensiest little bit retarded?
>>
>>61405349
Welp, they're arrays.
  0 typedef struct {
1 vec3 n; //normal of rect
2 vec3 v0;
3 vec3 u; //v1 - v0
4 vec3 v; //v2 - v0
5 float negunorm; //-(u dot u)
6 float negvnorm; //-(v dot v)
7 float k; //(u dot v)^2 - (v dot v)(u dot u)
8 } model_raytest_rect;

Has a sizeof of 60. If they were pointers it would be 44.
>>
>>61405303
>>61405255
>>61405174
PS C:\Users\justin\c-programs> cat .\struct.c
#include <stdio.h>

struct tuple { int foo, bar; } baz;

int *example(){
return &baz.foo;
}

void main(){
baz.foo = 9;
baz.bar = 18;
int *r = example();
printf("%d\n", *r);
return;
}
PS C:\Users\justin\c-programs> gcc struct.c -o struct
PS C:\Users\justin\c-programs> ./struct
9

were you just asking people to do your homework? i thought this was supposed to be some type of trick question
>>
>>61405437
use an ORM then
>>
>>61405478
Er, 48? I think 48 actually due to word alignment.
>>
>>61405487
>were you just asking people to do your homework?
No I didn't post the original I was just trying to test my own knowledge of C by giving my thoughts without looking anything up.
>>
>>61405329
If they were pointers, where would the memory be?
>>
>>61405539
It would be I have to call malloc.
>>
>>61405018
>>61405050
someone please respond
>>
>>61405478
>>61405508
Aligned to what? Everything in your struct is already (double) word aligned.

48=4*12 (3 floats 4 bytes each).


mong
>>
>>61405142
Knowing C as a language isn't hard.

Doing something with C requires a good understanding of your operating system's syscall interface and various memory and multiprogramming features that it has, the libc that comes with it and a basic understanding of the compiler-generated code which can be abstracted on a slightly higher level to assembly code.

It takes a very long time and a lot of effort to understand these enough to become "good" enough in C to really say that you know C, if by knowing a language you mean being able to manipulate it efficiently to do anything you have in mind. By that definition, while knowing python takes a few weeks at most, "knowing" C can take years and a few weeks for every operating system you "know" it on.
>>
>>61405605
I'm working on a router firmware project in C because I want to contribute to openwrt and it is slowly turning into a nightmare.
>>
>>61405582
If the typedef was an alias for float*, it would have to be 48 bytes because pointers are quad word aligned.

  4 typedef struct {
3 float * n; //normal of rect
2 float * v0;
float * u; //v1 - v0
float * v; //v2 - v0
float negunorm; //-(u dot u)
float negvnorm; //-(v dot v)
float k; //(u dot v)^2 - (v dot v)(u dot u)
} model_raytest_rect;

Try sizeofing it yourself.
>>
>>61405605
So basically saying that you know C just shows that you don't understand C.
>>
>>61405679
>>61405670
>>
File: file.png (139KB, 1280x995px) Image search: [Google]
file.png
139KB, 1280x995px
rate my kode cia niggers
>>
>>61405695
:|
>>
>>61405695
edgy
>>
File: bool.jpg (3KB, 110x30px) Image search: [Google]
bool.jpg
3KB, 110x30px
>>61404703
void s_switch_bool(bool *b){ *b = (*b) ? false : true; }

int main(void)
{
bool b = true;
printf("BOOL is %s\n", b ? "TRUE" : "FALSE");
s_switch_bool(&b);
printf("BOOL is %s\n", b ? "TRUE" : "FALSE");
return 0;
}


:^)
>>
>>61405711
>>61405723
What's so edgy about helping the high priest?
>>
Trying to compile a C program and add maria-db connector to it, but the mysql headers typedef uint64 which the program itself has already defined, so there's a typedef conflict. What are my options?
>>
>>61405695
>/root
>>
>>61405743
It's a server nigger.
>>
File: temp.png (23KB, 972x541px) Image search: [Google]
temp.png
23KB, 972x541px
>>61405363
i saw the video and saw no difference with a teleport. the player is tricked by the map having both end as the same. (see pic). this is a old trick that was already used in pac-man and would have produced the same effect if you played in the first person.

>>61405363
>What are you saying is wrong with these compared to preys teleporters?

https://youtu.be/zpQRePtEpRw?t=1m8s

prey portals were truly amazing in their time.
>>
File: 1455953544842.jpg (34KB, 300x470px) Image search: [Google]
1455953544842.jpg
34KB, 300x470px
>>61405747
>>
>>61405729
*b = !*b;
>>
>>61405645
>because pointers are quad word aligned.
Nope.

But if you are on x64 the pointer will naturally be 64 bits. This has nothing to do with alignment.
>>
>>61405735
Fix both the mysql headers and the program to use c11/posix typedefs.
>>
>>61405756
Thats not edgy enough
Useless code is good code :^)
>>
>>61405747
so? you still have a home folder for the user you're supposed to run it as (unless your idea of running scrappers is running them as root lol) and if you have any storage attached to the server it shouldn't be mounted as /root either
>>
>Trying to actually use Rust for the first time
>The .unwrap() meme is real
>>
>>61405777
He's either mentally ill or underage
>>
I've written a small webapp using SQLite as the DB. It works very well and I don't particularly want to move to Postgres et al.

However, I want to add high-volume logging and I suspect this will be challenging for sqlite (since it doesn't support parallel writes). I haven't measured it yet so this might not be a problem at all, but if it is, what should I use to store log data?

If I just write out to a CSV from multiple threads, there'll be race conditions and general corruption. If I synchronise the writes, I might as well just use another sqlite DB.
>>
>>61405795
you will become brain damaged
>>
>>61405776
void s_switch_bool(bool *b) {
for (;;);
/* by the end of the for loop b will be switched */
/* just trust me on this one */
}
>>
File: file.png (55KB, 170x218px) Image search: [Google]
file.png
55KB, 170x218px
>>61405752
>>61405777
I guess you've never owned a remote server before.

>>61405800
>helping high priest
>metally ill
Choose only one.
>>
>>61404013
It would be an interesting project to recompile something like chromium or firefox (including the engine) with musl-libc and inlining everything. Would probably take a while to compile though.
>>
>>61405814
Nah, Rust is actually turning me in a better programmer by forcing me to think about a whole new class of errors.
>>
>>61405821
kek
>>
>>61405760
Yes they are. 4 * 8 + 3 * 4 = 44. Sizeof that = 48.

Where did those 4 bytes come from in your universe?
>>
>>61405748
>this is a old trick that was already used in pac-man and would have produced the same effect if you played in the first person.
Yes but the point is they inherit all the physical simulations as if they were portals. You can even guide the guided rockets through them without a hickup.
>prey portals
Explain what they do different. They're identical. It's just clever leveldesign as far as I can see.

Can you tell me how they're different?
>>
>>61405822
You don't have to use /root for remote servers you dumb fuck
>>
File: zoz.jpg (63KB, 800x419px) Image search: [Google]
zoz.jpg
63KB, 800x419px
>>61405822
>metally ill
>>
>>61405735
>>61405764
Seems that doing #define HAVE_UINT64 1 fixed it.
>>
>>61405824
>Would probably take a while to compile though.
Not that much longer than a normal full recompile really.
>>
>>61405866
Is that really your only complaint with the script?
>>
File: Common Item Dialog (Windows).png (43KB, 787x881px) Image search: [Google]
Common Item Dialog (Windows).png
43KB, 787x881px
>read winapi
>just want a simple file dialog box
>find a super simple structure:
https://msdn.microsoft.com/en-us/library/ms646927(VS.85).aspx
>happy
>realize it's deprecated, my visual studio version doesn't even provide me with the bindings
>go look at their new and modern alternative
PAJEEEEETS.
>>
>>61405729
>not writing enterprise code
bool s_invert_bool(bool *b)
{
if *b == false
{
return !*b;
}
else if *b == true
{
return !*b;
}
else
{
assert(0);
}
}

void s_switch_bool(bool *writeInto, bool *readFrom)
{
*writeInto = s_invert_bool(*readFrom)
}


int main(void)
{
bool b = true;
printf("BOOL is %s\n", b ? "TRUE" : "FALSE");
s_switch_bool(&b, &b);
printf("BOOL is %s\n", b ? "TRUE" : "FALSE");
return 0;
}
>>
>>61405868
Fuck off nigger. I wrote my own compiler.
>>
>>61405898
>Dumb
>Autistic
>Edgy

>muh script
A 12 year old can do that as well. Stick to your daly epic cia niggerman vlog
>>
>>61405874
>can only run on 1 core
>every single library and their dependencies has to be recompiled
>it all has to be done in sequence
>>
>>61405913
>muh compiler
>>
>>61405901
Microsoft programmers have always been renowned for being utterly incompetent.
>>
>>61405927
You seem upset
>>
>>61405935
Compilers multithread awfully poorly. Yes if they were good compilers sure it'd be a major difference.
>>
File: nice.png (21KB, 935x201px) Image search: [Google]
nice.png
21KB, 935x201px
next problem done.
Takes ~1s on my desktop and only 10 seconds on a raspberry pi b+

#include <stdio.h>
#include <math.h>
#include "util.c"

#define LIMIT 10000000
int is_pandigital(uint64_t num);

int main()
{
uint64_t *primes = primes_below(LIMIT);
uint64_t max = 0;

uint64_t i = 0;
while(primes[i] != 0) {
if(is_pandigital(primes[i])) {
max = primes[i];
}
i++;
}

printf("largest pandigital prime: %lu\n", max);

return 0;
}

int is_pandigital(uint64_t num)
{
int len = log10(num)+1;
uint64_t* has_num = new_arr(len);

while(num > 0) {
int rem = num%10-1;
if(has_num[rem] == 0)
has_num[rem] = 1;
else {
free(has_num);
return 0;
}
num /= 10;
}
for(int i=0; i < len; i++) {
if(has_num[i] == 0) {
free(has_num);
return 0;
}
}
free(has_num);
return 1;
}


>>
>>61405954
How can I unsubscribe from your shitblogs?
>>
>>61405951
Yes, but doing everything in one thread will end poorly.
>>
>>61405959
You press the minus sign next to his post.
>>
>>61405970
>will end poorly.
Surely you don't mean that. It might be slower but it won't be ending poorly.
>>
>>61405954
>C prime-related code
>no use of custom Intel extended prime instructions

Lordy it must be summer
>>
>>61405971
What is this """minus sign""" you speak of?
>>
>>61405991
It will be extremely slow. Firefox probably depends on a lot of stuff indirectly, so you'd practically have to recompile the entire repos.
>>
>>61405994
What?
>>61405959
you cant. Thanks.
>>
>>61406014
>It will be extremely slow.
Fucking do it then.
>>
>>61406015
Fuck off then, not your personal twitter clone
>>
>>61405959
you don't open a thread where the OP asks people to share what they're working on
>>
>>61405729
>>61405821
void s_switch_bool(bool *b) {
//TODO
}
>>
>>61406022
You're in a thread called /dpt/ where the OP reads
>What are you working on, /g/?
>cia niggers wanna know.
I wonder if this thread is supposed to be some kind of anonymous blog?
>>
>>61406022
But it is
>>
>>61406028
That's not """working""" means, NEET
>>
File: file.png (139KB, 1280x995px) Image search: [Google]
file.png
139KB, 1280x995px
>>61405927
I fixed it
>>
>>61406061
>Arch
>/cianig
>/
> cianig
You have to be 18 to be posting here. Close the tab.
>>
>>61406061
Dumb autists will stay dumb autist
>>
>>61406049
manufacturing a computer program fits one of the main definitions of "working" which is
>the act of manufacturing or building a thing
>>
>>61406061
>lines longer than 80 characters
le trash is where it belongs
>>
>>61406049
Well, I am not neet though.
I am a CE student and love to educate myself when I have no homework or other shit to do :-)
>>
>>61406078
>>61406095
Now you have a problem with the OS I'm using? I used arch-anywhere though.

>>61406101
Good point, I'll fix.
>>
>>61406121
>Now you have a problem with the OS I'm using?
Are you literally brain damaged?
>>
>>61405854
Structs are still typically aligned to whatever word size you have

>pointers are quad word aligned
This on the other hand makes zero sense.
>>
>>61406136
You guys are really rude. I like arch, so what?
>>
>>61405822
>I guess you've never owned a remote server before.
t. the guy that uses root's home folder for his shit

hearty kek anon
>>
>>61406144
No you dumb fucking autist. You just DON'T make arbitrary directory in *nix.
>>
>>61406157
*nix root, I meant
>>
>>61406014
>It will be extremely slow
You're a big compiler.
>>
>>61406157
he's not doing it in /, he's doing it in /root which is basically a root folder in the root fs (usually used as root's "home" but you just don't do that either)
>>
>>61406097
Working without getting paid is hobby, it bears no meaning
>>
>>61406179
for whom?
>>
File: file.png (126KB, 1280x995px) Image search: [Google]
file.png
126KB, 1280x995px
>>61406101
>>61406157
>>61406195
Fixed. Now what?
>>
>>61406195
>/cianig
>>
>>61406143
>pointers are quad word aligned
They're aligned to quadwords. In x86,
word = 2 bytes.
double word = 4 bytes
quad word = 8 bytes

That is the cpu can only pointers if their addresses are divisible by 8.
>>
>>61406211
Start your own autism awareness vlog and gain popularity among edgy teenagers by calling people niggers xD
>>
File: tumblr_mts2xuLXSY1ruxwvqo1_500.png (191KB, 500x385px) Image search: [Google]
tumblr_mts2xuLXSY1ruxwvqo1_500.png
191KB, 500x385px
Does anyone need language bindings for a library or similar, but aren't knowledgeable enough to implement them?

I look to expand my GitHub and work without monetary compensation (pro bono, as you say in latin)
>>
>>61406211
is cianig a valid user?

>>61406212
oh sorry I didn't see the next screenshot and just assumed you were talking about the previous one
>>
>>61406220
Come on, don't be like that. I fixed everything you asked.
>>
>>61406228
>language bindings for a library
?
>>
>>61406199
that's completely wrong. did someone pay linus to start working on linux?
>>
>>61406211
>templeOS
>http
>not https


into the trash it goes
>>
File: file.png (71KB, 666x438px) Image search: [Google]
file.png
71KB, 666x438px
>>61406231
ya
>>
File: grad.png (200KB, 2154x2167px) Image search: [Google]
grad.png
200KB, 2154x2167px
>>61405729
This is much more concise if you just do

b != b;
>>
>>61406255
No one pays a fizzbuzzer to do euler problems either, what's your poing
>>
>>61406255
no, that's why he called it a hobby project back when he first announced it in 1991
>>
>>61406260
Come on man, Terry doesn't have https for his site, but if it makes you feel better all uploads are TLS encrypted.
>>
>>61406293
point*?
>>
>>61406297
ok, i'll allow it
>>
>>61406271
See >>61405776
>>
>>61406294
hobby projects don't make themselves. you have to work on them
>>
>>61406313
So it's all good now?
>>
>>61405812 (Me)
Bump. Current plan is to write to a different file in each thread and merge them later. I feel like there must be a nicer way.
>>
>>61405812
>>61406362
samefag
>>
>>61406201
If I compiled that, would your CPU overheat?
>>
>>61406396
my CPU isn't alone
>>
>>61406362
Don't worry about it. SQLite is much faster than people think it is.
>>
>>61406396
It would be extremely painful.
>>
>>61406219
What are you going on about now?

The data is word-aligned. Pointers is data like any other. Data being word-aligned helps in that access through indirection can be done by instructions with operands being word sized.

???


Also the CPU has no relation to the concept of pointers. No part of any hardware component has.
>>
>>61406410
Uh, you don't get to bring threads.
>>
>>61406423
What is the size of this struct on a 64 bit machine?
struct x {
char c;
int * p;
}
>>
>>61406462
Doesn't it depend on the way the compiler decides to pack it?
>>
>>61406500
Not in this case.
>>
>>61406500
Correct

>>61406513
Wrong

>>61406462
Typically 16 bytes.

The char is padded to 8 bytes.
The pointer is 8 bytes
>>
If I print something and don't flush.
Will it never be shown?
I use printf just fine without fflush(stdout); and get my prints in full.
When will this not happen?
>>
>>61406594
When you don't add a \n and the cache isn't full. It of course is implementation-dependant and might change depending on the OS and libc you use.
>>
>>61406540
>Wrong
How are you going to magically pack it tighter anon? There's several ways to pack it, but all the packings are the same size. I mean technically you could pack it so it's even larger than 16 bytes but no compiler does that.
$ cat wordalign.c
#include <stdio.h>
struct p {
char c;
int * i; };
struct q {
int * i;
char c; };
struct s {
char c;
float f; };
struct t {
float f;
char c; };
void main() {
printf("p: %i\n",sizeof(struct p));
printf("q: %i\n",sizeof(struct q));
printf("s: %i\n",sizeof(struct s));
printf("t: %i\n",sizeof(struct t)); }
$ gcc -o wordalign wordalign.c
$ ./wordalign
p: 16
q: 16
s: 8
t: 8
>>
>>61406624
>\n
But I've been told \n doesn't flush.
>>
>>61406636
There's nothing that says it should flush, but it is the way it's implemented most of the time.
>>
>>61406654
Ok thanks.
>>
>>61406636
And he said it's implementation-dependant and \n does in fact flush in a lot of impls.
>>
>>61406626
>How are you going to magically pack it tighter anon

Not pack it at all (7 bytes). Pack it to 8 bytes. 9, 10, 11, 12, 13, 14, 15... whatever I want, it doesn't matter as long as I make sure any instructions accessing the data do so correctly.

This is not dictated anywhere. Read YOUR compiler's manual to find out what applies.
>>
>>61406682
>Not pack it at all (7 bytes). Pack it to 8 bytes.

Oops, 9
>>
>>61406682
I suppose if you want to do multiple reads bitshifts, and masks you could pack it tighter, but you've missed the point. The point is the anon I posted that to didn't understand that pointers had to be qword aligned to be read as the qwords they are.

If you're willing to imagine a hypothetical compiler that doesn't add padding and actually does multiple reads + xors + bit masks instead of word aligning, then don't bother and imagine a pretend modern CPU that doesn't need word alignment.
>>
I'm a CS major about to enter my senior year. I've never had an internship. I've only contributed to one project on github (a shitty android app).

What skills do I need to learn/polish in the next year to make myself look like an attractive job candidate? I want to work with databases or in software engineering.
>>
>>61406828
get an internship
>>
I cast malloc.
>>
r8 muh sepples
#pragma once

#define decl_empty_base_class(name) \
class name { \
public: \
virtual ~name(); \
}

#define decl_polymorphic_wrapper_class(name, super, wrapped_type) \
class name: public super { \
private: \
wrapped_type value; \
public: \
virtual operator wrapped_type &(); \
virtual operator wrapped_type const &() const; \
}

#define impl_empty_base_class(name) \
name::~name() {}

#define impl_polymorphic_wrapper_class(name, wrapped_type) \
name::operator wrapped_type &() { \
return value; \
} \
name::operator const wrapped_type &() const { \
return value; \
}
>>
>>61406913
Stop using C++
>>
>>61406924
Sometimes I shiggy my diggies
>>
>>61405954
>standart library heap manipulation functions inside a a loop that happens to be in the performance critical codepath
>architecture dependant code
6/10.
Could do better, granted its only free that happens to be way cheaper than malloc but still that just might cause a few cache misses and make the branch predictor shit little tiny brix.

You could earn extra points by making your own prime function. Also you can implement the last function not use the heap.
>>
>>61406951
Scratch that, some anon's post made me think that primes_below was architecture dependant.
>>
>>61406922
>virtual operator wrapped_type const &() const;
>name::operator const wrapped_type &() const {
0/10
>>
File: YYYY-01-DD 22_01_SS.png (111KB, 823x504px) Image search: [Google]
YYYY-01-DD 22_01_SS.png
111KB, 823x504px
>>61406922
what's a sepple
>>
>>61405085
c++ is nice but very explicit. it's very powerful and you can do anything you want, it just takes a long time to get going and you will have to learn libraries outside the language to do a lot of things that are built in/in standard libraries in other languages. C++ still doesn't even have a sane way to handle networking so basically everyone uses Boost asio. Java does have all these things in its libraries so they're there if you need them in a pinch, but they're not very good so people use external libraries anyway.

Nice thing about C++ is that it's compiled to native code. Bad thing is this means you have to worry about the environment it will be run on. Different syscalls on windows and *nix, and things like that.

Ruby is just a perfect language. A functional language like Haskell would also be fun to learn. You can learn the basics pretty quickly using the wikibook.
>>
God I hate this:
https://youtu.be/AKtHxKJRwp4?t=713
Basically you've made an abstraction in C++ that has unnecessary cost.
And it should be perfectly obvious for the compiler that none of the intermediate string objects are saved so why should he waste time constructing these?
And the compiler talk is "don't help the compiler".
If he wanted to be accurate he'd say something like "don't do these very specific things I interpret as helping the compiler when actually I'm discouraging you from making my job slightly harder".
>>61407160
Proper name for C++ spelled out.
>>
rec me a compiler book
>>
>>61404703
>Hate videogames, haven't played one this decade
>Hate gamers, realize they're ruining /g/
>Kinda want to make a game

How to describe this feel.
>>
>>61407180
>c++ is nice but very explicit.
Compared to what? Java?
>>
I'm glad the D shilling has come to an end.
>>
>>61407248
i guess after D died it was inevitable that its fanbase would follow
>>
>>61405954
Yeah that malloc in is_pandigital is unnecessary.

Do
unsigned char has_num[9];
instead of mallocing. The maximum number of digits it can be is 9. I don't know why you're using a 64 bit int for boolean values.

You're lucky that code doesn't segfault on numbers like 17, because you're mallocing hasnum to a length of 2, and then trying to read position 6.
>>
File: 1500190205815.png (31KB, 500x500px) Image search: [Google]
1500190205815.png
31KB, 500x500px
>>61407197
Dragon book
>>
>>61407248
They probably have better things to do during the summer than post on /dpt/.
I still like D though.
>>
>>61406682
so you basically want to do this to "pack it"?

#include <stdio.h>

struct s
{
long int x; //8 bytes : 6 bytes int, 2x1 byte chars
};

int main()
{
struct s icc;
// int: xxxxxx00
icc.x = (5 << (8*2));
// first char: 000000x0
icc.x |= ('a' << 8);
// second char: 0000000x
icc.x |= '\n';

/*
* this is how I'll address them every time to save
* a glorious 2 bytes
*/
printf("%ld, %c%c", icc.x >> (8*2), (icc.x >> 8) & 0xff, icc.x & 0xff);
return 0;
}
>>
>>61407287
>>61405954
Oops another bug. You're reading a negative index when you encounter a prime with a zero in it. So count your blessings your code didn't segfault on 103.
>>
>>61407309
It has some nice ideas.
>>
>>61407232
yeah, compared to Java. Even more so compared to non-systems programming languages.
>>
File: 1492820305500.jpg (131KB, 459x448px) Image search: [Google]
1492820305500.jpg
131KB, 459x448px
>>61407180
>A functional language like Haskell would also be fun to learn.
i said object oriented, i already know haskell because you guys memed me into learning it. you're 'making me so ANGRY right now
>>
>>61407409
I agree, but only in part. It's more explicit, but it's not more verbose. Java makes you repeat yourself two or three times to compile, whereas everything you type in C++ has actual implications.
With auto, the majority of the cruft in C++ melts away.
>>
>>61407429
>didn't listen to sane advice
>posts frog
wow big surprise. You should learn Rust.
>>
File: 1500217716489.jpg (70KB, 770x760px) Image search: [Google]
1500217716489.jpg
70KB, 770x760px
>>61407460
>>
>>61407429
>I already know haskell
Doubt it.
>I want OOP
Double doubt it.
>>
>>61407469
Exactly.
>>
are the people who put haskell on their CV actually autistic? everyone i know has had to learn haskell for at least 1 class and i only see a very select few put it on their resume, and they all without fail seem like they're on the spectrum
>>
>>61407429
it was a general suggestion. I answered your other questions and gave you a free piece of advice
be happy lad

>>61407446
That's true I guess. both C++ and Java have antiquated syntax imo, and that makes it feel much more heavy to read through. Their type systems are also pretty inflexible. Look at how ugly C++ templates are compared to Haskell type variables, for example.
>>
>>61407248
I'm a D fag, ama
>>
>>61407510
there aren't many classes that teach haskell actually. if someone ACTUALLY knows haskell enough to work on a large codebase, why shouldn't they put it on their cv?
>>
Teaching myself C/C++. Should I use a proper IDE or a text editor like Sublime or VSCode?
>>
File: 23456y7dyhcg.png (11KB, 500x500px) Image search: [Google]
23456y7dyhcg.png
11KB, 500x500px
>>61407548
>work on a large codebase
>large codebase in haskell

hmm
>>
>>61407572
sweet summer child
>>
File: 1497644311022.gif (261KB, 400x400px) Image search: [Google]
1497644311022.gif
261KB, 400x400px
>>61407334
At least the other anon knew what packing is. You don't.
>>
>>61407566
Use a text editor while you're learning.
>>
>>61407548
>there aren't many classes that teach haskell actually
Haskell's a pretty standard language in a programming language theory course I think. The college I went to made you write a project in C, Haskell, ML, Prolog, and Scheme, and that course was mandatory for CS. Or at least that's my understanding because I got a degree in math.
>>
>>61407669
i think i had that exact same class. we did haskell, prolog, scheme and java though
>>
>>61407632
What's an easy way to build from a text editor though?
>>
>>61407692
Maybe. Did you go to a UT system school?

My knowledge of this course was listening to my CS friends whine about it. So I'll count 3/5 as a success.
>>
>>61407695
The programs you write while you're learning will be basic enough that you can just compile them directly with gcc.
>>
>>61407695
tmux with vim in one window and a shell with gcc/g++ or a makefile in the next
>>
>>61407695
Makefiles. Here's a simple one to get you started
main : main.c
gcc -o $@ $<
>>
>>61407669
My programming paradigms course was c, scheme, python, SML and f#
>>
>>61407632
alt tab to terminal
gcc main.c
./a.out
>>
>>61407669
No ASM? No APL? No Forth?
pfft not much a college
>>
>>61407566
>Should I use a proper IDE or a text editor like Sublime or VSCode?
Sublime is a 'proper IDE' by your measure?
I can see the argument for VSCode but.

I say you should go with an IDE.
>>
Searching alternatives to quantopian. It's ridiculous how much time a backtest on a strategy that makes less than a trade a day takes. I'm just starting out and waiting for results while just trying to understand how this shit works is killing me.

Feel free to suggest anything.
>>
>>61408339
I was saying that Sublime and VSCode are text editors and asking if I should use them instead of a proper IDE.
>>
>>61407209
I get that. I don't really enjoy playing but I like gamedeving.

>>61407197
>>61407288
I've heard that the dragon book's outdated. I would suggest comparing it with something like this:
https://www.cs.princeton.edu/~appel/modern/
especially the ml version because sml is great for compiler dev.
http://flint.cs.yale.edu/cs421/case-for-ml.html
>>
>>61408403
Ah.
I think the peak of features you might need when learning is a debugger, it's very helpful to step through code and read some memory when learning.
So VSCode should serve you. Dunno what debugging facilities Sublime has but you shouldn't waste your time learning GDB early on.
>>
>>61405729

++(*b) &= 1
>>
I want to switch to remote development workflow(weak laptop + powerful server).
The problem is: I don't know what tools can provide a good support for this workflow.

For example, look what happens if something goes wrong with a nuclide remote server: nuclide is unable to gracefully restart server, it is unable to save changes in a file, and it will lose the changes on atom restart. I have to manually save all the changed files to some local directory and manually synchronise them when I can re-establish a connection.
I want something that has some kind of "offline mode". I.e. remote version should be a primary one, but I always want to have a local project copy that auto-synchronises with the remote one.
>>
What's the best way to learn Idris?
>>
File: star_consider.png (123KB, 600x600px) Image search: [Google]
star_consider.png
123KB, 600x600px
I write a library in BSD.

Someone puts my library in a GPL project, and makes a few useful changes to it.

I merge the changes back into my library.

Is my library GPL now?
>>
>>61408429
VSCode has a debugger now?

Visual Studio does...
>>
>>61408490
I'm told it does. Looking at the feature list it wouldn't fit me but for someone just learning I'm sure it's fine. Looks like it's just your basic thing with breakpoints, watch window and the like.
>>
>>61408473
no.
>>
>>61408473
their project is GPL, but your library stays bsd unless you change the license yourself.
they cannot interfere.
>>
>>61408352
I dunno your area but I've found these datasets helpful:
http://www.cs.cmu.edu/~pavlo/datasets/index.html

>>61408472
http://gen.lib.rus.ec/book/index.php?md5=0462E4D37DDEE4BBF33FBB5A6533D166
>>
>>61408490
VSCode has had a debugger since almost its release.
As in: It has had extensions that run debuggers for varying languages. There's no guarantee there's one for your language of choice.
>>
>>61408472
(->> you
Learn basic functional programming, i.e. anything with higher-order functions
Learn BDSM-style functional programming, i.e. Haskell or Purescript
Read Idris docs, compile a couple of projects, play with dependent types a bit, and forget about Idris in favour of something more practical)
>>
>>61408473
No, but you did violate copyright law.

His changes are copyright to him. To integrate his changes into your library, he has to transfer copyright to you or waive his copyright on his changes.
>>
What are some essential readings for upper-level CS students?
My university is turning out to be a complete joke and I can feel my brain starting to atrophy.
I've got
Intro to Algorithms (MIT Press 3rd Edition)
Operating System Concepts (Silberschatz, 9th ed)
Computer Systems: A programmer's Perspective (Bryant/O'Hallaron)
and The Pragmatic Programmer (Hunt/Thomas)

I'm not sure where to start with these though. I'm doing the algo/data struct class right now but what we're taught/tested on is woefully small compared to what the chapters in the textbook are going on about. Should I just stick with that book for now or?
>>
>>61408568
>>61408473
Er, to elaborate on this further. His changes are jointly copyright between you and him. He'd have to specify the changes as MIT or public domain for you to integrate them.

If he publishes the changes as GPL then you can't put them in an MIT project because copyleft. That's why GPL is called viral.

t. copyeditor
>>
>>61408473
>Someone puts my library in a GPL project, and makes a few useful changes to it.
This is actually an issue of contributor agreement, not license. If your library also ships with a contributor agreement that states that added code is also BSD licensed, then you can merge their changes back with no problems. Otherwise, unless they explicitly license their changes, the code they added to your library is unlicensed and they retain copyright to it, so you can't add it back at all.
If they license their changes to your library as GPL and you merge it back into your codebase, then you now have a multi-licensed codebase, with most of being BSD and the additional code they wrote being GPL'd.

In practice nobody actually cares about this though. You would just merge it back and consider it to be BSD licensed, and nobody would throw a fit over it.
>>
>>61408629
Surely it is important to ensure that GPL code remains GPL?
>>
>>61404819
I would start with main() if I were you.
>>
>>61404819
check Game Programming Patterns out.
>>
>>61408667
That is the point of GPL, to eventually have all software be licensed under Stallman's cyber-communist dream.

So if you ever see a GPL extension to your library published by a "RMS," don't integrate it.
>>
Anybody got experience with streaming audio? I'm making an application which streams live audio via websockets. Is it typical to stream it uncompressed? How's the latency? I want the stream to be essentially live so I don't want to buffer too much ahead of time (a few seconds is fine). Anyone have any good docs on something like this?
>>
>>61408667
You're not relicensing their entire project or anything.
This situation usually comes up when someone includes a more permissively licensed project in their own and makes some minor changes to it to make it work better for their purposes and then doesn't license the changes at all.

Their project is GPL, but their changes to your library are unlicensed. You technically can't merge the changes back into your project, but usually you would anyway and nobody would care.

Now if he explicitly licenses his changes to your library under the GPL, then you cannot merge them back in without keeping them licensed under the GPL. You do not have to relicense your entire project to GPL, but you do need to keep his changes licensed under the GPL. Avoiding this situation is the reason why contributor agreements exist.
>>
>>61408739
My library is GPL, so integrating additional GPL code is fine.
>>
>>61408879
Don't integrate AGPL code then and if you're v2, don't integrate v3.
>>
>>61408888
I'm on v3. Problem?
>>
>all this licensing crap
Jeese I didn't think it was this complicated just to collaborate.
>>
>>61408876
>You technically can't merge the changes back into your project, but usually you would anyway and nobody would care.
Wouldn't that be copyright infringement?
>>
>>61408902
Solution is don't collaborate with idiots honestly.
>>
>>61408929
Another solution is not to throw a shitfit about some projects being GPL.
>>
>>61405552
Have you read the dragon book?
>>
>h-how dare you publish an open source library, but with a license that prevents me from putting it in an app and selling it on an app store
>I DEMAND that you let me make money for free using your work
Stop.
>>
>>61408924
Yes, hence "technically can't merge the changes back into your project"

But again, nobody ever cares in this situation. It's left unenforced because of how often small changes are left unlicensed accidentally.

If some asshole actually tries to come after you for it, then you remove their changes and reimplement them yourself.
>>
>>61408850
I've only done streaming audio with Core Audio for an emulator project, but the question about uncompressed is interesting.

For a 44.1kHz stream, assuming samples are 4 byte floats and you have a stereo source, that's 44100 x 8 bytes a second, or ~344k/s worth of data, assuming no metadata, which doesn't sound unreasonable.
>>
>>61404703
New ray-voxel collision detector. 140 lines shorter than old one, more generalized, hopefully less glitchy, and 10000% more maintainable. Still need to optimize.
>>
>>61408997
>then you remove their changes and reimplement them yourself
Surely you'd need to get someone else who hadn't seen the changes to do a clean-room reimplementation?
>>
>>61409042
Unless they're doing something very complex and novel, no.
>>
>>61408991
>I want my project to be tossed into the refuse bin of history
>meanwhile the cuck who writes a similar project in MIT becomes famous because Facebook and Microsoft use his software
>his software becomes industry standard
>>
File: t.png (50KB, 1680x1050px) Image search: [Google]
t.png
50KB, 1680x1050px
>>61404703
>What are you working on, /g/?

Exploring the deepest, darkest corners of Racket.
>>
>>61405695
>Bash
vomit.png
>>
learning javascript now, is it too late or is it still good one to learn? what can I do with js? I'm thinking about making a script to batch click a specific anime from nyaa

also, why isnt this correct?
>>
>>61409285
remove the space betwen "cake" and .length
>>
>>61409285
Javascript is deprecated.
>>
>>61409315

the console log still output the correct answer, does it matter moving forward or is this a particularly fussy academy that wants you to do everything according to their standard?


>>61409324
so what, learn python? i don't want to learn shit that have to import library to get it to work complex stuff
>>
>>61409394
It's technically wrong but javascript engines will find a way to run just about anything.
>>
>>61409394
Python is deprecated.
>>
>>61409100
How does that font not rape your eyes?
>>
>>61409100
That's not even that deep or dark.
for/sum
triggers me though. Why can't you just use a fold like a normal person?
>>
>>61409494
So are you
>>
Is there a combined create+alter table command for postgres? Basically I have a script with a bunch of creates. I want to change my db structure a bit. Ideally I'd just change the script with my create statements and re-run the script, instead of having to remember to update the script every time i alter a table.
>>
New thread:

>>61409624
>>61409624
>>61409624
>>
>>61409631
Dumbass
>>
>>61409631
lel
>>
Why does Java exist?
>>
>>61409686
So a thousand pajeets can slave away at a project and hack together something that works.
>>
>>61409686
Why do (You) exist?
>>
>>61409686
So they can diversity quota in useless women and niggers to fuck them.
>>
>>61409631
What happened?
>>
>>61409686
Garbage collected, well tooled multiplatform, statically typed. Best language in class that fulfills those requirements.
>>
>>61409610
Drop the tables, then recreate them.
>>
>>61409728
That creates annoying overhead of having to copy and restore the data. I was hoping for an UPSERT but for tables.
>>
New thread:

>>61409756
>>61409756
>>61409756
>>
>>61405284
>project euler

I love doing these, but I think I'm at a point where I don't know enough about algebra or number theory to be able to do these problems without a large amount of help.

I really like your solution, though! I did this in C++ and complicated everything by using maps and vectors, when really, all I needed was an array.


int solve(const int MAX_PERIMETER)
{
int perimeter = 0;
std::map<int, int> perimeterToOccurrence; // perimeter for the key and its number of occurrences as the value
std::map<int, std::set<std::set<int>> > perimeterToTriangle;
for(int m = 1; m < 30; m++)
{
for(int n = 1; n < m; n++)
{
int k = 1;
std::vector<int> triangle = getTriple(m, n, k);
perimeter = getPerimeter(triangle);
int perimeter_COPY = perimeter;
while(perimeter_COPY <= 1000)
{
perimeter_COPY = perimeter * (k++);
/* get the next integer multiple of the original permiter, and increment k */
incrementM(perimeterToTriangle, perimeter, vecToSet(triangle));
}
}
}
std::cout << "Done!" << std::endl;
int maxPerSize = 0, maxPerInd = 0;

for(auto it = perimeterToTriangle.begin(); it != perimeterToTriangle.end(); ++it)
{
if(it->second.size() > maxPerSize)
{
maxPerSize = it->second.size();
maxPerInd = it->first;
}
}
std::cout << "# OF SOLUTIONS: " << maxPerSize << std::endl;
std::cout << "PERIMETER WITH MOST SOLUTIONS " << maxPerInd << std::endl;
return perimeter;
}
std::vector<int> getTriple(int m, int n, int k)
{
std::vector<int> retVec;
retVec.push_back( k * (m*m - n*n) ); //a = m^2 - n^2
retVec.push_back( 2*k*m*n); //b = 2mn
retVec.push_back( k* (m*m + n*n) ); //c = m^2 + n^2
return retVec;
}

int getPerimeter(std::vector<int> t)
{
return std::accumulate(t.begin(), t.end(), 0);
}
>>
>>61409843
>std::map<int,
but why
>>
>>61409514
>>61409580
please, don't bully.

>>61409580
>Why can't you just use a fold like a normal person?
haven't' reached that level yet.
>>
Someone explain to a brainlet such as me why EOF = 0 in C
>>
>>61410045
*EOF =-1
whoops
>>
This is my last semester of basic programming and software dev courses.
What can I expect out of upper division courses? I have an emphasis in Computer Systems. So courses like Networking, Compilers, and Operatig Systems.
>>
>>61405284
Please optimize your code.

#include <stdio.h>
#include <math.h>

int solutions[1001];

unsigned isqrt(unsigned x) {
unsigned y = 0;

for( unsigned m = 0x40000000 ; m ; m >>= 2 ) {
unsigned b = y | m;
signed t = (signed) (x | ~(x - b)) >> 31;

x -= b & t;
y = (y >> 1) | m & t;
}

return y;
}

int main() {
/* we require that a > b (so that solutions are only counted once) and that
* a + b + c < 1000; this is encoded in maxb. the expression after (signed)
* evaluates to the maximum b such that a + b + c < 1000, and 293 is the
* first number in the range [1, 500[ in which a >= (the expression).
*/

for( unsigned a = 1 ; a < 293 ; a++ ) {
unsigned asq = a * a;

for( unsigned b = 1 ; b < a ; b++ ) {
unsigned csq = asq + b * b;
unsigned c = isqrt(csq);

if( c*c == csq ) {
printf("%u^2 + %u^2 = %u^2\n", a, b, c);
solutions[a + b + c]++;
}
}
}

for( unsigned a = 293 ; a < 500 ; a++ ) {
unsigned maxb = (signed) (1000 * a - 500000) / (signed) (a - 1000);
unsigned asq = a * a;

for( unsigned b = 1 ; b < maxb ; b++ ) {
unsigned csq = asq + b * b;
unsigned c = lround(sqrt(csq));

if( c*c == csq ) {
printf("%u^2 + %u^2 = %u^2\n", a, b, c);
solutions[a + b + c]++;
}
}
}

unsigned val = 0, max = 0;

for( unsigned i = 1 ; i < 1001 ; i++ )
if( max < solutions[i] ) {
max = solutions[i];
val = i;
}

printf("val: %u, solutions: %u\n", val, max);

return 0;
}
>>
>>61407288
dumb frogposter
>>
>>61410045
>>61410060
From the Kernigan and Ritchie book (pg 16):

>EOF is an integer defined in <stdio.h>, but the specific numeric value doesn't matter as long as it's not any char value.
>By using the symbolic constant, we're assured that nothing in the program depends on the specific numeric value
>>
>>61410045
>>61410060
it's not -1, that's implementation defined
Thread posts: 322
Thread images: 31


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