27 August 2012

Error Occur In Terminal
Solved by using this command in Terminal

1.) sudo rm /var/lib/apt/lists/*
2.) sudo apt-get update

Sandeep help in drop database of autonomous
Comannd to give all priviledges to user
GRANT ALL PRIVILEGES ON automation TO ‘sandeep’@’localhost’

Install latex
sudo apt-get install texlive-full

slides to learn basic latex
http://www.slideshare.net/jaspreetsarao/basics-of-latex
http://www.slideshare.net/jaspreetsarao/basics-of-latex

26 August 2012

Virtual private server (VPS) is a term used by Internet hosting services to refer to a virtual machine. The term is used for emphasizing that the virtual machine, although running in software on the same physical computer as other customers’ virtual machines, is in many respects functionally equivalent to a separate physical computer, is dedicated to the individual customer’s needs, has the privacy of a separate physical computer, and can be configured to run server software.

Now this code is able to display vertical as well as horizontal answers.

function chunk($from, $to, $chunk, $step, $vertCol)
 {
 if(!empty($vertCol))
 {
 for($i = $from; $i <= $vertCol; $i++)
 {
 $array[] = range($from, $to, $step);
 $array[loop] = $chunk-1;
 return($array);
 }
 }
 else
 {
 $range = range($from, $to, $step);
 $array[div] = array_chunk($range, $chunk);
 $array[loop] = $chunk-1;
 return($array);
 }
 }

Code Setting and Push on github.

https://github.com/NavdeepBagga/Applicant-pdf-file

24 August 2012

Insert comma

if(!empty($displayResult[$element]))
 {
 if($j==0)
 $rangeDisplay .= $displayResult[$element];
 else
 $rangeDisplay .= ",".$displayResult[$element];
 $j++;
 }

Output

Insert slash

$number=$pieces[$i];
 if($number == "139")
 {
 $realValue = $displayResult[$number];
 if(isset($realValue))
 {
 $concatDisplay .="/".$displayResult[$number];
 }}
 else{
 $realValue = $displayResult[$number];
 if(isset($realValue))
 {
 $concatDisplay .=" ".$displayResult[$number];
 }}

Output

23 August 2012

Change to Functions and Class

function metrics($segment, $array, $loop, $temp)
 { 
 global $odf;
 global $displayResult;
 $segment = $odf->setSegment($segment);
 foreach($array AS $element) 
 {
 if(!empty($displayResult[$element[0]]))
 { 
 for($i=0; $i<=$loop; $i++)
 { 
 $var = "$temp$i";
 $segment -> $var($displayResult[$element[$i]]); 
 }
 $segment -> merge(); 
 } 
 }
 $odf -> mergeSegment($segment);
 }

Help of sandeep and daman in session concept.
Help of komal in division CSS.

Convert code into Zend Coding Standard.

22 August 2012

I Convert this code

$article = $odf->setSegment('articles');
foreach($nd AS $element) {
 if(!empty($displayResult[$element[0]]))
 {
 $article->examArticle($element[0]);
 $article->InstituteArticle($displayResult[$element[1]]);
 $article->BoardArticle($displayResult[$element[2]]);
 $article->MaxmrkArticle($displayResult[$element[3]]);
 $article->PercentageArticle($displayResult[$element[4]]);
 $article->GradeArticle($displayResult[$element[5]]);
 $article->DopassArticle($displayResult[$element[6]]);
 $article->DurationArticle($displayResult[$element[7]]);
 $article->merge();
} 
}

To this code.To reduce LOC.
loc is line of code. It is a method to measure the size of program.
Another method is function point which measure number of functions
used in program.

$tac = $odf->setSegment('tackle');
 foreach($employment AS $element) 
 {
 if(!empty($displayResult[$element[0]]))
 { 
 for($i=0; $i<=6; $i++)
 { 
 $j="Org$i";
 $tac->$j($displayResult[$element[$i]]); 
 }$tac->merge(); 
 } 
 }
$odf->mergeSegment($tac);

Then convert above code into Function.

function segment($segment,$array,$loop)
 { global $odf;
 global $displayResult;
 $segment = $odf->setSegment($segment);
 foreach($array AS $element) 
 {
 if(!empty($displayResult[$element[0]]))
 { 
 for($i=0; $i<=$loop; $i++)
 { 
 $vari="Org$i";
 $segment->$vari($displayResult[$element[$i]]); 
 }$segment->merge(); 
 } 
 }
 $odf->mergeSegment($segment);
 }
segment("tac", $employment, 6);

Use of array chunk function.

function chunk($start,$stop,$chunk)
{
 $range2 = range($start,$stop);
 $arrele[0]= array_chunk($range2, $chunk);
 $arrele[1] = $chunk-1;
 return($arrele);
}
chunk(143,212,7);
$use = chunk(143,212,7);

Then function call change into this when I use chunk function.
segment(“tac”, $use, 6);

Output

21 August 2012

I use segment to display value in table which having metrics.

$article = $odf->setSegment('articles');
foreach($nd AS $element) {
 if(!empty($displayResult[$element[0]]))
 {
 $article->examArticle($element[0]);
 $article->InstituteArticle($displayResult[$element[1]]);
 $article->BoardArticle($displayResult[$element[2]]);
 $article->MaxmrkArticle($displayResult[$element[3]]);
 $article->PercentageArticle($displayResult[$element[4]]);
 $article->GradeArticle($displayResult[$element[5]]);
 $article->DopassArticle($displayResult[$element[6]]);
 $article->DurationArticle($displayResult[$element[7]]);
 $article->merge();
} 
}

20 August 2012

POSIX an acronym for “Portable Operating System Interface”, is a family of standards specified by the IEEE for maintaining compatibility between operating systems. POSIX defines the application programming interface (API), along with command line shells and utility interfaces, for software compatibility with variants of Unix and other operating systems.
The POSIX specifications for Unix-like operating system environments originally consisted of a single document for the core programming interface.

telnet <hostname> 25 is used to check mail server installed on server.

I am able to create multiple rows with single row in odt template.

I use this code to do:

 

$j =53;
for($i=0; $i<=7; $i++)
{
 $studies[$i]["text0"]=$j;
 $studies[$i]["text1"]=++$j;
 $studies[$i]["text2"]=++$j;
 $studies[$i]["text3"]=++$j;
 $studies[$i]["text4"]=++$j;
 $studies[$i]["text5"]=++$j;
 $studies[$i]["text6"]=++$j;
 $studies[$i]["text7"]=++$j;
++$j;
}

To reduce loc

Now I use this function of php it reduce code and serve same purpose

$input_array = range(56,135);
print_r(array_chunk($input_array, 8));