July 16, 2010

Another adventures and experiments with Play on my Linux !!

July 16, 2010 0
Hey everyone,
Along with my recent adventures and experiments with Play, I decided to force myself to become more proficient with Play. For all those who don't know what “Play” is , I will give u all a just of it..

The Play framework is a clean alternative to bloated Enterprise Java stacks.

I think its very nice framework to make web-based application by using any editor like Komodo or Emacs,and it provides libraries for database access,error handling,templating framework and session management,security,an automated test suite, a shiny web interface and an administration area and it also provides the codes for reuse.


so, if u still feel like I need to be set straight,any suggestion or any question,Send me an email.

Anyway,
I have been using Linux since about 2007.
I had JAVA self extracting file which was given to me by Mr. Jitendra Vishwakarma.
So,I tried to run play in my Linux with the help of documentation.
I had java ,but "i don't know how to install it?"

Ever since I first started using Linux, I have been using Terminal for installing most of software's and applications...even today I do so.. ,
really I don't know many commands of Linux.


So, once again I started searching on Google about "how to install java in Linux ". I found solution for it and I dabbled with a tutorial here and there...and finally I get the java on my Path.

My recent experiment with JAVA Installation has proved to be very fruitful, I say so to myself.

If anyone is much interested to know "how to install the java in Linux?",then follow the instruction and commands.

~~~~~~~~~~~~~~~~~~~~~~~~
Download and copy jdk-6-linux-i586.bin to $HOME/src (or a location of your choice).
type>>
% su -

(some linux use "su" command and some don’t. So in such a case, use the "sudo" command and it will prompt you for a enter admin password. once u have entered the password it will not ask u again and again during the editing, deleting, moving the files .)

"I don't know much about the RedHat and the Solaries,but as I have worked on ubuntu based linux, it accept the "sudo" command...."

~~~~~~~~~~~~~~~~~~~~~~~~

#su (or sudo)
# mkdir /usr/java (if it doesn't exist or start the line with "sudo")
# mv $HOME/src/jdk-6-linux-i586.bin /usr/java (if it doesn' start line with "sudo")
# cd /usr/java (if it doesn' start line with "sudo")
# chmod +x jdk-6-linux-i586.bin (if it doesn' start line with "sudo")
# ./jdk-6-linux-i586.bin

~~~~~~~~~~~~~~~~~~~~~~~~
It will extract all the files of java and install it in your system.
~~~~~~~~~~~~~~~~~~~~~~~~
Set the PATH and JAVA_HOME environment variables: (/etc/profile, $HOME/.bashrc or $HOME/.bash_profile).

PATH=$PATH:/usr/java/jdk1.6.0/bin
JAVA_HOME=/usr/java/jdk1.6.0
export PATH

~~~~~~~~~~~~~~~~~~~~~~~~
for more information about Java Installation try this "Enterprise Java for Linux HOWTO".

After installing the java,I started developing the Simple Web-Application in Play.
Here are the steps of creating application.

Installation of play is very simple.
Just download the latest binary package from the Play download page and unzip it to any path. Play uses command line a lot for creating,running and testing the application,it’s better to use a Linux or MacOS ,if you are using windows,its also fine.

Play is correctly installed,now start Creating a Play application is pretty easy and fully managed by the Play command line utility.That allows for standard project layouts between all Play applications.

Open a new command line and type:

$python play new helloworld

It will creates a new helloworld application.
now we need to test it if its working or not?

For run the application>Open a new command line and type:

$python play run helloworld/

Play will now load the application and start a Web server on port 9000.
You can see the new application by opening a browser to
http://localhost:9000


Here is the snap of the simple " hello-world "application and "how to set the JAVA_HOME path in snap"

And follow the Documentation for making "helloworld" application.

Click On the Image
To See The Tested "Hellowrld" Application.

Read more...

July 14, 2010

PlayFramework on my linux !!

July 14, 2010 0
Hey everyone,
Along with my recent adventures with play,I decided to force my self to become more proficient with Play.For those who don't know about the play ,

"The Play framework is a clean alternative to bloated Enterprise Java stacks. It focuses on developer productivity and targets RESTful architectures." I think its nice framework to make web-based application with the help of using any editor like Komodo or Emacs...rather than using "DotNet technology or NetBeans with JAVA" for making the Web-Based application.

There are often religious-grade battles those who believe in .net framework and NetBeans,another surviving application development technology, editor and framework for making web-based application using JAVA environment or etc.

I'm not trying to get into any debates about which is better and I'm not interested to know why I should not be using the .Net Technology or NetBeans for my project.
so,if u still feel like I need to be set straight,Send me an email

