HNHacker News
TopNewBestAskShowJobs

howtofly

168 karma · joined September 9, 2019

submissionscomments
howtofly··on Give to Thunderbird
Er... Just about to make a monthly 5 bucks donation, then I read this.
howtofly··on Xi Jinping’s Capitalist Smackdown Sparks a $1T Reckoning
In the era of wiki/scihub/libgen, the whole tutoring industry is worthless. They are just making easy money taking advantage of information asymmetry. Generally, easy money will not be allowed in China.

Edited: I'm talking specifically about Chinese tutoring industry. One comment below gives a very detailed description, which perfectly explains why I think it's worthless. We are all in the process of a revolution initiated by wiki/scihub/libgen. Whether agree with me or not, you are welcome.

howtofly··on strcpy: A niche function you don't need
I found the article kind of misleading: using memcpy for c-string is generally a bad idea, unless string length is bound with string buffer like std::string. Otherwise it will make code review very difficult.

In our team c-string is prefixed with sz_, e.g. char sz_name[13], and we always use a safe subset(or a safe replacement) of strxxx functions with these sz_ prefixed variables. Using memxxx with sz_ variables is explicitly forbidden, since it may break the NULL-terminating contract.

The sz_ prefix convention is by no ways like the hungarian naming nonsense. Suppose that you have "char sz_name[13]" in a structure of configuration parameters, sz_ tells the guy changing the field to keep it NULL-terminated, if they don't, it's their fault. On the other side, users of this field can safely use printf("%s", sz_name) without the risk of crashing the program.

For safe replacements of strcpy, I recommend: https://news.ycombinator.com/item?id=27537900

howtofly··on C++ Dev Ecosystem 2021
For the default setting, CDT is indeed very slow for large projects like Chromium. However, make change to eclipse.ini (providing large heap, the larger the better) and some preferences (mainly for how the code indexer works), CDT works smoothly for very large project. Just check the following link:

https://chromium.googlesource.com/chromium/src/+/refs/heads/... https://developer.mozilla.org.cach3.com/en-US/docs/Mozilla/D...

Please note that 16G RAM is assumed, I use 32G on my own laptop. I use Eclipse CDT for more than ten years successfully on all kinds of embedded projects.

howtofly··on C++ Dev Ecosystem 2021
I cannot imagine Clion, which lacked proper Autotools/Makefile support a year ago, dominate the embedded world now. Due to the immaturity of LSP, the same doubt applies to VScode.

Eclipse CDT, the long time king in embedded world, has been deliberately hidden from the default list. You have to click 'all results' to see it. Such a nasty trick!

PS: Eclipse can support all project long before LSP/Clion appeared, provided that 'CDT GCC Build Output Parser' is setup properly.

howtofly··on What every programmer should know about memory [pdf]
I read this 8 months ago, and forgot most of the technical details except that to use memory efficiently, you have to make good use of spatial and temporal locality.
howtofly··on Alibaba slapped with record $2.7B antitrust fine
Don't understand why such a good question is downvoted. Tencent is essentially doing the same thing as Alibaba in Chinese market.
howtofly··on Apple's Cooperation with Authoritarian Governments
H&M is a total failure in the Chinese market.
howtofly··on US raises ‘deep concerns’ over WHO report on Covid’s Wuhan origins
Now we're busy celebrating Chinese New Year and the victory of the fight over COVID-19, who care about US concerns :)
howtofly··on Nikon Is ending 70 years of camera production in Japan
I believe your description is quite typical in Sweden, which explains why the fight against covid-19 there is a total failure. Wearing masks is not only about protecting yourself, but also about protecting people you meet. I think wearing masks are nearly all about protecting other people, unless you have N95 and replace them regularly. It seems that I had made a wrong guess from this common sense, which obvious doesn't hold true in Sweden.

If it were a joke, it's not funny.

howtofly··on Nikon Is ending 70 years of camera production in Japan
LOL

Let's guess where your father's mask is made during this pandemic. Given that China has provided 200 billion masks, the answer is almost obvious. Please throw away all your masks made in China, right away!

I'm also curious how long it will take you to find a country that is both willing and able to sell you masks during this pandemic.

