Eid Mubarak

Eid Mubarak

Eid Mubarak to every one. May this Eid bring lots of happiness and joy and prosperity.

Child Labor

Child Labor is one of a very common problem in many countries. This includes employment of kids under the age of 18. UNICEF shares number of children under age and working.  We on the other hand are enjoying a 1 Mbps internet connection, with a cup of tea on the desk and not forgetting the snacks. Some things keep me wondering what is going on. Let us think from a child’s

Child Labor

perspective who is actually a prey to the most devastating situation of working even though he/she should be studying and learning the essence of books.

I have seen many times, small boys and girls begging for money on traffic signals, working, selling newspapers, selling mineral water bottles, picking cans, etc. I just want this to make us think a simple question “Why?” Why do these kids become the unlucky ones and they work when they should be studying, making a future for themselves and their families.

The answer was simple; they don’t have an option to do anything else. The kids have families; they don’t have an income source. Where should we expect them to earn if they don’t have anyone except themselves to earn. We sit in AC’s they sit by the side of roads. We eat Tandoori chicken, they eat left overs which aren’t even fresh. The basic question was child labor; we did make a rule, keeping children as employment is not legal. We did make a rule for it, but what were the children’s faults who don’t have an income for their house. What is their fault if they do not have an Air conditioner in their house? What is their fault if they do not have a house? They are also humans, they also get hungry. So how should we expect them to feed themselves, we claim to do so much but we forget the right. Checking stats with UNICEF, more than 158 million kids are working who are under the age of 14. The number is not a small one that we can ignore; we need to think to ourselves why the rule when we know it gives food to a few million. Many times asking the young ones “Why do you work?” led me to this answer being told “Kaam nahi karein gai tou khana kaisey lain gai (i.e. if we don’t work, where will we get food from)”. Clothing is not at all an option for these kids, wearing clothes that are ripped off. A person who doesn’t get food to eat, how can we expect him not to struggle for the food….

I just want us to think, as the literates what are we doing with the future of the world. The world is a colorful place which can be made even more colorful if we all decide to solve the problems the world has…

Piezoelectric Material

Sometimes, we think of problems and solutions. One such case is of the road that generates energy. Or may be some mechanical energy needs to be converted.  Piezoelectric material is used at places where we need to convert mechanical stress/Energy to Electrical energy.  The way a piezoelectric material acts is it absorbs the applied mechanical stress and converts it to electrical energy with a change in volume. This is referred to as the piezoelectric effect. Piezoelectric effect is a reversible process between applied mechanical energy and electrical energy. There are quite complex mechanisms to understand the mathematical working of piezoelectric effect.

Piezoelectric materials can be divided into 2 categories being the crystals and ceramics. Each of them has their advantages. The most commonly used piezoelectric material is quarts (SiO2). Piezoelectric materials are being used at a lot of places like airbag of cars. It works with the mechanism of when a car hits the person exerts pressure on the piezoelectric sensor resulting into an electrical signal being sent that triggers the airbag and hence the safety. Not only this is a typical application, now a few places have roads that have piezoelectric material deployed in them such that when people walk over them or a car drives over them, mechanical strain is applied generating electricity. Quite a lot of electricity can be produced by this mechanism at places. Other uses include imaging and high power applications. Piezoelectric motors, high voltage sources, etc. Piezoelectric material exists in nature as well and human as managed to develop new piezoelectric materials as well.

Piezoelectric is a growing field and applications keep on coming as mechanical energy is everywhere. Why not convert that to electrical energy and use it…

ITDen revamped :)

After a long long time, I thought to my self why did i actually stop writing this blog. So i have decided to write here again. Working on the website at the moment and stuff.

Regards,
Admin

How to make a Simple function in Matlab that adds two numbers

How to make a simple program in MATLAB that adds two numbers?

Have you ever encountered the power of Matlab? Well if you are an Engineering student you have to face it, now or than. Specially if you are working with Electrical, Electronics, genetics, etc… This is a very simple tutorial to tell you how to make a function that allows you to add two numbers. Why such a simple program? Well Matlab is vast; it has a lot of power. so I thought of starting with a very simple program, I will try to post some things related to Matlab as well.

To start off, open up Matlab,

In the command window type edit, or go to File > New M-file.

Copy the following piece of code

Function add (num1, num2)% note the difference with the line below the output will be shown on the %console(command window)

num3= num1+num2

% num4 wont be shown on the command window

num4 = num1+num2;

return;

I know the code is not that long actually the code is nothing. One point of emphasis is shown in the code, which is by the comment that is the percentage at the beginning of the line.

Comments are a vital part of programming any thing, and in Matlab we use % to make single lined comments.

A point of note: the file should be saved as add.m. Running the code is really simple, in command window we type

>add(4,6)

