Click here to Skip to main content
14,920,488 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: C++ & Thinking about SSD & wear level (updated) Pin
Peter_in_278027-Mar-21 16:03
professionalPeter_in_278027-Mar-21 16:03 
GeneralRe: C++ & Thinking about SSD & wear level (updated) Pin
raddevus27-Mar-21 17:47
mvaraddevus27-Mar-21 17:47 
GeneralRe: C++ & Thinking about SSD & wear level (updated) Pin
David O'Neil28-Mar-21 3:29
professionalDavid O'Neil28-Mar-21 3:29 
GeneralRe: C++ & Thinking about SSD & wear level (updated) Pin
raddevus28-Mar-21 3:37
mvaraddevus28-Mar-21 3:37 
GeneralRe: C++ & Thinking about SSD & wear level Pin
David O'Neil28-Mar-21 4:14
professionalDavid O'Neil28-Mar-21 4:14 
GeneralRe: C++ & Thinking about SSD & wear level Pin
raddevus28-Mar-21 5:11
mvaraddevus28-Mar-21 5:11 
GeneralRe: C++ & Thinking about SSD & wear level Pin
David O'Neil28-Mar-21 11:56
professionalDavid O'Neil28-Mar-21 11:56 
GeneralRe: C++ & Thinking about SSD & wear level Pin
raddevus28-Mar-21 12:50
mvaraddevus28-Mar-21 12:50 
That's great stuff. Thanks for sharing. I also cleaned up the code and made it so you can provide a drive letter (just the letter) as a command-line arg and it will scan the drive.
Unfortunately I couldn't get it quite right for mapped drives, there is something odd there.

Also I now use std::string as I should.
You can get the code at my github repo: GitHub - raddevus/wearlevel: wearlevel project that checks 1) how long OS has been running, 2) how many bytes read and written during uptime.[^]

Also, here's one more thing. I put a micro sd card in the laptop slot and ran it on d:
c:\>wearlevel d


See the snapshot[^].
Interesting that windows writes 61,440 bytes to the newly attached drive.
And, oh yeah, 61440 / 4096 = 15. But I have no idea why or what that means. Unsure | :~

modified 28-Mar-21 18:57pm.

GeneralRe: C++ & Thinking about SSD & wear level Pin
Dan Neely20-Apr-21 5:41
MemberDan Neely20-Apr-21 5:41 
GeneralAre you tired of keeping up with the latest changes? Pin
Slow Eddie20-Mar-21 2:58
professionalSlow Eddie20-Mar-21 2:58 
GeneralRe: Are you tired of keeping up with the latest changes? Pin
Julian Ragan20-Mar-21 3:22
MemberJulian Ragan20-Mar-21 3:22 
GeneralRe: Are you tired of keeping up with the latest changes? Pin
GuyThiebaut24-Mar-21 0:32
professionalGuyThiebaut24-Mar-21 0:32 
GeneralRe: Are you tired of keeping up with the latest changes? Pin
Gary R. Wheeler5-May-21 14:20
MemberGary R. Wheeler5-May-21 14:20 
GeneralRe: Are you tired of keeping up with the latest changes? Pin
Super Lloyd5-May-21 15:11
MemberSuper Lloyd5-May-21 15:11 
GeneralAbsolutely Horrific Pin
Brisingr Aerowing18-Mar-21 7:00
professionalBrisingr Aerowing18-Mar-21 7:00 
GeneralRe: Absolutely Horrific Pin
PIEBALDconsult18-Mar-21 7:13
professionalPIEBALDconsult18-Mar-21 7:13 
GeneralRe: Absolutely Horrific Pin
Daniel Pfeffer18-Mar-21 7:43
professionalDaniel Pfeffer18-Mar-21 7:43 
GeneralRe: Absolutely Horrific Pin
Slow Eddie20-Mar-21 2:53
professionalSlow Eddie20-Mar-21 2:53 
GeneralRe: Absolutely Horrific Pin
Greg Utas18-Mar-21 8:17
mvaGreg Utas18-Mar-21 8:17 
GeneralRe: Absolutely Horrific Pin
obermd19-Mar-21 3:46
Memberobermd19-Mar-21 3:46 
GeneralRe: Absolutely Horrific Pin
Greg Utas19-Mar-21 4:26
mvaGreg Utas19-Mar-21 4:26 
GeneralRe: Absolutely Horrific Pin
honey the codewitch27-Mar-21 12:43
mvahoney the codewitch27-Mar-21 12:43 
GeneralRe: Absolutely Horrific Pin
Greg Utas27-Mar-21 14:27
mvaGreg Utas27-Mar-21 14:27 
GeneralRe: Absolutely Horrific Pin
honey the codewitch27-Mar-21 15:25
mvahoney the codewitch27-Mar-21 15:25 
GeneralRe: Absolutely Horrific Pin
Greg Utas27-Mar-21 15:47
mvaGreg Utas27-Mar-21 15:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.