Need help with Cluster of Buttons displaying a message to which button is being pressed.
Create a VI with a cluster of six buttons labeled Option1…Option6. When executing, the VI should wait for the user to press one of the buttons. When a button is pressed, use the Display Message To User Express VI to indicate which option was selected. Repeat this process until the user presses the Stop button. The parameters of the problem needs me to use a while loop, case structure, a shift register and search 1d array. I'm just having trouble setting up my case structures and how to get the search 1d array to work with the cluster to find which button was pressed. I've attached a picture of my VI and also a VI I made without the cluster that does what I want the Cluster VI to do which is to recognize the button being pressed and bring up a prompt.
Solved!
Go to Solution.
Attachments:
Button Pressed.jpg 127 KB
Buttons Pressed No Cluster.jpg 189 KB
Okay so i moved the cluster into the while loop and wired a boolean true constant to the element of the search 1d array and now I can at least get the prompt for button 1 to display, but when I press the other buttons which I have set up the same way as button 1 I get no prompts so how can I get it to recognize the other buttons. Am I implementing the shift register incorrectly?
Attachments:
Button Pressed 2.jpg 115 KB
Similar Messages
-
Need help with cluster rs and rg status
Hello,
Many a times I found, when my resource is configured a little incorrectly, then when I enable the Resource (RG is already online)
then
resource status and status message becomes "*Starting*" " *Unknown Starting*" respectively and resource group Status becomes "*Pending Online*"
In this case it happens that Resource groups fails over from one node to other and then atttempts to restart the RG/RS but as the resource is configured incorrectly, it will never be online.
Is there any solution to stop cluster processes to stop doing this and just make everything offline immediately rather than waiting for cluster processes to give up after long long time.
If you need any other information from, please let me know.
Please help!
Thanks!!That is a quite complex question. In a nutshell and this is only my understanding:
quiesce - stops the RG and prevents it from restarting and failover; afterwards it is still under cluster control
suspend - is more moving a RG out of cluster control, so that you can fiddle with the resources without the cluster interfering with this work. At the end you have to resume RG. The details from the man page - see the -k option, which i had forgotten in my original reply.
quiesce: This command stops a resource group from continuously
switching from one node or zone to another node or zone
if a START or STOP method fails.
Use the -k option to kill methods that are running on
behalf of resources in the affected resource groups. If
you do not specify the -k option, methods are allowed to
continue running until they exit or exceed their config-
ured timeout.
suspend:
Suspends the automatic recovery actions on and quiesces
the specified resource group....
A suspended resource group is not automatically res-
tarted or failed over until you explicitly issue the
command that resumes automatic recovery. Whether online
or offline, suspended data services remain in their
current state.
THere might be some subtleties that need to be explored.
Hartmut -
Need Help with boot camp install, keep getting message can not install need
Hi Folks,
I keep getting a message that the boot camp assistant can not install needs firmware update. All updates are currently installed. I have tried all available updates and hey ell me the computer doesn't need them????
Any help that you may provide is greatly appreciated.
Jack
P.S. The computer is an Imac early 2006 1.83 gb.
Machine Name: iMac
Machine Model: iMac4,1
CPU Type: Intel Core Duo
Number Of Cores: 2
CPU Speed: 1.83 GHz
L2 Cache (shared): 2 MB
Memory: 1 GB
Bus Speed: 667 MHz
Boot ROM Version: IM41.0039.B00
Serial Number: W86220MSU2N
SMC Version: 1.1f5You do not have the firmware update installed. You only have the SMC firmware update. Boot Camp requires this firmware update.
-
Hi, I'm not sure if I'm allowed to post questions on this forum but I can't find anywhere to talk to helpful people about programming.
I'm making a dnd interface for JComponents. So far I've made a simple program that has a Component that can be lifted from a container and braught to the glass pane then later moved to anywhere on the screen and dropped into the container below it. Here's where my problems come:
1) Rite now my 'Movable Component' is a JPanel which is just colored in. I want to either take a Graphic2d from a JComponent/Component and draw it on the JPanel or change the JPanel to the component I want to paint and disable the component.
The problem with getting the Graphics2d is that if the component isn't on the screen it doesn't make a graphic object. I tried messing with the ui delicate and overriding parental methods for paintComponent, repaint, and that repaintChildren(forget name) but I haven't had luck getting a good graphics object. I was thinking of, at the beginning of running the program, putting 1 of each component onto the screen for a second then removing it but I'd rather not. I'd also like to change the graphics dynamicly if someone stretches the component there dropping and what not.
The problem with disabling is that it changes some of the visual features of Components. I want to be able to update the Component myself to change how it looks and I don't want disabling to gray out components.
I mainly just dont want the components to do any of there normal fuctions. This is for a page builder, by the way.
Another problem I'm having is that mouseMotionListener is allowing me to select 2 components that are on top of one another when there edges are near each other. I don't know if theres a fix to this other than changing the Java Class.
My next problem is a drop layout manager, but I'm doing pretty good with that rite now. It'll problem just move components out of the way of the falling component.
One last thing I need help with is that I don't want the object that's being carried to go across the menu bar and certain areas. When I'm having the object being carried I have it braught up to the glass pane which allows it to move anywhere. Does anyone have any idea how I could prevent the component from being over the menu bars and other objects? I might have to make 1 panel is the movable area that can then be broken down into the 'component bank', 'building page' and whatever else I'm gonna need.
This is all just test code to get together for when I make the real program but I need to make sure it'll be possible without a lot of hacking of code.
Sorry for the length. Thanks for any help you can give.The trick to making viewable components that have no behaviour, is to render them onto an image of some sort (eg a BufferedImage). You can then display the Image on a JLabel that can be dragged around the desktop.
Here is a piece of code that does the component rendering for you. This particular example uses a fixed component size, but you can modify that as you choose of course...public class JComponentImage
private static GraphicsConfiguration gConfig;
private static Dimension compSize = new Dimension(80, 22);
private static Image image = null;
public static Image getImage(Class objectClass)
if (gConfig == null)
GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gDevice = gEnv.getDefaultScreenDevice();
gConfig = gDevice.getDefaultConfiguration();
image = gConfig.createCompatibleImage(compSize.width, compSize.height);
JComponent jc = (JComponent) ObjectFactory.instantiate(objectClass);
jc.setSize(compSize);
Graphics g = image.getGraphics();
g.setColor(Color.LIGHT_GRAY);
g.fillRect(0, 0, compSize.width, compSize.height);
g.setColor(Color.BLACK);
jc.paint(g);
return image;
}And here is the class that makes the dragable JLabel using the class above...public class Dragable extends JLabel
private static DragSource dragSource = DragSource.getDefaultDragSource();
private static DragGestureListener dgl = new DragMoveGestureListener();
private static TransferHandler th = new ObjectTransferHandler();
private Class compClass;
private Image image;
Dragable(Class compClass)
this.compClass = compClass;
image = JComponentImage.getImage(compClass);
setIcon(new ImageIcon(image));
setTransferHandler(th);
dragSource.createDefaultDragGestureRecognizer(this,
DnDConstants.ACTION_COPY,
dgl);
public Class getCompClass()
return compClass;
}Oh and here is ObjectFactory which simply instantiates Objects of a given class and sets their text to their classname (very crudely)...public class ObjectFactory
public static Object instantiate(Class objectClass)
Object o = null;
try
o = objectClass.newInstance();
catch (Exception e)
System.out.println("ObjectFactory#instantiate: " + e);
String name = objectClass.getName();
int lastDot = name.lastIndexOf('.');
name = name.substring(lastDot + 1);
if (o instanceof JLabel)
((JLabel)o).setText(name);
if (o instanceof JButton)
((JButton)o).setText(name);
if (o instanceof JTextComponent)
((JTextComponent)o).setText(name);
return o;
}Two more classes required by this codepublic class ObjectTransferHandler extends TransferHandler {
private static DataFlavor df;
* Constructor for ObjectTransferHandler.
public ObjectTransferHandler() {
super();
try {
df = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType);
} catch (ClassNotFoundException e) {
Debug.trace(e.toString());
public Transferable createTransferable(JComponent jC) {
Transferable t = null;
try {
t = new ObjectTransferable(((Dragable) jC).getCompClass());
} catch (Exception e) {
Debug.trace(e.toString());
return t;
public int getSourceActions(JComponent c) {
return DnDConstants.ACTION_MOVE;
public boolean canImport(JComponent comp, DataFlavor[] flavors) {
if (!(comp instanceof Dragable) && flavors[0].equals(df))
return true;
return false;
public boolean importData(JComponent comp, Transferable t) {
JComponent c = null;
try {
c = (JComponent) t.getTransferData(df);
} catch (Exception e) {
Debug.trace(e.toString());
comp.add(c);
comp.validate();
return true;
public class ObjectTransferable implements Transferable {
private static DataFlavor df = null;
private Class objectClass;
ObjectTransferable(Class objectClass) {
try {
df = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType);
} catch (ClassNotFoundException e) {
System.out.println("ObjectTransferable: " + e);
this.objectClass = objectClass;
* @see java.awt.datatransfer.Transferable#getTransferDataFlavors()
public DataFlavor[] getTransferDataFlavors() {
return new DataFlavor[] { df };
* @see java.awt.datatransfer.Transferable#isDataFlavorSupported(DataFlavor)
public boolean isDataFlavorSupported(DataFlavor testDF) {
return testDF.equals(df);
* @see java.awt.datatransfer.Transferable#getTransferData(DataFlavor)
public Object getTransferData(DataFlavor arg0)
throws UnsupportedFlavorException, IOException {
return ObjectFactory.instantiate(objectClass);
}And of course the test class:public class DragAndDropTest extends JFrame
JPanel leftPanel = new JPanel();
JPanel rightPanel = new JPanel();
Container contentPane = getContentPane();
Dragable dragableJLabel;
Dragable dragableJButton;
Dragable dragableJTextField;
Dragable dragableJTextArea;
* Constructor DragAndDropTest.
* @param title
public DragAndDropTest(String title)
super(title);
dragableJLabel = new Dragable(JLabel.class);
dragableJButton = new Dragable(JButton.class);
dragableJTextField = new Dragable(JTextField.class);
dragableJTextArea = new Dragable(JTextArea.class);
leftPanel.setBorder(new EtchedBorder());
BoxLayout boxLay = new BoxLayout(leftPanel, BoxLayout.Y_AXIS);
leftPanel.setLayout(boxLay);
leftPanel.add(dragableJLabel);
leftPanel.add(dragableJButton);
leftPanel.add(dragableJTextField);
leftPanel.add(dragableJTextArea);
rightPanel.setPreferredSize(new Dimension(500,500));
rightPanel.setBorder(new EtchedBorder());
rightPanel.setTransferHandler(new ObjectTransferHandler());
contentPane.setLayout(new BorderLayout());
contentPane.add(leftPanel, "West");
contentPane.add(rightPanel, "Center");
public static void main(String[] args)
JFrame frame = new DragAndDropTest("Drag and Drop Test");
frame.pack();
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setVisible(true);
}I wrote this code some time ago, so it won't be perfect but hopefully will give you some good ideas.
Regards,
Tim -
Need Help with Address Display
I need help with APEX.
Here's my situation:
I have a report that displays brief employee information. Among the information displayed is the Address. Right now, it's display as:
Mr X
Employee Id
Accounting Department
Address 1
Mr X
Employee Id
Accounting Department
Address 2
I would like it to display
Mr X
Employee Id
Accounting Department
Address 1
Address 2
1) I have thought of using the Break functionality; however, the function only allows break at column 1, 2, 3. As you can see Address starts at column 4. Also, Address has a few columns; Address Line 1, Address Line 2, City, State, Zipcode.
2) Stragg functions - I'm not sure how to implement it since it has more than 1 columns.
Any ideas?
Thanks in advance
AndrewThe example I gave you, using analytic functions is a simple one.
Now, you are saying:
1. some of the employees may have two adresses?
2. if this is the case, your employee appears in the report twice?
3. you don't want his name, employee id and accounting department to appear twice?
4. only his address has to be displayed?
If the answer to all the questions is yes, this kind of query will help you. I repeat:
SELECT CASE
WHEN LAG (employee_id) OVER (ORDER BY employee_id) =
employee_id
THEN NULL
ELSE employee_name
END employee_name,
CASE
WHEN LAG (employee_id) OVER (ORDER BY employee_id) =
employee_id
THEN NULL
ELSE employee_id
END employee_id,
CASE
WHEN LAG (employee_id) OVER (ORDER BY employee_id) =
employee_id
THEN NULL
ELSE accounting_department
END accounting_department,
street, postal_code, city, state, country
FROM your_employees_table;Give it a try.
Denes Kubicek -
Hello,
I need help with a button. I created a button and set it up
so that when you click and hold it, the button becomes lighter in
color (I used Alpha). I want the button to stay this light color
after i release the click. Right now it goes back to the normal
color when I release the click. Can somone help we this?
Thanks!rpofclt wrote:
> Hello,
>
> I need help with a button. I created a button and set it
up so that when you
> click and hold it, the button becomes lighter in color
(I used Alpha). I want
> the button to stay this light color after i release the
click. Right now it
> goes back to the normal color when I release the click.
Can somone help we
> this?
you can't use the button itself if you want to maintain the
DOWN state after
release as button automatically resets itself once the mouse
lives the HIT zone.
Use movie clip instead and on press simply send it to a frame
where there
is DOWN state like image.
Best Regards
Urami
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami> -
Need help with Flash CS4 buttons/can't get buttons to control anything
Hello,
I need help with Flash CS4. I am making a banner with an animation (Image change into movie clip "3D Spiral") and added buttons but I cannot get the buttons to control the animation. Please help I am frustrated! If someone could help I would be most appreciated.Thank you.
Regards,
Michael J. Sheehan allelois
Date: Mon, 17 Aug 2009 18:48:09 -0600
From: [email protected]
To: [email protected]
Subject: Need help with Flash CS4 buttons/can't get buttons to control anything
Hi there
I'm not sure how you wound up where you did. But you wound up in the Adobe Captivate forums. Please stand by as I move your thread to the Flash forums.
Cheers... Rick
> -
I Need help with iCloud storage. 5gb are free, so I get an email, that mine is just about full. So I upgraded to 20gb and now I want to downgrade back to 5gb.
tthe DONE button doesn't highlight, so my requested can't be completed. Any help will be appreciated.Have you tried rebooting the computer? If not, the next step is to contact iCloud Support. http://www.apple.com/support/icloud/
-
Need help with JTextArea and Scrolling
import java.awt.*;
import java.awt.event.*;
import java.text.DecimalFormat;
import javax.swing.*;
public class MORT_RETRY extends JFrame implements ActionListener
private JPanel keypad;
private JPanel buttons;
private JTextField lcdLoanAmt;
private JTextField lcdInterestRate;
private JTextField lcdTerm;
private JTextField lcdMonthlyPmt;
private JTextArea displayArea;
private JButton CalculateBtn;
private JButton ClrBtn;
private JButton CloseBtn;
private JButton Amortize;
private JScrollPane scroll;
private DecimalFormat calcPattern = new DecimalFormat("$###,###.00");
private String[] rateTerm = {"", "7years @ 5.35%", "15years @ 5.5%", "30years @ 5.75%"};
private JComboBox rateTermList;
double interest[] = {5.35, 5.5, 5.75};
int term[] = {7, 15, 30};
double balance, interestAmt, monthlyInterest, monthlyPayment, monPmtInt, monPmtPrin;
int termInMonths, month, termLoop, monthLoop;
public MORT_RETRY()
Container pane = getContentPane();
lcdLoanAmt = new JTextField();
lcdMonthlyPmt = new JTextField();
displayArea = new JTextArea();//DEFINE COMBOBOX AND SCROLL
rateTermList = new JComboBox(rateTerm);
scroll = new JScrollPane(displayArea);
scroll.setSize(600,170);
scroll.setLocation(150,270);//DEFINE BUTTONS
CalculateBtn = new JButton("Calculate");
ClrBtn = new JButton("Clear Fields");
CloseBtn = new JButton("Close");
Amortize = new JButton("Amortize");//DEFINE PANEL(S)
keypad = new JPanel();
buttons = new JPanel();//DEFINE KEYPAD PANEL LAYOUT
keypad.setLayout(new GridLayout( 4, 2, 5, 5));//SET CONTROLS ON KEYPAD PANEL
keypad.add(new JLabel("Loan Amount$ : "));
keypad.add(lcdLoanAmt);
keypad.add(new JLabel("Term of loan and Interest Rate: "));
keypad.add(rateTermList);
keypad.add(new JLabel("Monthly Payment : "));
keypad.add(lcdMonthlyPmt);
lcdMonthlyPmt.setEditable(false);
keypad.add(new JLabel("Amortize Table:"));
keypad.add(displayArea);
displayArea.setEditable(false);//DEFINE BUTTONS PANEL LAYOUT
buttons.setLayout(new GridLayout( 1, 3, 5, 5));//SET CONTROLS ON BUTTONS PANEL
buttons.add(CalculateBtn);
buttons.add(Amortize);
buttons.add(ClrBtn);
buttons.add(CloseBtn);//ADD ACTION LISTENER
CalculateBtn.addActionListener(this);
ClrBtn.addActionListener(this);
CloseBtn.addActionListener(this);
Amortize.addActionListener(this);
rateTermList.addActionListener(this);//ADD PANELS
pane.add(keypad, BorderLayout.NORTH);
pane.add(buttons, BorderLayout.SOUTH);
pane.add(scroll, BorderLayout.CENTER);
addWindowListener( new WindowAdapter()
public void windowClosing(WindowEvent e)
System.exit(0);
public void actionPerformed(ActionEvent e)
String arg = lcdLoanAmt.getText();
int combined = Integer.parseInt(arg);
if (e.getSource() == CalculateBtn)
try
JOptionPane.showMessageDialog(null, "Got try here", "Error", JOptionPane.ERROR_MESSAGE);
catch(NumberFormatException ev)
JOptionPane.showMessageDialog(null, "Got here", "Error", JOptionPane.ERROR_MESSAGE);
if ((e.getSource() == CalculateBtn) && (arg != null))
try{
if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 1))
monthlyInterest = interest[0] / (12 * 100);
termInMonths = term[0] * 12;
monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest, -termInMonths))));
lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 2))
monthlyInterest = interest[1] / (12 * 100);
termInMonths = term[1] * 12;
monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest, -termInMonths))));
lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 3))
monthlyInterest = interest[2] / (12 * 100);
termInMonths = term[2] * 12;
monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest, -termInMonths))));
lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
catch(NumberFormatException ev)
JOptionPane.showMessageDialog(null, "Invalid Entry!\nPlease Try Again", "Error", JOptionPane.ERROR_MESSAGE);
} //IF STATEMENTS FOR AMORTIZATION
if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 1))
loopy(7, 5.35);
if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 2))
loopy(15, 5.5);
if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 3))
loopy(30, 5.75);
if (e.getSource() == ClrBtn)
rateTermList.setSelectedIndex(0);
lcdLoanAmt.setText(null);
lcdMonthlyPmt.setText(null);
displayArea.setText(null);
if (e.getSource() == CloseBtn)
System.exit(0);
private void loopy(int lTerm,double lInterest)
double total, monthly, monthlyrate, monthint, monthprin, balance, lastint, paid;
int amount, months, termloop, monthloop;
String lcd2 = lcdLoanAmt.getText();
amount = Integer.parseInt(lcd2);
termloop = 1;
paid = 0.00;
monthlyrate = lInterest / (12 * 100);
months = lTerm * 12;
monthly = amount *(monthlyrate/(1-Math.pow(1+monthlyrate,-months)));
total = months * monthly;
balance = amount;
while (termloop <= lTerm)
displayArea.setCaretPosition(0);
displayArea.append("\n");
displayArea.append("Year " + termloop + " of " + lTerm + ": payments\n");
displayArea.append("\n");
displayArea.append("Month\tMonthly\tPrinciple\tInterest\tBalance\n");
monthloop = 1;
while (monthloop <= 12)
monthint = balance * monthlyrate;
monthprin = monthly - monthint;
balance -= monthprin;
paid += monthly;
displayArea.setCaretPosition(0);
displayArea.append(monthloop + "\t" + calcPattern.format(monthly) + "\t" + calcPattern.format(monthprin) + "\t");
displayArea.append(calcPattern.format(monthint) + "\t" + calcPattern.format(balance) + "\n");
monthloop ++;
termloop ++;
public static void main(String args[])
MORT_RETRY f = new MORT_RETRY();
f.setTitle("MORTGAGE PAYMENT CALCULATOR");
f.setBounds(600, 600, 500, 500);
f.setLocationRelativeTo(null);
f.setVisible(true);
}need help with displaying the textarea correctly and the scroll bar please.
Message was edited by:
new2this2020What's the problem you're having ???
PS. -
I need help with this script please ASAP
So I need this to work properly, but when ran and the correct answer is chosen the app quits but when the wrong answer is chosen the app goes on to the next question. I need help with this ASAP, it is due tommorow. Thank you so much for the help if you can.
The script (Sorry if it's a bit long):
#------------Startup-------------
display dialog "Social Studies Exchange Trviva Game by Justin Parzik" buttons {"Take the Quiz", "Cyaaaa"} default button 1
set Lolz to (button returned of the result)
if Lolz is "Cyaaaa" then
killapp()
else if Lolz is "Take the Quiz" then
do shell script "say -v samantha Ok starting in 3…2…1…GO!"
#------------Question 1-----------
display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
set A1 to (button returned of the result)
if A1 is "Apprentices" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#----------Question 2--------
display dialog "Most children were taught
to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
set A2 to (button returned of the result)
if A2 is "Bible" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#------------Question 3---------
display dialog "In the 1730s and 1740s, a religious movement called the_______swept through the colonies." buttons {"Glorius Revolution", "Great Awakening", "The Enlightenment"}
set A3 to (button returned of the result)
if A3 is "Great Awakening" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#-----------Question 4--------
display dialog "_______ was
a famous American Enlightenment figure." buttons {"Ben Franklin", "George Washington", "Jesus"}
set A4 to (button returned of the result)
if A4 is "Ben Franklin" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#----------Question 5-------
display dialog "______ ownership gave colonists political rights as well as prosperity." buttons {"Land", "Dog", "Slave"}
set A5 to (button returned of the result)
if A5 is "Land" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#---------Question 6--------
display dialog "The first step toward guaranteeing these rights came in 1215. That
year, a group of English noblemen forced King John to accept the…" buttons {"Declaration of Independence", "Magna Carta", "Constitution"}
set A6 to (button returned of the result)
if A6 is "Magna Carta" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#----------Question 7--------
display dialog "England's cheif lawmaking body was" buttons {"the Senate", "Parliament", "King George"}
set A7 to (button returned of the result)
if A7 is "Parliament" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#--------Question 8-----
display dialog "Pariliament decided to overthrow _______ for not respecting their rights" buttons {"King James II", "King George", "King Elizabeth"}
set A8 to (button returned of the result)
if A8 is "King James II" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#--------Question 9------
display dialog "Parliament named ___ and ___ as England's new monarchs in something called ____." buttons {"William/Mary/Glorius Revolution", "Adam/Eve/Great Awakening", "Johhny/Mr.Laphalm/Burning of the hand ceremony"}
set A9 to (button returned of the result)
if A9 is "William/Mary/Glorius Revolution" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#---------Question 10-----
display dialog "After accepting the throne William and Mary agreed in 1689 to uphold the English Bill of _____." buttons {"Money", "Colonies", "Rights"}
set A10 to (button returned of the result)
if A10 is "Rights" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#---------Question 11------
display dialog "By the late 1600s French explorers had claimed the ___ River Valey" buttons {"Mississippi", "Ohio", "Hudson"}
set A11 to (button returned of the result)
if A11 is "Ohio" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#------Question 12---------
display dialog "______ was sent to ask the French to leave 'English Land'." buttons {"Johhny Tremain", "George Washington", "Paul Revere"}
set A12 to (button returned of the result)
if A12 is "George Washington" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#---------Question 13-------
display dialog "_____ proposed the Albany Plan of Union" buttons {"George Washingon", "Ben Franklin", "John Hancock"}
set A13 to (button returned of the result)
if A13 is "Ben Franklin" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#--------Question 14------
display dialog "The __________ declared that England owned all of North America east of the Mississippi" buttons {"Proclomation of England", "Treaty of Paris", "Pontiac Treaty"}
set A14 to (button returned of the result)
if A14 is "" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#-------Question 15-------
display dialog "Braddock was sent to New England so he could ______" buttons {"Command an attack against French", "Scalp the French", "Kill the colonists"}
set A15 to (button returned of the result)
if A15 is "Command an attack against French" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
#------TheLolQuestion-----
display dialog "____ is the name of the teacher who runs this class." buttons {"Mr.White", "Mr.John", "Paul Revere"} default button 1
set LOOL to (button returned of the result)
if LOOL is "Mr.White" then
do shell script "say -v samantha Congratulations…you…have…common…sense"
else
do shell script "say -v alex Do…you…have…eyes?"
#------END------
display dialog "I hope you enjoyed the quiz!" buttons {"I did!", "It was horrible"}
set endmenu to (button returned of the result)
if endmenu is "I did!" then
do shell script "say -v samantha Your awesome"
else
do shell script "say -v alex Go outside and run a lap"
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end ifUse code such as:
display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
set A1 to (button returned of the result)
if A1 is "Apprentices" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
return
end if
#----------Question 2--------
display dialog "Most children were taught to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
set A2 to (button returned of the result)
if A2 is "Bible" then
do shell script "say -v samantha Correct Answer"
else
do shell script "say -v samantha Wrong Answer"
return
end if
(90444) -
I need Help with a website I've created
I need help with a website I've created (www.jonathanhazelwood.com/lighthouse) I created the folowing site with dreamweaver at my current resolution 1366 by 768. Looks great on my screen resolution but if it is viewed on other resolutions the menu moves and some of the text above and below. How can I keep all content centered and working like it does on 1366 by 768 on all resolutions. The htm to my site is below I started off with a blank template through dreamweaver CS5.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The Lighthouse Church</title>
<style type="text/css">
<!--
body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
background: #42413C;
margin: 0;
padding: 0;
color: #000;
background-color: #000;
/* ~~ Element/tag selectors ~~ */
ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */
padding: 0;
margin: 0;
h1, h2, h3, h4, h5, h6, p {
margin-top: 0; /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
padding-right: 15px;
padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
border: none;
/* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */
a:link {
color: #42413C;
text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */
a:visited {
color: #6E6C64;
text-decoration: underline;
a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
text-decoration: none;
/* ~~ this fixed width container surrounds all other elements ~~ */
.container {
width: 960px;
background: #FFF;
margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout */
/* ~~ This is the layout information. ~~
1) Padding is only placed on the top and/or bottom of the div. The elements within this div have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design.
.content {
padding: 10px 0;
/* ~~ miscellaneous float/clear classes ~~ */
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
.fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */
float: left;
margin-right: 8px;
.clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the overflow:hidden on the .container is removed */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
#apDiv1 {
position:absolute;
width:352px;
height:2992px;
z-index:1;
top: 171px;
left: 507px;
#apDiv2 {
position:absolute;
width:961px;
height:1399px;
z-index:1;
left: 187px;
top: 1px;
#apDiv3 {
position:absolute;
width:961px;
height:1001px;
z-index:1;
top: -2px;
#apDiv4 {
position:absolute;
width:963px;
height:58px;
z-index:1;
left: 0px;
top: 101px;
#apDiv5 {
position:absolute;
width:961px;
height:1505px;
z-index:1;
top: -5px;
#apDiv6 {
position:absolute;
width:962px;
height:150px;
z-index:1;
left: 0px;
top: -1px;
#apDiv7 {
position:absolute;
width:361px;
height:25px;
z-index:2;
left: 35px;
top: 1308px;
#apDiv8 {
position:absolute;
width:320px;
height:24px;
z-index:2;
left: 200px;
top: 1479px;
#apDiv9 {
position:absolute;
width:962px;
height:63px;
z-index:3;
left: -10px;
top: -1292px;
#apDiv10 {
position:absolute;
width:270px;
height:27px;
z-index:2;
left: 200px;
top: 1478px;
#apDiv11 {
position:absolute;
width:961px;
height:44px;
z-index:3;
left: 195px;
top: 183px;
-->
</style>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#apDiv12 {
position:absolute;
width:295px;
height:23px;
z-index:4;
left: 198px;
top: 1px;
#apDiv13 {
position:absolute;
width:135px;
height:22px;
z-index:5;
left: 1001px;
top: 3px;
#apDiv14 {
position:absolute;
width:309px;
height:992px;
z-index:1;
left: 33px;
top: 479px;
#apDiv15 {
position:absolute;
width:327px;
height:999px;
z-index:1;
left: 324px;
#apDiv16 {
position:absolute;
width:262px;
height:1000px;
z-index:2;
left: 674px;
top: 477px;
#apDiv17 {
position:absolute;
width:85px;
height:34px;
z-index:1;
left: -379px;
top: 1001px;
#apDiv18 {
position:absolute;
width:200px;
height:115px;
z-index:6;
#apDiv19 {
position:absolute;
width:168px;
height:31px;
z-index:3;
left: 448px;
top: 1451px;
#apDiv20 {
position:absolute;
width:94px;
height:33px;
z-index:3;
left: 384px;
top: 1477px;
body {
background-color: #000;
margin-left: 0px;
margin-right: 0px;
#apDiv21 {
position:absolute;
width:920px;
height:200px;
z-index:4;
left: 19px;
top: 233px;
</style>
</head>
<body>
<div class="container">
<div class="content">
<div id="apDiv5">
<div id="apDiv16">
<div id="apDiv17">
<map name="Map2" id="Map2">
<area shape="rect" coords="4,2,77,28" href="http://www.myspace.com/lighthousechurch1" />
</map>
<img src="paypal-donate-button.png" width="83" height="33" border="0" usemap="#Map" />
<map name="Map" id="Map">
<area shape="rect" coords="2,2,80,30" href="https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=HgApKd0bxyPQv1ixwBW3HgWXaLxPIiT Po9gSsRELLQp72IZ2-_8uvSmCLRO&dispatch=5885d80a13c0db1f8e263663d3faee8d9384d85353843a619606 282818e091d0" />
</map>
</div>
</div>
<div id="apDiv21">
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<p><img src="faithexplosion.png" width="314" height="225" /></p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</div>
<div id="apDiv14">
<div id="apDiv15">
<div>
<div>
<p> Special Message from Perry Stone </p>
<h2> Was Jesus Born on December 25?</h2>
<p> 12/20/2010 </p>
<p><img alt="iStock_000003631829XSmall" src="http://www.voe.org/images/iStock_000003631829XSmall.jpg" width="300" height="234" /></p>
<p>Last year, in response to the growing number of Christians who celebrate Hanukkah but hate Christmas, I wrote an article for this website titled “Hanukkah or Christmas?” I explained why I think Jesus was either conceived or birthed on December 25.</p>
</div>
</div>
<div>
<div><a href="http://www.voe.org/Prophecy-Update/what-happened-to-global-warming.html"> READ MORE</a>
<p> Prophecy Update </p>
<h2> What Happened to Global Warming?</h2>
<p> 12/17/2010 </p>
<p> </p>
</div>
</div>
<div>
<div></div>
</div>
<div>
<div></div>
</div>
</div>
<div>
<p><font size="2">Special Word</font></p>
<p><font size="2">January 7th, 2011</font></p>
<p> <font size="2">Dear Viewers:</font></p>
<p><font size="2">We have now entered into one of the most trying times; but also one of the most glorious times in church history. Many things are coming upon the world and also upon the church and we (the church) must be totally prepared to take up our cross daily and venture out into the lost and</font></p>
<p> <a href="http://sermon.lighthousechurchinc.org/2011/01/07/special-word-1711-evangelist-barbara-lync h.aspx" target="_parent">Click Here for More</a></p>
</div>
<p> </p>
<div></div>
<div>
<!--// weAddFlash("lhi09hdr.swf",800, 100,"true","true","high","showall","true","#ffffff"); //--></div>
<div></div>
<p> </p>
</div>
<img src="lighthousegraphic2.jpg" width="960" height="1509" />
<div id="apDiv20"><img src="myspacebutton.jpg" width="89" height="30" border="0" usemap="#Map3" />
<map name="Map3" id="Map3">
<area shape="rect" coords="3,2,87,28" href="http://www.myspace.com/lighthousechurch1" />
</map>
</div>
</div>
<p> </p>
</div>
<!-- end .container --></div>
<div id="apDiv10"><font size="1"><font color="#FFFFFF">Copyright 2011 The Lighthouse Church Inc.</font></font></div>
<div id="apDiv11">
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="#">Home</a> </li>
<li><a href="#" class="MenuBarItemSubmenu">Our Pastor</a>
<ul>
<li><a href="#">Fresh Word</a></li>
<li><a href="#">Itinerary</a></li>
<li><a href="#">Prophetic Word</a></li>
<li><a href="#">Sermons</a></li>
<li><a href="#">Special Words</a></li>
<li><a href="#">Word of Month</a></li>
</ul>
</li>
<li><a href="#">Men Ministry</a></li>
<li><a href="#" class="MenuBarItemSubmenu">Ministers</a>
<ul>
<li><a href="#">Chris Gore</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">Our Church</a>
<ul>
<li><a href="#">Contact Us</a></li>
<li><a href="#">Donate</a></li>
<li><a href="#">Events</a></li>
<li><a href="#">Our Store</a></li>
<li><a href="#">Prayer Request</a></li>
<li><a href="#">Salvation</a></li>
<li><a href="#">Subscribe</a></li>
<li><a href="#">Vision</a></li>
<li><a href="#">We Believe</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">Resources</a>
<ul>
<li><a href="#">Prepare for Disaster</a></li>
<li><a href="#">How to Fast</a></li>
<li><a href="#">Heaven & Hell</a></li>
<li><a href="#">Warfare Prayers</a></li>
<li><a href="#">Wisdom Words</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">Prophetic</a>
<ul>
<li><a href="#">Article Archive</a></li>
<li><a href="#">Audio Prophecies</a></li>
<li><a href="#">Color for Year</a></li>
<li><a href="#">Major Articles</a></li>
<li><a href="#">Prophecy Archive</a></li>
<li><a href="#">Prophetic Articles</a></li>
<li><a href="#">Word for Year</a></li>
</ul>
</li>
</ul>
</div>
<div id="apDiv12"><font size="1"><font color="#FFFFFF">6 South Railroad Ave Wyoming,DE 19934</font></font></div>
<div id="apDiv13"><font size="1"><font color="#FFFFFF">Phone:(302) 697-1472</font></font></div>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
</html>Look at all the apdiv's you have. Those are absolutely positioned layers. I'm assuming by your post that you are very new to Dreamweaver and HTML and CSS. I would highly recommend not using absolutely positioned layers until you have a better grasp on HTML and CSS.
Looking at your code I would suggest that you consider using one of Dreamweaver's built in, or downloadable templates as a starting point and work from there.
http://www.adobe.com/devnet/dreamweaver/articles/dreamweaver_custom_templates.html -
Need help with Berkeley XML DB Performance
We need help with maximizing performance of our use of Berkeley XML DB. I am filling most of the 29 part question as listed by Oracle's BDB team.
Berkeley DB XML Performance Questionnaire
1. Describe the Performance area that you are measuring? What is the
current performance? What are your performance goals you hope to
achieve?
We are measuring the performance while loading a document during
web application startup. It is currently taking 10-12 seconds when
only one user is on the system. We are trying to do some testing to
get the load time when several users are on the system.
We would like the load time to be 5 seconds or less.
2. What Berkeley DB XML Version? Any optional configuration flags
specified? Are you running with any special patches? Please specify?
dbxml 2.4.13. No special patches.
3. What Berkeley DB Version? Any optional configuration flags
specified? Are you running with any special patches? Please Specify.
bdb 4.6.21. No special patches.
4. Processor name, speed and chipset?
Intel Xeon CPU 5150 2.66GHz
5. Operating System and Version?
Red Hat Enterprise Linux Relase 4 Update 6
6. Disk Drive Type and speed?
Don't have that information
7. File System Type? (such as EXT2, NTFS, Reiser)
EXT3
8. Physical Memory Available?
4GB
9. Are you using Replication (HA) with Berkeley DB XML? If so, please
describe the network you are using, and the number of Replica’s.
No
10. Are you using a Remote Filesystem (NFS) ? If so, for which
Berkeley DB XML/DB files?
No
11. What type of mutexes do you have configured? Did you specify
–with-mutex=? Specify what you find inn your config.log, search
for db_cv_mutex?
None. Did not specify -with-mutex during bdb compilation
12. Which API are you using (C++, Java, Perl, PHP, Python, other) ?
Which compiler and version?
Java 1.5
13. If you are using an Application Server or Web Server, please
provide the name and version?
Oracle Appication Server 10.1.3.4.0
14. Please provide your exact Environment Configuration Flags (include
anything specified in you DB_CONFIG file)
Default.
15. Please provide your Container Configuration Flags?
final EnvironmentConfig envConf = new EnvironmentConfig();
envConf.setAllowCreate(true); // If the environment does not
// exist, create it.
envConf.setInitializeCache(true); // Turn on the shared memory
// region.
envConf.setInitializeLocking(true); // Turn on the locking subsystem.
envConf.setInitializeLogging(true); // Turn on the logging subsystem.
envConf.setTransactional(true); // Turn on the transactional
// subsystem.
envConf.setLockDetectMode(LockDetectMode.MINWRITE);
envConf.setThreaded(true);
envConf.setErrorStream(System.err);
envConf.setCacheSize(1024*1024*64);
envConf.setMaxLockers(2000);
envConf.setMaxLocks(2000);
envConf.setMaxLockObjects(2000);
envConf.setTxnMaxActive(200);
envConf.setTxnWriteNoSync(true);
envConf.setMaxMutexes(40000);
16. How many XML Containers do you have? For each one please specify:
One.
1. The Container Configuration Flags
XmlContainerConfig xmlContainerConfig = new XmlContainerConfig();
xmlContainerConfig.setTransactional(true);
xmlContainerConfig.setIndexNodes(true);
xmlContainerConfig.setReadUncommitted(true);
2. How many documents?
Everytime the user logs in, the current xml document is loaded from
a oracle database table and put it in the Berkeley XML DB.
The documents get deleted from XML DB when the Oracle application
server container is stopped.
The number of documents should start with zero initially and it
will grow with every login.
3. What type (node or wholedoc)?
Node
4. Please indicate the minimum, maximum and average size of
documents?
The minimum is about 2MB and the maximum could 20MB. The average
mostly about 5MB.
5. Are you using document data? If so please describe how?
We are using document data only to save changes made
to the application data in a web application. The final save goes
to the relational database. Berkeley XML DB is just used to store
temporary data since going to the relational database for each change
will cause severe performance issues.
17. Please describe the shape of one of your typical documents? Please
do this by sending us a skeleton XML document.
Due to the sensitive nature of the data, I can provide XML schema instead.
18. What is the rate of document insertion/update required or
expected? Are you doing partial node updates (via XmlModify) or
replacing the document?
The document is inserted during user login. Any change made to the application
data grid or other data components gets saved in Berkeley DB. We also have
an automatic save every two minutes. The final save from the application
gets saved in a relational database.
19. What is the query rate required/expected?
Users will not be entering data rapidly. There will be lot of think time
before the users enter/modify data in the web application. This is a pilot
project but when we go live with this application, we will expect 25 users
at the same time.
20. XQuery -- supply some sample queries
1. Please provide the Query Plan
2. Are you using DBXML_INDEX_NODES?
Yes.
3. Display the indices you have defined for the specific query.
XmlIndexSpecification spec = container.getIndexSpecification();
// ids
spec.addIndex("", "id", XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
spec.addIndex("", "idref", XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
// index to cover AttributeValue/Description
spec.addIndex("", "Description", XmlIndexSpecification.PATH_EDGE | XmlIndexSpecification.NODE_ELEMENT | XmlIndexSpecification.KEY_SUBSTRING, XmlValue.STRING);
// cover AttributeValue/@value
spec.addIndex("", "value", XmlIndexSpecification.PATH_EDGE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
// item attribute values
spec.addIndex("", "type", XmlIndexSpecification.PATH_EDGE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
// default index
spec.addDefaultIndex(XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ELEMENT | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
spec.addDefaultIndex(XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
// save the spec to the container
XmlUpdateContext uc = xmlManager.createUpdateContext();
container.setIndexSpecification(spec, uc);
4. If this is a large query, please consider sending a smaller
query (and query plan) that demonstrates the problem.
21. Are you running with Transactions? If so please provide any
transactions flags you specify with any API calls.
Yes. READ_UNCOMMITED in some and READ_COMMITTED in other transactions.
22. If your application is transactional, are your log files stored on
the same disk as your containers/databases?
Yes.
23. Do you use AUTO_COMMIT?
No.
24. Please list any non-transactional operations performed?
No.
25. How many threads of control are running? How many threads in read
only mode? How many threads are updating?
We use Berkeley XML DB within the context of a struts web application.
Each user logged into the web application will be running a bdb transactoin
within the context of a struts action thread.
26. Please include a paragraph describing the performance measurements
you have made. Please specifically list any Berkeley DB operations
where the performance is currently insufficient.
We are clocking 10-12 seconds of loading a document from dbd when
five users are on the system.
getContainer().getDocument(documentName);
27. What performance level do you hope to achieve?
We would like to get less than 5 seconds when 25 users are on the system.
28. Please send us the output of the following db_stat utility commands
after your application has been running under "normal" load for some
period of time:
% db_stat -h database environment -c
% db_stat -h database environment -l
% db_stat -h database environment -m
% db_stat -h database environment -r
% db_stat -h database environment -t
(These commands require the db_stat utility access a shared database
environment. If your application has a private environment, please
remove the DB_PRIVATE flag used when the environment is created, so
you can obtain these measurements. If removing the DB_PRIVATE flag
is not possible, let us know and we can discuss alternatives with
you.)
If your application has periods of "good" and "bad" performance,
please run the above list of commands several times, during both
good and bad periods, and additionally specify the -Z flags (so
the output of each command isn't cumulative).
When possible, please run basic system performance reporting tools
during the time you are measuring the application's performance.
For example, on UNIX systems, the vmstat and iostat utilities are
good choices.
Will give this information soon.
29. Are there any other significant applications running on this
system? Are you using Berkeley DB outside of Berkeley DB XML?
Please describe the application?
No to the first two questions.
The web application is an online review of test questions. The users
login and then review the items one by one. The relational database
holds the data in xml. During application load, the application
retrieves the xml and then saves it to bdb. While the user
is making changes to the data in the application, it writes those
changes to bdb. Finally when the user hits the SAVE button, the data
gets saved to the relational database. We also have an automatic save
every two minues, which saves bdb xml data and saves it to relational
database.
Thanks,
Madhav
[email protected]Could it be that you simply do not have set up indexes to support your query? If so, you could do some basic testing using the dbxml shell:
milu@colinux:~/xpg > dbxml -h ~/dbenv
Joined existing environment
dbxml> setverbose 7 2
dbxml> open tv.dbxml
dbxml> listIndexes
dbxml> query { collection()[//@date-tip]/*[@chID = ('ard','zdf')] (: example :) }
dbxml> queryplan { collection()[//@date-tip]/*[@chID = ('ard','zdf')] (: example :) }Verbosity will make the engine display some (rather cryptic) information on index usage. I can't remember where the output is explained; my feeling is that "V(...)" means the index is being used (which is good), but that observation may not be accurate. Note that some details in the setVerbose command could differ, as I'm using 2.4.16 while you're using 2.4.13.
Also, take a look at the query plan. You can post it here and some people will be able to diagnose it.
Michael Ludwig -
Need help with navigation within a spark list...
hey guys, so in my application when you click on a list item, it opens up an image, and along with the image a few buttons are created dynamically...
the image and the url/labels for the dynamic buttons is provided through an xml/xmlListCollection.
what i need help with is the url or more specifically when you click on one of these dynamic buttons it needs to navigate me to another part of an list or display a certain set of images that is not in my spark list...
please let me know if this makes no sence
the code i have is
<code>
[Bindable] private var menuXml:XML;
[Bindable] private var imgList:XMLListCollection = new XMLListCollection();
[Bindable] private var navControl:XMLListCollection = new XMLListCollection();
[Bindable] private var fullList:XMLListCollection = new XMLListCollection();
private var returnedXml:XMLListCollection = new XMLListCollection();
private var myXmlSource:XML = new XML();
//[Bindable] private var xmlReturn:Object;
private var currImage:int = 0;
//public var userOpProv:XMLListCollection = new XMLListCollection();
//private var troubleShootProvider:XMLListCollection = new XMLListCollection();
private function myXml_resultHandeler(event:ResultEvent):void{
userOptionProvider.source = event.result.apx32.userOptions.children();
troubleShootProvider.source = event.result.apx32.troubleShooting.children();
fullList.source = event.result.apx32.children();
returnedXml.source = event.result[0].children();
myXmlSource = event.result[0];
private function myXml_faultHandler(event:FaultEvent):void{
Alert.show("Error loading XML");
Alert.show(event.fault.message);
private function app_creationComplete(event:FlexEvent):void{
userOptions.scroller.setStyle("horizontalScrollPolicy", ScrollPolicy.OFF);
myXml.send();
//trouble.scroller.setStyle("horizontalScrollPolicy", ScrollPolicy.OFF);
myXml = new HTTPService();
myXml.url = "modules/apx32/apx32TroubleshootingXml.xml";
myXml.resultFormat = "e4x";
myXml.addEventListener(ResultEvent.RESULT, myXml_resultHandeler);
myXml.addEventListener(FaultEvent.FAULT, myXml_faultHandler);
myXml.send();
private function troubleShootChange(event:IndexChangeEvent):void{
dynamicButtons.removeAllElements();
navControl.source = troubleShootProvider[event.newIndex].children();
currImage = 0;
imgList.source = troubleShootProvider[event.newIndex].images.children();
definition.source = imgList[currImage].@url;
if(imgList[currImage].@details == "true"){
if(imgList[currImage].buttons.@hasButtons == "true"){
for each(var item:XML in imgList[currImage].buttons.children()){
var newButton:LinkButton = new LinkButton();
newButton.label = item.@name;
newButton.x = item.@posX;
newButton.y = item.@posY;
newButton.setStyle("skin", null);
newButton.styleName = "dynamicButtonStyle";
dynamicButtons.addElement(newButton);
//var isMultiPage:String = navControl[2]["multiPages"];
//trace(isMultiPage);
// if(isMultiPage){
if(currImage >= imgList.length - 1){
next.visible = false;
back.visible = false;
else{
back.visible = false;
next.visible = true;
private function customButtonPressed(event:Event):void{
if(imgList[currImage].button.@changeTo != ""){
private function userOptionsChange(event:IndexChangeEvent):void{
dynamicButtons.removeAllElements();
navControl.source = userOptionProvider[event.newIndex].children();
currImage = 0;
imgList.source = userOptionProvider[event.newIndex].images.children();
definition.source = imgList[currImage].@url;
if(imgList[currImage].@details == "true"){
if(imgList[currImage].buttons.@hasButtons == "true"){
for each(var item:XML in imgList[currImage].buttons.children()){
var newButton:LinkButton = new LinkButton();
newButton.label = item.@name;
newButton.x = item.@posX;
newButton.y = item.@posY;
newButton.setStyle("skin", null);
newButton.styleName = "dynamicButtonStyle";
newButton.addEventListener(MouseEvent.MOUSE_DOWN, customButtonPressed);
dynamicButtons.addElement(newButton);
var isMultiPage:String = navControl[2]["multiPages"];
if(isMultiPage == "true"){
if(navControl[2]["next"] == "NEXT STEP"){
navContainer.x = 630;
else{
navContainer.x = 640;
next.label = navControl[2]["next"];
back.label = navControl[2]["back"];
if(currImage >= imgList.length - 1){
next.visible = false;
back.visible = false;
else{
back.visible = false;
next.visible = true;
private function nextClickHandler(event:MouseEvent):void{
currImage += 1;
dynamicButtons.removeAllElements();
if(currImage >= imgList.length-1){
currImage = imgList.length - 1;
//next.visible = false;
next.label = "YOU'RE DONE";
else
next.label = navControl[2]["next"];
back.visible = true;
if(imgList[currImage].@details == "true"){
if(imgList[currImage].buttons.@hasButtons == "true"){
for each(var item:XML in imgList[currImage].buttons.children()){
var newButton:LinkButton = new LinkButton();
newButton.label = item.@name;
newButton.x = item.@posX;
newButton.y = item.@posY;
newButton.setStyle("skin", null);
newButton.styleName = "dynamicButtonStyle";
dynamicButtons.addElement(newButton);
definition.source = imgList[currImage].@url;
private function backClickHandler(event:MouseEvent):void{
currImage -= 1;
dynamicButtons.removeAllElements();
if(currImage == 0){
back.visible = false;
next.visible = true;
next.label = navControl[2]["next"];
if(imgList[currImage].@details == "true"){
if(imgList[currImage].buttons.@hasButtons == "true"){
for each(var item:XML in imgList[currImage].buttons.children()){
var newButton:LinkButton = new LinkButton();
newButton.label = item.@name;
newButton.x = item.@posX;
newButton.y = item.@posY;
newButton.setStyle("skin", null);
newButton.styleName = "dynamicButtonStyle";
dynamicButtons.addElement(newButton);
definition.source = imgList[currImage].@url;
</code>
i have attached a copy of the xml that i have right now to this post for reference...
any help will be greatly appretiated!!! i've been stuck on this problem for the last week and my project is due soon
again thank you in advance...hey david... just nevermind my previous post... I was able to subclass a link button, so i now have two variables that get assigned to a link button,
one is "tabId" <-- contains the information on which tab to swtich to, and the second is, "changeTo"... this contans the label name which it needs to switch to
I'm just stuck on how to change my selected item in my tabNavigator/list
the code i have right now is
private function customButtonPressed(event:Event):void{
if(event.currentTarget.tabId == "troubleShooting"){
for each(var item:Object in troubleShootProvider){
if(item.@label == event.currentTarget.changeTo){
private function userOptionsChange(event:IndexChangeEvent):void{
dynamicButtons.removeAllElements();
navControl.source = userOptionProvider[event.newIndex].children();
currImage = 0;
imgList.source = userOptionProvider[event.newIndex].images.children();
definition.source = imgList[currImage].@url;
if(imgList[currImage].@details == "true"){
if(imgList[currImage].buttons.@hasButtons == "true"){
for each(var item:XML in imgList[currImage].buttons.children()){
var newButton:customLinkButton = new customLinkButton();
newButton.label = item.@name;
newButton.tabId = item.@tab;
newButton.changeTo = item.@changeTo;
newButton.x = item.@posX;
newButton.y = item.@posY;
newButton.setStyle("skin", null);
newButton.styleName = "dynamicButtonStyle";
newButton.addEventListener(MouseEvent.MOUSE_DOWN, customButtonPressed);
dynamicButtons.addElement(newButton);
var isMultiPage:String = navControl[2]["multiPages"];
var videoPresent:String = navControl[1]["videoPresent"];
if(videoPresent == "true"){
if(isMultiPage != "true"){
navContainer.x = 825;
if(isMultiPage == "true"){
if(navControl[2]["next"] == "NEXT STEP"){
navContainer.x = 630;
else{
navContainer.x = 640;
next.label = navControl[2]["next"];
back.label = navControl[2]["back"];
if(currImage >= imgList.length - 1){
next.visible = false;
back.visible = false;
else{
back.visible = false;
next.visible = true;
as you know, my xml gets divided into two saperate xmllistcollections one is the userOptionProvider, and the troubleshootingProvider
as is in the following xml
<mx:TabNavigator id="tabNav" width="275" tabStyleName="tabStyle" fontWeight="bold" height="400" paddingTop="0"
tabWidth="137.5" creationPolicy="all" borderVisible="false">
<mx:VBox label="USER OPTIONS" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
<s:List id="userOptions" width="100%" height="100%" itemRenderer="modules.apx32.myComponents.listRenderer"
borderVisible="false" contentBackgroundColor="#e9e9e9"
change="userOptionsChange(event)">
<s:dataProvider>
<s:XMLListCollection id="userOptionProvider" />
</s:dataProvider>
</s:List>
</mx:VBox>
<mx:VBox label="TROUBLESHOOTING">
<s:List id="trouble" width="100%" height="100%" itemRenderer="modules.apx32.myComponents.listRenderer"
borderAlpha="0" borderVisible="false" contentBackgroundColor="#e9e9e9"
change="troubleShootChange(event)">
<s:dataProvider>
<s:XMLListCollection id="troubleShootProvider" />
</s:dataProvider>
</s:List>
</mx:VBox>
</mx:TabNavigator>
Im having some trouble updating my list... basically change to the troubleshooting tab, and then select the one that i need...
hopefully that makes sence... -
I have a REAL problem that I need help with
many thanks to kglad for all his help last week with a problem but it hasn't fully sorted it out. I have a site with 908 buttons. Basically a person clicks a button, makes a donation (through paypal) and then that button gets their name displayed when the mouse hovers over it. Essentially the button becomes the property of the person who makes the donation. The problem I need help with is how to disable each button when someone clicks it. Disabling a button isn't the problem. I need it disabled only when the person has made a valid donation. Each button has a unique instance name (b001 - b908). There must be a way.
Many thanks in advance.I can't get this to work at all. At this stage, I'm considering a complete restructure of the site in dreamweaver.
I would love to be able to complete it in actionscript though as I would be learning something new.
When a user clicks a button, and goes through the paypal process, I need the clicked button to be disabled.
It has to be such that it gets disabled only when a user has made a donation through paypal. For example, plenty
of people may just click on the buttons as they are checking the site out, without any intention of using the paypal
facility. This is just human nature. Obviously, I don' t want any buttons disabled under these circumstances.
I was thinking, do I need a statement such as .......... "on returning from paypal, disable the clicked button"
Or is it just a case of......... "on returning from paypal, remove the event handler"
Or is it something completely different, I require, (please don't say a brain would be helpful).
Is there some generic code out there that could help me out please. -
Need help with a simple program (should be simple anyway)
I'm (starting to begin) writing a nice simple program that should be easy however I'm stuck on how to make the "New" button in the file menu clear all the fields. Any help? I'll attach the code below.
====================================================
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Message extends JFrame implements ActionListener {
public void actionPerformed(ActionEvent evt) {
text1.setText(" ");
text2.setText("RE: ");
text3.setText(" ");
public Message() {
super("Write a Message - by Kieran Hannigan");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(370,270);
FlowLayout flo = new FlowLayout(FlowLayout.RIGHT);
setLayout(flo);
//Make the bar
JMenuBar bar = new JMenuBar();
//Make "File" on Menu
JMenu File = new JMenu("File");
JMenuItem f1 = new JMenuItem("New");f1.addActionListener(this);
JMenuItem f2 = new JMenuItem("Open");
JMenuItem f3 = new JMenuItem("Save");
JMenuItem f4 = new JMenuItem("Save As");
JMenuItem f5 = new JMenuItem("Exit");
File.add(f1);
File.add(f2);
File.add(f3);
File.add(f4);
File.add(f5);
bar.add(File);
//Make "Edit" on menu
JMenu Edit = new JMenu("Edit");
JMenuItem e1 = new JMenuItem("Cut");
JMenuItem e2 = new JMenuItem("Paste");
JMenuItem e3 = new JMenuItem("Copy");
JMenuItem e4 = new JMenuItem("Repeat");
JMenuItem e5 = new JMenuItem("Undo");
Edit.add(e5);
Edit.add(e4);
Edit.add(e1);
Edit.add(e3);
Edit.add(e2);
bar.add(Edit);
//Make "View" on menu
JMenu View = new JMenu("View");
JMenuItem v1 = new JMenuItem("Bold");
JMenuItem v2 = new JMenuItem("Italic");
JMenuItem v3 = new JMenuItem("Normal");
JMenuItem v4 = new JMenuItem("Bold-Italic");
View.add(v1);
View.add(v2);
View.add(v3);
View.addSeparator();
View.add(v4);
bar.add(View);
//Make "Help" on menu
JMenu Help = new JMenu("Help");
JMenuItem h1 = new JMenuItem("Help Online");
JMenuItem h2 = new JMenuItem("E-mail Programmer");
Help.add(h1);
Help.add(h2);
bar.add(Help);
setJMenuBar(bar);
//Make Contents of window.
//Make "Subject" text field
JPanel row2 = new JPanel();
JLabel sublabel = new JLabel("Subject:");
row2.add(sublabel);
JTextField text2 = new JTextField("RE:",24);
row2.add(text2);
//Make "To" text field
JPanel row1 = new JPanel();
JLabel tolabel = new JLabel("To:");
row1.add(tolabel);
JTextField text1 = new JTextField(24);
row1.add(text1);
//Make "Message" text area
JPanel row3 = new JPanel();
JLabel Meslabel = new JLabel("Message:");
row3.add(Meslabel);
JTextArea text3 = new JTextArea(6,22);
messagearea.setLineWrap(true);
messagearea.setWrapStyleWord(true);
JScrollPane scroll = new JScrollPane(text3,
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
//SpaceLine
JPanel spaceline = new JPanel();
JLabel spacer = new JLabel(" ");
spaceline.add(spacer);
row3.add(scroll);
add(row1);
add(row2);
add(spaceline);
add(spaceline);
add(row3);
setVisible(true);
public static void main(String[] arguments) {
Message Message = new Message();
}persiandude wrote:
Topic: Need help with if, else, and which statements and loops.
How would I display 60 < temp. <= 85 in java
System.out.println("60 < temp. <= 85 in java");
another question is how do I ask a question like want to try again (y/n) after a output and asking that everytime I type in yes after a output and terminate when saying No.Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
[http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806].
Maybe you are looking for
-
Hello. I've used tutorial from Archlinux wiki to get easy copy (ctrl+c) and paste (ctrl+v) in urxvt. The problem now is that urxvt can't paste non-latin characters correctly. For example, I need to paste this to terminal: Région parisienne Guake term
-
I downloaded an album that is supposed to offer the iTunes LP feature, but it's not working. I have nothing waiting to be downloaded from iTunes, and I have the most current version of iTunes. Any help with this?
-
Don't understand factory pattern for DB creation
Apparently, I'm missing something critical to get my DB Factory setup correctly. Specifically, I'm having a hard time figuring out where the host, db, user, and password options are supposed to be set. I'm currently doing something like the following
-
Error / Failed to create file in the network
I'm using and enjoying the Oracle Data Integrator and created two packages for extraction and loading. But trying to create the file in the directory on the network get an error. I checked the permissions, but without success. Can anyone help me? Tha
-
I upgraded my iPad (3rd gen) to iOS 7. When I go to iTunes and look at the summary and to the "Apps" list tab, iTunes stops working and shuts down. What can I do? I am using a Windows 7 machine.