Friday, January 2, 2015

ECMA Script 6


Traceur Demo
https://google.github.io/traceur-compiler/demo/repl.html#
In the options tab -- select the show all options

es6 Fiddle
http://www.es6fiddle.net/

Compitable Tab
http://kangax.github.io/compat-table/es6/




Good explanation of prototype and javascript fundamentals
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Inheritance_and_the_prototype_chain#With_a_constructor

Friday, December 5, 2014

Angularjs

Own Plnkr.co
http://plnkr.co/edit/0daJFdwWm32zT8hpfNvB

Creating Tree View
http://jsfiddle.net/brendanowen/uXbn6/8/

Validate
http://angular-ui.github.io/ui-utils/#/showhide

Bootstrap Components
http://getbootstrap.com/components/#btn-dropdowns

AngularJS Magazine
https://flipboard.com/section/the-angularjs-magazine-bbIMWS

JavaScript Design Patterns
http://addyosmani.com/resources/essentialjsdesignpatterns/book/

Angular Design Patterns
http://blog.mgechev.com/2014/07/05/angularjs-in-patterns-part-3/

Javascript Flipboard magazine
https://flipboard.com/section/the-javascript-magazine--bMrmRp

Customer Manager with AngularJS
https://github.com/DanWahlin/CustomerManagerStandard

Some good gyan regarding the flow of anugular js
http://www.phase2technology.com/blog/code-reuse-in-angularjs/

this in javascript
http://javascriptissexy.com/understand-javascripts-this-with-clarity-and-master-it/

Javascript 16 pointers ..[ Every developer should know]
http://javascriptissexy.com/16-javascript-concepts-you-must-know-well/

Path to pdf 60 min
http://fastandfluid.com/publicdownloads/AngularJSIn60MinutesIsh_DanWahlin_May2013.pdf

sample code to start
http://www.codeproject.com/Articles/607873/Extending-HTML-with-AngularJS-Directives

validation framework
http://www.ng-newsletter.com/posts/validations.html

JavaScript Training
http://www.pluralsight.com/courses/javascript-good-parts

Good Article Covering all the basics
http://www.ng-newsletter.com/posts/beginner2expert-directives.html

Angularjs Blogs to Watch
http://neverfriday.com/2013/10/10/writing-an-angularjs-tutorial-first-draft-is-up/


Saturday, July 13, 2013

Database JOINS

JOINS - http://stackoverflow.com/questions/38549/difference-between-inner-and-outer-join

Sybase Search

In Sybase search for 'the contents of publishers (table name)' Transaction Mode - http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.sqlug/html/sqlug/sqlug855.htm

Sunday, January 29, 2012

Unix Alias

Create Unix Alias to get rid of entering long paths every time.

Login into su
prompt>cd
prompt>vi .bash_profile

alias tcb2='cd /local/apps/tomcat/apache-tomcat-7.0.23-2/bin'
alias logs2='cd /local/apps/tomcat/apache-tomcat-7.0.23-2/logs'
alias tclogs2='tail -f /local/apps/tomcat/apache-tomcat-7.0.23-2/logs/catalina.out'

prompt>. .bash_profile

Next time, you do not need to enter complete path like cd /local/apps/tomcat/apache-tomcat-7.0.23-2/bin just type "tcb2" and will be in directory.

Sunday, January 8, 2012

RAP (Rich Ajax Platform) and JMeter

The purpose of this article is to share my experience with JMeter tool when recording the test cases for RAP application using URL Rewriting. This is in continuation with http://wiki.eclipse.org/RAP/LoadTesting

Env:
Tomcat 7.0.23
Java 1.6.0_06-b02

RAP(Rich Ajax Platform):
RAP 1.5M4

File to Deploy:
app.war

Set Up:
Deploy the war file in Tomcat.It creates folder app(name of the war) inside webapps folder. Inside the plugins, we need to add the org.eclipse.rap.widgetidgenerator plugin.You can do this manully. Open the buldles.info (app\WEB-INF\configuration\org.eclipse.equinox.simpleconfigurator) add the org.eclipse.rap.widgetidgenerator,1.0.0.201112291625,plugins/org.eclipse.rap.widgetidgenerator_1.0.0.201112291625.jar,4,true. Copy the org.eclipse.rap.widgetidgenerator_1.0.0.201112291625.jar in plugins folder. This plugin need to be build from the source code and does not come in the rap tool.It will be good to test if the plugin is in active state when the war is installed using the ss command of the osgi framework.

In RAP application the session id is passed from server to client in the result of the first request. Session id can be viewed in the result

Sample Portion of Response Data:

"target": "w1",
"action": "call",
"method": "init",
"properties": {
"rootId": "w1",
"entrypoint": "sapphire",
"url": "rap;jsessionid=7F829865016AD6D0634595306844108A.sapphire01"
}

It can be anywhere in the response from server but it will be having the same format.

Our purpose is to use the session id and pass it into every request to server. Create a regular expression extractor which will extract the jsession id. See the attached image. This should be attached to the first request to server or HTTP Sampler.Store it in a variable.




Now we need to pass this session id in each and every request to sever.In the second HTTP Sample add a pre bean shell processor.




Recording the test case:
Hit the first request on the browser.
Stop to make the below changes.
In Jmeter, If you notice that we have session id in the request. Now we store this in the User Defined Variable. When we further keep recording the test case, session id is replaced by ${snum}

