David Go

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

Recent posts by David Go

Hey all I am trying my best to get this animation correct. Seems it may be in the Javascript but not sure.

The movie poster should load up in the center. Currently though its loading up all the way in the corner.

It should look like this when you click on a poster

Here is the codepen

Any help would be great!
Thanks all for the suggestions. This is what I came up with
6 months ago
Hey all the following code below works with highlighting the supplied word to search for but if there are more than just one (1) of that word in the sentence then it wont find it. It just stops at finding one (1) match.

The above code looks like this when ran and supplied the word "world" to find.

But now if I add to the sentence and add another "world" then hit the button this is what it looks like:

As you see, it still has the same highlighted word without also highlighting the second (2) "world".


I have attempted using regex in order to loop and find the needed word.

But this does not produce even one word found.
6 months ago
Hey all I am trying my best to convert this working CURL script to Java:


   -k: Allow insecure server connections when using SSL
   -c <filename>: Write cookies to <filename> after operation
   -L: Follow redirects
   -b <data>: Send cookies from string/file
   -H <header/@file>: Pass custom header(s) to server
   -d <data>: HTTP POST data

I've searched around for java code that includes an example of creating a cookie but I have yet to find something that would help me with my code above.

The closest I could find and modify the POST call is this:

For postIT the value is:

However, it has an error of:

   error: null

Not sure why the error is null since postIT has data? So not only am I not able to run the modified code I did, I'm still wondering how I go about calling a GET command using the cookie even if the code above worked.

So, in a nutshell:

   - Fix httpPost error.
   - How to send cookie on other GET methods.

Help would be great!
7 months ago
Hey all I am looking to find a value using XPath and once found, replace that value with something else that I define.

Problem being is that my XML file has levels like:

I have not been able to find any examples that contain the above - mainly the ic:, jxdm:....

The code I scraped together is:

I would be open to using another framework if needed (and also makes this easier) but I'm trying to use what java already has included out of the box. And if there's something other than XPath that would also make this easier then please let me know.

If anyone can help then please do so
9 months ago
Hey all I am trying to place an animated GIF (as an icon image) in front of all other layers I have.

the code:

It all starts out with the showAniCard() then I call stopAniCard() then showBlinkingLight(). As you will see from the image below the gif if behind the card.

Currently this is what it looks like when it runs that code.

The grey square in the background is the animated GIF that's behind the card reader.

If I don't load the ReaderWithCard.png image then it shows but this does me no good since I need the card in it as well.

What am I missing from this that would make the animated GIF be on top of the card/reader?
10 months ago
Hey all I have the code below that changes the background of a cell to either RED or GREEN. It seems that when I comment out the GREEN else code that my excel sheet has all red for each cell box in row 1. Likewise, if I do the opposite and comment out RED and un-comment GREEN then all the cells in row 1 are green.

I'm not understanding what in the code below is making it color all the cells the same color even though the first 2 cells should be RED while all the others should be GREEN. I already checked my logic and its going to the first IF 2 times and then the rest is going to the else so that's correct.

My code:

I'm sure I am just looking over something quite obvious but at this time I'm not able to find what that may be.

Any help would be great!

Note: Also posted to the following forums:

1 year ago

Dave Tolls wrote:The method setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment) in the type CellStyle is not applicable for the arguments (org.apache.poi.sl.usermodel.VerticalAlignment)

You've imported the wrong VerticalAlignment (I know, they are stupidly close in their package names).
You want the ss one, not the sl one.

It looks like "Middle" is not part of the SS?
1 year ago
Hey all I am trying to get my cell to vertical line instead of just being aligned by the left side using POI.

This is my java code:

However, the line headerCellStyle.setVerticalAlignment(VerticalAlignment.MIDDLE); has an error of:

The method setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment) in the type CellStyle is not applicable for the arguments (org.apache.poi.sl.usermodel.VerticalAlignment)

How can i go about getting this to work if I have already defined it as an static CellStyle headerCellStyle = workbook.createCellStyle();?
1 year ago
The // between Local Apps is said to take care of the space between the names. I was using something and it kept saying "cant find dir \Local"
1 year ago
Hey all I am trying to change directories and then run my command with parameters.

It runs without errors but outputs nothing. However, this is what shows up after it finishes:

<terminated, exit value: 0>C:\Local Apps\IBM\SDP\jdk\bin\javaw.exe (Jul 22, 2019, 11:21:37 AM)

The expected output should be:

So am I doing this correctly?
1 year ago

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.
1 year 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.
1 year 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.
1 year 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?
1 year ago