HashMapKeySet.javapackage net.roseindia.java;import java.util.HashMap;import java.util.Set;public class HashMapKeySet {public static void main(String[] arr) {/* Create object of HashMap */HashMap obHashMap...
World News
Entertainment
Retrieving XML Data Using GWT
package com.google.gwt.sample.simplexml.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import...
sql php code
!--php
$host = "localhost";
$user = "root";
$password = "root";
$database = "komal";
$connection = mysql_connect($host,$user,$password)
or die("Could not connect: ".mysql_error());
mysql_select_db($database,$connection)...
Java read file line by line
import java.io.*;public class ReadFile { public static void main(String[] args) throws Exception { File f = new File("C:/Hello.txt"); if (!f.exists() && f.length()...
Java write to file line by line
import java.io.*;class FileWrite { public static void writeToFile(String text) { try { BufferedWriter bw = new BufferedWriter(new FileWriter(new File( ...
Simple java program
Write a program that prints the following pattern: * *** ***** ******* ***** *** *public class Print{public static void main(String[] args){int i=1;int j;while(i<=7){for(j=1;j<=i;j++)System.out...
PHP displaying the time and date into your timezone
!--php
ECHO "Date using date()fucntion is:"."";
echo date("M d Y H:i:s",mktime(0,0,0,1,1,1998))."";
ECHO "Date using gmdate()fucntion is:"."";
echo gmdate("M d Y H:i:s",mktime(0,0,0,1,1,1998)).""...
ASCII Table
ASCII Table
!--php
session_start();
$table = "";
$table .= "";
$table .= "";
$table .= "";
$table .= "";
$table .= "";
$table .= "";
for($count = 1; $count...
Strings sample source codes
Trim FunctionLeft - ltrim() function !--php $text = "\t\tThese are a few words :) ... "; $trimmed = ltrim($text); // $trimmed = "These are a few words :) ... " $trimmed = ltrim($text," \t."); // $trimmed...
Parsing a Query String
Parsing a Query String!--php $str = "first=value&arr[]=foo bar&arr[]=baz"; parse_str($str); echo $first; // value echo $arr[0]; // foo bar echo $arr[1]; // baz parse_str($str, $output); echo...
Calendar for any month any year
Calendar for any month any year
!--php
#
# *** Set time stamp.Check for month requested(value from request form)
# *** If no value has been set then make it for current month
...
Databases sample source codes
A couple of functions that convert an IP address into its color code
and not-color-code. Useful when viewing an apache log with a mysql result grouped by IP
!--
/*this function converts $ipaddr into...
Graphics sample source codes
2D Line Plot (fully working)!--class plot2D { var $img, $imgWidth, $imgHeight, $fontSize, $fontWidth, $fontHeight, $cBack, $acPlot, $maxCatLen, $aItems, $maxVal, $numItems, $maxNumItems, $maxLinesDesc,...
File Upload Script
!--php
if ( isset( $_FILES['fupload'] ) ) {
print "name: ". $_FILES['fupload']['name'] ."";
print "size: ". $_FILES['fupload']['size']...
Student & Libary database using file& Swing
import javax.swing.*;import javax.swing.event.*;import java.awt.*;import java.awt.event.*;import java.io.*;import javax.swing.text.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.text.*;...
Tic Tac Toe Game in java
import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.undo.CompoundEdit.*;class TicTacToe{ public static void main(String s[]) { UserInterface uf=new UserInterface();...
Subscribe to:
Posts (Atom)