Kyle D. Skrinak

Note to self with jQuery & IE; “text/javascript”

by Kyle Skrinak on Oct.26, 2009, under Technology

Insanity is doing the same thing and expected different results. I’m not sure why I keep doing this, but I do: when including a jQuery script into an xHTML page, be sure to declare the script properly: “text/javascript” not “application/javascript”

Now to create a repeat loop: for (i=0;i<=100;i++); echo “use “text/javascript” \n.

Leave a Comment more...

Migrating from DotProject to Web2Project

by Kyle Skrinak on Oct.25, 2009, under Technology

I use a LAMP-based web application to track my projects. I had been using Todoist.com, a great on-line to-do list for many years but I needed better accommodation. My hosting provider at the time had a “click-and-go” installer for dotproject so I installed it and moved all my data over and started using it. However, I had continual technical and UI issues with it, (namely, dp doesn’t like MySQL instances with temporary table creation disabled) and I noticed there was a 2 year lag between what I installed and the then current version (2.1.12, which it is still at; more on that in a second) but the hosting company wouldn’t upgrade. So I de-installed the canned version and uploaded 2.1.12, which helped reliability, at least a little bit. However, the “temporary tables” issue remained, and dp would choke on creating the main status page.

A little research, starting from how to work-around the lack of temporary tables, led me to a fork of dp, “Web2Project.” It appears that the w2p fork was fostered by the lack of development at dp. While I don’t use w2p as well as I could, I am greatly pleased with the reliability and better over performance and UI. You can’t miss the similarities, but gone are the in-line error messages and incomplete pages.

Installing w2p (which allowed me to start by using my dp data) was a bit of a hurdle. First things, check your requirements. W2P doesn’t like php4, and I didn’t confirm mysql requirements but I am running 5.x without issues. I first tried to work from my web server, but the typical network latency made this process cumbersome, so I decided to migrate firstly in my MAMP setup, which turns out (in hindsight) to be the best way to perform this process. I had to change the install script so that the case statement defaulted to a single option: upgrade an existing dp database into w2p. After the install script had no choice, it moved my dp data into a w2p schema, ready for work. There is one issue. They have dropped “ticketsmith” support. I used this feature for a brief period and found it’s lack of integration problematic. Apparently the w2p team agrees. However, why not remove this data if unsupported?

3 Comments more...

Update: rotator.php scraped

by Kyle Skrinak on Aug.14, 2009, under Technology

Huh. Turns out mutlisite drupal and placing files at a directory’s root added a layer of complexity I hadn’t planned on. I used image module and views, which is just as well, as it has other advantages, such as using image nodes.

Leave a Comment :, , more...

Rotator.php fix?

by Kyle Skrinak on Aug.06, 2009, under Technology

Let’s say you have a rectangular section of your web page, within which you wish to have a single random image from a directory displayed there. In Drupal there are several, if complicated, ways to achieve this. Each requires the enabling of several modules, which increases rendering times and overall site maintenance. Unsatisified with current options, I explored alternatives and came across the ever-reliable site A List Apart with an article on a php-based image rotation script.

Enabling the script within Drupal was another matter. I modified the tpl.php file where I wish to render the random image (helped with the devel module) with:

<div><?php require ‘rotator.php’; showImage(); ?></div>

The original code called for “include” and not “require” but I made the change while debugging and decided to keep the change. I placed ‘rotator.php’ in the active theme’s folder; which dereferences properly. Rotator.php calls ‘image.ini’ which tells rotator.php which images, what alt and title tags, and other goodness. However, rotator.php couldn’t parse mage.ini; and I couldn’t find out exactly why.

Turns out this portion of the code in rotator.php was the problem:

# file containg your image descriptions

$IMG_CONFIG_FILE = 'images.ini';

# You shouldn't need to change anything below this point

