Tag: software

  • Ruby on Rails

    What is Rails?Ruby on Rails

    Rails is a web development framework written in the Ruby language. It is designed to make programming web applications easier by making several assumptions about what every developer needs to get started. It allows you to write less code while accomplishing more than many other languages and frameworks. Longtime Rails developers also report that it makes web application development more fun. Rails is opinionated software. That is, it assumes that there is a best way to do things, and it’s designed to encourage that best way – and in some cases discourage alternatives. If you learn “The Rails Way” you’ll probably discover a tremendous increase in productivity. If you persist in bringing old habits from other languages to your Rails development, and trying to use patterns you learned elsewhere, you may have a less happy experience. The Rails philosophy includes several guiding principles:

    • DRY – “Don’t Repeat Yourself” – suggests that writing the same code over and over again is a bad thing.
    • Convention Over Configuration – means that Rails makes assumptions about what you want to do and how you’re going to do it, rather than letting you tweak every little thing through endless configuration files.
    • REST is the best pattern for web applications – organizing your application around resources and standard HTTP verbs is the fastest way to go.

    The MVC Architecture

    Rails is organized around the Model, View, Controller architecture, usually just called MVC. MVC benefits include:

    • Isolation of business logic from the user interface
    • Ease of keeping code DRY
    • Making it clear where different types of code belong for easier maintenance

    Models

    A model represents the information (data) of the application and the rules to manipulate that data. In the case of Rails, models are primarily used for managing the rules of interaction with a corresponding database table. In most cases, one table in your database will correspond to one model in your application. The bulk of your application’s business logic will be concentrated in the models.

    Views

    Views represent the user interface of your application. In Rails, views are often HTML files with embedded Ruby code that performs tasks related solely to the presentation of the data. Views handle the job of providing data to the web browser or other tool that is used to make requests from your application.

    Controllers

    Controllers provide the “glue” between models and views. In Rails, controllers are responsible for processing the incoming requests from the web browser, interrogating the models for data, and passing that data on to the views for presentation.

    The Components of Rails

    Rails provides a full stack of components for creating web applications, including:

    • Action Controller
    • Action View
    • Active Record
    • Action Mailer
    • Active Resource
    • Railties
    • Active Support

    Action Controller

    Action Controller is the component that manages the controllers in a Rails application. The Action Controller framework processes incoming requests to a Rails application, extracts parameters, and dispatches them to the intended action. Services provided by Action Controller include session management, template rendering, and redirect management.

    Action View

    Action View manages the views of your Rails application. It can create both HTML and XML output by default. Action View manages rendering templates, including nested and partial templates, and includes built-in AJAX support.

    Active Record

    Active Record is the base for the models in a Rails application. It provides database independence, basic CRUDfunctionality, advanced finding capabilities, and the ability to relate models to one another, among other services.

    Action Mailer

    Action Mailer is a framework for building e-mail services. You can use Action Mailer to send emails based on flexible templates, or to receive and process incoming email.

    Active Resource

    Active Resource provides a framework for managing the connection between business objects an RESTful web services. It implements a way to map web-based resources to local objects with CRUD semantics.

    Railties

    Railties is the core Rails code that builds new Rails applications and glues the various frameworks together in any Rails application.

    Active Support

    Active Support is an extensive collection of utility classes and standard Ruby library extensions that are used in the Rails, both by the core code and by your applications.

  • Video Chat with OpenTok

    OpenTok

    The OpenTok video chat platform delivers the simplicity and customization that developers need for building modern web applications. This new API lets you call the shots. You have full control over layout, who sees whom, and who just watches.

    The OpenTok API is a free and flexible cloud-based API, making it easy to add video chat to your applications without having to worry about infrastructure and scale—build your app using our simple JavaScript or ActionScript libraries.

    Technical Requirements for OpenTok

    End users will need the following:

    • Flash Player 10.3 or later
    • Firefox 3.0+, Safari 4.0+, Internet Explorer 7+, Chrome
    • Windows XP+, OSX 10.4+
    • A webcam and a microphone!
    • A standard DSL line with a minimum upload and download speed of 160kb per call participant

    OpenTok in Linux

    OpenTok does not support in Linux but it provides facility to support Linux by adding {wmode : “window”}  in session.publisher function. If video chat is not working after adding this then do the following changes :

    • Download webcamstudio for video chatting using OpenTok

    Link to install webcamstudio :
    http://mandeepsimak.wordpress.com/2012/05/18/webcamstudio-a-free-virtual-webcam-software-with-cool-effects-ubuntu-11-1012-04/

    OR

    • Do the global settings of Adobe Flash Player
    Open 
    and choose Always Allow for static.opentok.com and staging.opentok.com it will allow it to work properly.

    Options available with OpenTok

    • Video Recording
    • Video chatting
    • Video Conferencing
    • Video Archiving

    Limitations of OpenTok

    • High speed internet connection is required. 
    • Global settings for Adobe Flash should be done for using OpenTok in Linux.
    • Sometimes after changes Flash settings, it doesn’t work.
    • Linux and Flash Player do not combine very well. So, we have to install Webcam Studio in Linux to fix camera acquisition problem.