Calculator: having problem with main method
This is a program that converts Infix expression to Postfix and evaluates it.I used eclipse to run this.
In my main method, how do i get it to loop? when the user still wants to input another expression? i just can't seem to figure this out.
import java.io.*;
import java.util.*;
import javax.swing.*;
public class Calculator {
private static Stack operators = new Stack();
private static Stack operands = new Stack();
private static int precedence( char operator ) {
if (operator == '+' || operator == '-' )
return 1;
else if (operator == '*' || operator == '/' || operator == '%')
return 2;
return 0;
private static String convertToPostfix( String infix ) {
StringTokenizer input = new StringTokenizer( infix );
String symbol;
String postfix = "";
while (input.hasMoreTokens()) {
symbol = input.nextToken();
if (Character.isDigit(symbol.charAt(0))){
postfix = postfix + " " + (Integer.parseInt(symbol));
}else if (symbol.equals("(")){
Character isOperator = new Character('(');
operators.push( isOperator );
}else if (symbol.equals(")")) {
while (((Character)operators.peek()).charValue() != '(') {
postfix = postfix + " " + operators.pop();
}operators.pop();
} else {
while (!operators.empty() && !(operators.peek()).equals("(") && precedence(symbol.charAt(0)) <= precedence(((Character)operators.peek()).charValue()))
postfix = postfix + " " + operators.pop();
Character isOperator = new Character(symbol.charAt(0));
operators.push( isOperator );
while (!operators.empty())
postfix = postfix + " " + operators.pop();
return postfix;
private static int evaluate( String postfix ) {
StringTokenizer input2 = new StringTokenizer( postfix );
int value;
String symbol;
while (input2.hasMoreTokens()) {
symbol = input2.nextToken();
if (Character.isDigit(symbol.charAt(0))) {
Integer isOperand = new Integer(Integer.parseInt(symbol));
operands.push( isOperand );
}else{
int op2 = ((Integer)operands.pop()).intValue();
int op1 = ((Integer)operands.pop()).intValue();
int result = 0;
switch(symbol.charAt(0)){
case '*': result = op1 * op2;
break;
case '+': result = op1 + op2;
break;
case '-': result = op1 - op2;
break;
case '/': result = op1 / op2;
break;
case '%': result = op1 % op2;
break;
Integer isOperand = new Integer(result);
operands.push( isOperand );
value = ((Integer)operands.pop()).intValue();
return value;
public static void main(String args[]) throws IOException {
JOptionPane.showMessageDialog(null, "Hello user! I hope you have a wonderful time using the
calculator. = ]" , "Welcome", JOptionPane.PLAIN_MESSAGE);
JOptionPane.showMessageDialog(null, "Note: Enter Infix expressions with spaces in between.",
"Welcome", JOptionPane.PLAIN_MESSAGE);
String infix = JOptionPane.showInputDialog("Enter Mathematical Expression Here: ");
String output = "The expression in Postfix is: " + convertToPostfix(infix);
JOptionPane.showMessageDialog(null, output);
String answer = "The answer to the equation: " + evaluate(convertToPostfix(infix));
JOptionPane.showMessageDialog(null, answer);
String options[] = {"Yes","No",}
int option = JOptionPane.showOptionDialog(null,"Do you want evaluate an expression?", "Calculator",
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,options,options[0]);
JOptionPane.showMessageDialog(null, "Thank you for using the calculator.\n Have a nice day! = ]");
}
Can probably be done better...
boolean stop = false;
while(!stop) {
//your optionpanes..
if(option == 0) {
stop = true;
}Also, your yes/no optionpane could be exchanged to:
int option = JOptionPane.showConfirmDialog(null,"Do you want evaluate an expression?", "Calculator", JOptionPane.YES_NO_OPTION);Edited by: prigas on Sep 20, 2008 12:04 PM
Similar Messages
-
Having trouble with "main" method
I have just installed j2re1.4.1 and I am having trouble running my applications. Every time I try to run even the smallest of apps I get an error message about the "Main" method.
In textpad i get this message:
"Exception in thread "main" java.lang.NoClassDefFoundError:"
and in Jcreator I get this message:
"The system couldnt find a suitable main method"
what is going wrong?How can I fix this?It could be something as simple as Case :-/
If you have a file Foo.java with a class Foo with a main()
you can compile it with javac foo.javawhich will create Foo.classbut you cannot run it with java fooyou will get Exception in thread "main" java.lang.NoClassDefFoundError: roids (wrong name: Foo)whereas java Foowill work just fine. -
Having problems with getRGB() method
Hi,
I've written an application in J2ME that allows you to use the camera and take a snapshot. The next thing I want to do is store the image that the camera takes in the RMS. Here is the code I've got so far:
void writeRecordDisplay(Image storedImage)
ByteArrayOutputStream bos = new ByteArrayOutputStream();
int rgbData[] = new int[storedImage.getWidth() * storedImage.getHeight()];
try
bos = storedImage.getRGB(rgbData, 0, storedImage.getWidth(), 0, 0, storedImage.getWidth(), storedImage.getHeight());
byte[] rec = bos.toByteArray();
rsDisplay.addRecord(rec, 0, rec.length);
catch (Exception e)
DisplayMessage1 = "WriteRecordD Exception:";
DisplayMessage2 = e.getMessage();
}The problem is that Borland JBuilderX gives me an error saying "incompatible tpes;found void,required: java.IO.ByteArrayOutputStream and I don't understand what I have done wrong
Any help would be greatly appreciated,
TomSorry for the lack of formatting on the previous post I completely forgot to do it.
Following you instructions I think I have completed the following steps yo listed:
a) declared the byte array and filled it using the RMS.
b) created the DataInputStream which is wrapped around the ByteArrayInputStream, created with the byte array from the RMS.
d) used the int array as a parameter for createRGBImage().
The problem I am having is with step (c). I get an error saying "incompatible types;found : java.io.DataInputStream,required: int[]
void readRecordDisplay()
int rgbData[] = null;
DataInputStream din = null;
byte [] data = null;
try
rsDisplay = RecordStore.openRecordStore(REC_STORE_DISPLAY, true);
data = rsDisplay.getRecord(1);
din = new DataInputStream(new ByteArrayInputStream(data));
rgbData = din;
reconImage.createRGBImage(rgbData, 160, 120, true);
catch (Exception e)
DisplayMessage3 = "ReadRecordD Exception:";
DisplayMessage4 = e.getMessage();
}Tom -
I'm having problems with CS2 (mainly illustrator and photoshop
I'm having problems with CS2 (mainly illustrator and photoshop ) randomly shutting down while trying to save a file. Reformatted my laptop for fear of a virus and reloaded... I have gotten nowhere.
Please Help!CS3 still had issues with the preferences becoming corrupt, so a possible workaround would be to reset the preferences.
The file is called AIPrefs and is located under 'Documents and Settings/User/Application Data/Adobe/Adobe Illustrator CS3 Settings'. It is a hidden file. Delete it with Illustrator closed and when you launch the program again the file will be rebuilt.
May be it is also sounds like you need more memory for your computer. If you can navigate to your computer's memory controls, and allow your operating system to use a portion of your hard disk drive (HDD) as RAM (maybe 2Gb or so) it may solve your issue.
How is about: http://www.filerepairforum.com/forum/adobe/adobe-aa/illustrator/383-%E2%80%8Bcorrupted-fon ts-in-illustrator-file-urgent-help-need – resource has non-commercial specialty
Third party software Illustrator Repair Kit also must be good solution
It has free demo version at:- http://www.illustrator.repair/
Hope this will be helpful. -
Still having problems with VPN access
Hello!
I am having problems with my VPN clients getting access to the networks over a MPLS infrastruture. I can reach these resources form my Core network (172.17.1.0/24) and my Wifi (172.17.100.0/24) but not from my VPN network (172.17.200.0/24). From the VPN I can reach the Wifi network (which is behind a router) and the rule that allows that also allows access to the other networks but for some reason it is not working.
When I ping inside the core network from VPN I can connect and get responses. When I ping to the Wifi network, I can get responses and connect to resources there. A tracert to the wifi network shows it hitting the core switch (a 3750 stack) @ 172.17.1.1, then the Wifi router (172.17.1.3) and then the host. A tracert to a resource on the MPLS network from the VPN shows a single entry (the destination host) and then 29 time outs but will not ping that resource nor connect.
I've posted all the info I can think of below. Any help appreciated.
*** Here is a tracert from a core network machine to the resource we need on the MPLS:
C:\Windows\system32>tracert 10.2.0.125
Tracing route to **************** [10.2.0.125]
over a maximum of 30 hops:
1 1 ms <1 ms <1 ms 172.17.1.1
2 1 ms <1 ms <1 ms 172.17.1.10
3 5 ms 5 ms 5 ms 192.168.0.13
4 31 ms 30 ms 31 ms 192.168.0.5
5 29 ms 30 ms 29 ms 192.168.0.6
6 29 ms 29 ms 29 ms 192.168.20.4
7 29 ms 29 ms 29 ms RV-TPA-CRMPROD [10.2.0.125]
Trace complete.
172.17.1.10 is the mpls router.
**** Here is the routing table (sh ip route) from the 3750 @ 172.17.1.1
Gateway of last resort is 172.17.1.2 to network 0.0.0.0
S 192.168.30.0/24 [1/0] via 172.17.1.10
172.17.0.0/24 is subnetted, 3 subnets
S 172.17.200.0 [1/0] via 172.17.1.2
C 172.17.1.0 is directly connected, Vlan20
S 172.17.100.0 [1/0] via 172.17.1.3
172.18.0.0/24 is subnetted, 1 subnets
S 172.18.1.0 [1/0] via 172.17.1.10
S 192.168.11.0/24 [1/0] via 172.17.1.10
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
S 10.2.0.0/24 [1/0] via 172.17.1.10
S 10.10.10.0/24 [1/0] via 172.17.1.10
S 10.20.0.0/24 [1/0] via 172.17.1.10
S 10.3.0.128/25 [1/0] via 172.17.1.10
S 192.168.1.0/24 [1/0] via 172.17.1.10
S* 0.0.0.0/0 [1/0] via 172.17.1.2
*** Here is the firewall config (5510):
ASA Version 8.4(1)
hostname RVGW
domain-name ************
enable password b5aqRk/6.KRmypWW encrypted
passwd 1ems91jznlfZHhfU encrypted
names
interface Ethernet0/0
nameif Outside
security-level 10
ip address 5.29.79.10 255.255.255.248
interface Ethernet0/1
nameif Inside
security-level 100
ip address 172.17.1.2 255.255.255.0
interface Ethernet0/2
shutdown
no nameif
no security-level
no ip address
interface Ethernet0/3
shutdown
no nameif
no security-level
no ip address
interface Management0/0
nameif management
security-level 100
ip address 172.19.1.1 255.255.255.0
management-only
banner login RedV GW
ftp mode passive
dns server-group DefaultDNS
domain-name RedVector.com
same-security-traffic permit inter-interface
same-security-traffic permit intra-interface
object network WiFi
subnet 172.17.100.0 255.255.255.0
description WiFi
object network inside-net
subnet 172.17.1.0 255.255.255.0
object network NOSPAM
host 172.17.1.60
object network BH2
host 172.17.1.60
object network EX2
host 172.17.1.61
description Internal Exchange / Outbound SMTP
object network Mail2
host 5.29.79.11
description Ext EX2
object network NETWORK_OBJ_172.17.1.240_28
subnet 172.17.1.240 255.255.255.240
object network NETWORK_OBJ_172.17.200.0_24
subnet 172.17.200.0 255.255.255.0
object network VPN-CLIENT
subnet 172.17.200.0 255.255.255.0
object-group service DM_INLINE_TCP_1 tcp
port-object eq www
port-object eq https
object-group network DM_INLINE_NETWORK_1
network-object object BH2
network-object object NOSPAM
object-group network VPN-CLIENT-PAT-SOURCE
description VPN-CLIENT-PAT-SOURCE
network-object object VPN-CLIENT
object-group network LAN-NETWORKS
network-object 10.10.10.0 255.255.255.0
network-object 10.2.0.0 255.255.255.0
network-object 10.3.0.0 255.255.255.0
network-object 172.17.100.0 255.255.255.0
network-object 172.18.1.0 255.255.255.0
network-object 192.168.1.0 255.255.255.0
network-object 192.168.11.0 255.255.255.0
network-object 192.168.30.0 255.255.255.0
object-group network VPN-POOL
network-object 172.17.200.0 255.255.255.0
object-group protocol DM_INLINE_PROTOCOL_1
protocol-object ip
protocol-object icmp
access-list Outside_access_in extended permit tcp any object-group DM_INLINE_NETWORK_1 eq smtp
access-list Outside_access_in extended permit tcp any object BH2 object-group DM_INLINE_TCP_1
access-list global_mpc extended permit ip any any
access-list Inside_access_in extended permit object-group DM_INLINE_PROTOCOL_1 any any
pager lines 24
logging enable
logging asdm informational
no logging message 106015
no logging message 313001
no logging message 313008
no logging message 106023
no logging message 710003
no logging message 106100
no logging message 302015
no logging message 302014
no logging message 302013
no logging message 302018
no logging message 302017
no logging message 302016
no logging message 302021
no logging message 302020
flow-export destination Inside 172.17.1.52 9996
mtu Outside 1500
mtu Inside 1500
mtu management 1500
ip local pool VPN 172.17.1.240-172.17.1.250 mask 255.255.255.0
ip local pool VPN2 172.17.200.100-172.17.200.200 mask 255.255.255.0
no failover
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
nat (Inside,Outside) source static EX2 Mail2
nat (Inside,Outside) source static any any destination static NETWORK_OBJ_172.17.1.240_28 NETWORK_OBJ_172.17.1.240_28
nat (Inside,Outside) source static any any destination static NETWORK_OBJ_172.17.200.0_24 NETWORK_OBJ_172.17.200.0_24
nat (Inside,Outside) source static inside-net inside-net destination static NETWORK_OBJ_172.17.1.240_28 NETWORK_OBJ_172.17.1.240_28
nat (Inside,Outside) source static LAN-NETWORKS LAN-NETWORKS destination static VPN-POOL VPN-POOL
object network inside-net
nat (Inside,Outside) dynamic interface
object network NOSPAM
nat (Inside,Outside) static 5.29.79.12
nat (Outside,Outside) after-auto source dynamic VPN-CLIENT-PAT-SOURCE interface
access-group Outside_access_in in interface Outside
access-group Inside_access_in in interface Inside
route Outside 0.0.0.0 0.0.0.0 5.29.79.9 1
route Inside 10.2.0.0 255.255.255.0 172.17.1.1 1
route Inside 10.3.0.0 255.255.255.128 172.17.1.1 1
route Inside 10.10.10.0 255.255.255.0 172.17.1.1 1
route Inside 172.17.100.0 255.255.255.0 172.17.1.3 1
route Inside 172.18.1.0 255.255.255.0 172.17.1.1 1
route Inside 192.168.1.0 255.255.255.0 172.17.1.1 1
route Inside 192.168.11.0 255.255.255.0 172.17.1.1 1
route Inside 192.168.30.0 255.255.255.0 172.17.1.1 1
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
dynamic-access-policy-record DfltAccessPolicy
aaa-server RedVec protocol ldap
aaa-server RedVec (Inside) host 172.17.1.41
ldap-base-dn DC=adrs1,DC=net
ldap-group-base-dn DC=adrs,DC=net
ldap-scope subtree
ldap-naming-attribute sAMAccountName
ldap-login-password *****
ldap-login-dn CN=Hanna\, Roger,OU=Humans,OU=WPLAdministrator,DC=adrs1,DC=net
server-type microsoft
aaa authentication ssh console LOCAL
http server enable
http 192.168.1.0 255.255.255.0 management
http 172.17.1.0 255.255.255.0 Inside
http 24.32.208.223 255.255.255.255 Outside
snmp-server host Inside 172.17.1.52 community *****
snmp-server location Server Room 3010
snmp-server contact Roger Hanna
snmp-server community *****
snmp-server enable traps snmp authentication linkup linkdown coldstart warmstart
crypto ipsec ikev1 transform-set ESP-AES-256-MD5 esp-aes-256 esp-md5-hmac
crypto ipsec ikev1 transform-set ESP-DES-SHA esp-des esp-sha-hmac
crypto ipsec ikev1 transform-set ESP-DES-MD5 esp-des esp-md5-hmac
crypto ipsec ikev1 transform-set ESP-AES-192-MD5 esp-aes-192 esp-md5-hmac
crypto ipsec ikev1 transform-set ESP-3DES-MD5 esp-3des esp-md5-hmac
crypto ipsec ikev1 transform-set ESP-AES-256-SHA esp-aes-256 esp-sha-hmac
crypto ipsec ikev1 transform-set ESP-AES-128-SHA esp-aes esp-sha-hmac
crypto ipsec ikev1 transform-set ESP-AES-192-SHA esp-aes-192 esp-sha-hmac
crypto ipsec ikev1 transform-set ESP-AES-128-MD5 esp-aes esp-md5-hmac
crypto ipsec ikev1 transform-set ESP-3DES-SHA esp-3des esp-sha-hmac
crypto dynamic-map SYSTEM_DEFAULT_CRYPTO_MAP 65535 set ikev1 transform-set ESP-AES-128-SHA ESP-AES-128-MD5 ESP-AES-192-SHA ESP-AES-192-MD5 ESP-AES-256-SHA ESP-AES-256-MD5 ESP-3DES-SHA ESP-3DES-MD5 ESP-DES-SHA ESP-DES-MD5
crypto map Outside_map 65535 ipsec-isakmp dynamic SYSTEM_DEFAULT_CRYPTO_MAP
crypto map Outside_map interface Outside
crypto ikev1 enable Outside
crypto ikev1 policy 10
authentication pre-share
encryption 3des
hash sha
group 2
lifetime 86400
crypto ikev1 policy 30
authentication crack
encryption 3des
hash sha
group 2
lifetime 86400
telnet 172.17.1.0 255.255.255.0 Inside
telnet timeout 5
ssh 172.17.1.0 255.255.255.0 Inside
ssh timeout 5
console timeout 0
dhcpd address 172.17.1.100-172.17.1.200 Inside
dhcpd dns 172.17.1.41 172.17.1.42 interface Inside
dhcpd lease 100000 interface Inside
dhcpd domain adrs1.net interface Inside
threat-detection basic-threat
threat-detection statistics
threat-detection statistics tcp-intercept rate-interval 30 burst-rate 400 average-rate 200
webvpn
group-policy RedV internal
group-policy RedV attributes
wins-server value 172.17.1.41
dns-server value 172.17.1.41 172.17.1.42
vpn-tunnel-protocol ikev1
default-domain value ADRS1.NET
group-policy RedV_1 internal
group-policy RedV_1 attributes
wins-server value 172.17.1.41
dns-server value 172.17.1.41 172.17.1.42
vpn-tunnel-protocol ikev1
split-tunnel-policy tunnelspecified
default-domain value adrs1.net
username rparker password FnbvAdOZxk4r40E5 encrypted privilege 15
username rparker attributes
vpn-group-policy RedV
username mhale password 2reWKpsLC5em3o1P encrypted privilege 0
username mhale attributes
vpn-group-policy RedV
username dcoletto password g53yRiEqpcYkSyYS encrypted privilege 0
username dcoletto attributes
vpn-group-policy RedV
username rhanna password Pd3E3vqnGmV84Ds2 encrypted privilege 15
username rhanna attributes
vpn-group-policy RedV
tunnel-group RedV type remote-access
tunnel-group RedV general-attributes
address-pool VPN2
authentication-server-group RedVec
default-group-policy RedV
tunnel-group RedV ipsec-attributes
ikev1 pre-shared-key *****
class-map global-class
match access-list global_mpc
class-map inspection_default
match default-inspection-traffic
policy-map type inspect dns preset_dns_map
parameters
message-length maximum client auto
message-length maximum 512
policy-map global_policy
class inspection_default
inspect dns preset_dns_map
inspect ftp
inspect h323 h225
inspect h323 ras
inspect rsh
inspect rtsp
inspect esmtp
inspect sqlnet
inspect skinny
inspect sunrpc
inspect xdmcp
inspect sip
inspect netbios
inspect tftp
inspect ip-options
inspect icmp
class global-class
flow-export event-type all destination 172.17.1.52
service-policy global_policy global
prompt hostname context
call-home
profile CiscoTAC-1
no active
destination address http https://tools.cisco.com/its/service/oddce/services/DDCEService
destination address email [email protected]
destination transport-method http
subscribe-to-alert-group diagnostic
subscribe-to-alert-group environment
subscribe-to-alert-group inventory periodic monthly
subscribe-to-alert-group configuration periodic monthly
subscribe-to-alert-group telemetry periodic daily
hpm topN enable
Cryptochecksum:202ad58ba009fb24cbd119ed6d7237a9Hi Roger,
I bet you already checked it, but does the MPLS end router has route to VPN client subnet 172.17.200.x (or default) pointing to core rtr)?
Also, if the MPLS link has any /30 subnet assigned, you may need to include that as well in Object group LAN-NETWORKS.
Thx
MS -
Having Problem with JSP In Netscape!HELP!!!
HI to all! I�m having problem with the jsp that i have :( If i use the Internet explorer it works but at Netscape... it doesn�t work :( The value of "PTE" is null... I need help !!!Please! I think the HTML IS NOT HELPING ...
the code is :
<html>
<head>
<!--tp001_transferencias_oic_POR.jsp-->
<title>BBVA - Transferências - Transferências OIC</title>
<LINK rel=STYLESHEET type='text/css' href="estilos/tablas.css">
<!--script language="javascript" src "js/dynlayer.js"></script-->
<script language="Javascript" src="js/banner.js"></script>
<script language="Javascript" src="js/tp_oic.js"></script>
<script language="Javascript" src="js/utilidades.js"></script>
<script language="javascript" src="js/limpar.js"></script>
<script language="javascript" src="js/tiempo.js"></script>
</HEAD>
<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" class="pag-contenido" onLoad="controlSesion();">
<%@ include file ="includecbtf.jsp" %>
<% String s = (String)datos.get("dt");
java.util.StringTokenizer str = new java.util.StringTokenizer(s, "-");
String anoServer = str.nextToken() ;
String mesServer = str.nextToken() ;
String diaServer = str.nextToken() ;
%>
<!--1�form-->
<form method="post" name="captura" action="<%=urls.get("action")%>">
<center> <!--1�center-->
<br>
<!--1�table-->
<table border="0" cellpadding="0" cellspacing="0" width="500"> <!--table das transf e nome-->
<tr>
<td colspan="3"><img src="images/linea.gif" border="0"></td>
</tr>
<tr>
<td width="250"><img src="images/traspasos.gif" border="0"></td>
<td width="82"><img src="images/titular.gif" border="0"></td>
<td width="169" class="fondotitular"><font class="texttitular"><%=datos.get("usuario")%></font></td>
</tr>
<tr>
<td colspan="3"><img src="images/linea.gif" border="0"></td>
</tr>
</table> <!--Fim do 1� table-->
<br><br>
</center> <!--Fim do 1� Center-->
<center> <!--2� Center-->
<!--Conteudo do table 2-->
<table cellpadding="3" cellspacing="1" border="0" align="center" width="500"> <!--table referente a mensagem-->
<tr>
<td class="cabeceratitulo" colspan="2"><p class="titulotabla">Nota : As Transferências para outras Instituições de Crédito decorrem de acordo com os horários da Compensação Interbancária, não se responsabilizando o BBVA pela sua realização fora das regras em uso.</p></td>
</tr>
<tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
</table> <!--fim do table2-->
</center> <!--Fim do 2� Center-->
<center> <!-- Inicio 3� Center-->
<!--Conteudo da table Combo-->
<!--Table3-->
<table cellpadding="3" cellspacing="1" border="0" align="center" width="500">
<tr>
<td class="cabeceratitulo" colspan="2"><p class="titulotabla">Transferência Conta a Conta para outras Instituiçôes de Crédito</p></td>
</tr>
<tr>
<td class="formgrisosc" width="100">
<p class="dato">Conta Ordenante: </p></td>
<td class="formgrisosc" width="300">
<%
java.util.Vector v = (java.util.Vector)(datos.get("ListaCuentas"));
java.util.Hashtable elem;
java.util.Enumeration e = v.elements();
%>
<!--1� Select-->
<select name="conta" size="1" class="formgrisosc">
<%
while (e.hasMoreElements()){
elem = (com.ibm.dse.base.Hashtable)(e.nextElement());
String cuenta = ((String)elem.get("s_banco")).trim() + "-"+((String)elem.get("s_oficina")).trim()+((String)elem.get("s_dcontrol")).trim()+((String)elem.get("s_num_cuenta")).trim();
out.println("<option value=\"" + ((String)elem.get("s_tipo")) + "$" + ((String)elem.get("s_clave_asunto")) + "\">" + cuenta + "</option>");
%>
</select> <!--Fim do 1� Select-->
</td>
</tr>
<tr>
<td class="formgriscla" width="100"><p class="dato">Data de Processamento:</p></td>
<td class="formgriscla">
<input type="text" name="dia" size="2"class="formgriscla" value="<%=diaServer %>" maxlength="2" class="formgriscla"> /
<input type="text" name="mes" size="2"class="formgriscla" value="<%=mesServer %>" maxlength="2" class="formgriscla"> /
<input type="text" name="ano" size="4"class="formgriscla" value="<%=anoServer %>" maxlength="4" class="formgriscla"></td>
<input type="hidden" name="dact" size="2"class="formgriscla" value="<%=diaServer %>" maxlength="2" class="formgriscla">
<input type="hidden" name="mact" size="2"class="formgriscla" value="<%=mesServer %>" maxlength="2" class="formgriscla">
<input type="hidden" name="aact" size="4"class="formgriscla" value="<%=anoServer %>" maxlength="4" class="formgriscla"></td>
</tr>
<tr>
<td class="formgrisosc" width="100"><p class="dato">Moeda: </p></td>
<td class="formgrisosc"><p class="dato">
<!--Select 2�Ver este bem-->
<select name="Moeda" size="1" class="formgrisosc">
<option value="PTE" selected>Escudos</option>
<option value="EUR">Euros</option>
</select> </p>
</td>
</tr>
<tr>
<td class="formgriscla" width="100"><p class="dato">Importância:</p></td>
<td class="formgriscla"><input type="text" name="importancia" size="20" maxlength="15" class="formgriscla"></td>
</tr>
<tr>
<td class="formgrisosc" width="100"><p class="dato">Refêrencia:</p></td>
<td class="formgrisosc"><input type="text" name="ref" size="15" maxlength="10" class="formgrisosc"></td>
</tr>
<tr>
<td class="formgriscla" width="100"><p class="dato">NIB Beneficiário:</p></td>
<td class="formgriscla"><input type="text" name="nibBeneficiario" size="30" maxlength="21" class="formgriscla"></td>
</tr>
<tr>
<td class="formgrisosc" width="100"><p class="dato">Descrição p/ Conta Débito:</p></td>
<td class="formgrisosc"><input type="text" name="debito" size="45" maxlength="45" class="formgrisosc"></td>
</tr>
<tr>
<td class="formgriscla" width="100"><p class="dato">Descrição p/ Conta Crédito:</p></td>
<td class="formgriscla"><input type="text" name="credito" size="45" maxlength="45" class="formgriscla"></td>
</tr>
<tr>
<td class="cabecera" colspan="2"><img src="images/1x1.gif" width=1 height=3 border="0"></td>
</tr>
</table> <!--Fim do table 3-->
</center> <!--Fim do 3�center-->
<center> <!--Inicio do 4� Center-->
<!--Inicio da table 4�-->
<table border="0" cellspacing="2" cellpadding="0">
<tr>
<td valign="top"><img src="images/limpar.gif" border="0" alt="Apagar"></td>
<td valign="top"><img src="images/continuar.gif" border="0" alt="Continuar"></td>
</tr>
</table> <!--Fim do 4� Table-->
</form> <!--Fim do FORM-->
</center> <!--Fim do 4� Center-->
</body> <!--Fim do BODY-->
</html> <!--Fim do Html-->
Thanks pepole!thanks people! when i try to validate the action "PTE" he gaves me (if i put a ALERT...) null.
the js code is : (Moeda is coin )
//testa amount
// var ent = (f.amount.value);
var tamanho = f.amount.value.length;
var valor = f.amount.value;
decimals = 2; // Apenas pode ter duas casas decimais?
if (((tamanho == 0) || (valor == 0)) && ok)
alert ("A import�ncia tem de ser maior que zero.");
f.amount.focus();
f.amount.select();
ok = false;
else
alert(f.Moeda.value);
if((f.Moeda.value=="PTE") && ok)
for (j = 0; j < tamanho; j++)
xx = valor.charAt(j);
if ((!(xx.match(numeroER)) && ok))
alert ("O Campo Import�ncia deve ser num�rico inteiro.");
f.amount.focus();
f.amount.select();
ok = false;
//if para limitar valor dos Escudos
if (ok)
if (eval(valor) > 1000000)
alert ("The field amount must be maxium 1 000 000 Pte.");
f.amount.focus();
f.amount.select();
ok = false;
else
if (ok)
//function checkDecimals(f.amount, f.importancia.value) {
if (isNaN(valor)) {
alert("O Campo Import�ncia deve ser num�rico e como separador decimal, o ponto.");
f.amount.select();
f.amount.focus();
ok = false;
else {
timeshundred = parseFloat(valor * Math.pow(10, decimals));
integervalue = parseInt(parseFloat(valor) * Math.pow(10, decimals));
if (timeshundred != integervalue)
alert ("Apenas pode ter " + decimals + " casas decimais. Por favor tente outra vez.");
f.amount.select();
f.amount.focus();
ok = false;
if (ok)
{ //if to limit the value of the Euros
if(eval(valor) > 4988)
alert ("The field amount must be maxium 4988 Eur.");
f.amount.focus();
f.amount.select();
ok = false;
}//end of amount -
Hi! I´m having problems with showing video files in Qlab on my Macbook Air. It started suddenly. Consulted a sound/video technician who told me to "blow out" my Mac. Was told to use cmd+r when restarting. Is this the right way to clean up my Mac? And is it likely that some kind of bug is causing problems for Qlab to show video files? I´ve already tried with a bunch of different video files and sometimes Qlab plays them and sometimes not. I need the Qlab playlist for a theatre show and only have a week until showtime so starting to really worry. Is there anyone out there who can help?
Your Mac runs maintenance in the background for you.
Command + R gives you access to restore, repair, or reformat the drive using OS X Recovery
No idea why that was suggested.
You may have a third party video player installed that's causing an incompatibility issue.
Check these folders:
/Library/Internet Plug-Ins/
/Library/Input Methods/
/Library/InputManagers/
/Library/ScriptingAdditions
~/Library/Internet Plug-Ins/
~/Library/Input Methods/
~/Library/InputManagers/
~/Library/ScriptingAdditions
The first four locations listed are in the root-level Library on your hard disk, not the user-level Library in your Home folder.The tilde (~) represents your Home folder.
To access the Home folder in OS X Lion or Mountain Lion, open the Finder, hold the Option key, and chooseGo > Library. -
Hi, I am having this problem:
I made a CustomItem, a TextField, now I overloaded the traverse method, so if the keycode is Canvas.UP or Canvas.DOWN then return false else return true.
The problem is that when I press the left or rigth button it also returns false and not true.
and there is another problem with traverse, before returning false or true I set a boolean and call to repaint to draw it on some way if its selected or not, the paint method is being called but it just dont draw as desired.
protected void paint(Graphics g, int ancho, int alto) {
System.out.println ("Dentro del paint, seleccionado="+seleccionado);
try {
g.drawString(label, 0, 0, Graphics.TOP|Graphics.LEFT);
if (!seleccionado) {
g.setColor(120, 120, 120);
g.drawRect(0, 4, tama�oTexto+8, 25);
if (seleccionado) {
g.setColor(255, 255, 255);
g.fillRect(1, 5, (tama�oTexto+8-1), 23);
g.setColor(0, 0, 0);
if (!seleccionado) {
g.setColor(80, 80, 80);
g.drawString(texto, 4, 7, Graphics.TOP|Graphics.LEFT);
if (seleccionado) {
int cursorX=Font.getDefaultFont().charsWidth((texto.substring(0, idLetraActual)).toCharArray(), 0, texto.substring(0, idLetraActual).length())+4;
g.drawChar('|', cursorX, 7, Graphics.TOP|Graphics.LEFT);
} catch (Exception E){
E.printStackTrace();
}the traverse method set the seleccionado variable and calls to repaint but instead of being false the paint method is drawing it as true (most of times).I have a problem with findByxxx() method.. in
Container managed bean.
i have
Collection collection =
home.findByOwnerName("fieldValue");
specified in my Client Program, where ownerName is the
cmp fieldname..
and
public Collection findByOwnerName(String ownerName)
throws RemoteException, FinderException
defined in my home interface.
i have not mentioned the findBy() method anywhere else
(Bean class). You have to describe the query in the deployment descriptor.
>
Even if i have a same "fieldValue" in the database
(Oracle), which i specified in findBy() method, iam a
result of owner Not found, which is not the case as i
have that owner name.
for the same application if i use findByPrimaryKey(),
it is working..
Can any one please post me the solution. -
Problem with WindowClosing() method
Hello everyone,
I have some problem with WindowClosing() method, in which I gave options
to quit or not. Quit is working fine but in case of Cancel, its not returning to
the frame. Can anyone help me ....Here is my code
import javax.swing.*;
import java.awt.*;
import javax.swing.event.*;
import java.awt.event.*;
public class TestFrame extends JPanel
public static void main(String[] args)
JFrame frame = new JFrame("Frame3");
WindowListener l = new WindowAdapter() {
public void windowClosing(WindowEvent e) {
int button = JOptionPane.showConfirmDialog(null,"OK to Quit","",JOptionPane.YES_NO_OPTION, -1);
if(button == 0) {
System.exit(0);
else
return;
frame.addWindowListener(l);
frame.setSize(1200,950);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}Maybe try
int button = JOptionPane.showConfirmDialog(yourframe,"OK to
Quit","",JOptionPane.YES_NO_OPTION, -1); -
Problem with forward method of jsp
am having problem with the requestDispatcher.forward method in my jsp + wml , the forward method gets executed but the new page is not displayed in the wap browser,
code snippet
small.jsp
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<%@ page language="java" %>
<%@ page contentType="text/vnd.wap.wml; charset=UTF-8" %>
<%@ page import="java.lang.*,java.io.*,java.util.*,java.util.Vector,java.util.Properties "%>
<%
System.out.println("in small");
RequestDispatcher rd = request.getRequestDispatcher("small1.jsp");
rd.forward(request,response);
%>
small1.jsp
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<%@ page language="java" autoFlush="false"%>
<%@ page contentType="text/vnd.wap.wml; charset=UTF-8" %>
<%@ page import="java.net.*,java.lang.*,java.io.*,java.util.*,java.util.Vector,java.util .Properties"%>
<%
String sm = "small1";
System.out.println("in small1");
%>
<wml>
<card id="two">
<p>
<small><%=sm%></small>
</p>
</card>
</wml>
i get the following output in the log
in small
in small1
but i dont get to see the small1.jsp' content , also the response.sendRedirect method works fine ,,
pls give me the soln
Thnk u in advancethank u very for the repl this is the message which i get in the nokia wap browser...
cannot load small1.jsp(HTTP Error 500 Server Error)
and i use IBM WebSphere as the web server....
and i have found that using response.reset in the small2.jsp overcomes this problem but the card title and the anchor tag is not displayed !!!!
what could be this problem? -
Having problem with i Pad sync getting pop up message as below. The i Pad cannot be synced because there is not enough space to hold all of the items in the iTunes library (additional 10.03 GB required). There is enough space be it in PC or on i Pad. Why and What can be done to resolve, please advice appreciate. Thanks
It generally means - just using random numbers for examples - the iTunes on your computer holds 45 gig of content, you have a 16 gig iPad which has 13 gig of free space and the content just won't fit.
Easy solutions. go into iTunes and 'manually manage' your content. I believe this is in the main summary tab for your device (connect your device, click on the icon in iTunes to access controls for your iPad
You may also need to choose to manually control content in both the music and movie tabs.
Apple - Support - Manuals
the manual will have more specific info for syncing and controlling content -
I am having problems with text size when using AOL Mail. I am using version 25.0 of Firefox. I did not have this problem in the past, but I suspect a change occurred with one of the Firefox upgrades. I do not have the same problem when using Internet Explorer.
Could you start by resetting the zoom level on the page? To do that, you can either:
* Press Ctrl+0 (that's a zero) on the keyboard
* View menu > Zoom > Reset
You also can use zoom to increase/decrease the size from there. This article describes the various mouse, keyboard, and menu methods: [[Font size and zoom - increase the size of web pages]].
Any luck? -
For users having problems with Mail functionality...
Hello! I have been having problems with Mail functionality as well, so, I took a few steps to see if I could solve the problem on my own.
My problems were:
Mail would freeze when sending mail, or, when I pressed quit, it would freeze.
If I toggled between inboxes too much it would freeze up.
Even after trying the many techniques others offered on this board, Mail still froze up. So.. here's what I did:
1.) Turn off the auto-retrieve mail function in the preferences/general menu. Set it to a manual check. Just check it yourself every once in awhile. It may not be as convenient, but it works, trust me.
2.) Under the fonts and colors menu, set all three fonts to the SAME font (mines Century Schoolbook, but anything works) and turn off fixed-width font. Sometimes mail has a tough time decoding and working with texts, and causes it to freeze.
3.) Clean our your main inbox! Place the emails that you want to keep, but don't need to be in your inbox in a new folder on your inbox bar (mines aptly named 'Saved Messages.' That way, when you open up Mail to your default account, it doesn't have 1,000+ messages to index. Also, try to keep the inboxes from having more than 100-200 messages per. It seems to frown on any more than that.
After trying these three easy, steps, restart mail and see if things run smoother. I have had no problems since these changes, and mail runs a ton better. Plus you don't have to worry about deleting your library/mail folder anymore. Let me know if things work out so I can see if my theory is a universally proven thing. Thanks and good luck!
iMac G5 20" Mac OS X (10.4.5)Good question. I have worked very little with IMAP other than as a testing device, so, on a daily routine I cannot say how it would function. However, I can only expect that by having the option to download all emails for offline viewing selected, you are right in it being a lag creator. Another suggestion would be, if you are running a single-computer setup, to have the account delete emails from the server after recieving them on your computer. Thus, you reduce the risk of repeat downloads or unnecessary build-up on the server end. DO NOT select this option if you run multiple computer set ups on one AppleMail account system or you will cause some discrepancies and/or data loss from system to system. Or, if you have emails redirected from a seperate server to Mail (i.e. I redirect mail from my university email account into Mail so that I don't have to go to the web-mail site to check it--> just like Gmail or Yahoo etc etc) you won't be able to check them from the web-based email system if you have the system delete them. Ok that sounded confusing. Solution: have the system remove emails from the server after a week (or any period of time, just not immediately) so that, in the off-chance you need to use the online system, you will have access, and will give you a chance to check the emails on other systems without a threat of data corruption (by corruption i mean that frustrating feeling you get when you can't find that super important email that was in your inbox just 10 seconds ago on your desktop etc.)
I will see if I can learn anything more about IMAP Ernie. Its definitley the biggest problem source for Mail, POP and .Mac being simple and functional as long as you don't play with the settings too much. As far as the issue of Offline viewing goes, try turning it off and seeing how Mail functions.
BEFORE you turn it off, however, I recommend saving all of your emails in your inbox as a text file or something so, in case the server burps and has a brain flatuence, you don't lose anything. Been there, done that, thrown the books against the wall in a frustrated rage.
My only reserve about the Offline Viewing is whether or not Mail will, when you click "recieve mail," have to re-download the emails from the server each time. If so, then it may end up taking longer and lagging more. The issue here is obviously minimizing the amount of activity between Mail and the email server without jeapordizing information on the server or multiple Mail programs on the same account. When we can find that balance, I think Mail's potential will be realized. Keep the questions coming. -
Having problem with typing chinese in OS X Lion
After installing OS X Lion, I am having problem with typing traditional chinese in my own account. Everytime I switch to traditional chinese the computer become extremely slow and the finally freezed. However, when I am using visitor account, I can type in traditional chinese without any problem. How should I fix this?
Normally differences like that between main and visitor accounts indicate a bad .plist in Home/Library/Preferences in the main account. I don't know which one might cause this...
-
Having problem with software update
Hello,
I am having problem with reinstalling my software with Nokia Suite. It shows while backing up the data that phone memory is full. However already I have exhausted all the options for freeing phone memory.
I need to reinstall my software as my mobile phone is causing some problem.
I have Asha 305 phone. Kindly reply back if you could help me.
Regards,
Ayush SharmaHello @poochini21 ,
Thanks for replying.
The reason i wish to reinstall software in my cellphone because of 'deletion of certificates'. It shows a 'Certificate Invalid, Check date and time settings'. Furthermore, my nokia browser has restored to its default version. And the mail does not work.
Re backup: I am unable to create backup following the mentioned instruction, it again pops the memory issue.
I have already tried to reset my mobile, both the settings and the full reset, which at maximum saves me a free phone memory of 6.0 MB. Moreover I have also tried the option in Nokia Suite, 'Free some space'. That too could not help me out.
If you can help me out, kindly reply.
Thanks and Regards,
Ayush Sharma
poochini21 wrote:
Hi ayushmnit,
Just to clarify, the main reason why you'd like to reinstall the phone's SW via Nokia Suite is due to the memory full error that you're getting, is that correct? Do you also get the same error when creating a backup file using the phone itself? In your Asha 305, try going to Settings > sync and Backup > create a backup. A memory card is required to do this.
BTW, is resetting one of the steps you did to free more phone space? If the phone backup process succeeded, try resetting your phone by going to Settings > Restore factory settings. You can select Settings only to just restore the defaul settings, or Restore all to wipe out all your personal data which could free more space in your phone. After the reset, try reinstalling the phone's SW via Nokia Suite and see your Asha 305 will work fine afterwards.
Let us know how it will go.
Maybe you are looking for
-
2006 MacMini Model A1176 cannot send video to Toshiba TV by S-video or ColorStream adapter
I attempted to hook my Mac Mini to my Toshiba Model 36AF41 TV. Since the TV does not have an HDVI input but does have both S-Video and ColorStripe, I purchased a VGA to ColorStripe/S-Video adapter. I tried the S-Video connection only, then tried the
-
Advice on Exporting Flash To Video
Greetings everyone. I'm in a bit of a pickle. I promised a client that I would be able to export the flash piece I did for them into a Quicktime Movie. I am using Flash 8, and using many Flash 8 only features (i.e. blending modes, blur filters). Now,
-
How can i edit a PDF document?
would like to edit a pdf doc. how can i do that?
-
Blue Screen Pops up everytime I put my shuffle into USB port
PLEASE anyone help me!! My shuffle was working fine and then one day an Blue ERROR screen pops up telling me windows is shutting down because of an error. I was told it might be a driver error and to disable the drive or check for driver updates. is
-
i want to use User Mapping APIs with web Dynpro. give some information or code .