If we look into the first line of the code, it indicates the code function add (num1, num2). This line means this is a function called add (we will use this name to call add), num1 and num2 indicate this takes two parameters, since we only need two parameters for the input, by saying parameters I mean they can be numbers, or any data type, since in Matlab we talk about functions as well like sin(x), etc. but here we will just use two numbers, as told above how to run the code snippet. you can add two numbers which is definitely not a high level thing but  keeping in mind the complexity and power of Matlab, this is just the start.

Any questions regarding this, I would be more than pleased to answer.

The most basic mistake in CSS

Well, we use CSS, no matter how complex the style sheet becomes, we tend to do some very basic mistakes that might result into catastrophic results. Today I will cover a very simple mistake. Let us assume this piece of style which seems correct

#pa {

Background: red;

font-family: Arial,georgia,sans-serif;

font-weight: bolder;

font-style: normal;

text-decoration: underline;

font-variant: ;

font-size: 0px;

width:500px;

height:300px

overflow: auto;

}

It seems like a perfect style sheet, but it will not actually have a scroll bar in it. No matter how much text is entered. So where is the problem, the problems exists in the line

height:300px

it has no terminator at the end of the property.  The property overflow is treated as being related to height some how. But this is wrong.

So the correct code is

#pa {

Background: red;

font-family: Arial,georgia,sans-serif;

font-weight: bolder;

font-style: normal;

text-decoration: underline;

font-variant: ;

font-size: 0px;

width:500px;

height:300px;

overflow: auto;

}

Now on entering excess text we see there is a scroll bar. Regardless of the number of property, you should always put the terminator (i.e. ; ) at the end of each property so when you decide to add a property later you don’t get to face any problems. It is a basic problem that we often face.

Cloud Computing: The Beginners Guide

Cloud Computing: The Beginners Guide

The topic every one is talking about now a days. It is actually a computing paradigm, the paradigm of the future. What is actually cloud computing? I define it as the generation of computers that utilizes servers some where in the cloud for data storage, management or computing resources allowing the world to become more efficient in technology.So what is the point of it? Let us consider a company that provides an online solution to some thing. And it is a software solution. They charge some thing for the solution, the data storage is provided, even if they don’t charge, Let us consider what things they have to look in. they need to look into things like overhead costs, customer satisfaction, etc. The most important thing is customer satisfaction. As if the customer is not satisfies the customer might simply leave the service. And if a customer is satisfied with the service, he/she might recommend the software to other users.

Now if the companies number of clients increase, they need more storage. Normally this costs the company buying new servers, and hiring highly trained staff to handle the servers. If there is a trend in decrement for the time period for some reason, the servers are still there and being operated, This means they have to pay whether they are using there servers or no. Giving rise to another point Server is not cheap and not possible for every one to maintain. So this is where we can talk about cloud computing. With cloud computing, we contact a company that provides services that is cloud computing. What is the point? We can get the same server capability for a far lesser amount and there are no hardware problems to deal with. The company that provides the cloud has to deal with the actual hardware. We can get resources at an instant click, and we can get rid of them when ever we don’t need them we can get rid of them. It is like a pay as you go service. Only you pay for what you have been using. Well there are three very big advantages of cloud computing, which are scalability, instantaneous and saves money.

Let us getting back to the solution the company was providing. With cloud computing, the company can now focus on there solution and forget about the issues with the hardware of the servers. And make a better solution by improving their solutions. It does not require any maintenance.

There are 3 trends in cloud computing which are Virtualization, Utility Computing and Software as a Service.So in simple words cloud computing, is the future of computing which can affect the business quite a lot if it is used properly.

Connecting a style sheet with a HTML file

Connecting a style sheet with a HTML file:

Today I will tell you how to import a style sheet into a HTML file, it is very simple. There are a few ways of doing it. So let us being…

Method 1: Writing a style sheet within a HTML page

Well after the <title> in the <head>, we mention that we are giving a link to a style sheet and start coding there. This is what the html code will look like

<html>

<head>

<title>Untitled-1</title>

<link rel=”stylesheet” type=”text/css”>

<style type=”text/css”>

h1{

background:black;

color:white;

}

background:black;

/** and so on and so forth the styling can be continued**/

</style>

</head>

If your web has not a lot of styling involved then only I recommend, because if your webpage is totally based on a lot of styles, then it gets rather complicated or if the style is being imported to many pages.

Method 2: Linking to an external style sheet

In the head we can import an external style sheet. The advantage to this is that it can be applied to as many pages without having to put the whole CSS code into the HTML file.

<html>

<head>

<title>Untitled-1</title>

<link rel=”stylesheet” type=”text/css” href=”/style/style.css” media=”all”>

</head>

Well if you see href=”/style/style.css”, this is more like a hyperlink to the style sheet. Well indeed it is a hyperlink to the style sheet. Now an important piece of information, you should place the link in the href from the root to the web site.Most of the websites use this method, as it is better and easier to implement. And changes can be made much more easily as compared to method 1 of adding styles to your web page.

