Friday, June 10, 2011

Java and MSAccess

A simple video on how to connect MSAcess and Java.

Creating Hello World Servlet

A simple video [ screencast ] to show how to develop the HelloWorld Servlet.

Friday, November 19, 2010

Replacing old *nix with Fedora 14

Last time when i installed fedora am not that happy; the problem may be on my side or on other side; i dont know.

I thought lets give it a try again. I installed fedora 14, installation was smooth but i faced some problem in creating the bootable usb drive. But it got resolved in few tries. I installed fedora and trust me installation was too smooth.

After the installation i need to make it ready for using [ missing softwares ]

I started with Java.

Installing Java
  • Download jdk and jre from goo.gl/nqkjo. Download bin files.
  • Change it to become executable [ chmod +x file ]
  • Run bin file
  • Using alternative --install command.

Ok Lets try it out. You may require root access.

  1. Open Terminal
  2. wget goo.gl/JMYjs This will download jdk-6u22-linux-i586-rpm.bin
  3. chmod +x jdk-6u22-linux-i586-rpm.bin
  4. ./jdk-6u22-linux-i586-rpm.bin
  5. alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_22/jre/bin/java 20000
  6. alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.6.0_22/jre/bin/javaws 20000
  7. java -version

Next is openoffice
yum install openoffice*

To enjoy mp3 and other restricted softwares we need to enable the restricted repos.

This is all for Fedora 14.

Wednesday, July 28, 2010

After the Currency symbol its time for Indian browser

It is again time for us to take proud, after the Indian currency symbol, their is a new browser for the Indians. The browser named “Epic” : The first ever web browser for India develop by Hidden Reflex. It has so many cool features that make it more user friendly. It comes with the side bar for the various services or widgets which includes

  • News from the india
  • Transliterator for Indian scripts, it supports 12indian languages
  • Skins
  • Antivirus  powered by eset
  • Editing and saving html files
  • Snippets that let you drag and drop the content and save it for later use
  • Video service that let you stream video in small pane and let you keep browsing the web
  • Todos
  • Facebook
  • Twitter
  • Gmail
  • Orkut
  • Yahoo
  • Maps
  • Travel
  • Jobs
  • Games
  • Backup

Have a look at  screenshots.

Its still not available on linux only exe version is out.  As it is built on Mozilla so it supports all the add-ons and plug-in that fire fox supports. It also comes with Epic App that allow to add more to the sidebar. With few hours of usage i feel its good one. One should give it a try.

Wednesday, February 10, 2010

Buzz

Today when i logged in gmail account it will ask you to go for Buzz!!! A new social networking initiative (is it correct!!!) by Google people. It let me share picasa photos,flickr, google reader, status, chatlogs, links, twitter ... and many more. Using it i had a felling like twitter and bit of facebook. Yes we can tweak to what to be shared in what manner (public or private). . It also suggest the list of your contacts to follow and following category. It overcomes the limitation of 140 character twitter. :) Now posting of long text is allowed. The best part is ...... Inbox Integration. The look and feel awesome (thumbnails).
@replies are also supported.

Although your inbox will be vibrating to show the new notification for the buzz you receives. Its ok when we get so many things bundled up.

Tuesday, December 22, 2009

Got like this on boot grub> !!! Restoring back to normal

Now a days when we are moving towards open source its common to find the two operating system on the pc or laptop. The one is linux which come with own loader GRUB. Sometimes it may happen due to ignorance or experimental purpose grub is mishandled and the result is a grub prompt at restart ...........
Many of us just get afraid and stuck to old but bad formula of formatting all drives and installing all the stuff again STRANGE!!!!
In this post you will find precise steps to recover your Grub.

First step is to find whether grub can open and read any files on any partition


grub> find /boot/grub/stage1

This will return partition in the form of (hdX,Y). For example (hd0,5)

Next step is to intall the grub.


grub> root(hd0,5)
grub> setup(hd0,5)

Next step is to tell grub about the kernel and initrd img. Assuming its in sda2


grub> kernel /boot/[select your vimlinuz PRESSING TAB] root=/dev/sda2
grub> initrd /boot/[select your initrd image PRESSING TAB]

Make sure you select the same version in both kernel and initrd.

Last step is to boot in to machine


grub> boot

This will return you to command prompt interface. Just do a normal login and type startx to start GUI.


startx

Bingo You are done.

Next step is to restore the menu.lst or make new one. Search for the menu.lst in /boot/grub/.

If its empty you need to add few lines for showing grub menu in while booting. We need to know the various UUID (Universally Unique Identifier) and details of the partition. Run the command


cat /etc/fstab

or

