We provide expertise in Teamsite and OpenDeploy services, perl, ruby on rails, php, Drupal, MYSQL, Oracle, XML, XSLT, LINUX, UNIX and services in most other current technologies. Your satisfaction is our sole objective, we know that referrals are our life blood. Successful business means addressing our customer's needs and pain points. Addressing your business pain points and critical needs is our number one priority. Service offerings include: creating websites, automating painful processes, data migrations, data parsing, web services, system administration.

Drupal Calendar View not working and month of November wont show up

http://drupal.org/node/591382

"I found by trial and error that setting my server to the local timezone (I am trapped in PHP 5.1) and then default PHP Timezone = TRUE in Date4 makes this go away."

"I suspect that the problem is mostly with PHP.
If possible, the best option is to upgrade your PHP to 5.2.x. I am having good luck with 5.2.9 right now.

If you cannot upgrade your PHP version, you should enable the Date PHP4 module. This module is required for PHP versions less than 5.2. From the Date documentation:

Date PHP4: Emulate PHP 5.2 date functions in PHP 4.x, PHP 5.0, and PHP 5.1. Required when using the Date API with PHP versions less than PHP 5.2."

Creating Regions (blocks)

Regions available are in the .info file of your sites theme. To create a new region add it to .info (for intance add: regions[content_top] = Content Top) and then in page.tpl.php you would add

<?php print $content_top; ?>

in the location you would like the region to be. See page 408 of the Oreily Drupal Book for more information.

The different template (tpl) files in Drupal

page.tpl.php: controls the layout of the entire page. The overalll screen in which your content types and blocks are laid out

node.tpl.php: used to control the look of each node

block.tpl.php: for control over the look of blocks

page-front.tpl.php: to control the look of just the home page of the site

node-nodetype.tpl.php to affect just one node content type. nodetype names can be found in the type column of the content types list page at administer->content management->content types.... copy node.tpl.php and rename it to node-story.tpl.php for instance and then code away.

Theme developer module (part of the devel module in drupal 6)

For help in theming install the Theme developer module. http://drupal.org/project/devel_themer

For Drupal 6, this module was part of the Devel project. For Drupal 7, it is its own project, but relies on the Devel module as a dependency.

Click on any element to see information about the Drupal theme function or template that made it. Page 400 of Using Drupal, by O'REILLY

PHPTemplate and printing out available variables for Drupal

List of available varialbles in Drupal 6, 7: http://api.drupal.org/api/drupal/modules--system--page.tpl.php
http://drupal.org/phptemplate
Excerpt from this link:

Print the variables array

<?php
print '<pre>';
print_r(get_defined_vars());
print '</pre>';
?>

Print the variables array with the HTML markup

<?php
print '<pre>';
print htmlspecialchars(print_r(get_defined_vars(), TRUE), ENT_QUOTES);
print '</pre>';
?>

perl file checks, to see if exists, the age, if directory, etc

http://www.devshed.com/c/a/Perl/File-Tests-in-Perl/

File Tests in Perl 
( Page 1 of 6 )

