Sunday, February 12, 2012

In Love With Ubuntu ? But still have feelings for Microsoft Office ?

Hey Folks , I'm back to blogging after a long break ,but I'll promise this is going to be a short post :) .

One thing I hate about Linux is, when you use it for a long period continuously ,you start to love it, which makes it almost impossible to go back to Windows .I have been using Ubuntu 11.10 (Oneiric Ocelot) as my primary operating system for about 4 months and I'm in love with it already .

But we have to accept the fact that,regardless of the freedom we feel and the fun we get by working in a "techie looking" Operating System ,it also comes with some major drawbacks .Forget about Games ! What about the office package ?

IMHO  Libreoffice  has a long way to go to before it becomes a good competitor to MS Office package .Saying this, I strongly believe it is us who should take the responsibility of speeding up the progress of LibreOffice package as Computer Science enthusiasts .

But for the time being we need a solution . Wine and PlayOnLinux are there for the rescue ! .Wine enables, computer programs written for Microsoft Windows to run on Unix-like operating systems while PlayOnLinux is the graphical front-end for Wine which simplifies the installation process for the user.

Things you need 
  • CD/DVD of Office 2010 ( I couldn't find a way to install with the setup file,if someone does please let me know as well )
  • Ubuntu 11.10 System
  • Working Internet Connection (Lots of things will be downloaded automatically in the middle if installation.) 
Steps to Follow
  • Type following Commands one by one in a terminal
      • wget -q "http://deb.playonlinux.com/public.gpg" -O- | sudo apt-key add -
      • sudo wget http://deb.playonlinux.com/playonlinux_oneiric.list -O /etc/apt/sources.list.d/playonlinux.list
      • sudo apt-get update
      • sudo apt-get install playonlinux 
  • Assuming earlier steps were successful now type the command "playonlinux" in the terminal to start the application .
  • Now download this script to your disk .
  • From the PlayOnLinux Application Menu select "Tools--->Run a local Script" and when it asks for the location of the script direct it to the script file you just downloaded.Click Next.
  • It will automatically asks to download several packages to proceed(Including wine). DO NOT skip any of those .Download all of them. 
  • After downloading the required dependencies you will be asked to select the CD/DVD drive where you have inserted the Office CD.
  • If you select the correct drive and press Next ,the installation of the Office 2010 will start and might download any missing requirements (such as .NET framework).
  • After a successful installation you should see your applications in the run tab of "PlayOnLinux" Application .



Finally double click on the necessary application (Example Microsoft Office 2010) to start the application . I didn't include intermediate screen-shots ,but if someone has a issue with the process let me know ! :)




Tuesday, November 16, 2010

Create OpenOffice Extensions ?

For the readers who are completely new to the phrase Open Office ,It is an open source project with word processing,presentation,Spread Sheet + many more applications which can be a good alternative to Microsoft Office package. It supports the ISO/IEC standard OpenDocument Format (ODF) for data interchange as its default file format. It is a community project where developers from all the over the world contribute to improve product features or to add new facilities.

This post will give you a basic idea on how to become a part of this wonderful project . I will be using Netbeans as my IDE and java as my language.Still you need to install NetBeans OpenOffice plug in as well as the OpenOffice SDK.

Setting up the Environment
  • Download the latest version of OO plugin within NetBeans by clicking on Tools ---> Plugins. You can find the plugin in the "Available Plugins" section as "OpenOffice.org API Plugin"(For the latest version of NetBeans (6.9) above method will not work.So download this file and install it manually.)
  • Then download OO SDK  (I assume that you have already installed OpenOffice package ) and install it.
Now We Are Ready to Rock and Roll !!

Creating your FIRST Project

Restart the IDE .Then go to File--->New Project  . Scroll down on New project window and find OpenOffice.org entry.Click on it

Select Project Type
From the above window select the entry "Open Office Add-on" .Click Next.
Now It is time to give a unique project name to your work.I chose "MyProject".And click Next !

Command Name
The above is an important window where you need to specify your unique command. As an example when you click "save" menu item in an application Save window get opened. So you should give a command name to your task . hmmm Lets say command is "Say Hello " . You can also insert icon images to your project using that icon column .For now, Lets just forget icons and click Next to proceed .

Menu Name
Alright now it's time to give a menu name . I gave "My Menu" .After that proceed by clicking next !In the next window you will have Check Boxes for each Open Office application.(Etc Writer ,Calc) Select the checkBox of the writer.This will add your add-on to the writer application.Then just press Finish! Your Friendly IDE will create the Project for you
 Now it's time to play with some codes! Go to SourcePackages---->com.example------->MyProject.java file.Using the CTRL+F key combination find the method named "dispatch" inside that java file .That method looks like this.

public void dispatch( com.sun.star.util.URL aURL,
                           com.sun.star.beans.PropertyValue[] aArguments )
    {
         if ( aURL.Protocol.compareTo("com.example.myproject:") == 0 )
        {
            if ( aURL.Path.compareTo("Say Hello") == 0 )
            {
                //add your own code

                return;
            }
        }
    }

Now replace that " // add your own code here" line with the code segment below.

String name = JOptionPane.showInputDialog("Enter your Name");                 JOptionPane.showMessageDialog(null, "Hello " + name + " How are you?", "Hello", JOptionPane.INFORMATION_MESSAGE);

Right Click Menu
Alright we are almost there now ! Right click on the project and find "Deploy and Run Extension ...." menu item. And observe other two menu items Debug Extension and Create OXT . For now let us use the middle one Deploy and run .This will run your extension on the Open Office package which is installed in your computer . After few steps Open Office will be automatically started . Open a Text Document .And you will see your Menu "My Menu" in the top menu bar. 
Click on it and it will have the "Say Hello" entry .Voillaaaaaa !! You just created your first OO extension!!

Friday, July 16, 2010

9 Tips to success in SCJP

It's been a while I'm writing a new post .And I guess this one will be a really helpful to all the guys who are preparing them selves for the SCJP examination. Anyway your goal should be to learn the technology other than adding extra 4 letters to your resume.So here we Go !!!


First and Foremost
 If you are a java professional who has been working with industry based java projects for a long time ,DO NOT underestimate the exam.This exam is looking for a human compiler rather than a good designer.So Take the exam Seriously :)

