posted by 방랑군 2012. 1. 4. 04:24
출처 :  http://fallove.blog.me/70101916122

최근 이슈가 되고 있는 Json(Javascript Object Notation)은 텍스트 타입의 데이터 처리 방식에 있어서 XML을 대체할 만한 또 다른 형태이다.

장점이라면 XML DOM 호출에 비해 처리 속도가 뛰어나며, Cross-site Domian에서도 사용이 가능하다.

 

현재 관리하고 있는 사이트를 좀 더 가볍게 하기 위해 기존 XML이나 DataSet의 형태를 Json으로 작업하기 위해 관련 자료를 찾아보던 중

Codeplex에서 소개하고 있는 Json.NET framework을 사용해 보았다...

 

        public string Serialize(object value)
        {
            Type type = value.GetType();

            JsonSerializer json = new JsonSerializer();

            json.NullValueHandling = NullValueHandling.Ignore;

            json.ObjectCreationHandling = ObjectCreationHandling.Replace;
            json.MissingMemberHandling = MissingMemberHandling.Ignore;
            json.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;

 

            if (type == typeof(DataRow))
                json.Converters.Add(new DataRowConverter());
            else if (type == typeof(DataTable))
                json.Converters.Add(new DataTableConverter());
            else if (type == typeof(DataSet))
                json.Converters.Add(new DataSetConverter());

 

            StringWriter sw = new StringWriter();
            JsonTextWriter writer = new JsonTextWriter(sw);
            if (this.FormatJsonOutput)
                writer.Formatting = Formatting.Indented;
            else
                writer.Formatting = Formatting.None;

 

            writer.QuoteChar = '"';
            json.Serialize(writer, value);

 

            string output = sw.ToString();
            writer.Close();
            sw.Close();

 

            return output;
        }

        public object Deserialize(string jsonText, Type valueType)
        {
            JsonSerializer json = new JsonSerializer();

 

            json.NullValueHandling = NullValueHandling.Ignore;
            json.ObjectCreationHandling = ObjectCreationHandling.Replace;
            json.MissingMemberHandling = MissingMemberHandling.Ignore;
            json.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;

 

            StringReader sr = new StringReader(jsonText);
            JsonTextReader reader = new JsonTextReader(sr);
            object result = json.Deserialize(reader, valueType);
            reader.Close();

 

            return result;
        }

 

 

위 두개의 Method는 테이터 타입의 정보를 Json 형태로 변환이 가능하다.

예로 DataSet의 데이터를 Json으로 변환해 보자..

 public void SetJson()

{

    string JsonFileNM = "Test_JsonFile.jsf";

    string JsonString = string.Empty;

    DataSet ds =  null;

 

    ds = Test.GetData(...);

    JsonString = Serialize(ds);

     ....

     //*******************//

     // JsonFileNM로 파일 저장  //

     //*******************//

 ...

}

 

public DataSet GetJson(Sstring jsonText)

{

    DataSet ds = (DataSet)Deserialize(jsonText, typeof(DataSet)));

    return ds;

}

 

Json.NET framework의 특징은 다음과 같다.

-Flexible JSON serializer to convert .NET objects to JSON and back again
-LINQ to JSON for reading and writing JSON
-Writes indented, easy to read JSON
-Convert JSON to and from XML
-Supports Silverlight and Windows Phone

 

CodePlex에서 관련 소스를 download가 가능하다.

http://json.codeplex.com/

http://www.west-wind.com/Weblog/posts/471835.aspx

 
posted by 방랑군 2012. 1. 4. 04:02
jQuery로 Textbox에 값을 가져오고 채우기 위해서는 .val() 함수를 이용한다.


1. 채우기
jQuery("#textbox id").val("abcd");

2. 가져오기
jQuery("#textbox id").val(); 

출처 : http://blog.naver.com/tjjoker?Redirect=Log&logNo=100121652807

ASP.NET 컨트롤 ID제어하기 

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

참고 : * jQuery JavaScript Library v1.4.4
 * http://jquery.com/

내용 : $("[id$='subject']").eq(1)  사용법 인지

 
 $(#"아이디풀네임") 을 적어서 접근을 하지만,

 id$='아이디일부명' 으로 접근이 가능하다.  단 이름이 AA 면  1_AA 등은 가능하지만 AA_ 식으로는 안된다는것이다.

즉, *AA는 되지만 AA* 는 같은 이름으로 인지를 못한다.

일단 같은이름으로 인지가 되면, jQuery은 .eq(인덱스) 를 통해 해당 컨트롤에 접근이 가능하다.

 

 

 

[참고] 컨트롤 존재여부 판단

$("[id$='chk_ItemId']").length 식으로 length 를 하면 없는 객체도 0으로 반환을하므로

존재 여부 판단 가능하다.

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

<%@ Page Language="C#" %>

<script src="/jQuery/jquery.js" type="text/javascript"></script>
 

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>제목 없음</title>
<script type="text/javascript">
    
    // TEST일 :  2011 - 02 - 09
    // 참고 URL http://cafe.naver.com/jquerymytour.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=64
     function test()
     {     
        //id$='형식으로 적으면' 해당 리스트가 속해있는 이름들을 찾는다. 
        
        //1.서버 텍스트 박스 값 가져오기 
        alert("1. 서버 텍스트 박스 값 >>" +$("[id$='_subject']").val());
        
        //2. 서버 텍스트 박스 값 변경
        $("[id$='_subject']").val("변경"); // 2개다 변경됨 (txt_subject1 변화없음) 
        // _subject2 면 제외댐, 앞은 아무거나 상관없음. 뒤에가 동일한 이름인 모든것을 검색함 ,동일한이름은 배열로저장되어접근가능
        
        //////////////////////////////////////////////////////////////////              
        
        alert("2. 서버 텍스트 박스 값 >>" +$("[id$='_1_TextBox']").val());// _1_TextBox 의값 
        alert("3. 서버 텍스트 박스 값- 배열 1번째값  >>" +$("[id$='_TextBox']").eq(0).val())
        alert("4. 서버 텍스트 박스 값- 배열 2번째값 >>" +$("[id$='_TextBox']").eq(1).val())
        
        //////////////////////////////////////////////////////////////////              
        alert("5. 서버 텍스트 박스 값- 배열 2번째값  >>" +$("[id$='subject']").eq(1).val()) //변경나옴
        alert("6. 서버 텍스트 박스 값- 배열 3번째값>>" +$("[id$='subject']").eq(2).val()) //undefined 나옴 (txt_subject1은 배열로 인식이안됨)
        alert("7. 서버 텍스트 박스 값- 배열 0번째값  >>" +$("[id$='subject']").val() + "=" + $("[id$='subject']").eq(0).val())
        
        var a = $("[id$='subject']");
        alert("배열갯수" + a.length);
        
        // $("#<%=txt_subject.ClientID%>").val();로 작업해도 무방
     }
        </script>
        
</head>
<body>
    <form id="form1" runat="server">

    <asp:Button ID="Button1" OnClientClick="test()"  runat = "server"/>
    s<br />
    <asp:TextBox ID="txt_subject" runat="server"  class="intstyle1" style="width:310px;" ></asp:TextBox>
    <asp:TextBox ID="tx2t_subject" runat="server"  class="intstyle1" style="width:310px;" ></asp:TextBox>
    <asp:TextBox ID="txt_subject1" runat="server"  class="intstyle1" style="width:310px;" Text = "아무변화없음" ></asp:TextBox>
    <br />
    <asp:TextBox ID="_1_TextBox"  runat="server"  class="intstyle1" style="width:310px;" Text = "1" ></asp:TextBox>
    <asp:TextBox ID="_2_TextBox" runat="server"  class="intstyle1" style="width:310px;" Text = "2"></asp:TextBox>
    
    </form>
</body>
</html>

 

'PP > Jquery' 카테고리의 다른 글

[Jquery,CoffeeScript] 모질라 파이어폭스 Ajax. 한글 키 이벤트 처리.  (0) 2012.01.08
jQuery UI 테스트 2  (0) 2012.01.08
jQuery 이벤트 테스트 2  (0) 2012.01.08
jQuery 이벤트 테스트 1  (0) 2012.01.08
jQuery UI 테스트 2  (1) 2012.01.08
posted by 방랑군 2012. 1. 4. 03:12
출처 : http://yyman.tistory.com/232

오늘 새벽에 올린 '[ASP.NET] 웹 서비스 구현 하기(Ajax) - Javascript로 호출 - Hello World'에 이어서 JQuery(JSON)을 이용하여 데이터를 가져오는 방법에 대해 소개하겠습니다.

[보충 자료]

그 전에 앞서 이전에 소개해드린 강좌에서 빠진 내용을 하나 소개하겠습니다.
매개 변수입니다.

function chHelloWorld2() {
WebApplication1.WebService1.HelloWorld2($get("txtName").value, OnSuccess);
}

이 부분에서 $get("txtName").value, OnSuccess가 있습니다.

Web Service에서 실제로 구현된 코드는 아래와 같습니다.

[WebMethod]
public string HelloWorld2(string s1)
{
return "Hello World" + s1;
}

자바 스크립트 부분을 보충하자면 아래와 같이 정의할 수 있겠습니다.
네임스페이스.클래스.함수(매개 변수1, 매개 변수2, …, 매개 변수n, OnSuccess, OnFailure)
(Parameters: ControlId,Method name,Parameter1,Parameter2...n,CallbackMethod)



두 개의 입력을 받아서 출력하려면 웹 서비스를 다음과 같이 수정할 수 있습니다.

[WebMethod]
public string HelloWorld2(string s1, string2)
{
return "Hello World" + s1;
}

물론 클라이언트 부분에서도 수정해줘야 합니다.
Input(HTML 사용자 컨트롤)이 txtName1, txtName2라고 가정합니다.

function chHelloWorld2() {
WebApplication1.WebService1.HelloWorld2($get("txtName1").value, $get("txtName2").value, OnSuccess);
}



본론) JSON을 이용한 데이터 받기



위의 예제처럼 Alert을 이용하여 출력하는 예제입니다.

1. 솔루션 구성



WebService1.asmx과 index.aspx은 Visual Studio에서 생성할 수 있지만, 나머지 이상한 파일들은 별도로 내려받아야 합니다.


Jquery 홈페이지(http://www.jquery.com)에서 내려받으실 수 있습니다. 귀찮으신 분들은 첨부된 파일을 내려받으시면 됩니다.

2. WebService1.asmx 설정 하기

[WebService1.asmx.cs]


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
namespace WebApplication1
{
/// <summary>
/// WebService1의 요약 설명입니다.
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// ASP.NET AJAX를 사용하여 스크립트에서 이 웹 서비스를 호출하려면 다음 줄의 주석 처리를 제거합니다.
[System.Web.Script.Services.ScriptService]
public class WebService1 : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld3(string s1, string s2)
{
return s1 + " " + s2;
}
}
}


[WebService1.asmx]

<%@ WebService Language="C#" CodeBehind="WebService1.asmx.cs" Class="WebApplication1.WebService1" %>

3. Index.aspx 파일 설정 하기

[index.aspx]


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="WebApplication1.index" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="js/jquery-1.4.4.min.js" type="text/javascript">
</script>
<script src="js/jquery-ui-1.8.8.custom.min.js" type="text/javascript">
</script>

