Help adding to an array
Hello,
I've added an Add button to a GUI. This feature should enable users to add itemName, numberUnitsStock, unitPrice, and itemNumber(one more than the previous last item). Can anyone help? I'm thinking that I need to extend the array size first and then figure a way to get the aforementioned included in the array. Any help would be greatly appreciated.
public class DVD6
protected int itemNumber; // item number
protected String itemName; // name of product
protected int numberUnitsStock; // number of units in stock
protected double unitPrice; // price of each unit
// constructor initializes DVD with int, String, and double as argument
public DVD6 (int itemNumber, String itemName, int numberUnitsStock, double unitPrice)
this.itemNumber = itemNumber; // initializes itemNumber
this.itemName = itemName; // initializes itemName
this.numberUnitsStock = numberUnitsStock; // initializes numberUnitsStock
this.unitPrice = unitPrice; // initializes unitPrice
} // end constructor
// method to set the item number
public void setitemNumber (int itemNumber)
itemNumber = itemNumber; // store the item number
} // end method setitemNumber
// method to retrieve the item number
public int getitemNumber()
return itemNumber;
} // end method getitemNumber
// method to set the name of product
public void setitemName (String itemName)
itemName = itemName; // store the name of product
} // end method setitemName
// method to retrieve the itemName
public String getitemName()
return itemName;
} // end method getitemName
// method to set the number of units in stock
public void setnumberUnitsStock (int numberUnitsStock)
numberUnitsStock = numberUnitsStock; // store the number of units in stock
} // end method setnumberUnitsStock
// method to retrieve the number of units in stock
public int getnumberUnitsStock()
return numberUnitsStock;
} // end method getnumberUnitsStock
// method to set the price of each unit
public void setunitPrice (double unitPrice)
unitPrice = unitPrice; // store the price of each unit
} // end method setunitPrice
// method to retrieve the price of each unit
public double getunitPrice()
return unitPrice;
} // end method getunitPrice
// method to retrieve the inventoryValue
public double getinventoryValue()
return (numberUnitsStock * unitPrice); // multiply numbers
} // end method getinventoryValue
// method to get the value of entire inventory
public static double getTotalValueOfAllInventory (DVD6 [] inv)
double tot = 0.0;
for (int i = 0; i < inv.length; i++)
tot += inv.getinventoryValue();
return tot;
} // end method getTotalValueOfAllInventory
public static DVD6[] sort(DVD6 [] inventory)
DVD6 temp[] = new DVD6[1];
// sort
for (int j = 0; j < inventory.length - 1; j++)
for (int k = 0; k < inventory.length - 1; k++)
if (inventory[k].getitemName().compareToIgnoreCase(inventory[k+1].getitemName()) > 0 )
temp[0] = inventory[k];
inventory[k] = inventory[k+1];
inventory[k+1] = temp[0];
} // end if
} // end for
} // end for
return inventory;
public String toString()
StringBuffer sb = new StringBuffer();
sb.append("Item number: \t").append(itemNumber).append("\n");
sb.append("DVD Title: \t").append(itemName).append("\n");
sb.append("Units in stock: \t").append(numberUnitsStock).append("\n");
sb.append("Price of unit: \t").append(String.format("$%.2f%n", unitPrice));
sb.append("Inventory value of product: \t").append(String.format("$%.2f%n", getinventoryValue()));
return sb.toString();
} // end class DVD6
public class DVDs6 extends DVD6
private String genre; // genre of DVD
private double restockingFee; // percentage added to product's inventory value
//constructor
public DVDs6(String genre, int itemNumber, String itemName,
int numberUnitsStock, double unitPrice)
super(itemNumber, itemName, numberUnitsStock, unitPrice);
this.genre = genre;
// method to set the genre of DVD
public void setgenre (String genre)
genre = genre; // store the genre
} // end method setgenre
// method to retrieve the genre
public String getgenre()
return genre;
} // end method getgenre
// method to retrieve the restockingFee
public double getrestockingFee()
return (super.getunitPrice() * 0.05);
} // end method getrestockingFee
// Inventory value + restocking fee
public double getinventoryValue()
return super.getinventoryValue() + (super.getunitPrice() * 0.05);
// String representation
public String toString()
StringBuffer sb = new StringBuffer();
sb.append("DVD Genre: \t").append(genre).append("\n");
sb.append("Restocking fee: \t").append(String.format("$%.2f%n", getrestockingFee()));
sb.append(super.toString());
return sb.toString();
} // end class
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.*;
public class DVD6Test
static int itemDisplay = 0; // ActionEvent variable
// main method begins execution of Java application
public static void main ( String args[] )
double total = 0; // variable to get entire inventory value
JPanel bttnJPanel; // panel to hold buttons
JLabel label; // JLabel for company logo
// instantiate object
final DVDs6[] a = new DVDs6[5];
a[0] = new DVDs6("Action/Drama" , 041, "Rocky", 20, 15.00);
a[1] = new DVDs6("Action" , 006, "Braveheart", 20, 20.00);
a[2] = new DVDs6("Action" , 001, "Armageddon", 10, 10.00);
a[3] = new DVDs6("Action" , 060, "Scarface", 15, 18.00);
a[4] = new DVDs6("Action" , 021, "Goodfellas", 5, 15.00);
DVDs6 temp[] = new DVDs6[1];
// sort
for (int j = 0; j < a.length - 1; j++)
for (int k = 0; k < a.length - 1; k++)
if (a[k].getitemName().compareToIgnoreCase(a[k+1].getitemName()) > 0 )
temp[0] = a[k];
a[k] = a[k+1];
a[k+1] = temp[0];
} // end if
} // end for
} // end for
// value of entire inventory
for (int i = 0; i < a.length; i++)
total += a.getinventoryValue();
// setup buttons
JButton firstBtn = new JButton("First"); // button to display first inventory item
JButton prevBtn = new JButton("Previous"); // button to display previous inventory item
JButton nextBtn = new JButton("Next"); // button to display next inventory item
JButton lastBtn = new JButton("Last"); // button to display last inventory item
JButton addBtn = new JButton("Add"); // button to add item to inventory
JButton delBtn = new JButton("Delete"); // button to delete item from inventory
JButton modBtn = new JButton("Modify"); // button to modify DVD item
JButton saveBtn = new JButton("Save"); // button to save inventory to a .dat file
JButton srchBtn = new JButton("Search"); // button to search for item by name
// create and setup panel to hold buttons
bttnJPanel = new JPanel();
bttnJPanel.setLayout(new GridLayout(1, 4));
bttnJPanel.add(firstBtn);
bttnJPanel.add(prevBtn);
bttnJPanel.add(nextBtn);
bttnJPanel.add(lastBtn);
bttnJPanel.add(addBtn);
bttnJPanel.add(delBtn);
bttnJPanel.add(modBtn);
bttnJPanel.add(saveBtn);
bttnJPanel.add(srchBtn);
//JLabel constructor
Icon logo = new ImageIcon("C:/logo.jpg"); // load graphic
label = new JLabel(logo); // create logo label
label.setText("Java Solutions Inc."); // set company name
// text area and frame setup for product display
final JTextArea textArea;
textArea = new JTextArea(a[0] + "\n");
textArea.append("\nValue of entire inventory: " + new java.text.DecimalFormat("$0.00").format(total) + "\n\n");
textArea.setEditable(false); // uneditable text
JFrame dvdFrame = new JFrame(); // JFrame container
dvdFrame.setLayout(new BorderLayout()); // set layout
dvdFrame.getContentPane().add(new JScrollPane(textArea), BorderLayout.CENTER); // add text area to frame
dvdFrame.getContentPane().add(bttnJPanel, BorderLayout.SOUTH); // adds buttons to frame
dvdFrame.getContentPane().add(label, BorderLayout.NORTH); // add company logo to JFrame
dvdFrame.setTitle("DVD Inventory"); // title of frame
dvdFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // terminate upon close
dvdFrame.setSize(800, 575); // set size
dvdFrame.setLocationRelativeTo(null); // set location
dvdFrame.setVisible(true); // display the window
// inner class to handle button events
firstBtn.addActionListener(new ActionListener() // register event handler
public void actionPerformed(ActionEvent event) // process button event
itemDisplay = 0;
textArea.setText(a[itemDisplay] + "\n");
prevBtn.addActionListener(new ActionListener() // register event handler
public void actionPerformed(ActionEvent event) // process button event
--itemDisplay;
if (itemDisplay < 0)
itemDisplay = (itemDisplay + a.length) % a.length;
textArea.setText(a[itemDisplay]+"\n");
nextBtn.addActionListener(new ActionListener() // register event handler
public void actionPerformed(ActionEvent event) // process button event
itemDisplay++;
if (itemDisplay >= a.length)
itemDisplay = (itemDisplay) % a.length;
textArea.setText(a[itemDisplay]+"\n");
lastBtn.addActionListener(new ActionListener() // register event handler
public void actionPerformed(ActionEvent event) // process button event
itemDisplay = a.length-1;
textArea.setText(a[itemDisplay]+"\n");
addBtn.addActionListener(new ActionListener() // register event handler
public void actionPerformed(ActionEvent event) // process button event
DVDs6[] as = new DVDs6[a.length + 1]; // increase array length
textArea.setText(new String());
} // end method main
} // end class
check this link,
http://www.java2s.com/Tutorial/Java/0140__Collections/0160__ArrayList.htm
U have lot of collections. always user like this
List user=new ArrayList();
user.add("username");
This code helps u to make changes in future. In future, if u want to change from ArrayList to Vector then u can just easily make a modification like this.
List user=new Vector();
user.add("username");
need to make changes only in the declaration part.
Similar Messages
-
Sorting values added to an array
Hi,
I've written some code to sort value in an array as I add them, but I can't get it to work properly. So far I have:
public boolean add(int next)
int last, temp, previous;
if (size < 1) // checks whether any values have been added to determine correct value for previous.
previous = size;
else
previous = size - 1;
if (size < arraySize) //determines whether array is full or not
last = numberList[previous];
if (next > last)
numberList[size] = next;
size++;
else if (next < last)
temp = last;
numberList[previous] = next;
numberList[size] = temp;
size++;
numberAdded = true;
return numberAdded;
}Which does add the numbers, but they aren't arranged into the proper order. When I look over it I can't see anything that stands out as being wrong, so I was wondering whether anybody could see anything?
Thanks for your help,endasil wrote:
nickd_101 wrote:
I don't want a loop in this case, as i want to put the values into the correct position (with respect to the previous one) as they're added into the array. Basically, my idea is that the previous value is checked against the new value and then they are swapped if the previous value is larger than the new or kept as is if not.So you're saying that if you added
1, 2, 4, 5, 3
you'd want the resultant order to be
1, 2, 4, 3, 5?
Because by your logic that's what would happen. The most that can ever happen by your logic is that a new entry would be at most 1 away from the end of the array.
P.S. use an SortedSet, given that your code doesn't allow duplicate values anyway.
Edited by: endasil on Nov 19, 2007 2:15 PMThanks for the response. What I meant is that I would eventually want it in ascending order 1,2,3,4,5. What I thought I was doing was sorting the comparing the new value with the preceding everytime a number was added so that it would always go in consecutive order. So, for example say the numbers were added to the array one by one in the order 3,5,4,1,2; 3 would be compared to 5 and there would be no change in the position. As i've typed this out i've just realised the massive logical error i've made! Could you point me in the right direction to get this to work as i'm new to this. I've managed to get a pre-defined array sorting as normal, but for this i need to sort everytime I add a new value?
Thanks again -
I need help adding a mouse motion listner to my game. PLEASE i need it for
I need help adding a mouse motion listner to my game. PLEASE i need it for a grade.
i have a basic game that shoots target how can use the motion listner so that paint objects (the aim) move with the mouse.
i am able to shoot targets but it jus clicks to them ive been using this:
public void mouse() {
dotX = mouseX;
dotY = mouseY;
int d = Math.abs(dotX - (targetX + 60/2)) + Math.abs(dotY - (targetY + 60/2));
if(d < 15) {
score++;
s1 = "" + score;
else {
score--;
s1 = "" + score;
and here's my cross hairs used for aiming
//lines
page.setStroke(new BasicStroke(1));
page.setColor(Color.green);
page.drawLine(dotX-10,dotY,dotX+10,dotY);
page.drawLine(dotX,dotY-10,dotX,dotY+10);
//cricle
page.setColor(new Color(0,168,0,100));
page.fillOval(dotX-10,dotY-10,20,20);
please can some1 help meplease can some1 help meNot when you triple post a question:
http://forum.java.sun.com/thread.jspa?threadID=5244281
http://forum.java.sun.com/thread.jspa?threadID=5244277 -
Need help adding schedule to xcode 4
I need help adding a tour schedule for an iphone app building an app for 13 djs and they want thier tour schedules added these need to be updated monthly is there a way to add this????
I don't know if this is the easiest way but it works for me. I connect the DVD player to my camcorder (so it's the 3 plugs yellow/red/white on one end and a single jack into the camera). Then I connect my camcorder to the computer (I think it's through a firewire port). Then I just play the DVD and the footage is digitized via the camcorder and I import it into iMovie 4 as it's playing. I believe the camcorder is just in VCR mode.
I have also used this method to transfer VHS tapes onto DVDs via the camera by connecting the VCR to the camera.
I haven't had much luck with movies over about 40 minutes on iMovie. But if it's home movies, there may be a logical break. Do maybe 20 minute segments (it's also really easy on iMovie to add a soundtrack if these are OLD films with no sound.
As you can see, I'm low tech!
Good luck!
Powerbook G4 Mac OS X (10.3.9) -
SCVMM 2012 R2 - Adding A Storage Array
Good Afternoon,
I am having a little bit of a problem adding a Storage Array to SCVMM for my hosts. To quickly go through everything, I have done the following:
- Added iSCSI Storage Device through SMI-S
- Added LUN
- Allocated Storage Pool
-Added iSCSI array to host
Now here is where I think I went wrong: I removed the provider to make some changes to the SAN and readded it, however I didn't destroy the sessions on the hosts.
I followed the procedure again to readd the iSCSI array however now I don't have the "Add iSCSI Array" available in the host properties anymore.
Has anyone experienced this before?
Thanks,
Dan
----------------------------------------- Dan SheppardIt is hard to tell why you are experiencing this.
What Update Rollup have you installed, and which version of VMM is this?
Did you follow the same steps as described in this blog? Ensure that all the mapping is correct so that the hosts actually will have access to the storage scope.
http://kristiannese.blogspot.no/2013/06/storage-management-with-datacenter.html
-kn
Kristian (Virtualization and some coffee: http://kristiannese.blogspot.com ) -
Help adding Input language Russian on 8330
I'm on Verizon Curve 4.3.
Can anyone help adding Russian as input language?
Thanks.
Greg.
Solved!
Go to Solution.Verizon should have a multi launguage package on the website.
If not you can go here:
http://na.blackberry.com/eng/support/downloads/download_sites.jsp
Make sure you get the same version that is on your phone currently so you ca maintain support.
Let us know when you get it, and well help you load it.
Thanks
Click Accept as Solution for posts that have solved your issue(s)!
Be sure to click Like! for those who have helped you.
Install BlackBerry Protect it's a free application designed to help find your lost BlackBerry smartphone, and keep the information on it secure. -
I am trying to dual boot Arch Linux and Ubuntu. When I try to boot there is no option for Arch. I have added it to the menu.lst file in ubuntu. Arch is installed on sdb1 according to sudo fdisk -l I need help!
Fdisk -l
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb38ab38a
Device Boot Start End Blocks Id System
/dev/sda1 * 1 9544 76662148+ 83 Linux
/dev/sda2 9545 9729 1486012+ 5 Extended
/dev/sda5 9545 9729 1485981 82 Linux swap / Solaris
Disk /dev/sdb: 40.9 GB, 40992473088 bytes
255 heads, 63 sectors/track, 4983 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0002eb1f
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 4891 39286926 83 Linux
Disk /dev/sdc: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000ea9be
Device Boot Start End Blocks Id System
/dev/sdc1 1 30401 244196001 7 HPFS/NTFS
I think Arch is on the 40GB partition
Menu.lst
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 0
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu
# Pretty colours
#color cyan/blue white/blue
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
## password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
# examples
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=ce3a864f-3f72-480b-96b3-54516b307170 ro
## default grub root device
## e.g. groot=(hd0,0)
# groot=ce3a864f-3f72-480b-96b3-54516b307170
## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true
## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false
## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash
## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false
## Xen hypervisor options to use with the default Xen boot option
# xenhopt=
## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all
## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
## indomU=true
## indomU=false
# indomU=detect
## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true
## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false
## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false
## ## End Default Options ##
title Ubuntu 9.04
uuid ce3a864f-3f72-480b-96b3-54516b307170
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=ce3a864f-3f72-480b-96b3-54516b307170 ro quiet splash
initrd /boot/initrd.img-2.6.28-11-generic
quiet
#title Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)
#uuid ce3a864f-3f72-480b-96b3-54516b307170
#kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=ce3a864f-3f72-480b-96b3-54516b307170 ro single
#initrd /boot/initrd.img-2.6.28-11-generic
#title Ubuntu 9.04, memtest86+
#uuid ce3a864f-3f72-480b-96b3-54516b307170
#kernel /boot/memtest86+.bin
#quiet
# (0) Arch Linux
title Arch Linux
root (hd1,0)
kernel /vmlinuz26 root=/dev/sda3 ro
initrd /kernel26.img
### END DEBIAN AUTOMAGIC KERNELS LIST
title Arch
rootnoverify (hd0,1)
chainloader +1 -
Help adding new Macs to the household, creating shared drive for iTunes,
I have a few questions:
My husband and I recently both got MacBook Pros. Our former set-up was a iMac which backs up to a 500 G Time Capsule. We have a large iTunes library and iPhoto library on the iMac. The iMac is going to turn in to the kids computer. I would like to do the following:
1. transfer photos to my MBP (#1). Will the Time Machine backup for the iMac become significantly smaller, making room for the soon to be larger backup of the MBP #1? Little confused how that is going to work.
2. have shared access to iTunes library? basically it would be nice for all 3 computers to have the complete iTunes library, but I would also like to backup all 3 computers using Time Machine and don't want to have triplicates of the library. I was trying to figure out if the way to go is to put the iTunes on a shared drive on the Time Capsule, but is there a way for the 3 computers to 'sync' to the shared drive when new music is added? Finally, if the iTunes is within a shared drive does that mean it won't be backed up?
Much appreciation and thanks to anyone who can help make sense of this.Update: Downloaded free version of Syncopation, and am hopeful this is going to some what solve my iTunes issue.
New question would be: when creating the Time Machine backups for MBP#1 and MBP #2 can I NOT back up the iTunes folders? That would save approx. 36G on each of these backups, right? 72G total of the Time Capsule space. And the assumption is that with Syncopation, as long as the iMac iTunes is backed up then, you have everything. -
Help adding new WLC to existing ACS
Hi All,
I need help with this.
This network has a working WLC that authenticates wireless users against an ACS by MAC address. It works fine.
I need to add a new WLC.
I added the WLC, the APs connect to the WLC fine, but the users get limited connectivity and we've found out that is because the new WLC is getting authentication errors against the ACS.
The configuration of the new WLC is exactly the same as the current working WLC and both controllers show as AAA clients on the ACS.
I want to know if somebody can point me out in the right direction to solve this.
There's connectivity fine between all devices (as far as PING goes), and there's no Firewall or filters in between.
The difference I see on both WLCs is that on the working one (WLC1), under Security - AP Policies, we see the AP Authorization List with the MAC addresses/cert type/hash. We don't get this information on the non-working WLC (attached document shows both)
Also in the attached document, I'm sending the errors I get no the WLC2 controller.
Any help is greatly appreciated.
Federico.Federico,
I didn't get you when you say that you see only One WLC under groupsetup/Mac address. Could you please elaborate this?
Also, if you don't know see any NAR configured under shared profile component then check inside the group/user setup there must be either ip based or CLI/DNIS based NAR configured for WLC's and looking at failed attempts it seem that action is denied.
HTH
Regds,
JK
Do rate helpful posts- -
Need help on passing an array to java routine from PL/SQL
I got a math routine in java and the idea is have an array of integer and the java routine does some computatoin and then pass the array back to pl/sql
and I google the web most code is calling pl/sql from java but not the other way round. any help will be really appreciated.
{code}
package tst;
import java.util.*;
public class plsql3 {
private final static int factor1 = 2;
public static void getFib2(int[] in, int[] out, int k){
for (int i=0;i<=k-1;i++){
out[i]= in[i] * factor1;
public static void main(String[] arg){
int[] in2 = {1,2,3,4,5};
int[] out2= {0,0,0,0,0};
getFib2(in2,out2,2);
for ( int j = 0 ; j <= out2.length-1;j++) {
System.out.println(out2[j]);
{code}
{code}
CREATE or replace PROCEDURE getfib5 (x IN OUT numlist, y IN OUT numlist, k in number)
AS LANGUAGE JAVA
NAME 'tst.plsql3.getFib2(int[], int[],int)';
set serveroutput on format wraped;
declare
in2 numlist := numlist(1,2,3,4,5,6);
out2 numlist := numlist(0,0,0,0,0,0);
begin
--in2(0) := 1;
--in2(1) := 2;
--in2(2) := 3 ;
for i in 1..in2.count
loop
dbms_output.put_line(in2(i));
end loop;
for i in 1..in2.count
loop
dbms_output.put_line(out2(i));
end loop;
getFib5(in2,out2,2);
for i in 1..in2.count
loop
dbms_output.put_line(in2(i));
end loop;
for i in 1..in2.count
loop
dbms_output.put_line(out2(i));
end loop;
--dbms_output.put_line(in2.count);
end;
{code}
{code}
javac -source 1.5 -target 1.5 tst/plsql3.java
{code}
Error report:
ORA-00932: inconsistent datatypes: expected a value at argument position 1 that is convertible to a Java int got an Oracle named TYPE (ADT, REF etc)
ORA-06512: at "TK1.GETFIB5", line 1
ORA-06512: at line 18
00932. 00000 - "inconsistent datatypes: expected %s got %s"
*Cause:
*Action:http://asktom.oracle.com/pls/asktom/f?p=100:11:::::P11_QUESTION_ID:3696816290928
-
Context sensitive help, adding mapping ID
I am updating a HTML help project file and having trouble adding additional mapping ID's. The .chm file works fine within the application we are using using the original data. However when I add to the .h file to add additional mapping ID's, its not working (only on the new mapping ID's I added. When I use the CSH Test application, it works fine. Its when ever I add additional mapping ID's it does not work within the application. So far Adobe hasn't been able to figure it out.
To Clarify:
Original file looks like this: (these work fine within the application - outside of RoboHelp)
Works fine with the CSH Test within Robohelp
#define HIDD_ADMIN_REPORT_9G 906 // 0x0000038a 906
#define HIDD_ADMIN_REPORT_10A 1000 // 0x000003e8 1000
#define HIDD_ADMIN_REPORT_10B 1001 // 0x000003e9 1001
#define HIDD_ADMIN_REPORT_ELAPSED_HOLD 1101 // 0x0000044d 1101
the values I have added: (these don't work within my application, but do work fine with the CSH Test within RoboHelp)
#define HIDD_ADMIN_REPORT_9h 131080
#define HIDD_ADMIN_REPORT_9i 131081
#defineHIDD_ADMIN_REPORT_9J 131082
#define HIDD_ADMIN_REPORT_9k 131083
#define HIDD_ADMIN_REPORT_9L 131084
PART of my question is - what is the // 0x0000038a 906 - mean? when I export the file it doesn't add those values
HELP !
Thanks,
JimTo answer your question, I'm not sure but it may explain why the call works in the CSH Tool but not from the application. It looks like some sort of hexadecimal value. Could you ask one of your developers to take a look and see if it rings a bell?
-
I added a persona, wanted a new one so disabled and removed the old one. I added a new persona, but the old one keeps coming back. Going into tools/add ons does no good because it is not even listed anymore but keeps coming back. I've shut down/restarted, I've searched for answers to this problem.
The data that specifies which persona to display is stored as a pref in the prefs.js file in the Firefox Profile Folder.
Did you try to rename or move the prefs.js file and a possible user.js file to see if that helps?
Are you using the Personas Plus extension, because in that case you need to check the settings in that extension.
You can use this button to go to the Firefox profile folder:
*Help > Troubleshooting Information > Profile Directory: Open Containing Folder -
Added a 2nd Array on my Xserve RAID, Though it's not appearing in disk utilityt
I have an Xserve RAID unit. Up until now I have just been running 1 side of it with 7 drives on RAID 5 = about 4TB. I recently picked up another identical RAID unit with 7 drives to fill out the right hand bay of the unit doubling our capacity. I have installed these and initialised the array which took about 48 hours, it's now showing as online and green lights all the way.
Now I've gone to make use of the extra space but it is not showing as available in the mounted RAID icon on the desktop, nor will the new array appear in disk utility. When I access server admin however, on the overview screen it shows I have 8TB on offer. Contrary to this in the system profiler the 'Fibre Channel Domain 2' is not reporting any SCSI devices unlike 'Fibre Channel Domain 0' - Not sure this is related.
If anyone can help me gain access to the new found 4TB I would be greatly appreciative.it is not showing as available in the mounted RAID icon on the desktop
It won't.
The XServe RAID is really built as two independent RAID controllers and drive sets in one enclosure.
The 7 left-most drives are connected to the top controller, and the 7 right-most drives are connected to the bottom controller. They are independent. There's no way to build a single 14-drive array - the best you can do is build two 7-drive arrays.
What you should find is that if you connect the bottom controller to your server, the second array should appear on the desktop, separate and distinct from your existing volume.
If you really need to expand your volume to cover all 14 drives then you'll need to use software RAID 0 (striping) on the server to meld both of the 7-drive arrays into a single logical volume. -
Need help adding image to datagrid column
Hi,
Can anyone tell me how to add an image to a datagrid column?
I have created a flex library project which contains a mxml component with a datagrid, an item renderer mxml component which rendered the image within the datagrid column depending on the value coming back from the database for that column and a folder 'assets' which hold all the images. When I add the library to my main project and call the mxml component with the datagrid an image place holder is visible in the datagrid column but not the image. However, if I take the image out of the library project and added to an 'assets' folder in the main project the image is displayed in the datagrid column.
It looks like, even though the images are in the flex library project and only the flex library project is trying to display the images in the datagrid, the library project is looking in the main application project folder for the image.
Does anyone know why this is happening and how to fix it?
Thanks in advance for an help,
Xander.I have tried embedding the images in my library but it still didn't work. Also I can't embed the image as I'm using the value of the column to complete the image name, for example in my mxml item renderer component I have the added the following code
<mx:Image source="@Embed(source='assets/' + data.mycolumnvalue + '.png')" tooltip="{data.mycolumnvalue}"/>
but nothing is displayed. -
I need help adding an additional button to a web template
Hello,
I am trying to add an aditional button to a web template I inherited. I am not a web person just trying to fill a gap at the company.
If you look at my test server www.pondviewtech.com I want to add another button above the request demo one. I have tried a bunch of things: making the button smaller, adding a similar line to my index file as the same button, deleting the "Welcome to" text. The best I could get was this www.pondviewtech.com/buttontest.html . I have attached my buttontest.html file. I couldn't figure out how to paste a few lines of code in this page.
I didn't create the template so if it is a mess don't worry about my feelings.
Thanks for any help or suggestions.Change this -
<p><u>Welcome to Automated Compliance Solutions</u></p>
<p><a href="contactacs.htm"><img src="button.png" width="266" height="56" border="0" align="right" /></a></p>
to this -
<p><u>Welcome to Automated Compliance Solutions</u></p>
<p><a href="yourlink.htm"><img src="yourbutton.png" width="266" height="56" border="0" align="right" /></a></p>
<p><a href="contactacs.htm"><img src="button.png" width="266" height="56" border="0" align="right" /></a></p>
Be aware that my suggestion here is NOT valid XHTML, but since you are not a web developer, and the 'invalid' markup that I have suggested will not affect the rendering or operation of the page, I decided to keep it simple for you. In my suggestion, "yourlink.html" refers to the page to which you want this button to link, and "yourbutton.png" refers to the filename of the button image (obviously you'd want to change this to correspond to the filename and extension of the image you have created).
Maybe you are looking for
-
In which table cound i find the info on EDI standard Message type??
Example EDI standard Message type Business process EDIFACT ORDERS Purchase order INVOIC Invoice ANSI X12 850 Purchase order 810 Invoice Like those 850..810..etc info, i dont know from which table could i find the relat
-
The APP STORE app on the iPhone 4S not working correctly for UPDATES now.
It used to be, when I had APPS that needed to be updated, I would see a badge on the APP STORE icon with the number of apps that needed to be updated. Then I could tap on the icon for the APP STORE, and I would see the UPDATE button showing the badge
-
Setting Column selection on transposed table
Hi, I have a problem with a jTable I am using in a program. The table has a rotate feature which works correctly. To do this I am reversing the getColCount() and getRowCount() methods within a seperate tableModel and setting this model on the table w
-
NHL Gamecenter AppleTv3 in Scandinavia?
Can anyone help someone who lives in Scandinavia to get nhl game center on Apple TV3? How do I go step by step? Having understood that I need to change dns address. Will the nhl app up automatically after restart and on / off power? Can I pay for acc
-
Playing MUVO through car stereo, ie: iTrip on iPod
Hi i was wondering if there was any plans by creative to bring out an adapter like the iTrip to play the MP3 player through the stereo of my car... or would anyone know if something is already out by creative or someone else that would work on my MUV