string java

search for more blogs here

 

"JPanel won't update" posted by ~Ray
Posted on 2008-11-13 12:15:49

Hello. Everything in my applet works except for one thing - When I click the JButton and the event takes place it is supposed to change a JPanel to say "please wait" but instead it freezes up for a few seconds while it completes the next commands and goes to the JPanel that is supposed to display after the commands are made completly bypassing the "please wait" JPanel. The code looks like this: public void actionPerformed(ActionEvent pt) { if(pt getSource() == init_Button){ overallLayout show(cardPanel. "2"); // please wait JPanel try { // Construct data String data = URLEncoder encode("key1". "UTF-8") + "=" + URLEncoder encode("value1". "UTF-8"); data += "&" + URLEncoder encode("key2". "UTF-8") + "=" + URLEncoder encode("value2". "UTF-8"); // Send data URL url = new URL("http://www loaded-designs com/posttest/posttest php"); URLConnection conn = url openConnection(); conn setDoOutput(true); OutputStreamWriter wr = new OutputStreamWriter(conn getOutputStream()); wr write(data); wr flush(); // Get the response BufferedReader rd = new BufferedReader(new InputStreamReader(conn getInputStream())); String line; while ((line = rd readLine()) != null) { getback_Label setText("The PHP variables are below:"); getback_Label2 setText(line); System out println(line); overallLayout show(cardPanel. "3"); } wr close(); rd close(); } catch (Exception ex) { ex printStackTrace(); } } } Swing works with the event dispatch thread (EDT). It is an attempt to make sure all events occur in proper sequence by having a single queue for all requests to wait in. So doing a time-consuming task like reading data over a network makes everything else wait until the long-running task completes. This has the net affect of freezing the gui and dis-allowing any gui updates to take place while the edt is busy with the long-running task. The solution is to do these long-running tasks on a background thread. For example: public void actionPerformed(ActionEvent pt){ if(pt getSource() == init_Button) { overallLayout show(cardPanel. "2"); // please wait JPanel loadData(); }}private void loadData(){ Thread thread = new Thread(new Runnable() { public void run() { try { // Construct data String data = URLEncoder encode("key1". "UTF-8") + "=" + URLEncoder encode("value1". "UTF-8"); data += "&" + URLEncoder encode("key2". "UTF-8") + "=" + URLEncoder encode("value2". "UTF-8"); // Send data URL url = new URL("http://www loaded-designs com/" + "posttest/posttest php"); URLConnection conn = url openConnection(); conn setDoOutput(true); OutputStreamWriter wr = new OutputStreamWriter(conn getOutputStream()); wr write(data); wr flush(); // Get the response BufferedReader rd = new BufferedReader( new InputStreamReader(conn getInputStream())); String line; while ((line = rd readLine()) != null) { getback_Label setText("The PHP variables are below:"); getback_Label2 setText(line); System out println(line); overallLayout show(cardPanel. "3"); } wr close(); rd close(); } catch (Exception ex) { ex printStackTrace(); } } }); // Keep gui responsive to user input thread setPriority(Thread. NORM_PRIORITY); // 5. EDT = 6 thread start();} private void loadData() { Thread thread = new Thread(new Runnable()); { public void run() { try { // Construct data String data = URLEncoder encode("key1". "UTF-8") + "=" + URLEncoder encode("value1". "UTF-8"); data += "&" + URLEncoder encode("key2". "UTF-8") + "=" + URLEncoder encode("value2". "UTF-8"); // Send data URL url = new URL("http://www loaded-designs com/" + "posttest/posttest php"); URLConnection conn = url openConnection(); conn setDoOutput(true); OutputStreamWriter wr = new OutputStreamWriter(conn getOutputStream()); wr write(data); wr flush(); // Get the response BufferedReader rd = new BufferedReader(new InputStreamReader(conn getInputStream())); String line; while ((line = rd readLine()) != null) { getback_Label setText("The PHP variables are below:"); getback_Label2 setText(line); System out println(line); overallLayout show(cardPanel. "3"); } wr close(); rd close(); } catch (Exception ex) { ex printStackTrace(); } } // Keep gui responsive to user input thread setPriority(Thread. NORM_PRIORITY); // 5. EDT = 6 thread start(); } } }

Forex Groups - Tips on Trading

Related article:
http://www.java-forums.org/new-java/3885-jpanel-wont-update.html

comments | Add comment | Report as Spam


"Word Scramble" posted by ~Ray
Posted on 2008-03-12 23:06:46

Guys I need help with this. Its a project that I am doing. I dont want you to furnish me or fix the code. I be to be able to do that. But I just need someone to express me what I am doing wrong. I have been staring at it for the last 3 hours and my brain has reached its threshold limit. Ok the objectives of this project is to act a string of words with spaces in between and then for each word keep the first and the last character but scramble whatever is in the middle so here is my.. gratify don't laugh i am a novice at coding especially in java /** * * @compose Lawrence */import java util.*;public class scramble { public static void main(arrange[] args) { int randomPos go away=0; char first measure; /* String text = "This is a pretty simple carve up. The season is autumn" + "and the air is crisp and alter. The leaves are turning a "+ "variety of colors and then sadly drop to the ground"; */ String text = "What person willing interesting"; Random generator = new Random(); for (int i=0; i<text length(); i++){ int whiteSpace = text indexOf(" " start); if (whiteSpace<0){break;} else{ first = text charAt(start); last = text charAt(whiteSpace-1); System out create(first);// this is the first character for each word need the measure and scramble the middle String eachWord = text substring(start+1 whiteSpace-1) ; //this will furnish me the substring to scramble need a integer to disarrange? int b = (whiteSpace-1)-(start+1); // this gives how many numbers to scramble for (int n=0; n < b; n++){ randomPos = generator nextInt(b); //outputs a random beween 0&b) char a = eachWord charAt(randomPos); //takes the character at pos System out print(a); // onces i decide that racndom character i need to take it out of the list if((start+1)-randomPos <=1){ eachWord = text substring(randomPos whiteSpace-1);} else if((whiteSpace-1)-randomPos <=1){ eachWord = text substring(go away+1 randomPos); } else { eachWord = text substring(go away+1 randomPos)+ text substring(randomPos whiteSpace-1);} } System out println(last+ " "+ eachWord) ;//this is the last charater of each word! go away = whiteSpace+1; } } } } if((go away+1) - randomPos <= 1) { eachWord = text substring(randomPos whiteSpace-1);} else if((whiteSpace-1) - randomPos <= 1) { eachWord = text substring(go away+1 randomPos);} else { eachWord = text substring(start+1 randomPos) + text substring(randomPos whiteSpace-1);} and it works okay so far. The scramble method calls another helper method. Breaking things up like this makes everything easier to follow understand and to troubleshoot. It is an easy way to break drink complex tasks into easy–to–bring home the bacon steps. Your label block above will have to deal with much more complexity to work properly. And since you be to do this on your own I'll only say this: I found it much easier to build up a new String by appending randomly–selected chars from "eachWord". thank you hardwired,you see the algorithm that I am looking at is this lets say the evince "show"if you take the first and the measure one out then we undergo the substring "resen"ok then imagine the randomomizer picks from the new substring lets say it picks 3 as illustrated [0][1][2][ System out printf("s = %s%n" s);while(s length() > 0) { int pos = generator nextInt(s length()); if(pos == 0) s = s substring(1); else if(pos == s length()-1) s = s substring(0 pos); else s = s substring(0 pos) + s substring(pos+1 s length()-1); System out printf("pos = %d s = %s%n" pos s);}System out println("s = " + s); Finally finished the program. Thanks to hardwired for the guiding to the alter direction. Though I had to tweak it a little bit but definitely worked for me. So yea if you are bored one and and just want to scramble your boy/girl friends essay without having to manually altering the lay the earn then i guess you can use this /** * @author Lawrence */import java util.*;public class scramble { public static void main(arrange[] args) { int pos start=0; char first last; arrange text = "This is a pretty simple paragraph. The season is autumn" + "and the air is crisp and clear. The leaves are turning a "+ "variety of colors and then sadly drop to the fasten."; Random generator = new Random(); while (text length()>0){ int whiteSpace = text indexOf(" " start); if (whiteSpace<0){break;} else{ first = text charAt(start); last = text charAt(whiteSpace-1); if ((whiteSpace-1)-start <=0) System out create(text charAt(start)+ " "); else { arrange eachWord = text substring(start+1 whiteSpace-1) ; //this will give me the substring to scramble need a integer to randomize? System out create(first);// this is the first character for each evince need the measure and scramble the lay while(eachWord length()>0){ pos = generator nextInt(eachWord length()); //outputs a random value of the size System out print(eachWord charAt(pos)); // onces i decide that racndom engrave i need to take it out of the list if (pos==0) eachWord = eachWord substring(1); else if (pos == eachWord length()-1 ) eachWord = eachWord substring(0,pos); else eachWord = eachWord substring(0,pos) + eachWord substring(pos+1 eachWord length()); } System out create(last + " ") ;//this is the measure charater of each word! } start = whiteSpace+1; }} int lastWhiteSpace = text lastIndexOf(" "); System out print(text charAt(lastWhiteSpace+1)); String lastWord = text substring(lastWhiteSpace+2 text length()-2); while (lastWord length()>0){ int lpos = generator nextInt(lastWord length()); System out print(lastWord charAt(lpos)); if (lpos==0) lastWord = lastWord substring(1); else if (lpos==lastWord length()-1) lastWord = lastWord substring(0,lpos); else lastWord = lastWord substring(0,lpos)+lastWord substring(lpos+1,lastWord length()); } System out create(text charAt(text length()-2)+"."); } }

Forex Groups - Tips on Trading

Related article:
http://www.java-forums.org/new-java/3852-word-scramble.html

comments | Add comment | Report as Spam


"Word Scramble" posted by ~Ray
Posted on 2008-03-12 23:06:45

Guys I be help with this. Its a communicate that I am doing. I dont want you to furnish me or fix the label. I want to be able to do that. But I just need someone to tell me what I am doing wrong. I undergo been staring at it for the last 3 hours and my brain has reached its threshold limit. Ok the objectives of this project is to take a string of words with spaces in between and then for each evince act the first and the measure engrave but scramble whatever is in the middle so here is my.. gratify don't laugh i am a novice at coding especially in java /** * * @author Lawrence */merchandise java util.*;public categorise scramble { public static void main(String[] args) { int randomPos start=0; char first last; /* String text = "This is a pretty simple paragraph. The season is autumn" + "and the air is crisp and alter. The leaves are turning a "+ "variety of colors and then sadly drop to the ground"; */ String text = "What person willing interesting"; Random generator = new Random(); for (int i=0; i<text length(); i++){ int whiteSpace = text indexOf(" " go away); if (whiteSpace<0){end;} else{ first = text charAt(start); last = text charAt(whiteSpace-1); System out print(first);// this is the first character for each evince need the measure and go the lay String eachWord = text substring(start+1 whiteSpace-1) ; //this ordain give me the substring to scramble need a integer to randomize? int b = (whiteSpace-1)-(start+1); // this gives how many numbers to scramble for (int n=0; n < b; n++){ randomPos = generator nextInt(b); //outputs a random beween 0&b) char a = eachWord charAt(randomPos); //takes the engrave at pos System out print(a); // onces i choose that racndom engrave i be to take it out of the list if((start+1)-randomPos <=1){ eachWord = text substring(randomPos whiteSpace-1);} else if((whiteSpace-1)-randomPos <=1){ eachWord = text substring(go away+1 randomPos); } else { eachWord = text substring(start+1 randomPos)+ text substring(randomPos whiteSpace-1);} } System out println(last+ " "+ eachWord) ;//this is the measure charater of each evince! start = whiteSpace+1; } } } } if((start+1) - randomPos <= 1) { eachWord = text substring(randomPos whiteSpace-1);} else if((whiteSpace-1) - randomPos <= 1) { eachWord = text substring(go away+1 randomPos);} else { eachWord = text substring(start+1 randomPos) + text substring(randomPos whiteSpace-1);} and it works okay so far. The scramble method calls another helper method. Breaking things up like this makes everything easier to follow understand and to troubleshoot. It is an easy way to end down complex tasks into easy–to–manage steps. Your code block above will undergo to broach with much more complexity to bring home the bacon properly. And since you want to do this on your own I'll only say this: I found it much easier to build up a new String by appending randomly–selected chars from "eachWord". thank you hardwired,you see the algorithm that I am looking at is this lets say the word "Present"if you take the first and the measure one out then we have the substring "resen"ok then imagine the randomomizer picks from the new substring lets say it picks 3 as illustrated [0][1][2][ System out printf("s = %s%n" s);while(s length() > 0) { int pos = generator nextInt(s length()); if(pos == 0) s = s substring(1); else if(pos == s length()-1) s = s substring(0 pos); else s = s substring(0 pos) + s substring(pos+1 s length()-1); System out printf("pos = %d s = %s%n" pos s);}System out println("s = " + s); Finally finished the program. Thanks to hardwired for the guiding to the alter direction. Though I had to tweak it a little bit but definitely worked for me. So yea if you are bored one and and just be to scramble your boy/girl friends act without having to manually altering the lay the letter then i guess you can use this /** * @author Lawrence */import java util.*;public categorise scramble { public static void main(String[] args) { int pos start=0; char first last; String text = "This is a pretty simple paragraph. The season is autumn" + "and the air is fold and clear. The leaves are turning a "+ "variety of colors and then sadly displace to the fasten."; Random generator = new Random(); while (text length()>0){ int whiteSpace = text indexOf(" " start); if (whiteSpace<0){break;} else{ first = text charAt(go away); last = text charAt(whiteSpace-1); if ((whiteSpace-1)-start <=0) System out print(text charAt(start)+ " "); else { arrange eachWord = text substring(start+1 whiteSpace-1) ; //this will give me the substring to scramble be a integer to randomize? System out print(first);// this is the first character for each word need the measure and scramble the middle while(eachWord length()>0){ pos = generator nextInt(eachWord length()); //outputs a random value of the size System out create(eachWord charAt(pos)); // onces i choose that racndom character i need to take it out of the list if (pos==0) eachWord = eachWord substring(1); else if (pos == eachWord length()-1 ) eachWord = eachWord substring(0,pos); else eachWord = eachWord substring(0,pos) + eachWord substring(pos+1 eachWord length()); } System out print(measure + " ") ;//this is the measure charater of each evince! } start = whiteSpace+1; }} int lastWhiteSpace = text lastIndexOf(" "); System out create(text charAt(lastWhiteSpace+1)); String lastWord = text substring(lastWhiteSpace+2 text length()-2); while (lastWord length()>0){ int lpos = generator nextInt(lastWord length()); System out print(lastWord charAt(lpos)); if (lpos==0) lastWord = lastWord substring(1); else if (lpos==lastWord length()-1) lastWord = lastWord substring(0,lpos); else lastWord = lastWord substring(0,lpos)+lastWord substring(lpos+1,lastWord length()); } System out print(text charAt(text length()-2)+"."); } }

Forex Groups - Tips on Trading

Related article:
http://www.java-forums.org/new-java/3852-word-scramble.html

comments | Add comment | Report as Spam


"convert string to float" posted by ~Ray
Posted on 2008-01-01 21:12:23

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will: have the possibility to earn one of our surprises if you are an active member access many other special features that ordain be introduced later. Registration is fast simple and absolutely free so please. ! If you have any problems with the registration process or your account login please. hello. i'm actually doing a calculation for mobile aplication using netbeans. i got some problem when i'm trying to convert string to float. cn anybody tell me? actually. i can just convert string into integer using Integer parseInt. but i don't really know why i couldn't use Double parseDouble or Float parseFloat in netbeans. i though that syntax is exist isn't it? hm. does anybody got any suggestion for me in order to return string value as float or double?i'm actually do a coding like this--cobz = Integer parseInt(textfield getString());because this is the only way for me to retrieve the 'enter' form user in the text field so i need to convert that 'string; into 'float' or 'double' to complete my calculation coding; not really by convert into integer. but i really got a problem with this. so please anyone help me... -thanks guys-

Forex Groups - Tips on Trading

Related article:
http://www.java-forums.org/netbeans/3798-convert-string-float.html

comments | Add comment | Report as Spam


"Re: Marshalling Error" posted by ~Ray
Posted on 2007-12-15 15:00:11

Here is the info as requested :SEI : package za co hyphen tradequest server;merchandise javax jws. WebParam. Mode;merchandise javax jws. WebParam;import javax jws. WebService;merchandise javax jws soap. SOAPBinding. call;import javax jws soap. SOAPBinding;import javax jws. WebMethod;merchandise javax jws. WebResult;import javax xml ws. RequestWrapper;import javax xml ws. ResponseWrapper;/** * This class was generated by the CXF 2.0.2-incubator * Fri Oct 19 10:26:40 CAT 2007 * Generated obtain version: 2.0.2-incubator * */@WebService(targetNamespace = "http://server tradequest hyphen co za/" name= "TradeQuest")public interface TradeQuest { @WebResult(targetNamespace = "" label = "response") @RequestWrapper(localName = "tradeQuestAction" targetNamespace ="http://server tradequest hyphen co za/" className ="za co hyphen tradequest server. TradeQuestAction") @ResponseWrapper(localName = "tradeQuestActionResponse" targetNamespace= "http://server tradequest spell co za/" className ="za co hyphen tradequest server. TradeQuestActionResponse") @WebMethod public String tradeQuestAction(@WebParam(targetNamespace = "" name ="request") String communicate);}Implementation : package za co hyphen tradequest server;merchandise java io. StringReader;import javax jws. WebResult;merchandise javax jws. WebService;merchandise org apache log4j. Logger;import org jdom. Element;import org w3c dom. enter;merchandise org xml sax. InputSource;merchandise za co spell schema. SchemaValidation;import za co hyphen tradequest bus. CardAuthorisation;import za co hyphen tradequest bus. Refund;import za co hyphen tradequest bus. RetrievalReference;import za co hyphen tradequest bus. ReverseOrSettle;merchandise za co hyphen utils.*;merchandise za co hyphen webservices interfaces. IProcessAction;/** * The entry point for the TradeQuest communicate. It is reponsible for thefollowing : * <ul> * <li>Build a document which ordain be used to return the responses.</li> * <li>authorise the incoming xml string to ensure it conforms to theXSD.</li> * <li>affect the communicate.</li> * <li>authorise the outgoing xml string to verify it conforms to theXSD.</li> * <li>go a response in a valid xml string.</li> * </ul> * @author Gareth Uren * @version 2.0 16 October 2007 */@WebService(endpointInterface = "za co hyphen tradequest server. TradeQuest",serviceName = "TradeQuest")public categorise TradeQuestImpl extends CommonFields implements TradeQuest{/** Logger for AccountValidatinImpl categorise. */private final static Logger log = Logger getLogger(TradeQuestImpl categorise);private IProcessAction processAction;/** * @param communicate for the accounts to be validated in the create of an xmlstring * @return response of the account validation communicate in the form of an xmlstring */public String tradeQuestAction (arrange request){log info("create request for request len : " + request length());if ((request == null) || (request length() == 0)) {org w3c dom. Element error = Util buildErrorResponse(dataDoc. "No Requesthas been received by the web service");log error("No xml communicate received");return DomWriter domWriter(error new StringBuffer()); }dataDoc = Util buildDocument();stringReader = new StringReader(communicate);inputSource = new InputSource(stringReader); log info("*** REQUEST :\n" + request);SchemaValidation schemaValidation = new SchemaValidation();// schema validaiton failed on incoming requestif (!schemaValidation validateSchema(tradeQuestRequestSchemaUrl,inputSource)) {org w3c dom. Element error = Util buildErrorResponse(dataDoc,schemaValidation getValidationMessage());log error("Invalid XML received : " +schemaValidation getValidationMessage());return DomWriter domWriter(error new StringBuffer()); }// continue to do processing of requestelse{jdomDataDoc = Util getXmlAsDocument(communicate);// get the grow elementElement root = jdomDataDoc getRootElement();userId = grow getChildText("UserId");password = root getChildText("Password");action = grow getChild("challenge") getText();log info("Action for request : " + action);// do authorisationif (action trim() toUpperCase() equals("AUTH")){processAction = new CardAuthorisation(jdomDataDoc userId password);}else if (challenge cut() toUpperCase() equals("SETTLE")){processAction = new ReverseOrSettle(jdomDataDoc challenge userId,password);}else if (challenge cut() toUpperCase() equals("REVERSAL")){processAction = new ReverseOrSettle(jdomDataDoc challenge userId,password);}else if (challenge trim() toUpperCase() equals("REFUND")){processAction = new Refund(jdomDataDoc userId password);}else if (action trim() toUpperCase() equals("RETREF")){processAction = new RetrievalReference(jdomDataDoc userId password);}try{response = processAction doRequestedAction();}catch (Exception e){log info("Exception creating command to IProcessAction - " +e getMessage() );log info("*** response = " + response);}}if ((response == null) || (response length() == 0)) {org w3c dom. Element error = Util buildErrorResponse(dataDoc. "No Responsehas been received by the web server");log error("No xml response received");return DomWriter domWriter(error new StringBuffer()); }stringReader = new StringReader(response);inputSource = new InputSource(stringReader);// schema validation failed on outgoing requestif (!schemaValidation validateSchema(tradeQuestResponseSchemaUrl,inputSource)) {org w3c dom. Element error = Util buildErrorResponse(dataDoc,schemaValidation getValidationMessage());log error("Invalid XML sent : " +schemaValidation getValidationMessage());return DomWriter domWriter(error new StringBuffer()); }log info("*** RESPONSE :\n" + response);go response;}}Julio Arias wrote:> > Can you affix your SEI or at least the method signature for the one > that is failing.> > On Nov 15. 2007 at 5:28 AM garethu wrote:> >>>> I have created a web service which is currently returning inconsistent>> results. Sometimes it ordain run fine returning valid results to the >> client.>> But after every 2 or 3 runs it returns the following from the Apache>> Server:>>>> Nov 15. 2007 1:26:43 PM java lang. Throwable <init>>> INFO: Interceptor has thrown exception unwinding now>> org apache cxf interceptor. Fault: Marshalling Error: null>> at java lang. Throwable.<init>(Throwable java:241)>> at java lang. RuntimeException.<init>(RuntimeException java:77)>> at>> org apache cxf common i18n. UncheckedException.<init> >> (UncheckedException java:35)>> at org apache cxf interceptor. Fault.<init>(Fault java:43)>> at>> org apache cxf jaxb. JAXBEncoderDecoder marshall >> (JAXBEncoderDecoder java:181)>> at org apache cxf jaxb io. DataWriterImpl write(DataWriterImpl java: >> 42)>> at>> org apache cxf interceptor. AbstractOutDatabindingInterceptor writePart >> s(AbstractOutDatabindingInterceptor java:93)>> at>> org apache cxf interceptor. BareOutInterceptor handleMessage >> (BareOutInterceptor java:68)>> at>> org apache cxf phase. PhaseInterceptorChain doIntercept >> (PhaseInterceptorChain java:207)>> at>> org apache cxf interceptor. OutgoingChainInterceptor handleMessage >> (OutgoingChainInterceptor java:74)>> at>> org apache cxf arrange. PhaseInterceptorChain doIntercept >> (PhaseInterceptorChain java:207)>> at>> org apache cxf displace. ChainInitiationObserver onMessage >>.

Forex Groups - Tips on Trading

Related article:
http://mail-archives.apache.org/mod_mbox/incubator-cxf-user/200711.mbox/%3C13788108.post@talk.nabble.com%3E

comments | Add comment | Report as Spam


"Array or Vector" posted by ~Ray
Posted on 2007-12-09 13:32:18

Welcome to the Java Forums. You are currently viewing our boards as a guest which gives you limited find to believe most discussions and access our other features. By joining our free community you will: have the possibility to earn one of our surprises if you are an active member find many other special features that will be introduced later. Registration is abstain simple and absolutely free so gratify. ! If you have any problems with the registration affect or your account login gratify. Vector <arrange> myValues = new Vector<String>(); arrange [] myValues1 = new String[10]; Just want to experience which one is the exceed choice. I am talking about memory and performance issues. Cheers If you know how many items you be to hold on. I think an array is the way to go. The advantage of a vector is its ability to change size. Basically if a vector is beat and you add another disapprove the memory for that object is dynamically allocated. This does not come about in an array. To change magnitude the coat of an array you have to create a new one and copy all of the original values. So in my opinion if there is no chance that you will be more than 10 Strings go with the arrange.

Forex Groups - Tips on Trading

Related article:
http://www.java-forums.org/new-java/3874-array-vector.html

comments | Add comment | Report as Spam


"Array or Vector" posted by ~Ray
Posted on 2007-12-09 13:32:18

accept to the Java Forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you ordain: have the possibility to acquire one of our surprises if you are an active member find many other special features that ordain be introduced later. Registration is fast simple and absolutely free so please. ! If you have any problems with the registration affect or your be login please. Vector <arrange> myValues = new Vector<String>(); String [] myValues1 = new arrange[10]; Just be to experience which one is the better choice. I am talking about memory and performance issues. Cheers If you know how many items you need to store. I evaluate an arrange is the way to go. The favor of a vector is its ability to dress coat. Basically if a vector is full and you add another disapprove the memory for that object is dynamically allocated. This does not happen in an array. To increase the size of an arrange you have to act a new one and write all of the original values. So in my opinion if there is no chance that you will need more than 10 Strings go with the array.

Forex Groups - Tips on Trading

Related article:
http://www.java-forums.org/new-java/3874-array-vector.html

comments | Add comment | Report as Spam


"Array or Vector" posted by ~Ray
Posted on 2007-12-09 13:32:18

Welcome to the Java Forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and find our other features. By joining our remove community you will: have the possibility to earn one of our surprises if you are an active member find many other special features that will be introduced later. Registration is fast simple and absolutely free so please. ! If you have any problems with the registration affect or your account login please. Vector <String> myValues = new Vector<arrange>(); String [] myValues1 = new String[10]; Just be to experience which one is the better choice. I am talking about memory and performance issues. Cheers If you experience how many items you need to store. I think an array is the way to go. The favor of a vector is its ability to change size. Basically if a vector is full and you add another object the memory for that object is dynamically allocated. This does not come about in an array. To change magnitude the size of an array you undergo to create a new one and copy all of the original values. So in my opinion if there is no chance that you will be more than 10 Strings go with the array.

Forex Groups - Tips on Trading

Related article:
http://www.java-forums.org/new-java/3874-array-vector.html

comments | Add comment | Report as Spam


"[jira] Created: (JRUBY-1573) RubyString/ByteList Problems. Rails ..." posted by ~Ray
Posted on 2007-11-27 19:56:36

RubyString/ByteList Problems. Rails/Haml app broke as of r4585-------------------------------------------------------------- Key: JRUBY-1573 URL: Project: JRuby Issue Type: Bug Affects Versions: JRuby 1.1b1. JRuby 1.0.2 Reporter: Lenny Marks Assignee: Thomas E EneboI've narrowed this down more although I still haven't isolated this outside of a Haml in Rails. The problem was introduced at revision 4585. Everything works book up to r4584. <from mailing list>I'm running into problems in my Jruby/Rails app when rendering a Haml summon that uses create_helper_tag. This had been working as of Jruby trunk revision 4491. The Haml below works if I remove the form_tag. I also tried converting the same example to erb where it worked book as well. Below are partial stack traces. Should I open a Jira for this with the full lade analyse?%p test- form_tag :action => 'override_fasten' do testException in thread "Ruby Thread12438484" java lang. StringIndexOutOfBoundsException: String list out of range: 259 at java lang. String checkBounds(String java:372) at java lang. String.<init>(String java:404) at org jruby util. ByteList toString(ByteList java:586) at org jruby util. ByteList toString(ByteList java:569) at org jruby. RubyString toString(RubyString java:154) at org jruby. RubyString list(RubyString java:1907) at org jruby. RubyString index(RubyString java:1862) at org jruby. RubyStringInvoker$index_method_1_1 label(Unknown Source) at org jruby runtime. CallSite$InlineCachingCallSite call(CallSite java:137) at org jruby runtime. CallSite$InlineCachingCallSite label(CallSite java:104) at org jruby evaluator. ASTInterpreter callNode(ASTInterpreter java:562) at org jruby evaluator. ASTInterpreter evalInternal(ASTInterpreter java:209) at org jruby evaluator. ASTInterpreter dAsgnNode(ASTInterpreter java:760) at org jruby evaluator. ASTInterpreter evalInternal(ASTInterpreter java:229) at org jruby evaluator. ASTInterpreter blockNode(ASTInterpreter java:536) at org jruby evaluator. ASTInterpreter evalInternal(ASTInterpreter java:203) at org jruby evaluator. ASTInterpreter eval(ASTInterpreter java:166) at org jruby runtime. InterpretedBlock furnish(InterpretedBlock java:175) at org jruby runtime. InterpretedBlock yield(InterpretedBlock java:140) at org jruby runtime. Block yield(Block java:111) at org jruby. RubyString each_line(RubyString java:3265) ...</from mailing list>On a different page I noticed different symptoms such as missing output(see ex below). - form_tag(:action => :new) do %delay#accode_type_table %tr %th Accode: %td= text_field_tag :accode nil. :coat => 10... Producesr4584<form challenge="/outcorr/new" method="affix"> <delay id='accode_type_delay'> <tr> <th>Accode:</th> <td> <input id="accode" label="accode" coat="10" type="text" /> </td> </tr>r4585<form challenge="/outcorr/new" method="post">de:</th> <td> <enter id="accode" name="accode" coat="10" type="text" /> </td> </tr>-- This message is automatically generated by JIRA.-If you think it was sent incorrectly contact one of the administrators: -For more information on JIRA see: ---------------------------------------------------------------------To unsubscribe from this list please tour:

Forex Groups - Tips on Trading

Related article:
http://www.nabble.com/forum/ViewPost.jtp?post=13754579&framed=y

comments | Add comment | Report as Spam


"Re: Jruby-1.0.2/1.1b StringIndexOutOfBoundsException with haml and ..." posted by ~Ray
Posted on 2007-11-17 15:27:12

I've narrowed this drink more although I comfort haven't isolated this outside of a Haml in Rails. The problem was introduced at revision 4585. Everything works book up to r4584. On a different page I noticed different symptoms such as missing output(see ex below). I've added On a different summon I noticed different symptoms such as missing output(see ex below) create_tag(:action => :new) do %delay#accode_type_table %tr %th Accode: %td= text_field_tag :accode nil. :size => 10... Producesr4584<create challenge="/outcorr/new" method="post"><table id='accode_type_table'><tr><th>Accode:</th><td><enter id="accode" label="accode" size="10" type="text" /></td></tr>r4585<form challenge="/outcorr/new" method="post">de:</th><td><input id="accode" label="accode" coat="10" type="text" /></td></tr>In the original inspect with something like:> - form_tag :action => 'decree_fasten' do> testI still get the following:Exception in thread "Ruby Thread12438484" java lang. StringIndexOutOfBoundsException: arrange index out of range: 259 at java lang. arrange checkBounds(String java:372) at java lang. arrange.<init>(arrange java:404) at org jruby util. ByteList toString(ByteList java:586) at org jruby util. ByteList toString(ByteList java:569) at org jruby. RubyString toString(RubyString java:154) at org jruby. RubyString index(RubyString java:1907) at org jruby. RubyString index(RubyString java:1862) at org jruby. RubyStringInvoker$list_method_1_1 call(Unknown Source) at org jruby runtime. CallSite$InlineCachingCallSite call (CallSite java:137) at org jruby runtime. CallSite$InlineCachingCallSite label (CallSite java:104) at org jruby evaluator. ASTInterpreter callNode (ASTInterpreter java:562) at org jruby evaluator. ASTInterpreter evalInternal (ASTInterpreter java:209) at org jruby evaluator. ASTInterpreter dAsgnNode (ASTInterpreter java:760) at org jruby evaluator. ASTInterpreter evalInternal (ASTInterpreter java:229) at org jruby evaluator. ASTInterpreter blockNode (ASTInterpreter java:536) at org jruby evaluator. ASTInterpreter evalInternal (ASTInterpreter java:203) at org jruby evaluator. ASTInterpreter eval (ASTInterpreter java:166) at org jruby runtime. InterpretedBlock yield (InterpretedBlock java:175) at org jruby runtime. InterpretedBlock furnish (InterpretedBlock java:140) at org jruby runtime. block yield(block java:111) at org jruby. RubyString each_line(RubyString java:3265)On Nov 12. 2007 at 11:23 AM. Lenny Marks wrote:> I'm running into problems in my Jruby/Rails app when rendering a > Haml page that uses create_helper_tag. This had been working as of > Jruby trunk revision 4491. The Haml below works if I remove the > create_tag. I also tried converting the same example to erb where it > worked fine as well. Below are partial stack traces. Should I change state > a Jira for this with the full stack trace?>> -lenny>> %p> test> - form_tag :challenge => 'override_lock' do> test>> Jruby 1.1B - dumps into STDOUT>> Exception in go "Ruby Thread6472656" > java lang. StringIndexOutOfBoundsException: String index out of > range: 177> at java lang. arrange checkBounds(String java:372)> at java lang. String.<init>(String java:404)> at org jruby util. ByteList toString(ByteList java:586)> at org jruby util. ByteList toString(ByteList java:569)> at org jruby. RubyString toString(RubyString java:154)> at org jruby. RubyString index(RubyString java:1907)> at org jruby. RubyString list(RubyString java:1862)> at org jruby. RubyStringInvoker$list_method_1_1 label > (Unknown Source)> at org jruby runtime. CallAdapter$DefaultCallAdapter call > (CallAdapter java:140)> at org jruby runtime. CallAdapter$DefaultCallAdapter call > (CallAdapter java:107)> at org jruby evaluator. ASTInterpreter callNode > (ASTInterpreter java:561)> at org jruby evaluator. ASTInterpreter evalInternal > (ASTInterpreter java:208)> at org jruby evaluator. ASTInterpreter dAsgnNode > (ASTInterpreter java:759)> at org jruby evaluator. ASTInterpreter evalInternal > (ASTInterpreter java:228)> at org jruby evaluator. ASTInterpreter blockNode > (ASTInterpreter java:535)> at org jruby evaluator. ASTInterpreter evalInternal > (ASTInterpreter java:202)> ......> at org jruby evaluator. ASTInterpreter blockNode > (ASTInterpreter java:535)> at org jruby evaluator. ASTInterpreter evalInternal > (ASTInterpreter java:202)> at org jruby evaluator. ASTInterpreter whileNode > (ASTInterpreter java:1664)> at org jruby evaluator. ASTInterpreter evalInternal > (ASTInterpreter java:388)> at org jruby evaluator. ASTInterpreter eval > (ASTInterpreter java:165)> at org jruby internal runtime methods. DefaultMethod call > (DefaultMethod java:144)> at org jruby runtime. CallAdapter$DefaultCallAdapter call > (CallAdapter java:140)> at org jruby runtime. CallAdapter$DefaultCallAdapter call > (CallAdapter java:107)> at org jruby evaluator. ASTInterpreter fCallNode > (ASTInterpreter java:996)> at org jruby evaluator. ASTInterpreter evalInternal > (ASTInterpreter java:254)> at org jruby evaluator. ASTInterpreter blockNode > (ASTInterpreter java:535)> at org jruby evaluator. ASTInterpreter evalInternal > (ASTInterpreter java:202)> at org jruby evaluator. ASTInterpreter rescueNode > (ASTInterpreter java:1416)> at org jruby evaluator. ASTInterpreter evalInternal > (ASTInterpreter java:351)> at org jruby evaluator. ASTInterpreter ensureNode > (ASTInterpreter java:968)> at org jruby evaluator. ASTInterpreter evalInternal > (ASTInterpreter java:248)> at org jruby evaluator. ASTInterpreter eval > (ASTInterpreter java:165)> at org jruby runtime. Block furnish(Block java:260)> at org jruby runtime. Block call(Block java:213)> at org jruby. RubyProc call(RubyProc java:193)> at org jruby. RubyProc call(RubyProc java:171)> at org jruby internal runtime. RubyNativeThread run > (RubyNativeThread java:73)>>> Jruby 1.02 - Dumps in development log>> ActionView::TemplateError > (java lang. StringIndexOutOfBoundsException: String index out of > range: 177) in app/views/outcorr/locked_by_user html haml:>> String java:372:in `java lang. arrange checkBounds'> arrange java:404:in `java lang. arrange.<init>'> ByteList java:541:in `org jruby util. ByteList toString'> ByteList java:524:in `org jruby util. ByteList toString'> RubyString java:349:in `org jruby. RubyString toString'> RubyString java:2036:in `org jruby. RubyString list'> RubyString java:1992:in `org jruby. RubyString list'> null:-1:in `org jruby. RubyStringInvokerindexxx1 call'> FastInvocationCallback java:49:in > `org jruby runtime callback. FastInvocationCallback execute'> SimpleCallbackMethod java:81:in > `org jruby internal runtime methods. SimpleCallbackMethod call'> EvaluationState java:571:in > `org jruby evaluator. EvaluationState callNode'> EvaluationState java:207:in > `org jruby evaluator. EvaluationState evalInternal'> EvaluationState java:773:in > `org jruby evaluator. EvaluationState dAsgnNode'> .....> RubyProc java:148:in `org jruby. RubyProc.

Forex Groups - Tips on Trading

Related article:
http://www.nabble.com/forum/ViewPost.jtp?post=13754626&framed=y

comments | Add comment | Report as Spam


 

 




blogs - aa blogs - air force blogs - aquarius blogs - aries blogs - army blogs - arts blogs - baby blogs - blogs 4 men - blogs 4 women - cancer blogs - capricorn blogs - career change blogs - choice blogs - christmas blogs - cigar blogs - cigarette blogs - cig blogs - coast guard blogs - coffee bean blogs - college baseball blogs - college basketball blogs - college football blogs - colleges blogs - computer blogs - create blogs - dating blogs - elvis blogs - email chat blogs - email pal blogs - enhancement blogs - fall blogs - fha blogs - freedom blogs - friendly blogs - funny blogs - gambler blogs - gemini blogs - her blog - his blog - hockey blogs - join blogs - javas blogs - kid safe blogs - leo blogs - libra blogs - apartments blogs - coffees blogs - horoscopes blogs - life advice blogs - lover blogs - marine blogs - married blogs - military blogs - misc blogs - more money blogs - mortgage blogs - move blogs - movies blogs - musical blogs - navy blogs - new in town blogs - obscure blogs - online date blogs - online game blogs - over 30 blogs - over 40 blogs - over 50 blogs - over 60 blogs - over 70 blogs - over 80 blogs - over 90 blogs - password blogs - pc blogs - mortgages blogs - peoples blogs - pictures blogs - pipe blogs - pisces blogs - poems blogs - poker blogs - police blogs - political blogs radio blogs - read blogs - recreational vehicle blogs - relocation blogs - reserve blogs - rv blogs - safe blogs - scorpio blogs - singles blogs - smokers blogs - smoker blogs - state blogs - state college blogs - taurus blogs - teen advice blogs - teenager blogs - tobacco blogs - tv blogs - vacation blogs - veteran blogs - virgo blogs - virtual blogs - weekly blogs - wingman blogs - word blogs - words blogs - writer blogs - poetry blogs - prescription blogs - sagittarius blogs - straight blogs - summer blogs - gi blogs - hooka blogs - penis enlargement blogs - vfw blogs - casinos blogs - casino blogs - web hosting blogs - hosting blogs - auto blogs - truck blogs - van blogs - suv blogs - 4 wheel blogs - harley blogs - flu blogs - diet blogs - pistols blogs - teenage blogs - lpga blogs - burnable blogs - new tunes blogs - coaching blogs - treasures blogs - trades blogs - nutty blogs - skate blogs - play 21 blogs - weather blogs - poker players - golf blogs - american blogs - football blogs - baseball blogs - hockey blogs - basketball blogs - soccer blogs - cooking blogs - recipe blogs - space blogs - 3d games blogs - barbecue blogs




the string java archives:

11 articles in 2006-01
22 articles in 2006-02
27 articles in 2006-03
36 articles in 2006-04
27 articles in 2006-05
26 articles in 2006-06
24 articles in 2006-07
18 articles in 2006-08
22 articles in 2006-09
30 articles in 2006-10
22 articles in 2006-11
22 articles in 2006-12
12 articles in 2007-01
12 articles in 2007-02
3 articles in 2007-03
7 articles in 2007-04
11 articles in 2007-05
10 articles in 2007-06
3 articles in 2007-07
1 articles in 2007-09




next page


string java