Draw and Replay with Processing.js

Posted on September 29th, 2008 in Programming | No Comments »

Over the lab, i had experiment with processing.js and i came up with something like you draw whatever you want and click the reply button, it will draw back everything that you had drawn. Processing.js like jQuery will have a huge future, and making it was really a good experience. Link is:
http://monmonja-labs.appspot.com/javascript/?content=processing1

Monmonja Labs follows monmonja design

Posted on September 28th, 2008 in Announcement | No Comments »

Monmonja Labs has been redesign to follow monmonja’s desgin. The transition was a bit hard coz the labs is hosted under Google App Engine (not visible in china?) meaning its server side language is Python so a lot of changes we’re made and new learning had been added. There is no new experiment but a video linking to the current status of HTML5. There is still a lot of changes needed to be made within the whole monmonja network like the page title is a bit mess or some page have no title, no seo stuff had been added, no rss and a lot more. My goal right now is to have my first adsense check and i’m still damn far about from it. ahhaha

Monmonja Music Released

Posted on September 27th, 2008 in Announcement | No Comments »

After few months of redoing the music part of monmonja, it finally come to its beta version, the greatest change on the new site is the interface, i made it as clean as i could. Another change is the removal of Joomla, and went directly by using cakephp. As the site progresses more API will be included (i hope) and more content. To check out the new site Monmonja Music

Templatetags on App Engine

Posted on September 25th, 2008 in Google, Programming | No Comments »

Making templatetags on App Engine is a bit different from the real django. Here is how i made mine.

* Create a templatetags folder under your root folder
* Create a empty file named __init__.py
* Create your templatetags file, for this example we will use ads_manager.py
Open your ads_manager.py and enter the following code
from google.appengine.ext.webapp import template
register = template.create_template_register()
def checkShowAds(remote_add):
if remote_add == "127.0.0.1":
return ""
else:
return "ADS HERE"
register.filter("checkShowAds",checkShowAds)

from google.appengine.ext.webapp import template
– means import the template class from the package google…

register = template.create_template_register()
– register this template or something like that

def checkShowAds(remote_add):……………..
– our function

register.filter(”checkShowAds”,checkShowAds)
– add our function as custom filter

May Madness Sale at Firebox.com

Next stop is to open your python file that you will use this templatetags/filter
and insert the following code
from google.appengine.ext.webapp import template
template.register_template_library('templatetags.ads_manager')
class MainPage(webapp.RequestHandler):
def get(self):
template_values = {
'remote_add': self.request.remote_addr
}
directory = os.path.dirname(__file__)
path = os.path.join(directory,os.path.join('templates','index.html'))
self.response.out.write(template.render(path,template_values))

template.register_template_library(’templatetags.ads_manager’)
– What this do is that it register your templatetags so you can use it on your template/view.

class MainPage(webapp.RequestHandler):……
– This and the rest of the code will just render your template while passing the remote address as ‘remote_add’ variable

Next is to open your template and add the following:
{{ remote_add|checkShowAds }}

I hope this helps. It took me days to understand the basic concept of how templatetags on app engine works.

Making CakePhp and Session Work

Posted on September 25th, 2008 in Php, Programming | No Comments »

If you have been developing website that uses cakephp, you might stumble upon an annoying time when your session is not working. Here are some tips on how to make it work.

1) Configure::write(’Security.level’, ‘medium’);
On your core.php search for the line Security.level, by default this is configured to be high. Most of the time changing this will make your session work.

2) Configure::write(’Session.checkAgent’, false);
Also on your core.php, checkAgent will check your HTTP_USER_AGENT, which retrieves your browser and computer information, most of the time and i don’t know why IE will have a problem with this. By default the setting is set to true, try setting it to false and see if your session works.

3) session.cookie_path
Some times when your session.cookie_path is different from the root folder, Session and CakePhp will not work. A simple solution is to set Session.start on core.php to false. And on your AppController (app_controller.php) or on every Controller that you have to use session, set the following on the beforeFilter function
function beforeFilter(){
$this->Session->activate('/');
...
}

GameDuell Inc. - Play Sudoku

4) Headers already out before CakePhp gets the Session
This took me hours before figuring out what’s the problem with my Session and this is the reason why i wrote this post. Anyway, to check if your headers are out before cake fire session_start, first create a dummy page what will definitely fire a session, create it under webroot folder. For example create a file named session.php under webroot with the following code:
<?php
session_start();
$_SESSION['test'] = “testing”;
?>

Access it by your browser (http:/xxxx/session.php).

