HNHacker News
TopNewBestAskShowJobs

syockit

307 karma · joined January 27, 2015

submissionscomments
syockit··on ‘All of Sony Systems’ Allegedly Hacked by New Ransomware Group
Can't reply directly to bart because the thread is too deep, but really, they do send it another e-mail. Don't ask me what it's supposed to achieve. Purportedly, if you sent the attachment to the wrong person, then you can remove the recipient when sending the mail containing the password if you happen to realize the mistake. Well, the thing is, (1) they usually send the password e-mail right after the attachment mail, which means it is highly likely they won't check the recipient list, and (2) they don't bother to use AES256 (because other Windows Explorer won't be able to open them), so even without the password it's trivial to crack.
syockit··on Road to NumPy 2.0
While not really python, there's Coconut language that has the infix pipeline operator and compiles into python.
syockit··on Nvidia’s AI supremacy is only temporary
Wow, now I learned something new. So even though statistics and machine learning overlap each other a lot, a word as simple as inference have totally different meanings. In statistics, it usually refers to determining the influence of an input, for a multi-input model. Getting predictions is simply called prediction.
syockit··on Nintendo is trying to patent some broad Tears of the Kingdom mechanics
The recognition of the phrase as a logical fallacy comes after the phrase starts to be widely used, not the other way around. If everyone starts saying "snowball out of control", then eventually the fallacy will be known as "snowball out of control" fallacy instead.
syockit··on My favorite Vim oneliners for text manipulation
This requires that you put have lines between major pieces of codes.

Which I think is a good habit to have anyway. Some people use comments without preceding empty lines (oh why) to delineate code, so they'd have to change the regex a bit to make this work.

syockit··on The Long History of Nobody Wants to Work Anymore
You print more money because you have to give out more money, whether if it's in the form of handouts or in the form of extra wages.
syockit··on Japanese population falls in all 47 prefectures for the first time
Some of my colleagues were already complaining that the government is forcing them to take leave. I can't imagine how much grumpier they will get if the government forces them to take even more.
syockit··on For BSD Unix, It's Sayonara (1992)
(Score:5, Insightful)
syockit··on Can a Rubik's Cube be brute-forced?
That must have been a rewarding experience! I made the mistake of memorizing the solution when I was a kid so solving the cube feels like a routine instead of actually solving a puzzle.
syockit··on Canadian judge says thumbs-up emoji amounts to contract acceptance
That's why I make it a point to say "I see", "uh-huh" instead of "OK" to such statements, given that it's so easy to be misunderstood even though technically "OK" is an acceptable response.
syockit··on Show HN: My platforming game written in C 89
It is unfortunate that VLA type was made optional in C11. It's like throwing the baby out with the bathwater. Luckily, they decided to make it mandatory again in C23 again, with only the automatic allocation optional.
syockit··on GPU Programming: When, Why and How?
I couldn't check it using Nsight Compute. It didn't find the kernel even though I ran it as root. A40 is supposed to be Ampere architecture, with GA102 chip so it should be supported. Maybe the toolkit I'm using is too old (CUDA 11.3).

Everything is on the device during the tight loop, and there is minimal transfer to host, so I don't think it's bandwidth limited in that sense. It could be bandwidth limited on the cache level but I couldn't tell. I wish I could get Compute running.

syockit··on GPU Programming: When, Why and How?
My experience with it was: with CSR format, SpMV got about 40x speedup compared to a single CPU core on a RTX 3090, with full core utilization. Rough calculation tells me it's equivalent to 80 GFlops, which is far from the full potential of the card. I thought there was someting wrong with cuSPARSE so I went ahead and wrote a SpMV kernel, based on the code in NVIDIA's past reports. It actually performed slightly better. Fair enough, cuSPARSE has to support all kind of workloads so it might be just that in my case, the handwritten kernel worked better. But still, it would never get to the regime of hundreds of GFlops. After reading various literatures on GPU SpMV implementations getting to the same conclusion, I had to concede that I can't squeeze more GFlops out of it.
syockit··on Japanese biomass venture using microorganisms to tackle waste disposal
In fact, when I read the title of this submission, I thought it was related to Polyglu.
syockit··on Dropbox accidentally billing two extra digits
An interesting accident involving currency with no minor units (cents). The customer has been reimbursed and the issue was resolved.
syockit··on 27 years later and the Psion 3a is still wonderful (2020)
My contribution for Astro Slide is dated Oct. 2020. They've locked my contribution, so I consider it money burnt. While I was still naively waiting for it to come, I held on to my Gemini PDA for so long, even after its battery had bulged to the point that the back panel covering it had dislodged. After all the troubles it had caused me, I decided to give it up and get a normal smartphone instead. Life has been much better since then.
syockit··on IUP – Cross platform C GUI library
It's A UNIX System!
syockit··on Hammerhead sharks are first fish found to ‘hold their breath’
What I like about having an input method editor (IME) is that I can easily type units like ℃ or ℉ to avoid ambiguity. For a Japanese IME, just type ど (do, for degree), press spacebar until it pops out a conversion candidate list, then just find the symbol you want. Of course, you need to have known that the symbol appears ℉ when you type ど. There isn't an obvious way to find out which word is mapped to which symbol. Usually, I type きごう (kigou, for symbol) to get a list of symbols but ℉ does not appear in that list.

Or, you can also use WinCompose (or Xcompose for X Windows users. For tty users, tough luck). At least, on my installation, it can be typed as "Compose Compose d e g f".

syockit··on Windows 11 in Svelte
I have no idea what you've typed there. All I see is a heart and three boxes. And it doesn't seem that the boxes are decodable either. Whatever it originally was has probably been irreversibly replaced.
syockit··on Qsort.h – Quicksort as a C macro (2019)
The function is already inlined because the implementation is visible. You can check the assembly, it has no calls to the compare and swap functions.

I guess you're right, since the function accepts a void pointer, it could also point to an array of two array pointers. So yes, it can also process two arrays.

syockit··on Qsort.h – Quicksort as a C macro (2019)
Today I learned that for modern processors, quicksort code is small enough that the compiler can inline them if the definition is visible during compilation. See here for comparison of isort function implemented using plain static functions vs the macro in TFA: https://godbolt.org/z/arGjPGhKE . It's not as flexible as the macro form (not being able to pass two arrays at once like the sortByAge example in TFA), but I figure it should be friendlier to debuggers (though with all the inlining the experience is not going to be that great either).

IIRC, if LTO is enabled the calls to the less and swap functions can also be inlined even if the generic function is compiled to a separate translation unit. Haven't tried it for the quick sort code above, but I found that out for some other thing I experimented with.

syockit··on A morale crisis after multiple Meta layoffs
I remember hearing that rumour when they were building a tech center in Yokohama. But all the job listings never mention anything related to self-driving so I always wondered what they actually do there.
syockit··on The Geomagnetic Storm Continues
That'd better be the real northern lights, and not someone forgetting to turn off the stove after realizing the lunch is ruined.
syockit··on C Strings and my slow descent to madness
According to an article I read, moshimoshi came from the telephone operators saying 申し申し (moushi moushi) to signify "I'm going to start speaking now". On a tangential note, 申し used to be the phrase when calling out to someone to ask something (similar to English "Excuse me").
syockit··on Cosine Implementation in C
Speaking from no experience, but it should be doable. But since in most applications you're going to use floating point anyway (or, if you're using fixed point, maybe right bit shift or maybe even do integer division until it fits the range of your value), the extra precision would be discarded in the end.
syockit··on SymPy makes math fun again
Wolfram Engine + VS Code (notebook plugin), anyone?
syockit··on Debian 12 “Bookworm” Enters Its Soft Freeze
Are you sure about that? Did you take the picture of his brain to confirm?
syockit··on Lesser known tricks, quirks and features of C
Me neither. In the VLA use cases page he does that with multidimensional array too.

    int (*arr)[n][m] = malloc(sizeof *arr);
which you have to access with

    (*arr)[i][j]
I prefer doing

    int (*arr)[m] = malloc(n*sizeof(*arr));
though this separates m and n to be one on left side while the other on the right side, it allows me to index directly

    arr[i][j]
syockit··on CLib: Header-only C library that implements the most important classes from GLib
Why instantly crash when out of memory instead of letting caller decide what to do?

Also, some GString methods that have string length argument do not append NUL terminator, assuming that the input string is terminated at length+1. This could lead to fun buffer overrun if the string is to be used by functions expecting C-strings. I guess they are to be used when strlen is known by caller, but nevertheless, some documentation would help.

syockit··on Why I'm still using Python
Julia came too late to the scene. When I first started using Julia 0.3, there was already Theano for Python, and Tensorflow was in the making. R for some reason is not as easily navigable as Python. The slowness of compiling Armadillo and Eigen makes it a no-go for iterating on new ideas. Maybe it should be asked instead why Octave didn't take hold, as Matlab is popular among engineering communities and the syntax is also simple enough to understand.
← PreviousPage 3 of 9Next →