Thursday, November 26, 2009

A serious hooray for stickies

What a great way to get everything in front of me.

I've fiddled with all sorts of productivity tools and systems. My favorite hope which I've since mostly abandoned is Getting Things Done by David Allen.

I've now downloaded Stickies, free software, available at http://www.zhornsoftware.co.uk. It's completely disorganized organization, but that's exactly what I was looking for.

I want to start disorganized. I want to enter notes in the absolute most basic and messy way possible. Then I can put the pieces together how I want to afterward.

Getting organized. By starting with disorganization. I love it.

Another feature that I'm super jazzed about is the ability to add images to the notes. I found out quickly however that you can't have both images and notes in the same sticky.

Oh. The sticky that does have the image pasted into it? You can quickly crop the image by selecting a portion and pressing enter, make notations on the graphic itself and save it if you choose to (as PNG or BMP). That will make for quick documentation, I think, when working on web projects. A quick screen shot, and even faster crop, then a quick note to go with it and save. Sweet.

Sunday, November 22, 2009

Creating an animated diagram of the drupal hook system.

I have some new insight into the hook system. I've read through Drupal Pro development, watched dozens of videos, and tried sample projects.

My issue the past few days has been how to present these new insights in a way that someone can 'get it' more quickly. I spent months studying the hook system (from the standpoint of a beginner php developer) and while I could make sense of some things the hook system itself evaded me.

What I was thinking of initially was making a Flash presentation, using one of the limited-functionality versions of the software to make an instructional diagram, one that had some basic animation to demonstrate what's going on the in the back end of drupal when a hook is called.

I think it's important to know the correlation. As a beginner php developer thrown at drupal due to necessity, time to gather the understandings behind the massive beast of code wasn't available to me when I needed it.

The question comes down to this: is there something that I can make an animated diagram with that isn't as expensive and convoluted as Flash is?

I'm going to check into open office. I'm not that familiar with Impress. Maybe it has the simple animation features that I'm looking for.

Links and CSS layers used with absolute positioning.

Are you having trouble with links simply not offering you the chance to click on them?

After adding a padding value to a couple of links on a wordpress blog I found that I was no longer able to click the links. The same held true after adding a margin to the same block.

The problem occurred with two elements that were position(ed): absolute(ly);. Since my renewed interest in web design and development I've primarily only worked with relative positioning I got stuck very quickly.

The problem was only in firefox. IE seems to natively support clicking links that are hidden below layers. Checking different versions of IE all worked. Have you tried out IETester? If not, you should.

Luckily because it was in firefox I was able to see clearly when using the firebug plugin that where my links became inoperable was exactly where another padded layer started. If you don't have firebug, please grab that too. It's great for design as well as debugging.

I had a hunch that simply reordering the layers by changing the position of the < div > tags in my html would fix the issue. It did, thankfully. A good note to keep for myself in the never-ending road to implementing more features for web sites.

Maybe I should have tried setting the z-index value too?

Friday, July 17, 2009

Disable AVG

Disable AVG Antivirus and other services.

These written down from version 8.5 (free version).

To turn off the Resident Shield
  • Double click the program icon in the bottom-right hand corner
  • Click on "Tools" in the file menu and select "Advanced Settings" from the drop-down bar.
  • In the window that opens, click to select the "Resident Shield" option.
  • On the right hand side under the "Resident Shield Settings" title, be sure "Enable Resident Shield" is unchecked.
  • Click "Apply".
To turn off Email Scanning
  • In the same Advanced Settings window click to select "Email Scanner" on the left side.
  • Under the Email Scanning heading to the right, uncheck "Check incoming email".
  • To the right of that be sure "Check outoing email" is also unchecked. It's unchecked by default at installation.
  • Click "Apply".
To turn off Link Scanning
  • Again in the same Advanced Settings window click to select "Link Scanning" on the left side.
  • On the right side under the heading "LinkScanner Settings", uncheck "Enable AVG Search-Shield (need web browser restart)"
  • Also uncheck "Enable AVG Active Surf-Shield"
  • Click "Apply"
  • Click "OK" to close the Advanced Settings window
How to determine AVG version
  • Open the main program window.
  • Click "Help" in the toolbar. Click "About AVG".
  • In the window that opens titled "Information", it's just to the right of AVG version.
  • Click the "Close" button.

Thursday, July 16, 2009

Turn off Norton 360 auto protect and firewall

For Norton 360 Version 3.0.0.135

Turn off Norton 360 Antivirus

Turn off Norton 360 Virus Scanning

  • Open the program
  • Click "Settings" in top nav
  • Click "Antivirus" under "Detailed Settings"
  • Click the pill looking button next to AutoProtect until it says "Off" right next to the button.
  • Norton Antivirus is now disabled.
If you're troubleshooting you may want to also....

Turn off Norton 360 Firewall

  • Open the program (if not already open)
  • Click "Settings" in top nav
  • Click "Firewall" under "Detailed Settings"
  • Click the pill looking button next to "Smart Firewall" until it says "Off" to the right next to the button.
  • The firewall is now turned off.

