[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 31
File: 1463198678174.jpg (47 KB, 692x960) Image search: [Google]
1463198678174.jpg
47 KB, 692x960
Old thread >>54653610

What meme/project are you working on /g/?
>>
File: poop.png (165 KB, 1077x592) Image search: [Google]
poop.png
165 KB, 1077x592
>>54656366
Rewriting the Linux kernel in Haskell.
>>
Rewriting the Haskell kernel in Linux
>>
Rewriting the C standard in Haskell.
>>
>>54656425
>[Deleted]
Sweet irony. Didn't know /g/ had mods, nice job.
>>
File: has_u_red_it.jpg (3 MB, 2448x3264) Image search: [Google]
has_u_red_it.jpg
3 MB, 2448x3264
>>54656425
This one is 13:37, though.
>>
>>54656366
legit thread

https://www.youtube.com/watch?v=wLHl8zJxeUQ
>>
File: lispbest.jpg (253 KB, 840x412) Image search: [Google]
lispbest.jpg
253 KB, 840x412
The broken promise of static typing

http://labs.ig.com/static-typing-promise
>>
>>54656486
Where is OCaml?
>>
File: akari3.jpg (92 KB, 912x576) Image search: [Google]
akari3.jpg
92 KB, 912x576
pls rate my dumb music program~
pipe the output to your sound card!

unsigned char b[], r1[], r2[];/* run: 'gcc -o pcm pcm.c && ./pcm | aplay' */
main(p,c,m){p=0,c=1;while(1){for(m=0;m<10000;m++){unsigned char*a=(c)?r1:r2;
putchar(((char)((float)(*(a+m)+*(b+m))/2.0)));}if(p++>2){p=0;c=!c;}}}/* <3 */

full program here -> https://a.pomf.cat/vbrtpq.c
>>
File: sier.png (6 KB, 644x353) Image search: [Google]
sier.png
6 KB, 644x353
Rewriting yet another CHIP-8 emulator in C++. I've posted about it here before, but here's the source if anyone wants to see it.

https://github.com/JamesJDillon/CHIP-8-Emulator
>>
>>54656486
Clojure has few bugs because nobody wrote anything more complex than hello world with it, just look at the commit count.
>>
>>54656486
I already felt this was true from personal professional experience

>experienced more issues with Java despite it being designed to be safe
>fucking Python is smooth as fuck to dev in and we end up more productive too

I don't know why /dpt/ pushes this 'dynamic is unsafe' meme
>>
>>54656486
It's not lisp's dynamic typing as much as it is the sweet sweet homoiconicity that makes it easy to write bug free code.

That being said static typing is obnoxious. Most of my issues are implementation issues not type issues.

>>54656491
It's in the F# section.
>>
>>54656503
What's the most rewarding algorithm you implemented with chip-8 opcodes?
>>
>>54656511
F# and OCaml are clearly not the same thing.
>>
>>54656534
I know. One has freedom and the other doesn't. Otherwise they're pretty fucking similar. It's like Scheme vs Racket.
>>
Rewriting the assembly standard in python
>>
>>54656526
I've not created any chip-8 roms. I don't think it would be particularly difficult, just very time consuming.
>>
>>54656583
>Rewriting the assembly standard in python
>the assembly standard
>assembly standard
>the
Wat.
>>
>>54656511
>That being said static typing is obnoxious.
I find it to be the complete opposite - I like static typing because of the productivity gains, I don't necessarily care about whether it helps reducing bugs or not.
With static types (or I guess type annotation is what I actually care about) you get immense help when refactoring, navigating code and documenting the code.
>>
File: nico nico nii~.jpg (89 KB, 960x796) Image search: [Google]
nico nico nii~.jpg
89 KB, 960x796
Friendly reminder that there's nothing wrong with VLAs.
>>
>>54656596
it's a variant of the "rewriting the linux kernel in haskell" meme
>>
File: snake fast.gif (36 KB, 640x321) Image search: [Google]
snake fast.gif
36 KB, 640x321
>>54656593
Shit's fun tho
>>
>>54656609
There's everything wrong with them, they are 100% useless.
>>
>>54656609
It's a useless meme.

If you're working on a large project, you'll be explicit about static/dynamic, and not fussing about with VLA unnecessary magic
>>
>>54656486
He's so wrong that he's not even wrong.
>>
int main()
{
int n=_____
srand(n);
}


Well /dpt/. What do you do?
>>
>>54656620
I saw you post your emulator the other day when I had a weird problem with writing my emulator. I didn't know whether it was a graphical glitch due to some SFML fuck-up, or an actual opcode error.

Turns out I had a brainfart, and was accidentally accessing some value of the memory array when I should've been I should've been getting from the register array. Stupid mistake.
>>
>>54656668
int n=*0

At least I won't be responsible for anyone using fucking srand() in 2016.
>>
>>54656668
>stdlib rand
>any year
>>
>>54656668
Seed it with the nanosecond value of a read from clock_monotonic. If you need more than 1 billion possibilities you probably shouldn't be using rand().
>>
>>54656711
Please never do anything that involves cryptography or security in any single way, ever.
This is the most terrible advice in the history of broken shit.
>>
>>54656717
even for non-crypto applications, there are much nicer more modern methods like xoroshiro128+
>>
>>54656717
You're not using rand() for cryptography you idiot. If you are then you deserve death.

As such my method is perfectly fine.
>>
>>54656668
Make it a constant because I generally want a consistent series for reproducibility .
>>
>>54656668
You can write your own faster and statistically normal rand() in 10 seconds, literally anything is better than the bloated shit that's part of glibc.
>>
>>54656735
rand() is implementation-dependant, it could literally return 0 all the time and that would be a valid implementation.
Even for reasonnably distributed random-looking numbers, you can't rely on rand().
>>
>>54656760
Oh really? How?
>>
>>54656780
http://xoroshiro.di.unimi.it/
>>
>>54656760
Why doesn't glibc use xoroshiro or something then? It's a free software project can't someone just push a change to use a better randomizer?
>>
>>54656780
https://software.intel.com/en-us/articles/fast-random-number-generator-on-the-intel-pentiumr-4-processor
>>
>>54656780
char r;
read(open("/dev/urandom", O_RDONLY), &r, 1);


I'm actually serious.
>>
>>54656780
2 shifts, an add and a bit rotate is what I use for most of my demo projects.
>>
>>54656813
It's probably higher quality randomness, but you're wasting thousands of processor cycles on creating a file handle instead of just scrambling numbers using a LCG.
>>
int rand() {
return 4;
}
>>
>using /dev/random unironically
>in the year 2016
I shiggedy.
>>
>>54656780
int n=0, PRIME = 961753369, genSize = 1234;

n = (n + PRIME) % (genSize);
....

Will give you a perfect permutation of 0..genSize as long as PRIME and genSize are relatively prime (which they are if genSize<PRIME).
>>
>>54656798
Well since the C standard doesn't impose any requirements about distribution or period, you couldn't rely on it anyway.
>>
File: 1462042225413.jpg (57 KB, 765x430) Image search: [Google]
1462042225413.jpg
57 KB, 765x430
>Haven't programmed in 2 days
>>
>>54656881
I don't think that's a good excuse to have shit. And you could rely on it if your platform uses exclusively glibc.
>>
File: 1417911861742.jpg (8 KB, 217x250) Image search: [Google]
1417911861742.jpg
8 KB, 217x250
>>54656892
>Spent 2 days programming an application to forge my job search history so I can do even less work
>>
>>54656892
get to it
>>
Are there any benefits of typefedding structs besides not having to write "struct" all the time?
>>
here's some advice
on school laptops if they're using chrome dumb students will login and save their passwords

if you go to settings > manage passwords you can actually print their login info out for literally all of their accounts.

After you graduate this will be helpful if you need to do further research or frame someone for something
>>
>>54656925
No, that's literally the only benefit.
>>
>>54656925
If you're writing a library and that struct is integral to your library, like a context, yes, it should be a typedef.
>>
>>54656925
typedefan is the same as #define'an except the compilar can use its black maagick and optimize u're code
>>
>>54656912
Send a patch and see if it gets accepted ^)
>>
>>54656925
C++ compatibility
>>
>>54656965
glibc is dead to me since my boi Ulrich left
>>
>>54656938
Here's some more advice.
On school networks where you need to enter your name/password to connect to the internet, Ethereal + Wireshark will hapilly give you a list of everyone's passwords.

