stringtokenizer

search for more blogs here

 

"StringTokenizer??" posted by ~Ray
Posted on 2008-11-13 12:20:50

StringTokenizer是一个用来分隔String的应用类,相当于VB的split函数。1.构造函数public StringTokenizer(String str)public StringTokenizer(String str. String delim)public StringTokenizer(String str. String delim booleanreturnDelims)第一个参数就是要分隔的String,第二个是分隔字符集合,第三个参数表示分隔符号是否作为标记返回,如果不指定分隔字符,默认的是:”\t\n\r\f”2.核心方法public boolean hasMoreTokens()public String nextToken()public String nextToken(String delim)public int countTokens()其实就是三个方法,返回分隔字符块的时候也可以指定分割符,而且以后都是采用最后一次指定的分隔符号。3.多余方法public boolean hasMoreElements()public boolean hasMoreElements()这个类实现了Enumeration接口,所以多了这么两个方法,其实根本没有必要实现这个接口它的名字就叫StringTokenizer,返回一个Object就没有什么意思了。

Forex Groups - Tips on Trading

Related article:
http://blog.sina.com.cn/s/blog_4d4e3d0f01000bcy.html

comments | Add comment | Report as Spam


"FIle comparison in java in Introduce Yourself" posted by ~Ray
Posted on 2008-03-12 23:12:39

Dream. In. label is the leading programming community offering advice on computer technology applications such as PHP. Java and Microsoft's ASP. NET as well as software development web development and game programming. import java io.*;import java util.*;public class myfilereader{ public static void main (String[] args) throws java io. IOException { //Getting the label of the files to be compared. BufferedReader br2 = new BufferedReader (newInputStreamReader(System in)); System out println("Enter 1st File label:"); arrange str = br2 readLine(); System out println("register 2nd register name:"); String str1 = br2 readLine(); String s1=""; String s2="",s3="",s4=""; String y="",z=""; //Reading the contents of the files BufferedReader br = new BufferedReader (new FileReader (str)); BufferedReader br1 = new BufferedReader (new FileReader (str1)); while((z=br1 readLine())!=null) s3+=z; while((y=br readLine())!=null) s1+=y; System out println (); //arrange tokenizing int numTokens = 0; StringTokenizer st = new StringTokenizer (s1); arrange[] a = new String[10000]; for(int l=0;l<10000;l++) {a[l]="";} int i=0; while (st hasMoreTokens()) { s2 = st nextToken(); a[i]=s2; i++; numTokens++; } int numTokens1 = 0; StringTokenizer st1 = new StringTokenizer (s3); arrange[] b = new String[10000]; for(int k=0;k<10000;k++) {b[k]="";} int j=0; while (st1 hasMoreTokens()) { s4 = st1 nextToken(); b[j]=s4; j++; numTokens1++; }//comparing the contents of the files and printing the differences if any int x=0; for(int m=0;m<a length;m++) { if(a[m] equals(b[m])){} else { x++; System out println(a[m] + " -- " +b[m]); System out println();} } System out println("No of differences : " + x); if(x>0){System out println("Files are not equal");} else{System out println("Files are equal. No difference found");} }}

Forex Groups - Tips on Trading

Related article:
http://www.dreamincode.net/forums/showtopic37596.htm

comments | Add comment | Report as Spam


"FIle comparison in java in Introduce Yourself" posted by ~Ray
Posted on 2008-03-12 23:12:38

