Technology

Confirming that object references in arrays are preserved while cloning the arrays

A short test to confirm references are preserved in cloned arrays. The result is: Now let’s mess with one piece of that to check if the object was passed by reference or got cloned: Confirmed, the object is passed by reference, even though the array that contained it was cloned: » about 300 words

Is Perl the best solution to write code that needs setuid?

A bunch of searching the web for things related to setuid and shell scripts lead me to this answer in Stack Exchange:

Perl explicitly supports setuid scripts in a secure way. In fact, your script can run setuid even if your OS ignored the setuid bit on scripts. This is because perl ships with a setuid root helper that performs the necessary checks and reinvokes the interpreter on the desired scripts with the desired privileges. This is explained in the perlsec manual. It used to be that setuid perl scripts needed #!/usr/bin/suidperl -wT instead of #!/usr/bin/perl -wT, but on most modern systems, #!/usr/bin/perl -wT is sufficient.

There was a comment on that answer suggesting the situation had changed recently, but the Perl docs assure me it still works.

There’s no ‘git cp filename’?

Here’s a sequence of unbelievable things:

  1. Yes, despite a lifetime in Subversion, I’m really this new to git!
  2. I’m going to link to Livejournal in this post!
  3. Git really doesn’t have an equivalent to svn cp filename!

I spent a surprisingly long time reviewing the man pages and surfing the internet to confirm this, but git really assumes you’ll never want to copy a file with history. Here’s that Livejournal link I promised, where markpasc has similar complaints — from 2008, no less.

I was looking for a way to copy a file with history because I needed to break a single file into multiple pieces. In my Subversion days I would have done a svn cp old-file.php new-file.php. From there I could prune old-file.php and new-file.php down to what I needed while preserving the full history for all the code that remained.

Or perhaps I’m missing something?

USB Camera Control

Problem The Canon EOS M doesn’t include a remote shutter release cable port, and the on-camera controls don’t expose features such as bulb-mode exposures. Further, simple remote shutter release doesn’t support the sophisticated camera control necessary to do timelapses with complex exposures. What kind of complex exposures? Imagine a timelapse going from day to night. During daylight […] » about 700 words

Preparing My iPhone For Europe

There’s uncertain talk of a European trip coming up, so I’m making nonspecific preparations for it. One of the questions I have is how to avoid hefty roaming charges from AT&T. In previous trips abroad I’d purchased overseas voice and data add-ons so I could use my iPhone. That works, up to a point. On my […] » about 400 words

Site Load Performance Benchmarks

The Loop’s Jim Dalrymple compiled the following numbers for the time it takes various tech sites to load in a browser in late 2011:

  • The Loop: 38 requests; 38.66KB; 1.89 secs
  • Daring Fireball: 23 requests; 49.82KB; 566 milliseconds
  • Macworld: 130 requests; 338.32KB; 8.54 secs
  • Ars Technica: 120 requests; 185.99KB; 2.08 secs
  • Apple: 46 requests; 419KB; 1.39 secs
  • CNN: 196 requests; 269.41KB; 4 secs
  • BGR: 368 requests; 2.74MB; 35.33 secs
  • AppleInsider: 141 requests; 649.39KB; 5.64 secs
  • Facebook: 137 requests; 993.54KB; 11.19 secs
  • MacStories: 119 requests; 2.16MB; 2.13 secs

John Gruber started this by calling out The Next Web for it’s slow performance:

  • TheNextWeb: 342 requests; 6MB; no time info

More benchmarks can be seen at Browsermob.

CSS Speech Bubbles

Twitter front-end guy Nicolas Gallagher likes both CSS and speech bubbles enough to want them unadulterated by images and non-semantic markup. The lesson from his many examples is that it all comes down to an :after pseudo element that puts the little triangle in there:

.speechbubble:after {
    content:"";
    position:absolute;
    bottom:-15px; /* value = - border-top-width - border-bottom-width */
    left:50px; /* controls horizontal position */
    border-width:15px 15px 0; /* vary these values to change the angle of the vertex */
    border-style:solid;
    border-color:#f3961c transparent;
    /* reduce the damage in FF3.0 */
    display:block; 
    width:0;
}

More examples on Nicolas’ site.

AirParrot Turns AppleTV Into A Secondary Display

From the FAQ on the AirParrot site:

What does AirParrot do?

AirParrot lets you AirPlay your Mac’s screen to a second or third generation AppleTV. What you see on your Mac’s screen will appear on the AppleTV, wirelessly!

How do I use AirParrot?

Once you’ve opened AirParrot, click on the icon in your menu bar. Select the AirPlay device (such as your AppleTV) and then select which screen you want to mirror. To stop mirroring, simply click on the same AirPlay device in the menu!

Configuring Amazon Linux For Web Services (Spring 2012)

I’ve tested this cookbook against Amazon Linux, but it will probably work just as well with the current version of CentOS. Basic Installation First, get root and update the OS: With that done, let’s get the basic packages and services installed: That gets us Apache HTTPD with SSL, PHP with a number of modules, Memcached, […] » about 400 words

How WordPress Taxonomy Query URLs Could Be More Awesomer

(Updated, see below) WordPress 3.1 introduced some awesome new taxonomy query features, and the URL parsing allows some rudimentary syntax to query multiple terms and choose if the query is OR’d or AND’d. The URL syntax is as follows: A comma (,) between terms will return posts containing either term (logical OR), like this http://maisonbisson.com/post/tag/wordpress,mysql/ . A […] » about 300 words

Web Strategy Discussion Starter

What follows is the text of a document I prepared to start and shape discussion about the future of the university website at my former place of work. The PDF version is what I actually presented, though in both instances I’ve redacted three types of information: the name of the institution (many already know, but […] » about 1500 words

Comcast’s Folly

Harry Shearer, the bassist for Spinal Tap, voice talent for many characters in The Simpsons, and host of Le Show has no difficulty criticizing the unnecessary complexities of modern media technology, but not until his August 14 episode (subscribe to the podcast) has he admitted to the frustrations of modern cable. “It’s now easier to watch TV on your […] » about 700 words