Posts

Showing posts from November, 2014

Alpha-Beta Pruning Algorithm

Alpha–Beta Pruning is a search algorithm that seeks to decrease the number of nodes that are evaluated by the minimax algorithm in its search tree alphabeta(origin, depth, -∞, +∞, TRUE) Pseudocode alphabeta(node, depth, α, β, maximizingPlayer) if depth = 0 or node is a terminal node return the heuristic value of node if maximizingPlayer for each child of node α := max(α, alphabeta(child, depth - 1, α, β, FALSE)) if β ≤ α break (* β cut-off *) return α else for each child of node β := min(β, alphabeta(child, depth - 1, α, β, TRUE)) if β ≤ α break (* α cut-off *) return β

Git Commands

Git Pull git pull will gets all from a remote and it instantly merge it into the branch you are in when you make the request. Pull is a request that runs ‘fetch’ then a ‘merge’ by default. Git Fetch Fetch is similar to pull, except it won’t do any merging. Download objects and refs from another repository Git Init command: git init Create an empty Git repository or reinitialize an existing one Git Status command: git status Show the working tree status Git Commit command: git commit -m "Message" Record changes to the repository Git Push command: git push Update remote refs along with associated objects Git add     Add file contents to the index Git bisect      Find by binary search the change that introduced a bug   Git branch      List, create, or delete branches     Git checkout    Checkout a branch or paths to the working tree     Git clone       Clone a repository into a new directory Git diff        Show changes between commits, comm

SQLite Dialect

Few days ago I worked with Hibernate and SQLite. I found that Hibernate doesn't provide dialect for SQLite Here is SQLiteDiaect: import java.sql.SQLException; import java.sql.Types; import org.hibernate.JDBCException; import org.hibernate.dialect.Dialect; import org.hibernate.dialect.function.AbstractAnsiTrimEmulationFunction; import org.hibernate.dialect.function.NoArgSQLFunction; import org.hibernate.dialect.function.SQLFunction; import org.hibernate.dialect.function.SQLFunctionTemplate; import org.hibernate.dialect.function.StandardSQLFunction; import org.hibernate.dialect.function.VarArgsSQLFunction; import org.hibernate.exception.ConstraintViolationException; import org.hibernate.exception.DataException; import org.hibernate.exception.GenericJDBCException; import org.hibernate.exception.JDBCConnectionException; import org.hibernate.exception.LockAcquisitionException; import org.hibernate.exception.spi.SQLExceptionConverter;