Archive for August, 2010

What makes Perl great?

I really do think Perl is great, the community is great, and Larry Wall has planted the seed for an awesome community that won’t be going away.  However, I will first present the dark side of Perl, especially for the beginner (like myself).

If you have done some shell scripting, C, C++, and Java and want a powerful scripting language to add to your arsenal, or have a quick project you want to implement, Perl is NOT that language. Why? Well based on personal experience…  but what initially made me make this decision was this article: http://www.artima.com/intv/aboutmeP.html.  From the article…

They say you can hold seven plus or minus two pieces of information in your mind. I can’t remember how to open files in Java. I’ve written chapters on it. I’ve done it a bunch of times, but it’s too many steps. And when I actually analyze it, I realize these are just silly design decisions that they made. Even if they insisted on using the Decorator pattern in java.io, they should have had a convenience constructor for opening files simply. Because we open files all the time, but nobody can remember how. It is too much information to hold in your mind. –  Bruce Eckel

Other things include, the mindset of Python to make the programmers life easier and the command line interpreter.  That thing is great!!  Everything is just easy.  From personal experience I was able to pick things up almost instantly and apply python idioms.  Also, OO programming is fully functional, and this gives python a huge win over Perl for me.  Also, thought arguable, Python produces more readable code and conventions are few and simple to follow as it is quite structured to begin with.

Of course, by now you are saying,  “I thought this was a blog post about Perl!??!?!.”

perl-ha-ha-ha-python

Yes, it is.  I am a beginner and this is from a beginner point of view on both Python and Perl.  What do I love about Perl so far?

  • Context Sensitive programming.  This is an awesome concept.  One that takes place often in spoken languages, but not typically present in programming languages.  This is also a downside, because it’s harder to understand what is going on, but as people learn a language it gives them room to improve where in some other languages you’ll reach peak performance quickly and not have much room for improvement in productivity because of the rigid standards imposed upon you.  (EVEN FOR SIMPLE TEST/PROTOTYPE PROGRAMS).
  • CPAN, CPAN, CPAN, and CPAN. CPAN and Perl are basically synonymous.  Anyone who has used Perl for a day will discover CPAN.  Of course, other languages have something similiar, but nothing is beating this defacto standard to my knowledge.  In fact, after doing a very small amount of research… all I see is complaints because no one can implement a fricken package manager for their language when they’ve had CPAN staring in their face for years.
  • Perl regular expressions are top of the line.  To my knowledge they can’t be beat.  Though… I have yet to need such power.
  • Perl makes reading code easier once you know it.  Yes, I said that…  and I may be wrong and I may take it back.  But the way I see it all those symbols look like giberesh because YOU CAN”T READ.   Once you learn it all those distiguishing symbosl will make things easier to read where other languages are hard to decifer because things do not look different in different contexts…
  • Perl 6.  This is an awesome community to be a part of and Perl  6 looks exciting.

I am not a one language guy.  I plan on going to deeper into several other languages and once I have the insight I will share more in depth arguments, but for now, the way I see it:  use python if you want to get something done and don’t have the time to learn intricacies, but if you want something that will have long term value in many environments, perl is a great choice, and is hands down the best community that I see out there right now.  C, C++, and Java are there, and you should know about them, but I’m more and more leaning towards avoiding them as much as I can until I have to use them.  The situation where we “have” to do this is quickly declining.

I will add a link here to a future article I want to write on an overview of tools and setting up your environment using VIM.

Be the first to comment - What do you think?  Posted by Derek Litz - August 10, 2010 at 1:27 am

Categories: Miscellaneous   Tags:

Connecting to a shared printer on a Mac using CUPS from Linux using Backtrack 4 running KDE.

The title says it all.  Being able to print through the wireless network I have at home was no straightforward task… but this guide should make it seem pretty strait forward!

This guide isn’t just for someone with the exact same situations as it should help you get started on the right track with a similar scenario, but it is not intended to be a generic guide for setting up shared printing.

Macintosh computers seem to set up shared printing using CUPS, at least that’s how my network was set up without doing anything special.  Now, the computer in my household that is hosting the printer I don’t have access to, but I needed to know a couple important details to set up printing.  Namely the Queue Name and Network Address of the computer hosting the printer.

Luckily backtrack 4 comes with a handy little utility called AutoScan Network.  I simply started this up and the computer I needed to connect to came up after waiting a little bit.  I thought it would do this.  It turned out to be even better though.  In the summary tab you should see ipp and when you click on that you should see a firefox box.  This will pull up the CUPS server in your browser and the URI should look something like this http://<Network Address>::631/.  Now you should have a nice UI and be able to to navigate to printers then to the printer you want to print from.  You final address should look like http://<Network Address>:631/printers/<Queue Name>.

Yay, now we’re done right?  Nope.  Turns out this information was the easy part for me… I spent the next hour or so trying to figure out how to connect KDE to it…

Go to Control Center->Peripherals->Printers. You now want to change your current print system to CUPS.  Problem is this gave me an error…

What finally enabled me to start CUPS was the following two commands.

  • apt-get install –reinstall ssl-cert
  • /etc/init.d/cups start

I had tried several times to get the server to start earlier without running the first command only to receive the following message:

Starting Common Unix Printing System: cupsdcupsd: Child exited with status 1!
failed!

After all of this FINALLY I went back to the Printers – Control Center and clicked the magic wand in the upper left then Add Printer/Class… next choose Network Printer w/IPP (IPP/HTTP).  Enter the full URI you found above, then click next.. Check Raw Printer, then click next.  Test it to see if it works and the rest is self explanatory.

Good Luck!

http://www.hackforums.net/showthread.php?tid=293493

Be the first to comment - What do you think?  Posted by Derek Litz - at 12:06 am

Categories: Miscellaneous   Tags: