Friday, August 17, 2012

Android Sample Application

Those who are compatible with even core Java need not be worry about the coding as android platform is supporting to use the basic skills that you earned so far in colleges qnd universities.

First of all we will start with android sdk installation. Currently  I am giving the tutorial about installtion in Linux and the other is same around for windows. Eclipse is basically prefered as it comes along with the basic settings to install sdk.

Sunday, July 29, 2012

HTML Presentation


Normally in Every Day Life one encounters with the problem of making presentation. Problem is not with making presentation but its after effects become a headache. If you were told to put the same content on  some sort of blog this thing make your mind go out of nuts by doing a large copy paste work. So For that We are having an alternative which we never thought about but yes somebody did.

Making Presentation in HTML

DZ Slides is the name that let you help in making the Slides in HTML and CSS and that too with the help of basic and simple syntax that you are already familiar with.


And That's It. A One Single html file with few javascript transition and you are done. And If you are wondering how to include text, images, videos and but about their usability then don't worry about it HTML 5 will make you at ease.

For Downloading the needed files and the script please refer to. https://github.com/paulrouget/dzslides

Introduction to Android


Android is the name in OS for mobile computing which is well known to the techno geeks and the smartphone and tablet users. So Many Version till now developed for this OS and the 4.0 IceCream Sandwich being the latest one.

Now a days I am trying hands on this fantastic platform to build some applications. The basic necessity and the way that one need to opt for will be guided in the next posts. I will explain every aspect and will try to make the most of them clear to the readers.

Android Logo


Android Development is the reliable way to get into the S/W Development industry, a now a days when the mobile computing is on its full swings. Job opportunities are lot in this field. One can get master in Android Development by using a little bit of logical thinking. 

Friday, November 4, 2011

How to get back ubuntu panel with default icons

Once the Terminal window opens, enter the following command at the prompt:

gconftool-2 – -shutdown

(Note: There should be no spaces between the two dashes before shutdown.)

EDIT – Reader nickrud has suggested a better method instead of shutting down gconfd. Instead use the following command (thanks nickrud!)

gconftool – -recursive-unset /apps/panel

(Remember: There should be no spaces between the two dashes before shutdown.)

Then enter the next command:

rm -rf ~/.gconf/apps/panel

And enter one more command:

pkill gnome-panel

That's it!

Both top and bottom panels will appear (if missing) with their default settings. Now you can customize them to your preference and get on with using Ubuntu.

Monday, October 10, 2011

Locale Issue resolved in Postgresql

Though I developed a full fledge application in Punjabi for Complaint Management Branch of DC Office in Punjabi, but yesterday I faced a hrassing issue of POSTGRESQL. I did not know why it happened, why I was not able to resolve it yesterday?

I was testing the application yesterday on Windows , because I am making the application Cross Browser Compatible and yes OS Independent too. Thatzz why I need testing. But I faced very absurd issue, absurd so because i did it earlier and now i am not being able to understand it. Actually while Entering data in Punjabi I realized data being entering in glyph form.

At first I realized that issue might be non- rendering of Unicode by windows, so i make some changes in php files to make it work. But then i realized that something is wron with the database. I found that LC_Collate and LC_Ctype (i.e localization issue was there). So, I keep on searching and searching to change the locale (which was the main blunder I was making.)

I even changed the OS system locale and tried for that but not complete results obtained.

And Today In the evening when I was sleeping consciously, I realised that I had heard about a 'C' being used in lc_collate and lc_ctype . I kept on thinking What was that?

Then I understood that this is what i was looking for, setting lc_collation and lc_ctype to 'C' and defining encoding to UTF-8 will make you to enter any sort of language supporting unicodes.

In linux one is not going to face such issues because in that what you need to do is that.

Go, to System->Administration->Language Support.

You will see two tab . 1) Language and 2) Text

Select English(Indian) after that installing postgresql will set your database to default locale of 'en_IN' which will allow to enter hindi, punjabi, english and any language that India supports. ;-)

But it sets this to default , if you will fall in love with latin or greek some day and wants to enjoy those beautiful structure of glyph of these language in db you wont be able to do it with your predefined lc_collation.

In that case and in case of windows you have to use lc_collation and lc_ctype to be 'C'.

Not a big thing to do that just define this thing while creating database.

See some screenshot below:-

[caption id="attachment_72" align="aligncenter" width="1024" caption="LC_COLLATION and LC_CTYPE"]LC_COLLATION and LC_CTYPE[/caption]

Another image show data stored in punjabi.

[caption id="attachment_73" align="aligncenter" width="1024" caption="Punjabi Data Entered in POSTGRESQL"]Punjabi Data Entered in POSTGRESQL[/caption]

Thursday, September 29, 2011

Bank Salary Slip Generation for Payroll Management System

Today I completed, one more section of Payroll Management System and that is Generation of Bank Salary Slip. As I am making this Web Based payroll software for a contract based firm working at Trident Group, dhaula, they need an individual slip which they ll give to Bank for payment of their employees. So, I did the same.

