2009년 12월 23일 수요일

ExtJs xtype List.

xtype            Class

------------- ------------------

box Ext.BoxComponent

button Ext.Button

buttongroup Ext.ButtonGroup

colorpalette Ext.ColorPalette

component Ext.Component

container Ext.Container

cycle Ext.CycleButton

dataview Ext.DataView

datepicker Ext.DatePicker

editor Ext.Editor

editorgrid Ext.grid.EditorGridPanel

flash Ext.FlashComponent

grid Ext.grid.GridPanel

listview Ext.ListView

panel Ext.Panel

progress Ext.ProgressBar

propertygrid Ext.grid.PropertyGrid

slider Ext.Slider

spacer Ext.Spacer

splitbutton Ext.SplitButton

tabpanel Ext.TabPanel

treepanel Ext.tree.TreePanel

viewport Ext.ViewPort

window Ext.Window



Toolbar components

---------------------------------------

paging Ext.PagingToolbar

toolbar Ext.Toolbar

tbbutton Ext.Toolbar.Button (deprecated; use button)

tbfill Ext.Toolbar.Fill

tbitem Ext.Toolbar.Item

tbseparator Ext.Toolbar.Separator

tbspacer Ext.Toolbar.Spacer

tbsplit Ext.Toolbar.SplitButton (deprecated; use splitbutton)

tbtext Ext.Toolbar.TextItem



Menu components

---------------------------------------

menu Ext.menu.Menu

colormenu Ext.menu.ColorMenu

datemenu Ext.menu.DateMenu

menubaseitem Ext.menu.BaseItem

menucheckitem Ext.menu.CheckItem

menuitem Ext.menu.Item

menuseparator Ext.menu.Separator

menutextitem Ext.menu.TextItem



Form components

---------------------------------------

form Ext.FormPanel

checkbox Ext.form.Checkbox

checkboxgroup Ext.form.CheckboxGroup

combo Ext.form.ComboBox

datefield Ext.form.DateField

displayfield Ext.form.DisplayField

field Ext.form.Field

fieldset Ext.form.FieldSet

hidden Ext.form.Hidden

htmleditor Ext.form.HtmlEditor

label Ext.form.Label

numberfield Ext.form.NumberField

radio Ext.form.Radio

radiogroup Ext.form.RadioGroup

textarea Ext.form.TextArea

textfield Ext.form.TextField

timefield Ext.form.TimeField

trigger Ext.form.TriggerField



Chart components

---------------------------------------

chart Ext.chart.Chart

barchart Ext.chart.BarChart

cartesianchart Ext.chart.CartesianChart

columnchart Ext.chart.ColumnChart

linechart Ext.chart.LineChart

piechart Ext.chart.PieChart



Store xtypes

---------------------------------------

arraystore Ext.data.ArrayStore

directstore Ext.data.DirectStore

jsonstore Ext.data.JsonStore

simplestore Ext.data.SimpleStore (deprecated; use arraystore)

store Ext.data.Store

xmlstore Ext.data.XmlStore

2009년 12월 11일 금요일

Google Goggles.

 

구글에서 안드로이드용 검색 App 을 개발한듯 하다.

 

정확한 표현을 하기 힘들지만..

 

아이폰의 증강 현실도 얼마 안있으면 안드로이드에서도 가능할듯하다.

 

안드로이드는 구글의 막강한 검색 엔진을 이용하여,

 

이미지를 통한 웹 검색을 하는듯하다..

 

이제 세계 모바일 시장은

 

 

심비안 > 안드로이드 => 아이폰 >>> WM

 

 

정도가 되지 않을까 싶다. (그래서 android 카테고리도 만들었다?)

 

 

 

 

 

 

2009년 12월 2일 수요일

X1 - Tmap 저장소 카드 변경 파일

출처 : http://cafe.naver.com/bjphone/485637

 

12월 1일 부로 올인원 요금제를 이용하는 고객에게

 

TMAP 이 무료다.

 

근데 X1 순정롬에선 설치가 되지만, 해외롬이나 기타롬에서는

 

설치가 안된다. 이유는 메모리의 해당하는 폴더 이름이

 

"저장소 카드" 로 Tmap은 설치 경로를 잡기 떄문이다.. 이게 뭔지 참.. -_-;

 

저장소 카드가 없으면 "Storage Card" 폴더를 찾도록 하면 되지..

 

그리고 굳이 한글로 "저장소 카드" 라는 폴더를 만들어 놓는지도 의문..

 

일부 프로그램에선 호환안되는..

 

그럼 Windows 폴더도 "윈도우즈" 라고 다 바꾸던가 :)

 

 

스마트 폰 카페에서 TMAP 설치 경로를 Storage Card 로 변경 해주는 파일을 올려주셨다.

 

첨부파일 다운후, 로컬에 Tmap 이 깔린 폴더에 덮고, TransferCab.exe 실행하면된다.

 

 

 

잘 설치 하셨으면, 출처의 해당 자료를 제공해 주신 분에게 감사의 댓글을...

 

 

2009년 11월 12일 목요일

JQuery 와 다른 라이브러리 충돌시.

http://docs.jquery.com/Using_jQuery_with_Other_Libraries



Using jQuery with Other Libraries

From jQuery JavaScript Library

Jump to: navigation, search

Contents

General

The jQuery library, and virtually all of its plugins are constrained within the jQuery namespace. As a general rule, "global" objects are stored inside the jQuery namespace as well, so you shouldn't get a clash between jQuery and any other library (like Prototype, MooTools, or YUI).

That said, there is one caveat: By default, jQuery uses "$" as a shortcut for "jQuery"

Overriding the $-function

However, you can override that default by calling jQuery.noConflict() at any point after jQuery and the other library have both loaded. For example:

 <html>
<head>
<script src="prototype.js"></script>
<script src="jquery.js"></script>
<script>
jQuery.noConflict();

// Use jQuery via jQuery(...)
jQuery(document).ready(function(){
jQuery("div").hide();
});

// Use Prototype with $(...), etc.
$('someid').hide();
</script>
</head>
<body></body>
</html>

This will revert $ back to its original library. You'll still be able to use "jQuery" in the rest of your application.

Additionally, there's another option. If you want to make sure that jQuery won't conflict with another library - but you want the benefit of a short name, you could do something like this:

 <html>
<head>
<script src="prototype.js"></script>
<script src="jquery.js"></script>
<script>
var $j = jQuery.noConflict();

// Use jQuery via $j(...)
$j(document).ready(function(){
$j("div").hide();
});

// Use Prototype with $(...), etc.
$('someid').hide();
</script>
</head>
<body></body>
</html>

You can define your own alternate names (e.g. jq, $J, awesomeQuery - anything you want).

Finally, if you don't want to define another alternative to the jQuery name (you really like to use $ and don't care about using another library's $ method), then there's still another solution for you. This is most frequently used in the case where you still want the benefits of really short jQuery code, but don't want to cause conflicts with other libraries.

 <html>
<head>
<script src="prototype.js"></script>
<script src="jquery.js"></script>
<script>
jQuery.noConflict();

// Put all your code in your document ready area
jQuery(document).ready(function($){
// Do jQuery stuff using $
$("div").hide();
});

// Use Prototype with $(...), etc.
$('someid').hide();
</script>
</head>
<body></body>
</html>

This is probably the ideal solution for most of your code, considering that there'll be less code that you'll have to change, in order to achieve complete compatibility.

Also see: Custom Alias

Including jQuery before Other Libraries

If you include jQuery before other libraries, you may use "jQuery" when you do some work with jQuery, and the "$" is also the shortcut for the other library. There is no need for overriding the $-function by calling "jQuery.noConflict()".

 <html>
<head>
<script src="jquery.js"></script>
<script src="prototype.js"></script>
<script>
// Use jQuery via jQuery(...)
jQuery(document).ready(function(){
jQuery("div").hide();
});

