Maven compile with jdk1.5

i was compiling my source code with Maven2 it failed because maven was using -source 1.3 so after few googling i ended up with the following solution: (source)

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0</version>
<configuration>
<source>1.5 </source>
<target>1.5 </target>
</configuration>
</plugin>
</plugins>
</build>

now its working quite fine… :)

LightObjectBOX IoC container — example

I usually like less xml configuration, i have a tiny project… IDEAStickyPlugin which is running as IntelliJ IDEA Plugin.

recently i got interest to support IDEASticky as a desktop standalone application, at least for my Ubuntu based pc, (i am not satisfy with Sticky notes and Tomboy).
these days i am working on this stuff. so i felt a tiny light weight IoC container,(though PicoContainer is better) no XML level configuration will be a good addition…

so yesterday evening i made the first test case and implemented the tiny container, here is few example code snaps:

@LightObjectName( name = “a” )
public class A {
……
@LightObjectKey( key = “b” )
public void setB(B b) {
this.b = b;
}
……
}

@LightObjectName( name = “b” )
public class B {
…..
@LightObjectKey( key = “a” )
public void setA(A a) {
this.a = a;
}
…..
}

here @LightObjectName annotation is used to define an object name, this name will be used to store in container.
@LightObjectKey annotation is used to define dependent object. it will be set through the setter on container initialization time.
also cyclic dependency has no problem.

sample usages:

mContainer = LightObjectBox.createBox();
mContainer.add( A.class );
mContainer.add( B.class );
mContainer.init();

here i have created an instance of LightObjectBox though createBox() and ..
add(
Class ) is used to register a component into container scope. later init(); invocation initialize all classes + dependencies …

so i can recall my object instance by “A a = mContainer.getObject( “a” );”
i will publish whole source code after completing my IDEASticky Standalone :) keep reading my blog :)

Congrats Hasin bhai, “WordPress Complete”

Wow, congrats hasin bhai….

“WordPress Complete” book has been announched by packt publisher. here is details:

WordPress is a simple and powerful way to start blogging. If you’re not an IT expert but want to use a state-of-the-art blogging system to give your blog the best chance of success, while giving you the time to focus on content and your readers, WordPress is the right system for you, and this book is the right place to start. It will give you a rapid and straightforward introduction to the rich and powerful features of WordPress and get you up and running with a state-of-the-art blog as quickly and painlessly as possible.

In Detail

WordPress is an open-source blog engine released under the GNU general public license. It allows users to easily create dynamic blogs with great content and many outstanding features. It is an ideal tool for developing blogs and though it is chiefly used for blogging, it can also be used as a complete CMS with very little effort. Its versality and ease of use has attracted a large, enthusiastic, and helpful community of users.

If you want to create powerful, fully-featured blogs in no time, this book is for you. This book will help you explore WordPress showing you what it offers and how to go about building your blog with the system.

You will be introduced to the main aspects of a blog – users, communities, posts, comments, news feeds – and learn how to manage them using WordPress. You will develop the skills and confidence to manage all types of content, be it text or images, on your blog, and also understand how users interact with the blog. In working through the book you’ll be inspired as well as informed, and have the capability and the ideas to make your blog cutting edge and exciting to maximize its impact.

What you will learn from this book

  • Installing and configuring WordPress on a local development machine or a web hosting service
  • Managing posts and comments
  • Working with Image galleries, calendars, etc.
  • Organizing users and Communities
  • Creating and Installing themes to control the page layout
  • Linking to the outside world – Feeds, Syndication, and Podcasting
  • Customizing Widgets and Plug-ins
  • Using WordPress as a regular CMS

Approach

Written in a clear, easy-to-read style, the book takes you through the essential tasks required to create a feature-rich blog as quickly as possible. From initial setup to customizing modules, each task is explained in a clear, practical way using an example blog developed through the book.

here is about our beloved hasin bhai:

This book is a beginner’s guide to WordPress, for people who are new to blogging and want to create their own blogs in a simple and straightforward manner. It does not require any detailed knowledge of programming or web development, and any IT-confident user will be able to use the book to produce an impressive blog.

RSSOwl on Ubuntu (mozilla browser component)

RSSOwl is my favorite RSS feed reader, recently i have setup mozilla browser component. here is simple extention for run.sh ( it could be found under %RSSOWL_DIR%/run.bat ).

#!/bin/sh
export MOZILLA_FIVE_HOME=’/usr/lib/mozilla-firefox/’
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MOZILLA_FIVE_HOME
java -Xmx96m -Djava.library.path=$RSSOWL_DIR -jar $RSSOWL_DIR/rssowl.jar

thats’s it. now open RSS Owl, now it will display feed content using Mozilla browser component…

iBatis PaginatedList and pagination

This iBatis feature is deprecated and discarded from iBatis library. moreover it has performance issue, hence i’m striking out this blog post :) thanks for visiting this post.

