tonybaldwin | blog

non compos mentis

Archive for the ‘language’ Category

Thou unmuzzled, malmsey-nosed scullian! (randomness in php)

with 6 comments

Some time ago, I wrote fo0l and Shakes, being random Shakespearean insult generators in python, fo0l being a basic script, and Shakes being the same, dressed up with a tkinter gui.

Today, I translated fo0l to php, creating a webinterface for this lovely linguistic tool.

Try it out HERE, if thou hast the heart, thou frothy, shard-borne haggard!

What did I do?
Let’s look at fo0l, first:

#!/usr/bin/python
# Shakespearean insult generator

from random import randint

a = ("artless", "bawdy", "beslubbering", "bootless", "churlish", "cockered", "clouted", "craven", "currish", "dankish", "dissembling", "droning", "errant", "fawning", "fobbing", "froward", "frothy", "gleeking", "goatish", "gorbellied", "impertinent", "infectious", "jarring", "loggerheaded", "lumpish", "mammering", "mangled", "mewling", "paunchy", "pribbling", "puking", "puny", "qualling", "rank", "reeky", "roguish", "ruttish", "saucy", "spleeny", "spongy", "surly", "tottering", "unmuzzled", "vain", "venomed", "villainous", "warped", "wayward", "weedy", "yeasty", "cullionly", "fusty", "caluminous", "wimpled", "burly-boned", "misbegotten", "odiferous", "poisonous", "fishified", "Wart-necked") # 60 items

a1 = randint(0,59)
a2 = a[a1]

b = ("base-court", "bat-fowling", "beef-witted", "beetle-headed", "boil-brained", "clapper-clawed", "clay-brained", "common-kissing", "crook-pated", "dismal-dreaming", "dizzy-eyed", "doghearted", "dread-bolted", "earth-vexing", "elf-skinned", "fat-kidneyed", "fen-sucked", "flap-mouthed", "fly-bitten", "folly-fallen", "fool-born", "full-gorged", "guts-griping", "half-faced", "hasty-witted", "hedge-born", "hell-hated", "idle", "headed", "ill-breeding", "ill-nurtured", "knotty-pated", "milk-livered", "motley-minded", "onion-eyed", "plume-plucked", "pottle-deep", "pox-marked", "reeling-ripe", "rough-hewn", "rude-growing", "rump-fed", "shard-borne", "sheep-biting", "spur-galled", "swag-bellied", "tardy-gaited", "tickle-brained", "toad", "spotted", "unchin-snouted", "weather-bitten", " whoreson", "malmsey-nosed", "rampallian", "lily", "livered", "scurvy-valiant", "brazen-faced", "unwash'd", "bunch-back'd", "leaden-footed", "muddy-mettled", "pigeon-liver'd", "scale-sided") # 62 items

b1 = randint(0,61)
b2 = b[b1]

c = ("apple-john", "baggage", "barnacle", "bladder", "boar-pig", "bugbear", "bum-bailey", "canker-blossom", "clack-dish", "clotpole", "coxcomb", "codpiece", "death-token", "dewberry", "flap-dragon", "flax-wench", "flirt-gill", "foot-licker", "fustilarian", "giglet", "gudgeon", "haggard", "harpy", "hedge-pig", "horn-beast", "hugger-mugger", "joithead", "lewdster", "lout", "maggot-pie", "malt-worm", "mammet", "measle", "minnow", "miscreant", "moldwarp", "mumble-news", "nut-hook", "pigeon-egg", "pignut", "puttock", "pumpion", "ratsbane", "scut", "skainsmate", "strumpet", "varlot", "vassal", "whey-face", "wagtail", "knave", "blind-worm", "popinjay", "scullian", "jolt-head", " malcontent", "devil-monk", "toad", "rascal", "Basket-Cockle") # 60 items

c1 = randint(0,59)
c2 = c[c1]

print("Thou " + a2 + ", " + b2 + " " + c2 + "!")

