Thursday, December 28, 2006

ExampleDesignPatternsInRuby (Ruby)

Almost all of these examples are correct Ruby programs. If example output is shown, you should be able to copy code from the web page, run it in a Ruby interpreter and get the documented output.

Patterns

Source:http://wiki.rubygarden.org/Ruby/page/show/ExampleDesignPatternsInRuby

Design Patterns in Ruby : Observer

The key ideas around the Ruby implementation of the Observer pattern are:
  1. Require the observer library
  2. Mixin the Observable module to your class which can be observed
  3. In the class that does the observing, implement the update method

That’s it.

Of course, an example would be nice. Here’s a small one.

require 'observer'  # Key step 1

class MyObservableClass
include Observable # Key step 2

def blah
changed # note that our state has changed
notify_observers( 5 )
end
end

class MyObserverClass
def update(new_data) # Key step 3
puts "The new data is #{new_data}"
end
end

watcher = MyObservableClass.new
watcher.add_observer(MyObserverClass.new)

Now, any time that MyObservableClass#blah is called, the observing classes will get notified. In this example, we aren’t dynamically changing the data (in fact, it always stays constant), but I think you can see that if in fact the data DID change, the observers would all get notified of that change.

Design Patterns in Ruby : Singleton

Singleton pattern in Ruby just simple. Only thing is you need to include singleton module. Lets look at sample ruby program.

require 'singleton'
class MyClass
include Singleton
end

sing Ruby’s powerful Mixin functionality, we bring the singleton code into our class definition. This automatically makes our class’s new method private, and give us an instance method we can use to get our object:

irb(main):005:0> a = MyClass.new
NoMethodError: private method `new' called for MyClass:Class
from (irb):5
irb(main):006:0> a = MyClass.instance
=> #

Wednesday, December 13, 2006

Ajax Stories Using Microsoft ATLAS


Video: Using Microsoft Atlas 01



Video: Using Microsoft Atlas 02





Video: Using Microsoft Atlas 03

Building a Blog with Rails


Video: Building a Blog with Rails

What is Chrome URL ?

You can get XUL files like regular HTTP URL or like HTML files.
URL types can automatically handle mulitple themes and locales.
The basic syntax of a chrome URL is as follows:

chrome:////

The text is the package name, such as messenger or editor. The is either 'content', 'skin' or 'locale' depending on which part you want. 'file.xul' is simply the filename.

Example: chrome://messenger/content/messenger.xul

When you select a chrome URL, Mozilla looks down its list of installed packages and tries to locate the JAR file or directory that matches the package name and part.

The mapping between chrome URLs and JAR files are specified in the manifest files stored in the chrome directory.

If you were to move the file messenger.jar somewhere else and update the manifest file accordingly, Thunderbird will still work since it doesn't rely on its specific installed location. By using chrome URLs we can leave details like this to Mozilla. Similarly, if the user changes their theme, the 'skin' part of the chrome URL translates to a different set of files, yet the XUL and scripts don't need to change.

Here are some more examples. Note how none of the URLs specify which theme or locale is used and none specify a specific directory.

chrome://messenger/content/messenger.xul
chrome://messenger/content/attach.js
chrome://messenger/skin/icons/folder-inbox.png
chrome://messenger/locale/messenger.dtd

Tuesday, December 12, 2006

Why should I upgrade to windows Vista

Last week i bought laptop with all latest configuration. Due to vistas late release i have to satisfy with XP professional SP2. AS far I know XP with SP2 provides lot of security than the latest Vista as it has already been tested for long years. Suppose if i need to upgrade to vista.. My printer will not work... may be some installations will not work.

The only reason looking for Vista is Aero glassy features and security. It requires high quality PC components.

According to Itwire ,Many know that the software cost of upgrading from Windows XP to Windows Vista Business is US$199 but they might not know that the Vista upgrade carries a hardware cost as well, with about US$100 in new or additional PC components required to make the jump to Microsoft's newest operating system, according to research firm iSuppli.

However, Vista allows users the option of disabling the 3D interface, eliminating the need for a new graphics card or a more powerful integrated graphics chip. Whether or not to pay the additional costs required to obtain the 3D functionality is a choice that individual users or companies must make.

why a business user, small or large, have to upgrade to Vista just becuase Windows XP has finally matured? We can't think of a single reason other than the fact is that from January 30, 2007, Microsoft will stop selling Windows XP and eventually we'll be forced to move to Vista - or something else. They wanna capture the market by forcing the users or businesses to get vista


7-day Free trial of Napster!

Friday, December 08, 2006

What is XUL and Its role in Mozilla/Firefox browser

What is XUL and why was it created?

XUL is developed to make firefox/mozilla browser easily and faster.
It follows XML structure and schemantics.
Even MathML or SVG can be inserted within it.

WE can make the following elements:
* Input controls such as textboxes and checkboxes
* Toolbars with buttons or other content
* Menus on a menu bar or pop up menus
* Tabbed dialogs
* Trees for hierarchical or tabular information
* Keyboard shortcuts


The created applications can be used as :
Firefox extension
Standalone XULRunner application
XUL package
Remote XUL application

Before learning XUL u need to know the following:
XML(DOM),
HTML,
CSS,
JavaScript and latest firefox browser

You can use same CSS properties in XUL just like HTML CSS.

THe XUL can be accessed from Browser using Chrome URL.
'chrome://' Your URL -> refers installed packages and extensions.


if you are going to use XUL on a web site, you can just put the XUL file on the web site as you would an HTML file, and then load its URL in a browser. Ensure that your web server is configured to send XUL files with the content type of 'application/vnd.mozilla.xul+xml'. This content type is how Mozilla knows the difference between HTML and XUL.

Mozilla does not use the file extension, unless reading files from the file system, but you should use the .xul extension for all XUL files. You can load XUL files from your own machine by opening them in the browser, or by double-clicking the file in your file manager. Remember that remote XUL will have significant restrictions on what it can do.

Firefox uses different documents types for :HTML, XML and XUL
Naturally, the HTML document is used for HTML documents, the XUL document is used for XUL documents, and the XML document is used for other types of XML documents. Since XUL is also XML, the XUL document is a subtype of the more generic XML document.

To summarize the points made above:

* Mozilla renders both HTML and XUL using the same underlying engine and uses CSS to specify their presentation.
* XUL may be loaded from a remote site, the local file system, or installed as a package and accessed using a chrome URL. This is what browser extensions do.
* Chrome URLs may be used to access installed packages and open them with enhanced privileges.
* HTML, XML and XUL each have a different document type. Some features may be used in any document type whereas some features are specific to one kind of document.

Example of buttons:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window
id="findfile-window"
title="Find Files"
orient="horizontal"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<button id="find-button" label="Find"/>
<button id="cancel-button" label="Cancel"/>

</window>

Friday, December 01, 2006

Ruby books :

Programming Ruby: A Pragmatic Guide2nd edition.

Making Use of Ruby by Suresh MahadevanWiley; ISBN 0-471-21972-X (2002)

Teach Yourself Ruby in 21 Daysby Mark SlagellSams; ISBN: 0672322528 (March, 2002)

Ruby Developer's Guideby Michael Neumann, Robert Feldt, Lyle JohnsonPublishers Group West; ISBN: 1928994644 (February, 2002)

The Ruby Wayby Hal FultonSams; ISBN: 0672320835 (December, 2001)

Ruby In A Nutshellby Yukihiro MatsumotoO'Reilly & Associates; ISBN: 0596002149 (November, 2001)

Programming Ruby: A Pragmatic Guideby Dave Thomas and Andrew HuntAddison Wesley; ISBN: 0201710897 (2000)(As of Sept 2004, there is a second edition. It is not open- sourced at this time.) Online version(Note that this is a legal first edition.)
Download Errata

What is Ruby?

What is Ruby?
Ruby is a very high level, fully OO programming language. Indeed, Ruby is one of the relatively few pure OO languages. Yet despite its conceptual simplicity, Ruby is still a powerful and practical "industrial strength" development language.

Ruby selectively integrates many good ideas taken from Perl, Python, Smalltalk, Eiffel, ADA, CLU, and LISP. Ruby combines these ideas in a natural, well-coordinated system that embodies the principles of least effort and least surprise to a substantially greater extent than most comparable languages — i.e., you get more bang for your buck, and what you write is more likely to give you what you expected to get. Ruby is thus a relatively easy to learn, easy to read, and easy to maintain language; yet it is very powerful and sophisticated.

In addition to common OO features, Ruby also has threads, singleton methods, mixins, fully integrated closures and iterators, plus proper meta-classes. Ruby has a true mark-and-sweep garbage collector, which makes code more reliable and simplifies writing extensions. In summary, Ruby provides a very powerful and very easy to deploy "standing on the shoulders of giants" OO scaffolding/framework so that you can more quickly and easily build what you want to build, to do what you want to do.

You will find many former (and current) Perl, Python, Java, and C++ users on comp.lang.ruby that can help you get up to speed in Ruby.

Finally, Ruby is an "open source" development programming language.

Thursday, November 30, 2006

XAML vs XUL vs MXML Comparision

MXML
Runs anywhere Flash Player 7
Server required
Uses ActionScript 2.0
XPath support: no
CSS support: limited

XAML
runs Runs only on Longhorn
Server not required
Uses .NET languages
XPath support: yes
CSS support: no

XUL
Runs on any platform.
Server Not Required
Javascript, Python, C++
XPath support: yes
CSS Support: excellent.

Wednesday, November 29, 2006

Ajax Stories

ASP.NET AJAX under the hood secrets
By Omar Al Zabir.

Take look at this site aspnetajaxtips .You will find advantages and disadvantages of Batch calls, AJAX call timeouts, browser call jam problem, ASP.NET 2.0's bug in web service response caching, and so on. This guy (Omar Al Zabir) has created Pageflakes website. He is MVP professional. I recommend every Asp.Net professional look at his work and samples.
He gives answer to this question "Why did not you use Protopage or Dojo library?"

AJAX Demos
Basic AJAX Examples The downloadable samples include full JavaScript & Java Source, a sample database for any SQL database, and a PowerPoint presentation. This sampler shows some basic techniques to demonstrate some of the possibilities of using AJAX/XMLHTTPRequest techniques in web applications. Basic browser & server interaction is demonstrated along with dynamic population of visual elements such as DIVs and SELECT drop downs.In addition, many ways of instantiating & encapsulating XMLHTTPRequest objects are shown in the Javascript.
-->Drag & Drop Sortable Lists with JavaScript and CSS In Web applications I've seen numerous, and personally implemented a few, ways to rearrange items in a list. All of those were indirect interactions typically involving something like up/down arrows next to each item. The most heinous require server roundtrips for each modification...boo.
-->FireBug FireBug is a new tool for Firefox that aids with debugging Javascript, DHTML, and Ajax. It is like a combination of the Javascript Console, DOM Inspector, and a command line Javascript interpreter.
-->AjaxAnywhere Ajax JSP Components.
-->fileNice PHP and AJAX file browser.
-->AJAX Instant Edit Example In spanish.
-->
AJAX Drag and Drop
Dragable RSS boxes This is is a script that uses Ajax to read data from external RSS sources and display them inside dragable boxes. You can also create new boxes dynamically directly from the page.

-->Fun with Drag and Drop with RICO For those of you who haven't seen Rico its another AJAX library, with quite a few cool extras. What I'm going to cover here is my first expiriment with Rico and their 'drag and drop' functionality. Getting basic drag and drop functionality is extremely easy with this library, and with just a bit of modification you can easily make it fit whatever you could want.
-->
AJAX Email
Take AJAX to Your Email Inbox: Developing a Web-based POP 3 Client In this article, the first of three parts, you will start creating a simple web-based POP 3 client using AJAX, which will use "XMLHttpRequest" objects to retrieve messages from a mail server.

-->Ajax Workshop 1: Ajax Basics & Building a Simple Email Verification With Prototype.js
In this introduction we will build a simple form (I know it says not to use AJAX for simple forms, but it is an easy example) that submits a user's information to the database and confirms if the user's email address is already in the database. We will be using a common JavaScript library by the name of prototype.js.
-->Zimbra
Open source AJAX email program
-->
AJAX File Uploaders
CakeTimer - Demo Page An Ajax file uploads progress bar This is a demonstration of an AJAX powered progressbar to monitor file uploads with (Cake)PHP. Yes you've heard right! Well, but before you begin to drool all over the place, there is one downside: it requires a Perl script that allows you to know the upload progress. But besides this little downer you have a maximum of flexibility regarding the design of your progress-bar and integration in your system.
-->
AJAX Flash
Incito - Interactive Everything SwfJax is a new approach to asynchronous JavaScript and XML applications using revolutionary Flash technology. SwfJax uses a lightweight SWF (Adobe's Small Web Format or simply - Flash) engine to get XML data from the server and xPath (XML Path Language) to address a part of data it has retrieved. Data can be returned back to Javascript as an Array. You can also send multiple xPath queries at once.
-->AFLAX: The AJAX Library for the Adobe Flash Platform Mar 15, 06 AFLAX (Wikipedia Entry) stands for Asynchronous Flash and XML. Defined simply, AFLAX is a development methodology which combines Ajax and Flash to create more dynamic web based applications. Developed by Paul Colton, the AFLAX technology is available as a library that enables developers to use JavaScript to fully utilize all of the features of Adobe's Flash runtime -- including graphics, networking, video and camera support.
-->
AJAX Forms
HTTP Authentication with HTML Forms Authentication in Web applications has been highjacked, HTTP defines a standard way of providing authentication but most apps use the evil spawn of Netscape, otherwise known as cookies. Why is this? Cookies aren't designed for authentication, they're a pain to use for it, insecure unless you know what you're doing, non-standard, and unRESTful.
-->FormSpring Online AJAX powered from builder.
-->Niceforms Web forms. Everybody knows web forms. Each day we have to fill in some information in a web form, be it a simple login to your webmail application, an online purchase or signing up for a website. They are the basic (and pretty much the only) way of gathering information on the web.
-->Capxous - AutoAssist AutoAssist is an auto completion web widget that written in pure JavaScript. It can help enhance the accessibility of existing website, let the users to work effective and feel comfortable. Moreover, it just a pure JavaScript file that won't break existing code or development style. (Related post: http://capxous.com/autoassist/)
-->Cake Baker - Submit a Form With AJAX The new release of CakePHP (RC2) comes with a completely rewritten AjaxHelper::form() function (with the disadvantage that it breaks existing code).
-->Wufoo - AJAX Form BuilderWufoo is a web-based tool to help you build and host amazing online forms. In only a few short minutes, you can create a mailing list, a marketing survey or even a complete customer management system.
-->Accessible Forms and Unobtrusive Javascript - dotvoid.com I usually try to separate backend logic from the user interface logic when creating new PHP applications. I am pro fat gui and usually have a lot of client side scripting going on. I mostly use AJAX or other remote scripting techniques to call actions defined in the PHP backend.
-->jotForm jotForm is the first web based WYSIWYG form builder.


7-day Free trial of Napster!

Tuesday, November 28, 2006

Latest news on karimnagar byelection

For more recent news features related to this topic, please click on a link to the left.
Skull struggle
Bill by BJp
Telangana in 2009 by Venkat Swamy
bedi workers strike
bedi workers strike
Bypoll campaign intensifiesDattatreya and Digvijay Singh to tour Karimnagar

TRS chief files nominationKick starts election campaign

TDP candidates file nominations for by-electionsL. Ramana to stand in Karimnagar

By polls for Karimnagar and Bobbili on December 4, 2006Congress, TDP, BJP and TRS have already announced their candidates

Karimnagar by pollL. Ramana picked as TDP candidate

BJP plans yatra in KarimnagarAims at exposing hollows of other parties

T Jeevan Reddy for Congress nominee for Karimnagar by pollCongress Party makes surprise move

TRS TDP men join Congress PartyCongress party gains strength amidst Karimnagar by-election

APCC to draft the services of Ministers and MLAs for Karimnagar electionCongress party presses top core team for elections

Rebel TRS MLA Mandadi asks voters to vote for Congress or BJPSays party lacks internal democracy

KCR named TRS candidate for Karimnagar seatTRS calls party members to teach Congress and TDP a lesson

Ch Vidyasagar Rao is BJP candidate for Karimnagar by pollState unit proposes his name unanimously

Karimnagar byelection

Professors fan out in the constituency and visit interior villages

KARIMNAGAR: TRS president K. Chandrasekhar Rao has found a new set of campaigners in the teaching faculty of Osmania and Kakatiya Universities and Non-Resident Indians, who have rallied behind him in the run-up to the Karimnagar byelection.

Led by the former dean of social sciences, Osmania University, Madhusudhan Reddy and K. Laxman of Philosophy Department, the teachers are fanning out in the Karimnagar parliamentary constituency visiting interior villages and seeking votes for the TRS chief and urging them to uphold the `self-esteem of Telangana'.

A 30-member team of professors has divided itself into small groups to cover all the seven Assembly segments. More than 300 students from OU are going round villages educating the voters on the need for the creation of a separate State.