We can multilink that is connecting multiple style sheets; here is a specific pattern by which results comes. We can embed 2 or more style sheets by the following code

<html>

<head>

<title>Untitled-1</title>

<link rel=”stylesheet” type=”text/css” href=”/style/style.css” media=”all”>

<link rel=”stylesheet” type=”text/css” href=”/style/style_new.css” media=”all”>

</head>

Method 3: Importing a style sheet

This is a built in declaration that we can use to import a style sheet into a HTML page. The syntax is as follows

<html>

<head>

<title>Untitled-1</title>

@import url(styles/style.css);

</head>

Method 4: Inlining style sheets

We can put our styles individually to elements, this can be done as follows:

<pSTYLE=”color:red; background: black; align: center”>This paragraph will be styled as red text on black background.</p>.

So this is about it. I hope you understood the basics of connecting a style sheet with an HTML file. In case of any questions feel free to contact. Have a great day .

Links in CSS

 

Styling links using CSS:

Link styling, a very basic concept that can be achieved using CSS. How to style your links? A question many face. Well there are many tutorials on how to make fancy buttons, attractive buttons, and professional buttons. But what are the basics of the whole thing? I will be explaining the basics of link styling, I won’t go into the exact styling but a general explanation of the whole thing.

So starting with the very basics of links

In a plain html file, we have our link is link

<a href=”home_page.html” target=”_self” >Home Page </a>

Not so complicated and not so styled as well. It will look very simple and in most cases it will not suit the over all page layout if your page is totally custom. So there we have either use java scripting to make image rollovers as links, or very simply style them. It seems the word styling is very common in the article. But to be honest styling is a very basic tool to enhance the page look without needing to get into very complicated methods or very sophisticated coding. I am assuming here you know how to import or connect or embed a style sheet (i.e. a CSS file) into an HTML file. So the first thing is the basic selectors in styling links. There are 4 selectors in styling links which are:

a:link – the default look of a link at a page load

a:visited – this is activated for a link that has been viewed

a:hover – As soon a mouse is taken over a link, it generates the code on that link

a:active- the code is generated when that page is being viewed

These are often called linked pseudo classes. Well this is every thing we need in order to style our links. A little explanation of each selector is described with it. The first thing we can do is add a background, change the font family, vary the size of the font, change the color of the font, add a border, etc. there are many things we can play around with here.

There can be a few scenarios though those need to be looked into, let us start…

The first scenario is where we want all the links to have a single style applied. This is relatively very simple. No need of id’s, classes, etc. the code of the CSS file can simple be,

/**Styling of links**/

/***Note: we can continue adding as many things as we want. I am just giving a few examples here.

a:link{

background: black;

color: white;

text-decoration: none;

}

a:visited {

background: #333333;

color: white;

text-decoration: none;

}

a:hover {

background: #990000;

color: black;

text-decoration: underline;

}

a:active{

background: black;

color: #990000;

text-decoration: underline;

}

Well this was the first case. Not considering a somewhat complicated case; in which we have top panel of buttons, a side bar, and a body where the buttons come. So now we have the fun part. Getting indulged in inserting <div>, and introducing id’s, classes etc.

The first thing we need to see is will the same style be applied to various locations in a page. In case the answer is YES, we will implement classes in these situations. Other wise if its being implemented to an id that is it is going to unique and used only once. So how to implement an id

Top Links come here… <div id=top>

Side links come here

<div class=side>

Body comes here links of body

<div id=body>

Side links also come here

I did not mention the html code. In case you need it for the above table let me know. I would post it; Implementation in CSS. The ids, classes that is required are given in the table it self.

The code for CSS is as follows

/****For the ID=top****/

#top a:link {

/**Styling for Normal link here**/

}

#top a:visited {

/**Styling for visited link here**/

}

#top a:hover {

/**Styling for Hovering here**/

}

#top a:active{

/**Styling for Active link here**/

}

/****For the class=side****/

.side a:link {

/**Styling for Normal link here**/

}

.side a:visited {

/**Styling for visited link here**/

}

.side a:hover {

/**Styling for Hovering here**/

}

.side a:active{

/**Styling for Active link here**/

}

/****For the ID=body****/

#body a:link {

/**Styling for Normal link here**/

}

#body a:visited {

/**Styling for visited link here**/

}

#body a:hover {

/**Styling for Hovering here**/

}

#body a:active{

/**Styling for Active link here**/

}

That is the basic layout of the code to call the ids or classes for styling the links. The styling will be done in the { }. I have mentioned before what can be done to the links.

So I guess this is about it. Very simple styling help. I tried to explain the very basics of ids, classes and styling. If you have any questions leave them as comments I will try to help you out as soon as possible.

Related Posts Plugin for WordPress, Blogger...