/dpt/ - Daily Programming Thread

Old thread: What are you working on, Sup Forums?

Other urls found in this thread:

youtube.com/watch?v=Zg6svO2AQHw
hastebin.com/rahidanodo.mel
youtube.com/watch?v=wf9nadEEmtw
en.wikipedia.org/wiki/CHIP-8.
twitter.com/SFWRedditVideos

thank you for not posting a fag thread

Programming to dank tunes
youtube.com/watch?v=Zg6svO2AQHw

First for programming

#ProgrammerLife

I can guarantee you've never read any of those books you dumb poser NEET.

That's Karlie, can't you tell from the diet shaming and product placement?

Is scheme a meme?

there are so many things wrong with this pic i can't be bothered to point them out

That's okay, I guess you don't know how to #kode

>a bunch of 'nerdy' shit around
>stacks and stacks of assorted technical books and biographies of talentless hacks
>plastic bottled water in Anno Domini 2016
>no paper with random maths written on it to be seen
Does karli want people to think she's not a programmer?

Is there any way this code can be improved? I'm trying to make a bullet that, upon seeing an enemy nearby, automatically turns towards it. This works, but it's VERY slow; with lots of bullets on the screen, my FPS drops to the 30s.

hastebin.com/rahidanodo.mel

y'all didn't forget about me by moving to a new thread, did you?

if you have the algorithm sorted out you could try doing it in a compute shader on the gpu

Not even that attractive ngl

her physical beauty is one thing, but it's not all of who she is. i like her talents and personality too.

i assume you buy a machine based on the case, not giving a care about the processor, gpu, memory, etc...

I wish there was an anime about programming.

btw BPS and Lain don't count.

>talents
>personality
Hahahahahahaha, she has neither

GitS

bitch
do i look like i know what that shit means
i just need to speed the code up

She's an Aryan goddess.

if you have many bullets that your'e running logic on it might be better to parallelize it on the gpu to speed it up

look here how much faster it runs on the gpu instead of on the cpu

youtube.com/watch?v=wf9nadEEmtw

She's an American. She's a mongrel.

she's too tall and she looks like shit without makeup on and literally what talent and personality, you're looking at her through rose tinted glasses

nah, you had your head up your ass so long, you have a shitty outlook on life. plus you're so full of shit your eyes are brown. TS fits me. even if she don't fit you.

>parallelize it on the gpu to speed it up
I wouldn't even know how to begin to do that.
Besides, I'm not using Unity, I'm using my own engine in C++.

*tips*

well how many bullets are we talking, and maybe you could do regular cpu multithreading in parallel with other game logic or something

>needs javascript to view
dont do this.

remove the trigonometry functions and use a movement vector instead

She has got nice legs though.

and use the squared distance so you don't have to calculate the square root

Average at best.

>how many bullets are we talking
My game has SHITLOADS of bullets in it. The FPS starts dropping at around 150 bullets.

>hastebin.com/rahidanodo.mel
change the sqrt to abs(dx+dy)?

>shitloads
10
100
1000
10000
pick please

see and use normalize(closestEnemy->Position() - position) * speed * fixedDeltaTime instead of using angleBetween with atan2

Well like I said, the FPS starts dropping at around 150, but the theoretical maximum right now is around 1200.

CLOAKING SUITS FUCKING WHEN

You either need to gitgud and use compute shaders to make the GPU to the hard work or you need to think around your current problem and come up with a way that doesn't involve whatever is currently kicking your CPU in the ass.

Why not just have him use regular threads?

but even without these improvements you shouldn't have this bad performance, all your other code most be slow as shit too

my bank has an app i use on my android phone. it req'd me to create an account on a regular pc first though. install app and log in - cool. but it doesn't allow me to login on the same app on a different device spare phone or tablet.

i want to do something similar when building my app, but idk what to even search the documentation for.

i want my app to have users upload info and get paid for doing so. but if they upload too much crap info, i want to disabled/ban them. it would be nice if i could req them to login with google account associated with their device. so i can ban their account and device when needed.

in case it's not clear, i'm talking android using java

also, how to make register/login using google account (token?)
don't need you to code it for me, just having trouble with what terms/keywords/phrases to search the doc page for

Because CPU parallelisation is a shit meme and you're just going to be kicking the ball down the road instead of actually solving the problem long term.

I mean yeah it'd definitely make life less miserable short term, but it doesn't give you a whole heap of room to work with.

Why would you bother putting the time and effort in when doing it on the GPU or working around the issue entirely would actually yield worthwhile returns.

I'm also updating and rendering lots of particles (which are just tiny sprites that disappear after a few seconds) at once, Removing them seems to boost the FPS a bit.

use the gpu for particles

full stack vue 2.0 web app

Oh and in addition to this, if it's his own engine then working out how to do this kinda shit on the GPU properly would be a huge boost for everything he tries to push through it for the foreseeable future (assuming he actually adds the functionality to the engine properly).

There's very little point solving this problem with a bit of duct tape and crossed fingers.

Yes, let's make him do all this complicated unnecessary shit, when he doesn't need it, because when he decides that he needs 10000000000000000000000000000000000000000000000000000 bullets on screen at once, he can do it AMIRITE?

cpu multithreading is a meme in most cases, for 150-1200 bullets if he doesn't want to do it on the gpu he should still be fine with a single thread or a single worker thread

Plus, if he needs to target anything pre DX11, he'll need to make things in CUDA.

