FCKeditor - inline html editor

FCKeditor logo

Should you need provide inline html editor feature in your web application (WYSIWYG editor), have a look at FCKeditor.

FCKeditor is very useful and functional. Let me cite a couple of its features:

  • Integration with ASP, ASP.NET, Java, ColdFusion, Perl, PHP, JavaScript and more
  • Complete toolbar customization
  • Skins support
  • Plugins support
  • Multi-language support with automatic user language detection
  • Lightweight and fast
  • Font formatting: type, size, color, style, bold, italic, etc
  • Text formatting: alignment, indentation, bullets list, etc
  • Link and anchors support
  • Image insertion, with upload and server browsing support
  • Table creation and editing (add, delete rows, etc) - one of the best systems on the market
  • Right click context menus support

I believe it’s worth recommending.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Digg
  • Technorati
  • Reddit
  • StumbleUpon
  • DotNetKicks
  • Wykop
  • Gwar
  • e-mail

ASP.NET AJAX In Action

If you’re about to start playing with AJAX in ASP.NET it’s a good idea to read this book: ASP.NET AJAX In Action by Alessandro Gallo, David Barkol, Rama Krishna Vavilala (see on amazon).

It very well describes basics of AJAX and shows basic and more advanced techniques of applying it in ASP.NET. There are exaplanations of Microsoft Ajax Library, UpdatePanel, ASP.NET AJAX client components, bulding AJAX-enabled controls, and much, much more. All well written and supported with extensive examples.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Digg
  • Technorati
  • Reddit
  • StumbleUpon
  • DotNetKicks
  • Wykop
  • Gwar
  • e-mail

FOAF.Vix - the way to visualise your FOAF file

Icon for the FOAF (Friend of a Friend) project. The colors don't match exactly with the icon presented in the official site of the project.Image via Wikipedia

If you use Friend of a Friend (FOAF) files to describe your profile and want to provide it to the reader in a readable way FOAF.Vix is a perfect service. Let me cite the description created by its authors:

FOAF.Vix is a visualizer and relation explorer for FOAF (Friend of a Friend) files. Although this file format is designed first of all to be machine readable, it is often desirable to be able to browse it as if it were a usual Web page. FOAF.Vix gives you this possibility, presenting the data from a FOAF file in an easy to understand form and allowing to follow links to other Web resources it contains, including links to other FOAF pages, thereby allowing you to explore the network of human relations.

Of course I decided tp use that tool :) So have a look at my readable FOAF profile

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Digg
  • Technorati
  • Reddit
  • StumbleUpon
  • DotNetKicks
  • Wykop
  • Gwar
  • e-mail

Tricky example with polymorphism

Example

Can you predict the output of the following code?

class SubTest extends Test {
    public int aNumber;

    public SubTest() {
        aNumber = 17;
    }

    public void doubleANumber() {
        System.out.println("Inside SubTest.doubleANumber()");
        aNumber *= 2;
    }
}

public class Test {
    public int aNumber;

    public Test() {
        aNumber = 6;
    }

    public void doubleANumber() {
        System.out.println("Inside Test.doubleANumber()");
        aNumber *= 2;
    }

    public static void main(String[] args) {
        Test t = new SubTest();
        t.doubleANumber();
        System.out.println(”The value of aNumber is ” + t.aNumber);
    }
}

Result

The output is:
Inside SubTest.doubleANumber()
The value of aNumber is 6

As you see, it was not the reference type but the real object type of t variable that decided which method was invoked at runtime. This way, aNumber of SubTest class was modified. This variable shadowed aNumber of Test class. Therefore, Test.aNumber variable was untouched (didn’t change at all).

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Digg
  • Technorati
  • Reddit
  • StumbleUpon
  • DotNetKicks
  • Wykop
  • Gwar
  • e-mail

Threds: multiple call to run() method

You can call run() method of a thread many times. However, not a single new thread will be started. This way JVM will only execute the code from run() method. And this will not probably be what you tried to achieve.

Remember: to start a new thread, you need to call start() method, which among others, will execute run() method in a new concurrent context.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Digg
  • Technorati
  • Reddit
  • StumbleUpon
  • DotNetKicks
  • Wykop
  • Gwar
  • e-mail

java.util.IllegalFormatConversionException when using System.out.format()

A few weeks ago I described how to format output using System.out.printl() and System.out.println() methods

