월요일, 4월 29
Shadow

미분류

#009 XML 만들기(config)파일로 생성시

미분류
오늘 보실 프로그램의 용도는........... 점심먹고, 담배한대하고, 커피한잔 해도 일이 손에 안잡힐때 리듬을 타게하는 정도...?? ㅋㅋㅋㅋ   [ SimpleXMLEncoderTest.mxml ]   <?xml version="1.0" encoding="utf-8"?> <!-- ************************************************* ArrayCollection -> XML 변환 ************************************************* --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" pageTitle="SimpleXMLDecoderTest" layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init();"> <mx:ArrayCollection id="ArrData"> <mx:source> <mx:Array> <mx:Object UserName="홍길동" UserTel="010-111-2222" /> <mx:Object UserName="홍길순" UserTel="010-222-2222" /> <mx:Object UserName="홍길남" UserTel="010-333-2222" /> <mx:Ob...

#008 FLEX에서 HTTPService를 이용한 XML 받기

미분류
FLEX에서 HTTPService 를 이용하여 XML 데이터를 불러오는 방법에 대해서 알아보겠습니다. 우선 받아올 데이터는 플렉스 컴포넌트라는 카페의 RSS 데이터를 불러오겠습니다. http://cafe.rss.naver.com/flexcomponent 이벤트 성공시 결과값 trace URL을 주석 처리하여 오류만들어 보면, fault 메세지가 trace 가 됨. HTTPService fault 이벤트 핸들러를 만들어주어서 상황에 맞게(XML 문법 오류라던가, 접속이 안된다던가.)에 대한 예외처리를 하는 것이 중요. - HTTPServiceTest.mxml

#007 XML 만들기(config)파일로 생성시

미분류
오늘 보실 프로그램의 용도는........... 점심먹고, 담배한대하고, 커피한잔 해도 일이 손에 안잡힐때 리듬을 타게하는 정도...?? ㅋㅋㅋㅋ   [ SimpleXMLEncoderTest.mxml ]   <?xml version="1.0" encoding="utf-8"?> <!-- ************************************************* ArrayCollection -> XML 변환 ************************************************* --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" pageTitle="SimpleXMLDecoderTest" layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init();"> <mx:ArrayCollection id="ArrData"> <mx:source> <mx:Array> <mx:Object UserName="홍길동" UserTel="010-111-2222" /> <mx:Object UserName="홍길순" UserTel="010-222-2222" /> <mx:Object UserName="홍길남" UserTel="010-333-2222" /> <mx:Ob...

#006 Flex에서 XML 을 String으로 만들때

미분류
'XML 그냥 toString() 하던지 toXMLString() 하면 String 만들어주잖아?' 라고 말이죠. 물론 XML의 toXMLString() 메소드를 호출하면 String 으로 만들어줍니다. 다만, 이게 개행문자(\n)가 포함되어있어서 문제가 됩니다. (개행문자 같은 metasequences는 이 곳을 참고하세요.) view plaincopy to clipboardprint? var sourceXML:XML = <root>           <items>               <item classtype='UIComponent' id='myUIComponent' x='10' y='10' width='20' height='20'/>               <item classtype='Canvas' id='myCanvas' x='20' y='40' width='30' height='30'/>               <item classtype='Panel' id='myPanel' x='30' y='60' width='40' height='40'/>           </items>       </root>;     var xmlString:String = sourceXML.toXMLString();   var targetXML:XML = new XML(xmlString);   위와 같은 코드가 있다고 할 때에 sourceXML.toXMLString() ...

#002 SQL top 10 추출

미분류
SELECT 문을 이용하여 데이터를 조회할 때 상위 몇개의 데이터만을 조회할 수 있습니다. 이러한 기능은 RBMS 마다 문법에 차이가 있습니다. > SQL Server : SELECT TOP 10 name, email, phone FROM userinfo > ORACLE : SELECT name, email, phone FROM userinfo WHERE ROWNUM <= 10 > MySQL : SELECT name, email, phone FROM userinfo LIMIT 10

#004 The TCP Datagram

미분류
0 . . 3 4 . . 7 8 . 10 . . . . 15 16 . . . . . . 23 24 . . . . . . 31 src port dest port sequence number acknowledgement number d offs (reserved) u a p r s f window checksum urgent pointer (options) (padding) (data)   source port number & destination port number (16 bits each) The source and destination port numbers that identify the tcp connection. sequence number (32 bits) The sequence number of the first data byte in the packet. Unless the syn flag is set in which case the sequence number is the isn (initial sequence number) and the first data byte has a sequence number of isn + 1. acknowledgement number (32 bits) If the ack bit is set, this number is the next sequence n...

#003 The IP Datagram

미분류
0 . . 3 4 . . 7 8 . . . . . . 15 16 . 18 19 . . . 23 24 . . . . . . 31 ipv ihl tos total length identification flags frag offs ttl proto header checksum source address destination address (options) (padding) (data)   ip version (4 bits) The ip protocol version. Currently 4 as of 1979 (rfc 791). ip header length (4 bits) Total header length in 32 bit words. Usually five (5) (since you hardly ever use options). Sort of silly because values of 0-4 cannot be used. Perhaps these could be used as some sort of biased value to extend the length of the header? type of service (8 bits) Describes how the packet should be handled in transit (speed vs. reliability vs. throughput). Bits arranged ...

#003 클라우드 컴퓨팅

미분류
1960년대 미국의 컴퓨터 학자인 존 맥카시 (John mcCarthy)가 처음 개념을 제시하고 여러 기업들에 의해 초석을 다져온 클라우드 컴퓨팅은 2006년 구글의 CEO 에릭 슈미트가 처음 한 말로써 최근 IT시장의 대세로 떠오른 스마트폰, 전자북 시장에까지 확대되고 있습니다. 본래의 개념은 필요한 소프트웨어를 PC에 저장할 필요없이 웹상에서 필요한만큼 빌려쓰고 비용을 지불하는 방식으로써 대표적으로 은행의 ATM기계를 들 수 있지만 최근에는 모바일 클라우드 컴퓨팅을 핵심으로 IT업계에 빠르게 퍼져나가고 있는 추세입니다. 많은 미디어, IT 전문가들은 앞으로 클라우드 컴퓨팅 이라는 수익모델에 기반한 개인용 스토리지시장이 2010년대 IT시장을 이끌어갈 핵심개념이라고 설명합니다. 클라우드 컴퓨팅이란? -정의 : 소프트웨어를 자신의 PC에 설치하지 않고 필요할때만 인터넷에 접속하여 각종 IT기기로 손쉽게 정보를 공유하고 사용하는 사용환경(interface)이자 플랫폼을 말하는 최신 IT용어입니다. -뜻풀이 : cloud + computing = 구름,덩어리+ 계산, 처리 (출처 : 다음 백과사전) 수많은 복잡한 인프라 구조로 이루어진 네트워크 모식도 입니다. 하지만 사용자들은 이것을(네트워크 보관소, 연결고리) 알지 못해도 손쉽게 네트워크로 들어가 본인에게 필요한 정보를 사용하고 또 공유할 수 있죠. 예를들면 스마트폰 시장의 대세인 아이폰의 세컨드라이브 (2ndrive)구글의 Gmail, Google Calender 등이 대표적이라 할 수 있겠죠. 사용자가 네트워크에 참여...

#069 자바를 이용한 파일 복사

미분류
package filecopy; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException;   /** * Stream을 이용한 파일복사 코드 스니핏 * @author */ public class StreamCopy {   /** * source에서 target으로의 파일 복사 * @param source * @param target */ public void copy(String source, String target) { //복사 대상이 되는 파일 생성 File sourceFile = new File( source ); //스트림 선언 FileInputStream inputStream = null; FileOutputStream outputStream = null; try { //스트림 생성 inputStream = new FileInputStream(sourceFile); outputStream = new FileOutputStream(target); int bytesRead = 0; //인풋스트림을 아웃픗스트림에 쓰기 byte[] buffer = new byte[1024]; while ((bytesRead = inputStream.read(buffer, 0, 1024)) != -1) { outputStream.write(buffer, 0, bytesRead); ...

#002 HTTP 1.0 전송규약

미분류
HTTP/1.0 (HyperText Transfer Protocol, Version 1.0, RFC 1945) 1. HTTP 개요 1.1 HTTP vs. TCP/IP HTTP는 World Wide Web에서 사용하고 있는 데이타 전송 프로토콜이며 MIME으로 지정할 수 있는 모든 데이타 형식에 대해 8bit 이진모드로 전송할 수 있다. (8bit 이진모드 전송이라 함은 1bit도 빠짐없이 완전무결하게 전송한다는 것이며 7bit 아스키모드 전송이라 함은 8bit 기본 단위에서 MSB 1bit의 완전무결성을 보장하지 못 한다는 것이므로 데이타 전송에 오류가 생길 가능성이 있다. 따라서 ASCII 텍스트 문서를 전송할 때는 7bit 아스키모드로 전송을 해도 되지만 실행파일과 같은 binary data를 전송하고자 할 때는 반드시 8bit 이진모드로 전송하여야만 한다.) 이것은 FTP의 경우에서와 같이 이진모드로 데이타 송수신이 가능함을 뜻하며, 다만 WWW용의 추가적인 정보가 HTTP 프로토콜에서 활용되고 있을 뿐이다. 따라서 HTTP 프로토콜은 TCP/IP 프로토콜 체계 가운데 TELNET이나 FTP와 같은 응용 프로토콜의 한 가지이다. 즉, 아래의 그림에서 보이는 것처럼 HTTP는 TELNET처럼 TCP 수송계층 프로토콜을 이용해서 데이타 송수신을 하는 응용 계층 프로토콜의 일종이라는 것이다. +------+ +------+ +--------+ +------+ +------------+ +-----+ +------+ +-----+ | ping | | http | | ...