#programming

1 messages · Page 168 of 1

sage crag
#

it astounded me how many people believed that you could parallelise merge sort but not quicksort

#

it also astounded me how many people said that quicksort had a worse space complexity than merge sort, considering quicksort can be done in-place and merge sort cant

tender river
#

(i am trustworthy and never make things up based on gut feeling)

#

okay maybe not

#

hmm

sage crag
#

to do it efficiently you typically need an auxillary array thats the same size as the input array

#

you can it without it if you want to sacrifice some hidden constants

#

i think typically rotation

#

but im not super versed in merge sort

tender river
#

The space overhead can be reduced to O(√n) by using binary searches and rotations

#

no algorithms

#

i dont want to think about them because i'll soon have to implement so many incremental data structures

sage crag
tender river
#

n/2 is even easier

sage crag
#

if you consider stack frames its worse though

#

since merge sort is a recursive algorithm

tender river
#

you can just for (int i = 1; i < n; i *= 2) (roughly)

uneven pulsar
#

do i just study java instead of python for my python passage exam cuz i am stupid at python

sage crag
proper rapids
#

god damn back rooms of the sea

tender river
#

merge each 2 consecutive chunks using the same merge function

sage crag
#

i dont think its possible to do quicksort without stack frames

sage crag
#

and i think its the same with merge sort using its conventional algorithm

tender river
sage crag
tender river
#

berf

sage crag
sage crag
tender river
#

erf cpu feature

#

if ai good why bad

sage crag
#

smort

#

if ai bad why good

#

if absolute why nuance

tender river
sage crag
#

nerm

tender river
#

neurm

opaque sigil
tender river
#

doesnt sound like a bad idea

#

even though it will be scheduled unevenly

opaque sigil
#

i guess if you can't afford that little bit of temporary storage enub

tender river
#

i am lazier than haskell

sage crag
#

if you do it in multiple processes you get more stack from the OS enub

faint sandal
sage crag
#

in basket

#

tall

faint sandal
#

ballin

#

Neuro will never be ballin

#

Neuro ballin:

sage crag
inner pike
sage crag
#

rotate rotate

inner pike
#

and tall people usually play basketball

#

so that might have lead to that train of thought

#

thats the only idea i have

sage crag
#

i have finite free will in accordance with the laws of physics

tender river
#

i only just noticed

sage crag
#

no

#

fake

tender river
olive sable
#

my hdr sdr toggle switch now works neuroHypers

#

it puts the dispalys in the wrong order tho, but i cant be bothered to fix that

#

ill just reorder my dp inputs

left solstice
#

I was asking because I was curious if it was possible to make a audio file small enough to fit into the 4KB storage of this Nokia-esque phone (G8). I trimmed and re-encoded an existing audio file to 48kb/s CBR using a simple audio trimmer app but those files were still too big. What could I use instead to make a specialized mp3 audio file that could be stored and played on something like this?

tender river
sage crag
#

the audio data is the big part. lower your bitrate.

left solstice
tender river
olive sable
#

my screenshots have proper colour now neuroHypers

left solstice
olive sable
sage crag
#

vibe coder

#

the v in vedal stands for vibe coding

olive sable
#

i dont know bash, and i wasnt interested in learning it

#

huh

#

disabling hdr makes my youtube need to reload the page

#

anyways, look at my red circle

sage crag
#

"circle"

olive sable
#

circle's in computer graphics are a social construct

#

nothing is round

#

the cake is a lie

nocturne olive
olive sable
#

nah

#

i know the basics and the rest is stuff chatgpt will need to do

olive sable
#

hi shadow

#

i bought my audio equipment

#

well, part of it

#

i got a Denon AVR-X6200W for 450 bucks

#

do you aprove as my local audio guy?

tender river
#

rotate rotate

olive sable
#

shadow came by to comment "based" and then died neuro7

spring mural
#

what is wrong in my godot script"func _unhandled_input(event: InputEvent) -> void:

if event is InputEventMouseButton:

Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

elif event.is_action_pressed("ui_cancel"):

Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)

if Input.get_mouse_mode() = Input.MOUSE_MODE_CAPTURED:

if event is InputEventMouseMotion:

neck.rotate_y(-event.relative.x*0.01)

camera.rotate_x(-event.relative.y*0.01)

camera.rotation.x=clamp(camera.rotation.x,deg2rad(-30),deg2rad(60))" give me idias why it 's not working

olive sable
#

the error message probably knows more than we do

#

and use proper code boxes please

#

