prev: What are you working on, Sup Forums?
/dpt/ - Daily Programming Thread
Other urls found in this thread:
show-cpp.readthedocs.io
git.savannah.gnu.org
gnu.org
pastebin.com
godbolt.org
godbolt.org
youtube.com
youtube.com
gist.github.com
youtube.com
youtube.com
youtube.com
youtube.com
thepiratebay.org
twitter.com
fuck opengl
fuck rust shills and fuck anything but C
Why?
Fuck C shills and anything but Rust
Fuck C, desu.
>no vao's in gl es2
>have to use vao's in gl 3.2+
>attribute/varying -> in/out
>in gl es2 have to specify the precision in every shader, they just couldn't have default value for them
this
Trying to make the Scala compiler hook up all the right instances is like trying to teach a blind person to navigate a printed maze.
I've been working on my C++ HTTP server framework show-cpp.readthedocs.io
I'm trying to make a function method in Java that when you put an array of numbers in its field it will count all the prime numbers inside the given array.
My code so far is this:
public static int countPrimes(int[] inputArray) {
int[] newArray = new int[inputArray.length];
int counter = 0;
for (int i = 0; i < inputArray.length; i++) {
boolean isDistinct = false;
for (int j = 0; j < i; j++) {
if (inputArray[i] == inputArray[j]) {
isDistinct = true;
break;
}
}
if (!isDistinct) {
newArray[counter++] = inputArray[i];
}
}
int primeCount = 0;
for (int i=0; i
I'm thinking of creating a DE-neutral for POSIX that's able to
>Add calander events
>Set reminder/timer/alarms
>Display popup notification when needed.
How should I approach this? I'm thinking of creating a daemon to run in the background for this. However I'm not sure how to show notification in gtk/Qt systems.
how does Sup Forums x cache captchas
when i request a new captcha the old one becomes invalid
Fuck m4, what the fuck is this shit? I had to abstract the entire language to do anything useful.
The fucking GNU manual wasn't any help, is this really how you recommend writing code? Even in a truely shit language?
git.savannah.gnu.org
Seriously, this array thing seems normal to you GNU?
gnu.org
I've never been happier to have read SICP. I just implemented a version of cons/car/cdr and copied map/filter/append and shit from the book. Now I can use a list that isn't a complete hack.
>the car and the cudder
Turing completeness is overrated.
That's right, they really are quite helpful. I wanted to post the code but it triggers the Sup Forums filter for some reason.
I only hire zoomorphic programmers.
public int countPrimes(int[] inputArray) {
return Arrays.stream(inputArrat).filter(i -> isPrime(i)).count();
}
private boolean isPrime(int input) {
// TODO: make faster if wanted
if (input < 2) return false;
for (int i=2; i
I only hire zooplancton.
Thats kind of cool. I tried learning m4 once and nearly died.
Start writing assembly.
i like the way you mov
>enroll computer graphics course
>don't feel like I'm actually understanding anything
>try to read professor's script
>it's even worse
>I'm somehow passing without knowing what the fuck I'm doing
can someone recommend a book or two on this? Prof has a shitload of code examples which I barely can understand, opengl being opengl doesn't help either
We've had topics such as:
>drawing lines (dda, bresenham, wu)
>polylines and polygons
>bit blit, masks, sprites, alpha comp and blend
>some image filters, corrections, kernels for blurs and sharpeners
>webgl shaders, transformations, textures
First part was done in python probably because of numpy and all that, second part is in webgl probably because it's easier to set up for everyone
Just looking for some more quality material to try to learn all of this again
/fpt/
if anyone is interested
I FEel you but it's a bit off.
godbolt.org
Why can't GCC optimize this into a jump table?
Clang does it just fine: godbolt.org
>FEel
I don't get this one.
Did you try -O3?
I want to eat cheetos
Modern JavaScript ES6/7 is absolutely fine.
You think this is 2002 ?
Yes. No difference.
FE as in hexadecimal.
Oh, I thought it was an instruction on some processor or something.
Hex has nothing to do with assembly.
Did you profile it? The jump table might not be faster with that few elements.
I don't see why gcc couldn't optimize that code into a jump table.
You'd use a number like 0x0001 as a bitmask to check a status flag or something.
Listen it's hard to come up with asm jokes ok?
It's really NOT that hard.
>this is where you laugh
Yeah, I don't know what his trouble is. I'm having NOProblem coming up with those.
Still dynamically typed and therefore garbage.
Yeah, I think his brain XOR'd itself with itself.
> dynamic typing
> a shitload of legacy things
> fucking dynamic typing where you can easily mess up everything and believe me people will do, js is not an elitist club like c ( I'm not too fond of c but its alright)
> verbose shitty syntax
> enterprise fizzbuzz libraries and frameworks that do fuckton of shit in ways which are a hell to debug due to magic everywhere and make everything slow
nope, javascript is a dead end
Maybe he should SSSEe a doctor about that.
We need more Andrei
youtube.com
>this is too complicated
>here's a solution that's more complicated
>cppfags
looking for a good youtube playlist for background music to listen to while programming.
any suggestions?
> verbose shitty syntax
the other things are kinda true or debatable, but this is definitely not accurate
What has the C preprocessor got to do with this?
r/a/dio
#include
using namespace std;
int main() {
static constexpr const char *fuck[]{"shit piss cum", "jizz tits ass"};
cout
Wash your mouth out
checking it out now. so far 2 asian soft pop songs like they belong in some kids anime
It sucks ass, to defend it is to defend the one part of C that barely evolved with time.
A cpp macro can do barely fuck all, the worst macro system ever. It has arguments, with time it gained __VA_ARGS__ but it still sucks ass.
Fuck the C preprocessor.
Ask cppcon.org, or your .cpp files.
>Sup Forums
well duh
>yfw you're so much of a brainlet you don't realize this talk actually hasn't much to do with Cpp besides the fact it's happening at CppCon
std::fill(youreMom.begin(), youreMom.end(), dick);
But I don't have any .cpp files.
I have .cxx files though.
huh?
what the fuck is that shit
why are you using a static const expression of C strings
just use std::string for fuck's sake
There's a reason why the a in r/a/dio is surrounded by forward slashes, because it originated from Sup Forums.
Complaining about anime on r/a/dio is retarded.
how do i git gud
working through k&r but im finding too challenging. am i brainlet?
where can I learn how to understand cppreference documentation?
>implying i did anything besides look at the video thumbnail and see `new'
well fuck.
the fuck, user?!
bump for a decent audio experience
for(auto& hole : urmom)
std::putcock(hole)
>git: 'gud' is not a git command. See 'git --help'.
I don't think you can
write something very simple that would be useful to you
then write something else that's more complicated
etc
Here's a good starting point youtube.com
What are you having trouble with?
sounds ok so far, thanks, user.
What is a programming language that makes it especially easy to work with HTTP Requests?
I use Python requests and that works fine, but there's some limitations, e.g. no http pipelining.
No PHP pls
python can still do it baby
gist.github.com
#include
using namespace std;
int main() {
using namespace std::string_view_literals;
static constexpr std::string_view fuck[]{"shit piss cum"sv, "jizz tits ass"sv};
cout
depends on what you're into I guess. I listen to this one a lot
youtube.com
let us start a petition:
ALL tutorials MUST be presented by Natural English Speakers (preferably from the mid-west USA) - pajeet, can write it up, but FFS, these deep hindi accents, hell even bri'ish accents make understanding the content harder than it needs to be.
can i get an amen?
>using namespace std;
>int main() {
> using namespace std::string_view_literals;
>"..."sv
>sv
What is this string literal suffix and what does it do?
youtube.com
I find this very soothing
Fuck off youtube tutorial faggot.
A programming language is text, if you can't read text then go away.
Read books you fucking nigger.
please poo in loo, hitesh
>neat
user. Why would you not think to use std::string first? Also why are you using string views? Also
>std::string
>constexpr
Where is nigger.js?
hello mister robertson please do the needful yes sir right away thankyou
>poo in loo
Alright, do you think pajeet's intro to java video was meant for anybody but other pajeets?
Read a fucking book.
fuck vulkan, too
> hurr device queues have unknown performance
> durr vendors allowed to expose useless/testing queues
> urr durr hurp no way to find out except to run profiler every time application starts
thanks!
AMEN, brother!
i watch all the microsoft visual studio youtube videos that come out and so many times it would be easier to understand their words if they were having a stroke at the time pf presentation.
this is pretty soothing background music I find: youtube.com
The "fuck opengl" dude is just some redittor who believes he's in good company.
The javascript community doesn't take kindly to that type of language. Once you've checked your privilege and made sure every character in your source doesn't offend anybody, only then may you write javascript.
i'm just here to be drunkpost
vulkan > opengl in many ways, but too many open ends
He could be a vulcan shill as well..
>insert spock image
Fascinating.
This helps me concetrate
youtube.com
don't they have official tutorials on channel9
mmmm thanks
on yor bindoes match-een, doopleez doo hoold zee ALT key anpress zee F4 key.
tankyoo, pleez comb agin
I have a question Sup Forums, what specific technical skills are needed to be considered a really good programmer?
Nuclear autism in online arguments.