Jump to content

roopurt18

Staff Alumni
  • Posts

    3,746
  • Joined

  • Last visited

    Never

About roopurt18

  • Birthday 03/11/1980

Contact Methods

  • Website URL
    http://www.rbredlau.com

Profile Information

  • Gender
    Male
  • Location
    California, southern

roopurt18's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Every 32-bit OS, from Linux to Windows, I've run on my 4GB machine only picks up ~3.2GB of RAM.
  2. If you're doing money / financial calculations make sure you're using BC or GMP math functions. Do not use floats.
  3. Do as suggested and set it in your CSS and not your JavaScript. Regardless of how you're creating them the CSS rules will be obeyed. If you start putting CSS in your JavaScript you are combining logic and presentation and making it harder to fix things later. The CSS rule you're looking for is: a > img { border: none; } Or if necessary: a > img { border: none !important; }
  4. What's the HTML output to the browser? In other words paste the results of View source in your browser.
  5. I'd say you can just ask your questions in this thread. While I have no direct comparisons, their performance should be comparable and you may be able to find something on this through google. I can tell you that the following affects the performance of all database systems you're considering: 1) Hardware - Fast drives will make a big difference 2) Proper indexes 3) Good table design 4) Optimized queries where necessary 5) Database maintenance (reindexing, packing tables, etc) Regardless of your database software, hardware, whatever, you may reach a point at which you can not achieve the performance you desire. That's when you start looking into calculating and caching results on a schedule rather than in real-time as the user requests things.
  6. I'm probably the one that recommended PostgreSQL. In any case, I think it's the way to go. Both PostgreSQL and MySQL are similar in syntax and support many of the same basic features. However PostgreSQL, as far as I know (remember I've been out of touch with MySQL for 2 1/2 years now), does have more advanced capabilities. You don't have to use them, but they're there if you need them. If you're worried about large data sets, I have tables with more than 10 million records in them and the performance is fine. Certain operations take a long time but that would be the case in either piece of software with that many records.
  7. Since your error included an exception message, you must be on PHP5. Therefore you can use exceptions to determine if the method exists or not. <?php try { $exists = true; $c->call('doesThisMethodExist', array('symbol' => 'ABC')); } catch( Exception $ex ) { $exists = strpos( $ex->getMessage(), 'Function ("doesThisMethodExist") is not a valid method for this service' ) === false; } ?> I whipped that up on the fly so while the concept should be sound, the code may not be right. That method is a little out of the way; this might be easier: http://www.php.net/manual/en/soapclient.getfunctions.php Or poke around in the SOAP documentation: http://www.php.net/manual/en/book.soap.php
  8. As Ron White would say, "You can't cure stupid."
  9. Does that mean this is solved? If so please mark it.
  10. The salary of a web developer is irrelevant. Why not instead do a PowerPoint presentation on how the central banks have taken over all the major governments and converted our entire system of obtaining goods into a debt-based system. Then you can go on to show that no matter which career path you choose, the path is always ladened with debt-based institutions you must pass through. The final slide could then say, "Yah, you're !@#$ed." On topic, depending on locale, experience, and some other factors, you'll see numbers between $40k and $80k on average for web development; that's in U.S. dollars.
  11. We use nu-coder and phpexpress where I develop. Why? Because a year and a half a go the only PHP developer that worked here tried Zend and ZendGuard and didn't like it.
  12. I'm no guru in either linux or apache, but my understanding of bash is that when you run a bash script it creates a sub-shell that inherits environment settings of the current shell. My initial guess would be the environment when the script is run by apache is not the same as that when run from bash. I would assume things like stdin, stdout, and pipes would work the same, but like I said I'm no guru. As a step by step process to figure out what is happening, I would recreate the shell script as a new file with commands up to the point that it stops working. In other words, copy the script and remove all the commands that make it go nuts. Then try invoking those commands from the PHP script (accessed by apache). I guess what you really want to know is, Can cinelerra be invoked by PHP under Apache without problems just by itself?
  13. Where you write the file I only see $ID; I don't see $ID2. I applaud you for attempting error-checking in your file handing code, but you've gone a bit overkill with the is_readable() and is_writable() IMO. In addition your code is calling fclose() only if it couldn't write to the file. You need to call fclose() when the file handle is valid and you are done with it. A typical file writing block might look like: <?php $fp = fopen( 'the_file.txt', 'a' ); // or use mode 'w' if( $fp ) { fwrite( $fp, 'line 1' ); fwrite( $fp, 'line 2' ); // or write in a loop for( $i = 0; $i < 5; $i += 1 ) { fwrite( $fp, 'loop: ' . $i ); } fclose( $fp ); unset( $fp ); // finally close and lose the file handle } ?> You'll notice I didn't do much error checking during the fwrite() calls. If you want to be more robust and check for errors but don't want a bunch of nested if...else, then you can use a nifty trick with do...while. You create a nifty loop like so: <?php $success = false; do { // some stuff $success = true; } while( false ); ?> The loop only executes one time, but it has the advantage of supporting the break statement. This means we can very easily drop out of the loop at any point in time. By setting $success to false at the beginning of the loop, if we drop out early, $success will still be false at the end of the loop. However if the code makes it to the very end of the loop (the line above the while( false )), then we assume all operations within the loop were successful so we set $success to true. So here's a better example: <?php $fp = fopen( 'the_file.txt', 'a' ); // or use mode 'w' if( $fp ) { $success = false; // Assume failure do { if( ! fwrite( $fp, 'line 1' ) ) break; // if one write fails, end the loop if( ! fwrite( $fp, 'line 2' ) ) break; // if one write fails, end the loop // or write in a loop $success = true; // Now we assume success for( $i = 0; $success && $i < 5; $i += 1 ) { if( ! fwrite( $fp, 'loop: ' . $i ) ) $success = false; } // Since we assumed success=true right before the loop, if success is // now false we know a write failed, so we end the loop again if( ! $success ) break; $success = true; // if the code made it this far in the do...while, // then we know all of the writes were successful } while( false ); if( $success ) echo "All file writes were made correctly "; else echo "Not all file writes were done correctly "; // finally we close the handle if( fclose( $fp ) ) echo "and the file handle was closed."; else echo "and there was a problem closing the file handle."; unset( $fp ); // it's a good idea to "lose" the file handle, an old C habit } ?> (edit) I almost forgot, you can also forgo the fopen(), fwrite(), fclose() nonsense and do it all with file_put_contents(). The availability of that function depends on your version of PHP and it may not support file appending, although you could do something like: <?php $file = '/some/file.txt'; $append = 'some content' . PHP_EOL; file_put_contents( $file, (is_file( $file ) ? file_get_contents( $file ) : '') . $append ); ?>
  14. You say this site is old. Has it always done this or is this a new development? If it's a new development, has there been any upgrades or modifications in server software? I would perform searches on the following: REMOTE_ADDR REMOTE_ client_ip ip _SERVER HTTP_ If you're sure that $_SERVER is always populated correctly, then you could also attempt changing the offending line: $client_ip = $_SERVER['REMOTE_ADDR'];
  15. Just specify the full or relative path to the file. <?php // assume this script is in: c:\myproj\myscrypt.php // we want to delete: c:\myproj\mydata\junkfile.dat unlink( 'mydata/junkfile.dat' ); // relative unlink( 'c:/myproj/mydata/junkfile.dat' ); // absolute // I prefer to provide absolute paths based on a path I'm certain about unlink( dirname( __FILE__ ) . '/mydata/junkfile.dat' ); ?>
×
×
  • 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.