Secondly
Become a member of JavaRanch community and be active in SCJP forum .At least read the new threads which are being posted every day.

And thirdly
Buy the SCJP guide by Kathy sierra and Bert Bates.Or if you are a great fan of EBooks go for the ebook.


Fourth Step 


Make your Goal .Buy the voucher and fix the exam date. Then your mind will always alert you about the money you are going to miss if you waste time. At least give yourself  2 months for study when you fix the exam date . The exact date will depend on you.If you are new to j2se and can sacrifice 3 good hours in a  day for this exam I suggest you to get at least two months for studies. 


Fifth step
First read the book one time completely ,doing all the  SELF TESTS, going though all the Two Minute Drills ,preparing a good short note for your self.And Code all the examples using a text editor(Notepad++) .Please avoid all those IDEs including Netbeans and Eclipse.And write lot of codes changing the same example in various ways.Spent good 15 minutes with a example which you couldn't answer at first time.

And the Sixth is 
Focus on the areas where you score low marks on self tests.And read those chapters one more time.
Now its time to test your self .Find some good mock exams. You can find some really good mock exams on javaranch specially ExamLab is a great tool which toughens you for the real exam.

Seventh will be
When you review the Mock exam results find your weaknesses and Read K&B book again for those chapters.And Loop through step 7 and 8 for at-least a week .

Eighth step
Day Before Exam-Read all the Two Minute Drills sections in the SCJP book.Go through all the steps in the book which tells you how to face the real exam.(In the first few pages). It tells you different methodologies  to answer different questions.And Please make sure to sleep early .At least get a sleep of 6 hours.

And the last will be 
Arrive one hour early to the exam venue and go through your short note(areas where you have some doubts) once again.And be calm and cool for 10 or 15 minute without doing anything.Face the exam with confidence using all the tips you learned.


And Finally Good Luck to Everyone who are going to face the exam!!

Thursday, June 17, 2010

A logic problem: Who is the killer??? (Do you Have a Mr:Sherlock inside you?)

For most of the time in our life we are busy with our day today works.May be with our studies or with our job. So here  I present you a small problem which is not related to any of those,but will need some brain cells to provide the correct  answer.So here goes the Adventure.




There were five people travelling in a train and they are named A,B,C,D and E. Here A,C and E are men and B,D are women. Suddenly train passed through a tunnel and when it emerges E was found dead.

And a detective came to the place and talk to other for passengers to get evidence.This is the result he got after talking to remaining four people.

A Said

I'm innocent : B was talking to E when the train was passing though the tunnel

B Said

I'm innocent : I was not talking to E when the train was passing through the tunnel.

C Said

I'm innocent : D committed the murder.

D said

I'm innocent :One of the men committed the murder.

You can see these four people are making eight statements,two by each person.And the detective could find out that four of these statements are true. And four of them are false.But he doesn't know which one of them are true and which are false.And he also got to know that only ONE person did the crime.Assuming you are the detective try to find out the killer?


                          
These are small logic problems which can be easily solved by doing some rough works.And these kind of problems are belong to the area called discrete mathematics .Try To Answer without help .I will post my answer Later. :).