/dpt/ - Daily Programming Thread

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

Attached: 1556414834931.jpg (675x900, 223K)

Other urls found in this thread:

developer.android.com/reference/android/media/MediaCodec
twitter.com/AnonBabble

kys disgusting pedo scum

Haskell is the most beautiful language in the world, if you don't think so, you're fag or a nigger

Attached: file.png (658x855, 617K)

why are sound file formats so complicated

Getting a bf

Attached: 1556291463060.jpg (250x250, 12K)

@70751160


>dumb attention whoring anime pedo scum calls someone a fag or nigger


seriously

.wav isn't particularly complicated. You'd do basically all of your real processing on raw PCM.

Compression is hard.
This. Even a brainlet like me made a simple wav decoder.

I'm currently working on changing one of the core parts of my wayland compositor library.
It sure is fun to massively break APIs for your users.

But it requires changing so much code to match my new design; I can't even test it properly as it is.

Attached: 1554336504492.jpg (2645x3305, 616K)

Friendly reminder to mark your virtual method overrides as final to help the optimizer.

Attached: 1536608288695.jpg (600x1137, 602K)

wish I had a senko san

pedo website
go back, faggot

buy one at the senko san shop

Pedo website

Attached: 1527248755184.jpg (1433x2024, 711K)

I am quite sure any compiler can detect if a method is final on its own

Cute pic dude

based and simon marlow pilled

Where can I find this mythical place?

DON'T YOU FUCKING DARE TO GIVE ME ANY (You)s DISGUSTING PEDO SCUM


YOU HAVE NO RIGHT TO EXIST


AND YOU HAVE NO RIGHT TO TALK TO ME

@70751357
go back

ask senko san

>What are you working on, Jow Forums?
Trying some stuff with Android's Camera API and Java sockets and sorta making some progress.

Attached: pain.png (1216x1040, 135K)

...

fpbp

do you know what you're doing with sockets or should you really be using a protocol built on top of that

I don't know how you people can code with that huge amount of bloat on screen

Nope, I was inspecting the output of -fopt-info on one of my projects and I just spotted multiple cases where the compiler couldn't convert it to a direct call. I had LTO on too.
Here's the details:
I have an interface like this:
struct Lock {
virtual void lock() = 0;

virtual void unlock() = 0;

virtual ~Lock() = default;
};

And a mutex type that implements it:
struct Mutex : Lock {
Mutex() : taken(false) {}

void lock();

bool try_lock();

void unlock();

private:
bool taken;
WaitQueue wait_queue;
};

Plus one other type that implements Lock, which hardly ever actually gets used in the codebase, except for like maybe once or something.
And I have a lock guard type like this:
template
struct LockGuard {
LockGuard(T &lock) : lock(lock) {
lock.lock();
}

~LockGuard() {
lock.unlock();
}

private:
T &lock;
};


Now, somewhere in my code (in fact, lots of places), I have this code:
LockGuard guard1(lock);

