Jump to content

The Little Guy

Members
  • Posts

    6,675
  • Joined

  • Last visited

Posts posted by The Little Guy

  1. putting a match in the field list is useless, unless you want to sort by it.

     

     

    SELECT item_keyword_search, (MATCH (item_keyword_search) AGAINST ('d-link* router*' IN BOOLEAN MODE)) as score 
    FROM item_import 
    WHERE MATCH (item_keyword_search) AGAINST ('d-link* router*' IN BOOLEAN MODE) order by score desc

  2. I don't believe MySQL has a natural sorting capability. So, you might need to query the records, dump into an array and then sort using PHP's natural sorting capability

     

    It does't, and from what I have read my two queries above should allow for natural sorting, so I don't think it is the issue.

     

     

    Wanna post the results of this?

     

    show create table files;

     

     

    what is the Collation of the column? that is more than likely the problem, as it has to do with sorting (if I am not mistaken)

  3. Saw this ad in my Twitter:

    http://www.bingiton.com

     

    Basically you do a search and it displays Bing's results on one side and Google's on another side (The side is random for each search), and you have to choose which result set you like better. The bad thing is, their is still a way to cheat....

     

    But basically it is Microsoft trying to prove it is better than Google. After the test Google won for me :birthday:

  4. Jim Halpert: Question, what kind of bear is best?

    Dwight Schrute: That's a ridiculous question.

    Jim Halpert: False. Black bear.

    Dwight Schrute: Well, that's debatable. There are basically two schools of thought.

    Jim Halpert: Fact, bears eat beets. Bears, beets, "Battlestar Galactica."

    Dwight Schrute: Bears do not... What is going on? What are you doing?

    Jim Halpert: Last week, I was in a drugstore, and I saw these glasses. Four dollars. And it only cost me $7 to recreate the rest of the ensemble, and that is a grand total of $11.

    Dwight Schrute: [back at their desks] You know what? Imitation is the most sincere form of flattery. So I thank you.

    [Jim takes a bobblehead doll out of his suitcase and sets it on his desk]

    Dwight Schrute: Identity theft is not a joke, Jim! Millions of families suffer every year!

    Jim Halpert: Michael!

    Dwight Schrute: Oh, that's funny. Michael!

  5. This seems like a fairly close way to calculate it. When I did this the console logged about 15MB/s When I went to speedtest.net and did a speed test, it was pretty close to the same thing.

     

    The important parts are between the <script> tags (top and bottom)

     

    <!DOCTYPE HTML>
    <html>
    <head>
    	<script>
    		<?php
    		echo "var filesize = ".filesize(__FILE__).";\r\n";
    		?>
    		var d1 = new Date().getTime();
    	</script>
    </head>
    <body>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    	<p>a;dfashdflajhdlkfjhsldkfj</p>
    </body>
    	<script>
    		var d2 = new Date().getTime();
    		var millitime = d2 - d1;
    
    		var diffTimeSeconds = millitime / 1000;
    		var bits = (filesize * ;
    		var kbits = bits / 1024;
    		var connectionSpeed = kbits / (diffTimeSeconds);
    		console.log(connectionSpeed / 1024);
    	</script>
    </html>

  6. If you are including another php that may have issues. Usually it is good NOT to close your <?php tags, unless there is more non-php (html). If you do close them and have an unknown space, or new line after it, the file including it will see that as output. If you don't close the tag and have many newlines or spaces the PHP file will ignore those lines.

     

    <?php
    require_once "some_file.php";  // This will not throw an error
    require_once "some_file2.php"; // This will throw an error
    header("Content-Type: text/plain");
    echo $var;
    

     

    some_file.php

    <?php
    $var = "some php code";
    
    
    
    
    
    
    

     

    some_file2.php

    <?php
    $var = "some php code";
    ?>
    
    
    
    
    
    

     

    Hope that makes sense. If that is not the cause are you sure you have valid php?

  7. it is faster to do:

     

    if($value === null){
        // do something:
    }

     

    over

     

    if(is_null($value)){
        // do something:
    }

     

     

    Iterations: 100000  (10 Runs)
    #  | NULL     | rel %  | is_null() | rel %
    ----+----------+--------+-----------+--------
      1 |  0.02851 |  5.9 % |   0.48044 | 1685.4%
      2 |  0.03086 |  6.5 % |   0.47557 | 1541.2%
      3 |  0.02853 |  5.9 % |   0.48534 | 1700.9%
      4 |  0.02860 |  6.0 % |   0.47666 | 1666.6%
      5 |  0.02854 |  6.0 % |   0.47783 | 1674.3%
      6 |  0.02863 |  6.1 % |   0.47144 | 1646.7%
      7 |  0.02854 |  6.0 % |   0.47272 | 1656.2%
      8 |  0.02855 |  6.0 % |   0.47754 | 1672.6%
      9 |  0.02854 |  6.0 % |   0.47301 | 1657.5%
    10 |  0.02853 |  6.0 % |   0.47380 | 1660.7%

  8. I am not sure what your trying to accomplish, but this should get the number of people who are currently viewing the page:

     

    /*
    Requires a unique key on (teacher_id, ip)
    */
    mysql_query("insert into teacher_views (teacher_id, ip, view_time) values ($teacher_id, inet_aton($ip), now()) on duplicate key update view_time = values(view_time)");
    $sql = mysql_query("select count(*) from teacher_views where view_time >= date_sub(now(), interval 5 minute)");
    $row = mysql_fetch_array($sql);
    $views = $row[0];
    

  9. Design is cool, good work but, flash games sites are a dime a dozen and it's the same motive as "I am going to create another Social Network site!"

     

    To add to:

     

    To make it successful/useful, you need to add elements that you wouldn't find at other sites, such as at addictinggames.com or newgrounds.com. How can you be different to be a better competitor in the game genre? Don't re-invent the wheel make it better.

×
×
  • 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.