// Use Prototype with $(...), etc.
$('someid').hide();
</script>
</head>
<body></body>
</html>

Referencing Magic - Shortcuts for jQuery

If you don't like typing the full "jQuery" all the time, there are some alternative shortcuts:

  • Reassign jQuery to another shortcut
    • var $j = jQuery;
    • (This might be the best approach if you wish to use different libraries)
  • Use the following technique, which allows you to use $ inside of a block of code without permanently overwriting $:
    • (function($) { /* some code that uses $ */ })(jQuery)
    • Note: If you use this technique, you will not be able to use Prototype methods inside this capsuled function that expect $ to be Prototype's $, so you're making a choice to use only jQuery in that block.
  • Use the argument to the DOM ready event:
    • jQuery(function($) { /* some code that uses $ */ });
    • Note: Again, inside that block you can't use Prototype methods

2009년 10월 7일 수요일

RD Tab 2.1.21

 

최근 자주쓰게 되는 Windows Remote Desktop 가 기본 유틸이 허졉해서

 

찾아보니 RD Tab 이라는 좋은 탭 유틸이 있어서 사용해보니

 

기본보다 많이 좋음.

 

 

 

 

RD Tab 2.1.21

 

 

최신버젼을 원한다면? http://www.avianwaves.com/Tech/Tools/RDTabs/

2009년 9월 22일 화요일

WinTail 3.4



WinTail 3.4


윈도우용 Tail 입니다. unix 운영체제에서 사용하던 것 처럼 편리하게 이용할수 있습니다.

GOOD~~




2009년 9월 17일 목요일

간단한 Stored Procedure 예제.


Oracle Store Procedure 를 사용하게 되어서, 처음으로 SP를 사용해 보았다.
아래는 아주 간단한 예제..
예제를 쉽게 만들어서 이해 하기 아주 쉬울꺼라고 생각한다..
좀더 응용적인건 계속 추가 예정..

create table MEMBER(
  id         varchar2(12)      primary key,
  name    varchar2(10)      not null
)

insert into MEMBER values('taesuz', '조태수');

create or replace
procedure hello_proc( in_id IN VARCHAR2, out_name OUT VARCHAR2 )
is
  begin
    select name INTO out_name from MEMBER
    where id=in_id;
    dbms_output.put_line( out_name );

EXCEPTION
  WHEN NO_DATA_FOUND THEN
    out_name:='NO_DATA_FOUND';
end hello_proc;


실행:

VARIABLE name varchar2(10);
execute hello_proc('taesuz', :name);
print name;

 

결과값:

name
---
조태수


2009년 9월 15일 화요일

Microsoft Office for Mac SP2 Serial

   from : http://paste2.org/p/359169



    Microsoft Office 2008 for Mac
    
    NEW Serials ~ Support SP2:
    
    PCVGG-GBCF3-72PW4-GRMFK-Q7DD3
    W339P-JRCPB-XX8XD-YK49M-7DYCW
    FWCQQ-3XX2G-3CD89-4VRJK-CR4YD
    WG667-BW4JP-M8KXV-CVPQD-6J49J
    QCDK8-9P4FC-8P6D4-QC22F-TT468
    JKQK8-KKDG8-2T729-TCKY8-3XJ8Q
    GHRHF-PMKVD-VWCGF-WQTCT-CGKJY
    GK46R-PT7KB-VCHGB-QDCQV-VYTGT
    Q8WDK-VD4YV-MXTT8-KYPPC-YPYMM
    TRHH8-F6P34-DBY2Q-BMQBT-RMMJ8
    RJCW4-K4388-GMYXY-YKQWX-2BVQJ
    FM9RP-GQ6XV-H8JCB-X9BMF-H2WF8
    GW7Y6-F977W-7Y6YD-82FJG-29C4Y
    DP87B-DXX8G-24TKP-PRTPF-VBTT3
    CC9CH-DT9DP-JD6R6-XWXBD-HQP8Y
        
        
    OLD Serials (blocked by SP2):
    
    MCX6K-J8YQP-CGMTM-X3XQ8-K6KDY
    RMG8D-KP8WT-DBCDV-QVRD2-V3WQY
    QYGR3-CJWQM-9HK4T-WX32G-F7XVM
    VTJG8-94R7P-RTQVT-8CK98-79THM
    J3JT3-8J2PM-VMYD8-8WT9X-BCM7M
    XH4P8-PQ2KW-JDM9P-YW2BV-PCF3Y
    TTTCG-JRGVX-R3J29-2XRG2-GP6BB
    DV4XH-WWB2F-9BGX2-WR82D-JGWBB
    PQRFY-VCW3V-8MBF4-2H8Y8-KDBBB
    FR7YV-P38TR-83V4C-G2RXD-VTF3Y
    
  Reactivate ~ Remove/Renew Serial:
    Delete these 2 .plist files:
    ./Users/username/Library/Preferences/Microsoft/Office 2008/Microsoft Office 2008 settings.plist
    ./Applications/Microsoft Office 2008/Office/OfficePID.plist

NodLogin 10b 32/64bit

 

NOD32 업데이트를 도와주는 NodLogin 입니다.

 

 

2009년 9월 8일 화요일

log4sql Query 의 대한 모든것을 보여준다.


http://log4sql.sourceforge.net/index_kr.html

개발시 쿼리 부분에 대한 것을 적나라 하게 보여준다.

필수 라이브러리라고 생각이 듬..

 

JDBC TYPE Origin Your Driver Class -> log4sql Driver Class
[ORACLE DRIVER CLASS] 'oracle.jdbc.drirver.OracleDriver' -> 'core.log.jdbc.driver.OracleDriver'
[MYSQL DRIVER CLASS] 'com.mysql.jdbc.Driver' or'org.gjt.mm.mysql.Driver' -> 'core.log.jdbc.driver.MysqlDriver'
[SYBASE DRIVER CLASS] 'com.sybase.jdbc2.jdbc.SybDriver' -> 'core.log.jdbc.driver.SybaseDriver'
[DB2 DRIVER CLASS] 'com.ibm.db2.jcc.DB2Driver' -> 'core.log.jdbc.driver.DB2Driver'
[INFOMIX DRIVER CLASS] 'com.informix.jdbc.IfxDriver' -> 'core.log.jdbc.driver.InfomixDriver'
[POSTGRESQL DRIVER CLASS] 'org.postgresql.Driver' -> 'core.log.jdbc.driver.PostgresqlDriver'
[MAXDB DRIVER CLASS] 'com.sap.dbtech.jdbc.DriverSapDB' -> 'core.log.jdbc.driver.MaxDBDriver'
[FRONTBASE DRIVER CLASS] 'com.frontbase.jdbc.FBJDriver' -> 'core.log.jdbc.driver.FrontBaseDriver'
[HSQL DRIVER CLASS] 'org.hsqldb.jdbcDriver' -> 'core.log.jdbc.driver.HSQLDriver'
[POINTBASE DRIVER CLASS] 'com.pointbase.jdbc.jdbcUniversalDriver' -> 'core.log.jdbc.driver.PointBaseDriver'
[MIMER DRIVER CLASS] 'com.mimer.jdbc.Driver' -> 'core.log.jdbc.driver.MimerDriver'
[PERVASIVE DRIVER CLASS] 'com.pervasive.jdbc.v2.Driver' -> 'core.log.jdbc.driver.PervasiveDriver'
[DAFFODILDB DRIVER CLASS] 'in.co.daffodil.db.jdbc.DaffodilDBDriver' -> 'core.log.jdbc.driver.DaffodiLDBDriver'
[JDATASTORE DRIVER CLASS] 'com.borland.datastore.jdbc.DataStoreDriver' -> 'core.log.jdbc.driver.JdataStoreDriver'
[CACHE DRIVER CLASS] 'com.intersys.jdbc.CacheDriver' -> 'core.log.jdbc.driver.CacheDriver'
[DERBY DRIVER CLASS] 'org.apache.derby.jdbc.ClientDriver' -> 'core.log.jdbc.driver.DerbyDriver'
[ALTIBASE DRIVER CLASS] 'Altibase.jdbc.driver.AltibaseDriver' -> 'core.log.jdbc.driver.AltibaseDriver'
[MCKOI DRIVER CLASS] 'com.mckoi.JDBCDriver' -> 'core.log.jdbc.driver.MckoiDriver'
[JSQL DRIVER CLASS] 'com.jnetdirect.jsql.JSQLDriver' -> 'core.log.jdbc.driver.JsqlDriver'
[JTURBO DRIVER CLASS] 'com.newatlanta.jturbo.driver.Driver' -> 'core.log.jdbc.driver.JturboDriver'
[JTDS DRIVER CLASS] 'net.sourceforge.jtds.jdbc.Driver' -> 'core.log.jdbc.driver.JTdsDriver'
[INTERCLIENT DRIVER CLASS] 'interbase.interclient.Driver' -> 'core.log.jdbc.driver.InterClientDriver'
[PURE JAVA DRIVER CLASS] 'org.firebirdsql.jdbc.FBDriver' -> 'core.log.jdbc.driver.PureJavaDriver'
[JDBC-ODBC DRIVER CLASS] 'sun.jdbc.odbc.JdbcOdbcDriver' -> 'core.log.jdbc.driver.JdbcOdbcDriver'
[MSSQL 2000 DRIVER CLASS] 'com.microsoft.jdbc.sqlserver.SQLServerDriver' -> 'core.log.jdbc.driver.MssqlDriver'
[MSSQL 2005 DRIVER CLASS] 'com.microsoft.sqlserver.jdbc.SQLServerDriver' -> 'core.log.jdbc.driver.Mssql2005Driver'