Dream. In. Code is the leading programming community offering advice on computer technology applications such as PHP. Java and Microsoft's ASP. NET as come up as software development web development and game programming. import java io.*;import java util.*;public class myfilereader{ public static void main (String[] args) throws java io. IOException { //Getting the label of the files to be compared. BufferedReader br2 = new BufferedReader (newInputStreamReader(System in)); System out println("Enter 1st File name:"); String str = br2 readLine(); System out println("Enter 2nd register name:"); String str1 = br2 readLine(); arrange s1=""; String s2="",s3="",s4=""; String y="",z=""; //Reading the contents of the files BufferedReader br = new BufferedReader (new FileReader (str)); BufferedReader br1 = new BufferedReader (new FileReader (str1)); while((z=br1 readLine())!=null) s3+=z; while((y=br readLine())!=null) s1+=y; System out println (); //arrange tokenizing int numTokens = 0; StringTokenizer st = new StringTokenizer (s1); arrange[] a = new arrange[10000]; for(int l=0;l<10000;l++) {a[l]="";} int i=0; while (st hasMoreTokens()) { s2 = st nextToken(); a[i]=s2; i++; numTokens++; } int numTokens1 = 0; StringTokenizer st1 = new StringTokenizer (s3); String[] b = new String[10000]; for(int k=0;k<10000;k++) {b[k]="";} int j=0; while (st1 hasMoreTokens()) { s4 = st1 nextToken(); b[j]=s4; j++; numTokens1++; }//comparing the contents of the files and printing the differences if any int x=0; for(int m=0;m<a length;m++) { if(a[m] equals(b[m])){} else { x++; System out println(a[m] + " -- " +b[m]); System out println();} } System out println("No of differences : " + x); if(x>0){System out println("Files are not equal");} else{System out println("Files are compete. No difference open");} }}

Forex Groups - Tips on Trading

Related article:
http://www.dreamincode.net/forums/showtopic37596.htm

comments | Add comment | Report as Spam


"using statement c" posted by ~Ray
Posted on 2007-12-15 15:05:35

