Recent Articles

Free Ebook: JavaTroubleshooting Guide for HP-UX Systems »

The information in this document will help application developers and support engineers debug their Java applications on HP-UX systems.

Download Link:

http://docs.hp.com/en/5992-1918/5992-1918.pdf

Popularity: 2% [?]

Free Ebook: How To Think Like A Computer Scientist Learning with C++ »

This is a good book for reading even though you are not a C++ programmer.

Link:

http://www.oopweb.com/CPP/Documents/ThinkCScpp/VolumeFrames.html

Popularity: 1% [?]

Apache Chainsaw: A Log4j Graphical Log Viewer »

Chainsaw v2 is a companion application to Log4j written by members of the Log4j development community.

It’s a GUI-based Log viewer. Rather than rely on a combination of tail/grep/vi or equivalent to view/query/trace-through a huge trail of logging events, you can use Chainsaw. Chainsaw can read log files formatted in Log4j’s XMLLayout, receive events from remote locations, read events from a DB, it can even work with the JDK 1.4 logging events.

chainsaw-1

Popularity: 2% [?]

Lua: A Powerful Scripting Language »

Lua is a powerful, fast, light-weight, embeddable scripting language.

Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.

Lua is a proven, robust language

Lua has been used in many industrial applications (e.g., Adobe’s Photoshop Lightroom), with an emphasis on embedded systems and games (e.g., World of Warcraft). Lua is currently the leading scripting language in games. Lua has a solid reference manual and there are several books about it. Several versions of Lua have been released and used in real applications since its creation in 1993. Lua featured in HOPL III, the Third ACM SIGPLAN History of Programming Languages Conference, in June 2007.

Lua is fast

Lua has a deserved reputation for performance. To claim to be “as fast as Lua” is an aspiration of other scripting languages. Several benchmarks show Lua as the fastest language in the realm of interpreted scripting languages. Lua is fast not only in fine-tuned benchmark programs, but in real life too. A substantial fraction of large applications have been written in Lua.

Lua is portable

Lua is distributed in a small package and builds out-of-the-box in all platforms that have an ANSI/ISO C compiler. Lua runs on all flavors of Unix and Windows, and also on mobile devices (such as handheld computers and cell phones that use BREW, Symbian, Pocket PC, etc.) and embedded microprocessors (such as ARM and Rabbit) for applications like Lego MindStorms.

Lua is embeddable

Lua is a fast language engine with small footprint that you can embed easily into your application. Lua has a simple and well documented API that allows strong integration with code written in other languages. It is easy to extend Lua with libraries written in other languages. It is also easy to extend programs written in other languages with Lua. Lua has been used to extend programs written not only in C and C++, but also in Java, C#, Smalltalk, Fortran, Ada, and even in other scripting languages, such as Perl and Ruby.

Lua is powerful (but simple)

A fundamental concept in the design of Lua is to provide meta-mechanisms for implementing features, instead of providing a host of features directly in the language. For example, although Lua is not a pure object-oriented language, it does provide meta-mechanisms for implementing classes and inheritance. Lua’s meta-mechanisms bring an economy of concepts and keep the language small, while allowing the semantics to be extended in unconventional ways.

Lua is small

Adding Lua to an application does not bloat it. The tarball for Lua 5.1.4, which contains source code, documentation, and examples, takes 212K compressed and 860K uncompressed. The source contains around 17000 lines of C. Under Linux, the Lua interpreter built with all standard Lua libraries takes 153K and the Lua library takes 203K.

Lua is free

Lua is free software, distributed under a very liberal license (the well-known MIT license). It can be used for any purpose, including commercial purposes, at absolutely no cost. Justdownload it and use it.

For specific reasons why Lua is a good choice also for constrained devices like cell phones, read this summary by Mike Pall.

Popularity: 20% [?]

Cleaning Malicious Software »

Here are some tips for cleaning malicious software

Always Do Windows Update

Always apply the latest Service Pack

Download and Install CCleaner

CCleaner is a freeware system optimization, privacy and cleaning tool. It removes unused files from your system – allowing Windows to run faster and freeing up valuable hard disk space.

Download Free Version of SuperAntiSpyware

