বৃহস্পতিবার, ২৯ ডিসেম্বর, ২০১১

how can I use external jars in an android project

  1. Create a folder call 'lib' into you project root folder
  2. Copy your Jar files to the lib folder
  3. Now right click on the Jar file and Build Path > Add to Build Path, this will create a folder called 'Refrenced Library' into you project, and your are done

বুধবার, ১৪ ডিসেম্বর, ২০১১

Declarative Transaction Management

Declarative transaction management means that you don’t write transaction management code in
your beans at all; instead, you configure the beans to be transactional. We can therefore take the
DefaultBankService from Listing 16-8 and specify in the bean configuration that we want the
transfer method to be transactional. The simplest way to achieve this is to use a proxy: the proxy will
intercept all method calls, and if the method name is included in the transactional configuration, the
proxy will act as around advice. It will begin the transaction before the call to the target method and
execute the target method in a try / catch block. If the target method finishes normally, the proxy
commits the transaction; if the target method throws a runtime exception, the proxy performs a roll-
back. To do all this work, the proxy will use the configured PlatformTransactionManager. This is the
core concept of declarative transaction management; the differences are in the way we can create
the proxy. Let’s begin with the legacy way, using the TransactionProxyFactoryBean.

মঙ্গলবার, ১৩ ডিসেম্বর, ২০১১

Mobile Development

1. http://techprithibi.com/eprithibi/1059
2. Video tutorial
3. http://www.learn-android.com/2010/01/05/android-layout-tutorial/5/
4. how can I use external jars in an android project
5. json/xml
6. 10 important project tutorial
7. http://www.helloandroid.com/tutorials/using-ksoap2-android-and-parsing-output-data
8. http://www.josecgomez.com/2010/04/30/android-accessing-restfull-web-services-using-json/
9. http://malsandroid.blogspot.com/2010/06/accessing-call-logs.html

opensessioninviewinterceptor vs opensessioninviewfilter

http://www.jroller.com/kbaum/date/20050406

http://chenyuye.blogspot.com/2008/05/spring-opensessioninviewinterceptor-vs.html


http://tadaya.wordpress.com/2008/07/31/opensessioninview-filter-vs-interceptor/

বৃহস্পতিবার, ৮ ডিসেম্বর, ২০১১

Spring 3 Property file read

Often times, most Spring developers just put the entire deployment details (database details, log file path) in XML bean configuration file as following :

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">


<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="com.mysql.jdbc.Driver"/>
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/oushod"/>
<property name="user" value="userName"/>
<property name="password" value="password"/>

<property name="minPoolSize" value="5"/>
<property name="maxPoolSize" value="20"/>
<property name="checkoutTimeout" value="300"/>
<property name="maxStatements" value="100"/>
</bean>


But, in a corporate environment, deployment detail is usually only can ‘touch’ by your system or database administrator, they just refuse to access your bean configuration file directly, and they will request a separate file for deployment configuration, for example, a simple properties, with deployment detail only.

To fix it, you can use PropertyPlaceholderConfigurer class to externalize the deployment details into a properties file, and access from bean configuration file via a special format – ${variable}.
Create a properties file (db.properties), include your database details, put it into your project class path.

driverClass=com.mysql.jdbc.Driver
jdbcUrl=jdbc:mysql://localhost:3306/oushod
user=root
password=admin


Declare a PropertyPlaceholderConfigurer in bean configuration file and map to the ‘db.properties‘ properties file you created just now.


<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:db.properties</value>
</list>
</property>
</bean>



Full example

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">

<import resource="applicationException.xml"/>

<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:db.properties</value>
</list>
</property>
</bean>

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${driverClass}"/>
<property name="jdbcUrl" value="${jdbcUrl}"/>
<property name="user" value="${user}"/>
<property name="password" value="${password}"/>

<property name="minPoolSize" value="5"/>
<property name="maxPoolSize" value="20"/>
<property name="checkoutTimeout" value="300"/>
<property name="maxStatements" value="100"/>
</bean>

</beans>






















