George’s Wonder Blog

Just another WordPress weblog

Archive for the 'Computers' Category

CSS: Use ID Selector or Classes?

March 19th, 2008 by George

When should you use an ID Selector or a class in CSS?

There are many of answers, some more technical than others, but here’s a fast and dirty answer.

Use an ID selector when it will be used only once on the page. For example, DIVs for header, body and footer are just begging to be ID selectors.

Use a Class name when an element will be used more than once on a page. As an example, if you have styles for external links and a different style for internal links you should use a Class name.

SAMPLE: What it Looks Like

<html>
<head>

head code here
</head>

<body>

<div id=”header”> Header stuff here </div>

<div id=”content”> Page content here including an <a href=”something.html” class=”ilink”>internal link</a> and an <a href=”http://www.somewebsite.com” class=”elink”>external link</a>. </div>

<div id=”footer”> Footer stuff here </div>

</body>
</html>

del.icio.us Digg Facebook Technorati StumbleUpon Bloglines Ask

Category: Web Design | 2 Comments »

Automating Batches in Photoshop CS2

February 25th, 2008 by George

THE WHAT: Say you have a bunch of images or graphics on which you’d like to perform the same actions. Maybe you want to convert your images to grayscale, then make them all 100 pixels wide (or whatever). In “The Simple How” below I’ll go over the basic way to do this. For more advanced information than presented below search Google, go to your Photoshop documentation, or try the Adobe website.

THE SIMPLE HOW:

1. Preparation: First get all of the images/graphics you want to work with into one folder. Then make a copy of that folder in case things don’t turn out the way you expected.

2. Record the Action: In Photoshop make sure your Actions Palette is open. If you don’t see it go to the menu and click Window > Actions, or press Alt+F9.

Next, open one of the images in the folder you created in step 1 above.

On the actions palette click the round button with the black arrow (see figure 1), and from the menu select New Action (see figure 2). and in the New Action window, give the action a name, then click the Record button (see figure 3). Now go to work on your image, performing all of the actions you want applied to all of your images. When you are done click the Stop button on the Action Palette (see figure 1 or 3, its a square button as it would be on a VCR/DVD).

Action Palette, figure 1
FIGURE 1

Action Palette, figure 2
FIGURE 2

Action Palette, figure 3
FIGURE 3

3. Run the Automated Batch: Now you can close the image you used to record your actions without saving (as you may reapply actions to the same image again). Go to the menu and click File > Automate > Batch. From the Action dropdown menu, select the action you saved (it may already be selected). Make sure the Source dropdown menu has Folder selected, then click the Choose button below, and navigate to your folder. Once you’ve clicked on the folder, then you can the OK button. Now you will see your images being processed. When the automated process is done simply go back and save your images and you are done. You can automate this portion, but that’s not covered here.

Happy batching!

del.icio.us Digg Facebook Technorati StumbleUpon Bloglines Ask

Category: Graphic Art | No Comments »

Good URLs - Future Proof your website

February 8th, 2008 by George

I’ve been involved in several web projects where we’ve rewritten an html site in asp or php. Your page names will change from whatever.html, whatever.htm, or whatever.shtml to whatever.asp or whatever.php - right? You can opt for this but there are workarounds that may be practical. For example, if your host company allows it you can instruct the server to treat your html, htm or shtml pages as if they are asp or php pages. Here’s a quick example from an asp site was rewritten in with php. The decision was made not to rename the pages with the php extension but instead to leave page names unchanged (like whatever.asp) but have the server treat the pages as if they were php pages. The following was added to the site’s .htaccess file:

## Make all .asp file act like .php
AddHandler application/x-httpd-php .asp

## Make sure the server knows which pages are index pages
DirectoryIndex index.asp default.asp index.html index.htm index.shtml index.shtm

The first line is a comment and the second line tells the server to run the php code in asp pages. Skipping the empty line, the third line of code is another comment, and the fourth line of code tells the server which files are index files. [For more on DirectoryIndex read about Apache mod_dir or try googling the term apache mod_dir.]

Good planning can save you time, money and your audience.  Check out these thoughts from W3C’s Hypertext Style: Cool URIs don’t change page into consideration when you are deciding how and if you should change your page names:

QUOTE 1:

In theory, the domain name space owner owns the domain name space and therefore all URIs in it. Except insolvency, nothing prevents the domain name owner from keeping the name. And in theory the URI space under your domain name is totally under your control, so you can make it as stable as you like. Pretty much the only good reason for a document to disappear from the Web is that the company which owned the domain name went out of business or can no longer afford to keep the server running. Then why are there so many dangling links in the world? Part of it is just lack of forethought.

QUOTE 2:
We have so much material that we can’t keep track of what is out of date and what is confidential and what is valid and so we thought we’d better just turn the whole lot off.

