CakePHP: baking cake in Windows

There are a lot of articles on the internet on how to make CakePHP and it’s bake function to work in Windows.

I have tried setting the PATH environment variable to match the console

PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\xampp\php;c:\xampp\cake\cake\console\

No avail. So I am just doing this instead after creating the databases.

  1. Click Start > Run.
  2. Type cmd then press Enter.
  3. Change directory to where my extracted CakePHP files were
    cd \xampp\htdocs\cake (press enter)
  4. Type: cake\console\cake bake all
  5. That’s it. All is well.

If you guys know how to make Windows recognize the cake.bat file to execute when it’s folder is included in the path, feel free to comment.

NOTE: I am not using the production setup of CakePHP and the command may vary depending on that. Please feel free to correct.

Notepad++ : Associate CTP file extension to PHP language

I am playing around with CakePHP (yet again) lately and found that I need to make the syntax highlighting to format the same way PHP files are formatted.

CTP files are simply the file extension for template files or views file extension for CakePHP.

The workaround:

  1. Click Settings > Style configurator
  2. Click PHP under Language
    NOTE: I chose PHP cause it’s formatting the HTML and the PHP code inside.
  3. Type ctp under user ext. (extension)
  4. Click Save and close.

You’re done!

NOTE: Also applicable when adding other file extension to a certain language.

Style configurator

Src: http://is.gd/6hAga

Loading image

Click anywhere to cancel

Image unavailable

Loading image

Click anywhere to cancel

Image unavailable

Flash CS3 and AS3 Error message

Error message: String passed to URLVariables.decode() must be a URL-encoded query string It’s been long since I’ve got my foot soaked in flash and this time it’s ActionScript 3.

I then got this error message from a callback function that’s supposed to say if the input has been processed successfully. Been pondering about why that could happen and has reverted back the code to it’s original format. This time I did check the PHP file on the server and see it’s code if it’s the main culprit. Alas, it is the main problem. A missing semi-colon made PHP throw an error message in front of the status (query string).

The status should be:

success=true or success=false

This status has been pre-pended with an error that Flash intercepted before the accepted value.

Other say that this code fixed the problem (source):

loaderFunction.dataFormat = URLLoaderDataFormat.TEXT;

wrapping a pre tag using css3 in ie, opera, mozilla firefox

pre {
white-space: pre-wrap;       /* css-3 */
white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
white-space: -pre-wrap;      /* Opera 4-6 */
white-space: -o-pre-wrap;    /* Opera 7 */
word-wrap: break-word;       /* Internet Explorer 5.5+ */
}

src: http://ajaxian.com/archives/wrapping-the-pre-tag

how to compile greasemonkey script

I also code in Greasemonkey to save a few clicks of the mouse while working. Idea for what I have coded is: save at least few clicks of mouse, hundred clicks/day, that’s about 3000 clicks per months. That’s an anti-RSI initiative :D

While creating and giving out the script to other user is ok, it’s another issue when you need to ask them to install GM since it’s needed. Did try to create an extension, but creating takes quite a time. While learning how to, I then bumped into idea of creating an extension out of it. Turned to Google to check out ideas, as I practice DRY, turned out that there’s someone who already created a compiler. Here’s the link:

User Script Compiler

how to enable innodb in xampp

Reference: The InnoDB Storage Engine

Find the file name my.cnf on xampp directory on C: drive. Uncomment the line that says:

#skip-innodb

and make sure that it will look like this:

skip-innodb

***
There are at least other setup option for innodb next to this line, just follow the helpful hints and you’re off. I can’t provide definite lines on this coz sadly my computer has broken down again? *Me thinks, am I worthy to be called a tech?* EVIL GRIN!

xpath

XPath 教程

I have been developing tools(for my current job) that will save me some few ‘clicks’ of mouse(at least on the long run). This time I bump into a tool/standard that offers a lot of possibility when coding in Javascript and learning DOM. And yes, I don’t usually code in JS. This time I need it. The link above gives enough example on how they work(by example).

[UPDATE 1]
Additional links:

XpathResult – http://www.xulplanet.com/references/objref/XPathResult.html
Mozilla XPath Documentationhttp://www-xray.ast.cam.ac.uk/~jgraham/mozilla/xpath-tutorial.html

The tool that I’ve developed by the way is based on Greasemonkey.

Have fun with it.

yahoo mail beta

I was bombarded by these messages from a forum I am with trying to sell a trick on using Yahoo! Mail beta. But I didn’t have the time to do it.

Not until now.

I may say that It have been such an experience using it.

First, it was all modified to be ajax-based so the user interface is as interactive as a desktop application. Next physical feature I have noticed was a cool color rather dull for most of the people and an outlook-express-like-interface.

Another quite impressive on this feat is that it uses better space management to allot spaces for the core components of the same yahoo mail account has to offer, though jam-packed with adverts for an unpaid account like the one I have.

RSS feeds. I have one with gmail and it is very useful. Not a very impressive feat though since another mail service provider has come up with that idea first.

Folders anyone? I love folders as I love filters in gmail. Drag-dropping mail into folders is another great feature of yahoo mail beta. Eases the need to load another page just to move some mails around.

A preview pane for the mails you have have been provided(outlook-like). More of a sneek-peak to your letter.

Autocomplete. Another first on gmail’s feature has been into this package. Typing 2 to 3 letters of your friends email is a great help really if you don’t want to have a palm disease in the future.

Search email in a breeze. Gmail again? Well I enjoy both services so it is quite nice to have it in yahoo. Will there be a chat feature too?

Tabs. That’s really a great plus for the mail as it was for a browser. This one is new in the mail world. Speaking of tabs, IE7 has been into trouble being created with one… firefox ei microsoft?

Addy. Addresses has been named Contacts! What? Another humble imitation of gmail… Sad that one company cannot patent words. :)

This blog is longer than what I have expected it to be. But lastly google has been into making some cool help and comments on their services, I have noticed that yahoo mail beta has been making some cool words added along it’s mail and help.. Cool but quite immitated as I may say so.

CONS: Just using the beta I found the ads a bit cluttery in sight since at first it is on right part of the browser and just consumes some of the space but somewhere in exploring the mail you will bump into a large ad displayed before you… and just what youre thinking right now of course I am not paying Yahoo! :)

Try it out. Make some googling and yahooeing with “using yahoo mail beta trick”. You may find yourself trying it out also. For a quickie try changing your default mail content to UK. and switch back to mail. It will be a new one.. shiny!