Here is the code for the bankslip.php to generate odt
<?php
session_start();
if($_SESSION['user']!='admin') {
    header('location:../checklogin/error.php');
}
require_once('../library/odf.php');
include '../dbfiles/config.php';
class bankslip {
    private $op;
    private $query;
    public function download_slip() {
        $odf = new odf("bankslip.odt");
        if($_POST['month']!='' && $_POST['year']=='') {
            echo "<script>alert('You forgot to submit year'); window.location='bankslip.php';</script>";
        }
        elseif ($_POST['month']=='' && $_POST['year']!='') {
            echo "<script>alert('You forgot to enter month'); window.location='bankslip.php';</script>";
        }
        elseif (($_POST['month']!='' && $_POST['year']!='') && $_POST['current']!='') {
            echo "<script>alert('Hello!! I didnt told you to select all options'); window.location='bankslip.php';</script>";
        }
        elseif (($_POST['month']=='' && $_POST['year']=='') && $_POST['current']=='') {
            echo "<script>alert('Hello!! I told you to select one option'); window.location='bankslip.php';</script>";
        }
        elseif ($_POST['month']!=''&& $_POST['year']!='') {
            $this->op= 'defined';
            $month= $_POST['month'];
            $year= $_POST['year'];

        }
        elseif ($_POST['current']!='') {
            $this->op= 'current';
            $month= date('n')-1;
            $year= date('Y');
        }
        switch ($month) {
            case 1:
                $monthname= 'January';
                break;
            case 2:
                $monthname= 'February';
                break;
            case 3:
                $monthname= 'March';
                break;
            case 4:
                $monthname= 'April';
                break;
            case 5:
                $monthname= 'May';
                break;
            case 6:
                $monthname= 'June';
                break;
            case 7:
                $monthname= 'July';
                break;
            case 8:
                $monthname= 'August';
                break;
            case 9:
                $monthname= 'September';
                break;
            case 10:
                $monthname= 'October';
                break;
            case 11:
                $monthname= 'November';
                break;
            case 12:
                $monthname= 'December';
                break;
        }
        $odf->setVars('month', $monthname);
        $odf->setVars('year', $year);
        $this->query= mysql_query("Select workers.id as id, worker_fname, worker_lname, gross, hra, rate, workdays, pf, esi, advance, accno from workers, worker_fixeds, worker_varys, worker_acc where workers.id=worker_fixeds.worker_id and workers.id=worker_varys.id and workers.id=worker_acc.id and month='$month' and year='$year'");
        $bank = $odf->setSegment('emp');
        $s=1;
        while($result= mysql_fetch_array($this->query)) {
            if(!$result) {
                header('location:qerror.php?op='.mysql_error());
            }
            $cal= sprintf('%.2f',($result['rate'])*($result['workdays']));
            $ded= $result['pf']+$result['esi']+$result['advance'];
            if($result['workdays']<20) {
                $wages= sprintf('%.2f',(($result['rate'])*($result['workdays']))+0);
                $netpay= sprintf('%.0f', ($wages-$ded));
                $total= sprintf('%.0f', ($total+$netpay));
            }
            else {
                $wages= sprintf('%.2f',(($result['rate'])*($result['workdays']))+$result['hra']);
                $netpay= sprintf('%.0f', ($wages-$ded));
                $total= sprintf('%.0f', ($total+$netpay));
            }
            $bank->s($s);
            $bank->accno($result['accno']);
            $bank->name($result['worker_fname'].' '.$result['worker_lname']);
            $bank->amount($netpay);
            $bank->merge();
            $s=$s+1;
        }
        $odf->mergeSegment($bank);
        $odf->setVars('total', $total);
        $odf->exportAsAttachedFile('Bankslip.odt');
    }
}
$bank_slip= new bankslip();
$bank_slip->download_slip();
?>

Wednesday, September 28, 2011

JOD Converter, a Great Utility for Conversion of the Documents

There is always a requirement for a programmer to be able to present the reports and all other important documents in various available formats and this was a requirement for me too. So, to add this ability to my existing and upcoming projects too, I looked upon the existing solution suitable for me. And thus after a lot of search I found a solution, a utility that will be helpful to me to perform the conversion of these files.

It is JOD COnverter. (Not a S/W purely, it is a library basically.)

JODConverter, the Java OpenDocument Converter, converts documents between different office formats. It leverages OpenOffice.org, which provides arguably the best import/export filters for OpenDocument and Microsoft Office formats available today.

JODConverter automates all conversions supported by OpenOffice.org, including

  • Microsoft Office to OpenDocument, and viceversa

    • Word to OpenDocument Text (odt); OpenDocument Text (odt) to Word

    • Excel to OpenDocument Spreadsheet (ods); OpenDocument Spreadsheet (ods) to Excel

    • PowerPoint to OpenDocument Presentation (odp); OpenDocument Presentation (odp) to PowerPoint

  • Any format to PDF

    • OpenDocument (Text, Spreadsheet, Presentation) to PDF

    • Word to PDF; Excel to PDF; PowerPoint to PDF

    • RTF to PDF; WordPerfect to PDF; ...

  • And more


    • OpenDocument Presentation (odp) to Flash; PowerPoint to Flash

    • RTF to OpenDocument; WordPerfect to OpenDocument

    • Any format to HTML (with limitations)

    • Support for OpenOffice.org 1.0 and old StarOffice formats

    • ..