Thursday, March 27, 2014

java.lang.IllegalArgumentException: badly formated directory string

it is based on invalid format, try to give correct name structure for instance:

new X500Name("C=DE,O=Organiztion");

Sunday, February 23, 2014

Design patterns

Design pattern are solutions to a class of problem which is proven to be good. It's like following the big guys. The attached project contains easy to learn example for Factory, observer listener and strategy design patterns. This project will be updated with further patterns. Each if the downloadable  project is an eclipse project , you can simply import it in eclipse  if you wish.
Download all Project
Description of project via sample problems:

PROBLEM 1:
 Say you want to create people in a computer game. People can be of type enemy army, friendly army or civilians (Also further more addition in future should be also possible).  In this kind of problem you can  use Factory pattern to create these game people.

PROBLEM 2:
Say in same game scenario you want to create Aeroplanes with different capability. Say 5 aeroplanes with military capability and 1 civilian  (In future you should be also able to add more capabilities like speeds, payload types). In this kind of problem you can use Strategy pattern. You can create different capabilities and inject them in aeroplane.

PROBLEM 3:
Now say you have a game window. There are different buttons. You want to do different action in your Window class based to the location of the button clicked (Say button is developed by some other developer in his own way). In this problem you can use observer listener pattern.Window can be listener of button click event. Developer of the button should define a interface to add listeners.

Wednesday, June 19, 2013

Running 2 or more JBOSS in same machine:

To run 2 or more instance of jboss follow the following step:
  1. First you need different installation location to run the another instance of the JBOSS. (assumption is that you already have a default instance running)
  2. This this example we are setting up jboss 5.1.0 as separate instance
  3. Go to bin : “jboss-5.1.0.GA\bin” and open “run.bat”
  4. Replace all the variable “%JBOSS_HOME%” with the direct path to your installation directory ie “jboss-5.1.0.GA”
if exist "%JBOSS_HOME%\bin\run.jar" (
if "x%JAVAC_JAR%" == "x" (
set "RUNJAR=%JAVAC_JAR%;%JBOSS_HOME%\bin\run.jar"
) else (
set "RUNJAR=%JBOSS_HOME%\bin\run.jar"
)
) else (
echo Could not locate "%JBOSS_HOME%\bin\run.jar".
echo Please check that you are in the bin directory when running this script.
goto END
)
With

if exist “<direct poath to jboss home>bin\run.jar" (
if "x%JAVAC_JAR%" == "x" (
set "RUNJAR=%JAVAC_JAR%;<direct poath to jboss home>\bin\run.jar"
) else (
set "RUNJAR=<direct poath to jboss home>\bin\run.jar"
)
) else (
echo Could not locate "<direct path to jboss home>\bin\run.jar".
echo Please check that you are in the bin directory when running this script.
goto END
)

  1. Run “run.bat”
[For other version of installation eg: jbosss 7, you can do the same thing,, ie go to “din/standlone.bat” and do 4)]

Wednesday, May 8, 2013

Heuristic Search videos

Basic of heuristic :

https://www.youtube.com/watch?v=jJ3CV3yhajM


A* algorithm example

https://www.youtube.com/watch?v=kgr4AiV4eCY

A* Algorithm optimality proof:


Heuristic search:

https://www.youtube.com/watch?v=xHocIAIPCEs


state space seach , 8 queen problem:

https://www.youtube.com/watch?v=M6V-TvwqwnU

hill climbing:

https://www.youtube.com/watch?v=3PtuHl1rrT8

state space search:

https://www.youtube.com/watch?v=FQWTa3XjyWg


informed search: BF, A*

https://www.youtube.com/watch?v=6hmIKIWBVSI

https://www.youtube.com/watch?v=tBn5gVXr0R4

A Quick Guide to the A* Algorithm :

https://www.youtube.com/watch?v=eTx6HQ9Veas

minimum spanning tree
https://www.youtube.com/watch?v=R_zU-UYUCQU

AND OR GRAPH Search
http://www.youtube.com/watch?v=oPVj17gB7gY
21:20 > 34:04

iterative deepening:
https://www.youtube.com/watch?v=7QcoJjSVT38

some videos from me:

Back tracking on AND/OR graph
https://www.youtube.com/watch?v=9SFwT3n0nD0

Game tree:


https://www.youtube.com/watch?v=SO-oXQgvJt4

            solving game tree: 
            6:00 > 11:00

            alpha beta pruning introduction: 12:40
            algorithm for alpha beta (example): 37:40
            algorithm for alpha beta (ALGO): 47:40