hashes.pl %(hash related)

A UNIX Command
$cat hashes.pl
# Simple hash constructs
$fred{"with"} = "without";
$fred{"this"} = "that";
$fred{"mountain"} = "valley";
$fred{"left"} = "right";
print qq/$fred{"this"}n/;
@keys = keys(%fred);
print "Keys are @keysn";

# Initializer for %yard.
%yard = ( red => 'brick',
          blue => 'sky',
          green => 'grass',
          yellow => 'dandelion' );
print "$yard{'blue'} $yard{'yellow'}n";

$perl hashes.pl
that
Keys are left mountain with this
sky dandelion
$


UNIX Explanation
Variables  whose   names  begin  with  %  are   hashes,  which  are
essentially arrays subscripted by  strings. As with arrays, %sue is
a hash, and it is a different variable from $sue, though members of
%sue are  selected by  $sue{$s}.  The built-in  function keys(%sue)
returns an array of all the keys (subscripts) of the hash %sue.

http://sandbox.mc.edu/~bennet/perl/leccode/var3_pl.html

songclip hazard cover oct 29 2011

[audio:http://www.beautifulwork.org/wp-content/uploads/2011/10/hazard.mp3]

Audio Recorder
: gnome-sound-recorder 2.91.2 Details : recorded as a wav file.
Play

$mplayer -nojoystick -nolirc hazard.mp3
MPlayer SVN-r33057 (C) 2000-2010 MPlayer Team

Playing hazard.mp3.
Audio only file format detected.
Clip info:
 Title:
 Artist:
 Album:
 Year:
 Comment:
 Genre: Unknown
Load subtitles in ./
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:  33.0 (33.0) of 33.0 (33.0)  2.0%


Exiting... (End of file)
$



MP3 Conversion
: pacpl Details : $pacpl hazard.wav -t mp3 Perl Audio Converter - 4.0.5 Converting: [hazard.wav] -> [mp3] ..done. Total files converted: 1, failed: 0 $
File Details

$file hazard.*
hazard.mp3: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, Monaural
hazard.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 32 bit, mono 22050 Hz
$


bubble sorting using php

<?php
/* bubble.php by detour@metalshell.com
 *
 * Generate random numbers then sort them.
 *
 * http://www.metalshell.com/
 *
 */


$array_size = 250;

// If you use v4.2.0 or lower uncomment this
// srand((double)microtime()*1000000);

// Generate $array_size random numbers to be sorted.
for($x = 0; $x < $array_size; $x++)
  $ran[$x] = rand(0, 500);

/* The bubble sort method.  If you don't know how it works it's very
 * simple, values are switched one at a time for each element. */
for($x = 0; $x < $array_size; $x++) {
  for($y = 0; $y < $array_size; $y++) {
    if($ran[$x] < $ran[$y]) {
      $hold = $ran[$x];
      $ran[$x] = $ran[$y];
      $ran[$y] = $hold;
    }
  }
}

for($x = 0; $x < $array_size; $x++)
  print $ran[$x] . "
"; ?>

songclip part time lover Oct 25 2011

[audio:http://www.beautifulwork.org/wp-content/uploads/2011/10/part-time-lover.mp3]

Audio Recorder
: gnome-sound-recorder 2.91.2 Details : recorded as a ogg file.
Play
$ogg123 part_time_lover.ogg

Audio Device:   Advanced Linux Sound Architecture (ALSA) output

Playing: part_time_lover.ogg
Ogg Vorbis stream: 2 channel, 44100 Hz

Done.
$


MP3 Conversion
: pacpl Details : $ffmpeg -i part_time_lover.ogg -ab 320k part-time-lover.mp3
File Details

$file part-time-lover.mp3
part-time-lover.mp3: Audio file with ID3 version 2.4.0, contains: MPEG ADTS, layer III, v1, 320 kbps, 44.1 kHz, JntStereo
$file part_time_lover.ogg
part_time_lover.ogg: Ogg data, Vorbis audio, stereo, 44100 Hz, ~160000 bps, created by: Xiph.Org libVorbis I
$

strip_tags PHP API

A Programming API


<?php $string= strip_tags($row['post_content']); ?>

An Explanation
strip_tags — Strip HTML and PHP tags from a string

string strip_tags ( string $str [, string $allowable_tags ] )

This function tries to return a string with all NUL bytes, HTML and
PHP tags stripped from a given  str. It uses the same tag stripping
state machine as the fgetss() function.


orepiyaclip sandb Sun Oct 16 2011

[audio:http://www.beautifulwork.org/wp-content/uploads/2011/10/orepiyafull.mp3]

Audio Recorder
: gnome-sound-recorder 2.30.0 Details : recorded as a wav file.
Play

$yatm orepiyafull.wav
$

MP3 Conversion
: pacpl Details : $pacpl orepiyafull.wav -t mp3 Perl Audio Converter - 4.0.5 Converting: [orepiyafull.wav] -> [mp3] ..done. Total files converted: 1, failed: 0 $
File Details
$file orepiyafull.*
orepiyafull.mp3: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, Monaural
orepiyafull.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 32 bit, mono 22050 Hz
$


beatclip Sat Oct 15 cover

[audio:http://www.beautifulwork.org/wp-content/uploads/2011/10/beat.mp3]

Audio Recorder
: gnome-sound-recorder 2.30.0 Details : recorded as a wav file.
Play
 $mplayer beat.wav
MPlayer SVN-r33057 (C) 2000-2010 MPlayer Team
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing beat.wav.
Audio only file format detected.
Load subtitles in ./
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 22050 Hz, 1 ch, s32le, 705.6 kbit/100.00% (ratio: 88200->88200)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
AO: [alsa] 48000Hz 1ch s32le (4 bytes per sample)
Video: no video
Starting playback...
A:  24.9 (24.8) of 24347.0 ( 6:45:47.0)  0.6%


Exiting... (End of file)
$




MP3 Conversion
: pacpl Details : $pacpl beat.wav -t mp3 Perl Audio Converter - 4.0.5 Converting: [beat.wav] -> [mp3] ..done. Total files converted: 1, failed: 0 $
File Details
$file beat.*
beat.mp3: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, Monaural
beat.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 32 bit, mono 22050 Hz
$