/dpt/ - Daily Programming Thread

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

Attached: 1568371408321.jpg (1440x1920, 1.54M)

Other urls found in this thread:

youtube.com/watch?v=uqY3FMuMuRo&t=157s
myrlang.org
github.com/oridb/mc
twitter.com/AnonBabble

Cute demon

>last commit: oct 3

Attached: 1556254713180.jpg (1280x720, 99K)

Why is her head the size of her torso?

I mean here is the shader code, it handles different font sizes arranged in different manners, and different terminal colors
shader_type canvas_item;
uniform sampler2D font;
uniform sampler2D palette;
uniform vec2 font_size;
// up to 256 color terminal
// a - character index
// b - background index
// g - foreground index
// r - attributes *NOT IMPLEMENTED*
void fragment(){
vec2 fontset_size = vec2(textureSize(font, 0));
vec2 fontset_size_in_chars = round(fontset_size / font_size); // round to fix bad floats
int chars_per_row = int(fontset_size_in_chars.x);
vec2 repeat = mod(UV / SCREEN_PIXEL_SIZE, font_size) / fontset_size;
ivec4 cell = ivec4(255.0 * texture(TEXTURE, UV));
vec2 offset = vec2(float(cell.a % chars_per_row), float(cell.a / chars_per_row)) / fontset_size_in_chars;
vec2 tile_uv = offset + repeat;
float pixel = texture(font, tile_uv).r;
float bg_index = float(cell.b) / float(textureSize(palette, 0).x - 1);
float fg_index = float(cell.g) / float(textureSize(palette, 0).x - 1);
vec3 bg_color = texture(palette, vec2(bg_index,0.5)).rgb;
vec3 fg_color = texture(palette, vec2(fg_index,0.5)).rgb;
COLOR.rgb = mix(bg_color, fg_color, pixel);
}

Anone! It's your chance to become a good JavaScript programmer now!

Attached: 61753d21bfa065e164bb85696daafb2e.jpg (1912x2868, 195K)

cute semen demon

better than me, your last commit is in the future!

i wish to be triangular

Will you let me pat your head if I do?

based demon poster

I might coom because of this

I know Jow Forums is anti-java, but I need to know how to do this.
I need to run a command line process from a Java REST API. As input, this process needs a temp file that I create. Ideally, this temp file would be deleted by the main Java program after the process finishes executing. I want to use ProcessBuilder to start the process.
Is there a way that I can, in this order, 1) start the process, 2) return or somehow get the PID of the process back to the calling method, and 3) wait for the process to finish executing so I can delete the temp files?

Thanks Jow Forumsuys, I'm sure one of you would know how to do this.

About to start learning Direct3D 12... What am I in for?

Direct3D 11 + 1

There is literally no reason to use DirectX.
Stop being a dumbass and use Vulkan.

stop being a dumbass and make your own graphics card

Is anyone actually using Vulkan yet?

this
virgin opengl 2d vs direct3dpd

Are you claiming that you've made your own GPU that supports Direct3D 12 but not Vulkan?
Are you the kind of idiot that would use a platform-restricted proprietary API for absolutely no reason?

I've heard D3D has better documentation

>documentation
Literally who cares

I heard your mum has better documentation

Her API has been totally mapped out

hash map hahahah us nerds right lol

She even has daily penetration testing

>when you don't get the joke

My GPU doesnt support anything but my own open source format
youtube.com/watch?v=uqY3FMuMuRo&t=157s

Attached: pepedrink.jpg (369x387, 35K)

my penis is a linked list lol hahahahahahah O(n) complexity hahahahahahaahahahahahwhahqha lol

Fuck off, you stupid frogposter.

Attached: 1561299316554.jpg (548x548, 64K)

Nobody was talking about hash maps but you. You're a nerd by your own admission, so fuck off

Fuck off

fuck you fuck munches mother cunt

>Fuck off, you stupid frogposter.

Attached: weeaboo.jpg (1280x720, 71K)

still making react embeddable widgets.

quite fun since it's a research and development project for work with not many time constraints

You must be at least 18 years of age to browse this website

Get out of here already you schizo

i 25 u mother cunts and the ROXK
IA
COOKING
COOOOOXXXXXXXXX

im sure this thread is one guy talking to himself every day

all me btw

trying to put together a simple Jow Forums shitposting program, json-c seems simple enough but how do I retrieve Jow Forums's json over the internet? do I use libcurl? if it's not obvious, im still new to network programming

Yeah, libcurl is the library you'd typically go with for things like that.

POSIX SOCKET YOU FOOL

If you feel like implementing HTTP from scratch.

It's the Unix way, idiot

ill t-t-try my best senpai :3

Sure, but that doesn't change the fact it's only giving tou a TCP stream.
Do you really think libcurl is not using posix sockets and is not capable of manipulating them?
I actually like libcurl because you can get it to give you its file descriptors and integrate into a poll() loop.

Parsers are cool!

Attached: anime-girl.gif (500x281, 1011K)

HTTP was a mistake

monadic parsers

Attached: image0 (4).jpg (375x380, 73K)

>I actually like libcurl because you can get it to give you its file descriptors and integrate into a poll() loop.
let me guess, this isn't part of the libcurl-easy API

No, that's part of the multi API.

i've been reading the wrong man pages then

>Gtk-rs actually used builder pattern for their widgets
HOLY BASED THANK YOU

The "builder pattern" is one of the most retarded things I've ever seen.

Global type inference is overrated. Rank N types, and impredicative polymorphism in general, are way more useful.

Record literals are an incredibly simple and straightforward alternative to this pattern. I have no idea why it's not more common.

rust BTFO

>r-rust btfo

