November 22, 2012

Mount TrueCrypt Volume with Read and Write File Permission for Users and Groups

Hi friends,

I have been working on Ubuntu from a long time. Recently I am exploring on TrueCrypt and I faced the following issue. After searching lot of websites and forums, I made a solution which worked for me perfectly.

Objective:
TrueCrypt volume copied data should be available to all when its mounted.

Usual Procedure:
Mount the TrueCrypt volume in Ubuntu
Copy some data to the volume
Change file permissions to other users or groups
Other users should be able to view the data from the volume when mounted

Hiccup(Problem):
After mounting the TrueCrypt Volume the directory permissions are changed and fixed to 700 (rwx --- ---). i.e. No access to groups and others.
Changing the directory permissions and changing the ownership will not be applied.
So, other groups and others cannot access the data.

Solution:
While mouting the TrueCrypt volume we need to specify the file system type and give permission to user[s] and/or group[s] with umask.

Please find the syntax and example below

Syntax:
$sudo /usr/bin/truecrypt -t --filesystem={filesystem_type} --fs-options={rwx},uid={userid},gid={groupid},umask={ugorwx} {your_tc_volume} {mounting_folder}

Example:
$sudo /usr/bin/truecrypt -t --filesystem=vfat --fs-options=rw,uid=1000,gid=1000,umask=022 tc1.tc /mnt/folder1

Thanks for visiting my blog.

Please send your feedback and comments to psrdotcom@gmail.com

November 20, 2012

Display Flash SWF Object File in Max Width and Height of Browser (Autofit)

Hi coders,

Today I have come across a situation where I need to display some .swf file in browser by using 100% browser width and height irrespective of the screen resolution. Generally we will specify the object width and height while display the flash on browser.

But I want the flash content to get display in maximum (full) width and height of the browser to any screen resolution. i.e. Automatically it has to adjust the width and height of the flash object.

I have found the following method
  • Please download the swffit from here 
  • It has lot of custome functions which developers can use
  • After downloading the zip file, please extract the content
  • You can find lot of sample codes
  • I have used example.html code and changed the fit method to 
    • swffit.fit("my_flash", 1, 1, null, null, true, true);
  • Now it will display the flash object in maximum width and height of the browser
Enjoy coding :)

Note: Please send your feedback and comments to psrdotcom@gmail.com

November 18, 2012

Windows 8 Installation, Kaspersky Anti-Virus Issue and resolved

Hi,

After a big gap, I am writing this post.

Today, I have upgraded my sister's laptop from Windows 7 to Windows 8 Pro by purchasing online for just Rs. 1999/-. Its cool, I am liking the Windows 8 look and feel (Metro interface). I have created ISO image for backup.

But I got a problem with the KasperSky anti-virus. The version which I installed in Windows 7 doesn't support in Windows 8. While uninstalling from Windows 8, it was not successfully uninstalled.

So, I removed it from registry and corresponding folders in file explorer. It was suddenly not recognizing the trackpad and even mouse. So, using USB flash drive, I had burned ISO to a USB Pendrive and booted from it. Refreshed the OS.

You know what, all the installed apps were gone. It moved to a folder named Windows.old(>10GB). I decided to delete it. So, I performed "cleanmgr" and deleted the old windows folder Windows.old. Finally I have installed all the required softwares.

The apps from Windows store are ok. But not many apps ( I know still lot of apps will come). I liked the Wikimedia, Photofunia, ToDo, Tasklists, Engadget, etc.

Overall weekend spent on Installing Windows 8 and corresponding software updates.

Note: Please uninstall the anti-virus before you upgrading to Windows 8.

August 25, 2012

Combine Different Network Connections to get Faster Internet Connection Speed Simultaneously

Hi friends,

Have you ever thought of combining your ethernet connection internet speed and your mobile internet speed and wi-fi internet speed and etc.?

Getting one active Internet connection speed doesn't suite for high speed downloads.

But Connectify Dispatch made this possible to combine different Internet connections and made a single, faster Internet connection to download with summation of all available networks.

Use multiple connections simultaneously to get a faster connection speed.

Please find more details at

http://www.kickstarter.com/projects/523076551/dispatch-the-internet-faster

References:

Connectify

July 20, 2012

Solved the problem of import project in eclipse

Hi users,

I had been facing this issue for sometime. I didn't concentrate much on this issue. Today finally it got solved.

Problem:
Unable to import projects into eclipse

Solution:
  • Remove any projects from the workspace with the same name (Cut and Paste in some folder as backup)
  • Check whether you have android-8 (min) in your project properties target platform
Note: You can view the existing projects (closed projects also) in your eclipse by clicking on package explorer


Remove the unused projects, name conflict projects.
Please restart the eclipse (File->Restart)
Now, you will be able to import your projects into eclipse.

