Saturday, November 28, 2009

Chrome OS and Java

I made some time ago small research about Java in Chrome OS, today I continued. Last time I played with VMPlayer, now I'm running Chrome OS [for true it is Chromium OS] on my Asus EEE PC 900.

First thing is, it looks that in Chrome OS we have 2 versions of Java!
First is OpenJDK 1.6, and you may find it in directory /usr/lib/jvm/java-6-openjdk, java -version shows here OpenJDK Runtime Environment (IcedTea6 1.5) (6b16~pre5-0ubuntu2) OpenJDK Client VM (build 14.0-b16, mixed mode).
Second is GCJ 4.4, which you may find at /usr/lib/jvm/java-1.5.0-gcj-4.4, and displays this version info java version "1.5.0" jij (GNU libgcj) version 4.4.1.

It looks that in this OpenJDK Java you will not be able to run any program using Swing or AWT, any try of this will end with message:


Which says in short that Java cannot find some native library.

In GCJ Swing is working :-)



But how you can notice program is displayed in full screen mode.

I was also able to run my Java program which animate face with Gouraud shading [this link will lead you to my blog in Polish, where you may find applet which is doing the same]:



But this is REALLY slow. What you can see on movie.



That's all what we know.
We don't know if Java will be part of Chrome OS, or if it is here only by luck.
My hope is that Java will be important part of Chrome OS.


Similar postsbeta
Gouraud Shading in JavaScript :-)
OpenOffice.org2GoogleDocs and Apple - first try ;-)
Which language is fastest? ;-)
Programmers love to over complicate...
How to detect clickbaits?

Wednesday, November 18, 2009

OOo2GD in Ubuntu 9.10 - it's working.

OK, from premiere of Ubuntu 9.10 I got by e-mail and other ways info that some of OOo2GD users aren't able to use OOo2GD on Ubuntu 9.10.
I tested it, and here is a result [OOo2GD with OpenOffice.org 3.1 on Ubuntu 9.10 rc 4 in VMPlayer in Windows 7]:



All what I needed to do to get it was to use command:

apt-get install openoffice.org


Which command downloaded and installed OpenOffice.org 3.1 with Java.

Next, I went to page http://extensions.services.openoffice.org/project/ooo2gd where I downloaded OOo2GD in version 1.9.0, next I installed it with Extension Manger from OO.org.

So guys, if OOo2GD doesn't work in your Ubuntu 9.10........ I'm sorry, but you must have something wrong with your configuration.


Similar postsbeta
I'm close to decide to abandon Linux.....
Which language is fastest? ;-)
OOo2GD 2.1.2 - small fix
OOo2GD 2.4.0 - folders and HTTPS ;-)
Why it isn't working???

Saturday, November 14, 2009

Which language is fastest? ;-)

Update: 15/01/2010 - It seems that I made big bug in test code for C# which caused decreasing of C# results about factor 10! I assumed that DateTime.New.Ticks returns nanoseconds, but it returns ticks, and in one nanosecond we have 10 ticks... Sadly nobody looked into sources of my tests :-(
So results for C# should be divided by 10, and in this case C# is faster than Java about 3 times [but not Java 1.5 with -server switch used in this case Java is a little faster than C#].
New results for Intel Core 2 Duo T6600 2.20 GHz under 64 bit Windows 7:
C# z .NET 4.0 - 1.17 ms
Java 1.5 with switch -server - 1.096 ms
Java 1.6 with switch -server - 2.8895 ms
Python 2.6 - 10.88 ms

Recently I made tests of this which programming language gives quicker code ;-)
Of course it depends from this what this code should to do.
So I choose thing which I'm writing almost always in new [new for me] language :-)