type 3 of these ` before and after the code block

spring mural
#

it sais it's in "input.get_mouse_mode()=input.MOUSE_MODE_captured:

olive sable
#

uh

#

lemme just

#
func _unhandled_input(event: InputEvent) -> void:
  if event is InputEventMouseButton:
    Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

  elif event.is_action_pressed("ui_cancel"):
    Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
    if Input.get_mouse_mode() = Input.MOUSE_MODE_CAPTURED:
      if event is InputEventMouseMotion:
        neck.rotate_y(-event.relative.x*0.01)
        camera.rotate_x(-event.relative.y*0.01)
        camera.rotation.x=clamp(camera.rotation.x,deg2rad(-30),deg2rad(60))
#

does this look right?

#

please use proper formating or nobody is able to read it

spring mural
#

okay

olive sable
#

= is an assignment operator, for comparison you would use ==

#

if Input.get_mouse_mode() = Input.MOUSE_MODE_CAPTURED:
needs to be
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:

#

i think thats the issue at least

spring mural
#

I will try

#

it worked

olive sable
#

also, you set Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) meaning the Input.get_mouse_mode() will no longer be MOUSE_MODE_CAPTURED, so the inner if will never run im pretty sure

spring mural
#

thanks man

olive sable
#

unless i did the indentation wrong

spring mural
#

it worked in the engine

olive sable
sage crag
#

@tender river managed to the vm up to 4gb/s throughput

#

so on the cheating test now 80% of c throughput

#

on single char it's 230 MiB/s

#

which is a lot worse than c neuroSadge

tender river
#

does it use fuel now

sage crag
#

yuh i made it use fuel a while ago

tender river
#

awawa

sage crag
#

speedy

sage crag
tender river
#

erf

#

on what

sage crag
#

aaa i forgot to clang-format

sage crag
#

all you need to do is

nix-shell
# make main.hb 
hbc --optimizations release>bin.axe
result/bin/hbvm_c | pv>/dev/null
tender river
sage crag
#

slowge

#

interesting performance regression

#

why so many stalled cycles

#

erf its faster on stdout but slower on fib

tender river
#

what do people usually use for benchmarks

#

in c

sage crag
tender river
#

doesnt seem like theres any standard

#

sounds about right for c

opaque sigil
#

probably google's benchmark library

#

Maybe there's better ones now idk it's been a while since I've had to do this enub

#

I end up just compiling multiple versions and using hyperfine or poop (yes I know neuroCry)

scarlet arch
#

Been benchmarking stuff recently and there's so much stuff to configure

#

Oh nevermind that's stat, didn't notice haha

#

Can recommend using record, followed by samply import belly

#

The Firefox profiler is perfect for comparing the results

sage crag
#

@tender river can you pull and try again

#

i made an experiment

tender river
#

its faster

#

um

#

maybe?

#

yeah i think it is

sage crag
#

wahoo

tender river
#

the fluctuations are too high to say anything conclusive

#

and this doesnt help neuroCatUuh

#

is it showing the total speed

#

or just the recent speed

#

wait i know

#

last time it was 8.77

#

now its 9.36

#

both were in a minute

#

so its faster

sage crag
#

its funny because this change made the fib slower again

#

bwabwabwa

#

only by a tiny amount but i sad

#

experience this beautiful code

tender river
#

while (fuel--)

chilly drift
#

Does anyone know what kind of Neural Network Evil and Neuro-Sama were based off of?

sage crag
tender river
sage crag
#

i did in fact try all of those

tender river
#

i think

sage crag
#

i was already writing zero to reg 0 but

#

in the last commit i stopped being lazy and put it in only some of the instructions

tender river
#

distracted neuroNyan

sage crag
#

awawa

olive sable
#

awawa

sage crag
#

its a shame gcc's lto sucks so much

chilly drift
#

What language are you using?

sage crag
#

c

chilly drift
#

ah
I don't work with c much
I was told its a little harder than C#

sage crag
#

the only challenge of using c over c# is manual memory control

#

the only difference between most languages is typesystem and memory model

tender river
#

it has many benefits over C# though

#

such as

#

not being C#

sage crag
#

true

sage crag
chilly drift
#

You know Neuro and Evil are written on C# right?

sage crag
#

they arent.

chilly drift
#

At the very least their APIs are

tender river
#

the frontend is, the backend isnt

sage crag
#

neuro and evil are "written in" python

#

almost certainly

#

their vtuber models are c#

chilly drift
#

Really? On Vedal's Github he only writes in C# Javascript and Typescript

sage crag
#

om

#

neuro isnt open source

chilly drift
#

I'm aware

#

the Neuro APIs and SDK are on his Github tho

sage crag
#

the neuro sdk is a reference implementation

chilly drift
#

I know

olive sable
#

the live2D models are rendered in unity with C# programming, the llm models are runnign in python

tender river
chilly drift
#

I know.

sage crag
#

no need to be patronising

chilly drift
#

I'm not trying to be

#

Apologize

#

I am just saying, since he seems to have an affinity for C# he might have written her in C#

#

I havent had the privledge of watching his Coding streams though

sage crag
#

neuro's code doesnt get worked on in coding streams

olive sable
#

he doesnt actually code in the dev streams

#

and even if he did he wouldnt show the ai code

sage crag
#

in a long time in the past there was some of neuro's code on stream iirc

#

@tender river python right?

chilly drift
#

I meant I havent seen his coding streams meaning I dont KNOW if he works in python more than C#

sage crag
#

ok, so, she's python.

#

ta-da

olive sable
#

its a fair question i guess, but llm's in C# are basicly unheard of

chilly drift
#

Thats not true

#

Its uncommon but I've seen plenty

#

She likely is python since its easier to code in

olive sable
#

ye sure its possible, but every single main one is python

#

afaik

chilly drift
#

I dont code in Python much since my college classes are required to be in C#

lilac helm
#

To be fair she's Python but at this point Python is Python + a bunch of C libraries

tender river
lilac helm
olive sable
lilac helm
sage crag
#

if you want to, you can use torch in c# just fine. there's just no reason to.

#

its not faster.

chilly drift
#

Hm

lilac helm
olive sable
sage crag
#

well, the same is true of any language

olive sable
#

yep

sage crag
#

if you do graphics or audio you will need to access system apis

chilly drift
#

How long have you all been programming?

sage crag
#

more than 10 years

olive sable
#

2-3 years if scratch doesnt ocunt

lilac helm
#

LMAO

olive sable
#

if it does count like 12 years

chilly drift
#

scratch imo doesnt count

lilac helm
#

I'm glad we all went through Scratch...

olive sable
#

hey my scratch programs were top tier.
the best damn code ive seen a 6 y/o make

chilly drift
#

I was recently tested on Programming knowledge and they asked questions about scratch
I havent used it since I was like 10

tender river
#

more than 10 years

chilly drift
#

you guys are old huh

olive sable
#

im 18

tender river
#

i'm over 10 years old

#

👵

chilly drift
sage crag
#

no way

olive sable
#

gramps_mugi since when is 18 old?

sage crag
#

this is true

#

still a kid

chilly drift
#

No not you

olive sable
#

these damn kids

chilly drift
#

The people who have been coding over 10 years

#

I'm older than you????

olive sable
#

im joking

chilly drift
#

I've been programming for around 6 years
if you count scratch make it 9

sage crag
#

its a shame gcc doesnt seem to support this attribute

#

clang does

amber fractal
#

I'd say 10 years, same for scratch in particular. Block programming in general it has been 12ish years. Hard to remember considering I'm 21.

opaque sigil
#

common gcc L neuroSadge

sage crag
tender river
#

here's some of my oldest code

#

february 2015

sage crag
#

mhm parse

#

its parsing something alright

opaque sigil
sage crag
tender river
#

i was using tail recursion vedalCry functional programmer by nature

desert plaza
#

i first started programming by copy-pasting batch scripts from youtube into notepad on windows 8 neuroTomfoolery

sage crag
chilly drift
#

I started with Java making Minecraft modpacks on Notepad

sage crag
#

i started with a terrible c graphing calculator

chilly drift
#

Lol

tender river
#

technically i wrote some code before 2015 when my dad showed me turbo pascal

#

but i didnt find it interesting at the time

sage crag
#

turbo pascal

tender river
#

i was like 6yo

sage crag
#

om

lilac helm
amber fractal
#

Going into middle school I started reading about scratch. But I've already used hopscotch for awhile before.

tender river
#

wait right

#

i wrote some bash code before i ever wrote a line of c++

chilly drift
#

Do you all thing Neuro was built off a Recurrent Neural Network or Generative Adversarial Network

sage crag
#

neither

#

large language model

#

transformers

olive sable
#

i cant find my code from 10 years ago, but i found untitled-6 from 2017 so 8 years ago.

sage crag
#

not any of CNN, RNN, or GAN

#

definitely transformers

#

hbvm

#

hbvm

#

hbvm

desert plaza
#

hbvm

lilac helm
#

If we're counting childhood coding I actually don't know when it was the first time I coded... My dad is a programmer so my younger brother and I did a lot of stuff when we were younger

tender river
#

.c

amber fractal
sage crag
# desert plaza hbvm

by da way, if you want to play with writing hbvm programs in machine code, i have a freestanding vm implementation here

olive sable
#

most of my scratch stuff is deleted cuz it wasnt up to my high standarts, but i know it did indeed suck

sage crag
#

it doesnt implement any of the ableos ecalls though, so you would have to write those yourself i guess

tender river
chilly drift
#

i might be stupid for asking this but what does hbvm mean..?

amber fractal
olive sable
#

my monitors arent in the correct order

#

thats interesting

#

ill need tto debug my hdr toggle script bwaa

desert plaza
amber fractal
olive sable
#
#!/bin/bash

MONITORS=("DP-3" "DP-2" "DP-1")

HDR_ON=false
for m in "${MONITORS[@]}"; do
    FORMAT=$(hyprctl monitors | awk -v mon="$m" '$0 ~ mon {in_mon=1} in_mon && $1=="currentFormat:" {print $2; exit}')
    if [[ "$FORMAT" == *1010 ]]; then
        HDR_ON=true
        break
    fi
done

for m in "${MONITORS[@]}"; do
    hyprctl keyword monitor "$m, 2560x1440@180, auto, 1, bitdepth, $([[ "$HDR_ON" == true ]] && echo 8 || echo 10), cm, $([[ "$HDR_ON" == true ]] && echo sdr || echo hdr), sdrbrightness, 1.4, vrr, 2" >/dev/null 2>&1
done

notify-send "HDR toggled" "HDR is now $([[ "$HDR_ON" == true ]] && echo "off" || echo "on")"
#

iuts probably that auto being a bitch

#

ill need to give it actuall numbers i guess

desert plaza
sage crag
#

@tender river

void hbvm_ecall_handler(HBVm *vm) {
  auto args = vm->regs;
  vm->regs[1] = syscall(args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
}

hbvm-linux

#

it forwards the ecalls to syscalls

tender river
#

that sounds like a good idea for testing hbvm codegen

olive sable
sage crag
# sage crag it forwards the ecalls to syscalls

@desert plaza this is an hbvm binary that uses the linux write syscall

0000000  15  91  d2  00  00  00  00  3c  00  00  00  00  00  00  00  02
0000010  00  00  00  00  00  00  00  3c  00  00  00  00  00  00  00  02
0000020  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
0000030  00  00  00  00  00  00  00  4e  1f  fe  f8  ff  ff  ff  ff  ff
0000040  ff  ff  08  00  30  fe  fe  f8  ff  ff  ff  ff  ff  ff  ff  46
0000050  02  00  4b  01  01  00  00  00  00  00  00  00  4b  04  02  00
0000060  00  00  00  00  00  00  4c  03  00  0d  00  00  00  5c  53  e1
0000070  ff  ff  ff  61  0a  0a  00  00  00  01  00  00  00  73  00  00
0000080  00  00  00  00  00  17  00  00  00  00  00  00  00  37  00  00
0000090  00  00  00  00  00  00  6d  61  69  6e  2e  73  74  72  00  61
00000a0  0a  00  6d  61  69  6e  2e  6d  61  69  6e  00  6d  61  69  6e
00000b0  00                                                            
00000b1
#

erm why is pv not working

#

ok, pv is working but piping to devnull isnt

#

erm

#

im writing to the wrong fd

#

genius

#

blazing speed

#

unsurprising though

#

this one is c native though

#

so its basically equivalent

#

which i find interesting

#

95% of performance

#

definitely being capped by syscall here

amber fractal
olive sable
#

i just cant be bothered to have seperate configs per monitor

#

its either all on or all off hdr

amber fractal
#

I was actually thinking as I was writing this that I shouldn't even be using hyprland for this

olive sable
#

wdym?

scarlet arch
olive sable
#

screenshots look like garbage with hdr on, bt i like how hdr looks.
hdr doesnt look too diffrent but the colours look nicer in my experience.

#

this is what happens when i try to take a screenshot

#

hdr on vs off

#

off is left btw

scarlet arch
#

Thats not my question tho. Just... Why does one need a script to control monitors

amber fractal
# olive sable wdym?

I personally use a program called kanshi as hyprland struggles with hotpluging monitors, you can also CLI to switch configs as long as all of the requirements for it exist.

olive sable
amber fractal
amber fractal
scarlet arch
olive sable
#

it doesnt work here

scarlet arch
#

Oh

olive sable
#

grim doesnt do proper hdr screenshots because of the hyprland compositor or something

#

so everything looks like shit

#

and i have mapped the pause button on my heyboard to a hdr toggle now

scarlet arch
#

I don't mean to sound mean, but why use that then

olive sable
#

hdr just looks nicer imo

scarlet arch
#

Nono, the hyprland thing

amber fractal
olive sable
#

sunk cost fallacy

scarlet arch
amber fractal
olive sable
#

kanshi allows you to define output profiles that are automatically enabled and disabled on hotplug. ye i dont really need that on my desktop. this would be nice for my laptop tho

sage crag
tender river
amber fractal
#

so one HDR profile one non HDR one and just call them

olive sable
#

hmmm

#

i mean what i have now works and i dont have any dependancies

#

ill keep it like this for now

amber fractal
#

Understandable have a nice day

olive sable
#

fucking around with hyprland hdr has drained me to the point where i just dont want to risk breakign it again

#

i have succesfully moved the vertexbuffer into vram dancingrainbowdog

#

this is all a bunch of small things that dont make a visual diffrence rn cuz ram was fast enough for 12 vertices, but it does need to happen

sick owl
#

Got a question for anyone here who might be more knowledgeable about batteries than yours truly

#

Is the 20-80% rule actually worth bothering to stick to?

olive sable
#

i think so.

#

like it doesnt make that much of a diffrence, but over thousands of charges it adds up

sick owl
#

At that point, aren't you just pretending your battery is degraded from the start to stop it degrading though?

#

I mean you're running at 60% capacity when a thousand cycles only brings you down to 80

#

In my case anyway

olive sable
#

not really, since it isnt degraded that 60% lasts a decent while

sick owl
#

Surely it only lasts as long as a degraded 60% though?

olive sable
#

and ill still charge it to 100% if i have a long day ahead of me

#

but for casual use i dont need the full 100

sick owl
olive sable
sick owl
#

Well wouldn't 60% degraded capacity 0 to 100 more or less be 60% 20 to 80 on a full capacity battery?

olive sable
#

from my perspective, noboy is forcing you to keep adhering to the 20-80 thing all the time. if you really need the 100% then the battery will be less degraded and the 100% will last longer than if you let it degrade beforehand

sick owl
#

I guess so yeah

olive sable
#

all in all it probably doesnt make that much of a diffrence unless the phone is 6 years old

rigid snow
pulsar edge
pulsar edge
#

pretty sure I was writing shit back in 2015, but it was script-based 3D modeling rather than programming apps

#

god knows when I took that java course, but it was probably sometime around 2016

rigid snow
pulsar edge
#

and they were super ahead of the curve too

olive sable
#

you know what M$ should do?

pulsar edge
#

odds are python won over something better like C++ or C# because data engineers don't want to spend time learning a proper language

olive sable
pulsar edge
#

I think the creator of mojo said that he started off by trying to create a better AI framework in rust but nobody would fucking use it, so he conceeded and made mojo which borrows python syntax

olive sable
#

python isnt a bad language for something that isnt cpu bound. but think about the hours of wasted compute time all toghether

pulsar edge
#

yeah

#

its better now with pypy JIT too

#

but its just crazy to me that people defended python as AI glue back then before we had pypy JIT

olive sable
#

i made an index buffer neuroHypers
it turns out that if you have the code to make one buffer you dont need to change much to make a couple diffrent ones

pulsar edge
#

neat

#

I have a bit of an issue sam that you'll probably find ironic

olive sable
pulsar edge
#

I want to make my rendering code use the GPU instead of the CPU but I despise doing all the verbose setup bullshit

#

I'm pretty sure my entire architecture is incompatible with it and I have to rewrite basically everything from scratch

olive sable
rigid snow
# pulsar edge odds are python won over something better like C++ or C# because data engineers ...

i think it's just that python happened to be the best combo of a good scripting lang, mature ecosystem, high-levelness and general disregard to perf because 99% of the spent compute you're wrapping native code anyway. lua was another good fit (as we can confirm by torch originally being a lua lib) but i suppose the ecosystem was meh, besides, python already was basically the most popular out of this category of langs

olive sable
#

opengl isnt too bad imo

pulsar edge
#

im using opengl through skiasharp

#

and even that is super verbose and virtually undocumented

rigid snow
#

i see skia evilStare

#

opengl through skiasharp
what does this even mean, why do you need opengl when you have skia already

pulsar edge
#

skia itself is CPU only

rigid snow
#

that's just not true and can't be

pulsar edge
#

GPU support is kindof built on top of skia

rigid snow
#

people write games in flutter

#

i'm not saying they should but they do

pulsar edge
#

you need to create a GPU surface specific to whatever API you want (opengl, vulkan, metal) and then it overrides certain draw calls

pulsar edge
#

its a lot closer to a game engine than traditional UI frameworks

rigid snow
#

it is in big part because it uses skia

rigid snow
pulsar edge
#

sam typing up a storm

olive sable
#

opengl isnt too bad imo. id consider it pretty light actually.

you just gotta do some

SDL_Init(SDL_INIT_VIDEO)
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);

glewInit()

SDL_GL_SetSwapInterval(swapInterval)

glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glFrontFace(GL_CCW);
glViewport(0, 0, screenWidth, screenHeight);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

and boom you have your context.
then to get objects on screen you jsut do some

//init:
glGenBuffers(1, &vbo);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, bufferView.byteLength, buffer.data() + bufferView.byteOffset, GL_STATIC_DRAW);

glEnableVertexAttribArray(0);
glVertexAttribPointer(0, vecSize, type, GL_FALSE, vecSize*4, (void*)0);
//drawing
glDrawArray(mesh.count, mesh.indexType, (void*)0)
#

like it looks complicated. and i left out some details. but it really isnt

pulsar edge
#

see, I lose half of those APIs through skia

#

which is nice that I don't have to setup the viewport and whatnot, but its annoying because I have to create, manually bind, and maintain each individual buffer as an individual IDisposable

olive sable
#

i mean, settignup the viewport is literally 1 command here

#

and ussualy you can leave it out

pulsar edge
#

also my code is for rendering text and 2D textures

olive sable
#

its jsut better to make sure it gets done since i dev for multiple platforms

olive sable
#

i haven tried that myself tho, i just include it already

pulsar edge
#

also I would rather not raw dog opengl because I don't want to write my own font handling and text drawing

olive sable
#

thats fair

pulsar edge
#

I'm just complaining instead of actually doing it

#

here lemme show you what Im working with

#

the rendering code takes so many shortcuts because it was originally written for CPU

olive sable
#

opengl is like

-init the window
-set versions
-init opengl
-set some settings

-make your buffers
-bind your buffers
-draw

its essentiely jsut those things you need to do

pulsar edge
#

im not happy about it either

olive sable
#

you have like 30 diffrent "draw xyz functions" neuro7

amber fractal
#

The age old question of MBR or GPT I'd have to see what the pros and cons are

pulsar edge
#

ik

#

but most of them boil down to DrawText

#

the main issue is how frame disposal is handled and how AddImageSection is handled

rigid snow
#

i still don't understand what for exactly you need raw opengl...

pulsar edge
#

we create and throw away so many buffers

rigid snow
#

when you're in skia

pulsar edge
#

omg

olive sable
#

since its 2D i was expecting just a function with a text input and positiondata that would have jsut been reussed

pulsar edge
#

skia barely abstracts over opengl init

#

in fact, it adds some more shit on top

rigid snow
pulsar edge
#

using the GPU adds a ton of stuff you need to do before you draw and after you draw

#

also you can't just create and throw away buffers the way we do atm on GPU

olive sable
#

if it were me i would have just done raw opengl, but i guess thatds unfair of me to say since im used to doing that

pulsar edge
#

I promise I've spent several hours looking into this already

rigid snow
pulsar edge
#

using var bm = new SKBitmap(width, height, pixformat); creates a CPU buffer, and theres no way around that

#

and we use that everywhere

olive sable
pulsar edge
#

to create a GPU buffer I need to pass the GPU context around, then using that I need to create a GPU surface with a specific opengl index, and some other stuff

#

keeping track of indices is kind of my main issue, as well as the fact that the rendering is as forward as you could possible make it

olive sable
#

ive never used "gpu surfaces" neuroLookUp

pulsar edge
#

GPU surfaces are the only thing exposed in skia

olive sable
#

huh

pulsar edge
#

which isn't compatible with GPU because that needs to know the size of the buffer

olive sable
#

ussualy for 2D. i would just set the position with a uniform buffer, and then bind a texture, and then draw

#

you can even reusee the same shaders

pulsar edge
#

its annoying, but its also the right way to do it and will also increase performance by reducing the amount of data copies

olive sable
olive sable
#

are your buffers not the size of the window?

pulsar edge
#

im not rendering to a window

olive sable
#

huh

olive sable
#

well, i guess if it works it works

pulsar edge
#

its horrible

olive sable
#

its jsut far from what i would do

pulsar edge
#

its slow

#

but it works

#

its far from what I would do too

#

I didn't write the original rendering code, I've just been fixing it up slowly over the last 3 years

#

but now its at the point where I need to rewrite it for GPU support

olive sable
#

HOLY 3 years

pulsar edge
olive sable
pulsar edge
#

its a little not amazing

olive sable
#

well, goodluck

#

i woudnt be able to do it, the skia gpu stuff sounds like actual garbage

pulsar edge
#

its annoying

#

its also very poorly documented as I mentioned

olive sable
#

so you say
also I would rather not raw dog opengl because I don't want to write my own font handling and text drawing
you can just use a library for that im pretty sure

#

altho i havent used ones for C#

pulsar edge
#

I know SDL does something like that

#

but it doesn't have system font support right?

olive sable
pulsar edge
#

you need to bundle the fonts you want?

olive sable
#

depends on the library ye

pulsar edge
#

yeah people would be super mad if I removed system font support

#

and my ass is not doing it myself

#

my NIHS stops at implementing low level rendering functions

pulsar edge
olive sable
#

ye the sdl one is better impretty sure

#
//this opens a font style and sets a size
TTF_Font* Sans = TTF_OpenFont("Sans.ttf", 24);

// this is the color in rgb format,
// maxing out all would give you the color white,
// and it will be your text's color
SDL_Color White = {255, 255, 255};

// as TTF_RenderText_Solid could only be used on
// SDL_Surface then you have to create the surface first
SDL_Surface* surfaceMessage =
    TTF_RenderText_Solid(Sans, "put your text here", White); 

// now you can convert it into a texture
SDL_Texture* Message = SDL_CreateTextureFromSurface(renderer, surfaceMessage);

SDL_Rect Message_rect; //create a rect
Message_rect.x = 0;  //controls the rect's x coordinate 
Message_rect.y = 0; // controls the rect's y coordinte
Message_rect.w = 100; // controls the width of the rect
Message_rect.h = 100; // controls the height of the rect

// (0,0) is on the top left of the window/screen,
// think a rect as the text's box,
// that way it would be very simple to understand

// Now since it's a texture, you have to put RenderCopy
// in your game loop area, the area where the whole code executes

// you put the renderer's name first, the Message,
// the crop size (you can ignore this if you don't want
// to dabble with cropping), and the rect which is the size
// and coordinate of your texture
SDL_RenderCopy(renderer, Message, NULL, &Message_rect);

// Don't forget to free your surface and texture
SDL_FreeSurface(surfaceMessage);
SDL_DestroyTexture(Message);
#

it does mean you need to convert an sdl surface into a opengl texture

pulsar edge
#

where the hell is the SDL_ttf docs

#

oh, they only have SDL3 docs, not SDL2??

olive sable
#

idk, sdl2 is being phased out i guess

pulsar edge
#

honestly, this API looks harder to work with than skiasharp

#

especially considering that I need to keep harfbuzzsharp around

#

which means I would need to render each individiual glyph to an sdl surface

olive sable
pulsar edge
olive sable
olive sable
pulsar edge
#

I'm 95% sure it doesn't do shaping though

#

no shaping = no arabic, hebrew, hindi, etc.

fleet beacon
#

So much lingo I'm never gonna understand

pulsar edge
#

I hate it here

#

I miss when I didn't know about text shaping

#

however, text shaping is also really nice because it lets me break the text at individual glyphs instead of just guessing where to break

olive sable
#

sometyhing like this should work

//this opens a font style and sets a size
TTF_Font* Sans = TTF_OpenFont("Sans.ttf", 24);

SDL_Color White = {255, 255, 255};
SDL_Surface* surfaceMessage = TTF_RenderText_Solid(Sans, "put your text here", White); 

SDL_Texture* Message = SDL_CreateTextureFromSurface(renderer, surfaceMessage);
glBindTexture(GL_TEXTURE_2D, Message->id)

SDL_DestroyTexture(Message);
#

havent done any testing tho so idk

pulsar edge
#

it'll work for any non-shaped text

olive sable
#

hmmm

#

does ttf not support shaped text?

pulsar edge
#

its a really annoying problem

#

you need a shaping library like harfbuzz or whatever the windows kernel provides

olive sable
#
It can draw Unicode characters just fine (so Arabic, Hebrew, Hindi codepoints will render if the font supports them), but it will not do the script-specific shaping, ligatures, or bidirectional reordering you need for those writing systems.
pulsar edge
#

and I'm pretty pretty sure SDL3_ttf doesn't use harfbuzz under the hood

#

yeah

#

no shaping is basically unreadable to them

#

I appreciate you looking into this for me though

hexed grove
pulsar edge
#

hey wait what

hexed grove
#

i forgor to commit

opaque sigil
#

sounds like you have to opt into harfbuzz

pulsar edge
#

god, you have to init harfbuzz properties for each individual font you load

olive sable
#

119 lines. not the absolute worst but not great

pulsar edge
#

that might work idk

olive sable
#

ye idk either, i dont have these libraries installed

#

this function is getting insanely long KEKW
commandManager.init(deviceManager.device, deviceManager.indices, frameManager.swapChainImages.size(), frameManager.swapChainFramebuffers, frameManager.swapChainExtent, frameManager.graphicsPipeline, frameManager.renderPass, vertexBuffer, indexBuffer, indices.size());

#

i should put this in a struct and just pass that

opaque sigil
#

ManagerManager mhm

#

i see 5 params

olive sable
#

i have a couple diffrent managers, and i guess the main.cpp would count as the manager manager then NODDERS

opaque sigil
#

seems fine

olive sable
opaque sigil
#

pass the managers

#

problem solved

olive sable
#

hmmm

midnight sigil
#

I just realized the folder for Visual Studio Code is "Microsoft VS Code"

olive sable
#

i cant tell if that is a good or a bad idea

midnight sigil
opaque sigil
#

make it an extra constructor that takes the managers and calls this function

olive sable
#

isnt that just moving the problem around?

opaque sigil
#

is it even a problem

#

passing it as a struct has the same result

pulsar edge
#

it seems that valorant isnt gifting bonus subs this subtember? lucky me, I don't have to implement that in my renderer

midnight sigil
pulsar edge
#

you think this is because of vedal breaking the hype train record lol

midnight sigil
opaque sigil
midnight sigil
#

maybe just don't care about readability in backend

opaque sigil
#

just be like the ML libraries for some reason and take like 30 params

olive sable
#

bruh

#

i have renamed the repo to just "vulkan" because i have published a branch that dosnt have terrible code

#

i hope this doesnt break quacks bot tho

midnight sigil
#

put things in macros

olive sable
opaque sigil
#

templates neuroPogHD

midnight sigil
#

c++

opaque sigil
#

make it as ambiguous as possible

midnight sigil
opaque sigil
olive sable
#

This branch is 2 commits ahead of, 63 commits behind main. KEKW

opaque sigil
#

damn he really just nuked the whole history

midnight sigil
#

git blame will lead us back in time

olive sable
#

the triangle is so fast because it completely ignores every single rule of race conditions and good code practices

#

thats why i cant use any of it besides the early improvements

#

i mean, it still does 13K fps, just not 47K like the triangle

#

🔺 ReallyInnocent

amber fractal
midnight sigil
tender river
#

gnome 3 stability is much better than it used to be neuroPogHD

#

it doesnt randomly crash every 2 seconds anymore

sage crag
#

its gnome 3

#

what

#

why

tender river
#

what

#

gimp 3

sage crag
olive sable
#

new problem, my firefox crashes if i turn off thew screen it was on

#

interesting

sage crag
#

vvvvvvvvvvvvv

tender river
sage crag
hoary lion
#

I smell yuri

tender river
pulsar edge
#

hi chat, which do you prefer

sage crag
#

the first one

#

infinitely

#

its far easier to read, and its less indented

pulsar edge
#

the indentation is identical between the two

sage crag
#

not the relevant part of the code

pulsar edge
#

fair

blissful geyser
#

I coded a macro in python to automatically screenshot my pc when it detects brainrot words on the screen, so it can start shaming how much braincells i lost

tender river
pulsar edge
#

I can do something like this to remedy that part

sage crag
#

why would you

#

its just worse

#

lol

tender river
#

a switch on a boolean is just an if

#

thats what an if is

#

but i suppose c# ifs arent expressions

sage crag
#

aside from that, simplicity is the most important factor when you are working in such a high level language

#

no matter what you write its going to perform the same

#

so just write the simplest version

tender river
#

it can be argued that pattern match is as simple as the direct version

sage crag
pulsar edge
#

I was just entertaining the switch expression that my IDE really wanted me to use

sage crag
#

reading program downwards is the correct way to read a program

#

reading to the side is mental overhead

pulsar edge
#

I preferred 1 as well, but I was curious if anyone here thought different

#

especially the rust devs

tender river
tender river
pulsar edge
#

lmao

hoary lion
#

fuck arrows

sage crag
#

arrows

hoary lion
#

not one but three

amber fractal
#

Too simple for a switch imo. ifs work just fine

hoary lion
tender river
#

its the same

amber fractal
tender river
#

wrong reply

sage crag
#

a pattern match is only useful when there is a pattern to match

pulsar edge
hoary lion
#

personally prefer chain of ifs

sage crag
#

use a function

hoary lion
#

arrows just makes shit confusing

pulsar edge
#

I have a few functions

tender river
hoary lion
#

unless super super needed

pulsar edge
sage crag
pulsar edge
#

whats an "expression" to you

tender river
#

a ? b : c is an expression

pulsar edge
#

C# has that

tender river
#

if (a) { b } else { c } is a statement

tender river
sage crag
#

ternaries suck enub

#

if as expression better

pulsar edge
#

ternaries have their place

sage crag
#

their place is the garbage

tender river
#

expression trees are normal

sage crag
tender river
sage crag
#

there's a reason most style guides specify a maximum line length

#

its because long lines are unreadable

tender river
#

line length is a separate concern

pulsar edge
pulsar edge
sage crag
#

gotos have their place

#

their place is not in this function

pulsar edge
#

there's a single goto in this entire project

sage crag
#

why did you use a switch?

pulsar edge
#

because I needed the goto

sage crag
#

hang on

pulsar edge
#

and I didn't want to use a label

#

and now that I'm looking at it again, I think this code might actually throw an exception because the content might only be valid for a single read?

#

I don't actually know

pulsar edge
tender river
#

shorter vertical space gives you better overview of what your code does as long as you're able to mentally parse it

pulsar edge
sage crag
#

goto and switch here are both awful and it makes me sad

pulsar edge
#

I don't see a better way

tender river
olive sable
#

neuroLookUp yuri posting on main, we dont see that here very often

sage crag
#

its not like its gonna be slower

small mason
#

Hay there, just wondering dose anybody know of a good way to learn code, I know theory of code but never picked up on it (originally VB) i don't really care what language just not MF

sage crag
tender river
#

shouldBreak = true;
if shouldBreak { break; }

Type thing

sage crag
#

readable and understandable

tender river
#

no

sage crag
#

there are no problems with the above control flow

tender river
#

labels are better than booleans because they are harder to get wrong

#

when you're trying to achieve the same goal, anyway

pulsar edge
#

especially for rust labeled loops

#

I wish that was in C#

sage crag
tender river
#

they arent easier to read

#

and they arent explicit

pulsar edge
#

in this case, I disagree with both points

tender river
#

they are an adhoc solution

sage crag
#

in this case its a very clear improvement over having a whole switch neuroKufufu

tender river
#

not really?

#

its just an if

#

semantically

#

ifs are easier than mangling control flow to conformance with booleans

pulsar edge
#

I don't think its worth adding the mental complexity of a boolean just to reduce the indentation by 1 and change the keyword

tender river
#

^

pulsar edge
#

I used to have more gotos in this project but I've since replaced them with saner alternatives

#

but this is a case where I think goto reduces complexity significantly

tender river
#

the best solution isnt one that uses the simplest concepts but one thats the hardest to get wrong as long as you perfectly know the concepts involved

#

and if that isn't the case, use go

pulsar edge
#

I assume this is what konii was saying was her preferred alternative?

tender river
#

yuh something like this

pulsar edge
#

in the context of the screenshot its not that much harder to read

#

but when you add the extra code around it, the context melds into the other surrounding statements

tender river
#

i dislike this version since it's easier to scan code for gotos and labels than for boolean reads/writes

#

it just obscures the control flow

pulsar edge
#

but I think I've also lost konii on the fact that I have some lines longer than 80 cols

tender river
#

my router code cupsama

pulsar edge
#

yeah thats fine to me

tender river
#

exactly, long lines can be fine or not fine, it depends on the context

#

reading long lines is something you can better at, anyway

olive sable
#

aight imma try to make uniform buffers. this should make it possible to do animated shaders neuroPogHD

amber fractal
#

The only case I'll disagree with is when it wraps on an ultrawide monitor

pulsar edge
#

disable soft wrap and you won't have that issue anymore SMILE

tender river
#

yup

pulsar edge
#

but I'm not touching it because I'm in the process of rewriting this file on another branch

amber fractal
pulsar edge
#

this sucks too and its also punched down in the rewrite branch

pulsar edge
#

4pt font

olive sable
#

what in the fuck are you doing that needs sucha long line of code?

amber fractal
#

Emojis

pulsar edge
#

regex

tender river
pulsar edge
#

emojis were invented by the devil deliv

olive sable
#

checks out

pulsar edge
#

also I wish C# had an stdlib function for detecting emojis that didnt need a regex

#

I dont wannt do the research to figure it out myself

tender river
#

does c# not have a unicode char class database somewhere

pulsar edge
#

it does for some categories, but emojis is not one of them

#

also I wish C# had a no-alloc unicode enumerator

#

we have TextElementEnumerator but it allocates a new string on the heap every time it advances with no option to reuse a buffer

glad path
#

i love pulling 12 commits after coding on a different laptop

#

so satisfying

fast pagoda
#

i was satisfied in a similar way pulling a large repo i had but havent touched in liek 2 months
it's so broken from dependencies that i didn't include because previously me went surely i'll just be working on this continuously forever, no need for a container or anything, and surely ill be on windows forever (i am no longer on windows)

#

i am no longer satisfied

#

exiv2 patch broke KDE's wallpaper picker nice

#

glad i ran pacman -Syu out of habit and now cannot open wallpapers

#

ayy running sudo downgrade exiv2 and then picking version 0.28.5 1 then rebooting did fix it

so if any of y'all are using KDE and suddenly can't open the wallpaper picker and updating today, do that and it'll fix it

uneven pulsar
#

is temple os worth it?

#

like worth my time

amber fractal
#

It's a meme, make of it what you will

mental valley
#

hm

lament igloo
maiden geyser
#

Torvalds in 2k25

cobalt sigil
#

never heard of this windows version

proper rapids
#

At times it's rather refreshing to read something so candid

maiden geyser
#

hope i didn't kill it yet

midnight sigil
maiden geyser
#

alright i killed it

proper rapids
#

?

#

was ist das

maiden geyser
#

supposedly le smart bulb

rigid snow
lament igloo
#

hi! im trying to learn C so i wanna ask questions
is this how typedef struct works?

#

Also i mistook %d for double/float so pls ignore that

tender river
#

but also please use virtual functions for something like that vedalCry

lament igloo
#

that typedef struct example is generated by GPT so that i get the general idea of it

sage crag
lament igloo
#

but is typedef struct like

typedef struct Name {
// <assign data types and vars here>
}```
#