You can also use Ethereal for replacing all images on the fly with !beecock.jpg when people browse the Internet. I had fun in boarding school.
>>
>>54656999
s/Etherreal/Ethercap/
>>
>>54656945
>>54656950
>>54656956
>>54656971
Thanks, I kind of liked not typedeffing all my structs so I can immediately tell if a struct belongs to a library or if I defined it myself.
Just wanted to check if I missed a hidden benefit.
>>
>>54656366

Web application framework written in an intermediate language which compiles to ZendEngine C.
>>
const float vertices[] = {
-0.25f, -0.50f, 1.0f, 0.0f, 0.0f,
0.50f, -0.50f, 0.0f, 1.0f, 0.0f,
0.50f, 0.50f, 0.0f, 0.0f, 1.0f,
};


#version 410 core

layout(location = 0) in vec2 position;
layout(location = 1) in vec3 Color;

out vec3 color;

void main()
{
gl_Position = vec4(position, 0.0, 1.0);
color = Color;
}


#version 410 core

layout(location = 1) in vec3 color;
out vec4 Color;

void main()
{
Color = vec4(color, 1.0);
}


Why does it produce a rainbow?
>>
>>54657044
OpenGL averages color by default so when you have red in 1 vertex, blue in another, and green in the last, you get a motherfuckin' rainbow.
>>
Can somebody explain this xor rotate shift rotate thing to me?
>>
>>54656999
my school has very up-to-date network security sadly so I wouldn't risk it
>>
>>54657060
oops average is incorrect term. bilinear interpretation is better term
>>
>>54657044
OpenGL is ran by sjw jewish multinationals who want to control the whitey by pushing homosexuality, abortion and higher taxes