Now, how did I translate that to php?


Enjoy!

./tony

Written by tonybaldwin

May 17, 2011 at 6:44 pm

search wiktionary from the bash cli

with 2 comments

Last week I posted several scripts for searching google, google translate, google dictionary, reverso, and wikipedia from the bash command line.

Today I wrote another script, this time for searching wiktionary.org, the multilingual, user-edit online dictionary:

#!/bin/bash

# get definitions from wikitionary

if [ ! $1 ];
	then
read -p "Enter 2 letter language code: " lang
read -p "Enter search term: " sterm
lynx -dump $lang.wiktionary.org/wiki/$sterm | less
else
lynx -dump $1.wiktionary.org/wiki/$2 | less
fi

I tucked this into my PATH as simply “wikt”, and usage is thus:
you@machine:~$ wikt en cows
or, if you neglect to use the language code and search term, of course, the script asks for them:
you@machine:~$ wikt
Enter 2 letter language code: en
Enter search term: cows

Enjoy!

./tony

Written by tonybaldwin

May 16, 2011 at 7:11 am

Un Système Purifié: PureOS GNU/Linux

leave a comment »

Pure OS Light

Pure OS Light & Iceweasel

In my continuing gnu/linux adventures, this evening I am playing with PureOS, a French gnu/linux distribution based on Debian/Testing.  For those unaware, Debian has three branches, stable (what I use for my work machines), testing, and unstable.  Currently, Squeeze is stable, but was just made so a week ago.  PureOS, as such, is still based on Squeeze.

All I can say is that it really feels like home! After all, this IS, more or less, Debian, simply with an adapted interface for the French, I suppose. PureOS IS also available in English, but I chose to experiment with the French version of PureOS Light, the XFCE4 flavored version. I would have to say, of all the LiveCD gnu/linux distributions I’ve toyed with, of late, PureOS may very well be the fastest. Now, usually running an operating system from your cdrom drive just isn’t fast, but, with PureOS, I almost forget that I’m running a LiveCD. It’s very snappy.
The full version includes the completely Free office suite, LibreOffice, which hasn’t yet been added to Debian, plus some other updated packages, but, since I only downloaded the Light version (I’m diabetic, after all), I have not yet played with LibreOffice with this system (I do have it running on my Debian/Squeeze systems).  So far, I have not determined any other real difference between PureOS, and what I’m running on my work machines, really, aside from these few updated packages, and the fact that this system is configured for French.  PureOS Light includes gnumeric, abiword, orage, epdfviewer, exaile music player, ristretto image viewer, and more.

More images here in
my screenshots album

Written by tonybaldwin

February 15, 2011 at 12:35 am

Fiddling with Fedora 14

leave a comment »

So, in my never ending quest to plumb the depths of all that is gnu/linux (I have NOT gone very deep yet, really), today I decided to play with an old friend.  My first long-time relationship in the gnu/linux world was with RedHat (starting with 7.1), which evolved into Fedora Linux, which I continued to use until about 2007, when I switched, at that time, to Ubuntu’s Dapper Drake (within a year of that, I switched to my ownPCLinuxOS derived, home brewed Linguas OS, and in 2009 I switched to Debian, which, at this juncture I still use, and probably will forever, unless I switch to Arch Linux with which I was toying yesterday).

So, I downloaded the Fedora LXDE Spin and gave it a whirl on my old, spare machine.  It ran well enough, grabbed the ethernet connection automagically (unlike Arch, yesterday, but that was easily amended).  It came with the usual LXDE stuff, including PCManFM, LXTerminal, LXTask, even an LXplay front-end to XMMS2 that I’d never seen before.  It had other useful goodies, including Firefox, MTPaint, Osmo personal organizer, which was cute, etc. No real big surprises, just, basic, popular, useful stuff for your average desktop, but good stuff.

