Jump to content

dreamwest

Members
  • Posts

    1,223
  • Joined

  • Last visited

    Never

Posts posted by dreamwest

  1. Why is it using so many resources. I killed the proccess but it keeps returning, ive restarted mysql server, check /etc/my.cnf for errors, still no luck

     

    I assuming --log-error=/var/lib/mysql/site.com.err is writing to a log and the PID's are lasting for 74Hours+ . Ive checked the site.com.err log and it doesnt have any errors

     

    So whats causing mysqld to use so many resources?

  2. Ive set up my new VPS and mysqld is using 60% - 90% cpu and 6% memory per process (6-8 processors). Im not running any databases yet, so its currently not being used

     

    Heres the PID thats causing the issue

     

    /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/site.com.err --pid-file=/var/lib/mysql/site.com.pid

     

  3. Im trying to include javascript inside javascript but not working for some reason

     

    page.html

     

    <script>
    function find() {
    
       var head= document.getElementsByTagName('head')[0];
       var script= document.createElement('script');
       script.type= 'text/javascript';
       script.src= 'http://site.com/find.js';
    
       script.onreadystatechange = callback;
       script.onload = callback
    
       head.appendChild(script);
    
    };
    
    </script>
    
    <form name='f' onsubmit='find(); return false;'>
    <input type="text" name="q" size="60" maxlength="755" value="" />  
    <input type="submit" value="Search"  />
    </form>
    
    <div id='results'></div>

     

    and in find.js

     

    document.getElementById("results").innerHTML ="Hello";

  4. Im trying to make this array unique but its making both keys and values unique is there a way around this?

     

    $arr = array
    (
        [funny] => 1
        [space] => 1
        [chimp] => 1
        [funny] => 0
        [lobster] => 0
    );
    
    $track = array_unique($arr);
    print_r($track);

     

     

    Basically i need the output to be:

     

    Array
    (
        [funny] => 1
        [space] => 1
        [chimp] => 1
        [lobster] => 0
    )

     

  5. Im trying to highlight some words within a html string but its returning highlights between tags.

     

    $txt = "Hello this is a <a href='/link.php' title='hello php'>link</a> within php";
    echo preg_replace("/\b(hello|php)\b/is",'<b style="color:black;background-color: #FFFF00">\1</b>',$txt);

     

    I need it to return:

    <b style="color:black;background-color: #FFFF00">Hello</b> this is a <a href='/link.php' title='hello php'>link</a> within <b style="color:black;background-color: #FFFF00">php</b>

  6. thanks, i have changed the database collation to UTF-8 General, and included the correct tag in pages, but still get the error

     

    Youll need to delete your existing fields and write them again. Also make sure the collation is "utf8_bin" not UTF-8 General

  7. Youll have to replace the whole element

     

    <script>
    function img(id,img){
    document.getElementById(id).innerHTML = "<img src='"+img+"'/>";
    }//end replaceImage
    </script>
    <td><button type="button" onclick="img('x','image1.gif');">Show Image 1</button></td>
    <td><button type="button" onclick="img('x','image2.gif');">Show Image 2</button></td>
    
    <span id='x'>Default img<br /><img src='http://i4.ytimg.com/vi/SvxkSKqY6cU/default.jpg'/></span>

  8. my bad im doing 10 things at once.

     

     

    <script>
    function replaceImage(id,img){
    
    if(img == 1){
    document.getElementById(id).innerHTML = "<img src='http://www.wizecho.com/images/wiz_start.jpg'/>";
    }else if(img == 2){
    document.getElementById(id).innerHTML =  "<img src='http://i1.ytimg.com/vi/8jUU3yCy3uI/default.jpg'/>";
    }
    }//end replaceImage
    </script>
    <p><a href='#' onClick="replaceImage('image',1); return false;" title='Reload image'>option1</a></p>
    <p><a href='#' onClick="replaceImage('image',2); return false;" title='Reload image'>option2</a></p>
    
    <span id='image'><img src='http://i4.ytimg.com/vi/SvxkSKqY6cU/default.jpg'/></span>

     

  9.  
    <script>
    function replaceImage(id,img){
    
    if(img == 1){
    document.getElementById(id).innerHTML = "<img id='image' src='image1.gif'/>";
    }else if(img == 2){
    document.getElementById(id).innerHTML =  "<img id='image' src='image2.gif'/>";
    }
    }//end replaceImage
    </script>
    <p><a href='#' onClick="replaceImage('image',1); return false;" title='Reload image'>option1</a></p>
    <p><a href='#' onClick="replaceImage('image',2); return false;" title='Reload image'>option2</a></p>
    
    <img id="image" src='image1.gif'/>
    

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