2009년 9월 2일 수요일

Java Properties 사용.

 

Java 설정 파일로 많이 쓰이는 Properties 사용법

 

String openProp = request.getRealPath("/taesuz/") + "/taesuz.properties";
try{
 Properties props = new Properties();
 props.load( new FileInputStream( openProp ));
 props.setProperty("type", type );

 FileOutputStream fos = new FileOutputStream( openProp );
 
 props.save(fos, "open type change");
 
 out.println( "open type change: " + type );
 
} catch (IOException ioe){
 out.println( ioe );
 
} catch (Exception e){
 out.println( e );
}

2009년 8월 28일 금요일

Snow Leopard Java 관련 문제들..



1.6 10432A 업데이트 후

MyEclipse 에서 Tomcat 설정 후

톰캣이 JDK 관련 오류를 내뱉고 있었다.

원인이 무언고 하니..


1.6 으로 넘어가면서 64비트가 기본으로 잡혀있어서 발생한 문제?

32비트로 전환해주니 아주 잘된다 흠..


2009년 8월 25일 화요일

HttpAnalyzer V5.0.1

onitor HTTP, Trace HTTP, Debug HTTP, Capture HTTP, Track HTTP and Analyze HTTP/HTTPS!

Build:5.0.1  New:  Integrate with Firefox, Deserialize Flash Remoting, JSON, SOAP
 
Stand-alone Edition, Firefox Add-on and IE Add-on (Click for larger image)
 
Need a tool which can serve as HTTP monitor, HTTP sniffer and HTTP Tracer?
IEInspector HTTP Analyzer is such a handy tool that allows you to monitor, trace, debug and analyze HTTP/HTTPS traffic in real-time. It is used by industry-leading companies including Microsoft, Cisco, AOL and Google.
HTTP Analyzer includes two Editions---Stand-alone Edition and Add-on Edition.

Stand-alone Edition : Window stand-alone EXE application. It allows you to capture and view HTTP/HTTPS traffic from a specific process or user/session/system wide. Support IE, Safari, Chrome, Firefox and other win32 web application.

Add-on Edition: An add-on that integrates into the lower part of your IE  or Firefox window and can be opened/closed from the IE or Firefox toolbar. It can only capture and view HTTP/HTTPS traffic of current IE or Firefox process.

