Making code more precise

Hi my name is vicente and i was wondering if the following code is as precise as it could be. I made the program in the course of 1 hour during class and it is quite simple. Let me know if there are things i can clean up. thanks
import java.io.*;
class Program49A1
     public static void main ( String[] args ) throws IOException
          EasyReader indata = new EasyReader ("testscores.dat");
          //initialize the variables
          int num=0,index,count, count2,newsize;
          String input,fName,lName,input2;
          double total=0, average,min=0,max=0;
          //read the first piece of data and save it to some variables for later          
          input = indata.readLine();
          count = Integer.parseInt(  input );
          index=count;
          count2=index;
          double testScores[] = new double[index+1];     
          //get the student's name and begin output.
          fName = indata.readLine();
          lName = indata.readLine();
          System.out.println(fName+ " " +lName+"'s test scores:");
          //read the first test score.
          input2 = indata.readLine();
          testScores[index] = Double.parseDouble(  input2 );
          total = total + testScores[index];
          //initializing the first element of the array as both the largest and the smallest number
          min=testScores[index];
          max=testScores[index];
          for( count=count-1; count != 0; count--)
               //begin the for loop by printing the test score and a comma.
               System.out.print( testScores[index] + ", ");
               input2 = indata.readLine();
               testScores[index] = Double.parseDouble(  input2 );
               //find the max and the min
               if ( testScores[index] <= min)
                    min = testScores[index];
               if (testScores[index] >= max)
                    max = testScores[index];
               //calculate average
               total = total + testScores[index];
          //print out the last testscore of the array.
          System.out.print(testScores[index]);
          //if the max and the min are the same number (unlikely)
          //this will make sure the new average is correctly calculated
          if(max==min)
               newsize =index-1;
          else
               newsize=index-2;
          //calculations and final output
          average = (total/count2);
          System.out.println("\n\naverage: "+average);
          System.out.println("\nmin:" +min+"\n\nmax: "+max);
          //subtract the sum of the max number and the lowest number from the total.
          total =total -(min+max);
          //average is now equal to the new total divided by the new number of numbers.
          average=total/(newsize);
          //final output
          System.out.println("\n\naverage: "+average);
          System.out.println("\n\n");               
}im using easy reader which you can find here: http://www.skylit.com/javamethods-old/EasyReader.java

Any place you have a comment could potentially be re-factored into a private method with a descriptive name. When you see 'blocks' in your code delineated by comments, always consider breaking up the larger method into smaller ones. Blocks within loops are also excellent candidates for a private method.
Consider making all string literals in your class into constants that are static and final. (Don't bother doing this for logging message or System.out.println(), it's overkill).
Consider catching the IOException rather than letting it propogate out of the main() method. You should instead display a meaningul message to the user. Stack traces are not that friendly on the eyes to ordinary users.
- Saish

