/dpt/ - Daily Programming Thread

Previous thread: What are you working on Jow Forums?

Attached: coding_is_easy_and_fun.jpg (496x1122, 204K)

Other urls found in this thread:

tools.suckless.org/farbfeld/
bitbucket.org/markm/sendkeysctypes/src/68b60cd364e9d890c097a3927d2e2617e2784dda/SendKeysCtypes.py?at=default&fileviewer=file-view-default
twitter.com/SFWRedditVideos

First for your mom xDDDD

Is LLVM an anime?

unironically started webshit in c++

Attached: 8127489321478213.jpg (500x698, 294K)

Yearly reminder to use #![feature(nll)].

fuck my timing.

Just realized something.

Minecraft was written in Java. How does that work? I've been under the impression that games are a no go for languages with garbage colection because the collectors would slow down the entire program at intervals.

Same with javascript. I've never seen the garbage collection being an issue for anyone.

Attached: 1327264650802.png (116x120, 36K)

it was written in java, and that's why it ran like shit
then microsoft bought it, and brought in actual professionals to port it to sepples

No. I dont know what it is, but I think it has something to do with C. Ive seen LLVM talked about in Rust, C, and WASM circles.

wt?

dropping the truth here my negroes: language choice literally doesn't matter

Never actually played it so I didn't know about its performance. Just assumed it runs (or ran) smooth because people go so much into it.

Now I realized C++ has garbage collection too. There's go to be something to this.

Have you ever wondered why minecraft runs like shit, even on fast computers?

incorrect

i am getting a really strange issue running a console app in windows, C++.

Even if all I do is a;
cout

Minecraft is a nightmare. I remember ready a blog post about the guy that makes the optifine mod. He said it's fucking incredible how optimized the whole thing is.
And they started switching to Enterprise Java™since microsoft bought it, the optifine guy basically said fuck this, here is an optimization mod, it's trash but blame mojang not me

Your IDE is trash, that's why

yes
too bad the ubuntu package is no longer maintained - building it was utter shit

Attached: Screenshot from 2018-09-02 15-43-12.png (640x192, 12K)

I am so bloody jealous of Notch damn

