Win a copy of Securing DevOps this week in the Security forum!

Alvin Watkins

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

Recent posts by Alvin Watkins

I'm not sure I understand your question. Where did you declare "object2" - I'm tired today but am pretty sure I don't see that in your code? I see you made an Away object "Away away_object = new Away()". Why don't you try passing your Speech, Writing and Reading objects to the Away you instantiated such as "away_object.update(speech, writing, reading);"?
5 years ago
Thank you, Bear.

Yes. I followed those directions. They are the ones that say all you have to do is download and install and you'll be good to go. In my case, it did not change the JRE. It just added Java to the System Preferences app. When I open a terminal and type java -version it still says 1.6.

5 years ago
I'm not sure what your DBA is talking about. I've used Timestamp for years and never had any problems. It just takes a long and converts it to a YYYY-MM-DD format that SQL will accept. Also, for testing, this seems pretty straightforward to me:

5 years ago
I always do this by passing around Long's and using Timestamp(). Timestamp will take a java.util.Calendar or Date time-in-milliseconds and convert it to a Timestamp easily inserted into a DB or passed around and converted to whatever kind of "Date" you want (sql, Calendar or Date).
5 years ago
I am sure this is a very simple issue but I'm not versed in Mac and am having some issues updating Java.

I am debugging an application that is having troubles on Mac. The first step I'd like to take is to update from Java 6 to Java 7 and see if that helps fix the bug. I followed the instructions Oracle gives for updating to Java 7 (which is pretty much to just download and install and all should be good to go). I downloaded Java 7, installed it and visited the panel via System Preferences. Yet, when I open a terminal and type "java -version" I get 1.6. I used command "which java" (just guessing from my use of Linux) and got /usr/bin/java. How do I actually update the Mac's settings to point to the latest Java 7 I installed? I am using OS X 10.8.2.

Thanks for your help.
5 years ago
Because I may need null values in a Collection. For instance, I may have static positions (say seats around a poker table) and I need to sometimes have values matching those keys and other times I need to have null values there (for instance no player is seated in the poker table's seat at static position 'n' so don't deal to that position).

There are many times that being able to put null values into Collections is very useful.
5 years ago
Ah, I see.

Could you use System.getProperty("java.class.path") and then use a File[] to find all the jars there?
5 years ago
Not sure if this will help you, but did you check this forum thread? Finding JVM Classes with Agent
5 years ago
I am tasked with fixing a SaaS project that teaches music and has an established subscriber base. The app uses Java MIDI packages to enable MIDI recording of sound devices (such as a MIDI keyboard) which then get compared to actual music pieces and scores the user. It works well on all platforms except Mac Lion. On Mac Lion, things play along for about 5 minutes but inevitably there will begin to be dropped notes around that time and until restarting the app if it does not crash - the MIDI just skips notes and does not play them.

Has anyone ever had similar problems with MIDI on Mac and if so, how did you fix them? I found some similar issues with Java MIDI on Mac that were experienced before Gervill here : Java MIDI Dropping

I made sure my test Mac is using Java 7 and yet this did not solve the issue for me.

I'm happy to post code if there are any specific questions about it. I almost wonder if I need to go with a native Mac library though and then just write a JNI interface. I hate doing that if I can avoid it. I don't want to create an exception install for this one OS. That defeats the purpose of WORA and complicates this project even more.
5 years ago
I use printStackTrace() with regularity. I don't use a logger like Log4j (often - it's great to use if you need it though) because the only time anyone should see errors relevant to stack traces are in development and they are very useful to me. Of course, I also return some message to the user in production so that the UI can inform the user of what's going on. In a production environment, however, no one should ever see a stack trace and if a stack trace is printing, it's probably indicating that I have an issue I need to fix in the code.
5 years ago
While Bill is totally right (you can use web services, sockets, flat files, XML, JSON...) one approach I've used is JNative (A JNI opensource API). It's likely that one of the other methods is better for you, but if you can turn your Dot Net app to a DLL and access it in Java, there's another option for connecting the two for you...
5 years ago
Since no one offered any ideas, here's what I did...

I created a MessageManager object which takes all client messages and stores them in Maps. MM sends to the client a header message if the MM.clientRecievedLastMessage is true. The client responds with the size of the message it is looking for (based on the header message). MM then sends the client the message that corresponds to the header. Once the client has received all bytes, it notifies MM. MM then removes the messages and if there are more unsent messages, sends the next header and the process repeats.

Thanks.