Saturday, July 23, 2011

How to prevent text selection

There are few ways

1. Apply 'preventDefault' for events 'onselectstart' and 'onmousedown'

var element = document.getElementById('content');
element.onselectstart = function () { return false; }
element.onmousedown = function () { return false; }

2. Add attribute 'unselectable'

$(document.body).attr('unselectable', 'on')

3. Add style 'user-select: none'

.g-unselectable {
  -moz-user-select: none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  user-select: none;
}

4. Use disabled textarea
<textarea disabled="disabled" style="border:none;color:#000;background:#fff; font-family:Arial;">
    how to prevent text selection?
textarea>

source (ru): javascript tips #2 

Monday, June 27, 2011

IBM Domino Java: No trusted certificate found. Fail?

I've faced with quite major problem when use IBM Java (the one from Domino 8.5.2 FP2). Our Domino grabs data from some webservices via 'https' (webservice does not have authentication, its free to everybody). Using simple Java Agent in Domino we grabbed data and was very happy :), here is few lines what we do
 URL url = new URL("https://here url");  
 URLConnection connection = url.openConnection();  
 HttpsURLConnection httpConn = (HttpsURLConnection) connection;  
 httpConn.setRequestMethod("POST");  
 httpConn.setDoOutput(true);  
 httpConn.setDoInput(true);  
 byte[] bytes = msg.getBytes("UTF-8");  
 httpConn.setRequestProperty("Content-length", String.valueOf(bytes.length));  
 OutputStream out = httpConn.getOutputStream(); // and on this line we now have an error: "no trusted certificate found"  
It worked fine for years but their (webservice provide) certificate has expired and they generate new one using same official CA. After they did it, Domino refuse to use new certificate and we can't grab data anymore from Domino.

We did some tests and noticed that non Domino JVM works just fine (we did tests in Eclipse with Oracles JVM) with exactly same code and it worked fine.

Of course we tried much more thing i.e.: we tried to add new certificate to cacerts storage in Domino and it did not work, we also tried to replace cacerts on Domino and use the one from Oracle JVM and lot of more things without any luck. Also when we tried to add new cert to cacerts in Domino it started to report about another issue: certificate chaining error.

Maybe Domino or Domino's JVM has problem/issue or we need to do something we just do not know. Would be nice to get more details about it because we are stacked now, does anybody know why we get this problem and if it is really problem in IBM Java?
There is also post on IBM with exactly same problem with not trusted certificates.
Would be nice if somebody share his suggestions/opinions.

Related topics:
IBM Domino Java: No trusted certificate found. Fail?
Domino and No trusted certificate found
Disabling certificate validation in Java

Thursday, June 23, 2011

How to add much more debug information to your Java Project

Go to Run\Configuration manu and switch to tab Arguments and add: -Djavax.net.debug=ssl,handshake (as I did on screen) and you will get much more debug information that could be useful for you.

Tuesday, June 07, 2011

Thank you MS for second update of Skype

Most of day Skype does not work and same situation in most of my friends. Only in such moments you understand how things are important like Skype :).

Tuesday, May 31, 2011

Copy/Paste substitutions freezes my Lotus Notes

Have you ever tried to copy and paste substitutions in server's names.nsf? I'm having problem there for last few years (if I recall correctly). Problem is quite simple, after you tried to paste substitution your Lotus Notes always freeze.


Previously I used ctrl+pause to avoid this freeze but I got new laptop and pause is absent :) (and I do not know how to simulate ctrl+pause).


Hope IBM will fix that in 8.5.3 :)

Tuesday, March 22, 2011

have you already download new FireFox?

I've just updated it to version 4. It works fine. Unfortunately I expected it would run faster then 3.X but it did not happen. FF can't beat Chrome in this area. But there is another good news: all my plug-in work fine. Only firebug required re-installation.

Saturday, March 19, 2011

I've moved my applications to google code.

I've upload some of my small application to google code. There are couple reasons why I did it:
- backup.
- we can use SVN now as on some projects I work with another people, so now we can get benefits from that as well.
- I just feel that it is much much more correctly :)

If you wish to create project your own project on google code, just fill google code form. After that using SVN do checkout and
input as URL repository https://*******.googlecode.com/svn/trunk/
[Username] is your email
[password] is available on google code setting page.

So go on and do your first commit to google code

Friday, March 04, 2011

SVN plug-in problems

Hi guys, we are moving our Domino applications to SVN and everything going really well except one thing.
We are having problems with elements that really do not modified but during synchronization they get new values (look on image). It is major problem for us, because applications have many design elements and most of them often get news values (modified, noteid etc) and then we are not able to determine what elements were really changed.
We do have workaround: do 1 more step and apply XSLT approch on exported elements and just remove these Noteinfo, modified, lastaccessed etc tags, but that is not the really correct way.

Does anybody know solution for that? If you use SVN - how you live with that?

IBM did forum on xPage, nice

Just noticed that IBM did forum for xPage based on xPage. I can't say it looks great, I feel it still require lot of work.