VOTE TRUMP
MAKE AMERICA GREAT AGAIN
>>
>>54657044
Because if you want 3 solid bars you need 3 solid bars.
>>
>>54657077
If you change your MAC, there's literally no way to catch you ARP-poisonning the local router.
Easy way to have some fun watching people reload madly while their facebook feed fills with beecocks.
>>
>>54657095
>not forcing HTTPS
>>
>>54657111
Oh yeah Facebook probably 301's to HTTPS nowadays, but it used to be that you could just SSLStrip it.
>>
>>54657044
varying/out variables get linearly interpolated between vertices
>>
>>54656366
I finished my pastebin editor, my thread scraper, and my intermediate framework

Now all I need to do is pipe the inputs between each module properly and sanitize everything. Made a lot of progress actually.
>>
I wonder if I could make money undercutting 4chan passes by selling a browser addon that uses commercial Captcha-solving websites.
>>
>>54657161
don't be a jerk, 4chan needs money
>>
File: faggot.jpg (36 KB, 615x461) Image search: [Google]
faggot.jpg
36 KB, 615x461
>>54657168
But sigourney literally abandonned us and ran to mootxico, what's the point?
I'm sure hiro can pay for servers.
>>
Someone gave me some snippets to some array system for C awhile go, and i've been working on something that lets me queue SDL_Texture's into an array.
//array.h
void *array_add ( Array *arr );
#define array_add_val(type, arr) (*((type *) array_add(arr)))

//array.c
void *array_add ( Array *arr )
{
if ( ++arr->length > arr->capacity )
arr->buf = realloc( arr->buf,
arr->element_size * (arr->capacity = arr->capacity << 1) );

return arr->buf + arr->element_size * (arr->length - 1);
}

//texture.h
typedef struct
{
unsigned int ID;
SDL_Texture *txr;
unsigned int w;
unsigned int h;
} TxrArr;

Array *G_txr;

//texture.c
void texture_add ( char *filename )
{
SDL_Texture *t = NULL;
t = textureLoad( filename );

unsigned int ID = texture_generate_id();

unsigned int w = getTextureW(t);
unsigned int h = getTextureH(t);

array_add_val(TxrArr, G_txr) = (TxrArr) { ID, t, w, h };
}

I didn't post everything but I will post more if you need it.

my getTexture functions just run SDL_QueryTexture and return the value, they work. BUT, they don't store in texture array that's just made. A workaround is to add this to the bottom of the texture_add function
TxrArr *p = array_get ( G_txr, ID ); 

p->w = w;
p->h = h;

p = NULL;

It seems unnecessary, but it's the only way I can actually force those values to be set lol.
>>
>>54657161
we solve ridiculously many captchas, i don't think you could undercut it
>>
>>54657191
Hey what about you stop reposting the same crap every thread and go annoy people on StackOverflow?
>>
Hey gee, are pointers signed or unsigned in C?
>>
>>54657206
this is only repost #1, if nobody is interested in seeing after a thread or so then i'll leave it be
>>
>>54657226
Unsigned.
>>
>>54657226
I prefer the term 'autographed'
>>
malloc
a
l
l
o
c
>>
>>54657226
your mom
>>
>>54657235
get a load of this webshit!
>>
>>54657226
Pointers are just a bunch of bits. Asking whether they're signed is like nonsense.
>>
>>54657226
Pointers are pointers. They are neither signed nor unsigned. They are no numbers, they point to addresses in the memory. You can interpret them as signed or unsigned numbers, it just doesn't matter.
>>
>>54657279
>integers are just a bunch of bits
>asking whether they're signed is like nonsense
anon...
>>
File: jewHidden.jpg (26 KB, 256x257) Image search: [Google]
jewHidden.jpg
26 KB, 256x257
>>54657196
Well a captcha solve goes for around $0.001, assuming you make 5,000 posts per year, which is 95 posts per week, it'll cost 5 bucks a year. A 4chan pass is $20 a year.

