Posts

Showing posts from October, 2013

To create a Materialized view with FAST REFRESH

Image
Materialized views  is used to replicate data from master(parent) to non-master sites in a replication environment. at non-master site it is replica of master site. so it is also known as ' snapshots' of master. Need of Materialized views :-                             Suppose I have two application, 1. for User Administration 2. actual user console. where based on user role user can perform different task. like Admin user can do administrative work, support user can monitor session, or see logs, and normal user can do all other things.                            For Both this application I have different schema, from User console while logging into application, i have to check user role given in User Administration console. So I need data from other application and which need to be synchronized. we can do this by DB jobs but t hese operations are expensive in terms of time and processing power. As DB jobs mostly given on time scheduling. So if in given time nothing is

dda line drawing algorithm in java

Read about DDA (Digital differential analyzer) algorithm . You can find line drawing using bresenham's line algorithm here . Java Code for DDA line drawing algorithm. :- package applet; import java.applet.Applet; import java.awt.Button; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; public class dda extends Applet implements MouseListener, MouseMotionListener, ActionListener {     int x1 = -1, y1 = -1, x2 = -1, y2 = -1,     //coordinates of start and end points             pixelsize = 12,                     //size of pixel in raster             xa = 0, xfin = 0, yfin = 0,         //increment and end point coordinates used in animation             dif = 0;                            //increment on main axis     Button refresh = new Button(&quo

Bresenham line drawing algorithm in java

   My friend Sandip is doing M.Tech from one of the reputed college. His lecturer asked him to do Java code for line drawing using Bresenham s , DDA algorithm. So I am posting this blog for  Bresenham line drawing algorithm in java and you can find line drawing using DDA algorithm  here . Read more about Bresenham's line algorithm  . Java code :-  package applet; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; public class bresenhamLine extends java.applet.Applet implements MouseListener, MouseMotionListener { private static final long serialVersionUID = 1L; int width, height; int x1 = 0, y1 = 0, x2 = 0, y2 = 0, pixelsize = 2; public void init() {      width = getSize().width;      height = getSize().height;      this.addMouseListener(this);       this.addMouseMotionListener(this);     } // draw a