Jump to content

Pachuca

Member
  • Posts

    900
  • Joined

  • Last visited

Reputation Activity

  1. Agree
    Pachuca reacted to Armakar in need help with multidimensional array in a class member C++   
    Make an initialization of the class method  as an object to the class.
  2. Agree
    Pachuca reacted to Shammikit in Hiding CMD window using C++   
    im writing a QT window application and im using popen to use CMD to run a command, get its output and display it. when running it open the cmd window for like a second  and goes out. the code works and i get my output in the label . I do not like seeing that cmd window pop up so i want to know if there's a method to hide the window when its running. Thank you
    #include <iostream> #include <stdexcept> #include <stdio.h> #include <string> std::string exec(const char* cmd) { char buffer[128]; std::string result = ""; FILE* pipe = popen(cmd, "r"); if (!pipe) throw std::runtime_error("popen() failed!"); try { while (!feof(pipe)) { if (fgets(buffer, 128, pipe) != NULL) result += buffer; } } catch (...) { pclose(pipe); throw; } pclose(pipe); return result; }  
  3. Informative
    Pachuca reacted to WereCatf in Hiding CMD window using C++   
    I believe you should use QProcess instead, it apparently shouldn't open up a window. Doesn't look like there's a way of stopping that from happening when using popen().
  4. Funny
    Pachuca reacted to FreshKD21 in No internet after win10 install   
    Thanks guys for helping! It was kind of easy to solve, i installed my radeon crimson driver from my HDD and suddenly my internet and everything else worked. I dont know why but radeon crimson software seems to cure anything  
  5. Informative
    Pachuca got a reaction from FreshKD21 in No internet after win10 install   
    same, haven't used MSI BIOS in a while. Try checking  LAN option ROM. You'll have to browse it yourself.
     
    edit: if you don't feel like dealing with this stuff the other option still is to switch to Ubuntu lol
  6. Funny
    Pachuca got a reaction from CrippledROBOT in About to De-lid my i5 8600k. Any Last Words/Thoughts?   
    High five!
  7. Informative
    Pachuca reacted to Ithanul in need help with GPU overclocking in Linux Ubuntu   
    Sometimes Ubuntu likes to be a pain about taking the settings.  I think one time I had to do it like twice or so for the OS to finally get the hint.
     
    This is what X Server looks like when OC is unlocked:

     
  8. Agree
    Pachuca reacted to Burusutazu in high temps on Linux ubuntu for laptop   
    TLP is realy great, I can get battery life pretty comparable to Windows on normal power settings with it. 
  9. Like
    Pachuca got a reaction from Burusutazu in high temps on Linux ubuntu for laptop   
    thanks, already found it online and installed. Temps just dropped by 20c. I'm running at 53c now and it's still going down.
  10. Like
    Pachuca reacted to Burusutazu in high temps on Linux ubuntu for laptop   
    Install the TLP package, by default Ubuntu does not really thermal manage for laptops.
  11. Informative
    Pachuca got a reaction from dual290x in high temps on Linux ubuntu for laptop   
    no this laptop is only a few months old and I don't have this heating problem in windows. I have both OS installed on here. 
  12. Like
    Pachuca reacted to Creed1 in high temps on Linux ubuntu for laptop   
    Found what I was looking for. This is called Bumblebee and its practically a Nvida Optimus Driver for Linux. It allows you to select what GPU you want to use via Command Line. Also please install Nvidia Drivers to make sure that Bumblebee will work properly. It may work or may not, but it should. 
     
    https://bumblebee-project.org/
     
     
     
     
     
  13. Informative
    Pachuca reacted to vanished in high temps on Linux ubuntu for laptop   
    With my laptop (2630QM + 6770M) depending on how I fiddle with it I can get it to lock in on either the iGPU or the 6770M, but yeah, switching, either live or even manually does not work.
  14. Informative
    Pachuca reacted to Creed1 in high temps on Linux ubuntu for laptop   
    Last I checked some linux distros didn't support Nvidia Optimus. Nvidia Optimus switches between your 1070 and iGpu. In windows Nvidia Optimus will select your iGPU when not playing games, but Linux will run your 1070 when not playing games due to lack of support of Nvidia Optimus. This is what it does with my Ghost Pro Laptop with an 970m. I will let you know if I find a solution. 
  15. Informative
    Pachuca reacted to colonel_mortis in LTT forums question - hiding my content in post from google search   
    The only thing we could do would be to remove your posts, and even that wouldn't actually stop the posts showing up when you searched for your name until several months later when Google reindexes the topic, just that clicking those links would go to a topic without your post, or to a 404 page if you were the original author of the topic. We would prefer not to do that because posts can help people in the future, but it is an option.
  16. Informative
    Pachuca reacted to Mira Yurizaki in LTT forums question - hiding my content in post from google search   
    Anything public is public to Google, and that's a site thing.
     
    There's a subforum that any posts you do is visible to you if you need a scratchpad.
  17. Like
    Pachuca reacted to PorkishPig in need advice to buy cheap server for learning   
    I would not suggest that you locally host a server, even if you are looking to work with physical hardware. In real world application, you'll probably never be hosting a website from a home server. I would suggest that you look into getting an OVH VPS instead. You can pick one up for $3.49/month and are great to start learning to use Linux. Using these minimalistic servers taught me the necessity of properly configured user accounts and security.
     
    Alternatively, a Raspberry PI 3 Model B with a Ubuntu Classic Server image will suit your basic web hosting needs.
  18. Informative
    Pachuca reacted to Jarsky in need advice to buy cheap server for learning   
    I'd just create it in Virtualbox or something similar. That way its also an x86/x64 architecture you're using as well rather than ARM. 
    You don't need server hardware to learn about how to use a server OS. 
  19. Like
    Pachuca reacted to Morgan MLGman in how to optimize Nvidia 4 gtx 1070   
    This video should help you understand the issues you're encountering and why:
     
  20. Informative
    Pachuca got a reaction from Zando_ in how to optimize Nvidia 4 gtx 1070   
    yes, OC doesn't help for clock speed, but it works if you increase the memory frequency. The card can also run at reduce power. About 80% power limit is safe. I've used 70-75% too, but noticed more crashes at those limits.
  21. Like
    Pachuca reacted to 79wjd in c++ how to check for duplicates in array   
    Even with the code he has that wouldn't work. He's setting arraynumber to be a random number, then setting arraycheck[j] to that same number (and then never iterating j), so arraycheck[0] will consist of a single int and it will match whatevers in arraynumbers[34]. What he should do is not use arrayCheck at all and use nested for loops if he doesn't want to sort the array. 
     
     
    for(int i=0; i<size(arrayNumber); i++}{      for(int j=i+1; j<size(arrayNumber); j++){             if(arrayNumber[i]==arrayNumber[j])                  // increment the count for that number                  // set arrayNumber[j] = NULL      } }  
     
    If I wasn't going to sort the array, then I'd use the numbers array, a unique numbers array, and a count array (or just a 2D array that's 35x2 where the first column would be the number and the second column the count). Set all of the numbers in my number array. Then iterate over the numbers array and add the first element to my unique array and initialize my count array to 1. Then iterate over the numbers array and for any duplicate of the i'th number I would increment the count in the count array (and set the value of the ith element in the numbers array to NULL so I wouldn't ever add it to my unique array. 
  22. Like
    Pachuca reacted to mariushm in c++ how to check for duplicates in array   
    It would seem simple to me.
     
    1. Have the array with the numbers
    2. Have a second array which holds the number of times the number at a particular position in the first array is found in the array
    3. Every time you detect the number a second time in the array, replace that number with some value you know for example -1 (since it seems you're using signed variables but only positive random numbers) and you'll skip searching for duplicates for that number when its time comes
     
    Here's something i wrote super quick in php the last two minutes, should be fairly easy to convert to c++  :
     
    <?php $numbercount = 49; // from 0 to 49 = 50 in total $numbers = array(); // holds the numbers $stats = array(); // holds the number of times each number is detected // generate some random numbers for ($i=0;$i<=$numbercount;$i++) { $numbers[$i] = mt_rand(0,100); // number between 0 and 100 inclusive $stats[$i] = 1; // this number is at least one in the array } // let's make sure there are some duplicates $numbers[15] = $numbers[3]; $numbers[20] = $numbers[5]; $numbers[21] = $numbers[5]; // just print the numbers for debugging purposes for ($i=0;$i<=$numbercount;$i++) { echo $numbers[$i]." "; } echo "\n"; $numbers_duplicate = 0; for ($i=0;$i<=$numbercount-1;$i++) { if ($numbers[$i]!==-1) { for ($j=$i+1;$j<=$numbercount;$j++) { if ($numbers[$i]==$numbers[$j]) { if ($stats[$i]==1) { $numbers_duplicate++; } $stats[$i]++; $numbers[$j] = -1; } } } } // show the array again to see the duplicate numbers gone for ($i=0;$i<=$numbercount;$i++) { echo $numbers[$i]." "; } echo "\n"; if ($numbers_duplicate > 0 ) { echo "There are $numbers_duplicate numbers to show: \n"; for ($i=0;$i<=$numbercount;$i++) { if ($stats[$i]>1) echo $numbers[$i].': '.$stats[$i]."\n"; } } else { echo "There are no duplicate numbers to show.\n"; } ?>  
    Example of output for this php code:
     
    "D:\Programs\php7\php.exe" "D:\Programs\php\file.php" 41 84 56 44 78 88 80 38 3 18 37 14 85 79 97 44 81 16 17 95 88 88 60 88 35 92 26 62 43 1 13 88 73 12 92 9 20 80 72 6 39 62 75 83 85 67 10 38 43 80 41 84 56 44 78 88 80 38 3 18 37 14 85 79 97 -1 81 16 17 95 -1 -1 60 -1 35 92 26 62 43 1 13 -1 73 12 -1 9 20 -1 72 6 39 -1 75 83 -1 67 10 -1 -1 -1 There are 8 numbers to show: 44: 2 88: 5 80: 3 38: 2 85: 2 92: 2 62: 2 43: 2 Done. (the 3rd and 5th number starting with 0 in array will be duplicates every time, because i said so in the code)
     
    Of course, this assumes you can mess with the array and replace some values with -1. But instead of replacing the value in that array, you could just change the value in stats array to -1 (or whatever)
     
     
  23. Like
    Pachuca reacted to cj09beira in How do I get my mined eth into my bank?   
    you could use coinbase they can do that for you, they are a online wallet that also can help you move eth to eur/dollars, you first though have to send a small transfer to your coinbase wallet for them to confirm the account as being yours they also want your full ID and pic
  24. Like
    Pachuca reacted to Intel HD Graphics in safe to buy used PSU?   
    Personally, i would not buy a used psu from an unknown sorce. The reason being is that it could be faulty and could fry your hardware. Make sure you know that is is working and get a demo on it on some other hardware before you use it
  25. Like
    Pachuca reacted to NoxiousOdor in safe to buy used PSU?   
    I have a used one and it has been great, if you are lucky you can get a good deal. For example I bought one off of someone on the forums here and it is a tier one and it is still under warranty I believe 
×