Tuesday, September 29, 2009

Partisipate In Google Summer Of Code(GSOC)


Hey if you are interested in a open source  programming gsoc is the best event to a go to.It is held every year
And is Done by Google and is a great place to learn how to work in open source  programming  there  are  a lot
of benifites.And if you are new to working in big projects its a great event
 watch this vedio to get a good idea


                               



for more information goto http://code.google.com/soc/

Sunday, September 27, 2009

Watch funny people online


Watch the newest comdey online

Release Date: 2009
Duration: 132min
Category: Comdey , Psychological Drama, Showbiz Comedy


Links-


How to include Google maps in your website

hey google maps is a cool tool you can use in your web sites and its very easy to add it but there is one problem
google has rules for free users that they cannot use it for commercial purpose's but u can use it if you are building for fun.if you realy like it and want it you can by it for commercial use
here is the first few steps to get it done
goto    http://code.google.com/apis/maps/ and there will be a link called Sign up for a Google Maps API key. 
to get this feature you should own a gmail account because you have to sign up using you gmail account
then they will give you a API key that you will use in the code to get the service
<script src="http://maps.google.com/maps?file=api&v=2&sensor=true_or_false&key=[put the API key you got here]"
    type="text/javascript"></script>
    <script type="text/javascript">

    function initialize() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        map.setUIToDefault();
      }
    }
</script>
The API key is a very long key
And please read the google terms of service before you use it  http://code.google.com/apis/maps/terms.html


Saturday, September 26, 2009

And Image Viewer using Ajax

This is a image viewer made using Ajax its cool no refreshing and realy quick thats the good
of Ajax
var xmlHttp;
function show(i){
document.getElementById("state").value="1";
document.getElementById("num").value=i;
showPics();
}

function showPics()
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}

xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("Get","getpics",true);
xmlHttp.send(null);
}

function stateChanged()
{
if (xmlHttp.readyState==4)
{
if(xmlHttp.status==200){
var pics=new Array();

var xmlDoc=xmlHttp.responseXML.documentElement;
var links = xmlDoc.getElementsByTagName("picture");
var state= document.getElementById("state").value;
var num = document.getElementById("num").value;

for ( var i = 0; i < 3; ++i )
{
try{
pics[i] = links[i].childNodes[0].nodeValue.toString();



}catch(err){
break;
}

}


if(state=="0"){
for(x in pics){

var l=(++x);



document.getElementById("pic"+l).src="./images/"+pics[--x];
}
}else{

document.getElementById("pict").src="./images/"+pics[--num];
}


}
}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}

</script>
<input type="hidden" name="name" value="0" id="state"/>
<input type="hidden" name="name" value="" id="num"/>

<pre>
<center><img src="" id="pict" width="344" height="200"/></center>

<%
connection con=new connection();
ResultSet rst=con.getDataP();
rst.last();
int num=rst.getRow();
for(int i=1;i<=num;i++){            out.print("&ltimg src="+""+" width="+"128"+" onclick="+"show("+i+");"+" height="+"133"+" id="+"pic"+i+"<");            }          %>  
You should have a connection class to connect to a database (here i used mysql and the Ide was netbeans) this code should do the job to get data
public ResultSet getDataP(){
ResultSet rst=null;
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost/[name of the database]","root","[your mysql password");
Statement stm=con.createStatement();
rst=stm.executeQuery("select * from [name of the table]");
}catch(Exception e){

}
return rst;
}
And for the command xmlHttp.open("Get","getpics",true); to work you should have a servlet that converts the database info to xml format
lets name it getPics.java
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/xml");
PrintWriter out = response.getWriter();
response.setHeader("Cache-Control","no-cache");
try {

connection con=new connection();
ResultSet rst=con.getDataP();
out.print("<userpic>");
while(rst.next()){

out.print("<picID>"+rst.getString(1)+"</picID>");
out.print("<picture>"+rst.getString(2)+"</picture>");


}
out.print("</userpic>");

}catch(Exception e) {

}
} 


Thursday, September 24, 2009

How to make web based a wordpad using gwt



gwt is one of the best ways to develop user frendly web applications this is my first project done using
gwt i want be able to put the complete code because its too long but i'll put a few useful codes

Creating a menuBar(this goes in the class that extends EntryPoint)
MenuBar menu = new MenuBar();
menu.setAutoOpen(true);
menu.setWidth("500px");
menu.setAnimationEnabled(true);

// Create the file menu
MenuBar fileMenu = new MenuBar(true);
fileMenu.setAnimationEnabled(true);
menu.addItem(new MenuItem(constants.cwMenuBarFileCategory(), fileMenu));
String[] fileOptions = {"New","Open","Save","Save As","Print","Print Preview","Exit"};
for (int i = 0; i <fileOptions.length; i++) {
fileMenu.addItem(fileOptions[i], menuCommand);
fileMenu.addSeparator();
}

// Create the edit menu
MenuBar editMenu = new MenuBar(true);
menu.addItem(new MenuItem(constants.cwMenuBarEditCategory(), editMenu));
String[] editOptions = {"Undo","Cut","Copy","Paste","SelcetAll","Clear"};
for (int i = 0; i <editOptions.length; i++) {
editMenu.addItem(editOptions[i], menuCommand);
}

}

Now menuCommand is were you put the coding for the action when the link is clicked you will have to useone for each here i only used one.first make another class
CommandHere.java

Command menuCommand = new Command() {


public void execute() {
Window.alert("you just clicked it");
}
};

public Command getMenuCommand() {
return menuCommand;
}



Using a dialogBox to insert Bullets into a text area and how to use popups to make it user frendly

Button bullets=new Button();
RichTextArea ta=new RichTextArea();
final DecoratedPopupPanel bulletpop=new DecoratedPopupPanel(true, false);
bulletpop.ensureDebugId("cwBasicPopup-simplePopup");
bulletpop.setWidth("10px");
bullets.addMouseOverHandler(new MouseOverHandler() {

public void onMouseOver(MouseOverEvent event) {
int left = 620;
int top = 55;
bulletpop.setPopupPosition(left, top);

bulletpop.setWidget(new Label("bullets"));
bulletpop.show();
}

});
bullets.addMouseOutHandler(new MouseOutHandler() {

public void onMouseOut(MouseOutEvent event) {
bulletpop.hide();
}
});
bullets.addClickListener(new ClickListener() {

public void onClick(Widget sender) {
ta.getExtendedFormatter().insertUnorderedList();

}
});

my first post

hi guys this is my first post just for checking

pulasthi

Amazon Deals