Anyway,
I have been using Linux since about 2007.
I had JAVA self extracting file which was gave me Jitendra Vishwakarma.
So,I tried to run play in my Linux with the help of documentation.
I had java ,but "i don't know how to install it?"

Ever since I first started using Linux, I have been using Terminal for installing most of software's and applications...at this time also ,really I don't know many commands of Linux.

So, once again I started searching on Google about "how to install java on Linux ". I found the solution for it and I dabbled with a tutorial here and there...and finally I get the java on my Path.

My recent experimentation with JAVA Installation has proved to be very fruitful, if I do say so myself.


If any one much interested to know "how to install the java on Linux?",then follow the instruction and commands.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Download and copy jdk-6-linux-i586.bin to $HOME/src (or a location of your choice).

type>>

% su -

(some linux are accept the "su" command and some are not,So in case of this problem use the "sudo" command.And it will prompt you for a enter admin password,once u have entered the password it will not ask u again and again during the editing,deleting,moving the files .)

"I don't know much about the RedHat and the Solaries,but ubuntu based linux accept the "sudo" command...."

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


#su (or sudo)
# mkdir /usr/java (if it doesn't exist or start the line with "sudo")
# mv $HOME/src/jdk-6-linux-i586.bin /usr/java (if it doesn' start line with "sudo")
# cd /usr/java (if it doesn' start line with "sudo")
# chmod +x jdk-6-linux-i586.bin (if it doesn' start line with "sudo")
# ./jdk-6-linux-i586.bin


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It will extract all the files of java and install it in your system.

Set the PATH and JAVA_HOME environment variables: (/etc/profile, $HOME/.bashrc or $HOME/.bash_profile).


PATH=$PATH:/usr/java/jdk1.6.0/bin
JAVA_HOME=/usr/java/jdk1.6.0
export PATH



for more information about Java Installation try this Enterprise Java for Linux HOWTO.


After installing the java,I started developing the Simple Web-Application in Play.
Here are the steps of creating application.

Installation of play is very simple.
Just download the latest binary package from the download page and unzip it to any path.Play use the command line a lot, it’s better to use a Unix-like OS.

Play is correctly installed, it’s time to create the hello world application. Creating a Play application is pretty easy and fully managed by the Play command line utility. That allows for standard project layouts between all Play applications.

Open a new command line and type:


$python play new helloworld


It will creates a new helloworld application.
now we need to test it,either its working or not?

For run the application>

Open a new command line and type:

$python play run helloworld/



Play will now load the application and start a Web server on port 9000.
You can see the new application by opening a browser to http://localhost:9000

Here is the snap of the simple " hello-world "application and "how to set the JAVA_HOME path in snap"
And follow the Documentation for making "helloworld" application.

Click On the Image
To See The Tested "Hellowrld" Application.

Read more...

My first Encounter with PlayFramework !!!!

July 14, 2010 2
Its a story very funnny and yet close to my heart...
I just thought to share this with you.

One month prior,everything in my life was going fine and very smooth. I was very happy with my python,my Django and was very engrossed in making different different application as a testing. I was so much happy and content with my work.. It seems that i got everything I'm my life. Don't want anything else now..

Now as I'm in Final year of my Computer Science course i decided to make a very dynamic application which i haven't made yet,something big and challenging which will be my best work uptil now and i should reach my satisfaction level.....

The day wen i went to college and i was still very happy with my plannings.. But the moment wen i got syllabus from my class teacher "Mr. Aishwarya Garg" and wen i just glanced on it..all my excitement was shattered....... projects have to be made either in "JAVA" or in ".NET"...

That day was the worst day...I was very sad and totally discontent.... I wanted to pursue something big in Python...It's my passion....i just wanted to work in it only.... whole day i was thinking about python,syllabus,.Net and JAVA....My head was spinning between all of them....

Finally at night when i came out of trauma that i was going through during the whole day... i started thinking now what should i go with.... I m not interested to learn "Dot Net" because most of my friends are going to make "Windows Application" using ".NET "...
so i was not willing to think about it...I just ignored it.....

The only option left was to select "JAVA"...
"JAVA" was something that i am not interested to learn it for project, i also don't love it as the way i love "PYTHON"...but anyhow i made my mind and selected "JAVA" in utter pain....

I decided to make a "web application in java...." but i don't know much about it excepts for the basic concepts.... but that was not a prob...."

I told myself "MERE PASS GOOGLE HAI"...
This word came from my Guru "PAVAN" who taught me to "how to use Google ?" and always he told me "Google Se pooch ! " . So thanks to him.
" GOOGLE gives me all my answers.... "

I started my rigorous searching on Google about "WEB-FRAMEWORK IN JAVA ".
I'm searching...searching......but nothing excited me as my Python and Django
I just love them....
My search was going on and on and on...
Then it was around 3am morning wen i started getting tired and sleepy....but i dont want to give up....i don't wanted to sleep....all that i wanted was to search something that excites me....

I started getting hungry, i went in kitchen to search something so that i will not get sleep....
I got my favorite "PARLE 20-20 (Short may niptao)"
My mom anyhow came to know that I'm still awake and she started shouting at me...
"kitna pareshan karta hai...din may bhi nai sota and raat may bhi jaagta rehta hai...kab soega...soja"
but I hate wen somebody disturbs me in my work....
I told her "Mom tum so jao...main thode der me sounga..."

Now I sat in front of My Computer and started eating cookiee biscuit ...and again continued hunting for web framework........
I found many "java web-frameworks".when I came across Cocoon.....But my mind said NAaaaa its not interesting.......Then "Cricket"...."hmm sounds good" but i was excited to know more about other java web-framework...
I just opened my notebook and wrote the name "Cricket" and continued searching.....
heehehehe.... then i came across "Spring,Struts,Tapestry " etc....
but they were heavy ..
it dint excited me.......
I got irritated but still kept my search on......
Then as i was surfing... and i wrote on Google "light-weight web-framework for java".....then I selected one hyperlink....
Then something flashed in front my eye.....something that had a very excited name....... and I suddenly stop and read it.......

It was "PLAY"............what...play...What is it? i started scratching my head....the moment i clicked on it,all my prob came to an end....It has got a exciting name....then even i thought to play with it....I stared reading its documentation over and over an over....
I just cant stop reading it....plus its features and concept excited me.....It had a flavor like "Django" and "Ruby on Rails" that was the thing that increased my excitement and expectation a lot.... It was light,scalable,fast and robust and many more...more ...and more......wow...i was so happy with it...... I saw the demo video and thought that it is very easy to work with and something that i can do along with my TY studies and my python..plus it has got a beautiful look and feel and Admin facility just as my Django gives me....I quickly downloaded the software..and start testing in Windows XP.

I started discovering it more and more and more.......It was around 5am in morning...i got tense that whether i should go to college or not...but i didn't care much about it...i started installing it following all the steps written in Documentation....

But then i started getting error.... i was trying and getting seriously confused that I'm installing the way it should be....But man y it is not happening....y.....whats the prob yaar....
Then it showed a error.....

"sh:./play: /usr/bin/python: bad interpreter: no such file or directory"



It means it requires "Python".......what python.....I got excited but was also confused.....Then i started intense investigation....Out of all my Curiosity,I came to know that PLAY Framework which is a java web framework is using python...

Why Python ?? it was my first question..so i got the answer..
""
We need a lot of scripts to manage Play applications, like creating a new application, running it, launching a browser, etc… Of course we could write these in Java directly. But running a Java VM for simple tasks like project creation is very slow. And Java itself is very limited when it comes to OS interaction.

Python allowed us to write these scripts in a completely portable way. It’s fast to run, easy to write and available out of the box on most systems. It’s not on Windows, that’s why play comes with the bundle of a "Windows Python binary" with the framework.
""

.....wow.........i was so happy that time.....somewhere I'm using python too in my project........really it made me smile and all my search was not in vain.....
I finally selected it for my project...... I was so so so happy.......

I told this to all my friends.....They heard this for the first time....They gave me a very bad expression and suggestion....But huh...who cares for them...I told this to my mam, she gave me a very blank look ......but I have decided to go with it, so no body can change my mind....I have not selected it for the purpose of job or anything....It was something new that i came across, wanted to try it,
Play with it and give my best in it....... then i made a small "Hello World" application. It boosted my confidence......
I started working on it more and more and more.......This was my feelings before and after selecting the project..... Though it was sad in the beginning....excited and surprising in he middle but it was totally best at the end..........
Now wen i remember that day,,it brings smile on my face... I laugh for the way i searched and selected language.......
hehehe.....

see more about Play Web framework
Read more...

July 13, 2010

How to Improve your Skills as a Programmer.....

July 13, 2010 0
Gather complete requirements.

Take the time to write down what the end product needs to achieve. Clarity of thought at this stage will save a lot of time down the line.

Write an implementation plan (or model).

For something small and self-contained, this might just be a basic flowchart or an equation.
For larger projects, it helps to break it into modules and consider what job each module must do, how data gets passed between modules, and within each module how it will function.
Although it is fun to dive straight into code, it is equally tedious to spend hours debugging. By taking the time to design the structure on paper, you will drastically reduce your debugging time (and you may also spot more efficient ways of doing things even before you write the first line of code).

Add Comments to your code.

Whenever you feel your code needs some explanation, drop some comments in. Each function should be preceded by 1-2 lines describing the arguments and what it returns. (Comments should tell you why more often than what. Remember to update the comments when you update your code!)

Use naming conventions for variables.

It will help you keep track of what type the variable is and also what it's purpose is. Although this means more typing than x = a + b * c, it will make your code easier to debug and maintain. One popular convention is Hungarian notation where the variable name is prefixed with its type. e.g. for integer variables, intRowCounter; strings: strUserName. It doesn't matter what your naming convention is, but be sure that it is consistent and that your variable names are descriptive.
(See Warnings below)

Organize your code.

Use visual structure to indicate code struture. i.e. indent a code block that sits within a conditional (if,else,...) or a loop (for,while,...) Also try putting spaces between a variable name and an operator such as addition, subtraction, multiplication, division, and even the equal sign (myVariable = 2 + 2). As well as making the code more visually elegant, it makes it much easier to see the program flow at a glance.
(See tips on indentation below)

Test.

Start by testing it with inputs that you would typically expect. Then try inputs that are possible but less common. This will flush out any hidden bugs. There is an art to testing and you will gradually build up your skills with practice.
Write your tests to always include the following:

Extremes: zero and max for positive values, empty string, null for every parameter.
Meaningless values, Jibberish. Even if you don't think someone with half a brain might input that, test your software against it.
Wrong values. Zero in a parameter that will be used in a division, negative when positive is expected or a square root will be calculated. Something that is not a number when the input type is a string, and it will be parsed for numeric value.

Practice. Practice. Practice.
Be prepared for change.

In a realistic working environment, requirements change. However, the clearer you are at the start about the requirements and the clearer your implementation plan, the less likely those changes will be down to misunderstanding or "Ah, I hadn't thought of that" scenarios.

You can take an active role in improving clarity of thinking by presenting your requirements document or your implementation plans before coding to ensure that what you are planning to create is actually what's been asked for.
Structure the project as a series of milestones with a demo for each block. Approach the programming one milestone at a time - the less you need to think about at any moment, the more likely you will think clearly.

Start simple and work towards complexity.

When programming something complex, it helps to get the simpler building blocks in place and working properly first.
For example, let's say you want to create an evolving shape on screen that follows the mouse and where the degree of shape change depends on mouse speed.

Start by displaying a square and get it to follow the mouse, i.e. solve movement tracking on its own.

Then make the size of the square relate to mouse speed, i.e. solve speed-to-evolution tracking on its own.

Finally create the actual shapes you want to work with and put the three components together.

This approach naturally lends itself to modular code writing, where each component is in its own self-contained block. This is very useful for code reuse
(e.g. you want to just use the mouse tracking in a new project), and makes for easier debugging and maintenance.
Read more...

If programming languages were cars...

July 13, 2010 0
The list

* Ada

Ada is a tank. A butt-ugly tank that never breaks down. People laugh uncontrollably if you tell them you drive Ada, but really, do you want to be driving a sports car in a war zone? [from Amit Dubey]

* Assembly Language
is a bare engine; you have to build the car yourself and manually supply it with gas while it's running, but if you're careful it can go like a bat out of hell.

[From "Subterfug" off digg.com:]

Assembly Language: you are the car.

* Basic

Basic is a simple car useful for short drives to the local shops. Once popular with learner drivers, it has recently been stripped down to a shell and rebuilt by a major manufacturer, The new version has been refurbished for longer journeys, leaving only cosmetic similarities to the original model. [from Przemyslaw Wrzos]

* C

C is a racing car that goes incredibly fast but breaks down every fifty miles.

* Cobol

Cobol is reputed to be a car, but no self-respecting driver will ever admit having driven one.

* C#

C# is a competing model of family station wagons. Once you use this, you're never allowed to use the competitors' products again.

* C++

C++ is a souped-up version of the C racing car with dozens of extra features that only breaks down every 250 miles, but when it does, nobody can figure out what went wrong.

* Eiffel

Eiffel is a car that includes a built-in driving instructor with a French accent. He will help you quickly identify and learn from your mistakes, but don't you dare argue with him or he'll insult you and throw you out of the car. [From Daniel Prager with some embellishments]