using statement using statement net using statement c using statement c++ using statement in net using statement in aspx page using statement in c using statement in c# using statement in vb using statement vb using statement vb net using static using static electricity using static hit using static in c using static in java using static ip using static libraries using static methods using static routes using static variable using static variables using static variables in c++ using static variables in java using stations using statistical methods using statistical affect hold back using statistics using statistics in business using statistics in investigate using statistics to alter airline safety using statistics to lie using statistics to understand business problem using statistics to understand the environment using statspack using statusbar using stax using std namespace using stdin using stdio using stdout using steam room for weight loss using steam to generate electricity using brace using steel buildings for housing using steel wool using stem and peruse using stepper go using stepper motors using steps using steri strips using steriods using steroid using steroids using steroids in sports using steroids properly using steroids safely using stethoscope using stevia using stimulants using stk using stl using stl c++ using stl in c++ using stl iterators using stl list using stl list c++ using stl map using stl maps using stl set using stl string using stl vector using stl vectors using stochastic using stochastics using stock flowers in floral arrangements using stolen credit card using stolen credit separate numbers using stolen credit cards using stop using store procedure using store procedures using stored procedure using stored procedure in asp using stored procedure in asp net using stored procedure in asp net using stored procedure in c# using stored procedure in sql using stored procedures using stored procedures in net using stored procedures in access using stored procedures in asp using stored procedures in asp net using stored procedures in asp net using stored procedures in c using stored procedures in c# using stored procedures in crystal reports using stored procedures in java using stored procedures in sql using stored procedures in sql server using stored procedures in vb using stored procedures in vb 6.0 using stored procedures in vb net using stored procedures in vb net using stored procedures sql using stored procedures with crystal reports using strace using straight razor using straightening irons using strain gages using strain calculate using strain gauges using bind ons using strap ons on men using strapons using straw or hay to decrease nitrogen in ponds using strcat using strcat in c using strcmp using strcmp in c using strcpy using be adrift using streambox using streambox vcr using streamreader using streamripper using streamtokenizer using streamtokenizer in java using streamwriter using streets and trips using strengths to dress weaknesses using strengths to facilitate behavior dress using be bands using string using arrange c++ using string change using string functions using string h using string in c++ using arrange split using string change integrity java using string tokenizer using string tokenizer in java using stringbuffer using stringbuffer in java using stringbuilder using stringbuilder c using stringbuilder categorise using stringbuilder in c using strings using strings c++ using strings in c using strings in c++ using strings in java using strings in vb using strings in vbscript using strings in visual basic using strings java using stringstream using stringtokenizer using stringtokenizer in java using stringtokenizer java using strlen using strlen c++ using strobes using strstr using strtok using strtok c using strtok example using strtok in c using strtok in c++ using strtok_r using struct using struct c using struct in c using struct in c++ using structs using structs c using structs c++ using structs in c using structs in c++ using structural equation modeling using structural functionalism using structures using structures c using structures in net using structures in c using structures in c++ using structures in matlab using structures in vb net using struts using struts by larry maturo using struts el using struts framework using struts in eclipse using struts layout using struts logic using struts modules using struts tiles using struts validation framework using struts validator using struts validator framework using struts with tomcat using stty using studio flash using stunnel using call pelt using style pelt in asp net using style sheets using style sheets asp net using style sheets html using call sheets in asp net using style sheets in c using call sheets in dreamweaver using style sheets in html using stylesheet using stylesheet asp net using stylesheet in asp net using stylesheet in html using stylesheet in jsp using stylesheets using stylesheets in net using stylesheets in asp net using stylesheets in html using sub queries in mysql using sub7 using subdomain using subdomains using subforms using subforms in access using submit using submit button using refer button in html using refer buttons using subprograms using subquery using subreports using subreports in crystal reports using subroutines using subroutines in perl using subscript using subscript in evince using subseven using substring using substring in asp using substring in c using substring in java using substring in javascript using substring in sql using subversion using subversion on windows using subversion with eclipse using subversion with netbeans using such as using such as in a sentence using sulfur using sulfuric acid using sulphuric acid using sum using sum function using sum in access using sum in excel using sum in sql using sumif using summary using pass sausage using sun dried tomatoes using sunbird using suncoml using sunscreen using sunscreen in a tanning bed using super attach using super glue on cuts using supplements using supply chain management using support vector forge using surveys for data collection using suse using suse linux using svchost using svideo using svm using swans to control geese using swap magic using change magic 3 using swap magic 3.3 using express words using swf files using swi prolog using swig using displace using swing components using swing in applets using displace in eclipse using displace in java using swing in jsp using swing java using swing timer using swings using swingworker using go using switchboard using switches using sybase using sybase bcp using sybian using symantec ghost using symbol using symbol in php using symbol in url using symbolic links using symbolism using symbolism in writing using symbols using symbols in html using synaptic using synchronization using synchronized using synchronized in java using syncml using synonyms using synonyms oracle using syntax using synthetic division using synthetic oil using sysdeo using syslog using sysprep using sysprep 2.0 using sysprep for xp using sysprep on xp using sysprep to act xp pro images using sysprep windows xp using sysprep with ghost using sysprep with windows xp using sysprep xp using sysprep inf using systat using system using system call using system call in c++ using system calls using system calls in c using system categorise using system collections using system collections generic using system command using system dominate in perl using system.

Forex Groups - Tips on Trading

Related article:
http://free-lesbian-porn-movie-video.blogspot.com/2007/11/using-statement-c.html

comments | Add comment | Report as Spam


"??StringTokenizer???" posted by ~Ray
Posted on 2007-12-09 13:39:03

