Highlight current element using javascript

Adding dyamic current link style using javascript. It makes easy to view where we are in website. I’m talking about when you are at home and home looks different from others. How can one achieve that without even using server side code. So I’ll give you a easy way of doing this. Requirement: Please Download mootols scripts. Home About Services… Read more →

PHP comment style

There are three ways of PHP commenting… #some single line comment in php //Another way of single line commenting in php /* some multiline commenting */ Read more →

Ending tags of php – leave or not

To end the php code we can use <? , In fact it is just optional and we should leave it when we are following OOP. This helps us to remove unwanted whitespaces. This is the core rule of Codeigniter also. But sometimes leaving this make code unclear and messy. Conclusion , so use this ?> when it’s required and… Read more →

Simulate a Key event press/release in QT 4

QApplication::sendEvent(this, new QKeyEvent (QEvent::KeyPress, Qt::Key_Dead_Diaeresis, Qt::NoModifier, QString(“¨”))); //Another way I guess easy to understand :) //Although both are same QKeyEvent keyEvent(QEvent::KeyPress,Qt::Key_Escape, Qt::NoModifier); QApplication::sendEvent(this, &keyEvent); Read more →

CSS Tip 3 # ShortHand Guide

CSS Shorthand Guide Ok. Let’s set the record straight. There is no official guide for each and every CSS shorthand property value. So let’s work together and put one together shall we? Ok. Straight to the business. Anytime I’ve ran into a specification (besides the confusing mess at the W3C), it turns into showing off a couple of examples and… Read more →

CSS Beginners tablet 2: Outline

outlines differ from borders in the following ways: 1. Outlines do not take up space. 2. Outlines may be non-rectangular. The outline properties control the style of these dynamic outlines. Read more →

CSS Rule 3 : System Colors

System Colors Any color property (e.g., ’color’ or ’background-color’) can take one of the following names. Although these are case-insensitive, it is recommended that 284 23 Apr 2009 15:57 User interface the mixed capitalization shown below be used, to make the names more legible. ActiveBorder Active window border ActiveCaption Active window caption AppWorkspace Background color of multiple document interface Background… Read more →

CSS Beginners tablet 1: Comments may not be nested

Comments begin with the characters “/*” and end with the characters “*/”. They may occur anywhere between tokens, and their contents have no influence on the rendering. Comments may not be nested. CSS also allows the SGML comment delimiters (““) in certain places defined by the grammar, but they do not delimit CSS comments. Read more →

CSS Rules 2: CSS Predefined Color List

CSS Predefined Color List A is either a keyword or a numerical RGB specification. The list of color keywords is: aqua black blue fuchsia gray green lime maroon navy olive orange purple red silver teal white yellow. These 17 colors have the following values: maroon= #800000 red= #ff0000 orange= #ffA500 yellow= #ffff00 olive= #808000 purple= #800080 fuchsia= #ff00ff white= #ffffff… Read more →

CSS Tip 2 : Quotes are optional in URL

The format of a URI value is ’url(’ followed by optional white space followed by an optional single quote (’) or double quote (“) character followed by the URI itself, followed by an optional single quote (’) or double quote (“) character followed by optional white space followed by ’)’. The two quote characters must be the same. Example(s): An… Read more →

CSS Rules 1 : ex ,em,px Know the difference

There are two types of length units: relative and absolute. Relative length units specify a length relative to another length property. Style sheets that use relative units will more easily scale from one medium to another (e.g., from a computer display to a laser printer). Relative units are: em: the ’font-size’ of the relevant font ex: the ’x-height’ of the… Read more →

CSS Tips 1 : Support for 2 values of same css property

If a User Agent(UA) does not support a particular value, it will ignore that value when parsing style sheets, as if that value was an illegal value . For example: Example(s): h3 { display: inline; display: run-in; } A UA that supports the ’run-in’ value for the ’display’ property will accept the first display declaration and then “write over” that… Read more →

gOS error : Virtual PC 2007

Microsoft Virtual PC 2007: An unrecoverable processor error has been encountered. install Suse Linux/Fedora and also gOS to Virtual PC 2007 Type(append to other options ) noreplace-paravirt to boot option This solves my problem. Read more →

vb.net htmlattributes example

ASP.NET MVC Code Example 1. < % Html.BeginForm("Create", "Model", "", "", New With {.id = "CreateForm"})%> Example 2 < % Html.BeginForm("Create", "Model", FormMethod.Post, New With {.id = "CreateForm"})%> Read more →

Qt Code Example: New File | Open File | Save File | Save as File | File Print | Print Preview | File Print Preview | Print Preview

These are few code snippet taken from Qt examples. I’m making easier to look for particular functions. That’s it :) . New File Open File Save File Save as File File Print Print Preview File Print Preview Print Preview Save as PDF void TextEdit::fileNew() { if (maybeSave()) { textEdit->clear(); setCurrentFileName(QString()); } } void TextEdit::fileOpen() { QString fn = QFileDialog::getOpenFileName(this, tr(“Open… Read more →

Qt Code Example: MessageBox

QMessageBox::about(this, tr(“About Syntax Highlighter”), tr(“The Syntax Highlighter example shows how ” \ “to perform simple syntax highlighting by subclassing ” \ “the QSyntaxHighlighter class and describing ” \ “highlighting rules using regular expressions.”)); Read more →

Qt Code Example : Open File

void MainWindow::openFile(const QString &path) { QString fileName = path; if (fileName.isNull()) fileName = QFileDialog::getOpenFileName(this, tr(“Open File”), “”, “C++ Files (*.cpp *.h)”); if (!fileName.isEmpty()) { QFile file(fileName); if (file.open(QFile::ReadOnly | QFile::Text)) editor->setPlainText(file.readAll()); } } Read more →