ls -al /dev/disk/by-uuid/*

menu.lst normally looks like


title Ubuntu 9.04, kernel 2.6.28-11-generic
uuid 63451d1e-eba4-487e-ba98-eee9e58e3101
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=63451d1e-eba4-487e-ba98-eee9e58e3101 ro quiet splash
initrd /boot/initrd.img-2.6.28-11-generic
quiet

title Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)
uuid 63451d1e-eba4-487e-ba98-eee9e58e3101
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=63451d1e-eba4-487e-ba98-eee9e58e3101 ro single
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu 9.04, memtest86+
uuid 63451d1e-eba4-487e-ba98-eee9e58e3101
kernel /boot/memtest86+.bin
quiet


title Microsoft Windows XP Professional
rootnoverify (hd0,0)
savedefault
makeactive
chainloader +1



title : shows as in Grub Menu option
UUID : For disks
kernel : for loading os
initrd image


Make your ones with the appropriate enttries and UUID and done. Save file and reboot the system.

Sunday, November 22, 2009

go : Part 1

go : a new language by google. Best is its OPEN SOURCE. As it says its fast, simple, fast, secure, c0ncurrent, fun, opensource!

This article covers the
Step 1 : Installation
Step 2 : Hello World program

Step 1 : Installation

Best way is to look in go site

  1. Create two directories in your home namely go and bin. (you can set any path). For simple understanding i have created the directory in home folder. If you choose different path than in place of $HOME write your path like /home/abc/golang/go ...
  2. Open .bashrc file. Normally its at your home. Open $HOME/.bashrc in editor.
  3. Add following lines (assuming u have 32 bit computer).

    export GOROOT=$HOME/go
    export GOARCH=386
    export GOOS=linux
    export GOBIN=$HOME/bin

  4. Open Terminal

    programmer@programmer-laptop:~$
    programmer@programmer-laptop:~$ sudo easy_install mercurial
    [sudo] password for programmer:
    Searching for mercurial
    Best match: mercurial 1.3.1
    Processing mercurial-1.3.1-py2.6-linux-i686.egg
    mercurial 1.3.1 is already the active version in easy-install.pth
    Installing hg script to /usr/local/bin

    Using /usr/local/lib/python2.6/dist-packages/mercurial-1.3.1-py2.6-linux-i686.egg
    Processing dependencies for mercurial
    Finished processing dependencies for mercurial

    programmer@programmer-laptop:~$ hg clone -r release https://go.googlecode.com/hg/ $GOROOT
    programmer@programmer-laptop:~$ sudo apt-get install bison gcc libc6-dev ed make

    programmer@programmer-laptop:~$ cd $GOROOT/src
    programmer@programmer-laptop:~$ ./all.bash
    --- cd ../test N known bugs; 0 unexpected bugs

We are done now ..... We have successfully installed go :)

Lets see what is there in bin directory. There are many executable files. We should see 8g (Compiling), 8l (linking).

The file have an extension .go. So lets create hello.go with following lines

package main
//Says its main package
import "fmt" // import

func main() //Entry Point
{
fmt.Print("Hello, World\n"); //Printf /cout/
}


Open Terminal
programmer@programmer-laptop:~$ cat hello.go

package main
import "fmt"

func main()
{
fmt.Print("Hello, World\n");
}

programmer@programmer-laptop:~$ 8g hello.go
programmer@programmer-laptop:~$ 8l hello.8
programmer@programmer-laptop:~$ 8.out
Hello, World
programmer@programmer-laptop:~$

Simple isn't it !!

8g is go compiler and will create a file with extension .8. To link the file 8l is used and the output goes in to 8.out.

If i want to import more packages with fmt we can do like

package main
import (
"os";
"fmt";
)

To make a variable s of type string

var s string = "" // With Datatype

OR

var s = "" // No Type needed Compiler will decide

OR

s := "" // Initializing and Declaring

// Single Line comment

/*
MULTI LINE COMMENT
*/



Lets try out another program. This will read command line arguments and displays the same. Like echo command

Open text editor and add following lines


package main

import (
"os";
"flag"; // command line option parser
)

var omitNewline = flag.Bool("n", false, "don't print final newline")

const (
Space = " ";
Newline = "\n";
)
/*
We could have done like

const Space = " "
const NewLine = "\n"

(No need of semi colon here)
*/

func main()
{
flag.Parse(); // Scans the arg list and sets up flags
var s string = "";

for i := 0; i <> 0 {
s += Space
}
s += flag.Arg(i);
}
if !*omitNewline {
s += Newline
}
os.Stdout.WriteString(s);
}

Carefully see the if condition and for loop, its bit syntactically different from what we have seen in c, c++, Java. No need to add condition or for loop parameter in (). But the body should be enclosed in {}.

See the usage of i:=0. No forward declaration is required as := will initialize and assign the value to i and compiler will know what to do with i.

Seems Simple.. But still this is the very very basic things rather not basic also there are lot many features to be seen.

Keep looking will publish the next post with more information and what more in go.