Feeds:
Posts
Comments

Archive for December, 2010

Hai today i tried to upload an image from my local storage to blog post

But  suddenly i found that my Upload/Insert links ( add an image, add video, add audio, add media, addpoll, add a custom form ) are not working.

Iam using Firefox version 3.6.3 ( to find the version click on Help->About Mozilla Firefox )

After searching for a while in wordpress.com forums,  it has been advised to clear the browser cache and cookies

Steps I followed  to make my Upload/Insert buttons to work

1. Logged out from  wordpress

2. Opened the browser ( Firefox in my case )

3. From the browser menu, select Tools – > Clear Recent History

4. Selected ‘ Everything’ to clear all cache in ‘ Time range to clear ‘

5. Clicked on ‘Details’ and selected ‘ cache ‘ and ‘ cookies ‘

6. To clear it, clicked on ‘ Clear Now ‘ button

7. Restarted my system

8. Logged in to wordpress and done with uploading files 🙂 🙂

Hope this helps for someone to solve the same issue

 

Advertisements

Read Full Post »

Hai yesterday i developed a simple calendar to display the current month and current year

The screenshot of my simple calendar looks as

You can find the HTML, Javascript, CSS code of this calendar from below


<html>
<head>
 <title>Trainer Union Calendar</title>
 <link rel="stylesheet" type="text/css" href="tu_cal.css" />
 <script type="text/javascript" src="tucalendar.js"></script>
</head>
<body>
 <script type="text/javascript">
 showCalendar();
 </script>
</body>
</html>

The javascript code is here


function showCalendar() {
 document.write("<h3 align='center'>Javascript Calendar Application</h3>");
 var dateObj = new Date();
 curr_day = dateObj.getDay();
 curr_date = dateObj.getDate();
 curr_month = dateObj.getMonth();
 curr_year = dateObj.getFullYear();
 day_names = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
 month_names = new  Array("January","February","March","April","May","June","July","August","September","October","November","December");
 noofdays =  new Array(31,28,31,30,31,30,31,31,30,31,30,31)
 document.write("<div id='myCalendar'>");
 document.write("<table class='cal_js'>");
 document.write("<thead id='cal_head'>");
 document.write("<tr><th colspan=7><input type='button' value='&lt' id='cli'onclick='previousmonth()'/>"+month_names[curr_month]+"<input type='button' value='>' onclick='nextmonth()' /> <input type='button' value='&lt' onclick='previousyear()'/>"+curr_year+"<input type='button' value='>' onclick='nextyear()'/></th></tr>");
 document.write("</thead>");
 document.write("<tr class='dayname'><th>Sunday</th><th>Monday</th><th>Tuesday</th><th>Wednesday</th><th>Thursday</th><th>Friday</th><th>Saturday</th></tr><tr>");
 document.write("<tbody>")
 dateObj.setDate(1);
 var first_day = dateObj.getDay();
 var total_days = noofdays[curr_month];
 var endrow = 0;
 for (i=1;i<=first_day;i++)
 {
 document.write("<td>"+" "+"</td>")
 endrow++;
 }
 for (i=1;i<=total_days;i++)
 {
 if(endrow==0)
 {
 document.write('<tr>');
 }
 if(curr_date==i)
 {
 document.write('<td>'+i+'</td>');
 }
 else
 {
 document.write('<td>'+i+'</td>');
 }
 endrow++;
 if(endrow==7)
 {
 document.write('</tr>');
 endrow=0;
 }
 }

 document.write(endrow);
 for( i =1; endrow!=0; i++ )
 {
 document.write('<td>'+" "+'</td>');
 endrow++;
 if(endrow==7)
 {
 document.write('</tr>');
 endrow=0;
 }
 }
 document.write("</tbody>")
 document.write("</table>");
 document.write("</div>");
 }

The CSS code is here


.cal_js {
 border: 1px solid black;
 margin: auto;
 padding: 5px;
 width: 150px;
 height: 150px;
}
.cal_js thead {
 word-spacing: 300px;
}
.cal_js th {
 border: 1px solid black;
 padding : 5px;
}
.cal_js td {
 border: 1px solid black;
 vertical-align: top;
 text-align: left;
}

My next step is to improve the calendar to display all the months for the current year

Read Full Post »

Hai, today i took a startup step to develop a calendar for our project (Trainer’s Union)