我有128筆從資料庫讀出,想用StringTokenizer的方法把那128筆資料轉成浮點數放入陣列,但不知道為什麼轉換後陣列裡面都是0,剛剛在學如何使用,麻煩有經驗的人指點,謝謝 其實下面這些數據他的間隔沒有規律,有的ㄧ格,有的2格或3格,也有tab鍵的空格,用change integrity的方法都只能切其中一部份) 98.39 158.69 140.38 28.32 -98.14 -158.45 -139.89 -28.32 98.39 158.69 139.89 28.08 -98.14 -158.45 -139.89 -28.08 98.63 158.69 139.65 27.83 -98.39 -158.69 -139.40 -27.83 98.88 158.94 139.40 27.83 -98.63 -158.69 -139.16 -27.59 99.12 158.69 139.16 27.59 -98.88 -158.69 -138.92 -27.34 99.37 158.94 138.92 27.34 -99.12 -158.69 -138.67 -27.34 99.37 158.94 138.92 27.10 -99.37 -158.69 -138.92 -26.86 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.67 -26.61 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.18 -26.37 99.85 159.18 138.43 26.37 -99.61 -158.94 -138.18 -26.37 100.10 159.18 138.18 26.12 -99.85 -158.94 -138.18 -25.88 100.34 159.18 137.94 25.63 -100.10 -158.94 -137.94 -25.88 100.59 159.18 137.70 25.63 -100.34 -158.94 -137.94 -25.63 100.59 159.18 137.45 25.39 -100.34 -158.94 -137.45 -25.39 100.83 159.18 137.94 25.15 -100.59 -158.94 -137.45 -25.15 101.07 159.18 137.70 24.90 -100.83 -159.18 -137.45 -24.90 其實下面這些數據他的間隔沒有規律,有的ㄧ格,有的2格或3格,也有tab鍵的空格,用split的方法都只能切其中一部份) 98.39 158.69 140.38 28.32 -98.14 -158.45 -139.89 -28.32 98.39 158.69 139.89 28.08 -98.14 -158.45 -139.89 -28.08 98.63 158.69 139.65 27.83 -98.39 -158.69 -139.40 -27.83 98.88 158.94 139.40 27.83 -98.63 -158.69 -139.16 -27.59 99.12 158.69 139.16 27.59 -98.88 -158.69 -138.92 -27.34 99.37 158.94 138.92 27.34 -99.12 -158.69 -138.67 -27.34 99.37 158.94 138.92 27.10 -99.37 -158.69 -138.92 -26.86 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.67 -26.61 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.18 -26.37 99.85 159.18 138.43 26.37 -99.61 -158.94 -138.18 -26.37 100.10 159.18 138.18 26.12 -99.85 -158.94 -138.18 -25.88 100.34 159.18 137.94 25.63 -100.10 -158.94 -137.94 -25.88 100.59 159.18 137.70 25.63 -100.34 -158.94 -137.94 -25.63 100.59 159.18 137.45 25.39 -100.34 -158.94 -137.45 -25.39 100.83 159.18 137.94 25.15 -100.59 -158.94 -137.45 -25.15 101.07 159.18 137.70 24.90 -100.83 -159.18 -137.45 -24.90 "98.39 158.69 140.38 28.32 -98.14 -158.45 -139.89 -28.32 98.39 158.69 139.89 28.08 -98.14 -158.45 -139.89 -28.08 98.63 158.69 139.65 27.83 -98.39 -158.69 -139.40 -27.83 98.88 158.94 139.40 27.83 -98.63 -158.69 -139.16 -27.59 99.12 158.69 139.16 27.59 -98.88 -158.69 -138.92 -27.34 99.37 158.94 138.92 27.34 -99.12 -158.69 -138.67 -27.34 99.37 158.94 138.92 27.10 -99.37 -158.69 -138.92 -26.86 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.67 -26.61 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.18 -26.37 99.85 159.18 138.43 26.37 -99.61 -158.94 -138.18 -26.37 100.10 159.18 138.18 26.12 -99.85 -158.94 -138.18 -25.88 100.34 159.18 137.94 25.63 -100.10 -158.94 -137.94 -25.88 100.59 159.18 137.70 25.63 -100.34 -158.94 -137.94 -25.63 100.59 159.18 137.45 25.39 -100.34 -158.94 -137.45 -25.39 100.83 159.18 137.94 25.15 -100.59 -158.94 -137.45 -25.15 101.07 159.18 137.70 24.90 -100.83 -159.18 -137.45 -24.90 " s這個字串就是你要讀入的那一行資料,內有128個數字,你可以看的出來,某些數字字串之間空隔比較大,那是故意用多個空白或者又空白又tab的穿插,sArray的陣列長度會是128,你再把字串轉成go。 leon1235 wrote:我有128筆從資料庫讀出,想用StringTokenizer的方法把那128筆資料轉成浮點數放入陣列,但不知道為什麼轉換後陣列裡面都是0,剛剛在學如何使用,麻煩有經驗的人指點,謝謝 其實下面這些數據他的間隔沒有規律,有的ㄧ格,有的2格或3格,也有tab鍵的空格,用split的方法都只能切其中一部份)

