Perl for dummies

Vote This Post DownVote This Post Up (No Ratings Yet)
Loading ... Loading ...

In the hours of the early morning here at work i enjoy the silence. It allows my mind to unravel the craziness of the previous day and take quiet walks around the office space. Recently i have been noting the books that people have on their shelves, and its odd - many people have the O’Reilly Programming Perl novel sitting up on their desks/bookshelves here. I say this is odd because so many people dont know a god damned thing about perl or have a barely functional knowledge of how it works or how to code in it.

One such example is pertaining to a failed attempt to be a software developer. An application with a “Template engine” that is controlled by the function you run previously. This is one aspect of this application that should let you all know how complicated this has been devised. I am convinced that i could simplify the code base considerably, given the freedom to do so, but alas - i cannot.

Its odd that people purchase or borrow or share books when they are not willing to actually read them. There are a number of very interesting and necessary tidbits that sit just below the surface of Perl that are more than useful; that are more than powerful; that are able to correct code that you have just spent four hours working on instead of reading four hours yesterday. It’s called a Map. Use it.

Posted on August 2nd, 2008 by Bob in Application Development, Web Development

Languages Span!

Vote This Post DownVote This Post Up (No Ratings Yet)
Loading ... Loading ...

I have often been caught in the cross fire of the ongoing and awfully brutal and emotional language wars. I am a C programmer by choice and a PHP/Perl Developer by trade, so I get some of the most heated and misfortunate of the angry or emotionally charged responses from people who just do not know a god damned thing about what they are talking about. Scarier is when I hear absurdities from people who actually do know something about their topic. For some reason they want to stick their toes into my pool and do not like the temperature of the water so they go into a tirade about how I should change the color of the water with some dye and install a heater, oh and the chlorine content is too low or too high and algae will form; who knows, maybe you should add this algae snake as well to keep it from getting to the bottom! I apologize for the extended analogy here but it stands. It is important that Comp Sci. and Developers alike learn at least one thing about languages before they enter the market and end up coding themselves into a corner – There is no such thing as a language level, Languages Span!

Read the rest of this entry »

Posted on July 25th, 2008 by Bob in Application Development, Game Development, Inspiration, Web Development

Code Example #5 - WinGrepReplace

Vote This Post DownVote This Post Up (No Ratings Yet)
Loading ... Loading ...

In the day to day happenings of web development many of us get into binds and have problems getting out of them. Yesterday a good friend of mine came to me with a huge problem. Her website of more than 700 files needed to have certain entries replaced and the amount of time it would take to go through them all and replace the lines individually was not worth the effort. Thankfully she knows that i dont do anything that difficult by hand, i invent something to do the work for me and give my computer a smack on the butt and just wait for the results.

Here is the Perl code to do just that:

#!/usr/bin/perl -w
################################################################################
# WinGrepReplace
#
# Replace a given line in all files in a directory of files.
################################################################################
 
use File::Find;
use File::Copy;
 
die "Usage: $0 directory find [replace]"if (@ARGV > 3 || @ARGV < 2 ||
!-e $ARGV[0] || length $ARGV[1] == 0);
 
our ($dir, $find, $replace) = @ARGV;
 
find(\&func, $dir);
 
sub func
{
   return if !stat || -d;
 
   open(FILE, "<$_");
   open(FILEO, ">$_.new");
 
   while (($line = ))
   {
       $line =~ s/$find/$replace/i if ($line =~ m/$find/i);
       print FILEO $line;
   }
 
   close FILE;
   close FILEO;
 
   move("$_.new", $_);
}

Although there are a couple of hacks and vulnerabilities in this block, it gets the job done nicely.

Posted on July 17th, 2008 by Bob in Random, Web Development

this past weekend was quite an exciting one

Vote This Post DownVote This Post Up (No Ratings Yet)
Loading ... Loading ...

this past weekend was quite an exciting one

Today is my dad’s birthday, I saw some friends I had been neglecting for far too long, and I kick started work on OMS. For those of you who are new to Gneu and our delusions of grandeur I’m sure this would come as a bit of a shock, but we intend to make a game. Not just any game, mind you, but one that is not made for everyone. It is going to be tailored to the concept of emulation of reality. We have quite a few notes about our goals up on the wiki, and I have another 12 paragraphs to add in the coming weeks. Some important links are at the end of this article.

Read the rest of this entry »

Posted on January 29th, 2008 by Bob in Game Development

Crypt::SSLeay Install on windows

Vote This Post DownVote This Post Up (No Ratings Yet)
Loading ... Loading ...
ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd

Perl on windows doesn’t have access to https links by default. This install will let you.

Posted on January 25th, 2008 by Bob in Random

Downtime? Lets get jiggy with it.

Vote This Post DownVote This Post Up (No Ratings Yet)
Loading ... Loading ...

Oh how i love shared hosting.

Hello,

I have performed a security audit of the server that your account is hosted on. Another user on the server had his/her account compromised. The attacker ran several perl based IRC bots and DDoS scripts which were using a considerable amount of bandwidth. I have secured this account and removed these malicious perl scripts. Your site’s load time has improved considerably. Please let us know if you have any more questions or concerns regarding this issue.

Regards,
-Charlie S.
Surpass Hosting Abuse Team

Posted on January 21st, 2008 by Bob in Gneu Website

Changes are in the wind…

Vote This Post DownVote This Post Up (No Ratings Yet)
Loading ... Loading ...

school has begun, and this winter quarter I am expanding my math as usual, but also undertaking something I am not quite sure why I dreaded. Java is being added to my arsenal and as with the other languages I have developed I plan to release whatever applications I create. I have only been in class a couple days but I really doubt it will provide me with much of a challenge to be able to cause me the hours of frustration that I spent in the computer lab with my introductory courses.

I have also begun working on my UT3 Packaging utility…

Read the rest of this entry »

Posted on January 9th, 2008 by Bob in Application Development, Game Development, Gneu Website

Revenge UT3 Mutator

Vote This Post DownVote This Post Up (No Ratings Yet)
Loading ... Loading ...

Another mutator down.

This mutator is quite simple actually. When you kill someone who has killed you, it has been arranged for you to be repaid, properly. Consult the following chart for details about the payment structure:

# Killed Reward for killing
1 Invisibility
2 UDamage
3 Berserk
4 Redeemer
>4 Invulnerability

All of the timed rewards are able to have their duration tweaked in the ini on a per server basis.

Feature List:

  • Reward players when they kill someone who has killed you.
  • Configurable Duration for timed rewards

ToDo:

  • Rework mutator to allow full configuration of rewards

  UT3 Revenge Mutator (4.2 KiB, 58 hits)


Code on SVN

Update Change Log:

  • 1.0
    • Initial Release
    • Tested over network.

Posted on January 3rd, 2008 by Bob in Random