The youngest web developer
Can you beat that? He’s only 7months old
I never imagined to expose my children to radiation at a young age but I can’t just resist seeing this picture over and over again.. He is soooo cute….
Can you beat that? He’s only 7months old
I never imagined to expose my children to radiation at a young age but I can’t just resist seeing this picture over and over again.. He is soooo cute….
It’s not obvious but certainly I was caught offguard for a certainly small issue that made me use the old habit of doing the checkbox thingy.
When I explicitly tell the html helper to check a certain checkbox, I always do array('checked'=>'checked'); to add the checked attribute but I am left wondrin why it does not do what I want. I really can’t remember what I did to make others work but certainly it was such a headache that I opted to use the old <input type=’checkbox’ /> tags. After looking at the html helper, I found out the ffg comments
* + ‘compact’
* + ‘checked’
* + ‘declare’
* + ‘readonly’
* + ‘disabled’
* + ’selected’
* + ‘defer’
* + ‘ismap’
* + ‘nohref’
* + ‘noshade’
* + ‘nowrap’
* + ‘multiple’
* + ‘noresize’
*
* And its value is one of:
* + 1
* + true
* + ‘true’
*
* Then the value will be reset to be identical with key’s name.
* If the value is not one of these 3, the parameter is not output.
This does not only involve the checkbox but all the input tags because they pass this step first before outputting any parameter. I wish I explored on this much earlier, it would have saved me a lot of energy. Oh well, atleast I learned something new for the day
You may also want to check the function yourself. It is the function _parseAttributes($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) in the html helper. You can see the $insertBefore = ' ', $insertAfter = null, this is useful for checkboxes to add labels but currently, that option is not available in the 1.1 version. Someone already asked this enhancement in trac so I am not reporting it again. I hope that saves some of your time
Scratch - a free programming language designed for children 8 years and above. Here is the definition of the author/s
Scratch is a new programming language that makes it easy to create your own interactive stories, animations, games, music, and art — and share your creations on the web.
Scratch is designed to help young people (ages 8 and up) develop 21st century learning skills. As they create Scratch projects, young people learn important mathematical and computational ideas, while also gaining a deeper understanding of the process of design.
I’ll think that’ll be fun to teach to my niece when he grows a little older. He already likes playing the keyboard and mouse at 7months old! (He’ll be the upcoming super geek LOL). What is also lovely about this language is that your children or you can share the program you’ve created in their site! Wanna know more, visit them here.
One of the days you’ll hate and you’ll love as well, saying goodbye and saying welcome back home! It is our last day today in the Cavite office where all my dreams started coming true.. For 2 years, I found a new family and a new life here. It’s so sad to leave them but I can’t hide the fact that I am also happy to finally go back where I grew. Life moves on …
Ofcourse, a farewell is not complete without some pictures to pack. My officemates had some little fun in Max where Carol almost kissed Piolo Pascual!
Check the animated version in scrapblog.
It took me a while to learn how to add validation using the $ajax->form() of cakePhp. I think the ajax helper simplifies your work for ajax calls but you should first understand how to use it. The manual isn’t that helpful in explaining the deatails of this helper. Here is one example that I used in an application I am involve with and this hopefully could brighten someone’s day.
In my view.thtml, I have this form
<?php
// !important: name your form
$form_options['id'] = ‘myform’;
$form_options['update'] = ‘my-results’;
// this is where you’ll call the validation function
$form_options['before'] = ‘if (!validate()) return false;’;
echo $ajax->form(’/controller/action’, null, $form_options)
?>
<div id=”errMsg”></div>
<table>
<tr valign=”top”>
<td nowrap><span class=”required”>*</span> Subscription type </td>
<td><div id=”ModelType”><?php echo $html->radio(’Model/type’, $my_type, ‘<br />’) ?></div></td>
</tr>
<tr valign=”top”>
<td nowrap><span class=”required”>*</span> Receive updates </td>
<td><div id=”ModelRange”><?php echo $html->radio(’Model/range’, $my_range, ‘ ‘) ?></div></td>
</tr>
</table>
</form><div id=”my-results”></div>
The validation looks like this
function validate() {
var validation_cnt = 0;
// you must delete the previous message
removeMsg(['err1', 'err2', 'err3']);// begin the validation
if (isRadioEmpty(”myform”, “data[Rss][type]“)) {
insertMsg(’RssType’, 1, ‘This is required.’);
validation_cnt++;
}if (isRadioEmpty(”myform”, “data[Rss][range]“)) {
insertMsg(’RssRange’, 2, ‘This is required.’);
validation_cnt++;
}if (validation_cnt > 0) {
var req_msg = ”;
if (validation_cnt == 1) {
req_msg = ‘Found ‘+ validation_cnt +’ error. Please double check your answers. Some fields are required.’
} else {
req_msg = ‘Found ‘+ validation_cnt +’ errors. Please double check your answers. Some fields are required.’
}
insertMsg(’errMsg’, 3, req_msg);
validation_cnt = 0;
return false;
}return true;
}
One problem I had with this one is that I need to validate radio buttons. But since cakePhp uses illegal characters in its name, you cannot just use the normal call for it. I found an explanation of how to do this here. Here is the function that validates the radiobuttons:
/**
* Returns true if any of radio boxes with the NAMEs of elementName contained in the FORM named formName is checked
*
* @param formName - ID of the FORM
* @param elementName - NAME of the radio boxes
* @author: Rachel
*/
function isRadioEmpty(formName, elementName) {
var empty = true;
for (i=0; i<=document.forms[formName].elements[elementName].length - 1; i++) {
if (document.forms[formName].elements[elementName][i].checked) empty = false;
}if (empty) return true;
return false;
}
I am also using some prototype methods to insert the error messages at the bottom of the fields and count the errors. Here is the function for that
/**
* Insert error message after the element containerID
* Add style to class errFld to add style to the error message
* You can delete the previous message created by using @link removeID(’err’+errID)
*
* @param containerID - ID of an element preceeding the error message
* @param errID - any unique ID that you can give to the error message to uniquely identify it
* @param msg - message
* @param containerType - default value is DIV tag
* @author: rage
*/
function insertMsg(containerID, errID, msg, containerType) {
if (!containerType) containerType = ‘div’;
new Insertion.After(containerID, ‘<’+containerType+’ id=”err’+errID+’” class=”errFld”>’+msg+’</’+containerType+’>’);
}/**
* Delete the element if it exist. Do nothing if it doesnt exist
*
* @param id - element IDs
* @author: rage
*/
function removeMsg(ids) {
for (x=0; x<=ids.length - 1; x++) {
try { Element.remove(ids[x]); } catch (err) {} // do nothing
}
}
You can check the whole code for simplicity here.
Finally, I reinstalled my OS and used Ubuntu Feisty and it’s quite awesome! The installation was very easy and I like it very very much compared to my old Breezy. Most of the applications that I use are already in the synaptic so I don’t have to bother looking for them. I am quite one of those users who just want to click and run and ready to use. What really made the difference now is that I have an idea of the linux OS so I know how to navigate my desktop compared 6months ago that I was so clueless and afraid of this OS. Aside from having Feisty, there are also some things that I have learned I couldn’t live without:
Zend studio editor - I tried not to install Zend at the first few days after I installed feisty just to try some editors but I didn’t find anything that match my favorite feature, the autocomplete. At those days I couldn’t really do my work with much productivity. I used either Kate or Gedit but non of the 2 really satisfies me as a complete editor.Well, I tried the phpEclipse before but I didn’t really bother to use it since I have to do some configuration. Honestly, the only thing that makes me like an editor is the autocomplete power which Zend editor has, the left panel where I can see my files and the tabs which make my navigation faster. I hope there is an opensource tool like that. Please let me know if there is one existing.
Firefox - ofcourse, this is just one of those I can’t live without as long as I am a programmer specially my favorite extensions: firebug, web developer and del.icio.us buttons
IE - well, I have to live with it even if the world ends
Krusader - Just found this a few weeks ago. It’s a file manager but I use it as my FTP manager since I only need regular FTP connections. I used the gFtp before but it always crushes and it has become annoying. My favorite tool using Krusader is the Compare file content and the drag and drop copy of files. I use the xxdiff to do the comparison thing and it is really really helpful specially now that I have been involve in a project where we are a group. The drag n drop is just something I have always been looking for in FTP managers for linux. Also, I am able to open as many connections as I want using different windows. The best part is the bookmarking of sites and able to save their logins. I still have a lot of things I haven’t explored in this app yet but I think it is already great!
Tomboy - this is my piece of paper in my desktop and I like taking notes of any idea that pops up at any time of the day or just merely saving some users and passwords. It is really great to have it on your desktop.
KColorChooser - a color palette editor and color picker for KDE. I used this before when I was not aware of the difference of KDE applications and Gnome applications so I really didn’t mind installing it. Anyway, someone told me about gcolor2 and agave. I have installed them and will try but I am already satisfied with the accuracy of kcolorchooser so I really dont mind if it’s for KDE.
Gaim - or pidgin.. Gaim is already installed in Ubuntu so I didn’t bother to upgrade to pidgin.
And one of the most helpful thing I found just lately using Linux - the grep command line. My work always consist of debugging and tracing codes so looking for a specific function or line in hundreds of files, that is just some kinda ninghtmare. Thankfully I just use this
grep -R 'line to search for' /my/directory
and that’s it! I found what I am looking Is there such tool in windows like that? I tried to use the file search of crimson editor but it doesn’t give me the details I want.
Finally is graphics editor like Photoshop. I just hope there is a Photoshop version for Linux and I do not have to go back to windows again. I use gimp as an alternative but I just don’t see myself learning it in the near future
Well, those are just the stuff that I have to take note off when I plan to reinstall my pc again!
From this entry in lifehacker.org, the following really intrigues me:
Don’t worry about your personality. You don’t really have one. Personality, like ego, is a concept invented by your mind. It doesn’t exist in the real world. Personality is a word for the general impression that you give through your words and actions. If your personality isn’t likeable today, don’t worry. You can always change it, so long as you allow yourself to do so. What fixes someone’s personality in one place is a determined effort on their part—usually through continually telling themselves they’re this or that kind of person and acting on what they say. If you don’t like the way you are, make yourself different. You’re the only person who’s standing in your way.
huh? what does that mean? maybe I just should sleep first and read this tomorrow to get the idea. What do you think?
I am always amazed by tattoe artworks and when I saw this one my curiosity arose more. By searching the web, I found out that you can create your own artwork with these free brushes and this. I tried to do some but I couldn’t make one that I’ll be proud to post here but maybe you could. Just a warning, the brushes are quite big in size (I wanted to load them all but my pc just hangs
) Also, because they are free, they have terms on using it so please be sure to read them as well if your planning on using it other than for personal use.
Enjoy!
I’ve always known that in my blood lies the blood of a cook! Hehe.. dramatic, ain’t I? Seriously though, Kapampangans, people from Pampanga where I belong, have been known as excellent cook. I never know why until I found this article that drives us to Pampanga cuisine. Well, aside from the historical aspect of that article which is not the focus of this post, it also lists some of the best foods (and exotic too) that we always offer to strangers. My mood todays tells mo to tell you something about the famous and not too famous buro which my family and relatives, except me, loves! Buro is a fermented rice with fish or small shrimps (a.k.a. balo-balo, tag-ilo). Buro is a Tagalog word which also means preserved in salt, picled or salted. It is always served as an accompaniment for fried or grilled fish and some vegetables.
A detailed howto create a buro was written in this blog. Just scroll down a bit and check the pictures to see a glimpse of how they do it.
Below is the buro - the whitish one besides the fishes.
Picture from Flickr
I always ask my mom what is so good about it and always answer me with, ‘Try it to find out’. Maybe I will when I get a cold so I can’t smell it! Here is some info for you but I couldn’t agree nor disagree
How does it taste? It is slightly sour, delicately salty and unmistakably garlic-flavoured with an underlying taste of shrimp. How is it supposed to be eaten? Definitely not like how May-May eats it although some of my obsessed cousins have used it as sandwich filling. The proper way of eating it is with fresh mustard leaves, steamed vegetables and broiled fish. And how do the first-time eaters like it? The proof of the paste is in the taste…
Nowadays, they only not use the shrimp/fish to make a buro. I heard that the meat of pigs are also being used but they are called etak in Bagiou City. The counterpart of this food in Korea is the Kimchi and in Japan is the Sushi..
This is just one of those exotic food to look for if you come here. I’ll post another one, the Kamaro, which is I guess the least food I will ever eat ever! But it never really ceases to amaze me that my brother and others can really chew that thing.. more info in the future
The faces of the overworked women..
2007 version
So I warn you people, don’t let women get super stressed in work, you might regret what they will do after office hours
LOL .. I hope they won’t see this post, otherwise, they are going to kill me.. I better run for my life !!
Recent Comments