If you don't post much more than a hundred times a week, which is probably the majority of people, I can cut the price in 4 AND you don't lose it if you get b&.
>>
For fun, I'm finally getting through the python koans and working through a haskell book.
>>
>>54657279
everything is bits you moron
>>
>>54657261
what the hell are you on about?
A pointer is an address in memory.
It does not make sense to cast it to a signed integer, but you can do what ever with the value.
>>
>>54656729
How the fuck does this shit even work?
uint64_t s[2];

static inline uint64_t rotl(const uint64_t x, int k) {
return (x << k) | (x >> (64 - k));
}

uint64_t next(void) {
const uint64_t s0 = s[0];
uint64_t s1 = s[1];
const uint64_t result = s0 + s1;

s1 ^= s0;
s[0] = rotl(s0, 55) ^ s1 ^ (s1 << 14); // a, b
s[1] = rotl(s1, 36); // c

return result;
}


/* This is the jump function for the generator. It is equivalent
to 2^64 calls to next(); it can be used to generate 2^64
non-overlapping subsequences for parallel computations. */

void jump(void) {
static const uint64_t JUMP[] = { 0xbeac0467eba5facb, 0xd86b048b86aa9922 };

uint64_t s0 = 0;
uint64_t s1 = 0;
for(int i = 0; i < sizeof JUMP / sizeof *JUMP; i++)
for(int b = 0; b < 64; b++) {
if (JUMP[i] & 1ULL << b) {
s0 ^= s[0];
s1 ^= s[1];
}
next();
}

s[0] = s0;
s[1] = s1;
}

int main()
{
jump();
std::cout<<s[0]<<','<<s[1];
}
>>
>>54657315
>integers are in any way equivalent to pointers

baka, anon.
>>
>>54657345
they are both abstractions of bits, so your answer is unsatisfactory
>>
>>54657315
Integers are bits that are interpreted as numbers. That's why you can say whether they are signed or not. Pointers are not interpreted as numbers, so they don't have a sign. If you want to see a numerical representation of the addresses the pointers point to, then you can freely choose what representation that is. There are probably conventions for that though.

>>54657330
Confirmed retard.
>>
File: 1111.png (162 KB, 921x655) Image search: [Google]
1111.png
162 KB, 921x655
>>54656497
>implying i'm going to run an obfuscated program
>>
>>54657315
Anon whether pointers are "signed" is meaningless to a human writing in a language with pointers.
>>
>>54656694
>>54656701
>>54656751
>>54656751

C confirmed garbage.
>>
>>54657392
You can read what it's doing, all it does is output mixed 8-bit unsigned PCM audio.
>>
>>54657317
i'd guess i make around 1000 posts/week
>>
>>54656497
aplay: playback:2716: read error
>>
>>54657191
Why do I have a feeling you're the same dumb fuck that spammed /dpt/s for weeks with his Lua bullshit because he couldn't read the documentation?
>>
>>54657361
That doesn't make them equivalent. Treating them like integers is baka.
>>
>>54657418
maybe he was referring to how you didn't properly space your code to make it readable
>>
>>54657448
Was it some image library?
>>
File: hurrrrr.gif (2 MB, 371x331) Image search: [Google]
hurrrrr.gif
2 MB, 371x331
>>54657427
That would be one post every 10 minutes assuming you literally never leave 4chan to sleep, eat, or piss.
I sure hope you don't.
>>
>>54657457
Yeah, it's like saying floats and integers are the same because they're composed of bits.
>>
>>54657344
the state is in s[2], you seed it so it's not just zero

you call next to get a pseudorandom 64 bit number

jump is only necessary if you have parallel computations like if you're doing multithreading and different threads need to have its own random, a call to jump skips ahead by 2^64 calls so a thread can get its own sequence of 2^64 or more pseudorandom numbers
>>
>>54657457
C++ developer detected
>>
>>54657457
You're right, it doesn't make them equivalent.

