Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!

David Go

Greenhorn
+ Follow
since Mar 30, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by David Go

Stephan van Hulst wrote:You should break up the input string in parts depending on how they're delimited. For instance, the time at the start (including the milliseconds) is delimited by whitespace, So you first want to match as many non-whitespace characters as possible, followed by at least one whitespace character. Use capturing groups for the parts that you're interested in, and use non-capturing groups for delimiters or fluff. That means that the regex for the first part could look like this:

This means: capture zero or more non-whitespace characters, and then match one or more whitespace characters.

For parts of the input string that are enclosed in braces, you would do something like this:

This means: match a '[' and then capture zero or more non-']' characters, and then match a ']' character.

Then you have to compose your entire regex of patterns like this, and then escape all the characters that have a special meaning in strings. I can promise you this will become incredibly messy and unmaintainable. Instead, you will probably want to use java.util.Scanner to process the input string in bits. Have you already looked at its API documentation?



Yeah even with your suggestion(s) I am unable to come up with even a charater being reconized.

I also noticed that the SSH log(s) are not all the same format:


So that above is different form:


So in my opinion this is totally out of my realm of Regex knowledge - even if regex can split all of these up regardless of form.
19 hours ago

Stephan van Hulst wrote:You would use a regex to get specific information out of a string. What information are you looking for? Do you want to get EVERY piece of information out of the string, or just a few particular parts?

I'm assuming that by the crosses in the input string you mean ANY character, but you just censored out the actual characters.


Yes you are correct Stephan. I am wanting to get every peice of information - just split into the sections of the pattern.
21 hours ago
I am terrible at trying to figure out this Regex! It's, like everyone else, doesn't make much since.

The string looks like this:

The pattern looks like this when breaking the above up:

Any help with this crazy pattern would be great! I've been told that using [.*?] would help with the X in brackets but it's still over my head and I don't know how to go about this the LONG LONG way around (.replace, .contains, .indexOf) but I know using Regex is much cleaner.
21 hours ago
Hey all I have created a Swing Java Application with setUndecorated. This is what I am wanting but it seems to take away the drop shadow of the jFrame.

I have been looking a lot for code to do this but all seem to have the drop shadow **INSIDE** the application itself.



In this linked stackoverflow post the user has an image like I am wanting to do (though the image is from a .NET winform):



I also ran across this stackoverflow post that *may* be what I am looking for but I am unable to apply the backdrop to my jFrame because this seems to only draw borders around the jFrame:



I also read over this staackoverflow post that seems to also be something I *may* be looking for but when I tried the code it didn't do anything in the background of the jFrame. This seems to be using the **SwingX** but I can not seem to get it to work with my jFrame?:


Lastly I looked at this [stackoverflow post][6] and it is somewhat what I am looking for but it messes up (makes my component's on the frame go random places) once I get the code onto my swing application and plus its not **all around** the jFrame.



So masters of Swing - how can I accomplish this?
6 days ago
Hey all new to Java some I'm sure this is something simple but just can not get it correctly in order for it to work.

The original java code for this runnable class:

The thread code that I created is this:

The only 2 errors I have out of all of that code above is:

Handler cannot be resolved to a type



on


and

Return type for the method is missing



on


So what do I need to change in order to replace Handler so that it will work with the thread code I created?
3 weeks ago
Hey all I am at a loss as to why its doing this. If I just run the server and standalone client it works just fine. However, once I use my code for the client it seems to get stuck...

It does fine until it gets to the "NAMEACCEPTED" else if condition and it just steps out of the while loop and then nothing happens. No error of any kind. It just doesn't how the swing frame!
If I comment out:

and run it the swing frame loads up just fine. But my Socket (which I am wanting in my swing app) keeps it for some reason passing.

To sum all this up - the above code hits the window = new UFTtrack(); and placeChatOnScreen() but after it exits the While loop in the placeChatOnScreen() it never continues to createTable(); What's the deal???
3 weeks ago