Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~14.9K People Reached
Favorite Tags
Member Avatar for winecoding

I am trying to do some text processing tasks against a collection of files stored in a directory. The data set is just standard 20-newsgroup data. However, running the following code segement gives error message such as `UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 240: invalid start byte` …

Member Avatar for vegaseat
0
388
Member Avatar for winecoding
Member Avatar for winecoding

I have been using some open source software, like weka/mallet to fulfill certain data analytics works. I know how to use the APIs of these softwares and write customized code under Eclipse. Right now, I would like to learn how to make this type of data analytics work as a …

Member Avatar for winecoding
0
179
Member Avatar for winecoding

I am trying to use a Weka method, crossValidateModel, which is posted in the last. It looks like that the fifth parameter is referred to as varargs parameter. I tried the example usage given in Weka page, such as [CODE]eval.crossValidateModel(cls, data, folds, rand);[/CODE] It works just fine on one system,(eclipse+Ubuntu); …

Member Avatar for ~s.o.s~
0
210
Member Avatar for winecoding

I have the following hashed structure [CODE]$chainStorage{$R1}{$S1}{$C1}{@A1}[/CODE] [QUOTE]$chainStorage = { 'ACB' => { 'E' => '06' => [100, 200, 95] 'B' => '23' => [20, 1000, 05, 30] }, 'AFG' => { 'C' => '24' => [18, 23, 2300, 3456] }, 'HJK' => { 'A' => '12' => [24, 25, …

Member Avatar for d5e5
0
435
Member Avatar for winecoding

I happen to read the following code segment from Thinking in Java [CODE]public class PetCount3 { static class PetCounter extends LinkedHashMap<Class<? extends Pet>,Integer> { public PetCounter() { super(MapData.map(LiteralPetCreator.allTypes, 0)); } public void count(Pet pet) { // Class.isInstance() eliminates instanceofs: for(Map.Entry<Class<? extends Pet>,Integer> pair : entrySet()) if(pair.getKey().isInstance(pet)) put(pair.getKey(), pair.getValue() + 1); …

Member Avatar for JamesCherrill
0
161
Member Avatar for winecoding

I have a generic text file, which can be composed of text data and numerical values, like an article. It can have multiple paragraphs/lines and have various types of delimiters. My general purpose is to tokenize this text file into a string array. I am quite confusing on how to …

Member Avatar for JamesCherrill
0
245
Member Avatar for winecoding

I have a csv file or an excel file, which is a mix of numerical values and text information. For instance 1 Paragraph1 2 Paragraph2 In this file, the cell of (first row, first column) has a numerical value of 1; on the other hand, the cell of (first row, …

Member Avatar for WaltP
0
109
Member Avatar for winecoding
Member Avatar for winecoding

In my current program, the input information is hard coded. For instance [CODE]final String titleFieldName = "title1";[/CODE] If I want to change title1 to title2, I have to modify the source code and click "run Java application" in Eclipse. How can I change the program to allow the user dynamically …

Member Avatar for stultuske
0
227
Member Avatar for winecoding

I am trying to list all of the files including a function, e.g., matrixCal. How to do that in linux. Thanks.

Member Avatar for Go_bots
0
177
Member Avatar for winecoding

I opened the .bashrc file on a system, which includes [CODE]export JAVA_HOME=/usr/lib/jvm/java-1.6.0-sun.x86.64[/CODE] After typing [CODE]whereis java[/CODE], the system prints out [CODE]java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz [/CODE] It seems to me that none of the above path matches the JAVA_HOME set up in bashrc file. Can you let me know …

Member Avatar for stultuske
0
246
Member Avatar for winecoding

I once saw the following script in a bashrc file, which is [CODE]export PATH=.:$PATH:$M2_HOME/bin[/CODE] I don't know what does . (the first dot point after =) mean here? Then, what is the resulting path after this kind of setup?

Member Avatar for rubberman
0
119
Member Avatar for winecoding

My program includes a code segment as following: [CODE]for (int j1 =0; j1<2;j1++) { for (int j2 =0; j2<2;j2++) { System.out.println("j1="+j1+"j2="+j2+" "+temp1.get(j1)+"----"+temp2.get(j2)); if (temp1.get(j1)==temp2.get(j2)) { System.out.println("find match"); } } }[/CODE] The program prints out sth like j1=0j2=0 7698380----7698380 the difference is 0 j1=0j2=1 7698380----7726365 the difference is -27985 j1=1j2=0 7726365----7698380 …

Member Avatar for JamesCherrill
0
173
Member Avatar for winecoding

I have a string, which is read from a database. The string can be just "null". I need to decide whether it is null or not? Among the following ones, what is the appropriate way to do it? [CODE]String a = …; If (a == null) If ( a.length == …

Member Avatar for mKorbel
0
154
Member Avatar for winecoding

For the computation involving multiple types of variables, such as integer and double, is the following approach the correct way in terms of not causing any hidden error or information lost? [CODE] int a = 2; double b = 3.0; double c; c = (double)(a+b); c = (double)(a/b); [/CODE]

Member Avatar for jon.kiparsky
0
231
Member Avatar for winecoding

In the code, I have [CODE]int a = 62; int b = 132; double c; c = a/b; [/CODE] This will generate the c value in the double format as 0.469696968793869 In fact, I only need to an approximation representation of c like 0.4697 Can you let me know how …

Member Avatar for ztini
0
93
Member Avatar for winecoding

I am trying to understand one test script, which includes [CODE]if [ ! -f mahout-work/reuters21578.tar.gz ]; then echo "Downloading Reuters-21578" curl http://kdd.ics.uci.edu/databases/reuters21578/reuters21578.tar.gz \ -o mahout-work/reuters21578.tar.gz fi[/CODE] What does the condition of [CODE]! -f mahout-work/reuters21578.tar.gz [/CODE]mean? And what does [CODE]curl http://kdd.ics.uci.edu/databases/reuters21578/reuters21578.tar.gz \ -o mahout-work/reuters21578.tar.gz [/CODE]stand for? Thanks.

Member Avatar for alaa sam
0
242
Member Avatar for winecoding

For the following segment of java code, the method of “run” occurs four times. I am quite confusing about the relationships of these four occurrences of “run”. Can you explain this to me? The original code is pretty long, I just keep the part that is related to my question. …

Member Avatar for NormR1
0
185
Member Avatar for winecoding

I am learning to use mahout by starting with a example copied from the book. However, the eclipse compiler gives me the following message: [QUOTE]Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.mahout.cf.taste.impl.model.file.FileDataModel.<clinit>(FileDataModel.java:119) at mia.recommender.ch02.RecommenderIntro.main(RecommenderIntro.java:18) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at …

Member Avatar for thekashyap
0
200
Member Avatar for winecoding

I am trying to save an integer matrix to the csv file. My code is listed as follows. [CODE]try { FileWriter writer = new FileWriter("test.csv"); for(int i = 0; i < row; i++) { for (int j=0; j<(column-1); j++) { writer.append(Matrix[i][j]); writer.append(','); } writer.append(Matrix[i][j]); writer.append('\n'); writer.flush(); } writer.close(); } catch(Exception …

Member Avatar for hfx642
0
115
Member Avatar for winecoding

I am learning Java, and found a code segment as follows. [CODE]public static void displayClusters(final Collection<Cluster> clusters) { displayClusters(clusters, Integer.MAX_VALUE); } public static void displayClusters(final Collection<Cluster> clusters, int maxNumberOfDocumentsToShow) { displayClusters(clusters, maxNumberOfDocumentsToShow, ClusterDetailsFormatter.INSTANCE); } public static void displayClusters(final Collection<Cluster> clusters, int maxNumberOfDocumentsToShow, ClusterDetailsFormatter clusterDetailsFormatter) { System.out.println("\n\nCreated " + clusters.size() + …

Member Avatar for JamesCherrill
0
143
Member Avatar for winecoding

I have a java project, which runs fine on eclipse. Right now, I need to run it from command prompt, like java classpath ... How to setup this classpath based on the stored ones using in Eclipse.

Member Avatar for jon.kiparsky
0
258
Member Avatar for winecoding

I have an existing Eclipse java project, and need to export it to the war file for deployment. By googling, it turns out that I need to covert it to a dynamic web project at first. But the menu item for this conversion is disabled. I would like to know …

0
81
Member Avatar for winecoding

I have implemented a jetty-based servlet under eclipse.It runs fine under eclipse. Right now, I need to deploy it as a Web application. I would like to know the procedures of transplanting these java programs from Eclipse to a real Jetty-based web application. The system is a Linux box. Thanks.

Member Avatar for peter_budo
0
106
Member Avatar for winecoding

My current work needs to do the development based on open soure software. There is a class defined as DirLocator.java The code is as follows [CODE]public final class DirLocator implements IResourceLocator { /** The folder relative to which resources are resolved. */ private File dir; /** * Initializes the locator …

Member Avatar for winecoding
0
8K
Member Avatar for winecoding

I am using Eclipse to develop an applet module, which requires a bunch of libraries. It runs correctly under the Eclipse environment. I would like to know how to embedded this code in a html page, or how to deploy this applet?

Member Avatar for NormR1
0
77
Member Avatar for winecoding

I am implementing an applet module which receiving an object sent from a servlet. The following is used to setup connection. [CODE]private URLConnection getServletConnection(String hostName) throws MalformedURLException, IOException { URL urlServlet = new URL(hostName); URLConnection con = urlServlet.openConnection(); con.setDoInput(true); con.setDoOutput(true); con.setUseCaches(false); con.setRequestProperty("Content-Type","application/x-java-serialized-object"); return con; } [/CODE] The following is the …

Member Avatar for NormR1
0
160
Member Avatar for winecoding

In servlet side, I am trying to receive an vector sent from the applet. The code is like [CODE]InputStream in = request.getInputStream(); ObjectInputStream inputFromApplet = new ObjectInputStream(in); Vector v = (Vector)inputFromApplet.readObject(); [/CODE] But the compiler specifies that the following one is wrong. [CODE]Vector v = (Vector)inputFromApplet.readObject(); [/CODE] The error message …

Member Avatar for JamesCherrill
0
143
Member Avatar for winecoding

In the main function, I have one two-dimensional array, A. I need to pass A into a function f, which takes A, may change A. f will also generate another two-dimensional array B based on some operations on A and return A. I know it is about passing pointer passing …

Member Avatar for Arbus
0
669