Mark Richardson

Ranch Hand
+ Follow
since Dec 28, 2016
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 Mark Richardson

Campbell Ritchie wrote:Why have you marked anything static except the main method?

I marked my variables static because I thought that's what I had to do in order to use them in the main method.
I didn't quite get your point... isn't that the only way to use a variable within a static method?
4 days ago
I fixed the small bug in my code. I was incorrectly adding 1 if the mid-point was larger then the key, and incorrectly subtracting 1 if the midpoint was smaller than the key.

I fixed it like so:

but my exeception handling problem still remains.
4 days ago
I wrote the following code. It's a program which uses Binary Search to locate an element. I try to utilize exception handling to mitigate against the usage of decimal numbers. My intention is for the program to act as follows:

If decimal Number is entered, tell the user that decimals are not allowed and re-run the main method.
What is happening is strange. The main method appears to be running multiple times. Why is this?

My other question is in regards to a bug in my code... If I search for "6000" (the last value in my array) my program tells me that it can't find it. I'm not sure why...
4 days ago
My use case is as follows:

I am already setting the following variables in localStorage.

wake-up time.

I need my count-down clock to stop at "bed time." It should visually display 00:00:00.

When it is time to "wake up," I want the count down to begin. It should now start counting down from 15:59 - The hours:minutes
remaining until it is time for bed-time again.

This repeats, over and over.

I wrote the following code:

This code and variations of it are either making my countdown timer go into the negative, stopping at 0:00, and not ever re-starting once it is time to wake-up.

Joseph Mokenela wrote:You can learn and embrace JavaScript. There is a JavaScript Course that I found very helpful. You can try it out.

Wow. this is excellent. Thank you.
5 months ago
So I learned today that this exists:

I'm intrigued. I know that almost all Android development now happens on Android Studio, but why hasn't this taken off?

Has anyone used it? What are its disadvantages? I'm curious!

(I use JSF/Primefaces at work, which I think is perfectly fine... except it's unfortunately fallen out of favor by the younger crowd - is it the same story with MAF?)
5 months ago

Bear Bibeault wrote:If you don't want to be left struggling in the tar pit, modern web development embraces JavaScript or TypeScript (everything you hated about JavaScript and more!)

Yeah.. I guess I  gotta suck it up and learn JS
5 months ago
I can put together a pretty decent website. A little HTML from here, some CSS from there, some Javascript from somewhere else, and BAM. It's beautiful, and it's mine. But hold-up Mr. Wannabe Web Dev! Can you actually implement functionality using Javascript? Nope. Javascript scares me.

I know Java though!

So here's my question for you guys:

I know that AWS can host snippets of Java on EC2/Lambda.  In other words, I can have all my methods sitting on a compute platform on the cloud. Now, how do I make my HTML site actually implement these methods? is it possible?

In other words, I want to make Java do most of the heavy lifting of Javascript.

I know I can utilize something like PrimeFaces... but then I'm envisioning running a dedicated Tomcat server on AWS and that's just too much overhead, and possibly pricey. What do you guys suggest? Is this a naive goal?

Am I stuck with having to learn Javascript? (or go the JSF route?)
5 months ago

The following, is my work-flow:

Important: Please Open Reference Image which Refers to the "Buttons" in Eclipse:

1. I write code.
2. I stop the Tomcat server by pressing button #2.
3. I re-build/compile the project by pressing button #3.
4. I start the Tomcat server by pressing button #1.

I simply want to be able to do this via a single keyboard-shortcut. I have looked into AHK, and I have looked into Eclipse's key-mappings, but to no avail. I am even considering exotic solutions such as utilizing AHK which would do a mouse-click, wait a few seconds, and then do another mouse-click using screen-coordinates - but that would be a very brittle solution.

Thank you!
5 months ago
This aspect of being a programmer... where you take on things because it's like solving a puzzle! I love it... and I think of all this time that Java has been around and how the community has come up with all these different "hacks" to solve common (and un-common) problems... and then I think of picking up another language, like Python or Javascript...and get the shudders when I think about the countless hours I will have to put in, being stuck on things which may or may not have an elegant/easy solution. Such is the curse of the life-long programmer, eh?
6 months ago
After much butting my head against the wall, I present you.... with this! It actually works!

6 months ago

Rob Spoor wrote:From [url=]Calendar.HOUR

Aha! Or just set the hour to something like 1! As some of these projects, we Jr. Devs are often at the mercy of the implementation the lead has endorsed/blessed
6 months ago

Carey Brown wrote:"HOUR_OF_DAY".

2018-07-16 12:35:40.304000 <---- this is the "problem" date...

from the passed dates below:

2018-07-16 07:15:25.047000
2018-07-16 07:34:21.760000
2018-07-16 07:51:57.253000
2018-07-16 08:07:26.351000
2018-07-16 08:08:56.393000
2018-07-16 08:13:58.930000
2018-07-16 08:14:35.531000
2018-07-16 08:17:53.103000
2018-07-16 09:04:03.488000
2018-07-16 10:23:41.801000
2018-07-16 10:56:23.732000
2018-07-16 11:30:23.057000
2018-07-16 11:40:24.722000
2018-07-16 11:59:21.130000
2018-07-16 12:35:40.304000
2018-07-16 10:45:43.790000
2018-07-16 10:45:47.358000
2018-07-16 10:45:52.008000
2018-07-16 10:45:56.748000

You're saying that the issue lies when I set HOUR_OF_DAY to 0? Hmmm... Can I get another hint, please?
6 months ago
I wrote a nifty method which parses a List of Dates, and separate them out by day. However, there's a bug in my code and I can't figure out where it is.

When I looked at the keySet of the groupedUserLogins, I get the following result:

Jul 16, 2018 12:00 PM
Jul 11, 2018 12:00 AM
Jul 13, 2018 12:00 PM
Jul 16, 2018 12:00 AM
Jul 12, 2018 12:00 PM

See? It counted Jul 16th twice! Once for 12pm, and once for 12am.
In case you are wondering, I don't care about the 12:00xx part since the JSF UI will format the keySets to display like this:

Jul 16, 2018
Jul 11, 2018
Jul 13, 2018
Jul 16, 2018
Jul 12, 2018

but the showing up of 16 still remains and I'm not sure why

For what it's worth, here are the dates that it got fed from the database. It parsed them and put them all into categories by day, but it didn't handle July 16th correctly, for some reason.

6 months ago