মঙ্গলবার, ১১ অক্টোবর, ২০১১

NULL News

বৃহস্পতিবার, ৬ অক্টোবর, ২০১১

Database design

1. http://www.tomjewett.com/dbdesign/dbdesign.php?page=enum.php

jquery plugin autoresize

http://james.padolsey.com/javascript/jquery-plugin-autoresize/

বুধবার, ২৪ আগস্ট, ২০১১

Resources of toefl / GRE

Reading :


http://www.goodlucktoefl.com/free-sample-toefl-essays.html

http://demo.toeflibtcourse.com/

http://www.englishclub.com/esl-exams/ets-toefl-practice-reading.htm

http://www.examenglish.com/TOEFL/index.php?gclid=COWS_fHPtagCFQZ66wodzVwnAA

http://www.free-english.com/toefl-ibt-practice-test.aspx#writing

http://www.testpreppractice.net/TOEFL/Free-Online-TOEFL-Practice-Tests.aspx

http://i-courses.org/?p=sample_tests

http://www.tcyonline.com/toefl/

http://toefl.khoaanh.net/



Speaking:


http://www.goodlucktoefl.com/free-TOEFL-speaking-samples.html

http://demo.toeflibtcourse.com/

http://www.englishclub.com/esl-exams/ets-toefl-practice-speaking.htm

http://www.free-english.com/toefl-ibt-practice-test.aspx#writing

http://i-courses.org/?p=sample_tests

http://toefl.khoaanh.net/

https://www.notefull.com/content.php?pgID=250


Writing:


http://www.englishclub.com/esl-exams/ets-toefl-practice-writing.htm

http://www.onlinenglish.net/iBT/OnlinEnglish_Actual/200703_writing_1a.html

http://demo.toeflibtcourse.com/

http://www.free-english.com/toefl-ibt-practice-test.aspx#writing

http://i-courses.org/?p=sample_tests

http://toefl.khoaanh.net/

https://www.notefull.com/content.php?pgID=250


Listening:


http://demo.toeflibtcourse.com/

http://www.englishclub.com/esl-exams/ets-toefl-practice-listening.htm

http://www.examenglish.com/TOEFL/index.php?gclid=COWS_fHPtagCFQZ66wodzVwnAA

http://www.free-english.com/toefl-ibt-practice-test.aspx#writing

http://i-courses.org/?p=sample_tests

http://toefl.khoaanh.net/

http://www.toeflblog.com/2008/06/03/3-free-toefl-ibt-listening-practice-sessions/



Full Length Test:


http://www.testden.com/challenge/free-toefl.asp?refererid=goog3&gclid=CKW43e3OtagCFUF66wodghnXAg

বুধবার, ৩ আগস্ট, ২০১১

Important blog

1. http://niklasschlimm.blogspot.com/p/inhaltsverzeichnis.html
1. For datepicker today override ....http://www.blrf.net/howto/50_jQuery__How_to_select_Today_for_Datepicker_.html
2. http://highscalability.com/blog/2009/8/5/stack-overflow-architecture.html
3. http://www.shaunabram.com/javaone-web-frameworks/
4. http://www.javacodegeeks.com/2010/07/java-mail-spring-gmail-smtp.html
5. http://www.quartz-scheduler.org/documentation/quartz-1.x/tutorials/crontrigger
6. http://www.jroller.com/kbaum/date/20050406

for ubuntu freeze for vlc
http://ubuntuforums.org/archive/index.php/t-872309.html

for best of nachiketa
http://www.mybanglaspace.com/mytunes/view/album_856/name_best-of-nachiketa/

for hibernate enum type
http://rockycode.com/blog/hibernates-enumerated-annotation-brittle/

http://umumble.com/blogs/company_intel/385/

শনিবার, ২৩ জুলাই, ২০১১

Basic Math

Divisibility Rules


Dividing by 3
    Add up the digits: if the sum is divisible by three, then the number is as well. Examples:
    1. 111111: the digits add to 6 so the whole number is divisible by three.
    2. 87687687. The digits add up to 57, and 5 plus seven is 12, so the original number is divisible by three.

