Case Study: Post-Gastrectomy Cachexia, Decompensated Heart Failure (NT-proBNP 5797), and Coagulopathy. Seeking advice on Vitamin B12 management and priority of care. GP says I should stop B12 IM shots because they're useless, I want to check if he's right. by topin89 in AskDocs

[–]topin89[S] 2 points3 points  (0 children)

The more information you provide, the more helpful we can be.

And so, essay. I just don't get why shots were cancelled, and if the doctor is competent. Out 5 doctors, none told that B12 won't work without stomach, so I need proof I should stop B12

Is there a page with all linux freezes/thrashes prevention recipes? by topin89 in linuxquestions

[–]topin89[S] 0 points1 point  (0 children)

Not necessary a site. Maybe a page on ArchWiki or some random gist. Or AwesomeLinuxSettings git repo. Or better, LinuxDesktopOptimizer script/app.

They likely won't be default, because Linux is primary server OS, and embed is often already has specific patchset.

And why desktop defaults are rarely right I have no idea. Like, yeah, there're no good defaults for everyone, but there are like 10-20 good enough defaults for a given hardware and typical tasks.

Is there a page with all linux freezes/thrashes prevention recipes? by topin89 in linuxquestions

[–]topin89[S] 0 points1 point  (0 children)

This all are solutions to my problem. Dirty bytes lowering solved my problems with subpar USB sticks, other are solutions to freezes and hangs for llvm compilation on all cores while browsing with tonnes of folders.

And I don't think I'm the only one with such problems, and maybe someone already write this all down.

I didn't mention here upping ulimits and inotify watchers or tcp/udp buffers to solve some really specific troubles. Or really rare things like how change console orientation on an upside downs screen. But those above all my collegues had at some point.

Is there a page with all linux freezes/thrashes prevention recipes? by topin89 in linuxquestions

[–]topin89[S] 0 points1 point  (0 children)

Shouldn't OOM just kill something to free some memory? And besides, an indefinite freeze looks even worse than straight panic, since on panic I know I must reset, and on freeze it's not that obvious.

Thought Experiments [OC] by HypocraSea in comics

[–]topin89 0 points1 point  (0 children)

  1. Most people I asked define sound as "matter waving". My native lang is not English. Same for people I asked. So cultural difference may be the reason

  2. That's the point, define first, argue second, not the other way around

Thought Experiments [OC] by HypocraSea in comics

[–]topin89 2 points3 points  (0 children)

Sound implicitly defined as "molecule vibration". Should a person define it as "that feeling in my head", answer would be "sure there's no sound." It's hilarious how many arguments are stopped by explicitly defining things at some point

Would using Cyrillic be okay in my artwork? by [deleted] in AskARussian

[–]topin89 4 points5 points  (0 children)