Main Features

    * Integrate with Internet Explorer and Firefox, No more switching between windows. HTTP Analyzer Shows HTTP/HTTPS traffic and web page in the same window. 
    * Support HTTPS, show you unencrypted data sent over HTTPS / SSL connections as the same level of detail as HTTP.
    * See wide range data, including Header, Request ,Network Timing, Content,  Cookies, Caching, Query Strings, Post data, Request and Response Stream, redirection URLs, DOMReadyTime, PageLoadTime and more.
    * Real-time Page and Request Level Time Chart, The colored time chart is used to express the relative time between a single network level timing (i.e. , DNS lookup, TCP connects) and other timing segments in the same request.
    * Native support for Flash Remoting , HTTP Analyzer is especially useful for Adobe Flash developers as you can view the request and response of LoadVariables, LoadMovie and XML loads. It can also deserialize and display all Flash Remoting or AMF (AMF0 and AMF3) traffic in a easy-to-use AMF object tree. 
    * JSON , SOAP and .NET ViewState Viewer , HTTP Analyzer can deserialize SOAP and JSON traffic into the easy-to-use object tree. It can also read and decode the hidden ViewState on an ASP.NET Page.
    * Request builder, Users can handcraft an HTTP request by using the HTTP Request Builder, or use a drag-and-drop operation to move an existing request from the session grid to the Request Builder to execute it again. 
    * Automation interface, The HTTP Analyzer automation library is packaged as COM components. both Stand-alone and Add-on can be fully controlled by using OLE Automation. It can be used by most programming languages (e.g. C#, VC, Delphi & JavaScript).



2009년 8월 17일 월요일

Custom Event 작성시 알아야 할 기본사항 (퍼옴)






Flex Application은 모두 알고 있다시피 Event Driven 방식이다.
Application 기동부터 종료까지 event로 시작해서 event로 끝난다..

event를 왜 사용하는가.를 포함, event에 대한 모든 제반사항에 대해서 지돌스타님 블로그에 정리가 잘 되어 있다.
여기를 클릭
참고하길 바라며, 나 또한 이글을 포스팅한 후 제반사항에 대해 예제위주로 정리해서 올려야겠다.(ㅋㅋ 대체언제..)

암튼 각설하고,

보통 개발자가 원하는 방식으로 event 처리를 할 때, event object에 개발자가 원하는 정보를 추가 및 보내기 위해 custom event를 만들어 사용하며, 보통 flash.events.Event 클래스를 상속받아서 custom event class를 작성한다.
또는, event type만을 정의해 다음과 같이 custom event 객체를 생성할 수도 있다.
==> this.dispatchEvent(new Event("myCustomEvent")) 

(주의사항 : 반드시 flash.events.Event 클래스를 상속받아서 만들 필요는 없다. 필요에 따라 다른 Event클래스를 상속 받아서 써도 된다. 상황에 맞게, 입맞에 맞게 상속받아서 사용하길 바란다.)

전자(Event클래스의 Sub Class 작성)는 event object 정보 외에 부가적으로 필요한 정보들을 event object에 추가 및 사용하기위해서 사용되고 후자(event type정의)는 단순히 event object 정보만 필요로 할때 사용한다.

여기서는 Event클래스의 Sub Class로 Custom Event를 작성할 때 기본적으로 알아야 할 사항을 정리해보았다.

일단 하나의 Custom Event를 만들어 보자.

package events
{
   import flash.events.Event;

   public class MyCustomEvent extends Event
   {
       public static const MY_EVENT:String = "myEvent";
      
       private var _strMyName:String;
      
       public function MyCustomEvent(type:String,strName:String,bubbles:Boolean=false,cancelable:Boolean=false)
       {
           super(type,bubbles,cancelable);
          
           _strMyName = strName;
       }
      
       public function get strMyName():String
       {
           return _strMyName;
       }
      
       public override function clone():Event
       {
           return new MyCustomEvent(type,strMyName,bubbles,cancelable);
       }
      
       public override function toString():String
       {
           return formatToString("MyCustomEvent", "type", "bubbles", "cancelable", "eventPhase", "strMyName", "target", "currentTarget");
       }
      
   }
}


flash.events.Event를 상속한 "myEvent" 타입의 MyCustomEvent 클래스를 작성했다.
(주의사항 : 이 Custom event 클래스는 event type과 사용자정보-strMyName- 및 bubbles 옵션,cancelable옵션을 event 객체를 생성할때 사용자가 원하는대로 설정할 수 있게끔 만든 것이다. 꼭 저렇게 만들어야 한다는 게 아니란 걸 말하고 싶다.)

보시는 바와 같이 아주 간단하게 Custom Event를 작성할 수 있는데 다음과 같은 사항을 고려해서 작성해야 한다.
==================================(Must가 아니라 Recommend사항)========================================

1. Custom Event Class의 Super Class 생성자 argument인 'type' 속성값은 static constant로 지정한다.

Event Class 생성자의 필수 argument인 'type' 속성의 데이터 타입은 string이다.
보통 다음과 같이 쓸 수 있다.

var strMyName:String = "게릴라";
          
dispatchEvent(new MyCustomEvent("myEvent",strMyName));

위의 예제에서 "myEvent" 라고 정확히 입력하면 문제가 되지 않겠지만 실수로 "myEvvent"라든가 "myEvents"등 오타를 입력하게되면 어떻게 될까?
플렉스 컴파일러는 생성자의 type 속성에 전달된 string값을 체크하지 않는다. 고로 컴파일 에러없이 컴파일이 수행된다.
(어플리케이션 어딘가에 저런 이벤트가 있겠지 하고 마는 것이다.)
런타임에 에러가 발생하지만 런타임 이전엔 에러를 찾기가 힘들다. 이 말은 프로그램을 돌려봐야 에러를 발견할 수 있단 얘기다.

이러한 문제를 미연에 방지하기 위해 즉, 컴파일 타임에 valid체크가 가능하도록 하기 위해  Event Class에 type 속성을
static constant로 정의한다.

var strMyName:String = "게릴라";
          
dispatchEvent(new MyCustomEvent(MyCustomEvent.MY_EVENT,strMyName));

만약 생성자의 type 속성에 잘못된 constant를 지정하게되면 컴파일러는 컴파일 타임에 친절하게
Syntax Error(구문 오류)를 날려주신다. (후훗~ 쌩유~)

흠..저런 고민을 덜고자, 오타를 아예 방지하고자 한다면 다음과 같은 방식으로 Custom event를 만들 수도 있겠다.

package events
{
   import flash.events.Event;

   public class MyCustomEvent extends Event
   {
       public static const MY_EVENT:String = "myEvent";
      
       private var _strMyName:String;
      
       public function MyCustomEvent(strName:String)
       {
           super(MyCustomEvent.MY_EVENT);
          
           _strMyName = strName;
       }
      
       public function get strMyName():String
       {
           return _strMyName;
       }
      
       public override function clone():Event
       {
           return new MyCustomEvent(strMyName);
       }
      
       public override function toString():String
       {
           return formatToString("MyCustomEvent", "type", "bubbles", "cancelable", "eventPhase", "strMyName", "target", "currentTarget");
       }
      
   }
}

이 event를 사용하고자 한다면 생성자에 type속성 값을 박아넣고, 아예 필요한 정보만 받도록 만든 것이다.
서두에 작성된 Custom event 클래스와는 달리 type 속성 및 bubbles , cancelable 값을 사용자가
제어하지 못하게 만든 Custom event 클래스이다.

이 event 클래스의 객체를 생성하고 dispatch한다고 할때, 다음과 같이 사용자 정보만 넘기면 된다.

var strMyName:String = "게릴라";
          
dispatchEvent(new MyCustomEvent(strMyName));



2. clone()메소드를 Override한다.

event클래스의 clone메소드는 event 객체의 복사본을 생성하여 되돌려준다.(참조복사-Shallow Copy-가 아닌 Deep Copy 객체)

flex엔 java의 clone() 메소드나 Cloneable같은 Interface가 존재하지 않기 때문에 각각의 event클래스 마다 각각
clone메소드를 override해야 한다.(아래 예제참조)

flex sdk의 소스를 까보면 mx.events패키지에 여러 이벤트들이 존재하는데 몇개만 들여다 보자.

-mx.events.CloseEvent

override public function clone():Event
{
   return new CloseEvent(type, bubbles, cancelable, detail);
}

-mx.events.ItemClickEvent


override public function clone():Event
{
   return new ItemClickEvent(type, bubbles, cancelable, label, index, relatedObject, item);
}


우리가 Custom Event를 만들때 clone 메소드를 override하는 것은 무조건 강제하는 사항은 아니다.
일반적으로 이 clone 메소드를 override하지 않아도 사용이 가능하다.

하지만 이 clone 메소드를 override하지 않은 Custom event는 Application내에서 언제 런타임 에러를 내뱉을지 모를
위험한 놈이 될 수도 있음을 알아야 한다.
그럼 왜 clone 메소드를 override 해야하는가?

이를 설명하기 전, EventDispatcher 클래스의 dispatchEvent() 메소드를 통해 event가 발생하는 내부로직부터 이해하고 넘어가야겠다. 거창할거 없다. 모두 알고 있는 단순한 사실을 짚고 넘어가 보자. event는 어떻게 발생하는가?
일단 dispatch하고자하는 새로운 event instance를 생성한다. 새로 생성된 event 객체의 target 속성값은 현재 null값이다.
EventDispatcher 클래스의 dispatchEvent() 메소드를 통해 새로운 event객체를 dispatch한다.
dispatchEvent() 메소드는 event객체의 target 속성값을 event를 발생시킨 객체(보통 컴포넌트) 레퍼런스, 즉 event를 최초 발생시킨 객체 참조값으로 초기화한다. 이 target 속성값은 바뀌지 않는다.(event flow(Capture-at Target-Bubbling)에서 등록된 eventListener에 따라 currentTarget값은 바뀌지만 target값은 바뀌지 않는다.)

자, 이렇게 이 event를 dispatch한 후 target속성값은 event를 최초 발생시킨 객체 참조값으로 정해졌다.

만약, 같은 Application에 addChild되어 있지만 dispatch된 이 event를 listening할 수 없는 컴포넌트에서 이 event를 똑같이 그대
로 받아서 쓰고 싶다면 어떻게 해야 될까?

Application에 서로 상관관계가(부모자식관계 or Hierachy관계)없는 A,B라는 컴포넌트가 있다 가정하고, A에서 발생한 event를
B에서도 받아서 쓰고 싶을 땐 A에서 발생한 event를 B에서 그대로 dispatch하면 된다.(event Re-Dispatch)
추가:event를 Re-Dispatch한다는 것이 말하고자 하는 요점이지 꼭 저런상황에서 필요하단 얘기가 아니다.
Application의 (A와 B를 포함하는) event listener에서 B의 메소드를 호출하든, B에서 event를 dispatch하든 그건 방법론적 차이이다.
Application의 listener가 appListener라고 가정하면,

appListener(cutomEvent:MyCustomEvent):void
{
//B의 메소드를 호출해서 일을 시킨다.
B.excuteMymethod(cutomEvent);

//B에서 event를 dispatch시킨다. B에 eventListener를 등록, eventListener에 등록된 이벤트 핸들러에서 일을 시킨다.
//B.dispatchEvent(cutomEvent);  // clone메소드 자동호출하도록 하기 위한 예.
}
말 그대로 두 방법 다 loose coupling이 아닌 tight coupling이 되는 구조다. 객체참조값을 통해 접근하기 때문이다.
B라는 컴포넌트가 없으면 에러가 발생할테니까..

가정상황이 두 컴포넌트는 따로 따로 있어야 하는 상황이고, 똑같은 event값을 받아 쓰려고 하는 상황이다. 말그대로 가정상황이다. clone메소드 자동호출하는 상황을 만들어내기 위한 가정상황이란 것이다. loose coupling을 염두에 둔다면 그냥 A와 B 각각 따로 event를 발생시켜서 쓰든가 observer패턴같은 디자인패턴을 적용해서 쓰든가 캔곰의 controller, command구조로 구성하든가 해야 할 듯하다. .다시 말하지만 event를 Re-Dispatch한다는 것이 말하고자 하는 요점이 지 방법론적 문제는 좀 더 연구해봐야 할 듯 하다.  예제가 적절치 못했음을 인정한다. event를 re-dispatch하는 상황이 언제 어디서 왜 필요한지 아직 정확히 몰라서 깊이 생각치 못하고 이런 가정상황을  만든 것이다. event를 re-dispatch해서 쓰는 상황에 대한 적절한 예가 필요하다^^;; 적절한 예를 들어주실 분! 손!

이때 dispatchEvent()메소드가 무슨 짓을 하는지 살펴보면..

dispatchEvent () method  
public function dispatchEvent(event:Event):Boolean
Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 9

Dispatches an event into the event flow. The event target is the EventDispatcher object upon which the dispatchEvent() method is called.

Parameters


event:Event — The Event object that is dispatched into the event flow. If the event is being redispatched, a clone of the event is created automatically.  After an event is dispatched, its target property cannot be changed, so you must create a new copy of the event for redispatching to work.
Returns

Boolean — A value of true if the event was successfully dispatched. A value of false indicates failure or that preventDefault() was called on the event.

Throws

Error — The event dispatch recursion limit has been reached.


빨간색으로 밑줄 친 부분은 If the event is being redispatched, a clone of the event is created automatically.
event가 다시 dispatch되면 자동으로 그 event의 복제본이 생성된다라고 말하고 있다.

이는 clone 메소드를 자동으로 호출한다는 것을 의미한다. dispatchEvent메소드를 호출하면(targeted Event를 파라미터로 받을경우) 자동으로 clone 메소드를 호출하기 때문에 사용자가 eventObject.clone() 할 일은 없을 것이다.(일반적으로 clone메소드는 사용자가 직접 호출해서 쓰지 않는다. 물론 직접 호출해서 써도 무방하다. 동일하게 작동하지만 자동으로 처리해주는 것을 굳이 사용자가 호출할 필요가 없지 않은가. flex sdk소스를 보다 보면 가끔 dispatchEvent(event.clone()); 처럼 처리하는 경우도 볼 수도 있다. )

쉽게 말하려 하는데, 한마디로 정리하자면!
target 속성값이 이미 할당된 event(이미 dispatch된 event)를 dispatchEvent()메소드를 통해 다시 dispatch하면 자동으로 그 event의 clone메소드를 호출한다는 것이다.

clone () method
public function clone():Event
Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 9

Duplicates an instance of an Event subclass.

Returns a new Event object that is a copy of the original instance of the Event object. You do not normally call clone(); the EventDispatcher class calls it automatically when you redispatch an event—that is, when you call dispatchEvent(event) from a handler that is handling event.

The new Event object includes all the properties of the original.

When creating your own custom Event class, you must override the inherited Event.clone() method in order for it to duplicate the properties of your custom class. If you do not set all the properties that you add in your event subclass, those properties will not have the correct values when listeners handle the redispatched event.



자, 다음과 같은 구조의 화면이 있다고 가정하자.
Application에 A-B-C-D구조로 된 부모/자식관계의 컴포넌트(Visual DiplayObject)들이 있고
A-B-C-D구조와는 상관없이 Application에 add된, A와 Depth가 같은 E라는 컴포넌트(Visual DiplayObject)가 있다고 하자.
현재 이 event를 Application 및 A-B-C-D구조로 된 부모/자식관계의 컴포넌트들과 E라는 컴포넌트가  모두 listening하고 있다. event는 D에서 발생했다. 위에서 설명한대로 D에서 발생한 event객체의 target은 D의 객체 참조값이 할당된다.
Application 및 A-B-C-D에선 이 event를 listening할 수 있지만 E에서도 listening이 가능한가? 현재구조로선 불가능하다.
등록된 eventListener에서 D에서 발생한 event객체를 받아서 다음과 같이 Re-Dispatch 해줘야한다.
(굳이 D에서 발생한 event를 사용하지 않고 , D에서 발생한 event와 똑같은 event를 새로 생성해서 E에서 dispatch할 수도 있다.
event를 Re-Dispatch한다는 것이 말하고자 하는 요점이지 꼭 저런상황에서 필요하단 얘기가 아니다.
물론 나라면 내부적으로 clone 메소드를 호출하도록 해서 똑같은 event객체를 쓸 것이다.
상황에 따라 얼마든지 event는 Re-Dispatch될 수 있다.)

등록된 eventListener가 myEventListener라면

myEventListener(cuctomEvent:MyCustomEvent):void
{
   E.dispatchEvent(cuctomEvent); // Re-Dispatch    
}


이미 target 속성값이 지정된(이미 dispatch된) event객체를 그대로 다시 dispatch하면 E에서도 D에서 발생한 event를 그대로 받아서 쓸 수 있다.

여기서 짚고 넘어갈 부분이 생겼다.위에서 언급했었지만 target 속성값은 바뀌지 않는다 라고 했었다...
하지만 이미 dispatch된 event객체를 다시 dispatch하면 clone메소드에 의해 생성된 새로운 복사본의 event target 속성 값은
어떻게 될까? 당연히 Re-Dispatch한 곳의 객체 참조값이 다시 할당되서 event target 속성값이 변경될 것이다.
(clone메소드에 의해 새로운 복사본 객체가 생성되면 새로 생성된 event 객체의 target 속성값은 null값이 되고 이를 dispatchEvent()메소드로 dispatch하면 새로운 target 속성값이 할당된다.)

D에서 발생한 event의 target 속성값은 D가 되고 E에서 Re-Dispatch한 event의 target 속성값은 E가 될 것이다.
이미 dispatch된 event객체를 Re-Dispatch하면 target 속성값이 변한다는 사실을 잊지 않길 바란다.

정말 뒤죽박죽 장황하게 떠들어댔다.. clone메소드를 왜 override해야 하는건지 말하려다보니 관련된 사항에 대해
말이 길어졌는데, 결국 저런 경우에 Custom Event에서 clone 메소드를 override하지 않은 채로 사용한다면 다음과 같은
런타임 에러가 발생한다.

TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::Event@...... to MyCustomEvent.

TypeError: Error #1034: 유형 강제 변환에 실패했습니다. flash.events::Event@......을(를) MyCustomEvent(으)로 변환할 수 없습니다.

왜 Type Conversion Error가 나지? 하고 의아해하는 사람도 있을 것이다.
Override하지 않은 clone 메소드는 내가 만든 MyCustomEvent 타입의 객체를 반환하지 않고 flash.events.Event 타입의 객체를 반환하기 때문에 Type Conversion Error가 나는 것이다.

주의사항 :
clone 메소드를 overriding할땐 flash.events.Event 클래스에 정의된 메소드 시그니처(Method Signature)에
맞게 작성해야 한다. override 한 clone 메소드의 리턴 값이 자신이 정의한 Custom Class 타입이 아닌 flash.events.Event 타입이어야 한다는 것이다. Event클래스를 상속한  자신의 Custom Event의 타입은 flash.events.Event 타입이지만 실제로
리턴되는 인스턴스는 Event클래스의 인스턴스가 아닌 자신이 작성한 Custom Event의 인스턴스가 된다는 것을 의미한다.

clone 메소드를 overriding해야 하는 첫번째 이유는 바로 저런 문제가 발생하기 때문이다.
그럼 다른 또 이유가 있을까? 있단다...이 부분은 사실 나도 잘 모르겠다...(사실 지금 찾아보다 포기했다.ㅋㅋㅋ)

clone 메소드를 overriding해야 하는 두번째 이유는
'clone 메소드는 내부적으로 event bubbling을 위해서 overriding해야 한다'고 한다.

Foundation Flex for Developer 58페이지에 언급된 내용을 보고 정신이 혼미하다...^^;;

We also need to call the clone method to support event bubbling.
By using this method, the event can bubble to any parent containers. This is necessary to inform any other components that are listening for this event.If you don’t override the clone method, the event can’t bubble.
->
event bubbling을 지원하기 위해 clone 메소드를 호출할 필요가 있다.
이 메소드를 사용해서 event는 어떤 부모 컨테이너에든 bubbling할 수 있다.
이 event를 linstening하고 있는 여느 다른 컴포넌트에 통지하기 위해 필요하다.
clone 메소드를 override하지 않으면 이 event는 bubbling할 수 없다.

flex bloger(farata) 에도 다음과 같이 언급되어 있다.

This class has to extend flash.events.Event, override its method clone to support event bubbling.

역시나 event bubbling을 위해선 clone 메소드를 override해야 한다고 한다.
하지만 실제로 저 블로그 링크의 예제를 따라해보면 clone 메소드를 override하지 않아도 custom event의 bubbles 속성값만 true로 하면 이상없이 bubbling된다는 것을 알 수 있을 것이다.

흠...일반적으로 clone 메소드를 override하지 않은 채로, custom event를 만들고 bubbles 속성값을 true로 해서
event 객체를 생성하고 hierachy구조(부모-자식관계)의 DisplayObject상에서 이 event객체를 dispatch하면 이상없이 event flow를 따라 bubbling되는 것을 알 수 있다.  

즉, Visual DisplayList에 addChild되어 있는 displayObject에서
실제 event가 bubbling될 때 새로운 event 객체가 복제되지 않고 event가 dispatch된 최초 발생지점(target)에서부터,
처음 생성된 event 객체가 stage까지 bubbling되면서 올라간다. bubbling되는 event 객체의 target 속성값은 변함 없지만 currentTarget 속성값은 현재 bubbling되면서 지나치는 displayObject 객체 참조값으로 계속 변경된다. 한마디로 뭐..event를 bubbling할때 event를 복제하지 않고 처음 생성된 event 객체를 그대로 쓴다는 얘기를 하려는 것이다.(일반적인 경우)

하지만 실제로 특별한 상황의 어플리케이션에선 내부적으로  clone 메소드를 호출해서 event bubbling을 한다고 한다.
clone 메소드를  overriding 하지않으면 event bubbling을 할 수 없는 경우가 있다고 하는데....정말 모르겠다..이부분은...
이 부분은 누가 좀 알려주면 정말 좋겠는데...^^; (트랙백 굽신굽신 ㅋㅋ)

3. toString()메소드를 Override한다.

이 메소드를 override하면 디버깅용으로 좋다. custom event의 클래스명부터 사용자가 정의한 모든 속성 및 상속받은 부모 event 클래스의 모든 속성까지 한번에 볼 수 있다. (type,bubbles,cancelable,eventPhase,target,currentTarget등)

override하지 않은 메소드를 호출하게 되면 상속받은 부모 클래스(일반적으로 Event클래스)의 toString 메소드를 호출하게 되고
사용자가 추가한 custom data는 보여주지 않고 다음과 같이 기본속성만 보여준다.

[Event type="myEvent" bubbles=true cancelable=false eventPhase=2]

type, bubbles, cancelable, eventPhase 속성값만 확인이 가능하다. 다른 속성값(target,currentTarget)이나 자신이 추가한
정보를 보고자 한다면 이 메소드를 override해야 한다.

그래서 기본적으로 제공되는 utility 메소드가 있는데 바로 Event 클래스의 formatToString 메소드이다.

formatToString () method  
public function formatToString(className:String, ... arguments):String
Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 9

A utility function for implementing the toString() method in custom ActionScript 3.0 Event classes. Overriding the toString() method is recommended, but not required.

  class PingEvent extends Event {


var URL:String;


public override function toString():String {


return formatToString("PingEvent", "type", "bubbles", "cancelable", "eventPhase", "URL");


}


}



친절하게도 custom event클래스의 toString 메소드를 구현하기 위한 utility function이라고 딱 정해놨다.
서두에도 말했듯, 1,2,3번 사항 전부 강제사항이 아닌 recommended 사항임을 알아두길...(권고사항은 왠만하면 지켜주는게
개발자 정신건강에 좋은 듯~ㅋㅋ 뭐 귀찮다면 할 수 없지만...)

자, formatToString 메소드에 전달되야 하는 값을 살펴보자.

formatToString(className:String, ... arguments):String

첫번째 값은 Custom event 클래스명을 String 타입의 값으로 받는다.
꼭 자신이 만든 Custom event 클래스명이 아니어도 에러는 발생하지 않는다. String값이면 된다.
두번째 값은 현재 자신이 만든 Custom event 클래스에서 사용할 수 있는 속성값들이다.
자신이 보고싶은 속성값들만 String값으로 연속해서 넣어주면 된다.
(주의사항 :  Custom event 클래스에서 사용할 수 없는 속성값을 넣으면 에러가 발생한다.)

본문 서두에 만들어 놓은 Custom event 클래스의 toString 메소드를 보자.

public override function toString():String
{
      return formatToString("MyCustomEvent", "type", "bubbles", "cancelable", "eventPhase",
                                     "strMyName", "target", "currentTarget");
}

"MyCustomEvent"가 className에 전달되는 string값이고 이후 "type"부터 rest parameter이다.


꼭 저렇게 하지 않아도 된다.
formatToString 메소드를 쓰지 않고 다음과 같이 자신이 원하는 대로 할 수도 있다.
단, Custom event 클래스에서 사용할 수 있는 속성값이어야 한다.

public override function toString():String
{
            return "[MyCustomEvent type=" + this.type + " MyName=" + this.strMyName + " bubbles=" + this.bubbles + " cancelable=" + this.cancelable + " eventPhase=" + this.eventPhase + " target=" + this.target + " currentTarget=" + this.currentTarget + "]";
}

입맛에 맞게 overriding하면 될 듯...


P.S. 1: 제가 위에서 언급한 부분(알아내지 못한 clone 메소드를 overriding해야 하는 두번째 이유) 함께 토의해봐요~^^
P.S. 2: 대체 어떤 상황에서 한번 dispatch된 event를 re-dispatch하는게 좋을까요? 함께 토의해봐요~^^

사실 위에 내용 중 긴가민가하는 부분이 간혹 있었다.

모르는 부분도 있고...누군가 잘못된 부분이나 내가 알아내지 못한 부분에 대해서 트랙백을 걸어주길 바라며

글을 정리한다.

오랫만에 글을 썼는데 날림으로 쓰느라 syntaxhightlighter도 사용하지 않고 막 써버렸다..

앞으로 모든 글들은 내 귀차니즘으로 인해...syntaxhightlighter를 쓰지 않는 형태가 될 것 같다..ㅋㅋㅋㅋㅋ

프로젝트 핑계로 정말 너무 게으르게 살았던 듯...

자~ 다시 열공모드로 진입합시다!!!

ㅋㅋㅋㅋ

2009년 8월 14일 금요일

Flex 에서 Fla Compile 할시 유용한 팁




원 소스 출처 : http://cafe.naver.com/flashover.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=387

Flex에서는 Fla 관리시에 좀 불편한점이 있었는데,

Fla 를 관리하며, 컴파일 할때, 컴파일 하기가 조금 번거롭다는 것인데,

위의 주소에서 jsfl 이라는 배치 스크립트 파일을 받았는데, 오류가 나면서 동작하지 않았다.

맥이라서 그런가?

그래서 아래와 같이 수정하였다.



for(var i=0; i<executableFileName.length; i++){
    fl.openDocument( currentPath+executableFileName[i] );
    fl.getDocumentDOM( ).exportSWF(currentPath+executableFileName[i], true );
}


맨 아래 두줄을 for로 묶고, 배열에 따라 swf 로 컴파일 하는...

현재 테스트 해보았는데 잘된다. :)

