Blessed are the flexabil, for they cannot be bent out of shape.

-- Michael McGriffy, M.D. Sent from my iPhone

Posted

How to find the most resent files in a directory with ruby

I had to find some files for processing and wanted to find the latest file by modification date. So here is what I came up with:

Dir.entries(".").sort_by { |f| File.file?(f) ? File.mtime(f) : Time.mktime(0) }.reverse[0..9]

Explanation:

Dir.entries(".")

grab the entries in the current directory

.sort_by

pass the entries into the block for sorting

File.file?(?) ?

the condition entry for finding out if the entry is a file

F.mtime(f) :

if the condition returns true, sort by modification time

Time.mktime(0)

if the condition is false, use the mktime(0)

.reverse[0..1]

reverse the list and show 0 to 1 entries

Posted

(download)

Sent from my iPhone

Posted

Contents of my portable USB hard drive

I have started to invest some time and attention to making my programming and development area to be portable for any word that involves the Windows environment. Over the months, I have built up a nice collection of the applications that have been useful to my job and have really been handy in tough spots. So here is a list of the applications I use:

 

  1. 2xClient (remote desktop for windows)
  2. 7-Zip (much faster than regular zip)
  3. ActiveStateKomodoEdit (fantastic editor for ruby on rails)
  4. Aptana Studio (good editor for ruby on rails, but not used often)
  5. Audactiy (audio editor)
  6. FileZilla (FTP client)
  7. FireFox
  8. FreeCommander (kind of like midnight commander, but for windows)
  9. GIMP (image editor)
  10. gVim (slim text editor)
  11. InfraRecorder (burning software)
  12. KeePass (for all my passwords)
  13. Lightscreen (very nice screen capturing software with some nice bells)
  14. PuTTY (tty client for ssh and serial connections)
  15. TeamViewer (really nice remote desktop application and very easy to setup with another person)
  16. ThunderBird
  17. UnetBootin (usb boot manager)
  18. WinDirStat (find those big files)
  19. winMd5Sum (check the file integrity when transferring stuff)
  20. WinMerge (diff file and directory utility)
  21. WinSCP (ssh copy)
  22. WinWGet (wget for windows)

Filed under  //  tech  
Posted

Webtrends 8.0 software and Campaigns

These are my notes for using campaigns with WebTrends 8.0a.

Overview

When sending out emails, announcements about your content and you want to track the success and use of a link, your best bet is to use campaigns.

Stuff to Know

Some stuff to know when tracking links:

  1. the campaign name should be safe to use within a browser (eg. replace spaces with %20)
  2. http://yourdomain.com/page&wt.mc_id=[alpha-numeric or campaign name]
  3. If you want to edit the campaigns manuall: C:\Program Files\WebTrends\storage\config\wtm_wtx\datfiles\datasources

The campaigns file always should have:

  1. hard character returns (msdos)
  2. 1 blank line at the end
  3. always the same number of columns for every line

List of columns in the campaigns file

  1. CampaignID, identifcation number
  2. Description, what the entry is for
  3. Creative, name of method
  4. Creative Type, print/email/banner
  5. Demand Channel,
  6. Marketing Activity,
  7. Marketing Program,
  8. Offer,
  9. Partner,
  10. Placement

 

 

Posted