Gone through the Date object and its function in Javascript

I played with the library functions to get today’s day,date,month,year

How to get today’s day,date,month,year in Javascript ?


<script type="text/javascript">
var dateObj = new Date();
var curr_day = dateObj.getDay();
var curr_date = dateObj.getDate();
var curr_month = dateObj.getMonth();
var curr_year = dateObj.getFullYear();
var day_names = newArray("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var month_names= newArray("January","February","March","April","May","June","July","August","September","October","November","December");
today = curr_date+ " "+day_names[curr_day]+ " " +month_names[curr_month]+ " " +curr_year ;
document.write(today);
</script>

How to get the name of a first day of the month ?

We have a function called setDate( ) which sets the date of a month

It’s obvious all months start with a date 1.

So we can pass the value ‘1’ to set the date ‘1’

Then we need to call getDay( ) to know which day the month starts.

Lets look out an example code


<script type = "text/javascript">

var dateObj = new Date();
dateObj.setDate(1);
var first_day = dateObj.getDay();
var day_names = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
document.write(day_names[first_day]);

</script>

And the journey continues to develop a calendar……

Read Full Post »

Hai today i initiated to created a calendar of my own in Javascript

Our mentor has assigned a task to develop a calendar so that it should fulfill our needs to integrate into our project.

His (mentor) requirement for a calendar similar to be as seen in this link http://dhtmlx.com/docs/products/dhtmlxScheduler/index.shtml

The calendar should  dynamically show the dates of any month on any year.

And also, the other most important feature is to add the events for a particular date/dates.

After spending couple of days in search of a open source calendar i didnt find a one to satisfy our requirements

So i decided to develop of my own.

Also i can gain knowledge from my experience 🙂

So far i created a simple calendar to display the current date, month, year

A long way to go from here…..

Read Full Post »

Greetings !

For the past few days, i didnt put any blog post regarding my learnings at Slashprog Technologies.

It’s all because of my laziness 😦

So, i hereafter i fixed in my mind that i should throw all my laziness.

The day 32 at Slashprog Technologies is Christmas Day

Initially we asked to our mentor Thagu sir to give leave for us on Christmas

But on Saturday and Sunday our mentor, Chandrashekar sir  use to take sessions

And ofcourse its only on these days we use to meet Chandrashekar sir on his busy schedule

So, finally its decided as working day.

By evening i.e., on Dec 24/12/2010,  yogesh and suresh went out to get decorative items to decorate our office

Eventhough none of us are christians, we wished to celebrate it 🙂

Since its time to leave on that day i.e., December 24 ,i left the office

The morning i entered in to the office

Woww our office was nicely decorated by my collegaues

Also, they bought a cake to cut.

When Chandrashekar sir entered the office, he wondered about the decorations and arrangement

After lighting the candles on the cake, yogesh cut it, and the cake is divided and served to all.

We all tasted it well.

That was a nice moment.

Thanks to all my collegaues and my mentors thagu sir and chandrashekar sir.

Then we all seated to listen to chandrashekar sir class.

In between me and sudha took small sessions.

I took the class on Blueprint.

Chandrashekar sir told that he learnt blueprint within 5 minutes from my class 🙂 🙂

I felt so happy to receive this comment from him

Sudha took class on ‘C’ programming

Then yeah our sir went to dais to engage his class

He appreciated us and told us about his experiences during his training career

He asked the work progress of everyone  in our project

He started the session by introducing us to CRC cards

I came across this name during my college days

But i forgot what it is 😦

Sir explained the importance of CRC.

CRC – stands for Class Responsibility Collaboration card

The concept behind CRC cards are used to design the software in an object-oriented method

It is used to identify the important classes in the project

It will be like a post card size.

The whole card is divided into 3 parts ( header, leftside and rightside)

The header part describes the classname/username

For example in our project we had one of the user, Trainer

The leftside column must consists of seven important responsibilities of that user

The rightside column describes the collaborators for the user, Trainer.

The appearance will looks as follows

He asked us to use CRC concept to build our software in the forthcoming days

Then he started to continue with rails

This time he taught us how to create a model in Rails 3.0.3

He demonstrated

  • An example of creating a model by using rails generate model command
  • Migrating in to the database using rake db:migrate command
  • Switching to irb environment using rails console command
  • How to add a record, update a record, delete a record from the console ?

He asked us to go through api from here http://api.rubyonrails.org/

On the whole, we all had wonderful time during celebrations as well as in the class sessions

My sincere thanks to our mentors and my collegaues

Read Full Post »

Greetings!

To create a web layout for our project, Trainer’s Union ( http://tu.slashprog.com/), our mentor told us about two (960.gs, Blueprint) Open Source CSS Frameworks.

I just started to play with Blueprint.

I would like to share my little knowledge of blueprint here.

What is Blueprint ?

Blueprint is a CSS framework, which aims to cut down on your development time. It gives you a solid foundation to build your project on top of, with an easy-to-use grid, sensible typography, useful plugins, and even a stylesheet for printing.

Source : http://www.blueprintcss.org/

Installing Blueprint :

To install it, download the zip or tar file from http://www.blueprintcss.org/

Extract the contents and you may find it contains many folders

Keep the important folder named blueprint and delete the rest.

Blueprint folder contains the necessary CSS files.

Uploading Blueprint to HTML code:

To make use of blueprint css files, we need to upload it into our <head> section of HTML file.

 

    <link rel="stylesheet" href="blueprint/screen.css" type="text/css" media="screen,projection" />
    <link rel="stylesheet" href="blueprint/print.css"  type="text/css" media="print" />
    <!--[if lt IE 8]><link rel="stylesheet" href="blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->
    

Things must know about Blueprint

  • Blueprint is a grid based framework
  • The grid is 950px wide, with 24 columns spanning 30px, and a 10px margin between columns
  • First step in designing the layout is to surround your grid with a container
  • Use div’s with one of the .span-x classes to set the number of columns the elements should span
  • The “last” class, which every last element inside a container or another column needs
  • Nesting of columns is possible.
  • Placing “showgrid” class shows a layout of your page inside a grid

Now we can create blueprint CSS framework for a simple layout design as follows

A Simple Layout:

We can write a skeleton code for the above layout

Creating a Skeleton Code:

<html>
<head>
 <title>Sample</title>
 <link rel="stylesheet" href="blueprint/screen.css" type="text/css" />
 <link rel="stylesheet" href="blueprint/reset.css" type="text/css" />
<!--[if lt IE 8]><link rel="stylesheet" href="blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->
</head>
<body>
<!--Container Div-->
<div class="container showgrid">

<!-- Header Div-->
<div class="span-24">
<p>Header</p>
</div>
<!--End Header Div-->

 <!-- Left Div-->
 <div class = "span-7">
 <p>Parent Col 1</p>
 <div class="span-3">
 <p>Child Col 1</p>
 </div>
 <div class="span-4 last">
 <p>Child Col 2</p>
 </div>
 </div>
 <!-- End Left Div-->

 <!-- Mid Div-->
 <div class ="span-10">
 <p>Parent Col 2</p>
 <div class="span-10 last">
 <p>Child Col 1</p>
 </div>
 </div>
 <!-- End Mid Div -->

 <!-- Right Div-->
 <div class="span-7 last">
 <p>Parent Col 3</p>
 <div class="span-2">
 <p>Child Col 1</p>
 </div>
 <div class="span-2">
 <p>Child Col 2</p>
 </div>
 <div class="span-3 last">
 <p>Child Col 3</p>
 </div>
 </div>
 <!-- End Right Div-->

 <!-- Footer Div-->
 <div class="span-24">
 <p>Footer</p>
 </div>
 <!-- End Footer Div-->

 </div>
<!-- End Container Div-->

</body>
</html>

The web page looks as,

After adding some contents into it, the web page looks as below

Read Full Post »

Hai today i downloaded a .tar.bz2 archive.

To decompress it, i typed the following command.

tar -xzvf example.tar.bz2

But i received an error as

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Exiting with failure status due to previous errors

Initially, i dont understand what is the reason for the error.

After googling, i came to know that the archive is not in gzip format i.e., it doesn’t ends with .tar.gz format

Its in .bz2 format

Hence we need to give  the following command to extract the archives that ends with .tar.bz2

tar -xjvf example.tar.bz2

By executing the above command your archive will get extracted

The difference between two (tar) commands is that ‘z’ is replaced by ‘j’ flag.

We use ‘z’ flag to extract the archive that ends in .tar.gz file.

Read Full Post »

Older Posts »