2009년 8월 12일 수요일

AS3 AVM1Movie 제어하기



원문 : http://alaguvel.wordpress.com/2008/09/06/avm1-swf-to-as3-swf-forcibleloader/

ForcibleLoader.as http://snippets.libspark.org/svn/as3/ForcibleLoader/src/org/libspark/utils/ForcibleLoader.as

 private function init():void{
  var loader:Loader = new Loader();
  loader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfComplete);
  var fLoader:ForcibleLoader = new ForcibleLoader(loader);
  fLoader.load(new URLRequest(swfURL));
  fxStage.addChild(loader);
  pptContainer.addChild(fxStage);
 }
 private function swfComplete(event:Event):void{
   libMC =  event.currentTarget.content as MovieClip;
   for(var i:int = 1;i<Math.ceil(libMC.totalFrames/2);i++){    
    totalSlides.addItem(i);
   }
   slides = Math.ceil(libMC.totalFrames/2);
   libMC.gotoAndStop(1);
 }



위 클래시를 이용해서, 위와 같이 제어 할수 있다.
 
진작 찾았으면 좋았을껄~

2009년 8월 11일 화요일

FDT Flash Compile Key Setting.


참고 : http://labs.mstudio.com/?p=174

Preferences -> Run/Debug -> Launching ->

