Previous thread: What are you working on, Sup Forums?
/dpt/ - Daily Programming Thread
I'm trying to learn how to use OpenGL (the graphics library for C/C++), and am using the following tutorial:
opengl-tutorial.org
I'm currently on tutorial 2 and am getting the following error
/Projects/OpenGLTutorials/ogl-OpenGL-tutorial_0015_33/tutorial02_red_triangle/tutorial02_red_triangle
Impossible to open SimpleVertexShader.vertexshader. Are you in the right directory ? Don't forget to read the FAQ !
Even though I followed the instructions for how to build it on the mac perfectly
What am I doing wrong? And if possible, are there any other tutorials for OpenGL for Mac users?
What does this picture has to do with programming?
can we talk about this cuckery
this is #kodewithklossy level bullshit
Link?
Trying to rig this shit, How do I know if it's working?
Can someone check if this is correct and working?
I'm not sure if 'elo' is the rank or not.
Help?
>ideathmatch.com
import requests
import json
num=666
headers = {'Accept-Encoding': 'identity',
'User-Agent': 'Mozilla/5.0 (Android 4.4; Tablet; rv:41.0) Gecko/41.0 Firefox/41.0'}
text= ["nigger", "Sup Forums", "pedo", "NORMIE"]
while True:
#num+=1
POST1 = {
'_': num
}
r2 = requests.get("ideathmatch.com
headers=headers,data=POST1, timeout=10).json()
for ids in r2:
for words in text:
if words in str(ids["text"]):
print(words in str(ids["text"]),",",words,"matched with: ",ids["text"])
print(ids["id"],ids["elo"])
theid=ids["id"]
print("working?")
POST = {
'winnerID': int(theid),
'loserID' : int(r2[1]["id"])
}
try:
t = requests.get("ideathmatch.com
headers=headers,data=POST, timeout=5)
print(t.text)
except requests.exceptions.RequestException as e:
print(e)
www.google.com
durr
It's not there faglord. I already checked.
>google.com is the only domain google owns
>Until now, emoji representing women haven’t been, well…representative. Let’s change that. Google is working to make sure emoji include a wider range of female professions.
>female professions
GAS THEM
here's the link it goes to dick hole
That's where it is. If it isn't there then you must be on mobile or blind you fucking faggot
Well, except it is not. Fucking retard.
FUCKING DIE KYS KYS KYS
It is because I took a screenshot of it, so you must be retarded
Teach me to get good like you guys at programming
Well, even if you took a screenshot it is not there. Stupid fag
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
>I can't see it even though there's evidence it's there so everyone else is retarded
Your argument is retarded and so are you
Well, I can't see it because it is not there. As simple as that.
Also, you are quoting things that were not said nor implied.
>tutorials for OpenGL for Mac users
>for Mac users
>I'm trying to learn how to use OpenGL (the graphics library for C/C++)
rofl
(you)
Epic meme Sup Forumsro xD
>pls gib attention
What was OP pic?
(you)
you just need a string (char array), either fix the mac-specific file paths or whatever or just use a string literal for now
Epic meme Sup Forumsro xD
What's so funny?
Recep Erdogan with ostentatious/foppish makeup and the gay flag behind him, also some text about how sharing the picture.
It wasn't related at all to programming
>pls gib attention
(you)
u, n00b
opengl is the same across different platforms (except for slightly different versions especially opengl es which is used for mobile devices and web browsers) so you don't need a tutorial specifically for mac
Does anyone here understand RxJava?
Is it the same guy who keeps posting political images for /dpt/ OPs? How autistic is he?
gay webshit
lol wut?
idk seems like a shitty meme at least
Okay... Good news: after I fixed the filepath names for the shaders, I stopped getting the error. However, now I'm getting this error:
/Desktop/Projects/OpenGLTutorials/ogl-OpenGL-tutorial_0015_33/tutorial02_red_triangle/SimpleVertexShader.vertexshader
ERROR: 0:5: Invalid use of layout 'location'
ERROR: 0:9: Use of undeclared identifier 'gl_Position'
ERROR: 0:9: Use of undeclared identifier 'vertexPosition_modelspace'
ERROR: 0:10: Use of undeclared identifier 'gl_Position'
Linking program
ERROR: One or more attached shaders not successfully compiled
>that font
are you fucking kidding me?
It's awesome
swap the order of vertex shader and fragment shader in the parameters of LoadShaders
Epic meme Sup Forumsro xD
Write the most fastest way of displaying n number fibonacci sequence in your fav lang, make it count the time or give proof by some kind
C++
int slowFibonacci(const int x)
{
int fib = 0;
if (x == 0) return 0;
if (x == 1) return 1;
else {
return (fibonacci(x - 1) + fibonacci(x - 2));
}
}
The font is OK, the rendering sucks
whats the font btw ?
#include
#include
#include
template
struct Fib
{
static const int val = Fib::val + Fib::val;
};
template
struct Fib
{
static const int val = 0;
};
template
struct Fib
{
static const int val = 1;
};
template
int fib_impl(std::index_sequence, const int i)
{
constexpr std::array a
= {Fib::val... };
return a[i];
}
int fib(const int i)
{
return fib_impl(std::make_index_sequence(), i);
}
int main(int argc, const char*[])
{
std::cout
/wdg/ here
teach me the basics of your stuff I'll teach you everything you need to know in matter of days
easy ;^)
I already did
constexpr int fastFibonacci(const int i)
{
const auto sqrt_5 = std::sqrt(5);
if(i == 0) return 0;
if(i == 1) return 1;
return static_cast((std::pow(1 + sqrt_5, i)
- std::pow(1 -sqrt_5, i)) / (std::pow(2, i) * sqrt_5));
}
>teach me the basics of your stuff I'll teach you everything you need to know in matter of days
not a fair trade
unsigned long long fib[100];
inline unsigned long long GetFib(int n) {
return fib[n];
}
all you have to do is initialize it somewhere first
manually ?
int[] arr = {0,1,1,2,3,5,8...};
like that ?
/wdg/ faggot detected
sure, doesn't matter since the initialization only happens once
Nigga, where's your TCO at?
GetFib(101)
wouldn't work anyway since there's no basic type high enough to hold that value
template
struct CTList;
My IDE says that this method is missing a return statement. Why? The return statement is inside the try block.
static int[] setTimer() {
boolean gettingInput = true;
while (gettingInput) {
try {
Scanner input = new Scanner(System.in);
int hour = input.nextInt();
int min = input.nextInt();
int sec = input.nextInt();
gettingInput = false;
int[] timeArray = {hour, min, sec};
return timeArray;
} catch (InputMismatchException e) {
System.out.println("Try again. Use the format H M S:");
}
}
}
Reminder that deferred lighting is a Jewish lie.
if you get an exception it skips the rest of the try block
because if it goes into the catch and gettingInput is false, then there's no return statement
>be me
>have only 2 projects on github
>more than 30K followers
who else knows this feels?
static int[] setTimer() {
Scanner input = new Scanner(System.in);
int[] timeArray;
while (true) {
try {
int hour = input.nextInt();
int min = input.nextInt();
int sec = input.nextInt();
timeArray = new int[]{ hour, min, sec };
break;
} catch (InputMismatchException e) {
System.out.println("Try again. Use the format H M S:");
}
}
input.close();
return timeArray;
}
Is that you Linus Torvalds?
I have like 50 projects and 0 subs wtf, show me yours m8
What is the recommended book in learning about a PC structure at detail level as Tebauman(or whatever its called) is for networking.
Also ,what about for unix internal structure.
What are you trying to?
Hello! yes!
i'm working on a kernel. if you want to help here's my github:
github.com/torvalds
we need more contributors
thank you for explaining
>who else knows this feels?
Linus does.
see
Vote for the ones with key words in them.
Kill yourself linus.
40k followers was less than i expected, but on second thought it's quite a lot of programmers
The github repo is just a mirror of the main kernel source tree anyway.
Ah, that makes sense.
Thanks for cleaning up the code.
But it prints out the error statement forever.
What are some good resources for learning C other than the K&R book? (I already have it but I don't really have access to it right now)
Perhaps you should change:
requests.get
to
requests.post
for POST
I think you to encode whatever you want to post before passing it in as params.
I usually use urllib2
I'm learning how to use codenameOne for cross platform app development. Does anyone have experience with it?
all of these
ah, put input.nextLine(); in the catch statement to clear out the old incorrect input
Gohu, I think... It's fucking amazing
Thanks user.
Reminder that if your first program wasn't a kernel, or if it wasn't programmed in C or assembly, or if it was just a shitty DOS clone, then you have no business calling yourself a programmer, and you should stop right now, get off your computer, and never return to it ever again.
QUICK, WRITE A FUNCTION THAT TAKES AN ARRAY OF NUMBERS (REPRESENTING STOCKS), AND RETURNS AN ARRAY WITH THE PERIOD IN WHICH YOU COULD'VE MADE THE MOST MONEY (AKA, MAXIMUM - MINIMUM IS THE HIGHEST NUMBER)
holly shit that worked
thanks senpai
show me ur github
{-# LANGUAGE BangPatterns #-}
fibby :: Int -> Integer -> Integer -> IO()
fibby 0 _ _ = return ()
fibby n !a !b = do
print a
fibby (n - 1) (a + b) a
main :: IO ()
main = do
putStrLn "How many fibs?"
n
Perfect!
No, you'll just steal my code.
is that impementation better than the 0 : 1 : zipWith version?
I don't even know how to do github, its too hard
Oh... Duh. Now I feel dumb
That makes sense. Thanks!
c:
Ok fine, here it is:
github.com
>posts code on shithub despite caring if people steal his code
>thinks his neckbeard code is worth anything in the first place
>implying
zipWith has the same asymptotic performance. I didn't use it because it would be simpler this way
hahah, I lied, I know how to git clone haha
well, I would never come up with either implementation
its nice to see someone competent, unless u copied off some forum