So LockGuard gets instantiated with T=Mutex, so LockGuard::lock becomes type Mutex&.
Now, for reasons I'm unsure of, the compiler was for some reason unable to see through that reference and realize the referencee was a concrete Mutex. (maybe it didn't inline LockGuard::LockGuard? who knows)
Because of that, the call to lock.lock() is now a virtual call, and, for another unknown reason, the compiler could not convert the call to a direct call, because maybe it thought there could be subtypes of Mutex (there isn't).
As soon as I fixed my Mutex type to
struct Mutex : Lock {
Mutex() : taken(false) {}

void lock() final;

bool try_lock();

void unlock() final;

private:
bool taken;
WaitQueue wait_queue;
};

the problem went away.

The compiler isn't always as smart as some people say, sometimes she's a big dummy and needs help.
Remember to always give as much information as possible to compiler-chan so she can do her best!

Thanks.

Attached: 1546000833779.jpg (600x848, 124K)

Attached: 1540826918288.jpg (675x1200, 115K)

>oppai
kys

Looking to spew raw h264 data as soon as I can get my structure figured out some more and convert my video to h264.

did you try it with non-templated code?

>anime
unironically kys disgusting pedo scum
>he knows what sort of anime is it
feel free to kys too, fag

imagine being mad about anime on Jow Forums

Attached: 1554939578390.jpg (468x468, 193K)

>oppai
>type of anime
Also pedo website.

Attached: 1525981088468.jpg (714x1000, 705K)

my personal experience using sockets directly has been that they're a nightmare and i would always choose something higher level now, you might even be able to leverage HLS
but if you know what you're doing then good luck

anime is fine, false-flagging paedophile shills are not

this is much better
never post oppai lolis again

If I replace T with Lock, it still doesn't get converted to a direct call.
Can't test with T replaced with Mutex because that causes type errors in other parts of code.

still pretty fucking retarded, you could write a pre-processor to convert all your final methods to final, the compiler should be doing that for you

>you could write a pre-processor to convert all your final methods to final, the compiler should be doing that for you
No, because some methods can't be final. You can just make assumptions like that.
Remember, it's valid for types deriving other types to be loaded dynamically from shared libraries at any time. The compiler can't assume every override is final.

I dont write dynamically shared libaries

Ok but the compiler doesn't know that.

well then we're all suffering for a feature many people dont use

imagine being so mentally ill you find kids arousing

No just remember to mark overrides as final, as long as they actually are final.

thats hunrdeds of classes and thousands of methods for me

Seems to me like you're using a bit too much virtual

Luckily ffmpeg will be on the other side and it deals with reconnecting to raw tcp stream very well. The server forks at the moment and copies data to all connected client, although I might change that.

it wouldnt even be a problem if it didnt have to support a dumb feature like dynamic inheritance, so much for zero cost abstractions

Eventually I will figure out wtf I am doing, hopefully.

Attached: cleint.png (1216x1040, 126K)

>dynamic inheritance
It's just inheritance. It's dynamic to begin with.

/agdg/ memes > CS grad memes

Attached: agdg unity.png (1485x766, 216K)

Why are you even using virtual functions at all?

There's 2 flags -Wsuggest-final-types and -Wsuggest-final-methods that allows you to see whether marking them as final is actually worth it.

Attached: 1556031955307.png (718x63, 11K)

static inheritance via a crtp is a thing, so no, it’s not

>oppai-loli
based and pedopilled

Do not (You) me ever again

that's because /dpt/ is serious business

...

Looks like this run's p fast. Just need to encode the raw camera data to h264 now!

Attached: jackpot.png (1585x1040, 142K)

did they announce EVA 3.0+2.0?

Attached: 1531040547742.jpg (402x469, 37K)

Attached: 1550532525713.jpg (883x960, 55K)

is c++ the true path to computer wizardry?

No.

no

Yes

Nope

Yes

then what is

Ask again later.

Why would I tell you? It's Haskell

Attached: Reisen.Udongein.Inaba.full.1915431.jpg (900x1271, 803K)

C or some intel syntax asm

the real test will be how reliable the video feed is on the other end

well, you start with anime, you like computers, you get into Linux... you know where this ends...

imagine wanting to hire someone and finding they have an anime picture in their github account lmao
good luck programming waifus chief because you ain't gonna get paid for that

anyone else just straight up reject "programmers" who don't have anime avatars on their github? bad taste makes for a bad programmer

Attached: 1556480871706.jpg (1024x576, 90K)

I only hire people with anime profile pictures

I got my current job with an anime github profile picture.
Everyone knows that weebs are undoubtedly the best programmers.

Attached: 1554334256061.jpg (704x1024, 59K)

True. I am finally starting to feel like I can get rid of some messes I have made trying to re-learn android's flavor or java.

developer.android.com/reference/android/media/MediaCodec

Since I am targetting API level 18 this looks like it should make encoding to h264 easy. And since I am already using a surface for my camera preview it sounds like it should be pretty fast.

There is only one reaction to this degree of weaponized autism: XD

mate, people don't get paid with chicken tendies

Attached: 0b3.png (534x400, 188K)

mate, no one wants to hire pure autists. teamwork is also important, and the ability to communicate with others. let alone the fucking smell.

we had two hardcore weeb C++ devs, we just literally put them in a small room that was a storage closet. they smelled like rotten fish. fucking disgusting.

meh, they were underpaid and got the worst jobs anyway.

please stop saying mate it's making me cringe

k mate

stop spamming the fucking thread you deranged autist

My application benefits significantly from being compiled with -march=native on several platforms, but that obviously makes the binary less portable, so I want to have separate build types which either include it (presumably default for people building from source for the own use) or don't (for packaging, docker images, i.e. more portable distribution in general).

I'm thinking of leaving the default built type (with -march=native) as just "Release", but what should I call the more portable build type? "Portable"? "Nonnative"? I've usually only had Release and Debug in my projects.

>Senko
I approve.

LMAO.
Yes, this thread is so great, and it's so very much about programming already!

I've been working as a programmer for the last 5 years and my github pic is a cute anime girl. Get rekt.

newfag

Mixed endians

Attached: cantador.png (686x429, 539K)

implying weeb/pedo/shota/trap shitposting has ever been a common thing

so question from yesterday
void someFunc(const char* p) {
int* ip = (int*) p;

// do some calculations with ip
}
In what way would I be able to predict what ip would hold?
Let's assume that I'm limiting myself to using only the first 4 elements of ip.
I imagined that if I wrote some string "asdf" that I'd get an integer representation of it in ip[0] but doesn't seem to be the case, the result almost seems random except for the starting 2 digits which correspod to 'a' char code

you're not making it better with actual spam you fucking retard.
Go back to reddít if you can't keep yourself from getting triggered by pictures that are posted at the start of every thread, it's nothing new and it won't change.
fucking kill yourself

weeb shitposting yes

Mixed Indians

Attached: file.png (227x222, 70K)

if I pass "asdfasdfasdfasdfasdf" and print the first 5 elements (%u) I get:
1634545454
1627418217
1634100339
1634100339
1634100339
I don't get it, why are the first 2 numbers different

nigger

Generic

trap posting is recent but weeb posting has literally always been extremely common on Jow Forums.

I know, and I am not saying posting anime characters is a bad thing over the whole site. It has it's places, like on /b/, /jp/, etc. But to just randomly spam a thread where we have an on-going topic.... that's just fucking low and should worth a ban.

This entire thread is like 80% shitposting. It's truly awful. I came here to help new coders, instead I see just weeb shit spammed. Fuck that.