In this article, you will learn how to find out useful information about files in Perl. It is excerpted from chapter 11 of the book Learning Perl, Fourth Edition, written by Randal L. Schwartz, Tom Phoenix and brian d foy (O'Reilly; ISBN: 0596101058). Copyright © 2006 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.
Earlier, we showed how to open a filehandle for output. Normally, that will create a new file, wiping out any existing file with the same name. Perhaps you want to check that there isn’t a file by that name. Perhaps you need to know how old a given file is. Or perhaps you want to go through a list of files to find which ones are larger than a certain number of bytes and not accessed for a certain amount of time. Perl has a complete set of tests you can use to find information about files.

File Test Operators
Before we start a program that creates a new file, let’s make sure the file doesn’t already exist so that we don’t accidentally overwrite a vital spreadsheet data file or that important birthday calendar. For this, we use the -e file test, testing a filename for existence:

  die "Oops! A file called '$filename' already exists.\n"
    if -e $filename;

We didn’t include $! in this die message since we’re not reporting that the system refused a request in this case. Here’s an example of checking if a file is being kept up to date. In this case, we’re testing an already opened filehandle instead of a string file name. Let’s say that our program’s configuration file should be updated every week or two. (Maybe it’s checking for computer viruses.) If the file hasn’t been modified in the past 28 days, then something is wrong:

  warn "Config file is looking pretty old!\n "
    if -M CONFIG > 28;

The third example is more complex. Let’s say disk space is filling up; rather than buy more disks, we’ve decided to move any large, useless files to the backup tapes. So let’s go through our list of files* to see which of them are larger than 100 KB. But even if a file is large, we shouldn’t move it to the backup tapes unless it hasn’t been accessed in the last 90 days (so we know it’s not used too often):†

  my @original_files = qw/ fred barney betty wilma pebbles dino bamm-bamm /;
  my @big_old_files; # The ones we want to put on backup tapes
  foreach my $filename (@original_files) {
    push @big_old_files, $filename
      if -s $filename > 100_000 and -A $filename > 90;
  }

This is the first time that you’ve seen it, so maybe you noticed that the control vari able of the foreach loop is a my variable. That declares it to have the scope of the loop, so this example should work under use strict . Without the my keyword, this would be using the global $filename .

The file tests look like a hyphen and a letter, which is the name of the test, followed by a filename or a filehandle to test. Many of them return a true/false value, but several give something more interesting. See Table 11-1 for the complete list and read the following discussion to learn more about the special cases.

Table 11-1.  File tests and their meanings

File test	Meaning
-r	File or directory is readable by this (effective) user or group
-w	File or directory is writable by this (effective) user or group
-x	File or directory is executable by this (effective) user or group
-o	File or directory is owned by this (effective) user
-R	File or directory is readable by this real user or group
-W	File or directory is writable by this real user or group
-X	File or directory is executable by this real user or group
-O	File or directory is owned by this real user
-e	File or directory name exists
-z	File exists and has zero size (always false for directories)
-s	File or directory exists and has nonzero size (the value is the size in bytes)
-f	Entry is a plain file
-d	Entry is a directory
-l	Entry is a symbolic link
-S	Entry is a socket
File Test Operators
Table 11-1.  File tests and their meanings (continued)

File test	Meaning
-p	Entry is a named pipe (a “fifo”)
-b	Entry is a block-special file (like a mountable disk)
-c	Entry is a character-special file (like an I/O device)
-u	File or directory is setuid
-g	File or directory is setgid
-k	File or directory has the sticky bit set
-t	The filehandle is a TTY (as reported by the isatty() system function; filenames can’t be tested by this test)
-T	File looks like a “text” file
-B	File looks like a “binary” file
-M	Modification age (measured in days)
-A	Access age (measured in days)
-C	Inode-modification age (measured in days) 

The tests -r, -w, -x , and -o tell if the given attribute is true for the effective user or group ID,* which essentially refers to the person who is in charge of running the program.† These tests look at the permission bits on the file to see what is permitted. If your system uses Access Control Lists (ACLs), the tests will use those as well. These tests generally tell if the system would try to permit something, but it doesn’t mean that it really would be possible. For example, -w may be true for a file on a CD-ROM, though you can’t write to it, or -x may be true on an empty file, which can’t truly be executed.

The -s test does return true if the file is non-empty, but it’s a special kind of true. It’s the length of the file, measured in bytes, which evaluates as true for a nonzero number.

A Unix filesystem‡ has seven types of items, represented by the seven file tests -f , -d , -l , -S , -p , -b , and -c . Any item should be one of those. If you have a symbolic link pointing to a file, that will report true for -f and -l . So if you want to know whether something is a symbolic link, you should generally test that first. (You’ll learn more about symbolic links in Chapter 12.)

The age tests, -M , -A , and -C (yes, they’re uppercase) return the number of days since the file was last modified, accessed, or had its inode changed.* (The inode contains all of the information about the file except for its contents. See the stat system call manpage or a good book on Unix internals for details.) This age value is a full floating-point number, so you might get a value of 2.00001 if a file were modified two days and one second ago. These “days” aren’t necessarily the same as a human would count. For example, if it’s 1:30 A.M. when you check a file modified at about an hour before midnight, the value of -M for this file would be around 0.1 , even though it was modified “yesterday.”

When checking the age of a file, you might get a negative value like -1.2 , which means that the file’s last access timestamp is set at about thirty hours in the future. The zero point on this timescale is the moment your program started running,† so that value might mean a long-running program was looking at a file that had just been accessed. Or a timestamp could be set (accidentally or intentionally) to a time in the future.

The tests -T and -B determine if a file is text or binary. But people who know a lot about filesystems know there’s no bit (at least in Unix-like operating systems) to indicate that a file is a binary or text file, so how can Perl tell? The answer is that Perl cheats: it opens the file, looks at the first few thousand bytes, and makes an educated guess. If it sees a lot of null bytes, unusual control characters, and bytes with the high bit set, then that looks like a binary file. If there’s not much weird stuff, then it looks like text. It sometimes guesses wrong. If a text file has a lot of Swedish or French words (which may have characters represented with the high bit set, as some ISO-8859-something variant, or perhaps even a Unicode version), it may fool Perl into declaring it binary. So it’s not perfect, but if you need to separate your source code from compiled files, or HTML files from PNGs, these tests should do the trick.

You’d think that -T and -B would always disagree since a text file isn’t a binary and vice versa, but there are two special cases where they’re in complete agreement. If the file doesn’t exist, or can’t be read, both are false since it’s neither a text file nor a binary. Alternatively, if the file is empty, it’s an empty text file and an empty binary file at the same time, so they’re both true.

The -t file test returns true if the given filehandle is a TTY—if it’s interactive because it’s not a simple file or pipe. When -t STDIN returns true, it generally means that you can interactively ask the user questions. If it’s false, your program is probably getting input from a file or pipe, rather than a keyboard.

Getting started with the salesforce php api

from the url: http://www.mikesimonds.com/getting-started-php-salesforce-t117.html Credit goes to this site and this developer for being awesome.

Peter thanks for joining the site and I hope that I can help you, so let's give it a try:

1) You can use PHP with salesforce to perform almost any action you want with your projects. We currently use PHP to update, insert, and upset(salesforce function) to update all our data in salesforce for accounts, products, pricebooks and custom objects within salesforce. You can use PHP to create data or populate data from an object to a custom object using outbound messaging. You can use PHP to create a complete replication process of your data in Salesforce to a local database such as MySQL or Oracle. We do all these types of functions using PHP.