Forex Groups - Tips on Trading

Related article:
http://www.javaworld.com.tw/jute/post/view?bid=29&id=209679

comments | Add comment | Report as Spam


"??StringTokenizer???" posted by ~Ray
Posted on 2007-12-09 13:39:03

我有128筆從資料庫讀出,想用StringTokenizer的方法把那128筆資料轉成浮點數放入陣列,但不知道為什麼轉換後陣列裡面都是0,剛剛在學如何使用,麻煩有經驗的人指點,謝謝 其實下面這些數據他的間隔沒有規律,有的ㄧ格,有的2格或3格,也有tab鍵的空格,用split的方法都只能切其中一部份) 98.39 158.69 140.38 28.32 -98.14 -158.45 -139.89 -28.32 98.39 158.69 139.89 28.08 -98.14 -158.45 -139.89 -28.08 98.63 158.69 139.65 27.83 -98.39 -158.69 -139.40 -27.83 98.88 158.94 139.40 27.83 -98.63 -158.69 -139.16 -27.59 99.12 158.69 139.16 27.59 -98.88 -158.69 -138.92 -27.34 99.37 158.94 138.92 27.34 -99.12 -158.69 -138.67 -27.34 99.37 158.94 138.92 27.10 -99.37 -158.69 -138.92 -26.86 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.67 -26.61 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.18 -26.37 99.85 159.18 138.43 26.37 -99.61 -158.94 -138.18 -26.37 100.10 159.18 138.18 26.12 -99.85 -158.94 -138.18 -25.88 100.34 159.18 137.94 25.63 -100.10 -158.94 -137.94 -25.88 100.59 159.18 137.70 25.63 -100.34 -158.94 -137.94 -25.63 100.59 159.18 137.45 25.39 -100.34 -158.94 -137.45 -25.39 100.83 159.18 137.94 25.15 -100.59 -158.94 -137.45 -25.15 101.07 159.18 137.70 24.90 -100.83 -159.18 -137.45 -24.90 其實下面這些數據他的間隔沒有規律,有的ㄧ格,有的2格或3格,也有tab鍵的空格,用split的方法都只能切其中一部份) 98.39 158.69 140.38 28.32 -98.14 -158.45 -139.89 -28.32 98.39 158.69 139.89 28.08 -98.14 -158.45 -139.89 -28.08 98.63 158.69 139.65 27.83 -98.39 -158.69 -139.40 -27.83 98.88 158.94 139.40 27.83 -98.63 -158.69 -139.16 -27.59 99.12 158.69 139.16 27.59 -98.88 -158.69 -138.92 -27.34 99.37 158.94 138.92 27.34 -99.12 -158.69 -138.67 -27.34 99.37 158.94 138.92 27.10 -99.37 -158.69 -138.92 -26.86 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.67 -26.61 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.18 -26.37 99.85 159.18 138.43 26.37 -99.61 -158.94 -138.18 -26.37 100.10 159.18 138.18 26.12 -99.85 -158.94 -138.18 -25.88 100.34 159.18 137.94 25.63 -100.10 -158.94 -137.94 -25.88 100.59 159.18 137.70 25.63 -100.34 -158.94 -137.94 -25.63 100.59 159.18 137.45 25.39 -100.34 -158.94 -137.45 -25.39 100.83 159.18 137.94 25.15 -100.59 -158.94 -137.45 -25.15 101.07 159.18 137.70 24.90 -100.83 -159.18 -137.45 -24.90 "98.39 158.69 140.38 28.32 -98.14 -158.45 -139.89 -28.32 98.39 158.69 139.89 28.08 -98.14 -158.45 -139.89 -28.08 98.63 158.69 139.65 27.83 -98.39 -158.69 -139.40 -27.83 98.88 158.94 139.40 27.83 -98.63 -158.69 -139.16 -27.59 99.12 158.69 139.16 27.59 -98.88 -158.69 -138.92 -27.34 99.37 158.94 138.92 27.34 -99.12 -158.69 -138.67 -27.34 99.37 158.94 138.92 27.10 -99.37 -158.69 -138.92 -26.86 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.67 -26.61 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.18 -26.37 99.85 159.18 138.43 26.37 -99.61 -158.94 -138.18 -26.37 100.10 159.18 138.18 26.12 -99.85 -158.94 -138.18 -25.88 100.34 159.18 137.94 25.63 -100.10 -158.94 -137.94 -25.88 100.59 159.18 137.70 25.63 -100.34 -158.94 -137.94 -25.63 100.59 159.18 137.45 25.39 -100.34 -158.94 -137.45 -25.39 100.83 159.18 137.94 25.15 -100.59 -158.94 -137.45 -25.15 101.07 159.18 137.70 24.90 -100.83 -159.18 -137.45 -24.90 " s這個字串就是你要讀入的那一行資料,內有128個數字,你可以看的出來,某些數字字串之間空隔比較大,那是故意用多個空白或者又空白又tab的穿插,sArray的陣列長度會是128,你再把字串轉成go。 leon1235 wrote:我有128筆從資料庫讀出,想用StringTokenizer的方法把那128筆資料轉成浮點數放入陣列,但不知道為什麼轉換後陣列裡面都是0,剛剛在學如何使用,麻煩有經驗的人指點,謝謝 其實下面這些數據他的間隔沒有規律,有的ㄧ格,有的2格或3格,也有tab鍵的空格,用change integrity的方法都只能切其中一部份)

