Yahoo! News - Tiny La. Community Gets Telephone Service

January 30th, 2005, 8:57 pm by lig

Yahoo! News - Tiny La. Community Gets Telephone Service

I didn’t know there was a town that still didn’t have telephones.

del.icio.us:Yahoo! News - Tiny La. Community Gets Telephone Service  digg:Yahoo! News - Tiny La. Community Gets Telephone Service  furl:Yahoo! News - Tiny La. Community Gets Telephone Service  reddit:Yahoo! News - Tiny La. Community Gets Telephone Service

salvation

January 30th, 2005, 7:51 pm by lig

Well it turned out that I didn't have all my paths set to the local versions of the PEAR DB. After working with a user forum and my hosting service - and still not being able to find a solution to my problem. I started combing everything and everything I could think of. Read at least 10 different papers on cron, the PEAR DB documentation that I thought could even remotely be related, the bug reports, some of the DB_DataObject docs and searched the PEAR general mailing list archives using multiple search parameters.

Finally in the PEAR general mailing list (searched using database)on about the 10th page I found a little string consisting of 3 emails. There I found out this little line of code:

PHP:
  1. $db = DB::connect($dsn);
  2. if (PEAR::isError($db)) {
  3.    die($db->getMessage()."  ".$db->getUserInfo()."  ");
  4. }

getUserInfo().... never heard of that method. Add it to my code and next thing you know I am being told that the script can't find my mysql.php (local version isn't on the set path - normal version is denied because of a "base_dir restriction").

Finally I have something I can fix! Track and trace the various paths to the classes and eventually - It Runs!!!

Holy cow - talk about ignorance being a problem. Looked in the documentation for DB and DB_DataObject again for anything on that method. Can't find a single line about it. So if someone would be so kind to point me in the right direction - I would love to learn more about the solution to my headache.

del.icio.us:salvation  digg:salvation  furl:salvation  reddit:salvation

cron hell

January 30th, 2005, 4:58 pm by lig

I am in cron hell. There is no other explaination for it. According to my hosting service there is no reason for my script not to be working - and yet it still isn't.

They have verified my shebang at the top of the script and crontab command. The script when called with a browser - connects and runs perfectly. When called by the cron: at the initial database connection - the error "DB Error: not found" is thrown. All the database connection information is verified and the script was pulled up again threw the browser just to make sure. Again it works. (user has all GRANT permissions and the DB name is verified as correct.)

GRRRR - What the hell is going on? If anyone has any ideas please let me know. This puzzle is driving me nuts.

FYI - the site is a shared hosting.

del.icio.us:cron hell  digg:cron hell  furl:cron hell  reddit:cron hell

Newest page - and translation

January 20th, 2005, 8:20 pm by lig

Well the first page of my administrative area is up and running (debugged and minor testing). Will be starting the next page tomorrow. Worked on fixing a few bugs and Photoshop all day today. Was a nice change of pace.

The Project Manager/Translator finally had a chance to see her translation in context and hated it. :) Said it looked like a bad translation script was used. HEHE. She asked to have the files re-sent so she could do a better job this time. Luckily I had just finished the first admin page. Wonder if she is surprised by the size of the translation file (it is getting pretty large). :)

del.icio.us:Newest page - and translation  digg:Newest page - and translation  furl:Newest page - and translation  reddit:Newest page - and translation

SQL - solved; cron - unsolved

January 20th, 2005, 8:08 pm by lig

