×

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home4/ccollins/public_html/ccollins/includes/common.inc).

Writing a good parser for an INI file

I wrote one of these a couple of years ago but it wasnt quite right.  This takes another stab at it.

1.    It uses the DFLT section to populate any key that is not already there.  

2.    All sections and sub section are case insensitive .
3.    All keys are case insensitive.
4.    Any section that does not have key=value pairs is ignored
5.    The sections will only use the first numeric then alpha characters  get the client
       a.    For instance 
             [144LI0901] 
                Becomes
             [144LI]

Ordering array based on arbitrary list.

 

 

<code>

  my $order = [
                'STARTING_BALANCE',
                'NUMBER_OF_DAYS_IN_PERIOD',
                'ENDING_BALANCE',
                'TOTAL_DEPOSITS_LESS_INTEREST',
                'AVERAGE_COLLECTED_BALANCE',
                'TOTAL_WITHDRAWALS_DEBITS',
                'ANNUAL_PERCENTAGE_YIELD',
                'TOTAL_INTEREST',
                ];

foreach (@{$this->{'_statement'}{'ACCOUNTS'}[0]{'ACCOUNT'}}) {

How to put several qr into an array

We had a problem with a client sending us data that was not consistent.  I decided to write a function that could deal with many regex's.

 

we put the regexs into an array.  Iterate through the array and break out if any match.

if no regexs match die.

<code>

sub figureOutFileFormat {
    my $fileHash     = shift(@_);
    my $batchName     = shift(@_);
    my $file          = shift(@_);

    my $year   ;
    my $month  ;
    my $day    ;

    # set the account number
    #
    my $acct   ;

My attempt at programming python

I've been wanting to get into python for a while but never had the time.
This last week i didn't have anything to do so.......
I have written a perl script to get the environment variable out of multiple files.
If i have the same variable in both files the last file will replace the first files variable.

env.ini

Load the command prompt to your right-click options

Easy as this

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\shell\runas]

[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Open command window here as Administrator"
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""

[-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="Open command window here as Administrator"
"HasLUAShield"=""

Sync Subversion between two different servers

I had a need to back up my repo to another server. I already back up the repository to an external dive but i thought this would be an even better solution. To have a hot backup!

After searching google for a wile i found a article that fit the bill.
https://journal.paul.querna.org/articles/2006/09/14/using-svnsync/

While i have version 1.6.11 it still worked great!

The only thing that i did differently was create a user in the repo to run this as.