Wednesday 9 December 2009

[Flex] Create own Event

itemCheckedChange="dataGridCheckedItemChange(event)"

new Event Tag : "itemCheckedChange"
new Event name : DeviceGroupAndListGridEvent

=========== org =====================
[device:DeviceGroupAndListGrid
id="dataGridT" width="100%" height="100%"
variableRowHeight="true"
sortExpertMode="true"
itemCheckedChange="dataGridCheckedItemChange(event)"/]

- script part
private function dataGridCheckedItemChange(event:DeviceGroupAndListGridEvent):void
{
Alert.show("sr");
}

============= component ================
[mx:Metadata]
[Event(name="itemCheckedChange",type="com.DeviceGroupAndListGridEvent")]
[/mx:Metadata]


============ actionscript file ==================
public class DeviceGroupAndListGridEvent extends Event
{
public static const ITEM_CHECKED_CHANGE:String = "itemCheckedChange";

public function DeviceGroupAndListGridEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
{
super(type, bubbles, cancelable);
}

}

Tuesday 8 December 2009

[Flex] Loading process bar

Sample Page
http://www.pathf.com/sites/pfd/flash/blog/08142008/PreloaderComponent.html


Source site
http://www.pathf.com/blogs/2008/08/custom-flex-3-lightweight-preloader-with-source-code/

Thursday 3 December 2009

[Flex] - view object

Alert.show(ObjectUtil.toString(object that you want to check));

Wednesday 2 December 2009

[Flex] DataProvider show

if(_dataProvider != null)
{
Alert.show(ObjectUtil.toString(_dataProvider),"data");
}

[Flex] Debug message output

[target class="flex.messaging.log.ConsoleTarget" level="Debug"]
[properties]
[prefix][BlazeDS] [/prefix]
[includeDate]true[/includeDate]
[includeTime]true[/includeTime]
[includeLevel]false[/includeLevel]
[includeCategory]true[/includeCategory]

[/properties]
[filters]
[pattern]Endpoint.*[/pattern]
[pattern]Service.*[/pattern]
[pattern]Configuration[/pattern]
[/filters]
[/target]

Friday 27 November 2009

[Flex] -error: DisplayObjectContainer/getChildIndex()

DisplayObject should be ...... DisplayObjectContainer/getChildIndex()

Your component of start is "Application" -> should change the other component such as Canves

Thursday 22 October 2009

[flex] Create - Setup module part

- right button from the project that has module of flex
1. properties > Flex Modules > Add > Select the module

Then swf file will be go to the specific folder

Tuesday 20 October 2009

[osgi] TargetPlatform

1. Create "TargetPlatform" project
2. Create some bundle folder which has all bundle jar files.
3. Create "TargetPlatformDefinition" folder
4. Create "test-prop.target" file
5. use below part
===============================

[?xml version="1.0" encoding="UTF-8"?]
[?pde version="3.2"?]

[target name="test-proto"]

[location path="${test-Prototype}"/]

[content useAllPlugins="true"]
[plugins]
[/plugins]
[features]
[/features]
[extraLocations]
[location path="${test-Prototype}\OSGi"/]
[location path="${test-Prototype}\target"/]
[/extraLocations]
[/content]

[/target]

========================

6. change setup Eclipse part
1) Window -> preference -> Run/Debug -> String/Substitution -> Click "New" button
2) Variable : test-Prototype || Value : TargetPlatform folder

Wednesday 14 October 2009

[Flex] connecting flex library

