Starting With Java Programming

java programming

In this post I will tell you what I know about java and how to make a hello world program in java ok, now java is a great programming language, it was introduced in 1995. From my experience java is nothing without classes because everything works with classes in java programming, java is a language that can be used in web and desktop, the syntax of java is exactly the same as c# and also the codes are similar to c# too if you go through the java programming history you will see java programming language is a tradition of C & C++, the newest version is JDK 7.
Java originally doesn't have an IDE(Integrated Development Environment) it just have compiler, below is a hello world program in java
public class HelloWorldApp {

    public static void main(String[] args) {
            System.out.println("Hello World - ultimate programming tutorials");
    }

}
The code is for the hello world program now you can see public class HelloWorldApp its the class name, the program should start off with public static void main(string[] args).

I hope you learned something, share with your friends and please let me know if theres any questions.

Java Tutorials

How To Make A IP Analyzer In VB.NET

ultimate programming

This is a good one but its a in console but i hope you will like it and it has not alot code . the program works like when you enter a IP address and press enter key in your keyboard then you will see the class of the ip address and subnet mask and IP binary and network address and at last broadcast address so i hope you will like the features and dont forget you can also make alot features for this if you made anything dont forget to comment it ok lets begin making it now make a console project and name it and when it loading successful then add this code down

How To Draw Border At PictureBox Border In C#

s

hello i am up with this but this is something very small but very useful ok now what this is about , theres are 2button and a openfiledialog and when you click open the openfiledialog will be up so you just can go ahead and select a image and you click the draw button the picturebox out border will be green color .

How To Create A Folder Using C#

hello this is a simple tutorial not actually a tutorial but yah lets begin this is a console application so you dont need any forms you know that ok so create a new console application project and name it now when the coding part is loaded now you just need to understand the code first of all this is the whole code and this is a picture of the application


How To Get SQL Instance Using C#

hello guys this a simple tutorial that will give you the list of SQL servers available on your lan . ok lets begin making this just open c# and make a new project and name it whatever and after form finished loading add a button and change the text  to refresh and add combobox and at last add a label to make the ui beautiful now  add a class and name it getsql.cs
how to get sql instance using c# - adding class getsql

ok now you will see the class in the side bar ok now go to getsql.cs and add this codes

using System;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

//Author : Mohamed Shimran
//Blog : http://www.ultimateprogrammingtutorials.blogspot.com

namespace DBGrep
{
 public class SqlLocator
 {
  [DllImport("odbc32.dll")]
  private static extern short SQLAllocHandle(short hType, IntPtr inputHandle, out IntPtr outputHandle);
  [DllImport("odbc32.dll")]
  private static extern short SQLSetEnvAttr(IntPtr henv, int attribute, IntPtr valuePtr, int strLength);
  [DllImport("odbc32.dll")]
  private static extern short SQLFreeHandle(short hType, IntPtr handle); 
  [DllImport("odbc32.dll",CharSet=CharSet.Ansi)]
  private static extern short SQLBrowseConnect(IntPtr hconn, StringBuilder inString, 
   short inStringLength, StringBuilder outString, short outStringLength,
   out short outLengthNeeded);

  private const short SQL_HANDLE_ENV = 1;
  private const short SQL_HANDLE_DBC = 2;
  private const int SQL_ATTR_ODBC_VERSION = 200;
  private const int SQL_OV_ODBC3 = 3;
  private const short SQL_SUCCESS = 0;
  
  private const short SQL_NEED_DATA = 99;
  private const short DEFAULT_RESULT_SIZE = 1024;
  private const string SQL_DRIVER_STR = "DRIVER=SQL SERVER";
 
  private SqlLocator(){}

