Mark Richardson

Ranch Hand
+ Follow
since Dec 28, 2016
Cows and Likes
Cows
Total received
2
In last 30 days
0
Total given
0
Likes
Total received
6
Received in last 30 days
0
Total given
65
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mark Richardson

My use case is as follows:

I am already setting the following variables in localStorage.

bed-time.
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.
2 months ago
So I learned today that this exists:

https://www.oracle.com/technetwork/developer-tools/maf/overview/index.html

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?)
2 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
2 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?)
2 months ago


The following, is my work-flow:

Important: Please Open Reference Image which Refers to the "Buttons" in Eclipse: https://i.stack.imgur.com/LgaUn.png

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!
2 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?
3 months ago
After much butting my head against the wall, I present you.... with this! It actually works!

3 months ago

Rob Spoor wrote:From [url=https://docs.oracle.com/javase/8/docs/api/java/util/Calendar.html#HOUR]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
3 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?
3 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.

3 months ago

Tim Holloway wrote: Primefaces

Yep! That's exactly what we're using. But, I'm straining to figure out how to get all the key values out of my collection and display them in my dataTable. As for "genius" managers, since I'm a Jr. myself, I don't exactly have the experience, foresight, nor clout to recommend alternate solutions
3 months ago
JSF

Mark Richardson wrote:HashTable

Typo: I meant to say, HashMap.
3 months ago
JSF
Thank you, Tim!

In our implementation, by the time we get the userLogins they are already part of a User object which belongs to a specific user. Therefore, there is no need to provide "user id" - and unfortunately, I have to work within that paradigm on this project, and furthermore, we've been pigeon-holed by our lead to use the Hashtable construct.

What we get back will be ALL the logins for that one user.

Here is what the data looks like in our Hashtable construct:

Key                          List<Date>
2018-07-11
                  2018-07-11 08:14:08.540000
                  2018-07-11 10:46:23.575000

2018-07-12 
                  2018-07-12 12:51:48.928000
                  2018-07-12 13:09:00.701000
                  2018-07-12 16:04:45.890000

2018-07-13
                  2018-07-13 14:14:17.461000


Now, the question is... how to use the square brackets in JSF to go and fetch the keys (or the actual time-stamps)
On the UI the keys will be listed and next to them will be row expanders which will reveal the time-stamps.
3 months ago
JSF