Try to run the code below:

double avgAge = 245 / 34;
System.out.format("Average age is %d.", avgAge);

Without doubts you’ll get an exception thrown at runtime:

Average age is Exception in thread "main"
java.util.IllegalFormatConversionException:
d != java.lang.Double
    at java.util.Formatter$FormatSpecifier.failConversion(Unknown Source)
    at java.util.Formatter$FormatSpecifier.printInteger(Unknown Source)
    at java.util.Formatter$FormatSpecifier.print(Unknown Source)
    at java.util.Formatter.format(Unknown Source)
    at java.io.PrintStream.format(Unknown Source)

The reason is becase wrong conversion label was used. To recall, conversion label is ‘%’ sign followed by a letter b, c, d, f, or s inside System.out.format().

In the above example, %d meant that an integral type (byte, Byte, short, Short, int, Integer, long, Long, BigInteger) would be used. However, finally there was a floating point passed (avgAge). This example would work if this conversion label were used: %f.

So, remember to be careful with conversion label!

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Digg
  • Technorati
  • Reddit
  • StumbleUpon
  • DotNetKicks
  • Wykop
  • Gwar
  • e-mail

How to close the dialog in IVR application

As you might have deduced from my CV, I have some experience in designing and developing IVR applications.

Basically, they must be attractive to the callee so the usage is convenient and intuitive. Going forward, the callee should get the impression like they are talking with a human being, not an application, which is not that easy :)

Recently, I’ve come across an interesting series of posts on The VUI Post weblog suggesting how a dialog should be closed. So far there are 16 pieces of advice, perhaps new ones will appear (will track it).

Here are the links:

If you’re interested in IVR apps, I recommend reading that!

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Digg
  • Technorati
  • Reddit
  • StumbleUpon
  • DotNetKicks
  • Wykop
  • Gwar
  • e-mail

What happens if concate String value and int?

Can you predict the output/result of the following code?


String s = "A String ";
s += 12345;
System.out.print(s);

The answer is: “A String 12345“.

The reason for that is described in the desciption of String class in Java 2 Platform SE 5.0 API:

The Java language provides special support for the string concatenation operator ( + ), and for conversion of other objects to strings. String concatenation is implemented through the StringBuilder(or StringBuffer) class and its append method. String conversions are implemented through the method toString, defined by Object and inherited by all classes in Java.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Digg
  • Technorati
  • Reddit
  • StumbleUpon
  • DotNetKicks
  • Wykop
  • Gwar
  • e-mail

Unreachable catch block

Always contruct try-catch blocks in a way that assumes catching Exceptions from more detailed to more generic.

Example


try {
    String [] tab = null;
    System.out.println(tab[3]);
} catch (Exception e) {
    System.out.println(”Exception”);
} catch (NullPointerException e) {
    System.out.println(”NullPointerException”);
}

The above presented snippet will cause compilation error:

Unreachable catch block for NullPointerException. It is already handled by the catch block for Exception

Solution


try {
    String [] tab = null;
    System.out.println(tab[3]);
} catch (NullPointerException e) {
    System.out.println(”NullPointerException”);
} catch (Exception e) {
    System.out.println(”Exception”);
}

This way, if you invoke this snippet you’ll get the following output on the screen: “NullPointerException”.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Digg
  • Technorati
  • Reddit
  • StumbleUpon
  • DotNetKicks
  • Wykop
  • Gwar
  • e-mail

AJAX Control Toolkit - Could not load file or assembly vjslib

I wanted to play around with ASP.NET AJAX Control Toolkit. There are a few steps to do before you can start using this tool. Among others, you need to build the Visual Studio Solution provided in the downloaded zip file.

When I tried to build the solution I got this error:

Error 1 Could not load file or assembly ‘vjslib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified. C:\Program Files\Microsoft ASP.NET\Ajax Control Toolkit\TemplateVSI\TemplateVSI.csproj 60 5 TemplateVSI

Solution

This is what AJAX Control Toolkit documentation says:

The TemplateVSI project has a dependency on vjslib.dll which is a part of the Visual J# Redistributable…

The above mentioned package can be found there. Installing it solved this problem, at least on my computer.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Digg
  • Technorati
  • Reddit
  • StumbleUpon
  • DotNetKicks
  • Wykop
  • Gwar
  • e-mail