Alyda

Just a Girl Weblog

Remembering Who I Really Am

DIY Photography Light Box

Close-up photography requires good lighting and a light box is an excellent solution. The translucent material of a light box diffuses the light evenly around your subject, softening shadows and eliminating glare.

Tools

  • Hacksaw or Fine‑Cut Wood Saw
  • File, or 80 to 100 Grit Sandpaper (optional)

Plumbing Materials

  • 2 ‑ 1/2" x 10' PVC Sch 40 Plain End Pipe (need 12')
  • 4 ‑ 1/2" PVC Sch 40 Tee Fitting
  • 4 ‑ 1/2" PVC Sch 40 90‑Degree Elbow
  • 4 ‑ 1/2" PVC Sch 40 Pressure Cap

Lamps and Bulbs (Optional)

  • 4 ‑ Style Selections 16-1/4" Adjustable Black Clip-On Desk Lamp (Lowes Item #191955)
  • 2 ‑ 9‑Watt (40W) Daylight (5000K) CFL Light Bulb
  • 2 ‑ 14‑Watt (60W) Daylight (5000K) CFL Light Bulb

Assembly Instructions

Cut the PVC pipe to the lengths specified in the diagram below. Clean the burrs from the ends of each piece with a file or sandpaper.

Drawing - Light Box Materials

Lay all the pieces on a flat surfice and dry fit. The pieces fit together quite snuggly and don't require cement to hold their form.

Final Product

To eliminate the numerous reflections on the smooth curved surface of this sculpture, I draped a semi‑opaque white shower curtain over everything (light box, camera, me). The white backdrop is a sheet of poster board taped to the frame of the light box.

Light Box With Shower Curtain

This is a Richard Kramer sculpture entitled Achiever. It's showing some light rust on the rough surfaces, so I applied the Lightroom preset Creative ‑ B&W Low Contrast.

Acheiver

Filed under: ,

mod_rewrite—Proof That God Exists

...and she has a Wicked Sense of Humor

Perhaps the most common use of mod_rewrite is to make URLs easier to type, easier to remember, and easier to tell someone over the phone. This can be accomplished very simply with a single RewriteRule. mod_rewrite isn't hard at all. Regular expressions appear—at first glance—to be diabolically difficult.

Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
Jamie Zawinski

mod_rewrite is built on top of the Perl Compatible Regular Expression (PCRE) vocabulary, and a basic grasp of regular expressions is essential when you compose your RewriteRule(s). Or you could spend a day and a half copying blindly—as I did—with literally no comprehension of the regex vocabulary.

  • <IfModule mod_rewrite.c>
  • # Set the name of the file used for logging
  • RewriteLog "/private/var/log/apache2/rewrite.log"
  • # Set the verbosity of the log file
  • # Remember to comment out when done debugging or set to 0
  • RewriteLogLevel 6
  • # Enable runtime rewriting engine
  • RewriteEngine On
  • # Define rule(s) for the rewriting engine
  • # Syntax: RewriteRule Pattern Substitution [Flags]
  • RewriteRule ^/gallery/(.*) /gallery.php?gal=$1 [NC,L]
  • </IfModule>

In hindsight, there were sevaral things I could have done to save a lot of time.

First: Absolute vs Relative Paths

If you're not targeting the default document set in the DirectoryIndex Directive (usually index[.php\.html]), you must use absolute paths to css, js, and image files (etc.) in your PHP/HTML document.

  • <!-- use '/css/' -->
  • <link rel="stylesheet" href="/css/gallery.css">
  • <!-- not 'css/' -->
  • <link rel="stylesheet" href="css/gallery.css">

If your images and stylesheets don't load but everything else seems fine, the path is likely your problem. For example:

  • incoming URL
  • justagirl.us/gallery/tour2013/
  • pattern match
  • /gallery/tour2013/
  • substitution
  • /gallery.php?gal=tour2013
  •  
  • if the path to your css file is relative, you'll also see something like this
  • pattern match
  • /gallery/tour2013/css/gallery.css
  • substitution
  • /gallery.php?gal=tour2013/css/gallery.css

Second: Context

What is the context (server config, virtual host, directory, .htaccess)? See 'What is matched?' in the RewriteRule Directive section of the mod_rewrite reference documentation. On my local machine the context is VirtualHost. In most of the examples I found (and copied) the context was Directory or .htaccess.

  • # context is VirtualHost, note slash preceeding '/gallery'
  • RewriteRule ^/gallery/(.*) /gallery.php?gal=$1 [NC,L]
  • # context is Directory, note absence of slash preceeding 'gallery'
  • RewriteRule ^gallery/(.*) gallery.php?gal=$1 [NC,L]

Third: Pattern, Substitution and Flags

Syntax of the RewriteRule directive
Syntax of the RewriteRule directive

Pattern

The pattern is a regular expression specifying which incoming URLs should be affected by the rule.

Regular Expression Vocabulary

 ^  Called an anchor, matches the beginning of the string
( ) Groups several characters into a single unit, and captures a match for use in a backreference
 .  Matches any single character
 *  Repeats the previous match zero or more times

Substitution

The substitution can contain backreferences to parts of the incoming URL‑path matched by the pattern. The value of the backreference is captured in a special variable, $1. Note: When using RewriteRule, the variables are prefixed with a dollar sign ($), but when using RewriteCond, they are prefixed with a percent sign (%).

Flags

