Wednesday, June 24, 2009

Getting CSS to work from your layout files in Cakephp

If you want your handwritten css files to work in your cakephp application, remember that you have to use the echo statement. Ok, here i go step by step.

Once you finish designing the structure of your application, you go on to bake it (i.e use the bake script to generate basic add/delete/view functionalities).
Having done that, your application performs its basic tasks and then you go on to tweak it.

When you finally head over to doing the front end design, you should create your css files, and your images/icons first. Then head over to the layouts folder and create the layouts you want. Layouts are common templates within which the action specific views will load. When you do this, you would like to insert links to your css files in the head tag of your layout page.For this, use $html->css(' <filename> '); where your css file is filename.css and remember to echo it.
It should finally look like this :-
<head>
<?php echo $html->css('somename'); ?> // where somename.css is my css file

Read this article for explanations on the same topic.


Friday, June 19, 2009

TGIF - Thank God Its Friday

As I had said earlier, today I was to be part of a puppet show. and we did manage to do something out of it. Thankfully my sister consented to provide us with background score with the harmonium. So with the confidence that we could cover up all our goofs in the din of the harmonium, we started our show. After a bumpy start ( I swallowed three words in the invocation song), we started talking, and things flowed the way they should. I goofed up just once in the middle, where i gave an unwarranted long pause - my mind just went blank, i was watching the green buttons flickering in the mic amplifier - things were pretty ok. only thing was we had the script written out on sheets of paper (to prompt ourselves), which flew onto our faces 5 mins into the show. and we were left to our own to take the conversation forward. and we finished it, with very little deviation.
We used stick puppets.  I will try to post the pictures somewhere on the internet, all those interested can google for it. :D.

After the show, i was breathless for a while, and my voice went hoarse when i managed to speak.

So D day is over. and the show is over as well. and as i recount the day now, i am glad that the show is over. but my mind is tempted to venture into string puppets/marionets the next time. Ah, such are the fancies of my mind.


View status msg videos in gmail inbox

I havent noticed this before, but today something was different in my inbox.... Nothing that changed significantly, but just that the reply button looks shinier now, is it because of my theme I wonder... may be it is so for other people as well, you guys have to tell me through your comments...

Ok, wait. I am literally ranting now.

What I wanted to put down in htis post was, Today one status message was getting displayed with a difference. Usually, my routine when i turn on the computer goes this way - I turn on the computer. I click on firefox twice, just to see which of the two instances loads b4 the other. and then I heard straight to mail.google.com. and then i sign in and then i try to read the deluge of emails that have piled up. and then i gape at the various green buttons and red buttons in the chat area. i hover over each and read the status messages (trust me, some of them are absolutely ridiculous) and spend sometime trying to predict which of these will turn orange in the next 30 seconds. and generally wait for some green button to come up with which i can do a conversation less conversation..which ultimately never happens. and i get back to my game of prediction....

today as i was going through this step for the first time, one of my green buttons put up a link to a youtube video. i hovered over it and it said - Play: What is a browser? with a blue html link like color. I click on it for something miraculous to happen, and voila. the video plays in my gmail inbox in a little chat window. I know we can view videos of the links sent as part of chat msgs. But i dint know that this worked for status msgs as well.

Does everyone else know it already??

Btw, here is the video that i was talking about - http://www.youtube.com/watch?v=o4MwTvtyrUQ Nice one I must say.

Thursday, June 18, 2009

The mess that was

In my attempts to try something very adventurous, I messed up my entire cakephp installation yesterday. It would refuse to read from the db, it would display a form, but would refuse to store the data in the DB, it would partially update the DB and such stuff. Cranky kid.

But today i fixed it. How? I reinstalled the whole thing :D Not that i wanted to escape from finding the real cause of the mess I created, its just that I am in a great hurry to finish up this application as soon as possible. But generally mistakes  I made are these:- 1) I interconnected controllers and models, where cake likes to keep connected one -to-one
2) I created my own routes by which the application should parse the request url, which confused cake like mad.

So I have managed to add data, read the data from the db. Now I start work on the login and registration part.

So long.

Tuesday, June 16, 2009

Cakephp tutorials - an aggregation

Want to code your own mail client in php?

Learn how to create your own mail client in PHP using this link: -

http://riobautista.wordpress.com/2008/01/08/accessing-a-pop3-mailbox-using-php/

CakePHP setup

Ok, before the non-programming junta starts hurling stones at me, Let me clarify. CakePHP has got nothing to do with cakes or for that matter eating itself. It just happens to have the word 'cake' in it.

CakePHP is a framework. frameworks(apparently) make a programmer's life easier by taking care of a lot of routine task. In return,they give you a set of rules that you should follow while you create your application. I have been sweating it out trying to read and understand the framework for the past 1 week and consequently have also been raising my Googling quotient( :D , IQ is obsolete now) to a new high.

1)If every anybody tries cakephp on an xampp install, remember to tweak your apache settings. http://tinyurl.com/6hbt7u

2)To install cakephp, download the folder from its website. Uncompress it and copy the contents of the cake folder into the folder of your public_html OR htdocs and thats it. You're just one step away from salvation.

3)Create a database for your application, fill in the details in database.php - find it here: htdocs/your-folder-name/app/config/ - and.. well thats it.

4) Open your browser,hit http://localhost/your-foldername OR http://your-site-name.com/folder or wherever you installed it, and you should be able to see the default pages running. IF you see a page with only text links and no colors, then your installation isnt successful yet. No, no biscuits for doggie.

If for some reason you dont see the Blue and greeen colors of your life coming alive, then its most likely that either your DB config isnt right, or your apache settings arent fine. The problem most of the times is only at these two points, so dont waste your time meandering through the app folder, or config folder or any other folder for that matter. You wont find your treasure there.

So much for now. More Later.

Monday, June 15, 2009

New ventures

I have been experimenting with quite a few things lately. And one of the things that I have been working on is a script for a puppet show.

My script writings skills are abysmal, as are my other skills. I have been working hard over the script for the past three days and now it has taken some shape. And the show 's coming up this friday. Lets see what happens.

If this turns out well, then I'm intending to work on few other hitherto unknown stories from the folklore.

Lets see what happens.

Another Salute to people who share tech tips on their websites

I was saved yet again today, by the small tip given by Brian Fidler here at this page
A deep bow to you.

Sunday, June 7, 2009

What am I looking for?

Its been almost a month and a half since I wrote anything on this blog, mostly because I have been busy with a project at work that has been sucking out alot of my thinking capability. 

So today being Sunday, I decided that I will put aside everything else, and just let things be. And when that happened, I realised that my mind was continually searching for something. I tried to do some chores, watched a movie on tv, tried texting some old friends, but no that was not it.  I tried doing some google search about topics I had kept aside for reading a looong while ago, but yet, at the end of this exercise, my mind still is looking for something... I dont know what it is.

Something, the mere presence of which will drive it to do all that it has set itself up to.  There is a sense of void, or vacuum that keeps gnawing, I have lots of work to do, but my mind is not engaged.

When and where will this search end??

More later.

Google Wave Presentation

Everyone should see this: