Pages

Jun 21, 2011

CSS/HTML Interview Questions

CSS/HTML Interview Questions


1. What CSS means? In addition, how it works?
CSS:
How it works:








2. Which of them should work and which of them do not work to center an object horizontally (also implement the theoretical concept), explain?
(Put cross or right, left side and explain it right side)
a) Take a wrapper and style it to {margin: 0 auto; }. Explain:


b) #DIV {top: center; left:center; }. Explain:


c) #DIV {top: 50%; left:50%; right: -200px; bottom: -250px; height:500px ;weight:400}. Explain:




d) #DIV {top: 50%; left:50% }. Explain:




e) Take a wrapper and style it to {text-align:center;}. Explain:




3. How to align an object to vertically center?


4. How overlap a Flash Object?






5. How to create CSS Menu (one item would be enough)? Give an Example with HTML + CSS.




6. What do you understand by the term of selectors? Give some example.


7. How many types of styles sheets are there?




8. What do you know about Reset CSS?


9. Suppose you have an ID named “id”, class named “class”, h1 and h2 tags; now write a simple css rule for all of them at the same time.








10. What is the default CSS position for every object and the inherit does work?


11. Why specification is need in CSS Terms?


12. How to use a transparent image?






13. What float does? And What does ‘Clear’ have to do with it, explain.












14. Which cannot be negative? Which one does the outer spacing?


15. What CSS fixed position means?


16. What z-index does?


17. Write some CSS pseudo codes? And give some example of it.




18. Is CSS case sensitive?
a) Yes
b) No
19. How to use a Fixed and Repeated background using CSS?










20. What inline,block,none attribute does in the display parameter ?
Inline:
Block:
None:
21. What do you understand by the term of XHTML and HTML?
XHTML:
HTML:

CSS Center or Centering an Object

CSS Center or Centering an Object

How do you center a containing block on a page using CSS? There are two main methods and the choice should be made based on whether your page layout is liquid (will move in and out depending on the size of the browser window) or fixed width.

Centering liquid layouts

Liquid layouts are easy to center using margins on each side of the containing box. The margins can be set with em, pixel or percentage units.
div#container
{
 margin-left: 10%;
 margin-right: 10%;
}

Centering fixed-width layouts

Theoretically, you should be able to apply auto margins to the left and right of the containing block and it should center on the page.
The W3C Visual formatting model states: “If both ‘margin-left’ and ‘margin-right’ are ‘auto’, their used values are equal. This horizontally centers the element with respect to the edges of the containing block.”
So, a containing block should be able to be centered using the following rules:
div#container
{
 margin-left: auto;
 margin-right: auto;
 width: 50em;
}
However, some browsers do not center the containing blocks using this method as they ignore the auto margins. These browsers include:
  • NN4 (Mac and Win)
  • Win/IE4
  • Win/IE5
  • Win/IE5.5
  • Win/IE6 (when in quirks-mode)
By adding two simple rules, this problem can be overcome in all of the browsers mentioned above, excluding NN4.

1. Center the body

While these browsers ignore auto margins, they will follow “text-align: center”. If this is applied to the body, the containing block will center correctly. So, a new rule is added:
body
{
 text-align: center;
}

div#container
{
 margin-left: auto;
 margin-right: auto;
 width: 50em;
}

2. Resetting text-align

The only problem with this new rule is that all content on the page is now center-aligned. To overcome the center alignment problem, a new declaration is added within the containing block rule set – “text-align: left”. The final CSS code is:
body
{
 text-align: center;
}

div#container
{
 margin-left: auto;
 margin-right: auto;
 width: 50em;
 text-align: left;
}

Jun 4, 2011

Alim Ul Karim's Blog: Database First Approach / DB First Approach / MVC3

Alim Ul Karim's Blog: How to Create Database First in ASP.NET MVC3/MVC 3...: "If you are new in ASP . NET MVC / MVC3 or in EntityFramework ( EF ) you should look for some articles before read this topic. If you ar..."

Alim Ul Karim's Blog: Database First Approach / DB First Approach / MVC3

Jun 1, 2011

How to install Code::Blocks GCC Compiler / C Compiler / OpenSource Cross Platform C++ compiler Correctly in your machine(windows) / computer / pc

How to install Code::Blocks GCC Compiler / C Compiler / OpenSource Cross Platform C++ compiler  Correctly in your machine(windows) / computer / pc


 Open Source Cross Platform IDE for C++ / Code Blocks / C Compiler

Many of us downloaded the code blocks (codeblocks-10.05-setup.exe) 23 MB version which doesn't have any compilers , consequently all default installation doesn't give you the correct result that you have been expecting.