Adding the No Case, or [NC], flag to any RewriteRule makes that rule case insensitive. The Last, or [L], flag indicates that the end of the rewriting process has been reached, and no further transitions should be applied to the requested URL.

Explanation of Solution

  • # incoming URL: justagirl.us/gallery/tour2013/
  • # RewriteRule: context is VirtualHost
  • RewriteRule ^/gallery/(.*) /gallery.php?gal=$1 [NC,L]

Pattern: ^/gallery/(.*)
Match a string that begins with /gallery/. Capture everything after /gallery/ and group it into a single unit (.*) for use as a backreference.

Substitution: /gallery.php?gal=$1
Anything appearing after /gallery/ as captured in the backreference $1 will be given as a query string argument ?gal= to gallery.php. Rewritten URL is justagirl.us/gallery.php?gal=tour2013

Flags: [NC,L]
Case-insensitive (NC) pattern matching will be slightly slower. The default behavior of the RewriteRule directive is to be case sensitive. The L flag is only useful when several rules are chained together in a single logical unit. It's good form to use this flag even when just a single rule is used; it's more of a reminder for you than for mod_rewrite.

Remember to restart Apache after making a change to the configuration file. On my local machine, the instruction is sudo apachectl restart. On the server I usually use sudo apachectl -k graceful.

Please…Take my Advice; I Rarely use It.

A little reading from the list below may result in a sudden, intuitive perception of, or insight into, the essential meaning of regular expressions. Yup, magic. From muggle to witch/wizard.

Where to Go for More Information

Filed under: , , , ,

Create a Fur Trim Scatter Brush in Illustrator CS6

I recently had a problem with tiled printing in Illustrator CS6 and turned to an old friend, the lynda.com Online Training Library, for help. While searching for the solution, I stumbled upon Robin Schneider's 'Illustrator for Fashion Design: Creating Brushes' video tutorial. I particularly enjoyed the 'Creating fur trim' subchapter, and it's the subject of this post.

If you believe—as I do—that…

You don't learn anything from what you see or hear or read. That makes you aware of an idea, but you haven't learned it. It's not yours until you express it, give it away, or teach it.
— Burt Hotchkiss, author of Your Owner's Manual

…then, please, follow along.

Step One

Create a line segment 5pt in length at an angle of 0°. Select a neutral gray Stroke color (i.e, #666666) and no Fill. Set the line weight to 0.5pt and, from the Variable Width Profile dropdown box, choose Width Profile 5.

Illustrator Scatter Brush - Fur Trim: Spike

Step Two

With the line segment selected, click New Brush from the Brush Panel and select New Scatter Brush from the New Brush dialog. This will open up the Scatter Brush Options dialog. Enter the values shown below. Remember to set Rotation relative to: Path.

Illustrator Scatter Brush - Fur Trim: Scatter Brush Options - Spike

Step Three

Make 5pt by 5pt circle. Select a neutral Stroke color (i.e, #666666) and no Fill. Apply the FurSpike Brush we made in Step Two.

Note: The Scatter and Rotations were set to Random in Step Two. Apply the brush one or more times to get the affect you like.

Step One: Illustrator Scatter Brush - Fur Trim

Step Four

Choose Expand Appearance from the Object menu.

Step Two: Illustrator Scatter Brush - Fur Trim

Step Five

With the Direction Selection Tool, select one of the bounding boxes.

Step Three: Illustrator Scatter Brush - Fur Trim

Step Six

From the Select menu, choose Same » Fill & Stroke, then press Delete.

Step Four: Illustrator Scatter Brush - Fur Trim

Step Seven

From the Pathfinder Panel, choose Unite.

Step Six: Illustrator Scatter Brush - Fur Trim

Step Eight

On the Tools Panel, double‑click on Rotate to open the Rotate dialog. Type in 40° for the angle and click Copy. Apply a lighter gray Stroke color (i.e., #999999).

Step Seven: Illustrator Scatter Brush - Fur Trim

Steps Nine and Ten

Repeat Step Seven twice more, with Stroke colors of #CCCCCC and #FFFFFF.

Step Eight: Illustrator Scatter Brush - Fur Trim
Step Nine: Illustrator Scatter Brush - Fur Trim

Step Eleven

Scale the last object created to 75%.

Step Ten: Illustrator Scatter Brush - Fur Trim

Step Twelve

With the clump of 'Fur' objects selected, click New Brush from the Brush Panel and select New Scatter Brush from the New Brush dialog. This will open up the Scatter Brush Options dialog. Enter the values shown below. Again, remember to set Rotation relative to: Path. Select Hue Shift for the Colorization Method and set the Key Color to White (#FFFFFF). This will allow you to change the color of the brush once it is applied to an object (by changing the Stroke color).

Illustrator Scatter Brush - Fur Trim: Scatter Brush Options - Fur Trim

Step Thirteen

Draw a new line segment with a Stroke Weight of 1pt and a Stroke color of White (#FFFFFF). Apply the brush.

Illustrator Scatter Brush - Fur Trim: Scatter Brush Options - Fur Trim

To demonstrate the affect of the Hue Shift Colorization Method, I've changed the Stroke color to Red (#CC3300).

Illustrator Scatter Brush - Fur Trim: Scatter Brush Options - Fur Trim

Here, the Stroke Weight was changed to 0.5pt.

Illustrator Scatter Brush - Fur Trim: Scatter Brush Options - Fur Trim

Where to Go for More Information

Filed under: , ,