With a little side of applesauce...

Friday, August 24, 2012

Drupal - using JQuery in custom functions

For anyone this is getting the following error:

 Uncaught TypeError: Property '$' of object [object Window] is not a function

yet sees that jquery.js is being loaded before their custom javascript. You will need to wrap your jquery syntax a la:

function toggleSelectedWorkshop(id) {
    (function ($) {
        if ( $('#selectMe-'+id).is('.selectedWorkshop')) {
            $('#selectMe-'+id).removeClass('selectedWorkshop');
        } else {
            $('#selectMe-'+id).addClass('selectedWorkshop');
        }
    }(jQuery))
}

http://drupal.org/node/1003664#comment-4414248

Thursday, August 23, 2012

Drupal 7 - date_popup options

I'm pulling this from the source code so that I can reference it more easily:
* #date_timezone
 *   The local timezone to be used to create this date.
 *
 * #date_format
 *   Unlike earlier versions of this popup, most formats will work.
 *
 * #date_increment
 *   Increment minutes and seconds by this amount, default is 1.
 *
 * #date_year_range
 *   The number of years to go back and forward in a year selector,
 *   default is -3:+3 (3 back and 3 forward).
 *
 * #datepicker_options
 *   An associative array representing the jQuery datepicker options you want
 *   to set for this element. Use the jQuery datepicker option names as keys.
 *   Hard coded defaults are:
 *   - changeMonth => TRUE
 *   - changeYear => TRUE
 *   - autoPopUp => 'focus'
 *   - closeAtTop => FALSE
 *   - speed => 'immediate'
 */
function date_popup_element_info() {
  $timepicker = date_popup_get_preferred_timepicker();
  $type['date_popup'] = array(
    '#input' => TRUE,
    '#tree' => TRUE,
    '#date_timezone' => date_default_timezone(),
    '#date_flexible' => 0,
    '#date_format' => variable_get('date_format_short', 'm/d/Y - H:i'),
    '#datepicker_options' => array(),
    '#timepicker' => variable_get('date_popup_timepicker', $timepicker),
    '#date_increment' => 1,
    '#date_year_range' => '-3:+3',
    '#date_label_position' => 'above',
    '#process' => array('date_popup_element_process'),
    '#value_callback' => 'date_popup_element_value_callback',
    '#theme_wrappers' => array('date_popup'),
  );

Wednesday, August 22, 2012

This is a RAID status update from mpt-statusd. The mpt-status program reports that one of the RAIDs changed state:

I got tired of receiving these messages from my Debian 6 vm

This is a RAID status update from mpt-statusd.  The mpt-status

program reports that one of the RAIDs changed state:

I fixed it by running:

 2011  sudo /etc/init.d/mpt-statusd stop

 2012  echo RUNDAEMON=no > /etc/default/mpt-statusd

I got it from:
http://forums.debian.net/viewtopic.php?f=5&t=61130

Friday, August 17, 2012

macports - mysql socket causing '#2002 Cannot log in to the MySQL server'

I was trying to setup phpmyadmin on my Mac 10.7.4 with MacPorts and kept getting:
#2002 Cannot log in to the MySQL server

Here is how I fixed it:

1. find the MacPorts mysql5-server socket (mysql needs to be running):
speeves@mycomp:~/Documents/workspace/phpmyadmin$ netstat | grep mysql 
ffffff801826c2c0 stream      0      0 ffffff801dd0a1f0                0                0                0 /opt/local/var/run/mysql5/mysqld.sock
2. Add this line to /opt/local/etc/php5/php.ini:
mysql.default_socket = /opt/local/var/run/mysql5/mysqld.sock
3. Add this line to /path/to/webroot/phpmyadmin/config.inc.php
$cfg['Servers'][$i]['socket'] = '/opt/local/var/run/mysql5/mysqld.sock';
4. Restart Apache

Thursday, August 16, 2012

Eclipse - TNS:listener does not currently know of SID given in connect descriptor



Many of the blog entries mention using the "Other" driver instead of the Oracle Thin Client, but I found that I simply needed to change the colon to a forward slash like this:

jdbc:oracle:thin:@mydb.example.com:1521:service-name

To:

jdbc:oracle:thin:@mydb.example.com:1521/service-name

http://robertmarkbramprogrammer.blogspot.com/2012/02/oracle-and-eclipse-sid-vs-service-name.html