Download and install the free version of SuperAntiSpyware

Download and Install ComboFix

You can get it from

http://download.bleepingcomputer.com/sUBs/ComboFix.ex
http://subs.geekstogo.com/ComboFix.exe
http://download.bleepingcomputer.com/sUBs/Beta/ComboFix.exe
http://subs.geekstogo.com/Beta/ComboFix.exe

Download Trend Micro™ HijackThis

Download and install HijackThis.

Popularity: 1% [?]

Java: Troubleshooting Memory Problem »

The -XX:+HeapDump option can be used to observe memory allocation in a running Java application by taking snapshots of the heap over time. Another way to get heap dumps is to use the _JAVA_HEAPDUMP environment variable; setting this environment variable allows memory snapshots to be taken without making any modifications to the Java command line. In order to enable this functionality, either use the command-line option or set the environment variable (for example, export _JAVA_HEAPDUMP=1) before starting the Java application.

The output is similar to that produced by the -Xrunhprof:heap=dump option except that the thread and trace information is not printed to the output file.

With the -XX:+HeapDump option enabled, each time the process is sent a SIGQUIT signal, the Java VM produces a snapshot of the Java heap in hprof ASCII format. The name of the file has the following format: java_<pid>_<date>_<time>_heapDump.hprof.txt.

If _JAVA_HEAPDUMP_ONLY is set, then heap dumps are triggered by SIGVTALRM instead of SIGQUIT for this option. Only the heap dump is produced; that is, the thread and trace dump of the application to stdout is suppressed. Setting the _JAVA_BINARY_HEAPDUMP environment variable along with _JAVA_HEAPDUMP_ONLY produces a binary format heap dump when the SIGVTALRM is sent to the process instead of an ASCII one.

In addition to -XX:+HeapDump, there are three other HeapDump options available: -XX:+HeapDumpOnCtrlBreak , -XX:+HeapDumpOnOutOfMemoryError, and -XX:+HeapDumpOnly.

-XX:+HeapDumpOnCtrlBreak

The -XX:+HeapDumpOnCtrlBreak option is available beginning with SDK 1.4.2.11 and JDK 1.5.0.05. It enables the ability to take snapshots of the Java heap when a SIGQUIT signal is sent to the Java process without using the JVMTI-based -Xrunhprof:heap=dumpoption. This option is similar to -XX:+HeapDump except the output format is in binary hprof format and the output is placed into a filename with the following naming convention: java_<pid>.hprof.<millitime>.

If the environment variable _JAVA_HEAPDUMP is set and this option is specified, then both hprof ASCII and binary dump files are created when a SIGQUIT is sent to the process. For example, the following file names are created: java_27298.hprof.1152743593943 andjava_27298_060712_153313_heapDump.hprof.txt.

If JAVA_BINARY_HEAPDUMP is set and the -Xrunhprof:heap=dump command is given, then both hprof ASCII and binary files are produced for this option.

 


-XX:+HeapDumpOnOutOfMemoryError

The-XX:+HeapDumpOnOutOfMemoryError option is available beginning with SDK 1.4.2.11 and JDK 1.5.0.04. This option enables dumping of the Java heap when an “Out Of Memory” error condition occurs in the Java VM. The heap dump file name defaults tojava_pid<pid>.hprof in the current working directory. The option -XX:HeapDumpPath=file may be used to specify the heap dump file name or a directory where the heap dump file should be created. The only heap dump format generated by the -XX:+HeapDumpOnOutOfMemoryError option is the hprof binary format.

One known issue exists: the-XX:+HeapDumpOnOutOfMemoryError option does not work with the low-pause collector (option -XX:+UseConcMarkSweepGC).

 


-XX:+HeapDumpOnly

Starting with SDK 1.4.2.11 and JDK 1.5.0.05, the -XX:+HeapDumpOnly option or the _JAVA_HEAPDUMP_ONLY environment variable can be used to enable heap dumps using the SIGVTALRM signal (signal 20). This interface is provided to separate the generation of thread and trace information triggered via SIGQUIT from the heap dump information. If the-XX:+HeapDumpOnly option is specified or the_JAVA_HEAPDUMP_ONLY environment variable is set, then the heap dump functionality is triggered by sending SIGVTALRM to the process. The printing of thread and trace information to stdout is suppressed.

