Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

fordy_rounds

Member
  • Content Count

    200
  • Joined

  • Last visited

Reputation Activity

  1. Like
    fordy_rounds got a reaction from Murasaki in Need help finding software for a file   
    Thanks! AOMEI worked, and I can browse through the files now. ūüėĄ
  2. Agree
    fordy_rounds got a reaction from Satan666 in RAM frequency not 3200mhz   
    Yep. Go into bios, find the setting for either XMP or DOCP (two names for basically the same thing). Should be an XMP profile for 3200 listed.
  3. Agree
    fordy_rounds got a reaction from Zando Bob in RAM frequency not 3200mhz   
    Yep. Go into bios, find the setting for either XMP or DOCP (two names for basically the same thing). Should be an XMP profile for 3200 listed.
  4. Agree
    fordy_rounds got a reaction from Yatharth Shah in Function in C - Why "malloc( )" required for creating char *   
    C doesn't handle strings well, as you're finding out. Both of these functions have errors, just the first is run-time and the second is compile-time.
    In the first version, you have 
    char * out = malloc(0); which might work with your compiler, but won't necessarily work with any C compiler. (Some compilers return a NULL pointer for malloc(0), which means that you'll get a segmentation fault when you use this in the sprintf call.) The problem is that you're not actually allocating any space here; technically, even though your compiler returns an apparently valid pointer, any use of it (such as in sprintf) is a buffer overflow error. (If you're malloc-ing anything else, you might overwrite it and cause errors.) To fix this, figure out how many chars you'll actually need (some math from the string length will get you there) and malloc that number. (i.e., if strlen returns a two-digit number, you need 6 chars [2 for the first number, 1 for the /, 2 for the second number, and 1 for the null char at the end]; if it's three-digits you need 8, etc.)
    The other issue here is that by malloc-ing a char* and returning it from the function, you're putting the burden of free-ing it onto the calling code, and if that doesn't happen, you could get a memory leak.
     
    Version 2, without the malloc, doesn't work because the pointer is pointing to a read-only string literal. Thus, when you try to change it (with sprintf), there is an error. A fix here is to use the fact that arrays and pointers are closely related, and use 
    char out[16]; This will most probably allocate more characters than you actually need, but that's ok, it's better to have too many than too few. (From my math above, this allows up to a 7-digit number of chars in the original string, or up to 9,999,999 characters. You could adjust the 16 to allow whatever number size you think you'll need; however, it has to be set at compile-time, and cannot by dynamic. If you want it dynamic, you have to malloc it.) This allocates the space onto the stack instead of the heap, which means that it'll automatically be freed without a memory leak.
     
    On a side note, once you know how long "out" can be (whether malloc-ed or statically assigned), you should use snprintf instead of sprintf to ensure there's no buffer overflow. (Example: if I use malloc(4), then try to print "1/10", that's 5 characters, and I've overflowed the allocated space. sprintf will let you do this; snprintf takes the 4 as an argument and will only allow up to 4 chars.)
     
    In summary, here's your answers:
    1) Why does the pointer "out" need to be malloced?
        It doesn't have to be, but that's the only way to get a dynamic array length. If you're ok with a static length, you can use e.g. char out[10]; instead.
    2) Is there a way to write this program without using malloc( ) ?
        Yes, but only with a static array length, as above.
    3) If malloc is used inside the function, how can I free the pointer "out"?
        - I read you should always free any memory allocated with malloc( )
        Yes, that's correct. Since you're returning the pointer, the calling function assumes the responsibility for freeing it. This is messy, and is often the cause of memory leaks. In this case, it might look something like:
    char* output = printerError(myString); // do something else with 'output' free(output);  
  5. Informative
    fordy_rounds got a reaction from JoostinOnline in Function in C - Why "malloc( )" required for creating char *   
    C doesn't handle strings well, as you're finding out. Both of these functions have errors, just the first is run-time and the second is compile-time.
    In the first version, you have 
    char * out = malloc(0); which might work with your compiler, but won't necessarily work with any C compiler. (Some compilers return a NULL pointer for malloc(0), which means that you'll get a segmentation fault when you use this in the sprintf call.) The problem is that you're not actually allocating any space here; technically, even though your compiler returns an apparently valid pointer, any use of it (such as in sprintf) is a buffer overflow error. (If you're malloc-ing anything else, you might overwrite it and cause errors.) To fix this, figure out how many chars you'll actually need (some math from the string length will get you there) and malloc that number. (i.e., if strlen returns a two-digit number, you need 6 chars [2 for the first number, 1 for the /, 2 for the second number, and 1 for the null char at the end]; if it's three-digits you need 8, etc.)
    The other issue here is that by malloc-ing a char* and returning it from the function, you're putting the burden of free-ing it onto the calling code, and if that doesn't happen, you could get a memory leak.
     
    Version 2, without the malloc, doesn't work because the pointer is pointing to a read-only string literal. Thus, when you try to change it (with sprintf), there is an error. A fix here is to use the fact that arrays and pointers are closely related, and use 
    char out[16]; This will most probably allocate more characters than you actually need, but that's ok, it's better to have too many than too few. (From my math above, this allows up to a 7-digit number of chars in the original string, or up to 9,999,999 characters. You could adjust the 16 to allow whatever number size you think you'll need; however, it has to be set at compile-time, and cannot by dynamic. If you want it dynamic, you have to malloc it.) This allocates the space onto the stack instead of the heap, which means that it'll automatically be freed without a memory leak.
     
    On a side note, once you know how long "out" can be (whether malloc-ed or statically assigned), you should use snprintf instead of sprintf to ensure there's no buffer overflow. (Example: if I use malloc(4), then try to print "1/10", that's 5 characters, and I've overflowed the allocated space. sprintf will let you do this; snprintf takes the 4 as an argument and will only allow up to 4 chars.)
     
    In summary, here's your answers:
    1) Why does the pointer "out" need to be malloced?
        It doesn't have to be, but that's the only way to get a dynamic array length. If you're ok with a static length, you can use e.g. char out[10]; instead.
    2) Is there a way to write this program without using malloc( ) ?
        Yes, but only with a static array length, as above.
    3) If malloc is used inside the function, how can I free the pointer "out"?
        - I read you should always free any memory allocated with malloc( )
        Yes, that's correct. Since you're returning the pointer, the calling function assumes the responsibility for freeing it. This is messy, and is often the cause of memory leaks. In this case, it might look something like:
    char* output = printerError(myString); // do something else with 'output' free(output);  
  6. Like
    fordy_rounds got a reaction from Ross Siggers in SFF2: Electric Bugaloo... The PlayStation 2 build!   
    Please, don't let one hater get you down. I loved the Dreamcast build, and I'm intently watching this one too, dreaming that someday I might do something so ambitious....
  7. Agree
    fordy_rounds got a reaction from DJ46 in SFF2: Electric Bugaloo... The PlayStation 2 build!   
    Please, don't let one hater get you down. I loved the Dreamcast build, and I'm intently watching this one too, dreaming that someday I might do something so ambitious....
  8. Like
    fordy_rounds reacted to Agonizel in XMAS gift & a gooey mess: HP Pavillion for my little sister   
    Hi community,

    This post is more about emotional sharing than anything else really. So I'm a psych major student, I work on the side at a fast food chain - pretty hard but the pay is good (12‚ā¨/h).
    I like spoiling my sister for Xmas and my mom doesn't have much money.
    This year I decided to give my 14y/o sis her first very own Laptop! 
     
    So I get myself an absolute deal on Facebook Marketplace:¬†A 2019 HP Pavillion i7 10th gen, 8GB of RAM, 512gb SSD, 1080p IPS 15.6" - backlit keyboard, all sorts of IO connections for 465‚ā¨! It has 1 year warranty left.
    In addition, the guy includes a laptop bag and a M220 wireless mouse, pretty cool right?

    Thing is, the fan goes WWOOOOOSSHHHHHH on startup and it just doesn't stop. Pretty annoying. I download CPU FAN: 55-75¬įC on idle: noice.¬†
    By the way, the seller had this ABSOLUTE UNIT of a Cat. It meowed, walked and looked like the Dwayne Johnsons of cats. That cat must've been the mayor of the town's cats.
    Anyway, I tell myself the reason why the fan struggles so much is that there's too many cat hair or dust in the laptop, maybe.

    So I open it up: spotless. Damn. I spray around with my little airbottle compressor thingy I usually use for my keyboard. Maybe they forgot to apply thermal paste? So I unscrew the cooler and boi...
    There was a litteral (but figurative) OCEAN of thermal paste; like the verge pc^10. Holy moly, no wonder the fan spins like an autistic child's fidget spinner, the heat just gets trapped into that swamp of thermal paste.
    So, I take out the isopropylic alcohol, wash the damn thing and I apply that sweet MX4 at corresponding dosage. Close everything up: boom 28¬įC idle, silent as hell.

    I was so happy, so proud. I'm stoked to see my sis' reaction to that prreeeeeemiuuuum Laptop I got her.
    465‚ā¨ for a one-year-old +1000‚ā¨ Laptop, damn today was a good day!

    Thanks for reading!

    PS: That cat was so big, jesus 
  9. Agree
    fordy_rounds got a reaction from paddy-stone in Motherboards/Adapters with A or E key m.2 for Intel AX 200?   
    Motherboards that come with wifi usually have it installed via an A/E slot (including newer laptops; older laptops used mPCIe). So this is, I think, meant more as an upgrade than as a new component. You can get x1->A/E adapters, but they usually come as WiFi adapters (i.e., with the the WiFi card already slotted in), so again, this would be an upgrade.
    Honestly, it would probably be cheaper just to get an AX200 PCIe card than to get this + an adapter.
  10. Agree
    fordy_rounds got a reaction from Gegger in On the News! Folding@home exascale supercomputer finds potential targets for COVID-19 cure   
    A solid portion of this is you, @Den-Fi. Nearly a billion points is a lot of progress toward killing Covid. Thanks!
  11. Agree
    fordy_rounds got a reaction from FakeNSA in On the News! Folding@home exascale supercomputer finds potential targets for COVID-19 cure   
    A solid portion of this is you, @Den-Fi. Nearly a billion points is a lot of progress toward killing Covid. Thanks!
  12. Agree
    fordy_rounds got a reaction from kelvinhall05 in On the News! Folding@home exascale supercomputer finds potential targets for COVID-19 cure   
    A solid portion of this is you, @Den-Fi. Nearly a billion points is a lot of progress toward killing Covid. Thanks!
  13. Like
    fordy_rounds got a reaction from kelvinhall05 in What should I do,   
    Yes, it is. It looks like most/all of these are equality of int or char types, so they would be better implemented as switch statements. (The inequalities (that's <, <=, >, or >= ) need to be if/else's still.)
     
    And a few other notes, OP: short variable names don't make your code more efficient. Help us, and yourself, with some real names (i.e. use employment_status or employmentStatus rather than es). I don't have any idea what gi, ba, ot, etc, mean, and if you set this down and come back to it in two weeks, you probably won't, either.
     
    Statements like if(es=='r||R') don't work the way you want it to; in fact, it won't even compile. Use if(toUpper(es)=='R') instead (though, as above, switch(toUpper(es)) is even better).
     
    Also, for user-friendliness, sentence-case your outputs so we don't feel like your program is screaming at us.
     
    That's about all the help I can give without more specific questions.
  14. Agree
    fordy_rounds got a reaction from Lurick in Why is WIFI and BLUETOOTH not working after installing the card?   
    Even if it didn't come with a driver CD, check the manufacturer's website to see if they need to be downloaded.
  15. Like
    fordy_rounds reacted to MaximumBubbleMods in Spirit of Motion - Scratchbuild Log   
    The finer details continue
     



     



     



     

  16. Informative
    fordy_rounds got a reaction from nE0n1nja in What's the fastest way to transfer data from a microSD card to a PC   
    Keep in mind that at some point you'll be limited by the microSD card's speeds rather than the USB speeds. Right now, as you say, you have a USB 3.0 reader and port; that limits you to (theoretically) 500MB/s (it's ~1/10, not 1/8, of the spec'd 5Gb/s, because there's overhead, parity bits, etc.) That's already faster than all but a UHS-III card (UHS-II caps out at 312 MB/s). If you have a UHS-III card, you could see a minor improvement if you upgrade to a 3.1 reader and port, which is 1.2GB/s, but not much, since UHS-III caps out at 624MB/s. Not sure that the speed increase is worth the cost, though. From 312 to 500, sure, but from 500 to 624, maybe not.
     
    Also keep in mind that you're transferring to an HDD. That's going to limit your speed more than anything else.... Most HDDs cap out at around 100MB/s, which is equivalent to a UHS-I SD card.
     
    When it comes to file transfer speeds, remember: the slowest speed is always your determining factor. If your microSD card can do 624MB/s, the reader can do 500, the port can do 500, the port/cable going to the HDD can do 500, and the HDD can do 100... you'll be doing 100MB/s at most.
  17. Agree
    fordy_rounds got a reaction from SupaKomputa in What's the fastest way to transfer data from a microSD card to a PC   
    Keep in mind that at some point you'll be limited by the microSD card's speeds rather than the USB speeds. Right now, as you say, you have a USB 3.0 reader and port; that limits you to (theoretically) 500MB/s (it's ~1/10, not 1/8, of the spec'd 5Gb/s, because there's overhead, parity bits, etc.) That's already faster than all but a UHS-III card (UHS-II caps out at 312 MB/s). If you have a UHS-III card, you could see a minor improvement if you upgrade to a 3.1 reader and port, which is 1.2GB/s, but not much, since UHS-III caps out at 624MB/s. Not sure that the speed increase is worth the cost, though. From 312 to 500, sure, but from 500 to 624, maybe not.
     
    Also keep in mind that you're transferring to an HDD. That's going to limit your speed more than anything else.... Most HDDs cap out at around 100MB/s, which is equivalent to a UHS-I SD card.
     
    When it comes to file transfer speeds, remember: the slowest speed is always your determining factor. If your microSD card can do 624MB/s, the reader can do 500, the port can do 500, the port/cable going to the HDD can do 500, and the HDD can do 100... you'll be doing 100MB/s at most.
  18. Informative
    fordy_rounds got a reaction from HanZie82 in What's the fastest way to transfer data from a microSD card to a PC   
    Keep in mind that at some point you'll be limited by the microSD card's speeds rather than the USB speeds. Right now, as you say, you have a USB 3.0 reader and port; that limits you to (theoretically) 500MB/s (it's ~1/10, not 1/8, of the spec'd 5Gb/s, because there's overhead, parity bits, etc.) That's already faster than all but a UHS-III card (UHS-II caps out at 312 MB/s). If you have a UHS-III card, you could see a minor improvement if you upgrade to a 3.1 reader and port, which is 1.2GB/s, but not much, since UHS-III caps out at 624MB/s. Not sure that the speed increase is worth the cost, though. From 312 to 500, sure, but from 500 to 624, maybe not.
     
    Also keep in mind that you're transferring to an HDD. That's going to limit your speed more than anything else.... Most HDDs cap out at around 100MB/s, which is equivalent to a UHS-I SD card.
     
    When it comes to file transfer speeds, remember: the slowest speed is always your determining factor. If your microSD card can do 624MB/s, the reader can do 500, the port can do 500, the port/cable going to the HDD can do 500, and the HDD can do 100... you'll be doing 100MB/s at most.
  19. Informative
    fordy_rounds got a reaction from dfsgsfa in gpu at "PCIe x 16 2.0 @ 16 x 2.0"   
    Exactly. I looked up both the chipset and CPU, and both of them only support 2.0. Thus, OP, your card is showing up as PCIe 2.0 because it's connected via 2.0, even though the card itself is still 3.0-capable.
    Much like USB, or SATA, or other backwards-compatible standards, the lowest specification wins.
  20. Like
    fordy_rounds got a reaction from BiG StroOnZ in My "Gradual Upgrade" Build   
    New update!!!!
     
    I've done some pretty good upgrades this month.
     
    First, I bought some of these fans. I installed them, and..... they didn't make much difference. Things were still running pretty hot.

    Nice white-framed case fans. Too bad they didn't affect the temperature much.
     
    The eagle-eyed among you may also notice that the WD SSD got swapped out for a PNY. I bought the PNY for a laptop upgrade, but ultimately decided I liked it better aesthetically in this case (aesthetics don't matter in the laptop), so I swapped them out, and the WD went into the laptop.
     
    I thought about it, and I realized that, after paying $40 for these fans and another $40 or more for a good air cooler, I'd be $80+ into cooling; additionally, my choices of air cooler were limited by the case's 154mm specification for max cooler height. Most of the really good tower coolers are taller than that. But hey, I realized, for $80+ I can get into a cheap-ish AIO. So I did. I returned the white fans and caught a good sale on Cooler Master's ML240L ($65, plus there's a rebate, so the eventual cost is only $55; less than I'd have paid for a good air cooler and fans). I also got a matching exhaust fan for the rear for $12. Thus:

    Sorry it's a little washed out‚ÄĒthat RGB is super bright, and hard to properly photograph. (See note below.) It's sexier in person.
     
    Yes, I know, I know, I still need to double the RAM to get dual-channel. But I've gotten into Folding@Home, and just didn't have the thermal headroom to properly fold on the CPU. I was at 80+ folding on only 5 threads; now I fold on 10 (leaving a couple for GPU coordination and other things) and I've been pretty steady at 70C.
     
    I learned, with both sets of RGB, that my MB doesn't support dimming, apparently, each color is either on full blast or off. This limits me to only 8 colors (blue, red, green, purple, yellow, cyan, white, black). It also only supports static lighting, no automatic color-changing. I'm ok with this, though. I've set it to red in the BIOS and blue through Fusion, so it boots and red and turns blue when Windows loads Fusion, then I just leave it blue while running (although I typically turn the RGB off at night).
     
    And one last upgrade: I got tired of the finickiness of my USB Wi-Fi adapter, and added in a PCI-E Wi-Fi adapter. (I had an Amazon gift card, and my RAM is only available from Newegg, so I got Wi-Fi instead of RAM.)

    It's pretty snug there in between the GPU and PSU, but that's the only slot available. I now have no room for expansion. But that's ok, as I also have no plans for further expansions. What else do folks use PCI-E slots for, anyway?
     
    There's still room for improvement on cable management, but with Folding Month going on, I didn't want to leave it powered off for too long while I did the AIO and Wi-Fi upgrades. I'll improve it and add RAM after Folding Month.
  21. Like
    fordy_rounds reacted to Temporary11 in My "Gradual Upgrade" Build   
    Looks great. I am a fan of the white and blue aesthetic and think it is a nice touch to have it red in bios so that it transitions into blue when fully booted. That was very creative.
     
    Well done!
  22. Agree
    fordy_rounds got a reaction from Mateyyy in Wraith stealth cooler screw go forever   
    Sounds like maybe it stripped. (This can sometimes happen if a crossthreaded (i.e. put in at the wrong angle) gets driven in, it just strips out the threads so then it'll keep turning because it's just a screw in a hole, not a screw in a threaded hole.)
    If the cooler feels secure and your temps are ok, it might be ok. Otherwise, I'd recommend replacing both the cooler and the backplate it screws into. (Wraith stealths are cheap online, because a lot of people replace them with after-market coolers; the backplate might be harder to find, though.)
  23. Agree
    fordy_rounds reacted to minibois in GPU won't fit in the slot completely   
    Take out the card and try installing it, by first starting with the left side and then inserting the right side after.
    Make sure the metal PCIE on the card's left side is properly going into the case, which I suspect is going wrong now.
  24. Agree
    fordy_rounds reacted to boggy77 in GPU won't fit in the slot completely   
    also give it a clean
  25. Agree
    fordy_rounds reacted to Collin_S in LTT Official Folding Month 2020!!!   
    @GOTSpectrum I have a suggestion for future days. Could you possibly put each day into a new page in the same google sheet? That way, it might be easier to compare between days, especially if we want to put a graph together.
√ó