Launching Operation
      Always launch the previously launched applications


Preferences -> General -> Keys

Search : Run Last Launched
Binding Key.

:)

ActionScript Debugger - Arthropod


Arthropod

http://arthropod.stopp.se/index2.php/


Download : http://arthropod.stopp.se/index2.php/?page_id=3
Download Direct Link :
                                    AIR : http://arthropod.stopp.se/downloads/Arthropod.air
                                    CLASS : http://arthropod.stopp.se/downloads/Debug.as

How to use

Arthropod is really easy to use. Basically the only thing you need to do is import the Debug class, write a log message with the log function, start Arthropod and publish your site / AIR application.

To hide the Bitmap window, Array window and clear the output field, just click on the main area and press Backspace (<–).

Step-by-step:

  1. Download Arthropod
  2. Install Arthropod
  3. Add the Debug.as file to your Actionscript 3 library under com/carlcalderon/arthropod/
  4. Import the Debug class by inserting import com.carlcalderon.arthropod.Debug;
  5. Place a Debug.log method execution where ever you want to make a trace, like this; Debug.log("my message");
  6. Start Arthropod
  7. Publish your site/ AIR application.
  8. The message “my message” will be displayed in Arthropod.

Available methods:
Check out the “Documentation” section for further explanation.

  • log
  • warning
  • error
  • object
  • memory
  • array
  • bitmap
  • snapshot
  • clear

