Wednesday 31 January 2007

Easy rounded corners on web pages (Web 2.0 style)

Recently I had to do a website and I though I would use web2.0 based rounded corners and colors and fonts.

One of the best resources to do rounded corners without images and just using css and javascript is this one I found called NiftyCorners. It is quite cool and easy to use.

Web 2.0 Colors
Well, if you are a photoshop user, then you have to discover this little gem. Miles here has grabbed 70 colors and crammed them into a Photoshop color pallette. Here is his blog and the pallette.

Web 2.0 Fonts
The most common fonts in the Web 2.0 space. Notice the rounded theme at most places.

Web 2.0 Icons and buttons
This is strictly not Web 2.0, but then no-one took the trouble to define what was Web 2.0 anyway. Most of the commentrators and bloggers have made up the standards for Web 2.0. The true inspiration for some of these Icons and buttons come from Apple's Aqua interface from OS X.

If you are a Photoshop user, then here are some links to tutorials on how to create these icons or buttons. Link 1, Link 2 (a badge), Link 3

If you are a GIMP user, see my post about how to do this using GIMP.


References
See a collection of Web 2.0 logos here.

Friday 19 January 2007

List of Java Profilers

Here is a compliation list of Java Profilers and debugging aids for memory and code profiling.


Netbeans Profiler
NetBeans Profiler is a project to provide a full-featured profiling functionality for the NetBeans IDE. The profiling functions include CPU, memory and threads profiling as well as basic JVM monitoring, allowing developers to be more productive in solving memory or performance-related issues.
Link to Netbeans profiler


InfraRED
InfraRED is a tool for monitoring performance of a J2EE application and diagnosing performance problems. It collects metrics about various aspects of an application's performance and makes it available for quantitative analysis of the application.

InfraRED has the ability to monitor the complex architecture of J2EE application environments, provide detailed information for analysis and reporting, alert on performance related problems and guide you to determine the root cause of the problem. When you are trying to identify a performance issue that is causing your production application not meet customer expectations or you are trying to proactively identify issues prior to deploying your application, InfraRED is essential to helping you save time, and ultimately ensure a better performing, more scalable Java application.

InfraRED uses AOP to weave the performance monitoring code into the application. It comes with out of the box support for AspectJ and Aspectwerkz. It can also be made to work with other AOP frameworks such as JBoss AOP etc.

Link to InfraRED


JIP - Java Interactive Profiler
JIP is a high performance, low overhead profiler that is written entirely in Java. JIP gives the developer the ability to turn the profiler on and off while the VM is running. You can also filter out classes and packages as well as control the output.
Link to JIP


JMP - Java Memory Profiler
JMP is a profiler for java that can be used to trace objects usage and method timings. JMP uses the JVMPI interface to gather statistics and interact with the JVM. JMP uses a GTK+ interface to show the status.
Link to JMP


YourKit
YourKit, LLC is a new technology leader, creator of the most innovative and intelligent tool for profiling Java applications. The YourKit Java Profiler has been already recognized by the IT professionals and analysts as the best profiling tool for Java.
With YourKit Java Profiler, both CPU and memory profiling have come to the highest professional level, where one can profile even huge applications with maximum productivity and zero overhead.
Link to YourKit web site


JProfiler
JProfiler is an award-winning all-in-one Java profiler. JProfiler's intuitive GUI helps you find performance bottlenecks, pin down memory leaks and resolve threading issues.
Link to JProfiler


Optimizeit
Optimizeit was one of the best of breed commercial profilers along with yourkit. They have now been taken over by Borland.
Link to Optimizeit (from Borland now)


P6Spy
P6Spy is an open source framework for applications that intercept and optionally modify database statements. One of the best profilers that can debug, instrument your database calls without any code changes. It does this by providing a pseudo-JDBC driver that passes calls on to the real one.
Link to P6Spy