<script language="javascript" type="text/javascript">
function HelloQuery() {
$.ajax({
type: "POST",
url: "
http://localhost:50000/WebService1.asmx/HelloWorld3",
data: '{"s1":"' + $get("txtName1").value + '", "s2":"' + $get("txtName2").value + '"}',
processData: false,
contentType: "Application/json; charset=utf-8",
dataType: "json",
success: function (data) {
alert(data.d);
}
});
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input name="txtName1" id="txtName1" type="text" />
<input name="txtName2" id="txtName2" type="text" />
<a href="#" onclick="HelloQuery()">TEST</a>
</div>
<asp:ScriptManager runat="server">
<Services>
<asp:ServiceReference Path="~/WebService1.asmx" />
</Services>
</asp:ScriptManager>
</form>
</body>
</html>

http://localhost:50000/WebService1.asmx/HelloWorld3

선언된 파일의 주소를 모르시면 본인이 만드신 ASMX파일을 접속하셔서 확인하셔도 됩니다.

* 구문 확대해서 살펴보기

data: '{"s1":"' + $get("txtName1").value + '", "s2":"' + $get("txtName2").value + '"}',


data : ' { " 매개변수1 " : " ' + $get("클라이언트 input name 값").value + ' " ,
" 매개변수2 " : " ' + $get("클라이언트 input name 값").value + ' " ,


" 매개변수n " : " ' + $get("클라이언트 input name 값").value + ' " } '


ex) 매개 변수가 하나일 때

data:'{"s1":"' + $get("클라이언트 input name 값").value + '"}'



사용자 환경에 맞게 적절히 연구하시어 잘 사용하시기 바라는 마음으로 글을 정리해봅니다.
글을 정리하면서 느낀 것은 Visual Studio.NET에 맞게 설계된 것과 공개 소스에 맞게 설계된 것의 차이는 엄청난 자본의 투입으로 말미암아 편리한 것이지만, 한 소프트웨어 환경에서 구현해야만 하는 불편한 점이 있습니다.
이식성은 Jquery 아저씨가 확실히 좋습니다.
아무쪼록 Jquery를 활용하는 것과 웹 서비스의 Hello World 강좌를 이것으로 정리합니다.



참고 자료) http://alexandershapovalov.com/how-to-call-wcf-services-from-javascript-jquery-and-aspnet-ajax-39/ 
posted by 방랑군 2012. 1. 4. 02:57
출처 :  http://blog.naver.com/websiteman?Redirect=Log&logNo=40132506449

문제점 :

페이스북처럼 ajax를 이용한 실시간 파일 업로드를 구현하고 싶다.

jQuery Plugin을 이용해서 파일업로드 및 멀티 파일 업로드를 구현해 보자.

 

 

해결방법 :

1. 첨부파일을 다운받아 설치한다.

  - demo2.php (기본데모)

  - demo.php (기본데모 + 멀티파일 업로드)

 

2. 설치하고 접속해 보자.

<demo2.php>

 

<demo.php>

 

3. 파일 업로드를 하게 되면 파일은 uploads 디렉토리에 쌓이는데 설정에 의해 위치를 바꿀 수 있다.

 

4. 소스는 아주 간단하다. 나머지는 Plugin에서 처리한다.

  - 옵션을 추가하거나 변경하여 필요한데로 custmizing해서 사용하면 되겠다.

<script type="text/javascript">
$(document).ready(function() {
  $('#file_upload').uploadify({
    'uploader'  : 'uploadify.swf',
    'script'    : 'uploadify.php',
    'cancelImg' : 'cancel.png',
    'folder'    : 'uploads',
    'auto'      : true
  });
});
</script>

 

논의 :

1. Uploadify라는 Plugin을 활용한다.

  - 홈페이지 : http://www.uploadify.com/

  - jQuery, php, 플래시(swf)를 이용하여 멀티파일 선택 기능 등을 제공하고 있다.

2. 추가적인 설정 사항에 관해서는 documentation 페이지를 참조하자.

  - http://www.uploadify.com/documentation/

  - Options, Methods, Events 등 다양한 설정을 통해 원하는 데로 파일 업로드를 만들수 있다.

 

'PP > Upload' 카테고리의 다른 글

uploadify  (0) 2012.01.06
posted by 방랑군 2012. 1. 4. 02:45

출처 : http://blog.naver.com/saltynut/

Generic

 

드디어 C#과 VB.NET에 Generic이 적용되었습니다!  '드디어'라고 하니 마치 대단한 것처럼 생각이 되지만, 사실 C++ 프로그래머들이 템플릿 기능이 없다는 것으로 하도 난리법석(?)을 떤 탓에..

우선 Generic이 대체 어디에 쓰는 물건인지부터 알아봐야겠죠?

가장 간단하게, 유식하게 말하자면.. 'Type independent한 코드를 작성하게 해준다'라는 것입니다.

무슨 말인가 하면.. 통상 개발을 하다보면.. 특히 라이브러리 같은 것을 작성하다보면..

여러 타입을 지정할 수 있도록 필드, 파라미터, 리턴 타입 등을 object로 쓰는 경우가 많습니다.

예를 들면 다음과 같습니다.

 

using System.Collections;

 
// Employees 개체를 담을 Stack
Stack employees = new Stack();
// Push 메서드의 매개변수는 object 형이므로, 암시적 형 변환이 일어남
employees.Push( new Employee() );
// Pop 메서드의 리턴 타입은 object 형이므로, 명시적 형 변환을 해야 함
Employee employee = (Employee) employees.Pop();
 
뭐, 위 경우야 일단 별다른 문제가 있는 것은 아닙니다. 하지만 다음 코드는 좀 심각하지요.
 
// Integer를 담을 Stack
Stack sizes = new Stack();
// Box
sizes.Push( 42 );
// Unbox
int size1 = (int) sizes.Pop();
// Integer만 들어가야 하지만.. 어쨌든 컴파일 시는 OK
sizes.Push( 77 );
sizes.Push( new Employee() );
// 역시 컴파일은 되지만, Pop 시키는 것이 Employee 형일 경우..
// InvalidCastException이 발생한다.
int size2 = (int) sizes.Pop();
 
으음.. 이건 문제가 좀 있지요?
이런 경우에 발생가능한 문제점, 단점들에 대해서 정리해보자면..
* 컴파일 시에 타입 체킹이 불가능하므로, 임의의 타입을 집어넣어도 확인할 길이 없습니다.
* value type을 사용할 때, 박싱, 언박싱이 일어납니다.
* ref type일 때도, 런타임 타입 체킹이 계속 일어나며, 형 변환이 필요하므로 오버헤드가 생깁니다.
 
Generic은 이런 문제점을 해결하기 위해 나온 녀석입니다. 백문이 불여일견이라고, 위의 코드를 Generic을 적용해 보도록 하겠습니다.
 
using System.Collections.Generic;
 
Stack< Employee > employees = new Stack< Employee >();
 
// Push 메서드 매개변수가 Employee 형이므로, 형 변환이 필요없음
employees.Push( new Employee() );
// Pop 메서드가 Employee 형을 리턴하므로, 형 변환이 필요없음
Employee employee = employees.Pop();
 
흐음.. 뭔가 좀 좋아진 것 같지요?
아까 좀 심각하다고 했던 코드는 어떻게 되는지 봅시다.
 
Stack< int > sizes = new Stack< int >();
// No boxing
sizes.Push( 42 );
// No unboxing
int size1 = sizes.Pop();
sizes.Push( 77 );
// 아래 코드는 컴파일 시 에러가 발생한다. 
sizes.Push( new Employee() );
// 이제 안심하고 써도 됨 (리턴 타입이 항상 int일테니..)
int size2 = sizes.Pop();
 