I opened up the little gui package manager and surfed around the available packages for Fedora, and, I have to say, it seems like a lot of stuff I use in Debian was simply not available in Fedora.  There were definitely far fewer packages, especially in the development area.  At the same time, many of them were more recent.  For instance, I install OmegaT by hand on my Debian system, because only 1.8.1 is available in even the brand, shiny, spanking new stable release Squeeze, while the OmegaT project has release 2.2.2 (I’m using 2.2.0 here).  Well, Fedora has OmegaT 2.2.3 (good news for my fellow translators, at least).  In truth, that’s about the only thing that impressed me.  Their inclusion of the latest OmegaT.  Yeah.  Otherwise, I was more or less confirmed in my conviction that leaving Fedora, I wasn’t missing anything, and, especially, moving to Debian was a great idea.  I don’t mean to bad-mouth the Fedora Project, of course.  Back in 2007, I left Fedora, because, as I recall, yum (the package manager) kept breaking stuff.  They may very well have resolved that issue, and, I’m certain Fedora is a solid project. It is very popular, but, frankly, I just didn’t see anything in this LiveCD that would motivate me to install it on my hdd (unlike the CTKArch LiveCD I tried yesterday…that was AWESOME! Considering a dual-boot with that, at the very least).

Anyway, here are a few screenshots for your viewing pleasure.

From screenshots

Written by tonybaldwin

February 14, 2011 at 9:27 pm

Luisa Maita – Lero Lero

leave a comment »

via YouTube – Luisa Maita – Lero-Lero.

No mp3brasil.com estão oferecendo o mp3 gratis, em troca por um tweet (A @ é destaque na @ e pra comemorar eu baixei uma música em troca de um tweet! ).  Pois, dessa forma fiquei sabendo dessa garota lindinha e talentosa, e fui buscando mais músicas dela.  Valeu, sim!

Luísa Maita Lero-Lero

Luísa Maita Lero-Lero


Se você gostar, pode comprar o disco inteiro Lero-Lero

ou ainda melhor, pode baixar todos os mp3s por somente US$5.00: Lero-Lero (Amazon Exclusive Version) (vem com um remix extra somente disponível no amazon!)

Comprei os mp3 dessa forma, e estou gostando demais!

In mp3brasil.com today they are giving a free download of this song, in exchange for a tweet.  Thus, I learned of this beautiful and talented girl, and went in search of more of her music. It was definitely worth it!

Follow this link to get the mp3 for yourself: 

If you like it, you can get the CD for $13 here: Lero-Lero

or, even better, download the entire mp3 album for only $5 here: Lero-Lero (Amazon Exclusive Version) (comes with an extra remix song ONLY available on Amazon!)

I bought the mp3s, and I am LOVING it!


Okay, desde que eu estava aqui de tarde escrevendo, eu tenho que dizer que NÃO POSSO PARAR DE ESCUTAR ESSA MENINA!
Eu tive que sair de casa, pois, fiz um disco das suas músicas pra levar no carro, E, também pois as suas canções no meu celular (android), e, fico escutando, de novo e de novo, sem cansar dessas músicas. Tem elementos folcloricos e de músicas tradicionais brasileiras, mas, também algo bem moderno, que nem posso describir, e, que ela tem influencias em outros artistas brasileir@s já e obvio (Céu, Marisa, Bebel, Adriana e muitos que llegaram bem antes) mas, ela tem criado algo bem distinto, ainda. Além de tudo, essas músicas possuem uma beleza cativante que me deixam louco pra ouvir-as de novo.
Você TEM que escutar esse disco. Eu juro.

Okay, since I was here this afternoon writing, I have to say that I CAN NOT STOP LISTENING TO THIS GIRL!
I had to go out, so, I burnt a disc of her music to take in the car, AND, I also put her songs on my cell phone (android), and I keep listening, over and over, without tiring of these songs. They have elements of folk and traditional Brazilian music, but, also, something quite modern,that I can’t quite describe, and, that she’s been influenced by other Brazilian artists (Céu, Marisa, Bebel, Adriana and many other who came before her) is quite obvious, yet, she’s made something all her own and original. Above all, these songs possess a captivating, hauting beauty to them that makes me crazy to hear them again.
I swear, you have GOT to listen to this disc.