?

lament igloo
#

or do i not need typedef

tender river
#

better example

tender river
#

before you have defined the typedef, you will have to use struct A regardless

lament igloo
tender river
#

this is valid C

lament igloo
#

its global right?

tender river
sage crag
lament igloo
#

also i thought of something silly

tender river
#

probably

sage crag
lament igloo
tender river
#

it creates a type definition

#

type alias

sage crag
lament igloo
#

soo typedef double is valid?
if so, what for other than struct?

sage crag
#

struct name {}
is a type
struct {}
is also a type

tender river
#

typedef struct <name1> { ... } <name2>

name 1 - the name when used like struct <name1> *ptr = NULL;
name 2 - the name when used like <name2> *ptr = NULL;

#

name 1 can be omitted

lament igloo
#

isnt this just variable assignment?

#

like var name or smth

uneven pulsar
tender river
sage crag
tender river
uneven pulsar
#

but kinda similar a bit

lament igloo
uneven pulsar
#

okay maybe not much

sage crag
uneven pulsar
#

its C

uneven pulsar
sage crag
#

similarity end there

tender river
#

javascript is java so C must be java

lament igloo
tender river
tender river
#

wait does C# have that kind of using

uneven pulsar
#

i dont want to be forced to learn python anymore

#

buuut i have a py passage exam on semptember 15

