Java Concurrency Series- How to use Lock/RentrantLock in Java 5

Average: 5 (2 votes)

In this article, we will examine the subtleties of using newly introduced Lock classes in java.util.concurrent.locks package and their advantages over traditional "synchronized" blocks and methods.

Java Concurrency Series- How to use Future/FutureTask and Callable

Average: 4.4 (11 votes)

In this article we will discuss how to use the new interface Callable introduced in java.concurrent.util in Java 5. Callable along with another interface Future allows us to obtain a return value from a method executed in a separate thread.
In the second example we will also examine the usage of FutureTask, an implementation of Future.

Java Concurrency Series - another Executor example

Average: 4 (1 vote)

In an earlier article on Executor, we looked at how we can create use the executor to create thread pools to manage our multi-threaded program. We shall continue to explore additional features of this class.
Here we will extend the ThreadPooledExecutor class and provide our implementation to replace the empty implementation.

Java Concurrency Series - meaning of volatile variable

Tagged:  
Average: 3 (2 votes)

One of the least understood aspects of Java Thread model is the "volatile" keyword. The general misconception is that if you make a variable volatile you don't need to provide synchronized access to it.
Let's create a simple class with a integer marked as volatile. There are two methods which increment and decrement the variable in a for loop. To increase interleaving of the threads, we have a call to yield inside the for loop.

Code snippet 1

  1. public class VolatileExample {
  2.        
  3.         private volatile int volatileInt=0;
  4.        
  5.         /** unsynchronized volatile variable being incremented */

Java Concurrency Series - Simple Executor example

Tagged:  
Average: 4.1 (8 votes)

With Java 1.5 we have a new way of managing threads or threaded tasks. We no longer need to call start() and join()on our Thread object. The new concurrent package provides us with an elegant Executor class to manage our threads.

Let's go through a simple example given below. We have created a simple ThreadPool with default pool size of 2 and max size of 4. In the method createMultipleConsumerThreads(), we have created an instance of a Runnable task, Consumer and passed it on to the execute() method.

Grails - How to create groovy domain classes from mysql database

Tagged:  
Average: 2.5 (2 votes)

Recently I started working with Grails and I am very much impressed with its capabilities and kind of digging deep now.

Being used MyEclipse extensively I started searching for tool to create groovy domain objects from mysql database. But no luck I couldn't able to find any tools or scripts. So I created one which suits my needs presently. Feel free to use it any way you like.

Features

- Converts Plural table names to Singular form
- Removes underscores (_) and capitalizes first letter of every word.

Java Concurrency Series with examples- Barrier

Tagged:  
Average: 4 (3 votes)

In this series we will discuss different concurrent structures provided in the new Java 5 Concurrent package.
We will start with a simple parallel processing concept called "barrier" that we have all studied and forgotten. By definition if there are set of independent tasks (T1..Tn) that need to fully completed to initiate another task (Tx) which is dependent on all these tasks (T1...Tn) we can synchronize them using a barrier.

Ubuntu - Using Nautilus File Manager

Tagged:  
This screencast we look at the Nautilus file manager. This includes:-
  • Configuration preference in nautilus
  • Managing files and folders
  • Mounting and correctly unmounting external storage devices (USB sticks and memory cards)
  • Dealing with trash
  • Bookmarks

ADO.NET using C# database access

Tagged:  
ADO.NET cleanly factors data access from data manipulation into discrete components that can be used separately or in tandem. ADO.NET includes .NET Framework data providers for connecting to a database, executing commands, and retrieving results. Those results are either processed directly, or placed in an ADO.NET DataSet object in order to be exposed to the user in an ad-hoc manner, combined with data from multiple sources, or remoted between tiers. The ADO.NET DataSet object can also be used independently of a .NET Framework data provider to manage data local to the application or sourced from XML.

django: Web Development for Perfectionists with Deadlines

Tagged:  
Django is an open source web application framework, written in Python, which loosely follows the model-view-controller design pattern. It was originally developed to manage several news-oriented sites for the World Company of Lawrence, Kansas, and was released publicly under a BSD license in July 2005; the framework was named after gypsy jazz guitarist Django Reinhardt.

Joomla CMS Jumpstart Tutorial

Tagged:  
Learn the basics of Joomla CMS by watching this quick start video screen cast to setup a new web site from start to finish.

Joomla! is a free, open source content management system for publishing content on the world wide web and intranets. Joomla! includes features such as page caching to improve performance, RSS feeds, printable versions of pages, news flashes, blogs, polls, website searching, and language internationalization. Joomla! is licensed under the GPL, and is the result of a fork of Mambo. Original Video From : http://video.jumpbox.com/?app=joomla

Advanced Python or Understanding Python

Tagged:  
The Python language, while object-oriented, is fundamentally different from both C++ and Java. The dynamic and introspective nature of Python allow for language mechanics unlike that of static languages. This talk aims to enlighten programmers new to Python about these fundamentals, the language mechanics that flow from them and how to effectively put those to use. Among the topics covered are duck-typing, interfaces, descriptors, decorators, metaclasses, reference-counting and the cyclic-garbage collector, the divide between C/C++ data and Python objects and the CPython implementation in general. This video is part of Google Tech Talks Series.

Ubuntu - How to connect a Printer

Tagged:  
Check out various ways of connecting printers in Ubuntu.
  • Printer auto-detection in Ubuntu 7.10 (Gutsy Gibbon)
  • Automatic detection of network printers
  • Manually configuring network printers
  • Connecting to Windows shared printers.
  • Printing test pages

How to Play DVD / MP3 on Ubuntu

Tagged:  
This screencast comprehensively details how to play media (Movies and DVDs) in Ubuntu.

This screencast covers:-

  • Playing DVDs
  • Adding codecs automatically
  • Playing video embedded in a browser
  • Installing Flash Player plugin
  • Installing Miro video platform

Using CakePHP Database Migrations

Tagged:  
A screen cast tutorial on Database Migrations for the CakePHP Framework and how to use them.
Syndicate content