2005-11-23

Macro in Ant

When you write an ant macro, the main problem is inabillity to define temporary property.
    <macrodef name="sample">
<sequential>
<java resultproperty="java.result">
</sequential>
</macrodef>
Property can be set only once, and later nobody can change its value. It is good behaviour,
elsewere we can run into troubles depends on order of target calls.

So, if we call the above macro second time, the value of ${java.result} stays unchanged.

But we can overcome this:
   <macrodef name="sample">
<attribute name="workDir">
<sequential>
<antcall target="internal.java">
<param name="dir" value="@{workDir}">
</antcall>
</sequential>
</macrodef>

<target name="internal.java">
<java dir="${dir}" resultproperty="java.result"/>
</target>
That macro can be called more than one time, and will be works correctly.

2005-11-14

Linux on the Notebook

I helped to a friend to configure fresh-installed Ubuntu Linux. It was long. I haven't seen such problem before. X server starts, no errors in log, but the screen stays blank.

It turned out that is the standard problem for ATI Radeon drivers. Before starting it is necessary to load chipset specific AGP module.

In our case it was intel-mch-agp.

2005-11-12

Linux: MIDI Setup

There is my translated forum message. Of corse it can be extended and improved, but in order just to not forget, i will leave it as is.

For happy owners of sound cards without midi support, there is only one way to get listen midi sound is to install timidity, the software midi emulator.

I want to write about my timidity setup expirience.
$> apt-get install timidity
$> sudo /etc/init.d/timidity start

I saw error, OK, I went to /etc/timidity, and saw that it contains only one line that includes missing file.

I don't remember its name, but just looking on it, helps me to understand that something called freepars is missing. I open synaptic and found that package with exactly same name are exists.
Cool!

Later i saw that even timidity package recomends freeparst to install.

$>apt-get install freepats

One more time:
$> sudo /etc/init.d/timidity start

And one more error.

Once, i don't remember details, but it was realy easy to understood that we need to load some kernel module responsible for midi. But i have to brutforce the what exactly midi module i need to load.

And than, in order to make this module load automatically on start, i wrote it in /etc/modules,

Thats all.