Blog

  • Baking on Ubuntu while using xampp

    So, I’m a web developer working on Ubuntu. Since I don’t want to get into complications like pinning to have earlier versions of PHP (useful when developing on Drupal), I use XAMPP. Its a bit of a work to get php ready to bake while using XAMPP on Ubuntu. These instructions are probably generic to any bash shell, but tested and working on Ubuntu. Also note, I assume you install XAMPP in the expected directory at /opt/lampp.

    1. Add an alias for php in .bashrc. Open the ~/.bashrc file and add the following line:

       alias php='/opt/lampp/bin/php' 
    2. When running the bake script, run it as follows:

       php cake.php bake 
  • jQueryObject

    CakePHP moved from Javascript helper to a Js helper and they decided to add support Prototype/Scriptaculous, Mootools/Mootools-more, and jQuery/jQuery UI.  Out of the 3, jQuery remains the one I like most so far. I’m not an expert in it (yet :p) but its pretty nifty to work with. Sometimes when working with one or more libraries, the jQueryObject which is $ by default tends to clash with other libraries. CakePHP of course has code to deal with this, only is not publicly mentioned how to do it. I spent around 5 hours to discover how, and here it goes drum roll

        $js->JqueryEngine->jQueryObject = '$j';     print $html->scriptBlock('var $j = jQuery.noConflict();',         array('inline' => false));

    When you look at the code using firebug, you would now see the jQueryObject changed to $j. I’ve suggested a section to the book for this and I’ve also modified some of the documents for stuff that I found helpful.

  • pageTitle gotcha

    When cake moved from 1.2 to 1.3, there were a few changes. While the manual is up-to-date, the default manual that’s shown tends to be 1.2 and there is a section in the 1.2 manual that talks about the migration. I got stuck with one of the gotchas today. I spent 1 hour trying to find out why the title I set in $pageTitle would not print with $title_for_layout until Phally pointed it out on IRC for me. To set the title from the controller, I’m supposed to this

        $this->set ('title*for*layout', 'My title');

    Doh! Anyway, now I’ve changed my bookmark to the 1.3 manual instead of 1.2

    For a full list of changes, take a look at the transition guide.

  • Cake is yummy!

    Its a few weeks since I formally started my career as a web developer and I feel I’ve got lots to say. I started working on a project writing PHP code that mixed with the view, basically a bunch of php files with lots of PHP code and html. It was easy, but it wasn’t great fun. There was indeed a lot of copy and paste and find and replace, but it was hard work to get things done though it was easier to figure out how to do things.

    When I started working on a new project, I convinced my boss that we should try moving to a framework and I chose CakePHP for some reason though there was CakePHP, Codeigniter, and Symfony to chose from. Something about CakePHP pulled me towards it. It took a fair bit of experimentation before I was able to convince myself that I could do it (yeah, this was after I convinced my boss).

    After about a week into development, I can happily say that it is indeed awesome and yummy. I like the inbuilt helpers and components that helps do a lot of common tasks like access control, pagination, data validation, and others quite easily. But the best part, is baking code. It takes a lot of the boring part out of coding for a web application especially when your entire application is a CMS like system that is somewhat custom made to client requirements. Being the first project I’m doing in CakePHP, I think it might take around 2 weeks for this project, but I’m pretty sure, I can cut down this time to probably a week or less once I get a feel for it.

    I’ve got stuck a fair number of times and I’m really glad that most of my google searches lead me back to the Manual and its mostly what I wanted at that time too. In some cases I got stuck and lost for hours at a time, and that was when IRC came to my rescue. There was always someone online who had a good idea about cake, particularly markstory and savant, always willing to help us newbies. I look forward to more adventures and perhaps more frequent posts.

  • UDS-M Day 5

    Phew, finally I get down to writing day 5 overview, a few days after UDS. Generally, I write the previous day’s blog post on the next day. After day 5 though, I had to get work (yeah, on a Saturday). On Friday, I decided to tackle my power trouble by going outside for the hours that I know in advance I won’t have power. Overall, good idea, but they decided to cut power at different times. Sigh.

    First thing in the morning was a call with Daniel Holbach to discuss about the Cleansweep Project. Skype kinda gave us trouble and we ended up using Facebook chat in the end to discuss stuff.

    Community Roundtable

    A round up in the morning of all the community stuff including what we have to go ahead. My memory is faint about what we talked, but I vaguely remember everyone summing up the week and the progress that was made. Also, someone was playing music from Benjamin’s laptop, which included the Titanic song. Fun times 😉

    Ubuntu Women Session

    A session I didn’t want to miss. This session was very goal oriented from all the other sessions. I liked the mentorship discussion and revival of the whole thing. I’ll probably sign up to be a mentor. I’ve already helped a few friends that I know through UW in other teams like Bug Squad. The idea was not to replace the other mentorship options but to work with the others and to give a list of folks on the UW wiki who can be contacted for particular stuff.

    I decided to take a break from the nest session to plan for Operation Cleansweep, a project that I have volunteered to coordinate. I put up wiki pages and came to the realization that we needed more time to get things together. I’d rather have a proper start with documentation everything ready rather than having to wait. I pinged Daniel and we decided to postpone start date to May 24th, 2010.

    Lightening Talks

    As usual James Tantum rocked us with pictures of slides since most of it were using slides. I forgot a lot of them, but ones that rocked including one by Jonathan from Launchpad team about ‘How to be an evil overlord’ or something to that extent, Popey’s Momubuntu talk, James Westby’s talk about launchpadlib (and yes, try try try until you succeed), a talk from Google Chrome guys about how speed matters, Chris Johnston talked about Classbot, Alan Bell about etherpad (we overloaded the pad 😉 ), and more that I’ve forgotten. I’ll wait for the videos.

    Travis Hartwell talked about how he wanted a way to pull the source for all the dependencies of a package with one command instead of typing out many different commands. I was pretty sure sed or awk could do something coupled with apt-cache. My sed foo is pretty low and I asked my good friend Mackenzie Morgan wrote something up for this. Travis, this one’s for you buddy

    apt-get source $ (apt-cache depends gwibber | awk '/Depends/{ print $2  }') 

    That command would get you all of Gwibber’s dependencies. You can change that package name to get the source of dependencies for any package. This source will be downloaded into the current folder when you’re running it from a terminal. Perhaps someone could make the whole thing more prettier, but hey, this is a start 🙂 Thanks again maco!

    Advocate the use of daily builds

    One of the projects that Daniel Holbach has been assigned for this cycle. Its been given a high importance and I realize the reason. A daily build means every time you write new code, it will be built for you and a whole lot of folks can test it for you and give you bug reports. Various improvements to LP were discussed including a rollback option among the others.

    Ubuntu News Team

    Amber is the chief editor of the Ubuntu Weekly Newsletter, so I attended this one hoping it would be interesting and it was! A lot of discussion about unifying teams, etc. There was a thought of doing away with Fridge which I stopped right away. Reminding you folks again, We WANT the Fridge! Well, it wasn’t a serious consideration but a thought someone had. All in all, they made some tough calls, which will happen internally. Also, Fridge is going to be in WordPress soon, so that should help make a lot of things easier. I don’t remember who, I think Joey, will be working with the Design Team for a new theme, etc for the Fridge.

    Closing Session

    Finally, the UDS comes to a close. Everyone had great fun for a week and did lots of work. Most people were tired and close to burn out (yeah, from all the staying up late in the bar or out partying 😉 ). Seriously, it was tiring. Even from remote, I was burned out. Last 2 days I’ve been so tired. Hopefully I can recharge this week. All the track leads summed up their tracks. Important stuff include Robbie confirming that 10.10.10 could be a release date, pending TB approval. He was talking about how much time each cycle has had and it seemed okay. Jaunty cycle only had 25 weeks, so for 10.10.10, we’ll have only 23 weeks and it seems possible. Scott, talked about btrfs and how it may be the default option for Maverick. Keyword there being ‘may’. Scott blogged about what needs to happen for that. Leann summed up the kernel track decisions. I didn’t understand much of it, so skipping that. Design track, Desktop track, and cloud track also had a small summary which I don’t particular recall. This why I should perhaps write blog posts then and there. Oh yeah, now I remember one decision from desktop, Chromium will be the default browser for the netbook edition. Finally Jono summed up the community track. A huge list of summing up. Most of which I think I’ve already written in the previous posts. He announced Project Cleansweep. Well, he announced it as Project Babu and how it was renamed to Project Cleansweep. Well, I wonder why I even bothered to oppose if he was going to call it Project Cleansweep a.k.a. Project Babu 😀

    The final quote from Jono ‘Lets get seriously drunk people.’ He did say he was kidding, but the tone he said it in, was awesome. Marianna arranged for a treasure hunt and she was given a small token of appreciation from the community for all the hard work she did over the week. Finally UDS is over!

    Now, time to get to work.