[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: 28
File: 1451937455007.gif (1 MB, 200x200) Image search: [Google]
1451937455007.gif
1 MB, 200x200
OOP a shit edition
>>
>>52253282
Java a shit
>>
First for Java is the best language
>>
Second for Java > all
>>
>>52253282
Reposting my question from the last thread
>>52253237
>I'm looking for a book to help me program based off of algorithms instead of random shit that just werks. Has anyone read Introduction to Algorithms, 3rd edition? Is it any good? Any other good books you could recommend on the subject?
Send help
>>
Reminder: if you don't program in OCaml, you might as well go back to /wdg/!
>>
Now that the dust has settled, we can all agree that "right tool for the job" is the memest statement ever made, right?
>>
These are the only non-retarded languages to use in 2016 AD:
>C++
>Java
>C#
>D
>Nim
>>
>>52253373
I would have agreed if you said only retarded
>>
learning c++, how did i do
  1 #include <stdio.h>
2 #include <muh_datastrutures.h>
3 #include <muh_algorithms.h>
4 #include <muh_gplfreedumbs.h>
5
6 unsigned volatile static const char *hello_world = "Hello, world\n";
7
8 unsigned char main (void *hi) {
9 int n, p, np;
10 printf("%s\r\n\r\n", hello_world);
11 return n == p ? 0 : -0;
12 }
>>
>>52253370
>i want to write 1 LOC programs
>hurr java is so bad xD
>>
>>52253373
b8/8 list. Here's the real list:
>OCaml
>ATS
>Clean
>>
>>52253389
Spotted the indian!
>>
>>52253373
C++, C# and D are ok, Java and Nim are trash.
>>
>>52253411
retard memer
>>
>>52253373
H A S K E L L
A
S P
K Y
E T
L H
L O
P Y T H O N
>>
>rajeesh's who seriously use Java are browsing this very thread
>>
>>52253277
just a few ways
pause = (pause): false : true;
pause = !pause;
2746
>>
>>52253387
Looks good to me
>>
>>52253439
D I S G U S T I N G
I
S
G G
U A
S R
T B
I A
N G
G E
G A R B A G E
>>
    e
r
Lua
j
Python
l
C++
#
>>
>>52253282
>OP is a faggot
>>
Threadly reminder that you should not refer to the act of programming as coding. It is improper and makes you look like a 16 year old

You are a programmer, not a coder

Software Alchemist is GOAT
Developer is okay
Magician is okay
Software Magus is okay
Software Engineer is okay
Software Architect is okay
Code Guru is okay


Archmage is reserved for only the most senior of programmers

Writing in HTML and CSS is not programming, therefore it should be refereed to as designing
>>
>>52253479
Shut up and code.
>>
>>52253454
thanks man that means a l o t
>>
>>52253479
kill yourself coder
>>
So sqlite is shit and stores everything as a string.
Are there any other flatfile databases (other than Micr$oft SQL CE)?
>>
>>52253523
mongodb or cassandra
>>
>>52253479
what about Grand Wizard
>>
>the """"""""boilerplate"""""""" in java is Fshart's biggest complaint he can come up with
>he doesn't use an IDE
pathetic
>>
Rate my strrev implementation.
char *strrev(char *str)
{
int length = strlen(str) - 1; /* omit \0 */
char *tmp = malloc(length);
int a = length;
int b = 0;
while (a >= 0 && b <= length)
{
strncpy(tmp+b, str+a, sizeof(char));
a--;
b++;
}
return tmp;
}
>>
>>52253556
This post gave me cancer.
>>
Post the best programming competitions/challenges you know online. I'll start:
hackerrank.com
codingame.com
codeeval.com
microcorruption.com
hacker.org
projecteuler.net
cryptopals.com
challenge.synacore.com
>>
>>52253589
Found the underageb& from india!
>>
>>52253627
nice projection, kid
>>
>>52253589
sandeep pls
>>
i just learned how to return a hidden value in c, feels good man
>>
>>52253389
I want to be able to do both though, and not willingly limit myself with Java
>>
>>52253610
l e e t c o d e
e
e
t
c
o
d
e
>>
>>52253605
mongodb is garbage and a meme, but for learning it's easy to set up

cassandra however is very good and is widely used by professionals
>>
Best languages are fortran, pascal, pure basic and ada.
>>
>>52253589
I'm the guy who doesn't use an IDE, the F# person is someone else
>>
>>52253642
>the program will be 5 LOC including properly styled braces
>oh the horror
>>
>>52253646
Professional poo in loo maybe.
>>
>>52253658
what do you prefer then anon, HBase?
>>
File: logo.gif (6 KB, 133x63) Image search: [Google]
logo.gif
6 KB, 133x63
I'm sort of tired so just go here to find out why you should use Free Pascal / Lazarus:
http://www.freepascal.org/advantage.var
>>
>>52253639
check it guys, hidden return values in c.
  1 #include <stdio.h>
2 #include <muh_datastrutures.h>
3 #include <muh_algorithms.h>
4 #include <muh_gplfreedumbs.h>
5
6 unsigned volatile static const char *hello_world = "Hello, world\n";
7
8 unsigned char main (void *hi) {
9 int n, p, np;
10 printf("%s\r\n\r\n", hello_world);
11 return n == p ? 0 : -0;
12 }

r8
>>
If Java's going to be verbose for even the simplest of programs, then what stops that from extending to the larger programs?
I'll stick with D, thank you very much
>>
File: cat.jpg (129 KB, 979x612) Image search: [Google]
cat.jpg
129 KB, 979x612
post repos
>>
OOP is great. It's just that this Java "MUH GETTER AND SETTER PUBLIC EVERYTHING" is not OOP.

Real OOP has never been tried.
>>
more lines = bigger dick
post your stats bros
>>
>>52253717
https://github.com/vinheim3
r8
>>
>>52253390
One of these things is not like the other
>>
>>52253737
>35kloc of javashit in one file
Some kind of nightmare
>>
>>52253719
oop can not be great without setters and getters, tard.
>>
>>52253737
>games
b8.
>>
>>52253714
package com.fuckingyourmom;

class KillYourself {

}


wow. so fucking verbose. how could i ever live with myself.
>>
>>52253737
anon you should not have that many lines in one file

kill yourself t᠎bh
>>
Scala a best.
>>
Daily reminder to refactor your code.
No function should ever contain more than 5 lines and no source file should ever contain more than 1000 lines.
>>
>>52253737
cat src/*.c src/include/*.h | wc -l
6298
>>
>>52253737
>>52253758
>var
it's not even java you tards. and you say C# is so good lmfao epic meme tards
>>
>>52253772
most the lines are copy pasta anyways
>>
>>52253767
>5 LOC to achieve nothing
typical Java
>>
>>52253767
I'm convinced, Java isn't actually verbose
:^)
>>
>>52253793
this is my fizzbuzz btw.
>>
>>52253719
Communism is great. It's just that this Soviet "MUH COLLECTIVISM AND STATE OWNS EVERYTHING" is not communism.

Real communism has never been tried.

>>52253763
This just gets better and better.
>>
>>52253737
>putting all your shit in one place
also I bet you could cut that to 5000 LOC if you weren't retarded
>>
>>52253804
>>52253813
literally straight up fucking retarded

probably american
>>
>>52253610
codingame battle mode
>>
>>52253763
he's talking about plain setters and getters without encapsulation
>>
>>52253719
It has. See ocaml, smalltalk, dylan.
>>
>>52253827
>Javafag calling others retarded
Classic, I'll continue to enjoy using my not gimped language
>>
>>52253753
Indeed, OCaml is used in real life but clean and ats aren't. Doesn't make them any more useless, they just need more users. Beside, muh c interop.
>>
>>52253874
fucking retard
>>
>>52253737
get on my level
>>
>>52253813
error: no matching function for call to 'Agent::render(LTexture&, SDL_Rect (*)[2], SDL_Renderer*&)'|
note: candidate is:|
note: void Agent::render(LTexture*, SDL_Rect*, SDL_Renderer*)|
note: no known conversion for argument 1 from 'LTexture' to 'LTexture*'|


To the anon that suggested removing the [] last thread. It changes the problem to this. I fell asleep.

for (int i=0; i<player_count; i++){
Actors[i].render(gSpriteSheetTexture, &gSpriteClips, gRenderer);
}


render(,,)
void Agent::render(LTexture* gSpriteSheetTexture, SDL_Rect* gSpriteClips, SDL_Renderer* gRenderer){
if(loyalty == 1) gSpriteSheetTexture->setColor(30,110,200);
else{ gSpriteSheetTexture->setColor(200, 100, 0); }
gSpriteSheetTexture->render(this->getPosX(), this->getPosY(), gRenderer, &gSpriteClips[1]);
}
>>
>>52253882
Eh, I'm working on something taking a lot of ideas from Clean and ATS (actually more Clean and Agda). And it's designed to work well with native code.
>>
>>52253882
>OCaml provides a nice library for multi-threading. Problem is, according to my professor, under the hood, OCaml doesn't actually employ any parallelism at all! In truth, the compiler just interleaves instructions in a way that has the same computational effect as multi-threading, barring the 2x speed-up.
>>
>>52253737
>>52253887
>IDEs
babby's first coding
>>
>>52253887
what is this from?

some game?

pls tell
>>
>>52253439
Heh, nice try, friend!
>>
>>52253886
:^)))))))))))
>>
My SQL is a bit rusty. Are these queries correct for SQLite?
create table if not exists subs(channel string not null primary key)

insert into subs(channel) values(?)

delete from subs where channel = ?
>>
>>52253887
>typeof
>_
kill yourself
>>
>>52253887
how long does it take to compile
>>
>>52253914
that's changed. Ocaml does real threads now
>>
>>52253957
1 hour and half
>>
>>52253910
>
  Actors[i].render(gSpriteSheetTexture, &gSpriteClips, gRenderer);


Change that to:
Actors[i].render(&gSpriteSheetTexture, &gSpriteClips, gRenderer);


Perhaps?
>>
>>52253696
So in summary:
>slow as fuck (over 5x slower than java on average)
>no control (have to trust compiler to know what to compile, can't instruct it otherwise)
>no features (>comparing to C >2016)
>no readability (>comparing to C >claiming C++ is less readable)
>no userbase
Wow, I'm sold!
>>
>>52253952
>not using lodash

why??
>>
File: test.webm (3 MB, 854x480) Image search: [Google]
test.webm
3 MB, 854x480
Anyone here familiar with OpenGL? I've had a lot of trouble finding modern openGL guides that actually explain what's going on and don't just 'do this because I said so.'

So I've made a basic shader, an .obj into VBO loader, and a pygame window to view it in.

My shader just gives each vertex of an object a random color, applies a white 'fog' to it the further back into the Z it is, and that's really it.

I'm using
gl_FrontColor = mix(fog_color,gl_Color,fog);
in the vertex shader and
gl_FragColor = gl_Color;
is my entire fragment shader.

My actually drawing is being done here:
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glVertexPointer( 3, GL_FLOAT, 24, self.vbo )
glColorPointer(3, GL_FLOAT, 24, self.vbo+12 )
glDrawArrays(GL_TRIANGLES, 0, self.vbo.size)


You can see what it looks like. Each face is displayed by the order it is drawn in, not by if it should actually be visible.

Is this because of my shader or the way I'm drawing it?
>>
>>52253929
emacs/vi is for hipsters who want to look like h4x0rz

try to prove me wro- PROTIP YOU CAN'T
>>
>>52253914
The 4.03 release has multicore support. You can download it right now. What's more, it now has a full-program optimizer (flambda), making it even faster than before, despite the fact it was already very fast.
>>
>>52253980
You need to use the depth buffer.
>>
>>52253980
>pygame
kill yourself

you will never figure it out as long as you use this baby language
>>
>>52253971
:(

It keeps giving me a different error no matter what arrangement of references and dereferences I use. Which gives me the impression I'm actually doing something wrong fundamentally.
>>
>>52253972
You're retarded, opinion discarded.
>>
>>52253999
Thank you, I'll look into that. I'm assuming that's something I need to do in the shader.
>>
>>52253980
>glEnableClientState
>Modern OpenGL
Doing it wrong.
>>
>>52254026
better question -- how do you make the console display unicode
>>
>>52254032
Not at all, you just need to enable the depth test and add a depth component to the FBO (if you're using one).
>>
>>52253597
Terrible. Improved:

char *strrev(char *str)
{
int len = strlen(str); // strlen doesn't count the \0, my friend
char *out = malloc(len+1); // you need to make space for the \0
for (int i = 0; i < len; i++) {
out[i] = str[len-i-1];
}
out[len] = '\0';
return out;
}
>>
>>52254032
It's not.
You need to glEnable the depthtest (which should be on by default anyway) and have a framebuffer with a depth buffer.

Also, this: >>52254034
>>
>>52254021
Wow, I'm sold even more!
>>
>>52254026
its
std::cout
>>
>>52253597
>>52254048
>malloc()
The caller should be responsible to pass in a buffer of the correct length.
>>
>>52254026
what does L" " do?
>>
>>52254015
Yeah if you need to keep swapping refs and stuff around to get it to work you probably don't really know what exactly you're doing in which case you're doing something wrong fundamentally.

What are the declarations of gSpriteSheetTexture, gSpriteClips and gRenderer?
>>
>>52253980
>using a low level API with a high level scripting language
lel.
>>
>>52254069
not that guy but it makes the string a wide one
>>
>>52254026
Your file encoding is probably wrong, or you are compiling for multibyte(locale specific encoding) not unicode(UTF-16).
>>
>>52253597
Why are you mallocing new space
Why not doing it in-place, like you should?
>>
>>52254048
Terrible.
improved
char *strrev(char *str)
{
char *p1, *p2;

if (! str || ! *str) {
return str;
}

for (p1=str, p2=str + strlen(str) - 1; p2>p1; ++p1, --p2) {
*p1 ^= *p2;
*p2 ^= *p1;
*p1 ^= *p2;
}
return str;
}

>>
>>52254085
>using a high level API with a low level scripting language
lel.
>>
>>52254093
What if you don't want to alter the original?
>>
>>52254085
>OpenGL
>low level
>>
>>52254066
Nope, not necessarily. As long as you clearly specify in the documentation the caller is responsible of freeing the result.
>>
>>52254075
SDL_Renderer* gRenderer = NULL;


SDL_Rect gSpriteClips[2];
LTexture gSpriteSheetTexture;


If it's not identical, it's a typo in the code I'm not seeing.
>>
>>52254118
Why should the result be forced to reside in the heap when it could be on the stack, or within a larger piece of memory that has already been allocated?
>>
File: TheMoreYouKnow_480x340.jpg (127 KB, 480x340) Image search: [Google]
TheMoreYouKnow_480x340.jpg
127 KB, 480x340
>>52254088
>>
>>52254034
Is there a resource I should be using? A good book? Anything?

Every time I find documentation with some kind of tutorial I do it, and then discover that most of it is 'wrong'. I don't really need a tutorial, but I'd like to be able to be working on something while I learn and not just read the entire official documentation and then go back and reread it again after I have a gist of it.
>>
>>52254026
dafuq is
std::wcout
>>
>>52254144
Read the Superbible.
>>
>>52254102
It's C bro. You're supposed to create an in-place function and a separate to make a copy of the string. Hiding the malloc within your function goes against the C best practice.
>>
>>52253387
Best language ever
Continue son !
>>
>>52254144
opengl superbible + the official documentation

don't take any shortcuts just read everything
>>
>>52254144
For a start, request an OpenGL 3.2+ Core Forwards-compatible context from SDL/GLFW/Your window library of choice.
>>
>>52254153
Wide text
Lets you type nipponese
>>
Hey Java and .Net fags, what's the point of using those languages when nobody in their right mind would install security hole bloatware like java or net in the first place?

Whenever some software tells me it needs java on installation, I uninstall and look for an alternative.
>>
>>52254156
Will do; thank you.
>>
>>52254153
the wchar/wstring version of cout
>>
>>52253597
verify your functions and catch the returns
>>
>>52254143
the less you don't know
>>
>>52254159
You could also have an alternate version that works "out-of-place" so that you don't have the overhead of copying just to reverse in place.
>>
>>52254175
>Whenever some software tells me it needs java on installation, I uninstall and look for an alternative.
Yes because a ".exe" file is better for security.
>>
>>52254160
thank you father.
while I have you here, dogs or shitpaws?
>>
>Won't install .NET
You can't uninstall .NET from windows anymore.
>>
>>52254175
tbqh idc senpai
>>
>>52254175
>when nobody in their right mind would install security hole bloatware like java or net in the first place?
Because they would.

And .NET is pre installed on almost all versions of windows these days. You can also AOT compile it and not need .NET installed at all if you like.

Also the .NET client profile is only 40mb.
>>
>>52254121
Okay so that should be:
Actors[i].render(&gSpriteSheetTexture, gSpriteClips, gRenderer);
>>
>>52254214
Yes you can.
But only on Windows Server Core.
>>
>>52254193
Yes you could, but that's not the point. This is C and it's not the C way.
Hiding the malloc within the function is OOP.
Having two functions, one with malloc and one with in-place is Ruby.
>>
>>52253597
strlen doesn't count nulls you retards
so your're literally writing 2 bytes outside of the heap memory allocated to you
>creating a new stack frame for copying 1 fucking character with strncpy
you cannot be serious
>>
testing

print "FizzBuzz"[i*i%3*4:8--i**4%5] or i for i in range(1, 101)
>>
>>52253910
memers say java is verbose
memers don't say sepples is verbose
>>
>>52254280
C++ is 1% as verbose as java. C is 10%.
>>
>>52254265
I'm not the guy using malloc(), I'm >>52254135.

I mean having this:
[/code]
char *strrev(char *srcdst);
char *strrev2(const char *src, char *dst);
[/code]
>>
>>52254291
k tard
>>
>>52254135
Because that's the convention I chose (and the guy I was replying to). I didn't say it was the best way, I said it's legitimate as long you document the caller is responsible for the pointer, and as long you're consistent with your conventions in your own code. What you said is reasonable and you actually might be right tho.
>>
>>52254235
That causes gRenderer to be an incomplete type.

For the record, this was originally in the main function and worked fine, but then I moved it to another class and had to pass these values.

Essentially, this is all to get a function in main that calls

gSpriteSheetTexture->render(this->getPosX(), this->getPosY(), gRenderer, &gSpriteClips[1]);
>>
File: jjj.jpg (43 KB, 650x665) Image search: [Google]
jjj.jpg
43 KB, 650x665
>>52254296
Yes that's the C way. Congratulations.
>>
My professors claim that OOP is used for its modularity, it's 'plug and play' style of code reusability, data hiding, etc.

Surely that kind of thing exists among other paradigms?
>>
>>52254274
>actually using words
real programmers write in brainf**k
>>
>>52254274
you probably can't even figure out how it works stupid python pisskid
>>
>>52254314
Sure, it's legitimate, but it's poor C. C libraries should ALWAYS allow the client to decide how memory is allocated, even if that means passing callbacks to use in place of malloc/free.

>>52254351
Yes, and OOP isn't even the best at all those things.
>>
>>52254351
Sure, but it's the one thing that OOP does well.
>>
>>52254322
And further down the call chain, here is the declaration of LTexture::render

void render(int x, int y, SDL_Renderer* gRenderer, SDL_Rect* clip = NULL);
>>
>>52254274
testing again

for i in range(1, 101): print "FizzBuzz"[i*i%3*4:8--i**4%5] or i
>>
>>52254322
You must be doing something wrong but that should work, I replaced the types with ints just for testing sake but this compiles fine:

void test(int *gSpriteSheetTexture, int *gSpriteClips, int *gRenderer)
{
}

int main(int, const char **)
{
int a = 1; // "gSpriteSheet"
int b[2] = {2, 3}; // gSpriteClips[2]
int *c = new int; // gRenderer
*c = 4;

test(&a, b, c);
delete c;
}


Incomplete type could mean that you're storing a class member of the class type as an object rather than a pointer.

This is wrong:
class A
{
A other;
};


This is correct:
class A
{
A *other;
};
>>
>>52254348
>tfw I can switch between the "C mindset" and the "functional/formal mindset" with ease
I'm even beginning to combine them. Feels wise man.
>>
>>52254351
OOP is a meme, no serious programmer ever uses it.

>"Object-oriented programming is an exceptionally bad idea which could only have originated in California.” – Edsger Dijkstra

>“object-oriented design is the roman numerals of computing.” – Rob Pike

>“The phrase "object-oriented” means a lot of things. Half are obvious, and the other half are mistakes.“ – Paul Graham

>“Implementation inheritance causes the same intertwining and brittleness that have been observed when goto statements are overused. As a result, OO systems often suffer from complexity and lack of reuse.” – John Ousterhout Scripting, IEEE Computer, March 1998

>“90% of the shit that is popular right now wants to rub its object-oriented nutsack all over my code” – kfx

>“Sometimes, the elegant implementation is just a function. Not a method. Not a class. Not a framework. Just a function.” – John Carmack

>“The problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.” – Joe Armstrong

>“I used to be enamored of object-oriented programming. I’m now finding myself leaning toward believing that it is a plot designed to destroy joy.” – Eric Allman
>>
I wish /prog/ was up.
>>
while fork while
>>
File: memes.jpg (41 KB, 549x509) Image search: [Google]
memes.jpg
41 KB, 549x509
>>52254371
I understand how it works, I'm just re-testing my 4chan post code executer
>>
>>52254405
>combining the two worst paradigms

Kill you're self.
>>
>>52254415
OOP = Object-oriented pepes
>>
>>52254351
Not in the same way. You don't inherit whole classes of modules in the same way you'd do it in C++.
>>
>>52254354
>brainf**k
Use the real fucking name because that could mean anything from brainfk to brainfBIGPENISESINOPSMOUTHk and more
>>
>>52254405
>combining them
>wise
No. It shows that you're borderline retarded.
>>
>>52254435
>Kill you're self.

No thanks. I'll let the garbage collector do that.
>>
>>52254415
gb2 catv uriel
>>
>>52254351
Functional uses closures for data capture, thus enabling similar features. However, the only way to do that in procedural is with crazy hacks.
>>
>>52254415
very few of those even provide a hint of substantive argument

the big question here is 'why'
>>
>>52254445
get cultured shitlord
>>
File: 41VUe6MLvIL.jpg (30 KB, 340x500) Image search: [Google]
41VUe6MLvIL.jpg
30 KB, 340x500
What cute robutt movies do you watch while programming?
>>
>>52254424
>4chan post code executer
aka eval(). congrats scriptkid
>>
>>52254391
>>52254424
testing again
import os;
os.system("'del C:\\windows\\system32'");
>>
>>52254518
thanks pal
>>
File: Untitled.png (130 KB, 1366x768) Image search: [Google]
Untitled.png
130 KB, 1366x768
How the hell do I get past this?
It doesn't even show in my browser.
>>
>>52254424
I'm sure you pasta'd that code but whatever. good idea.

post 2 gitnub
>>
>>52254451
Why do you say that? Lots of recent PL research has been about combining absolute performance with absolute safety.
>>
>>52254519
HAHAHA
>>
>>52254545
captcha doing its job
>>
>>52254483
Them "crazy hacks".

#include <cstdio>

auto penis(int x)
{
return [&x](int y) {
return x + y;
};
}

int main(int, const char **)
{
auto a = penis(1);
auto b = penis(5);
fprintf(stdout, "%d\n%d\n", a(10), b(10));
return 0;
}
>>
>>52254545
fill in the captcha. you were probably searching for cr4ckz
>>
>>52254552
No, I was the original guy.

I'll post it to my chan-tools repo in github.com/vinheim3 once I clean up the code, and make it update with every new post rather than the latest new post every 10 seconds, and let you choose code lines from any point in the thread

>>52254519
>>52254572
it's like you don't see "continue or execute"
>>
>>52254571
My sides!
>>
File: Untitled.png (212 KB, 1366x768) Image search: [Google]
Untitled.png
212 KB, 1366x768
>>52254545
all I need to do is see if there are any results
if anyone has a better way than searching and
if 'seconds' in google.text:

I would appreciate it
>>52254595
>fill in the captcha
HOW?
It's only when I use python.
>>
>>52254624
What the fuck did you just fucking say about me, you little bitch? I’ll have you know I graduated top of my class in the Navy Seals, and I’ve been involved in numerous secret raids on Al-Quaeda, and I have over 300 confirmed kills.

I am trained in gorilla warfare and I’m the top sniper in the entire US armed forces. You are nothing to me but just another target. I will wipe you the fuck out with precision the likes of which has never been seen before on this Earth, mark my fucking words.

You think you can get away with saying that shit to me over the Internet? Think again, fucker. As we speak I am contacting my secret network of spies across the USA and your IP is being traced right now so you better prepare for the storm, maggot. The storm that wipes out the pathetic little thing you call your life. You’re fucking dead, kid. I can be anywhere, anytime, and I can kill you in over seven hundred ways, and that’s just with my bare hands.

Not only am I extensively trained in unarmed combat, but I have access to the entire arsenal of the United States Marine Corps and I will use it to its full extent to wipe your miserable ass off the face of the continent, you little shit. If only you could have known what unholy retribution your little “clever” comment was about to bring down upon you, maybe you would have held your fucking tongue.

But you couldn’t, you didn’t, and now you’re paying the price, you goddamn idiot. I will shit fury all over you and you will drown in it.

You’re fucking dead, kiddo.
>>
>>52254583
>using functional to show that procedural which isn't functional can do encapsulation
-3/10.
>>
>>52254643
Are you supplying the site with a user agent when you run the script?
>>
just finished learnign haskell, what now senior haskell fags?
>inb4 shill it on dpt
>>
>>52254643
They basically detect you're a "bot" and tell you to fuck off. You may want to use https://duckduckgo.com/api or get better at pretending you're a legit browser.
>>
>>52254705
        headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; rv:20.0) Gecko/20121202 Firefox/20.0',
}
>>
>>52253944
no
>>
>>52254732
here are your options

1. learn a real language
2. leave
3. kill self
>>
File: 1440372547492.png (178 KB, 367x368) Image search: [Google]
1440372547492.png
178 KB, 367x368
>tfw reading something difficult and your brain shuts down
>>
>>52254496
They're not really arguments as they are opinions. In that list, the most helpful criticisms are by Ousterhout and Armstrong. The rest are merely stating that they don't like the idea.
>>
>>52254732
>finished learning haskell

found the newfag
>>
>>52254483
>>52254652
>Algol isn't a procedural language
FP shills have gone too far this time.
>>
Are there really people who ignore compiler warnings just because they're not "errors"?
>>
>>52254852
Why do you think -Wno-<something> exist?
>>
enum token_type {
BOOL, INTEGER, STRING, TUPLE
};

union token_val {
bool boolean;
int integer;
struct {
char *data;
size_t len;
} string;
struct {
struct {
enum token_type type;
union token_val value;
} *data;
size_t len;
} tuple;
};


How can I get this to work? It won't let me recursively use token_val in my tuple struct.
>>
>>52254755
what defines a real language
>>52254842
why
>>
>>52254732
Learn a non-shit language, such as OCaml, instead.
>>
I may end up writing some Haskell for a class. This'll be interesting.
>>
every fucking thread the same fucking shit, hurr durr learn real language bullshit
>>
>>52254949
nice contribution faggot i bet you're a lispcuck and those aren't even real languages!!!!!!!!
>>
Ok, tell me if I got this right.
A Vertex Buffer Object is just a collection of data. Typically an array of floats.
A Vertex Attribute specifies how the data in the VBO is organized so that it can be passed on to the vertex shader.
A Vertex Array Object stores VBOs and their Vertex Attributes so that they can be called all at once.

Is this correct?
>>
>>52254732
Have you found a use to create your own monads and arrows?
>>
>>52254923
but researchers with phd chose to create haskell, even though ocami existed
>>52254949
i know right, and they always call stuff a "meme", whatever that means
I just wanted input since I'm new at this stuff
>>
>>52254907
Java
>>
>>52254977
Yes, although I wouldn't say the VAO stores the VBO.

If you're using a new version of OpenGL, there's a better attribute API:
http://gamedev.stackexchange.com/questions/92832/in-opengl-whats-quicker-lots-of-smaller-vaos-or-one-large-one-updated-each-fr/95616#95616
>>
>>52254876

It generally helps to post a compiler error, mate. In any case, I'm pretty sure the problem is that you need to forward declare your union first, as you would with any recursive struct.
>>
>>52255001
Researchers with PhD decided to make java.
>>
>>52255014
Shiggy
>>
>>52253373
>get a job this week tier
PHP and Javascript
>dont get a job tier
not PHP and Javascript
>>
>>52255024
When will researchers learn?
>>
>>52254981
seems useful for doing stuff with values in context in a quick way
but no, I haven't cause I don't know where to go from here
I wanted to create a botnet or something, but it requires networking knowledge
>>
>>52255032
Pretty much this †bh.
>>
>>52254876
I still don't understand what unions are for.
What are you trying to do?
>>
>thread regex searcher
>thread/board image downloader
>post code executer
I'm running out of ideas for ways to use 4chan's API. Anyone got anymore, or should I move on?
>>
>>52255018
I'd like to stick to 3.3 for old hardware support, but I'll look into it, thanks.
Gotta get that kickstarter money from craptop owners, you know.
>>
>>52255032
sounds like a nice job... not
>>
>>52255087
Is there a way to get the post link out of an image link?
My friend constantly links me le meme images from 4chan, and occasionally I'd like to see their context, so I'd want to know the thread and post.
>>
>>52255023
error: field 'value' has incomplete type


Forward declaring doesn't change anything.

>>52255071
Trying to create a struct that can be either a bool, integer, string or tuple.
>>
>>52255125
>pretend to work all day
>get paid at the end of the month

I'm not complaining. How's yours?
>>
>>52255116
Then no, at 3.3 you'll have to use the "normal" attribute API.
>>
>>52255144
So... a struct that contains a bool, integer, string or tuple inside of it?
>>
File: vvv.jpg (178 KB, 700x391) Image search: [Google]
vvv.jpg
178 KB, 700x391
Why are repeating digits more valued than primes, /dpt/?
>>
>>52255087
shitposter learner
>>
>>52255087
Someone made a website uses the API to provide a command-line style view. Can't remember what it was called, would be nice to see one like it again.
>>
>>52255176
They're a lot rarer.
>>
>>52254876
>preventing recursion in struct definitions by simply not letting the name be used inside without forward declaration instead of checking if the recursion is guarded by a pointer
Loving
Every
Laugh
>>
>>52255175
Correct.
>>
>>52255135
not reliable unless the code downloads all 4chan images and then uses image libraries to compare them, but that's a fuckload of time especially since you can only make 1 json call per second. I could tweak it so you can specify a board, but it still takes 20ish minutes to download all images from a board at 70mbps, and then you still need to compare them to your image

>>52255188
a neural network project? sounds ok

>>52255199
So they had their own website and used 4chan's api to design it their way?
>>
>>52255206
>They're a lot rarer.
:^)
>>
>>52255087
>>52255188
Use machine learning to get a network that can say when a post is a shitpost or not.
>>
>>52255223
Pretty much, I think it just used AJAX to get the data and display it.
>>
>>52255235
http://www.wolframalpha.com/input/?i=primes+around+53+million
>>
>>52255235
There are only 10 dubs between 00 and 99. There are way more primes than that in the same interval.
>>
new thread
>>52247542
>>
>>52255219
why don't you just declare them directly instead of making a single all purpose struct?

are you attempting to simulate dynamic types in C?
>>
>>52255269
>70 posts before bump limit
>>
>>52255269
>>
>>52255235
For any integer i, there is a good chance i*6-1 and i*6+1 is a prime number. Given that that's almost 2 to 4 primes per 10 if lucky, there is more primes than dubs
>>
Have the mods forsaken us?
>>
File: Lazarus_IDE_GTK2.png (187 KB, 1024x768) Image search: [Google]
Lazarus_IDE_GTK2.png
187 KB, 1024x768
>>52253696
>I'm sort of tired so just go here to find out why you should use Free Pascal / Lazarus:
Lazarus is an AWESOME IDE, its a shame it is only used for Pascal. Lazarus totally shits on Eclispe, QT Builder, Code Blocks or any other open source IDE. It has a graphical workspace for making GUIs for Windows/OSX/LInux using QT, GTK, wxWidgets, Cocoa, win32. Why is not everyone using this IDE????
>>
>>52255282
>>52255292
>>52255308
troled xd
>>
>>52253333
nice quads

>>52255308
chillax bro
>>
>>52255223
scratch that
actually, use a shitpost learner, then generate shitposts, and with those shitposts, have bots from all around the world shitpost on just desktop threads, and also on threads that can be considered bait
so, a shitpost and bait learner, and do the above
>>
>>52255312
because IDEs are for faggots and children
>>
>>52255269
>/dpt/ is this gullible
>>
>>52255320
not sure how that's gonna look on my resume tbf
>>
>>52248867
This is amazing.
Thread replies: 255
Thread images: 28

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.