Jump to content

shamuntoha

Members
  • Posts

    55
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male

shamuntoha's Achievements

Member

Member (2/5)

0

Reputation

  1. Many thanks for comments. some sites benchmerk show things slowing down while using lot of things which is not thought more before creating it, where i am doing a open source project for VML, XML, SVG, JS (respecting large hits). http://www.php.lt/benchmark/phpbench.php do we care those staff while doing php?
  2. i did this for my w2k3 working. win: reboot_pc.bat: net user administrator back_to_old_password_on_hack shutdown -r -f -c "Daily or weekly" unix: file /etc/ini.. still trying...
  3. Thanks to all, but i read a article that storing inside class, cause memory or performance issues ? like not all programs need OOP.
  4. index.php global $a; class.php function called_from_index() { & $a = 4; } do you mean from above, i have to use global to change the $a?
  5. Server maintain: In windows 2003, i setup a schedule for weekly: shutdown -r -f -c "Maintain" Q. How i can do this for my Solaris 5 ? Q. How i can put the Windows 2003 batch command to reboot and change back the password of "Administrator" to the password that i assigned, in case of someone hack and changed. Q. How i can put Solaris 5, script to on reboot execute. #passwd rootpassword to myoldpassword #myCppprogram restart #mail central management
  6. Where i can post my questions of Windows 2003, Solaris 5, 8, 10, like batch file and auto schedule scripts.
  7. Question is not so clear. Is your password encrypted ? by using base64 or md5 then you need to decode it. Two way its mostly encode and decode, either by your front page, or from mysql function itself. $password = "helo"; $encrypt_pwd = base64_encode($password); ($password == $encrypt_pww) ! true : false; $decrypt_pwd = base64_decode($password); ($password == $decrypt_pwd) ! true : false;
  8. if you mean to loop: for ($i=0; $i<6; $i++) { switch ($i) { case 5: echo "6 Times looped, call array": echo array[0].array[1].array[2]; break; } } or if u mean. foreach ($array in $key=>$value ) { if ($key == 2 ){ $array_scaned = true; } }
  9. function ..() { global $all_pages; } is global inside function, same like outside functions to define?
  10. shamuntoha

    PHP

    php interview asked few questions. i failed to answer it in 1 minute. does anyone know it? Q.1 what is the x and y value ? x+y = 3 x-y = 4 Q.2 what is the result? {1, 2, 3, 4, 6}
  11. Why to use === ? Why not only use ==?
  12. Thanks, i came to this code, which is much faster. <?php /** * If any errors * - Large file handle * - 100mb to 200mb * - unix grep use, tail etc */ error_reporting(E_ALL); // File total size $fsize = filesize("d:\\log24"); // for ini_set $fsize += 32 * 100 * 1024; // ini_set("memory_limit", $fsize . "M"); // Set memory to use ini_set("memory_limit","90M"); // Start and Download move $send = 0; // Set the chunk $chunk = (2 << 20); // Create large array. $buffer = array(); // File resource $ex = fopen("d:\\log24", "rb"); // Attempts to try $i=0; // Loop to get data as binary safe while($send <= $fsize){ $buffer[$i] = explode('---', fread($ex,$chunk) ); $send += $chunk; $i++; } // Close resource fclose($ex); // Clear send unset ($send); // Output the data foreach($buffer as $key=>$value){ echo $key; } // Clear ram unset($buffer); // Exit exit(0); ?>
  13. What do you mean by this ? can you explain? "split the file yourself"
  14. Did you mean to do following ? 3 different method try. new 2 as following. Handle 1: Notice: Undefined variable: line in D:\xampp\htdocs\jony\index.php on line 6 Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 33292271 bytes) in D:\xampp\htdocs\jony\index.php on line 6 <?php error_reporting(E_ALL); //ini_set("memory_limit","M"); $file = fopen("d:\\log24", "r"); while ( !feof($file) ) { $line = $line . fgets($file); } $ex = explode('---', $line); echo $ex[0]; exit(0); ?> Handle 2: Notice: Undefined variable: line in D:\xampp\htdocs\jony\index.php on line 10 Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 31457281 bytes) in D:\xampp\htdocs\jony\index.php on line 10 <?php error_reporting(E_ALL); //ini_set("memory_limit","M"); $send = 0; $chunks = (2 << 20); $total = filesize("d:\\log24"); $file = fopen("d:\\log24", "r"); while ( $send < $total ) { $line = $line . fread($file, $chunks); $send += $chunks; } $ex = explode('---', $line); echo $ex[0]; exit(0); ?>
  15. Yes split in parts is also not helping showing the allocation error. Fatal error: Allowed memory size of 83886080 bytes exhausted (tried to allocate 15358622 bytes) in D:\xampp\htdocs\jony\index.php on line 6 <?php error_reporting(E_ALL); ini_set("memory_limit","80M"); $f1 = file_get_contents("d:\\log24"); $total = strlen($f1); $part1 = substr($f1, 0, $total/5 ); //$part 2= substr($f1, $total/2, $total ); $ex = explode("---", $part1); echo $ex[0]; exit(0); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.