Wednesday, December 18, 2013

Tips on Socializing with Colleagues at Work


It is challenging for the office workers to socialize each other or it is a challenging subject to think about how much socializing is ideal. If you are rather an introverted person who does not open up easily to others, here are some ways to start off the conversation and socialize with your colleagues.

DO's

- Try initiating short talks whenever you run across someone in the office even if it is about the weather, food or holidays. This shows your effort to be open-friendly and can reduce any misunderstandings.
- Take five minutes in the afternoon to drop by offices of those whom you want to socialize with. It does take a little effort but the friendly chats surely contribute to ease the atmosphere and makes work more tolerable.
- Even if you don't have any topics at hand, try getting to know others as genuine people. Ask what they like and improve your relationships.

DO NOT's

- In your conversations, avoid speaking about religion and politics as these two can possibly become a sensitive or even offensive topic for anyone.
- Avoid being absent to the corporate event like Christmas lighting, for example. Those activities become a good opportunity to bond instead of wasting time.
- Do not hesitate to ask about the topics that you are not knowledgeable at. Rather try taking interest, follow up with the news stories that others like.

Tuesday, September 10, 2013

Simple Steps for Website Relaunch

1. Collect Materials
2. Prioritize Web Contents
3. Look & Feel
4. SEO & Content Optimization
5. Build & Test
6. Re-Launch


Other Helpful Tips: 

- Minimize the change of important contents and of their URL's. 

- If haven't, try using Google's Webmaster Tools for audience demographics, traffics, and development strategies for the future.  

Friday, September 06, 2013

Top Seven Mistakes in Building Website

Are you building a website that doesn't get viewers bored? Here are list of common mistakes for you to check through and fix your site before launching it officially. 

- No Call to Action: Are you asking for conversion without giving a taste to viewers? Webpage without call to action has nothing that activates the readers. Try seeing what the pages does for audience. Think of a clear purpose of what you want to achieve through that page. 

- No Address Bar: Unless your website is for simple product or a figure, audience wants to find what they want to find out about. Especially when your site has many articles to dig in, it is always convenient for viewers to have address bar on the website. 

- Passive Verbs: Is your website active or passive? Use active verbs and get rid of passive tense. 

- Long Passages: 260-600 words on a single webpage is known so that viwers can read easily. If longer than that, readers either would skip or not read at all. Visuals with short text welcomes viewers to stay longer and feel comfortable with your site. 

- Cluttered badges: Never emphasize too much on social media and other company banners that do not help promote your site but theirs. It tells the reader saying, "We don't have much to promote." 

- Portal Look: Do not clutter your website with unrelated topics, as it creates scattered attention to readers. Try focusing on top three things that you want your readers to get. More than that would rather divert readers to close the window. 


- No Compatibility: Make sure you test out your website in multiple devices and browsers. Try both on Mac and PC. Tablet and mobile. Firefox and Safari. This will optimize your traffic and avoid blunders. 

Thursday, September 05, 2013

Except from my paper - Web application security

To build secure Web applications, Microsoft describes a holistic approach, which is to apply security at all three layers: network, host, and application.   The first layer is network, which involves protecting the network infrastructure which consists of routers, firewalls, and switches.  In the host layer, it is securing the host, whether it is your Web server, application server, or database server.

According to the WASC Web Application Security Statistics Project 2008, an initiative to pool together sanitized website vulnerability data and to gain a better understanding about the web application vulnerability landscape, more than 13% of 12186 reviewed sites can be compromised completely automatically.  The probability to detect a urgent or critical error in dynamic web application is about 49% by automatic scanning and 96% by comprehensive expert analysis (white box method).  Also, Analyst firm Gartner Inc. of IBM has stated that 75% of all attacks on web sites and web applications target the application level and not the infrastructure.

Knowing the threats and incorporating security into the applications’ life cycle are important measures essential to the application security.  Open Web Application Security Project (OWASP) and Web Application Security Consortium (WASC) publish documents and initiates projects to raise awareness of application security by identifying some of the most critical risks. 




Here is link to the OWASP Top 10, which focuses on Top 10 Most Critical Web Application Security Risks to protect against these high risk problem areas. Be sure to check out the cheat sheet to prevent security vulnerability.