Well the SQL problem has been solved - the varchar needed a size. So now it has (255) added to it. Ran into a couple more problems before I was done. MySQL 4.0.x doesn't support a BOOLEAN data type so I used CHAR(1). Yeah - I could have used an INT or enum('T', 'F') but enum isn't supported by all DB structures and a non-computer person will never remember that 1 = TRUE and 0 = FALSE. Heck - the only reason I remember is because I have a little sticky note on my monitor that reminds me (and yes I sometimes can't tell my left from my right). :)

The cron script is still in the air. The hosting service keeps asking me if I am using the correct username when accessing the DB. How can I not be when the script works perfectly fine in a browser? Have to keep reminding myself that it WILL work eventually.

del.icio.us:SQL - solved; cron - unsolved  digg:SQL - solved; cron - unsolved  furl:SQL - solved; cron - unsolved  reddit:SQL - solved; cron - unsolved

today = ‘VERY bad day’;

January 19th, 2005, 2:21 pm by lig

it is only 10 AM and already I am ready to kick my computer.

My cron still is not working - (At least it isn't a path problem this time) - it can't access the DB even though all the access information is correct (tested in browser and works fine) and the cron is accessing as a user with full privileges. Dropped a trouble ticket off to the hosting service - maybe they can tell me what the problem is now, so I can fix it. I honestly thought that this whole thing with the cron would be easy once I had the script and command line set- AS IF.

Add to that - I am writing part of the administration area for my project and a stupid SQL ALTER command won't work. It keeps throwing out a syntax error - and yet when I check out the manual for the DB and a book I have on the DB - it says it should work. But of course it doesn't.
Command giving me headaches:

ALTER TABLE table ADD COLUMN TEST VARCHAR;

Database being used MySQL. Quote from manual:

ALTER [IGNORE] TABLE tbl_name alter_specification [, alter_specification] ...
alter_specification:
ADD [COLUMN] column_definition [FIRST | AFTER col_name ]
...

Quote from book (MySQL - visual blueprint series)

Example:

ALTER TABLE address ADD COLUMN (
country VARCHAR(10),
unit VARCHAR(5),
notes TEXT );

The parenthesis shown above in this example are not necessary unless you are adding more then 1 column.

So the word COLUMN is optional and the parens are optional. So why the heck isn't it working?!?!

del.icio.us:today = 'VERY bad day';  digg:today = 'VERY bad day';  furl:today = 'VERY bad day';  reddit:today = 'VERY bad day';

Smarty - Thank god for books!

January 17th, 2005, 7:22 pm by lig

Was working on my project today and had to loop through an array. After every 3rd record had to break the table row and start a new one. Sounds easy right. Only one problem I'm using smarty and NO WHERE in the documentation is it noted that there is a built in counter for loops. So I figure I'll make another array of numbers to be my counter - right. Works on small stuff but this time it won't work. No matter how I nest the foreach's and the if's - the output will be wrong. Go to take a look at section and cycle... Hmmm - nothing that will suit my simple needs.

Darn it - all I need is a simple counter for the dang loop!!! There has got to be one somewhere! Go and pull out "Essential PHP Tools" by David Sklar. I know they talk about looping with Smarty in the book (quickly glanced over it when I received it - Still reading "Advanced PHP Programming" by George Schlossnagle). And there it is - the iteration property of the foreach loop. Darn it - why couldn't I find it on the online documentation. Look again at the online docs - and sure enough there it is all the way at the bottom. I didn't see it for whatever reason (though it really isn't explained well on the online docs). Maybe it is because I was so busy looking at the examples . Since none of the examples used it - I saw no reason to look lower then Example 7.5. No code or pictures - no sense looking there ;) .

Anyway - it was a good thing I had the book because I know I never would have noticed the reference to it in the online docs. Here is a direct quote of what it says directly below Example 7-5:

Foreach-loops also have their own variables that handle foreach properties. These are indicated like so: {$smarty.foreach.foreachname.varname} with foreachname being the name specified as the name attribute of foreach

iteration
iteration is used to display the current loop iteration.

Iteration always starts with 1 and is incremented by one one each iteration.

first
first is set to true if the current foreach iteration is the first one.

last
last is set to true if the current foreach iteration is the last one.

show
show is used as a parameter to foreach. show is a boolean value, true or false. If false, the foreach will not be displayed. If there is a foreachelse present, that will be alternately displayed.

total
total is used to display the number of iterations that this foreach will loop. This can be used inside or after the foreach.

del.icio.us:Smarty - Thank god for books!  digg:Smarty - Thank god for books!  furl:Smarty - Thank god for books!  reddit:Smarty - Thank god for books!

computers and stuff

January 16th, 2005, 11:14 pm by lig

Well this past week has been fun and frustrating as @#$%. My husband finally finished building me a box to put my Linux into. Been wanting to play with it and see what I am missing since I mostly use Windows. Have a book and CD for Red Hat 8 so I load it up.

I cheated and used the GUI interface to install - I know I should have used the command line. "Then I would really understand Linux." Figured I had to crawl before I walk (never mind run) so here I am. Have been playing around with it and even started writing a tutorial on PHP and forms just for the heck of it. (Please don't say it - I know I'm odd thinking that is fun.) Anyway went to save to the floppy.... and couldn't figure out how. :) Spent about an hour trying to do it before I finally went to the Internet. Googled and found out it isn't easy to do like in Windows... so left it for another day.

My husband also bought a wireless access point to hook up to the current main computer to make a wireless network (also got cable internet this weekend so want to access it through the laptops). Could find the network but couldn't connect. Read the instructions - says we need a router. So go and buy a wireless router. Set up the network according to the directions - can see the network, and connect, but can not access the cable internet available on the main computer. Try every kind of configuration we can think of and that is as close as we can get. Will be contacting technical support for the router later on and see if they can help me get the network up.

Eventually want to make the Linux box the server for a local wireless network - but am not quite there yet. Maybe I should first learn how to mount and write to a floppy be fore I get all ambitious. Hehe - it will all get done eventually. Though I am dreading reading the tome for Linux I have waiting at home.

del.icio.us:computers and stuff  digg:computers and stuff  furl:computers and stuff  reddit:computers and stuff

Damn cron - Work!

January 13th, 2005, 4:02 pm by lig

had 2 nights to try to run the cron - both failed. First time - I forgot to give the file the correct permissions. idiot. Today - the PEAR DB file isn't in the allowed paths. Hmmm. Will try to send it to the local versions. If that doesn't work... guess I will have to add the packages to the cron folder (though I don't lik the idea of that).

del.icio.us:Damn cron - Work!  digg:Damn cron - Work!  furl:Damn cron - Work!  reddit:Damn cron - Work!

cron #2 - done

January 10th, 2005, 11:46 pm by lig

Finished the second cron script. Mostly cut and paste from the first but it has some major changes in the logic. Took a little longer to get working as I want it to but that is OK. Will set it up today in the cron tab. Hopefully I will see what I want tomarrow.

Cross your fingers.

del.icio.us:cron #2 - done  digg:cron #2 - done  furl:cron #2 - done  reddit:cron #2 - done

cron script #1 - done

January 10th, 2005, 12:01 am by lig

Yeah! the first cron script is finished. Now on to the second one - slightly more complex but hopefully not too bad.

The biggest problem I had was getting stupid Outlook Express and Outlook to understand the character set. They kept on wanting to put it into Latin based characters - never mind that there is a header that says the character set is utf8 (Oh sorry for M$: UTF-8). Stupid thing.

Thank you PEAR's Mail_Mime package. You made my life MUCH easier once I figured out how you work.

del.icio.us:cron script #1 - done  digg:cron script #1 - done  furl:cron script #1 - done  reddit:cron script #1 - done

PEAR’s Mail_Mime

January 9th, 2005, 4:37 pm by lig

Well I'm off to learn something new again - PEAR's Mail_Mime package. Now that I am doing the back end of the project I need to learn how to send an email that can contain the English, Japanese, and Korean characters. I think the Mail_Mime package can handle it though I really won't know until I try it out. If it doesn't work then I guess I will have to make my own. I am not particularly looking forward to that prospect. But then I am coming to like streching new muscles. :)

del.icio.us:PEAR's Mail_Mime  digg:PEAR's Mail_Mime  furl:PEAR's Mail_Mime  reddit:PEAR's Mail_Mime

Learned a little bit about cron and php

January 6th, 2005, 11:50 pm by lig

Learned a little bit about getting a PHP script to run through the cron today. Also learned alot about cron itself. It was pretty interesting but very confusing at times. My site has a GUI interface for the cron so it is pretty easy to set up something. But what about if my next site doesn't - Ex: if I am on a dedicated server. What would I do then to get my PHP script to run every day at midnight and have any messages output by it sent to my email. And as a friend told me - what if the server itself has an error - how will I be told about that?

Here is how my learning experience went:

Started out just looking for a tutorial to tell me how to run a PHP script as a cron. Found this tutorial. Really easy to understand but rather basic. Cool. But I want to make sure what I'm doing is correct so I keep looking and find this tutorial. It is a little more advanced and gives a lot more detail about what everything means. Great! Now I think I have it. So I start coding the rest of the script.

(I am a member of the PHPCommunity volunteers so I commonly hang out on it's IRC channel.) So I'm talking to some of the other guys on the channel and make the comment that I am writing a cron script. We start talking about it and somehow we get on the subject how I want to have the cron command line code for running the script in case there is no GUI. ebag tells me I should have the output emailed to myself incase anything goes wrong. He can't remember how to do it, but he knows it is possible.

Since I was right in the middle of using PHP's mail() to tell me if an error occurs in the script - that sounded like a good idea :) . So off I go investigating deeper. Eventually find this site. And what do you know it shows me how to have the output emailed to me. Edit my cron command again. Now I'm feeling pretty proud of myself and very thankful to ebag for telling me it was possible.

Show the guys the newest version of the command and ebag suggests I make one more addition so I can also have the server's standard errors sent to the email. Since I have zero knowledge about servers he sends me another link to red up on it and understand (sorry - didn't keep that link). So now I finally get it.

And what is the command? :)

0 0 * * * /usr/local/bin/php /path/to/your/cronscript.php 2>&1 | mail -s "Subject of mail" person@domain.com

Thanks ebag for all of your help. I really appreciate it!

del.icio.us:Learned a little bit about cron and php  digg:Learned a little bit about cron and php  furl:Learned a little bit about cron and php  reddit:Learned a little bit about cron and php

problem fixed

January 5th, 2005, 10:44 pm by lig

Well I'm back at work (about a week now) and working on my project. Got some things done on varaction but not as much as I wanted. *shrug* My boss is actually letting me code all day instead of doing all the other million things I have to do so I am actually getting somewhere.

While I was just hanging out on the PHPCommunity channel today coogle came around asking about the IntSmarty project. Told him about my current problem and sent him the translation file that crashed the site. Wouldn't ya know it - it about 5 minutes he saw where/how the translation file formating was screwed up (there were stray single quote marks and a comma where there should not have been). John reminded me that the single quotes will end the translation string so I had extra strings just hanging around messing up the parsing. So I fix it and what do you know - it works.

John also commented that it seems I found a bug in the PHP. I haven't a clue how or where so I asked him to report it since he would know more about the actual details involved (I only know that it didn't work and what I did before hand). I admit it - I am a CIS person not a CS. I don't care how it works as long as it does. :)

Well I now have a total of 4 pages up and running. 2 are in English and Japanese, 2 in only English. Still have to code the administrative area, backend cron programs- and get a korean translation to try that out on the pages. I almost feel done.

del.icio.us:problem fixed  digg:problem fixed  furl:problem fixed  reddit:problem fixed

And the luggage saga continues

January 5th, 2005, 4:13 pm by lig

Well it is now Thursday morning and my last bag has finally shown up. All it took was 6 days to do it. Oh and did I mention that no one bothered to call me to tell me it was in never mind offer to deliver it since it has taken so long to show up. I have already written 1 nasty gram to Continental and mailed it to the local office as well as the main office in Texas.

The worst part is that is I had been shown a little courtesy and customer service I wouldn't be half as pissed off as I am. Life happens after all - just don't treat me like I am a piece of crap unworthy of your time or attention.

del.icio.us:And the luggage saga continues  digg:And the luggage saga continues  furl:And the luggage saga continues  reddit:And the luggage saga continues

Kai

January 4th, 2005, 5:35 pm by lig

Unfortunately it seems that Kai will probably not be a show dog. He has bad teeth :) . Actually he has an underbite where none of the teeth touch so it is considered an automatic disqualification in the show ring. Granted he is only 7 months and there is a slight chance that it will correct itself as he fully matures but his breeder says it is VERY rare. Our breeder offered to take him back and replace him with either an adult female dog who is a proven show dog (already has her Australian Champianship) or a new puppy since she knew we wanted to show him. We personally beleive that pets are forever so we declined the offer but let her know we will be contacting her when the time comes for another dog.