Note: Please write your comments (or) mail to psrdotcom@gmail.com

BlackBerry mobile/phone is not starting/switching on problem with solution

Hi all,

Today, We were faced one issue like, our BlackBerry is not powering on.

We had connected the mobile with the USB cable for 2 hours. But not at all switching on.


Problem: Phone is not starting
Resolution: Charge the mobile with AC adapter for 1 hour.
Reason: Battery completely drained. So, it requires more power at starting to charge the battery initially.

Don't get scare and don't rush to service center for this small issue.

Please post your comments (or) send mail to psrdotcom@gmail.com for more details.

July 18, 2012

Text Formatting in *NIX to run Script files of Different Platforms

Hello all,

While writing shell scripting in Ubuntu, Windows and deploying it in *NIX based machine, we found some issue. That the file running perfectly on the Ubuntu (Linux), Windows machine. The same script was displaying errors like

'\r': command not found
^M: command not found
 
There was a formatting issue. You need to run the following command to resolve it.

DOS2UNIX

Installation:
sudo apt-get install tofrodos

Syntax: 
dos2unix filename

Example:
dos2unix script1.sh

To know more about this you can go through References.

References:
http://linuxcommand.org/man_pages/dos2unix1.html
http://www.thefreecountry.com/tofrodos/

If you have any further queries, please add your comments. You can also mail to psrdotcom@gmail.com

July 05, 2012

Digital Cameras in the Budget Range

Hi everyone,

I am posting this one related to digital cameras.

In India most of the users wants the camera just for occasional purpose.

Example: For outing, Home functions etc.

For those basic needs, we can have a budget camera.

These are my opinion on the current cameras in Nikon, Canon and Sony

I think these are best cameras in mid range ..

Below Rs. 5000

Nikon Coolpix L23

Canon Powershot A1200

Below Rs. 6000

Nikon Coolpix L26

Canon A3200 IS

Sony W520

I decided the camera based on the resolution (megapixel) and optical zoom. I don't to go in-depth in deciding the basic camera.

Send your feedback and comments to psrdotcom@gmail.com

June 25, 2012

Create Hyperlink to the part of the image in HTML using AREA tag

Hi everyone,

Its been a long time that I have been posted a new one. This time I would like share with you the information to create or make some part of the image as hyperlink.

Source:
<img src="image.jpg" usemap="#areal" />
<map name="areal">
<area shape="rect" coords="0,0,50,50" href="http://www.pillisureshraju.info/" target="_blank"></area>
</map>

Important values to observe:
image.jpg -- Image name
areal -- map area name
rect -- Shape type
0,0,50,50 -- x1,y1,x2,y2 coordinates of the shape
href -- hyperlink reference

Now, the hyperlink is been created for your image with the specified coordinates.

Please send your comments and feedback to psrdotcom@gmail.com

June 07, 2012

Ubuntu Linux Free and Best Audio (MP3, Ogg, etc.) and Video (AVI, MP4, etc.) Editors, Cutter, Joiner

Hi folks,

I would like share some best audio and video editors in Ubuntu Linux. Install common-codecs to use these Audio/Video editors.

In Ubuntu Software Center, search for Ubuntu restricted extras and install.

Audio Editors:
  • Audacity
  • Command Tools for MP3 Cutter and Joiner: mp3split, mp3wrap
  • Jokosher
  • Grip
  • Hydrogen
  • Sound Converter (Extract Audio from a Video File)
  • Muse
  • RoseGarden
  • Ardour
  • SoundKonverter
  • StreamRipper
  • LLMS