JRat
JRat is the Java Runtime Analysis Toolkit. Its purpose is to enable developers to better understand the runtime behavior of their Java programs. The term "behavior" includes, but is not limited to performance profiling.
  • accumulate timing statistics (a few ways)
  • create trace logging
  • track rate methods are called over time
  • track the response time of methods over time
  • Link to JRat


    Eclipse TPTP
    The Eclipse Test & Performance Tools Platform (TPTP) Project is an open source Top Level Project of the Eclipse Foundation.
    Link to Eclipse TPTP


    Troubleshooting tools in JDK 6 (Mustang)
    The following tools can be used for specific troubleshooting tasks. The tools described in this section are unsupported and experimental in nature and should be used with that in mind. They may not be available in future JDK versions.
    Link to these tools

    Java Profilers

    I had to do some research and pick a Java profiler to use recently. Being open minded instead of using what I knew and the one that is built-in to my favorite IDE, Eclipse, I did some research. But, the task at hand was easily accomplished using hprof and jconsole. Here are some useful links to profilers that I have used in the past.

    Using hprof
    HPROF - A Heap/CPU profiling tool

    In the past I have found the profiler that is included in Netbeans very useful. Inspite of Eclipse being my IDE of choice, I have had this weird combination of using Eclipse to write my code and to run it, and then hook it up with the Netbeans profiler.

    Using jconsole
    If you are using JDK 5, then use the built-in jconsole utility to provide some valuable insight into what the JVM is doing. All you need to do is to start the JVM with this argument -Dcom.sun.management.jmxremote.

    Thus, if you are debugging a java program, use this as part of your command line or if you are debugging your application server's web instance, pass this via your application server to your JVM.
    Then just execute jconsole from your JDK/bin directory to connect to the running instance and view.

    Monday 15 January 2007

    Linux - Dual Monitors with ATI Radeon on IBM T42

    My recent experience with a dual monitor setup with Fedora Core 6 on an IBM T42 laptop with the ATI Mobility Radeon chip. I really liked the nice 3D and floating effects of compiz and beryl that comes stock standard with FC6 on the laptop screen.
    Alas, after a lot of teeth gnashing and debug, the effects don't seem to extend properly to a dual monitor setup. My dual montior setup was more special as it had different resolutions. The laptop screen at 1400x1050 and the external Samsung monitor at 1440x900 (widescreen).

    After a lot of experiementation, I discovered that using the latest ATI drivers (the fglrx ones) off the ATI website or using the Livinia repository gave the best display across the dual monitors as separate desktops, and not an extended desktop. Alas, with this option, the 3D desktop goes away, as the ATI drivers do not support the AIGLX extensions.

    Thus, now I have two xorg.conf's setup on my laptop. One is for a single monitor setup (using the Xorg's radeon driver) and the other for a dual monitor setup (using the ATI driver from Livinia repository).

    Some good links I used to experiment with.
    http://forums.fedoraforum.org/showthread.php?t=121119

    http://ozlabs.org/~jk/docs/mergefb/

    http://dri.freedesktop.org/wiki/MergedFB

    Single-Head xorg.conf with radeon drivers
    Section "ServerLayout"
    Identifier "single head configuration"

    Screen 0 "Screen0" 0 0
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "Synaptics" "CorePointer"
    EndSection

    Section "Module"
    Load "dri"
    Load "glx"
    SubSection "extmod"
    Option "omit xfree86-dga"
    EndSubSection
    EndSection

    Section "InputDevice"
    Identifier "Keyboard0"
    Driver "kbd"
    Option "XkbModel" "pc105"
    Option "XkbLayout" "us"
    EndSection

    Section "InputDevice"
    Identifier "Synaptics"
    Driver "synaptics"
    Option "Device" "/dev/input/mice"
    Option "Protocol" "auto-dev"
    Option "Emulate3Buttons" "yes"
    EndSection

    Section "Monitor"

    ### Comment all HorizSync and VertSync values to use DDC:
    Identifier "Monitor0"
    ModelName "LCD Panel 1400x1050"
    ### Comment all HorizSync and VertSync values to use DDC:
    HorizSync 31.5 - 90.0
    VertRefresh 59.0 - 75.0
    Option "dpms"
    EndSection

    Section "Device"
    Identifier "Videocard0"
    Driver "radeon"
    EndSection

    Section "Screen"
    Identifier "Screen0"
    Device "Videocard0"
    Monitor "Monitor0"
    DefaultDepth 24
    Option "AddARGBGLXVisuals" "True"
    Option "DisableGLXRootClipping" "True"
    SubSection "Display"
    Viewport 0 0
    Depth 24
    Modes "1400x1050" "1280x1024" "1280x960" "1280x800" "1152x864" "1152x768" "1024x768" "800x600" "640x480"
    EndSubSection
    EndSection

    Section "DRI"
    Group 0
    Mode 0666
    EndSection


    Dual-head xorg.conf with ATI fglrx drivers
    Section "ServerLayout"
    Identifier "Multihead layout"
    Screen 0 "Screen0" LeftOf "Screen1"
    Screen 1 "Screen1" 0 0
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "Synaptics" "CorePointer"
    Option "Xinerama" "on"
    Option "Clone" "off"
    EndSection

    Section "Module"
    Load "dri"
    Load "glx"
    SubSection "extmod"
    Option "omit xfree86-dga"
    EndSubSection
    EndSection

    Section "InputDevice"
    Identifier "Keyboard0"
    Driver "kbd"
    Option "XkbModel" "pc105"
    Option "XkbLayout" "us"
    EndSection

    Section "InputDevice"
    Identifier "Synaptics"
    Driver "synaptics"
    Option "Device" "/dev/input/mice"
    Option "Protocol" "auto-dev"
    Option "Emulate3Buttons" "yes"
    EndSection

    Section "Monitor"

    ### Comment all HorizSync and VertSync values to use DDC:
    ### Comment all HorizSync and VertSync values to use DDC:
    Identifier "Monitor0"
    ModelName "LCD Panel 1400x1050"
    ### Comment all HorizSync and VertSync values to use DDC:
    HorizSync 31.5 - 90.0
    VertRefresh 59.0 - 75.0
    Option "dpms"
    EndSection

    Section "Monitor"
    Identifier "Monitor1"
    VendorName "Monitor Vendor"
    ModelName "LCD Panel 1440x900"
    ### Comment all HorizSync and VertSync values to use DDC:
    HorizSync 31.5 - 100.0
    VertRefresh 59.0 - 75.0
    Option "dpms"
    EndSection

    Section "Device"
    Identifier "Videocard0"
    Driver "radeon"
    EndSection

    Section "Device"
    Identifier "Videocard1"
    Driver "radeon"
    VendorName "Videocard Vendor"
    BoardName "ATI Technologies Inc RV350 [Mobility Radeon 9600 M10]"
    BusID "PCI:1:0:0"
    Screen 1
    EndSection

    Section "Screen"
    Identifier "Screen0"
    Device "Videocard0"
    Monitor "Monitor0"
    DefaultDepth 24
    Option "AddARGBGLXVisuals" "True"
    Option "DisableGLXRootClipping" "True"
    SubSection "Display"
    Viewport 0 0
    Depth 24
    Modes "1400x1050" "1280x1024" "1280x960" "1280x800" "1152x864" "1024x768" "800x600" "640x480"
    EndSubSection
    EndSection

    Section "Screen"
    Identifier "Screen1"
    Device "Videocard1"
    Monitor "Monitor1"
    DefaultDepth 24
    SubSection "Display"
    Viewport 0 0
    Depth 24
    Modes "1440x900"
    EndSubSection
    EndSection

    Section "DRI"
    Group 0
    Mode 0666
    EndSection

    Using GIMP to create web graphics

    I recently had to do a couple of web sites for friends and family and after doing hardcore programming, coming back to basic html and graphics was a shock. But, Google helped ! I use GIMP, the open source Image Manipulation Program . Searching through the Internet, I found these excellent tutorials to create Web 2.0 graphics and images.

    Using Gimp to make Web 2.0 Buttons and Graphics

    Creating Badges/Violators using Gimp

    The above two links are excellent and many thanks to Binny !