I am watching Stargate SG-1

July 30th, 2007 by Quatrux

Well, I saw it on TV sometime ago, but really not all the seasons, so I thought to watch all of them and darn am I in a problem.. The movies and moreover 10 seasons of Stargate SG-1 with 22 episodes each and an episode lasts for about 44 minutes, so it will really take a lot of my time.. Not to mention that there are 3 episodes of Stargate Atlantis already, so I am really stuck! I thought Babylon-5 is long or Prison Break, not to mention Conan the Barbarian with so much episodes or any anime with over 200 episodes.. :D Well, with time I think I will finish, maybe on September 1? I am already watching the 4th season, the 5th episodes or something like that, well, it is not the best stuff, but I can watch it, I usually like fantasy. ;)

Posted in Personal | No Comments »

file_put_contents() for PHP4!

July 30th, 2007 by Quatrux

When I was using PHP4 for my web stuff, I wrote a quite good function for usage with PHP4, as a lot of you know on PHP5 a very handy function file_put_contents(); exist, but not in PHP4, but if you want to use it on PHP4, due to your server still has it running, which in my opinion is still quite normal, I will share another of my functions, I just browsed around my sources which usually never is finished and found it, so thought to share, it is in my opinion quite different when the one offered on the PEAR package, but it does the same, just is a little bit expanded.. I will explain a little! Firstly I named it put_file_contents(); to avoid the risk of duplication, but for instance, just do a check with the simple function function_exists(); Moreover, I recommend to include your functions only once, I mean use include_once() and/or require_once() ;)

  1. function put_file_contents($file, $data, $mode = ‘a’, $path = ‘0′, $y = ) {
  2.         /* check if file exists and atempt to Create it */
  3.         if (!file_exists($file) && !touch($file)) {
  4.                 user_error(‘put_file_contents() Can not create the file’, E_USER_WARNING);
  5.                 return FALSE;
  6.         /* check if Directory exists */
  7.         } elseif (is_dir($file)) {
  8.                 user_error(‘put_file_contents() Can not write to a directory’, E_USER_WARNING);
  9.                 return FALSE;
  10.         /* check if file is regular */
  11.         } elseif (is_file($file)) {
  12.                 /* check the Flags */
  13.                 if (!strpos(‘**|a|w|t|’, ‘|’.$mode.‘|’)) {
  14.                         $mode = ‘a’;
  15.                 /* Change Owner if required */
  16.                 } elseif ($mode == ‘t’ AND !qcreate_file($file)) {
  17.                         user_error(‘put_file_contents() Can not change file owner’, E_USER_WARNING);
  18.                         return FALSE;
  19.                 }
  20.                 /* check if file is writabl/stronge otherwise try to change permsissions */
  21.                 if (!is_writable($file) && (!chmod($file, 0666) OR !qftp_chmod($file))) {
  22.                         user_error(‘put_file_contents() Can not write to file, permission denied’, E_USER_WARNING);
  23.                         return FALSE;
  24.                 /* Change Data Array to String */
  25.                 } elseif (is_array($data)) {
  26.                         $data = implode($y, $data);
  27.                 /* Check Input Data */
  28.                 } elseif (!is_scalar($data)) {
  29.                         user_error(‘put_file_contents() The 2nd parameter should be either a string or an array’, E_USER_WARNING);
  30.                         return FALSE;
  31.                 }
  32.                 /* Open and Store Data to File */
  33.                 if (($fo = fopen($file, $mode, $path)) === FALSE) {
  34.                         user_error(‘put_file_contents() Failed to open stream: Unknown reason’, E_USER_WARNING);
  35.                         return FALSE;
  36.                 }
  37.                 if (fputs($fo, $data) === FALSE) {
  38.                         user_error(‘put_file_contents() Failed to write to file: Unknown reason’, E_USER_WARNING);
  39.                         return FALSE;
  40.                 }
  41.                 /* Close Handle */
  42.                 fclose($fo);
  43.                 return TRUE;
  44.         } else {
  45.                 user_error(‘put_file_contents() Can not continue: Not a file’, E_USER_WARNING);
  46.                 return FALSE;
  47.         }
  48. }

As you can see, several times more of my stupid custom functions were used, you can remove them, but I will still share them, even though I don’t think they are useful.. I just tried to paste them, but I saw even more custom things :D So I think I will only leave and idea and not an actually working code.

Posted in PHP | 1 Comment »

James Bond – Agent 007

July 9th, 2007 by Quatrux

I started watching James Bond, Agent 007, due to on my local TV they will show it all the summer every Sunday, but as I don’t really watch TV anymore and I am forgetting that, so I decided to watch through my computer, well I saw the first 8 movies and I can say that the first movie James Bond, Dr. No in 1962 was quite good, it really seemed that it is James Bond, the storyline and the main elements and still young Sean Connery! But in my opinion, the best Bond movie was From Russia with Love in 1963, it was the second movie and I think that fixed everything what was bad in the first movie, Sean Connery also still was young, but Goldfinger 1964, well it was quite stupid and the main elements of James Bond as Secret Agent were a bit lost, but it was alright, now Thunderball 1965 was something different, as I know it cost a lot of money and is considered one of the best Bond films, even though were are really a lot of things to be amazed of I still think that From Russia with Love is the best one.

Anyway, a lot can say that You Only Live Twice is a real classic, but most of the elements are lost there, it really is a good movie and almost the last movie with Sean Connery, he got a bit old in those 5 years, so I guess the next James Bond movie with George Lazenby as James Bond On Her Majesty’s Secret Service in 1969 got much less money and I really laughed, the real Bond was gone, I knew that the next movie after this Sean Connery will return, but I didn’t thought he will look much older and fatter, not what people imagine Bond, so Diamonds Are Forever in 1971 with Sean Connery also was a stupid movie in my opinion, don’t know even how to comment, to lazy, better watch it yourself..

So I think those guys also thought similar and Yesterday I saw James Bond Live and Let Die made in 1973 and Roger Moore was acting as James Bond, the Agent 007, he was young and looked as James Bond, so I would call him the next James Bond, due to some elements of the real Bond came back, some more Bond action came back and they didn’t do bullshit! So will comment on this later, due to I still have to see some movies and time usually lacks. ;)

Posted in Personal | 1 Comment »