Support:
Arthropod currently supports the following.

  • All characters (should include asian characters, not tested)
  • OSX and Windows (Tested on some Linux dists.)
  • AIR Runtime 1.0 and above
  • All major browsers (Internet Explorer, Firefox 2.0 and above, Safari)
  • SWFObject 1.5 and above
  • Optional ProFont

2009년 8월 9일 일요일

Licensing for this product has expired 문제

삭제

MAC : 라이브러리\Application Support\Adobe\Adobe PCD\cache\cache.db
WIN : C:\Program Files\Common Files\Adobe\Adobe PCD\cache\cache.db


hosts 설정

127.0.0.1 activate.adobe.com
127.0.0.1 practivate.adobe.com
127.0.0.1 ereg.adobe.com
127.0.0.1 activate.wip3.adobe.com
127.0.0.1 wip3.adobe.com
127.0.0.1 3dns-3.adobe.com
127.0.0.1 3dns-2.adobe.com
127.0.0.1 adobe-dns.adobe.com
127.0.0.1 adobe-dns-2.adobe.com
127.0.0.1 adobe-dns-3.adobe.com
127.0.0.1 ereg.wip3.adobe.com
127.0.0.1 activate-sea.adobe.com
127.0.0.1 wwis-dubc1-vip60.adobe.com
127.0.0.1 activate-sjc0.adobe.com



2009년 6월 17일 수요일

JQuery 사용팁 모음.


JQuery 를 사용하면서, 자주 쓰이고 제일 유용한것들(?) 정리..

아마 이정도면 JQuery 로 왠만한건 구현 가능할듯?



[code]

//초기 실행
$(document).ready(function() {
   init();
})


//onclick 설졍
$('id').click( function(){
    alert('click!!');
})


//onchange 설졍
$('id').change( function(){
    alert('click!!');
})


//CSS변경
$('id').css('style', 'attribute');


//첫번째 tr를 빼고 전부 삭제
$
('someTableSelector tr:not(:first)').remove();


//select 세팅
$("id option[value=Apple]").attr("selected", "true");


//selected 값
$("id :selected").val()


