User Profile

Collapse

Profile Sidebar

Collapse
chemlight
chemlight
Last Activity: May 6 '09, 08:43 PM
Joined: Jan 23 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • chemlight
    replied to PHP library for printing landscape
    in PHP
    One more question relating to this topic. Are there any good starter tutorials for the php GD library? I've found some...php.net has the manual, but I'm looking for a starting point that gets me into it quickly, and then I can spend more time looking at all the details.
    See more | Go to post

    Leave a comment:


  • chemlight
    replied to PHP library for printing landscape
    in PHP
    Thanks. I've got a Mac for development, and running ubuntu for our server.

    The answer I found was php GD library, and was also able to find a great walkthrough for the install.

    http://www.libgd.org/DOC_INSTALL_OSX

    obviously applies only to OSX, but its helpful in case anyone in my situation runs across this. The only thing - before you follow the instructions make the following directories:

    /usr/local/man...
    See more | Go to post

    Leave a comment:


  • chemlight
    started a topic PHP library for printing landscape
    in PHP

    PHP library for printing landscape

    I seem to remember from somewhere that there is a PHP library for converting a php page into an image, and rotating it for printing in landscape. I haven't been able to find anything on google, or bytes. A lot of chatter about the @page CSS properties (which don't work). Not what I need though...

    A point in the right direction would be appreciated.
    See more | Go to post

  • Solution Found

    The solution is actually pretty simple (kicking myself).

    Since I am using images, I am placing a div around each image that needs to be displayed to create the form. The div is positioned using position: relative. So, both the image AND the information are placed within the div. Then, the absolute positioned information is adjusted based on the div it is now contained in, and prints as well.
    ...
    See more | Go to post

    Leave a comment:


  • More testing and interesting results for printing absolute positioned element

    Alright, so it gets more interesting.

    I've been trying to get the printing to work, and tried setting up the absolute positioned element within a relative positioned element (since an absolute positioned element is based on its most recent ancestor with positioning applied)

    Here was my first test:

    Code:
     <html>
    ...
    See more | Go to post

    Leave a comment:


  • Absolute positioned HTML elements not printing

    I am having an issue with HTML elements not printing when positioned absolutely when they extend beyond the first page. I am working on some foreign tax refund forms. The forms are cut into multiple jpg images, so that I can position them on the HTML page, so that they print properly (page1, page2, etc). The information to complete the forms is then positioned using position: absolute and a z-index of +1.

    Here is an example code of...
    See more | Go to post

  • My biggest issue with size was a series of drop down boxes, that could contain very large lists. I found the solution to be to not inlcude the drop down boxes in the save. I haven't had any issues since then.
    See more | Go to post

    Leave a comment:


  • The problem with firefox is in your function a_state, you are using:

    Code:
    p.innerHTML = this.innerHTML
    To get the actual value of the textarea, use value.

    Code:
    p.innerHTML = this.value;
    Again, this works in Firefox. I don't have IE, and I have yet to test in Safari. Will get back to you with Safari (and maybe Camino?) if I can find out anything else
    See more | Go to post

    Leave a comment:


  • chemlight
    replied to testing php script performance
    in PHP
    Thanks for the information. I had tried using date('u') initially, but that only returned all 0's.
    See more | Go to post

    Leave a comment:


  • I look forward to it!
    See more | Go to post

    Leave a comment:


  • chemlight
    chemlight posted a Visitor Message for bilibytes
    Curiosity is something that plagues me. In our discussion, you mentioned a site you were working on. What site is it?
    See more | Go to post

  • Here's the code that I speed tested:

    Code:
    function microtime_float()
    		{
    			list($usec, $sec) = explode(" ", microtime());
    			return ((float)$usec + (float)$sec);
    		}
    		
    		$time_start = microtime_float();
    		
    		$i = 0;
    		while($i < 1000){
    			$info = mysql_query("SELECT email, email_privacy FROM testtable2 WHERE id = '1'");
    			while($row = mysql_fetch_array($info)){
    ...
    See more | Go to post

    Leave a comment:


  • chemlight
    replied to testing php script performance
    in PHP
    http://bytes.com/topic/php/answers/8...est-php-script

    that should do it....
    See more | Go to post

    Leave a comment:


  • chemlight
    replied to testing php script performance
    in PHP
    Found the anser at php manual.

    Here is the code for testing time in microseconds:
    [code=php]
    <?php
    /**
    * Simple function to replicate PHP 5 behaviour
    */
    function microtime_float ()
    {
    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);
    }

    $time_start = microtime_float ();

    // Sleep for a while
    ...
    See more | Go to post

    Leave a comment:


  • Lol. I just posted a thread on that too...

    :-)...
    See more | Go to post

    Leave a comment:


  • chemlight
    replied to testing php script performance
    in PHP
    Speed Test PHP Script

    I was thinking about how to speed test a php script, and I'm not sure.

    I get the basics:

    testing the first action
    Code:
    $i = 0;
    while($i < 10000){
    //do action 1
    }
    //return time
    testing the second action
    Code:
    $i = 0;
    while($i < 10000){
    //do action 2
    }
    //return time
    ...
    See more | Go to post

    Leave a comment:


  • Not sure if its the best. I don't know how to test script speeds, but thats how I would think of doing it...(note the "newbie" under Chemlight :-) )
    See more | Go to post

    Leave a comment:


  • I like the idea of metadata. You could pre-pend the metadata with the public/private value, use whatever delimeter, and then split the value with your script, limiting it to only one split.

    so, for example, email would look like
    private;myemail @email.com

    then, when you queried the table, you would run something like this (I'm using php as an example, not sure what script you're using)
    Code:
    $email = mysql_query("SELECT
    ...
    See more | Go to post

    Leave a comment:


  • That worked. I was also just about to post that testing if the resource is null also works.

    One of the things I had tried was:
    Code:
    if(count(mysql_fetch_array($result)) > 0)
    But that returns 1 in both cases. The mysql_num_rows returns the proper count.

    Thanks again for your help and patience!
    See more | Go to post

    Leave a comment:


  • I also decided to test it by providing a variable to the query string istead. I got the same results

    Code:
    <?php
    	require("scripts/db_connect.php");
    
    	$vendor = 4486;	
    	$result = mysql_query("SELECT * FROM vendor_details WHERE id = " . $vendor . "");
    	if(!$result){
    		echo "no vendor " . $vendor . "<br />";
    	}else{
    		echo "vendor
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...