1. create flex library project
2. create main flex project
3. properties from main flex project
4. "Flex Build Path" > Library path > Add Project (line flex library > bin folder > select "swc" file"

Friday 9 October 2009

[Flex] Flex Style Explorer

create css script

http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html#

Wednesday 30 September 2009

[Flex] Event blocking

private function btnCancel_click(e:MouseEvent):void
{

trace("btncancel click "+e.target);
trace("btncancel click "+e.currentTarget);

e.stopPropagation(); }

[Flex] Alert Error

Insert

import mx.controls.Alert;

Alert.show("sr");

Tuesday 29 September 2009

[Flex] dynamic parameter

a.strTel_1 = "1111";
a.strTel_2 = "2222";
a.strTel_3 = "3333";
a.strTel_4 = "4444";
a.strTel_5= "5555";
a.strTel_6 = "6666";
a.strTel_7 = "7777";
a.strTel_8 = "8888";

for (x=1; x <= 8; x++)
{
textDisplay.text += a["strTel_"+x.toString()]+"\n";
}

[Flex] keep actionscript parameter setting

-- Keeping actionscrip by setting parameter

right button from the flex project > properties > flex compiller > "Additional Compiloer Arguments" > setup parameter as the below

-locale en_US -keep-generated-actionscript

[Flex] screen Capture

private function capture() : void
{
var bd:BitmapData = new BitmapData(this.width,this.height);
bd.draw(this);

var encoder:JPEGEncoder = new JPEGEncoder(60);
var ba:ByteArray = encoder.encode(bd);

var file:File = File.desktopDirectory.resolvePath("Test2.jpg");
var fs:FileStream = new FileStream();
fs.addEventListener(OutputProgressEvent.OUTPUT_PROGRESS,onOut);
fs.openAsync(file, FileMode.WRITE);
fs.writeBytes(ba);

}

private function onOut(e:OutputProgressEvent):void
{
trace("ok");
e.currentTarget.close();
}

]]]
[/mx:Script]
[mx:Button x="284" y="194" label="Button" click="this.capture();"/]
[mx:DataGrid x="10" y="10"]
[mx:columns]
[mx:DataGridColumn headerText="Column 1" dataField="col1"/]
[mx:DataGridColumn headerText="Column 2" dataField="col2"/]
[mx:DataGridColumn headerText="Column 3" dataField="col3"/]
[/mx:columns]
[/mx:DataGrid]

[Flex] copy .. file

private function main() : void
{
var file:File = File.applicationDirectory.resolvePath("images/booklist.gif");


var cpy:File = File.desktopDirectory.resolvePath("create.gif");

try {
file.copyTo(cpy, true);
} catch (e:Error) {
//alert.showTitleBar("Overwirte?");
}

}

[Flex] File browser

private function on_click() : void
{
var file:File = new File();
file.addEventListener(Event.SELECT,
function (e:Event):void
{
trace(file.nativePath);
}
);
file.browseForDirectory("search");
}

Wednesday 16 September 2009

[Flex] - Very Simple tranning course

http://www.youtube.com/watch?v=MLpWNQqkSDk&feature=PlayList&p=F9A84EB0F8DB1DB9&index=3

Wednesday 9 September 2009

Google Setting (Connection)

Setting for Google talk - connection

When you start google talk, please start like below.

"C:\Program Files\Google\Google Talk\googletalk.exe" /nogaiaauth

Tuesday 8 September 2009

Agile Development - Kent Beck

http://www.infoq.com/presentations/responsive-design

Monday 7 September 2009

remote access

checking service for remote access

->Terminal Services

Tuesday 23 June 2009

[MS-SQL] port setting

Micorsoft SQL Server > Configuration Tools > SQL Server Configuration Manager

* check SQL Server "Running"

* check TCP/IP "running"
- SQL Server 2005 Network Configuration > Protocols for SQLEXPRESS > TCP/IP >
right button click > properties >

+ TCP Dynamic ports : (delete data)
+ TCP Port : 1433
(IP1 , IP2, IP All)

[Remote Desktop Connection] - copy file

* copy file by remote desktop connection

Start > Remote Desktop Connection > Click "local resource" > click "More Detail" under local device and resource > check "drive"

Monday 15 June 2009

EFitNesse Setup - eclipse

*. Install EFitNesse Eclipse Plugin
1. On Eclipse go to Help->Software Updates->Find and Install
2. Select "Search for new features to install"
3. Select "New Remote Site" button
4. Enter the following
5. Name: EFitnEsse
6. URL: http://www.bandxi.com/fitnesse/
7. Select Finish Button
8. Follow Menus to install plug-In
9. On Eclipse got o Window->Preferences->FitNesse
10. Fill In the values as shown on Screen.
11. LocalHost = localhost
12. Local Port = 9083
13. Local Root Directory enter EFitnesse Wiki\FitNesseRoot (created project)
iv. Remote Host = localhost
v. Report Port = 7777

4. Click on FL icon on top of Eclipse Menu Screen.

Thursday 4 June 2009

eFitnesse

FitNesse is a software development collaboration tool

http://fitnesse.org/

Tuesday 26 May 2009

[MS-sql] Error

Error message when you try import database from backup file

