Jump to content

MrMG

Member
  • Posts

    35
  • Joined

  • Last visited

Awards

This user doesn't have any awards

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I googled it. Apparently the RAM is soldered on. So sadly that will not be an option.
  2. Hello everyone, my girlfriend and I watch netflix together via the teleparty extension for chrome and edge, and discord for communication. This used to work without many issues until recently (approximatly a week ago) when her laptop suddenly started to slow down significantly. Her device is a Surface Pro 4 laptop with 4 gb ram and 128gb ssd storage. Starting a movie in netflix takes forever and sometimes fails after which she gets an error message (Error codes: M7253-5101, M7399-1290, M7703-1003). Furthermore, the audio connection keeps dropping and the time between me saying something and her receiving it grows to like 5-10 seconds. The audio connection does work as long as she does nothing else with the device. We tried a bunch of things to fix it, but nothing worked: - Performed a Speedtest to check internet connection, internet speed should be more than enough and no other device in her home has these issues (15 Mbit/s down and 8 Mbit/s up) - Reduced the video quality - Switched to google meeting for communication - Switched browser (From Edge to Google Chome) - Tried it without the teleparty extension - Tried YouTube, also very slow and the browser shows a message that the tab froze and is not reacting (works without teleparty but still very slow) - Freshly reinstalled windows 10 on her machine - Checked for hardware bottlenecks but according to taskmanager nothing reaches 100% usage, so I assume the hardware should not be the problem (and everything worked flawlessly just a week ago) - ran sfc/scannow via the cmd And a bunch of smaller stuff I found on google. But nothing worked. At this point I am totally stumped and I have no idea what could be the cause. Maybe some video decoding issues, maybe an update that bricked something, maybe the wifi driver is broken, but I am not sure. She wants to avoid buying a new laptop because this one does everything she needs (except for video playback now). Does anyone have any Idea what else we could try?
  3. I am not an expert on CUDA or anything like that, but as far as I know CUDA is just an API to interact and work with the graphics card on your computer. Graphics cards are heavily optimized for calculations made with matrices or vectors and it can do them in parallel. This is of course very often needed when doing graphics calculations, but can also be used in other areas, like machine learning. Here some sources for further reading: https://www.infoworld.com/article/3299703/what-is-cuda-parallel-programming-for-gpus.html https://en.wikipedia.org/wiki/CUDA
  4. Alright, I think I see your problem. Processo filaDeProcesso[] = new Processo[numeroDeProcessos]; This is executed at the moment you create a ContadorDeProcessos object. That happens in the first line of this method: public void analisarTamanho() throws Exception { ContadorDeProcessos contadorNUmero = new ContadorDeProcessos(); //RIGHT HERE. That means that here your array is set to a length of 0 BufferedReader analisador = new BufferedReader(new FileReader("process.txt")); while (analisador.readLine() != null) { numeroDeProcessos++; } System.out.println("NUMERO DE PROCESSO" + numeroDeProcessos); contadorNUmero.setNumero(numeroDeProcessos); System.out.println("TESTE" + contadorNUmero.getNumero()); contadorNUmero.numero = numeroDeProcessos; analisador.close(); } that means your "contadorNUmero" object now has an array with the length 0. First of all. Is there a reason why ContadorDeProcessos extends Leitor? I don't think you should do that, because ContadorDeProcessos doesn't really have anything to do with the Leitor class (Which I assume means Reader. If you don't understand what inheritance is normally used for then I can explain you that if you want). Next you should be using a Constructor in ContadorDeProcessos, like this: public class ContadorDeProcessos { Leitor leitor = new Leitor(); int numero; Processo filaDeProcesso[]; //This is the Constructor. This is called whenever you write "new ContadorDeProcessos(someInteger);" public ContadorDeProcessos(int numero){ this.numero = numero; filaDeProcesso[] = new Processo[numero]; //Now the array has the size of numeroDeProcessos ] public int getNumero() { return numero; } public void setNumero(int numero) { this.numero = numero; } public void vernumero() { System.out.println(numero); } public void setProcessoNaFila(Processo process, int num) { filaDeProcesso[num] = process; } }  Next in your Leitor code: public class Leitor { int numeroDeProcessos = 0; int contadorDeprocesso = 0; Escalonador escalonador = new Escalonador(); public void analisarTamanho() throws Exception { BufferedReader analisador = new BufferedReader(new FileReader("process.txt")); while (analisador.readLine() != null) { numeroDeProcessos++; } ContadorDeProcessos contadorNUmero = new ContadorDeProcessos(numeroDeProcessos); //Here numeroDeProcessos has the correct value and will now pass this value to the contadorNUmero object. This line will call the Constructor of ContadorDeProcessos System.out.println("NUMERO DE PROCESSO" + numeroDeProcessos); System.out.println("TESTE" + contadorNUmero.getNumero()); analisador.close(); } Now everything should happen in the right order and your array should have the right size. Edit: The reason why it did not work before is because your array was created while numeroDeProcessos was still 0. Even if you change numeroDeProcessos afterwards, your array size stays the same once it is created. You just had to create the array once numeroDeProcessos had the right value. That was the mistake.
  5. Ok. What do you expect to happen and what is happening in your code? Do you get an error message?`Or is something not behaving how you want it to behave? Or do you not know how to proceed from here?
  6. Do you have any code that you could show? And I am not sure if I understood your problem correctly. You are trying to access an attribute which is stored in another Class?
  7. while(number >= 0) Remove this while-loop surrounding your for-loop and everything should work as intended* (see edit). What is happening currently is that as long your number is a positive number it just keeps running the for-loop. First 5 times, then 120 times and so on. Eventually the number gets so large that the number variable overflows and becomes a negative number, stopping the loop. Edit: You should also store the value of number in a different variable, else your for loop will probably never end as @WiiManic said.
  8. Consider using Debug.Log("some kind of debug message"); in your code to see what lines get executed and what does not. Check if the onCollisonEnter method gets called, then check what path your code takes. You could do the following for the BombBlock method: private void BombBlock() { GameObject[] allNormalBlocks = GameObject.FindGameObjectsWithTag("Breakable"); Debug.Log(allNormalBlocks.Length); foreach (GameObject obj in allNormalBlocks) { Debug.Log("NormalBlock in BombBlock is getting called!"); NormalBlock(); } Destroy(gameObject); }
  9. Well yes, the first time it goes through the loop a becomes 2. But now a is 2 and b is 7. Both are bigger than 0 so the loop executes a second time. Here is your loop condition: while(a > 0 && b > 0) Now b is bigger than a so the else block gets executed which calculates b = b - a; which makes b equal 5. But a = 2 and b = 5 so the loop gets executed another time, now a = 2 and b = 3 . Now it gets executed another time a = 2 b = 1. Now a is bigger than b so a = a - b; which means now a = 1 and then b = 1 and both are still bigger than 0 so we execute the code in the while block another time which calculates b = b - a; which leads to a = 1 and b = 0. Now b is NOT bigger than 0 so the while loop ends and we go to the following if statement: if(b == 0) { JOptionPane.showMessageDialog(null, "a : " + a); } else { JOptionPane.showMessageDialog(null, "b: " + b); } because b == 0 the message dialog shows you the value of a, which is 1. I think you might be forgetting about the while loop, and that's what's confusing you.
  10. Are .exe files not all encoded in machinecode? I don't think that has anything to do with C#. @RahulDesai1999 I think you can use any programming language you want for this. I do not know a lot about this kind of stuff but I think you need to find out how to send data from one device in your local network to another. Just choose the programming language you are most comfortable with and google "--here your programming language-- local network communication" or something like that. From experience I know that some languages make stuff like this very easy, like python as an example. Just keep in mind that you will need a separate program on your phone than on your pc. Maybe if you use Java you could just copy your code for the pc application to your android application with android studio. But the communication should be programming language independent (I think).
  11. Because that is what your algorithm does? What output are you expecting here? And what are you trying to calculate with this program?
  12. Sure. You could do the following: switch(inputNumber) { case 1: case 2: case 3: quarter = "1"; break; case 4: case 5: case 6: quarter = "2"; break; case 7: case 8: case 9: quarter ="3"; break; case 10: case 11: case 12: quarter = "4"; break; default: JOptionPane.showMessageDialog(null, "Wrong input!"); }
  13. Yes, I changed the "|| > 12" to "|| inputNumber > 12" . The reason you are not getting any pop up's when you write "abc" is because of this line: inputNumber = Integer.parseInt(input); If input is not a number but an actual text, then parseInt function will throw an exception which will make your program stop prematurely. If you don't want that, then you could try to work with try-catch blocks.
  14. If the user does not enter a number between 1 and 12, then what will happen is that the default case in your switch block will run, and the other cases won't. That means that the text stored in quarter is just "". Next a message dialog gets created, but quarter still has only "" stored. That's why you get "Quarter: " as the text of that dialog. You could try the following: if(!quarter.equals("")){ JOptionPane.showMessageDialog(null, "Quarter: " + quarter); } This should make the message dialog only pop up if the text in quarter is not "" . And FYI whenever you compare strings always use string1.equals(string2). The == operator will not work with Strings. And also: if(inputNumber < 1 || > 12) { JOptionPane.showMessageDialog(null, "Wrong input!"); } Are you sure it works? I feel like it should look like this: if(inputNumber < 1 || inputNumber > 12) { JOptionPane.showMessageDialog(null, "Wrong input!"); }
  15. The problem is that your default case in the switch block does not assign anything to quarter, but instead stores "wrong input!" in output. You either have to assign something to quarter in the default case or you do something like this: String input, output, quarter; int inputNumber; input = JOptionPane.showInputDialog(null, "put in a number (1-12)."); inputNumber = Integer.parseInt(input); quarter = ""; switch(inputNumber) { case 1: case 2: case 3: quarter = "1"; break; case 4: case 5: case 6: quarter = "2"; break; case 7: case 8: case 9: quarter ="3"; break; case 10: case 11: case 12: quarter = "4"; break; default: output = "wrong input!"; } JOptionPane.showMessageDialog(null, "Quarter: " + quarter); Else what could happen is that the user puts in a number bigger than 12 and your program ends up trying to show a dialog with the value of quarter, but quarter never got a value assigned.
×