del.icio.us:Kai   digg:Kai   furl:Kai   reddit:Kai

4 down, 1 to go - Continental baggage

January 2nd, 2005, 8:42 pm by lig

Well 4 of our bags have finally shown up (1 month, 2 completely different climates, and formal and casual clothes required - in case anyone is wondering why so many bags). It only took 5 days for them to finally get to Guam. Unfortuanely Kayla's suitcase is still MIA so she will still be living on a greatly reduced wardrobe as she starts school again. If it takes much longer I guess I will be taking her shopping for new cloths (which is a waste since she got a lot of new cloths while we were stateside), but she needs cloths. I guess we should be thankful this all happened when we came home instead of when we flew out - but for right now I am too irritated.

del.icio.us:4 down, 1 to go - Continental baggage  digg:4 down, 1 to go - Continental baggage  furl:4 down, 1 to go - Continental baggage  reddit:4 down, 1 to go - Continental baggage

lost luggage

January 2nd, 2005, 3:59 pm by lig

Well the luggage is still lost so we do not have clothes. Each of us has about 2 - 3 outfits available (old or dirty when we left) . The luggage has now officially been lost for 5 days (Wed - Sun) and is still sitting in LA. Will see if it shows up today. If not - I will be having a talk with the supervisor of the baggage department. They know where it is so all they have to do is get it here.

del.icio.us:lost luggage  digg:lost luggage  furl:lost luggage  reddit:lost luggage

Happy New Year

January 2nd, 2005, 3:48 pm by lig

Hope everyone had a safe and fun filled New Years Eve. Since were still having problems with jet lag - we were all in bed by 11 PM. Though Jason and I first drank a bottle of wine to celebrate the new year.

del.icio.us:Happy New Year  digg:Happy New Year  furl:Happy New Year  reddit:Happy New Year