Archive for: February, 2009

Using Python to replace spaces with underscores in filenames.

Feb 25 2009 Published by under Python

Python can be used on Window, Linux and Mac. It just a simple install.

download code

#!/usr/bin/python

import string
import os
import re

# task:
# loop thur input directory
# look for .pdf
# replace space with underscore
# rename/move to output directory

inputDir = "./" # Current directory
outputDir = "./new_location"

for filename in os.listdir(inputDir):
    if filename[-4:] == ".pdf":
        tempName = filename
        tempName = tempName.replace(' ', '_')
        os.rename(inputDir + "/" + filename, outputDir + "/" + tempName)

One response so far

Microsoft Certified Professional Developer (MCPD)

Feb 24 2009 Published by under Coding

How to earn your MCPD certification on Visual Studio 2008

Each MCPD certification on Visual Studio 2008 requires that you pass two to four Microsoft Certified Technology Specialist (MCTS) prerequisite exams and one Professional Series exam, as shown in the following table. When you pass all the exams in a specific MCPD path, you earn the related MCTS certifications as well as the relevant MCPD certification.

I will be focusing on this particular track: MCPD: ASP.NET Developer 3.5 so I’ll need to pass the following exams: 70-536, 70-562 and 70-564.

Exam 70-536: Microsoft® .NET Framework 2.0 Foundation

Just purchased a book to pass Exam 70-536.

MCTS Self-Paced Training Kit

MCTS Self-Paced Training Kit

Exam 70-562: TS: Microsoft .NET Framework 3.5, ASP.NET Application Development

Exam 70-564: PRO: Designing and Developing ASP.NET Applications Using Microsoft .NET Framework 3.5

No responses yet

Sony PRS505SC Over Amazon’s Kindle

Feb 23 2009 Published by under Chatter

No responses yet

Displaying Child Page Links in A Template

Feb 22 2009 Published by under PHP, Wordpress



			

ID . '&echo=0'); if ($children) { ?>
', '

'); ?>

No responses yet

Linux and Apache commands

Feb 16 2009 Published by under Linux

Here are some commands that we use at the Gazette on our Linux web server.  It is running Red Hat Enterprise Linux 5.2.

Reload Apache Conf file
/etc/init.d/httpd reload

Restart Apache
apachectl -k graceful (didn’t work on Rackspace)

Restart Apache from ssh
/etc/rc.d/init.d/httpd restart

Modify Apache conf file
vi /etc/httpd/conf/httpd.conf

vi commands
i enter edit mode
esc to exit edit mode (command mode)
:wq to write changes and quit (in command mode)
:!q quit without saving

Memory Use

free -t -m

No responses yet

Friday the 13th 404 Error

Feb 13 2009 Published by under Wordpress

Friday the 13th after work panic call. Three sites had 404 error pages on their homepages. A quick Google search for this WordPress post

PROBLEM: My wordpress homepage (www.satvatovecommunity.com) displays the “Page not found (404)” error. This error is there no matter what I set my homepage to display (either latest posts or any static page).

I found out that one of my plug-ins “redirection” was causing the problem.

No responses yet

Deprecated innerHTML

Feb 05 2009 Published by under JavaScript

This is a JavaScript example of how to use the createTextNode instead of the deprecated innerHTML. There is also an example of how to use the removeChild function if the node you want to add to has child nodes.



No responses yet