자.. 보다시피 < > 안에 특정 타입을 지정해서 코드 템플릿을 만들 수 있게 해줍니다.
그렇게 해서, 특정한 타입만이 사용되도록 보장해주는 것이죠.
이 기능은 C++에서는 템플릿이라고 불리며, Eiffel, Ada와 같은 다른 언어들에서는 Generic이라 불립니다. (대세를 따라서 C#, VB.NET은 후자를 택한 것 같네요.)
Generic은 클래스, 구조체, 인터페이스, 메서드, 대리자(delegate) 등 다양하게 만들 수 있습니다.
 
Generic 사용 시의 장점은..
* 컴파일 타입 체킹을 좀 더 빡세게(?) 수행할 수 있습니다.
* 불필요한 런타임 타입 체킹, 박싱, 언박싱을 줄일 수 있습니다.
* 명시적으로 형 변환을 하지 않아도 됩니다.
* 좀 더 깔끔하고, 빠르고, 안전한 코드를 작성할 수 있습니다.
 
장점을 좀 더 팍팍 와 닿게 하기 위해서.. 다음 그림을 통해 비교해 보죠.
 
왼쪽의 Generic을 사용하지 않은 경우와 오른쪽의 사용하는 경우를 볼 때 어느게 더 복잡해 보이는지요? Generic을 사용하는 것이 훨씬 더 깔끔하다는 것을 알 수 있습니다.
 
자, 그러면 이렇게 Generic을 지원하는 클래스는 어떻게 작성할까요? 예를 들어, 위의 스타일처럼 지원하도록 MyStack이라는 클래스를 작성해보도록 하겠습니다.
 
// Generic MyStack 클래스
public class MyStack< T >
{
   private T[] frames;
   private int pointer = 0;
   public MyStack( int size )
   {
      frames = new T[ size ];
   }
   public void Push( T frame )
   {
      frames[ pointer++ ] =
         frame;
   }
 
   public T Pop()
   {
      return
         frames[ --pointer ];
   }
}
 
대충 감이 잡히시겠지만, 클래스 명 뒤에 < >를 붙이고.. 그 안에 T라고 썼습니다.
이 T는 임의의 템플릿 타입 파라미터(Template Type Parameter)이므로, 이름은 무엇으로 변경해도 상관없습니다. 클래스 내의 메서드 구현 시 T를 사용하고 있는 것에 주의하시기 바랍니다.
 
아래는 위 클래스를 사용하는 예제입니다.
 
// 사용 예제
MyStack< int > s = new MyStack< int >( 7 );
 
// 0~6까지를 Stack에 집어넣음
for ( int f = 0; f < 7; ++f )
   s.Push( f );
 
// '6 5 4 3 2 1 0 ' 을 출력
for ( int f = 0; f < 7; ++f )
   Console.Write( s.Pop() + " " );
아참.. VB.NET에서는 어떻게 하냐구요? 다음과 같이 (Of T) 형태의 구문을 사용합니다.
 
' Generic MyStack 클래스
Public Class MyStack(Of T)
   Private frames As T()
   Private pointer As Integer = 0
 
   Public Sub New( ByVal size As Integer)
      frames = New T(size) {}
   End Sub
 
   Public Sub Push( ByVal frame As T)
      frames(pointer) = frame
      pointer += 1
   End Sub
 
   Public Function Pop() As T
      pointer -= 1
      Return frames(pointer)
   End Function
End Class
 
' 사용 예제
Dim s As New MyStack(Of Integer)(7)
 
' 0~6까지를 Stack에 집어넣음
For f As Integer = 0 To 6
   s.Push(f)
Next f
 
' '6 5 4 3 2 1 0 ' 을 출력
For f As Integer = 0 To 6
   Console.Write( s.Pop().ToString())
Next f
자.. 그러면 위의 템플릿 타입 파라미터.. T를 아무 타입이나 못하게 제약을 걸 수는 없을까요?
물론 가능합니다. Generic에서는 where  키워드를 사용하여 다음 3가지 유형의 제약 조건을 걸 수 있습니다.
* Class 제약 : 타입이 특정 베이스 클래스로부터 상속된 것이어야 함
* Interface 제약 : 타입이 특정 인터페이스를 구현한 것이어야 함
* 생성자 제약 : 타입이 public 기본 생성자를 가져야 함
 
이러한 제약 조건을 걸도록 작성한 Generic 클래스는 다음과 같습니다.
 
class MyList< K, V >
   where K : IComparable, IFormattable
   where V : ValueBase, new()
{
   // ...
}
 
K는 IComparable, IFormattable 인터페이스를 구현한 것이어야 하며..
V는 ValueBase로부터 상속받고, public 기본 생성자가 있는 것이야 합니다.
그럼 MyList를 사용하는 예제를 보죠.
 
// ValueBase 클래스
class ValueBase {}
 
// Widget 클래스 : ValueBase를 상속
class Widget : ValueBase {}
 
// Thing 클래스 : ValueBase를 상속하며, public 기본 생성자가 없음
class Thing : ValueBase
{
   public Thing( int i ) {}
}
 
// OK
MyList<int, Widget> list1 = new MyList<int, Widget>();
 
// Error : string은 ValueBase로부터 상속되지 않음 
MyList<int, string> list2 = new MyList<int, string>();
 
// Error : Thing은 ValueBase로부터 상속되지만, public 기본 생성자가 없음
MyList<int, Thing> list3 = new MyList<int, Thing>();
 
// Error : Point는 IComparable, IFormattable 인터페이스를 구현하지 않음
MyList<Point, Widget> list4 = new MyList<Point,Widget>();
 
위에서 볼 수 있듯이, 제약조건을 사용하면..
* 타입이 필요한 기능을 가졌는지를 보장하고,
* 보다 강력한 컴파일 타임 타입 체킹을 할 수 있으며,
* 명시적 형변환을 줄일 수 있고,
* generic의 사용을 제한하는 효과를 가집니다.
 
지금까지 Generic에 대해서 살펴보았습니다.
어떤가요? 유용할 것 같나요?
뭐, 정답은.. 만드는 사람은 귀찮고, 쓰는 사람은 편하고.. ^^
그럼 나머지 언어 상의 변경사항은 다음에 또 알아보겠습니다.
posted by 방랑군 2012. 1. 4. 02:43
출처: http://blog.naver.com/PostView.nhn?blogId=kimgas2000&logNo=90132135285


jQuery.ajax (options)

HTTP 통신에서 페이지를로드합니다. 이 함수는 jQuery의 AJAX 통신의 기본 부분에서 실제로 $. get및 $. post 같은 함수를 사용하는 것이 쉽게 구현할 수 있습니다. 그러나 이러한 추상화된 함수는 구현의 용이성과 교환에 오류시 콜백과 같은 복잡한 기능을 잃고 있습니다. 그런 처리를 구현하려면, 역시 핵심이다이 함수를 사용해야합니다. $. ajax 함수는 반환값으로 XMLHttpRequest 객체를 반환합니다. 대부분의 경우이 개체를 직접 조작하는 것은 없다고 생각되지만, 예를 들어 던져 버린 요청을 중단하는 경우 등, 필요하면 이용하십시오. 이 함수는 인수를 하나만 취하지만, 실제로는 해시에서 키 - 값 조합은 많은 옵션을받습니다. 다음에 그 목록을 싣고 있으므로 참고하시기 바랍니다.


async / boolean
비동기 통신 플래그. 기본값은 true (비동기 통신)에서 요청이 던져에서 응답할 때까지 사용자 에이전트는 비동기 처리를 계속합니다. false로 설정 (동기 통신)하면 통신에 응답이있을 때까지 브라우저는 잠겨 조작을 받아들이지 않을 것을주의하십시오.
beforeSend / function
AJAX에 의해 요청이 전송되기 전에 불리는 Ajax Event 입니다. 반환값을 false로 설정하면 AJAX 전송을 취소할 수 있습니다.
function (XMLHttpRequest) { 
this / / AJAX 전송 설정 옵션을 나타내는 개체
}
cache / boolean
jQuery 1.2. 초기값은 일반적으로 true이지만 dataType이 script의 경우에는 false입니다. 통신 결과를 캐시하지 않으에는 false로 설정하십시오.
complete / function
AJAX 통신 완료될 때 호출되는 함수입니다. success이나 error가 호출된 후에 호출되는 Ajax Event 입니다.
function (XMLHttpRequest, textStatus) { 
this / / AJAX 전송 설정 옵션을 나타내는 개체
}
contentType / string
서버에 데이터를 보낼 때 사용 content - type 헤더의 값입니다. 기본값은 "application / x - www - form - urlencoded"대부분의 경우이 설정으로 문제 없을 것입니다.
data / object, string
서버로 전송하는 값. 개체가 지정된 경우 쿼리 문자열로 변환되고 GET 요청으로 추가됩니다. 이 변환 처리에 대해서는, 후술하는 processData를 참조하십시오. 객체는 키와 값의 조합해야하지만, 만약 값이 배열이라면, jQuery는 같은 키를 가지는 여러 값으로 serialize합니다. 예를 들어 {foo : "bar1", "bar2"]}와 같이 지정된 경우, & foo = bar1 & foo = bar2처럼 조립할 수 있습니다.
dataFilter / function
기본 수준에서 XMLHttpRequest의 반환 데이터를 필터링합니다. 서버 로부터의 반환값을 청소하는 경우 등에 유용합니다. 함수는 첫번째 인수에 원시 데이터를 제 2 인수 dataType 값을받습니다. 필터링된 값을 반환 값으로 반환하십시오.
function (data, type) { 
/ / 필터링
/ / 마지막으로 청소 후에 데이터를 반환
return data;
}
dataType / string
서버에서 반환되는 데이터 형식을 지정합니다. 생략했을 경우는, jQuery이 MIME 타입 등을 보면서 자동으로 결정합니다. 지정 가능한 값은 다음과 같은 것입니다.
  • "xml": XML 문서
  • "html": HTML을 텍스트 데이터로. 여기에 script 태그가 포함된 경우 처리가 실행됩니다.
  • "script": JavaScript 코드를 텍스트 데이터로. cache 옵션 특히 지정이 없으면 캐시가 자동으로 비활성화됩니다. 원격 도메인에 대한 요청의 경우 POST는 GET으로 변환됩니다.
  • "json": JSON 형식 데이터로 평가하고 JavaScript의 개체로 변환합니다.
  • "jsonp": JSONP로 요청을 부르고 callback 매개 변수에 지정된 함수 회수 값을 JSON 데이터로 처리합니다. (jQuery 1.2 추가)
  • "text": 일반 텍스트.
dataType을 지정할 때는 몇 가지 가리키는 할 점이 있습니다. 아래의주의 1,2를 참조하십시오.
error / function
통신에 실패했을 때 호출되는 Ajax Event 입니다. 인수는 3 개로 차례 XMLHttpRequest 개체 오류 내용, 추가적인 예외 개체를받습니다. 제 2 인수에는 "timeout", "error", "notmodified" "parsererror"등이 돌아갑니다.
function (XMLHttpRequest, textStatus, errorThrown) { 
/ / 보통은 여기서 textStatus 및 errorThrown 값을보고 처리를 분리하거나
/ / 단순히 통신에 실패했을 때의 처리를 기술합니다.
this / / this는 다른 콜백 함수 마찬가지로 AJAX 통신할 때 옵션을 나타냅니다.
}
global / boolean
Ajax Events의 Global Events을 실행할지 여부를 지정합니다. 일반적으로 true이지만, 특별한 통신 false 수도 있습니다. 자세한 내용은 Ajax Events 를 참조하십시오.
ifModified / boolean
서버의 응답에 Last - Modified 헤더를보고, 전회 통신에서 변경이있는 경우에만 성공 상태를 반환합니다.
jsonp / string
jsonp 요청을 할 때 callback이 아닌 매개 변수이면 지정합니다. 예를 들어 {jsonp : 'onJsonPLoad'}로 지정하면 실제 요청은 onJsonPLoad = 함수 이름이 부여됩니다.
password / string
인증이 필요한 HTTP 통신시 암호를 지정합니다.
processData / boolean
data 지정한 개체를 쿼리 문자열로 변환할지 여부를 설정합니다. 기본값은 true로, 자동으로 "application / x - www - form - urlencoded"형식으로 변환합니다. DOMDocument 자체 등의 다른 형식으로 데이터를 보내기 위하여 자동 변환하고 싶지 않은 경우는 false를 지정합니다.
scriptCharset / string
스크립트를 로드할 때의 캐릭터 세트를 지정합니다. dataType이 "jsonp"혹은 "script"에서 실행되는 페이지와 호출하는 서버측의 캐릭터 세트가 다른 경우에만 지정해야합니다.
success / function
AJAX 통신이 성공하면 호출되는 Ajax Event 입니다. 돌아온 데이터와 dataType 지정한 값 2 개의 인수를받습니다.
function (data, dataType) { 
/ / data의 값을 사용하여 통신 성공시 처리를 기술합니다.
this / / this는 AJAX 전송시 설정한 옵션
}
timeout / number
제한 시간 (밀리초)을 설정합니다. $. ajaxSetup 에서 지정한 값을 통신에 따라 개별적으로 덮어쓸 수 있습니다.
type / string
"POST"또는 "GET"을 지정하여 HTTP 통신의 종류를 설정합니다. 기본값은 "GET"입니다.RESTful에 "PUT"또는 "DELETE"를 지정할 수 있지만 모든 브라우저가 지원하는 것은 아니기 때문에주의가 필요합니다.
url / string
요청을 보낼 대상 URL입니다. 기본값은 호출 페이지에 보냅니다.
username / string
인증이 필요한 HTTP 통신시 사용자 이름을 지정합니다.
xhr / function
XMLHttpRequest 객체가 생성되었을 때 호출되는 콜백 함수입니다. 이 함수는 예를 들면 IE에서 XMLHttpRequest 아니라 ActiveXObject가 만들어진 때라고합니다. 만약 특정 사이트의 XMLHttpRequest 개체의 확장과 인스턴스 관리 팩토리를 가지고있는 경우에는이 함수 생성물을 덮어쓸 수 있습니다. jQuery1.2.6 이전에서는 사용할 수 없습니다.

※주의 1 
dataType 옵션을 사용하는 경우 서버에서 응답이 올바른 MIME 타입을 반환하는지 확인하십시오. 
만약 MIME 타입과 지정된 dataType에 불일치가있는 경우, 예기치 않은 문제가 발생할 수 있습니다. 
자세한 내용은 
Specifying the Data Type for AJAX Requests (영어) 를 참조하십시오. ※주의 2dataType에 "script"을 지정하여 다른 도메인에 전송하는 경우 POST를 지정해서 요청은 GET 자동으로 변환됩니다. jQuery 1.2에서는 다른 도메인에서도 JSONP를 사용하여 JSON 데이터를 검색할 수있는 옵션이 붙었습니다. JSONP를 제공하는 서버가 "url? callback = function"와 같은 형태로 요청을받는 경우에는, jQuery가 자동으로 function을 사용하여 JSON 데이터를받습니다. 또한 매개 변수가 callback이 아닌 경우 jsonp 옵션 매개 변수 이름을 지정하여 마찬가지로 처리할 수 있습니다.

