Showing posts with label misc. Show all posts
Showing posts with label misc. Show all posts

Friday, June 27, 2008

New ANTLR targets

Till now I used javacc (http://javacc.dev.java.net/), the Java Compiler Compiler, for creating my parsers.

Like I said earlier (http://shogi-software.blogspot.com/2008/01/tsume-shogi-parser-or-how-to-store-28k.html) I was hoping to try ANTLR out.

Today I read two interesting pieces of information:
  1. There is an IDE to develop and debug grammars, ANTLRWorks.
  2. New (3.1) ANTLR would support JavaScript and ActionScript as targets (platforms in which parsers generated by ANTLR can run).
It is certainly big motivation for me to check this tool out. First of all, ANTLRWorks will make designing and testing my Shogi grammars much easier and faster.
Secondly, new targets will allow creation of shogi games browsing/viewing software on these two very popular platforms: JavaScript and Flash/Flex.

I am going to give it a try very soon.

Tuesday, June 24, 2008

Visiting the Dark Side

I've been inactive (as a blogger) for quite a time now.

Due to some technical problems MyJavaServer.com didn't accept any new files. That made me search for alternative hosting site for my experiments.
I couldn't find anything similar to mjs but I googled http://www.vndv.com/ out. They give you free hosting for your PHP pages, MySQL databases, subdomains, ftp access, no advertisements, very decent user interface, tutorials. But no Java... Well, nobody's perfect :-)
I spent time on toying a little bit with PHP and client side technologies.

I'll show you my firs PHP page (http://fatboldcyclop.vndv.com/index.php):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>PHP Test</title>
</head>
<body>
  <?php phpinfo(); ?>
</body>
</html>

I am very proud of it :-). But seriously, I did some reading on PHP and I found it interesting. I decided to check it out later and take a closer look at client side web development with JavaScript and CSS first.
My first attempt was to write JavaScript Shogi Board Viewer. I'll describe the program on this blog later. Now I'll share with you my impressions on JavaScript (JS)-- it was basically my first real contact with the language.

First of all, I greatly underestimated the language. Now I think that it is a flexible, dynamic and powerful language. You can do many thing using small clever JS "tricks", but...

But developing in JS is for me a road trip through hell. I managed to get used to auto complete feature of Java IDEs. In Java, which is very strict, the tool can "easily" predict what the programmer can type (object properties and methods, etc.). With JavaScript it's not so easy -- it is dynamic, method and properties can be added on the fly, etc. But IDE is only small part of the problem.
The biggest pain was for me browser compatibility. I had a piece of code ruining smoothly on few browsers (i.e. FireFox 2 and 3, Opera, Safari) but IE somehow didn't like a line or two. Figuring out which line was the real challenge.

Debugging JS is so difficult. Thank God for FireBug. It saved me a lot of time and nerves, but it comes only with FireFox. Fortunately, Opera (9.5) and IE 8.0beta also have a "cheaper" version of the tool.

Another annoying thing about client side web development is CSS compliance. I tried to do simple things like having 2 text boxes next to each other. O what fun it is to make it work exactly the same in all the browsers. This one gives you an extra margin between two boxes, other resizes one box, etc. etc.
By the way, I fought with IE7.0 for correct placement of pieces on the board in my SFEN converter. I won the battle but I lost the war. After I finally forced IE7 to show it right, IE8 was released. And of course, the newer version of the browser has it's own way of positioning page elements.

Anyway, I'm glad I gave it a try. I learnt few things:
  • I lack the imagination to think how people did it before the FireFox came to life.
  • browsershots.org is a great tool to test your web design in different browsers.
  • Trying/learning different languages opens your eyes to new possibilities.
  • JavaScript is an interesting and powerful language but using it is not such fun at all.
  • If you want to show HTML code on your blog, you could use this tool to make it possible.
All in all it was a very educational experiment for me -- short walk on the dark side of the web development.

Sunday, January 27, 2008

Installing Oracle XE on openSUSE Linux

Despite what I have read on the net it was quite easy. I decided to put the information on the net in case I would have to repeat the procedure. And maybe someone else would need the information...

First I'll tell you what machine I use, then I'll show you what I did.

The machine

I use HP Compaq 6710b laptop, with 2G of RAM. Inside the machine is the Intel® Core™2 Duo T7300 2GHz processor.
There is Windows Vista preinstalled in it, but I decided to use OpenSuse (10.3) Linux as my development environment.

Installation procedure

You could summarize the whole process in 3 steps:
1. Obtaining the installation file.
2. Installing Oracle XE and required libraries.
3. Configuring Oracle instance.

In my case the procedure went as follows:
1. I downloaded Oracle XE for Linux x86 (http://www.oracle.com/technology/software/products/database/xe/htdocs/102xelinsoft.html). I chose oracle-xe-univ-10.2.0.1-1.0.i386.rpm.

2. Logged as the root I run the installer. Everything went smooth except for the database didn't run. I checked the installation guide (I know, I should have done it earlier :-) ) and it turned out that this Oracle distribution requires libgc and libaio libraries.

I ran software management program (/sbin/yast2 --install) that lets you see and modify software components installed on your openSUSE.
In my case the libraries where absent so I looked for them on openSUSE Build Service pages (http://software.opensuse.org/searchand), downloaded and installed them.

3. The final step, according to the manual was running the provided configuration script. So I did, as the root, ran

/etc/init.d/oracle-xe configure

I chose the default options when prompted and set up the password for sys and system users:
Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:y
Starting Oracle Net Listener...Done
Configuring Database...Done
Starting Oracle Database 10g Express Edition Instance...Done
Installation Completed Successfully.
To access the Database Home Page go to "http://127.0.0.1:8080/apex"
I tried to run the database's home page by running FireFox and entering http://127.0.0.1:8080/apex address.

Unfortunately I couldn't log in (I probably did something wrong but I am not sure what was it -- maybe just misspelled the password during log-in),
so I opened "Run SQL command line" and typed:
conn sys as sysdba ;
alter user system identified by ;
alter user sys identified by ;
After this maneuver I retried entering user/password and finally successfully logged into the database's home page.

Like I said, I am not sure if the last step (resetting the password) was necessary. When I have a chance to run the installation again I'll correct the information.

Have fun with Oracle on openSUSE!

Friday, January 25, 2008

New Shogi Tools banner




A friend of mine was so kind to make a banner for my Shogi Tools project.


I put the banner on the project's page. I also used it on www.myjavaserver.com/~fatboldcyclop/sfen_ggl.jsp.

Thanks Yummy!