Monday, June 03, 2013

Setting flash message and redirect with yii-user-management

If you want to set a flash message letting the user know that they need to login or to have required credentials before proceeding to the page they requested, you can do the following.

In the main config file, please add the location of the 'errorHandler'.
 'components' => array(
      'errorHandler'=>array(
            'errorAction' => 'site/error'
        ),

),

Then, in the siteController, add the error action page
/**
     * This is the action to handle external exceptions.
     */
    public function actionError()
    {
        $error = Yii::app()->errorHandler->error;
        if ($error['code']=='403') {
            Yii::app()->user->setFlash('Require Login', $error['code']. 'Error Occured. Please login before continuing.');
            Yii::app()->user->setState('error_login', $error['code']. ' Error Occured. Please login before continuing.');
            /* Get the current URL to redirect */
            Yii::app()->user->setState('redirectUrl', Yii::app()->request->url);
            Yii::app()->controller->redirect(array('/user/user/login'));
        } else if ($error) {
            if ($error['code']=='404') {$error['code'] = "404: Page Not Found"; $error['message'] = "Sorry, but the page you are looking for has not been found.  Please check the URL for errors and try again.";}
            $this->render('error', array('error'=>$error));
        }
        else {
            throw new CHttpException(404, 'Page not found.');
        }
    }
Then, in yii-user-management page, located in app-page/modules/user/views/user/login.php, you can set the flash message to let the users know that they need to login before.

     <?php if(Yii::app()->user->getState('error_login')):?>
        <p class="flash-success"><?php echo Yii::app()->user->getState('error_login'); ?></p>
        <br />

<?php endif; ?>
Then, redirect them to the right page.  If you set the hiddenField for returnURL, yii-user-management will redirect you to the page that the user tried at the first place.

<?php
if(Yii::app()->user->getState('redirectUrl')) {
     $_GET['action'] = Yii::app()->user->getState('redirectUrl');
}
if(isset($_GET['action'])) {
    echo CHtml::hiddenField('returnUrl', urldecode($_GET['action']));
}

?>
I didn't actually use renderFlash used in Yum (yii-user-management), but it works well~

Tuesday, May 14, 2013

YII: Create a Delete Button with Post Action and Confirmation Dialog

Here is how to create a delete button or link with post action and also add confirmation dialog.

echo CHtml::link("Delete", '#', array('submit'=>array('post/delete', "id"=>$data->id), 'confirm' => 'Are you sure you want to delete?'));






In order to delete, you must pass variable through post action, not get action, so here is how you can make a delete button.


Tuesday, April 09, 2013

Using CJUIDatePicker in Yii CActiveForm Widget

If you want to add Jquery UI DatePicker in create/update form, you can do the following,
http://jqueryui.com/datepicker/

Inside
<?php
$form=$this->beginWidget('CActiveForm', array(
    'id'=>'event-form',
    'enableAjaxValidation'=>false,
)); ?>


<?php $this->endWidget(); ?>

Find the row you want to add the datepicker,

<div class="row">
 <?php echo $form->labelEx($model,'created'); ?>
 <?php echo $form->textField($model,'created'); ?>
 <?php echo $form->error($model,'created'); ?>
</div>
 
Replace 
<?php echo $form->textField($model,'created'); ?> 
with
 
<?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
 'name'=>"Event[created]", // the name of the field
 'value'=>$model->created,  // pre-fill the value
 // additional javascript options for the date picker plugin
 'options'=>array(
 'showAnim'=>'fold',
 'dateFormat'=>'yy-mm-dd',  // optional Date formatting
 'debug'=>true,
),
 'htmlOptions'=>array(
 'style'=>'height:20px;'
 ),
 )); 
?>
That's it!  Unfortunately, it didn't work for me, so I had to update old jquery-ui.css and jquery-ui.js.

To update them, download the latest stable version and upload them to PATH-TO-FRAMEWORK/web/js/source/jui/js / jquery-ui.min.js and jquery-ui-i18n.min.js and /web/js/source/jui/css/base / jquery-ui.css

Yay! It is working~