샘플
샘플 1
JavaScript 파일을 읽고 실행합니다.
$. ajax ({type : "GET", url : "test.js"dataType : "script"});
서버에 데이터를 저장하고 처리가 완료된 것을 사용자에게 알려줍니다.
$. ajax ({type : "POST", url : "some.php"data : "name = John & location = Boston", success : function (msg) {alert ( "Data Saved :"+ msg);}}) ;
HTML 페이지의 최신 버전을 가져옵니다.
$. ajax ({url : "test.html", cache : false, success : function (html) {$ ( "# results"). append (html);}});
동기 통신에서 데이터를 읽습니다. 
통신 중에 브라우저가 잠겨 있기 때문에 어떤 방식으로 통신중인 사용자 작업을 방해 궁리를해야 할 것입니다.
var html = $. ajax ({url : "some.php"async : false}). responseText;
XML 형식의 문서를 데이터로 보냅니다. 
processData 옵션을 false로 설정하여 데이터를 문자열로 자동 변환되는 것을 피할 수 있습니다.
var xmlDocument = create xml document]; $. ajax ({url : "page.php"processData : false, data : xmlDocument, success : handleResponse});

우리가 작성한 예제 :

$(function() {
$("#btn1").click(function() {
var name= $("#name").val();
var age = $("#age").val();
var url = "test5_ok.jsp";
var params = "name=" + name + "&age=" + age + "&nickName=수요일";
$.ajax({
type : "POST", // "POST"또는 "GET"을 지정하여 HTTP 통신의 종류를 설정. default는 "GET"
url:url,
data:params, // 서버로 전송하는 값
dataType:'xml', // 기본 text -> 서버에서 반환되는 데이터 형식을 지정. html, xml, text, script, json, jsonp 가 있음
success:function(args) { // AJAX 통신이 성공하면 호출되는 Ajax Event 
$(args).find("status").each(function() {
var status = $(this).text();
alert(status);
});

var str = "";
$(args).find("records").each(function() { // 태그명이 records 인 것들 중에 해당하는 것들을 불러옴
var records = $(this);
var id = records.attr("id"); // 속성명이 id
var name = records.find("name").text(); // 태그명이 name 인 것의 text를 가져옴
var age = records.find("age").text(); // 태그명이 name 인 것의 text를 가져옴
var nickName = records.find("nickName").text(); // 위와 동일

str += "id="+ id +", name=" + name + ", age=" + age + ", nickName=" + nickName + "<br/>"; 
});
$("#result").html(str); // id명이 result 인 것에 위에서 반복문으로 받은 것들을 html형식으로 찍는다.
},
beforeSend:showRequest, // AJAX에 의해 요청이 전송되기 전에 불리는 Ajax Event 
error:function(e) { // 통신에 실패했을 때 호출되는 Ajax Event 
alert(e.responseText);
}
});
});

$("#btn2").click(function() {
$("#result").empty();
});
});

function showRequest(args) { // 리턴 값이 true 일경우만 전송, false이면 전송 취소
if(!$("#name").val()) {
alert("이름을 입력하세요 !!!");
return false;
}
if(!$("#age").val()) {
alert("나이를 입력하세요 !!!");
return false;
}
return true;
}

[출처] Jquery ajax 정리|작성자 kimgas2000

 
posted by 방랑군 2011. 12. 27. 22:59

출처 : http://cafe.naver.com/sharedtalk.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=281&
 


SAP Rfc Function 
호출을 위한 SAP .NET Connector3.0 오류 Trouble Shooting

 

2011-11-11

 

상태

ASP.NET 프로그램에서 SAP 의 로그인 체크 function 을 호출하여 현재 해당 클라이언트의 로그인 정보를 리턴 받는 로직을 구현하였습니다.

SAP .NET Connector3.0 이 나온지 얼마 되지 않았고로직 구현 방법도 크게 바뀌었다고 들었습니다최대한 간단하고 쉽게 말이죠.  .NET Connector 2.0 의 많은 한계를 극복한 버전이라고 하여 영문으로 된 매뉴얼을 열심히 읽어가며 구현하게 되었습니다.

 개발환경은 아래와 같습니다.

OS :

Windows Server 2008 (x64)

IIS :

IIS 7 (Version 6)

.NET Framework :

3.5

.NET Connector :

Nco 3.0

development tool :

VisualStudio 2005

SAP :

SAP GUI 7.20

 

 

Figure 1 어플리케이션 단 프로그램

 

l  Figure 1 :

n  Tutorial.cs  à main() 로직

n  AbapConnectorClient.cs à SAP Rfc Function 호출하여 로그인 정보 체크 로직

n  App.config à Rfc Function 호출할 SAP 클라이언트 정보

 

콘솔 응용프로그래밍 입니다. Rfc 호출 잘 됩니다^^

 

Figure 2 웹 사이트 프로젝트

l  Figure 2 :

n  MultiLoginTest.cs  à SAP Rfc Function 호출하여 로그인 정보 체크 로직(어플리케이션 단 로직과 거의 같음), 결과 정보MultiLoginTest.aspx 로 넘겨줌

n  MultiLoginTest.aspx à 파라미터 정보 받아서 웹 화면에 띄어줌

n  web.config à Rfc Function 호출할 SAP 클라이언트 정보 및 Web configuration 정보

 

 

Figure 3 운영서버에 적용할 때 Bin폴더 안에 라이브러리 파일 삽입

 

현상

응용프로그래밍 프로젝트즉 어플리케이션 단 RFC 프로그래밍 시 정상

그러나.......

웹 사이트 프로젝트 프로그래밍으로 RFC 호출 시 에러à 아래와 같은 오류

 

Figure 4 오류 화면

 

-       Invoke() 부분에서 오류 발생.

-       바인딩 오류라 생각하여 이놈이 필요한 dll파일들을 못찾아서 나는건가 싶어서 --> Web.config 설정 여러 번 변경 해봄…. 그래도 오류 발생

-       구글링 해본 결과 .NET Framework4.0 으로 업그레이드 하라고 함 à 운영상 리스크때문에 보류

 

결국…SAP 에 Customer Message 보내어 해결책 얻음.

 

원인

.NET Connector3.0 (3.0.3.0) release 버전의 버그 문제

 

솔루션

 

119일 Release 된 .NET Connector3.0 버그 패치 버전 (3.0.5.0) 으로 다시 설치 및 dll 파일 복사 후 적용

 

 

 

 

 

한달간의 삽질이 버그 문제로 판명이 되었습니다^.^

 

이전 버전으로 고생하고 계신 분들이 있을 까봐 공유합니다.

장원철님 도움주셔서 감사합니다.

앞으로도 도움 주고받으면서 지냈으면 좋겠습니다.

 

 

여기에 올려도 되는지 모르겠습니다.

원하시는데 옮겨주시면 감사하겠습니다^^

 

posted by 방랑군 2010. 4. 21. 17:49

 현재 내가 겪는 상황을 잘 표현한 말....


“우리는 지금보다 더 열심히 일할 수 없습니다. 더 이상 투자할 자원도 없습니다. 이제는 열심히 일할 방법보다 더 현명하게 일할 방법을 찾아야 합니다”

지난 3일(현지시각)부터 미국 라스베이거스에서 개최되고 있는 ‘IBM 임팩트 2009’에서 IBM 소프트웨어 그룹 웹스피어 사업부 스티브 마일스 부사장은 ‘현명하게 일하는 방법’을 강조해 주목을 끌었다.

'방랑이의 생활' 카테고리의 다른 글

하우스시즌6-17편 : 명 에피소드....  (0) 2010.04.16
나의 철학 성향  (0) 2010.02.17
posted by 방랑군 2010. 4. 16. 18:02


 정말 많은 걸 궁금증을 풀어준 에피소드...

'방랑이의 생활' 카테고리의 다른 글

“현명하게 일하는 방법을 찾아라”  (0) 2010.04.21
나의 철학 성향  (0) 2010.02.17
posted by 방랑군 2010. 4. 1. 13:04

'건강 > 가십' 카테고리의 다른 글

법정스님이 남긴 주요 어록  (0) 2010.03.12
posted by 방랑군 2010. 3. 26. 09:49
MS
BizTalk Server Developer Center

참고 사이트 : http://msdn.microsoft.com/en-us/library/ms946383.aspx




I've exposed quite a lot of my orchestrations as web services; while doing that I faced numerous problems sojust thought of summarizing all possible resolutions techniques here
1. SOAP Port not created
2. All properties required for correlation are not promoted; so uninstall assembly are redeploy it
3. SOAP Port created is not bound to orchestration
4. Web service is using anonymous access; remove this anonymous access; keep only windows authentication
5. User account for web service application pool doesn't have access to %temp% folder
6. User account for web service application pool is not member of IIS_WPG group
7. Client to this web service is sending credentials
8. Do iisreset once to ensure all changes are reflected
9. User account for Isolated host has enough rights to access SQL server
10. If you are using Http and SOAP adapters both then create seperate instances of isolated hosts for them

11. Changing receive location pipeline to XML receive pipeline from default passthru pipeline

12. Finally check event log for more information 

posted by 방랑군 2010. 3. 12. 13:01

DDL(Data Definition Language) 은 데이터베이스의 스키마 객체를 생성(CREATE),

 

변경(ALTER), 제거(DROP) 하거나 권한의 부여나 박탈(GRANT, REVOKE), 주석(COMMENT),

 

자료의 버림(TRUNCATE) 등을 수행하는 문장의 집단을 의미한다.

 

각 문장은 CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE, COMMENT 등으로 시작한다.

 

이 밖에도 많은 종류의 DDL이 존재한다. 그러나 PL/SQL 블록에서는 DDL을 사용할 수 없다.

 

 

DML(Data Manipulation Language)은 스키마 객체의 데이터를 입력(INSERT), 수정(UPDATE),

[Manipulation=교묘한처리,조종]

 

조회(SELECT), 삭제(DELETE)하거나 테이블에 잠금을 설정하거나 (LOCK TABLE), SQL문의

 

처리의 절차에 대한 정보를 얻거나 (EXPLAIN PLAN), PL/SQL 모듈을 호출하는 작업(CALL)의 집단이다.

 

각 문장은 INSERT, UPDATE, DELETE, SELECT, LOCK TABLE, EXPLAIN PLAN, CALL 등으로 시작된다.

 

PL/SQL의 모듈에서 사용할 수 없는 DML로서는 EXPLAIN PLAN과 CALL이 있다.

 

DCL(Data Control Language)은 트랜잭션의 성격을 제어하는 것으로서 SET TRANSACTION,

 

COMMIT, ROLLBACK, SAVEPOINT와 같은 종류가 있다.

 

PL/SQL 모듈에서는 DCL을 사용할 수 있고 DCL을 이용하여 모듈의 트랜잭션을 제어 할 수 있다.

 

 

발췌 about Oracle 9i PL/SQL  p156   저자 이태윤

posted by 방랑군 2010. 3. 12. 08:32

(서울=연합뉴스) 고미혜 기자 = 11일 입적한 법정스님은 '무소유', '산에는 꽃이 피네' 등 여러 권의 산문집과 법문을 통해 지친 사람들을 위로하고 깨달음을 전하는 주옥같은 말을 남겼다.

특히 "무소유란 아무것도 갖지 않는다는 것이 아니라 불필요한 것을 갖지 않는다는 뜻이다. 우리가 선택한 맑은 가난은 부보다 훨씬 값지고 고귀한 것이다"라는 말은 스님이 설파하던 '무소유'의 정신을 압축한다.

1997년 길상사 창건 당시 "길상사가 가난한 절이 되었으면 합니다"로 시작하는 창건 법문도 이러한 무소유 정신과 맞물려 널리 회자됐다.

그런가 하면 말년인 지난 2008년 낸 산문집 '아름다운 마무리'에서는 "아름다운 마무리는 끝이 아니라 새로운 시작"이라며 마지막 모습까지 귀감이 되기도 했다

다음은 법정스님의 주요 어록. 

▲우리는 필요에 의해서 물건을 갖지만, 때로는 그 물건 때문에 마음을 쓰게 된다. 따라서 무엇인가를 갖는다는 것은 다른 한편 무엇인가에 얽매이는 것, 그러므로 많이 갖고 있다는 것은 그만큼 많이 얽혀 있다는 뜻이다.('무소유' 중)

▲우리 곁에서 꽃이 피어난다는 것은 얼마나 놀라운 생명의 신비인가. 곱고 향기로운 우주가 문을 열고 있는 것이다. 잠잠하던 숲에서 새들이 맑은 목청으로 노래하는 것은 우리들 삶에 물기를 보태주는 가락이다.('산방한담' 중)

▲빈 마음, 그것을 무심이라고 한다. 빈 마음이 곧 우리들의 본 마음이다. 무엇인가 채워져 있으면 본 마음이 아니다. 텅 비우고 있어야 거기 울림이 있다. 울림이 있어야 삶이 신선하고 활기 있는 것이다. ('물소리 바람소리' 중)

▲삶은 소유물이 아니라 순간순간의 있음이다. 영원한 것이 어디 있는가. 모두가 한때일 뿐, 그러나 그 한때를 최선을 다해 최대한으로 살 수 있어야 한다. 삶은 놀라운 신비요, 아름다움이다.('버리고 떠나기' 중)

▲사람은 본질적으로 홀로일 수밖에 없는 존재다. 홀로 사는 사람들은 진흙에 더럽혀지지 않는 연꽃처럼 살려고 한다. 홀로 있다는 것은 물들지 않고 순진무구하고 자유롭고 전체적이고 부서지지 않음이다.('홀로 사는 즐거움' 중)

▲무소유란 아무것도 갖지 않는다는 것이 아니라 불필요한 것을 갖지 않는다는 뜻이다. 우리가 선택한 맑은 가난은 부보다 훨씬 값지고 고귀한 것이다.('산에는 꽃이 피네' 중)

▲나는 누구인가. 스스로 물으라. 자신의 속얼굴이 드러나 보일 때까지 묻고 묻고 물어야 한다. 건성으로 묻지 말고 목소리 속의 목소리로 귀속의 귀에 대고 간절하게 물어야 한다. 해답은 그 물음 속에 있다.('산에는 꽃이 피네' 중)

▲내 소망은 단순하게 사는 일이다. 그리고 평범하게 사는 일이다. 느낌과 의지대로 자연스럽게 살고 싶다. 그 누구도, 내 삶을 대신해서 살아줄 수 없다. 나는 나답게 살고 싶다. ('오두막 편지' 중)

▲우리가 지금 이 순간 전 존재를 기울여 누군가를 사랑하고 있다면 이 다음에는 더욱 많은 이웃들을 사랑할 수 있다. 다음 순간은 지금 이 순간에서 태어나기 때문이다. 지금이 바로 이때이지 시절이 따로 있는 것이 아니다. ('봄여름가을겨울' 중)

▲길상사가 가난한 절이 되었으면 합니다. 요즘은 어떤 절이나 교회를 물을 것 없이 신앙인의 분수를 망각한 채 호사스럽게 치장하고 흥청거리는 것이 이 시대의 유행처럼 되고 있는 현실입니다. 풍요 속에서는 사람이 병들기 쉽지만 맑은 가난은 우리에게 마음의 평화를 이루게 하고 올바른 정신을 지니게 합니다. 이 길상사가 가난한 절이면서 맑고 향기로운 도량이 되었으면 합니다. 불자들만이 아니라 누구나 부담없이 드나들면서 마음의 평안과 삶의 지혜를 나눌 수 있있으면 합니다.(1997년12월14일 길상사 창건 법문 중)

▲삶의 순간순간이 아름다운 마무리이며 새로운 시작이어야 한다. 아름다운 마무리는 지나간 모든 순간들과 기꺼이 작별하고 아직 오지 않은 순간들에 대해서는 미지 그대로 열어둔 채 지금 이 순간을 받아들이는 일이다. 아름다운 마무리는 낡은 생각, 낡은 습관을 미련 없이 떨쳐버리고 새로운 존재로 거듭나는 것이다. 그러므로 아름다운 마무리는 끝이 아니라 새로운 시작이다.('아름다운 마무리' 중)

▲행복할 때는 행복에 매달리지 말라. 불행할 때는 이를 피하려고 하지 말고 그냥 받아들이라. 그러면서 자신의 삶을 순간순간 지켜보라. 맑은 정신으로 지켜보라. ('아름다운 마무리' 중)

▲모든 것을 소유하고자 하는 사람은 어떤 것도 소유하지 않아야 한다. 모든 것이 되고자 하는 사람은 어떤 것도 되지 않아야 한다. 모든 것을 가지려면 어떤 것도 필요도 함 없이 그것을 가져야 한다. 버렸더라도 버렸다는 관념에서조차 벗어나라. 선한 일을 했다고 해서 그 일에 묶여있지 말라. 바람이 나뭇가지를 스치고 지나가듯 그렇게 지나가라. ('일기일회' 중)

'건강 > 가십' 카테고리의 다른 글

[유머] 한국인들은 정말 천재인가?  (0) 2010.04.01
posted by 방랑군 2010. 3. 5. 17:22

You should spend about 40 minutes on this task.

 

"Prevention is better than cure." 
Out of a country's health budget, a large proportion should be diverted from treatment to spending on health education and preventative measures.
To what extent do you agree or disagree with this statement?

 

You should write at least 250 words.

 

model answer:

Of course it goes without saying that prevention is better than cure. That is why, in recent years, there has been a growing body of opinion in favour of putting more resources into health education and preventive measures. The argument is that ignorance of, for example, basic hygiene or the dangers of an unhealthy diet or lifestyle needs to be combatted by special nationwide publicity campaigns, as well as longer-term health education.

Obviously,there is a strong human argument for catching any medical condition as early as possible. There is also an economic argument for doing so. Statistics demonstrate the cost-effectiveness of treating a condition in the early stages, rather than delaying until more expensive and prolonged treatment is necessary. Then there are social or economic costs, perhaps in terms of loss of earnings for the family concerned or unemployed benefit paid by the state.

So far so good, but the difficulties start when we try to define what the 'proportion' of the budget should be, particularly if the funds will be 'diverted from treatment'. Decisions on exactly how much of the total health budget should be spent in this way are not a matter for the non-specialist, but should be made on the basis of an accepted health service model.

This is the point at which real problems occur - the formulation of the model. How do we accurately measure which health education campaigns are effective in both medical and financial terms? How do we agree about the medical efficacy of various screening programmes, for example, when the medical establishment itself does not agree? A very rigorous process of eval!uation is called for, so that we can make informed decisions.

'ENGLISH > Today's Writing' 카테고리의 다른 글

IELTS 전형적인 작문 주제(30)  (0) 2010.03.05
2009 12 14  (0) 2009.12.14
2009 10 19  (0) 2009.10.19
2009 10 06  (0) 2009.10.16
2009 10 15  (0) 2009.10.15
posted by 방랑군 2010. 3. 5. 10:57

IELTS 전형적인 작문 주제(30)

  The following is a list of IELTS sample writing questions for you to try out. Some of them also include Academic and General Training questions.

 

1Some young children spend a great amount of their time practicing sports. Discuss the advantages and disadvantages of this. use specific reasons

 

2It is sometimes said that borrowing money from a friend can harm or damage the friendship. Do you agree? Why or why not? Use reasons and examples in your answer.

 

3Every generation of people is different in important ways. How is your generation different from your parents’generation? Use specific reasons and examples to explain your answer.

 

4Some people pay money for the things they want or need. Other people trade products or goods for what they need. Compare the advantages of these two ways of obtaining things. Which way do you prefer? Explain why.

 

5Imagine that you have received some land to use as you wish. How would you use this land? Use specific details to explain your answer.

 

6Some people like doing work by hand. Others prefer using machines. Which do you prefer? Use specific reasons and examples to support your answer.

 

7. You want to persuade someone to study your native language. What reasons would you give? Support your answer with specific details.

 

8. You have been asked to suggest improvements to a park that you have visited. This might be a city park, a regional park, or a national park. What improvements would you make? Why? Use specific reasons and examples to support your recommendations.

 

9. Do you agree or disagree with the following statement? People should read only those books that are about real events, real people, and established facts. Use specific reasons and details to support your opinion.

 

10. Films can tell us a lot about the country in which they were made. What have you learned about a country from watching its movies? Use specific examples and details to support your response.

 

11. Some people say that physical exercise should be a required part of every school day. Other people believe that students should spend the whole day on academic studies. Which opinion do you agree with? Give reasons to support your answer.

 

12. Some people prefer to spend most of their time alone. Others like to be with friends most of the time. Do you prefer to spend your time alone or with friends? Give reasons to support your answer.

 

13. If you could invent something new. what product would you develop? Use specific details to explain why this invention in needed.

 

14. It has been said." Not everything that is learned is contained in books." Compare and contrast knowledge gained from experience with knowledge gained from books. In your opinion, which source is more important? why?

 

15. Do you agree or disagree with the following statement? Playing a game is fun only when you win. Use specific reasons and examples to support your answer.

 

16. Because of developments in communication and transportationcountries are becoming more and more alike. How is your country becoming more similar to other places in the world? Use specific examples and details support your answer.

 

17. If you could change one important thing about your hometown, what would you change? Use reasons and specific example to support your answer.

 

18. People attend colleges or universities for many different reasons( for example, new experiences, career preparation, increased knowledge) why do you think people attend colleges? Use specific reasons and examples to support your answer.

 

19. In general. people are living longer now. Discuss the causes of this phenomenon. Use specific reasons and detail to develop your essay.

 

20. Over past 50 years, young people gain status and power but old people have lost. What is the cause and is it a good development or bad development?

 

21. You and your family are living in a rented accommodation in an English-speaking country. You are not satisfied because there are something wrong with the furniture. So write a letter to the landlord and ask how to resole the problem.

 

22. Young people are exposed to a great amount of information such as film, book, Internet. In what ways they give bad influence on young people and explain the reason, how to reduce the bad influence with examples.

 

23.

(A) Do you think government should subsidizes the musicians, artists, actors or drama companies, do u agree or disagree, what should government do?

 

(G) People doing different kinds of work enjoy different amount of holiday time. Should people have the same amount of leisure time? Give your opinion using some of your own experience.

 

24.

(A) Some people believe that a country should have the moral obligation to help the other country and some of the people think that exist the misspending of the government and the aid money can not be got by the poor. What is your opinion?

 

(G) Some people think that children’s lives will be different from their own. Whit is your opinion? Explain the reasons by your experience and examples.

 

25.

(A) Some people think that machine translation is highly developed in today’s society, therefore it is not necessary for children to learn a foreign language. What’s your opinion?

 

(G) Today some person has to work away from his family, what is the advantages and disadvantages? Give your opinion and some explains of your experience.

 

26.

(A) Someone say the age of book is past, the info will be presented by some multimedia tools such as video, computer, television and film , others think the book and the written words will be necessary for spread info & complete education. Discuss both sides and give your opinion.

 

(G) The culture of different countries are becoming similar so there is no pint for people to go traveling abroad for they could have same experience at home agree or disagree.

 

27. Parent should limit children time of watching TV and playing computer game, others Insister children spend reading books, agree or disagree?

 

28. Traveling abroad work for period of months or years, advantages or disadvantages to people and country

 

29. Do you think people do different jobs they should have different time holiday are you agree or disagree , give your reason an explain.

 

30. Some people said should not encourage sport at school because it will cause competition rather than co-operation. to what extend you agree with it?

'ENGLISH > Today's Writing' 카테고리의 다른 글

"Prevention is better than cure."  (2) 2010.03.05
2009 12 14  (0) 2009.12.14
2009 10 19  (0) 2009.10.19
2009 10 06  (0) 2009.10.16
2009 10 15  (0) 2009.10.15
posted by 방랑군 2010. 2. 26. 16:09

문자열 함수

Function

Oracle

SQL Server

Convert character to ASCII

ASCII

ASCII

String concatenate

CONCAT

(expression + expression)

Convert ASCII to character

CHR

CHAR

Return starting point of character in character string (from left)

INSTR

CHARINDEX

Convert characters to lowercase

LOWER

LOWER

Convert characters to uppercase

UPPER

UPPER

Pad left side of character string

LPAD

N/A

Remove leading blank spaces

LTRIM

LTRIM

Remove trailing blank spaces

RTRIM

RTRIM

Starting point of pattern in character string

INSTR

PATINDEX

Repeat character string multiple times

RPAD

REPLICATE

Phonetic representation of character string

SOUNDEX

SOUNDEX

String of repeated spaces

RPAD

SPACE

Character data converted from numeric data

TO_CHAR

STR

Substring

SUBSTR

SUBSTRING

Replace characters

REPLACE

STUFF

Capitalize first letter of each word in string

INITCAP

N/A

Translate character string

TRANSLATE

N/A

Length of character string

LENGTH

DATALENGTH or LEN

Greatest character string in list

GREATEST

N/A

Least character string in list

LEAST

N/A

Convert string if NULL

NVL

ISNULL

 

Date 함수

Function

Oracle

SQL Server

Date addition

(use +)

DATEADD

Date subtraction

(use -)

DATEDIFF

Last day of month

LAST_DAY

N/A

Time zone conversion

NEW_TIME

N/A

First weekday after date

NEXT_DAY

N/A

Convert date to string

TO_CHAR

DATENAME

Convert date to number

TO_NUMBER(TO_CHAR())

DATEPART

Convert string to date

TO_DATE

CAST

Get current date and time

SYSDATE

GETDATE()

 

posted by 방랑군 2010. 2. 26. 15:44
윈도우 기본 애플리케이션

명령어

실행하는 프로그램

mspaint

그림판

wordpad

워드패드

calc

계산기

notepad

메모장

sndvol32

볼륨 조절기

regedit

레지스트리 편집기

iexplore

인터넷 익스플로러

wmplayer

윈도 미디어 플레이어

msmsgs

윈도 메신저

cmd

명령 프롬프트

msconfig

시스템 구성 (시작 프로그램 관리자)

moviemk

윈도 무비 메이커

snippingtool

캡처 도구 (윈도우 7만 기본적으로 지원)

explorer

탐색기

msinfo32

시스템 정보

chkdsk

디스크 검사 도구

cleanmgr

디스크 정리

taskmgr

작업 관리자

perfmon

성능 모니터

mrt

악성 소프트웨어 제거 도구

sfc

시스템 검색 유틸리티 (시스템 파일 유효성 확인)

sfc /scannow

즉시 스캔

sfc /scanonce

다음 부팅 때 한번 실행

mstsc

원격 데스크톱 연결

msra

윈도 원격 지원

osk

화상 키보드

wab

연락처

logoff

로그오프

shutdown

시스템 종료

shutdown –r

시스템 다시 시작


제어판

명령어

실행하는 프로그램

control

제어판

appwiz.cpl

프로그램 추가/삭제

desk.cpl 또는 control desktop

디스플레이

mmsys.cpl

소리

sysdm.cpl

시스템 속성

control mouse

마우스 속성

ncpa.cpl 또는 control netconnections

네트워크 연결

inetcpl.cpl

인터넷 속성

wscui.cpl

보안 센터

fsmgmt.msc

공유 폴더

powercfg.cpl

전원 옵션

control admintools

관리 도구

services.msc

서비스

devmgmt.msc

장치 관리자

control printers

프린터

gpedit.msc

그룹 정책 편집기

control fonts

폰트 (fonts만 입력하면 폰트 폴더 열림)

control schedtasks

작업 스케줄러

 

IT
posted by 방랑군 2010. 2. 26. 15:41

'IT' 카테고리의 다른 글

Windows Server 2008 Setting Tip  (0) 2009.07.30
posted by 방랑군 2010. 2. 26. 15:40
C# 윈폼에서 DataGridView Data를 Excel 파일로 저장하는 소스를 알려 드리겠습니다. 순수하게 제가 만든건 아니고 여러 사이트에서 소스를 참조해서 제 상황에 맞게끔 응용을 했습니다.

제가 MS 오피스 2007 에 Visual Studio 2008 을 쓰기 때문에 이를 기준으로 소개를 하겠습니다.

먼저 솔루션 탐색기에서 참조추가를 합니다.

솔루션탐색기->참조추가->COM->Microsoft Excel 12.0 Object Libary 선택



이후 아래 소스를 적용하시면 됩니다.

using System.Reflection;
using Excel = Microsoft.Office.Interop.Excel;

private void ExportExcel(bool captions)
{
    this.saveFileDialog.FileName = "TempName";
    this.saveFileDialog1.DefaultExt = "xls";
    this.saveFileDialog1.Filter = "Excel files (*.xls)|*.xls";
    this.saveFileDialog1.InitialDirectory = "c:\\";

    DialogResult result = saveFileDialog.ShowDialog();

    if (result == DialogResult.OK)
    {
        int num = 0;
        object missingType = Type.Missing;

        Excel.Application objApp;
        Excel._Workbook objBook;
        Excel.Workbooks objBooks;
        Excel.Sheets objSheets;
        Excel._Worksheet objSheet;
        Excel.Range range;

        string[] headers = new string[dataGridView.ColumnCount];
        string[] columns = new string[dataGridView.ColumnCount];

        for (int c = 0; c < dataGridView.ColumnCount; c++)
        {
            headers[c]=dataGridView.Rows[0].Cells[c].OwningColumn.HeaderText.ToString();
            num = c + 65;
            columns[c] = Convert.ToString((char)num);
        }

        try
        {
            objApp = new Excel.Application();
            objBooks = objApp.Workbooks;
            objBook = objBooks.Add(Missing.Value);
            objSheets = objBook.Worksheets;
            objSheet = (Excel._Worksheet)objSheets.get_Item(1);

            if (captions)
            {
                for (int c = 0; c < dataGridView.ColumnCount; c++)
                {
                    range = objSheet.get_Range(columns[c] + "1"Missing.Value);
                    range.set_Value(Missing.Value, headers[c]);
                }
            }

            for (int i = 0; i < dataGridView.RowCount - 1; i++)
            {
                for (int j = 0; j < dataGridView.ColumnCount; j++)
                {
                    range = objSheet.get_Range(columns[j] + Convert.ToString(i + 2),
                                                           Missing.Value);

                    range.set_Value(Missing.Value,
                                          dataGridView.Rows[i].Cells[j].Value.ToString());

                }
            }

            objApp.Visible = false;
            objApp.UserControl = false;

            objBook.SaveAs(@saveFileDialog.FileName,
                      Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookNormal,
                      missingType, missingType, missingType, missingType,
                      Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange,
                      missingType, missingType, missingType, missingType, missingType);
            objBook.Close(false, missingType, missingType);

            Cursor.Current = Cursors.Default;

            MessageBox.Show("Save Success!!!");
        }
        catch (Exception theException)
        {
            String errorMessage;
            errorMessage = "Error: ";
            errorMessage = String.Concat(errorMessage, theException.Message);
            errorMessage = String.Concat(errorMessage, " Line: ");
            errorMessage = String.Concat(errorMessage, theException.Source);

            MessageBox.Show(errorMessage, "Error");
        }
    }


posted by 방랑군 2010. 2. 26. 15:39
네트웍 프로그램을 개발할시 Connect 로 접속할때 IP가 살아 있지 않으면 딜레이가 많이 생깁니다. 하나의 IP에 단발성으로 Connect 를 할거면 딜레이가 생겨도 상관이 없지만 여러 IP에 Connect 를 시도 해야할때는 이 딜레이 때문에 프로그램이 꼭 다운된듯한 느낌이 들어 사용자에게 오해를 불러 일으킬수 있는 요지가 있어 이 딜레이를 없애는게 좋은거 같습니다. 

C# 내부 함수로는 이 딜레이를 없애는 방법은 없는거 같습니다. 그럼 방법은 ping 을 날려 보고 살아 있으면 Connect를 하고 죽어있으면 다른 IP로 넘어 가는 방법을 택해야 하는거 같습니다.

C#에서 Ping Test Code 입니다.

public bool Connect(string ip, int port)
{
    try
    {
        //IP Address 할당 
        this.ipAddress = IPAddress.Parse(ip);

        //TCP Client 선언
        this.tcpClient = new TcpClient(AddressFamily.InterNetwork);

        Ping pingSender = new Ping();
        PingOptions options = new PingOptions();

        // Use the default Ttl value which is 128,
        // but change the fragmentation behavior.
        options.DontFragment = true;

        // Create a buffer of 32 bytes of data to be transmitted.
        string data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
        byte[] buffer = Encoding.ASCII.GetBytes(data);
        int timeout = 120;
        PingReply reply = pingSender.Send(this.ipAddress, timeout, buffer, options);
        
        if (reply.Status == IPStatus.Success)
        {
            // Ping 성공시 Connect 연결 시도
            this.tcpClient.NoDelay = true;
            this.tcpClient.Connect(ipAddress, port);

            this.ntwStream = tcpClient.GetStream();               
        }
        else
        {
            // Ping 실패시 강제 Exception
            throw new Exception();
        }

        return true;
    }
    catch (Exception ex)
    {
        //MessageBox.Show("Connect Fail... : " + ex);
        return false;
    }
}

참고한자료 : 
msdn - Ping 클래스(System.Net.NetworkInformation)
posted by 방랑군 2010. 2. 23. 17:03
  if( !(hIMC = ImmGetContext( GetActiveWindow() ) ) )                    // 핸들을 얻어오고,
   break;


  ImmGetConversionStatus( hIMC, &dwConversion, &dwSentence);    // 현재 IME의 상태를 얻어서
  if(dwConversion & IME_CMODE_HANGEUL)                                    // 만약 한글 모드라면
   dwConversion -= IME_CMODE_HANGEUL;                                    // 한글 모드 안되게...
  
  ImmSetConversionStatus( hIMC, IME_CMODE_ALPHANUMERIC, IME_SMODE_NONE);    // 한글모드아니게 설정
  ImmReleaseContext( GetActiveWindow(), hIMC );                            //얻은 핸들 풀어주고


이런식...
IME_CMODE_HANGEUL 
IME_CMODE_JAPANESE
.. 등등<


Imm32.lib와 
Imm.h를 사용한다.

'IT > 후킹' 카테고리의 다른 글

IME 메시지를 hooking 하는 방법  (0) 2010.01.08
posted by 방랑군 2010. 2. 17. 12:54





나의 결과:

posted by 방랑군 2010. 2. 12. 09:47


 요즘 회사 사이트나 결재 빼고는 크롭을 이용한다..

IE 는 속도가 넘 느려 터져서......

근데, 파이어 폭스는 첫 실행할때 로깅이 엄청 느리다..
어째 IE 보단 더 짜증나는 브라우저다....

크롬이 짱이다...

'방랑이의 생활 > Diary' 카테고리의 다른 글

불안감..  (0) 2009.11.24
From Now On....  (0) 2009.10.22
posted by 방랑군 2010. 2. 4. 10:32


감사합니다. ^^; 모든 구문 정리 다했습니다.

더 이상 한국에서 나오는 시험에 등장하는 구문은 없습니다.


Ⅰ.원급의 관용적 표현



1. as~as S can(=as~as possible)

   He came home as early as he could.

(=He came home as early as possible.)

2. as~as ever(변함없이~하다)

   He looks as depressed as ever.

3. as far as(=so far as)(~하는 한, ~에 관한 한, ~까지)

   As far as I know, he is trustworthy.

   He is not a bad servant, so far as servants go.

   He walked as far as the station.

4. as good as(~나 다름없다)

   He was as good as dead.

5. as long as(=so long as)(~하기만 한다면)

   I will lend you the book as long as you keep it clean.

6. as many(같은 숫자의)

   I made ten mistakes in as many lines.

7. as many again(두 배의 수)                        

   as much again(두 배의 양)

   I have six hear and as many again at home,

   I have as much again as you.

8. as much as to say(~라고 말하는 듯이)

   She looked as much as to say that I was a liar.

9. as often as not(자주, 종종)

   During foggy weather trains are late as often as not.

10. A as well as B(A라기보다는 차라리 B다)

    It was not so much an invitation as a command.

11. as~as anything(매우~하다)

    He is an arrogant as anything.

12. as~as ever lived(매우~하다)

    He is as impudent a man as ever lived.

13. as soon as(~하자마자)

    As soon as I got home, it began to drizzle.

14. go so far as to+R(~하기까지 했다니 놀랍다)

    The owner of the building went so far as to say he was glad it burned down.





Ⅱ. 비교급의 관용적인 표현


1. still more(=much more), still less(=much less)

   He can speak French, much more English.

   He can't speak English, much less French.

   Since he was poor, it was difficult for him to buy a suit, much less have one tailored.

   이들은 하나의 숙어로 기억해야 하며 ‘much more(difficult)'로 연결해서 생각하지 말아야 한다.

2. the+비교급~the+비교급(~하면 할수록 점점 더 ~하다)

   The higher the tree (is), the stronger the wind (is).

   The sooner, the better.

3. not more than (기껏해야, =at most),

   not less than( 적어도 ~이상, =at least),

   no more than (겨우, =only),

   no less than (~만큼, =as much as)

   * not은 강한 부정어이다.

     She is very poor ;she has not more than $500.

     She is very rich ;she has not less than $500.

     He gave me no more than $500.

     He gave me no less than $500.

4. no longer(더 이상 ~아니다, =no more)




  cf. not longer(길이가 더 길지 않다)

   He is no longer a young man.

   This yellow pencil is not longer than that blue one.

5. more or less(다소간)

   She was more or less surprised.

6. no more(더이상 ~아니다)

   If you won't go there, no more will I.

7. no more 원급 than (~나 마찬가지로 ~가 아니다)

   I am no more mad than you (are).

8. A is not B any more than C is (B)


  A is not B any more than C is D  (A가 B가 아닌 것은 C가 (B)D가 아닌 것과 마찬가지다)

   A whale is not a fish any more than a horse is.

   A collection of facts is not science any more than a dictionary is poetry.

9. nothing less than(~정도)

   We expected nothing less than an attack.

10. none the less(그대로 역시)

    I love him none the less his faults.

11. no better than(~나 마찬가지다)

   He's no better than a beggar.

12. more than=over

    More than one year has passed since I saw him.

   * more than one은 단수 취급한다.

13. had better(not)+R [~하는(않는)편이 더 좋겠다]

    You'd better get your car towed.

14. know better than to+R (~할 사람이 아니다)

    I know better than to quarrel.

15. get the better of (이기다)

    My curiosity got the better of me.

16. the former~, the latter~ (전자, 후자)

    The novel was made into a film in 1960 and again in  1968; I prefer the latter version to the former.

17. the latter half (후반부)

    the latter half the nineteenth century

18. better off(잘산다, 형편이 더 좋다),

    worse off(못산다, 형편이 나쁘다)

    You could pay it back afterwards when you are better off.

    This budget would leave taxpayers for worse off.





Ⅲ. 최상급의 관용적인 표현


1. do one's best(최선을 다하다)=do one's utmost

   He did his best, but he still didn't win.

2. at(the)most(기껏해야), at(the)best

   There would be at most twenty students listening.

   At best the proposal was a lame compromise.

3. make the most(best) of (그런대로 ~을 가장 잘 이용하다)

  We should face up to the situation and make the most(best) of it.

4. for the most part (대개는)

   For the most part the students in my class sit in silence.

5. the last man to+R (~할 사람이 아니다)

   He is the last man to feed me a line.

6. not the least bit (조금도 ~않다) =not in the least

   I don't mind in the least.

   She wasn't the least bit jealous.

7. at(the) latest (늦어도)

   I'll see you at five o'clock at the latest.

8. if the worst comes th the worst (사태가 악화되면)

   The situation may improve but if the worst comes to the worst I'll have to sell my car.

9. the last but one (끝에서 두 번째)

   Friday is the last day of the week but one.

10. (the) second(next) best (두 번째, 차선)

    Don't settle for second best.

11. had best+R (~하는게 상책이다)

    You had  best consent.

12. as best one can(may) (되도록 잘)

    Do it as best you can.

13. to the best of one's knowledge (내가 알기로는)

    This is a play which to the best of my knowledge has never been performed in our country.

14. to the best of one's ability (힘이 자라는 데까지, 힘껏)

    I'm here to do my work to the best of my ability.

15. for the best (잘 하느라 성의껏)

    She meant it all for her best.

16. know best (경험이 많아 잘 알고 있다)

    Parents always know best.

17. at (long) last (마침내)

    At (long) last I've found a girl that really loves me.

18. the winter before last(지지난 겨울),

    the year before last(지지난 해),

    the night before last(지지난 밤),

    the president before last(전전번 대통령),

    the election before last(전전번 선거)

19. to the last detail(상세한 세목까지),

    to the last man(최후 일인까지)

    The robbery planned to the last detail. We were ready to fight to the last man.





Ⅵ. 부정사의 관용적인 표현


1. be(feel) inclined to+R

  (~하는 경향이 있다, ~하고 싶은 생각이 들다)

   I feel inclined to enter teaching.

2. be supposed to+R(~하기로 되어 있다 =be expected to+R)

   Many prominent figures are supposed to be at the preview.

3. go to great lengths to+R(온갖 노력을 기울여 ~하다)

  go to every length to+R

   The country is going to great lengths to arrest the inflation.

4. be required+R(~해야 한다)

   We are required to pay taxes to the government.

5. be relieved to+R(~하고 안심하다)

   Jean was relieved to gear that she had been accepted to the university.

6. be determined+R(~할 결심을 하다)

   Jack was determined to quit smoking.

7. be about to+R(막~하려하다)

   Beth was just about to leave when Laura telephoned.

8. go so far as to+R(~조차 하다)

   She went so far as to call her husband names.

9. have no choice but to+R(~하는 수 밖에 없다)

   = There's nothing for it but to+R

   You have no choice but to obey her orders.

10. be likely to+R(~일 듯하다)

  = It is likely that S+V~

    He's likely to be hear so soon.

12. seem to+R(~일 듯싶다)

  =It seems that S+V

   He seems to be all thumbs.(그는 재주가 없는 것 같다.)

13. used to+R(~하곤 했었다)

    He used to drop by my office talk with me about his divorce.

14. know better than to+R(~할 사람이 아니다)

    He knows better than to touch me to the quick.

    (그는 내 감정을 상하게 할 사람이 아니다)

15. It pays to+R(~하는게 이롭다)

    It doesn't pay to+R(~해봤자 이로울게 없다)

    It doesn't pay to dawdle over your homework.

  (숙제하는 일을 꾸물거리고 있어 봤자 이로울게 없다)

16. be hard pressed to+R(~하느라 애를 먹다, ~하기 어렵다)

   Chinese people ae hard pressed to limit their family to one child.

17. bo bound to+R(~하는게 의무이다, ~해야 한다)

    He was bound to obey her orders.

18. serve no other purpose than to+R(유일한 목적이다)

    This novel serves no other purpose than to tickle readers.




Ⅴ. 동명사의 관용적인 표현

1. have difficulty

        trouble

        a hard time           +(in) ~ing

        a lean time           + with+Noun  (애먹다)

        a difficult time

        a terrible struggle

  He had a hard time(in) balancing his bank account.

  He had a hard time with his bank balance.

2. spend(waste)+시간,돈,노력 + ┌ (in) ~ing

                               └ on+Noun

  (시간, 돈, 노력)을 들였다(허비했다)

  He has spent a lot of time (in) collecting stamps.

  He has spent a lot of time on stamps.

3. be busy (in) ~ing(~하느라 바쁘다)

   Many people are too busy(in) chasing after money.

4. cajole(reason, talk, argue)+Sb.+into~ing(out of~ing)

  (잘 설득해서 ~(못)하게 하다)

  I argued him out of smoking.

  They were cajoled into coming with us.

5. prevent

   keep

   stop

   prohibit          + Sb. from~ing (~을 못하게 막다)

   discourage

   restrain

   deter

   Nothing could stop him from being a novelist.

   He restrained his kid from doing mischief.

   The existence of such discrimination may deter more women from seeking work.

6. be addicted to ~ing(or Noun), be given over to ~ing(or Noun)(~에 빠져있다, 골몰하다)

   He is addicted to gambling.

   He is given over to boasting.

7. be acclimated to~ing, be acclimatized to~ing (적응하다)

   Have you become acclimated to living in that city?

8. object to ~ing(=have an objection to ~ing) (반대하다)

   I object to your joining the party.

9. in the act of ~ing, in the middle of ~ing,

   in the midst of ~ing(~하는 중)

   He was apprehended in the act of shoplifting at a department store.

10. in ~ing (=when) (~할 때에)

    Be polite in dealing with others. (Be polite when you deal with others.

11. cannot help ~ing(=cannot+(choose) but+R)

    (=There is noting for it but to+R)

    (=have no choice but to+R) (도저히 하지 않을 수 없다)

    The bus was so crowded that I couldn't help leaning on her a little.

   (The bus was so crowded that I couldn't(choose) but lean on her a little.)



12. want

    need

    require           + ~ing (수동적인 의미)

    bear                (=to be p.p)

    deserve

   My watch wants repairing.(=My watch wants to be repaired.)

   He deserves helping.(=He deserves to be helped.)

   This cloth will bear washing.

   (=This cloth will bear to be washed.)

13. when it comes to ~ing(~에 대해 말하자면)

    When it comes to eating kimchi that's where I draw the line. (김치에 대해 말하자면 나는 절대로 먹지 않는다.)

    When it comes to asking for a raise, he's no laggard.

14. What do you say to ~ing? (~합시다)

   = Let's+R~ =What do you say+S+V~?

    What do you say to going out for a stoll? (=Let/s go out for a stoll.)

15. confess to ~ing(~를 고백하다)

    He confessed to having extramarital relations with his secretary.

16. go in for ~ing[(취미로, 직업으로) ~을 하다]

    He goes in for growing orchids.

    I thought of going in for teaching.

17. one's skill in ~ing (~하는 기술)

    She's famous for her skill in painting birds in oils.

   * skill to+R(고어체 표현으로 거의 쓰이지 않는다.)

18. be averse to ~ing (~을 싫어하다; 반대하다)

    I'm averse to haggling over a few cents.

19. have no doubt of ~ing (~에 대해 의심치 않는다)

    I have no doubt of her showing up.

20. There is no~ing(=It is impossible to+R)

    (~하는 것은 불가능하다)

    There's no denying that she is a decent lady.

    (=It is impossible to deny that she is a decent lady.)

21. It is no use(good) ~ing(=It is of no use to+R)

    (~해도 소용없다)

    It is no use your worrying about me. (It is of no use for you to worry about me.)

22. of one's own ~ing(=p.p+by oneself)(~에 의해 ~되어진)

    We reap the harvest of our own sowing

    (=We reap the harvest sown by ourselves.)

23. On(Upon) ~ing(=As soon as), (=The moment), (=Directly), (=Hardly had+S+p.p ~when), (No sooner had+S+p.p ~than) (~하자마자)

    Upon hearing the bell ring, we ran out of the classroom.

    (=As soon as we heard the bell ring, we ran out of the classroom.)

    (=The moment we heard the bell ring, we ran out of the classroom.)

    (=Hardly had we heard the bell ring when we ran out of the classroom.)

24. with a view to(of) ~ing

   =for the purpose of ~ing(~할 목적으로)

    He came to this country with a view to studying ethnology.

  * 회화체에서는 ‘with a view to+R'로 쓰는 경우도 있다.

    He got a loan for the purpose of buying a larger apartment.

25. be on the point of ~ing(~하려는 찰나)

  = be on the verge of ~ing

  = be on the brink of ~ing

   (be about to + R)

   As they were on the point of setting out, it began to rain cats and dogs.

   (=As they were about to set out, it began to rain cats and dogs.)

26. make a point of ~ing

  (=make it a point to+R)

  (=make it a rule to+R) (~하는 것을 중요시하다)

   I make a special point of being sociable.

   (= I make it a special point to be sociable.)

   (= I mke it a rule to be sociable.)

27. It goes without saying that S+V

   (= It is needless to say that S+V)

   (= It is a matter of couse that S+V)

   (~는 말할 필요조차 없다)

   It goes without saying that I owe what I am to my father.

   (=It is needless to say that I owe what I am to may father.)



PS:

 as…as의 앞의 as는 지시 부사, 뒤의 as는 접속사(관계 부사라고 할 수도 있다). (2) as…as의 부정형은 not so…as가 원칙이지만, 구어에서는 보통 not as…as를 씁니다

 

 John doesn’t work as hard as George. 존은 조지만큼 공부를 열심히 하지 않는다.

I am not as old as he, I am much older. 나는 그와 동년배가 아니라 훨씬 더 나이가 많다

am always as busy as (I am) now. 나는 항상 지금처럼 바쁘다

She works as hard as anybody. 그녀는 누구 못지 않게 열심히 공부한다

He has as many horses as you(do). 그는 너와 같은 두수의 말을 기르고 있다

Man is not as social as ants or bees. 인간은 개미나 꿀벌만한 군거성을 지니고 있지 않다.

She is as tall as you (are). 그녀는 너만큼 키가 크다

I love you as much as (I love) her. 그녀를 사랑하는 것만큼 나는 너를 사랑하고 있다

It is not so[or isn’t as] hard as you might think. 그것은 네가 생각하는 것만큼 어렵지 않다

It came out the same way as it had done before. 그것은 전과 같은 결과가 되었다

His voice is as thin as he is fat. 그는 뚱뚱한 몸집에 비해 목소리가 가냘프다

He was as popular as his father not. 그는 아버지와는 반대로 인기가 있었다.

posted by 방랑군 2010. 1. 8. 16:23

http://support.microsoft.com/kb/601978/ko


IME message들은 OS가 Application의 message queue 로 posting하는 message가 아니라, 각 application의 WinProc를 직접 call하는 message이므로, CallWndProc hook procedure를 이용하여 hooking해야 합니다. 
다음은 WM_IME_NOTIFY message를 hooking하는 DLL 의 예제코드입니다.

## Hooking Procedure에서 추가되는 함수들은 user의 input를 기다리는 API는 사용하지 마십시오. 이것은 system의 performance를 떨어뜨리거나 심지어는 dead-lock 발생의 원인이 됩니다.


HHOOK hHook = NULL;
HINSTANCE hHookDll;
LRESULT CALLBACK GetMsgProc(int code,  WPARAM wParam,  LPARAM lParam);

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
)
{
hHookDll = (HINSTANCE )hModule;
     return TRUE;
}

BOOL APIENTRY  SetHookProc()
{
hHook =  SetWindowsHookEx(WH_GETMESSAGE,GetMsgProc,hHookDll,0);
if (hHook)
return true;
else
return false;
}

void APIENTRY UnsetHookProc()
{
UnhookWindowsHookEx(hHook);
}

LRESULT CALLBACK GetMsgProc(int code,  WPARAM wParam,  LPARAM lParam)
{
   MSG *msg = (MSG *)lParam;
   if ( msg->message == WM_IME_NOTIFY)
   {
   // TODO : Add to code what you want to act
  
   // Always call next hook in chain 
   return CallNextHookEx(hHook, code,  wParam, lParam);
}



'IT > 후킹' 카테고리의 다른 글

[MFC] 활성화 창 한/영 체크 및 변환  (0) 2010.02.23
posted by 방랑군 2010. 1. 7. 14:11


일반과세자 부가가치세 신고서 작성하기

'방랑이의 생활 > 개인사업자' 카테고리의 다른 글

개인사업자 신고 목록  (0) 2009.12.31
세금계산서양식 입니다.  (0) 2009.12.31
소득신고 관련  (0) 2009.11.18
간편장부  (0) 2009.11.05
개인사업자 장,단점  (0) 2009.11.05
posted by 방랑군 2010. 1. 5. 10:23
http://www.cyworld.com/burningLamb/3322299
posted by 방랑군 2009. 12. 31. 14:04



기본적으로 개인사업자는 부가가치세소득세 신고를 하여야 합니다.

1. 부가가치세 신고.
 - 1월부터 6월분을 7월 25일까지, 7월부터 12월분은 1월 25일까지 부가세 신고합니다.

 : 상세 내용
   일반과세자라면 부가세 신고는 매출액의 10%에서 매입액의 10%를 뺀 금액을 신고하고 납부하여야 하는데, 매출액의 10%에서 뺄 수 있는(매입세액공제할 수 있는)매입세액은 사업과 관련하여 비용을 지출하면서 적격증빙(세금계산서, 대표자명의 신용카드매출전표, 지출증빙용현금영수증)을 수령한 부분에 한합니다.
 즉, 11,000원(부가세포함)을 팔고, 8,800원(부가세포함) 비용지출하였다고 한다면, 매출세액(1,000원)에서 매입세액(800원)을 뺀 200원을 신고,납부하게 됩니다.

2. 소득세 신고.
  -  1월부터 12월까지 사업하고 난뒤 순수익(수익-비용)에 소득세율(6.6%~38.5%)를 곱한 금액을 
    다음해 5월에 소득세 신고합니다.

 : 상세내용
   이때, 소득세 신고하는 방법은 매출액의 크기등에 따라 장부를 만들어서 실제 순수익에 대하여 소득세 신고를 하는 방법과, 경비율(법에 정해진 매출액 대비 경비인졍비율)을 적용하여 소득세를 신고하는 방법이 있습니다. 

장부를 만드셔서 소득세 신고하시는 것은 직접하시기 힘든 경우가 대부분이고, 사업초기나 매출액이 적은 경우에는 경비율을 적용하여 소득세를 신고하는 경우가 대부분이므로, 국세청 홈택스를 통하여 부가세 및 소득세 신고를 직접하실 수 있으십니다.



'방랑이의 생활 > 개인사업자' 카테고리의 다른 글

부가가치세 신고하기 따라 하기  (0) 2010.01.07
세금계산서양식 입니다.  (0) 2009.12.31
소득신고 관련  (0) 2009.11.18
간편장부  (0) 2009.11.05
개인사업자 장,단점  (0) 2009.11.05
posted by 방랑군 2009. 12. 31. 12:12
세금계산서 양식입니다.
공급자용에만 입력하시면 공급자 보관용에는 자동 입력 됩니다.
공급가액과 세액 부분만 수동으로 입력 하시면 됩니다.

세금계산서양식



















'방랑이의 생활 > 개인사업자' 카테고리의 다른 글

부가가치세 신고하기 따라 하기  (0) 2010.01.07
개인사업자 신고 목록  (0) 2009.12.31
소득신고 관련  (0) 2009.11.18
간편장부  (0) 2009.11.05
개인사업자 장,단점  (0) 2009.11.05
posted by 방랑군 2009. 12. 28. 16:52

Indentify BizTalk Version and Edition

Here is how you can find out the edition: Enterprise/Standard/Branch 

HKLM\SOFTWARE\Microsoft\BizTalk Server\3.0 and the key ProductEdition. This should tell you if it is Enterprise/Standard or Branch.... 

 

BizTalk version through Registry:

HKLM\SOFTWARE\Microsoft\BizTalk Server\3.0

 

ProductVersion key

version

3.0.4902.0

BizTalk Server 2004

3.0.6070.0

BizTalk Server 2004 SP1

3.0.7405.0

BizTalk Server 2004 SP2

3.5.1602.0

BizTalk Server 2006

3.6.1404.0

BizTalk Server 2006 R2

 

Here is a way to determine the version of BizTalk Server through Database:

open BizTalkDBVersion Table from BizTalk Management database.. Do not change any values here as the supportability clause comes into picture....

 

 

Version(Minor + Major)

Comments

BizTalk 2009

3.7

 

BizTalk 2006 R2

3.6

 

BizTalk 2006 RTM

3.5

 

BizTalk 2004 SP2

3.2

If table exists ('admv__BackupDatabases')

BizTalk 2004 SP1

3.2

If table exists ('adm_OtherDatabases')

BizTalk 2004 RTM

3.2

If not table specified above exist

 

This is by DB version though.. not the registry.. there should be some easy way to tell, trying to get that mapping...

'BIZTALK' 카테고리의 다른 글

SOA(Service Oriented Architecture)란?  (0) 2009.12.22
MS BizTalk Server 소개  (0) 2009.12.22
미들웨어란 무엇인가?  (0) 2009.12.22
BizTalkDTADb  (0) 2009.11.29
Microsoft BizTalk ESB Toolkit  (0) 2009.10.05