So the actual request
/sever5/rap;jsessionid=AD08983085AB2DA747EC6B6E158E6EC8?nocache=1326086526260
will be presented as
/server5/rap;jsessionid=${snum}?nocache=1326086526260

Now when we run testcase, ${snum} will be replaced with actual session id.




Our Final Test Case will look like

Thursday, July 22, 2010

Code for PopUp


package com
{
import com.adobe.cairngorm.control.CairngormEventDispatcher;
import com.vzw.mpi.rss.events.DataReceiveEvent;
import com.vzw.mpi.rss.model.RdsModelLocator;
import com.vzw.mpi.rss.serverEvents.RdsEvent;
import com.vzw.mpi.rss.utils.RDSConstants;
import com.vzw.mpi.rss.utils.RssConstants;

import customComponents.ImageFocus;
import customComponents.datagrid.CheckBoxDataGrid;
import customComponents.popups.SingleSelectCustomPopup;

import flash.events.Event;
import flash.events.FocusEvent;

import mx.controls.TextInput;
import mx.controls.dataGridClasses.DataGridListData;
import mx.controls.listClasses.BaseListData;
import mx.controls.listClasses.IDropInListItemRenderer;
import mx.controls.listClasses.IListItemRenderer;
import mx.core.UIComponent;
import mx.managers.IFocusManagerComponent;
import mx.managers.PopUpManager;


public class SpyGlassFieldEditor extends UIComponent implements IListItemRenderer, IDropInListItemRenderer, IFocusManagerComponent
{

public function SpyGlassFieldEditor()
{
super();
addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
}

private var txtInputByUser:TextInput;
private var spyGlassImage:ImageFocus;
private var maxInputCharacters:int=20;

private var _data:Object;

public function get data():Object
{
return _data;
}

public function set data(value:Object):void
{
_data=value;
invalidateProperties();
}


private var _listData:BaseListData;
private var _dataGrid:CheckBoxDataGrid;
private var _dataField:String;
private var win:SingleSelectCustomPopup;

[Bindable]
protected var rdsModel:RdsModelLocator=RdsModelLocator.getInstance();

public function get listData():BaseListData
{
return _listData;
}

public function set listData(value:BaseListData):void
{
_listData=value;
_dataGrid=value.owner as CheckBoxDataGrid;
_dataField=(value as DataGridListData).dataField;
}

override public function setFocus():void
{
if (dgOwner.shiftKey)
{
spyGlassImage.setFocus();
}

else
txtInputByUser.setFocus();
}

private function onTextChange(event:Event):void
{
var textInput:TextInput=event.currentTarget as TextInput;

if(_dataField)
{
var properties:Array=_dataField.split(".");

if (properties.length >= 2)
{
var object:Object=data[properties[0]];
object[properties[1]]=textInput.text;
}
else
{
data[_dataField]=textInput.text;
}

_dataGrid.dataProvider.itemUpdated(data);
invalidateProperties();
}
}

override protected function createChildren():void
{
super.createChildren();

txtInputByUser=new TextInput();
txtInputByUser.maxChars=maxCharacters;
txtInputByUser.addEventListener("change", onTextChange, false, 0, true);
addChild(txtInputByUser);
spyGlassImage=new ImageFocus();
spyGlassImage.source="assets/images/spyglass.gif";
spyGlassImage.buttonMode = true;
spyGlassImage.addEventListener("click", onImageClick, false, 0, true);
addChild(spyGlassImage);
}

protected function onImageClick(evt:Event):void
{

}

public function get editValue():String
{
return txtInputByUser.text;
}

private var dgOwner:CheckBoxDataGrid;

override protected function commitProperties():void
{
dgOwner=owner as CheckBoxDataGrid;
super.commitProperties();

if (_dataField)
{
var properties:Array=_dataField.split(".");
if (properties.length >= 2)
{
var object:Object=data[properties[0]];
txtInputByUser.text=object[properties[1]];
}
else
{
txtInputByUser.text=data[_dataField];
}
}
}


public function onPopUpClose():void
{
var properties:Array=_dataField.split(".");
if (properties.length >= 2)
{
var object:Object=data[properties[0]];
object[properties[1]]=win.idSelected.text;
}
else
{
data[_dataField]=win.idSelected.text;
}
_dataGrid.dataProvider.itemUpdated(data);
invalidateProperties();
}

override protected function updateDisplayList(w:Number, h:Number):void
{
super.updateDisplayList(w, h);
txtInputByUser.move(0, 0);
txtInputByUser.setActualSize(w - 25, h);
spyGlassImage.move(w - 11, 0);
spyGlassImage.setActualSize(11, 11);
}

private function keyFocusChangeHandler(event:FocusEvent):void
{
//trace("Focus Manager " + focusManager.focusPane);
if (event.shiftKey)
{
//trace("Inside Shift Key");
if (spyGlassImage.contains(getFocus()))
{
event.preventDefault();
txtInputByUser.setFocus();
}
}
else
{
if (txtInputByUser.contains(getFocus()))
{
event.preventDefault();
spyGlassImage.setFocus();
}
}
}

public function set maxCharacters(max:int):void
{
maxInputCharacters=max;
if (txtInputByUser)
txtInputByUser.maxChars=max;
}

public function get maxCharacters():int
{
return maxInputCharacters;
}
}

}