Attached: 1537379077871.jpg (480x480, 28K)

>Rank N types, and impredicative polymorphism
can all typefags just fuck off

>Le reddit man XDDD

Attached: 1369446960901.png (256x310, 20K)

what are some good python exercises/projects that can get me familiar with many of it's capabilities? I want to use it in blender

It's really just a complicated name for a simple idea. The good thing is that it makes nearly all other type autism redundant.

>It's really just a complicated name for a simple idea
I know, that's the problem

If I've contributed to a company's open source software, should I just message a recruiter on LinkedIn, or should I still apply on their site?

Some user said this in the last thread and it died before I woke up:
>I wanna make C with pattern matching, dynamic arrays, hash maps, utf8 strings, and non garbage macros. Then never use anything else. It sucks that the only languages that have pattern matching are meme garbage like Rust and functional languages.

This sounds exactly like Myrddin except for the macros, which you could help implement into the compiler.
myrlang.org
github.com/oridb/mc

"pattern matching" is just another way of writing a switch, who gives a shit

And a switch statement is a way of writing an if statement, that doesn't make it any less useful.
Also, good luck using a switch on two values at the same time:
use std

const main = {
for var i = 1; i

I'm trying to figure out whether I have memory leak or not. it's embedded low power armv5 linux system so valgrind is not available (qt program).

What do these columns (1) signify in the image? If i see values that DON'T grow in (2) but i see significant increase in used/cached columns system wide after one day of runtime, does it indicate anything? so if RSS for a process does not increase but system wide used and cached mem increases could it be leak? FS is on nand flash and log is written few times a minute. There is no swap file and ECC is enabled. Trying to debug mysterious hang after few days of runtime, when paging kernel panic happens and OS runs out of memory or in reverse order.

Attached: naeme.png (568x211, 169K)

as a sidenote this is just random top image i found from internet, it's not node im running.

it isn't really a complicated name. rank N types is just saying you can have types with a rank
of any arbitrary N
the rank is sort of like the degree of nested generic-ness, e.g. non-generic is rank 0, regular generic is rank 1, something that takes a generic as a parameter is that rank + 1

What are your thoughts on global variables vs local variables?
e.g. I have loads of strings for different but related functions which all need to check values against these global/local variables.

Do I create a new file and make them constants? Or declare them all in the functions they're used in? There are 6+ for a single function in some cases.

impredicative polymorphism is a terrible name for what you just said but also for things which aren't functions

If they're constants it's fine.

let rec rev l acc =
match l with
| [] -> acc
| hd :: tl -> rev tl (hd :: acc)

vs
static void reverse(struct Node** head_ref)
{
struct Node* prev = NULL;
struct Node* current = *head_ref;
struct Node* next = NULL;
while (current != NULL) {
next = current->next;
current->next = prev;
prev = current;
current = next;
}
*head_ref = prev;
}

Are the values reused between functions? If so, pull the strings out into its own file for constants. If not, then it's really up to you.
I would personally throw them into their own file for maintainability because it doesn't sound like the strings are a one-off magic number but an integral part of the program logic.

impredicative polymorphism isn't just that, impredicative polymorphism is about being able to instantiate generics with generics

D

that's a natural consequence of it

Oh well, glad that I didn't notice too late. Going to rewrite whatever I wrote for the UI and utilize the builder pattern they provided. Very nice :)

I know D

The GtkD documentation is utterly horrid. I'm rather glad I switched to Rust. That said I still love D.

I can see ur pantsu, whore.

no it isn't, you can have both without the other
in GHC/Haskell you can get the effects of impredicative polymorphism without allowing it by wrapping a rank-n-type in a data type or newtype, creating a monotype that's isomorphic to a polymorphic type

>mfw I'm knee deep in technical debt
check those return value for errors kids

Attached: 1536873709358.jpg (720x720, 80K)

functional programming could have prevented this

>I still love D
heh

(or made it 10x worse, mind you)

D is great but underrated

Functional programming makes error handling effortless.

No. D deserved all of the failure that it got.

what does this mean? do you mean this sort of error handling strategy?

int x = someShit(1,2,3,myVar);
if (!x) {
gracefullyEatShitAndDie();
}

What is the programming equivalent?

Attached: One-Punch-Man-Workout.jpg (860x1236, 271K)

No, that's the procedural way of doing it.
Functors and monads (read: mappable and flatmappable) make it super easy to handle errors without distracting from the actual purpose of your code.

There is plenty of technical debt in langs like Haskell
Of practically-isekai capeshit?

OPM is native isekai though

1 pair of socks, 2 distro hops, 2 buckets of tendies, 10 threads about how you can't figure out high-school level math hoping other anons are bigger regards than you and won't tell you to actually git gud.

Every single day

Based

yeah there's a list of games on wikipedia. I think proton/wine use it too with dxvk

Why is this oracle sql select:
select City, country_id,
case state_province
when null then 'Province Unknown'
else state_province
end
from locations
where lower(city) like 's%'
and length(city) >= 8
;
Outputing the following:
CITY CO CASESTATE_PROVINCEWHENNUL
------------------------------ -- -------------------------
Southlake US Texas
south San Francisco US California
South Brunswick US New Jersey
Singapore SG
Stretford UK Manchester
Sao Paulo BR Sao Paulo
Without replacing the empty state with "Province Unknown"?

Attached: Selection_009.png (898x504, 68K)

and you can get by using elseif chains instead of switch
that pattern-matched fizzbuzz isn't really any more eloquent than doing it regularly

the offending phrase was "impredicative polymorphism", something you would never hear outside of a haskell discussion

I want rub my dick against Shamiko's pantyhosed legs until she goes into succubus mode.