Monday, March 17, 2008

Support for AJAX - Microsoft

ASP.NET AJAX Overview

AJAX features is alreay provided in Microsoft ASP.NET.
AJAX scripting compatable with most frequently used browsers
(including Microsoft Internet Explorer, Mozilla Firefox,
and Apple Safari).
ASP.NET 2.0 AJAX already becomes standard features from Microsoft product,
The latest one is ASP.NET 3.5. ,
For new production Like Visual Studio 2008, SharePoint also comes with such capabilities, so that in the near future Microsoft is will going to support AJAX.

Sunday, March 16, 2008

Python Database framework - PyDbLite

PyDbLite - a small & fast in-memory database engine - PyDbLite.pyAuthor: Pierre Quentel

While preparing the AJAX project and looking for database solutions, PyDbLite
is one of the possible optional. PyDbLite is a pur-Python in-memory database
engine, use list as query language. It is very simple and easy to implement,
but it will take up memory to hold the database, so it is not suitable for a
large scale database application.

It comes with a Base class and allow us to to create, open, update, delete, query the
database and create index for the database file we need. While creating the database, we do not have to defind data type. PyDbLite will accept any value that can be serialized by the cPickle module.

>> code samples <<
Complete reference

from PyDbLite import Base
db = Base('dummy')
db.create('name','age','size',mode="open" )
db.open()
db.insert(name='homer',age=23,size=1.84)
db.commit()
recs = [ r for r in db if 30 > r['age'] >= 18 and r['size'] < 2 ]

for r in (r for r in db if r['name'] in ('homer','marge') ):
do_something_with(r)

for r in db:
do_something_with(r)

db.create_index('age')
records = db._age[23]
len(db)
db.delete(record)
db.update(record,age=24)
db.add_field('new_field'[,default=v])
db.drop_field('name')
db.fields

Monday, March 10, 2008

Introduction to Ajax framework


http://en.wikipedia.org/wiki/Ajax_framework


AJAX framework helps to develop web applications that using Ajax. The goal of the framework is to provide the Ajax engine to help develop server and client-side functions.

There are a lot of different framework available on the net, they are open source and free. Such as:-


Dojo Toolkit
, Modular JavaScript toolkit,


Prototype
, a JavaScript framework that provides Ajax and other utilities


Mootools
, a compact and modular JavaScript framework best known for its visual effects and transitions


Script.aculo.us
, Used with the Prototype Framework, mainly for animations and interface development

Thursday, March 6, 2008

Javascript Overview

http://en.wikipedia.org/wiki/JavaScript

Javascript is a script language, used to provide functions that can be embedded or included in HTML documents. It supports most of the syntax from C like if, while, switch etc... It provides dynamic typing, the type of the variable is determined by the value, so we can change the type of the variable by assigning different types of value to it. Objects are associative arrays, such that the representation of an object object.x is equivalent to object["x"], so the values within the object can be add, change or deleted. Javasrcipt use prototypes instead of class when defining object properties, functions and method are the same, but if the function is call with an object, the this keyword is refer to the originated object.

Javascript support variadic functions, which is an indefinite number of parameters can be passed to a function. The function can both access them through formal parameters and the local arguments object. JavaScript also support regular expressions, which provide a concise and powerful syntax for text manipulation that is more sophisticated than the built-in string functions.

In order to execute Javascript, the browser who runs it must comes with a JavaScript engine, an interpreter, to interpret JavaScript source code and executes the script accordingly, since not all the browsers can run the JavaScript, so when we may need to test the compatibility of the browser before running the script.

Javascript mostly run at client's browser, client side application, so it can provide a quick response to user's action and is capable of detecting the user's action like keystrokes input, for which HTML alone is not able to handle it.

The web server, server side application, is another common application of the engine. A JavaScript webserver would expose host objects, typically created by public API, representing a HTTP request and response objects, which a JavaScript program could then manipulate to dynamically generate web pages.

JavaScript and the DOM provide the potential for malicious attack, including cross-site scripting. To counter the risk like that, first, scripts run in a sandbox in which they can only perform Web-related actions, not general-purpose programming tasks like creating files. Second, scripts are constrained by the same origin policy: scripts from one Web site do not have access to information such as usernames, passwords, or cookies sent to another site. Third, stick to the same origin policy.