Tuesday, June 24, 2008

At least one secondary cursor must be specified to DB->join error 22

Never found this problem on the Internet? Does it mean nobody except me run into it?

I have tested BerkeleyDB BTree 4.7.25 (from Oracle now) and when running a simple test described in their doc I got the following when opening (creating) a database:

At least one secondary cursor must be specified to DB->join error 22

After hours of searching here is what I found - the standard installation that comes the btree with is precompiled with a different Visual Studio that has a problem with VS 6.0 I was using. Even though I was able to download the dll (the release mode because the debug mode was wrong - shipped with improper MS nondebug libraries) the opening was returning this wrong message.

Only after opening the .dsw that came with the sources, and rebuilding it with VS 6.0 all went okay.

I hope it will help someone...

Friday, June 6, 2008

New download of the cvs repository on Windows

I have moved to a new laptop, and I had to get all the data from the cvs repository to this new one.
I wasn't even expecting so many problems with the WinCVS application to have!
No, it's not that WinCVS is bad. It's great. The point is that It gives so many options to accomodate so many users behaviours that at someome moment these options became a burden!

So I have finally decided to describe, step-by-step all the operations one needs to do in order to download new repository to his/her place.
This list is for cvs windows only.
I may to do this for Linux/Unix as well some time.
If you want to install WinCVS then, please, search on the Internet, wait for my new blog, or write to me in the comments.


RUN: <<<WinCVS>>>

MENU: <<<Admin/Login...>>>
EDIT: <<<CVSROOT:>>> - avoid using <<<...>>> It's overly confusing. It is better to enter the path:
:pserver;username=USERNAME;hostname=HOSTNAME:REPOSITORY
EXAMPLE: :pserver;username=john;hostname=our.server.org:/Projects

BUTTON: <<<OK>>>
The CVS will ask you for the password which will be stored at your machine
in an encrypted form and will be used for communication every time you
access the repository, but until you click MENU: <<<Admin/Logout>>>
MENU: <<<Remote/Checkout module...>>>
DIALOG: <<<Checkout settings>>>
EDIT: <<<Module name and path on the server:>>>
ProjectAlpha
EDIT: <<<Local folder to checkout to:>>>
CHANGE IT so it points at the ROOT directory where the ProjectAlpha directory will be created.
EXAMPLE: c:\JohnsProject\ (yes, add the backslash at the end!)

NOTE: If you DO NOT WANT to create the ProjectAlpha\ directory in the c:\JohnsProject one then you need to do:
CHECKBOX: <<<Check out into directory:>>> Turn in ON
EDIT: <<<Check out into directory:>>>
JohnsProject
COMBOBOX: <<<CVSROOT:>>>
Drop down menu and select the last one that you have enteted a few steps above.
BUTTON: <<<OK>>>
Off you go!



-------------------------------------
After this operation, you will have your selected directory (c:\JohnsProject\ProjectAlpha, or c:\JohnsProject only) populated with the data.
from the server.

Thursday, June 5, 2008

Sending an email from PHP (on Windows too.)

Yey, finally got something that really works.
It's not my stuff, but I was able to found it after a long time search!
Here is the link to sourceForge.net, to the page that hosts php Mailer for PHP 5 for Windows, and looks like for Unix too. If the link does not work then search for the word phpMailer.

The easiest way to install the stuff is to do as follows (example on Windows, with assumption that you have your php installed in the c:\php directory.)

> mkdir c:\php\mailer
Unzip phpMailer_v2.1.zip into c:\php\mailer
> notepad.exe c:\php\php.ini
Add at the very end:
include_path=".;c:\php\mailer"

Youre done!

Now, example:
>
<?php
require_once( "class.phpmailer.php" ) ;

$mail = new PHPMailer() ;
$mail->IsSMTP() ;
$mail->Host = "smtp.myserver.com:587" ;
$mail->SMTPAuth = true ;
$mail->Username = "username" ;
$mail->Password = "password" ;
$mail->From = "me@myserver.com" ;
$mail->FromName = "It is me!" ;
$mail->AddAddress( "testaddress@theirserver.com", "Poor Receiver" ) ;
$mail->AddReplyTo( "me@myserver.com", "do-not-reply" ) ;
$mail->AddAttachment( "c:\\mydog.jpg", "Isn't she cute?" ) ;
$mail->Subject = "Sorry for this test email!" ;
$mail->IsHTML( true ) ;
$mail->Body = file_get_contents( "c:\\myemail.html" ) ;
$mail->AltBody = "non-HTML mail client? Where are you from?" ;

if( !$mail->Send())
printf( "Sending Error: " . $mail->ErrorInfo . "\n" ) ;
else
printf( "Message has been sent successfully.\n" ) ;
?>