That I can sympathize with - the W3C went through a period like that, when we had to carefully sift archival material for confidentiality before making the archives public. The solution is forethought - make sure you capture with every document its acceptable distribution, its creation date and ideally its expiry date. Keep this metadata.

del.icio.us Digg Facebook Technorati StumbleUpon Bloglines Ask

Category: SEO-SEM | No Comments »

My Linux Journal Day 26

January 27th, 2008 by George

I was looking at replacing my current linux machine with a hopefully more powerful one, and after loading a Linux distro onto it I found it had a 650MHz CPU with only 128MB of RAM. Needless to say I was disappointed. According to a badge on its case it was built by Quest, or the tower case is by Quest. I really don’t know much about it besides I’m taking its 16GB drive to use as a scratch drive for Photoshop on my work machine and the rest is going into the trash can.

After using the Linux Hardware Lister tool on the other one, I ran it on my current Linux machine, a Pavilion 8766C.

To run Linux Hardware Lister, open a console and  type:

sudo lshw

I was glad to see I had upgraded the RAM significantly, so all in all this 900 MHz P3 with 128MB of RAM, onboard video, onboard sound (Rockwell Chameleon combo card) has been upgraded with a total of 512MB of RAM, a 128MB GeForce4 MX4000 video card and a Creative Labs Sound Blaster Ensoniq ES1371 sound card.

del.icio.us Digg Facebook Technorati StumbleUpon Bloglines Ask

Category: mylinuxjournal | No Comments »

My Linux Journal Day 23

January 24th, 2008 by George

Today should have been really easy, but it was a bigger deal than I expected. It should be easy to figure out how to get your NUMLOCK key to be on when you boot up right? Wrong. In all of the Windows PC’s I’ve used NUMLOCK is always onwhen booting up, so I expected to find a simple checkbox somewhere in Ubuntu for this simple feature. Nope.

GDM and GNOME

After looking around here’s what worked for me. I run Gnome sessions, so that means I run GDM (I learned form some quick reading). According to Gnome.org’s GDM page , GDM is the Gnome Display Manager that presents you with a graphical logon screen like this one:

GDM login screen

If you like it, you can find this login screen at http://art.gnome.org/themes/gdm_greeter/1374

Ubuntuguide to the Rescue

You can click on the link above and do a lot of scrolling or just use the steps below. For some reason I could not do an apt-get install to install numlockx, here’s what I did:

1) In Synaptic, install numlockx

2) Make a backup of the file you are about to edit. In your console window type:

sudo cp /etc/gdm/Init/Default /etc/gdm/Init/Default.bak
_________________________________________

3) Now back into the console window to edit your file:

gksudo gedit /etc/gdm/Init/Default
_________________________________________

4) Now your file opens in gedit. Scroll down to the very bottom, and just above the bottom line that says “exit 0″ add this and save, then close the file:

if [ -x /usr/bin/numlockx ]; then
/usr/bin/numlockx on
fi
_________________________________________

5) Now if everything’s gone well when you reboot next time you will see your NUMLOCK key is ON.

del.icio.us Digg Facebook Technorati StumbleUpon Bloglines Ask

Category: mylinuxjournal | 4 Comments »

My Linux Journal Day 18

January 19th, 2008 by George

Just a quick note with more detail later…..

I’ve installed Wine, and to test it installed Notepad++. That seems to have gone well.

Also since my Linux machine only has 128MB 512MB of RAM with a PIII 900MHz CPU, and because I wanted a larger monitor with higher resolution I’ve installed BFG Technologies ASLMX4000 GeForce4 MX4000 128MB AGP (GeForce4 MX 4000) and a Philips Brilliance 202P4. This seems to be working well so far.

Oh and how about a cool screenshot:

Screenshot


del.icio.us Digg Facebook Technorati StumbleUpon Bloglines Ask

Category: mylinuxjournal | 2 Comments »

My Linux Journal Day 17

January 18th, 2008 by George

Okay, I’ve gotten started with the Quanta HTML editor because Bluefish just didn’t do it for me. Mainly there was no color picker, and I’m not going to use an external program, my memory, or a website for colors.

So Quanta is installed and in action here:

Quanta screesnhot

This is pretty cool because its also my first time using GIMP. Simple image re-size was the order for the day, but it was pretty cool to be using 100% free software to do all of this. SO here are the beginnings of my web design suite on my linux machine:

The workflow is different with Quanta + gFTP + Photoshop than it is for Dreamweaver, but its easy enough to get used to. First off, I don’t have a dual monitor setup on my linux machine yet, so I’ll rely on virtual desktops to separate Quanta + gFTP from GIMP.

More later, I think this is off to a decent start.

del.icio.us Digg Facebook Technorati StumbleUpon Bloglines Ask

Category: mylinuxjournal | No Comments »

My Linux Journal Day 16

