chapter31

development in a land far far away…

at the moment

History is not what happened. History is what was written down.

Have you ever pasted code you are working on to a colleague over IM or even email for some help or an opinion? Then you would benefit from using pastebin (free service) particularly if you experienced problems with code over IM in the past :(

“Pastebin is a tool for collaborative debugging or editing”

What that means is you can paste any code into a nice big textarea on the pastebin homepage, choose your syntax highlighting (ColdFusion is available!), enter your name and hit send.

Then you are redirected to a URL which you can copy and send to anyone else so that they may view y our code.

The cool thing is that the other person can see your original code, but can also add their own modifications in a separate box for you to see and collaborate on.

You can “save” your code on pastebin for a day, a month or forever which means you can always come back to it later for further review.

One thing to note is that everyone can automatically see your posts from the pastebin homepage, if that’s not your cup of tea you can create a “private” pastebin. This will allow you to have a sub-domain (as long as it’s unique). Example, I could have barry.pastebin.com/ to store all my entries.

* Note: This is NOT password protected, anyone guessing your sub-domain will have full access to your posts. It just means you can view and review posts without the rest of the “noise” of the regular network and have them all stored under a sub-domain container.

More questions can be answered from the help page

Update

It goes without saying that code owners would and should never post sensitive code to a forum such as this as there is no security on the transmission to the server or on access to the site.

There is no mention (that I can see) of copyright on pastebin, treat everything you see and post as public domain.

New FarCry “core” site

June 23rd, 2008

The guys at Daemon have been busy of late. With the conference just barely over I just noticed they’ve found the time to launch a new site at http://www.farcrycore.org/ for all your information needs on the FarCry framework.

Includes documentation, downloads (for the new version 5!) and more, go and take a look and try it out today.

Ok this is a warning to all those who get sent commands to use via IM.

Scenario:

I was helping someone setup their Apache config today, so I copied part of my VirtualHost block to them in an IM client. Then I went to their machine, grabbed the code and pasted it into their .conf file. Then Apache wouldn’t start/restart.

After spending 10 minutes scratching my head and comparing code and files etc…I removed all carriage returns/whitespace from the code and woo hoo! Apache started happily.

Same thing happened to me last week where I put some SQL in an IM window, when the recipient got grabbed the query it wouldn’t run saying there was a parse error. When he removed the whitespace it worked fine.

Moral of the story?

If you are using code sent to you via IM, when you paste it in remove all carriage returns and white space before using it. Then you can re-format it how you want. You just need to make sure there are no sneaky hidden characters in there.

Note: This is for FarCry v3 which is a bit old now but should work for v5 :)

Sometimes when using FarCry I have a need to find an occurance of a page “type” which sits somewhere above where I currently am in the the navigation hierachy.

Say I want to find the “VehicleType” page (which could be Car or Bike etc) above where I am in the navigation hierachy as listed below (when I’m on the “Models” page):

  • Home
    • Vehicles
      • Bike
      • Car
        • Sedans
          • Models
        • Wagons

I want to know whether I’m in the “Car” or “Bike” part of the navigation tree and I want the content object of that page.

There are a couple of ways to do this, using categories (tags) would be one way. Another is to simply look for an occurance of my type (VehicleType) in the tree above the current page you’re on.

The following function will do just that, just pass in the request.navId of the page you’re on (Models), the typename and displayMethod you’re looking for (VehicleType).

For example:

Note that the “nLevel” argument in the function allows you to skip the ancestor nodes you know you’re not interested in such as “Root” and “Home”.

Hope this helps some people.

I’m a lucky member of the teachers credit union, lucky for many reasons but just one of them is that they offer online statements. Meaning you get no correspondence via traditional mail.

They are also donating $1 into the Teachers Environment Fund for each member who signs up for e-statements.

Ask yourself, do you really need all those paper statements every month? I know I don’t, which is why I’m lucky to have a bank which provides an alternative.

Check if your bank offers the same (or any other institution where you get useless monthly letters) and make the change.