Caleb Cushing's Blog Also known as XenoTerraCide

Don't Say "Patches Welcome"

Don’t say “patches welcome” it does more harm to your community than good. Why? It’s a polite way of saying “I don’t care. Fuck you. Fix it yourself. End of discussion”. 1.) Not a Developer The person you are saying this to is not developer. They don’t know how to do it. Period. At this point you are refusing to help them. This person may now have the opinion that your community isn’t helpful.

Teaching Perl - Week 3 - Textual Data

So lastweekyou should have covered variables, conditionals, flow control statements, calling functions, stdin/out/err, and using new perl features.This week we’re covering text processing, scalars, external libraries, and reinforcing what we learned last week. Text Processing is one of Perl’s specialty’s, mostly due to it’s powerful regular expression engine.First install LWP with cpan. cpanp -i Bundle::LWPwill do it.#!/usr/bin/perluse strict;use warnings;use LWP::Simple;getprint(“http://aur.archlinux.org/packages/modern-perl/modern-perl/PKGBUILD");So this is almost completely new… what does it do? and what does it have to do with text?

Teaching Perl - Week 3 - Prelude Commentary

So I think that Head First Programming: A Learner's Guide to Programming Using the Python Languageis a great guideline to teach any programming course, esp a 10 week course as it has 10 chapters. We’re one week behind. Arguably you could merge week 2 into week 1 and I may do just that in a rewrite of this series. In fact I’d suggest you do just that. But for now I’m going to continue on and we’ll see what people think once I reach the end.

Dist::Zilla vs xenoterracide

Yes, I am invincible! I solved my problemwith Dist::Zilla. If you agree with me that you should be able to install from your git repository, without requiring your users to have Dist::Zilla installed here’s one way of doing it.First install Dist::Zilla::Plugin::CopyTo. Now Edit your dist.ini. Most people probably use one of the Dist::Zilla bundles. Assuming you use Basic here’s what you do.; remove GatherDir from basic so we can specify it seperately[@Filter]bundle = @Basicremove = GatherDir; specify the where your ungenerated source lives[GatherDir]root = src; specify where you want the generated source to live[CopyTo]dir = .

My new Love/Hate Relationship with Dist::Zilla

Dist::Zillais a great release tool, code generator, and it just plain takes the boring part of doing a release away from you.That having been said, it does, imo, horrible things to your source repository. “But, Caleb, it cleans up your source repository you can remove a lot of excess stuff you don’t really need to be storing there”. Well… I disagree, to the point that I’ve used every explicative in the book to express my displeasure.

cat that displays tabs at 4 spaces

So in the tabs vs spaces war I’m squarely on the side of use tabs. tabs have meaning. tabs allow people to set there editor’s to whatever space display width their eyes are comfortable with as opposed to what yours are (e.g. you like 2 spaces I like 4). However, I’ve heard the argument what about when you cat the file, etc. Well it is actually a bit annoying… so let’s fix it.

Teaching Perl - Week 2 ( part2 )

This part2 was prompted by Chromatic’s post on state. I’d never heard of state before, and it’s documentation is poor. Let’s take a look at how state could affect our game. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 #!/usr/bin/env perl # guess a number game use strict; use warnings; use feature qw( say state switch ); say 'welcome'; # generate the winning number between 1 and 10 # see perlfaq4 for algorithm details my $winning_num = 1 + int( rand( (10-1)+1 ) ); until ( $winning_num == state $guess ) { say 'Guess a number between 1 and 10: '; $guess = readline(*STDIN); # check to see if we have a winner, or the guess is to high, or low.

Teaching Perl - Week 2

Teaching Perl - Week 1 - ( Part2 )

Teaching Perl - Week 1 - ( Part1 )

Make sure you’ve read Part 0first.As I said before Baker provides a Linux server for the perl class. However, none of the students have had a unix class. So I advise touching on it and giving them a link to these tutorialsif they want to use it, and a helping hand. The book also talks about ActiveState but this isn’t the recommended way to do perl on windows anymore. Avoiding crux will prevent you from wasting a week or more on unix which is not what the class is about (my instructor failed horribly at this, and at knowing unix (or perl for that matter) well enough to cover it).