/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1555973798276.jpg (1280x720, 113K)

Other urls found in this thread:

youtube.com/watch?v=RBr5If8GrM4
en.wikipedia.org/wiki/Beatty_sequence
twitter.com/SFWRedditVideos

nth for Nim!

If you write C++ you're a nigger

is this tutorial any good?

Attached: file.png (374x473, 128K)

video tutorial are all fucking shit.
-read the docs
-browse S.O
-read C# in a nutshell
if you absolutely must, Tim Corey and channel9.

I lived in niggurland during my teens, I program in Sepples for a living (I'd rather be a Cnile at work, but whatever), but I'm not of dark complexion. Do I comply?

I'm working on making my window server load new wallpapers in a background thread. It currently freezes the system while I wait for the PNG decoder, so that's not super cool.
I'm kinda playing around with it to discover what kind of threading API's I'd like to have.

Earlier today I also made a demo video of the last month of changes in my operating system: youtube.com/watch?v=RBr5If8GrM4

Attached: Screenshot at 2019-05-01 00-06-07.png (1920x1080, 1.29M)

I personally learned c# (and c++, working g on Haskell atm) by working on project Euler problems

I learned through a book
I think it was deitel and deitel

Is being a junior dev hard

Going through all sorts of bare metal raspi3 resources, wrapping my head around all those booting modes.
Tomorrow I'll try basic preemptive multitasking on single thread. Not sure if I want to bother with execution levels and virtual memory already. Have to say STM's data sheets are far nicer than Broadcoms.
I've tried to write amd64 kernel before but Aarch64 is so damn clean and comfy. I love it so far.
I'm also curious for multicore, never done multicore before.

Depends. Is there a senior dev on your project, team or even in your company? If not then yes.

there is
so what if I fuck up will the senior dev fix my shit and clean up after me or how does it work

a good senior will call you a retard and make you feel hopeless

then he will fix your shit

How does Angular work

No. You fix your own shit or you get canned. Ask the senior engineer for advice but don’t make them do your job.

Is it humanly possible to be a good programmer using a "he" pronoun?

This.

>you get canned
and so does the project lol

ask >>>/wdg/

>so what if I fuck up will the senior dev fix my shit and clean up after me
They might kick your ass instead. If you fucked up because you were stupid, you'll deserve that. If you keep making the same mistake over and over, you'll deserve that.

Is it humanly possible for you faggots to go five minutes without degenerating out society?

hey as long as i get paid i dont mind

He will take one look at your code and tell you to do it again until you get it right. If he cared about getting it done he wouldn't have given it to you.

read a bok first my negro

c-hash yellow book still holds up, or so I've heard

Do you know what's harder than finding a job with no work experience under your belt? Finding a job where you were fired and publicly blacklisted after 3 months in your first job.

So good luck with that.

>no anime pic with a girl holding ISO/IEC 14882:2017(E)
Shame tbqh

no wonder people kill themselves
nice (((society)))

Trying to teach myself how to use NLTK with Python for ... reasons

writing c++ wrapper around c libraries is really tedious.
at least macros make it easier.

Attached: curl.png (762x545, 150K)

Trying to run an android build of a react-native app. It builds successfully, and then produces this error to prevent it from running.

Security exception: Permission Denial: starting Intent

Any thoughts?

>finding excuses to not do your job properly
lmao

I know nothing about Android development, but I'm guessing that the app requires permissions it has been denied.

how do you draw a chess board on the console?
it's really hard to come up with something that's not spaghetticode

open adb logcat and try running your application, see if you get any more detailed error messages.

Write a module to do it. My intuition would be to write a function which can print a matrix to the console. Then a fuction to generate a default matrix. Then the facilities to modify locations of pieces by overwriting values in the matrix where they reside.
For something more robust you might look at a library like ncurses.

that depends on how you structured your chess board in your program, I used a bitboard in mine. it's not complete spaghetti but the print function is about 30 lines of C. if you mean graphically and your terminal/font supports it unicode has chess symbols.

chess symbols would be cool but currently I'm just saying 2Q for example for player 2 Queen
but I think I found something that's not complete dogshit, have to try now

>currently I'm just saying 2Q for example for player 2 Queen
for printing, don't do that. if you want ascii only, use Q and q. from gnuchess:
r n b q k b n r
p p p p p p p p
. . . . . . . .
. . . . . . . .
. . . . P . . .
. . . . . . . .
P P P P . P P P
R N B Q K B N R

Easy.
|__||__|
||||
|__|__|

How can we obtain boards for other interests but with /dpt/‘s IQ?

sounds good

Apparently Jow Forums doesn't like chess characters but the the chess unicode characters were supposed to be between the bars.

Have you ever made unintentionally a different program because the code wasn't what you wanted but it compiled?

I made a program that prints Segmentation fault.

Becoming a sepples wizardo

Attached: 13378F5B-D78D-47E6-8340-9FEE168ABBDD.jpg (220x271, 17K)

I feel like it would take me 6 months to read this

the infamous segfault generator

lmao more like six penises

Attached: 0F64F4B0-0DC9-4BD3-BA70-F58353D6AB5C.jpg (300x350, 26K)

i dont get it

dot see peepee

haha good one user

Attached: 1447438659860.png (390x470, 11K)

Sorry user, I do C++

Ecmascript, Haskell, and Cpeepee are all you need.

Attached: 58CBDF29-163F-4E26-BC21-99A2C8CB30A3.png (1024x1280, 88K)

how do u make a function that takes an HP value and the lower it gets the more priority it gives?

like I want to set my chess piece move priority with how much HP the enemy piece has multiplied by how low it's HP is.

Attached: 827.png (680x638, 250K)

is there any merit to learning sml/ocaml before haskell?

Attached: xsjhvax8gap21.jpg (750x398, 40K)

>u
Fuck off, stupid illiterate frogposter.

>with /dpt/‘s IQ?

Attached: 1477864477183.jpg (654x525, 46K)

chess pieces don't have HP, trust me im a scientist

Attached: 1556283308876.png (1436x1210, 271K)

there isn't any merit in learning ML and Haskell.

mine does.

Attached: latgi.webm (1024x600, 1.39M)

Review your highschool algebra book. Specifically the equation of a line.

Attached: 97A63558-2C45-40D5-B537-75EB85DABE77.png (633x709, 284K)

can u help me?

math is faggot shit and I have no clue what algebra does.

Attached: 1521469512317.png (650x638, 25K)

To learn haskell, no.
It is worthwhile to learn a bit of ML because of how influential it was. Many features from ML are only now being implemented in common languages, it was way ahead of its time.

Not a math help thread, go ask sci.

Attached: 207D7BB3-03B4-469D-AEFD-8602D9DD3048.png (589x720, 584K)

How can I use a regex to map URIs to handlers? It's a catch 22. The URIs are generated at runtime, but the route handling needs to be done at compile time. This is in C++.

You need a router that can find the correct handler for the route.

def take_hp(priority)
n = int(priority)
str_alpha = str("41421356237309504880168872420969807856967187537694" +
"80731766797379907324784621070388503875343276415727")
alpha, sigma, sign = int(str_alpha), 0, 1
while n > 0:
n_ = int(str(n * alpha)[:-len(str_alpha)] or 0)
sigma += sign * ((n+n_)*(n+n_+1)/2 - n_*(n_+1))
n, sign = n_, -sign

return str(sigma)

wtf this do?

Attached: 1520524959926.jpg (284x178, 9K)

The code is the only documentation you should need.

Kek

For real though it solves beatty sequence for floor(i * sqrt(2)) where i=priority in this case..

I have no clue what you guys are talking about.
I'm too dumb.

Attached: 1520380041734.png (650x773, 47K)

en.wikipedia.org/wiki/Beatty_sequence

Attached: 1476589963382.gif (300x222, 485K)

>string operations on an numerical algorithm
You're a shit programmer.

dumb frogposter

>str("..." + "....")
why is python so autistic?

there's not a youtube video that explains it and the wikipedia page is just math equations.

Attached: 1520487468308.jpg (1920x1541, 126K)

Stop replying

all me

Try to recreate the code without the strings. See what is stored.

dumb wojack poster
lighten up

Attached: 1544009500110.png (1422x1250, 1.45M)

the reason why NTFS copying gets slower the closer it is to being done is because of fragmentation, correct?

just use this and go
def linear_function(weight, max_hp, hp):
" weight: max value of function \
max_hp: pieces max hp \
hp: pieces current hp \
return: the weight scaled by the units remaining hp [0, weight]"
return weight - weight * (hp / max_hp)

My daughter Gabriel is so cute in those cat pajamas!

thanks, but how do u give more priority to the ratio being lower (having lower HP)?

I just need some dumb down explanation.

@@70759930
>>>/facebook/
Fuck off

soon

Jesus christ, you can't even figure out lerp? You're not going to make it, just give up now.
There is a reason why we call fuckheads like you "stupid frogposter", and you still need to fuck off.

Attached: 1450763534148.png (508x685, 398K)

there's also memory not yet written to disk but the write functions return early so that the callng program keeps running instead of waiting for disk. that's why when you monitor write speeds on slow devices it goes from extremely fast to shit slow.

I don't know math beyond elementary school.

Recess is over kid, get off Jow Forums and get back to class.

I know people say you don't need any "real" maths for most programming tasks, but god damn, you still need basic shit like high-school level algebra.

I self teach myself how to code using game tutorials.

I still have no clue how do I code but I can code a lot of things on game engines.

and don't come back

>New C++20 std::lerp
>defined in
why

You are going to need a lot of basic math to write games. Basic algebra and probability are necessary, and linear algebra is needed if you want to do any graphics work yourself.

>Gaymes
Oh course that's what it fucking is. In fact, algebra is even more important for games, and any real shit is going to make heavy use of university-level linear algebra. Basically you're fucked.
Go back to your containment thread.

Not frogposter. I'm graduating college soon and never took linear algebra. How fucked am I?

The linear algebra you need for games isn't actually that much, if you're a university graduate you could probably learn it pretty easily on your own.