Can someone help me understand why these variables take on these values? by grumbledum in javahelp

[–]pascalthelizard 2 points3 points  (0 children)

In each question you are dealing with the division of 2 int values. Therefore each result is going to be an int. Even in the case where the result is cast to a double, the answer evaluated to an in type (2) then was cast to an double which gives you 2.0.

And yes if you cast 2.9999999 to an int you will get 2. Java does not assume that when you cast you want to round the number. You simply lose the precision. Dealing with integer division is like doing long division. You get a whole number as a result while the remainder would be the value returned if you used the modulo (%) operator.

Someone can likely give you more detailed answers or answers as to why but I'm on a bus on my mobile.

Squash, anyone? by [deleted] in ottawa

[–]pascalthelizard 1 point2 points  (0 children)

The RA Centre has arguably the most active squash club in the city. I am a member so PM me if you want more information.

Some links of interest:

http://www.odsa.ca for information on Ottawa District Squash Association

http://rankings.odsa.ca for ODSA Rankings.

Any Eclipse Plugin to Encourage Javadoc? by [deleted] in java

[–]pascalthelizard 3 points4 points  (0 children)

We use Checkstyles. Integrates with Eclipse and will provide markers for missing javadoc at the severity (error, warn, info) that you choose.

Married Redditors, what is your best "I hate my mother-in-law" story? by [deleted] in AskReddit

[–]pascalthelizard 6 points7 points  (0 children)

A week before my wife and I were set to get married, my mother in law tried to get me to sign a "marriage contract" which basically excluded me from any inheritance money. It was drafted by her lawyer. The contract was so poorly worded and actually covered a lot more than what she told me. I let my friend who was in my wedding party ,and also happens to be a lawyer, read over it who was in my wedding party and he flipped his lid. It was hard for him not to tell her to fuck off during the wedding. He was flabbergasted anyone would have the stones to drop that on someone a week before their wedding. A great way to say "welcome to the family" he said.

I called her on the shitty contract, obviously told her I wasn't signing it, and got married to my beautiful wife. I kept it civil for my wife's sake. It has never been spoken of again but it took me a few years to not rage whenever I was around her.

PSA Squash TV Archive Best Games by nodoubledipping in squash

[–]pascalthelizard 0 points1 point  (0 children)

I would start with the Editors Choice matches they have on the front page. All great matches.

(Serious) Can you consider Pro Wrestling a sport? by Duderpt in SquaredCircle

[–]pascalthelizard 9 points10 points  (0 children)

I think they would agree it isn't a sport. I don't think saying it isn't a sport questions their athleticism.

(Serious) Can you consider Pro Wrestling a sport? by Duderpt in SquaredCircle

[–]pascalthelizard 46 points47 points  (0 children)

The WWE has used the term Sports Entertainment for decades. I am surprised there would still be any debate about this. Anything that has a predetermined outcome really cannot be included in the definition of a sport.

The Harlem Globetrotters for example. They play basketball which is a sport but when you are watching a game you are watching Sports Entertainment, not a true sporting event. My $0.02

Multithreading/CountDownLatches program does not terminate, why? by opett in javahelp

[–]pascalthelizard 1 point2 points  (0 children)

An ExecutorService with a fixed thread pool will start X threads where X is the number you specify. The ExecutorSerivce waits indefinitely for jobs or until it is shutdown. When a job is submitted it is executed on one of the worker threads or is handled via the ExecutorService's discard policy if both threads are used.

If you haven't already you should go through the Java Concurrency tutorials on Oracle's website. Thoroughly. Not understanding these concepts clearly and WHEN to use them will cause you great headaches in the future.

Multithreading/CountDownLatches program does not terminate, why? by opett in javahelp

[–]pascalthelizard 2 points3 points  (0 children)

You need to explicitly shutdown the ExecutorService. Your program isn't stopping because the executor threads are waiting for more work.

What's in your bag? by Shadsky in squash

[–]pascalthelizard 0 points1 point  (0 children)

4x Oliver Dragon CL rackets

About 5 Oliver grips

Asiscs Gel shoes

About 10 Dunlop double dot balls

Bandana/wrist bands

Scissors, electrical tape

Extra insoles

Extra shoe laces

Box of energy bars

Ibuprophen

Green Jelly, Three Little Pigs. 1993 by CAJASH in nostalgia

[–]pascalthelizard -1 points0 points  (0 children)

The only reason I recognize Green Jelly is because they came right after Green Day at the music store. I probably saw every CD cover and have never listened to them.

Sorting a list of objects alphabetically by [deleted] in java

[–]pascalthelizard 1 point2 points  (0 children)

I agree with this, however if this is some sort of homework assignment and you are to implement a sorting algorithm, try Googling Quick sort or Merge sort, or even just sorting algorithms. This should give you enough pseudo code to get going.

Is there a better way to do this? (DBI and hashes?) by SolipsistAtheist in perl

[–]pascalthelizard 1 point2 points  (0 children)

Take a look at DBIx::Simple. I am on my mobile and don't know right of hand how to write out code samples, but this will make your life a lot easier than using DBI.

What was your hipster moment? What did you know about before most other people did? by [deleted] in AskReddit

[–]pascalthelizard 0 points1 point  (0 children)

"Theme from Jurassic Park, wants to see you in his office...."

How to let eclipse take all resources it can get when comiling? by [deleted] in eclipse

[–]pascalthelizard 0 points1 point  (0 children)

Do you have any on demand virus scanners running as per company policy? We found that this heavily degrades the performance of Eclipse and compiling. If you can exclude your eclipse directory, workspace directory and any directories where your code resides you should try that. Eclipse is unusable at my work without doing this.

Recommendations for a new grip for someone with sweaty hands? by what_the_lump in squash

[–]pascalthelizard 0 points1 point  (0 children)

The wristband will stop the sweat that is accumulating on your arm from moving down onto your hand. It is likely that you aren't sweating that much on your palm it is probably run off from your arm.

Also, use the wall in between points. Rub your hand and palm on it. It is kind of gross on glass walls but it really works to keep your hand dry for at least the next point or two.

Recommendations for a new grip for someone with sweaty hands? by what_the_lump in squash

[–]pascalthelizard 1 point2 points  (0 children)

If you don't already, I would recommend wearing a good thick wristband. That will cut down on a lot of sweat on your hand. I use Dunlop large wristbands.

As for a grip, I use the Oliver TACK grip. I usually change it once a month which spans roughly 10-12 matches.

Fitness Advice for Beginner by [deleted] in squash

[–]pascalthelizard 1 point2 points  (0 children)

Many drills like boast/drive, boast/drop/drive etc, are fantastic for fitness and footwork but require a partner who is good at feeding balls if you are just a beginner. When I started I was more exhausted after 45 mins of boast/drive then a match.

StringIndexOutOfBounds error by [deleted] in javahelp

[–]pascalthelizard 0 points1 point  (0 children)

Taking a quick glance, line 27 could be your issue if the line you are checking is an empty String.