Dividing by 4

    Look at the last two digits. If the number formed by its last two digits is divisible by 4, the original number is as well.
    Examples:
    1. 100 is divisible by 4.
    2. 1732782989264864826421834612 is divisible by four also, because 12 is divisible by four.

Dividing by 5

    If the last digit is a five or a zero, then the number is divisible by 5.

Dividing by 6

    Check 3 and 2. If the number is divisible by both 3 and 2, it is divisible by 6 as well.

Dividing by 7

    To find out if a number is divisible by seven, take the last digit, double it, and subtract it from the rest of the number.
    Example: If you had 203, you would double the last digit to get six, and subtract that from 20 to get 14. If you get an answer divisible by 7 (including zero), then the original number is divisible by seven. If you don't know the new number's divisibility, you can apply the rule again.

Dividing by 8
    Check the last three digits. Since 1000 is divisible by 8, if the last three digits of a number are divisible by 8, then so is the whole number.
    Example: 33333888 is divisible by 8; 33333886 isn't.

Dividing by 9

    Add the digits. If that sum is divisible by nine, then the original number is as well.

Dividing by 10

    If the number ends in 0, it is divisible by 10.

Dividing by 11

    Let's look at 352, which is divisible by 11; the answer is 32. 3+2 is 5; another way to say this is that 35 -2 is 33.

    Now look at 3531, which is also divisible by 11. It is not a coincidence that 353-1 is 352 and 11 × 321 is 3531.

Dividing by 12

    Check for divisibility by 3 and 4.

Dividing by 13

Dividing by 14

মঙ্গলবার, ১৯ জুলাই, ২০১১

Restfull in grails

Restfull for Grails :

grails create-app RestFullTest
cd RestFullTest

grails create-domain-class book

grails create-controller Book



You can add some code this /grails-app/conf/BootStrap.groovy file:
def init = { servletContext ->
new Book(author:"S.M. Mahmudul Hasan",title:"Grails").save()
new Book(author:"Shohan",title:"Restfull").save()
}

or U can insert value in db
or U can insert by programatically
Final project structure will be:




















RESTful server
We need to create controller that will be performing base CRUD operations and map its methods to REST style URLs.

Edit /grails-app/conf/UrlMappings.groovy:
class UrlMappings {

static mappings = {
"/$controller/$action?/$id?" {
constraints {
// apply constraints here
}
}

"/"(view: "/index")
"500"(view: '/error')
"/book"(controller: "book") {
action = [GET: "list", POST: "create"]
}
"/book/$id"(resource: "book")
}

Entry with /book maps GET and POST HTTP requests to this URL to list and create controller methods. Below we map URLs like /book/$id using default grails REST mapping:
  • GET -> show
  • PUT -> update
  • POST -> save (used when you know ID of item you create - not our case;)
  • DELETE -> delete
Implementation of our controller will use GORM for data storage and will communicate with client application using JSON format. Edit /grails-app/controllers/BookController.groovy:

import grails.converters.*

class BookController {
def list = {
response.setHeader("Cache-Control", "no-store")
render Book.list(params) as JSON
}

def show = {
Book b=Book.get(params.id)
render b as JSON
}

def create = {
def json = JSON.parse(request);
def b = new Book(json)
b.save()
response.status = 201
response.setHeader('Location', '/book/'+b.id)
render b as JSON
}

def delete = {
Book b=Book.get(params.id)
b.delete()
render(status: 200)
}
}

Run this code with grails run-app and point your browser to http://localhost:8080/GrailsRestTest/book. You should get following response:
[{"class":"Book","id":1,"author":"S.M. Mahmudul Hasan","title":"Grails"},{"class":"Book","id":2,"author":"Shohan","title":"Restfull"}]
To get particular item try http://localhost:8080/GrailsRestTest/book/1 - response should be:
{"class":"Book","id":1,"author":"S.M. Mahmudul Hasan","title":"Grails"}

সোমবার, ১৮ জুলাই, ২০১১

রবিবার, ১৭ জুলাই, ২০১১

About JSF

basic link

বৃহস্পতিবার, ১৪ জুলাই, ২০১১

About basic Java

What Is Java

Java is a computer programming language created by Sun Microsystems.

The Java programming language is a high-level language that can be characterized by all of the following buzzwords:

  • Simple

  • Architecture neutral

  • bject oriented

  • Portable

  • istributed

  • High performance

  • Multithreaded

  • Robust

  • Dynamic

  • Secure

Why Java is so popular

1. It is free unlike the other rivals.

2. Platform independence (Write Once Run Anywhere).

3. Automatic Garbage collection (Memory management)


Java Object: Object is a real time entity and it has state and behavior.

Java Class: Java class is a blue print of java object.

Abstract class: Abstract classes are super classes which contain abstract methods and are defined such that concrete subclasses are to extend them by implementing the methods.

Concrete class: A concrete class, however, is a class for which entities (instances) may be created. This contrasts with abstract classes which can not be instantiated because it defeats its purpose of being an 'abstract'.


Identifiers:

1. Identifiers must start with a letter, a currency character ($), or a connecting
character such as the underscore ( _ ). Identifiers cannot start with a number!
2. After the first character, identifiers can contain any combination of letters,
currency characters, connecting characters, or numbers.
3. In practice, there is no limit to the number of characters an identifier can
contain.
4. You can't use a Java keyword as an identifier. Table 1-1 lists all of the Java
keywords including one new one for 5.0, enum.
5. Identifiers in Java are case-sensitive; name and NAME are two different identifiers.


JavaBeans: JavaBeans are Java classes that have properties with setter and getter.


JavaBean Property Naming Rules:

1. If the property is not a boolean, the getter method's prefix must be get. getSize()

2. If the property is a boolean, the getter method's prefix is either get or is .getStopped() or isStopped()

3. The setter method's prefix must be set. setSize()

4. Setter method signatures must be marked public, with a void return type
and an argument that represents the property type.

5. Getter method signatures must be marked public, take no arguments, and
have a return type.

Source File Declaration Rules


1. There can be only one public class per source code file.
2. Comments can appear at the beginning or end of any line in the source code
file.
3. If there is a public class in a file, the name of the file must match the name
of the public class. For example, a class declared as public class Dog { }
must be in a source code file named Dog.java.
4. If the class is part of a package, the package statement must be the first line
in the source code file, before any import statements that may be present.
If there are import statements, they must go between the package statement
(if there is one) and the class declaration. If there isn't a package statement,
then the import statement(s) must be the first line(s) in the source code file.
If there are no package or import statements, the class declaration must be
the first line in the source code file.
5. import and package statements apply to all classes within a source code file.
In other words, there's no way to declare multiple classes in a file and have
them in different packages, or use different imports.
6. A file can have more than one nonpublic class.
7. Files with no public classes can have a name that does not match any of the
classes in the file.


Modifiers fall into two categories:
1. Access modifiers: public, protected, private.
2. Non-access modifiers (including strictfp, final, and abstract).

strictfp :

strictfp is a keyword and can be used to modify a class or a method, but never a
variable. Marking a class as strictfp means that any method code in the class will
conform to the IEEE 754 standard rules for floating points. Without that modifier,
floating points used in the methods might behave in a platform-dependent way.



Online Groovy Console

This is very nice console for groovy code compiling. link

শনিবার, ১৮ জুন, ২০১১

git

for install: http://veerasundar.com/blog/2011/06/git-tutorial-getting-started/



To see the list of git commands

git help

To see help on a git command


git help COMMAND_NAME

Configure your GIT first time


git config --global user.name "Your Full Name"
git config --global user.email "name@therapservices.net"

Configure your GIT to get colorize output


git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto

Clone your project


git clone git://masum/therap therap

Clone a bare repository for publishing (for team leads):

git clone --bare git://masum/therap therap

Add release branch

git branch --track release origin/release

Delete branch

git branch -D BRANCH_NAME

Add other’s repo as remote branch

git remote add -t master -t release otherperson git://otherperson/therap

Fetch/merge master from otherperson

git checkout master
git fetch git://otherperson master:master
git merge otherperson/master

See all the tags (usually used to mark releases)

git tag -l

See list of all commits from a particular release tag to now

git log --no-merges ..HEAD
git log --no-merges v7.2.4..HEAD

See list of all commits between two release tags

git log --no-merges ..
git log --no-merges v7.2.3..v7.2.4

See which files you are changing

git log --stat

See change details too

git log -p --stat

Viewing the changes you have made since last commit

1) git status
2) git diff
3) git diff --cached
4) git diff HEAD
  1. See status of all files changed or added
  2. See the changes that you have made but not added, changes in a file after the last git add is also
  3. See the changes that you have added to commit, changes done in working directory but not added are not shown
  4. See all changes you have made since last commit (HEAD)
