D. M. Ashley

Untitled

22nd November, 2009 Posted by | Uncategorized | Leave a Comment

Untitled

22nd November, 2009 Posted by | Uncategorized | Leave a Comment

Untitled

11th November, 2009 Posted by | Uncategorized | Leave a Comment

Baby Seal Boy – the surreal experiment

Baby Seal Boy – the surreal experiment

Shared via AddThis

25th June, 2009 Posted by | Uncategorized | Leave a Comment

Site Satellite

24th June, 2009 Posted by | Uncategorized | Leave a Comment

Broom Handle

Broom Handle

there is a large broom handle

poking through my chest

it’s really rather ugly

I wish I’d worn a vest

24th June, 2009 Posted by | Uncategorized | Leave a Comment

Powershell and Poetry

A Powershell script used to generate “poetry”. The program uses simple rules of grammar to pick random words from various word files. The output can be tweaked by manipulating the input word files.

BLAKE.PS1

$global:words=@{}

##########################################################################################

function get-words ($wordtype)

{

if ($words.($wordtype) -eq $null)

{

$words.($wordtype)=get-content c:\powershell\lex\$wordtype.lex|

foreach {$_.SPLIT()}

}

$ret=get-word $words.($wordtype)

$ret=$ret.REPLACE(“‘”,”").REPLACE(“.”,” “)

$ret

}

##########################################################################################

function get-word ($wordlist)

{

$max=$wordlist.count-1

$pick=get-random -min 0 -max $max

$ret=$wordlist[$pick]

if ($ret.TOSTRING().TOUPPER().CONTAINS(“GETWORD”))

{$ret=evaluate $ret}

$ret

}

##########################################################################################

function evaluate ($in)

{

$out=$in.TOSTRING()

do

{

$pos=$out.TOUPPER().INDEXOF(“GETWORD”)

$first=$out.SUBSTRING(0,$pos)

$brst=($out.TOUPPER().INDEXOF(“(“))+1

$bren=$out.TOUPPER().INDEXOF(“)”)

$wrd=$out.SUBSTRING($brst,($bren-$brst))

$rest=$out.SUBSTRING(($bren+1))

$out=$first + (get-words $wrd) + $rest

} until (-not ($out.TOUPPER().CONTAINS(“GETWORD”)))

$out

}

##########################################################################################

function get-randpct ($pct)

{

$ret=$false

$test=GET-RANDOM -MIN 1 -MAX 100

if ($test -gt $pct) {$ret=$true}

$ret

}

##########################################################################################

function get-nounphrase

{

$type=“noun”

if (get-randpct 35) {$type=“plural”}

$pron=(get-words “pronoun”)

$np=”"

if (get-randpct 45) {$np = $np + ” ” + (get-words “adject”)}

$np = $np + ” ” + (get-words $type)

if (($type -eq “plural”) -and ($pron -eq “a”)) {$pron=”the”}

$np=$pron + ” ” + $np

if (get-randpct 70) {$np=$np + ” and ” + (get-nounphrase)}

$np=$np.REPLACE(“  “,” “)

$np

}

##########################################################################################

function get-verbphrase

{

$adv=$false

$vp=”"

if (get-randpct 90)

{

$vp=(get-words “adverb”)

$adv=$true

}

$vp=$vp + ” ” + (get-words “verb”)

if (get-randpct 90) {$vp=$vp + ” ” + (get-nounphrase)}

if ((get-randpct 75) -and (-not ($adv))) {$vp=$vp + ” ” + (get-words “adverb”)}

if (get-randpct 75) {$vp=$vp + ” ” + (get-words “prep”) + ” ” + (get-nounphrase)}

$vp=$vp.REPLACE(“  “,” “)

$vp

}

##########################################################################################

for ($i=1;$i -lt 10;$i++)

{

((get-nounphrase) + ” ” + (get-verbphrase)).replace(“  “,” “).padright(120)|

write-host -b darkblue -f white

}

NOUN.LEX

people race species civilisation pool granite street ethos goddess night

anarchist cobra lubricant lute madcap maelstrom maharajah malaria

nebula oak phantasm magnificence mammal maggot time drift drifter lake

lullaby marionette monarch mannequin machine machinery madhouse madman

song voice symphony sigh ember luck mandarin maiden woman nymph

sea ocean river building

doctor fisherman birth commandant anvil blemish cancer decay hammer

claymore bloodsucker accident meteorite coffin virus garrotte capsule

captain jelly blood heart mind soul body hand fist heath marsh

desert sand lake water dust grass dagger sword coin foundation hearse

heart heartache ache blacksmith offspring entity damned power station

victim child slave jackboot joy haemophiliac ferret dementia candlestick

blanket

jihad blood destruction horror terror fear pain flesh life birth

scream cry reactor meltdown canister warhead warlord terrorist

inmate installation fighter emperor deity goddess titan giant mountain

juggernaut car dagger voice command power

dish piece flute sword ring circle square triangle

sabre arrow death lightning heat killer assassin mercenary alien

monster dragon lizard animal beast ghost phantom spectre vampire

quarter section strain factor project protocol code program execution

bone laughter sorrow sound song place perception quartet orchestra

night train undercurrent tide stream rain raindrop wind breeze

tornado hurricane storm dawn tide sea light liquid spawn horde army

bird swallow goose hawk eagle raven falcon bird.of.prey

ADJECT.LEX

dying flying clawing damp melancholy terminal deep tranquil

red green blue orange white black golden silver dangerous violent

dancing shiny vengeful surreal abandoned animated silent

idealistic able mysterious strange still turbulent translucent

silent random subconscious clouded

abrasive disconcerting abusive detonated academic ideological

accidental accursed

acrobatic wobbling nightly seafaring twilight

continental emotional acrylic distrusting metaphysical committed

chopping cavorting brandishing bold bracing

grateful spinning admiring moist

dangling pointed admired contaminated adoring

rigid advanced adventurous incredible bloody red white silver bruised

echoing addicted addictive additional emaciated canonized carving

absorbing lowering impressionistic abused abusing civilized

inexhaustible democratic disturbing identifying defoliate

gifted avenging inspired tripping floating dreaming

shivering bloody golden inbred passionate broken screaming

crying wailing dying burnt burning cold frozen icy illegitimate jelly

jealous hydrostatic aching acidic assisted acoustic jumbled impregnating

dream time inglorious intoxicated jovial Jovian jumping jagged juggling

detailed leather chopped kidnapped killed foreboding brown gripping

darkened huddled brutal ladled detestable fugitive half-hearted adaptable

marching jabbering forked crystalline festering microscopic

gothic automated exiled existential captivated burnt crystal subsonic

ultra super deep pleasure twilight ice frozen icy crystal snowbound

damping distortion subterranean dark gallant heroic strange cursed

solitary young disgruntled damned disruptive dark broken dry

wind.swept dusty hot steamy melting molten glistening shimmering brown

yellow sandy damp arid muddy limpid

PRONOUN.LEX

the the the the the the the the the the the the the the the the the the

‘the.’GETWORD(NOUN)’s’ ‘our.’GETWORD(NOUN)’s’

‘his.’GETWORD(NOUN)’s’ ‘her.’GETWORD(NOUN)’s’ ‘their.’GETWORD(NOUN)’s’

‘your.’GETWORD(NOUN)’s’

the the the the the the our his her their your Gods the.devils lifes

deaths

its

a a a winters summers Octobers Decembers

my your my your his her their my your our your my his my her my your

ADVERB.LEX

gingerly absentmindedly brightly gently weakly soothingly jealously

absolutely unsoundly abstractly

abusively abysmally acceptably glaringly

unceremoniously accidentally beneficially accountably

fitfully accurately accusingly acoustically

continently actively actually

acutely adamantly additionally adaptively adeptly strangely

scathingly menacingly adjacently grievously

administratively admissibly jubilantly entirely non-specifically

defiantly adorably heavenly operationally slowly

tyrannically adversely sadly aerobically

excusably jealously slowly surely gently swiftly bracingly

experimentally triumphantly explicitly darkly greedily

exceptionally excessively hungrily hurriedly

aerodynamically aesthetically affectedly flexibly affectionately

affirmatively affluently unhurriedly occasionally

slowly quickly silently swiftly brightly

gently quickly

VERB.LEX

smeared cloned forgot rampaged flew shouted screamed swore disturbed

lubricated teemed spawned scrutinized abolished fermented absconded

accelerated uncoiled acclaimed violated shrank grew walked ran

liked studded poisoned accumulated accused ached trimmed dislocated

ionized adjudicated crossed adjusted grayed rattled whipped talked

hammered clanged gored cowered advertised ran walked swam sung

betrayed afflicted toughened aimed ducked parachuted paraded soared

jerked alighted detonated destroyed walked altered ambushed slumbered

burned blocked swayed halted stopped broke turned drew picked.up blew.up

exploded destroyed moved talked sang whispered shouted burnt

drowned flew floated ambled swarmed dived struck attacked killed

stung slashed pierced thrust paused waited examined talked

burned screamed broke hung stopped started grew shrank

PLURAL.LEX

old.ones ancients amnesiacs fans clones knights spies bonds seas

contraptions pointers girls women       bits things parts descendants

toilets glow-worms butterflies gamekeepers chambers abnormalities enemies

abominations avenues gifts masses

years days months decades insomniacs innocents contaminators bouncers

inducers condors exposures insects conquerors grenades constructors

shadows warriors aliens devils terrors insects monsters nightmares

members limbs winkles rods pineapples satsumas anarchists seas oceans

cobras lubricants lutes  maelstroms maharajahs nebulas oaks

phantasms contraceptives mammals maggots lullabies marionettes monarchs

mannequins machines madmen songs voices embers mandarins girls

women tarts doctors fishermen births commandants abortions anvils

claymores bloodsuckers accidents meteorites coffins viruses garrottes

gods daggers swords coins foundations hearts weapons ancients towers

entities stations powers shadows demons devils currents tides swords

dreamers makers beings walkers warriors watchers guardians

bowels reactors canisters warheads warlords terrorists victims

prisoners slaves children women killers destroyers daggers swords

installations fighters emperors deities goddesses titans giants mountains

dishes pieces  flutes swords rings circles squares rivers

triangles sabres arrows killers assassins aliens monsters dragons lakes

lizards animals beasts ghosts phantoms spectres vampires quadrants

sections strains factors projects protocols codes programs

sounds keys places secrets currents tides winds

27th April, 2009 Posted by | Powershell, Programming | Leave a Comment

Site at a Glance

27th April, 2009 Posted by | Uncategorized | Leave a Comment

Hello world!

300px-magritte_thesonofman600px-pi-symbol_svg Welcome to WordPress.com. This is  your first post. Edit or delete it and start blogging!

27th April, 2009 Posted by | Uncategorized | 1 Comment

   

Follow

Get every new post delivered to your Inbox.