Feeds:
Posts
Comments

Hai,

To insall django on Fedora 14, open a terminal and as a root user type

yum install Django

πŸ™‚

Advertisements

Hai today when i was working with a rails project, when i gave bundle install ( after editing the Gemfile ), i received the following error

Error :

/usr/lib/ruby/gems/1.8/gems/bundler-1.0.9/lib/bundler/ui.rb:56: uninitialized constant Gem::SilentUI (NameError)
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.9/lib/bundler/cli.rb:16:in `initialize’
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.9/lib/bundler/vendor/thor.rb:246:in `new’
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.9/lib/bundler/vendor/thor.rb:246:in `dispatch’
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.9/lib/bundler/vendor/thor/base.rb:389:in `start’
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.9/bin/bundle:13
from /usr/bin/bundle:19:in `load’
from /usr/bin/bundle:19

Inorder to get away from this error, just update the bundler by running the following command

sudo gem install bundler

Now bundle install will work πŸ™‚

 

This property removes the line break before or after the html element

Example Code:

 <html>
 <body>
 <p style="display:inline">This paragraph is continued </p>
 <p style="display:inline">without line break because of <b>display-inline</b> property</p>
 </body>
 </html>

If you run the above code, you wont see any line breaks between the first and second <p> tags

This property hides the content placed inside an html element

Example Code:

<html>
 <body>
 <p style="display:none">This paragraph is not diplayed because of <b>display-none</b> property</p>
 </body>
 </html>

If you run the above code, the contents enclosed in <p></p> tag are not displayed

Hai

Today when i was working for a web project, i learnt how to create a simple toggle effect in JQuery.

Here’s my code to illustrate this ( slide toggle ) effect

Prerequisite:

Download jquery.js file from here

Code:


<html>
 <head>
 <script type="text/javascript" src="jquery.js"></script>
 <script type="text/javascript">
 $(document).ready(function(){
 $(".demo").click(function(){
 $(".content").slideToggle("slow");
 });
 });
 </script>
 <style type="text/css">
 div.content,p.demo
 {
 margin:0px;
 padding:5px;
 text-align:center;
 background:gray;
 border:1px solid blue;
 }
 div.content
 {
 height:50px;
 display:none;
 }
 </style>
 </head>
 <body>
 <div class="content">
 <p>Example for Slide Toggle effect<p>
 </div>
 <p class="demo">Show/Hide Content</p>
 </body>
 </html>
 

When you run the above code, you can see a nice toggling effect

And yes, JQuery is awesome πŸ™‚

 

 

Greetings!

Today i learnt a bit on HTML, CSS and then proceeded with Chapter 10 of Learn Rails by Example

In HTML i worked with image tag <img> fromΒ  w3schools

I learnt the following things in <img> tag

  • <img> tag is used to insert an image into an HTML document
  • There is no closing tag for it.
  • Contains common attributes such as src, alt, width, height, border
  • src – specifies the path of the image
  • alt – specifies the alternate text for the image
  • width, height – specifies the dimension for the image
  • border – sets the border for an image

To insert an image into an HTML document, i just followed the code to display the image in browser

<html>
<body>

<img border="0" src="/home/rajee/animal.jpg" alt="Deer" width="100" height="100" />

</body>
</html>

Then i switched to learn CSS from CSS CookBook by Christopher Schmitt available in our library

The book covers nearly 500 pages

I set a goal to complete 5 pages per day.

Though its a too too small small goal, i want to follow it everday with good understanding of my workarounds. And this is my real goal πŸ™‚ πŸ™‚

From yesterday i started to learn CSS

So, today i completed 10 pages from the book.

I came across the following two selectors in CSS cookbook

  • Type Selectors
  • Class Selectors

Type Selectors

It represents the HTML tags or the elements

Example

h1 { font-size:100%; }

body { background-color : red; }

Class Selectors:

It is used to apply the same CSS rule many times to different elements.

Example

<html>
 <head>
 <title>CSS Cookbook</title>
 <style type="text/css">
 .warning
 {
 font-weight:bold;
 }
 </style>
 </head>
 <body>
 <p>A para <a href="http://csscookbook.com">link</a>.
 <p>Second para illustrating the <em>class selector</em> example</p>
 </body>
</html>

Then i started to watch and work with the rails screencast

Previously, i stopped in quarter portion of Chapter 10 ( i.e., i just worked with first half an hour of the tutorial )

I resumed from where i left and watched next one hour lesson

In my workaround i learnt how to implement a bit of security model while updating users

The first step is to protect pages from unauthorised access by requiring signing in ( ie., if someone wants to access edit page, he/she should be redirected to sign-in page )

It is done using before_filter

Writing test cases in users_controller_spec.rb


describe "authentication of edit/update actions" do

 before(:each) do
 @user = Factory(:user)
 end

 it "should deny access to 'edit'" do
 get :edit, :id => @user
 response.should redirect_to(signin_path)
 end

 it "should deny access to 'update'" do
 put :update, :id => @user, :user => { }
 response.should redirect_to(signin_path)
 end
 end

Adding before_filter in users_controller.rb


before_filter :authenticate, :only => [:edit, :update]

def authenticate
 redirect_to signin_path unless signed_in?
 end

By 3.45p.m., we gathered for a SCRUM Meet and i told like as i exlpored on HTML,CSS,Chapter 10 of Learn Rails by Example

Will be continue to work with these technologies tomorrow πŸ™‚

Hai, today i learnt how to create a curved border using CSS (Cascading Style Sheet)

It is accomplised using border-radius

I just tried a simple example to know how it works

There are other properties such as border-top-left-radius, border-top-right-radius, border-bottom-left-radius, border-bottom-right-radius to set all the corners

HTML file


<html>
<head>
<link rel="stylesheet" type="text/css" href="example.css" />
</head>
<body>
<div id="first">
<p>Paragraph</p>
</div>
</body>
</html>

Example.css


#first {

border:5px solid red;
border-top-left-radius: 12px;
border-top-right-radius: 12px;
border-bottom-left-radius: 12px;
border-bottom-right-radius: 12px;

}