2010년 4월 25일 일요일

[20100417] SharePoint 커뮤니티 발표 자료 - current, future stories about collaborati...

 
 

끄자님이 Google 리더 이메일을 보내셨습니다!

 
 

10. 4. 16 작성자: 백승주(Seung Joo Baek)의 꼬알라의 하얀집...

금주의 마지막 세미나였습니다. SharePoint 커뮤니티 의 정기 세미나에서 Microsoft 협업 플랫폼의 현재와 미래라는 주제로 발표를 했습니다. Office 2010, SharePoint 2010, 그리고 BPOS, Live Services의 이야기를 드렸으며, 몇가지 아직까지 밝힐 수 없는 내용(?)을 데모를 통해서 보여드렸습니다. 관련된 발표 자료 를 포스팅합니다. 주말 오후에 참석해주신 분들께 감사드립니다....(read more)

 
 

Google 리더를 사용하면 다음과 같은 일들이 가능해집니다.

 
 

iconv() 함수 완전정복(?)

리눅스를 한다면 필요한 API

 
 

끄자님이 Google 리더 이메일을 보내셨습니다!

 
 

10. 4. 22 작성자: 구차니의 구차니의 잡동사니 모음

iconv() 함수에서
변환결과로 나와야 하는 방법이 unicode일 경우에는 (일단 다른건 안해봤으니 -ㅁ-?)
(strlen(inbuf) + 2) * 2 가 된다.

size_t iconv(iconv_t cd,
                     char **inbuf, size_t *inbytesleft,
                     char **outbuf, size_t *outbytesleft);

예를 들어 UTF-8을 UNICODE로 변환시에는
UTF-8 문자열 특성상, stelen(utf8str) == 100 일 경우
유니코드(2바이트) 스트링은 최소 25에서 최대 100 까지 변환이 된다.

그리고 iconv 특성상 처음에 2바이트 BOM(Byte Order Mark)을 붙이므로
실질적으로 변환을 위해 필요로 하는 outbuf의 길이는
(strlen(inbuf) + 2) * 2 가 된다.

원래대로라면
(strlen(inbuf) + 1) * 2 + 2 이고
+1 은 '\0'
+2 는 Unicode BOM(0xFEFF in big endian)이다.