Video Editors:
  • Openshot
  • AvideMux
  • Cinelerra
  • Kino
  • Jahshakha
  • Pitvi
  • Lives
  • Vivia
  • FFMpeg
  • Handbreak
  • VLC Media Player (Don't get surprise, see the 4th Reference link)

Most of the above mentioned softwares can be downloaded from the Ubuntu Software Center/Synaptic Package Manager.

Download the editor(s) and, be creative in your own way.

References:

http://ubuntup.blogspot.in/2010/09/best-audio-mp3-cutter-converter-editor.html
http://techcityinc.com/2009/04/14/10-best-audio-editors-for-linux/
http://techcityinc.com/2009/02/04/top-10-free-video-editors-for-ubuntu-linux/
http://ubuntup.blogspot.in/2010/10/best-video-editor-converter-splitter.html

June 02, 2012

Live CD Ubuntu Customization Kit (UCK) without Internet

Hi friends,

As many of you know that, UCK (Ubuntu Customization Kit) requires Internet when customizing the Live CD.

Why we need Internet while customization?

  • To get the updates from the repositories we need the internet.
  • To install any software using apt-get/synaptic package manager.
Do we need Internet all the time?

According to me, We may not need the Internet for small updates.
So, I have modified the customization scripts to work without Internet.


Pre-requisites:

Please download the following files.

sources.gz: 
According the ubuntu distro, we need to get the sources.gz from the link
http://archive.ubuntu.com/ubuntu/ubuntu/ubuntu/dists/$DISTRO_CODENAME/main/source/Sources.gz

gfxboot-theme-ubuntu_x.x.x:
http://archive.ubuntu.com/ubuntu/ubuntu/ubuntu/pool/main/g/gfxboot-theme-ubuntu/

Please place these two files in ~/Softwares/UCK/ directory

Note: ~ is home directory of the user.

Apply Patches

If you installed UCK, you will having the /usr/lib/uck/customization-profiles/localized_cd/ directory
In that directory, you will be having customize and customize_iso scripts.

Those two scripts will be copies to /home//tmp folder while running the UCK.

So, please apply the following patches in /usr/lib/uck/customization-profiles/localized_cd/ 

Now apply the patch as shown below

$ patch -u customize customize.patch
$ patch -u customize_iso customize_iso.patch

customize.patch


--- customize 2012-06-01 21:47:31.905741928 +0530
+++ customize_old 2012-06-01 21:46:03.509742149 +0530
@@ -121,8 +121,7 @@
arch=`if [ -d /lib64 ]; then echo x86_64; else echo i586; fi`
echo ">> Customizing: $rel, $kernel $arch"

-# Commented by PSR
-#prepare_install || failure "Preparing installation failed, error=$?"
+prepare_install || failure "Preparing installation failed, error=$?"

# List of packages to install to support the selected languages:
PACKAGES_TO_INSTALL=""
@@ -153,16 +152,16 @@
fi
done

-# Commented by PSR
- #install_packages $PACKAGES_TO_INSTALL || failure "Installing language packs failed, error=$?"
+ install_packages $PACKAGES_TO_INSTALL ||
+ failure "Installing language packs failed, error=$?"

# NOTE: we first install selected language packs, then remove others as
# installing a language pack might pull in packages that were not
# previously present
echo "Removing unnecessary language packages..."
REMOVED_PACKAGES=`dpkg-query --show | cut -f1 | grep -E '^(language-pack|language-support|firefox-locale)' | grep -Ev "[-]($LANGPACKS_CONCATENATED)\>"`
-# Commented by PSR
-# remove_packages $REMOVED_PACKAGES || failure "Removing packages failed, error=$?"
+ remove_packages $REMOVED_PACKAGES ||
+ failure "Removing packages failed, error=$?"
fi

if [ "$RUN_MANUAL_CUSTOMIZATIONS" = "yes" ] ; then

customize_iso.patch


--- customize_iso 2012-06-01 21:47:38.369741917 +0530
+++customize_iso_old 2012-06-01 21:46:00.441742156 +0530
@@ -50,9 +50,6 @@
REMASTER_DIR="$REMASTER_HOME/remaster-root"
BOOT_LANG=`cat "$SCRIPT_DIR/livecd_locale"`

-# Added by PSR
-SOURCES_DIR="/home/user/Softwares/UCK"
-
function failure()
{
echo "$@"
@@ -83,21 +80,12 @@
DISTRO_CODENAME=`cd "$ISO_REMASTER_DIR"/dists && find . -maxdepth 1 -type d | grep '/' | cut -d '/' -f2` || failure "Unable to identify Ubuntu distro codename"
APT_SOURCES_TMP_DIR=`mktemp -d`
-# Commented by PSR
-# wget -c http://archive.ubuntu.com/ubuntu/ubuntu/ubuntu/dists/$DISTRO_CODENAME/main/source/Sources.gz -O "$APT_SOURCES_TMP_DIR"/Sources.gz
-
-# Added by PSR
- cp "$SOURCES_DIR"/"$DISTRO_CODENAME"_Sources.gz "$APT_SOURCES_TMP_DIR"/Sources.gz
-
-# Commented by PSR
-# GFXBOOT_THEME_UBUNTU_SOURCE_PACKAGE=http://archive.ubuntu.com/ubuntu/ubuntu/ubuntu/pool/main/g/gfxboot-theme-ubuntu/$(zgrep gz "$APT_SOURCES_TMP_DIR"/Sources.gz | grep gfxboot-theme-ubuntu | sed -n 1p | awk '{ print $3 }')
+ wget -c http://archive.ubuntu.com/ubuntu/ubuntu/ubuntu/dists/$DISTRO_CODENAME/main/source/Sources.gz -O "$APT_SOURCES_TMP_DIR"/Sources.gz
+ GFXBOOT_THEME_UBUNTU_SOURCE_PACKAGE=http://archive.ubuntu.com/ubuntu/ubuntu/ubuntu/pool/main/g/gfxboot-theme-ubuntu/$(zgrep gz "$APT_SOURCES_TMP_DIR"/Sources.gz | grep gfxboot-theme-ubuntu | sed -n 1p | awk '{ print $3 }')

-# Commented by PSR
-# wget $GFXBOOT_THEME_UBUNTU_SOURCE_PACKAGE || -# failure "Unable to download gfxboot-theme-ubuntu source package from $GFXBOOT_THEME_UBUNTU_SOURCE_PACKAGE"
+ wget $GFXBOOT_THEME_UBUNTU_SOURCE_PACKAGE || + failure "Unable to download gfxboot-theme-ubuntu source package from $GFXBOOT_THEME_UBUNTU_SOURCE_PACKAGE"

-# Added by PSR
- cp "$SOURCES_DIR"/gfxboot-theme-ubuntu_0.14.2.tar.gz .
tar xfz *.tar.gz || failure "Unable to extract gfxboot-theme-ubuntu source package"
fi

Please apply the patch files and run the UCK without Internet.

Enjoy a quick Ubuntu Customization.

Please send you comments and feedback

June 01, 2012

Create and Apply Patch file in Linux using Diff command

Hi friends,

When I was updating one file, I have taken backup as filename_old.

After updating (adding and removing line) the current file, I thought let me see what are all the updates I have done to the current file. Then I thought, there is a concept call patch file.

Then I decided to create the patch file.

I have searched and surprised that "diff" command is able to do that.

Procedure:

Files: 1.txt (Original File), 2.txt (Modified File), diff.patch (Patch File)


1.txt 2.txt
a a
b b
c c
d e
e f
f g
1


Create Patch


Syntax: diff -Naur Original_File Modified_File > Patch_File

In terminal window, execute the following command

$ diff -Naur 1.txt 2.txt >> diff.patch


Output:

diff.patch


--- 1.txt 2012-06-01 23:25:02.713727335 +0530
+++ 2.txt 2012-06-01 23:25:09.833727317 +0530
@@ -1,7 +1,6 @@
 a
 b
 c
-d
 e
 f
-1
+g




Apply Patch

Syntax: patch -u Original_File Patch_File


$ patch -u 1.txt diff.patch


Output:



1.txt
a
b
c
e
f
g


Now, we have successfully applied the patch to the old (Original) file.

Please send your feedback to psrdotcom@gmail.com or write comments

May 31, 2012

Forgot your Windows password; Login without password using Kon-Boot Utility

Hi friends,

I am in a confusion whether to put this information in my blog or not. Because it can be used for both good and bad cause.

Promise me that, you will use it for good cause.

Backup files:

Whenever you forgot the admin password in Windows [XP, Vista, 7] any version, you can take backup of your files by using any of the Live CD/DVDs [Ex: Ubuntu Live CD, Which I always prefer to use].

Bypass Authentication:

Without using the Live CD/DVD and if you wants to login to your computer there is a possibility but for limited Operating Systems by using Kon-Boot.

As per Kon-boot free version, it will support only 32-bit edition operating systems (Windows XP,  Vista, Server 2003/08).

The free version doesn't support 64-bit versions and Windows 7 (32bit/64bit).

Procedure:
  1. Download the free version of Kon-Boot utility from here http://www.piotrbania.com/all/kon-boot/index2.html#free
  2. Direct Link: http://www.mediafire.com/?e51u3rce5a5c0mn
  3. Extract the zip file with the password kon-boot
  4. Extract the CD-konboot-v1.1-2in1 zip file
  5. Open the CD-konboot-v1.1-2in1 folder
  6. You will find the CD-konboot-v1.1-2in1.iso
  7. Make your Pendrive as bootable with this iso (or) burn the iso to a CD
  8. To make your pendrive as a bootable disk, please follow any one of the methods
  9. You can use the utilities unetbootin or any bootable utility for pendrive
  10. Follow this link for more details http://www.irongeek.com/i.php?page=security/kon-boot-from-usb
  11. Boot to your pendrive by adjusting the BIOS boot order settings or One time boot menu at the boot time
  12. It will show you the Kon-Boot screen
  13. Press any key to get out of the starting screen of Kon-Boot
  14. Now it will show you the Kryptos Logic Screen
  15. It will automatically bypasses the existing operating system
  16. In my system, it automatically booted to the harddisk partition
  17. If not, you please select the desired partition to boot for the next time
  18. Thats it, now you without entering the password you can login into your system
Note: Kon-Boot will not erases the password of your operating system. It just bypasses the OS authentication.

For further details, please comment here or mail to psrdotcom@gmail.com

May 26, 2012

Andhra Pradesh Public Service Commision (APPSC) Government Jobs Apllication Challan and Submit Application Online for various posts using APOnline Services

Dear friends,

Very useful information for those who wants to apply various posts in the Andhra Pradesh Public Service Commision (APPSC).

Procedure:
  1. Visit the APPSC website http://apspsc.gov.in/
  2. Browse the "Online Application Submission" section
  3. For any post, you need to fill the challan by clicking "Get Challan"
  4. Upon successfully filling the challan form, you will get the challan in PDF format.
  5. According to instructions, either you need to visit near SBI branch or APOnline center.
  6. But, you can pay the challan online using APOnline services.
  7. Just click on the link http://aponline.gov.in/apportal/index.asp
  8. Click on the "Citizen Login" on left side of the page
  9. Register/Sign in with your details.
  10. Click on "Adhoc Services"
  11. In the section of "Challan payments", choose "APPSC Challan Payment"
  12. Enter your challan number
  13. Your details gets appeared; Your name and other details.
  14. Click on "Submit"
  15. Now it will ask you to pay using any one of the bankers (SBI, HDFC, AXIS, IndianBank)
  16. After the payment, you will get the transaction acknowledgement along with your "Journal" number.
  17. Make a note of "Journal Number"
  18. The next day after 2:00 PM, visit APPSC website http://apspsc.gov.in/
  19. Click on the "Submit Application"
  20. Before you submitting the application, you need to have your scanned photograph and scanned signature.
  21. The dimensions of the photograph should be 3.5cm(Width) x 4.5cm(Height) [Around 276px * 354px]
  22. The dimensions of the signature should be 3.5cm(Width) x 1.5cm(Height) [Around 276px * 118px]
  23. Using any of the photo editors you can combine both the photograph and signature into one .jpeg image with the dimensions 3.5cm(Width) x 6cm(Height) [276cm * 472px]
  24. The image size must be less than 50KB
  25. Upload the image by clicking on browse option
  26. Click on "Preview" button
  27. Verify the photograph and signature in the page
  28. Click on "Submit" button
  29. You can download the submitted application form

All the very best for you exam.

For any queries, mail to psrdotcom@gmail.com

May 19, 2012

Java Virtual Machine (JVM) vs Kilobyte Virtual Machine (KVM) vs Dalvik Virtual Machine (DVM)

Hi friends,

Do you that the java program, when running on different architectures, it runs on different virtual machine (VM)?

Why it need different VM when running the similar syntactical code?

Let me take the opportunity to share and explain what I have gone through

I have been read about 3 main VMs.

Java Virtual Machine
Kilobyte Virtual Machine
Dalvik Virtual Machine

Java Virtual Machine:
JVM executes Java .class bytecode to run the Java applications. JVM with set of libraries form a JRE, which is installed on computer to execute any Java program.


Kilobyte Virtual Machine:
Java API contains large set of standard libraries. To use the same no.of libraries in Mobile is not possible due to memory constraint in the mobile. So, they have come up with an idea to take a subset of libraries and form a profile in Java 2 Platform Micro Edition (J2ME). So JVM is replaced with less memory running KVM. KVM is designed to run in kilobytes memory for small devices.

Dalvik Virtual Machine:
When it comes to Android Operating System, they don't want to either JVM or KVM. Because they want to run a virtual machine for every application. This concept can't be implemented with existing virtual machines. Due to this reason, this virtual machine is integral part of the Android Operating System. In Android, the java .class bytecode converted to dalvik compatible .dex which will be executed with Dalvik Virtual Machine (DVM). The set of .dex files forms an Android Package (.apk) file, which gets installed on the devices to install and run the applications.

Similarities:
All the virtual machines primary source is developed in java.

Dissimilarities:
Set of libraries have changed.
Memory allocation is different.


References:
http://docs.oracle.com/javase/specs/jvms/se7/html/index.html
http://java.sun.com/products/cldc/wp/
http://catazinelive.catreloaded.net/2012/02/08/dvm-dalvik-virtual-machine/

May 11, 2012

Ubuntu Customization Kit (UCK) Problem Solved in 12.04 Precise Pangolin

Hi friends,

I had an issue with UCK (Ubuntu Customization Kit) in Ubuntu 12.04.

Problem:
After selecting the language pack, the UCK crashes. It doesn't show the error also.

Solution:
  • I have uninstalled it completely.
  • I have delete the folder /usr/lib/uck --Doesn't know this is right cause
  • I have updated my Ubuntu 12.04 with latest updates --For no reason, Just tried my luck
  • Then I have tried to do as mentioned in the link.
  • This problem was resolved but a new problem came into picture i.e. resolve.conf problem
  • After googling, I found this patch which helped me to resolve the problem.

Now I am happy that, I am able to customize my latest Ubuntu 12.04 Precise Pangolin also.

References:
http://askubuntu.com/questions/129933/running-uck-causes-zenity-crashed
https://bugs.launchpad.net/uck/+bug/946480

May 08, 2012

Micro SD Card, Unable to Format, Write Protected

Hi friends,

One more issue with some precaution. My friend formatted his micro-sd card and trying to copy the files from computer to sd card using card reader. The files aren't copying into the sd card. We tried to format the drive and it was showing an error in windows like "Windows was unable to format the drive".

We tried to format the drive on Linux, Mac also. Tried to use "dd" command to write random data in it. It was automatically disconnecting from PC/Mac. i.e. The drive is not accessible after sometime.

Then we have come to one conclusion that "Never, Ever format your sd card from the phone". It will not be accessible by the PC/Mac.

We tried to use the same SD Card in Samsung mobile also. It was detected and formatted from the Samsung phone too. It was formatted successfully. But when we were trying to copy some files to the sd card, It says "Drive location is accessible".

Lesson: "Don't format your micro-sd card from phone"

If anyone knows, how to solve this problem, please let me know.

Send your feedback to psrdotcom@gmail.com

May 03, 2012

UGC has comeup with Offline Application Submission to solve Online Application Submission Problem for NET Examination Aspirants

Dear friends,

From past few days UGC website was fully busy with lot of online application submission requests. Those who have already taken the Bank Chllan and unable to create/edit the data from UGC website, UGC provided Offline application submission.

Please go through the below link for more details.

http://ugcnetonline.in/offline_mode.php

Download the offline application from the below link

http://206.71.52.87/~ugcnet/offline_application_form.pdf


Important Instructions:

Before filling the application, apart from your personal details like name, father name, mother name, address, you must have the following things

  • Bank Challan
    • Branch Code
    • Journal Code
  • Your highest degree details
    • Marks obtained
    • Total marks
All the very best ...

Java: Create .jar file with .class file(s)

Hi friends,

Today, We had some trouble in using the .class file in java project. My colleague gave an idea of creating the .class to .jar file. So, We have created the .class file to .jar file, which solved our problem.

But one should know the package name of the .class file before creating the .jar file.

If the .class file is in some abc package. We have to place the .class file in a folder named abc.

In command prompt/terminal, go to the parent folder of abc.

Syntax: 
jar cf jar_file_name dir\{classname(s),*}

Example:

cmd> jar cf abc.jar abc\*

All the classes from abc folder will be now in abc.jar file

Now you can import the .jar file in any java project.

April 29, 2012

Huffman Code in C/C++ with String as Node

Hi everyone,

I have copied someone's code and modified. But Since, the author has put the code as open source, I have done that for my friend.

Here it goes, Huffman code in C/C++

Source Code:
#include<conio.h>
#include<string.h>
#include<math.h>
#include<iostream.h>
#include<stdlib.h>

#define ARRAY_SIZE 20
#define MAX_NAME_LEN 25

int g,h,p,y,n;
char m[ARRAY_SIZE],b[ARRAY_SIZE][2],re;

int alpha = 65;

char name[ARRAY_SIZE][MAX_NAME_LEN];
int i=0,j=0,k=0;

/*
Perfoming operations
*/

//Tree Structure
struct tree
{
char a[20];
int s;
struct tree *left,*right;
}*root=NULL,*tt[20]={NULL},*temp,*temp2,*t2,*ri,*le;


// Queur Structure
struct pqu
{
int info;
char a[20];
struct pqu *ptr;
}*front=NULL,*t,*par,*t1,*p1,*p2;

// Pointer to queue
struct pqu* fp(int info)
{
struct pqu *p=NULL;
for(t1=front;t1->info<info&&t1!=NULL;t1=t1->ptr)
{
p=t1;
}
return (p);

}

//PUSH operation
void enqu(char a[20],int p)
{
t=(struct pqu*)malloc(sizeof(struct pqu));
strcpy(t->a,a);
t->info=p;
t->ptr=NULL;
if(front==NULL)
{
front=t;
}
else
{
par=fp(p);
if(par==NULL)
{
t->ptr=front;
front=t;
}
else
{
t->ptr=par->ptr;
par->ptr=t;
}
}
}

// POP operation
struct pqu* dequ()
{
t1=front;
front=front->ptr;
return t1;
}

//Get Info of a leaf
void info(char c[2])
{
int m=0,i;
temp2=root;
while(strcmp(c,temp2->a)!=0)
{
t2=temp2->left;
for(i=0;i<strlen(t2->a);i++)
{
if(t2->a[i]==c[0])
{
temp2=temp2->left;
m=1;
cout<<”0&”;
break;
}
}
if(m!=1)
{
temp2=temp2->right;
cout<<&”1&”;
}
m=0;
}
}

// Insert Operation
void insert()
{
char a1[20],b1[20],v1[20];
int i,j,z=0,l;
while(front!=NULL)
{
p1=dequ();
strcpy(a1,p1->a);
l=p1->info;
p2=dequ();
if(p2==NULL)
break;
strcpy(b1,p2->a);
strcpy(v1,a1);
temp=(struct tree*)malloc(sizeof(struct tree));
strcpy(temp->a,strcat(v1,b1));
temp->s=l+p2->info;
temp->left=NULL;
temp->right=NULL;
temp2=temp;
root=temp;
for(i=0;i<z;)
{
if(strcmp(tt[i]->a,a1)==0)
{
temp->left=tt[i];
for(l=i;l<z;l++)
{
tt[l]=tt[l+1];
}
i=0;
continue;
}
else if(strcmp(tt[i]->a,b1)==0)
{
temp->right=tt[i];
for(l=i;l<z;l++)
{
tt[l]=tt[l+1];
}
i=0;
continue;
}
i++;
}
if(temp->left==NULL)
{
le=(struct tree*)malloc(sizeof(struct tree));
strcpy(le->a,a1);
le->left=NULL;
le->right=NULL;
temp2->left=le;
}
if(temp->right==NULL)
{
ri=(struct tree*)malloc(sizeof(struct tree));
strcpy(ri->a,b1);
ri->left=NULL;
ri->right=NULL;
temp2->right=ri;
}
if(front!=NULL)
enqu(temp2->a,temp2->s);
tt[z++]=temp2;
}
}

//Display Tree
void disp(struct tree *rt)
{
if(rt!=NULL)
{
disp(rt->left);
//cout<<””<<rt->a;disp(rt->right);
}
}

//Display Name
void displayname(int idx)
{
cout<<name[idx]<<”: ”;
}

/*
End of operations
*/


//Main Method

int main()
{
while(1)
{
//Clear Screen
clrscr();

cout<<”Enter the total no of leafs : ”;
cin>>n;


for(i=0;i<n;i++,alpha++)
{
cout<<”Enter Name: ”;
cin>>name[i];

//itoa(alpha,m,10);
//strcpy(m,(char*)alpha[i]);
*m=(char)alpha; //Assigning Local Values
strcpy(b[i],m);

cout<<”Enter frequency for ”<<name[i]<<” : ”;
cin>>g;

//Enque to the list
enqu(m,g);

} //Repeat till all the leafs data entered

insert(); // Form the tree
disp(root); // Display the codeword of leaf from root


for(i=0;i<n;i++)
{
displayname(i);
info(b[i]);
cout<<”n”;
}

cout<<”nDo You Want To Continue Y or N: ”;
cin>>re;
clrscr();
if(re=='y'||re=='Y')
continue;
else
break; //exit(0);
}

return 0;
}//end of while

Output:

I am also making this as an open source code. Anyone can edit, share, re-distribute the code.

For further queries, please mail to psrdotcom@gmail.com

April 27, 2012

Upgraded to Ubuntu 12.04 LTS from Ubuntu 11.10

Hi all,

Today I have upgraded my PC from Ubuntu 11.10 to Ubuntu 12.04 LTS.

Procedure:

I have downloaded the .iso file from Ubuntu.com
Burn the .iso file into a CD.
Booted from the CD and upgraded.

After upgrading some of the non-compatible softwares has been removed.

I manually found the un-installed softwares and installed it.

My Review:

Look and feel: Not much difference between 11.10 and 12.04
Features: Inbuilt privacy application to specify that, "Don't record activity"
Videos: Search Youtube videos and play directly

Lot more features to search ..

UPSC Civil Services Premilinary Examination 2012 e-admit card / Hall Ticket Download

Hi all Civil Services Aspirants,

You can download the UPSC Civil Services Preliminary Examination 2012 e-Admit card (Hall-Ticket) through this link.

http://www.upsc.gov.in/

Please follow the below instructions to download the e-Admit card.
  1. On the right side of the page, you will find the "What's new" section.
  2. Under "What's new" section, click on the e-Admit Card-Civil Services (Preliminary) Exam.,2012 
  3. Please read the instructions carefully.
  4. Click on the "Click Here" link from the page

Important Instructions are:

  • Exam will be conducted in 2 sessions
  • Morning session: 9:30AM to 11:30AM
  • Afternoon session: 2:30PM to 4:30PM
  • Please reach the examination hall before 20 minutes of the session start time
  • Candidates are not allowed after 10 minutes to session start time
  • Bring only the Black Ball Point Pen to the examination center
  • Produce the downloaded e-Admit card at the examination center
  • If the downloaded e-Admit card photograph is not clear then
    • Bring 2 Passport size photographs (For 2 sessions, Morning and Afternoon)
    • Photo Identity Proof such as Driving License, Passport, Ration Card or any Govt. approved card
  • Any electronic device is not allowed inside examination center
  • Last date to download the e-Admit Card is 16-May-2012
    • Note: They will send you the e-Admit card to your registered e-mail id with UPSC.

Download Link of the e-Admit Card

http://164.100.128.31/CSPDefault.aspx

Download Process:
 
By 3 ways, you can download the e-Admit card
  • Click on the above mentioned link
  • Choose any one option
    • Registration Number: At the time of registration you will get this. (or)
    • Roll Number: After registration completion, you will get a roll number. (or)
    • Name: You full name as per the certificate, Father name and mother name (without Initials)
  • Provide your Date of Birth
  • Enter the captcha(characters in the box)
  • Click on the "Submit" button
Your e-Admit card gets downloaded.

All the very best for your examination.

April 26, 2012

Shelr.tv, Record your Terminal / Console and Share Online

Hi friends,

If you want to share your terminal work with your friends/official/public.

About Shelr.tv: http://shelr.tv/about

I have uploaded a sample terminal work of mine. Just listing .txt file(s)



Click on the Play button to view the recorded work.

We can create and share online tutorials and lot more by using this. If you are interested to do so, please follow the below procedure to install and record using shelr.tv


Pre-Requisites:

  1. Any Linux OS, Mac OS X
  2. Ruby and Rubygems


Your Identity:

  • Register with Shelr.tv to create an account with your any one of the existing ID (GitHub, Twitter, Google, OpenID)
  • You will be getting your unique ID from Shelr.tv
  • Now you are ready to record your terminal work


Installation:

I have tried with Ubuntu 11.10.

Please see the installation process here.

As you can see the bold faced lines are the commands which has been executed.

user@user-Vostro-230:~$ sudo add-apt-repository ppa:gwibber-daily/ppa
You are about to add the following PPA to your system:
 PPA for gwibber-daily
 Daily builds of Gwibber trunk
Press [ENTER] to continue or ctrl-c to cancel adding it

Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.aTSMFL4Xlg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keyserver.ubuntu.com:80/ --recv 06D1ED00EB802A66640696C8D0AFF96872D340A3
gpg: requesting key 72D340A3 from hkp server keyserver.ubuntu.com
gpg: key 72D340A3: public key "Launchpad PPA for gwibber-daily" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

user@user-Vostro-230:~$ sudo apt-get update
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net oneiric Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 588CD9FC28446D73

user@user-Vostro-230:~$ sudo gem install shelr
Fetching: json-1.6.6.gem (100%)
Building native extensions.  This could take a while...
Fetching: shelr-0.15.1.gem (100%)
Successfully installed json-1.6.6
Successfully installed shelr-0.15.1
2 gems installed
Installing ri documentation for json-1.6.6...
Installing ri documentation for shelr-0.15.1...
Installing RDoc documentation for json-1.6.6...
Installing RDoc documentation for shelr-0.15.1...


Record:

  1. Setup the Shelr with your unique id
  2. Run the record command
  3. Play the recorded work
  4. Push the recorded work
    • You will be prompted with "Description" and "Tags" of the work
    • Once successfully published the work, you will get the link (URL) of published one


Please see the sample recording and publishing of work.

user@user-Vostro-230:~$ shelr setup 8333xxxxxxxxxxxxxxxxxx

user@user-Vostro-230:~$ shelr record
Provide some title for your record: PSR's First Shelr Record
/home/user/.local/share/shelr/1335339141/meta
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> Your session started
=> Please, do not resize your terminal while recording
=> Press Ctrl+D or 'exit' to finish recording
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Script started, file is /home/user/.local/share/shelr/1335339141/typescript
user@user-Vostro-230:~$ ls -l *.txt
-rwxr-xr-x 1 user user 64 2011-05-12 15:52 mozilla.txt
user@user-Vostro-230:~$ exit
Script done, file is /home/user/.local/share/shelr/1335339141/typescript
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> Session finished

Replay  : shelr play last
Publish : shelr push last
user@user-Vostro-230:~$ shelr play last
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
user@user-Vostro-230:~$ ls -l *.txt
-rwxr-xr-x 1 user user 64 2011-05-12 15:52 mozilla.txt
user@user-Vostro-230:~$ exit
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
user@user-Vostro-230:~$ shelr push last

Your record will be published under terms of
Creative Commons Attribution-ShareAlike 3.0 Unported

Description: PSR's First Recording using Shelr.tv
Tags (ex: howto, linux): Test, Shelr, Ubuntu, PSR
=> Record published!
user@user-Vostro-230:~$ 

For further queries, please mail to psrdotcom@gmail.com

April 17, 2012

Clojure - A dynamic programming language targets JVM

Hi friends,

I found this post will be useful for the beginners and intermediate dynamic programming language developers.

Clojure -- http://clojure.org/

To get started with Clojure please follow the below procedure


Sample Examples:
  1. Calculate 1+2+(3*4) = 15
  2. Show JOptionPane Message Dialog with some text
You can see the example content in the below screen



References:
http://clojure.org/downloads
http://clojure.org/getting_started

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com