January 17th, 2008 by George

More on my monitor resolution again, and its not good news (though not terrible). I booted up today to check for updates when I got an 800×600 screen resolution again. After a reboot (no changes, just a restart) I’ve again got 1280×1024. I’m going to guess that I need to look into turning off the restricted drivers.

I decided to get some work programs on the linux machine here, so decided to install Bluefish HTML editor, and GIMP. So, I jumped into Synpatic:

System > Administration > Synaptic Package Manager

As I was about to install GIMP, it occurred to me I hadn’t checked the menus yet. A quick look at Applications > Graphics showed it was already installed. Cool. Next onto Bluefish. I didn’t even check, I just installed it via Synaptic and I have it opened now.

Next, I am thinking about installing Wine (Windows Emulator) to run Internet Explorer because sadly there are some sites you *must* rely on Internet Explorer to visit because the developer doesn’t know what their doing, or its done on purpose because Microsoft if evil. Well, okay maybe not evil, but you get the idea. More on Wine later.

del.icio.us Digg Facebook Technorati StumbleUpon Bloglines Ask

Category: mylinuxjournal | No Comments »

My Linux Journal Day 11

January 12th, 2008 by George

FLASH INSTALLED

Finally! I found a working HOWTO for installing Adbobe/Macromedia Flash 9 for Linux, and more specifically Ubuntu 7.10 (Gutsy Gibbon). First, open your favorite console. Next, visit this Ubuntu 7.10 (Gutsy Gibbon) How-To page. Once you get to the instructions (below) its a simple matter of copy/pasting 4 lines of commands, or if your console doesn’t support paste, typing them in by hand (not so fun):

Either way, ignore the instructions 1 & 2 at the top since they do not work at this point due to a bug. Follow the instructions below that start 1. Manually download and… to get Flash installed and running.

PRINTER INSTALLED
I installed an Epson Stylus Photo 820, and it worked right off, not counting that I need new ink cartridges. The physical install was the easiest, power plug and parallel cord. Next, System > Administration > Printing, then click New Printer. It did a quick search returning several options of which I chose LPT:1. Going from memory now, the next choice was the brand of printer, Epson. After that I was presented with a list of Epson printers and selected the Epson Stylus Photo 820 from the list and finished.

Next was the part I’m having trouble with, ink. The ink cartridges are old and dry and the printer was given to me with a refill kit. The refill wasn’t too difficult after I figured the was ink for black, blue, light blue, red, light red and yellow. The blues and reds looked alike butthe light-colors were marked with a capital “L” on top. After refilling, including many ink spills on my hand its done, but not printing very well. I’ll give it some more time before I give up an attempt to buy new ink cartridges.

del.icio.us Digg Facebook Technorati StumbleUpon Bloglines Ask

Category: mylinuxjournal | No Comments »

Back up your hard drive

January 12th, 2008 by George

THIS IS NOT
This is not an article about drive mirroring, which I will have to save for some future date. Drive mirroring is more important for a) those with the know-how and b) those who really need a more bullet-proof option than hard drive backups.

This is also not a step-by-step HOWTO written by someone who has actually done this - I just know its important and I’ll get around to it….. someday. Soon hopefully.

THIS IS
A wake up call for those of you who may not have thought of backing up your hard drive or a reminder for those of you who have forgotten, along with some tips.

WHAT IS BACK UP VS MIRRORING?
Imagine mirroring as a copy of your entire hard drive - all of your installed programs, data files, everything. Back up of your hard drive backs up specific data, but not programs. Sure you can backup C:/Program Files, but if you ever have to restore from your backup many/most of your programs will not work because you have not backed up other essential parts of the program such as Windows Registry entires.

BACKING UP YOUR HARD DRIVE
I subscribe to the Lifehacker RSS feed and found a real jewel - back up your hard drive. This is probably more important than most people realize, especially for those who rely on certain data and files on our computers. In my case my hard drive has countless files in My Documents, like many Windows users, plus I also have upwards of 175 websites. You can read Lifehacker.com’s Geek To Live: Automatically back up your hard drive for more nitty gritty details than I will mention here. My comments on the Lifehacker article:

  • SyncBack freeware is now SyncBack Freeware V3.2.14, scroll down the page past the paid versions
  • External Drives - A quick comparison of 320GB External USB Drives VS 320GB External Firewire/USB tonight on Tigerdirect.com (my friend swears by them). Anyway the USB drive was only about $20 less than the USB/Firewire, so if you have the money go for the US/Firewire combo.
  • FTP Back up - if you need to or have to start out backing up to your external hard drive and add FTP back up when and if you can. Running back up only mean if your original drive gets fried, your data is safe, but if your house burns down your goose is cooked.

del.icio.us Digg Facebook Technorati StumbleUpon Bloglines Ask

Category: Windows | No Comments »