=======Error Message===========
Restore failed Server 'your-computer' (Micorsoft.SqlServer.Smo)

Additional information:
->An exception occurred while executing a Transact-SQL statement or batch
(microsoft.SqlServer.ConnectionInfo)
--> The file or filegroup 'yourfileName_log' cannot be selected for this operation.
RESTORE DATABASE is terminating abnormally.(Microsoft SQL Server, Error: 3219)
==================================

--- Solution ----- (progress as manual way)
create database that you want (ex: test)
right button click from test db
Tasks - > Restore -> Files and Filegroups...
select From device and select backup file location

---> Select "Script" from top location

Type this script on page

RESTORE DATABASE [ct3] FROM DISK = N'D:\temp\test.bak' WITH FILE = 1, MOVE N'test' TO N'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\test.mdf', MOVE N'test_log' TO N'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\test_log.LDF', NOUNLOAD, REPLACE, STATS = 10
GO

Thursday 21 May 2009

split("|") error

String a = "sssrrrr|ccccc";

String[] b= a.split("\\|");

System.out.println(b[0]);

Thursday 9 April 2009

[Hibernate] native SQL example- One return column case

String gSql = "select sYear from VIEW_REPORT_BillingRegion group by sYear";

// Query query = sessionFactory.getCurrentSession().createQuery(gSql);
SQLQuery query = this.sessionFactory.getCurrentSession().createSQLQuery(gSql).addScalar("sYear", Hibernate.STRING);


List[Object] list = query.list();
System.out.println("======="+list.size());
for( Object objArr : list){
System.out.println(objArr );
}
System.out.println("============"+list.size());

Wednesday 8 April 2009

[Hibernate] native SQL example

@SuppressWarnings("unchecked")
@Transactional
public void getTest(IUiListCfg uiListCfg) throws ReportException {

try {
String sSql = "select sGroupId, sGroupName from tRmCo_Group";
SQLQuery query = this.sessionFactory.getCurrentSession().createSQLQuery(sSql).addScalar("sGroupId", Hibernate.STRING).addScalar("sGroupName", Hibernate.STRING);

List list = query.list();
for( Object[] objArr : list){
for( Object obj : objArr){

System.out.println(obj );
}
}
System.out.println("============"+list.size());

} catch (Exception e) {
e.printStackTrace();
}
}

Saturday 28 March 2009

[SQL] compaire data type

DB NAME : testDB
column's NAME : createDate
real data : 2009-02-07 15:15:43.000

compare

select * from testDB where cast(convert(char(10),createDate,101)as datetime) >= cast(convert(char(10),'2009-02-05',101) as datetime)

Tuesday 17 March 2009

[Eclipse] Auto line change

== 3.3 version ==
이클립스에서

1. help
2. software updates
3. find and Install
4. Search for new features to install
5. New Remote site

Name: Virtual Word Wrap
URL: http://ahtik.com/eclipse-update/

=== 3.4 version ===

http://ahtik.com/eclipse-update/

Wednesday 11 February 2009

[Hibernate] many-to-many

There are 3 tables
=== Table1 ====
fooId
a

==== Table2 -====
barId
b

==== Table3 ==== (This table is joined from Table1 and Table2)
fooIdEx
barIdEx


===== a.java ===
....
private int foodId;
private String a;

private Set[b] bEnitty;
.......

===== b.java ======
......
private int barId;
private STring b;
............

===== a.hbm.xml (Mapping xml file) ======
.......





......

please refer to http://www.xylax.net/hibernate/manytomany.html

Tuesday 10 February 2009

[Hibernate] one-to-many

one-to-many [hibernate]

===== a.java ========
......
private Set[b] bSet;
.......

==== b.java ======
....
....

==== a.hbm.xml -(mapping for a entity xml file) ====



[Error] Hibernate error

- Error Message
org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here

This error is from that the hibernate can not find "Transactional".

Please insert
@SuppressWarnings("unchecked")
@Transactional

[Hibernate] join (one-to-many)

create sub bean
BeanA.java - same as sub table

Wednesday 4 February 2009

[Error] Eclipse Ganymede start error

When you have the problem for starting eclipse , please check eclipse.ini file
==== Error message
-VM terminated...

==== original eclipse.ini
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-framework
plugins\org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

==== update this eclipse.ini file
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-framework
plugins\org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar
-vm
C:\Sun\SDK\jdk\bin\javaw.exe

