Miscellaneous

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:

Programming and caffeine. Productivity vs. Health.

I’m sure this is the last thing most people are thinking about as the deadline for an important project approaches.  Well that’s why I’m thinking about it for you!  I’ll start out with the plain and simple answers.

  • Productivity – YES!
  • Health – Yes, No, and Maybe.

There are three ways to get your caffeine.  Daily, almost every day, and occasionally.  Which one am I for?  Daily.  Here’s why.

  • Caffeine can result in headaches in some people if you “skip” occasionally.  Headaches are not fun.
  • Using caffeine occasionally has other side effects which are negated by drinking it often.  You might get a bigger pick me up that one time, but more bathroom trips isn’t the best thing in the world either.  And besides you shoud want to experience The Brief Chemically Induced Happiness of a Programmer as often as possible.

Positive Side Effects:

  • Improved mood.  **REAL WINNER**
  • Increased alertness.
  • Better contextual memory recall.

Negative Side Effects:

  • Tip of the tongue syndrome.
  • Increase heart rate.  I haven’t seen this to be a big deal unless you have medical problems. (Bad heart, High blood pressure, etc.)  However, I would not recommend exercising while using caffeine. An extra 20-30 bpm added on to 160 during high intensity training is not healthy for most people.  There are, of course, the extremists who scream caffeine is liquid stress.  He even takes it one step further by implying that if you drink coffee, you are supporting child slavery…
  • Caffeine isn’t for everyone, and there are side effects depending on your genes.  Most of the world has built up a great tolerance for caffeine.

These effects are also very temporary, but the positive mood that gets the ball rolling is NOT temporary.

Ok, you want caffeine, you’re addicted to caffeine, and you want it now and don’t care how.  Just stop right there.

People today should care a little bit more about what they put in there body and pop is evil. Diet soda isn’t much better for several reasons.  The only reason to drink diet soda instead of real thing is it doesn’t make you fat.  WRONG, Diet Soda Makes you Fat! When I eat something sweet and sugary I don’t want my brain thinking I just ate 0 calories.

Personally I recommend either coffee (black for me), or tea (Earl Grey for me).  In fact, luminosity recommends coffee or tea as part of the regular diet.  Go ahead, take the brain grade test and see if it recommends it for you.  (I wasn’t drinking coffee or tea at the time.)  However, it doesn’t say one way the other about caffeine, because its benefits are more then debatable.

I’m for caffeine, how about you?

Be the first to comment - What do you think?  Posted by Derek Litz - July 22, 2010 at 2:30 pm

Categories: Miscellaneous   Tags:

Are Software Developers Bad Communicators?

No, no, no and NO! Maybe there’s an expert programmer in the corner of some software shop who does a very specific task and has done it for years.  In fact this guy probably doesn’t do anything but nobody is the wiser.  That guy probably doesn’t communicate well.  But, that guy is not a software developer.

A software developer has to take some of the most technically complex systems and communicate them in ways average people understand.  A software developer has to:

  • Translate business needs into software requirements.
  • Constantly educate those who make business decisions so they have a realistic idea of what is possible, while keeping it understandable.
  • Read minds of people who do not communicate perfectly and come up with good approximations to work off of.
  • Write detailed documentation.
  • Write detailed comments of difficult to understand parts of working code.
  • Come up with good naming schemes to write self documenting code.
  • Create diagrams, charts, paper prototypes, etc etc… need I go on?

In fact, almost all of what we do is communicating things so that other people can understand (usually our future selves).

Code that cannot be understood is worthless, and we are writing in languages that don’t express what they are trying to accomplish without a serious amount of effort.  In fact nearly half of my education was spent looking at ways to bridge this gap.  YES, over half my college education was spent on communication strategies.

As a developer, who doesn’t like an enthusiastic customer who’s willing to communicate their ideas and participate in the evolution of there software?  We are constantly looking for better ways to understand the needs of the target audience for the software we are developing.  In fact, as developers we go above and beyond and use our skills to get a sort of direct, mind to mind communication from consumers by developing tools to track their actual behavior.  And we listen.

