Category Archive: Computers

MySQL makes me want to kill babies.

So I’ve got this database, this large database, on a large box with 24G of memory.

I’m using SLES 11.1 with MySQL 5.5 Percona XtraDB configured to use an innodb_buffer_pool of 14G.

My theoretical max memory footprint should be about 16.4 GB.

[OK] Maximum possible memory usage: 16.4G (69% of installed RAM)

My tables are partitioned daily, and split into single files. As the day goes on, I watch mysql slowly eat all the systems memory until it finally restarts itself.

For example…

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 8371 mysql     10 -10 18.1g  16g 6576 S  136 68.9 254:03.69 mysqld

Why is the virtual size 18.1g? I have no idea.

If I run FLUSH TABLES in mysql, this will free up. Does anyone know why?

Permanent link to this article: http://www.lukemacneil.com/2011/07/31/mysql-makes-me-want-to-kill-babies/

Dynamically generate searchable sortable tables.

Frequently throughout my pages I like to print out reports of data. The jquery tablesorter plugin is an excellent way to take this tabular data and make it sortable by column. However, since I do this so frequently, I wanted to create a script that would set up the plugin and add some other features, like an itunes like lazy search feature and highlighted hovered rows. So, on my pages, after my table is created I include the following javascript.

Note: This requires jquery and the jquery tablesorter plugin.


/*
 * Start out by building a search filter div. After the sort table is created
 * this will be placed on the page on top of it.
 */
document.write("<div id='searchfilter'>");
document.write("<input type='text' name='filter' value='' id='filter'/>");
document.write("<span class='ui-icon ui-icon-help' title='Begin typing to filter results. [ESC] to clear.'></span>");
document.write("</div>");

$(document).ready(function() {
    // Before the FilterTable, put the search filter.
    $('#searchfilter').insertBefore('#FilterTable');

    // Convert the existing table into a grid.
    $("table").tablesorter({
        widthFixed: false,
        widgets: ['zebra']
    }) ;

    // Highlight hovered row.
    $('tbody tr').hover(function(){
        $(this).find('td').addClass('hovered');
    }, function(){
          $(this).find('td').removeClass('hovered');
    });

   //Default each row to visible
   $('tbody tr').addClass('visible');

   $('#filter').keyup(function(event) {
        //if esc is pressed or nothing is entered
        if (event.keyCode == 27 || $(this).val() == '') {
            //if esc is pressed we want to clear the value of search box
            $(this).val('');

            //we want each row to be visible because if nothing
            //is entered then all rows are matched.
            $('tbody tr').removeClass('visible').show().addClass('visible');
        }
        //if there is text, lets filter
        else {
            filter('tbody tr', $(this).val());
        }//end if
    });

    //filter results based on query
    function filter(selector, query) {
      query =   $.trim(query); //trim white space
      query = query.replace(/ /gi, '|'); //add OR for regex query

      $(selector).each(function() {
        ($(this).text().search(new RegExp(query, "i")) < 0) ? $(this).hide().removeClass('visible') : $(this).show().addClass('visible');
      });
     }//end function
});

Permanent link to this article: http://www.lukemacneil.com/2010/05/07/dynamically-generate-searchable-sortable-tables/

Ubuntu 10.04

I gotta say, it may be the best out
of the box desktop OS I’ve tried out in a long
time.

 

Ubuntu One (dropbox/mobile.me) is
amazing, it’s got an iTunes like store now, and syncs with ipod/iphone out of
the box.

They did a really, REALLY good job
of integrating IM, Email, and Social networking into one place
too.

Really
slick.

 

http://www.ubuntu.com/products/whatisubuntu/1004features

Permanent link to this article: http://www.lukemacneil.com/2010/05/05/ubuntu-10-04/

Disable PHP warnings in seyret

The seyret video module used on this site is awesome, but the PHP warnings it was spewing out on my site were unacceptable. Finally tracked it down.

The errors looked like this:

Notice: Undefined variable: catlistoption in /home/content/html/components/com_seyret/views/video/video.view.php
on line 0

Warning: Invalid argument supplied for foreach() in /home/content/html/libraries/joomla/html/html/select.php
on line 68

This was driving me crazy. I checked my php5.ini file, errors turned off, threw a .htaccess file in the specific folder… no love, I tried manually putting error_reporting(0) into the questionable file, the ioncube loader didn’t like that one bit. Then I started poking around the seyret code and found this:

 //Don't forget to delete
 error_reporting(E_ALL);
 ini_set('display_errors', 1);
 

Hiding out in /home/content/html/components/com_seyret/seyret.php

Looks like whoever put that in there forgot to delete it :)

Commenting out those lines clean up the view. The errors themselves don’t seem to affect the functionality of the plugin, so I’m not too concerned about it.

Permanent link to this article: http://www.lukemacneil.com/2010/04/29/disable-php-warnings-in-seyret/

Busted Westinghouse TV SK-32H540S

I got a frantic call from my mom a while back about her Westinghouse TV.
She would turn it on, and then seconds later, the display would go blank.
The audio stayed on, and the blue power indicator stayed lit, but there was absolutely nothing on the screen.

I looked at it a bit, and couldn’t find anything obvious, so I took it home for a closer look.

I’ve never seen the inside of an LCD TV or monitor before, so I was a little surprised to find how clean it is in there.
Everything is very clean and elegant, and there’s not too much going on.

After a half hour or so of examining the innards, I stumbled across what I believe is the problem.
The inverter board has 3 transformers on it. The middle transformer has melted. I can see that the back of the circut
board has some char on it.

I’m not much for electrical repairs like this, but it doesn’t seem too difficult. I think this just has to be removed and replaced.
I found replacement transformers online for $29.99.

She’s already bought a new TV, but when I get sick of looking at the 32″ nightmare sitting on my kitchen table, I’ll likely see if it’s something I can do.

Permanent link to this article: http://www.lukemacneil.com/2010/04/27/busted-westinghouse-tv-sk-32h540s/

Older posts «

» Newer posts