-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

[Error] Eclipse Ganymede start error

when you start eclipse , you might have the error with popup message box.
such as "VM terminate...."
Please check eclipse.ini file and update it

original eclipse.ini
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-vm
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

==== Please update this eclipse.ini file =====
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-vm
D:\java\jdk1.6.0\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

Monday 2 February 2009

[ExtJs] Simple Tree Example (Json as JSP)

=========== test2.html =================
[html]
[head]
[link rel="stylesheet" type="text/css" href="../resources/css/ext-all.css"]
[script type="text/javascript" src="../adapter/ext/ext-base.js"][/script]
[script type="text/javascript" src="../ext-all.js"][/script]
[script type="text/javascript" src="reorder2.js"][/script]
[title]Insert title here[/title]
[/head]
[body]
[div id="tree-div" style="overflow:auto; height:300px;width:250px;border:1px solid #c3daf9;"][/div]
[/body]
[/html]

=============== reorder2.js ====================

Ext.onReady(function(){
// shorthand
var Tree = Ext.tree;

var tree = new Tree.TreePanel({
el:'tree-div',
useArrows:true,
autoScroll:true,
animate:true,
enableDD:true,
// rootVisible: false,
containerScroll: true,
loader: new Tree.TreeLoader({
dataUrl:'json.jsp'
})
});

// set the root node
var root = new Tree.AsyncTreeNode({
text: 'Ext JS',
draggable:false,
iconCls:'conthruAr',
id:'source'
});
tree.setRootNode(root);

// render the tree
tree.render();
root.expand();
});

================ json.jsp =================
[%@page import="java.util.Enumeration"%]
[%
Enumeration ss = request.getParameterNames();
String value;
while(ss.hasMoreElements()){
String key = (String)ss.nextElement();
value = request.getParameter(key);
System.out.println(key+" : "+value+" ");
}

String getS = request.getParameter("node");

System.out.println("ss : "+getS);
if (getS.equals("source")){
%]
[{"text":"1","id":"1","cls":"folder"},{"text":"4","id":"4","leaf":true,"cls":"file"},{"text":"3","id":"3","cls":"folder"},{"text":"2","id":"2","leaf":true,"cls":"file"}]
[%
} else if(getS.equals("3")) {
%]
[{"text":"7","id":"7","leaf":true,"cls":"file"},{"text":"8","id":"8","cls":"folder"}]
[%} %]

Monday 19 January 2009

[Error] Could not open Hibernate Session for transaction

[Error Message]
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is java.lang.IllegalArgumentException: interface org.hibernate.jdbc.ConnectionWrapper is not visible from class loader


Please insert org.hibernate.jdbc pacakge in MENIFEST file

Monday 5 January 2009

[Error] Can not Start Eclipse

* Error Message
JVM terminated. Exit code=-1 .......
................
.......

- Open eclipse.ini file under eclipse installed folder

change the last line like this
-Xmx256m

http://blog.naver.com/sungback?Redirect=Log&logNo=90033293141

[Error] can not start MS-SQL Service

* Can't start MS-SQL service
- there are some error message that ms-sql can't start

+ Please open control panel > Service
Change running logon user

Thursday 1 January 2009

[Eclipse] (Plugin)- Java Code Coverage for Eclipse

* This plugin for Code Coverage - especially for Junit

1. Install
http://www.eclemma.org/installation.html

2. Launching (or setting) in Coverage Mode
http://www.eclemma.org/userdoc/launching.html

3. Create "Test" run configuration

4. You should select what kind of project can be generate code coverage report
from "Coverage" tab. (Coverage Run > Converage configurations)

5. When "running" is over , Do not terminate manually !
Type : osgi> exit

Then you will see Coverage report

* error message "No coverage data file has been written"
check "http://www.eclemma.org/faq.html#usage03"


Check all step from this web site

* After running code coverage you should re-compile
the project which is checked for Code Coverage

[Eclipse] - Run (Arguments- Clean)

Eclipse Run configuration option

- Arguments Tab -
* Program arguments
-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -console --clean

* VM arguements
-Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dosgi.clean=true

Eclipse [Plug-In] - CheckStyle Eclipse Plugin

* CheckStyle Eclipse Plugin
- CheckStyle Eclipse Plugin help you ensure that your Java code adheres to a set of coding standards.

- Installation document

- Checkstyle file
- format file