Jump to content

mikat

Member
  • Posts

    6,405
  • Joined

  • Last visited

Reputation Activity

  1. Agree
    mikat reacted to wasab in What happens in the first step of this program flow-React-useState hook?   
    Nope, map runs but its callback isn't. Doing a map on zero length arrary is similar to a for loop on an array with length of 0.
    for(let i = 0; i< arr.length; i++)  
    Map will just returns an empty array as well because nothing is there to map. 
    btw, if you want to see what the variables is initially, console.log these variables. you can set breakpoint using the chrome debugger as well althgough i wouldnt recommend doing it on a react project. A lot of the code are asynchronous so debugger jumps all over the place and somethimes the code you see are all minify nonsense which isnt helpful. 
  2. Agree
    mikat got a reaction from RockSolid1106 in How to convert if to switch statement in JavaScript? (beginner JavaScript)   
    The formatting is off (not a problem atm but it's better to start right), you replaced the response assignments with console.log and the machine is off, your console.log's were not ending up in the paragraph but in the console, and because the machine was off only the first "an error has occured" message was being logged to the console.
     
    let response; let score = 75; let machineActive = true; switch (machineActive) { case score <= 0 || score >= 100: response = 'This is not possible, an error has occurred.'; break; case score >= 0 && score <= 19: response = 'That was a terrible score — total fail!'; break; case score >= 20 && score < 39: response = 'You did a passable job, not bad!'; break; case score >= 40 && score < 69: response = 'You did a passable job, not bad!'; break; case score >= 70 && score < 89: response = "That's a great score, you really know your stuff."; break; case score >= 90 && score < 100: response = 'What an amazing score! Did you cheat? Are you for real?'; break; // include as many cases as you like default: response = 'The machine is turned off. Turn it on to process your score.'; } // Don't edit the code below here! section.innerHTML = ' '; let para1 = document.createElement('p'); let para2 = document.createElement('p'); para1.textContent = `Your score is ${ score }.`; para2.textContent = response; section.appendChild(para1); section.appendChild(para2);  
  3. Like
    mikat got a reaction from Wictorian in [PYTHON] Print out the content of a disk   
    You could use os.listdir() and os.stat() if you wanted to do it yourself:
    https://docs.python.org/3/library/os.html#os.listdir
    https://docs.python.org/3/library/os.html#os.stat
    (os.listdir was already in the link sent earlier but you did not reply to that one)
  4. Informative
    mikat got a reaction from c0d0ps in How to convert if to switch statement in JavaScript? (beginner JavaScript)   
    You'll need to add "break" statements after each of your response assignments, as it is doing what you want it to do but then also executing the default statement, setting your response to the default one. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch#what_happens_if_i_forgot_a_break
  5. Like
    mikat got a reaction from Origami Cactus in Low clockspeed on Threadripper 1920X during single threaded workload   
    Oh yeah that's it, using `grep "MHz" /proc/cpuinfo` I can see it is working, thank you 😄
     
    Didn't realize linux handled this differently than windows, very used to just using windows task manager.
    Every 0,2s: grep "MHz" /proc/cpuinfo cpu MHz : 2163.245 cpu MHz : 2164.101 cpu MHz : 2119.335 cpu MHz : 3941.924 <-- my program :) cpu MHz : 2083.296 cpu MHz : 2068.435 cpu MHz : 2167.127 cpu MHz : 2150.844 cpu MHz : 2164.694 cpu MHz : 2164.620 cpu MHz : 2173.278 cpu MHz : 2162.330 cpu MHz : 2147.448 cpu MHz : 2469.906 cpu MHz : 2156.120 cpu MHz : 3777.464 cpu MHz : 2074.508 cpu MHz : 2096.003 cpu MHz : 2162.750 cpu MHz : 2151.859 cpu MHz : 2168.285 cpu MHz : 2174.605 cpu MHz : 2167.663 cpu MHz : 2166.842  
  6. Funny
    mikat got a reaction from WhitetailAni in Testing the FPS of our eyes   
    so console gamers game so much that they're so tired that they can only see 24 FPS?
  7. Agree
    mikat reacted to pythonmegapixel in HTML/CSS - How can I align something to the centre with things either side?   
    That worked excellently, thanks. However, in case anyone comes across this and wants to do the same - it's necessary to specify "margin: auto;" on the left, middle and right divs; before I did that they were ever so slightly misaligned vertically, probably because of different padding amounts.
     
     
    I found that "auto 1fr auto" worked better - this is because "1fr auto 1fr" had the irritating side-effect of not expanding the middle div enough, causing a large gap between each edge and the first button, which "auto 1fr auto" didn't.
  8. Like
    mikat reacted to Downkey in Upgrading to 11th Gen   
    Well, once the reviews are out, then you will get your answer. If the performance jump is small then I would just get the 10400f
  9. Like
    mikat got a reaction from Jobgh in HTML/CSS - How can I align something to the centre with things either side?   
    Pretty good solution, but for smaller screens the grid could be improved to 1fr auto 1fr so the middle div isn't always as large as the outer 2 divs
  10. Informative
    mikat got a reaction from JoostinOnline in Computer shuts down in gpu intensive games/benchmarks   
    I just wanted to say that we figured it out whilst I was writing this but I didn't wanna throw this post away so other people in the future could benefit from our findings: the included fans in the meshify C only go up to 1200 rpm and we had to max them out all the time to get acceptable southbridge (chipset) temperatures, they were going up steadily while running furmark, gonna order him a noctua NF-A14 to fix the problem and get him some more airflow
  11. Agree
    mikat got a reaction from Letgomyleghoe in Follow Linus Media Group   
    try making a new thread, not a lot of people look at this thread
  12. Informative
    mikat got a reaction from amdorintel in Follow Linus Media Group   
    No, Linus explained it on wan show, he's the CEO of both companies but floatplane isn't owned by LMG
  13. Informative
    mikat got a reaction from Lowfat_Cheese in 3D Animation Student Building a >1000USD Tower for Student Films   
    I'd wait til you have all the money and spend it all at once, you never know when new hardware comes to market
  14. Like
    mikat got a reaction from Dat Guy in Processing Power Recommended for Programming   
    *echo
  15. Informative
    mikat got a reaction from Lowfat_Cheese in Does RTX allow for Faster Ray-Traced Renders in Maya/Blender over Non-RTX?   
    Blender doesn't have support yet but it seems like maya is getting support soon:
    I'd wait for the release before buying a new gpu (we don't know how much better an rtx gpu is vs a normal gpu, this could just be a gpu thing)
  16. Agree
    mikat reacted to BrinkGG in LTT Server Rack   
    If it was a technical question about configuration of their servers I'd be more curious of the context for why you ask, but since it's literally about a metal box you have no worries. 
    If you do end up with an awesome looking rack setup though, feel free to share it in the Battle Stations and Build Setups thread! 
    I personally love clean server rack setups. 
     
  17. Agree
    mikat reacted to Dat Guy in Processing Power Recommended for Programming   
    Vim is bloatware. Try ed.
  18. Agree
    mikat reacted to DevBlox in Processing Power Recommended for Programming   
    Well, yes, you don't need a good monitor, but that sure as hell is nice. I personally love screen real-estate and crisp text, can get around bigger IDE's without constantly pushing things around to see the widget or screen I need. When I had a small screen I just got some vi plugins and worked on that, but eventually I needed more features on bigger projects. I'll get around to a 21:9 someday, code on one side, library reference on another, perfect.
  19. Like
    mikat got a reaction from Den15 in Processing Power Recommended for Programming   
    well yeah but only if you know beforehand what you're gonna be running your code on, you have to make a seperate binary for every architecture  
  20. Like
    mikat got a reaction from Den15 in Processing Power Recommended for Programming   
    @Den15 Nice, Linux is great, you don't have to worry about getting the crappy version of docker then
    As for monitors I'd not recommend anything under 1440p, 1080p is really limiting from my experience (laptop for school) and it's always a relief coming home to 2x4k monitors
  21. Like
    mikat got a reaction from Den15 in Processing Power Recommended for Programming   
    Not much, but I can say that CPUs with higher clock speeds are nice and it's definitely handy to grab windows 10 pro, the clockspeed is because many compilers for web development only use one thread if you're only compiling one final js file. Windows 10 pro is for when you want to do virtualization with hyper-v and testing out docker images on your computer (the version for windows 10 home is awful )
    You should be fine with an cpu equal to or better than the i5-8250u. I'd get 16gb of ram for virtual machines and chrome tabs
    That is if you're shopping for a laptop, if you're shopping for a desktop, I'd get either the i3-9300 or the i5-9500 (i7's will be slightly better but not by a lot, perf/$ falls of a cliff at that point for web development)
  22. Agree
    mikat reacted to TheBean in Linus can we get YouTube exclusive videos   
    never going to happen. linus outright said that anybody can do whatever the hell they want to do on CSF, and use any ad money from there. nobody cares about that channel. 
    >1 video per day is not going to happen. the team is already working full time to get 1/day. they might do it after this next wave of recruitment but no commitments. floatplane is mainly meant as an extra revenue source and LTT spreading out their wings for stability. (literally why it is called floatplane)
  23. Agree
    mikat got a reaction from Fasauceome in Cloud Computing and the Patriot Act   
    yeah I come to the forum to read things in text not videos, sorry
  24. Like
    mikat got a reaction from Zeketo in New NVENC(2gpu one for streaming one for gaming?)   
    If you use NVENC you will not have lower FPS since it's a seperate part of the gpu that does the encoding from the part that does the gaming
  25. Funny
×