🙂
./tony

Written by tonybaldwin

January 27, 2011 at 1:57 pm

TonyBaldwin.net = Webmastery Awesomeness

leave a comment »

I actually have two sites up, at the moment, to showcase (and market) my webmastery awesomeness.
I’m in the process of deciding which will stay and which will go.

They are:

http://webs.baldwinsoftware.com

hand written with some jquery niftiness
WINNER! This page now rests at both: http://webs.baldwinsoftware.com AND http://www.tonybaldwin.net!!

and


http://baldwinsoftware.com/joo/

built with joomla

Which ever wins, in the end, will likely remain at BOTH URLs, http://webs.baldwinsoftware.com & http://www.tonybaldwin.net . UPDATE: winner has been determined…

So…what do YOU think?

Written by tonybaldwin

January 27, 2011 at 1:34 pm

Luisa Maita – Lero-Lero

leave a comment »

via YouTube – Luisa Maita – Lero-Lero.

No mp3brasil.com estão oferecendo o mp3 gratis, em troca por um tweet (A @ é destaque na @ e pra comemorar eu baixei uma música em troca de um tweet! ).  Pois, dessa forma fiquei sabendo dessa garota lindinha e talentosa, e fui buscando mais músicas dela.  Valeu, sim!

Luísa Maita Lero-Lero

Luísa Maita Lero-Lero


Se você gostar, pode comprar o disco inteiro Lero-Lero

ou ainda melhor, pode baixar todos os mp3s por somente US$5.00: Lero-Lero (Amazon Exclusive Version) (vem com um remix extra somente disponível no amazon!)

Comprei os mp3 dessa forma, e estou gostando demais!

In mp3brasil.com today they are giving a free download of this song, in exchange for a tweet.  Thus, I learned of this beautiful and talented girl, and went in search of more of her music. It was definitely worth it!

Follow this link to get the mp3 for yourself: 

If you like it, you can get the CD for $13 here: Lero-Lero

or, even better, download the entire mp3 album for only $5 here: Lero-Lero (Amazon Exclusive Version) (comes with an extra remix song ONLY available on Amazon!)

I bought the mp3s, and I am LOVING it!


Okay, desde que eu estava aqui de tarde escrevendo, eu tenho que dizer que NÃO POSSO PARAR DE ESCUTAR ESSA MENINA!
Eu tive que sair de casa, pois, fiz um disco das suas músicas pra levar no carro, E, também pois as suas canções no meu celular (android), e, fico escutando, de novo e de novo, sem cansar dessas músicas. Tem elementos folcloricos e de músicas tradicionais brasileiras, mas, também algo bem moderno, que nem posso describir, e, que ela tem influencias em outros artistas brasileir@s já e obvio (Céu, Marisa, Bebel, Adriana e muitos que llegaram bem antes) mas, ela tem criado algo bem distinto, ainda. Além de tudo, essas músicas possuem uma beleza cativante que me deixam louco pra ouvir-as de novo.
Você TEM que escutar esse disco. Eu juro.

Okay, since I was here this afternoon writing, I have to say that I CAN NOT STOP LISTENING TO THIS GIRL!
I had to go out, so, I burnt a disc of her music to take in the car, AND, I also put her songs on my cell phone (android), and I keep listening, over and over, without tiring of these songs. They have elements of folk and traditional Brazilian music, but, also, something quite modern,that I can’t quite describe, and, that she’s been influenced by other Brazilian artists (Céu, Marisa, Bebel, Adriana and many other who came before her) is quite obvious, yet, she’s made something all her own and original. Above all, these songs possess a captivating, hauting beauty to them that makes me crazy to hear them again.
I swear, you have GOT to listen to this disc.

🙂
./tony

Written by tonybaldwin

January 24, 2011 at 11:00 am