Setup > Terminal 메뉴에서
coding[receive]:KS5601
coding[transmit]KS5601:
locale:korean
CodePage:949
Setup > Terminal 메뉴에서
coding[receive]:KS5601
coding[transmit]KS5601:
locale:korean
CodePage:949
readLine() 을 사용할 수 없는 경우이다.
원 출처는 http://javacan.tistory.com/entry/35
InputStream is;
is = connectionSocket.getInputStream();
String msgBodyStr = "";
BufferedReader br = new BufferedReader(new InputStreamReader(is));
char[] buffBody = new char[1024];
int len = -1;
int sumLen = 0;
while ((len = br.read(buffBody)) != -1){ // br.read(buffBody,0,1); 도 가능
msgBodyStr += new String(buffBodym0, len);
sumLen += len;
if (sumL > = msgBodyLen){
break;
}
}
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
int main ()
{
FILE *fp;
char buf[1024];
char *token;
int cnt;
fp = popen("/usr/bin/wc -l abc.txt", "r");
if (fp == NULL)
{
printf("ERROR:popen fail\n");
exit(0);
}
fread(buf, 1, 1024, fp);
pclose(fp);
printf("buf:%s\n", buf);
token = (char *) strtok(buf, " ");
printf("token:%s\n", token);
cnt = atoi(token);
printf("cnt:%d\n", cnt);
}
Unhandled exception type IOException 컴파일 에러 때
아래 코드 추가
import java.io.IOException;
try {
// 원래 코드
} catch (IOException e) {
System.out.println (ex.toString());
}
find . -name "*.php" | xargs perl -pi -e 's/\<\?/\<\?php/g'
원 출처는
$ ls *.class
$ Sever$Connection.class Server$ConnectionManger.class Server$HTTPMirror.class ...
달러 ($) 표시 클래스는 내부 클래스를 뜻한다.
당연히 프로그램 기동 때 필요한 클래스다.
import = "java.util.Enumeration"
<%
String requestMethod = request.getMethod();
Enumeration enu = request.getParameterNames();
String sNames = "";
while (enu.hasMoreElements()) {
sNames = (String)enu.nextElement();
if ( request.getParameter(sNames).indexOf("script") > -1 ||
request.getParameter(sNames).indexOf("\"") > -1 ||
request.getParameter(sNames).indexOf("<") > -1 ||
request.getParameter(sNames).indexOf(">") > -1 ) {
response.sendRedirect("/index.html");
}
%>