Wi-Fizzle.com - Putting the fizzle in Wi-Fi since 2005 .. (yes, this was a poor choice for a domain name)
Posted by dandriff on Friday July 04, 2008@04:51PM

AVS Forum has a nice thread dedicated to the Marantz SR8500 Receiver. The linked page contains information which is either not included or that I was otherwise unable to locate in the manual for this receiver (and I've read every word of that forsaken thing) -- how to change the A and B speaker selectors via the universal remote control that comes with the unit.

Press AMP and then the 6 button.

Now, only if I could find the original universal remote control...


Posted by dandriff on Thursday July 03, 2008@08:13AM

FreeUtopia. The guys who runs this is my hero.


Posted by dandriff on Thursday July 03, 2008@08:12AM

Sitepoint has some interesting articles.


Posted by dandriff on Wednesday July 02, 2008@08:33AM

This looks interesting. Google code hosting.


Posted by dandriff on Monday June 30, 2008@02:10PM

In PHP, there is an alternative if-statement syntax. I didn't find it listed on the PHP.net control-structures documentation. It goes like this:

<?php
if (!function_exists('ptrfun'):
  /**
   * This isn't the real ptrfun() function like you would find in C.  This is
   * just a poorly named and subsequently rather stupid example function.
   *
   * @return int
   */
  function ptrfun() {
    // Return the integer which represents what the future unix-timestamp will
    // be one minute from now.
    return mktime() + 60;
  }
endif;
?>

Okay. The above example seems horrid, confusing, and overcomplicated. Here is the 'real' example with less chatter:


<?php
if (...):
  // {Whatever code you want goes in here}.
endif;
?>

**This note was added for my own personal reference.**


Posted by dandriff on Monday June 30, 2008@12:22PM

This comment at php.net contains a valuable piece of wisdom:

If you need to compare a variable with a value, instead of doing:
<?php
  if ($foo == 3) bar();
?>

do:
<?php
  if (3 == $foo) bar();
?>

This way, if/when you forget the second equals sign (=), the statement will become:
<?php
  if (3 = $foo) bar();
?>

and PHP will evaluate the statement and report an error.


Posted by dandriff on Sunday June 29, 2008@10:43AM

Howto: Coax a BASH shell script into splitting for-loop elements by newline instead of whitespace (whitespace is the default behaviour).

#!/bin/bash

IFS_BAK=$IFS
IFS="
"

for f in `ls -1 .`; do
  echo "I found a directory! => $d"
done

IFS=$IFS_BAK
IFS_BAK=

This is really being posted for future reference by me, as I seem to keep forgetting that the "magic" variable name is IFS and not EOL.

Keywords: IFS, EOL, end of line, for-loop, newline, end-of-line,


Posted by dandriff on Thursday June 26, 2008@03:07PM
Posted by dandriff on Wednesday June 25, 2008@04:22PM

Today my buddy showed me Prado, a PHP framework I don't think I've seen before. I'll report back on what I think of it once I've checked it out and formed an opinion on the matter. (;


Posted by dandriff on Wednesday June 25, 2008@09:48AM

ShroudBNC is a project I've been watching for a few years now. It is beginning to look more promising then ever; I'll have to try it out and report back.

UPDATE: I had already previously expressed interest in ShroudBNC here


Posted by dandriff on Tuesday June 24, 2008@11:59AM
Posted by dandriff on Tuesday June 24, 2008@10:32AM
Posted by dandriff on Tuesday June 24, 2008@10:16AM

One-liners for randomizing the order of lines in a file:

Using only the Bash command line:

cat dead.letter | while read -r line; do echo "$RANDOM $line"; done | sed 's/^/0000/' | sed 's/^0*\([0-9]\{5\}[ ].*$\)/\1/' | sort | sed -r 's/^[0-9]+ //'

Using Perl:

perl -e '$filename="dead.letter";use List::Util "shuffle";open FILE,"<$filename" or die("unable to open $filename for reading\n");print shuffle();'

Even shorter with Perl:

cat dead.letter | perl -e '@a=<>;while(@a){print splice(@a,rand(@a),1)}'


Posted by dandriff on Tuesday June 24, 2008@08:35AM

Interesting Article:

"Making Wrong Code Look Wrong"
By Joel Spolsky

Every article I have ever read by Joel Spolsky has been an excellent read. Thank you Joel!!


< Previous Articles >