This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Net.Json; | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| String inJson = "{'name':'test', 'type':'test'}"; | |
| JsonTextParser parser = new JsonTextParser(); | |
| JsonObject obj = parser.Parse(outJson); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 파일 읽을 때 | |
| FileInputStream fileInputStream = new FileInputStream("d:\\test.txt"); | |
| BufferedReader reader = new BufferedReader(new InputStreamReader(fileInputStream, "EUCKR")); | |
| while((inputLine = reader.readLine()) != null){ | |
| buffer.append(inputLine); | |
| } | |
| // 파일 쓸 때 | |
| FileOutputStream fileOutputStream = new FileOutputStream("test.txt"); | |
| OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream, "UTF8"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class StringToInputStream{ | |
| public static void main(String[] args){ | |
| String str = "test"; | |
| InputStream is = new ByteArrayInputStream(str.getBytes()); | |
| ..... | |
| ..... | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TestThread1 implements Runnable{ | |
| // implement | |
| public void run(){ | |
| System.out.println("Start Test1 Thread"); | |
| } | |
| } | |
| public class TestThread2 extends Thread{ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int main(){ | |
| const int itemSize = 5; | |
| int array[itemSize] = {3, 8, 0, 1, 4}; | |
| int i = 0; j = 0; | |
| bool noChange = true; | |
| for(i = itemSize-1; i > 0; i--){ | |
| noChange = true; | |
| for(j = 0; j < i; j++){ | |
| if(array[j] > array[j+1]){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void quickSort(int numbers[], int array_size); | |
| void q_sort(int numbers[], int left, int right); | |
| int main(int argc, char **argv) | |
| { | |
| const int itemSize = 6; | |
| int array[itemSize] = {3,8,0,2,1,4}; | |
| quickSort(data, itemSize); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| void merge_sort(int array[],int left ,int right); //분할 함수 | |
| void merge(int num[],int left,int mid,int right); //병합 함수 | |
| const int ITEMSIZE = 6; | |
| int result[ITEMSIZE]; | |
| int main(void) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const int ITEMSIZE = 6; | |
| void insertion_sort(int array[]){ | |
| int i,j; | |
| int key; | |
| for(i=1; i<ITEMSIZE; i++){ | |
| key=array[i]; | |
| for(j=i-1; j>=0; j--){ | |
| if(array[j]>key){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const int ITEMSIZE = 6; | |
| void shell_sort(int array[],int length){ | |
| int i,j,k,tempInt; | |
| int interval = length; | |
| do { | |
| interval = interval/2; // Shell 정렬 간격 설정. | |
| for (i=0; i<interval; i++){ // 인터벌 개수까지만 루프를 실행. | |
| for (j=i+interval; i<length; i+=interval){ // 삽입 정렬. 차이점이라면 인터벌 개수를 기점으로 돌린다는 차이. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import smtplib | |
| from email.MIMEText import MIMEText | |
| def sendMail() : | |
| HOST = 'smtp.server.com' # smtp 호스트 주소 | |
| me = '[email protected]' # 보내는 사람 메일 주소 | |
| you = '[email protected]' # 받는 사람 메일 주소 | |
| contents = '프로그램 뻗었다!!' | |
| msg = MIMEText(contents, _charset='euc-kr') |