Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp

Stephane Clinckart

Ranch Hand
+ Follow
since Oct 21, 2003
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Stephane Clinckart

Hi,

Are you touching data structures and algorithms (or concepts) used in crypto mining... more precisely in blockchain programming ?
Is there a recept to prepare a "conventional" program to be migrated to "blockchain" solutions ?
What are the datastructures / algoritms that are (not) elligible ?
Where should we pay attention ?

Thanks

Kind regards
8 months ago
Go
Hi,

Could you point me which plugin i should use to do the following:

On a Server A, I have Hudson (continuous integration) installed.

On a Server B, I have Selenium RC server installed (and running).

Each night, a full build is executed on the Server A (with latest version of the sources stored in svn).

I would like that my Selenium Tests Cases (and Suites) are started during this build from the Server A but the execution of the Tests should be done on the Server B (remotely from Maven thus).

How can I do that ???

Thanks for help.

Stephane
8 years ago
Thanks.

Is it possible to mix both technologies - GWT and JavaFX ???

The idea is to have an GWT application who "embed" a small JavaFX application in the banner by exemple that allow to send mail on the client side with an attachement ?
This to "hack" the fact that mailto don't allow attachment.

You think it is faisable ?

Thanks


9 years ago
Hello,

I read that in the roadmap of JavaFX2 there is something binded to handle Swing.

Can you spot me a good article that explain what is covered ?

Thanks.
9 years ago
Hi,

I would like to have a confirmation.

I evaluate the possibility to use a JavaFX application (JavaFX2 ?) for a distributed web application.

My question:

Is it possible to send a mail on the client side ?
With file attachment ?

The idea is to open the mailclient with an attachment in it.

Like I should do with a Swing application with java.mail API ?

Thanks a lot for help

Stephane
9 years ago
May I know what you used at the end ?
What is a success?

Thanks
9 years ago
I advance a little on this problem:

I found this solution:


What you think about ???
9 years ago
I'm not sure that I explain well.

What I don't understand is that Sustem.getNano is arround the other way to get the duration.

It looks like both methods are not using the same time referencial internaly.

start1 = getTime()
start2 = getCPUTime()

stop2 = getCPUTime()
stop1 = getTime()

Normally (stop1-start1) should be higger than (stop2-start2)

But it is not the case.

Even if I try in a loop.

Any idea what cause this ???
9 years ago

Rob Prime wrote:Use another variable to store the old value, then restore that old value at the end. Or simply use the new variable instead of the old one.
Note that you may need to copy (or clone()) the old value if you intend to modify it. E.g.



The idea is to change the "systemTime" inside the application... or better in the block.

The target is to have the ability to test a lib, a class, ... on a specified time.

By exemple on 2008/31/12 --> This date was special if I well remember... day 366 of the year what is not common.

I didn't find a way to do this in Java.
It looks like C# is able to do stuff that is not possible in Java... at least for this specific problem.
9 years ago
Who can expalin this ???


Resolution : 15600100ns - 15ms
Resolution Nano System: 810029ns - 0ms

"Resolution" should be lower than "Resolution Nano System" but it is not the case !

Thanks for help.

PS: The original code is from this blog: http://snippets.hoydaa.org/simple-stopwatch-to-calculate-actual-thread-time
9 years ago

Campbell Ritchie wrote:Don't know. I don't think you can use the System.setProperty() method since there doesn't seem to be a property corresponding to current time. Sorry I can't help any more.



Hi,

thanks anyway or help.

The problem with this method is how to "restore" the normal date at the end ?

Another point I would like to achieve... if it is possible... is to have different time in my Threads.

Thread 1 --> 2000/01/01
Thread 2 --> Current Time
Thread 3 --> Time in the future
...

Very usefull for testing an application.

But... this would be the sherry on top of my cake ;-)
9 years ago

Campbell Ritchie wrote:You will get better attention if we know what the question is about.

Do you mean to get the time with methods like System#currentTimeMillis()?
Or would you want a Calendar object? Or one of the DateFormat classes (possibly SimpleDateFormat)?



Did you read what this lib is doing ?
My goal is to achieve the same in terms of functionnality in java.

The code I spot do following:

In the Do block... the systemTime is set to 2000/01/01

When the block is closed, the SystemTime is "restored".

Another sample of the same idea:
http://melgrubb.wordpress.com/2008/12/31/use-datetimecontext-to-put-your-code-in-a-time-warp/

Thanks for help.

9 years ago
var instant = DateTime.Parse('”2000-01-01”);

using (SystemTime.Is(instant))

{

// do some work

var currentTime = SystemTime.UtcNow;

}

More details here: http://jonathan-oliver.blogspot.com/2009/10/testing-timestatic-calls-and.html

Thanks.
9 years ago

Alex Hurtt wrote:This?




May be I explain badly ? (i'm not english native).

My target is to have something like:



This way... the day the type of id change... all code binded to this type is automaticly changed without having to refactor.

Who know how to achieve this ???

Thanks a lot

9 years ago

Rob Prime wrote:How about this:



Yes... this works... but... you are just moving the problem a little bit more far.

The goal I try to achieve is to define only in one place the Type (Long) of the id inside the Entity.
--> So if I change it to Integer or something else... I need to do only in one place ad don't have to refactor all my code.

I showed the code with the "EntityService"... but other layers of my application will have the same problem (DO, DTO, DO2DTOMapper, ...)

Anyway... thank for help.

Hope someone hass a good idea to fix this problem.
9 years ago