Ron McLeod

Saloon Keeper
+ Follow
since Feb 12, 2013
Ron likes ...
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
Richmond, BC, Canada
Cows and Likes
Cows
Total received
238
In last 30 days
2
Total given
75
Likes
Total received
473
Received in last 30 days
18
Total given
671
Given in last 30 days
22
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ron McLeod

I just saw that today.  Tokens cost 1ยข each, and depending on the size of the content you want to reveal, it could be only a few tokens or several tens (or maybe hundreds) of tokens.

2 hours ago
Works on Mac 10.11.6 as well
3 hours ago
This doesn't answer your Mac-specific question, but if I run your code on a Windows platform, the date does get reported properly.
3 hours ago
As Prasad pointed-out, the way you are using Scanner is problematic.  You need to use nextLine() to remove data from the input, otherwise Scanner will not move past the beginning of the input stream, and hasNextLine() will just keep reporting true, leaving your code stuck executing inside the while loop

Here's a simple example using System.in for input.  Run it, enter just a single of characters from the keyboard followed by Enter:
The output will look something like this:

23 hours ago

Matt Pitt wrote:I am told that SocketTimeoutException is never thrown by reader.readLine(), implying that the setSoTimeout() has no effect here, contradicting the javadoc.


The javadoc for BufferedReader#readLine says that it will throw a IOException if an I/O error occurs.  SocketTimeoutException is a subclass of IOException, so you can catch IOException and check to see if the actual class of the exception is SocketTimeoutException.

Here's an runnable example based on the code that you posted:
1 day ago
Great - have a cow for figuring it out and for reporting back with your solution 

1 day ago

Stephan van Hulst wrote:ICY is based on HTTP I believe.


That is correct, but HttpURLConnection specifically looks for statusLine.startsWith("HTTP/1.")

The response from the Icecast server returns a status line of ICY 200 OK, which fails this check.
1 day ago
If your question is related to this post, then you are probably wanting to check the status line of the response.  You may be able to get the status line using getHeaderField(0), but it is implementation-specific whether that is supported or not.

Since URLConnection only has concrete subclasses for HTTP (HttpURLConnection) and JAR (JarURLConnection) protocols, it is not going to work when the request URL indicates HTTP and the response indicates ICY protocol.  HttpURLConnection will throw an IOException exception with a message indicating Invalid Http response.

To make this work, you would probably have to extend URLConnection, or work directly at the socket level.
1 day ago

Edward John wrote:I'm just wondering if it's a normal behavior not able to startup the node manager when the system date is altered


Could it be that you are setting the date back so far, that the system date is before the some security certificate's notBefore date?
2 days ago
Have you tried asking application/library vendor for testing/eval licenses?

If the node manager is just being used to start the managed server, have you tried starting the managed server from the command line, without using the node manager?
2 days ago

Mike Gauthier wrote:run:
\\nsp\pi\sprinkler\schedule.json (No such file or directory)
BUILD SUCCESSFUL (total time: 8 seconds)


Hmm ... I would have expected that to work - must be a MAC thing.

One last suggestion is to try: "file:///nsp/pi/sprinkler/schedule.json"

If that doesn't work, you could looking at the JCIFS library.
2 days ago
One case would be were the client-side does not support JavaScript, or it has been disabled for security purposes.

Another case would be where the bandwidth is not sufficient to perform the initial download of the Angular fat-client application.  The application that I am working at the moment has a 3kbps satellite link between the client and server.  Downloading a 500kB bundle for the GUI would take over 20 minutes.
2 days ago
JSP
You need to specify a UNC path in the form \\computer\folders\file

Either of these should work:
    "\\\\nsp\\pi\\sprinkler\\schedule.json"
    "\\\\nsp/pi/sprinkler/schedule.json"
2 days ago
What is the operating system running on the PI device?
2 days ago