The heap dump is written to a file with the following filename format: java_<pid>_<date>_<time>_heapDump.hprof.txt.

The default output format is ASCII. The output format can be changed to hprof binary format by setting the _JAVA_BINARY_HEAPDUMPenvironment variable. This environment variable can also be used with the -XX:+HeapDump option to generate hprof binary format with the SIGQUIT signal.


Using Heap Dumps to Monitor Memory Usage

By creating a series of heap dump snapshots, you can see how the number and size of objects varies over time. It is a good idea to collect at least three snapshots. The first one serves as a baseline. It should be taken after the application has finished initializing and has been running for a short time. The second snapshot should be taken after the residual heap size has grown significantly. Try to take the last snapshot just before the heap has grown to a point where it causes problems resulting in the application spending the majority of its time doing full GCs. If you take other snapshots, spread them out evenly based on residual heap size throughout the running of the application.

Popularity: 2% [?]

Java for .NET »

Ja.NET is an open source project focused on enabling Java-based software on .NET

Popularity: 1% [?]

Apache Click »

Apache Click is a modern JEE web application framework, providing a natural rich client style programming model. Click is designed to be very easy to learn and use, with developers getting up and running within a day.

  • Very easy to learn
  • Component and Page Oriented design
  • Event base programming model
  • Very high performance
  • Automatic form rendering and client/server side validation
  • Supports Velocity, JSP or FreeMarker page rendering
  • Free Open Source with commercial friendly Apache License
  • Supports JDK 1.4 and later

Popularity: 1% [?]

Open Source ASP.NET Blogging Engine »

Oxite is simple blog engine written using ASP.NET MVC, and is designed with two main goals:

  1. To provide a sample of ‘core blog functionality’ in a reusable fashion. Blogs are simple and well understood by many developers, but the set of basic functions that a blog needs to implement (trackbacks, rss, comments, etc.) are fairly complex. Hopefully this code helps.
  2. To provide a real-world sample written using ASP.NET MVC.

image

Popularity: 1% [?]

A Multiplatform Programming Language »

haXe (pronounced as hex) is an open source programming language.

