Jump to content

Pcgeekbrain

Member
  • Posts

    30
  • Joined

  • Last visited

Awards

This user doesn't have any awards

Profile Information

  • Gender
    Male
  • Location
    New York City
  • Interests
    Software Engineering, Photography
  • Occupation
    Junior Software Engineer

System

  • CPU
    Intel i7-4700HQ (8) @ 3.4GHz
  • RAM
    16GB
  • GPU
    NVIDIA GeForce GTX 850M
  • Display(s)
    2 x 1920x1080, 1 x 2560x1440
  • Cooling
    Air
  • Keyboard
    Integrated
  • Mouse
    Logitech Wireless (multiple versions)
  • Operating System
    Ubuntu 17.04 x86_64

Recent Profile Visitors

458 profile views

Pcgeekbrain's Achievements

  1. @mariushm Thanks for the tip. It seems that the server I was running forces buffering regardless of the PHP engine :-(.
  2. I am trying to have my script dynamically read a log file and stream it to the user. Here is my code (file is a tmp that I am using to test) <?php error_reporting(E_ALL); ini_set("display_errors", 1); // function disable_ob() { // Turn off output buffering ini_set('output_buffering', 'off'); // Turn off PHP output compression ini_set('zlib.output_compression', false); // Implicitly flush the buffer(s) ini_set('implicit_flush', true); ob_implicit_flush(true); // Clear, and turn off output buffering while (ob_get_level() > 0) { // Get the curent level $level = ob_get_level(); // End the buffering ob_end_clean(); // If the current level has not changed, abort if (ob_get_level() == $level) break; } // Disable apache output buffering/compression if (function_exists('apache_setenv')) { apache_setenv('no-gzip', '1'); apache_setenv('dont-vary', '1'); } } disable_ob(); echo "test"; //https://stackoverflow.com/questions/3218895/php-how-to-read-a-file-live-that-is-constantly-being-written-to $file='/home/user/youfile.txt'; $lastpos = 0; $i = 0; while ($i < 5) { //usleep(300000); //0.3 s sleep(1); clearstatcache(false, $file); $len = filesize($file); if ($len < $lastpos) { //file deleted or reset $lastpos = $len; } elseif ($len > $lastpos) { $f = fopen($file, "rb"); if ($f === false) die(); fseek($f, $lastpos); while (!feof($f)) { $buffer = fread($f, 4096); echo $buffer; flush(); } $lastpos = ftell($f); fclose($f); } $i++; } However, after 5 seconds the page loads with all the contents of the file and the test. I am at a loss for how to force it to start sending data before the 5 sec loop is finished. anything I might have missed?
  3. Then I think you will really like this phone that was just funded (runs the linux distro of your choice): https://puri.sm/shop/librem-5/
  4. I believe it is because you are using scan.next() and not next line for getting the qPointsx variables
  5. I ran this code on my local system and it seems that you are attempting to parse an invalid string on line 97 as it is a mesh of all the strings that where entered above and then trying to cast it to an integer. what are you attempting to do?
  6. You might want to try Double.parseDouble(qPoints1); that should return a double primitive while valueOf() Should return a object of the Double class. For more info see this stack-overflow post on the subject: https://stackoverflow.com/questions/7255078/double-valueofs-vs-double-parsedouble
  7. Seriously consider a used ThinkPad. Especially the T series. They are built like tanks and due to IBM and now lenovo not understanding the word "advertising" they fall in value really quickly. r/thinkpad on reddit generally knows the best bang for buck you can get at any given time. - Written on my awesome thinkPad with unsigned drivers :-) !
  8. I don't know how applicable this is to you, but I have always found this technique works for me. Look around your environment (particularly at work) and see if you can find some process that bugs you. (Does your company use an excel sheet to keep track of important information? Are customers consistently calling to get the same info over and over again? Is there something you find yourself doing again and again?) And start working on a solution for that. Generally boosts your interest in actually finishing the project, for me it is enough to make me get a MVP out the door :-)
  9. Kinda, I believe what you are looking for is called 'closure' in the js world. http://javascriptissexy.com/understand-javascript-closures-with-ease/
  10. Weird, the gpu might have done it :-(
  11. The problem with this theory is that we cannot predict the future. As such, what I think may happen in 20 years may not happen at all and therefore cannot be considered history. For example: 'people' thought that by '1984' the world would be a miserable place. Well the thought is history, the act, not so much.
  12. No, you should have around 3GB useable (experience with Windows 7). But the RAM cost of 64bit )2x address size) may not be worth the RAM gain.
  13. As for the core, UNIX and Linux are not the same. Look up GNU.
  14. IOS was built for the iPhone. Use a nexus phone and tell me Android is worse after that. And that is still after very little optimization (just less crapware). And for viruses, ios has plenty more of them. But Android does not restrict application installs very much so a virus/Trojan... can persist out of the app store.
×