You will not be able to or would want to store your php scripts on a Salesforce server, they will all reside on your personal server or a company server. We have two servers, one for production and one for development that run Apache, PHP, and MySQL. The PHPToolkit is basically a group of scripts that are a class that is used to communicate with Salesforce's API.

The best way to get started is, and I am assuming that you have a windows PC, to download a free WAMP(windows apache web server for localhost development) and install it on your PC. You can do all the development on your local pc, that is what I do. I use XAMPP and since you are from Germany, here is the link > apache friends - xampp
Once you get that installed, follow the link from my main menu to the PHPToolKit and download it. There are some instructions and examples in the folder system within the zip file that will help you get started. I will also be glad to help you offline get setup

2) Once you have a webserver or localhost installed and have the toolkit installed, you can connect to Salesforce's API using your administrator Salesforce Account. If you want to have a development Salesforce account, which I would suggest, you can sign up for one for FREE > Force.com Developer Edition Sign-Up

The WSDL file can be downloaded right from wihin your Salesforce Account. Once you login to Salesforce, go to Setup > App Setup > Develop > API and you can generate a Partner WSDL file from there and then add that to your localhost or webserver and you can start development

I hope some of this makes sense, It seems like a lot, but it is not really. Let me know if you need any clarification and catch me on Skype anytime

Creating an event via the salesforce php api

Credit goes to this url for this post. I repost in case his site goes down and the info is lost. http://www.mikesimonds.com/adding-event-calendar-t111.html
The object to update or insert a new calendar event is the "Event" object in salesforce

There are 4 required fields that need to be inserted in order for the event to be added to your instance of Salesforce.

Assigned To
Subject
Start (date and time)
End (date and time)

Those API field names are

Owner Id
Subject
StartDateTime
EndDateTime

Remember that Salesforce times are all set to GMT, so you have to account for that. Since my time is set to -6 GMT, I have to adjust my code for that:

PHP Code:

<?php
ini_set("soap.wsdl_cache_enabled","0");


require_once ('./soapclient/SforcePartnerClient.php');
require_once ('./soapclient/SforceHeaderOptions.php');

$mystuff = array('OwnerId'          => '00550000000wI2LAAU', // Assigned To
                 'Subject'          => 'PHP Event Addidtion Test 2', //Subject
                 'StartDateTime'    => '2008-08-05T12:00:00.000Z', //Start time of event
                 'EndDateTime'      => '2008-08-05T13:00:00.000Z'); //End time of event **ALL TIMES ARE GMT, REMEMBER TO ACCOUNT FOR THIS****
//clean User to allow changing of characters to XML
$mystuff = array_map('htmlspecialchars',$mystuff);

//try to add User from from array
try
{
    //salesforce login and wsdl
    $wsdl = './soapclient/partner.wsdl.xml';
    $userName = "me@email.com"; // change this to a valid email
    $password = "password"; // change this to a valid password

    //connect to salesforce
    $client = new SforcePartnerClient();
    $client->createConnection($wsdl);
    $loginResult = $client->login($userName,$password);

    $sObject = new sObject();
    $sObject->type = 'Event';
    $sObject->fields = $mystuff;


    //this part adds the contact to salesforce
    $result = $client->create(array($sObject));

    if ($result->success)
    {
        echo "A new Calendar event has been added to your instance of Salesforce with an Id of ".$result->id."<br />";
        echo "**************** ALL DONE ****************<br />";
        exit;
    }
    else
    {
        $errMessage = $result->errors->message;
        echo $errMessage;
    }

}
catch (exception $e)
{
    // This is reached if there is a major problem in the data or with
    // the salesforce.com connection. Normal data errors are caught by
    // salesforce.com
    echo '<pre>'.print_r($e,true).'</pre>';
    return false;
    exit;
}
?>

What is a quick way to find out what's wrong with an oracle database

If you run this query, you'll get back info on any serious problems, also check the alert.log file. The alert log is located in $ORACLE_HOME/admin/$ORACLE_SID/bdump

How do I kill off a program in windows from the command prompt

Using ctrl alt del and killing off a program through the gui is painful and takes many tries. Use taskkill /IM notepad.exe from the command prompt to kill off a process. To kill off firefox which is hung for example you would use taskkill /IM firefox.exe There is other other options for this command as well which are easily googled. Or contact barnettech for help if you like at barnettech@gmail.com