Forex Groups - Tips on Trading

Related article:
http://www.javaworld.com.tw/jute/post/view?bid=29&id=209679

comments | Add comment | Report as Spam


"??StringTokenizer???" posted by ~Ray
Posted on 2007-12-09 13:39:02

我有128筆從資料庫讀出,想用StringTokenizer的方法把那128筆資料轉成浮點數放入陣列,但不知道為什麼轉換後陣列裡面都是0,剛剛在學如何使用,麻煩有經驗的人指點,謝謝 其實下面這些數據他的間隔沒有規律,有的ㄧ格,有的2格或3格,也有tab鍵的空格,用split的方法都只能切其中一部份) 98.39 158.69 140.38 28.32 -98.14 -158.45 -139.89 -28.32 98.39 158.69 139.89 28.08 -98.14 -158.45 -139.89 -28.08 98.63 158.69 139.65 27.83 -98.39 -158.69 -139.40 -27.83 98.88 158.94 139.40 27.83 -98.63 -158.69 -139.16 -27.59 99.12 158.69 139.16 27.59 -98.88 -158.69 -138.92 -27.34 99.37 158.94 138.92 27.34 -99.12 -158.69 -138.67 -27.34 99.37 158.94 138.92 27.10 -99.37 -158.69 -138.92 -26.86 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.67 -26.61 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.18 -26.37 99.85 159.18 138.43 26.37 -99.61 -158.94 -138.18 -26.37 100.10 159.18 138.18 26.12 -99.85 -158.94 -138.18 -25.88 100.34 159.18 137.94 25.63 -100.10 -158.94 -137.94 -25.88 100.59 159.18 137.70 25.63 -100.34 -158.94 -137.94 -25.63 100.59 159.18 137.45 25.39 -100.34 -158.94 -137.45 -25.39 100.83 159.18 137.94 25.15 -100.59 -158.94 -137.45 -25.15 101.07 159.18 137.70 24.90 -100.83 -159.18 -137.45 -24.90 其實下面這些數據他的間隔沒有規律,有的ㄧ格,有的2格或3格,也有tab鍵的空格,用change integrity的方法都只能切其中一部份) 98.39 158.69 140.38 28.32 -98.14 -158.45 -139.89 -28.32 98.39 158.69 139.89 28.08 -98.14 -158.45 -139.89 -28.08 98.63 158.69 139.65 27.83 -98.39 -158.69 -139.40 -27.83 98.88 158.94 139.40 27.83 -98.63 -158.69 -139.16 -27.59 99.12 158.69 139.16 27.59 -98.88 -158.69 -138.92 -27.34 99.37 158.94 138.92 27.34 -99.12 -158.69 -138.67 -27.34 99.37 158.94 138.92 27.10 -99.37 -158.69 -138.92 -26.86 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.67 -26.61 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.18 -26.37 99.85 159.18 138.43 26.37 -99.61 -158.94 -138.18 -26.37 100.10 159.18 138.18 26.12 -99.85 -158.94 -138.18 -25.88 100.34 159.18 137.94 25.63 -100.10 -158.94 -137.94 -25.88 100.59 159.18 137.70 25.63 -100.34 -158.94 -137.94 -25.63 100.59 159.18 137.45 25.39 -100.34 -158.94 -137.45 -25.39 100.83 159.18 137.94 25.15 -100.59 -158.94 -137.45 -25.15 101.07 159.18 137.70 24.90 -100.83 -159.18 -137.45 -24.90 "98.39 158.69 140.38 28.32 -98.14 -158.45 -139.89 -28.32 98.39 158.69 139.89 28.08 -98.14 -158.45 -139.89 -28.08 98.63 158.69 139.65 27.83 -98.39 -158.69 -139.40 -27.83 98.88 158.94 139.40 27.83 -98.63 -158.69 -139.16 -27.59 99.12 158.69 139.16 27.59 -98.88 -158.69 -138.92 -27.34 99.37 158.94 138.92 27.34 -99.12 -158.69 -138.67 -27.34 99.37 158.94 138.92 27.10 -99.37 -158.69 -138.92 -26.86 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.67 -26.61 99.85 158.94 138.67 26.61 -99.61 -158.69 -138.18 -26.37 99.85 159.18 138.43 26.37 -99.61 -158.94 -138.18 -26.37 100.10 159.18 138.18 26.12 -99.85 -158.94 -138.18 -25.88 100.34 159.18 137.94 25.63 -100.10 -158.94 -137.94 -25.88 100.59 159.18 137.70 25.63 -100.34 -158.94 -137.94 -25.63 100.59 159.18 137.45 25.39 -100.34 -158.94 -137.45 -25.39 100.83 159.18 137.94 25.15 -100.59 -158.94 -137.45 -25.15 101.07 159.18 137.70 24.90 -100.83 -159.18 -137.45 -24.90 " s這個字串就是你要讀入的那一行資料,內有128個數字,你可以看的出來,某些數字字串之間空隔比較大,那是故意用多個空白或者又空白又tab的穿插,sArray的陣列長度會是128,你再把字串轉成go。 leon1235 wrote:我有128筆從資料庫讀出,想用StringTokenizer的方法把那128筆資料轉成浮點數放入陣列,但不知道為什麼轉換後陣列裡面都是0,剛剛在學如何使用,麻煩有經驗的人指點,謝謝 其實下面這些數據他的間隔沒有規律,有的ㄧ格,有的2格或3格,也有tab鍵的空格,用split的方法都只能切其中一部份)