You should have said that instead of 'they are a bunch of bits' considering everything is a bunch of bits
>>
>>54656497
So what did you do to generate the char arrays?
>>
>>54657466
Um no I think it was something related to entities in a video game.
>>
>>54657473
dunno how accurate the 1000/week is but it's often a bunch of posts in a row, one minute apart
>>
>>54657489
autism
>>
>>54657392
slightly prettier
unsigned char b[], r1[], r2[]; /* run: 'gcc -o pcm pcm.c && ./pcm | aplay' */
main(p, c, m) {
p = 0, c = 1;
while (1) {
for (m = 0; m < 10000; m++) {
unsigned char * a = (c) ? r1 : r2;
putchar(((char)((float)( * (a + m) + * (b + m)) / 2.0)));
}
if (p++ > 2) {
p = 0;
c = !c;
}
}
} /* ⤠*/
>>
>>54657487
I didn't say they're a bunch of bits. I said they're JUST a bunch of bits. As in only. As in therefore not integers because integers are more than a bunch of bits.
>>
>>54657487
That isn't useful.
>>
>>54657513
Neither is 'they are just a bunch of bits'
>>
>>54657473
>>54657499
like in the previous thread if i ctrl+f there are 82 (You), and that thread only lasted 3 hours
>>
File: stopPosting.jpg (31 KB, 410x307) Image search: [Google]
stopPosting.jpg
31 KB, 410x307
>>54657499
Mate one minute is literally the cooldown time...
And it was doubled from 30s to stop image dumps, not one guy spamming the board...
>>
>>54657524
fucking retard stop spamming
>>
>>54657524
stop posting memes
>>
>>54657528
>>54657531
>>54657535
k tard cmen cshart hot opinion kill yourself retarded sperg
>>
>>54657479
yes. exactly.

Every data structure is a bunch of bits, but that isn't useful to someone who is asking questions about how to use things in a program that they write. the original question asked a question that clearly showed a misunderstanding of pointers, and calling them "a bunch of bits" is a useless description.
>>
>>54657538
we need the whole thing
>>
>>54657307
>Pointers are pointers
>pajeet revelations
>>
>>54657523
I know. That's what I'm saying.

>>54657510
>pedantic

That isn't useful.
>>
>>54657448
no but I know who you are talking about; I lurk, and when I see something good I take it and work on it for my own learning. More often than naught they lead to dead ends but I usually figure out how that shit works by the end of it. That's how I passed my programming class this semester with an A.
>>
>>54657489
Manually
>>
>>54657571
So autism then?
>>
>>54657553
Fair enough, constant practice and playing around with stuff just for the fuck of it is what makes people actually good at something.
>>
>>54657524
could you copy the html down into pastebin for me? I'd be very interested in which posts are yours
>>
>>54657486
explain your meme
>>
>>54657524
>82 (You)s
Jesus fuck. Well it's good to know it's one guy and not many.
>>
>>54657595
this array thing interests me but it's like trying to do C++ without the C, not sure how far I can take it lol
>>
>>54657587
Not really, any decent hex viewer will output hex literals directly.
>>
File: Capture.png (10 KB, 463x294) Image search: [Google]
Capture.png
10 KB, 463x294
do you suppose windows does a linear regression when calculating download time?
>>
>>54657650
That only slightly reduces autism
>>
>>54657673
No, it's quadratic, that's why in some cases it says "11.948 + 8.6 i seconds remaining."
>>
>>54657701
lel
>>
>>54657673
Merci, doctor.
>>
>>54657611
i tried saving the page but the version of chrome i'm using can't download webpages, don't know how to get the html file otherwise
>>
Guys, give me something useful to code that I can show off on the Internet and be cool.
>>
>>54657510
>integers are more than a bunch of bits
nope, integers are just a bunch of bits tho
>>
>>54657729
press f12, click the body class, and press ctrl+c

>>54657779
web crawler/archiver for academic papers
>>
File: 735243242.jpg (187 KB, 1600x1066) Image search: [Google]
735243242.jpg
187 KB, 1600x1066
do people find "dat boi" humorous? out of all the dumb, forced memes in my day this one strikes me as the dumbest and most forced. am I just getting old or am I missing something?
>>
>>54657779
one-liner inverting a binary tree
>>
>>54657804
No, it's a stupid forced meme alright. Just /r9k/ type people trying as hard as they can to fit in.
>>
>>54657804
it's forced. It first appeared on reddit's board me_irl iirc
as far as I know /r9k/ doesn't even like it
>>
Beginner here.

Trying to do this stupid JavaScript challenge to get into this school, where we take these card numbers in an array, find the sum of the highest one, have it print out, etc.

