Jump to content

The Little Guy

Members
  • Posts

    6,675
  • Joined

  • Last visited

Posts posted by The Little Guy

  1. I want object literals and more similarities to JS!

     

    Example:

     

    <?php
    $something = "a fancy string";
    
    (function($values){
        $obj = {
            var1: "a string",
            var2: [
                "one",
                "two",
                "three"
            ],
            aFunc: function(){
                return 12345;
            }
        };
        echo $obj->var1;
        return $obj->aFunc();
    })($something);

  2. I feel that this site is low on content, but I am not sure what else to add to it. I am not going to say what the site is for, because if you can figure it out, then there isn't enough content. It is a very simple site, so please give me any feed back on what I can do to improve it!

     

    http://www.newzstand.us/

     

    Thanks!

  3. Here is why the gibberish urls are in there:

     

    https://groups.google.com/a/chromium.org/forum/?fromgroups=#!topic/chromium-discuss/F70-k_PGhEg

    If you type in a single-word search query, chrome needs to send a DNS

    request to check if this might be a single-word host name: For

    example, "test" might be a search for "test" or a navigation to

    "http://test". If the query ends up being a host, chrome shows an

    infobar that asks "did you mean to go to 'test' instead". For perf

    reasons, the dns query needs to be asynchronous.

     

    Now some ISPs started showing ads for non-existent domain names (

    http://en.wikipedia.org/wiki/DNS_hijacking ), meaning chrome would

    always show that infobar for every single-word query. Since this is

    annoying, chrome now sends three random DNS requests at startup, and

    if they all resolve (to the same IP, I think), it now knows not to

    show the "did you mean" infobar for single-word queries that resolve

    to that IP.

  4. Every 5 - 10 minutes while I am on Chrome, I have to wait for Chrome for about 20+ seconds after I click on a link or type in a URL, and at the bottom of the page (where the urls display) it says: "Sending Request..."

     

    After that happens I can browse for 5 - 10 minutes perfectly fine then it does it again, and I have to wait for 20+ seconds for it to send the request. I have dealt with it for a few months and now it is just getting annoying. I have been searching the internet for a solution but have yet to find one.

     

    Some things I have tried:

    - Re-install Chrome

    - Changed my DNS to: Google Public DNS

     

    Has anyone here had this problem and gotten fixed?

  5. I am trying to set up Google Public DNS, but I am have issues.

     

    For some reason when I click on properties, nothing happens.

     

    What can I do to fix this? I can not find anything on Google on how to fix this either.

     

    Edit:

    There is a spelling error in the attachment it says "does" it should say "doesn't"

    post-42401-13482403722759_thumb.png

  6. So I am doing this:

     

    Insert the data

    $values = array("one", "two", "dog", "mouse", "one", "cat", "mouse");
    $handle = fopen("some/file", "ab");
    foreach($values as $value){
        $value = "\n".gzcompress($value, 9);
        fwrite($handle, $value);
    }
    fclose($handle);
    

     

    Search the data

    $handle = fopen("some/file", "rb");
    $search = gzcompress("mouse", 9);
    $results = array();
    while (($buffer = fgets($handle)) !== false) {
        $i = 0;
        if($search == ($saved = trim($buffer, "\n"))){
            $results[$i] = gzuncompress($saved);
        }
    }
    print_r($results);
    

     

    Just an FYI, I am attempting to make a NoSQL database in php (because I was bored).

  7. Line breaks are fine, I am compressing the data before I put it into the file, so line breaks are then removed (when saved). So then when I search, I search compressed data against compressed data. I then uncompress matches.

  8. Here is what I look for in an editor:

     

    - Auto Indent

    - Auto Close: Brace, Bracket, Quote, Apostrophe, Parenthesis

     

    Netbeans formats fairly well not 100% perfect I noticed though

     

    Before formatting:

    <?php
    class C{
    private $v1 = "";
    public $superman = array();
    protected $batman = 1234;
    public function __construct($thing){
    $this->thing = $thing;
    $cat = "Dog";
    echo $cat;
    }
    public function something(){
    $longvariablecounter = 0;
    for($i=0;$i<10;$i++){
    echo "Hello";
    $longvariablecounter++;
    }
    }
    }
    
    
    $frenchFry = "10";
    $bans = "123";
    $c = new C($frenchFry);
    $c->something();
    echo "<br />";
    echo $bans;
    ?>

     

    After formatting:

    <?php
    class C{
        private $v1       = "";
        public $superman = array();
        protected $batman = 1234;
        public function __construct($thing){
            $this->thing = $thing;
            $cat = "Dog";
            echo $cat;
        }
        public function something(){
            $longvariablecounter = 0;
            for($i                   = 0; $i < 10; $i++){
                echo "Hello";
                $longvariablecounter++;
            }
        }
    }
    $frenchFry = "10";
    $bans      = "123";
    $c         = new C($frenchFry);
    $c->something();
    echo "<br />";
    echo $bans;
    ?>

     

    As you can see the alignment on variables in the for loop, are strange, and the equal signs don't line up that well some variables such as ones with arrays.

     

    But it does do everything else quite nice!

  9. A javascript string can not span more than one line, unless you place a "\" at the very end of the line (no trailing spaces).

     

    example:

    document.write('<div class="advert slideshow" style="overflow: hidden; height: 0px;">\
    <ul id="slideshow_1004">\
    	<li><img src="images/slidshow/slide_image01.jpg" width="980" height="300" alt="" /></li>\
    	<li><img src="images/slidshow/slide_image02.jpg" width="980" height="300" alt="" /></li>\
    	<li><img src="images/slidshow/slide_image03.jpg" width="980" height="300" alt="" /></li>\
    </ul>\
    </div>');

  10. I am pretty sure it doesn't matter where the server is located, as long as the content doesn't violate any of search engines rules. A good TLD name will help Google/Yahoo/Bing/etc. target the member properly.

     

    If you have the following domains:

    mysite.de

    mysite.cn

     

    and your searching from China, the .cn domain will probably be higher than the .de returned in the Google search

    A lot more info: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=182192

     

    As for speed, the closer the server is to the user the faster the site will be.

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