Adding files for commit

1) git add filePath
2) git add filePattern
3) git add .
4) git add web/WEB-INF/
5) git add *.java
  1. Adding a single file
  2. Adding multiple files
  3. Adding all files you have changed, give the command from your project root
  4. Adding all files under web/WEB-INF directory
  5. Adding all changes to java files

Reset/Undo Changes of a file

git checkout HEAD filepath
or git checkout -- filepath

Undo Commit and Keep Changes:

git reset --soft HEAD^

To see who, when added/modified each line of a file

git blame 

Make changes in commit message before pulled by anyone else

git commit --amend

More information on git: http://git-scm.com/

Date format match with regular expression

import java.util.regex.Pattern
import java.util.regex.Matcher
......
.........

boolean isValidDate(String dates){

//String DATE_PATTERN = "(0?[1-9]|1[012])/(0?[1-9]|[12][0-9]|3[01])/((19|20)\\d\\d)"; // for simple

String DATE_PATTERN = "(((0[13578]|1[02])\\/(0[1-9]|[12]\\d|3[01])\\/((19|[2-9]\\d)\\d{2}))|((0[13456789]|1[012])\\/(0[1-9]|[12]\\d|30)\\/((19|[2-9]\\d)\\d{2}))|(02\\/(0[1-9]|1\\d|2[0-8])\\/((19|[2-9]\\d)\\d{2}))|(02\\/29\\/((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))"

// detail solve for 31 problems/ leap year problem

Pattern pattern = Pattern.compile(DATE_PATTERN);

Matcher matcher = pattern.matcher(dates);

if(!matcher.matches()){

return true;

}

else {

return false;

}

}

System.out.println(isValidDate(06/20/2012)); // true



help from .....link

রবিবার, ২৪ এপ্রিল, ২০১১

study

list of german university......link
Resources of TOEFL/GRE ....link

বৃহস্পতিবার, ২১ এপ্রিল, ২০১১

show hide panel by jquery

<html>
<head>

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
if($("button").html() == 'show'){
$("button").html("hide");
}
else {
$("button").html("show");
}
$(".panel").slideToggle("slow");
});
});
</script>

<style type="text/css">
div.panel,p.flip
{
margin:0px;
padding:5px;
text-align:center;
background:#e5eecc;
border:solid 1px #c3c3c3;
}
div.panel
{
height:120px;
display:none;
}
</style>
</head>

<body>

<div class="panel">
<p>Because time is valuable, we deliver quick and easy learning.</p>
<p> you can study everything you need to learn, in an accessible and handy format.</p>
</div>

<button>show</button>
</body>
</html>

Countable text area

jquery.simplyCountable.js

