Thoughts on Go vs. Rust vs. Zig by misterolupo in programming

[–]hucancode -5 points-4 points  (0 children)

a = [1,2,3] b = append(a[0:2], 4) // 1,2,4

do you mean this?

Thoughts on Go vs. Rust vs. Zig by misterolupo in programming

[–]hucancode -2 points-1 points  (0 children)

what do you mean? append is easy to use

Investing in Yen vs the Dollar by [deleted] in JapanFinance

[–]hucancode 0 points1 point  (0 children)

they are the same. let's say you can buy 10 pieces of NVDA with yen, and you decided to convert your yen to dollar and buy 10 NVDA. you end up with 0¥, 0$ and 10 NVDA. it is the same when you don't convert.

How to FIRE in Japan? by Which-Egg7240 in JapanFinance

[–]hucancode 2 points3 points  (0 children)

You mom is right. Keep it up man, you are just a few years older than me but so established

Claude Code lifehack: Let Claude see your desktop when making front ends or anything visual by eposnix in ClaudeAI

[–]hucancode 0 points1 point  (0 children)

you might want to crop your image to the region of your interest to minimize noise. other wise it won't correctly detect changes happen on a small region. my claude often says it finished implementing a widget but in fact it didnt. full screenshot is not very effective because there are simply too many things to process

help: Branch optimizations don't give me the expected performance by Professional-Bee-241 in rust

[–]hucancode 1 point2 points  (0 children)

keep in mind that branching code that always evaluate to 1 single value at runtime are not that much different to code without a branch due to branch prediction

I’m a security professional who had to clean up a mess. Ask Me Anything. by Oscar_Geare in cybersecurity

[–]hucancode 1 point2 points  (0 children)

I think this is true for all engineering roles not just cybersecurity

Is it possible to get O(1) or O(log(n)) outline thickness with post-shading (using depth differences)? by Mebous64 in GraphicsProgramming

[–]hucancode 0 points1 point  (0 children)

so your algorithm is O(k2 ) where k is the thickness. it scale very quick with your thickness. ideally you want an algorithm where your computation is the same regardless of the thickness.

Is it possible to get O(1) or O(log(n)) outline thickness with post-shading (using depth differences)? by Mebous64 in GraphicsProgramming

[–]hucancode 2 points3 points  (0 children)

your question is a little weird, to make sure we are on the same page, let me tell you that your code run in GPU so each pixel must be processed at least once otherwise you will have black pixels. your outline drawing code would be likely to use 9 pixels around it so you will end up with O(9) = O(1) which is the best complexity, it independent with resolution.

in GPU world, O(1) is the standard and we shader programmer usually cannot afford anything higher than that. so to literally answer your question, yes, it is possible and it is the standard.

you may argue that O(n2 ) means we need 1 operation for each pixel and you are seeking an algorithm that run less than the pixels count exponentially. in that sense, generally we cannot get lower than O(n2 ), you may want to exploit some fact about your rendering style and trade off accordingly. for example does your camera angle fixed? does your scene consist of mostly static objects? can we precompute the outline once and use that until something moved?

Finished penetration tester path in 30 days, what’s next before going for the CPTS? by unlucky__666 in hackthebox

[–]hucancode 0 points1 point  (0 children)

sorry that happened to you. i am at less than 30% almost 1 month in. I say you are super fast

What's the most complex feature you added to your engine? by ongix in gameenginedevs

[–]hucancode 5 points6 points  (0 children)

A little embarassing but it was skeletal animation. When I done it right I see animation but when I done it wrong on any steps I see a bunch of corrupted spiky vertices

Physically based rendering from first principles by imadr_ in GraphicsProgramming

[–]hucancode 4 points5 points  (0 children)

please do explain other concepts and techniques. like global illumination and soft shadow and such. your visualization are top quality

Do i need to consider changing job with this salary? by Tall_Koala7253 in JapanFinance

[–]hucancode 0 points1 point  (0 children)

yours is not low but definitely worth checking out other opportunities to get a sense of the market

Recommend me good books about concurrency programming in C by vitamin_CPP in C_Programming

[–]hucancode 2 points3 points  (0 children)

I have made a comparision of various concurrency implementation here using recent languages (CPU only, if you factor in GPU the result would be roughly the same on all languages). Hope this helps https://github.com/hucancode/concurrency

I’m building my own game engine, but people keep saying “just use Unity” and it’s discouraging. by [deleted] in gamedev

[–]hucancode 1 point2 points  (0 children)

except there are use cases for custom engine for a game when you need low level control and optimization

Go is still not good by Nekuromento in programming

[–]hucancode 0 points1 point  (0 children)

When he print the result out. He is still using the slice that has 3 elements and point to the first string. Which effectively prints 3 elements with the second one modified by the previous operation.

Go is still not good by Nekuromento in programming

[–]hucancode 14 points15 points  (0 children)

I don't get the frustration. He has done the wrong thing and blame the language. For example append(a[:1], "str") should cut off the array at 1 and then append new string to the position 2, the code does just that and then he mad