Viktor Kubinec

Ranch Hand
+ Follow
since Jan 28, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
4
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Viktor Kubinec

First you should find the reason why do you have such performance for 100 users. Try to use some JVM monitoring tool (jconsole,jprofiler,visualVM) to monitor your web app and ESB. Try to find out whether the bottleneck is your app or the ESB.

One of the reasons why the performance is going down with more users could be running out of memory. When you run out of memory(which can happen with more users) then GC is running more often and consuming lot of cpu time. In this case you could try to extend java memory settings.
11 years ago
First I suggest you to look at Calendar api documentation - http://docs.oracle.com/javase/6/docs/api/java/util/Calendar.html

and here is a short hint :



there are more convenient set methods which makes your life easier. It also might be confusing that setting month starts with 0 (= january) but setting day of month starts with 1.
11 years ago

Joe Harry wrote:Referring to the mongoDB in Action book...



What is a slug in the above document? It sounds like a unique Id. But how do I ensure uniqueness with a slug field when say I have around a million documents?



I think it is just a field in the json document just like sku,name,description... If you want to make a field unique you can create unique index on that field.
11 years ago

Joe Harry wrote:Is everything a String in mongoDB? Can't I use long datatype for my Id?



No, there are more datatypes. I don't know if this is the full list, but at least what I know : String, Number, boolean and object and you can use Long datatype as your id. How do you access mongodb?
11 years ago
Hi, please edit your post and wrap the java code into code tags. This way it is unreadable and people in here are less willing to read it.
11 years ago
Java application process doesn't end when main method is completed. It ends when all threads are completed. I don't know what are you doing in your while loop but if new Threads were started there this could be the reason.
11 years ago
Hello,

i'm looking for a time management framework with funcitionality like defining and searching time intervals, their colisions (intersections) ...

Any suggestions?

Thanks.
11 years ago
Proxy servlet is just a simple servlet I deployed to tomcat ROOT, which just forwards the requests and send responses back. Since the requests and responses available here they can be traced or even modified.

I have set up proxy server in firefox in network setting, I checked the option - use for all protocols. But after I shuted down the proxy servlet the page was still updated in the browser by regular ajax calls. So it look like that ajax is bypassing the proxy server.

Maybe I can try to disable firefox to access internet in firewall settings and see what happens then.
11 years ago
Hello,

I want to implement web browser monitor in java (to track all the communication between browser and web application). I started with simple proxy servlet, but I realized that ajax calls are not going through the proxy. Is there some way how to catch also ajax calls? Is there some way how java can hook into the browser communication other than proxy?

Thanks.
11 years ago
Hi,

today I passed OCPJP with 96%. For preparation i used books from KS&BB (SCJP guide and OCP exam book). I have done all mock exams in OCP exam book, exam lab mock tests and 6 enthuaware mock tests in this order. In OCP exam book I have scored around 65-70%, in exam lab 70-75% and in enthuaware I had 85% in average. There are not so many tricky questions in real exam. 2 and half hour was enought time to finnish test. The room was little cold and there was lot of ouside noise from construction side (It did not bother me, I just want to tell that this can happen). I took the exam in VUE center in Slovakia.

My tip:
Always read all the answers and I try to explain to yourself why is the given answer right or wrong. When you find a line which is throwing exception in the code don't mark the "exception thrown during runtime" without reading the rest of the code - there still can be compalation problem.
11 years ago
thanks for answers.

@Paul : unfortunatelly I haven't marked those questions, so I can't tell you their ids. In total I have done 6 normal tests and the Final test ( I'm doing the exam tommorow in the morning ) and I think I have found just 2 questions like this among them.
Hi. I am preparing for the certificate and I have bought enthuaware mock exams. Sometimes I found there questions which can be solved by pure logic without any java knowledge.

For example - there are 5 options out of which 3 are right :

1. Will not compile
2. Compiles fine and .....
3. Compiles fine and .....
4. Compiles fine and .....
5. None of the above ....

It is clear that if 3 answers are corect, it cannot include 1 or 5. So correct is 2,3,4. This is the solution without even reading the question. Sometimes only 2 are correct, so one has o find 2 out of 3 instead of all 5.

Are questions like these also on the real exam?
Is the real exam easier or harder than enthuaware exam? (I also find somethimes questions which are out of scope as ~ operator for example)

Thanks for answers.
Hi,

these lines compile fine :



But these do not compile :



As far as I know Object[] IS-A Object. So why I am getting this compilation error : Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Type mismatch: cannot convert from Object[] to Object
?

Similiar problem :

this line compiles :


but these line don't compile (same compilation error as before):


Please, can someone explain this to me?
11 years ago
Given this code:


Why //1 compiles? Is it ok that this statement returns object of Type which is not acessible from this place?
Why //3 compiles (and prints "I AM HERE" , which means that toString method was accessed)
I understand why //2 doesn't compile, I just put it here to show that toString method cannot be called here.
12 years ago
I have bought an Oracle voucher in december last year. Last week I ordered an OCP, JAva 6 SE exam(VUE), which should take place at the end of march. Yesterday I have found a post in this forum from Bert Bates that for non-certified people OCA certification is required(I am not cerified yet). So I checked this out on Oracle web page and same thing is written there. Since my exam is already ordered I called to Oracle university and asked them if it is really required for me to complete OCA first. The guy on the phone needed to confirm this, so he wrote me later an email that for OCP JAVA 6 SE certification i need only to pass 1Z0-851 exam. So now I am pretty confused about it and I am afraid that if I pass the exam I will not get the certificate. Since when is this change (OCA requirement for OCP) valid?

Thanks.