Riboflavin
Fun With Programming Languages
Tonight, a Facebook thread got a little out of control after I posted a status update that I was “mentally bankrupt.” It was a long day working on client work – a project that is just about done but past due.
After some commentary by Facebook friends, we got to writing little scripts that would take a random selection from a group of adjectives and adverbs and put similar phrases together randomly.
What came of this exercise was a fun little jaunt into a variety of programming languages.
PHP
[cc lang="php"]
$adverbs = array(
'mentally',
'morally',
'emotionally',
'socially',
'psychologically'
);
$adjectives = array(
'devoid',
'bankrupt',
'empty',
'hollow',
'vacant',
'sleeping with fishes',
'taking a dirt nap',
'shallow'
);
echo $adverbs[array_rand( $adverbs )] . ' '
. $adjectives[array_rand( $adjectives )];
?>[/cc]
Ruby
[cc lang="ruby"]
adj = [ "mentally", "morally",
"emotionally", "socially",
"psychologically" ]
adv = [ "devoid","bankrupt",
"empty", "hollow","vacant",
"sleeping with fishes",
"taking a dirt nap","shallow" ]
print adj[rand(adj.length)] + ” ”
+ adv[rand(adv.length)] + “\n”
[/cc]
Python
[cc lang="python"]
import random
def popchoice(seq):
return seq.pop(random.randrange(len(seq)))
adj = [ 'mentally', 'morally',
'emotionally', 'socially',
'psychologically' ]
adv = [ 'devoid','bankrupt','empty',
'hollow','vacant','sleeping with fishes',
'taking a dirt nap','shallow' ]
print popchoice(adj) + ” ”
+ popchoice(adv)
[/cc]
SQL
[cc lang="sql"]CREATE TEMPORARY TABLE adjectives (
adjective VARCHAR (30) NOT NULL
);
CREATE TEMPORARY TABLE adverbs (
adverb VARCHAR (30) NOT NULL
);
INSERT INTO adjectives (adjective)
VALUES
(‘mentally’),
(‘morally’),
(‘emotionally’),
(‘socially’),
(‘psychologically’);
INSERT INTO adverbs (adverb)
VALUES
(‘devoid’),
(‘bankrupt’),
(‘empty’),
(‘hollow’),
(‘vacant’),
(‘sleeping with fishes’),
(‘taking a dirt nap’),
(‘shallow’);
SELECT CONCAT_WS(
‘ ‘,
( SELECT adjective FROM adjectives ORDER BY RAND() LIMIT 1 ),
( SELECT adverb FROM adverbs ORDER BY RAND() LIMIT 1 ) )
as RandomStuff;
[/cc]
“Sarah Palin” Makes an “amazing” Appearance on SNL with her Tina Fey Glasses
In case you missed it:
What Would the United States Do for Mexico?
There was a massive earthquake in western Mexico and 200,000 people unfortunately, and tragically, died. In the wake of the tragedy, the nations of the world banded together to provide relief.
China sent a ship with containers of goods such as tee-shirts, watches and electronic devices to help with cleanup and provide humanitarian relief.
Great Britain sent 500 palettes of drinking water and other humanitarian aid.
Beliza and Costa Rica sent hundreds of first responders and medical aid.
The United States sent 200,000 Mexicans to replace the ones that were lost.
In all seriousness, this election is important in so many ways. One of the major issues on the table that might not be getting as much attention is illegal immigration. John McCain doesn’t want to talk about it much because it was an issue made big by George W. Bush and he’s trying to keep Sarah Palin front and center. Barack Obama isn’t talking much about it because he’s fighting a guerilla war based more on propaganda and media spin, than he is on these core issues.
But, at the end of the day, both candidates have taken some kind of position on immigration. It’s not that we, as conservatives, don’t care about the plight of illegals, but that there is a process to being legal.
Obama is best suited, based on his platform, to push this issue. We need to find a way to help illegals become legal without destroying families and lives in the process. We do need to secure the borders, but what does that mean? Certainly, the immigrants that are here now are “doing the jobs Americans won’t”, but that’s not an excuse to allow a persistent state of illegality. Instead, how do we help these people become legal and at the same time, stem the wave of illegals that are coming into the country and tapping our finite resources without paying a dime into the system.
Obama is best suited to do this.
