Array Expander Issues.

Hi there ...
this is how I am adding stuff.
class CallRecordInfo {
  String from;
  String to;
  double duration;
  CallRecordInfo(String f, String t, double d) {
    from = f;
    to = t;
    duration = d;
public class testReader{
     int CRdbSize = 2;//CRdbSize = Call Records Database Size ...
       int numRecords = 0; // number of entries in CDdb array
       CallRecordInfo CRdb[] = new CallRecordInfo[CRdbSize];
       void addCallRecord(String from, String to, double dur) {
       boolean LimitReached = (numRecords == CRdbSize);
       if (LimitReached)
                                   int tsize = CRdb.length+1;
                                CallRecordInfo tempCRdb[] = new CallRecordInfo[tsize];
                                System.arraycopy(CRdb, 0, tempCRdb, 0, CRdb.length);
                                CRdb = tempCRdb;
                                  CRdb[numRecords] = new CallRecordInfo(from, to, dur);
                                    numRecords++;
                                    numRecords = numRecords-1;     
     else {
                   CRdb[numRecords] = new CallRecordInfo(from, to, dur);
                     numRecords++;          
    }okay .. basically I don't know how long the array will be hence, I did the array expanding code as you can see. I have another method (called find) to search for records by "From". Initially I have 11 sets of record. So if I set the int CRdbSize above 11. The find method works properly. However if its below 11 which is when the boolean kicks in to expand the array, I think the array gets jumbled up or something, as then on calling find method, it doesn't return the right values.
I understand the error is when I'm copying the array, but I'm not sure what it is.
Secondly, I tried to achieve similar result using vector. However like the Class CallRecordInfo has been cast to the array, I don't know how to do it for the vector hence be able to search for the values.
Any suggestions? thank you :)

hi, thank you everyone for helping me out. I never noticed that I forgot to update "CRdbSize", how silly! ... However, I was wondering about the ArrayList that you suggested. How would I initialise it?
If i write something like ArrayList <CallRecordInfo> db = new ArrayList(); Then I get all sorts of errors. I'm sorry for the dumb question, I'm just not use to ArrayList as yet. :( ..

Similar Messages

  • OBIEE 11g Hierarchy expanding issue

    Hi Experts,
    I have an Analysis report which I display hierarchy and I have many reports which contain hierarchy.
    But I have a specific report which only expand up to 1 level only unlike my other Analysis reports which display the hierarchy up to the last level.
    This report that only expand up to 1 level have many records (about 1.5K).
    Can you help me fix/resolve this issue about the hierarchy
    My OBIEE version is: 11.1.1.6 (11.1.1.6.0.120104.0152.000 to be exact).
    My hierarchy is properly displayed in other reports but one of my reports, the hierarchy is not displaying well.
    SCENARIO:
    all reports have same hierarchy fields to be displayed:
    report 1 (displays only 50 records or less) - good
    report 2 (displays only 50 records or less) - good
    report 3 (displays only 50 records or less) - good
    report 4 (displays more than 1000 records) - not working
    Thanks,

    Hi JaiG,
    My OBIEE version is: 11.1.1.6 (11.1.1.6.0.120104.0152.000 to be exact).
    Yes, the hierarchy is defined is defined in the repository.
    My hierarchy is properly displayed in other reports but one of my reports, the hierarchy is not displaying well.
    SCENARIO:
    all reports have same hierarchy fields to be displayed:
    report 1 (displays only 50 records or less) - good
    report 2 (displays only 50 records or less) - good
    report 3 (displays only 50 records or less) - good
    report 4 (displays more than 1000 records) - not working
    Thanks,
    any updates experts? :(
    Edited by: OBIEE Learner on Dec 13, 2012 12:42 AM

  • Array Manager Issues

    Hi,
    I'm currently using tarantella 3.4 and am trying to get ldap/ad mirroring with the tarantella ens. To do this I need to change some of the attributes in the Global Desktop Security Login Tab within Array Manager. The problem is that when I apply the change and the go back in none of my changes have been saved. I can change other attributes with Array manager and they are saved.
    Any ideas why this is happening?
    TIA
    Dave

    as root:
    ./tarantrella config list you get all attributs
    ./tarantella config edit --<attribute> <value> you can set the ldap/ad attributes. So you see, wether its an Array Manager problem or a service issue.

  • RAID array activation issue in CS2 & XP

    Yes, I still have CS2, which I love, as well as Production Studio. I have used CS2 for years with a RAID array, first striped and now a mirror. The mirror array lasted about 10 months until the motherboard went. eVGA replaced the motherboard with the same model, I fiddled around a bit trying to get my same array up and running, I couldn't figure it out and ended up doing a reinstall (after a couple of weeks of running single drives). Anyway, I keep having to activate my Adobe Suites. I have talked to people (thick accents, maybe in India) three times now; takes a lot of time. I know that there is an issue with CS2 and RAID (XP and CS2 have all of their available updates). I tell them I have RAID. I ask for a patch to avoid the activation issue. I have been told that I "should not be using RAID", that I will "have to reactivate every time I boot" and that I won't be able to run this "without upgrading to CS4". I KNOW that this configuration will work, because it has worked in the past. I vaguely remember a patch when I originally installed.
    I just called the Tech Support number, instead of the activation number. I also got someone with a thick accent who told me that he had no support available for CS2. He wouldn't give me a phone number to call, I asked about a patch and he "doesn't support CS2", end of discussion. He suggested the website. Ugh!
    I am not locked out at this time, but have just done another reactivation. I suspect Adobe will put a stop to repeat activations. I worry about being locked out when I am under the gun trying to finish something. My son is working on a school project for the end of year right now. What can I do? Does anyone know where I can find a patch or talk to someone who will help a CS2 user?
    I LIKE my RAID array. I know that my data is perfectly backed up at all times. I would prefer not to have to break the RAID array into single drives. I chose this MB because of the RAID capability.
    Thanks in advance!

    Thanks Bob. I asked to speak to a supervisor with calls two and three to India, or wherever. One lady said they didn't have a supervisor and then said, well, of course we have supervisors, but they will not be able to help. I guess I could have thrown a fit, but neither was willing to connect me to a supervisor even though I asked. I did find it amusing (in a sad way) that the one lady initially denied that she had a supervisor.
    I then called Customer Support (call number four) and they simply wouldn't talk to me. They don't deal with CS2, didn't want to talk to me at all.
    I guess I'll try India again, next time it locks me out.
    I'll go through old files (again) to see if I saved some kind of patch.
    Thanks again.

  • Mathscript Array Generation Issue

    I am trying to create a script to generate a 2D array.  When I test the script in the Mathscript editor I get the correct answer, but when I implement it in my VI with the same numbers I get a different answer.
    Script:
    function final=grid(X,Xi,deltaX,Y,Yi,deltaY)
    s=X*Y;
    T=zeros(s,2);
    i=1;
    Yy=Yi;
    for k=1:X
    for j=1:Y
    T(i,1)=Xi;
    T(i,2)=Yy;
    Yy=Yy+deltaY;
    i=1+i;
    end
    Xi=Xi+deltaX;
    Yy=Yi;
    end
    final=T;
    Using the following grid(3,.5,1,3,.5,1) I get the answer I want
    ans =
               0.5      0.5    
               0.5      1.5    
               0.5      2.5    
               1.5      0.5    
               1.5      1.5    
               1.5      2.5    
               2.5      0.5    
               2.5      1.5    
               2.5      2.5    
    However I get a much larger matrix when I use it in my VI (attached).  Any help appreicated.
    Attachments:
    Array Creation.vi ‏24 KB

    The VI does not produce any errors and I have no broken arrow on my file.  I will re-attach the VI just in case I uploaded an earlier edition.   The issue is mainly that I am trying to produce the following array.
              0.5      0.5    
               0.5      1.5    
               0.5      2.5    
               1.5      0.5    
               1.5      1.5    
               1.5      2.5    
               2.5      0.5    
               2.5      1.5    
               2.5      2.5    
    However, when I run the code I get a 2 x 27 (Array Creation Pic)  array not a 2 x 9 (Array Generation Pic).
    Attachments:
    Array Creation.vi ‏73 KB
    Array Creation pic.PNG ‏76 KB
    Array Generation.PNG ‏81 KB

  • Arrays.sort() issue when Numbers are a string!

    Hey guys -- here is my problem.
    I am working on a TOP TEN SCORES mechanism for a trivia game. I have read in the score and the players name from a file. SO I have 2 different arrays topScores[] and topNames[] ---
    Now if someone plays the game and has a higher score than the lowest score, they get to put their score and name in the file and replace the low score.
    HOWEVER -- I do not know how to sort topSCORES[] and then make whatever sorted changes apply also to the topNAMES[] array.
    SO I thought - HEY I will concatenate the topScores and topNames into a single String array. And then SORT! This sounded like a great idea until I realized that the following will happen:
    100 tvance (first one)
    1000 dvance (second score)
    250 danderson (third score) !!!
    See my problem? When I sort this way - it is sorting alphabetically so it will put a 1000 score before a 200-900 score! ---
    **I hope I explained this adequately -- can someone help? Is there a way to sort the topScores array and have it also change the order of the topNames array as well?

    Create a new class - HighScore, which has a highScore and a name?Yup. This technique even has a name: object-oriented programming!
    Demo:
    import java.util.*;
    public final class HighScore implements Comparable<HighScore> {
        private final int score;
        private final String name;
        public HighScore(int score, String name) {
            if (name == null)
                throw new NullPointerException();
            this.score = score;
            this.name = name;
        public int getScore() {
            return score;
        public String getName() {
            return name;
        public int compareTo(HighScore that) {
            if (this.score < that.score)
                return -1;
            else if (this.score > that.score)
                return +1;
            else
                return this.name.compareTo(that.name);
        public boolean equals(Object obj) {
            if (this == obj)
                return true;
            else if (obj instanceof HighScore) {
                HighScore that = (HighScore) obj;
                return this.score == that.score && this.name == that.name;
            } else
                return false;
        public int hashCode() {
            return score ^ name.hashCode();
        public String toString() {
            return score + " " + name;
        //demo
        public static void main(String[] args) {
            HighScore[] top = {
                new HighScore(250, "danderson"),
                new HighScore(1000, "dvance"),
                new HighScore(100, "dvance")
            Arrays.sort(top);
            for(int i=0; i<top.length; ++i) {
                System.out.println(top);
    If you are using an older version of Java (1.4 or earlier), the generics won't be
    recognized. In that case the class definition would begin:
    public final class HighScore implements Comparable {And the compareTo method would begin:
    public int compareTo(Object obj) {
        HighScore that = (HighScore) obj;Good luck!

  • Hierarchy expand issue after EHP1 upgrade

    Hi,
    We had EHP1 upgrade in our BI system. After upgrade, when we are trying to open the hierarchy of period.
    it should open from TOTAL to Q1, Q2, Q3 and Q4. Also when we should try to open Q1 then it should open Jan, Feb and Mar.
    When i am trying to open the Q1, Insted of opening another column for Jan, Feb and Mar. It disappear the Q1 column from WB.
    I tried to execute the query separately and it is working fine. Created a another new WB and it is also working fine.
    Is there any one have such issue then please let me know whould could bea solution or any SAP Note ect?
    Regards
    Pankaj

    Hi Pankaj,
    I have also done the EHP1 upgrade and found the same issue....
    Please run the program SAP_DROP_TMPTABLES and delete the hierarchy temporary tables.....It will definately solve your problem...
    Please let me know in case of further clarifications...
    Thanks,
    Amit Kr.

  • Powershell Array Export Issues

    Hey everyone! So I might just be going about this the wrong way but here's my issue. The script functions as I need it to however, when I export the values to my .csv, the columns are in the wrong order than the way I think they should be. Here's what I've
    got:
    $list = Get-content targets.txt
    Foreach($_ in $list) {
    $SAM = Get-RegValue -ComputerName $_ -Key Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI -Value LastLoggedOnSAMUser
    $User = Get-RegValue -ComputerName $_ -Key Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI -Value LastLoggedOnUser
    @('Name','LastUserAccessed','LastUserLoggedOn')
    New-Object PSObject -Property @{
    Name = ($SAM).ComputerName
    LastUserAccessed = ($User).Data
    LastUserLoggedOn = ($SAM).Data
    } | Export-csv Results.csv -notypeinformation -append}
    I would like it to read Name, LastUserAccessed, and LastUserLoggedOn but it comes out to be LastUserAccessed, Name, LastUserLoggedOn. Any ideas as to why this is happening? Thanks in advance!

    Okay, then instead of using 'New-Object PsObject -Property', use [pscustomobject].
    http://blogs.interfacett.com/powershell-v3-object-creation-accelerator
    EDIT: Or you can just use [ordered] if you'd prefer:
    http://stackoverflow.com/questions/7802406/use-cases-of-ordered-the-new-powershell-3-0-feature
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Image Array , GUI Issue

    I am currently trying to insert a 20X20 image a specific spot on an array spot[X][Y], but do not know how to get them in the array.
    Can anyone help me?
    I am using JPanel and want the images to be displayed within the GUI.

    AWebster wrote:
    How would i be able to do this? By reading the Sun Swing tutorials JLabel section and by playing with JLabels and ImageIcons first before trying to incorporating them into your main application.
    And sorry im a Beginner, but would this mean i would have to make 100 separate JLabels to fill the 10X10 grid for the array?Yes, you'd have to make 100 JLabel objects, but not 100 separate JLabel variables as all the JLabel objects would be held in a single 10 by 10 array.
    Is this a memory game application?

  • OS X array formatting issues

    This works on a the PC running windows nt in my comp Sci Class but not at home on my mac.
    This is a simple program I am writing for my comp sci HW. The purpose of this app is to print out a 2D array that forms a alphabetical letter composed of that letter. I wil end up doin the whole alphabet but for now here is A and B. What I can't seem to figure out is why the col will not print to the right? it doesn't seem to read num[row][rows-1]='B', it runs but it just puts that in the position [1] column instead of the [rows-1] column. Any help would be greatly appreciated.
    public class all
         public static void main(String[] args){
         int b=3;
         int rows=100;
         int col;
         int row;
         while(b==3)
              rows=Keyin.inInt("Input an odd # between 6 and 20");
              if((rows>6)&&(rows<20)&&(rows%2!=0))
                   b=2;
              else
                   System.out.println("Learn to count");
              int cols=rows;
              char num[][]=new char[rows][cols];
    //A
         int split=(rows/2);
              for(row=0;row<rows;row++)
                   for(col=0;col<cols;col++)
                   num[row][col]=0;
                   System.out.print(num[row][col]+" ");
                   System.out.println("");
              for(row=0;row<rows;row++)
                   for(col=0;col<cols;col++)
                        num[0][col]='A';
                        num[col][0]='A';
                        num[split][col]='A';
                        num[row][rows-1]='A';
              for(row=0;row<rows;row++)
                   for(col=0;col<cols;col++)
                        System.out.print(num[row][col]);
                   System.out.println("");
    //B
              for(row=0;row<rows;row++)
                   for(col=0;col<cols;col++)
                   num[row][col]=0;
              for(row=1;row<rows;row++)
                   for(col=1;col<cols;col++)
                        int top=1;
                        if((row>=1)&&(row<split)||(row>split)&&(row<rows-1))
                             num[row][rows-1]='B';
                        else
                             num[col][0]='B';
                             num[split][col-1]='B';
                             num[0][col-1]='B';
                             //Bottom
                             num[rows-1][col-1]='B';
              for(row=0;row<rows;row++)
                   for(col=0;col<cols;col++)
                        System.out.print(num[row][col]);
                   System.out.println("");
    [/code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Your problem is that the mac doesn't treat ASCII code 0 as a space.

  • Array Access Issues

    I have the following array which is a set of 4 multipliers (Direction)
    private int dirMult[][] = new int[][]{{0,1},{0,-1},{1,0},{-1,0}};I am accessing it as follows, where it runs succesfully 2 times, before givin an array out of bounds error.
    //Apply direction multipliers
    for (int M = 0; M <= 3; M++) {
    //Throws Exceotion Below this line on 2nd access
    xMult = dirMult[1][M];
    yMult = dirMult[2][M];
    System.out.println("Multipliers X: " + xMult + " Y: " + yMult);
    moveList.add(super.generateMoves(super.X, super.Y, xMult, yMult, distance));
    }I'm not sure If i configured the array correctly in the first place, it jumps from running {0,1} to {-1,0}. It might be the access methods are wrong. Could someone point out the right syntax to me? Cheers.

    would it be more appropriate to use .length??
    for(int i = 0;i<arr.length;i++)
         for(int j = 0;j<arr.length;j++)
              System.out.println("i: "+i+" j: "+j+" is " +arr[i][j]);

  • Array averaging issues

    I have a VI set up which acquires data into an xy graph.  The axes are saved independently.  Currently, when I output the arrays used for my xy graph into a file, it gives the x and y coordinate for each file.  The x-coordinates are ordered appropriately and coordinate appropriately with the y-axis, but repeat with each scan eg...
    x   y
    0  .2
    1  .3
    2  .4
    3  .5
    0  .21
    1  .32
    2  .4
    etc.
    What would be the best method of averaging the repeated scans?  Eventually, I will have to differentiate points using a third coordinate (-1, 0, and 1), and I will have to set up this program to be able to handle that, which is a further complication.
    I apologize since this seems like it ought to be routine, but I have always had extreme trouble in dealing with arrays in LabView, especially with establishing indices in multidimensional arrays.
    Thank you for whatever advice you can provide.
    Please find attached my current VI so perhaps you can see better what I mean.
    Attachments:
    Gate Scanning Decay Curve retriever (beta) with voltage control modification.vi ‏97 KB

    First of all, correct code should not slow down significantly, so something else is wrong. You are growing arrays in shift registers without bounds, so this will tax the system after a while. You shoud stram the data ti disk and only accumulate the two fixed size 2D arrays as described below. Atleast you could clear the feedback nodes after each file write in your current implementation. There is also no reason in the world to do EXT and CXT datatypes. Way too much baggage for this application.
    Here's a quick draft how you could do the 2D thingy. Just keep two 2D arrays in shift registers and for each data point, increment the element at x,z indices. One array keeps the sum of all elements and the other the count. At the end, just divide the two 2D arrays. Of course you would need to adjust the size of each dimension according to the desired granularity.
    Matt G wrote:
    (an x axis might read 0, 0.1, 0, 0.3, 0.4, where the third value was not entered). 
    Well, a value of zero is not the same as a missing value. How can you tell the difference?
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    arrayaveraging2.vi ‏18 KB

  • Array length issues

    Whatever i put in for h, tiles at i's length is always 1.
    tiles' length is correct. Why?

    whether that code is in an external .as file or not is
    irrelevant. the problem is it's probably in a class file and
    there's something (other than the code you showed) that's causing
    the problem.

  • Error trying to convert float to expanded form for a check application

    I am writing a program to generate a check, but when it tries to parse the Float (netpay) into a String in expanded form (e.g. 1.23 becomes 1 dollar and twenty-three cents) it throws weird arrayOutOfBounds exceptions
    * Check.java
    * Created on January 23, 2008, 9:55 AM
    package payrollapplication;
    public class Check extends javax.swing.JFrame {
    public Employee emp;
    String expanded;
    /** Creates new form Check */
    boolean debug = true;
    public Check() {
    initComponents();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
    private void initComponents() {
    date = new javax.swing.JLabel();
    jPanel1 = new javax.swing.JPanel();
    name = new javax.swing.JLabel();
    amtexpanded = new javax.swing.JLabel();
    amtnum = new javax.swing.JLabel();
    empid = new javax.swing.JLabel();
    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("EMP Name Here");
    setAlwaysOnTop(true);
    setCursor(new java.awt.Cursor(java.awt.Cursor.CROSSHAIR_CURSOR));
    setResizable(false);
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowActivated(java.awt.event.WindowEvent evt) {
    formWindowActivated(evt);
    date.setText("DATE");
    jPanel1.setBackground(new java.awt.Color(102, 102, 0));
    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 429, Short.MAX_VALUE)
    jPanel1Layout.setVerticalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 62, Short.MAX_VALUE)
    name.setText("NAME");
    amtexpanded.setText("AMT EXPANDED");
    amtnum.setText("AMT #");
    empid.setText("EMPID");
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(10, 10, 10)
    .addComponent(amtexpanded, javax.swing.GroupLayout.DEFAULT_SIZE, 342, Short.MAX_VALUE))
    .addComponent(name, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
    .addComponent(amtnum, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addComponent(date, javax.swing.GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE)
    .addComponent(empid, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
    .addContainerGap())
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addGap(14, 14, 14)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(date)
    .addComponent(name))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(amtnum)
    .addComponent(amtexpanded, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(empid)
    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    pack();
    }// </editor-fold>
    private void formWindowActivated(java.awt.event.WindowEvent evt) {                                    
    initDisplay(); //Computes the expanded form of the number and fills the windows with information
    amtexpanded.setText(expanded);
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new Check().setVisible(true);
    public void initDisplay() {
    try {
    amtnum.setText("$"+emp.netpay); //Fill in the net pay
    name.setText(""+emp.fname+" "+emp.mname+" "+emp.lname+" "+emp.suffix); //Fill in the name
    System.out.println("NOT YET IMPLEMENTED");
    expanded = "";
    //begin to compute the expanded form
    //determine the length of the left side of the decimal
    expanded = emp.netpay+"";
    String[] split = expanded.split(".");
    int length = split[0].length();
    //Now we compute the first half of the number
    int wholeLength = split[0].length();
    char[] arr = split[0].toCharArray(); //create the character array
    expanded = ""; //Clear it
    if(length == 3) {
    System.out.println("Length of 3, working...");
    //Assume we are starting at the one thousands
    //Since 0 is 1, we need to test for 3 for 1,000s not 4
    switch(arr[3]) {
    case '1': expanded = "One Thousand ";
    case '2': expanded = "Two Thousand ";
    case '3': expanded = "Three Thousand ";
    case '4': expanded = "Four Thousand ";
    case '5': expanded = "Five Thousand ";
    case '6': expanded = "Six Thousand ";
    case '7': expanded = "Seven Thousand ";
    case '8': expanded = "Eight Thousand ";
    case '9': expanded = "Nine Thousand ";
    switch(arr[2]) {
    case '1': expanded = expanded + "One-Hundred ";
    case '2': expanded = expanded + "Two-Hundred ";
    case '3': expanded = expanded + "Three-Hundred ";
    case '4': expanded = expanded + "Four-Hundred ";
    case '5': expanded = expanded + "Five-Hundred ";
    case '6': expanded = expanded + "Six-Hundred ";
    case '7': expanded = expanded + "Seven-Hundred ";
    case '8': expanded = expanded + "Eight-Hundred ";
    case '9': expanded = expanded + "Nine-Hundred ";
    switch(arr[1]) {
    case '0': {
    switch(arr[0]) {
    case '0': expanded = expanded + "";
    case '1': expanded = expanded + "and One";
    case '2': expanded = expanded + "and Two";
    case '3': expanded = expanded + "and Three";
    case '4': expanded = expanded + "and Four";
    case '5': expanded = expanded + "and Five";
    case '6': expanded = expanded + "and Six";
    case '7': expanded = expanded + "and Seven";
    case '8': expanded = expanded + "and Eight";
    case '9': expanded = expanded + "and Nine";
    case '1': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Ten";
    case '1': expanded = expanded + "and Eleven";
    case '2': expanded = expanded + "and Twelve";
    case '3': expanded = expanded + "and Thirteen";
    case '4': expanded = expanded + "and Fourteen";
    case '5': expanded = expanded + "and Fifteen";
    case '6': expanded = expanded + "and Sixteen";
    case '7': expanded = expanded + "and Seventeen";
    case '8': expanded = expanded + "and Eighteen";
    case '9': expanded = expanded + "and Nineteen";
    case '2': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Twenty";
    case '1': expanded = expanded + "and Twenty-One";
    case '2': expanded = expanded + "and Twenty-Two";
    case '3': expanded = expanded + "and Twenty-Three";
    case '4': expanded = expanded + "and Twenty-Four";
    case '5': expanded = expanded + "and Twenty-Five";
    case '6': expanded = expanded + "and Twenty-Six";
    case '7': expanded = expanded + "and Twenty-Seven";
    case '8': expanded = expanded + "and Twenty-Eight";
    case '9': expanded = expanded + "and Twenty-Nine";
    case'3': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Thirty";
    case '1': expanded = expanded + "and Thirty-One";
    case '2': expanded = expanded + "and Thirty-Two";
    case '3': expanded = expanded + "and Thirty-Three";
    case '4': expanded = expanded + "and Thirty-Four";
    case '5': expanded = expanded + "and Thirty-Five";
    case '6': expanded = expanded + "and Thirty-Six";
    case '7': expanded = expanded + "and Thirty-Seven";
    case '8': expanded = expanded + "and Thirty-Eight";
    case '9': expanded = expanded + "and Thirty-Nine";
    case '4': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Fourty";
    case '1': expanded = expanded + "and Fourty-One";
    case '2': expanded = expanded + "and Fourty-Two";
    case '3': expanded = expanded + "and Fourty-Three";
    case '4': expanded = expanded + "and Fourty-Four";
    case '5': expanded = expanded + "and Fourty-Five";
    case '6': expanded = expanded + "and Fourty-Six";
    case '7': expanded = expanded + "and Fourty-Seven";
    case '8': expanded = expanded + "and Fourty-Eight";
    case '9': expanded = expanded + "and Fourty-Nine";
    case '5': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Fifty";
    case '1': expanded = expanded + "and Fifty-One";
    case '2': expanded = expanded + "and Fifty-Two";
    case '3': expanded = expanded + "and Fifty-Three";
    case '4': expanded = expanded + "and Fifty-Four";
    case '5': expanded = expanded + "and Fifty-Five";
    case '6': expanded = expanded + "and Fifty-Six";
    case '7': expanded = expanded + "and Fifty-Seven";
    case '8': expanded = expanded + "and Fifty-Eight";
    case '9': expanded = expanded + "and Fifty-Nine";
    case '6': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Sixty";
    case '1': expanded = expanded + "and Sixty-One";
    case '2': expanded = expanded + "and Sixty-Two";
    case '3': expanded = expanded + "and Sixty-Three";
    case '4': expanded = expanded + "and Sixty-Four";
    case '5': expanded = expanded + "and Sixty-Five";
    case '6': expanded = expanded + "and Sixty-Six";
    case '7': expanded = expanded + "and Sixty-Seven";
    case '8': expanded = expanded + "and Sixty-Eight";
    case '9': expanded = expanded + "and Sixty-Nine";
    case '7': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Seventy";
    case '1': expanded = expanded + "and Seventy-One";
    case '2': expanded = expanded + "and Seventy-Two";
    case '3': expanded = expanded + "and Seventy-Three";
    case '4': expanded = expanded + "and Seventy-Four";
    case '5': expanded = expanded + "and Seventy-Five";
    case '6': expanded = expanded + "and Seventy-Six";
    case '7': expanded = expanded + "and Seventy-Seven";
    case '8': expanded = expanded + "and Seventy-Eight";
    case '9': expanded = expanded + "and Seventy-Nine";
    case '8': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Eighty";
    case '1': expanded = expanded + "and Eighty-One";
    case '2': expanded = expanded + "and Eighty-Two";
    case '3': expanded = expanded + "and Eighty-Three";
    case '4': expanded = expanded + "and Eighty-Four";
    case '5': expanded = expanded + "and Eighty-Five";
    case '6': expanded = expanded + "and Eighty-Six";
    case '7': expanded = expanded + "and Eigthy-Seven";
    case '8': expanded = expanded + "and Eighty-Eight";
    case '9': expanded = expanded + "and Eighty-Nine";
    case '9': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Ninety";
    case '1': expanded = expanded + "and Ninety-One";
    case '2': expanded = expanded + "and Ninety-Two";
    case '3': expanded = expanded + "and Ninety-Three";
    case '4': expanded = expanded + "and Ninety-Four";
    case '5': expanded = expanded + "and Ninety-Five";
    case '6': expanded = expanded + "and Ninety-Six";
    case '7': expanded = expanded + "and Ninety-Seven";
    case '8': expanded = expanded + "and Ninety-Eight";
    case '9': expanded = expanded + "and Ninety-Nine";
    //Now we move down the length, 2, 1 ,
    if(length == 2) {
    System.out.println("length of 2, working...");
    switch(arr[2]) {
    case '1': expanded = expanded + "One-Hundred ";
    case '2': expanded = expanded + "Two-Hundred ";
    case '3': expanded = expanded + "Three-Hundred ";
    case '4': expanded = expanded + "Four-Hundred ";
    case '5': expanded = expanded + "Five-Hundred ";
    case '6': expanded = expanded + "Six-Hundred ";
    case '7': expanded = expanded + "Seven-Hundred ";
    case '8': expanded = expanded + "Eight-Hundred ";
    case '9': expanded = expanded + "Nine-Hundred ";
    switch(arr[1]) {
    case '0': {
    switch(arr[0]) {
    case '0': expanded = expanded + "";
    case '1': expanded = expanded + "and One";
    case '2': expanded = expanded + "and Two";
    case '3': expanded = expanded + "and Three";
    case '4': expanded = expanded + "and Four";
    case '5': expanded = expanded + "and Five";
    case '6': expanded = expanded + "and Six";
    case '7': expanded = expanded + "and Seven";
    case '8': expanded = expanded + "and Eight";
    case '9': expanded = expanded + "and Nine";
    case '1': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Ten";
    case '1': expanded = expanded + "and Eleven";
    case '2': expanded = expanded + "and Twelve";
    case '3': expanded = expanded + "and Thirteen";
    case '4': expanded = expanded + "and Fourteen";
    case '5': expanded = expanded + "and Fifteen";
    case '6': expanded = expanded + "and Sixteen";
    case '7': expanded = expanded + "and Seventeen";
    case '8': expanded = expanded + "and Eighteen";
    case '9': expanded = expanded + "and Nineteen";
    case '2': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Twenty";
    case '1': expanded = expanded + "and Twenty-One";
    case '2': expanded = expanded + "and Twenty-Two";
    case '3': expanded = expanded + "and Twenty-Three";
    case '4': expanded = expanded + "and Twenty-Four";
    case '5': expanded = expanded + "and Twenty-Five";
    case '6': expanded = expanded + "and Twenty-Six";
    case '7': expanded = expanded + "and Twenty-Seven";
    case '8': expanded = expanded + "and Twenty-Eight";
    case '9': expanded = expanded + "and Twenty-Nine";
    case'3': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Thirty";
    case '1': expanded = expanded + "and Thirty-One";
    case '2': expanded = expanded + "and Thirty-Two";
    case '3': expanded = expanded + "and Thirty-Three";
    case '4': expanded = expanded + "and Thirty-Four";
    case '5': expanded = expanded + "and Thirty-Five";
    case '6': expanded = expanded + "and Thirty-Six";
    case '7': expanded = expanded + "and Thirty-Seven";
    case '8': expanded = expanded + "and Thirty-Eight";
    case '9': expanded = expanded + "and Thirty-Nine";
    case '4': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Fourty";
    case '1': expanded = expanded + "and Fourty-One";
    case '2': expanded = expanded + "and Fourty-Two";
    case '3': expanded = expanded + "and Fourty-Three";
    case '4': expanded = expanded + "and Fourty-Four";
    case '5': expanded = expanded + "and Fourty-Five";
    case '6': expanded = expanded + "and Fourty-Six";
    case '7': expanded = expanded + "and Fourty-Seven";
    case '8': expanded = expanded + "and Fourty-Eight";
    case '9': expanded = expanded + "and Fourty-Nine";
    case '5': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Fifty";
    case '1': expanded = expanded + "and Fifty-One";
    case '2': expanded = expanded + "and Fifty-Two";
    case '3': expanded = expanded + "and Fifty-Three";
    case '4': expanded = expanded + "and Fifty-Four";
    case '5': expanded = expanded + "and Fifty-Five";
    case '6': expanded = expanded + "and Fifty-Six";
    case '7': expanded = expanded + "and Fifty-Seven";
    case '8': expanded = expanded + "and Fifty-Eight";
    case '9': expanded = expanded + "and Fifty-Nine";
    case '6': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Sixty";
    case '1': expanded = expanded + "and Sixty-One";
    case '2': expanded = expanded + "and Sixty-Two";
    case '3': expanded = expanded + "and Sixty-Three";
    case '4': expanded = expanded + "and Sixty-Four";
    case '5': expanded = expanded + "and Sixty-Five";
    case '6': expanded = expanded + "and Sixty-Six";
    case '7': expanded = expanded + "and Sixty-Seven";
    case '8': expanded = expanded + "and Sixty-Eight";
    case '9': expanded = expanded + "and Sixty-Nine";
    case '7': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Seventy";
    case '1': expanded = expanded + "and Seventy-One";
    case '2': expanded = expanded + "and Seventy-Two";
    case '3': expanded = expanded + "and Seventy-Three";
    case '4': expanded = expanded + "and Seventy-Four";
    case '5': expanded = expanded + "and Seventy-Five";
    case '6': expanded = expanded + "and Seventy-Six";
    case '7': expanded = expanded + "and Seventy-Seven";
    case '8': expanded = expanded + "and Seventy-Eight";
    case '9': expanded = expanded + "and Seventy-Nine";
    case '8': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Eighty";
    case '1': expanded = expanded + "and Eighty-One";
    case '2': expanded = expanded + "and Eighty-Two";
    case '3': expanded = expanded + "and Eighty-Three";
    case '4': expanded = expanded + "and Eighty-Four";
    case '5': expanded = expanded + "and Eighty-Five";
    case '6': expanded = expanded + "and Eighty-Six";
    case '7': expanded = expanded + "and Eigthy-Seven";
    case '8': expanded = expanded + "and Eighty-Eight";
    case '9': expanded = expanded + "and Eighty-Nine";
    case '9': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Ninety";
    case '1': expanded = expanded + "and Ninety-One";
    case '2': expanded = expanded + "and Ninety-Two";
    case '3': expanded = expanded + "and Ninety-Three";
    case '4': expanded = expanded + "and Ninety-Four";
    case '5': expanded = expanded + "and Ninety-Five";
    case '6': expanded = expanded + "and Ninety-Six";
    case '7': expanded = expanded + "and Ninety-Seven";
    case '8': expanded = expanded + "and Ninety-Eight";
    case '9': expanded = expanded + "and Ninety-Nine";
    if(length == 1) {
    System.out.println("Length of 1 working....");
    switch(arr[1]) {
    case '0': {
    switch(arr[0]) {
    case '0': expanded = expanded + "";
    case '1': expanded = expanded + "and One";
    case '2': expanded = expanded + "and Two";
    case '3': expanded = expanded + "and Three";
    case '4': expanded = expanded + "and Four";
    case '5': expanded = expanded + "and Five";
    case '6': expanded = expanded + "and Six";
    case '7': expanded = expanded + "and Seven";
    case '8': expanded = expanded + "and Eight";
    case '9': expanded = expanded + "and Nine";
    case '1': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Ten";
    case '1': expanded = expanded + "and Eleven";
    case '2': expanded = expanded + "and Twelve";
    case '3': expanded = expanded + "and Thirteen";
    case '4': expanded = expanded + "and Fourteen";
    case '5': expanded = expanded + "and Fifteen";
    case '6': expanded = expanded + "and Sixteen";
    case '7': expanded = expanded + "and Seventeen";
    case '8': expanded = expanded + "and Eighteen";
    case '9': expanded = expanded + "and Nineteen";
    case '2': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Twenty";
    case '1': expanded = expanded + "and Twenty-One";
    case '2': expanded = expanded + "and Twenty-Two";
    case '3': expanded = expanded + "and Twenty-Three";
    case '4': expanded = expanded + "and Twenty-Four";
    case '5': expanded = expanded + "and Twenty-Five";
    case '6': expanded = expanded + "and Twenty-Six";
    case '7': expanded = expanded + "and Twenty-Seven";
    case '8': expanded = expanded + "and Twenty-Eight";
    case '9': expanded = expanded + "and Twenty-Nine";
    case'3': {
    switch(arr[0]) {
    case '0': expanded = expanded + "and Thirty";
    case '1': exp

    if(length == 3) {
    System.out.println("Length of 3, working...");
    //Assume we are starting at the one thousands
    //Since 0 is 1, we need to test for 3 for 1,000s not 4
    switch(arr[3]) {Arrays in Java start at index zero, so if the length of an array is 3, then the valid indices are 0,1 and 2.
    You also can make the whole thing much cleaner with using the way things are phrased in English - you say "one million, one hundred and fifty thousand, two hundred and seventy six pounds, thirty seven pence", so if you write a routine which converts an integer between 0 (inclusive) and 1000 (exclusive), and call that for the millions, thousands, units and cents in turn. You also might want to use localized strings in an array instead of coding everything as a sequence of switch statements.

  • Data Logging a programmatically created shared variable of cluster or array datatype into citadel DB

    Hi,
    Is there a way to log a programmatically created shared variable of cluster or array datatype into citadel DB?
    I have attempted to programmatically create a shared variable of type 'double' and was able to successfully log the same into Citadel DB. In the attachment, Please refer to the attached project SV_TC.lvproj and specifically to SV_W.vi for the code that i have used (W.png file shows the dB in MAX and shared variable in NI Distributed System Manager)
    However when i tried the same approach to create a shared variable 'array of double', i noticed that traces are not getting created and hence data logging isn't happening into the Citadel DB. I was however able to write and read the shared variable array without issues. The same is true with cluster datatype also. Please refer to SN_NW.vi for the code that i have used - only difference from SV_W.vi is that i have tried to create a shared variable of type 'array of double'
    One observation is that if i create an 'array of double' or cluster in a shared variable library using the project explorer and deploy, i could see that these being logged into Citadel DB.
    Hence i want to understand what could be done to achieve the same programmatically? Could you please advice?
    Regards,
    Sridhar
    Attachments:
    SV_TC.zip ‏3925 KB

    Why is the transaction happening over remote?
    Because we need the information to be on our database immediately when they submit it.
    I don't know anything about streams or replication.....
    The web database is run by the company that hosts our web site. We use PL/SQL to show the pages and output the html. It fetches the data the customer is requesting from our database, but I'm struggling to get the best way to insert into our database from there.

Maybe you are looking for

  • Iweb linking to web gallery

    is tehre a way to link to a web gallery and not have the MY GALLERY button show up. I only want the link to open one album and not allow access to all my albums.

  • Cisco 9201 Routing between interfaces

    Done Thanks

  • How can use ' Vector ' in JSP

    I use rs.getString(1); can get three strings like "12:00-13:00", "01:00-02:00", "02:00-03:00" from sql 2000. I would like these time one by one, if it equals user select. System will show the message...then I use following code...but doesn't work bec

  • Connection.getMetaData( ) exception

    Greetings; I'm trying to implement the following code, but a SQL exception is thrown ( message is NULL). DatabaseMetaData dmd = conn.getMetaData(); Works fine in the IDE, and as a stand alone application. Deploys to Oracle8i using OCI8 thin driver wi

  • Resetting router and logging back in

    I am not able to login to my router through the web-based login.  I have tried resetting it several times, but when the username & password dialog box comes up, and I leave the username blank and enter admin as the password, I still cannot login.  PL