How to get the name and size of all disks whether mounted or not in c++

Advertisements I need a way to get the name and size (in megabytes if possible) of all disks in C++ on Linux (Arch to be specific). >Solution : You can simply read files from /sys filesystem. For example on my machine: chus@kagi:~$ cat /sys/block/nvme0n1/size 2000409264 Just open the file, read the number in, multiply by… Read More How to get the name and size of all disks whether mounted or not in c++

What's the rate-limiting step for mysql query, index query or disk read?

Advertisements For the basic mysql query like select * from table where c1=v1 and c2=v2 and c3=v3, I realize the latency of the query is proportional to response payload size, say return 500 rows is slower than 200 rows, which sounds reasonable to me. But my question is what makes 500 rows slower than 200?… Read More What's the rate-limiting step for mysql query, index query or disk read?

Trying to understand why my C++ program is slowing down after running for long time

Advertisements None of the threads close to the topic that I could find (like this one) helped me so far. I have a C++ program that reads some data from a file, runs pretty complex and intensive operations and then writes outputs to new files. When I let the process run for few hours, here… Read More Trying to understand why my C++ program is slowing down after running for long time

Remove Name Notepad file if doesnt exist in AD through powershell

Advertisements $Users = GC "Desktop\Master.txt" foreach ($user in $users) { $userobj = $(try {Get-ADUser $user} catch {$Null}) If ($userobj -ne $Null) { Write-Host "$User Exists" } else { Write-Host "$User Doesn’t Exist" }} I am using this code to check if a user exists in AD. Later on this notepad file is processed to delete… Read More Remove Name Notepad file if doesnt exist in AD through powershell

Does running a synchronous method using Task.Run() make it asynchronous

Advertisements Let’s consider a class (This is not the class or code I’m using in my application, just trying to learn with this example) class Person { public int Id {get; set;} public string Name {get; set;} public int DeptId {get; set;} public string Department {get; set;} } Now let’s assume I get a List… Read More Does running a synchronous method using Task.Run() make it asynchronous