tender river
lament igloo
#

isnt that for libraries only??

#

huh

tender river
sage crag
#

its not advised to put this inside of your structs

#

if you are using c++ use virtual functions or something

tender river
#

if you're using C++ don't use typedefs at all

lament igloo
#

aight lemme go thru w3schools for a bit

tender river
#

use using and plain struct definitions without typedef

#

using i64 = int64_t;

#

struct A { int a; int b; };

#

C++

olive sable
#

I have done a stupid.
The needed materials for my college course said a drawing tablet, but they meant one without the android to use on a pc 3Head
I bought the pen for my tablet with android without the pc

sage crag
lament igloo
#

im good with c++
im aiming for lightweight and more control i think

sage crag
# lament igloo alr

the reason you have to name it as point_display and not just display is that there are no modules in c

#

if you #include "point.h" its going to add display as a function, not point.display or something, if you name the function display

sage crag
#

c++ is probably a better choice if you want to stick closer to typical object oriented programming

lament igloo
#

but C is quite faster no? nub

umbral thorn
#

no

sage crag
#

no

umbral thorn
sage crag
#

smart ellie

#

u smart

lament igloo
#

welp

nocturne olive
#

From what I know C and C++ and Rust are all equal in speed

tender river
sage crag
lament igloo
#

anyways my other usage? it does a screenshot and i can overlay the screenshot and do whatever the fuck i want from there