iBatis has very good pagination support. every query can be limited by max number of rows and scrollable.
for example i have executed “queryForPaginatedList( “queryName”, domainObject, MAX_ROWS ) “;
iBatis PaginatedList class is extension of “java.util.List” class. so you can generally use it as collection object.
following methods are added to PaginatedList class:

int getPageSize();

page size is current size of list (list.size() == MAX_ROWS)

boolean isFirstPage();

if page offset is 0 no “nextPage” is invoked (default state)

boolean isMiddlePage();

if between last and first offset (though did not use it, just assumption)

boolean isLastPage();

if page offset == total available page

boolean isNextPageAvailable();

if current offset is not the last offset

boolean isPreviousPageAvailable();

if current offset is not set to ’0′ i mean already (nextPage(…)) invoked.

boolean nextPage();

hit database(or cache) to load next MAX_ROWS number of items

boolean previousPage();

hit database(or cache) to load rows from certain range from current state to one step backward.

void gotoPage(int i);

move forcefully to certain page by specified offset

int getPageIndex();

return current page index(offset) number

How to paginate through your records?:

1. let’s think some one accessed your controller, you performed some retrieval task, and stored this “PaginatedList” object into session context.
2. when user request for  “next” page. you just load your object from session and invoke “pgList.nextPage()”
3. when user request for “back/previous” page you just load your object from session and invoke “pgList.previousPage()”
4. and set again in session context.
5. access from view .. and render your desire UI…
regards and Eid Mubarak!!!

A request !!

please stop piracy, stop piracy your favorite music album. stop sharing your favorite album with your the best friend.
rather gift her/him a new favorite album. encourage our talents our artists.
an album does not cost much… but it worth much for an artist… please encourage them…
let them produce more creative artistic album. prove your true love for your loving artist…

my simple request to all folks … STOP PIRACY STOP MUSIC PIRACY FIRST … LET INSPIRE …

My favorite Hero – Jet li

3-l.jpg

I watched every Jet li film. nothing left. some movies i watched more than 5 times and at least more than once.
recently i found this answer from jet li site.
i really respect such person… my heartiest greets to Mr. Jet li.

I am in dream….

path4467.png

i like dreaming… i like to imagine everything … while i am walking on the street i like to think… i am in a dream…
dream is my inspiration of life… i like to make dream… i like to control my dream… dream… dream after dream…. after dream….

I belief dreaming is one of the  easiest jobs that everyone can do…
well, during vacation dreaming is nice job… :D

Every time I try to access my repository, the process just hangs

one of our repositories was hanging while user was trying to checkout. to resolve this problem i found the following lines from svn FAQ. Now it has been fixed.

Your repository is not corrupt, nor is your data lost. If your process accesses the repository directly (mod_dav_svn, svnlook, svnadmin, or if you access a `file://’ URL), then it’s using Berkeley DB to access your data. Berkeley DB is a journaling system, meaning that it logs everything it is about to do before it does so. If your process is interrupted (Control-C, or segfault), then a lockfile is left behind, along with a logfile describing unfinished business. Any other process that attempts to access the database will just hang, waiting for the lockfile to disappear. To awaken your repository, you need to ask Berkeley DB to either finish the work, or rewind the database to a previous state that is known to be consistent.

collected from – http://subversion.tigris.org/faq.html#bdb-recovery
just apply “svnadmin recover /path/to/your/repository”

GP Edge on Ubuntu

My congratualtions to Lavluda who followed me to successfully setup “GP” EDGE connection on Ubuntu
here is another blog post published by Lavluda.
here is my steps that lead me to successfully configure EDGE on Ubuntu:

1. first plugin your mobile (in my case i am using Motorola E398)

2. sudo dmesg | grep tty

[4294668.901000] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[4294668.904000] 00:07: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[4300957.868000] cdc_acm 2-1:1.0: ttyACM0: USB ACM device

here “ttyACM0″ is my USB mobile device.
3. sudo wvdialconf /etc/wvdial.conf

it will create a configuration file template based on my USB Device

4. sudo gedit /etc/wvdial.conf
5. compare your files and add following changes:

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,”IP”,”gpinternet”
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyACM0
ISDN = 0
Phone = *99***1#
Username = xyz
Password = xyz

NOTE: xyz will remain xyz and Phone number will also remain as given above. Replace “/dev/ttyACM0″ with your deivce location
6. sudo ifdown eth0

it will disable your LAN connection

7. finally execute ” sudo wvdial “

8. now you will get lot of output on console… and best wishes for succssfully connection :D

my tweets

 

October 2006
S S M T W T F
« Sep   Nov »
 123456
78910111213
14151617181920
21222324252627
28293031  

Flickr Photos

@kamalapur over bridge

@kamalapur station

cox's bazaar trip oct 09

cox's bazaar trip oct 09

cast ur vote!

More Photos
Follow

Get every new post delivered to your Inbox.