Tuesday, July 14, 2009

Shut off Norton 360 Antivirus and Firewall

Moved to: http://www.niftygeek.com/2009/07/turn-off-norton-360-auto-protect-and.html - apologies for any inconvenience.

Saturday, June 20, 2009

Setting up xampp for multi site serving on XP

The locations of the files you will need to edit.

[driveletter:]\xampp\apache\conf\httpd.conf (only if there is a permissions issue)
[driveletter:]\xampp\apache\conf\extra\httpd-vhosts.conf
C:\WINNT\system32\drivers\etc\hosts

See this for the official apache virtual host documentation if you get lost. I say that because every tutorial on the web told me to do that. I didn't in fact find it insightful specifically for this xampp setup.

Okay. On with the steps.

Create a new folder for your virtual hosts.

I created a new site folder under \xampp\1sites\ called newdevsite. I figure I'll access that folder quite a bit, so I added the '1' in front of it so it will float to the top of the folder listing.

Edit your hosts file to point your new virtual host to your local IP address.

Simply make a new line underneath the existing entry in the same format with your new development site.

I entered:

127.0.0.1 newdevsite

Edit httpd-vhosts.conf

Uncomment 'NameVirtualHost *:80' in httpd-vhosts.conf. Get rid of the "##".

I created the following two entries. From what I read, it's recommended to use forward slashes. It worked that way for me. If you want to continue using your existing site in xampp, you will need to add that as a virtual host as well.
<VirtualHost *:80>
DocumentRoot "c:/xampp/htdocs"
ServerName localhost
ServerAlias localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/xampp/1sites/newdevsite/public_html"
ServerName newdevsite
ServerAlias newdevsite
</VirtualHost>
Restart apache and test

If you get a 403 permissions error on the new virtual host

Once I got the VirtualHost directives correct, I was getting 403 permission errors on the newdevsite. (I don't know enough about apache administration, so to be safe I would footnote that I would not do the following on a live Apache installation).

The edit proposed by Preast in the following link straighted out the rest of my woes.
http://www.php-editors.com/forums/apache-help/2205-virtual-hosts-error-403-a.html (Copied text from that post below).

Did I mention I have no idea if this is a bad idea on a production server? The following is an edit to the httpd.conf file.

<directory>
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all ## Changed this from "Deny from all" ##
Satisfy all
</directory>

Hijacking the live url of sites that use explicit URLs to themselves

If you are editing a site that is already live you could override http://thelivesite.com to point to your development location at 127.0.0.1 at every request.

Simply make an entry in the hosts file with 127.0.0.1 www.thelivesite.com

With this type of development environment set up and assuming you will be working with at least a few copies of live web sites, I would highly recommend getting notepad++ and leaving a copy of your hosts file open in it so you can tweak it on the fly.

Saturday, May 30, 2009

Elusive PHP syntax errors - a strange fix.

I found a variety of syntax errors when debugging a PHP script lately. Since the PHP parser isn't the clearest when it comes to debugging (and these were terribly elusive) here are are some methods that I found to solve the problem.

The line numbers associated with the errors were no help at all - the error just wasn't found on line 1. And then when the line number changed, it was not found on line 34 either.

These errors included both "Unexpected $end" and "Unexpected [T_variable]" errors.

As this script was a mixture of PHP and HTML, the page was fairly long and daunting. I looked for missing brackets, tick marks, quotes, and reserved words.

I reviewed every line of code for semicolons and matching parentheses and brackets. No luck. I tweaked variable names in the lines above where the reported error was. Still no luck. Since from what I've read about debugging PHP syntax errors said the line number is 'around' or typically a line or two above the reported line number, I sat there staring at each place the bad formatting of code should have been. Nothing!

One method I came up with that I didn't find online was to separate the script into chunks. As it was a syntax error (how things were formatted), I simply segmented the script as I could, added a little HTML 'hello world' to the page (to make sure I wasn't just seeing the PHP white screen of death), and previewed different sections of the code up on the server.

I copied each logical segment of code to a new file and ran it. No errors. Eventually I copied the entire contents. Still no error in the new file. At that point I was about to pop in frustration.

I was methodical and the fact that the errors changed when I tweaked code in the original file (which seemed formatted correctly to me to begin with), was annoying to say the least.

It could be that there was a small part of the file which was corrupted while I had it open in notepad++ or maybe up on the server. Strangely enough, copying the entire contents of the script to a new file and then saving it over the old one did the trick.

It ran beautifully after that.

So, a few PHP syntax debugging tips for myself to remember in the future. Especially if they become elusive and persistent like this last time.

1.) Use something like Notepad++ to help highlight matching brackets, reserved words, quotes, and semicolons.
2.) See the PHP Syntax error wiki.
3.) If it's a long script and the syntax errors jump to different line numbers after tweaks, first copy the entire contents to another file then take segments of the code and paste it into a new file.