Jump to content

Igor Perrotta

Member
  • Posts

    136
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Igor Perrotta got a reaction from AbydosOne in Octave Not Opening image   
    Wow, it was the special characters, thank you!
    Now it works and i know in the future!
     
  2. Like
    Igor Perrotta reacted to MrMG in -JAVA- Creating an array using a variable from another class   
    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.
  3. Like
    Igor Perrotta reacted to Megah3rtz in A cheap card that can beat my R9 280X   
    RX 580/1060 6gb are great, an RX 470 would be the cheapest model right now while still being a good upgrade. 
  4. Like
    Igor Perrotta reacted to Damascus in A cheap card that can beat my R9 280X   
    It would be a good upgrade, a gtx 1050 ti is on par with a r9 290 and a 1060 is a big upgrade over that
  5. Informative
    Igor Perrotta got a reaction from yathis in A cheap card that can beat my R9 280X   
    Woah, i had no idea that a 1050 could beat a 290, now i'm thinking about selling my desktop and getting a notebook with a 1050 on it
  6. Like
    Igor Perrotta got a reaction from matthgriff.mg in Good antivirus?   
    Hey guys, so i just installed windows and i'm looking for a good antivirus, what do you guys recommend?
     
    Thanks in advance!!!
  7. Like
    Igor Perrotta got a reaction from Nup in AMD donwsampling?   
    WHY YOU DO THIS AMD D: 
    WHY NOT MY 280X 
  8. Like
    Igor Perrotta got a reaction from Jumper118 in A MSI 280x can do crossfire with?   
  9. Like
    Igor Perrotta got a reaction from Rag in I need help chossing the right GPU for my system.   
    http://www.coolermaster.outervision.com/PSUEngine2 I made a prevision about your system not sure if thats what you have but take a look
  10. Like
    Igor Perrotta got a reaction from Rag in I need help chossing the right GPU for my system.   
    Video Card: Asus Radeon R7 240 2GB Video Card  ($54.99 @ Micro Center) 
    Power Supply: Corsair Builder 430W 80+ Bronze Certified ATX Power Supply  ($19.99 @ Newegg) 
    Total: $74.98
  11. Like
    Igor Perrotta got a reaction from Rag in I need help chossing the right GPU for my system.   
    And chech out deletive LINKS A 430W POWER SUPPLY 80+ BRONZE  and a R7 240 2gb all for  70 dollars. SOUNDS LIKE A GOOD DEEEAAAL
  12. Like
    Igor Perrotta reacted to Enderman in A good CPU watercooler?   
    You're welcome.
  13. Like
    Igor Perrotta reacted to itroitnyah in Overclock a 1600MHZ CORSAIR XMS3   
    At 1.65V you should be able to get at least 2000MHz, although you should be able to get higher. Just be sure to check the stability of the RAM at the speed and voltages. 
  14. Like
    Igor Perrotta reacted to failblox in Overclock a 1600MHZ CORSAIR XMS3   
    I don't recommend overclocking RAM. The performance gains are so small that it won't make a difference whether you OC it or not.
    However, if you insist on OCing it, use memtest86 to test stability.
     
    Also, I'd just like to politely point out that it isn't necessary to make your post in red font, as it violates the LTT CoC.
×