Forex Groups - Tips on Trading

Related article:
http://www.javaworld.com.tw/jute/post/view?bid=29&id=209679

comments | Add comment | Report as Spam


"De StringTokenizer a Split" posted by ~Ray
Posted on 2007-11-27 20:03:34

Leyendo acerca de StringTokenizer en java encontré que no es recomendable usarla y en cambio recomiendan utilizar el método split de la clase String. No se aun porque es que no lo recomiendan pero lo investigare. Ahora con esto creo que respondo otra pregunta que he tenido del porque en c# no existe esta clase si muchas cosas tan útiles de java se encuentran en c# casi que con el mismo nombre. Encontré el método change integrity en c# (String. change integrity),entonces ya se como seguire haciendo lo del StringTokeneizer,sin seguir usando el dll que me baje de www codeproject com donde hicieron el StringTokenizer para c#. De lo único que difiere el change integrity de c# del de Java es de la primera letra en java es split (s minúscula en c# S mayúscula) ha también encontré que el split esta como método de la clase arrange de python y ruby. De hecho en una práctica que hice hace tiempito en python use ese método pues no hallaba el StringTokenizer. Esto es lo que dicen en la API acerca de StringTokenizer:"StringTokenizer is a legacy categorise that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the change integrity method of String or the java util regex package instead."