Similar Messages

  • Making code more efficient

    I am having a lot of trouble getting my code to work fast enough. I have 4 sonic anemometers and currently my code is only efficient enough to collect data from one. I have programs that run 2 sonic anemometers and save the data, but bites pile up at the port. The instruments are in unprompted mode and send data at 10hz. I find that using the wait command dose not work well for some reason so I have the loop continuously running. The first version of my code (V3a) worked for one sonic and bites did not pile up at the port. So I made (V3b) and tried to make a more efficient program. I tried separating things into multiple loops but, it still does not work well and was hoping to get some ideas to make things work better.
    I attached the 2 versions of my code. I am not sure if I should attach the subVIs, let me know.
    Thanks!
    Attachments:
    fo3csat_unprompted_v3a.vi ‏23 KB
    fo3csat_unprompted_v3b.vi ‏27 KB

    I'm going to ask you a very important question about that occurrence in the top loop: by using the occurrence the way you have, have you eliminated the possibility of a race condition? The answer is NO... study it, and you'll see why. If you can't figure it out, post back and I'll tell you why the race condition is still present.
    Also, if you ever are coding and thinking to yourself, "WOW, I can't believe the guys who developed LabVIEW made it so hard to do this simple task!", odds are, you're making it hard yourself! Rather than making 4 parallel branches of a numeric, converting to an ASCII string, then reinterpreting as 4 separate numerics, consider the following code. It's nearly equivalent, except my seconds has more significant digits (maybe good, maybe not):
    I'm going to argue that even splitting the discrete components of time is unnecessary, unless your logging protocol specifically requires that format. Instead, simply write the timestamp directly to file with the data points.
    Also, remember to use a standard 4x2x2x4 connector pane on your SubVIs. Refer to the LabVIEW Style Guide (search, and you will find it).
    Finally, I'm going to disagree with the other guys, it's not evident why you split the one loop into three loops. The only "producer/consumer" architecture has the top loop as the "producer", and all it's producing is a timestamp! This is not a typical or intended use of the producer/consumer architecture. Your VI is intended to only save a data point once every 30 minutes (presumably), so it's no big deal of both of your serial devices are in the same loop.
    The single biggest problem why your VI is completely railing out a CPU core (you didn't state this, but I'm guessing the reason you posting is because you noticed a core running at 100%!) is the unmetered loop rate... like the other guys say, drop a "Wait Until Next ms Multiple" and slow the loop rate down significantly. 10msec is probably too fast for your application.... actually, a loop rate of once every 30 minutes (that's 1800000msec) might be best.
    Let us know how it goes!
    a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"] {color: black;} a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"]:after {content: '';} .jrd-sig {height: 80px; overflow: visible;} .jrd-sig-deploy {float:left; opacity:0.2;} .jrd-sig-img {float:right; opacity:0.2;} .jrd-sig-img:hover {opacity:0.8;} .jrd-sig-deploy:hover {opacity:0.8;}

  • Making code faster smaller and more elegant

    hi just like yesterday I�m new to java. first of all I want to get familiar with the basics. I wrote a little game therefore. with some help. within the code are no mistakes, compiling errors or such. but now my question is why is my CPU usage nearly 75% when I run it. when the �h� ( Thread.sleep(h); ) is about 5 which makes the game faster but the CPU usage is 100%. Are there any possibilities to make the code faster? next question. are there any tricks to make the code more elegant or smaller? you know what I mean? it�s quite difficult for me to express what I want cause my English isn�t the best�
    what ever here is the code
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    public class BricksGame extends JFrame implements MouseListener, MouseMotionListener{
         private int mouseX, mouseY;
         double a = -3;
         int delta = 1;
         int beta = -3;
         int x_max = 288;
         int y_max = 320;
         int x_min = 0;
         int y_min = 0;          
         int x = 5;
         int y = 5;
         int b = y_max;
         int h = 15;
         int y_block = 80;
         int i;
         int x_point;
         int y_point =0;
         int punkte = 0;
         double k ;
         double r;
         int zahl = 1;
         boolean changed = true;     
         boolean gameNotOver = true;
         JPanel panelOben = new MyPanel();
         JPanel panelUnten = new JPanel();
         JLabel labelU1 = new JLabel();
         JLabel labelU2 = new JLabel("Punktestand: 0");
           JButton b1 = new JButton("restart");
         public  BricksGame(){
              setSize(400,600);
              setLocation(100,200);
              Dimension full = getSize();
              mouseX = full.width/2;
              mouseY = full.height/2;
              addMouseMotionListener(this);
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {System.exit(0);}
              panelOben.setLayout(null);
              //Ausrichtung der Elemente
              panelOben.setBounds(50, 50, 400, 500);
              panelUnten.addMouseMotionListener(this);
              panelUnten.setLayout(null);
                   //Ausrichtung der Elemente
              panelUnten.setSize(300, 100);          
              panelUnten.setBounds(50, 500, 300, 100);
              labelU1.setBounds(100,380,130,25);
              labelU2.setBounds(150,430,130,25);
              b1.setBounds(150,500, 80, 30);
              b1.addMouseListener(this);
              ImageIcon ii2 = new ImageIcon(getClass().getResource("TW1.gif"));
              labelU1.setIcon(ii2);
                   //Hinzuf�gen der Elemente
              panelUnten.add(labelU1);
              panelUnten.add(labelU2);
              panelUnten.add(b1);
              getContentPane().add(panelOben);
              getContentPane().add(panelUnten);
              setResizable(false);
              (new Mover()).start();
              setVisible(true);          
              validate();     
         public static void main (String[]args){
              BricksGame object = new BricksGame();     
         public void mousePressed (MouseEvent e) {}
         public void mouseReleased (MouseEvent e) {}
         public void mouseClicked (MouseEvent e) {
              restart();
         public void mouseEntered (MouseEvent e) {}
         public void mouseExited (MouseEvent e) {}
         public void mouseDragged (MouseEvent e) { }
         public void mouseMoved (MouseEvent e) {
              mouseX = e.getX();
              if (mouseX <= 85){
                   mouseX = 85;
              }else if (mouseX >= 319){
                   mouseX = 319;
              labelU1.setBounds(mouseX -35 ,380,70,25);
          * @author Haferberger
          * To change the template for this generated type comment go to
          * Window>Preferences>Java>Code Generation>Code and Comments
         class Mover extends Thread{
              public void run(){
                   while (gameNotOver){
                        try {Thread.sleep(h);}
                        catch (Exception e) {
    //                     TODO: handle exception
                        repaint();
          * @author Haferberger
          * To change the template for this generated type comment go to
          * Window>Preferences>Java>Code Generation>Code and Comments
         class MyPanel extends JPanel{
              public void paint(Graphics g){
                   if (y <= y_min && !changed){
    //                    System.out.println("up");     
                        //wie oft oben gegen     
                        i++;
                        //Koordinaten des G�nen Punktes
                        x_point =x_max -x;
                        y_point =0;
                        //Nach 5 mal oben gegen wird der Winkel ge�ndert
                        if (i%5==0){
                             zZahl();
                             alpha();
                        //Richtungs�nderung
                        a = -a;
                        b = (int)(y_min - a*x);
                        changed = true;     
                   }else if (y >= y_max && !changed){
    //                    System.out.println("down");                    
                        //Bei Ber�hrung unten wird der Block verschoben
                        if (y_block == 221){
                             beta = -beta;
                        }else if (y_block == 80){
                             beta = -beta;
                        y_block+= beta;
                        //Betimmen wo der Ball aufkommt
                        if (x + 5 >= mouseX - 84 && x + 5 <= mouseX -27 ){
    //                         System.out.println("Mitte");
                        }else if(x + 5 >= mouseX - 95 && x + 5 <= mouseX -85 ){
    //                         System.out.println("au�en links");
                             if(delta > 0){
                                  delta = -delta;
                                  a = -a;
                                  b = (int)(y_min - a*x);
                        }else if(x + 5 <= mouseX -16 && x + 5 >= mouseX -26 ){
    //                         System.out.println("au�en rechts");
                             if(delta < 0){
                                  delta = -delta;
                                  a = -a;
                                  b =(int)(y_min - a*x);
                        }else{
                             System.out.println("daneben");
                             gameNotOver=false;
                             a = -a;
                             b = (int)(y_max - a*x);
                        changed = true;
                   }else if (x >= x_max && !changed){
    //                    System.out.println("right");                                        
                        a = -a;
                        b = (int)(y - a*x_max);
                        delta = -delta;
                        changed = true;
                   }else if (x <= x_min && !changed){
    //                    System.out.println("left");
                        a = -a;
                        b = (int)(y - a*x_min);
                        delta = -delta;
                        changed = true;               
                   }else if (y == y_block && x>72 && x<216 && !changed){
    //                    System.out.println("Balken unten");
                        a = -a;
                        b = (int)(y - a*x);
                        changed = true;               
                   }else if (y == y_block+20 && x>72 && x<216 && !changed){
    //                    System.out.println("Balken oben");
                        a = -a;
                        b = (int)(y - a*x);
                        changed = true;               
                   }else{
                        changed = false;                    
                   g.setColor(Color.cyan);
                   g.fillRect(0, 0, 300, 330);
                   x+= delta;               
                   y = (int)(a*x + b);
                   g.setColor(Color.red);               
                   g.fillOval(x,y+5,10,10);
                   g.setColor(Color.magenta);
                   g.fillRect(72, y_block,144,20);
                   y_point+=2;
                   if(y_point==310){
                        y_point=500;
                        if(x_point + 5 >= mouseX - 94 && x_point + 5 <= mouseX -20 ){
                             punkte+=50;
                   g.setColor(Color.green);               
                   g.fillOval(x_point,y_point,20,20);
                   labelU2.setText("Punktestand: " + punkte);
                   labelU2.validate();
         public void zZahl(){
                   r = (Math.random() * 10);
                   zahl = (int)r%5 + 1;
         public void alpha(){
              switch(zahl){
                   case 4:
                        if (a<0){
                             a=-1;
                        }else if (a>0){
                             a=1;
                        if (delta<0){
                             delta=-4;
                        }else if (delta>0){
                             delta=4;
                        break;
                   case 3:
                        if (a<0){
                             a=-2;
                        }else if(a>0){
                             a=2;
                        if (delta<0){
                             delta=-4;
                        }else if(delta>0){
                             delta=4;
                        break;
                   case 5:
                        if (a<0){
                             a=-3;
                        }else if (a>0){
                             a=3;
                        if (delta<0){
                             delta=-1;
                        }else if (delta>0){
                             delta=1;
                        break;
                   case 2:
                        if (a<0){
                             a=-0.5;
                        }else if (a>0){
                             a=0.5;
                        if (delta<0){
                             delta=-4;
                        }else if (delta>0){
                             delta=4;
                        break;
                   case 1:
                        if (a<0){
                             a=-0.2;
                        }else if (a>0){
                             a=0.2;
                        if (delta<0){
                             delta=-5;
                        }else if (delta>0){
                             delta=5;
                        break;
         public void restart(){
              gameNotOver=true;
              y_block=80;
              beta = -3;
              x=mouseX;
              (new Mover()).start();
              punkte = 0;
              labelU2.validate();
    }thanks

    First of all, big friendly advice: split your code into few classes and methods. Currently your code looks very ugly.
    And one simple question: what is happening with Mover instance after restart? I don't see anything that stops old Mover thread instance before starting a new one...
    And so on...
    It is much simpler to answer your question when code is splited in small parts - problems then are located in small pieces of code.

  • Please specify short text more precisely

    Hello All
    when i create a free text sc and reffered a material group GOA item text are same.
    sc description text = goa item text same (product category GOA)
    i get this error "Please specify short text more precisely" while creating a PO (classic)
    SAP options to make error message to warning message in ECC Version = 00
    Appl.A = 06
    No. = 474
    Cat = W
    what are the business impacts will be there if i make E to W.
    Br
    muthu

    Hi
    06474 is a MM-PUR error . It will also have effection to MM prochase order process.
    Error message 06 474 with item category W and M contracts occurs if the
    material on the PO has the same short description (text) as a non-stock
    item from the referring contract.
    If you change the description of your short text on the PO item (ex.
    text1) or you insert a material master with a description the error
    message will not appear.
    The error message that is generated is part of standard functionality.
    It is designed to prevent you from having a duplicate material.
    LMEPOF2B
    IF ekpo-ematn IS INITIAL.                               "371796
    IF ekpo-txz01 NE space AND ekpo-konnr NE space AND
       ekpo-txz01 EQ kekpo-txz01 AND
      ( kekpo-pstyp EQ pstyp-munb OR kekpo-pstyp EQ pstyp-wagr ).
       PERFORM enaco_2(sapfmmex) USING '06' '474'.         "371796
       mmpur_metafield mmmfd_short_text.                   "431879
       CASE sy-subrc.                                      "371796
         WHEN 1.                                           "371796
           MESSAGE w474 INTO gl_dummy.                     "371796
           mmpur_message 'W' '06' '474' '' '' '' ''.       "371796
         WHEN 2.                                           "371796
           MESSAGE e474. "specify the short description of the item
        WHEN 3.         "<   message not customized        "371796
           MESSAGE e474.                                   "371796
      ENDCASE.                                             "371796
    ENDIF.
    ENDIF.                                                   "371796
    The code listed above is where the error is generated. When there is no
    material master (EKPO-EMATN) and the short text on the PO (EKPO-TXZ01)
    is the same as the short text on the contract (KEKPO-TXZ01) and the
    contract is item category M (PSTYP-MUNB) or W (PSTYP-WAGR) then the
    error is generated.
    You can set the message to 'W' in SPRO t-code:
    SPRO > Materials Management > Purchasing > Environment Data >
    Define Attributes of System Messages
    I hope this information will help you.

  • More precision in Timestamps

    Hello,
    I'm acquiring 2.5MS/s with a DAQmx card. That means that my timestamps must have more than ms precision... When I have ms precision I get around (I don't know if it's exactly that) 2500 samples with the same time (for example 2500 samples at 0,023s).
    So, how can I get more precision in my timestamps? I read something about getting another counter channel and use it as timestamp, but I want to know if there's any other path for that? I'm already acquiring 8 channels and 'fighting' to save them, I didn't want to add one more channel. And I need timestamps for EACH channel, and not one for all of them...
    Thanks for the help,
    Rafael

    Timestamps have 64 bit for 1 second so the absolute accuracy is much greater, maybe it's just the reprsentation.
    Where do you read the timestamp?
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • I am making code to try to make a game and my problem is that my code......

    I am making code to try to make a game and my problem is that my code
    will not let it change the hit everytime so im getting the first guy to hit 1 then next hits 8 and so on and always repeats.
    Another problem is that I would like it to attack with out me telling it how much times to attack. I am using Object oriented programming.
    Here is the code for my objects:
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.util.Random;
    import static java.lang.Math.*;
    import java.awt.*;
    import java.awt.color.*;
    class rockCrab {
         //Wounding formula
         double sL = 70;                                   // my Strength Level
         double bP = 1;                                   // bonus for prayer (is 1 times prayer bonus)
         double aB = 0;                                 // equipment stats
         double eS = (sL * bP) + 3;                         // effective strength
         double bD = floor(1.3 + (eS/10) + (aB/80) + ((eS*aB)/640));     // my base damage
         //Attack formula
         double aL = 50;                                   // my Attack Level
         double eD = 1;                                   // enemy's Defence
         double eA = aL / eD;                              // effective Attack
         double eB = 0;                                   // equipment bonus'
         double bA = ((eA/10) * (eB/10));                    // base attack
         //The hit formula
         double fA = random() * bA;
         double fH = random() * bD;
         double done = rint(fH - fA);
         //health formula
         double health = floor(10 + sL/10 * aL/10);
         rockCrab() {
         void attack() {
              health = floor(10 + sL/10 * aL/10);
              double done = rint(fH - fA);
              fA = random() * bA;
              fH = random() * bD;
              done = rint(fH - fA);
              System.out.println("Rockcrab hit" +done);
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.util.Random;
    import static java.lang.Math.*;
    import java.awt.*;
    import java.awt.color.*;
    class self {
         //Wounding formula
         double sL = 1;                                   // my Strength Level
         double bP = 1;                                   // bonus for prayer (is 1 times prayer bonus)
         double aB = 0;                                 // equipment stats
         double eS = (sL * bP) + 3;                         // effective strength
         double bD = floor(1.3 + (eS/10) + (aB/80) + ((eS*aB)/640));     // my base damage
         //Attack formula
         double aL = 1;                                   // my Attack Level
         double eD = 1;                                   // enemy's Defence
         double eA = aL / eD;                              // effective Attack
         double eB = 0;                                   // equipment bonus'
         double bA = ((eA/10) * (eB/10));                    // base attack
         //The hit formula
         double fA = random() * bA;
         double fH = random() * bD;
         double done = rint(fH - fA);
         //health formula
         double health = floor(10 + sL/10 * aL/10);
         self() {
         void attack() {
              health = floor(10 + sL/10 * aL/10);
              fA = random() * bA;
              fH = random() * bD;
              done = rint(fH - fA);
              System.out.println("You hit" +done);
    }Here is the main code that writes what the objects do:
    class fight {
         public static void main(String[] args) {
              self instance1 = new self();
              rockCrab instance2 = new rockCrab();
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
    }when the code is run it says something like this:
    you hit 1
    RockCrabs health is 9
    RockCrab hit 7
    your health is 38
    you hit 1
    RockCrabs health is 8
    RockCrab hit 7
    your health is 31
    you hit 1
    RockCrabs health is 7
    RockCrab hit 7
    your health is 24
    you hit 1
    RockCrabs health is 6
    RockCrab hit 7
    your health is 17
    my point is whatever some one hits it always repeats that
    my expected output would have to be something like
    you hit 1
    RockCrabs health is 9
    RockCrab hit 9
    your health is 37
    you hit 3
    RockCrabs health is 6
    RockCrab hit 4
    your health is 33
    you hit 2
    RockCrabs health is 4
    RockCrab hit 7
    your health is 26
    you hit 3
    RockCrabs health is 1
    RockCrab hit 6
    your health is 20
    Edited by: rade134 on Jun 4, 2009 10:58 AM

    [_Crosspost_|http://forums.sun.com/thread.jspa?threadID=5390217] I'm locking.

  • Short text vs contract item text-Please specify short text more precisely

    Hello all
    1. creating free text PO w.r.t material group for reference to material group contract
    2. miselanious - SHORT TEXT vs Contract MATERIAL group miselanious SHORT TEXT are same
    now i get error Please specify short text more precisely
    Why SAP set as E . if i make W . what are the impacts.
    -> Purchasing
    -> Environment Data
    -> Define Attributes of System Messages
    -> System messages (double click on it)
    Add a new entry
    Version = 00
    Appl.A = 06
    No. = 474
    Cat = E
    if i set W , i could create PO successfully. ..
    Why SAP KEPT ERROR for this matter?
    thanks
    Muthu

    Thanks Jurgen
    Note 371796 - Msg 06474: Please specify short text more precisely
    ME21N, ME22N, ME23N
    Message 06474: "Please specify short text more precisely" for a purchase order with reference to a material group contract.
    Additional key words
    ME21, ME22, material description
    Cause and prerequisites
    In the new transactions for the purchase order, the system displays the message for a material group contract with reference, which is correct, if there is an assigned material without a material number and the short text, which was copied to the purchase order from the contract to help you, was not changed to the actual material text. In this case, the short text of the material should be more specific in the purchase order than that for the material group in the contract.
    For situations in which the specification of the purchase order text does not need to be checked, the message could be made adjustable in Customizing.
    In Transaction ME21 and ME22, the text is not copied and must be entered manually. However the system then no longer carries out a check.
    Solution
    For situations in which the specification of the purchase order text for contracts with the item category material group should not be checked, this note enables you to set error message 06474 in Customizing.
    See the advance corrections.
    any impacts what itcause damage to business.
    bullet points. i will freeze the thread.
    Muthu

  • Need more precise output

    Precise response needed
        I made a vi to drive a vco circuit .I am varying the frequency from 70 to 148. For some values of frequeny  I am getting the exact respose ie the frequency.I am entering is getting at the output using Ni USB 6009 DAQ card, ie the 12 bit binary generated at DAQ output is sufficent. It have 12 bit digital output pin.I want to make the response more precise 
    I am adding some value
    148.1  1111 1111 1111
    129     1011 1101 1001
    Please help me to solve is issue
     Thanks in advance
    with regards
    DK
    Attachments:
    v to f 150 expresion node B.vi ‏47 KB

    Duplicate Post:http://forums.ni.com/t5/Digital-I-O/2-digit-decimal-to-12-bit-binary/m-p/2584021
    Duplicate Post:http://forums.ni.com/t5/Digital-I-O/Precise-response-needed/m-p/2586339
    Please keep it all in a single thread.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to establish code standards to make the abap code more readability

    Every programmer have their habit to code, but this lead a problem , it is difficult to read other people's code, especially the complex logic.
    So how to establish code standards to make the abap code more readability?
    I came up with this:
    1.Unify the naming rule.
    2.Reduce the nest of 'if' statement. (better in less than 4 if statement in one block )
    3.Use more Perform to replace the big code block.
    Is there any other standards to make our abap code more readability ?  (if we establish the standards, in sap is there any tool to help us to follow the rule we set ?)

    There are a number of things you could do. Some of which are:
    I would recommend creating your own in-house document on Coding standards, some of which you can control with the code inspector.
    It is also possible to set up the transport request in such a way that objects that do not pass the SCI test are not allowed to be released.
    I would also assign a senior developer to act as quality control for all developments. You can have a rotation scenario where this work can be divided by the number of senior developers you have.

  • Ihone 4s lost all contacts. I tried to restore from backup but the error message now says there is not enough room. I have deleted all the apps without making any more room on iphone. Why did contact disappear and how do I get them back?

    ihone 4s lost all contacts. I tried to restore from backup but the error message now says there is not enough room. I have deleted all the apps without making any more room on iphone. Why did contact disappear and how do I get them back?

    In the simplest sense, archiving a file means making a copy that you never change and never discard. You already know how to do that.
    iPhoto has built-in archival features, in the sense that it saves all versions of an image that you've modified. As long as you have adequate backups, you don't necessarily have any reason to archive an iPhoto library. If you want to delete images from the working library but still have access to them in case you change your mind, then you do need to archive those images. I don't have a specific suggestion as to how you should do that. You might post a question in the iPhoto forum.

  • How can i measure the transmision time in gpib with visual basic with more precision if i use time() function?

    I want to take a measurement of the time that i use to make a gpib transmision in a Visual Basic program,i use the function TIME() to take the time in the begining and other time in the end,but this way only give me precision of seconds, and i want miliseconds,can i use other function,other way?
    Can answer in spanish?

    Try using GetTickCount() API function, which provides millisecond precision. If you need more precise timer, try using QueryPerformanceCounter() function.
    Makoto

  • Controling speed changes with more precision? is it possible in FCPX?

    controling speed changes on clips with more precision? is it possible in FCPX? other than the presets?

    where is it that you can change the values...I have read that you open the retiming bar in the timeline...didn't see anywhere to change the values..sorry I'm sure it's right in front of me, but?

  • How to paste audio clips more precisely?????

    Im just getting to know my brand new Logic Studio. Im working on a track just to try to get to know my new Logic.
    So in trying to paste Audio clips on a certain point, it wont allow me to get it bang on where desired point. Its always
    a little off.  For example Im trying to copy and paste the first verse to build the 2nd verse. I dragged the bar to the deseired
    point which is 20 1 1 1. When I paste in my region or audio clip its like 21 4 4 239.  After this I notice I try enlarge the screen
    to make it more precise and as I drag it the Audio clip goes past it or before it a little out of time.
    Maybe its something to do with the audio clips themselves Im not sure but this never happened to me in Logic Express...
    Thanks guys

    You know, the funny thing might be to pull them into a single track in FCP and Dona remove gaps.
    You could try:
    Using the browser in STP to list all the files in order. I'm on the road so I can't test this, but what happens if you select them and drag and drop to a single track in multitrack mode?
    And how about: in the browser select the next clip, right click and do spot to playhead? If you've jumped to the end of the file in the track it will butt next next one against it.
    So a could things to fool with.

  • Frequently faced errors when making code as unicode enabled document

    Hi ALL,
    Does any have frequently faced errors when making code as unicode enabled document
    please forward it to
    [email protected]
    thanks
    Suchitra

    WS_DOWNLOAD and WS_UPLOAD function calls will need to be replaced with GUI_UPLOAD and GUI_DOWNLOAD or the assocaited methods of the class CL_GUI_FRONTEND_SERVICES.  Also, some syntax changes to some statements, like OPEN DATASET will need the ENCODING extension.
    Regards,
    Rich HEilman

  • TS1292 How come it doesn't show the amount of money there is s gift card?  I tried putting in the code more than once, but all it says is that the card has already benn redeemed?

    How come it doesn't show how much money there is left in my iTunes gift card?  I have tried putting in the code more than once, but all my tablet says is that the card has already been redeemed.

    I haven't got access to the server right now (so I can't provide the complete details), but something like 6-700 GB (which is more than it shows in the client time machine windows, but less than what is true (which was around 1,5 TB))

Maybe you are looking for

  • Required standard report

    Hi, Please help me in getting the report. Require a report which should have  PO No., Material Code,  PO qunatity, GR quantity  and payment to supplier with respect to GR. Thanks...

  • Change labels of af:query parameters

    Hello, I have a table with an af:query. I've set a viewcriteria on the base ViewObject. This criteria contains two parameters (one is a number, the other is an LOV based id). When running the page, the attributes labels in the af:query are the column

  • Create multiple capture processes for same table depending on column value

    Hi, is it possible to create multiple realtime downstream capture processes to capture changes for the same table depending on column value? Prakash

  • Port number pops up in URL...

              Hi,           I have this issue.           We have weblogic Server(5.0) running on HP-Unix. We have several           JSP Pages and a controller servlet.           The testing goes like this:           We have a form in my.jsp and it gets s

  • G5 powermac freezes, fan get loud

    Recently uninstalled lion and reinstalled leopard. Restore apps and files from time machine backup. Now, the mac freezes, screen goes black and fan noise gets loud. I can power off and restart, but after several minutes, happens all over again. Any a