Showing posts with label WTF. Show all posts
Showing posts with label WTF. Show all posts

Wednesday, March 11, 2015

WTF Wednesday

Guess why I find this song particularly relevant. Go ahead, I'll wait.

Wednesday, September 10, 2014

What year is it?

I may have had too much to drink, but I think I just saw the prez on the TV machine telling me we really need to bomb some brown people across the ocean. I thought we already tried that, but I must be misremembering things -- our beloved political/media class couldn't possibly be feeding us another line of shit, right?

Sunday, March 10, 2013

For Substance

That righteous Substance McGravitas recently posted one way to handle messing with some text files. There are easier ways to go about it, and I am a helpful beer snob:

Sample file contents:


% cat pissoff.list 
fuck you
you fucking wanker
go fuck yourself
% 

% cat wanker.list 
useless git
bollocks
bloody hell
%

What Substance wants to do is take those input files and wrap them in some simple XML. PERL is perfect for this job. Here's a quickly whipped up program to do so:


#!/usr/bin/perl

if ($#ARGV < 0) {
    print STDERR "\nUsage: abuse [files...]\n\n";
    print STDERR "I know you came here for abuse,";
    print STDERR " but you still need files as arguments.\n";
    print STDERR "Output goes to STDOUT, you probably "
    print STDERR "want to redirect it somewhere\n\n";
    exit(1);
}

print "<XML>\n";

foreach $file (@ARGV) {
    if (-r $file) {
 open(FILE, "$file");
 @lines = <FILE>;

 foreach $line (@lines) {
     chomp($line);
     print "<words>\n\t<data>$line</data>\n</words>\n";
 }
 close(FILE);
    } else {
 print STDERR "Can't read $file -- skipped\n";
    }
}

print "</XML>\n";

Save that as a file called something (in my case I saved it as "abuse" -- just 'cause). Make it executable:


%chmod 755 abuse

Now run it with our two files:


% ./abuse pissoff.list wanker.list 
<XML>
<words>
 <data>fuck you</data>
</words>
<words>
 <data>you fucking wanker</data>
</words>
<words>
 <data>go fuck yourself</data>
</words>
<words>
 <data>useless git</data>
</words>
<words>
 <data>bollocks</data>
</words>
<words>
 <data>bloody hell</data>
</words>
</XML>


To store the output in a file, simply redirect the output somewhere using standard shell redirection:


% ./abuse pissoff.list wanker.list > fuckyou.xml

It took me twice as long to write this post than it did to write the code. PERL is a damn handy thing to have around.

Thursday, September 13, 2012

Random idiocy

This craigslist post is fucking hilarious. I've saved a screenshot for posterity:

"Oh noes! I cut a hole in my gas tank and (surprise!) gas came out! Now what do I do?"

The only way this could be better is if they'd managed to catch themselves on fire during the process.

Also: look, a blahg post! Yay me.

Wednesday, June 20, 2012

Technology

Hehehe, I just got this in my inbox from an Apple rep (I use lots of Apple stuff, so this isn't to bash them):

Technology makes this a magical time to be a student. And a powerful time to be an educator. The Apple Learning Tour is an opportunity to experience how you can transform learning with innovative new tools for creating, curating, and deploying content.

Due to a technical issue with our registration system, we are currently not able to accept registrations via our website.

Register today by sending an email to...

Emphasis mine. Perhaps fixing your issue might give educators a bit more confidence in this innovative new technology, eh?

Thursday, December 15, 2011

What the fuck, Ron?

I'm normally quite supportive of Oregon's Senators, but this is just fucking ridiculous.

Brilliant plan there Ron, jump into bed with the biggest Ayn Rand freakizoid in the Republican party to "help fix" a popular social safety net program. You know, the safety net program that Randians hate with a burning passion and would do anything to destroy. I'm sure that'll turn out just fine. Gah!

I really, really hope there's some unseen cunning plan of Wyden's that I'm just not seeing, but I don't think there is.

Fuck.