The correct version you should download codeblocks-10.05mingw-setup.exe which is approximately 73 MB  and has GCC compilers ; which will give you the correct result that you have been expecting for.


Code Block C Compiler (light-weight) Installation Settings :

First Screen After Installing Code::Blocks
Click on that radio button and hit ok.
After Configuration First look of the Code::Blocks IDE
Making the Editor better - Font Size , Fonts etc...


see now you have better fonts and looks than before.

Now you can run your c++ or c codes from the Built Menu item.


Suppose you had installed that correct version but still your code isn't compiling , now what should you do?

Goto [Settings] -> [ Compiler and Debugger ]

You should check and follow below images to configure your code blocks compiler.


Select those options as shown.
Select as shown and hit ok.




Seo Texts:
Code :: Blocks , C Compilers Problem , Code :: Blocks Installation Process Step by Step , GCC Complier Problems , C++ Cross Platform Free IDE

May 27, 2011

Interview Questions: What is the difference between unique-key and primary-key in database (Oracle , Microsoft SQL Server, Access , MySQL etc)

Interview Questions: What is the difference between unique-key and primary-key in database (Oracle , Microsoft SQL Server, Access , MySQL etc...)

This is a mature question , I myself had faced this question in an interview but couldn't describe all the points but I was able to describe the main key point of this question "What is the difference between unique-key and primary-key in database".


The main key points of this question( "What is the difference between unique-key and primary-key in database") is below number 1,2.


1) Unique key (UK) can be null but Primary key can't be null.
2) Primary key (PK) can be referenced to other Data-tables as a Foreign(FK) but 

Unique key (UK) can't play this role.

3) We can have multiple unique keys(UK) in a table but in the case of Primary key (PK) there should be only one.
4) And also a primary key creates a cluster-index by default but unique key creates a non-cluster-index by default.


More Explanation: 
Primary Key is a combination of Unique and NOT NULL Constraints so it can’t have duplicate values or any null values.
Moreover in Oracle Databases,  UNIQUE Key Columns can have any number of NULL values, however in MS SQL Server/ Microsoft-Access can only have one NULL value in  their unique key column.

What is Foreign Key:

Related links in What is the difference between unique-key and primary-key:

SEO Labels:

Uniquekey and primarykey Difference , 

What is the difference between unique-key and primary-key , 

Interview Questions: What is the difference between unique-key and primary-key , 

Foreign ,Key, Primary ,Key, Unique, Key

May 19, 2011

Alim Ul Karim's Blog: How to Create Database First in ASP.NET MVC3/MVC 3...

Alim Ul Karim's Blog: How to Create Database First in ASP.NET MVC3/MVC 3...: "If you are new in ASP . NET MVC / MVC3 or in EntityFramework ( EF ) you should look for some articles before read this topic. If you ar..."

How to Create Database First in ASP.NET MVC3/MVC 3 using Entity Framework (EntityFramework - EF 4.1/EF4.1) 4.1

If you are new in ASP.NET MVC /MVC3 or in EntityFramework (EF) you should look for some articles before read this topic. If you are a beginner or apprentice then , I suggest you to watch Scott Hanselman's MVC-101 video , it will help you to learn about new ASP.NET 4 MVC3 from beginner to advanced (if MVC2 is already known to you ,  MVC3 will not be a new path or unknown to you , basic structure remain same as MVC2).


The reason behind I am writing this topic because I haven't found any good resource to start my project as Database First in MVC using Entity Framework 4.1 (EF 4.1). In Entity Framework 4.1 coders,database designers, model designers can do what they want first, if you like to code then code first (there are lots of examples over the internet  about - code first in EF 4.1 few of them are linked in my article), if like to create model first then do it first and so on.
In this topic, I will write less and help you via images because  it's a fast and easy way to learn. So let's begin to work.


I have created a new ASP.NET 4 MVC3 HTML5 based Internet application, attached a database first as shown in the image , I recommend you to download the source and investigate yourself.
Project First Appearence - Database DB First Approach ASP.NET 4 MVC3
BlogContent DataTable Data
Taxonomy Data
ContentType Table Data
Existing Database , table relationships schema - Database DB First approach


Creating ADO.NET ENTITY Data Model From a Existing Database - Database First Approch


Generate Entity Data Model From Existing Database - DB - Database DB First approach 

Creating ConnectionString from Exiting Database - Database First approach


Entity Data Model Edmx file view


 right click on the white surface in the entity data model of Blog Database.

DBContext Generate From Entity Data Model

Creating Repository , Model and Database Table Class from the Entity Data Model, Click on 'ok' twice
Now Build your project and then do as below.
After Creating Repository, Model and DBContext from Wizard


Controller Wizard to Create V-View, C- Controller
V-View and C- Controller has been created with Read,Write, Delete, Details View ability