(function($){

$.fn.simplyCountable = function(options){

options = $.extend({
counter: '#counter',
countType: 'characters',
wordSeparator: ' ',
maxCount: 256,
strictMax: false,
countDirection: 'down',
safeClass: 'safe',
overClass: 'over',
thousandSeparator: ',',
onOverCount: function(){},
onSafeCount: function(){},
onMaxCount: function(){}
}, options);

var countable = this;
var counter = $(options.counter);
if (!counter.length) { return false; }
var regex = new RegExp('['+options.wordSeparator+']+');

var countCheck = function(){

var count;
var revCount;

var reverseCount = function(ct){
return ct - (ct*2) + options.maxCount;
}

var countInt = function(){
var text = countable.val();
for (var i = 0; i < text.length; i++) {

var charCode = text.charCodeAt(i);
//utf-8 character count
if (charCode == 10 || charCode == 13) {
if ($.browser.msie) {
count -= 1;
}
}
else if (charCode > 127 && charCode < 2048) {
count -= 2;
} else if (charCode > 2047 && charCode < 65536) {
count -= 3;
} else if (charCode > 65535 && charCode < 1114112) {
count -= 4;
}
}
return (options.countDirection === 'up') ? revCount : count;
}

var numberFormat = function(ct){
if (options.thousandSeparator){
ct = ct.toString();
for (var i = ct.length-3; i > 0; i -= 3){
if((ct.length%4)==0 && ct.charAt(0)=='-'){
ct = ct;
} else {
ct = ct.substr(0,i) + options.thousandSeparator + ct.substr(i);
}
}
}
return ct;
}

/* Calculates count for either words or characters */
if (options.countType === 'words'){
count = options.maxCount - $.trim(countable.val()).split(regex).length;
if (countable.val() === ''){ count += 1; }
}
else { count = options.maxCount - countable.val().length; }
revCount = reverseCount(count);

/* If strictMax set restrict further characters */
if (options.strictMax && count <= 0){
var content = countable.val();
if (count < 0 || content.match(new RegExp('['+options.wordSeparator+']$'))) {
options.onMaxCount(countInt(), countable, counter);
}
if (options.countType === 'words'){
countable.val(content.split(regex).slice(0, options.maxCount).join(options.wordSeparator));
}
else { countable.val(content.substring(0, options.maxCount)); }
count = 0, revCount = options.maxCount;
}

counter.text(numberFormat(countInt()));

/* Set CSS class rules and API callbacks */
if (!counter.hasClass(options.safeClass) && !counter.hasClass(options.overClass)){
if (count < 0){ counter.addClass(options.overClass); }
else { counter.addClass(options.safeClass); }
}
else if (count < 0 && counter.hasClass(options.safeClass)){
counter.removeClass(options.safeClass).addClass(options.overClass);
options.onOverCount(countInt(), countable, counter);
}
else if (count >= 0 && counter.hasClass(options.overClass)){
counter.removeClass(options.overClass).addClass(options.safeClass);
options.onSafeCount(countInt(), countable, counter);
}

};

countCheck();
countable.keyup(countCheck);
countable.keypress(countCheck);
countable.click(countCheck);
countable.mouseover(countCheck);

};

})(jQuery);


main.gsp(for layout)

<g:javascript library="jquery" plugin="jquery"/>
<script type="text/javascript" src="${resource(dir: 'js', file: 'jquery.simplyCountable.js')}"></script>

<head>
…..............
…........
<style type="text/css" media="screen">
.safe {
color: green;
}
.over {
color: red;
}
</style>
<script>
jQuery.noConflict();
jQuery(document).ready(function () {
jQuery('textarea').map(function() {
if (jQuery(this).attr("floor") == 1) {
var id = jQuery(this).attr("id");
jQuery('#' + id).live('keydown',ND.utils.textCounter);
jQuery('#' + id).live('keyup',ND.utils.textCounter);
jQuery('#' + id).live('focus',ND.utils.textCounter);
}
});
});
</script>
….......
….........
</head>

For textarea in any .gsp

<g:countableTextArea name="medicalInfo" id="medicalInfo_countable" class="field" cols="25" rows="4" floor="1"
length="3000" value="${ifspTypeInfoInstance?.medicalInfo}"/>

NB:
1. floor means active for textarea countable...............
2. length means max length.


