5.14.2010

iPhone Test

Nas & Damian

3.22.2010

Rihanna's Rude Boy

Now Rihanna's Rude Boy gets No.1 at Billboard chart.
I like this song since I heard her album because this song's mood fits her caribbean roots & melody line additionally written by Niki Minaj is so fresh!

Google App Engine Oil Rebooted!

The new version of Google App Engine Oil came!
Its feature is WSGI compliant. So if you want to leave google app engine,
you can move your web-apps to another server easily more than ever(although
you need to change DB from big-table to other.

http://gaeo.org/

11.12.2009

Google App Engine Oil is fantastic!

To make Google App Engine , there are two ways using python or java.


Java makes virtually another language like Ruby or PHP work. So I love RoR(Ruby On Rails), I tried to use RoR on GAE looking these site.


http://jruby-rack.appspot.com/
http://rails-primer.appspot.com/


It worked! That's great but the motion was very slow so I got so many errors(on GAE s request handler has a limited amount of time to generate and return a response to a request, typically around 30 seconds).
So I decide to switch Ruby to using Python.


GAE's python allows to use Django framework which likes RoR. I was new to Pyhton & Django. But To learn python was easy. However I didn't feel happy using Django because the differences of it and RoR(I think Django is good framework though). When I was stopping to try using GAE, I met Google App Engine Oil(GAEO).


http://code.google.com/p/google-app-engine-oil/


This is another framework on GAE using python. GAEO's feature is very similar to RoR and very compact. If you liked RoR style, you like GAEO too.


By the way, though above official site has some tutorials, there were small information about GAEO now. Yesterday I post on GAEO's google group a sample code of how to make the page using form.
http://groups.google.com/group/google-app-engine-oil/browse_thread/thread/a9989a23d3a15e32


the same step & source code are here.

(0) install GAE(python) & GAEO on your PC
Install GAE sdk:
http://code.google.com/intl/en/appengine/docs/python/gettingstarted/introduction.html
Install GAEO:
http://doc.gaeo.org/tutorials/getting-started



(1) At Terminal
gaeogen scaffold Testform index new create show




(2) Make model: edt application/mode/testform.py



from google.appengine.ext import db
from gaeo.model import BaseModel, SearchableBaseModel
class Testform(BaseModel):
    name = db.StringProperty(required=True)
    secret = db.StringProperty(required=False)
    phone = db.PhoneNumberProperty(required=True)
    post_at = db.DateTimeProperty(required=True, auto_now_add=True)




(3)Make controller(at application/controller/testform.py)

import cgi
from google.appengine.ext import db
from gaeo.controller import BaseController
from model.testform import Testform
from google.appengine.ext.db import djangoforms
class TestformController(BaseController):
    def create(self):
      data = AddForm(data=self.request.POST)
      if data.is_valid:
        entity = data.save(commit=False)
        entity.update_attributes(secret= "foo")
        self.redirect('/testform')
      else:
        self.redirect('/testform/new')
    def index(self):
        query = Testform.all()
        self.result = query.fetch(limit=1000)
    def new(self):
        self.form = AddForm()
    def show(self):
        self.r = Testform.get(self.params.get('id'))
class AddForm(djangoforms.ModelForm):
  class Meta:
    model = Testform
    exclude = ['secret']




(4)Make new.html(At application/templates/new.html) : you just add
only {{ form }}



{% extends "../base.html" %}
{% block title %}TestformController#new{% endblock %}
{% block content %}
        
New Testform {{ form }}
{% endblock %}



(5)Make show.html(At application/templates/show.html) :



{% extends "../base.html" %}
{% block title %}TestformController#show{% endblock %}
{% block content %}
{{ r.name }}:{{ r.phone }}:{{ r.secret }}
{% endblock %}




Enjoy!

11.11.2009

From today I'll try to write blog in English.

I'm a Japanese web producer.  To make my English brushed up,
I decided to write blog in English from today. Because I like today's number: 1111 :)

At this blog  I will post mainly web-programing-tips about Ruby(RoR), Python, PHP, Javascript and ActionScript. However sometime I'll post theblog about music. I love R&B, Hiphop, Reggae. This blog title is the pun of Curtis Mayfield's greatest song"The Making Of You".  So many artist
covered this song like below:

Gladys Knight
http://www.youtube.com/watch?v=i9BRHiAZFSs&feature=fvw

Lauryn Hill
http://www.youtube.com/watch?v=lrYS_-ASt1Y&feature=related

Monica (this is not cover but using Curtis sampling)
http://www.youtube.com/watch?v=p_7_b9NsQsg&feature=fvw

Aretha Franklin
http://www.youtube.com/watch?v=loD2YCZLdC4

enjoy!