sage crag
#

as long as it compiles to machine code it will be approximately the same speed

uneven pulsar
nocturne olive
lament igloo
#

its a visual thing so i can learn C / C++ more

sage crag
#

just because its further from c#

#

om

olive sable
#

Konii you're an osu player, what drawing tablets (for pc) are good for drawing?

lament igloo
#

idk ab c# atp

tender river
lament igloo
#

c# made me rely on a dll 🥀

sage crag
#

wacom ctl 472 is cheap

tender river
#

you'll have to do your own research

sage crag
#

i use it for drawing too

fierce nova
#

NeuroCorpa use language the best for your job market

sage crag
#

cheaper as well

lament igloo
sage crag
#

i can only really recommend those two since ive only used those ones

lament igloo
sage crag
#

correct

tender river
#

i have an xp-pen g640 and i can confirm it's a tablet

sage crag
#

i can also confirm it's a tablet

#

i do not have it though

fierce nova
lament igloo
sage crag
#

java enterprise devs are the most common devs

uneven pulsar
sage crag
lament igloo
#

REACT LMAOOOOOOO 😭

sage crag
#

react is common

uneven pulsar
lament igloo
#

im going for Bachelor in Information Technology
idk if that changes anything

uneven pulsar
sage crag
#

php still has uses

uneven pulsar
#

