tag:blogger.com,1999:blog-75281809854198467722024-03-13T10:32:00.953-07:00Saatvi's WeblogThis blog discusses all the work i have carried out on various subjects of my interest..Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-7528180985419846772.post-26511327815096581792008-10-13T20:00:00.000-07:002008-10-25T03:54:02.391-07:00Do u know Daknet??? Wireless Point to Point Connectivity??<div style="text-align: justify;">Information delivery and communication efficiency in rural and remote areas in a developing country is the main concern of this article. Here we see how wirelless networks can achieve this point to point conectivity while providing the broadband access to remote areas at very low prices. <span style="font-weight: bold;">"Daknet"</span> is an initiative of this kind which has been successfully implemented and functioning even in some rural parts on India.<br /><br />DakNet, is an ad hoc network that uses wireless technology to provide asynchronous digital connectivity,is an evidence that the marriage of wireless and asynchronous service may be the beginning of a road to universal broadband connectivity. Developed by MIT Media Lab researchers, DakNet has been successfully deployed in remote parts of both India and Cambodia. The DakNet wireless network takes advantage of the existing communications and transportation infrastructure to distribute digital connectivity to outlying villages lacking a digital communications infrastructure. <span style="font-weight: bold;">How is that achieved?</span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFHleyzXR0RAuhxo-gxS5uMBRWKV7X8yt9a4WSZyS4JgZNIO5Nc0TVs7HRiKBsgx9Pe-lTD1qz6Hq8PnwZvR1TaHdzSn5q0ym3-ei1VnmkMPm6_-AJFw-R-5aFY2jBSsrpRu7MgOuu0no/s1600-h/map-daknet.bmp"><img style="cursor: pointer; width: 320px; height: 208px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFHleyzXR0RAuhxo-gxS5uMBRWKV7X8yt9a4WSZyS4JgZNIO5Nc0TVs7HRiKBsgx9Pe-lTD1qz6Hq8PnwZvR1TaHdzSn5q0ym3-ei1VnmkMPm6_-AJFw-R-5aFY2jBSsrpRu7MgOuu0no/s320/map-daknet.bmp" alt="" id="BLOGGER_PHOTO_ID_5261035586238877570" border="0" /></a><br /><br />The above figure illustrates the Daknet concept that has been applied in real time. Instead of relaying information over long distances which would be expensive and consume more power, Daknet makes use of short point -to-point links to transmit data between the Kiosks in each village and portable storage devices call Mobile Access Points (MAP). Mounted on and powered by a bus, a motorcycle, or even a bicycle with a small generator, a MAP physically transports data among public kiosks and private communications devices (as an intranet) and between kiosks and a hub (for nonreal- time Internet access). Low-cost WiFi radio transceivers automatically transfer the data stored in the MAP at high bandwidth for each point-topoint connection.<br /><br />1)As the MAP-equipped vehicle comes within range of a village WiFi-enabled kiosk, it automatically senses the wireless connection and then uploads and downloads tens of megabytes of data.<br /><br />2)When a MAP-equipped vehicle comes within range of an Internet access point (the hub), it automatically synchronizes the data from all the rural kiosks, using the Internet.<br /><br />These steps are repeated each time a MAP equipped vehicle passes through the village which enables low cost wireless network and seamless connectivity. Even a single vehicle passing by a village once per day is sufficient to provide daily information services and the connection quality is also high. Daknet also incorporates means for seamless scalability in future when the village's ecconomy grows and people can afford to spend more and they will also be able to obtain real time communication services.<br /><br />Even local entrepreneurs currently are using DakNet connections to make e-services like e-mail and voice mail available to residents in rural villages. Daknet concept has helped many more initiatives in India like the Bhoomi initiative. Bhoomi, an initiative to computerize land records. Daknet helps on this a lot. A detailed article on Daknet and other initiatives which has enabled digital connectivity in remote areas through wireless networks is available here.<br /><br /><a href="http://www.keepandshare.com/doc/view.php?id=867331&da=y">http://www.keepandshare.com/doc/view.php?id=867331&da=y</a><br /><br /><br /><br /><br /><br /><br /></div>Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com2tag:blogger.com,1999:blog-7528180985419846772.post-77071635815817565622008-09-16T22:24:00.000-07:002008-09-16T22:55:26.368-07:00Using Sun's Wireless ToolKit for CDLC to develop a simple J2ME App<div style="text-align: justify;"><span style="font-family:arial;">The Sun Java Wireless Toolkit (formerly known as J2ME Wireless Toolkit) is a set of tools for creating Java applications that run on devices compliant with the </span><a style="font-family: arial;" href="http://java.sun.com/products/jtwi/">Java Technology for the Wireless Industry (JTWI, JSR 185)</a><span style="font-family:arial;"> specification and the Mobile Service Architecture (MSA, JSR 248) specification. It consists of build tools, utilities, and a device emulator. The application, a MIDlet, was designed for the Mobile Information Device Profile, one of the Java ME specifications. here we write and deploy a normal servlet and hook it up with a MIDlet to run the same app in a mobile device. we can test it using the emulator provided in the toolkit.</span><br /><br /><span style="font-family:arial;">First prepare for a normal web app deployment using Tomcat 4.1 or above. the folowing code just counts the number of hits and displays it to the user.</span><br /></div><pre>import javax.servlet.http.*;<br />import javax.servlet.*;<br />import java.io.*;<br /><br />public class HitServlet extends HttpServlet {<br />private int mCount;<br /><br />public void doGet(HttpServletRequest request,<br />HttpServletResponse response)<br />throws ServletException, IOException {<br />String message = "Hits: " + ++mCount;<br /><br />response.setContentType("text/plain");<br />response.setContentLength(message.length());<br />PrintWriter out = response.getWriter();<br />out.println(message);<br />}<br />}<br /></pre><div style="text-align: justify;"><span style="font-family:arial;">Compile and deploy the servlet using configurations in the web.xml as its done </span><span style="font-family:arial;">usually.Test the application by providing the URL specified in the web.xml.now we'l </span><span style="font-family:arial;">connect the servlet with the MIDlet.Install the wireless Toolkit and create a new </span><span style="font-family:arial;">project </span><code>HelloSuite</code><span style="font-family:arial;">. The following shows the Toolkit interface.</span><br /></div><pre><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8kJ020-C7Tp5LcxY7BhGU-_fTrvA5G_ZxiZfugbeV7zu7vrzLX_vCkSnoMBuV8J5F58fda0H_IVXDMSLdaDSqZ57kB8I1WYHV03NRhFowVyIr4yDhzY0Wv3CLezU5p4owODBZvvS_jaw/s1600-h/wireless.bmp"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8kJ020-C7Tp5LcxY7BhGU-_fTrvA5G_ZxiZfugbeV7zu7vrzLX_vCkSnoMBuV8J5F58fda0H_IVXDMSLdaDSqZ57kB8I1WYHV03NRhFowVyIr4yDhzY0Wv3CLezU5p4owODBZvvS_jaw/s320/wireless.bmp" alt="" id="BLOGGER_PHOTO_ID_5246860451604514626" border="0" /></a><br /></pre><div style="text-align: justify;">The window will show where you have to store the source code files after creating the project.<br />Savethe below code as <code>HitMIDlet.java</code> inside the <code>apps/HelloSuite/src</code> directory underneath the Sun Java Wireless Toolkit root directory.<br /></div><pre>import java.io.*;<br /><br />import javax.microedition.io.*;<br />import javax.microedition.lcdui.*;<br />import javax.microedition.midlet.*;<br /><br />public class HitMIDlet<br />extends MIDlet<br />implements CommandListener {<br />private Display mDisplay;<br />private Form mMainForm;<br />private StringItem mMessageItem;<br />private Command mExitCommand, mConnectCommand;<br /><br />public HitMIDlet() {<br />mMainForm = new Form("HitMIDlet");<br />mMessageItem = new StringItem(null, "");<br />mExitCommand = new Command("Exit", Command.EXIT, 0);<br />mConnectCommand = new Command("Connect",<br /> Command.SCREEN, 0);<br />mMainForm.append(mMessageItem);<br />mMainForm.addCommand(mExitCommand);<br />mMainForm.addCommand(mConnectCommand);<br />mMainForm.setCommandListener(this);<br />}<br /><br />public void startApp() {<br />mDisplay = Display.getDisplay(this);<br />mDisplay.setCurrent(mMainForm);<br />}<br /><br />public void pauseApp() {}<br /><br />public void destroyApp(boolean unconditional) {}<br /><br />public void commandAction(Command c, Displayable s) {<br />if (c == mExitCommand)<br /> notifyDestroyed();<br />else if (c == mConnectCommand) {<br /> Form waitForm = new Form("Waiting...");<br /> mDisplay.setCurrent(waitForm);<br /> Thread t = new Thread() {<br /> public void run() {<br /> connect();<br /> }<br /> };<br /> t.start();<br />}<br />}<br /><br />private void connect() {<br />HttpConnection hc = null;<br />InputStream in = null;<br />String url = getAppProperty("HitMIDlet.URL");<br /><br />try {<br /> hc = (HttpConnection)Connector.open(url);<br /> in = hc.openInputStream();<br /><br /> int contentLength = (int)hc.getLength();<br /> byte[] raw = new byte[contentLength];<br /> int length = in.read(raw);<br /><br /> in.close();<br /> hc.close();<br /><br /> // Show the response to the user.<br /> String s = new String(raw, 0, length);<br /> mMessageItem.setText(s);<br />}<br />catch (IOException ioe) {<br /> mMessageItem.setText(ioe.toString());<br />}<br />mDisplay.setCurrent(mMainForm);<br />}<br />}<span style="font-weight: bold;"><br /></span><br /></pre><div style="text-align: justify;"><span style="font-family:arial;">There are two other things to configure to get </span><code style="font-family: arial;">HitMIDlet</code><span style="font-family:arial;"> working. First, you need to tell the toolkit about this new MIDlet. Click on </span><span style="font-family:arial;">Settings...</span><span style="font-family:arial;">, then select the </span><span style="font-family:arial;">MIDlets</span><span style="font-family:arial;"> tab. Click on </span><span style="font-family:arial;">Add</span><span style="font-family:arial;"> and fill in "HitMIDlet" for both the MIDlet name and class name. You can leave </span><span style="font-family:arial;">Icon</span><span style="font-family:arial;"> blank. Click on </span><span style="font-family:arial;">OK</span><span style="font-family:arial;"> and you should see </span><code style="font-family: arial;">HitMIDlet</code><span style="font-family:arial;"> listed.<br /><br />click on </span><span style="font-family:arial;">Settings...</span><span style="font-family:arial;">, then select the </span><span style="font-family:arial;">User Defined</span><span style="font-family:arial;"> tab. Click on the </span><span style="font-family:arial;">Add</span><span style="font-family:arial;"> button. Fill in the property name as </span><span style="font-family:arial;">HitMIDlet.URL</span><span style="font-family:arial;">; the value should be the URL that invokes </span><code style="font-family: arial;">HitServlet</code><span style="font-family:arial;">, the same URL you used in a browser to test the servlet. When you're finished, click on </span><span style="font-family:arial;">OK</span><span style="font-family:arial;"> to dismiss the project settings window.<br />Click on Build button and then Run button to run the application. you will see the emulator now..launch and connect and u will see the same result you saw in the webbrowser earlier as shown below..</span><br /></div><pre><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6UmHTVV_WTAaDrV9kiOcBWgXQJK0aoPKe0H_p0FrlZ75HXSsb8ALreUTsNYJB9t5a0QTSEpTT4zcsLDlngwSoAmi2IiGhxRXsbn_oDLRLOrhAM747X33rnkHTwrmCabX5zMBaAnmhvDA/s1600-h/mob.JPG"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6UmHTVV_WTAaDrV9kiOcBWgXQJK0aoPKe0H_p0FrlZ75HXSsb8ALreUTsNYJB9t5a0QTSEpTT4zcsLDlngwSoAmi2IiGhxRXsbn_oDLRLOrhAM747X33rnkHTwrmCabX5zMBaAnmhvDA/s320/mob.JPG" alt="" id="BLOGGER_PHOTO_ID_5246862518066529122" border="0" /></a><br /></pre>Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com1tag:blogger.com,1999:blog-7528180985419846772.post-54869168841368097122008-08-03T00:10:00.000-07:002008-08-03T00:55:50.990-07:00Mounting Devices on Linux<div style="text-align: justify;">Before accessing a hard disk or any other storage medium in Linux or UNIX they should be mounted. Note that there is no concept of mounting in windows platforms. Mount allows you to merge two file systems. Mounting of file systems are done with mount command.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdV9a5niWqPpXRHX0dxAbXJE1h_0g6zKfDD6UfaNp-LTGc2EnM7uH_zFtFfjQn0nLC9Xr6Kyw5Fht0smNkbOH-s5nawfufJVUJ6shXmwEvIIIvIPduC1MPDKwqNVWCzcs09brP05pmYLY/s1600-h/mount.bmp"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdV9a5niWqPpXRHX0dxAbXJE1h_0g6zKfDD6UfaNp-LTGc2EnM7uH_zFtFfjQn0nLC9Xr6Kyw5Fht0smNkbOH-s5nawfufJVUJ6shXmwEvIIIvIPduC1MPDKwqNVWCzcs09brP05pmYLY/s320/mount.bmp" alt="" id="BLOGGER_PHOTO_ID_5230187953145854226" border="0" /></a><br />The figure shows the unix file system before mounting and after mounting.<br /><br /><span style="font-weight: bold;">The Mount command </span><br />Mount command has many options and hence little complex. But most of the time you will be able to mount file systems easily with few options. Mount command takes following general format.<br />mount -t filesystem_type -o mount_options /dev/device_file /mnt/mount_point<br /><br />Usually we don't specify t option because kernel can usually identify the file system type by looking at partition table. The o options are also optional.We can unmount a device by it's device file name or by the mount point.<br />#umount /dev/sda<br />#umount /mnt/flash<br /><br /><span style="font-weight: bold;">Mounting a CD ROM/DVD ROM</span><br />Following command tells the kernel to auto detect (t auto) file system type and mount the device /dev/cdrom on /mnt/cdrom.<br /><span>#mount -t auto /dev/cdrom /mnt/cdrom</span><br /><br />If mounting fails, check whether you have a /mnt/cdrom directory, you can do it by using ,<br /><span>#ls -l /mnt/cdrom</span><br /><br />If it is not there then create it,<br /><span>#mkdir /mnt/cdrom</span><br /><br />Now try the mount command if it fails again check whether you have /dev/cdrom. If it does not exist, try<br /><span>#dmesg | grep -i cdrom</span> to find out the device file.<br /><br />Now you can retry the command assuming that /dev/hdb is your CD ROM drive.<br /><span>#mount -t auto /dev/hdb /mnt/cdrom</span>.<br /><br /><span style="font-weight: bold;">Mounting a floppy, USB drive and windows partition<br /></span>You can mount floppy as root user with following command.<br /><span>#mount -t auto /dev/fd0 /mnt/floppy</span><br /><br />If you get any error follow steps given earlier.<br />For USB drive, as root user<br /><span>#mount -t vfat /dev/sda1 /mnt/usb</span><br /><br />If you get any error follow steps given above. If you still get error saying that /dev/sda is not a valid block device then check whether the disk is partitioned. You can do this with fdisk command.<br /><span>#fdisk -l /dev/sda</span><br /><br />If you still find problems restart your hotplug sub system and remove and reinsert the device.<br /><span>#/etc/init.d/hotplug restart</span><br /><br />When mounting DOS/Windows partitions first make sure whether it is fat formated or ntfs the following commands can be used.<br /><span>#mount -t vfat /dev/hda1 /mnt/windows</span><br /><span>#mount -t ntfs /dev/hda5 /mntwinxp</span><br /><br />If you want to mount so that all users can read and write, you may want to try:<br /><span>#mount -t vfat -o user,rw,exec,umask=000 /dev/hda1 /mnt/c</span><br /><br />“-o user,rw,exec,umask=000” gives every body all the permission to all the files on your partition.<br /><br /><span style="font-weight: bold;">Mounting a loopback device</span><br />Create a file containing all zeros. A 10MB file.<br /><span>#dd if=/dev/zero of=myblock.img bs=1k count=1024</span><br /><br />Now attach this to loop back device and format.<br /><span>#losetup /dev/loop0 myblock.img</span><br /><span>#mkfs -t vfat /dev/loop0</span><br /><br />Now we can mount the device by using the file as the device.<br /><span>#mount -o loop myblock.img /mnt/loop</span><br /><br /><span style="font-weight: bold;">How can you allow a normal user to mount a device?</span><br />All you have to do is adding an entry to the /etc/fstb file It has the following format.<br /><file> <mount> <type> <options> <dump> <pass><br /><span>/dev/sda1 /mnt/usb vfat user,rw 0 0</span><br /><br /></div>Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com4tag:blogger.com,1999:blog-7528180985419846772.post-40249208563008945182008-07-20T21:42:00.000-07:002008-07-20T22:52:55.904-07:00A complete chat program<span style="font-weight: bold;">ChatClient.java</span><br /><br />import java.net.*;<br />import java.io.*;<br /><br />public class ChatClient implements Runnable<br />{<br /> static String command; <br /> Socket socket;<br /> static final int portNumber=1666;<br /> Thread commReader=null;<br /><br /> BufferedReader input;<br /> PrintStream output;<br /><br /> String alias=null;<br /> boolean logging=true;<br /><br /> public static void main(String[] argv) throws IOException<br /> {<br /> InetAddress clientAddr;<br /> if(argv.length==0)<br /> clientAddr=InetAddress.getLocalHost();<br /> else<br /> clientAddr=InetAddress.getByName(argv[0]);<br /> System.out.println("Connecting to Chat Server at "+clientAddr);<br /> ChatClient cc=new ChatClient(clientAddr);<br /> Thread t=new Thread(cc);<br /> t.start();<br /> }<br /><br /> public ChatClient(InetAddress adx)<br /> {<br /> CommandReader cr=new CommandReader(this);<br /> commReader=new Thread(cr);<br /> command="xXx";<br /> try<br /> {<br /> socket=new Socket(adx,portNumber);<br /> input=new BufferedReader(new InputStreamReader(socket.getInputStream()));<br /> output=new PrintStream(socket.getOutputStream());<br /> commReader.start();<br /> }<br /> catch(IOException e)<br /> {<br /> System.out.println("Abnormal chat client socket condition:"+e);<br /> }<br /> }<br /><br /> public void run()<br /> {<br /> try<br /> {<br /> doLoop();<br /> input.close();<br /> output.close();<br /> socket.close();<br /> System.exit(0);<br /> }<br /> catch(IOException e)<br /> {<br /> System.out.println("Abnormal chat client socket condition:"+e);;<br /> }<br /><br /> }<br /><br /> public void doLoop() throws IOException<br /> {<br /> String nullString=new String("xXx");<br /> String data=nullString;<br /> while(true)<br /> {<br /><br /> synchronized(command)<br /> {<br /> <br /> if(!command.equals("xXx"))<br /> {<br /> data=command;<br /> //reset<br /> command="xXx";<br /> <br /> }<br /> } //end synch<br /><br /> if(!data.equals("xXx"))<br /> {<br /> if(logging)<br /> {<br /> //first msg<br /> logging=false;<br /> alias=data;<br /> System.out.println(">>Logging as:"+alias);<br /> output.println("S"+alias); //Starting new chat<br /> }<br /> else<br /> {<br /> if(data.equals("exit"))<br /> {<br /> System.out.println(">>Exiting Chat.");<br /> output.println("X"+alias);<br /> break;<br /> }<br /> else if(data.equals("/list"))<br /> {<br /> System.out.println(">>list of connected users:");<br /> output.println("L"+alias);<br /> break;<br /> }<br /> else if(data.equals("/help"))<br /> {<br /> System.out.println(">>Help on Chat commands:");<br /> output.println("H"+alias);<br /> break;<br /> }<br /> else<br /> {<br /> System.out.println(">>Sending msg:"+data);<br /> output.println("D"+data); //sending data<br /> }<br /> }<br /><br /> }<br /><br /> data=input.readLine();<br /> if(!data.equals("xXx"))<br /> {<br /> System.out.println("<<"+data);<br /> }<br /> data=nullString;<br /> }<br /> }<br /><br />}<br /><br /><br /><span style="font-weight: bold;">ChatDaemon.java</span><br /><br />import java.net.*;<br />import java.io.*;<br /><br />public class ChatDaemon implements Runnable<br />{<br /> static final int maxClients=20;<br /> static final int portNumber=1666;<br /> static int numClients=0;<br /> ChatServer[] chatters;<br /> Thread me;<br /><br /> SharedMsg sharedMsg;<br /><br /> public static void main(String[] argv)<br /> {<br /> ChatDaemon cd=new ChatDaemon();<br /> }<br /><br /> public ChatDaemon()<br /> {<br /> sharedMsg=new SharedMsg(this);<br /> chatters=new ChatServer[maxClients];<br /> //start sending<br /> me=new Thread(this);<br /> me.start();<br /><br /> try<br /> {<br /> listen();<br /> }<br /> catch(IOException e)<br /> {<br /> System.out.println("Abnormal socket condition:"+e);<br /> }<br /> }<br /><br /> public void listen() throws IOException<br /> {<br /> ServerSocket ss=null;<br /> ss=new ServerSocket(portNumber);<br /> Socket chatSocket=null;<br /> System.out.println("...listening for connections..");<br /> while(true)<br /> {<br /> chatSocket=ss.accept();<br /> ChatServer ct=allocThread(chatSocket);<br /> synchronized(System.out)<br /> {<br /> System.out.println("Allocated new chat server");<br /> }<br /> }<br /><br /> }<br /><br /> ChatServer allocThread(Socket s)<br /> {<br /> if(numClients<maxClients)<br /> {<br /> ChatServer ct=new ChatServer(s,sharedMsg,numClients);<br /> chatters[numClients]=ct;<br /> Thread t=new Thread(ct);<br /> t.start();<br /> numClients++;<br /> return ct;<br /> }<br /> else<br /> return null;<br /> }<br /><br /> public void run()<br /> {<br /> char broad=(char)-1;<br /> String dataNull=new String(broad+"xXx");<br /> while(true)<br /> {<br /><br /> for(int i=0;i<numClients;i++)<br /> if(chatters[i].alive())<br /> chatters[i].newMsg(dataNull);<br /> }<br /> }<br /><br /> public void refresh()<br /> {<br /> String data=sharedMsg.get();<br /> synchronized(System.out)<br /> {<br /> System.out.println("RECEIVED:"+data);<br /> }<br /> for(int i=0;i<numClients;i++)<br /> {<br /> if(chatters[i].alive())<br /> chatters[i].newMsg(data);<br /> }<br /> }<br />}<br /><br /><br /><span style="font-weight: bold;">ChatServer.java</span><br /><br />import java.net.*;<br />import java.io.*;<br /><br />public class ChatServer implements Runnable<br />{<br /> int index=-1;<br /> SharedMsg sharedMsg;<br /> Socket socket;<br /><br /> DataInputStream input;<br /> PrintStream output;<br /><br /> String alias="";<br /> boolean running=false;<br /><br /> boolean alive()<br /> {<br /> return running;<br /> }<br /><br /> public ChatServer(Socket s,SharedMsg sm,int idx)<br /> {<br /> index=idx;<br /> sharedMsg=sm;<br /> socket=s;<br /> try<br /> {<br /> input=new DataInputStream(socket.getInputStream());<br /> output=new PrintStream(socket.getOutputStream(),true);<br /> <br /> }<br /> catch(IOException e)<br /> {<br /> System.out.println("Abnormal chat server socket condition 1:"+e);;<br /> }<br /> }<br /><br /> public void run()<br /> {<br /> try<br /> {<br /> doLoop();<br /> input.close();<br /> output.close();<br /> socket.close();<br /> }<br /> catch(IOException e)<br /> {<br /> System.out.println("Abnormal chat server socket condition 2:"+e);;<br /> }<br /> }<br /><br /> public void doLoop() throws IOException<br /> {<br /> String line=null;<br /> String data=null;<br /> char command='W';<br /> char ind=(char)index; //index of sender of msg<br /> char broad=(char)-1; //goes to everybody<br /><br /> running=true;<br /> while(true)<br /> {<br /> //loop: reads in msg, write it onto sharedmsg<br /> line=input.readLine();<br /> command=line.charAt(0);<br /> data=line.substring(1);<br /><br /> if(command=='X')<br /> {<br /> sharedMsg.put(broad+"User: "+data+" Logged Out");<br /> break;<br /> }<br /> else if(command=='S')<br /> {<br /> //first msg<br /> alias=data;<br /> sharedMsg.put(broad+"New User Logged: "+alias);<br /> }<br /> else<br /> {<br /> sharedMsg.put(ind+"From "+alias+": "+data);<br /> }<br /> }<br /> //exiting<br /> running=false;<br /> }<br /><br /> //new message arrived, send it over the socket<br /> public void newMsg(String msg)<br /> {<br /> char mitt=msg.charAt(0);<br /> String data=msg.substring(1);<br /><br /> if(mitt!=(char)index)<br /> {<br /> //send<br /> output.println(data);<br /> output.flush();<br /><br /> synchronized(System.out)<br /> {<br /> System.out.print(".\b");<br /> System.out.flush();<br /> }<br /> }<br /> }<br />}<br /><br /><br /><span style="font-weight: bold;">CommandReader.java</span><br /><br />import java.io.*;<br /><br />/**<br /> * Reads from keyboard (STDIN)<br /> */<br />class CommandReader implements Runnable<br />{<br /> ChatClient chatClient;<br /> DataInputStream user;<br /><br /> public CommandReader(ChatClient cc)<br /> {<br /> chatClient=cc;<br /> user=new DataInputStream(System.in);<br /> }<br /><br /> public void run()<br /> {<br /> System.out.println("Waiting for client side commands...");<br /><br /> String com=null;<br /> while(true)<br /> {<br /> //reads from keyboard<br /> try<br /> {<br /> com=user.readLine();<br /> }<br /> catch(IOException e)<br /> {<br /> System.out.println("Abnormal reading from user:"+e);<br /> }<br /> <br /> synchronized(chatClient.command)<br /> {<br /> chatClient.command=com;<br /> }<br /> }<br /> }<br />}<br /><br /><br /><span style="font-weight: bold;">SharedMsg.java</span><br /><br />public class SharedMsg<br />{<br /> String data="";<br /> ChatDaemon chatDaemon=null;<br /><br /> SharedMsg(ChatDaemon cd)<br /> {<br /> chatDaemon=cd;<br /> <br /> }<br /><br /> synchronized String get()<br /> {<br /> return data;<br /> }<br /><br /> synchronized void put(String s)<br /> {<br /> data=s;<br /> chatDaemon.refresh();<br /> }<br />}Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com0tag:blogger.com,1999:blog-7528180985419846772.post-65853683988299626552008-07-12T03:27:00.000-07:002008-07-14T21:17:12.321-07:00Creating 2D Shapes in Java<div style="text-align: justify;">The Java2D API provides advanced two-dimensional graphics capabilities for programmers who require detailed and complex graphical manipulations. it includes features for processing line art, text and images in packages java.awt, java.awt.image, java.awt.color, java.awt.font, java.awt.geom, java.awt.print and java.awt.image.renderable.<br /><br />The code shown below constructs a ring of five pointed stars constructed from straight lines and complex curves.<br /></div><br />import java.awt.Color;<br />import java.awt.Graphics;<br />import java.awt.Graphics2D;<br />import java.awt.geom.GeneralPath;<br /><br />import javax.swing.JFrame;<br /><br />public class shapes extends JFrame{<br /><br />//set window's title bar string, background color and dimensions<br />public shapes(){<br /><br />super("Drawing 2D shapes");<br /><br />getContentPane().setBackground(Color.WHITE);<br />setSize(400,400);<br />setVisible(true);<br />}<br /><br />//draw general paths<br />public void paint(Graphics g){<br />super.paint(g);<br />int xPoints[]={55,67,109,73,83,55,27,37,1,43};<br />int yPoints[]={0,36,36,54,96,72,96,54,36,36};<br /><br />Graphics2D g2d = (Graphics2D)g;<br /><br />//create a star from a series of points<br />GeneralPath star = new GeneralPath();<br /><br />//set the initials coordinates of the General Path<br />star.moveTo(xPoints[0],yPoints[0]);<br /><br />//create the star<br />for(int count =1; count<xPoints.length; count++)<br />star.lineTo(xPoints[count],yPoints[count]);<br /><br />//close the shape<br />star.closePath();<br /><br />//translate the origin to (200,200)<br />g2d.translate(200,200);<br /><br />//rotate around origin and draw stars in random colors<br />for(int count =1; count<=20; count++){<br /><br /><br />//rotate coordinate system<br />g2d.rotate(Math.PI/10.0);<br /><br />//set random drawing color<br />g2d.setColor(new Color(<br />(int)(Math.random()*256),<br />(int)(Math.random()*256),<br />(int)(Math.random()*256)));<br /><br />//draw filled star<br />g2d.fill(star);<br />}<br />}<br /><br />public static void main(String args[]){<br /><br />shapes application = new shapes();<br />application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<br /><br />}<br /><br />}<br /><br /><span style="font-weight: bold;">Run the program and view the result!!!</span>Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com1tag:blogger.com,1999:blog-7528180985419846772.post-87484646522087878762008-07-11T20:35:00.000-07:002008-07-11T21:03:21.854-07:00Kerberos... providing strong cryptography<div style="text-align: justify;"><span style="font-family:arial;">The Internet is an insecure place as we all know. Many of the protocols used in the Internet do not provide any security. Tools to identify passwords off of the network are in common use by malicious hackers. Thus, applications which send an unencrypted password over the network are extremely vulnerable. Some sites attempt to use firewalls to solve their network security problems. Unfortunately, firewalls assume that hackers are on the outside, which is often a very bad assumption. Most of the really damaging incidents of computer crime are carried out by insiders.Kerberos was created by MIT as a solution to these network security problems. The Kerberos protocol uses strong cryptography so that a client can prove its identity to a server (and vice versa) across an insecure network connection. After a client and server has used Kerberos to prove their identity, they can also encrypt all of their communications to assure privacy and data integrity as they go about their business.Lets see how it works.</span><br /></div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlzSGemASfdD_H4Eu1arF6bxvNCdAc8WHFJ56CFQJ99wYACuPyeQu5MYUE6lqOEmtysME6988FOLvoquoPaRFHVqapWJTeriaqcXS6tCEUh10cHdo-8sdydrlmm9bpCMF3mUdp3ayKuo8/s1600-h/kerberos1.bmp"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlzSGemASfdD_H4Eu1arF6bxvNCdAc8WHFJ56CFQJ99wYACuPyeQu5MYUE6lqOEmtysME6988FOLvoquoPaRFHVqapWJTeriaqcXS6tCEUh10cHdo-8sdydrlmm9bpCMF3mUdp3ayKuo8/s320/kerberos1.bmp" alt="" id="BLOGGER_PHOTO_ID_5221969206108597922" border="0" /></a><br /><span style="font-weight: bold;">Auth</span> - Authenticator<span style="font-weight: bold;"> , SK1</span> - Session Key , <span style="font-weight: bold;">TGT</span> - Ticket<br /><br /><div style="text-align: justify;"><div style="text-align: justify;">The client asks the authentication server for a ticket to the ticket-granting server(TGS). The authentication server looks up the client in its database, then generates a session key (SK1) for use between the client and the TGS. Kerberos encrypts the SK1 using the client’s secret key. The authentication server also uses the TGS’s secret key (known only to the authentication server and the TGS) to create and send the user a ticket-granting ticket (TGT).<br /></div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYR0lf_l9OlzYZ7TGrAUb9dBj7B5mTUUe6DD3RGTU0N4apbETxtm-ny8Ofh0cNlr5b4WcJDxWK40ymkX1LwoRknav5dD9PZJF-G3jxOtiOeshhsYkDTJlTp8FJHbL_Xu1h93BoSQczJDU/s1600-h/kerberos2.bmp"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYR0lf_l9OlzYZ7TGrAUb9dBj7B5mTUUe6DD3RGTU0N4apbETxtm-ny8Ofh0cNlr5b4WcJDxWK40ymkX1LwoRknav5dD9PZJF-G3jxOtiOeshhsYkDTJlTp8FJHbL_Xu1h93BoSQczJDU/s320/kerberos2.bmp" alt="" id="BLOGGER_PHOTO_ID_5221969799086468594" border="0" /></a><br /><br /><div style="text-align: justify;"><div style="text-align: justify;">The client decrypts the message and recovers the session key, then uses it to create an authenticator containing the user’s name, IP address and a time stamp. The client sends this authenticator, along with the TGT, to the TGS, requesting access to the target server. The TGS decrypts the TGT, then uses the SK1 inside the TGT to decrypt the authenticator. It verifies information in the authenticator, the ticket, the client’s network address and the time stamp. If everything matches, it lets the request proceed. Then the TGS creates a new session key (SK2) for the client and target server to use, encrypts it using SK1 and sends it to the client. The TGS also sends a new ticket containing the client’s name, network address, a time stamp and an expiration time for the ticket — all encrypted with the target server’s secret key — and the name of the server.<br /></div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4_3b0gO-pTyWJqUcBCRVpVnjtb31onuV7txCQ2uTk74jw_UNG162VdCesXmUGOd8huiba3rqcfg7Yu8DtX92ZEoiJWXquucabFXLjb9WXISYSVO0PnvM6quFaM-7LSG8alahsefv44v8/s1600-h/kerberos3.bmp"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4_3b0gO-pTyWJqUcBCRVpVnjtb31onuV7txCQ2uTk74jw_UNG162VdCesXmUGOd8huiba3rqcfg7Yu8DtX92ZEoiJWXquucabFXLjb9WXISYSVO0PnvM6quFaM-7LSG8alahsefv44v8/s320/kerberos3.bmp" alt="" id="BLOGGER_PHOTO_ID_5221970342437499570" border="0" /></a><br /><br /><div style="text-align: justify;"><div style="text-align: justify;">The client decrypts the message and gets the SK2. Finally ready to approach the target server, the client creates a new authenticator encrypted with SK2. The client sends the session ticket (already encrypted with the target server’s secret key) and the encrypted authenticator. Because the authenticator contains plaintext encrypted with SK2, it proves that the client knows the key. The encrypted time stamp prevents an eavesdropper from recording both the ticket and authenticator and replaying them later. The target server decrypts and checks the ticket, authenticator, client address and time stamp. For applications that require two-way authentication, the target server returns a message consisting of the time stamp plus 1, encrypted with SK2. This proves to the client that the server actually knew its own secret key and thus could decrypt the ticket and the authenticator.<br /></div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHvH7tyBBvEZScftnaGcSPJGswP4IgnV0Dk6M4rrtQzFCg40N2GTc0o8nGVLtNqUHBPkDIG0S-UElAPk6lqDl92_Xr9TnRxULrC1nxjkSpmge7kcuIJAl5u8i27RhA4gO1Te7Eok9n6AA/s1600-h/kerberos4.bmp"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHvH7tyBBvEZScftnaGcSPJGswP4IgnV0Dk6M4rrtQzFCg40N2GTc0o8nGVLtNqUHBPkDIG0S-UElAPk6lqDl92_Xr9TnRxULrC1nxjkSpmge7kcuIJAl5u8i27RhA4gO1Te7Eok9n6AA/s320/kerberos4.bmp" alt="" id="BLOGGER_PHOTO_ID_5221970883390917186" border="0" /></a><br /><br /><div style="text-align: justify;">The target server knows that the client is who he claims to be, and the two now share an encryption key for secure communications. Because only the client and target server share this key, they can assume that a recent message encrypted in that key originated with the other party.<br /></div><br /></div></div></div>Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com0tag:blogger.com,1999:blog-7528180985419846772.post-54944248457099313382008-07-09T20:19:00.000-07:002008-07-25T20:24:49.250-07:00Combination Generator program in java<div style="text-align: justify;">This is a problem related to computability and complexity in computer science...Some problems in computer science cannot be resolved completely. Finding a correct solution might be impossible at some circumstances. Have you heard of these problems? Sorting, Partition problem, Halting problem. Here i present a case regarding partition problem.<br /><br />The program takes numbers at run time and breaks it in to two sets where the sum of the elements in the two sets are equal. It should display the result, or it should say there are no such two sets in the given numbers. The time taken to get the solution against the numbers entered at run time is calculated. I started with 10 numbers and waited for the result. Then increased it to 14,16 and so on.. I hope you got a clear picture of what is happening now. Below is the program written in java. The timer runs in the program itself.<br /><br />import java.math.BigInteger;<br />import java.io.*;<br />import java.awt.event.*;<br />import java.util.*;<br />import java.text.*;<br /><br />public class CombinationGenerator {<br /><br />private int[] a;<br />private int n;<br />private int r;<br />private BigInteger numLeft;<br />private BigInteger total;<br /><br /><br />// Constructor<br /><br />public CombinationGenerator (int n, int r) {<br /><br />if (r > n) {<br /> throw new IllegalArgumentException ();<br />}<br />if (n < 1) {<br /> throw new IllegalArgumentException ();<br />}<br />this.n = n;<br />this.r = r;<br />a = new int[r];<br />BigInteger nFact = getFactorial (n);<br />BigInteger rFact = getFactorial (r);<br />BigInteger nminusrFact = getFactorial (n - r);<br />total = nFact.divide (rFact.multiply (nminusrFact));<br />reset ();<br />}<br /><br />// Reset<br /><br />public void reset () {<br />for (int i = 0; i < a.length; i++) {<br /> a[i] = i;<br />}<br />numLeft = new BigInteger (total.toString ());<br />}<br /><br />// Return number of combinations not yet generated<br /><br />public BigInteger getNumLeft () {<br />return numLeft;<br />}<br /><br />// Are there more combinations?<br /><br />public boolean hasMore () {<br />return numLeft.compareTo (BigInteger.ZERO) == 1;<br />}<br /><br />// Return total number of combinations<br /><br />public BigInteger getTotal () {<br />return total;<br />}<br />// Compute factorial<br /><br />private static BigInteger getFactorial (int n) {<br />BigInteger fact = BigInteger.ONE;<br />for (int i = n; i > 1; i--) {<br /> fact = fact.multiply (new BigInteger (Integer.toString (i)));<br />}<br />return fact;<br />}<br /><br />// Generate next combination (algorithm from Rosen p. 286)<br /><br />public int[] getNext () {<br /><br />if (numLeft.equals (total)) {<br /> numLeft = numLeft.subtract (BigInteger.ONE);<br /> return a;<br />}<br /><br />int i = r - 1;<br />while (a[i] == n - r + i) {<br /> i--;<br />}<br />a[i] = a[i] + 1;<br />for (int j = i + 1; j < r; j++) {<br /> a[j] = a[i] + j - i;<br />}<br /><br />numLeft = numLeft.subtract (BigInteger.ONE);<br />return a;<br /><br />}<br /><br />public static void main(String d[]) throws IOException{<br /><br /> long startTime; // Starting time of program, in milliseconds.<br /> long endTime; // Time when computations are done, in milliseconds.<br /> double time; // Time difference, in seconds.<br /><br /><br />//get the number of numbers in set<br />InputStreamReader reader = new InputStreamReader (System.in);<br />BufferedReader input = new BufferedReader(reader);<br />System.out.print("Enter the numer of numbers in you set=");<br />String p = input.readLine();<br />int q =Integer.parseInt(p);<br />//put the elements to an array<br /><br />int sum_of_array=0;<br />int[] indices;<br />int elements[]=new int[q];<br />int half_of_set=0;<br />int sum_of_elm=0;<br /><br />for(int r=0; r<q; r++){<br /><br />System.out.print("Enter the numbers of your set=");<br />String c = input.readLine();<br />int e =Integer.parseInt(c);<br /> elements[r]= e;<br />}<br />//get the sum of array<br />for(int x=0; x<elements.length; x++){<br /> sum_of_array=sum_of_array+elements[x];<br />}<br />int reminder=sum_of_array % 2;<br />half_of_set=sum_of_array/2;<br /><br />//<br />if(reminder==0){<br />startTime = System.currentTimeMillis();<br />for(int len_of_array=1;len_of_array<=elements.length;len_of_array++ ){<br /><br /> CombinationGenerator x = new CombinationGenerator (elements.length, len_of_array);<br /> StringBuffer combination;<br /> while (x.hasMore ()) {<br /><br /> combination = new StringBuffer ();<br /> indices = x.getNext ();<br /> for (int i = 0; i < indices.length; i++) {<br /><br /> sum_of_elm=sum_of_elm+elements[indices[i]];<br /> <br /> }<br /> <br /> if(half_of_set==sum_of_elm){<br /> <br /> <br /> //print the sub set element<br /><br /> for(int g=0; g<indices.length; g++){<br /> System.out.println("numbers in your one sub set are ="+elements[indices[g]]+",");<br /> <br /> }<br /> endTime = System.currentTimeMillis();<br /> time = (endTime - startTime) / 1000.0;<br /> System.out.println(time);<br /><br /> return;<br /> }<br /> <br /> sum_of_elm=0;//set the sum of elm to 0<br /> }<br />}<br />endTime = System.currentTimeMillis();<br />time = (endTime - startTime) / 1000.0;<br /> System.out.println(time);<br /><br />}else{<br /> System.out.println("given number set can not divide to two equal sets:Sorry");<br /><br />}<br />}<br /><br />}<br /></div><br /><div style="text-align: justify;">The maximum number of numbers i could enter was 36..i couldn't go beyond that..the program stopped running....it explains the complexity of the problem. Finally the output was shown in a graph as below..<br /></div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXE5vYB6UspX5kPV5ZPEFaQ3_7aPznrqAW_hmOT-r_cEscotNGJfG8FiMqKVx0aIKuUtpsDYQJ3PxkHqdXzH8gnVW9uftWm-o45hFUD5hqonKY23YU4KOwwMMc2clesd7qMToyKwlOiDM/s1600-h/compl.bmp"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXE5vYB6UspX5kPV5ZPEFaQ3_7aPznrqAW_hmOT-r_cEscotNGJfG8FiMqKVx0aIKuUtpsDYQJ3PxkHqdXzH8gnVW9uftWm-o45hFUD5hqonKY23YU4KOwwMMc2clesd7qMToyKwlOiDM/s320/compl.bmp" alt="" id="BLOGGER_PHOTO_ID_5221226452356933826" border="0" /></a>Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com0tag:blogger.com,1999:blog-7528180985419846772.post-29414668328972073022008-07-07T23:02:00.000-07:002008-07-07T23:47:51.589-07:00ISD Models..Systematic Approach vs Evolutionary<div style="text-align: justify;">Instructional Systems Design, the most widely used methodology for developing new training programs. Today most of the e-learning programs are designed based on ISD. It is also known as Instructional Systems Design & Development (ISDD), the Systems Approach to Training (SAT), or just Instructional Design (ID). There are many ISD models that are used widely, like ADDIE, ASSURE, Dick & Carey Model etc. These are based on a systematic approach to online training.<br /><br />But what do you think is the most effective approach? Systematic approach or the Evolutionary one? Some of the benefits of a system approach are characteristic of all systematic approaches. The ISD model is a management tool that makes courseware production more efficient. Effective training programs are more likely because the ISD model increases the probability that the courseware will match the objectives and not veer off in a different direction. Approach is scientific as it is empirical and can be replicated. The courseware can be improved and strengthened through data collection and analysis.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghXDY6o33sX-Ck6VeHu9Gzjo-NW_1XmpRD-JNQlRjnuxyVDhELsCoAzHP4zE4Ltnq_IKgOB-rNKUqtCFLxlV8GRDZNbTQe84Niwf9nOFOnQROLtNWqjriIEA11zK-1FhheKjNpHCXb6nA/s1600-h/addie.bmp"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghXDY6o33sX-Ck6VeHu9Gzjo-NW_1XmpRD-JNQlRjnuxyVDhELsCoAzHP4zE4Ltnq_IKgOB-rNKUqtCFLxlV8GRDZNbTQe84Niwf9nOFOnQROLtNWqjriIEA11zK-1FhheKjNpHCXb6nA/s320/addie.bmp" alt="" id="BLOGGER_PHOTO_ID_5220530448607064050" border="0" /></a><br /><br />The figure shows the ADDIE model used widely for the systematic ISD approach..<br />Even though it has so many advantages they say it’s too systematic. A frequent criticism is that it is too time-consuming to be practical in the real world. There are practical challenges with a purely systemic design approach in the management of resources. In most cases, training programs must be developed under a fixed -- and often limited -- budget and schedule. While it is very easy to allocate people and time to each step in the ISD model, it is harder to plan deliverables when there are no distinct steps in the process.<br /><br /><span style="font-weight: bold;">Introducing Evolutionary & Rapid Prototyping Approach</span><br /><br />An evolutionary approach includes both deterministic and incremental systems, in contrast to the systems approach, which is entirely deterministic. This approach is particularly appropriate for situations where there is limited past experience from which to draw guidance. A major benefit is that it enables a designer to test new ideas without making a long term commitment. A major disadvantage is that it lacks a defined set of steps. Also, it is difficult to specify in advance the amount of time and money that will be needed to complete significant events and it is logically impossible to specify the outcome of an evolutionary process.<br /><br />Rapid Prototyping Design (RPD) uses a more formative model that is based on usability testing of prototypes. Results of usability tests on the prototypes are used to modify and improve the product. This model shares many attributes in common with the ISD model, and stresses the importance of iterative analysis and evaluation.<br /><br />The conclusion is, if you know exactly what you are doing and exactly what needs to be built, then you are using the ISD (static or waterfall) method (however, this rarely happens in the real training world). When the subject is new, controversial, etc., then more prototypes are going to be built, hence you are more into RPD.<br /><br /></div>Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com0tag:blogger.com,1999:blog-7528180985419846772.post-20834562621946172112008-07-01T01:55:00.000-07:002008-07-01T02:38:58.973-07:00Write exceptions into error log(C#.net)Try this console application code to write exceptions in to a log file.<br /><br /><span style="color: rgb(51, 204, 255);">using </span>System;<br /><span style="color: rgb(51, 204, 255);">using </span>System.Collections.Generic;<br /><span style="color: rgb(51, 204, 255);">using </span>System.Text;<br /><span style="color: rgb(51, 204, 255);">using </span>System.IO;<br /><br /><span style="color: rgb(51, 204, 255);">namespace </span>ConsoleApplication1<br />{<br /><span style="color: rgb(51, 51, 255);"> <span style="color: rgb(51, 204, 255);">class </span></span>errorlogs<br />{<br /><br /><span style="color: rgb(51, 153, 153);"> String </span>filepath = <span style="color: rgb(255, 255, 204);">"</span><span style="color: rgb(255, 255, 204);">C:/Documents and Settings/error/log.txt</span><span style="color: rgb(255, 255, 204);">"</span>; //path of errorlog file<br /><br /><span style="color: rgb(51, 51, 255);"><span style="color: rgb(0, 204, 204);">static void</span> </span>Main(<span style="color: rgb(51, 204, 255);">string</span>[] args)<br />{<br />errorlogs er = <span style="color: rgb(51, 204, 255);">new </span>errorlogs();<br /><span style="color: rgb(51, 204, 255);">object </span>i = <span style="color: rgb(51, 204, 255);">new </span><span style="color: rgb(51, 153, 153);">IOException</span>();<br />er.writelog(i); //passing the ioexception<br />}<br /><br /><span style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 204, 255);"> public void</span> </span>writelog<span style="color: rgb(51, 204, 255);">(</span><span style="color: rgb(51, 204, 255);">object </span>a){<br /><br />try{<br /><span style="color: rgb(51, 153, 153);">StreamWriter </span>logWriter;<br /><span style="color: rgb(51, 204, 255);">if</span>(<span style="color: rgb(51, 153, 153);">File</span>.Exists(filepath)){<br /> logWriter = <span style="color: rgb(51, 153, 153);">File</span>.AppendText(filepath);<br />}<br /><span style="color: rgb(51, 204, 255);">else</span>{<br /> logWriter = <span style="color: rgb(51, 153, 153);">File</span>.CreateText(filepath);<br /> <br />}<br />logWriter.WriteLine();<br />logWriter.WriteLine(<span style="color: rgb(255, 255, 204);">"------"</span>+ <span style="color: rgb(51, 153, 153);">DateTime</span>.Now +<span style="color: rgb(255, 255, 204);">"--------"</span>);<br />logWriter.WriteLine();<br />logWriter.WriteLine(a);<br />logWriter.WriteLine();<br />logWriter.WriteLine(<span style="color: rgb(255, 255, 204);">"--------------------------------"</span>);<br />logWriter.Close();<br /> <br />}<br /><span style="color: rgb(51, 204, 255);">catch</span>(<span style="color: rgb(51, 153, 153);">Exception </span>e){<br /> <span style="color: rgb(51, 153, 153);">Console</span>.Out.WriteLine(<span style="color: rgb(255, 255, 204);">"Error in writing errorlog:"</span> +e.Message); <br />}<br />}<br /><br />}<br />}Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com0tag:blogger.com,1999:blog-7528180985419846772.post-10491537027360944582008-06-23T00:05:00.000-07:002008-06-23T02:05:20.394-07:00Sendmail<div style="text-align: justify;">Sendmail is a mail transfer agent (MTA) that is a well-known project of the open source, free software and Unix communities, which is distributed both as free software and proprietary software. Its also called the mail server daemon. Other mail server daemons include qmail, postfix, exim, mmdf, smail etc. server daemons looks after the receiving incoming mail and delivers outgoing mail.<br /><br /><span style="font-weight: bold;">Sendmail configuration files</span><br />All sendmail related configuration files have to be put in /etc/mail directory.<br /><span style="font-weight: bold;"></span><span style="font-weight: bold;"><br />1)/etc/mail/access</span><br />It specifies what hosts or IP addresses have access to the local mail server and what kind of access(OK, REJECT,RELAY) they have.<br />OK - allowed to send mail to the host as long as mail's final destination is the local machine.<br />REJECT - reject for all mail connections<br />RELAY - allowed to send mail for any destination through this server.<br />e.g.<br /> cyberterror.com 550 we dont expect mail from you<br /> a.source.of.spam REJECT<br /> cyberspammer.com OK<br /> 128.32 RELAY<br /><br /><span style="font-weight: bold;">2)etc/mail/aliases<br /></span>This database contains a list of virtual mailboxes that are expanded to other user(s), files, programs or other aliases.<br />e.g<br />root: ajantha<br />webmaster:kamal,lal<br />customers: :include: /etc/mail/lists/customer-list<br /><br />The last alias causes how to keep a list of users for an aliases in an external file.<br /><br /><span style="font-weight: bold;">3)/etc/mail/local-host-names<br /></span>Consist list of host names that sendmail is to accept as the local mail host. if the mail server was to accept mail for the domains cmb.ac.lk and ucsc.cmb.ac.lk the above file will contain:<br />cmb.ac.lk<br />ucsc.cmb.ac.lk<br /><br /><span style="font-weight: bold;">4)/etc/mail/sendmail.cf<br /></span>It controls the overall behavior of sendmail. The master sendmail configuration file can be built from m4 macros.<br /><br /><span style="font-weight: bold;">5)/etc/mail/virtusertable<br /></span>This maps email addressse for virtual domains and mailboxes to real mail boxes. The mail boxes can be local, remote, aliases defined.<br />e.g<br />info@msc.cmb.ac.lk ajantha<br />info@bit.cmb.ac.lk saman<br /><br /><br /><span style="font-weight: bold;"></span><br /><br /><br /><br /><br /></div>Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com0tag:blogger.com,1999:blog-7528180985419846772.post-78379297348270068432008-06-17T00:05:00.000-07:002008-06-17T00:33:20.255-07:00Containers and ServletsA Servlet container is a specialized web server that supports Servlet execution. They map the request URLs to specific servlets..but how? Containers know the interface between the servlets and the web server. no specific API is needed for this.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSG16lm868yc1AY3tdMJI0HbRoKTWvPL5NXMzJPKyv2UitwK9leDDfEvo70NYwGFjxZ7Dumnao_KXcWgJVGRFy9T9TO8vFljrmH17Nwj6AHrOWG2Hm6VwlUsO5JxxJQIOurLMc510359w/s1600-h/Picture1.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSG16lm868yc1AY3tdMJI0HbRoKTWvPL5NXMzJPKyv2UitwK9leDDfEvo70NYwGFjxZ7Dumnao_KXcWgJVGRFy9T9TO8vFljrmH17Nwj6AHrOWG2Hm6VwlUsO5JxxJQIOurLMc510359w/s320/Picture1.jpg" alt="" id="BLOGGER_PHOTO_ID_5212746854830809426" border="0" /></a><br />The container receives a HTTP request.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD5LCdkH6flt9hhnf-7LSwt7H-jkqjZzH35jNosgqUbukMOERJMy1cHPnZeiHb72457IKXBo4aC8V98IwSLNbfe0nyGxUOQ5A5om7-VCHX-OZL3wQeNE-5p77D0-Ny65l-EuDYwvgfItg/s1600-h/Picture2.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD5LCdkH6flt9hhnf-7LSwt7H-jkqjZzH35jNosgqUbukMOERJMy1cHPnZeiHb72457IKXBo4aC8V98IwSLNbfe0nyGxUOQ5A5om7-VCHX-OZL3wQeNE-5p77D0-Ny65l-EuDYwvgfItg/s320/Picture2.jpg" alt="" id="BLOGGER_PHOTO_ID_5212747129797047042" border="0" /></a><br />The container creates request and response objects.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYxG6HcZ_PSoiJ2n_YcVuMj4vKsRhEIecmcQXtjqonZ0-R4UCe1gVlTQHGyHV4wG13jl0hSLTzuNU39WI-EPKy1oYmLFXbG4Gnm1zepcZTdTMQXk0a0OPtfa7SMpbNPDdetThEiKMaqw4/s1600-h/Picture3.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYxG6HcZ_PSoiJ2n_YcVuMj4vKsRhEIecmcQXtjqonZ0-R4UCe1gVlTQHGyHV4wG13jl0hSLTzuNU39WI-EPKy1oYmLFXbG4Gnm1zepcZTdTMQXk0a0OPtfa7SMpbNPDdetThEiKMaqw4/s320/Picture3.jpg" alt="" id="BLOGGER_PHOTO_ID_5212747132232457506" border="0" /></a><br /><div style="text-align: justify;">It initiates a new thread to handle the request. Then passes the two objects in to the thread.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8Mm-JToAtqe0nEu6kQEnORyXJTuYdjr5es54JapEfMnycfm-6tTjyZ7Kz1Kdc5bv2XSfemDUTCc8cRU0TplI59eKX0CyXxeC0IVvR3rw2rtjp-MeuV-VY2XHqME-HuathHH5Zd9Okp4Y/s1600-h/Picture4.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8Mm-JToAtqe0nEu6kQEnORyXJTuYdjr5es54JapEfMnycfm-6tTjyZ7Kz1Kdc5bv2XSfemDUTCc8cRU0TplI59eKX0CyXxeC0IVvR3rw2rtjp-MeuV-VY2XHqME-HuathHH5Zd9Okp4Y/s320/Picture4.jpg" alt="" id="BLOGGER_PHOTO_ID_5212747692337629090" border="0" /></a><br />Container calls the service() method of the servlet which would call the doGet() or doPost() methods, based on the request type.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQmTrN992_NKUVeVoVueXqdxUHYuzNXwr0qTBdxZy9cMfqeH6yZ9H3AX4AQD4GKQgoH8nZdDCuO1kU4F84kkr9adWXw8BeJPQOd1PK2lYCC0xdRaNHs6b2XfYaq-tQl0CrmsmkyPPiZ_I/s1600-h/Picture5.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQmTrN992_NKUVeVoVueXqdxUHYuzNXwr0qTBdxZy9cMfqeH6yZ9H3AX4AQD4GKQgoH8nZdDCuO1kU4F84kkr9adWXw8BeJPQOd1PK2lYCC0xdRaNHs6b2XfYaq-tQl0CrmsmkyPPiZ_I/s320/Picture5.jpg" alt="" id="BLOGGER_PHOTO_ID_5212747710528107714" border="0" /></a><br />The doGet() method returns the result, writes the HTML and stuffs it into the response object.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmBdI6kvbhfM4l3QjUbgEDkh4BgSMXCKjJPFh8vnOHLzyg0foY67Mf_sxvSjzZyvCnQ0oX3EfxyU_4kLVfzqFLn1DMIy65FwGfjgYvukoSzH7g_f_-CHAnIedFIvbVxUklSPJOJKKXUFM/s1600-h/Picture6.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmBdI6kvbhfM4l3QjUbgEDkh4BgSMXCKjJPFh8vnOHLzyg0foY67Mf_sxvSjzZyvCnQ0oX3EfxyU_4kLVfzqFLn1DMIy65FwGfjgYvukoSzH7g_f_-CHAnIedFIvbVxUklSPJOJKKXUFM/s320/Picture6.jpg" alt="" id="BLOGGER_PHOTO_ID_5212747727777869138" border="0" /></a><br /><div style="text-align: justify;">The HTML page is sent back to the client, the response, request objects are deleted and the thread is killed.<br /><br />Hope this would have given a clear picture on what happens to the request for a servlet. but still there is more. Here the business logic and presentation are tied together which is not a very good OO practice. you can separate them using JSPs.. MVC improves on it even more...We'll come back to that later..<br /></div><br /><br /><br /></div>Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com0tag:blogger.com,1999:blog-7528180985419846772.post-26750574202503524712008-06-11T00:59:00.000-07:002008-06-18T22:38:56.485-07:00ERP Systems Overview<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuckxn0o0C5xUArqNAnPIeoDl8QPEuVLw_jlS1ADL0Fp54aJNJ4G2pmpYgcnmND-Nq3GdkvntuwST4pr3yumxWS1laz1Pd6yKcnPORdoc3MeNcLPphrtu0wtatfSiWimX03uBrzSKnggI/s1600-h/erp-image.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuckxn0o0C5xUArqNAnPIeoDl8QPEuVLw_jlS1ADL0Fp54aJNJ4G2pmpYgcnmND-Nq3GdkvntuwST4pr3yumxWS1laz1Pd6yKcnPORdoc3MeNcLPphrtu0wtatfSiWimX03uBrzSKnggI/s320/erp-image.jpg" alt="" id="BLOGGER_PHOTO_ID_5210538566660088834" border="0" /></a><br /><span style="font-family:arial;">The above figure shows an ERP model.<br /><br /></span><div style="text-align: justify;"><span style="font-family:arial;">When we say ERP Systems it’s basically the integration of several data sources and processes of an organization in to a unified system with a unified database to store various system modules. Modular software design is the core concept of ERP systems which allows individual components/modules to be added to the system. These modular software designs link into the common database, so that all of the information between is accessible in real time. ERP systems integrated separate systems of an organization which led to minimization of specialties in an organization.</span><br /></div><br /><div style="text-align: justify;"><span style="font-family:arial;">When most people refer to the “core” ERP applications or “modules,” they mean the back-office capabilities to manage human resources, accounting and finance, manufacturing, and project-management functions. However, major ERP suites from Oracle, PeopleSoft, and SAP now provide much more—including modules for sales force automation, business intelligence, customer relationship management, and supply chain management. We had a practical assignment at university where we had to plan an ERP system for the Sri Lankan Railways. The document is available here. It includes study of the existing system, the proposed system features, the risks and rewards in implementing it etc. I’m sure it will provide a practical view.</span><br /></div><br /><a href="http://www.keepandshare.com/doc/view.php?id=622579&da=y"><span style="text-decoration: underline;">http://www.keepandshare.com/doc/view.php?id=622579&da=y</span></a><br /><br /><span style="font-weight: bold;font-family:arial;" >Characteristics of ERP systems</span><br /><br /><div style="text-align: justify;"><span style="font-family:arial;">• In ERP systems, information is often recorded in a form that cannot be read without the use of a computer.</span><br /><br /><span style="font-family:arial;">• Financial and business information is often generated automatically by ERP systems based on data previously entered, without further human instructions.</span><br /><br /><span style="font-family:arial;">• Errors that might be observed in non-ERP systems may go undetected because of the reduced human involvement in computerized processing. There is a danger that errors in processing may be applied to a large number of transactions</span><span style="font-family:arial;"> without being noticed.</span><br /></div><br /><div style="text-align: justify;"><span style="font-family:arial;">• With proper controls, ERP systems can be more reliable than non-ERP systems. This is because ERP systems subject all data to the same procedures and controls. Non-ERP systems are subject to random human error. Although computer processing will usually be consistent, errors may still occur; for example, if the computer is incorrectly programmed.</span><br /></div><br /><div style="text-align: justify;"><span style="font-family:arial;">• But still it is difficult to make changes after an ERP system has been implemented. Therefore, we should be aware of the organization’s plans to introduce significant new systems or to make major modifications to existing systems. It is advisable to review new systems or modifications before implementation so that a preliminary assessment can be made of the adequacy of control procedures, in order to ensure an adequate audit trail, and to plan any necessary changes in the audit approach.</span></div>Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com1tag:blogger.com,1999:blog-7528180985419846772.post-73733213748028445432008-06-09T22:38:00.000-07:002008-06-10T01:48:59.579-07:00Using SSH<div style="text-align: justify;"><span style="font-family:arial;">SSH is a program to log into another computer over a network, to execute commands in a remote machine, and to move files from one machine to another. It provides strong authentication and secure communications over insecure channels. SSH is most useful when logging into a UNIX machine from another machine where the traditional telnet and rlogin programs would not provide password and session encryption.<br /><br />Now we'll take a look at some basic SSH commands in networking.<br /><span style="font-weight: bold;">To login to a remote machine running sshd server</span> you can use the any of the following formats.<br /><br /># ssh -l remote_user host_name_or_ip<br /># ssh remote_user@host_name_or_ip<br />e.g.<br /># ssh -l root 192.248.16.100<br /># ssh bud@server.cmb.ac.lk<br /><br /><span style="font-weight: bold;">To execute a command on the remote machine without logging in explicitly</span> you can use,<br /></span><span style="font-family:arial;"># ssh -l remote_user host_name_or_ip remote_command<br />e.g.<br /># ssh -l bud@192.248.16.100 /usr/bin/x11/xclock<br />It starts the xclock application in the remote machine.<br /><br /><span style="font-weight: bold;">To ftp securely</span> you can use sftp.<br />e.g<br /># sftp bud@192.248.16.100<br /><br />sftp> cd downloads - Used to change directory<br />sftp>mput *.rpm - Used to upload multiple files<br />sftp>mget httpd* - Used to download multiple files<br />sftp>help - See a list of commands<br /><br /><span style="font-weight: bold;">To copy files from one host to another</span> try<br /># scp [-r] source user@remote_host:target<br />e.g.<br /># scp bud@192.248.16.100:/etc/lilo.conf /tmp<br /><br />Still there is SSH server and client configuration and do you knw how to configure passwordless SSH login?<br /><a href="http://www.keepandshare.com/doc/view.php?id=624904&da=y">http://www.keepandshare.com/doc/view.php?id=624904&da=y</a><br /><br /><br /></span></div>Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com0tag:blogger.com,1999:blog-7528180985419846772.post-57532779340195441612008-06-09T02:29:00.000-07:002008-06-09T03:15:35.482-07:00AdventNet QEngine 6 - Web Performance Test Tool<div style="text-align: justify;"><span style="font-family:arial;">Lets have some practical experience on a testing tool.</span> AdventNet QEngine Web Performance Test tool is a powerful, easy-to-use and affordable web load testing tool to quickly test the performance of your web sites and web-based applications. Its automatic analysis enables you to accurately simulate the traffic of thousands of users to identify and isolate performance bottlenecks and optimize user experience within minutes.<br /></div><div style="text-align: justify;"><span style="font-family:Arial;"><span style="font-family:arial;"><br /><span style="font-weight: bold;">Main Features of AdventNet QEngine 6</span><br /></span></span><ul><li><span style="font-family:Arial;"><span style="font-family:arial;">Test Scheduling and Command Line Toolkit</span></span></li><li><span style="font-family:Arial;"><span style="font-family:arial;">Web Performance Testing (Load Testing)</span></span></li><li><span style="font-family:Arial;"><span style="font-family:arial;">Web Services Testing (Functional & Performance)</span></span></li><li><span style="font-family:Arial;"><span style="font-family:arial;">QEngine Issue Tracker</span></span></li><li><span style="font-family:Arial;"><span style="font-family:arial;">QEngine Toolbar for remote record/playback of user actions </span></span></li><li><span style="font-family:Arial;"><span style="font-family:arial;">Browser-based Web testing </span></span></li><li><span style="font-family:Arial;"><span style="font-family:arial;">Jython Test Scripts </span></span></li><li><span style="font-family:Arial;"><span style="font-family:arial;">Environment Independent Tests </span></span></li><li><span style="font-family:Arial;"><span style="font-family:arial;">Powerful Script Editor</span></span></li></ul><span style="font-family:arial;">The basic steps involved in<span style="font-size:100%;"> </span></span><span style=";font-family:arial;font-size:100%;" ><span style="font-size:10;"><span style="font-size:100%;">QEngine Load Testing</span> </span></span><span style="font-family:arial;"> testing are as follows:<br /></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqPJtar0cntEO_yz6vuXGkStS-QdF3rJqvmwJPHCVkT75ZcBDWhbSuQqLePE1MbgnrwGsdkwvLBgHM5t4etzYsYLhe1ObaUTAO69uzAUw8Poa2b-vyR93pkJH_IGF-dzrnAYoTWssLAJU/s1600-h/process.bmp"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqPJtar0cntEO_yz6vuXGkStS-QdF3rJqvmwJPHCVkT75ZcBDWhbSuQqLePE1MbgnrwGsdkwvLBgHM5t4etzYsYLhe1ObaUTAO69uzAUw8Poa2b-vyR93pkJH_IGF-dzrnAYoTWssLAJU/s320/process.bmp" alt="" id="BLOGGER_PHOTO_ID_5209815271705014786" border="0" /></a><br /><br />The detail picture of testing with QEngine is provided here.<br /><a href="http://www.keepandshare.com/doc/view.php?id=622522&da=y">http://www.keepandshare.com/doc/view.php?id=622522&da=y</a><br /><br />Now we'll take a look at some of the outputs of the load testing with QEngine.<br /><span style="font-weight: bold;"><br />Transaction Status Summary </span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRMs72hBhZFKEARK3zii-EOCvWhX_DxupOYTEo_GjZ5oVNh6nII7tCk3DkTpiu17QeSv7GrooF-AWgX4Lci24H0YAie_NQcrDe2ZQSi_lP51hgSU6k2t4WMrCIi-KCXY6L4medALDp0-k/s1600-h/Picture2.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRMs72hBhZFKEARK3zii-EOCvWhX_DxupOYTEo_GjZ5oVNh6nII7tCk3DkTpiu17QeSv7GrooF-AWgX4Lci24H0YAie_NQcrDe2ZQSi_lP51hgSU6k2t4WMrCIi-KCXY6L4medALDp0-k/s320/Picture2.jpg" alt="" id="BLOGGER_PHOTO_ID_5209817268068555554" border="0" /></a><br /><br /><div style="text-align: justify;">The above figure shows a transaction status summary graph provides a snapshot of Requests pending, Response pending & Response status such as, download started and download completed. If pending Request / Response is too high then check the test duration in Summary Report and the error distribution graph in Error Report to identify the problem.<br /></div><br /><span style="font-weight: bold;">Hits Per Second<br /><br /></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfsRUbkJR5CWeAGgykB5iphXq8SqsxhGuh2U9hJGLlIiE8KQ86COY64M_F14Pk5lWoT0ad6qOrKj4Gv2NGllVIi8n6KhlySNPCJDFhIRM8RAS3Wcxc8R8zm2jp1ITf3TM0LEpG7yxO9O4/s1600-h/Picture3.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfsRUbkJR5CWeAGgykB5iphXq8SqsxhGuh2U9hJGLlIiE8KQ86COY64M_F14Pk5lWoT0ad6qOrKj4Gv2NGllVIi8n6KhlySNPCJDFhIRM8RAS3Wcxc8R8zm2jp1ITf3TM0LEpG7yxO9O4/s320/Picture3.jpg" alt="" id="BLOGGER_PHOTO_ID_5209818405094200786" border="0" /></a><br /><span style=";font-family:Arial;font-size:10;" ></span><br />This graph shows the number of HTTP/S requests made by Virtual users to the server during each second of the run.<br /><br /><b><span style=";font-family:Arial;font-size:10;" ><span style="font-size:100%;">URL wise Response Time Report<br /><br /></span></span></b><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimPZ76ae_GSYP4VqbRT-6rAxgwcWzHxGluemnnidyr6_3VcJ3bwWMP4mj8vEY5B0dzmTTKLRB3lPimKkjSkvzPaCgTktmQWXVUkUH9FIn7xWhRkNJPVYRu3mRyhaKXpUNjrpiq2GvSGkI/s1600-h/Picture4.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimPZ76ae_GSYP4VqbRT-6rAxgwcWzHxGluemnnidyr6_3VcJ3bwWMP4mj8vEY5B0dzmTTKLRB3lPimKkjSkvzPaCgTktmQWXVUkUH9FIn7xWhRkNJPVYRu3mRyhaKXpUNjrpiq2GvSGkI/s320/Picture4.jpg" alt="" id="BLOGGER_PHOTO_ID_5209818876247061538" border="0" /></a><br /><br /><span style="font-family:arial;">More details about QEngine testing is available in the link provided above. The report also speaks of another load and stress testing tool called WAPT 5.0 that provides with an easy-to-use, consistent and cost-effective way of testing web sites, web servers, and intranet applications with web interfaces.</span><br /><br /><span style=";font-family:Arial;font-size:10;" ></span><br /><br /><span style=";font-family:Arial;font-size:10;" ><!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter"> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"> <v:f eqn="sum @0 1 0"> <v:f eqn="sum 0 0 @1"> <v:f eqn="prod @2 1 2"> <v:f eqn="prod @3 21600 pixelWidth"> <v:f eqn="prod @3 21600 pixelHeight"> <v:f eqn="sum @0 0 1"> <v:f eqn="prod @6 1 2"> <v:f eqn="prod @7 21600 pixelWidth"> <v:f eqn="sum @8 21600 0"> <v:f eqn="prod @7 21600 pixelHeight"> <v:f eqn="sum @10 21600 0"> </v:formulas> <v:path extrusionok="f" gradientshapeok="t" connecttype="rect"> <o:lock ext="edit" aspectratio="t"> </v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style="'width:414.75pt;"> <v:imagedata src="file:///C:\DOCUME~1\MFAHAD~1\LOCALS~1\Temp\msohtml1\04\clip_image001.png" title=""> </v:shape><![endif]--><!--[if !vml]--><!--[endif]--></span></div>Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com0tag:blogger.com,1999:blog-7528180985419846772.post-90716950072896341512008-06-09T01:15:00.000-07:002008-06-09T03:19:44.884-07:00A Little Survey on Software QA Tools<p class="MsoNormal" style="text-align: justify; line-height: 150%;font-family:arial;"><span style="line-height: 150%;font-size:100%;" >Many modern software systems consist of large sets of heterogeneously developed components. Object-oriented design, component-based software engineering, components off-the-shelf (COTS), design patterns, and open source software facilitate the development tasks, but assuring the quality in scenarios that entail (combinations of) these concepts is problematic.<o:p></o:p></span></p> <p class="MsoNormal" style="text-align: justify; line-height: 150%;font-family:arial;"><span style="line-height: 150%;font-size:100%;" >Basically so many categories of test tools are available in the industry today. Some of the most important categories of these test tools are listed below.</span></p><ul style="font-family:arial;"><li><span style="line-height: 150%;font-size:100%;" >Application Test Tools</span></li><li><span style="line-height: 150%;font-size:100%;" >Web Test Tools</span></li><li><span style="line-height: 150%;font-size:100%;" >Test Management Tools<br /></span></li><li><span style="line-height: 150%;font-size:100%;" >Bug Tracking Tools<br /></span></li><li><span style="line-height: 150%;font-size:100%;" >API Test Tools<br /></span></li><li><span style="line-height: 150%;font-size:100%;" >Communications Test Tools<br /></span></li><li><span style="line-height: 150%;font-size:100%;" >Requirements Management Tools<br /></span></li></ul> <p class="MsoNormal" style="text-align: justify; line-height: 150%;font-family:arial;"><span style="line-height: 150%;font-size:100%;" >Most of the test tools are available in open source too. These tools are free. </span><span style="line-height: 150%;font-size:100%;" >There is no need to pay a vendor to use these tools, but they still have a cost of ownership through evaluation, implementation, training and maintenance costs, the same as any software does. But with a handful of commercial vendors dominating the proprietary software testing tools market, make no mistake about it. </span><span style="line-height: 150%;font-size:100%;" ><span style=""><br /></span></span></p><p class="MsoNormal" style="text-align: justify; line-height: 150%;font-family:arial;"> </p><p class="MsoNormal" style="text-align: justify; line-height: 150%;font-family:arial;"><span style="line-height: 150%;font-size:100%;" >The paradox of quality assurance is that, although it’s a key value for every organization, the actions taken to ensure it are often left until late in the lifecycle when budgets are scarce, time is short and there is high pressure to deliver to the market. As a result there are often challenges associated with improving the software development process, reducing costs, improving quality and increasing reliability of planning. But so far the efforts to overcome these challenges are being successfully handled by software QA professionals to best safeguard the quality of good software.<o:p></o:p></span></p> <p class="MsoNormal" style="text-align: justify; line-height: 150%;font-family:arial;"><span style="line-height: 150%;font-size:100%;" >From my viewpoint I found that future of software testing and quality assurance will be doing more on the web. <span style="">The evolution in web development over the past two to three years has ushered in a new set of challenges for software quality professionals across the board; specifically, the emergence of Web 2.0 and the introduction of Ajax and SaaS architectures as new approaches for building rich content applications for the web. Such shifts combined with the need for enterprises to be agile and deliver products to market in shorter product cycles, has dramatically challenged many of the existing testing tools and rendered many old record and replay approaches almost obsolete. A detail survey of mine on these QA tools is attached here. It also consists descriptions of various leading testing tools in market today. <a href="http://www.keepandshare.com/doc/view.php?id=622520&da=y"><br /></a></span></span></p><p class="MsoNormal" style="text-align: justify; line-height: 150%;font-family:arial;"><span style="line-height: 150%;font-size:100%;" ><span style=""><a href="http://www.keepandshare.com/doc/view.php?id=622520&da=y">http://www.keepandshare.com/doc/view.php?id=622520&da=y</a><br /></span></span></p><p class="MsoNormal" style="text-align: justify; line-height: 150%;font-family:arial;"><span style="line-height: 150%;font-size:100%;" ><span style=""> <o:p></o:p></span></span></p> <p class="MsoNormal" style="text-align: justify; line-height: 150%;font-family:arial;"><span style="line-height: 150%;font-size:100%;" >Today it will be impractical to rely too much on human configurations, tests, debugging, and management because software systems today are of very large scale and contain numerous components and users. It is believed that, it is time to bring a new generation of cutting-edge technologies and innovative processes to software testing that will assist software quality professionals in building better software easier in the near future.<o:p></o:p></span></p> <p class="MsoNormal" face="arial" style="text-align: justify; line-height: 150%;"><span style="font-size:100%;"><br /></span><span style="line-height: 150%;font-size:100%;" ><o:p></o:p></span></p> <p class="MsoNormal" style="text-align: justify; line-height: 150%; font-family: arial;"><span style="line-height: 150%;font-size:100%;" ><br /></span></p>Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com0tag:blogger.com,1999:blog-7528180985419846772.post-47203283066015016612008-06-08T20:57:00.000-07:002008-06-08T21:13:27.237-07:00HCI's role in e-learning<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi-PosrGwaeaq-3ALYyzDsgD68-9uj-3AyTucMTLsqioL93p-0JR9e9og8f7BR3MlCShEsXHjzKewHwPHeoaTQj5JnU04QbvH7oSnwX7h09OiEiWjPua4OYlV5wkBRGi4AXfLuOt7uww0/s1600-h/rma0280l.jpg"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi-PosrGwaeaq-3ALYyzDsgD68-9uj-3AyTucMTLsqioL93p-0JR9e9og8f7BR3MlCShEsXHjzKewHwPHeoaTQj5JnU04QbvH7oSnwX7h09OiEiWjPua4OYlV5wkBRGi4AXfLuOt7uww0/s320/rma0280l.jpg" alt="" id="BLOGGER_PHOTO_ID_5209728311083317026" border="0" /></a><span style="font-size:100%;"><br /></span><div style="text-align: justify;"><span style="font-size:100%;">Today the eLearning environment is dramatically changing the way of students, employees and indeed all members of the general public learning new knowledge and performing learning activities. Effective learning occurs where students actively participate in the learning process and when they have ownership of what and how they learn, and are supported in appropriate ways. That is where e-learning has always been successful but still, making elearning sustainable in a traditional education environment involves many challenges.<o:p></o:p></span></div><div style="text-align: justify;"> </div><p class="MsoNormal" style="text-align: justify;font-family:arial;"><span style="font-size:100%;"><o:p></o:p>A major challenge currently faced by e-learning systems’ designers is the development of improved tools better able to engage new learners and sustain their online learning activities any time and anywhere. E-learning systems should be designed in such a way so that<span style=""> </span>its more usable and innovative, supporting creative learning, based on strategies which guides the learners to make the most effective use of the learning content. The approach to e-learning should be</span></p><p class="MsoNormal" style="font-family: arial; text-align: justify;"> </p><ul style="margin-top: 0in; text-align: justify;" type="disc"><li class="MsoNormal" style="font-family:arial;"><span style="font-size:100%;">learner centered<o:p></o:p></span></li><li class="MsoNormal" style="font-family:arial;"><span style="font-size:100%;">digitally minded<o:p></o:p></span></li><li class="MsoNormal" style="font-family:arial;"><span style="font-size:100%;">research based<o:p></o:p></span></li><li class="MsoNormal" style="font-family:arial;"><span style="font-size:100%;">focused on quality<o:p></o:p></span></li><li class="MsoNormal" style="font-family:arial;"><span style="font-size:100%;">innovative and<o:p></o:p></span></li><li class="MsoNormal"><span style=";font-family:TimesNewRoman;font-size:100%;" ><span style="font-family:arial;">providing leadership.</span></span></li></ul><div style="text-align: justify;"><div style="text-align: justify;"><span style="font-family:arial;">Human- Computer Interaction (HCI) theories and methodologies can support the design of appropriate e-learning settings responding to the requirements of today’s e-learning environment which were shown above. It will make e-learning applications smart enough to adapt themselves to the students’ learning styles and to assure high standards of accessibility and usability, in order to make learners’ interaction with the systems as natural and intuitive as possible. In the context of Human-Computer Interaction it is important to consider a perspective that recognizes, respects, values and attempts to accommodate a wide range of human abilities, skills, requirements and preferences in the design of learning material. This automatically reduces the need for a lot of special features. It also encourages individualization, high quality of interaction and, ultimately, end-user acceptability. In short the focus here is always on the human user.</span> <br /></div><span style="font-family:arial;"><br /></span><div style="text-align: justify;"><span style="font-family:arial;">Analysis of learners’ preferred interactions with e-learning environment, and a learner-centered design perspective which takes into account also the typical learning styles shared within the different cultural contexts, are the key factors that would contribute to the successful integration of HCI in e-learning.</span><br /></div><br /><br /></div><p class="MsoNormal" style="text-align: justify;"><br /><span style="font-size:12;"><o:p></o:p></span></p>Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com0tag:blogger.com,1999:blog-7528180985419846772.post-1742822323501818562008-06-08T05:13:00.000-07:002008-06-09T01:53:21.994-07:00Datamining using RapidMiner 4.1<div style="text-align: justify;"><span style="font-family:arial;">Data mining involves searching through databases for correlations and patterns that differ from results that would be anticipated to occur by chance or in random conditions. The practice of data mining in and of itself is neither good nor bad and the use of data mining has become common in many industries. I participated in a datamining assignment which analyzed the export patterns of Gems and Jewelry in Sri Lanka. the tool used was RapidMiner 4.1. Some most important facts were found out in the process.</span><br /></div><span style="font-family:arial;">The process of data mining consists of three stages:<br />(1) the initial exploration,<br />(2) model building or pattern identification with, and<br />(3) deployment<br /><br /><span style="font-weight: bold;">Stage 1: Exploration</span><br /></span><div style="text-align: justify;"><span style="font-family:arial;">This stage usually starts with data preparation which may involve cleaning data, data transformations, selecting subsets of records and - in case of data sets with large numbers of variables ("fields") - performing some preliminary feature selection operations to bring the number of variables to a manageable range<br /><br /></span></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9RpxkZgovQoTcgJGsNaCWYn9HMrYM7VMPvWmYI4q2O3l5vkAoD-J0UPHl1ZWAY0dTF1dnwjmfx_h-YBBB7CHkF9G2i1wI5hQpk5YFkVzj0VixsIoy5Gii4ObPFmzzjUgICA1Qqf6RC2A/s1600-h/analysis.bmp"><img style="cursor: pointer; width: 372px; height: 283px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9RpxkZgovQoTcgJGsNaCWYn9HMrYM7VMPvWmYI4q2O3l5vkAoD-J0UPHl1ZWAY0dTF1dnwjmfx_h-YBBB7CHkF9G2i1wI5hQpk5YFkVzj0VixsIoy5Gii4ObPFmzzjUgICA1Qqf6RC2A/s320/analysis.bmp" alt="" id="BLOGGER_PHOTO_ID_5209488081577961394" border="0" /></a><br /><span style="font-family:arial;">The figure shows a screenshot of a graph which was made on the gem exports using Rapid Miner.</span> <span style="font-family:arial;"><span style="font-weight: bold;"><br /><br />Stage 2: Model building and validation</span><br /></span><div style="text-align: justify;"><span style="font-family:arial;">The dimensional model must suit the requirements of the users and support ease of use for direct access. The model must also be designed so that it is easy to maintain and can adapt to future changes.<br /><br /></span></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV1Ml01bQGi0pFjZL8DDY-xkNkvXTpt7tJKi9Gcr7mbRiNtTtenukGwwGb4qLLSHUqdNSJFw6hHOwdyScfo92baICHe1z1HXkhOVvKPrnfCtIRBN0g5sqMvxPA3C4VynoW9GCub7GLxAs/s1600-h/untitled.bmp"><img style="cursor: pointer; width: 380px; height: 153px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV1Ml01bQGi0pFjZL8DDY-xkNkvXTpt7tJKi9Gcr7mbRiNtTtenukGwwGb4qLLSHUqdNSJFw6hHOwdyScfo92baICHe1z1HXkhOVvKPrnfCtIRBN0g5sqMvxPA3C4VynoW9GCub7GLxAs/s320/untitled.bmp" alt="" id="BLOGGER_PHOTO_ID_5209489583034912386" border="0" /></a><br />The figure shows a 2D Model View of the data.<br /><span style="font-family:arial;"><br /></span><div style="text-align: justify;"><span style="font-family:arial;">The model design must result in a relational database that supports OLAP cubes to provide instantaneous query results for analysts. a typical dimensional model uses a star or snowflake design that is easy to understand and relate to business needs, supports simplified business queries, and provides superior query performance by minimizing table joins.</span><br /></div><span style="font-family:arial;"><br /></span><span style="font-weight: bold;font-family:arial;" >Stage 3: Deployment</span><br /><div style="text-align: justify;"><span style="font-family:arial;">That final stage involves using the model selected as best in the previous stage and applying it to new data in order to generate predictions or estimates of the expected outcome.</span><br /><br /><span style="font-family:arial;">I have attached my datamining asignment report here,<br /><span style="font-size:100%;"><br /></span></span><span style="font-size:85%;"><a href="http://www.keepandshare.com/doc/view.php?id=622494&da=y"><span style="font-size:100%;"><span style="font-family: arial;">http://www.keepandshare.com/doc/view.php?id=622494&da=y</span></span></a><br /><br /></span><br /><span style="font-size:85%;"><br /></span></div><span style="font-family:arial;"><br /></span> <span style="font-family:arial;"><span style="font-weight: bold;"><br /></span><br /><br /></span><a style="font-family: arial;" href="http://www.statsoft.com/textbook/stdatmin.html#deploy"></a>Saatvihttp://www.blogger.com/profile/01175146299820944145noreply@blogger.com0