Created a Link for the Blog Content Controller

Preview of the Project

Code : http://www.mediafire.com/download/4oai056o5h3enlr/WebApplication3.7z


Download the Source File:
  1. Direct Link: Blog OpenSource Project - Database First Approch - ASP.NET MVC3 HTML5 Project
  2. Mediafire Link: Blog OpenSource Project - Database First Approch - ASP.NET MVC3 HTML5 Project
Related Videos of Scott Hanselman, Steve Sanderson , download High WMV for best quality experience:
  1. Scaffolding – ASP.NET, NuGet, Entity Framework Code First and More
  2. DevDays Keynote + MVC-101 + Nuget : Depth
  3. NuGet In Depth: Empowering Open Source on the .NET Platform

Author Related Links:
SEO Labels:

DB First Approch / Database First Approch / Create Database First then model then code / First effort Database - DB ASP.NET MVC 3/ MVC3 / EntityFramework Database First / EF 4.1 / EF4.1 Database First approch / EF 4.1 Database(DB) First Approch .

May 3, 2011

Adobe Flash CS3,CS4,CS5 (ActionScript 3.0 AS3) - Video/MovieClip/MC/Movie Clip - FLV/SWF - sound/audio volume decreasing or increasing or mute or reduce code. -- How to sound off in a flash movieclip as3


Adobe Flash CS3,CS4,CS5 (ActionScript 3.0 AS3) - Video/MovieClip/MC/Movie Clip - FLV/SWF - sound/audio volume decreasing or increasing or mute or reduce code.


Over the Internet, I had searched a lot and found few articles that suggested me to add soundclips as an external object and then control or reduce it(volume/sound) but what if  I have a video.swf or flv which contains sound/audio in my library or in the stage and I want to reduce or increase it's volume/sound.After , searching for 5 hours I was bored but finally found the solution  and now I want to share it with everyone.


So no more talk , just read the code and you will have the idea how to do it.


Code:
//Suppose I have a movieclip/mc/movie clip named 'video' which contains audio and video entity 
// we are writting as3/actionscript 3.0 coding , follow as below.


//Mute Volume/Sound
video.soundTransform = new SoundTransform(0);  //maybe it won't work in AS2/ActionScript 2.0...works in as3



//Full Volume/Sound
video.soundTransform  = new SoundTransform(1);  //maybe it won't work in AS2/ActionScript 2.0...works in as3


//Half Volume/Sound
video.soundTransform = new SoundTransform(.5);  //maybe it won't work in AS2/ActionScript 2.0...works in as3




SEO Tags:


Flash ,

Flash Sound off ,

Flash Sound Reduce from Original ,

Flash Sound Reduce in a movieclip ,

Flash AS3 Sound Reduce in a movieclip ,

Flash AS3 Sound Reduce in a movieclip ,

Flash AS3 Sound Mute in a movieclip ,

Flash AS3 Sound Mute in a flv file ,

Flash AS3 Sound Reduce in a movieclip ,

Flash AS3 Sound Reduce in a flv file ,

Flash AS3 Sound Reduce in a movie file ,

Flash AS3 Sound Sound off flv file ,

Flash AS3 Sound SoundOff in movieclip ,

Soundoff




Adobe Flash CS3,CS4,CS5 (ActionScript 3.0 AS3) - Send Data (SendData) to a URL or PHP or ASP Page as Post or Get Method Example

Adobe Flash CS3,CS4,CS5 (ActionScript 3.0 AS3) - Send Data (SendData) to a URL or PHP or ASP Page as Post or Get Method Example
by using this method we can send email to our clients.


Tested on Flash ActionScript 3.0(AS3) - 

function send_data_to_url():void
{
var url_var:URLVariables = new URLVariables();
url_var.email = "auk.junk@live.com";

 url_var.first_name      = "Alim";
 url_var.middle_name   = "Ul";
 url_var.last_name           = "Karim"; //Alim Blog
 url_var.blog             = "Blog";
 //add as much as you want.
 trace(url_var);

sendData("example.php",url_var); //or use asp page url

}

function sendData(url:String, _vars:URLVariables):void
{
var request:URLRequest = new URLRequest(url);
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT;
request.data = _vars;
request.method = URLRequestMethod.POST; //Set Get Method if you want
loader.addEventListener(Event.COMPLETE, handleComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.load(request);

}
function handleComplete(event:Event):void
{
var loader:URLLoader = URLLoader(event.target); // send request complete , you can do   what ever you want
}
function onIOError(event:IOErrorEvent):void
{
//a.text = "Error loading URL."; // print error in a textfield
}


Tags:

Flash ActionScript,

SendData,

to url,

ASP ,

PHP,AS3