Grace Green

Ranch Hand
+ Follow
since Nov 08, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Grace Green


I would like to create a map of maps in groovy.
For each entry in idToStates, I would have
[id : [state:timestamp]]

The problem with the code below is that the [state:timestamp] is not adding new state-to-timestamp pairs, but merely replacing the existing one.

I do not seem to be able to find a solution, I might not be using the correct groovy syntax since I am new to it. Thank you in advance for your help.



9 years ago
I have a web page containing a table, where each row has either class vc_row_odd or vc_row_even, like the one below.
The table has about 3000 rows, but using jsoup I am retrieving only about half of them. I have looked at the source page, and the rows seem consistently structured. Why is jsoup selector not finding all rows I wonder ?

Here below is my jsoup code:




<tr class="vc_row_odd">
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
<tr class="vc_row_even">
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>

Thank you for your reply, but it did not make any difference.
Instead, this worked:

No other way worked.

Now, the loop in which this commend is executed hangs ... maybe I should close the proc or process ?
9 years ago
Could anyone help understand as to why this code snipped has the error below ?



grep: Movie: No such file or directory
grep: Theatre': No such file or directory

In other words, it does not seem to be able to understand the spaces in between words. I have tried [[:space]] and also \s with the option -e, but still same issue

I have also tried

But same error:
Cannot run program "grep "Selected Movie Theatre Number" -A 5 filename
Caused by: java.io.IOException: error=2, No such file or directory

9 years ago
No answer at all ? Maybe I posted it on the wrong forum ?
I have imported an xml file into JackRabbit repository using


I ended up with the following repo structure:


How do I map my POJO XmlFile field data to the jcr:xmltext or jcr:xmlcharacters portion of the imported xml ?
I have tried @Field(jcrName="jcr:xmltext") @Field(jcrName="jcr:xmlcharacters") @Field(jcrName="ns:grammar"), but the "data" field in any XmlFile object returns always null

I found th e problem: the bean in the application-context was being overwritten by the same in mvc-dispatcher-servlet.xml
10 years ago
I am getting a org.springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size of 500000 bytes exceeded;
which I thought could be solved by adding

<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- one of the properties available; the maximum file size in bytes -->
<property name="maxUploadSize" value="3000000"/>
</bean>

I also have the commons-fileupload.jar in the pom.xml.

but I am still getting the error, any suggestions on where to look as to why the maxUploadSize has no effect. I am loading a file that is just 537KB
10 years ago
This works, notice without "classpath:"



That assumes that repository.xml is in the same location, i.e. WEB-INF as the Spring's application context xml file.
If I replace
<constructor-arg value="repository.xml"/>
with
<constructor-arg value="classpath:repository.xml"/>

there is an error stating that classpath:repository.xml cannot be found ...

ANyone can explain why ?
10 years ago
I am using Tomcat 7 with Eclipse Luna to run a Spring based web app which also uses Jackrabbit. In Spring's application-context.xml file, I have defined a Jackrabbit repository's reference with



repository.xml is in the same folder as application-context.xml.

Tomcat throws
java.io.FileNotFoundException: /Applications/eclipse/Eclipse.app/Contents/MacOS/classpath:repository.xml (No such file or directory)


It is as if "classpath:repository.xml" were interpreted as a directory path, and not as a Spring's resource string.

<constructor-arg index="0" value="classpath:repository.xml"/>

Is this an issue with Eclipse ? Do I need to specify anything in its .ini ?
Or with Tomcat or with Spring ?


I also tried to deploy the .war in the standalone tomcat server, and take eclipse out of the equation.

I got the same:

java.io.FileNotFoundException: /mypathtoApache/apache-tomcat-6.0.41/bin/classpath:repository.xml (No such file or directory)

It is as if "classpath" were interpreted as part of the dirname, not as a resource string.

Any help ?
10 years ago
This query will return as many rows as there are VALUEs and COUNTs for a given date, but I am not interested in all VALUEs, only in the one with the max(COUNT) on a given date. Can you please help me build the sql statement I need ?



I tried with the sql below but I basically got the same results.



Hope some sql expert can help. Thanks !
Actually, RestTemplate works for my purposes, well I do have to extract the list of filenames, but it gets the page no problem this way


10 years ago
Yes, an HTTP GET on the browser shows the content of the directory.
I guess RestTemplate is not appropriate, as you say. I will have to find a different solution.

10 years ago
Using Spring `RestTemplate` for the first time. Is there an easy way to get the list of filenames contained in a directory using Spring `RestTemplate` ? Is RestTemplate appropriate to the goal ?

TO get a specific file (filename), I would do sth like




But this time I simply would want the list of filenames contained in the directory url "https://myrepo.com/" . Which of the methods in the `RestTemplate` API woudld allow me to do so ?
10 years ago