* Erlang

Erlang is a fleet of cars that all cooperate to get you where you want to go. It takes practice to be able to drive with one foot in each of several cars, but once you learn how you can drive over terrain that would be very hard to navigate any other way. In addition, because you're using so many cars, it doesn't matter if a few of them break down.

* Forth

Forth is a car you build yourself from a kit. Your car doesn't have to look or behave like anyone else's car. However, a Forth car will only go backwards.

[By "256byteram", on a comment on Digg.com (I couldn't resist):]

FORTH LOVE IF HONK THEN !

* Fortran

Fortran is a pretty primitive car; it'll go very quickly as long as you are only going along roads that are perfectly straight. It is believed that learning to drive a Fortran car makes it impossible to learn to drive any other model.

* Java

Java is a family station wagon. It's easy to drive, it's not too fast, and you can't hurt yourself.

* Haskell

Haskell is an incredibly elegantly-designed and beautiful car, which is rumored to be able to drive over extremely strange terrain. The one time you tried to drive it, it didn't actually drive along the road; instead, it made copies of itself and the road, with each successive copy of the road having the car a little further along. It's supposed to be possible to drive it in a more conventional way, but you don't know enough math to figure out how.
[Monadic version:]

Haskell is not really a car; it's an abstract machine in which you give a detailed description of what the process of driving would be like if you were to do it. You have to put the abstract machine inside another (concrete) machine in order to actually do any driving. You're not supposed to ask how the concrete machine works. There is also a way to take multiple abstract machines and make a single abstract machine, which you can then give to the concrete machine to make multiple trips one after another.

* Lisp

Lisp looks like a car, but with enough tweaking you can turn it into a pretty effective airplane or submarine.

[from Paul Tanimoto:]

Lisp: At first it doesn't seem to be a car at all, but now and then you spot a few people driving it around. After a point you decide to learn more about it and you realize it's actually a car that can make more cars. You tell your friends, but they all laugh and say these cars look way too weird. You still keep one in your garage, hoping one day they will take over the streets.

* Mathematica

Mathematica is a well-designed car that borrowed a lot from the Lisp car without giving it nearly the credit it deserved. It can solve equations to determine the most efficient way to get to the destination, but it costs a fortune

* Matlab

Matlab is a car designed for novice drivers going on short trips over terrain similar to the terrain the Mathematica car is usually driven over. It is very comfortable when driving over this terrain, but if you go off the trail even a little the car becomes so hard to drive that more snobby drivers refuse to even acknowledge that it's a car.

* Ocaml

Ocaml is a very sexy European car. It's not quite as fast as C, but it never breaks down, so you end up going further in less time. However, because it's French, none of the controls are in the usual places.

* Perl

Perl is supposed to be a pretty cool car, but the driver's manual is incomprehensible. Also, even if you can figure out how to drive a Perl car, you won't be able to drive anyone else's.

* PHP

PHP is the Oscar Mayer Wienermobile, it's bizarre and hard to handle but everybody still wants to drive it. [from "CosmicJustice" off of digg.com]

* Prolog is fully automatic: you tell it what your destination looks like, and it does all the driving for you. [Addendum from Paul Graham:] However, the effort required to specify most destinations is equivalent to the effort of driving there.

[I forget who suggested this one:]

Prolog is a car with a unique trial-and-error GPS system. It will go down the road looking for your destination, and if it gets to the end of the street without finding it, it will back up and try the next street over and continue until you get where you need to go.

* Python

Python is a great beginner's car; you can drive it without a license. Unless you want to drive really fast or on really treacherous terrain, you may never need another car.

* Ruby

Ruby is a car that was formed when the Perl, Python and Smalltalk cars were involved in a three-way collision. A Japanese mechanic found the pieces and put together a car which many drivers think is better than the sum of the parts. Other drivers, however, grumble that a lot of the controls of the Ruby car have been duplicated or triplicated, with some of the duplicate controls doing slightly different things in odd circumstances, making the car harder to drive than it ought to be. A redesign is rumored to be in the works.

* Smalltalk

Smalltalk is a small car originally designed for people who were just learning to drive, but it was designed so well that even experienced drivers enjoy riding in it. It doesn't drive very fast, but you can take apart any part of it and change it to make it more like what you wanted it to be. One oddity is that you don't actually drive it; you send it a message asking it to go somewhere and it either does or tells you that it didn't understand what you were asking.

* Visual Basic

Visual Basic is a car that drives you. [from "yivkX360" on digg.com, no doubt channeling Yakov Smirnov
Read more...

July 10, 2010

I got a speedy Linux "# !" for my desktop.

July 10, 2010 0
CrunchBang Linux is an Ubuntu based distribution offering a great blend of speed, style and substance. Using the nimble Openbox window manager, it is highly customisable and provides a modern, full-featured GNU/Linux system without sacrificing performance.
CrunchBang Linux comes with the ability to play most popular media formats, including but not limited to MP3, DVD playback & Adobe Flash. CrunchBang Linux also comes with many popular applications installed by default, including but not limited to Firefox 3 web browser, VLC media player, Skype and Transmission BitTorrent Client.

Thanks to my friend Harsh Shah,who give me the #! Linux.


Read more...

May 17, 2010

Django-Python Web Framework

May 17, 2010 0
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Developed four years ago by a fast-moving online-news operation, Django was designed to handle two challenges: the intensive deadlines of a newsroom and the stringent requirements of the experienced Web developers who wrote it. It lets you build high-performing, elegant Web applications quickly.

Read more about django from
Django Web Framework

Django focuses on automating as much as possible and adhering to the DRY principle.
Now Django 1.2 is release.

Download django from here,
Django 1.2 download
Read more...

My first website "OnRoute Courier & Cargo " in django.

May 17, 2010 0
My first website,
The OnRoute-courier&Cargo website is fully powered by django.
This website is also written in Ruby and Python scripting languages and also available on Google-App-engine.
Thanks to Pavan Mishra,who help me to develop this website on Django.
Pavan also made this website on Ruby and Rails.which is hosted as onroute.in.
Here is some snaps of the Website..
powered by Django...developed by me

Home page


The Administration of consignment of OnRoute



Django site Administration



See the original website which is powered by Ruby-Rails....
Onroute Courier & Cargo
Read more...

"Xpress Courier & Cargo " in Google Appengine

May 17, 2010 0
Now,its my second Project,
which is developed in Google Appengine.
This website is also made in Django with the use of python as a scripting language.
Thanks to Pavan Mishra ,who help me to develop this website on Google Appengine.
Here is the URL xpressCC .

Here is some snaps of the Website..
powered by Google Appengine...developed by me.

Its not a complete website,its a development version.



Home Page .




Adding Consignment.




Deleting Consignment from the List.

Read more...

May 14, 2010

Writing programs gives you the power to control your PC.

May 14, 2010 0
Almost everyone knows how to use a computer,but few people take the step and learn how to control it.if you use others people's software,you will be always limited by what other people think you want to do.Write your program and only the limit will be your own imagination.Programming will make you more creative.It will make you think more precisely,and it will teach you to analyze and solve problem logically....

Do you want to be programmed or be the programmer ?

Read more...

May 07, 2010

say Hello, World! in Google Appengine.

May 07, 2010 0


Lets start.
# Creating a Simple Request Handler :-
Python App Engine applications communicate with the web server using the CGI standard. When the server receives a request for your application, it runs the application with the request data in environment variables and on the standard input stream (for POST data).

* create an application directory.
if you are using Linux,create the application in the Google Appengine directory.
eg. google-appengine/

* Create a directory named "helloworld". All files for this application reside in this directory.

e.g-
google-appengine/helloworld

* Inside the helloworld directory, create a file named "helloworld.py", and give it the following contents:

----------------------------------------------
print 'Content-Type: text/plain'
print ''
print 'Hello, world!'
----------------------------------------------

This Python script responds to a request with an HTTP header that describes the content, a blank line, and the message Hello, world!.

# Creating the Configuration File

* An App Engine application has a configuration file called "app.yaml". Among other things, this file describes which handler scripts should be used for which URLs.

* Inside the directory, create a file named "app.yaml" with the following contents:

------------------------------------------------
application: helloworld
version: 1
runtime: python
api_version: 1

handlers:
- url: /.*
  script: helloworld.py

-------------------------------------------------

* The application identifier is "helloworld". When you register your application with App Engine in the final step, you will select a unique identifier, and update this value. This value can be anything during development. For now, leave it set to helloworld.

* This is version number "1" of this application's code. If you adjust this before uploading new versions of your application software, App Engine will retain previous versions, and let you roll back to a previous version using the administrative console.

* This code runs in the "python" runtime environment, version "1". Additional runtime environments and languages may be supported in the future.

* Every request to a URL whose path matches the regular expression /.* (all URLs) should be handled by the "helloworld.py" script.

For a complete list of configuration options, see the app.yaml reference.

# Testing the Application

* With a handler script and configuration file mapping every URL to the handler, the application is complete. You can now test it with the web server included with the App Engine SDK.

--------------------------------------------------
google_appengine/dev_appserver.py helloworld/
--------------------------------------------------
if you are a Linux User use the command after change the google_appengine dir.
e.g :-

$cd google_appengine/
$python dev_appserver.py helloworld/


* The web server is now running, listening for requests on port 8080. You can test the application by visiting the following URL in your web browser:

* http://localhost:8080/

* To shut down the web server, make sure the terminal window is active, then press Control-C (or the appropriate "break" key for your console), or click Stop in Google App Engine Launcher.


Position of Application dir :-

google_appengine /
- [many files & folder]

- dev_appserver.py
- appcfg.py

- helloworld/
- helloworld.py
- app.yaml



Here is the codes and command for run the appication on LinuxOS






Running application on port http://localhost:8080/



Read more...

The Development environment for google appengine.

May 07, 2010 0
You develop and upload Python applications for Google App Engine using the App Engine Python software development kit (SDK).Download from the Python website .

Download the App Engine SDK . Follow the instructions on the download page to install the SDK on your computer.

most use of two commands from the SDK:

* dev_appserver.py, the development web server
* appcfg.py, for uploading your app to App Engine.

Windows and Mac users can run Google App Engine Launcher and simply click the Run and Deploy buttons instead of using these commands.
Read more...

Google App Engine at a glance .

May 07, 2010 0
1. Google App Engine at a glance


2. Introduction
• PaaS
• Running own Apps in Google infrastructure
• Supports different runtime environments – Java ( JRE 6 with limitations, standard APIs like JDO, JPA, JavaMail) – Python ( 2.5.2, standard library)
• App runs in sandbox
• Automatic scaling and load balancing


3. Architecture - Overview Internet Internet http://(version).(appid>).appspot.com/some/path Loadbalancer Frontend … Frontend Static File Server … Static File Server Application Server … Application Server static files resource files program files static files resource files program files


4. Architecture - Application Server URLFetcher Application Mail Internet Internet XMPP Application sandbox /Runtime Environment External Services Authentication Memcache Datastore Blobstore Logging Image Tasks Internal Services Google App Engine Bigtable memcache Google Infrastructure


5. Services / Capabilities
• Sandbox
• Runtime Environment / Servlet Container – Java Interpreter – Read only filesystem – Memory
• Data Store • Services – User authentication – URL Fetch – Mail – XMPP – Memcache – Image Manipulation – Scheduled tasks / Task Queues – Blobstore – Logging


6. Limitations
• Programming Model – Application runs in sandbox and can not
• Write to filesystem • Make arbitary network connections
• Use multiple threads/processes
• Perform long-lasting processing
• Permissions
• Know about other instances/applications – Sandbox restrictions are implemented as JVM
• Quotas (Requests, In/Out bandwidth, CPU time, API calls) – Billable Quotas
• Set by the application owner to keep in budget – Fixed Quotas
• Set by GAE to ensure integrity of the system


7. Development Environment
• Tools – Development Server – Application lifecycle management – Eclipse plugins / Firefox plugin (GWT) – Local unit testing / debugging


8. Deployment Environment
• Application is deployed as war which contains: – Static files – Resource Files – Program Files – Deployment Descriptor
• Rich Admin web console
• Deployment is integrated in IDE
• Deploy multiple version of the application at the same time


9. GWT-RPC Client Server Framework RemoteServiceServlet ServiceDefTarget RemoteService extends related implements OurServiceImpl OurServiceAsync OurService implements Our stuff implements ProxyService GWT framework (autogenerated)


10. App Engine Datastore Entity key “data” Application ID Property * Kind name Value * ID / Name
• Non-relational Data-
• Distribution, replication, store load balancing behind
• Stores data as entities the scene
• APIs:
• Based on Bigtable / GFS – JDO / JPA – Low Level API


11. Using Email/XMPP
• Create Servlet for handling incoming messages
• Ensure proper url configuration ins deployment descriptor
• Configure as inbound service
• XMPP – implementation supports no Group Chat – App-id@appspot.com / anything@version.latest.app-id.appspotchat.com


12. Logging
• Java.util.logging.Logger
• View in Administration Console
• Download logfiles
• Standard output / standard error are written to the logs


13. Local Unit Testing
• LocalTestServiceHelper provides – local test environment including GAE services
• Datastore
• XMPP/Mail
• User Management – Capability to use JUnit framework


14. Memcache Service
• Distributed in memory cache
• Configurable expiration time but • Unreliable might be vanished at any time
• Supported Interfaces : – JACHE (JSR 107: JCACHE – Java Temporary Caching API) – The Low-Level Memcache API (documentation)


15. User Management – Google Accounts
• Optional feature
• Utilize Google Authentication system in your own application -> focus on business logic
• Access to Google account data -> email, id
• Access constraints based on roles – Declarative in deployment descriptor (URL based) – programmatically


16. Managing Applications
• Administration Console @http://appengine.google.com/a/yourdomai n.com – Application Dashboard – Multiple application versions – Analyzing log files (including admin) – Analyzing resource usage


17. Further Readings
• Google App Engine documentation
• GWT documentation
• “Beginning Java Google App” – Kyle Roche, Jeff Douglas
• “Programming Google App Engine” – Dan Sanderson.



For see the Presentation Transcript about this post and more info visit :
Google Appengine At A Glance.

-- by Stefan Christoph
Read more...

Google Appengine overview...

May 07, 2010 0
Creating an App Engine application is easy, and only takes a few minutes.
Now , we are going to learn :

* build an App Engine application using Python
* use the "webapp" web application framework
* use the App Engine datastore with the Python modeling API
* integrate an App Engine application with Google Accounts for user authentication
* use Django templates with your app
* upload your app to App Engine

For using of Django on Appengine see the Django on Appengine post.
Google App Engine and Django both have the ability to use the WSGI standard to run applications. As a result, it is possible to use nearly the entire Django stack on Google App Engine, including middleware.
Read more...

May 06, 2010

Take a look on "Google Appengine for Python"

May 06, 2010 2


Welcome to Google App Engine for Python!
You can develop your Google App Engine application for either of two application environments:

1->Java
2->Python

But here,I am going with Python

* a fast Python 2.5 interpreter in a secure sandbox environment
* includes the complete Python standard library
* compiled application code is cached for rapid responses to web requests
* supports popular web application frameworks, including Django
* works with any application that supports CGI or WSGI
* includes a rich data modeling API for the datastore

With App Engine, you can build web applications using the Python programming language, and take advantage of the many libraries, tools and frameworks for Python that professional developers use to build world-class web applications. Your Python application runs on Google's scalable infrastructure, and uses large-scale persistent storage and services.

if u haven't, see,see the Python Getting Started Guide for an interactive introduction to developing web applications with Python and Google App Engine.

* The Datastore and Services
Apps can use the App Engine Datastore for reliable, scalable persistent storage of data. The Python API to the App Engine datastore includes rich data modeling tools for managing data schemas.The API supports two interfaces for performing datastore queries, including GQL, a SQL-like query language that is also used in the Admin Console.

* Scheduled Tasks

An application can configure scheduled tasks that will call URLs of the application at specified intervals.

* Python Tools

The App Engine Python SDK includes tools for testing your application, uploading your application files, managing datastore indexes, downloading log data, and uploading large amounts of data to the datastore
Read more...

May 05, 2010

Google Appengine

May 05, 2010 1


Google Appengine.


Google App Engine lets you run your web applications on Google's infrastructure. App Engine applications are easy to build, easy to maintain, and easy to scale as your traffic and data storage needs grow. With App Engine, there are no servers to maintain: You just upload your application, and it's ready to serve your users.
You can serve your app from your own domain name (such as http://www.example.com/) using Google Apps. Or, you can serve your app using a free name on the appspot.com domain. You can share your application with the world, or limit access to members of your organization.
Google App Engine supports apps written in several programming languages. With App Engine's Java runtime environment, you can build your app using standard Java technologies, including the JVM, Java servlets, and the Java programming language—or any other language using a JVM-based interpreter or compiler, such as JavaScript or Ruby. App Engine also features a dedicated Python runtime environment, which includes a fast Python interpreter and the Python standard library. The Java and Python runtime environments are built to ensure that your application runs quickly, securely, and without interference from other apps on the system.

The Application Environment


Google App Engine makes it easy to build an application that runs reliably, even under heavy load and with large amounts of data. App Engine includes the following features:
  • dynamic web serving, with full support for common web technologies
  • persistent storage with queries, sorting and transactions
  • automatic scaling and load balancing
  • APIs for authenticating users and sending email using Google Accounts
  • a fully featured local development environment that simulates Google App Engine on your computer
  • task queues for performing work outside of the scope of a web request
  • scheduled tasks for triggering events at specified times and regular intervals
Your application can run in one of two runtime environments: the Java environment, and the Python environment. Each environment provides standard protocols and common technologies for web application development
Read more...

May 02, 2010

Follow Us @soratemplates