While most of the other languages are bound to their own platform (Java to the JVM, C# to .Net, ActionScript to the Flash Player), haXe is a multiplatform language.

It means that you can use haXe to target the following platforms :

  • Javascript : You can compile a haXe program to a single .js file. You can access the typed browser DOM APIs with autocompletion support, and all the dependencies are resolved at compilation time.
  • Flash : You can compile a haXe program to a .swf file. haXe can compile for Flash Players 6 to 10, with either “old” Flash<8 API or newest AS3/Flash9+ API. haXe offers very goodperformance and language features to develop Flash content.
  • PHP : You can compile a haXe program to .php files. This enable you to use a high level strictly-typed language such as haXe while keeping full compatibility with your existing server platform and libraries.
  • NekoVM : You can compile a haXe program to NekoVM bytecode. This can be used for server-side programming such as dynamic webpages (using mod_neko for Apache) and also forcommandline or desktop applications, since the NekoVM can be embedded and extended with some other DLL.
  • C++ : Currently in testing, with the right build of haXe from Hugh Sanderson, you can now output your haXe applications to pure C++ source code, complete with makefiles.

The idea behind haXe is to let the developer choose the best platform to do a given job. In general, this is not easy to do because every new platform comes with its own programming language. What haXe provides to you is :

  • a standardized language with many good features
  • a standard library (including Date, Xml, Math…) that works the same on all platforms
  • platform-specific libraries : the full APIs for a given platform are accessible from haXe

Popularity: 1% [?]

Java: Develop Rich Client Application using UIDL and Applino »

The UIDL (User Interface Description Language) project was created through the realisation that the browser model was very good for application deployment but that HTML was not suitable for complex applications, resulting in low developer productivity and a poor end user experience. The project proposes that the browser needs to be extended to support an alternative syntax aimed specifically at user interfaces rather than layering complex technologies on top of HTML.

The main features of a UIDL page are the ability to create complex user interfaces (using Swing based widgets) and to communicate asynchronously with server based objects (using the JSON-RPC protocol).

Whilst this may sound similar to AJAX, the implementation is much cleaner thanks to the ability to natively instantiate complex UI components within the browser and the ability to transparently present server based objects via their JavaScript proxies.

The Applino project was designed to allow multiple Java applications to be run within a single JVM (Java Virtual Machine) thereby reducing resource consumption and significantly reducing start up delay.

  • An applino is to the desktop what a servlet is to the server.
  • Applino provides and environment for running multiple Java desktop applications within a single JVM.
  • The Applino environment runs as a taskbar icon and starts when the user logs into their computer.
  • Applini (Applino applications) are similar to servlets in that they contain runtime descriptors and have their life cycles dictated by the Applino container.

Popularity: 1% [?]

Multiple Purpose Windows Launcher »

Executor is a multi purpose launcher and more advanced and customizable freeware windows run replacement.

image

  • Keywords have properties like shortcuts, and you can for example drag-drop a shortcut/file/folder/favorite to add it as a keyword.
  • Auto-completion for keywords, file system and history (can also be configured).
  • Url detection, Enter URLs directly (like www.google.com, mail.google.com, google.com or http://www.google.com).
  • Keywords support parameters. Example “google latest executor” “wiki nirvana”.
  • Besides keywords Executor can also optionally and dynamically add matching start-menu items, control panel items and other handy items to the drop-down/list.
  • Ability to add your own paths to scan for user defined file extensions.
  • Keyword “find [text]” for using Windows Instant Search (Vista) feature or Windows Desktop Search (WDS for XP etc.).
  • Can add keyword integration with popular services like GMail, Twitter, GCal, RTM and many others (see forums for howto’s, tutorials and tips).
  • Optional show icon for current keyword/input.
  • Optional show drop-down box for current keyword/input (auto-completion).
  • Optional drop-down box can be set to auto-open (like windows run) displaying auto-completion suggestions.
  • Optional Vista like list displaying matching items.
  • Layout can be customized. Set colors, font, dimensions, position, transparency and more.
  • Skinable. Supporting alpha blending effects and free positioning of all elements.
  • Each keyword can be assigned a hotkey, so Executor can also perform like many popular hotkey managers.
  • Many settings to customize the program as you like.
  • Can be launched from an user defined hotkey.
  • One keyword or text input can start multiple keywords/urls/programs/documents/files etc. Example one keyword opens three websites and/or programs.
  • Each keyword have properties like optional group (to organize into groups), customizable icon and other properties.
  • A number of special commands (like for example pause and replace tag with parameter).
  • Optional windows context-menu integration (as another way of easily adding new keywords).
  • Optional show title for the current input.
  • Can import keywords from windows start-menu.
  • All file-paths can be auto-completed (also when file-path is a parameter).
  • Keywords to manipulate the current active window (center, resize to specific size, maximize width or height etc).
  • Special keywords to list (and open) running applications, text previously copied to clipboard and recent documents.
  • Many special keywords like for example lock computer, restart, shutdown, standby, turn off monitor, mute sound, show date/time/week number etc.
  • Shortcut keys for faster navigation.
  • Integrated calculator.
  • Import/Export keywords.
  • Option to override windows run hotkey (Win-R).
  • Optional sounds.
  • Integrated Windows context-menu (for example when right-clicking list items).
  • At startup a number of keywords/commands optionally be launched.
  • Several hidden experimental/minor settings to play with (Example show time/date/other stuff when idle).

Popularity: 2% [?]

Open Source Web Service Framework for C »

WSO2 Web Services Framework for C (WSO2 WSF/C) is a standards compliant, enterprise grade, open source, C library for providing and consuming Web services in C. WSO2 WSF/C is a complete solution for building and deploying Web services, and is the C library with the widest range of WS-* specification implementations, including MTOM, WS-Addressing, WS-Policy, WS-Security, WS-SecurityPolicy, WS-Reliable Messaging and WS-eventing. It provides the best interoperability- all the Web services specification implementations are tested for interoperability with Microsoft .NET, WSO2 WSAS and other J2EE implementations.

WSO2 WSF/C is released with Apache License V2.0, and is based on the family ofApache open source projects, including Apache Axis2/C, Apache Rampart/C,Apache Sandesha2/C and Apache Savan/C. The key advantage of using WSO2 WSF/C is that it seamlessly integrates the multiple Apache Axis2/C projects together, which is tested and ready to be used. It also comes with additional features such as XMPP transport and a command line tool for consuming Web services, named wsclient.

WSO2 WSF/C provides the basic framework on which other scripting language bindings such as PHP, AJAX, Perl, Python and Ruby could be built, for providing and consuming Web services in those respective scripting languages. It can also be easily embedded in other software systems where full Web services stack support is required.

Popularity: 2% [?]

Good Read: Developing a Mobile Web Portal »

Here are some reading on how MIT develop the MIT Mobile Web.

MIT Vision for Mobility

Developing the MIT Mobile Web

Popularity: 2% [?]

Detect Wireless Devices using Wireless Universal Resource File »

The WURFL is an “ambitious” configuration file that contains info about all known Wireless devices on earth. Of course, new devices are created and released at all times. While this configuration file is bound to be out of date one day after each update, chances are that the WURFL lists all of the WAP devices you can purchase in the nearest shops.

Interesting fact quoted from the website,

The WURFL is based on the concept of family of devices. All devices are descendent of a generic device, but they may also descend of more specialized families. A device which identifies itself as (user-agent) “SAMSUNG-SGH-T100/1.0 UP.Browser/5 (GUI)” is an implementation of the GUI browser by Openwave and, of course, also a descendent of the generic browser. As a consequence, as soon as such a device is released (or, we should say, as soon as someone detects its user agent hitting a site), we can safely add it to the WURFL and state that it is a descendent of the “upgui_generic” family.
This will let that phone inherit all of the capabilities of the family of the Openwave GUI browser even before that device is actually tested by anyone.
This mechanism, called ‘fall_back’, lets programmers derive the capabilities of a given phone by looking at the capabilities of its family, unless a certain feature is specifically different for that phone.
To further clarify, here is a concrete example. Nokia shipped several subversion of the 7110 model. Some of those did not support WML tables. Some did. The WURFL models this knowledge elegantly thanks to the fall_back mechanism.
First, the generic family specifies a capability called “table_support”:

<device fall_back="root" id="generic" user_agent="">
 <group id="ui">
    :
   <capability name="table_support" value="true" />
 </group>

you can read this as “Generic WAP devices support WML tables”
As a WURFL default, Nokia phones support tables because of fall_back on generic. This is modelled here:

<device user_agent="Nokia" fall_back="generic" id="nokia_generic">
 <group id="ui">
  <capability
      name="break_list_of_links_with_br_element_recommended"
      value="false" />
 </group>
</device>

When it comes to table support, the line above implies that for a generic Nokia device the same value as generic should be used.
Two interesting device families follow:

 <device user_agent="Nokia7110/1.0 (04"
         fall_back="nokia_generic"
         id="nokia_7110_ver1">
    :
 <group id="ui">
      :
   <capability name="table_support" value="false" />
 </group>
 </device>
 <device user_agent="Nokia7110/1.0 (04.67)"
         fall_back="nokia_7110_ver1"
         id="nokia_7110_ver1_sub467" />
 <device user_agent="Nokia7110/1.0 (04.69)"
         fall_back="nokia_7110_ver1"
         id="nokia_7110_ver1_sub469" />
   :
 <device user_agent="Nokia7110/1.0 (04.94)"
         fall_back="nokia_7110_ver1"
         id="nokia_7110_ver1_sub494" /> 

<!--  7110 new-age   -->
 <device user_agent="Nokia7110/1.0 (05"
         fall_back="nokia_7110_ver1"
         id="nokia_7110_ver2">
  <group id="ui">
    <capability name="table_support" value="true" />
  </group>
 </device>
 <device user_agent="Nokia7110/1.0 (05.00)"
         fall_back="nokia_7110_ver2"
         id="nokia_7110_ver1_sub500" />
 <device user_agent="Nokia7110/1.0 (05.01)"
         fall_back="nokia_7110_ver2"
         id="nokia_7110_ver1_sub501" />

When it comes to table support, this can be read as “there is a family of phones subset of the 7110 for which tables are not supported and there is a family for which they are supported”. All known 7110 devices are contained in the list, but each one falls in one or the other subfamilies. This lets you model if a given device supports tables or not.

Popularity: 2% [?]

Open Source Java PDF Generation and Renderer »

For PDF generation, iText is a good choice.

You can use iText to:

  • Serve PDF to a browser
  • Generate dynamic documents from XML files or databases
  • Use PDF’s many interactive features
  • Add bookmarks, page numbers, watermarks, etc.
  • Split, concatenate, and manipulate PDF pages
  • Automate filling out of PDF forms
  • Add digital signatures to a PDF file
  • And much more…

For PDF rendering, PDF Renderer can be used.

The PDF Renderer is just what the name implies: an open source, all Java library which renders PDF documents to the screen using Java2D. Typically this means drawing into a Swing panel, but it could also draw to other Graphics2D implementations.

Popularity: 2% [?]

CSS Framework »

Blueprint is a CSS framework, which aims to cut down on your CSS development time. It gives you a solid CSS foundation to build your project on top of, with an easy-to-use grid, sensible typography, and even a stylesheet for printing.

Popularity: 1% [?]

Gradle: Another Java Build System »

Gradle is a build system which provides:

  • A very flexible general purpose build tool like Ant.
  • Switchable, build-by-convention frameworks a la Maven (for Java and Groovy projects). But never lock you in!
  • Powerful support for multi-project builds.
  • Powerful dependency management (based on Apache Ivy).
  • Full support for your existing Maven or Ivy repository infrastructure.
  • Support for transitive dependency management without the need for remote repositories and pom.xml or ivy.xml files (optional).
  • Ant tasks as first class citizens.
  • Groovy build scripts.

Popularity: 1% [?]

Free EBooks from Oreilly »

O’Reilly has published a number of Open Books–books with various forms of “open” copyright–over the years. The reasons for “opening” copyright, as well as the specific license agreements under which they are opened, are as varied as our authors.

Link:

http://oreilly.com/openbook/

Popularity: 3% [?]

Apache XBean »

The goal of XBean project is to created a plugin based server analogous to Eclipse being a plugin based IDE. XBean will be able to discover, download and install server plugins from an Internet based repository. In addition, we include support for multiple IoC systems, support for running with no IoC system, JMX without JMX code, lifecycle and class loader management, and a rock solid Spring integration.

   1: <beans xmlns:p="java://org.apache.xbean.spring.example">
   2:  
   3:   <p:PizzaService id="pizzaService" topping="Salami" cheese="Edam" size="17"/>
   4:   
   5: </beans>

maps to

   1: public class PizzaService {
   2:  
   3:     private static final Log log = LogFactory.getLog(PizzaService.class);
   4:     
   5:     private String topping;
   6:     private String cheese;
   7:     private int size;
   8:     private double price;
   9:  
  10:     public void makePizza() {
  11:         log.info("Making a pizza with topping: " + topping + " cheese: " + cheese + " with size: " + size);
  12:     }
  13:  
  14:     public String getCheese() {
  15:         return cheese;
  16:     }
  17:  
  18:     public void setCheese(String cheese) {
  19:         this.cheese = cheese;
  20:     }
  21:  
  22:     public double getPrice() {
  23:         return price;
  24:     }
  25:  
  26:     public void setPrice(double price) {
  27:         this.price = price;
  28:     }
  29:  
  30:     public int getSize() {
  31:         return size;
  32:     }
  33:  
  34:     public void setSize(int size) {
  35:         this.size = size;
  36:     }
  37:  
  38:     /**
  39:      * @org.apache.xbean.Property alias="myTopping"
  40:      */
  41:     public String getTopping() {
  42:         return topping;
  43:     }
  44:  
  45:     public void setTopping(String topping) {
  46:         this.topping = topping;
  47:     }
  48:  
  49: }

Popularity: 1% [?]