howtofly··on The State of Linux Debuggers
Can't agree more. As a longtime user of Eclipse CDT on Ubuntu Desktop, I've not seen the kind of bugs mentioned in the article for more than five years.
howtofly··on Switching from Vim to Intellij
Ironically though many think CLion as a better IDE than Eclipse CDT, Eclipse CDT actually works smoothly for large projects like Chromium (https://chromium.googlesource.com/chromium/src/+/master/docs...), Firefox (https://developer.mozilla.org/en-US/docs/Mozilla/Developer_g...) or the Linux Kernel. I've successful used it with Chromium when doing some WebRTC development.

Last time when I praised CDT for embedded Linux developing, I was downvoted by these vim/clion lovers...

howtofly··on Embedded Programming Without the IDE
A large portion of problems of using Eclipse CDT is that the Language Setting Provider is NOT properly set. See the MDN article mentioned in another comment for more on this. CDT parser is NOT bound to any build system. You can make it work with almost any build system, provided the build system had legitimate command line output. And CDT's performance is better than most of the LLVM/LSP-based tools. LSP based solution has not matured enough to be a real competitor.

I remembered that around 2011 I've tried Qt Creator, and it was a bad experience since I did know how to cope with several build systems. I've no idea how QtCreator's multiple build system support is now. For the same reason, CLion is not good enough to compete with CDT.

LLVM/LSP/Vscode/CLion, these are all exciting and have a lot of fans. Unfortunately, none of them is good enough in this subfield.

howtofly··on Embedded Programming Without the IDE
You may have heard that Eclipse CDT didn't work out of the box. To make it work, you only need to understand how its parser work and how to properly set it up. It can support all build system, only if the build system can output the build command line output. It worked for almost every project I have encountered in the past nine years.

Check the linked article for more details: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_g...

howtofly··on Embedded Programming Without the IDE
Eclipse CDT is perfect for embedded developing, with no real competitor. Given the compilation command line output, its buildin parser can understand very large code base (the linux kernel, chrome browser et) efficiently and precisely, long before llvm-based tools appeared.

No need to configure tons of vim plugins, you have tons of powerful features in the default settings, like type hierarchy, call hierarchy, debugging etc.

howtofly··on Blueberry Compound May Provide New Inflammatory Bowel Disease Therapy
As a former UC patient, I would say that IPAA might be a good option if medical treatment is not effective for keep steroid-free remission.
howtofly··on Apple Hides Taiwan Flag in Hong Kong
"As a strong believer of democracy are you naive enough to believe all the elections are perfectly fair, no party at power ever cheats to imitate democracy and that democracy is about everybody sacrificing themselves to obey "the majority?"

As believer of HEALTHY democracy, I've never made any such implications. Guys from US/UK/EU claiming Taiwan is a country should go protesting right away, don't let democracy down!

As I already said, if democracy doesn't work in your country, don't waste your time caring about China/TW/HK unless you actually live there.

howtofly··on Apple Hides Taiwan Flag in Hong Kong
I was writing to make it clear that it's inappropriate for minority to make such "everybody" claim. And obviously the above reasoning applies perfectly to EVERYBODY holding similar opinions, especially those living in modern democratic countries.
howtofly··on Apple Hides Taiwan Flag in Hong Kong
> Well, in many countries it absolutely is. And there is no way to fix this.

That a legal government of a modern democratic country cannot represent its people is a horrendous claim. As a strong believer of democracy, I'd rather assume that you were the minority in this case. The everyone claim may hold true for everyone you know (among the minority of your country of course).

howtofly··on Apple Hides Taiwan Flag in Hong Kong
Theoretically, a government should represent its people, which should be the foundation of democracy. If that foundation were broken, it is far more worrisome than these China/Taiwan/HK events.

I suggest fixing it ASAP. For example, the op can protest to urge his/her government to recognize Taiwan as a country, which will be "a beautiful landscape" as described by Nancy Patricia Pelosi.

howtofly··on Apple Hides Taiwan Flag in Hong Kong
"Everybody knows Taiwan is a distinct country"

Really? Does your government officially call Taiwan "a country"? Show us the proof. Considering only 15 countries in this universe still do this, it's almost safe to guess NO.

howtofly··on Iraq blocks Facebook, Twitter, WhatsApp, and Instagram, shuts down internet
Considering this country is literally liberated by the US, it is totally hilarious!
howtofly··on Life in China Is Getting Harder With High Prices
China's success proves that democracy is not the only way. These guys just cannot accept this simple fact. LOL
howtofly··on Neovim v0.4.0
Now coc+ccls is the best vim plugin for C/C++. Though compared to Eclipse/CDT, several features still missed, e.g. step-by-step macro expansion.
← PreviousPage 2 of 2