var findLargeSum = (cards) => {
if (cards !== null) {
var dashSplit = '-';
if (cards.indexOf(dashSplit) >= 0) {
var cardNumbers = ['4916-2600-1804-0530', '4779-252888-3972', '4252-278893-7978', '4556-4242-9283-2260'];
var cardSplit = cardNumbers[0];
var cardInt = parse.Int(cardSplit);
}
}
}
findLargeSum(cards);
>>
File: 1463131282871.png (302 KB, 393x500) Image search: [Google]
1463131282871.png
302 KB, 393x500
>>54657804
It's an ancient meme that will outlive us all
>>
Hey gee, can a 2d array be allocated on the heap in C?
>>
>>54657845
Yes.
>>
>>54657801
alright now do i need to strip some data such as "delPassword", i'll try replacing the value, hope it doesn't break
>>
>>54657845
No, just allocate 2GB on the heap and move ESP to point to it then declare your 2D array on the stack.
>>
>>54657798
remove nihilist

Integers have more meaning than "a bunch of bits"
>>
>>54657827
yes it strikes me as very reddit, bunch of faggots trying to be ironic like 2009 was a long time ago.

>>54657833
I chuckled at this one.
>>
>>54657861
as far as I know there shouldn't be any identifying information in any html besides anti-spam values
>>
So if I'm understanding correctly, SDL2 uses its own functions for 2D rendering but has to call openGL for 3D and stuff like particle effects?
>>
>>54657830
Think harder, you can't turn your array into integers with that method.
>>
>>54657900
It calls whichever 3d library it feels is optimal, openGL is just one of them
>>
>>54657845
Sure. malloc just allocates untyped bytes, how you interpret them is up to you.
>>
>>54657845
Not on RHEL 4.
>>
>>54657915
But all the 2D stuff is handled by SDL itself?
>>
>>54657891
>You have exceeded the maximum paste size of 512 kilobytes per paste.
meh
>>
Tfw writing a MongoDB plugin for a program without even knowing how to CRUD in mongo
>>
>>54658054
absolute madman
>>
>>54656509
That's because Java is fucking garbage senpai.
>>
>>54657954
webshits actually believe this
>>
>>54657900
No, YOU have to use OpenGL.
>>
>>54657884
>integers are not bits
anon...
>>
How do my C programs know how to interpret SIGINT? Is that provided by libc? Could I, in theory, write a program that doesn't use any of that?
>>
>>54657833
check out dat boi and his boi puccy!
>>
>>54657845
you're reusing the memes too fast

int (*x)[m][n] = (int (*)[m][n]) malloc(sizeof(int[m][n]));
>>
File: IMG_20160520_112250.jpg (2 MB, 3120x4160) Image search: [Google]
IMG_20160520_112250.jpg
2 MB, 3120x4160
>>54657804

Dunno, but it was my choice of mediums for drawing Mohammad today.
>>
>>54658314
>drawing Mohammad
DELETE THIS
>>
>>54658314
Hahahaha Epic post Dude!!
>>
>>54657499
checked
>>
File: BENNIES.png (76 KB, 1366x650) Image search: [Google]
BENNIES.png
76 KB, 1366x650
What should I do with my life now that I don't have to look for work to claim benefits any more? All this free time and I have no idea how to manage it.
>>
>>54657804
kys
>>
>>54658345
start a software company
>>
>>54658368
What kind of software?
>>
>>54657830
how do you split strings in javascript
>>
>>54658384
depends on what you're interested in, maybe games, there are lots of different types of games you could make
>>
>>54658398
Games don't make money.
>>
>>54658409
Games development is the only way to make original applications in the modern age.
>>
>>54658409
they do if they're any good, don't just throw together a flappy bird clone in a couple of hours and expect to become a millionaire off the bat
>>
>>54658390
you kill yourself and you ever tried learning that piece of shit language.
>>
>>54658425
Look at the sea of indie games, some of them are actually good, but very lucky few make money.
>>
If the equality operator is ==, why isn't the inequality operator !==?
>>
>>54656612
Yeah, it's cancer. Don't participate.
>>
>>54658450
Because the equality operator is two equals symbols because one equals symbol is the assignment operator.
>>
>>54658450
Equality is == because = is taken, but !== makes no sense, all the other comparison operators are 2 characters.
>>
>>54658450
why would you waste a character ? does anyone really think that != is a DONT ASSIGN operator ?
>>
>>54657810

void invert(auto *t){if(t){swap(t->l, t->r);invert(t->l);invert(t->r);}}


>>54658322

No.
>>
>>54658450
It just isn't fag deal with it or if you don't want to