function showImage( $ini=null ) {
global $IMG_CONFIG_FILE;
# if no custom ini file has been specified, use the default
$ini_file = $ini ? $ini : $IMG_CONFIG_FILE;
# read the config file into an array or die trying
$images = @parse_ini_file($ini_file,true);
if (! $images) {
die('Unable to read ini file.');
}

My guess was that the $IMG_CONFIG_FILE = ‘images.ini’; outside of the showImage function was being overwritten by the gloal declaration within the function — but I don’t know php, and this script was working in other environments. To get it to work on mine (MAMP) I modified the above to the following:

# You shouldn't need to change anything below this point

function showImage( $ini=null ) {
$IMG_CONFIG_FILE = 'images.ini';
# if no custom ini file has been specified, use the default
# $ini_file = $ini ? $ini : $IMG_CONFIG_FILE;
# read the config file into an array or die trying
$images = @parse_ini_file($IMG_CONFIG_FILE,true);

if (! $images) {
die('Unable to read ini file.');
}

2 Comments more...

Using Spaces virtual desktops with one application, many windows

by Kyle Skrinak on Jul.03, 2009, under Technology

I read somewhere that Mac OS X Leopard’s Spaces virtual desktop manager did not allow for a single application to have multiple windows in multiple desktops. (continue reading…)

Leave a Comment more...

My admiration grows for Drupal

by Kyle Skrinak on Jul.01, 2009, under Technology

I recently needed to add a feature to a Drupal website I didn’t start but now manage. I had to make some webforms (a.k.a., “surveys,” to my beloved customer) available to only a select group of users. I created a role for the targeted user group. There were a few pitfalls — the site is Drupal 5, not 6, (and the difference matters nowadays, as the D6 base is more robust, go figure) and the recommended modules from the webform module references D6-only modules. So I had to hunt down an alternative, and found one, “Content Access.” I plugged it in, and after the usual learning curve, I had it performing its desired functionality whereby select webforms were visible to a selected user role. (My previous post is a video tutorial and setting the content access privileges for my client.)

So, here’s the kicker, something I realized only after I was done and moved on to other things. I have a “view” (as a page) that shows all webforms in the system. This is what I needed to filter down. I added the Content Access module, made the appropriate adjustments, and then my view respected the content access settings without hitch or modification requirements. That is remarkably tight integration. I love standing on the shoulders of giants.

Leave a Comment more...

Video Tutorial: Using Content Access for node view/edit/delete control

by Kyle Skrinak on Jun.17, 2009, under Technology

This is a video tutorial on controlling who can see content in Drupal using “Content Access.”
(continue reading…)

1 Comment more...

Stuff Happens: hostmysite (now called “Hosting.com” — see update)

by Kyle Skrinak on May.29, 2009, under Technology

KDS update 2009-11-03: Title changed, removed “Highly recommended site” from title; added new company name.

This isn’t an exhaustive review of competing solutions, a la Consumer Reports. I had a bad experience rant about godaddy, and now for some good news.

After dealing with somewhere less than 10 competing hosting services, I find myself continually pleased by the web hosting provider “hostmysite.com” (HSM) I learned of them through a customer who uses them for their site. SCI recently performed a critical migration for this customer from a static web site to a dynamic CMS site. At first we experienced HSM committing a number of errors and mistakes. For the first few days, it looked rather bleak, frankly, for HSM. However, when I had an issue, I’d call, and… get support nearly immediately. I’ve never waited more than 2 minutes. Remarkable. And, I get technically competent people who are NOT following those decision flow-charts. If they don’t know the answer, they’re on it until they figure it out. So, they tripped but they did worked until they ironed matters out.

I don’t have the admin control panel (it’s the customers) and so I have a very limited access. I can’t perform a fair UI review — but, really, it’s moot. If I have a problem I can’t fix, I call them and it’s fixed in short order.

If you’re looking for a hosting solution; give them a shot: hostmysite.com


October 19, 2009 update: I just closed a support ticket with Hosting that we opened on Oct 8. 10 days to resolve a ticket (no FTP access being one of the problems) is clearly significantly problematic. While the phone support remains excellent, such core failure is fatal. I am not recommending these guys for now.


November 03, 2009 update: From bad to worse: If I need to see or update file and directory permissions, I must issue a ticket. Really. As this is the only .NET hosting vendor with which I work, I can’t say how mainstream this is, but it does seem to stink. For me, the question is; “Is this symptomatic of the vendor, or does .NET tolerate less services for higher cost?

Leave a Comment more...

My Spine is the Command Line

by Kyle Skrinak on May.19, 2009, under Technology

I love this kind of stuff. Here’s a simple command line script that will output xHTML gallery of images in a single directory. Requires ImageMagick and zsh.

for i in sponsor-logos/*.*;do
j=`identify -format "width=\"%[fx:w]\" height=\"%[fx:h]\"" $i`
echo \<div\>\<img src=\"$i\" $j alt=\"$i:t\" /\>\<\/div\>
done

Sure I could have done this in php/rails/whatever, but I needed something quick and valid and output that I later use for the jquery “cycle” plugin (which I love, you can see it in use here, look for the cycling logos on the middle right of the page) and this does the trick.

There’s a dearth of documentation on  the jquery cycle plugin; sounds like a blog post.

Leave a Comment more...

Cool vim random line shuffle trick

by Kyle Skrinak on May.17, 2009, under Technology

Recently, I needed to perform a random sort of lines in vim. After a little bit of googling, I came up with the following:

(Works on Mac OS X Leopard and ubuntu 9.4)

Create the following perl script file:
#!/usr/bin/perl -w
use strict;
use List::Util 'shuffle';
my @lines = <>;
print shuffle( @lines );

Save the file and make it executable as well as easily accessible. Such as a directory that is in your PATH variable.

Now, fire up vim and visually select the lines you want to randomly select. Now, type:

!randsort.pl

There it is — randomly sorted lines.

1 Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!