Yii Vertical Operations Menu (CMenu)

Yii framework provides a nice, dynamic “Operations Menu” with CRUD views generated by Gii application. In one of my projects I wanted to change vertical nature of the operations menu and make it horizontal to match with the template. Below image illustrates the change I wanted. Basically it is all about changing horizontal nature of Yii Operations Menu into a vertical arrangement.

Just to be sure that none of the CSS changes affect other components, DIV containing the CMenu (found in “views/layouts/column2.php”, unless you have moved it elsewhere) was modified as shown below:

Note the new class “operations_ads” added to the wrapper DIV.

<div class="span-5 last operations_ads">
<div id="sidebar">
<?php
 $this->beginWidget('zii.widgets.CPortlet', array(
  'title'=>'Operations',
 ));
 $this->widget('zii.widgets.CMenu', array(
  'items'=>$this->menu,
  'htmlOptions'=>array('class'=>'operations'),
 ));
 $this->endWidget();
?>
</div><!-- sidebar -->
</div>

Finally flowing CSS was added:

.operations_ads ul {
	/* transform horizontal <UL> into a vertical UL*/
	display: inline !important;
}
.operations_ads li {
	/* transform horizontal <UL> into a vertical UL*/
	display: block !important;
	float: left !important;
	padding-right: 10px;
	margin-right: 10px;
	/* Styling */
	border-style:solid;
	border-color:#80CFFF;
	border-width:1px;
	background-color:#CEEDFF;
}
.operations_ads li:hover {
	background-color:#80CFFF;
}
.operations_ads {
	width: 100% !important;
}
.operations_ads .portlet-content {
	position: absolute;
	width: 732px;
}
Share

XSS (Cross-site scripting)

Cross-site scripting is a vulnerability that exists in many web applications. It is rated as a top threat for web application developers and also rated as one of the famous types of exploits among web application hackers. Before moving ahead, I’d like to point out few examples that prove how common cross-site scripting is, even in nowadays, after 11 years from February 2, 2000 when the first advisory about Cross-Site Scripting (XSS) was published, namely “Advisory CA-2000-02 Malicious HTML Tags Embedded in Client Web Requests”.

Drupal is a famous open source content management system. Shown below is a screenshot of Drupal, Security Mailing list (2011 February).

More >

Share

Fetch-execute cycle and impact of operation types.

What is a fetch-execute cycle in a processor.


Conventional processor consist five units called ALU, Controller, Internal Storage, Internal Interconnections and External Interface. These units are designed to work in a collaborated environment continuously. What should processor and mentioned components do at a moment is decided by the program that is currently being executed. The way processor is going to read next instruction, execute, produce and store result of computation is called Fetch-Execution cycle. Steps of fetch-execution cycle can be further described as shown below:

Fetch:

CPU has a special register named Program Counter (PC) (also referred as Instruction Pointer) which is a part of Internal Storage. CPU reads the memory address stored in this Program Counter (PC) in to Memory Address Register (MAR). This process can be denoted as “[MAR] <= [PC]” More >

Share

Guessing Game in Assembly

This assembly language program is designed to create a very simple game where user is allowed to guess a hard coded number between 1 and 255. This hard coded number can be replaced by a randomly generated number using a “random number generator” for EMU8086, which is bit complex because EMU8086 do not contain an instruction to do this implicitly. Program will output if guess is higher or lower than the input number. The code is well commented so that it can be used by anyone who is interested in learning assembly language.

Assembler

This code is written for EMU8086

http://www.emu8086.com/

More >

Share