[링크 : http://mwultong.blogspot.com/2006/05/qna-unicode-bom-byte-order-mark.html]


덧 : UTF-8로 인코딩된 아랍어의 경우, 조합은 별도로 해주어야 한다.
iconv()가 UNICODE로 변환은 해주지만, 그렇다고 해서 조합까지 해주지는 않는다.

 
 

Google 리더를 사용하면 다음과 같은 일들이 가능해집니다.

 
 

2010년 4월 24일 토요일

MSSQL SP 에서 NOCOUNT 옵션

발췌 : 네이버 카페 ( http://cafe.naver.com/xlsvba/7031 )

MSSQL 에서 SP 사용시 NOCOUNT 옵션

SET NOCOUNT [ON | OFF]



알아두믄 피가되구 살이 되는 설정옵션이다...^^

물론 수시간의 삽질을 동반하구 알아냇다면 뇌속 깊숙이 박히겠지만

이런 기회에 알아두어두 별거 아니므로 기억하는데 어려움이 없으리라 본다.





일단 MSDN을 기초로 설명을 해보자믄



[정의]

: Transact-SQL 문 또는 저장 프로시저의 영향을 받은 행 수를 나타내는 메시지가

결과 집합의 일부로 반환되지 않도록 합니다.





[옵션별 설명]

ON : 실행쿼리에 의해 영향을 받은 ROW의 개수가 반환되지 않음(클라이언트에게 DONE_IN_PROC 메시지를 보내지 안는다.)

실제 데이터를 많이 반환하지 않는 일부 문이 포함된 SP 또는 T-SQL 루프가 포함된 SP의 경우

ON으로 설정하면 네트워크 트래픽이 크게 줄기 때문에 성능 향상에 도움이 된다.

VB에서 SP호출시 해당 SP내 실행쿼리가 존재할 경우(임시 혹은 일반테이블 모두)

레코드셋의 오픈이 아니되는데 이때 살행 쿼리구문에 앞서 ON으로 설정하고

실행쿼리 종료후 OFF로 설정하면 이러한 문제를 극복할 수 있다.

단 @@ROWCOUNT 함수는 정상적으로 업데이트된다. http://cafe.naver.com/xlsvba/3539



OFF : 실행쿼리에 의해 영향을 받은 ROW의 개수가 반환된다.





[예제]



가령 아래와 같은 SP를 만들고 SSMS에서 테스트 해보도록 하자.

정상적인 쿼리라면 결과값도 무리없이 출력될것이다.







CREATE PROC p_test
(
@idt INT
)
AS
BEGIN
SELECT u_id, u_nm, u_job INTO #tmp_test FROM t_test WHERE u_work = '1'
IF @idt = 0
   SELECT * FROM #tmp_test
ELSE IF @idt = 1
   SELECT * FROM #tmp_test WHERE u_cnt > 0
ELSE
   SELECT * FROM #tmp_test WHERE u_cnt < 0
END

일단 정상출력이라고 가정하고
이번엔 이넘을 VB에서 호출해 보자.

'## SQL ADO OLEDB 연결정상이라치구
Call ConnectADO(0)

'## 레코드셋 인스턴스 생성두 정상이라치구...
If oRs Is Nothing Then
   Set oRs = CreateObject("ADODB.Recordset")
End If

Sql = "EXEC [DBO].[p_test] 1"
oCn.Execute Sql
oRs.Open Sql, oCn, 3, 1
If oRs.recordcount <> 0 Then '## ERROR발생--> 개체가닫혀있으면..... 어쩌구저쩌구...~~~
...

SP내에 실행쿼리가 없다면 즉 실행쿼리에 의해 영향을 받은 ROW의 개수가 반환된것이 없다면(DONE_IN_PROC MESSAGE 미발생)

잘 돌아가겠지만 글치 안타믄.... 즉 실행쿼리에 의해 영향을 받은 ROW의 개수가 반환된것이 존재한다믄(DONE_IN_PROC MESSAGE 발생)

위와 같은 에러가 발생한다는 것이다.



그럼 간단하게 해결해 보도록하자..

ODBC어쩌구 저쩌구 하지말구 머리 아프니깐 간단하게 살자...

당연한 얘기이지만 임시이건 일반테이블이건 마찬가지란것에 주의해야한다...

잘못된 정보로 인해서 삽질하지 말자..

SP를 고쳐보도록 하자...



IF OBJECT_ID('p_test') IS NOT NULL
  DROP PROC p_test
GO

CREATE PROC p_test
(
@idt INT
)
AS
BEGIN
SET NOCOUNT ON
SELECT u_id, u_nm, u_job INTO #tmp_test FROM t_test  WHERE u_work = '1'
IF @idt = 0
    SELECT * FROM #tmp_test
ELSE IF @idt = 1
   SELECT * FROM #tmp_test WHERE u_cnt > 0
ELSE
   SELECT * FROM #tmp_test WHERE u_cnt < 0

SET NOCOUNT OFF

END


정상적으로 실행되리라 본다....

개인적으루 먹구살기 바쁘다 보니 양질의 강좌를 올리지 못하는점 미안하게 생각하고 있다.

물론 SQL강좌가 그리 인기가 있지 않은것이 다행이긴 하지만,,,, Good Bye..!!

2010년 4월 21일 수요일

자바를 이용한 암호화 모듈

자바를 이용한 암호화 모듈 정보 입니다..

TripleDES


http://yegam400.tistory.com/73

http://naratalk.com/142



SEED

http://seed.kisa.or.kr/seed/jsp/seed_1020.jsp

2010년 4월 17일 토요일

wget - cookie 관련 옵션

Linux에서 많이 사용하는 명령어

 
 

끄자님이 Google 리더 이메일을 보내셨습니다!

 
 

10. 4. 9 작성자: 구차니의 구차니의 잡동사니 모음

wget은 HTTP나 FTP 등의 프로토콜을 통해 웹페이지나 파일을 다운받는 유틸리티이다.
아무튼 youtube에서 파일로 다운로드 받기위해 주소를 변환해서 시도를 해도
403 Forbidden 에러만 날뿐 다운로드 되지 않는다.

아무튼 쿠키를 저장하고, 이를 다시 불러들여 다운로드를 시도하면 제대로 받아진다.
쿠키를 이용해서 세션이 달라지면, 이전의 내용은 무효화 되서 그런것으로 생각된다.

'--no-cookies'
Disable the use of cookies. Cookies are a mechanism for maintaining server-side state. The server sends the client a cookie using the Set-Cookie header, and the client responds with the same cookie upon further requests. Since cookies allow the server owners to keep track of visitors and for sites to exchange this information, some consider them a breach of privacy. The default is to use cookies; however, storing cookies is not on by default.


'--load-cookies file'
Load cookies from file before the first HTTP retrieval. file is a textual file in the format originally used by Netscape's cookies.txt file.

You will typically use this option when mirroring sites that require that you be logged in to access some or all of their content. The login process typically works by the web server issuing an http cookie upon receiving and verifying your credentials. The cookie is then resent by the browser when accessing that part of the site, and so proves your identity.

Mirroring such a site requires Wget to send the same cookies your browser sends when communicating with the site. This is achieved by '--load-cookies'—simply point Wget to the location of the cookies.txt file, and it will send the same cookies your browser would send in the same situation. Different browsers keep textual cookie files in different locations:

Netscape 4.x.
The cookies are in ~/.netscape/cookies.txt.
Mozilla and Netscape 6.x.
Mozilla's cookie file is also named cookies.txt, located somewhere under ~/.mozilla, in the directory of your profile. The full path usually ends up looking somewhat like ~/.mozilla/default/some-weird-string/cookies.txt.
Internet Explorer.
You can produce a cookie file Wget can use by using the File menu, Import and Export, Export Cookies. This has been tested with Internet Explorer 5; it is not guaranteed to work with earlier versions.
Other browsers.
If you are using a different browser to create your cookies, '--load-cookies' will only work if you can locate or produce a cookie file in the Netscape format that Wget expects.

If you cannot use '--load-cookies', there might still be an alternative. If your browser supports a "cookie manager", you can use it to view the cookies used when accessing the site you're mirroring. Write down the name and value of the cookie, and manually instruct Wget to send those cookies, bypassing the "official" cookie support:

          wget --no-cookies --header "Cookie: name=value"


'--save-cookies file'
Save cookies to file before exiting. This will not save cookies that have expired or that have no expiry time (so-called "session cookies"), but also see '--keep-session-cookies'.


'--keep-session-cookies'
When specified, causes '--save-cookies' to also save session cookies. Session cookies are normally not saved because they are meant to be kept in memory and forgotten when you exit the browser. Saving them is useful on sites that require you to log in or to visit the home page before you can access some pages. With this option, multiple Wget runs are considered a single browser session as far as the site is concerned.

Since the cookie file format does not normally carry session cookies, Wget marks them with an expiry timestamp of 0. Wget's '--load-cookies' recognizes those as session cookies, but it might confuse other browsers. Also note that cookies so loaded will be treated as other session cookies, which means that if you want '--save-cookies' to preserve them again, you must use '--keep-session-cookies' again.


[링크 : http://www.gnu.org/software/wget/manual/html_node/HTTP-Options.html]

--save-cookies 로 저장한 youtube 쿠키이다. 음.. 무슨 의미지 -ㅁ-?
$ cat yt.cookie
# HTTP cookie file.
# Generated by Wget on 2010-04-10 11:57:59.
# Edit at your own risk.

.youtube.com    TRUE    /       FALSE   1586228278      PREF    f1=50000000&f2=8000000
.youtube.com    TRUE    /       FALSE   1291604278      VISITOR_INFO1_LIVE      FNfBrJzTQY

$ wget "http://www.youtube.com/watch?v=mdljV2uEs1A" --save-cookies yt.cookie
$ wget --load-cookies=yt.cookie "http://v22.lscache2.c.youtube.com/videoplayback?ip=211.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Ci
tag%2Calgorithm%2Cburst%2Cfactor&fexp=904405%2C900037&algorithm=throttle-factor&itag=35&ipbits=8&burst=40&sver=3&expire=1270890000&key=yt1&signature=5C611E956FB97E74D3435F8815A7A2376E3C61D4.C2C593CDDE0C15671462BB13C5404EC6927F7F7D&factor=1.25&id=99d963576b84b350" -O file.mp4
--2010-04-10 12:33:26--  http://v22.lscache2.c.youtube.com/videoplayback?ip=211.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor&fexp=904405%2C900037&algorithm=throttle-factor&itag=35&ipbits=8&burst=40&sver=3&expire=1270890000&key=yt1&signature=5C611E956FB97E74D3435F8815A7A2376E3C61D4.C2C593CDDE0C15671462BB13C5404EC6927F7F7D&factor=1.25&id=99d963576b84b350
Resolving v22.lscache2.c.youtube.com... 74.125.167.33
접속 v22.lscache2.c.youtube.com|74.125.167.33|:80... 접속됨.
HTTP request sent, awaiting response... 200 OK
Length: 15708973 (15M) [video/x-flv]
Saving to: `file.mp4'

100%[==========================================================================>] 15,708,973   105K/s   in 2m 0s

2010-04-10 12:35:27 (128 KB/s) - `file.mp4' saved [15708973/15708973]

URL이 너무 길어서 별도의 파일이름을 지정해주지 않으면
Cannot write to `videoplayback?ip=211.0.0.0&sparams=id,expire,ip,ipbits,itag,algorithm,burst,factor&fexp=904405,900037&algorithm=throttle-factor&itag=35&ipbits=8&burst=40&sver=3&expire=1270890000&key=yt1&signature=5C611E956FB97E74D3435F8815A7A2376E3C61D4.C2C593CDDE0C15671462BB13C5404EC6927F7F7D&factor=1.25&id=99d963576b84b350' (File name too long).
주소가 255자를 넘어서는 관계로, 파일 이름으로 하기에는 너무 길다고 에러가 발생한다.
반드시 -O filename 으로 별도의 이름을 지정해 주어야 한다.

2010/04/09 - youtube 동영상 페이지 fmt_map, fmt_url_map, fmt_list, fmt_stream_map
[링크 : http://kldp.org/node/75150]



 
 

Google 리더를 사용하면 다음과 같은 일들이 가능해집니다.

 
 

2010년 4월 8일 목요일

[지디넷코리아] 네이버가 노란색?…네이버 초기화면 변천사

 
끄자님께서 추천하신 지디넷코리아 기사입니다.
네이버가 노란색?…네이버 초기화면 변천사
이설영 기자 ronia@zdnet.co.kr 2010.04.06 / PM 04:08
네이버 변천사입니다.
[지디넷코리아]...[more]
글로벌 IT의 중심 언론 <메가뉴스>
IT뉴스는 <지디넷코리아>, 게임트렌드는 <게임스팟코리아>
스마트폰으로 읽는 실시간 IT뉴스 <모바일지디넷>
저작권자ⓒ메가뉴스 & ZDNet & CNET. 무단전재 및 재배포 금지