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 <iostream> | |
| using namespace std; | |
| class Base | |
| { | |
| public: | |
| void foo1() { | |
| cout << "BASE foo1" << endl; | |
| } | |
| virtual void foo2() { |
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 java.util.Calendar; | |
| public class StringTest { | |
| public static void formatTest() { | |
| Calendar c = Calendar.getInstance(); | |
| String strtest = String.format("μλ νμΈμ %dμ %dμΌμ λλ€.", | |
| c.get(Calendar.MONTH) + 1, c.get(Calendar.DAY_OF_MONTH)); | |
| System.out.println(strtest); | |
| } | |
| public static void main(String[] args) { |
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 java.net.UnknownHostException; | |
| import java.util.Set; | |
| import com.mongodb.BasicDBObject; | |
| import com.mongodb.DBCollection; | |
| import com.mongodb.DBCursor; | |
| import com.mongodb.DBObject; | |
| import com.mongodb.MongoClient; | |
| import com.mongodb.DB; |
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
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>net.honux</groupId> | |
| <artifactId>qna</artifactId> | |
| <version>1.0.0</version> | |
| <packaging>war</packaging> | |
| <dependencies> | |
| </dependencies> |
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 redis.clients.jedis.Jedis; | |
| public class Test { | |
| private static long time; | |
| private static Jedis jedis = new Jedis("localhost"); | |
| public static void main(String[] args) { | |
| /* | |
| jedis.set("hoyoung", "tired"); | |
| String str = jedis.get("hoyoung"); |
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 java.util.Random; | |
| public class MakeData { | |
| static Random r = new Random(); | |
| public static void main(String[] args) { | |
| int len = 8; | |
| MakeData m = new MakeData(); | |
| int count = Integer.parseInt(args[0]); | |
| m.genData(count, len); |
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> | |
| #include <string.h> | |
| int main(void) { | |
| char *all = "μλ νμΈμ"; | |
| char buf[16]; | |
| buf[0] = all[3]; | |
| buf[1] = all[4]; | |
| buf[2] = all[5]; | |
| buf[3] = '\0'; |
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> | |
| #include <string.h> | |
| #include <wchar.h> | |
| #include <locale.h> | |
| #include <stdlib.h> | |
| #include <time.h> | |
| void print_name(wchar_t all[]); | |
| 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| void foo() {printf("I am foo\n");} | |
| int global = 10; | |
| int main(void) { | |
| int x = 100; | |
| char *literal = "Hello"; //read only, literal[1] = 'h' --> error | |
| char stack[] = "Hello"; //stack | |
| char *heap = (char *) malloc(sizeof(char)* 6); //heap | |
| printf("address of foo = %p\n", foo); |
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> | |
| #include <stdlib.h> | |
| double pow(double x, int n) { | |
| int i; | |
| double ret = 1; | |
| for (i = 0; i < n; i++) ret *= x; | |
| return ret; | |
| } | |
| int main(void) { |