C Interview Questions 181-190

This post contains 181-190 questions of c program. It will helpful to solve c aptitude questions, c quiz , c objective type questions etc in interview.181-190 QuestionsQ1: The time complexity of binary search in average case is a) O(n) b) O(n2) c) O(nlogn) d) O(logn) Answer: Q2: The time complexity of bubble sort in best case is a) O(n) b) O(n2) c) O(nlogn) d) O(logn) Answer: Q3: The time complexity […]... Read More »

C Interview Questions 191-200

This post contains 191-200 questions of c program. It will helpful to solve c aptitude questions, c quiz , c objective type questions etc in interview.191-200 QuestionsQ1: The time complexity of selection sort in worst case is a) O(n) b) O(n2) c) O(nlogn) d) O(logn) Answer: Q2: The time complexity of insertion sort in worst case is a) O(n) b) O(n2) c) O(nlogn) d) O(logn) Answer: Q3: The time complexity […]... Read More »

Yii 1.0 Extract Zip files

Extract Zip Files Using YiiI have added the source code to extract the zip files using yii public function actionExtractfile($filename) { $filename='filename'; $zipfile=DirDetails."/filename.zip"; $zip = zip_open($zipfile); $extract=DirDetails."/newfolder"; if($zip) { if(!is_dir($extract)) mkdir($extract); while ($zip_entry = zip_read($zip)) { // if(zip_entry_name($zip_entry)==$filename) //if you need any specified file use this condition { $fp = fopen($extract."/".zip_entry_name($zip_entry), "w"); if (zip_entry_open($zip, $zip_entry, "r")) { $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); fwrite($fp,"$buf"); zip_entry_close($zip_entry); fclose($fp); break; } } } zip_close($zip); } […]... Read More »

Yii 1.0 Update Zip files

Update Zip Files Using PHPI added the source code to add new file into existing zip files. public function actionUpdatezip($zipfilename,$filelist) { $destination=Yii::app()->basePath.'/files/'.$zipfilename.".zip"; $zip=new ZipArchive(); if(!$zip->open($destination)) { return false; } if($filelist) { foreach($filelist as $thefile) { $filemodel=new Filesmodle; $randno=rand(11111,99999); $filename=$randno.$thefile->name; // yii magic method $zip->addFile($thefile->tempname,$filename); //$fileext=$thefile->extensionName; //$filemodel->Size=$thefile->size; } } $zip->close(); }... Read More »

FTP File Transfer Using Yii

This tutorials will helpful to transfer the large files (or small files)  from ftp folder to your application folder. When you upload the large files (in applications), It will take some times. But if you use ftp file transfer It will transfer the files fast. Based on my experience i explained below.Create Ftp Account and Folder Add Ftp Extension Config Main.php Ftp Controller Ftp View Create Ftp Account and FolderFirst create a ftp account in […]... Read More »

How To Handle CGridview in Yii

CGridview Basic CGridview With User MethodsCGridview Css StyleCGridview CButtonColumnCGridview AjaxCGridview enableSortingImages In CGridviewLink In CGridviewCGridview Summary TextPagination Header Text And Override Pagination CSSEmpty Result TextCGridview After DeleteSupport FilesCGridview Pagination TextColumn Header In CGridviewRow Selection Or Click Event In CGridViewAdd Css Class To CGridView Table RowAdd Class Or Style For CGridView Header CellAdd Css Class To CGridView Table ColumnCGridview Filter : DropDown ListCGridView Filter: DatepickerCGridview BasicHint – For Html: When display the date, […]... Read More »

Password Generator In PHP

Password Generator In PHP. We can generate dynamic password with numeric, alphanumer etc using php. I created dynamic_password function. It will generate and return the dynamic password. You should have to send password type, length like sha1, md5 for password type and numeric value for password length.<?php function dynamic_password($type='',$length=10){   // Dynamic password function   $chars = array_merge(range(0,9), range('a','z'), range('A','Z'));   shuffle($chars);   $password = implode(array_slice($chars, 0, $length));   if($type=='md5'){ […]... Read More »