I wrote it even during my first session, over green screen [on RS232 connection] when I was first time connected to HP-UX on my University server ;-) [or maybe not??? I'm not sure now ;-)]

This thing is simple numerical integration of function f(x)=e-x2 in range (-10,10> [when calculated form minus infinity to plus infinity result is equals to square root from Pi :-), I was really impressed when my professor showed it to us on our lecture from mathematical analysis]. Those calculations are performed in 10000 of steps, and repeated 1000 times for stable result [so we measure time of 1000 iterations from 0 to 9999] and divide result by 1000 to get information about time needed to calculate one iteration.

If you are interested in source codes of programs I wrote for those tests, please use one of those links [those are links to my blog in Polish, but you needn't be afraid ;-) you are interested only in source codes] sources for Java, Python, C, and C# [here you may find ZIP file with some of those programs], sources for JavaScript [here is a simple JavaScript tester, which will display info how long took one full iteration for calculate this numerical integration], and finally sources for Go [here you need to be warned, that this Go program should have changed one line, where math.Exp() is used, it should use math.Pow()].

And results are interesting ;-)

C++ 32bit - 0.985 ms
C++ 64bit - 1.387 ms
JavaScript from Mozilla Firefox 3.5.4 - 1.380 ms
JavaScript from Google Chrome 4.0.223.11 - 2.514 ms
Java 64bit - 3.8 ms
Java 32bit - 4.7 ms
Google Go 32bit - 8.521 (5.68) ms
Python 2.5.2 32bit - 10.3 ms
Python 2.5.4 64bit - 10.16 ms
C# 64bit - 14 ms

All tests except test for Go was performed on my 64 bit Windows 7 laptop with Core 2 Duo processor, Go was tested on virtual Ubuntu 9.10 in VMware Player 3.0 hosted on Windows 7, in case of Go first result [8.521 ms] is a result shown by test program, second result [5.68 ms] was calculated by comparing results of JavaScript from Firefox on Windows 7 and in this virtual Ubuntu 9.10.
C++ code was compiled with Visual C++ 2008 Express Edition [for 64 bits I used compiler from Windows 7 SDK, here instruction how to make Visual C++ 2008 Express Edition to use it :-)]

The biggest surprise for me was really poor result of C#, and superb result of JavaScript in FireFox :-) I still don't know why JS was so fast :-) [interesting thing also is this that FireFox JavaScript was here faster than Google Chrome JavaScript ;-)}
Result of Go wasn't so surprising, now after the premiere of this language we can here only praises, but its still experimental thing, and I used 32 bit version of compiler which isn't the best ;-) [I must also admit that after my first experience with Go I don't like it and I hope this one Google project will die].

I think that good advice after this test is ;-) If you need to write some very quick code use C++, if it must be fast but needn't to be extremal fast - use Java, and newer use C# ;-)


Similar postsbeta
Calculation of SSD life time in EEE PC
Sources of JPC - x86 emulator in Java
How to detect clickbaits?
Programmers love to over complicate...
Gouraud Shading in JavaScript :-)

Thursday, November 12, 2009

OOo2GD 1.9.0, let's try to be seamless ;-)

Nothing big today, but rather useful ;-)

First, in configuration window you may find new checkbox, for overwriting files during download.

What's for? Thanks to this you will be able to avoid downloading a lot of files with similar names, example now when you have document called "test" in Google Docs, and you try to download it several times, you will end with file test.odt, test(1).odt, test(2).odt, test(3).odt and so on.

This change will help you in using second change ;-) From now OOo2GD will try to be smart, and when you will want to export file to Google Docs it will try to find in Google Docs item with most similar name, and will set itself to update this item, you can still decide that you want to upload new item.

Last but not least change is try to reuse once obtained information, example you open import window, and use Refresh List button, next you close import window and open it again... now OOo2GD will try to use existing list of documents instead displaying empty list and making you click on refresh list. You can still use Refresh List to refresh it ;-)

Hope you will find those changes useful :-)

You can visit project page, or download newest version :-)


Similar postsbeta
Download your document in choosen format from Google Docs with OOo2GD 1.8.0 :-)
How to create valid file name?
ePubGenerator v0.0.3 - from OpenOffice.org to EPUB :-)
Bloggeroid 1.2 - let's make it simpler
OpenOffice.org2GoogleDocs 3.0.0 - uploading without conversion to Google Docs :-)