  public static string[] GetServers()
  {
   string[] retval = null;
   string txt = string.Empty;
   IntPtr henv = IntPtr.Zero;
   IntPtr hconn = IntPtr.Zero;
   StringBuilder inString = new StringBuilder(SQL_DRIVER_STR);
   StringBuilder outString = new StringBuilder(DEFAULT_RESULT_SIZE);
   short inStringLength = (short) inString.Length;
   short lenNeeded = 0;

   try
   {
    if (SQL_SUCCESS == SQLAllocHandle(SQL_HANDLE_ENV, henv, out henv))
    {
     if (SQL_SUCCESS == SQLSetEnvAttr(henv,SQL_ATTR_ODBC_VERSION,(IntPtr)SQL_OV_ODBC3,0))
     {
      if (SQL_SUCCESS == SQLAllocHandle(SQL_HANDLE_DBC, henv, out hconn))
      {
       if (SQL_NEED_DATA ==  SQLBrowseConnect(hconn, inString, inStringLength, outString, 
        DEFAULT_RESULT_SIZE, out lenNeeded))
       {
        if (DEFAULT_RESULT_SIZE < lenNeeded)
        {
         outString.Capacity = lenNeeded;
         if (SQL_NEED_DATA != SQLBrowseConnect(hconn, inString, inStringLength, outString, 
          lenNeeded,out lenNeeded))
         {
          throw new ApplicationException("Unabled to aquire SQL Servers from ODBC driver.");
         } 
        }
        txt = outString.ToString();
        int start = txt.IndexOf("{") + 1;
        int len = txt.IndexOf("}") - start;
        if ((start > 0) && (len > 0))
        {
         txt = txt.Substring(start,len);
        }
        else
        {
         txt = string.Empty;
        }
       }      
      }
     }
    }
   }
   catch (Exception ex)
   {
    //Throw away any error if we are not in debug mode
#if (DEBUG)
    MessageBox.Show(ex.Message,"Acquire SQL Servier List Error");
#endif 
    txt = string.Empty;
   }
   finally
   {
    if (hconn != IntPtr.Zero)
    {
     SQLFreeHandle(SQL_HANDLE_DBC,hconn);
    }
    if (henv != IntPtr.Zero)
    {
     SQLFreeHandle(SQL_HANDLE_ENV,hconn);
    }
   }
 
   if (txt.Length > 0)
   {
    retval = txt.Split(",".ToCharArray());
   }

   return retval;
  }
 }
}

The Switch Case Statement In Visual C# .Net

The switch case statement is also used for making decision, unlike the if else statement , we can not test conditions like "greater than" or "less than" . in switch case we can test the value of a variable and decide what to do if a particular value is stored in the variable.

the syntax for switch statement below


switch(varable to test)

{

case value 1 :
statements if value 1 stored in the variable;
break;

case value 2 :
statements if value 2 stored in the variable;
break;

*
*
default:
statements if none of the values match;
break;
}

example

the user will enter a weekday number( 1 to 7 ) and the program will display the name of the corresponding day

How To Make A Awesome Calender Using HTML,CSS,JQUERY


hello guys , i am going to write here on how to make a calender i am gonna use html and css  first of all you need the codes

you need jquery 1.6.2



jquery ui mouse

How To Add Facebook Share Buttons To Your Website


I wouldn't call this a tutorial but i hope this is helpful for you in some ways in this post I am featuring facebook share buttons.

1 - small icon with text(share on facebook):
<script>
    function fbs_click() {
        u = location.href;
        t = document.title;
        window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,width=626,height=436');
        return false;
    }
</script>
<style>
    html .fb_share_link {
        padding:2px 0 0 20px;
        height:16px;
        background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top left;
    }
</style>
<a
class="fb_share_link"
href="http://www.facebook.com/share.php?u=%3C;url%3E"
onclick="return fbs_click()"
rel="nofollow"
target="_blank">Share
    on
    Facebook</a>

2 - text(share on facebook)
<script>
function fbs_click() {
    u = location.href;
    t = document.title;
    window.open(
        'http://www.facebook.com/sharer.php?u=' +
        encodeURIComponent(u) +
        '&t=' +
        encodeURIComponent(t),
        'sharer',
        'toolbar=0,status=0,width=626,height=436'
    );
    return false;
}
</script>
<a href="http://www.facebook.com/share.php?u=%3C;url%3E" onclick="return fbs_click()" rel="nofollow" target="_blank">Share
    on
    Facebook</a>

3 - icon(facebook)
<script>
function fbs_click() {
    u = location.href;
    t = document.title;
    window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer',
        'toolbar=0,status=0,width=626,height=436');
    return false;
}
</script>
<style>
html .fb_share_button {
    display: -moz-inline-block;
    display:inline-block;
    padding:1px 20px 0 5px;
    height:15px;
    border:1px solid #d8dfea;
    background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top right;
}
html .fb_share_button:hover {
    color:#fff;
    border-color:#295582;
    background:#3b5998 url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top right;
    text-decoration:none;
}
</style>
<a class="fb_share_button" href="http://www.facebook.com/share.php?u=%3C;url%3E" onclick="return fbs_click()" rel="nofollow" style="text-decoration: none;"
target="_blank"></a>

Thanks.

How To Make A Contact Form In PHP

this is a simple contact form that many websites use in their website for a contact for , we can make this with html and php , html is form and php is to send the email.