#define !== !=
>>
>>54658444
most of them are really shit, they're only "good" in your view because you have lower expectations for indie games and you don't have much experience so you can't tell how little effort they put into the game
>>
<_sre.SRE_Match object; span=(90, 105), match='>>54653644
<_sre.SRE_Match object; span=(338, 353), match='>>54653691
<_sre.SRE_Match object; span=(101, 116), match='>>54653833
<_sre.SRE_Match object; span=(101, 116), match='>>54653913
<_sre.SRE_Match object; span=(103, 118), match='>>54654025
<_sre.SRE_Match object; span=(103, 118), match='>>54654250
<_sre.SRE_Match object; span=(103, 118), match='>>54654471
<_sre.SRE_Match object; span=(103, 118), match='>>54654503
<_sre.SRE_Match object; span=(103, 118), match='>>54654897
<_sre.SRE_Match object; span=(114, 129), match='>>54654981
<_sre.SRE_Match object; span=(103, 118), match='>>54655013
<_sre.SRE_Match object; span=(103, 118), match='>>54655123
<_sre.SRE_Match object; span=(114, 129), match='>>54655142
<_sre.SRE_Match object; span=(103, 118), match='>>54655268
<_sre.SRE_Match object; span=(92, 107), match='>>54654981
<_sre.SRE_Match object; span=(103, 118), match='>>54655268
<_sre.SRE_Match object; span=(138, 153), match='>>54655177
<_sre.SRE_Match object; span=(92, 107), match='>>54655368
<_sre.SRE_Match object; span=(92, 107), match='>>54655518
<_sre.SRE_Match object; span=(123, 138), match='3 >>5465546
<_sre.SRE_Match object; span=(114, 129), match='>>54655736
<_sre.SRE_Match object; span=(103, 118), match='>>54655736
<_sre.SRE_Match object; span=(90, 105), match=' >>5465576
<_sre.SRE_Match object; span=(239, 254), match='>>54655736
<_sre.SRE_Match object; span=(92, 107), match='>>54655851
<_sre.SRE_Match object; span=(114, 129), match='>>54656123
<_sre.SRE_Match object; span=(154, 169), match='>>54656367
<_sre.SRE_Match object; span=(92, 107), match='>>54656428
<_sre.SRE_Match object; span=(92, 107), match='>>54656451
<_sre.SRE_Match object; span=(92, 107), match='>>54656689
<_sre.SRE_Match object; span=(92, 107), match='>>54656689

well here they are, folks. I really should clean this up..
>>
>>54658490
>how little effort they put into the game
Actually fuck you
>>
>>54658490
lol k
>>
>>54658481
Well, no. It was just a thought. Logically, it makes sense.
>>
>>54658500
ah and as you can see most of the (you)s in the last thread were false positives, and regex seems to have picked up on this.

and here's the messy code
from bs4 import BeautifulSoup
import re

file=open('temp.txt','r')
out=file.read()
soup=BeautifulSoup(out, 'html.parser')

def clean(text):
return re.sub(r'[^\x00-\x7F]',' ', text)

file1=open('out.txt','w+')

for posts in soup.findAll(('div'),{"class":"postContainer"}):
for reply in posts.findAll(('div'),{"class":"post reply"}):
tmp = reply.text
if 'you' in tmp:
pattern = re.search('............You',tmp)
out=clean((str)(pattern))[:-6]
print(out)
file1.write(out + '\n')

file1.close()
file.close()
>>
>>54658501
a lot of them genuinely put very little effort into their games, or if they did try hard it's like their first ever game so it's not going to be that great, don't be the entitled millennial kid that expects to get showered with money and fame just because they made a basic ass game
>>
>>54658540
>entitled millennial kid
next lvl bait
>>
>>54658308
>casting malloc
I want webshits out of muh gee!
>>
>>54658540
you've clearly never made a game before. It's extremely hard to create a game by yourself that earns the genuine praise of random strangers
>>
>>54658553
>he can't handle the truth
go back to your safe space >>>/vg/agdg
>>
>>54658554
>this is what Ctards think
lmao
>>
>>54658562
it's hard when you make shit that was literally shat out in a few weeks or a few months using a very shitty babby engine with pre-bought assets etc, of course the game is going to be shit when you use shit tools and don't even bother to learn anything, you're just a spoiled brat that decide off the bat that you're a competent game developer, and then you get butthurt when you don't become an overnight billionaire because you are this delusional
>>
File: 3RD PLACE TROPHY.jpg (57 KB, 576x1024) Image search: [Google]
3RD PLACE TROPHY.jpg
57 KB, 576x1024
>>54658481
Now I want a don't assign operator.
Hm, this should do the trick:
#define !== not_eq
#define != ,


So useful!
// Write one to p if it's not null!
void write_one(int* p) {
if (p !== 0)
*p = 1;
else
*p != 1;
}