Taglib......
def countableTextArea = { attrs, body ->

def escapeHtml = true
if (attrs.escapeHtml) escapeHtml = Boolean.valueOf(attrs.remove('escapeHtml'))

// Pull out the value to use as content not attrib
def value = attrs.remove('value')
if (!value) {
value = body()
}
out << """<textarea """
attrs.each { k, v ->
out << "$k=\"${v.encodeAsHTML()}\" "
}
out << """ >""" <<"""${escapeHtml ? value.encodeAsHTML() :value}</textarea>"""
def check = Integer.valueOf(attrs.remove('floor'))
if (check == 1) {
out << """<p style="margin: 0;"> <span id="${attrs.id}-counter"> </span> </p>"""
}
}

বুধবার, ২০ এপ্রিল, ২০১১

two or three jquery in same page

if you have two or three jquery in same page, just put a different variable for different jquery..example :


<script type="text/javascript">
var $s = jQuery.noConflict();
$s(document).ready(function() {
$s('#news-container').vTicker({
speed: 500,
pause: 3000,
animation: 'fade',
mousePause: true,
showItems: 2
});
});
</script>
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(document).ready(function() {
$j('.sf-menu ul').superfish({
delay: 1000,
animation: {opacity:'show',height:'show'},
speed: 'medium',
autoArrows: false,
dropShadows: 'medium'
});
});
</script>




courtesy.....

বুধবার, ৬ এপ্রিল, ২০১১

Open Cart

1 . Menu info

মঙ্গলবার, ৫ এপ্রিল, ২০১১

grails important blog/link list

1. http://www.intelligrape.com/blog/category/grails/
2. For Symbole http://gavingrover.blogspot.com/2008/02/grerl-vys-and-groovys-symbols-part-2.html
3. Assert
4. Conditional validation in domain class ........details
5. Grails and the Pagination Bugaboo.......link
6. Dynamic jasper report in grails लिंक
7. export plugin problem solved by लिंक
8 . pdf css .....link
9. jquery-multiselect.js for multiple select combo box link-->
10. Grails AJAX Examples link
11. grails prevent multiple submition using useToken link
12. How to use onLoading event in grails remoteFunction link
13. Online Groovy Console link
14. http://csetyro.blogspot.com/2011/07/restfull-in-grails.html
15. Projection sum and group by link

মঙ্গলবার, ২৯ মার্চ, ২০১১

jQuery disable / enable SELECT options based on Radio selected

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<title>Sandbox</title>
</head>
<body>
ABC: <input type="radio" name="abc123" id="abc"/>
123: <input type="radio" name="abc123" id="123"/>

<select id="theOptions">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="a">a</option>
<option value="b">b</option>
<option value="c">c</option>

</select>
<script>
jQuery.fn.filterOn = function(radio, values) {
return this.each(function() {
var select = this;
var options = [];
$(select).find('option').each(function() {
options.push({value: $(this).val(), text: $(this).text()});
});
$(select).data('options', options);
$(radio).click(function() {
var options = $(select).empty().data('options');
var haystack = values[$(this).attr('id')];
$.each(options, function(i) {
var option = options[i];
if($.inArray(option.value, haystack) !== -1) {
$(select).append(
$('<option>').text(option.text).val(option.value)
);
}
});
});
});
};

$(function() {
$('#theOptions').filterOn('input:radio[name=abc123]', {
'abc': ['a','b','c'],
'123': ['1','2','3']
});
});
</script>
</body>
</html>

courtsey SandBox

সোমবার, ২৮ মার্চ, ২০১১

js confirm block

<script type="text/javascript"><br />function show_confirm()<br />{<br />var r=confirm("Press a button!");<br />return r;<br /><br />}<br /></script>

<a onclick="return show_confirm()" href="http://algobd.com/" value="nothing">click</a>

রবিবার, ২০ মার্চ, ২০১১

Ant as build file