//table 안에 tr추가
$('id').append( $('<tr></tr>').html('<td>JQuery</td>');


//swfobject 플러그인 사용.
    $('#flashcontent').flash(
        {
            swf: 'fla/cp.swf',
            width: 820,
            height: 250,
            flashvars:
            {

               
name1: 'jQuery',
                name2: 'SWFObject',
                name3: 'Plugin'

            }
        }
    );


//

[/code]

2009년 5월 14일 목요일

DWR을 이용한 간단한 로그인 예제.

오랜만에 포스팅..

Ajax 와 Java 의 만남으로, DWR(Direct Web Remoting) 라는 좋은 놈이 있다.

이놈을 좀 잘 활용하면, 서블릿이 필요가 읍다.

자바스크립트로 직접적으로 접근을 하니, 그러나 표현하는 데이터가 많으면 속도가 느리다.

적절히 혼합해서 사용하면 정말 굳일듯?



우선 다운로드를 한다.

http://directwebremoting.org/dwr/download


해당 라이브러리 추가후,

아래와 같이 수정




WEB-INF/web.xml
[code].....
  <servlet>
    <servlet-name>dwr-invoker</servlet-name>
    <display-name>DWR Servlet</display-name>
    <description>Direct Web Remoter Servlet</description>
    <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>

    <!-- This should NEVER be present in live -->
    <init-param>
      <param-name>debug</param-name>
      <param-value>true</param-value>
    </init-param>
  </servlet>
.....

 <servlet-mapping>
    <servlet-name>dwr-invoker</servlet-name>
    <url-pattern>/dwr/*</url-pattern>
  </servlet-mapping>
[/code]




WEB-INF/dwr.xml (신규 생성)
[code]<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" "http://www.getahead.ltd.uk/dwr/dwr20.dtd">
<dwr>
    <allow>
        <create creator="new" javascript="Login">
            <param name="class" value="test.Login" />
            <include method="loginProc" />
        </create>       
    </allow>
</dwr>
[/code]



[code]<create creator="new" javascript="Login">[/code]
- 페이지에서 Login 이라는 자바스크립트 클래스로 이용한다.

[code]<param name="class" value="test.Login" />[/code]
- 위 사용하려는 Login 의 참조 클래스

[code]<include method="loginProc" />[/code]
- Login 클래스의 메소드





test.Login
[code]package test;

public class Login {
   
    public Login(){}
   
    public String loginProc(String id, String pw){
        String loginResult = "false";
        
        if( id.equals("test") && pw.equals("test") ){
            loginResult = "true";
           
        }
       
        return loginResult;
    }
   
}
[/code]


 별거 읍다. test / test 로 들어왔을때 맞는지 아닌지만 확인. 실 이용에는 DB커넥션등.. 뭐 들어가면 될듯.





login.html
[code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>login.html</title>
    <meta http-equiv="content-type" content="text/html; charset=EUC-KR">
       <script type='text/javascript' src='../dwr/interface/Login.js'> </script>
    <script type='text/javascript' src='../dwr/engine.js'></script>
    <script type='text/javascript' src='../dwr/util.js'></script>
    <script type='text/javascript'>
   
        function loginProc(){
            var id = dwr.util.getValue('id');
            var password = dwr.util.getValue('password');
           
            Login.loginProc( id, password, resultData );
        }
       
        function resultData(loginResult){
            console.info( loginResult );
           
            if( loginResult == "true" ){
                document.getElementById("resultLayer").innerHTML = "<b>로그인 완료</b>";
            }
           
            if( loginResult == "false" ){
                document.getElementById("resultLayer").innerHTML = "<b>로그인 실패</b>";
            }
       
        }
   
    </script>
  </head>
 
  <body>
      test / test
      <hr />
     
      <div id="displayLayer">
        <div>
            <table>
                <tr>
                    <td>id</td>
                    <td>: <input type="text" id="id" name="id" /></td>
                </tr>
                <tr>
                    <td>pw</td>
                    <td>: <input type="password" id="password" name="password" /><input type="button" value="login" onClick="loginProc();" /></td>
                </tr>
            </table>
        </div>
    </div>
   
    <hr />
   
    <div id="resultLayer">
    </div>

   
    <div>
    </div>   
  </body>
</html>
[/code]




스크립트 선언에 보면,
[code]<script type='text/javascript' src='../dwr/interface/Login.js'> </script>
<script type='text/javascript' src='../dwr/engine.js'></script>
<script type='text/javascript' src='../dwr/util.js'></script>
[/code]


부분을 볼수가 있는데, 경로는 현재 웹컨덴츠 루트를 선택해 주면 된다.
[code]<script type='text/javascript' src='http://localhost:8080/test/dwr/engine.js'></script>
[/code]


그리고 사용자 정의 클래스를 불러오는 부분이
[code]<script type='text/javascript' src='../dwr/interface/Login.js'></script>[/code]


이 부분이 되겠다. /dwr/interface/ 로 해서 불러오면 끝.


그리고 이제 실 사용부분을 보면,
dwr.util.getValue 는 뭐 보면 아시겠으니 생략
[code]Login.loginProc( id, password, resultData );[/code]



loginProc(String id, String passwrd) 를 사용하므로 id 와 password 를 넘겨준다.

그런데 resultData 라고 하나가 더 들어가있다. 이것은 callBack 부분이므로 리턴값이 있는 경우 사용하면된다.

function resultData 에서 마지막으로 결과 값 처리를 한다.





참 쉽죠~? (사실 나도 처음에 헤맸다. -_-)



2009년 4월 27일 월요일

맥용 통합 메신져


맥용 MSN과 네이트온이 있지만..

아무래도 제대로 호환이 안된다.

메세지가 온지도 모르고..일할때가 많다.

그래서 찾은 통합 메신져.


Adium
     http://adiumx.com/


NateOn 플러그인
      http://www.adiumxtras.com/index.php?a=xtras&xtra_id=5355


최고!

2009년 3월 27일 금요일

결혼식 축가 영상.


부끄럽지만 결혼식 축가 영상 올립니다.

처음으로 축가를 불러봐서.. 서투르고 잘하진 못했지만,

추억이기에 간직하고 싶어 올립니다.

에코만 좀 있었어도...ㅡㅜ..







2009년 3월 25일 수요일

Apache Common DBUtil 사용하기.


Apache Common DBUtil 클래스를 사용함으로써, 그동안 삽질했던 DB 관련 Bean 세팅 노가다에서

벗어 날수 있다. 적용 해야지 하면서 미루다가 정리해서 포스팅.


다운로드 : http://commons.apache.org/downloads/download_dbutils.cgi
API : http://commons.apache.org/dbutils/apidocs/index.html





Single Result

         ...........
        QueryRunner runner = new QueryRunner();
        ResultSetHandler rsh = new BeanHandler(TestBean.class);
       
        TestBean bean = null;

        try {
            query.append("select * from TEST");

            bean = (TestBean) runner.query(conn, query.toString(), role_code, rsh);
        ...........



Multi Result


        ...........
        TestBean bean = null;
        RowProcessor convert = BasicRowProcessor.instance();

        ArrayList list = new ArrayList();
        try {
            query.append("select * from TEST");
            pstmt = conn.prepareStatement( query.toString() );
            rs = pstmt.executeQuery();
            list = (ArrayList) convert.toBeanList(rs, TestBean.class);

         ........



Update( insert, update 같음 )

       QueryRunner runner = new QueryRunner();       
        try {
           
            conn.setAutoCommit(false);
           
            query.append("update TEST set user_name=?, user_nick=? where role_code=?");

            Object[] param = {
                    "조태수",
                    "taesuz"
            };
           
            iResult = runner.update(conn, query.toString(), param);
           
            conn.commit();








2009년 3월 24일 화요일

Topre Realforce & HHKB Pro Dip Switch Setting


토프레 리얼포스 86/101/103

해피해킹 프로2


딮 스위치 세팅 메뉴얼 입니다.

레오폴드에서 제공하는 메뉴얼에서 딮스위치 부분만 빼어

PPT로 제작하였습니다.


2009년 3월 19일 목요일

Keyboard Mania...?

사건의 계기는 시간을 거슬러..

1달 전쯤?

불미스러운 일... 회사분이라면 알겠지..

일어나서.. 내가 쓰고 있던..Filco Majestouch FKB104M 갈축을 지선양에게 대여..

그리고 내가 쓸께 없어서..

그리고 써보고 싶었던..

RealForce86 + 루프 + 퍼플키캡 + 레드키...지름..

어떤분이 그랬다.. RealForce 103은 포스가 103개라고..

그럼 86은 포스가 86개.. ㅎㄷㄷ..

그렇게 쓰던중.. 또다시 찾아온 지름신..

"다른것도 써봐야지. 넌 소중하니까."

그리하여.. Cherry 3491 영입..

그러나.. 또각또각.. 흠.. 이건 내가 원하는게 아니야..

장터링하던중.. 예전에 한번쯤 소유하고 싶었던..

IBM UltraNav 10key 구입.. 키감이.. 노트북 같지 않다..(T61 사용중) 그냥 소장하자..

여기서 멈추지 않는 장터링..

RealForce를 얻었으니 HappyHacking도 얻어야지? 라는 생각이 ㅡㅡ;

그러나 환율크리를 맞은 해피는 구하기 쉽지 않았는데

수원에서 직거래 매물! 오케! 가자! .....

그리하여 Happy Hacking Pro 1 먹색 무각인 입수..

첫인상.. 오.. 귀엽다! 쓰긴 좀 난감하네..

계속 쓰니 익숙해지네.. 흠.. 2는 어떨까? 라는 위험한 생각을..

오늘 Happy Hacking Pro2 계약 ㅡㅡ;;

계약하고 나니.. 내가 무슨짓을 하고 있는지 정신 차리게 됨.

그러나 나쁜건 아니 잖아? ㅡㅡ;

휴... 통장 잔고 바닥 어케살지 ㅡㅡ;


자 뽐뿌를 받아 보시라