Don't mind me, I'll just be waiting on my turing award over there.
>>
>>54658595
kek
>>
>>54658590
you are a fucking tard.
>>
>>54658622
you are a butthurt agggydaggy kid
>>
>>54658632
why would I be butthurt ? you gave out some of the worst advice i have ever read.
>>
>>54658662
ok so anon should give up and just watch animu all day, just because he decided ahead of time that he can't start a software/gamedev company?
>>
>>54658482
Are we even sure that's what invert meant? I remember his 'in depth' explanation was shit. No wonder he didn't get in.
>>
Can I use Qt from a C application or do I have to use something else?
>>
>>54658683
You can use a Qt binding for C, but not Qt directly since it's written in a superior language :^)
>>
Is there a /dpt/ discord?
>>
>>54658688
>Qt binding for C
Where can I find one?
>>
>>54658682

I presumed it was something to the degree of mirroring. So at any level, the right most and left most are switched, second right most and second left most are switched, etc...
>>
>>54658700
Yes, a tranny owns it and he mostly uses it to talk about his tranny problems.
>>
>>54658702
You can't, but you can use a Qt binding for a real language like say Rust or Go or whatever, and call into this language's bindings from C.

But I'd really recommand just writing the GUI part of your application in C++ and linking that with your C files.
Pure C users typically stick to GTK+.
>>
>>54658724

The /dpt/ Discord is dead, and the owner doesn't even talk in it.
>>
>>54658595
/g/ can be funny, I forget that sometimes
>>
imagine if a woman wanted to do something that takes effort, like become a great programmer or something, she has no idea how much effort goes into it, she's too lazy to do it, and she will most likely fail.

many indie game devs, while they may have good intentions, are like pedro or pajeet or a woman, they just lack the entire concept of putting a ton of work and effort or something, so their games will just not turn out all that great even though in their minds it took a lot of effort to them and for all they know they're the most hard working and competent people in the world.
>>
>>54658754
Go home /pol/, you're drunk.
>>
Is QT the most useful knowledge to have in finding a programming job?
>>
>>54658793
No, Java is
>>
>>54658793
No, the most useful knowledge is how to learn by yourself instead of asking stupid questions.

People who know one single thing really well and bet their whole carreer on that while being unable to learn anything new are useless.
>>
>>54658754
>b-but video games are hard!!!
Is that why video games on your resume and portfolio = into the trash it goes?
>>
>>54658562
>video games are hard
>>54658808
>video games aren't hard
nice moving the goalposts (obviously not the same person but still)
>>
>>54657830
Func<string[], string> findLargeSum = (cards) => {
var card = cards
.Select(c => new {number=c, sum=c.Replace("-", "").ToCharArray().Select(char.GetNumericValue).Sum()})
.OrderByDescending(c => c.sum)
.First();

return $"Card \"{card.number}\" has the highest sum of {card.sum}.";
};

findLargeSum(new[]{"4916-2600-1804-0530", "4779-252888-3972",
"4252-278893-7978", "4556-4242-9283-2260"})


>> Card "4779-252888-3972" has the highest sum of 81.
>>
>>54658722
I guess what I'm thinking of would be 'flipping' a binary tree. I'd be impressed if I saw a short one-liner for that.
>>
>>54658808

Video games degree = useless.
Actual video game on the market that people are playing = hireable.
>>
>>54658879

Show me what you think a flipped binary tree might look like when compared to the original.
>>
>>54658847
oh my god C# tries to look cool and hip but in reality it's a dad in mid 40s and looks absolutely terrible
>>
File: example.png (30 KB, 1275x474) Image search: [Google]
example.png
30 KB, 1275x474
>>54658896
>>
>>54658881
>Video games degree = useless.

No more useless than any other bachelors degree.
>>
>>54658742
>You can't
So you're saying this guy is a retard? >>54658688
>>
File: snap_13.png (9 KB, 446x112) Image search: [Google]
snap_13.png
9 KB, 446x112
>>54659008
That's a way to put it.
For my defense, on the top of my head I though I remembered a C binding, but no.
>>
whats the new meme starting language now?
>>
What say you guys, I am just working on some toy/small programs, use Visual Studio to get used to it for bigger projects or use something lightweight instead of codeblocks or geany.
>>
>>54659130
python but it's RIDICULOUSLY SHIT and it's on its way out apparently, anon said universities are moving back to lisp (scheme/racket) for its babby courses
>>
>>54659138
visual studio
>>
>>54658973
kek. But yeah, that's what I meant. I guess all the leaves would go into a list or set.
>>
Frame rate cap in menus?
Should I do it?
>>
>>54659317
I actually enjoy 1800fps in my menus, why take that option away from the user?
>>
>>54659317
https://www.youtube.com/watch?v=u5YJsMaT_AE
>>
>>54659317
why...why wouldn't you cap it?
Thread replies: 255
Thread images: 31

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.