To get up and running with the binary edition of Ant quickly, follow these steps:

  1. Make sure you have a Java environment installed, See System Requirements for details.
  2. Download Ant. See Binary Edition for details.
  3. Uncompress the downloaded file into a directory.
  4. Set environmental variables JAVA_HOME to your Java environment, ANT_HOME to the directory you uncompressed Ant to, and add ${ANT_HOME}/bin (Unix) or %ANT_HOME%/bin (Windows) to your PATH. See Setup for details.
  5. Optionally, from the ANT_HOME directory run ant -f fetch.xml -Ddest=system to get the library dependencies of most of the Ant tasks that require them. If you don't do this, many of the dependent Ant tasks will not be available. See Optional Tasks for details and other options for the -Ddest parameter.
  6. Optionally, add any desired Antlibs. See Ant Libraries for a list.

Note that the links in the list above will give more details about each of the steps, should you need them. Or you can just continue reading the rest of this document.

The short story for working with the Ant source code (not needed if you are working with the binary edition) is:
  1. Get the source code. See Source Edition for details.
  2. Build Ant. See Building Ant for details.

For the full story, continue reading. continue-->

সোমবার, ২৮ ফেব্রুয়ারী, ২০১১

বৃহস্পতিবার, ৩ ফেব্রুয়ারী, ২০১১

Problem

1. In AbstractController , difference between handleRequestInternal and handleRequest. when and where we use what?
2. Dao vs service directory in src

মঙ্গলবার, ১ ফেব্রুয়ারী, ২০১১

Mischelenious

1. Simple form Controller

বুধবার, ২৬ জানুয়ারী, ২০১১

Self Referencing in Hibernate

link

রবিবার, ২৩ জানুয়ারী, ২০১১

list of java based orm

* Cayenne, Apache, open source for java
* Kodo, commercial implementation of both the JDO and JPA API.
* Torque, an object-relational mapper for Java
* Carbonado, open source framework, backed by Berkeley DB or JDBC
* Dozer, a Java Bean to Java Bean mapper
* Ebean, open source ORM Framework
* EclipseLink, Eclipse Persistence Platform
* Enterprise Objects Framework, Mac OS X/Java, part of Apple WebObjects
* Hibernate, open source ORM Framework, widely used
* iBATIS, maintained by ASF, and with .NET port
* Java Data Objects (JDO)
* Java Object Oriented Querying (jOOQ)
* Java Persistence API (JPA)
* DataNucleus, open source JDO and JPA implementation
* JPOX, open source JDO 2 reference implementation
* Object Relational Bridge (Apache OJB), an object-relational mapper for Java
* OpenJPA, Apache, open source, supports JPA API
* ORMLite, open source ORM Framework, lightweight framework supporting JDBC and Android OS.
* TopLink by Oracle
* QuickDB ORM, Open Source ORM Framework (GNU LGPL)
* Sobat, simple hibernate-like ORM.
* JPMapper, Open Source ORM(GNU LGPL)

An Introduction to Hibernate 3 Annotations

An Introduction to Hibernate 3 Annotations

Annotations properties:

link

tutorialcreate-spring-3-mvc-hibernate-3-example-using-maven-in-eclipse

http://amohsen.com/abdo/1493/mysql/tutorialcreate-spring-3-mvc-hibernate-3-example-using-maven-in-eclipse/

বুধবার, ১৯ জানুয়ারী, ২০১১

মঙ্গলবার, ১৮ জানুয়ারী, ২০১১

spring

1. sneha blog on application context

2. web flow example >>

3. http://amohsen.com/abdo/1493/databases/tutorialcreate-spring-3-mvc-hibernate-3-example-using-maven-in-eclipse/
4. Annotation based configuration in Spring link
5. http://www.mkyong.com/spring-mvc/spring-mvc-form-handling-annotation-example/

6. http://springcert.sourceforge.net/study-notes-3.html 
7. http://www.tutorialspoint.com/spring/

সোমবার, ১০ জানুয়ারী, ২০১১

jquery

1. photo gallery: http://benjaminsterling.com/jquery-jqgalviewii-photo-gallery/
2. two or three jquery in same page --link
3.jQuery disable / enable SELECT options based on Radio selected link

3. show hide panel --link