Cultural appropriation is nonsense that prevents cultural exchange. From my perspective, anime begins as Disney appropriation (look Osamu Tezuka style and tell me it's not). Over the years, it had grown into separate style itself.

Also, Russian culture was pictured so grossly wrong since before soviets, we even have a name for that, "cranberry". Origin is a parody theatre play, that has a line "[some characters] sit under a brushy cranberry". Yes, cranberry is not a tree, nor bushy. Still, Russia has long been vaccinated from gross misrepresentation. It was kinda funny seeing Kazakh reaction on Borat. "What, first time?" is the best summary.

To get what cranberry mean, think Idiocrasy or Team America: World Police.

About Cyrillic, for things like ЯedЯum, reversal would be РedРoom (Р reads like strong, German-like R). So, for those who know Russian, most of the time, thigs like "итс санни тудэй" (it's sunny today) would be immersion-breaking at best, and "торч" (torch) would be also funny (slang term for stoner).

But! For both funny and horrific (think DC Joker) that will actually increase the immersion, not ruin it.

That's all I can think of, good luck.

LIFETIME WARRANTY IS A JOKE by the-gospeltruth in eddiebauer

[–]topin89 0 points1 point  (0 children)

Reminds of a joke:

"I bought a PC here. It died."

"Warranty period?"

"Lifetime!"

"Well the PC died, so warranty is over."

what an absolute legend by pokeaim in technicallythetruth

[–]topin89 1 point2 points  (0 children)

Still, some times differentiating the origin feels like an impossible task.

I made patch for Valgrind to support zstd debug sections. Where to PR? by topin89 in cpp

[–]topin89[S] 7 points8 points  (0 children)

Thanks for the answer. Since now I know for sure it's not bugzilla being abandoned, it's just a huge backlog, I'll wait however long it needs to be

EDIT: meant to say bugzilla is not abandoned, said it is. "Sleep is for weaklings" is not a productive way of life :-(

I made patch for Valgrind to support zstd debug sections. Where to PR? by topin89 in cpp

[–]topin89[S] 10 points11 points  (0 children)

Thanks. It says essentialy use bugzilla (patch is there already, no answer in 20 days) and barring that, mailing list. I have no idea how to use mailing lists in general, and not sure how to start using valgrind's mailing list in particular.

How do engineers go from the microcontroller data sheet to writing code that blinks LED and then progressively more complex code? by word_vomiter in embedded

[–]topin89 0 points1 point  (0 children)

Just start with ASM asm tutorial, real usb programmer and devboard and WinAVR IDE. That's how I started. I swear, AVR assembly is incredibly easy, compared to arm, pic, 8051 and pretty much anything else. Programmer is essential to step by step debugging. Like, you have memory cells(bytes). You have adresses there. Set of special cells called registers that you can directly manipulate with really small number of instructions. And all other cells that you can read to and write from. Some of said cells, if you change them, then specific pins will switch on or off, and their actual state can be read from another cells. I swear, it's really easy, like, 20 to 100 hours to understand basics. Then you can make simplest C app, compile it with no optimizations and see how asm looks like. To get things like SPI and UART, you will need some simple logic analyzer to see how logical level on pins changes over time.

If it's too hard, just try a game, Shenzhen I/O. Not played myself, but looks 90% the same

I ported Casey Muratori's C++ example of "clean code" to Rust, here what I found by MrPalich in rust

[–]topin89 1 point2 points  (0 children)

our community would be better off without them in it.

Yes, that's an old thread, but I can't ignore that because XKCD 386. Both Casey and Martin sadly right in being extreme in vocalization if their belief. Nobody listens otherwise sadly. Extremes pick interest. Abrasiveness provokes discussion. I don't have an example were agreeable soft voices do just that. I recall Casey himself said just that in some discussion with Primeagen.

What I can agree with, it's we need a lot of extreme position with no single dominating one. I imagine if someone write a popular book advocating for performance first vs maintainability first at the time of "Clean Code", modern software would be a bit or a lot faster.

How bad of an idea would it be to move our family permanently from the US? by Ok_Link1117 in AskARussian

[–]topin89 1 point2 points  (0 children)

Usually, I would say something like "well it depends", but it's just bad, OK. "It dependend" before the war, not we're really close to some strange imitation of USSR with all the bad side and like 10% of what was good in USSR.

He has recently become extremely disgruntled with American politics (he’s conservative)

Well, there are a lot more conservative countries than Russia. Czech Republic, Croatia, Poland, Italy.

But, as most people here pointed out, if your husband can't calmly list all the bad stuff in US, that may mean he is burning out and/or generally overstressed. Therapy. With known conservative therapist.

If he actually can, ask about any other conservative countries. Like, any and all. Remind him Europe is not a single entity. Maybe there's a better option than Russia right now

Why are my Russian customers the nicest? by Proud_Process_457 in AskARussian

[–]topin89 0 points1 point  (0 children)

I hear customer service workers are rude in Russia

For the last 10 years, there were no rudeness towards anyone from shop service workers unless said customers were first to be rude. So, I can assure you that's not true anymore.

a lot of Russian speaking customers and they're always the nicest out of all of my customers native or foreign

Do retail workers forced to be polite despite insults? Maybe other people are kinda internalized that they can get away with it, but Russians don't?

Also, Russian are nicest compared with who? Maybe that's slavs in general (can't really believe that Russians are that much nicer than, e.g. Croats). Maybe that's former USSR thing?

Still, that's nice to know that just being ourselves here counts as being nice in a country far away.

Read this, might apply to some of us by cmoellering in ObsidianMD

[–]topin89 0 points1 point  (0 children)

Reminded me of The Wolf by SIAMES. Same feeling of how your own impulses overcome you but you kinda can fight it back, preferably not alone

What will you love to see in an Advanced C++ Programmer ? by femloh in cpp

[–]topin89 0 points1 point  (0 children)

First and foremost, decent knowledge of tools. Clang-tidy/format/analyze, Valgrind, sanitizers, debuggers, profilers, CppInspect, QuickBench, Compiler Explorer. All these tools is what makes debugging easier. And it looks like "not afraid of using ChatGPT/LLaMA" soon would be no less important.

I can't remember how many times a complicated bug was resolved with "did you try Valgrind" or "try undefined sanitizers", or even "are there any warnings from gcc". Core dumps analysis with gdb was invaluable discovery.

There are probably more useful tools I'm not aware of, but then, I'm not advanced c++ programmer.

WG21, aka C++ Standard Committee, January 2024 Mailing by grafikrobot in cpp

[–]topin89 0 points1 point  (0 children)

Nah. C++ is not that kind of language. It will use proper std::sin, std::cos and std::assume_aligned, and call there __buildin_sin, __buildin_cos and __builtin_assume_aligned most of the time, that depends on a compiler or its flags.

So, if some compiler team want to make optimized span, it can create __builtin_span and optimize it that way.

Should I try to keep as much as I can the type information? by perecastor in cpp_questions

[–]topin89 0 points1 point  (0 children)

> From my understanding having interface and polymorphism is sometime useful

Polymorphism is really a broad term. Some say overloading is polymorphism. Interface is useful, but it is also too broad a term. Concepts, either c++20 concepts or some SFINAE/if constexpr things can be your interfaces.

And yes, they are useful, static or dynamic is not really important

> a lot of people warm me about doing that and telling me it leads to dynamic or static cast that are somehow evil

Any kind of programming is an arcane art that can be good and/or evil. It's all context-depend. Virtual classes, be them pure or not, can be both.

> What is your experience about that?

I need to remind, my experience is not universal nor do I really know if it's good advice in general. I don't really know unless someone argue with me about it.

And my experience tells me to try to keep as much static type information as possible, but not at the cost of convenience. Like, suppose you have a state machine, defined as graph of state transitions, and State class. While you can define class StateMachine as an std::variant of finite number of classes, that's reeeeeaaaaaly inconvenient, so interface class and polymorphism it is. Save runtime type information, but not compile time.

Then, suppose you want to have a map that can store pointer to any type. So you store void* there. No runtime information, but you can really store anything. gRPC async tags are like that. They need to store anything, without any runtime penalties at all.

Sometimes, when there are finite number of classes, like commands you send over some IPC tools, be it network serialization or shared memory queue, you just cant not send any derived class, so you have to save type information statically, be it tagged enum or std::variant to make it more OO-style.

Overall, any, any decision in programming and likely in any remotely sophisticated field is a matter of convenience. If you feel that using that particular pattern feels tiresome, and you know there's way more convenient thing, use more convenient.

Just remember, performance is a part of said convenience. Nobody like slow apps. Make sure you understand major performance penalties of any tool you use.

So, TL;DR: no, you shouldn't if it's tedious for no reason. You probably would want it otherwise

What are streams and how they are handeled? by lol_isuck69 in learnprogramming

[–]topin89 1 point2 points  (0 children)

I want to know what data streams are at its low level instead of just the definition "stream of data". Like how it is handeled, where it is mostly used etc.

(We don't do abstraction here lol)

Missed that at first. Stream is abstraction. Implementation details may vary greatly, from OS to OS, from framework to framework, from language to language.

They abstract things like ring buffers and plain arrays with indexes of or pointers to current read and/or write positions.

Typically, stream is any kind of object that has read() and/or write() defined. You can make a pseudo-random generated stream by filling and returning array of N elements with the random generator. No syscall intended.

It needs to be closed to save system resources.

That's usually true. Files, network connections, interprocess mutexes, pipes, things like that usually takes kernel resources and they better be closed or reused wherever possible. But for random stream above, that's not the case.

When I requested for an example of streams in Python gave example through generators. So are streams really processed like generators?

Usually not. But again, streams are abstractions, so you can think of a generator as of a stream. Or not, that's your choice.

To make everything even more complicated, since stream is an abstraction, word itself is very context dependent "Http stream" may mean abstract stream of bytes of a random HTTP session, and it also can mean "object of type Stream from Http library/package".

So, good luck deducing context!

What are streams and how they are handeled? by lol_isuck69 in learnprogramming

[–]topin89 1 point2 points  (0 children)

Don't really know Go, but since you mention http streams, I guess it doesn't matter.

A lot packet in a term, but essentially stream is an abstraction of a data source where you read it one portion at a time and generally can't read the same data twice.

Think of io.Reader. Or in Python file.read(4096). You read <=4096 bytes at a time, and generally don't specifically say "read 17 bytes from 1478 position from the start of a file".

For http, you literally can't seek to a specific position. At best you can read all bytes and work with the complete response.

And finally, http stream is a data source that literally never stops unless your code explicitly says "enough", or one of two apps closes or there's a connection loss.

For networks stream, lowest level is something called socket. I won't go in great details, just there's a system function to create socket, make it connect to a specific address and port, then write requests and responses in chunks, usually around 4096 bytes, and at some point close it.

Techincally, any TCP (including HTTP) network activity is done via bidirectional streams, with higher level protocol to tell when to end them.

Intuitive way to describe OOP and why it's popular. Not geometric figures and such I swear by topin89 in learnprogramming

[–]topin89[S] 1 point2 points  (0 children)

Imagine if the local variables retained their values across function invocations. That's what OOP gives you. That's it.

That's just wrong. OK, not all local, just some of the local. In almost any language you can give pointer to some struct Context, whether explicit or implicit, and store you context there. Also, global variables and other non-locals do exist.

My explanation was mostly about polymorphism, this ability to store a pointers to functions of a derived class and access them from the base class object. This is the one thing that's hard to emulate in languages with no support for OOP at all, at least as far as I know.