FUCKING PHP

lament igloo
#

XD

tender river
#

theres a lot of php jobs

sage crag
#

too many

uneven pulsar
lament igloo
#

ye

sage crag
#

most code is legacy code

uneven pulsar
sage crag
lament igloo
tender river
sage crag
#

web technologies neuroPogHD

uneven pulsar
lament igloo
sage crag
#

mhm

sage crag
#

that's like saying you die when you are killed

tender river
sage crag
tender river
uneven pulsar
#

so bassicly

#

they taught me the same thing you learned at early age

lament igloo
# sage crag so is any language

I always love breaking down these "react sucks" articles. There is some genuine good in here, but oh boy is it also so so wrong...

Thank you Augment Code for sponsoring! Check them out at: https://soydev.link/augment

SOURCES
https://medium.com/@fourtyeighthours/tech-founder-entrepreneur-this-is-why-you-should-avoid-react-js-in-your-app-41fe9fb...

▶ Play video

"CTOs are secretly moving away from React". I knew I had to talk about this one. There's a lot of good info here, but also a ton of nuance missing and frankly a lot of these company's moves seem misinformed.

Thank you Infinite Red for sponsoring! Check them out at: https://soydev.link/infinitered

SOURCE
https://javascript.plainenglish.io/why-...

▶ Play video
sage crag
#

this guy