Java

php-, Java-, VBA confusion

6.10.07, 16:56 | Tags: ,,,, | No comments

It’s getting more and more difficult for me, really. For business reasons, I sometimes do some Excel VBA macros. VBA is pretty straightforward and quite easy.

For my studies, I am again enrolled in a Java course. Now, Java is a beautiful language, but sometimes quite strict and therefore not always straightforward.

Finally, I often do some PHP hacks – like now, I am currently trying to develop my first WordPress widget.

PHP / Java / VBA: Although both PHP and VBA are script-like languages, and although both VBA and Java are object-oriented, I almost went mad today – until after 2 hours or so I remembered that in PHP, to concatenate two strings, you use the dot-operator . – while in Java, you can use +, and in VBA I think it’s &.

What a mess! I am totally lost on this…. It will be funny when I have to write my next Java examination – I will probably do no VBA and no PHP for the two months before it….

Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Technorati
  • MySpace
  • StumbleUpon

Tomcat

9.06.07, 14:55 | Tags: ,,, | No comments

Something new today – I want to have a tomcat environment to play around with. So I emerged tomcat – this pulls a LOT of packages on the box, and also I first added these lines to /etc/portage/package.use:
dev-java/sun-jdk doc
www-servers/tomcat doc java5
After the emerge, I stick to the wiki entry and the official Gentoo tomcat guide. Just starting /etc/init.d/tomcat-5.5 did it – I could reach the tomcat server at port 8080.

Then, I had a look at /etc/conf.d/tomcat-5.5. It uses sun java, which is ok. I then added the user apache to the group tomcat, and also my own user, in order to be able to access the tomcat files easily. Finally, I added manager access, as described in the wiki.

Now it’s time to integrate apache and tomcat – again, there is a wiki entry on mod_jk. Emergin mod_jk and configure /etc/conf.d/apache2 – easy – everything works!

Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Technorati
  • MySpace
  • StumbleUpon

Beryl

28.04.07, 15:15 | Tags: ,, | No comments

I finally wanted to have Beryl and all the nice stuff on my desktop – in fact, that was one of the reasons to get a new box… :)
First, I made sure I had the latest nvidia-drivers and that all settings in Xorg.conf are ok – there is a good post in the gentoo xeffects wiki. I also had a look at the nvidia-entry in the gentoo-wiki. Turned out that I had to add the Composite part in the extensions section.
I then added these entries to /etc/portage/package.keywords:
x11-libs/startup-notification ~x86
x11-apps/xlsclients ~x86
x11-apps/xvinfo ~x86
dev-python/pyrex ~x86
x11-wm/beryl-core ~x86
x11-misc/beryl-manager ~x86
x11-plugins/beryl-plugins ~x86
x11-misc/beryl-settings-bindings ~x86
x11-wm/aquamarine ~x86
x11-misc/beryl-settings ~x86
x11-wm/beryl ~x86

After emerging beryl, I made sure that my KDE settings were set according to the Beryl entry in the Gentoo wiki. Then, I started the beryl-manager and immediately made sure that it is set for good performance on nvidia as described in the mentioned nvidia entry on the Gentoo xeffects wiki.
I won’t configure beryl to autostart yet – just tweak around with the settings.
In the meantime, I have found out that java has some problems when being run on beryl; the workaround found on the forums is to add this line to .bashrc:
export AWT_TOOLKIT=MToolkit
With this being done, beryl is now working perfectly. It will be tested for a few days and then I’ll make the switch completely and permanent.

Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Technorati
  • MySpace
  • StumbleUpon

Head first is first!

19.02.07, 12:30 | Tags: | No comments

I already blogged about the HeadFirst / HeadRush series, edited by O’Reilly. And I already said that I can’t think of any better books to learn… whatever you want to learn.

As I currently have to learn Java for my studies, I decided to not rely on my study materials only, but to get a little bit more into it. So, I bought Head First Java, the book of which I think that started the whole Head First series. And – what can I say? It is once again a good example on how learning materials should be! I mean, the course materials for the particular course are not bad (after all, the OU has some experience with it, although the other course I am doing would probably serve as a bad example…); but what’s the fun about programming when the stuff you are developping is boring (like account objects) or silly (like dancing frogs)? In the Head First book, you program games and music servers, and this is just fun! You get working results in the first few chapters, and you never loose sight of the important stuff.
Again, as mentioned in my posts for the other books, you can learn with the books – they are not necessarily meant as reference; for Java, this is not really a problem, because the whole API is well-documented (yes, you learn that as well) and the language is simple enough…
Summary: If you want to learn Java, get this book – period. At least, as a starting point.

Share and Enjoy:
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Technorati
  • MySpace
  • StumbleUpon