Every non-trivial project I’ve worked on involved a huge amount of communication, and the better the communication, the less work the project seemed to be.  No true businessman is going to tell a developer to go do what he does without first being able to understand what-in-the-hell he is doing.  There are no black boxes when a company’s reputation is at stake.  They’ve got to understand or there is no way we’re going to convince them that what we are developing will be a good investment.

HOW CAN SOMEONE SAY SOFTWARE DEVELOPERS DO NOT HAVE GOOD COMMUNICATION SKILLS? Well, someone did, and that man is Andrea Di Maio and we’re pissed off.

Here is a summary of some of the ridiculous things being said right now:

  • “Perhaps they can develop some program to help them master communication.”
  • “Good programmers are often shy, self centered, geeky. I can’t see how they could be particularly skilled to communicate complex political platforms.”
  • “Politicians need to be able to balance positions, seek compromise, communicate effectively, being transparent but up to a point, not taking sides too strongly while being passionate about certain topics on their constituents’ behalf.” (Assuming we can’t)
  • “Developers would be better communicators? This is quite laughable.”

Below is a petition you can sign or leave a comment on his blog.  Thank you.

Jim Gilliam July 21, 2010 at 9:53 am

If you find Andrew’s bigoted mocking of developers tiresome and counterproductive, you can sign this Twitter petition:

http://act.ly/27f

1 comment - What do you think?  Posted by Derek Litz - at 12:42 am

Categories: Miscellaneous   Tags:

Best Grammar Checker

Well today I decided it’d be fun to do a little honing of my typing skills, which in turn sent me wildly out of control a path I could not have foreseen.

Today it went something like this.

www.typeracer.com -> a book -> www.geraldmweinberg.com -> weinbergonwriting.blogspot.com -> www.ninc.com/blog/index.php/archives/meet-dean-wesley-smith -> quest to disable all automatic grammar checking -> quest to find the best grammar checker.

The first quest was easy.  In Firefox its in preferences->advanced->check my spelling as I type.  Then you can just right-click to active the spell checking.  Why would you want to do this? Well Dean Wesley Smith has it off because it is simply, “Too disruptive on the creative flow.”, and he seems to know something about writing efficiently.

It boils down to these three steps when writing.

  1. Creative writing.  Let the information flow!
  2. Spell Checker, Grammar Checker, Proofread.  Yes by hand. I’ll get more into to that later.
  3. Have someone else read your work.  (If its important.  I’m gonna skip this step for this blog post).

Now, I simply didn’t stop here, I had my second quest, to find the best grammar checker.  Firefox only has a built-in spelling checker, while Safari has a built-in grammar and spelling checker.  Certainly there had to be a plug-in!

Despite the mixed reviews I ended up going with After the Deadline out of the two grammar checkers available because it seemed like it was their specialty and the idea is great.  When it finds a grammatical error it doesn’t just fix it, it tells you why it did so and teaches you little something.  AWESOME.  Except it doesn’t work… at least not very well.  In fact, I’m attempting to use it as I write and it simply isn’t working.  So I won’t be able to show you their awesome idea, but I think you get it.  They do also offer a WordPress plugin, which I’ll try some other time.

Anyways, I also looked at several other grammar checkers testing them with a tough sentence I came up with, only to find none of them fixed it how I would fix it.  Some did better than others.

The sentence: Tis is the stuff I luv abut yous I like you. I really would, like this, too works good.

  • Built-in browser (Safaria, Firefox).  Ok…
  • Microsoft Word.  Pretty good.
  • But the winner is!  WhiteSmoke.  This one did very well.

However, after looking at their video I noticed something not quite right.  She sent her manuscript to a big NY publishing house, but it rejected it. I felt it should be: She sent her manuscript to a big NY publishing house, but they rejected it. Now, it wasn’t enough that I felt it should be they, I had to prove it to myself.  At first I was in a dilemma, I could only find references that said to use singular pronouns to refer to singular nouns…  until this!

If we refer to the individuals that compose that unit, we use a plural pronoun.
My family is very warm and supporting. I love them all.

Read more…

Be the first to comment - What do you think?  Posted by Derek Litz - July 21, 2010 at 11:37 pm

Categories: Miscellaneous   Tags:

Hello world!

Goodbye, cruel world.

1 comment - What do you think?  Posted by Derek Litz - at 3:54 am

Categories: Miscellaneous   Tags: