HNHacker News
TopNewBestAskShowJobs

d26900

60 karma · joined February 8, 2021

submissionscomments
d26900··on 50 Years Ago, Sugar Industry Quietly Paid Scientists to Blame Fat (2016)
I think it boils down to ketosis/water fasting/calorie restriction.
d26900··on 50 Years Ago, Sugar Industry Quietly Paid Scientists to Blame Fat (2016)
Could it also relate to ketosis perhaps? (Water) fasting and calorie restriction seem to have favorable effects on living organisms.
d26900··on 50 Years Ago, Sugar Industry Quietly Paid Scientists to Blame Fat (2016)
I think you are basing your worldview on hearsay evidence, elevenoh.
d26900··on 50 Years Ago, Sugar Industry Quietly Paid Scientists to Blame Fat (2016)
Maybe the person should have used: "suggesting"? Anyhow, I share the sentiment that the "vegan lobby" is an easy target to pick.
d26900··on Ask HN: What are relevant books as of C++20?
> "... my coding in C++ still feels like doing C with classes and some STL containers like 2005. I want to progress from this state. ..."

What's wrong with these?:

- C++: The Core Language by Gregory Satir and Doug Brown

- https://github.com/QuantumLeaps/OOP-in-C

- C++ Concurrency in Action

- C++ Templates the Complete Guide 2e

The first is particularly geared towards C programmers, and I prefer the second one to "Inside the C++ Object Model". (There's also another popular book by a German author who covers OOP in C.)

For the time being, I will be an "opportunist" who is waiting for the right time to switch to another language - Rust:

"To me using C++ means you are ready to give up a lot of time and energy in order to gain a complete control over certain aspects of your program. I was very much into that at the start of my career and gradually started drifting away to more immediate productivity while reserving the right to poke under the hood when necessary. This has led me to Rust and I find it to be the better natively compiled strongly & statically typed language, but YMMV of course."[1]

(No, the concepts I learn in C++11 and beyond won't go into waste even when C++ becomes less and less relevant in a couple of decades.)

According to Stroustrup himself[2], you should know 5 different kinds of programming languages. So for me it's:

- Systems programming: C (has a special place in my heart)

- General purpose: C++ (will switch over to Rust when the time is ripe)

- Scripting: Python

- JVM: Scala

I think with these, you are well-equipped for the "future".

Also, specialization has its benefits[3], that's why I am not "language hopping" constantly. I am "conservative" (C++) until I feel I that the time is right for me to be a "liberal" (Rust).

References:

[1] https://news.ycombinator.com/item?id=24805717

[2] https://youtu.be/NvWTnIoQZj4

[3] https://news.ycombinator.com/item?id=26119087

d26900··on Ask HN: What is the best OS startup/bootup sound ever?
I really like the PlayStation 1's from Takafumi Fujisawa[1] (藤澤孝史)[2]:

https://youtu.be/Jwln1ai_DYU

- "The function of this sound is to tell the user that the hardware is running like it is supposed to, and that the disc has successfully been read. To add, the swooshing reverse sound is designed so that it can go into loop if the disc couldn’t be read, and we can understand if something went wrong."

- "I thought of the structure, selected the tones, and gathered the instruments in 2 weeks, and the studio work was done essentially in 2 days. I kept thinking from the start that I wanted the sound image to be something exciting, like that feeling when you walk into a cinema. I really wanted to communicate and reinforce that something fun is going to happen."

References:

[1] https://blog.playstation.com/archive/2019/12/05/how-sound-de...

[2] https://www.mobygames.com/developer/sheet/view/developerId,5...

d26900··on Show HN: Workman ( ͡° ͜ʖ ͡°) – The Package Installer
After theamk's comment, I came to the conclusion that this project was and is a waste of time.

I have now produced an equivalent solution via a Bash script: https://github.com/d26900/Scripts/blob/main/setup.sh

My shortsightedness in this particular case, caused me to opt for a bad solution.

Nevertheless, thanks to the input I received here, I was able to correct this wrongheaded decision of mine.

Thanks again, I think I learned a valuable (life) lesson here.

d26900··on Show HN: Workman ( ͡° ͜ʖ ͡°) – The Package Installer
I archived this repository now:

https://github.com/d26900/Workman/issues/1

d26900··on Show HN: Workman ( ͡° ͜ʖ ͡°) – The Package Installer
Oh gosh, I wasn't aware of "setup.sh" up until now. へ(>_<へ) *facepalm*

Yes, you are right, my tool is pretty much redundant now (w/o any error handling as you rightfully pointed out).

Anyhow, good riddance, and thanks for your valuable feedback! (This is so embarrassing and painful at the same time for me, but in a good way.)

d26900··on Common libraries and data structures for C
I am not an expert either, but I would say that you have to rehash it either way if it grows (or shrinks). Tombstones as I understand it, are a way to "mark" deleted entries off of the hash table. Having these deleted entries marked ensures that your hash table doesn't break its "search chain". This is important so that you still can find entries that are put at another index when one index ("bucket") is already occupied.

However, I also don't shrink my table, once it grows. It stays grown. (Another drawback of my lib I suppose).

Thank you for the feedback, I really appreciate it! :)

d26900··on Common libraries and data structures for C
That's a cool library! Well done!

I made something similar to it being inspired by the C++ standard library. But it is for C89:

https://github.com/d26900/JamaisVu

I use tombstones for my hash table (unordered_map) though.

Another drawback of my lib: for each hash table entry, I allocate an extra byte for the tombstones.

d26900··on Show HN: Workman ( ͡° ͜ʖ ͡°) – The Package Installer
Might work for Fedora (dnf) as well. I was tired of (re-)installing packages all the time for my different Ubuntu instances (VirtualBox, Dual Boot). So I automated it using Python 3.

All you need to do is to provide a list of packages that you want to install inside `npms.txt`. In the `npms.txt` you can list the package `react` and define the installation commands and options like so:

! npm install

? -g

react

Then you need to run `python3 workman.py` as an administrator. Done! (Don't forget to include the `npms.txt` into your `todos.txt`. The `todos.txt` is a requirement.)

(Note that you can also comment out to-dos from `todos.txt`.)

← PreviousPage 2 of 2