I did it.

#include
#include
#include
#include "anagram.h"

struct Vector anagrams_for(char *word, struct Vector list)
{
int len = strlen(word), begin = 0, counter = 0;

struct Vector vout = {NULL, 0};
vout.vec = malloc(list.size * MAX_STR_LEN);

iterate:
if (begin == list.size)
return vout;

for (int i = 0; i < len; ++i)
{
for (int j = 0; j < strlen(list.vec[begin]); ++j)
{
if (len != strlen(list.vec[begin]))
continue;

if (word[i + 1] == word[i])
continue;

if (word[i] == list.vec[begin][j])
++counter;
}
}

if (counter == len)
strcpy(vout.vec[vout.size++], list.vec[begin]);

counter = 0;
++begin;
goto iterate;

return vout;
}

>Yes, let's make him do all this complicated unnecessary shit, when he doesn't need it

If this were a valid argument, then the only valid response to him would be "Go use UE4".

He's the one who decided to make his own engine, within that is the express understanding that you're gonna have to implement a bunch of really complicated shit so that your engine doesn't suck a bag of dicks.

Why not just OpenCL

Nvidia doesn't support it on their pre DX11 cards.

I'm actually using [spoiler]SDL2's renderer.[/spoiler]
[spoiler]It's just so fucking easy and simple, fuck off.[/spoiler]

I'm talking about compute not rendering.

should i get blazed before i continue with lpthw exercises?

weed + voice recorder to brain storm ideas
be straight when coding tho

I think it's called "device ID" in android...

if you care about performance and quality you should learn how to do proper rendering

Name a good C project to work on

What good resources are there for learning embedded programming? Or is it probably better just learning good low level C stuff?

it might be tied to your sim card

i dont think aloud though, so maybe text editor+weed?

i was thinking since ive had a break for so long, i started to learn C and now i need to get blazed to transition myself into the mindset that i should be reading documentation and doing exercises every day instead of shitposting and playing gaymans.

I know, I know, but this game is already way too far along already to switch renderers. I'll probably use SDL2's built in OpenGL for my next game, though.

Write your own OS and then you'll be ready for anything.

>He's the one who decided to make his own engine, within that is the express understanding that you're gonna have to implement a bunch of really complicated shit so that your engine doesn't suck a bag of dicks.
yes, of GPGPU is not one of those things however.

no, CPU parallelisation is fine, CPUs have a lot better synchronisation facilities etc.
GPUs are only a good choice if your code has certain properties.

How fucking long does LLVM take to build? I've been compiling it in a VM for the past 20 minutes.

Write an OS that can browse and post to /dpt/.

I remember when I thought 20 minutes was a long compilation too.

try writing emulators for simple consoles.

I compiled Firefox on my shitty Gentoo laptop 3 years ago and it took me 19 hours, but nothing on my desktop Xeon has ever taken close to this long to build.

What keywords does Lockheed Martin use for resumes?

such as?

I made a simple integer class in C++

what did he mean by this?

does this mean i am already a better programmer since i use vim?

/dpt/ how do I git gud at math?
I'll be honest, I was a lazy piece of shit during high school, and never learned how to math good.
I did "just enough" to get by, but I never really bothered with my homework.
When I tried to get back into it, none of it made any sense to me and I felt stuck.
I probably don't have any knowledge of math concepts beyond 8th grade, where do I start?

>Python
kek

enjoy your meme language

chip8 is the essential beginner emulator project en.wikipedia.org/wiki/CHIP-8.

it's pretty simple, after that you can try gameboy or something.

i know its gay but i want to make shit for my web page

>python

>does this mean i am already a better programmer since i use vim?
no it means that you shouldn't use vim because you suck

"If you're trying to learn Python close that fucking book and learn Ruby instead."

"If you're trying to learn Ruby put that fucking dragon dildo away and learn C"

lol i am not a programmer im like grandma user WHERE DID MY EMAIL BUTTON GO

hey faglords, anyone got a guide on mapping apps?
I need to rebuild some shitty lib, because it's old and does not work as it should... and I'm too lazy to "reverse engineer" this shit, so might as well learn the concepts and stuff

second Q: is it worth it to rebuild libs, when other langs support more or the same shit?

But I already know C. Also, what has to do ruby with c? They're not even on the same level, ruby is a interpreted scripting language lmao

Tragically, I was bored enough to write a runescape bot that just picks up beef.

checked

Damn, dpt is slow as shit recently
Where did all the shitposters go?

if you can write proper bots that are more or less unbannable you could make a good buck off of it or at least you could in the past

One time, /dpt/ was so slow, I purposely bumped all the dead threads on Sup Forums and made 4 more just to bump /dpt/ off the board.

>not liking practically all healthy womens exterior
Are you gay or something?

if anyone is familiar with World of Warcraft fishing, you know there's a splash sound when it's time to click.

i want to build a small java app that listens for that splash coming out of my speakers via the laptop's microphone and then have it"click" the left mouse button.

sounds simple enough.

but the boober moves a bit on screen, is there any way to get the mouse to follow the bobber that wouldn't give any feedback to blizzard that this action is going on?

>Anime
Skipped

Nobody wants your worthless opinions here anyway, reddit.

user. He's making a bullet hell game. It shouldn't be that problematic.
Maybe have him post relevant source.

Like position/rotation storage, his rendering pipeline and presumably opengl code.