Next step is to go to your cake folder, then libs folder, then open session.php. Locate for the word “function __startSession” and change the following lines
function __startSession() {
if (headers_sent()) {
if (!isset($_SESSION)) {
var_dump($_SESSION);
$_SESSION = array();
}
return false;
.....

Now definitely there should be something on the $_SESSION, if not or you have an empty array then you have a problem with spaces on your files, you can check the controller your calling from, the models, the components and see if you have a space on the top or the bottom. If your sure you have none, then check if the file was meant to run under linux, windows or unix. If you still have a problem then check the file encoding, if you are using UTF-8 select the one without BOM. If you still have problem then ask google to help you. :)

Monmonja Changes

Posted on September 19th, 2008 in Announcement | No Comments »

There is a template change in the whole monmonja, first because i think the last template was not simple enough for me and secondly coz i’ve been hacked twice, one on the joomla integration and the other on the phpbb forum, the forum will be temporarily closed and will be pushed back to live once the template has been integrated, another reason is that the old one was build by other people so it was harder for me to change it and i even don’t know if the license permits me.

The template was tested on IE6,IE7,FF3,Chrome and Opera. Firefox and Chrome or webkit based browser will have a better view due to their css capability.

To the people who hacked me, please don’t hack this site!!!
I dare you to hack big sites not small sites like this (i dont even get 100 views a day, aha)… Thanks

Microsoft Ads

Posted on September 14th, 2008 in Microsoft | No Comments »

The second ads with Jerry Seinfeld has been release, even tough i don’t get the meaning of it especially the first one, the new one made me laugh especially the bed story telling with bill and the robot thing at the end.

Here is the second ads:

How to disable textfield on AS3

Posted on September 7th, 2008 in Programming | No Comments »

This took me 2 hours to find out how to disable textfield on AS3, its not the perfect solution but it seems to be the only solution.

private var txtField:Textfield;

this.txtField = this.getChildByName(”txtField”);
this.txtField.mouseEnabled = false;
this.txtField.tabEnabled = false;

and to turn it enable again:
this.txtField.mouseEnabled = true;
this.txtField.tabEnabled = true;

While this sound cheap coz you have to disable the mouse and the tab of that component and not the component itself, it seems to be the only solution. Thanks Adobe!!!!!!!!

Google Chrome and its significance to computing

Posted on September 7th, 2008 in Google | No Comments »

Google chrome was released last week and its already got around 2-4% of US market share, while its sounds so small, actually it a lot, if you compare it to opera or safari which took them years to get to 4% it only took google one week or even a day. I really hate the news when i saw it before the day it was released, and the reason was we web developers have to cater another browser with different javascript engine.

But this move brings significance to the whole computer industry, of course its not just Google Chrome but other stuff that make news this few week. One of them is JIT or Just in Time Compiler, thanks to Adobe for opening their Javascript JIT engine, we can see the result of these in TraceMonkey, the javascript engine of the next version of firefox and V8 the javascript engine of Google Chrome, so whats so good about it? The source are now compiled like java or .net and the browser need not to download binaries, this will make javascript to be executed a lot faster, 4-10% of the current speed.

Another thing which i believe google will do in the long run is the instant on linux(SplashTop) feature and they might even release a computer of their own, with this one feature sort of a cloud book but with no operating system except the prebuild linux and their android team will help them achieve this goal. Currently SplashTop includes firefox as the build in browser, but i’m looking at the opportunity that once Chrome reached the linux land they will make a dell with them or they will make their own.

Is this the end of MS? I don’t think so but i do hope that its the end of IE, ahha. Coz after IE8 is released we have to cater 3 browser from MS and that sucks. This is actually good for MS coz now their force to do better but the question now is that will IE8 commit to its promise of being standard or web programmer will just ignore them in the long run when firefox, safari, chrome and opera (all comply to the standard) reached over 50% of market share?

Google Android will be big because of China

Posted on September 1st, 2008 in Google, Technology, android | No Comments »

Why China? Have you guys seen any phones from china that looks exactly like the real phone except the ugly interface? I personally believe that would change because of android. Why? Here are some of my reason.

* Operating System - These small mobile company made their own mobile os simply because they could not use Symbian or Windows Mobile os or Apple due to the license stuff, dont know about Symbian now that they are open source. So it would be wise for these company to stop making their own and just use something that is already build then just remodify some part of it.

* Cost - Making your own mobile os with all the programmers that you will hire to do all the stuff that will make your mobile work is way too expensive for these company compare to using something that is already build. Not just they have to pay for their people to do the software, they also have to pay over the maintenance of it, translation of the manual and some technical support to their client???

Musicnotes.com

* Revenue - Over the 3rd world countries, mobiles from China are hot, why? Not just because their cheap but because of the features but some people especially the one who can afford to buy 2nd class phones would not buy them, why? Not because they think its cheap but because they hate their first experience they had with these phones because of the interface. So using android would make them more richer.

* Innovation - This is purely my imagination, but i forecast that the Chinese people will not just make android on smart phone but on different gadget as well, like PMP, PDA, and Laptop computer (they might port it, these people are freakin awesome and insane)

I believe that smart phone will be huge and China will pay a major role on it. But what’s with Google on this? The more android phones they got, the more people will have use their services, the better standing they will get not just in China but over the globe. So its better for everyone after all.