Paul Clapham

Sheriff
+ Follow
since Oct 14, 2005
Paul likes ...
Eclipse IDE Firefox Browser MySQL Database
Forum Moderator
Paul Clapham currently moderates these forums:
Vancouver, Canada
Cows and Likes
Cows
Total received
50
In last 30 days
0
Total given
98
Likes
Total received
2380
Received in last 30 days
2
Total given
522
Given in last 30 days
1
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Paul Clapham

Welcome to the Ranch, Mike!

The proximate error (the one which makes it hard to see the actual error) is that you don't print a lot of the useful data which the exception includes. Try this instead:



john kaine wrote:so youre saying i can just call the showfavourite method again and if it comes false it wont show the message?



Are you not yet at the point where you could just try that and see what happens?
4 weeks ago
Here's your original proposed code:



Where you're testing whether the Property in question is a favourite.

But the showFavourite() method you posted -- it does that test too. So you don't have to. Just call the method and let it do its thing.

And I have to say that the comment at the top of the showFavourite() method is absolutely bloody useless. Sure, it happens to be true, but it's still useless. A properly written comment would explain what was in the message and how the Property parameter affects the message. Yes, I know you didn't write that method, I'm just saying that it isn't something you should be learning from.
4 weeks ago
If you're asking how to write code which does nothing, the answer is to write no code. Like this, in your example:


4 weeks ago
Looks like your research is pretty good so far, and that being able to set the compressed size is pretty much the only option.

So: do you have to create the ZipEntry and set the compressed size before deflating and writing the data to the zip archive? What I have in the back of my mind is to get the Deflater from the output stream which you use to write the data to the archive, and ask it how many bytes it wrote. It does have a method which does that. Once you have that number then you can set the ZipEntry with the appropriate compressed size.

Does that sound feasible? It's just a top-of-the-head idea so far.
4 weeks ago

Glyndwr Bartlett wrote:Another issue is that the dates I enter are dd/mm/yyyy (e.g., 02/12/2018). However, the imported date is m/d/yy (e.g., 12/2/18).



From what I know about Excel I recall that it will take anything that looks like a date and store it in its own internal format. It won't remember what format you used when you entered it.
Right! Thanks for posting back with your solution.
The compiler thinks that you think that "aspect" is a Java keyword. But it isn't, so the compiler is right. (The compiler is always right.) Perhaps you meant to use an annotation, like "@aspect"?
4 weeks ago

john kaine wrote:i was struggling with the last line on the 1st message that said gui.showProperty().  i spent about 3 hours on that one line before realising that i had to enter the line before it (the portfolio.getProperty(0) line) as the paramter for the gui.showProperty().  as painful as it was to waste so much time on something so easy you were probably cringing actually gave me suuuuch a huge smile.



Yeah, we've all been there. I remember... but everyone has their own anecdotes. So, for you it's on to the next tar pit!
4 weeks ago

john kaine wrote:i get the    method in class cannot be applied to given types     error message.



Okay. Then it would be useful for us to know exactly which line of code produced that message.

Maybe you get it more than once? Then you could tell us about every line of code which produces it.
4 weeks ago

new persons wrote:i feel like thats really bad explaining



Yes, your instinct is correct. It is really bad explaining. But don't let that deter you, you can do better.

but its the only way i can explain without posting all the code on(i dont even know how)



Show us the code. Do you think there's too much code and we're going to be put off by having to scroll forever? That's quite possible. But your question is just about how to declare parameters, so we don't really need to see what's inside the methods and constructors. You could leave that out.

Or are you concerned about how to get the code from your machine to the forum? Copy it from your code editor and paste it in the box you're posting in. If necessary, copy it to somewhere else on your machine and delete irrelevant code before pasting what's left into the forum's post box. Don't worry too much about whether it looks good, anything is better than what we have so far and we're all friendly and used to beginners here.

And, welcome to the Ranch!
4 weeks ago

Basil Smart wrote:The issue is below this code referring (clonesheet) to copy 1st worksheet to new sheet of workbook2.



Which, as I said, doesn't actually write anything to any file. Perhaps you thought your code was updating an existing file? That's not how XSSFWorkbook works.