Mike Bates

Ranch Hand
+ Follow
since Sep 19, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mike Bates

I have written a program that off loads 4 different records from a serial device, that part works great.

I am wondering on an approach for updating a web page, email, twitter, ftp, GUI, etc. I thought of using the Observer model but not sure if that is the best approach.
Two of the records get updated every 2.5 seconds, 1 record gets updated every 5 minutes (could be every minute) and the forth record is updated about every 5 minutes plus or minus.

The each record is defined in their own class and updated as needed, I thought the best approach would be to notify other processes that the record was updated, have those processes grab the data and to their part.

Anyway, I am looking for options on approach.

Thanks
Mike
7 years ago
I have created a standard mbean for my desktop application and the cool thing it works. I would like it to auto refresh every 2 minutes automatically. I have Googled the heck out this but can't find a way to do this, I may not be using the right search criteria.

Any thoughts on direction? I have seen examples talking about this for JBoss and Tomcat but no code samples.

Thanks
Mike
9 years ago
Take a look A Switch on String Idiom for Java it is not perfect but it works. Or wait until Java 7 is released.

Mike
9 years ago
robi,

Thanks for the response. For a development environment I am guessing that Eclipse or Netbeans will work for development environments and there is nice test platform for the application.

Have a good one.

Mike
9 years ago
What is the uplift to take a mid-level J2EE developer to become an Android developer? Are development environments similar and the APIs like enough to make the leap without a large learning curve?

I know the interaction with serial devices at the desktop level can be pain (such as a GPS,) is the interaction/integration easier on the Android?

Thanks
Mike

9 years ago
Okay, I am create a data model like this for more flexibility but can't get it to work with a template. I know I am missing something just not sure what. I tried to capture the basics here with the code and template, so you would get the idea of what I have tried so far.


Any thoughts?

Thanks
Mike



With this template I get data but the List is in one line:



Results:
David,

Thanks for the feedback, which is exactly what I was looking for. I know the problem was probably not defined clearly enough and I have thinking for days on to write it up. You validated I was on the right track and provided a missing part of the puzzle -- the factory class.

Thanks
Mike
10 years ago
I working with a device that can be accessed via serial port or IP:port (stream.) My thought was to do the following and want to know if I am on the right track or not. Just need some guidance and/or course correction. Using sort of pseudo code to get my idea across.



I think where I am going to run into an issue is with creating the connection stream in the code so it is reusable in other places. I think I understand the contract around interfaces it is taking using it with the base code. The commands are the same for the device regardless of how it access, just the details that differ between serial and IP communication is where things become difficult the reason I am trying to get the level of the data stream.

Anyway am I on the right track? What other issues might I see or need to deal with? Or do I need to provide more information?

Thanks
Mike
10 years ago
David,

Thanks for the response. I will head down that road.

Thanks
Mike
10 years ago
I am collecting data every minute up to nine or more elements (double and strings, possibly) for 24 hours. I was planning on storing them in an array and then push out the oldest element and realized that array can be of only one type. This way I can access specific time elements as needed. The program runs constantly collecting data, everything will be stored in a database ultimately but every few minutes data will be pushed to another site. I thought having the extra database access would be painful for performance so I was looking at an in memory structure.

Here is my sample code which I have not completed yet but thought since I am still new to Java there might be some better approach instead of an array, maybe a stack, a queue, etc.

In this case, I am storing up to 10 minutes of data just to work through the process.

Any thoughts or direction would be appreciated.



Thanks
Mike
10 years ago
Gosh dang it. I looked at that demo and missed the ActionListener for the trayIcon.

Thanks for the direction.

Mike
10 years ago
I have this code working just fine, one option I want is to use a double-click on the icon in the system tray to set the application visible again. I am thinking of using a mouse listener but not sure where I would put it or would I use a window listener?

Thanks for your guidance.
Mike


10 years ago
So I have a Java application, both command-line and GUI, that I would like to send to user and have the users deploy the application. I am looking at install tools but is there some place documented best practices for deploying Java applications.

1) I use several different tools such as log4j, httpclient, etc and they all have jar files that need to be deployed with the application. Should be separated out in a separate library directory or embedded in my jar file? What is the best approach to manage these for the future and make sure I have documented their inclusion and copyrights?

2) Should have the installer install JRE or check that the user has installed an appropriate JRE?

I know I am probably touching the tip of the iceberg here but thought this would get me started by asking a couple of questions. Also, I hope this is the a good place to ask them.

Thanks,
Mike
10 years ago
Martijn,

You hit the nail no the head. It looks like I had a log4j.properties within the Jar file and it was using that first. Thought I had deleted it a long time ago.

Something that caused me some low level frustration for the last couple of weeks and it was simple.

Thanks
Mike
Okay, ${user.dir} is /home/mbates/dist on Linux and found a file called dist/jAPRSSend.log in the /home/mbates directory. The file C:jAPRSSendjAPRSSend.log created with it in the /home/mbates/dist directory.


With the above change, after deleting all log files, I still get two log files now in /home/mbates/dist. One called jAPRSSend.log and one called C:jAPRSSendjAPRSSend.log.

I am using log4j-1.2.15.jar in my lib directory. [UPDATED] Just tried 1.2.16 with the same results.

Mike