Ignoring performance (games with AAA graphics probably wouldn't run well in an interpreted language, no matter what machine you got at home), that's true unless you care about portability. Say I'd develop a game in ruby - I doubt I'd be able to port it to a console without rewriting it in a language that's popularly used for games.

Code::Blocks is affecting my console behaviour?

it's sorta fun, isn't it? I've been thinking about making pet shit in wt for a while

post your whole code

What are you even talking about? Plenty of modern games have garbage collection. It started becoming a common practice about a decade ago.

I hate people like you so GODDAMN MUCH. Now even basic rubbish, with no real time simulation, and basic ass graphics, like democracy 3 and orwell run like absolute SHIT.
FUCK you.

I've only started, but the idea of not having to touch JS does make me hard.

Attached: 412348912341.jpg (595x599, 79K)

You've been duped into thinking that Java is slow
You're wrong. Java GC is fast and will only get faster with Java 11 (~4ms for multiple terabytes of garbage)
You can absolutely write games in Java, e.g. minecraft, slay the spire, lewd maze, tales of androgyny, android games

Java version of minecraft ran fine and java is the reason why theres so many mods for it, because java has reflection. The C++ version does not support mods. C++ also doesn't have GC, unless you consider RAII GC

>java is the reason why theres so many mods for it, because java has reflection. The C++ version does not support mods.
really makes you think about the ABSOLUTE state of /dpt/

Attached: img65517081.jpg (760x760, 88K)

Dude calm down. I already decided to stick with C/C++ to include people with old ass computers.

what he said is true though

there's literally no reason for the lack of modding support in the c++ version, other than incompetence or oversight
it's not a language issue

Factorio is made with C++ and runs fine on old as fuck computers yet it has a fuckton of mods. Why? Because its developers are not retarded and added mod support from the beginning.
>inb4 mods are written in Lua so it's trash

Rust, tha game, sucks ass to play because of the GC. Go read their devblogs.

Rust was written by hobbyists who had no idea what they're doing

You could also have compiled dlls as mods. FSX does it iirc

but that seems to use unity?

is that a question.

How do I keep improving as a programmer? Will I ever be able to write code that I'm happy with?

Attached: 96gq9FD[1].jpg (500x648, 121K)

you already know how

Attached: TB2qplmaheK.eBjSZFlXXaywXXa_!!17848761_original.jpg (798x798, 166K)

I know C++ and Python. I want to contribute to a project related to the financial world. Any suggestions?

No cryptocurrency/blockchain shit please.

Attached: being and time.jpg (581x872, 51K)

literally all banks are on the blockchain rn my dude

learn Haskell

These are pics of dudes aren't they?

Programming socks is the answer to all problems.

>tfw don't understand the differences between newtype, type, and data, and mix them up erroneously all the time

Type defines a type synonym. It's almost like a macro.
Newtype is like data, except when there is only one, one argument constructor. It guarantees the same representation as its single field, and you can coerce between the two.
Data defines a type constructor (e.g. a type or generic type).

Newtype is a japanese otaku magazine

It is, the java version has been completely reverse engineered and a community made abstaction layer has been developed for it, decompiling native code, is fucking hard, comparatively, especially because you’d also have to crack the UWP drm.

Any sort of memory management is bad for a game. There is similar techniques that you need to use in both GC and non-GC languages to reduce it and get better performance.

see ,

You surely meant "automatic" memory management, right?

Don't bother arguing with that retard

They actually feel pretty comfy to wear desu...

how do I get chris and the tranny to send me a free copy of his book?
what's his email?

No, you do not want to allocate and release a lot of memory in the middle of a game loop, this kills performance

you sound like a retard
literally every sepples game has some form of memory management, either the default system, or some custom solution

Any suggestions on how to calibrate my sensor? I attached a TCS34725 sensor to an arduino to take color measurements. Pic related is my read vs reference measurements. I used a photographic color calibration card with "known" RGB values printed on it.

The G channel is good though the R and B need some work.

Attached: color_sensor_calibration_raw.png (2161x450, 34K)

nooo you're wrong m8 you gotta load every single resource the game uses before starting the game loop

that's called "memory management"

You're right, games shouldn't use memory at all.

Why do you need docker/containers when you could just run the applications on the hardware itself?
What benefit do containers offer?

it provides an opportunity for new books, talks, ""experts"", fooling business boomers, and selling shit to idiot nu male onions

Attached: lectures.jpg (1156x867, 136K)

Can someone explain what the [2222] means in the farbfeld image format?

Bytes Description
8 "farbfeld" magic value
4 32-Bit BE unsigned integer (width)
4 32-Bit BE unsigned integer (height)
[2222] 4*16-Bit BE unsigned integers [RGBA] / pixel, row-major
tools.suckless.org/farbfeld/

I use a container to compile for windows and other/older linux distros. Much simpler and not as resource heavy as a VM.

Rust's main problem is being built in unity. If the devs were any smart they'd put some money aside and pay a small team to rebuild the game in C++. It's a real shame because the game is super fun but it gets bogged down by lag and shitty network programming.

Language choice definitely mattered for Minecraft.

Since it was made in Java you could play the trial version as an applet in your browser.
Plus the Java bytecode was easy to decompile which enabled a lot of the game's modding community.

By that argument it would have been far better in javascript. Runs in browser with less hassle, even easier to tinker with, larger modding community.

Is there a way I can virtually press the Prtsc key through the command line? I'm trying to make an automated screen capture that passes the image through the clipboard to a python script that processes the image.

I could just use some screenshot software and save the image to disk first, but I'm afraid that takes too much time (Honestly not sure -- I would imagine it takes significantly less time to just pass it through the clipboard).

Attached: 702348742.jpg (500x295, 27K)

Not in 2011 when it came out. WebGL just came out around that time and definitely wasn't ready for prime time at that point. JS VMs weren't as optimized as the JVM at that point in time either.

2 bytes red
2 bytes green
2 bytes blue
2 bytes alpha

Good point all around, I forgot how old minecraft is.

how do i fix my attention span?
I'm trying to go through the c++ programming lang and I keep alt-tabbing away after every half page

Attached: 41289482934.jpg (1500x1000, 194K)

Oh geez, for some reason I thought that it was the number 2,222. Thanks.

Try writing some code and reading a chapter every once in a while. Alternatively, you could wilt away into obsolescence.

for X11 there's xdotool

reading some of these docs unfortunately requires lateral thinking

Did you google and find SendKey yet? There's a few modules that seem to do this, this one appears to have an option for PTRSC, not sure if that would do what you want.

bitbucket.org/markm/sendkeysctypes/src/68b60cd364e9d890c097a3927d2e2617e2784dda/SendKeysCtypes.py?at=default&fileviewer=file-view-default

I recommend high velocity lead treatment applied directly to forehead in 124 grain doses.

Seriously though, if you can, stop forcing yourself to learn what you aren't interested in. If you were genuinely interested in that, you wouldn't be trying to get away from it. This is universal life advice.

Attached: 124_grain_lead_treatment.jpg (1296x972, 216K)

>Alternatively, you could wilt away into obsolescence.
wow rude

>Seriously though, if you can, stop forcing yourself to learn what you aren't interested in. If you were genuinely interested in that, you wouldn't be trying to get away from it. This is universal life advice.
don't say that

Attached: 41234123523.jpg (900x900, 47K)

Suckless stuff would be nicer if it wasn't so terse.

I disagree, some stuff only gets good after you slog through it for a while.

But entire web services are deployed on them as well. I don't understand the benefit of having one container per service, other than it just being easier to manage.

Maybe try something else than C++? I said earlier in the thread, C++ is a nightmare. Just learn a well designed programming language that was designed to be used by human beings.

I wouldn't know because I'm not a webdev but it's very useful to me, much easier than installing 10 different VMs when I just need a compilation environment
pic related, my containers so far.
I still need to tweak them and change some things but as you can see their size is very small and they run very well.
The two images that are ~1GB I've use to compile a specific gcc version and didn't clean up the install

Attached: Screenshot_2018-09-02_16-52-18.png (116x177, 9K)

Oh no, I like the language and I've been using it for a number of years. Just wanted to go through the bible to polish some rough edges and learn some new stuff, but the problem is I can't focus on the words for too long for some reason. My eyes just fly off in all directions.

That might work, I'll give that a go. Thanks!

>a well designed programming language that was designed to be used by human beings
Such as Ada or Fortran (9*, 200* versions)?

Close Jow Forums you massive fag.
Also close any websites not useful to your reading. The best thing would be to get your reading material in pdf format and read it on a kindle or something.

tanh : Real → Real
delay : Signal Real ⊸ Signal Real

integrate : Signal Real ⊸ Signal Real
integrate x = 0.5 x + delay (0.5 x + integrate x)

low_pass : Signal Real ⊸ Signal Real
low_pass x = integrate (x - low_pass x)

soft_clip : Signal Real → Signal Real
soft_clip = tanh

warm_low_pass : Signal Real → Signal Real
warm_low_pass x = integrate (soft_clip x - soft_clip (warm_low_pass x))

>fag
please refrain from using this kind of homophobic language in the future
thank you

>implicit fmap

Attached: 1476899775627.png (320x320, 114K)

go back to your wank shack you massive cock sucker

>chinese cartoon picture
opinion instantly discarded

I will delete your life

Attached: 1484620344522.jpg (600x564, 33K)

this is quite hurtful, buddy. You have to understand it's not acceptable to use the f- word.

>no trigger discipline

I hate that the more intelligence I become the worst it gets.

Attached: 1474325315193.jpg (636x616, 44K)

I'm so good at programming that it hurts

Attached: 1527048925688.jpg (480x640, 48K)

I want to be a little girl

That programs!

Faggot.
t. JMB

Attached: Pic-11[1].jpg (2790x2508, 639K)

I will be back at work tomorrow and I will continue add new features to several APIs that handle my banks financial transactions. Bad thing is the previous coders left a mess on one of the APIs. Another bad thing is that our vendor working on the front-end do not listen to me and kept arguing with the specs.