Forex Groups - Tips on Trading

Related article:
http://abuilesj.blogspot.com/2007/11/de-stringtokenizer-split.html

comments | Add comment | Report as Spam


"Re: timus reverse root problem" posted by ~Ray
Posted on 2007-11-17 15:35:02

  |    |    |   View: Flat ()  |   |  |  I'm trying to understand problem but am getting measure limit exceeded. It's such a trivial problem but evidently I'm doing the enter reading too inefficiently. Or maybe the power operation is slowing it down too much and there's a smarter way to take square roots. Any ideas? My code is in edit history. get rid of iostreams they are slowget rid of stringstreams they are REALLY slowuse scanf/printf from <cstdio>get rid of vectors and use a static global arrayor at least get rid of the push_backs and initialize the vector to a size that is large enoughedit: and instead of pow() call sqrt() a dedicated function will most probably be faster than a general one Thanks for the tips. One thing I wasn't sure about with scanf is if there's a way to command variable numbers of spaces between numbers. For example let's say a lie contained this: So I didn't see a way to do that with scanf since I don't know the be of spaces between numbers. In addition. I don't know how many numbers are going to be on each line. That's why stringstream was nice but you're right it's too decrease. So I anticipate the only way I can think of to do it is to use fgets to get a line and then walk through the line and build each be. scanf() as well as C++ streams usually silently skip all whitespaces. So if the aim platform supports long long and uses %Ld for its parsing all you need is just: You can use doubles in inspect you don't experience how 64bit integers are supported on target platform. Also instead of multiplying by 1.0 just cast to double. Do you have any tips of input/output for Java user ? Scanner is really slow and BufferedReader is not so convenient. :( Sorry but I think it likely takes less time to get an answer from topcoder forum than from timus :). I tried to submit the problem 9 times and it comfort gets Time Limit exceeded at evaluate #9. Here is my code: BufferedReader input = new BufferedReader( new InputStreamReader( System in ));String in;StringTokenizer str;double [] l = new manifold[500000];int index = 0;while( (in = input readLine()) != null ){str = new StringTokenizer( in );while( str hasMoreTokens() ){l[list] = Double parseDouble( str nextToken() );list++;}}double res;for( int i = index-1; i >= 0; i-- ){res = Math sqrt( l[i] );System out printf( "%.4f\n" res );}Do you know how to optimise it ? My guess is that your printf statement is slowing down your schedule too much. The printf answer in Java is awfully slow. Try the following code on your computer which just does a simple output of random manifold values: ls[i]);out1 close();time = System currentTimeMillis() - time;System out println(time); time = System currentTimeMillis(); i = 0; i < ls length; i++)out2 println(ls[i]);out2 close();time = System currentTimeMillis() - time;System out println(time); On my computer the first block of code using printf takes roughly three times longer to kill than the second block. Your best bet. I evaluate is to create verbally your own output formatter and then output with println. Good guess. I tried to optimize input parsing (using some tricks discussed ) with no luck. Only when I shift printf and did my own formatting it passed. alter: Maybe the label is worth sharing after 10 failed attempts :)   |     |     |     |     |     |  

Forex Groups - Tips on Trading

Related article:
http://forums.topcoder.com/?module=Message&messageID=882812

comments | Add comment | Report as Spam


"using stringtokenizer" posted by ~Ray
Posted on 2007-11-09 17:19:03

my string is polireddy ch 1.233 hello like this i be to get how many digits after the decimal inform(i e 233) Don't use StringTokenizer. Use arrange lastIndexOf('.') and arrange substring instead. Kaj if "hello like this" belongs to his arrange that won't help that much. I'd declare - believe it or not - a regex. Unless otherwise licensed label in all technical manuals herein (including articles. FAQs samples) is provided under this.

Forex Groups - Tips on Trading

Related article:
http://forum.java.sun.com/thread.jspa?threadID=5210492

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 stringtokenizer 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


stringtokenizer