윈도우,맥,리눅스등 주어진 용량만큼의 빈파일 만들기
1. mac / linux
$ cd /tmp
$ dd if=/dev/zero of=10mb.bin bs=10m count=10
-> 1m * 10 = 10mb.bin 테스트 파일생성
2.windows
fsutil file createnew c:\temp\10mb.bin 10485760
-> 10mb.bin 테스트 파일생성
1. mac / linux
$ cd /tmp
$ dd if=/dev/zero of=10mb.bin bs=10m count=10
-> 1m * 10 = 10mb.bin 테스트 파일생성
2.windows
fsutil file createnew c:\temp\10mb.bin 10485760
-> 10mb.bin 테스트 파일생성
.asmx란?
- 웹메서드를 제공하기 위한 파일.
- C#에서는 asmx를 참조함으로써 asmx 네임스페이스에 접근할 수 있다.
- sharepoint에서는 아래 표와 같은 asmx를 서비스한다.
페이지 | 설명 |
http://<server:5966>/_vti_adm/Admin.asmx | 사이트 생성이나 삭제등과 같은 관리 함수 - CreateSite - DeleteSite - GetLanguage - RefreshConfigCache |
http://<server>/_vti_bin/Alerts.asmx | 경고와 관련된 작업을 하는 함수 |
http://<server>/_vti_bin/DspSts.asmx | 데이터와 스키마 검색과 관련된 함수 |
http://<server>/_vti_bin/DWS.asmx | 문서 작업과 관련된 함수 |
http://<server>/_vti_bin/Forms.asmx | 사용자 인터페이스 폼과 관련된 함수 - GetForm - GetFormCollection |
http://<server>/_vti_bin/Imaging.asmx | 사진 라이브러리와 관련된 함수 |
http://<server>/_vti_bin/Lists.asmx | 리스트와 관련된 함수 |
http://<server>/_vti_bin/Meetings.asmx | 회의 작업과 관련된 함수 |
http://<server>/_vti_bin/Permissions.asmx | Sharepoint 보안과 관련된 함수 |
http://<server>/_vti_bin/SiteData.asmx | Sharepoint 포탈 서버에서 사용되는 함수 |
http://<server>/_vti_bin/Sites.asmx | 사이트 템플릿을 검색하기 위해 하나의 함수를 포함한다. |
http://<server>/_vti_bin/UserGroup.asmx | 사용자나 그룹과 관련된 작업 함수 |
http://<server>/_vti_bin/versions.asmx | file 버전과 관련된 작업 함수 - DeleteAllVersions - DeleteVersion - GetVersions - RestoreVersion |
http://<server>/_vti_bin/Views.asmx | 목록의 view와 관련된 함수 |
http://<server>/_vti_bin/WebPartPages.asmx | Web Part와 관련된 함수 |
http://<server>/_vti_bin/Webs.asmx | 사이트와 하위 사이트와 관련된 작업 함수 |
1 | http://sharepoint.com/_vti_bin/Lists.asmx?WSDL |
Stub code생성을 위해 console창을 열어 JDK에서 제공하는 wsimport tool을 사용하여 하래와 같이 실행합니다.
1 | wsimport -p com.microsoft.sharepoint -keep -extension sharepoint.wsdl |
정상적으로 실행이 되었다면 실행한 folder에 stub code가 생성됩니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | public static ListsSoap Authentication(String userName, String password) throws Exception { ListsSoap port = null; if (userName != null && password != null) { Lists service = new Lists(); port = service.getListsSoap(); ((BindingProvider) port).getRequestContext() .put(BindingProvider.USERNAME_PROPERTY, userName); ((BindingProvider) port).getRequestContext() .put(BindingProvider.PASSWORD_PROPERTY, password); } else { throw new Exception("Fail: Authentication."); } return port; } |
1 2 3 4 5 6 7 8 9 10 | public static void NTLMAuth(final String userName, final String password) { if (userName != null && password != null) { Authenticator.setDefault(new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(userName, password.toCharArray()); } }); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | public static void readSharePointList(ListsSoap port, String listName, ArrayList<string> listColumnNames, String rowLimit) throws Exception { if (port != null && listName != null && listColumnNames != null && rowLimit != null) { try { String viewName = ""; GetListItems.ViewFields viewFields = null; GetListItems.Query query = null; GetListItems.QueryOptions queryOptions = null; String webID = ""; GetListItemsResponse.GetListItemsResult result = port.getListItems(listName, viewName, query, viewFields, rowLimit, queryOptions, webID); Object listResult = result.getContent().get(0); System.out.print(listResult); } catch (Exception ex) { throw new Exception("Exception :" + ex.toString() + "\n"); } } } </string> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | public static void main(String[] args) { String domain = "Domain\\"; String userName = "userName"; String password = "Password"; httpService.NTLMAuth(domain+userName, password); try { ArrayList<string> listColumnNames = new ArrayList<string>(); listColumnNames.add("Title"); listColumnNames.add("Comments"); ListsSoap port = sharepointService.Authentication(domain+userName, password); sharepointService.readSharePointList(port, "Issue Tracking", listColumnNames, "100"); } catch (Exception e) { e.printStackTrace(); } } </string></string> |
출처: http://xtech.tistory.com/entry/Sharepoint-%EB%82%B4%EC%9A%A9-%EC%9D%BD%EA%B8%B0-with-Java-Tutorial
java에서 클래스 명, 라인 번호 찍기.
java에서 php의 __FILE__ __LINE__과 유사한 기능을 구현하는 방법!!!
String a = "hahaha";
System.out.println("===========디버깅 시작했다~================");
System.out.print("file:" + (new Throwable()).getStackTrace()[0].getClassName() + " line");
System.out.println((new Throwable()).getStackTrace()[0].getLineNumber());
System.out.println(a);
System.out.println("===========디버깅 끝났다~================");
eclipse의 경우 템플릿을 지정해놓으면 더 쉽게 할 수 있다.
도구->환경설정->Java->편집기->템플리트
새로작성
이름: dprt
컨텍스트: java
자동삽입에 체크
설명: 디버깅용 프린트
패턴:
//* debugging~~ ${date} ${time}
System.out.println("===========디버깅 시작했다~================");
System.out.println("time:" + new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date()));
System.out.print(new Throwable().getStackTrace()[0].getClassName() +"." + new Throwable().getStackTrace()[0].getMethodName() + "()" );
System.out.println(" line: " + new Throwable().getStackTrace()[0].getLineNumber());
System.out.println(${cursor});
System.out.println("===========디버깅 끝났다~================");
// the end of debuuging.. */
요렇게 넣고 확인하면..
java 코드에서 "dprt"라고 치고 ctrl+space 치면 위의 구문들이 찍힌다. 디버깅용으로 굉장히 편하다.
log4j 써도 된다~
httpd.conf 파일이나, .htaccess 파일을 이용해,
ErrorDocument command 로 오류 처리를 할 수 있다.
'ErrorDocument 404 /404.html'
만약, /404.html 은 동작안하고, http://도메인/404.html 은 동작할경우,
404.html 파일 용량이 512k가 넘도록 만들어야 한다.
안그러면 성의없는 답변으로 explore 자체에서 무시해 버린다.
이 오류로 한참 찾았음....
1. 케스팅 문제
reinstance_cast, const_cast, 등 2가지가 더 있다. 찾아라~
2. vector 와 list 의 차이 그리고 당신이라면 어떤 경우에 어떤 자료형을 사용 할 것인가.
3. map과 hash map 의 차이와 어떤 경우에 어떤 자료형?
4. 너라면 게임 서버 설계를 어찌 할 것인가?, 그리고 왜???
5. 사용해본 패턴들과 그 패턴의 설명 (난 preactor 패턴이랑 singleton 말 했음. 각자 패턴 1~2개 설명 해봐~)
6. TCP/UDP 차이
7. DataBase 사용 여부와 DB에 어떤 방법을 접근했는지.
8. class와 struct의 차이
9. 오버로딩, 오버라이딩의 차이
10. 상속과 포함의 차이와 언제 어떻게 사용 할 것인가.
11. 설계를 하고 코딩을 하는가?
12. 내 서버 설명.
출처) http://cafe.naver.com/networkach.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=116
1 <script language="javascript">
2 <!--
3 function resizeImg(imgObj) {
4 // 이미지 별도 로딩으로 원래 사이즈 추출
5 var maxHight=265; // 최대 이미지 사이즈
6 var maxWidth=320; // 최대 이미지 사이즈
7 var imgOriginal = new Image();
8 imgOriginal.src = imgObj.src;
9 // 가로와 세로 중 어느걸 기준으로 줄일지 결정
10 if(imgOriginal.width >= maxWidth && imgOriginal.height >= maxHight ){
11 var baseAxis;
12 if ( (imgOriginal.width / maxWidth) > (imgOriginal.height / maxHight) ){
13 baseAxis = 'width';
14 }else{
15 baseAxis = 'height';
16 }
17
18 // 결정된 기준을 바탕으로 나머지 길이를 리사이징
19 if (baseAxis == 'width') {
20 imgObj.height = Math.round(imgOriginal.height *(maxWidth / imgOriginal.width));
21 imgObj.width = Math.round(imgOriginal.width * (imgObj.height / imgOriginal.height));
22 }else{ // baseAxis == 'height'
23 imgObj.width = Math.round(imgOriginal.width * (maxHight / imgOriginal.height));
24 imgObj.height = Math.round(imgOriginal.height *(imgObj.width / imgOriginal.width));
25 }
26
27 }else if(imgOriginal.width >= maxWidth && imgOriginal.height < maxHight ){
28 imgObj.width = maxWidth;
29 imgObj.height = Math.round(imgOriginal.height *(maxWidth / imgOriginal.width));
30
31 }else if(imgOriginal.width < maxWidth && imgOriginal.height >= maxHight ){
32 imgObj.width = Math.round(imgOriginal.width * (maxHight / imgOriginal.height));
33 imgObj.height = maxHight;
34
35 }else{
36 imgObj.height=imgOriginal.height;
37 imgObj.width=imgOriginal.width;
38 }
39 }
40 //-->
41 </script>
42
43 <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#DDDDDD">
44 <tr>
45 <td height="310" bgcolor="#FFFFFF" align="center">
46 <img src="이미지 경로" id="bg" name="imgsrc" onload="resizeImg(this);"></td>
47 </tr>
48 </table>