while ( i != you ) i++;

공지 사항

분류없음 2014.06.17 06:14 by Yohan Chon

Yohan Chon's citations [PDF Version] [at Google Scholar Citations]



Contact Information

SAMSUNG Electronics | Anycall SCH-W330 | 1/21sec | F/2.8 | +0.78 EV | 2009:04:05 13:47:38

  Yohan, Chon (John, Chon)

Bibliography
Yohan Chon is currently a Ph.D. candidate in computer science, Yonsei University, Korea. where he received his B.S. and M.S. degrees in 2009 and 2011, respectively. His research interests include mobile sensing systems, human mobility prediction and context-aware pervasive computing.

Education
M.S., Computer Science, Yonsei University, Seoul, Korea, 2011
Concentrations: Computer Science, Mobile Computing, Context-Aware Computing
Thesis: Smartphone-based Context Provider for Everyday Location Monitoring

B.S, Computer Science, Yonsei University, Seoul, Korea, 2009

Publications
CrowdSensing & Big Data Mining (7)
Human Mobility Monitoring & Prediction (6)
Location Tracking & Location-based Services (14)
Power Management (9)
  • J. Lee, Y. Chon, H. Cha, "Evaluating battery aging on mobile devices," In Proceedings of the 52nd Annual Design Automation Conference (DAC '15). ACM, New York, NY, USA, Article 135 , 6 pages. 2015.
  • S. Lee, W. Jung, Y. Chon, H. Cha, "EnTrack: a system facility for analyzing energy consumption of Android system services," In Proceedings of the 2015 ACM International Joint Conference on Pervasive and Ubiquitous Computing (UbiComp '15). ACM, New York, NY, USA, 191-202. 2015.
  • D. Kim, Y. Chon, W. Jung, Y. Kim, H. Cha, "Accurate Prediction of Available Battery Time for Mobile Applications," in ACM Trans. Embed. Comput. Syst. 15, 3, Article 48 (May 2016), 17 pages.
  • S. Kim, Y. Chon, S. Lee and H. Cha, "Prediction-based personalized offloading of cellular traffic through WiFi networks," in 2016 IEEE International Conference on Pervasive Computing and Communications (PerCom), Sydney, NSW, 2016, pp. 1-9.
  • W. Jung, Y. Chon, D. Kim, H. Cha, "Powerlet: An Active Battery Interface for Smartphones," in Proceeding of 2014 ACM International Joint Conference on Pervasive and Ubiquitous Computing (UbiComp'14), 2014, ACM, Seattle, USA, Accepted.
  • S. Lee, G. Ryu, Y. Chon, R. Ha, H. Cha, "Automatic Standby Power Management using Usage Profiling and Prediction," IEEE Transactions on Human-Machine Systems, vol.43, no.6, pages.535-546, Nov. 2013. SCI.[at IEEEXplore]
  • S. Lee, Y. Chon, Y. Kim, H. Rhan, H. Cha, "Occupancy Prediction Algorithms for Thermostat Control Systems using Mobile Devices," IEEE Transactions on Smart Grid,, vol.4, no.3, pages.1332-1340, Sept. 2013. SCIE.[at IEEEXplore]
  • Y. Chon,W. Ryu, H. Cha, "Predicting Smartphone Battery Usage using Cell Tower ID Monitoring," Pervasive and Mobile Computing, Elsevier, June, 2013, SCIE. [at ScienceDirect]
  • C. Yoon, Y. Chon, H. Cha, "PION: Human Mobility-based Service Provisioning Framework for Smartphone Users," in Proceeding of 9th Annual IEEE Communications Society Conference on Sensor, Mesh, and Ad Hoc Communications and Networks (SECON 2012), pages.174-181, 2012, IEEE, Seoul, Korea. Accept Ratio 31% (68 accepted out of 219 submissions). [at IEEEXplore] [Slide]
Delay Tolerant Network (3)
Awards and Fellowships
  • ACM UbiComp 2012 Best Paper Award
  • Microsoft Research Asia Fellowship (Microsoft Research Asia 2011)
  • ACM HotPlanet 2011 Mobility Data Contest sponsored by Google, 1st Prize [Slide]
  • Global Ph.D. Fellowship (Ministry of Education, Science, and Technology, Korea, 2011-2012)
  • Teaching Assistant (Yonsei University, 2010)
  • Research Assistant (Yonsei University, 2009-2010)
  • Student Scholarship (Yonsei University, 2003, 2007, 2008)
Academic Services
  • PhD Forum Organizer at ACM International Conference on Mobile Systems, Applications, and Services 2013 (MobiSys'13)
  • External Reviewer at ACM Transactions on Autonomous and Adaptive Systems (TAAS)
  • Website/Publicity Chair at Mobile Sensing 2013, Workshop with ACM/IEEE Conference on Information Processing in Sensor Networks 2013 (IPSN'13)
  • External Reviewer at IEEE Wireless Communications and Networking Conference 2013 (WCNC'13)
  • External Reviewer at ACM Transactions on Sensor Networks
  • External Reviewer at ACM 14th International Conference on Ubiquitous Computing 2012 (UbiComp'12)
  • External Reviewer at IEEE Transactions on Systems, Man, and Cybernetics, Part C: Applications and Reviews
Teaching Experience
  • C Programming, Spring, 2013, Yonsei University
  • Educational PC, Fall, 2012, Yonsei University
  • Engineering Information Processing, Teaching Assistant for Programming Practice, Spring, Fall, Winter, 2010, Yonsei University
Project Experience
  • "Development of a Pedestrian Dead Reckoning Algorithms," funded by Hubilon, July 2012 ~ October 2012
  • "Development of a Human-centric Mobile Sensing Framework Exploiting Human Mobility Patterns," funded by Microsoft Research AsiaProject Leader, April 2011 ~ March 2012
  • "Smartphone-based Indoor Pedestrian Tracking and Floor-Plan Construction," funded by LG Electronics, Project Leader, December 2010 ~ November 2011
  • "Seamless Mobile Node Localizations based on Sensor-Communication Fusion Technology," funded by Ministry of Education, Science and Technology, Korea, May 2009 ~ December 2010
  • "Development of an iPhone-based Seamless Location Provider for Advanced Location-based Service," funded by Ministry of Education, Science and Technology, Korea, Project Mentor, March 2010 ~ August 2010
  • "Development of Adaptive System Software for Sensor Network Applications," funded by Ministry of Education, Science and Technology, Korea, January 2009 ~ March 2010
Patent
  • Method, Apparatus and System for Tracking Lost Device, Korea Patent Registration No.1161097, June. 2012.
  • Method for Tracking User Location, Method and Apparatus for Constructing Map using the Same, Korea Patent Registration No.1161103, June. 2012.
  • Apparatus for Tracking Position using Sensors Mounted in the Mobile Phone and Method for Tracking, Korea Patent Registration No.1104591, Jan. 2012.
  • IMU-aided Collaborative and Autonomous RSS Fingerprinting for Localization, Korea Patent Registration No.1089995, Nov. 2011.


저작자 표시 비영리 동일 조건 변경 허락
신고
크리에이티브 커먼즈 라이선스
Creative Commons License
Project/LifeMap 2013.07.10 14:43 by Yohan Chon

The dataset is available in CRAWDAD community.

(We temporally link our dataset at here until CRAWDAD releases the dataset)

These codes are used for generating figures in following paper:

  • Y. Chon, N.D. Lane, Y. Kim, F. Zhao, H. Cha, "Understanding the Coverage and Scalability of Place-centric CrowdSensing," in Proceeding of 2013 ACM International Joint Conference on Pervasive and Ubiquitous Computing (UbiComp'13), 2013, ACM, Zurich, Switzerland.

The collected image and audio data are not released due to the privacy issue.

The crawled social network data and codes related to social network data are not released either, since we don't have the permission to open social network data.

Download full source code at here. It works at eclipse project, and you should change directory for library files.


  • Constant variables for database
	
        // Version 22 for v1.0 Release
	public static final String LOCATION_TABLE = "locationTable";
	public static final String EDGE_TABLE = "edgeTable";

	public static final String CATEGORY_TABLE = "categoryTable";
	public static final String CATEGORY_SET_TABLE = "categorySetTable";
	public static final String CONFIGURE_TABLE = "configureTable";

	public static final String STAY_TABLE = "stayTable";

	public static final String NO_RADIO_TABLE = "noRadioTable";

	// Version 26 for v1.2 Release
	public static final String BATTERY_TABLE = "batteryTable";
	
	// Version 35 for v2.1 Release
	public static final String WIFI_AP_TABLE = "wifiApTable";
	public static final String WIFI_SIGNAL_TABLE = "wifiSignalTable";
	public static final String LIGHT_TABLE = "lightTable";
	public static final String SCREEN_TABLE = "screenTable";
	public static final String ORIENTATION_TABLE = "orientationTable";
	public static final String WIFI_LOC_TABLE = "wifiLocTable";
	
	// Version 37 for v2.2 Release
	public static final String NET_TRAFFIC_TABLE = "netTrafficTable";
	public static final String APP_TABLE = "appTable";
	public static final String APP_STATUS_TABLE = "appStatusTable";
	public static final String APP_NET_TRAFFIC_TABLE = "appNetTrafficTable";

	// Version 38 for v2.2 Release
	public static final String LOCATION_RAW_TABLE = "locationRawTable";

	public static final String LOCATION_KEY_ID = "_node_id";
	public static final String LOCATION_KEY_LATITUDE = "_latitude";
	public static final String LOCATION_KEY_LONGITUDE = "_longitude";
	public static final String LOCATION_KEY_LATITUDE_GPS = "_latitude_gps";
	public static final String LOCATION_KEY_LONGITUDE_GPS = "_longitude_gps";
	public static final String LOCATION_KEY_LATITUDE_WIFI = "_latitude_wifi";
	public static final String LOCATION_KEY_LONGITUDE_WIFI = "_longitude_wifi";
	public static final String LOCATION_KEY_ALTITUDE = "_altitude";
	public static final String LOCATION_KEY_ACCURACY = "_accuracy";
	public static final String LOCATION_KEY_ACCURACY_GPS = "_accuracy_gps";
	public static final String LOCATION_KEY_ACCURACY_WIFI = "_accuracy_wifi";
	public static final String LOCATION_KEY_ACTIVITY = "_activity";
	public static final String LOCATION_KEY_PLACE_NAME = "_place_name";
	public static final String LOCATION_KEY_PLACE_COMMENT = "_place_comment";
	public static final String LOCATION_KEY_TIME = "_time_location";

	public static final String EDGE_KEY_ID = "_edge_id";
	public static final String EDGE_KEY_NODE_ID = LOCATION_KEY_ID;
	public static final String EDGE_KEY_DES_NODE_ID = "_destination_node_id";
	public static final String EDGE_KEY_TIME = "_time_edge";
	
	public static final String CATEGORY_KEY_ID = "_category_id";
	public static final String CATEGORY_KEY_PLACE_NAME = "_category_place_name";
	public static final String CATEGORY_KEY_ACTIVE = "_category_active";
	public static final String CATEGORY_KEY_EDITABLE = "_category_editable";
	public static final String CATEGORY_KEY_RES_ID = "_category_res_id";
	public static final String CATEGORY_KEY_TIME = "_time_category";

	public static final String CATEGORY_SET_KEY_ID = "_category_set_id";
	public static final String CATEGORY_SET_KEY_CATEGORY_ID = CATEGORY_KEY_ID;
	public static final String CATEGORY_SET_KEY_LOCATION_ID = LOCATION_KEY_ID;
	public static final String CATEGORY_SET_KEY_HUMAN_ID = "_category_set_human_id";
	public static final String CATEGORY_SET_KEY_TIME = "_time_category_set";

	public static final String CONFIGURE_KEY_ID = "_configure_id";
	public static final String CONFIGURE_KEY_TIME_INTERVAL = "_configure_time_interval";
	public static final String CONFIGURE_KEY_UNCATEGORIZED_VIEW = "_configure_uncategorized_view";
	public static final String CONFIGURE_KEY_SENSOR_USAGE_LOG = "_configure_sensor_usage_log";
	public static final String CONFIGURE_KEY_BATTERY_LOG = "_configure_battery_log";
	public static final String CONFIGURE_KEY_WIFI_LOG = "_configure_wifi_log";
	public static final String CONFIGURE_KEY_CELL_LOG = "_configure_cell_log";
	public static final String CONFIGURE_KEY_GPS_LOG = "_configure_gps_log";
	public static final String CONFIGURE_KEY_APP_LOG = "_configure_app_log";
	public static final String CONFIGURE_KEY_LAST_NODE_ID = "_configure_last_node_id";
	public static final String CONFIGURE_KEY_LAST_ACTIVITY = "_configure_last_activity";
	public static final String CONFIGURE_KEY_NICKNAME = "_configure_nickname";
	public static final String CONFIGURE_KEY_TOP_PLACE = "_configure_top_place";
	public static final String CONFIGURE_KEY_FROM_DATE = "_configure_from_date";
	public static final String CONFIGURE_KEY_FOURSQUARE_TOKEN = "_configure_foursquare_token";
	public static final String CONFIGURE_KEY_FACEBOOK_TOKEN = "_configure_facebook_token";
	public static final String CONFIGURE_KEY_FACEBOOK_EXPIRE_TIMESTAMP = "_configure_foursquare_expire_timestamp";
	public static final String CONFIGURE_KEY_TIME = "_time_configure";

	public static final String STAY_KEY_ID = "_stay_id";
	public static final String STAY_KEY_NODE_ID = LOCATION_KEY_ID;
	public static final String STAY_KEY_STAY_TIME = "_stay_time";
	public static final String STAY_KEY_STAY_START_TIME = "_stay_start_time";
	public static final String STAY_KEY_TIME = "_time_stay";

	public static final String BATTERY_KEY_ID = "_battery_id";
	public static final String BATTERY_KEY_LEVEL = "_battery_level";
	public static final String BATTERY_KEY_STATUS = "_battery_status";
	public static final String BATTERY_KEY_VOLTAGE = "_battery_voltage";
	public static final String BATTERY_KEY_TIME = "_time_battery";
	
	public static final String NO_RADIO_KEY_ID = "_no_radio_id";
	public static final String NO_RADIO_KEY_DURATION = "_no_radio_duration";
	public static final String NO_RADIO_KEY_START_TIME = "_no_radio_start_time";
	public static final String NO_RADIO_KEY_TIME = "_time_no_radio";

	// Since v2.1 Release
	public static final String WIFI_AP_KEY_ID = "_wifi_ap_id";
	public static final String WIFI_AP_KEY_BSSID = "_wifi_ap_bssid";
	public static final String WIFI_AP_KEY_SSID = "_wifi_ap_ssid";
	public static final String WIFI_AP_KEY_OPEN = "_wifi_ap_open";
	public static final String WIFI_AP_KEY_TIMESTAMP = "_wifi_ap_timestamp";
	
	public static final String WIFI_SIGNAL_KEY_ID = "_wifi_signal_id";
	public static final String WIFI_SIGNAL_KEY_AP_ID = WIFI_AP_KEY_ID;
	public static final String WIFI_SIGNAL_KEY_SIGNAL = "_wifi_signal_signal";
	public static final String WIFI_SIGNAL_KEY_TIMESTAMP = "_wifi_signal_timestamp";
	
	public static final String LIGHT_KEY_ID = "_light_id";
	public static final String LIGHT_KEY_LOCATION_ID = LOCATION_KEY_ID;
	public static final String LIGHT_KEY_VALUE = "_light_value";
	public static final String LIGHT_KEY_TIMESTAMP = "_light_timestamp";
	
	public static final String SCREEN_KEY_ID = "_screen_id";
	public static final String SCREEN_KEY_VALUE = "_screen_value";
	public static final String SCREEN_KEY_TIMESTAMP = "_screen_timestamp";
	
	public static final String ORIENTATION_KEY_ID = "_orientation_id";
	public static final String ORIENTATION_KEY_AZIMUTH = "_orientation_azimuth";
	public static final String ORIENTATION_KEY_PITCH = "_orientation_pitch";
	public static final String ORIENTATION_KEY_ROLL = "_orientation_roll";
	public static final String ORIENTATION_KEY_TIMESTAMP = "_orientation_timestamp";	
	
	public static final String WIFI_LOC_KEY_ID = "_wifi_loc_id";
	public static final String WIFI_LOC_KEY_LOCATION_ID = LOCATION_KEY_ID;
	public static final String WIFI_LOC_KEY_AP_ID = WIFI_AP_KEY_ID;
	public static final String WIFI_LOC_KEY_SIGNAL = "_wifi_loc_signal";
	public static final String WIFI_LOC_KEY_SIGNAL_DEVIATION = "_wifi_loc_signal_deviation";
	public static final String WIFI_LOC_KEY_SAMPLE_COUNT = "_wifi_loc_sample_count";
	public static final String WIFI_LOC_KEY_TIMESTAMP = "_wifi_loc_timestamp";

	// Since v2.2 Release
	public static final String NET_TRAFFIC_KEY_ID = "_net_traffic_id";
	public static final String NET_TRAFFIC_KEY_MOBILE_RX = "_net_traffic_mobile_rx";
	public static final String NET_TRAFFIC_KEY_MOBILE_TX = "_net_traffic_mobile_tx";
	public static final String NET_TRAFFIC_KEY_TOTAL_RX = "_net_traffic_total_rx";
	public static final String NET_TRAFFIC_KEY_TOTAL_TX = "_net_traffic_total_tx";
	public static final String NET_TRAFFIC_KEY_TIMESTAMP = "_net_traffic_timestamp";

	public static final String APP_KEY_ID = "_app_id";
	public static final String APP_KEY_PROCESS = "_app_process";
	public static final String APP_KEY_TIMESTAMP = "_app_timestamp";
	
	public static final String APP_STATUS_KEY_ID = "_app_status_id";
	public static final String APP_STATUS_KEY_APP_ID = APP_KEY_ID;
	public static final String APP_STATUS_KEY_PID = "_app_status_pid";
	public static final String APP_STATUS_KEY_UID = "_app_status_uid";
	public static final String APP_STATUS_KEY_IMPORTANCE = "_app_status_importance";
	public static final String APP_STATUS_KEY_LRU = "_app_status_lru";
	public static final String APP_STATUS_KEY_TIMESTAMP = "_app_status_timestamp";
	
	public static final String APP_NET_TRAFFIC_KEY_ID = "_app_net_traffic_id";
	public static final String APP_NET_TRAFFIC_KEY_APP_ID = APP_KEY_ID;
	public static final String APP_NET_TRAFFIC_KEY_RX = "_app_net_traffic_rx";
	public static final String APP_NET_TRAFFIC_KEY_TX = "_app_net_traffic_tx";
	public static final String APP_NET_TRAFFIC_KEY_TIMESTAMP = "_app_net_traffic_timestamp";
	
	public static final String LOCATION_RAW_KEY_ID = "_location_raw_id";
	public static final String LOCATION_RAW_KEY_LATITUDE = "_location_raw_latitude";
	public static final String LOCATION_RAW_KEY_LONGITUDE = "_location_raw_longitude";
	public static final String LOCATION_RAW_KEY_ACCURACY = "_location_raw_accuracy";
	public static final String LOCATION_RAW_KEY_TIMESTAMP = "_location_raw_timestamp";
  • Composition of study population (related to Figure 3)
    • Input Parameters
      • String dir: directory that stores database file (e.g., "C:\\LifeMap_Database\\")
      • String outputDir: directory that stores the results
    • Fields in output file
      • Filename
      • Nickname
      • Gender
      • Age
      • Occupation: jobs (e.g., undergraduate student, graduate student, office worker, high school student)
      • StartDate: first date of data collection
      • EndDate: last date of data collection
      • Period
      • HitDate(%): number of days with sensing (hitdate / period)
      • Place: number of places
      • Path: number of paths
      • Stay: number of stays
      • Naming(%): number of places with labeled name (naming / place)
      • Category(%): number of places with labeled category (category / place)
      • WiFi: number of unique WiFi APs
      • WiFiPlace(%): number of places with surrounding APs (WiFiPlace / place)
	public void showPopulation(String dir, String outputDir) {
		FileOutputStream fos = null;
		OutputStreamWriter osw = null;
		SimpleDateFormat sdfDate = new SimpleDateFormat("yyyyMMddHHmmss");
		SimpleDateFormat sdfDateOnly = new SimpleDateFormat("yyyy-MM-dd");
		final String START_DATE = "20101101000000", END_DATE = "20130601000000";
		
		try {
			String outputFileName = outputDir + LifeMapParameter.longToTimeString(System.currentTimeMillis()) + "_Description.csv";
			File outputFile = new File(outputFileName);
			fos = new FileOutputStream(outputFile);
			osw = new OutputStreamWriter(fos, "UTF8");
			
			osw.write("Filename,Nickname,Gender,Age,Occupation,StartDate,EndDate,Period,HitDate,HitDate(%),Place,Path,Stay,Naming,Naming(%)," +
					"Category,Category(%)," +
					"WiFi,WiFiPlace,WiFiPlace(%)," +
					"\n");
			
			File root = new File(dir);
			if(!root.isDirectory()) return;
			String[] list = root.list();
			for(int i=0 ; i < list.length ; i++) {
				String filename = list[i];
				if(filename.equals(".") || filename.equals("..")) continue;
				File f = new File(dir + filename);
				if(f.isDirectory()) continue;
				else if(filename.contains(".db")) {
					if(conn != null && !conn.isClosed()) conn.close();
					conn = DriverManager.getConnection("jdbc:sqlite:" + dir + filename);
					System.out.println("Filename(" + (i+1) + "/" + list.length + "): " + filename);
					
					try {
						HashSet hsDate = new HashSet(); // Count day with sensing
						HashSet hsWifi = new HashSet();
						int placeCount = 0, pathCount = 0, stayCount = 0, namingPlaceCount = 0, categorizedPlaceCount = 0, wifiPlaceCount = 0, cellPlaceCount = 0;
						String firstTimestamp = null, lastTimestamp = null, nickname = null;
						Statement stmConf = conn.createStatement();
						ResultSet rsConf = this.getAllEntries(stmConf, CONFIGURE_TABLE);
						if(rsConf.next()) {
							try {
								nickname = rsConf.getString(rsConf.findColumn(CONFIGURE_KEY_NICKNAME));
							}
							catch (Exception e) {
								
							}
						}
						rsConf.close();
						stmConf.close();
						if(nickname == null) nickname = "Unknown";
						
						// Count number of places, places with name, category, or WiFi APs
						Statement stmLoc = conn.createStatement();
						ResultSet rsLoc = this.getAllEntries(stmLoc, LOCATION_TABLE, LOCATION_KEY_ACTIVITY + "=" + LifeMapParameter.ACTIVITY_STAY);
						while(rsLoc.next()) {
							long nodeId = rsLoc.getLong(rsLoc.findColumn(LOCATION_KEY_ID));
							String placeName = rsLoc.getString(rsLoc.findColumn(LOCATION_KEY_PLACE_NAME));
							String timestamp = rsLoc.getString(rsLoc.findColumn(LOCATION_KEY_TIME));
							if(timestamp.compareTo(START_DATE) < 0 || timestamp.compareTo(END_DATE) > 0) continue;
							if(firstTimestamp == null || firstTimestamp.compareTo(timestamp) > 0) firstTimestamp = timestamp;
							if(lastTimestamp == null || lastTimestamp.compareTo(timestamp) < 0) lastTimestamp = timestamp;
							hsDate.add(timestamp.substring(0, 8));
							placeCount++;
							if(placeName != null && placeName.length() > 0) namingPlaceCount++;
							String categoryName = this.getCategoryName(nodeId);
							if(categoryName != null && categoryName.length() > 0 && !categoryName.equals("Unknown")) categorizedPlaceCount++;
							if(hasWifiAp(nodeId)) wifiPlaceCount++;
						}
						rsLoc.close();
						
						// Count number of points in paths
						rsLoc = this.getAllEntries(stmLoc, LOCATION_TABLE, LOCATION_KEY_ACTIVITY + "!=" + LifeMapParameter.ACTIVITY_STAY);
						while(rsLoc.next()) {
							String timestamp = rsLoc.getString(rsLoc.findColumn(LOCATION_KEY_TIME));
							if(timestamp.compareTo(START_DATE) < 0 || timestamp.compareTo(END_DATE) > 0) continue;
							hsDate.add(timestamp.substring(0, 8));
							pathCount++;
						}
						rsLoc.close();
						stmLoc.close();
						
						// Count number of stays in places
						Statement stmStay = conn.createStatement();
						ResultSet rsStay = this.getAllEntries(stmStay, STAY_TABLE);
						while(rsStay.next()) {
							String startTimestamp = rsStay.getString(rsStay.findColumn(STAY_KEY_STAY_START_TIME));
							String endTimestamp = rsStay.getString(rsStay.findColumn(STAY_KEY_TIME));
							if(startTimestamp.compareTo(START_DATE) < 0 || startTimestamp.compareTo(END_DATE) > 0 || endTimestamp.compareTo(START_DATE) < 0 || endTimestamp.compareTo(END_DATE) > 0) continue;
							if(firstTimestamp == null || firstTimestamp.compareTo(startTimestamp) > 0) firstTimestamp = startTimestamp;
							if(lastTimestamp == null || lastTimestamp.compareTo(endTimestamp) < 0) lastTimestamp = endTimestamp;
							hsDate.add(startTimestamp.substring(0, 8));
							hsDate.add(endTimestamp.substring(0, 8));
							stayCount++;
						}
						rsStay.close();
						stmStay.close();
						
						// WiFi Count
						Statement stmWifi = conn.createStatement();
						ResultSet rsWifi = this.getAllEntries(stmWifi, WIFI_AP_TABLE);
						while(rsWifi.next()) {
							String bssid = rsWifi.getString(rsWifi.findColumn(WIFI_AP_KEY_BSSID));
							hsWifi.add(bssid);
						}
						rsWifi.close();
						stmWifi.close();

						if(firstTimestamp == null || lastTimestamp == null) continue;
						
						Calendar firstCal = Calendar.getInstance(), lastCal = Calendar.getInstance();
						firstCal.setTime(sdfDate.parse(firstTimestamp.substring(0, 8) + "000000"));
						lastCal.setTime(sdfDate.parse(lastTimestamp.substring(0, 8) + "000000"));
						int period = 1 + (int)((lastCal.getTimeInMillis() - firstCal.getTimeInMillis()) / LifeMapParameter.DAY);
						
						String userInfo = "";
						StringTokenizer stk = new StringTokenizer(filename, ".");
						while(stk.hasMoreTokens()) {
							String token = stk.nextToken();
							if(token.equals("M")) userInfo += "Male,";
							else if(token.equals("F")) userInfo += "Female,";
							else if(token.equals("db")) { }
							else if(token.length() > 5 && token.charAt(token.length()-2) >= '0' && token.charAt(token.length()-2) <= '9') userInfo += token.substring(0, token.length()-2) + ",";
							else userInfo += token + ",";
						}
						// Filename,Nickname,Gender,Age,Occupation,StartDate,EndDate,Period,HitDate,Place,Path,Stay,
						// Naming,Naming(%),Category,Category(%),WiFi,WiFiPlace,WiFiPlace(%)
						osw.write(filename + "," + nickname + "," + userInfo +
								firstTimestamp.substring(0, 4)+"-"+firstTimestamp.substring(4, 6)+"-"+firstTimestamp.substring(6, 8) + "," +
								lastTimestamp.substring(0, 4)+"-"+lastTimestamp.substring(4, 6)+"-"+lastTimestamp.substring(6, 8) + "," +
								period + "," + hsDate.size() + "," + ((double)hsDate.size()/period) + "," + placeCount + "," + pathCount + "," + stayCount + "," + 
								namingPlaceCount + "," + ((double)namingPlaceCount/placeCount) + "," +
								categorizedPlaceCount + "," + ((double)categorizedPlaceCount/placeCount) + "," +
								hsWifi.size() + "," + wifiPlaceCount + "," + ((double)wifiPlaceCount/placeCount));
						osw.write("\n");
					}
					catch (Exception e) {
						System.out.println("Error !!!!!!");
					}
					finally {
						if(conn != null && !conn.isClosed()) conn.close();						
					}
				}
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		finally {
			try {
				if(conn != null && !conn.isClosed()) conn.close();
				if(osw != null) osw.close(); if(fos != null) fos.close();
			}
			catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

	private boolean hasWifiAp(long nodeId) {
		boolean res = false;
		try {
			Statement stm = conn.createStatement();
			ResultSet rs = this.getAllEntries(stm, WIFI_LOC_TABLE, WIFI_LOC_KEY_LOCATION_ID + "=" + nodeId);
			while(rs.next()) {
				res = true;
			}
			rs.close();
			stm.close();
		}
		catch (Exception e) {
			
		}
		
		return res;
	}
  • Location trace (related to Figure 4)
    • Input Parameters
      • String dir: directory that stores database file (e.g., "C:\\LifeMap_Database\\")
      • String outputDir: directory that stores the results
    • Fields in output file
      • Latitude
      • Longitude
      • Type: Stay, Move
      • VisitCount: number of visits
	public void showLocationPoint(String dir, String outputDir) {
		FileOutputStream fos = null;
		OutputStreamWriter osw = null;
		SimpleDateFormat sdfDate = new SimpleDateFormat("yyyyMMddHHmmss");
		SimpleDateFormat sdfDateOnly = new SimpleDateFormat("yyyy-MM-dd");
		final String START_DATE = "20101101000000", END_DATE = "20130601000000";
		
		try {
			String outputFileName = outputDir + LifeMapParameter.longToTimeString(System.currentTimeMillis()) + "_LocationList.csv";
			File outputFile = new File(outputFileName);
			fos = new FileOutputStream(outputFile);
			osw = new OutputStreamWriter(fos, "UTF8");
			
			osw.write("Latitude,Longitude,Type,VisitCount" +
					"\n");
			
			File root = new File(dir);
			if(!root.isDirectory()) return;
			String[] list = root.list();
			for(int i=0 ; i < list.length ; i++) {
				String filename = list[i];
				if(filename.equals(".") || filename.equals("..")) continue;
				File f = new File(dir + filename);
				if(f.isDirectory()) continue;
				else if(filename.contains(".db")) {
					if(conn != null && !conn.isClosed()) conn.close();
					conn = DriverManager.getConnection("jdbc:sqlite:" + dir + filename);
					System.out.println("Filename(" + (i+1) + "/" + list.length + "): " + filename);
					
					try {
						Statement stmLoc = conn.createStatement();
						ResultSet rsLoc = this.getAllEntries(stmLoc, LOCATION_TABLE, LOCATION_KEY_LATITUDE + "!=" + LifeMapParameter.UNKNOWN_LOCATION + " AND " + LOCATION_KEY_LONGITUDE + "!=" + LifeMapParameter.UNKNOWN_LOCATION);
						while(rsLoc.next()) {
							long nodeId = rsLoc.getLong(rsLoc.findColumn(LOCATION_KEY_ID));
							int latitude = rsLoc.getInt(rsLoc.findColumn(LOCATION_KEY_LATITUDE));
							int longitude = rsLoc.getInt(rsLoc.findColumn(LOCATION_KEY_LONGITUDE));
							int activity = rsLoc.getInt(rsLoc.findColumn(LOCATION_KEY_ACTIVITY));
							osw.write(latitude / 1E6 + "," + longitude / 1E6 + ",");
							switch(activity) {
							case LifeMapParameter.ACTIVITY_STAY:
								int count = this.getVisitedNumberOfDate(STAY_KEY_NODE_ID + "=" + nodeId);
								osw.write("Stay," + count + "\n");
								break;
							default:
								osw.write("Move,1\n");
								break;
							}
						}
						rsLoc.close();
						stmLoc.close();
					}
					catch (Exception e) {
						System.out.println("Error !!!!!!");
					}
					finally {
						if(conn != null && !conn.isClosed()) conn.close();						
					}
				}
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		finally {
			try {
				if(conn != null && !conn.isClosed()) conn.close();
				if(osw != null) osw.close(); if(fos != null) fos.close();
			}
			catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
	
	public int getVisitedNumberOfDate(String where)  {
		int count = 0;
		try {
			String query = 
				"SELECT " 
					+ STAY_KEY_NODE_ID + ", " 
					+ " SUBSTR(" + STAY_KEY_TIME + ",1,8) AS DATE, " 
					+ " COUNT(1) AS COUNT "
				+ "FROM "
					+ STAY_TABLE + " ";
			if (where != null)
				query += " WHERE " + where;
			query += " GROUP BY " + STAY_KEY_NODE_ID + ", DATE";

			Statement stm = conn.createStatement();
			ResultSet cursor = stm.executeQuery(query);
			while(cursor.next()) {
				count++; 
			}
			cursor.close();
			stm.close();			
		}
		catch (SQLException e) {
			e.printStackTrace();
		}
		
		return count;
	}
  • Interval between visits at same places (related to Figure 5)
    • Input Parameters
      • String dir: directory that stores database file (e.g., "C:\\LifeMap_Database\\")
      • String outputDir: directory that stores the results
    • Fields in output file
      • Name: anonymized place name, "Unknown" indicates that a user did not put the name of place 
      • Category: category of place, "Unknown" indicates that a user did not put the category of place
      • Latitude
      • Longitude
      • Interval(Second,Minute,Hour,Day): Interval between visits
public void showVisitInterval(String dir, String outputDir) {
		FileOutputStream fos = null;
		OutputStreamWriter osw = null;
		SimpleDateFormat sdfDate = new SimpleDateFormat("yyyyMMddHHmmss");
		SimpleDateFormat sdfDateOnly = new SimpleDateFormat("yyyy-MM-dd");
		final String START_DATE = "20101101000000", END_DATE = "20130601000000";
		
		try {
			String outputFileName = outputDir + LifeMapParameter.longToTimeString(System.currentTimeMillis()) + "_VisitInterval.csv";
			File outputFile = new File(outputFileName);
			fos = new FileOutputStream(outputFile);
			osw = new OutputStreamWriter(fos, "UTF8");
			
			osw.write("Name,Category,Latitude,Longitude,Interval(Second),Interval(Minute),Interval(Hour),Interval(Day)" +
					"\n");
			
			File root = new File(dir);
			if(!root.isDirectory()) return;
			String[] list = root.list();
			for(int i=0 ; i < list.length ; i++) {
				String filename = list[i];
				if(filename.equals(".") || filename.equals("..")) continue;
				File f = new File(dir + filename);
				if(f.isDirectory()) continue;
				else if(filename.contains(".db")) {
					if(conn != null && !conn.isClosed()) conn.close();
					conn = DriverManager.getConnection("jdbc:sqlite:" + dir + filename);
					System.out.println("Filename(" + (i+1) + "/" + list.length + "): " + filename);
					
					try {
						long topId = this.getTopPlace(1);
						long secondId = this.getTopPlace(2);
						
						Statement stmLoc = conn.createStatement();
						ResultSet rsLoc = this.getAllEntries(stmLoc, LOCATION_TABLE, LOCATION_KEY_ACTIVITY + "=" + LifeMapParameter.ACTIVITY_STAY);
						while(rsLoc.next()) {
							long nodeId = rsLoc.getLong(rsLoc.findColumn(LOCATION_KEY_ID));
							int latitude = rsLoc.getInt(rsLoc.findColumn(LOCATION_KEY_LATITUDE));
							int longitude = rsLoc.getInt(rsLoc.findColumn(LOCATION_KEY_LONGITUDE));
							String name = this.getPlaceName(nodeId);
							String category = this.getCategoryName(nodeId);
							// Skip top 1 place (home) and top 2 place (workplace).
							// The two places can be under-estimated the intervals since users routinely visited these private places.
							if(nodeId == topId || nodeId == secondId) continue;
							
							Statement stmStay = conn.createStatement();
							ResultSet rsStay = this.getAllEntries(stmStay, STAY_TABLE, STAY_KEY_NODE_ID + "=" + nodeId, STAY_KEY_TIME);
							String prevTimestamp = null;
							while(rsStay.next()) {
								String timestamp = rsStay.getString(rsStay.findColumn(STAY_KEY_TIME));
								if(prevTimestamp != null) {
									long interval = LifeMapParameter.timeStringToLong(timestamp) - LifeMapParameter.timeStringToLong(prevTimestamp);
									osw.write(name + "," + category + "," + (latitude/1E6) + "," + (longitude/1E6) + ",");
									osw.write((double)interval / LifeMapParameter.SECOND + "," + (double)interval / LifeMapParameter.MINUTE + "," + (double)interval / LifeMapParameter.HOUR + "," + (double)interval / LifeMapParameter.DAY+ "\n");									
								}
								prevTimestamp = timestamp;
							}
							rsStay.close();
							stmStay.close();
						}
						rsLoc.close();
						stmLoc.close();
					}
					catch (Exception e) {
						System.out.println("Error !!!!!!");
					}
					finally {
						if(conn != null && !conn.isClosed()) conn.close();						
					}
				}
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		finally {
			try {
				if(conn != null && !conn.isClosed()) conn.close();
				if(osw != null) osw.close(); if(fos != null) fos.close();
			}
			catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
	
	public long getTopPlace(int k, String where) {
		long res = -1;
		
		Statement stm;
		try {
			stm = conn.createStatement();
			String query =
				"SELECT "
					+ STAY_KEY_NODE_ID + ", "
					+ "SUM(" + STAY_KEY_STAY_TIME + ") AS DURATION "
				+ "FROM " + STAY_TABLE;
			if(where != null) query += " WHERE " + where;
			query += " GROUP BY " + STAY_KEY_NODE_ID
				+ " ORDER BY DURATION desc"; 

			ResultSet cursor = stm.executeQuery(query);
			int i=1;
			cursor.next();
			while(i < k && cursor.next()) {
				i++;
			}
			if(i==k) {
				res = cursor.getLong(cursor.findColumn(LOCATION_KEY_ID));
			}
			cursor.close();
			stm.close();
			
		} catch (Exception e) {
		}
		
		return res;
	}
  • Visit counts according to categories (related to Figure 6)
    • Input Parameters
      • String dir: directory that stores database file (e.g., "C:\\LifeMap_Database\\")
      • String outputDir: directory that stores the results
    • Fields in output file
      • Category: category of place, "Unknown" indicates that a user did not put the category of place
      • Visits: total number of visits
	public void showVisitByCategory(String dir, String outputDir) {
		FileOutputStream fos = null;
		OutputStreamWriter osw = null;
		
		try {
			String outputFileName = outputDir + LifeMapParameter.longToTimeString(System.currentTimeMillis()) + "_CategoryVisit.csv";
			File outputFile = new File(outputFileName);
			fos = new FileOutputStream(outputFile);
			osw = new OutputStreamWriter(fos, "UTF8");
			
			osw.write("Category,Visits" +
					"\n");
			
			HashMap hmSubToMajorCategory = new HashMap();
			for(int i=0 ; i < subCategory.length ; i++) {
				hmSubToMajorCategory.put(subCategory[i], majorCategory[i]);
			}
			HashMap hmCategoryToVisit = new HashMap();
			
			
			File root = new File(dir);
			if(!root.isDirectory()) return;
			String[] list = root.list();
			for(int i=0 ; i < list.length ; i++) {
				String filename = list[i];
				if(filename.equals(".") || filename.equals("..")) continue;
				File f = new File(dir + filename);
				if(f.isDirectory()) continue;
				else if(filename.contains(".db")) {
					if(conn != null && !conn.isClosed()) conn.close();
					conn = DriverManager.getConnection("jdbc:sqlite:" + dir + filename);
					System.out.println("Filename(" + (i+1) + "/" + list.length + "): " + filename);
					
					try {
						Statement stmLoc = conn.createStatement();
						ResultSet rsLoc = this.getAllEntries(stmLoc, LOCATION_TABLE, LOCATION_KEY_ACTIVITY + "=" + LifeMapParameter.ACTIVITY_STAY);
						while(rsLoc.next()) {
							long nodeId = rsLoc.getLong(rsLoc.findColumn(LOCATION_KEY_ID));
							String category = this.getCategoryName(nodeId);
							int count = this.getVisitedNumberOfDate(STAY_KEY_NODE_ID + "=" + nodeId);
							// Refine sub-category to major category
							if(hmSubToMajorCategory.containsKey(category)) {
								String majorCategory = hmSubToMajorCategory.containsKey(category)?hmSubToMajorCategory.get(category):category;
								int majorCount = (hmCategoryToVisit.containsKey(majorCategory)?hmCategoryToVisit.get(majorCategory).intValue():0);
								hmCategoryToVisit.put(majorCategory, majorCount + count);								
							}
							else {
								int totalCount = (hmCategoryToVisit.containsKey(category)?hmCategoryToVisit.get(category).intValue():0);
								hmCategoryToVisit.put(category, count+totalCount);								
							}
						}
						rsLoc.close();
						stmLoc.close();
					}
					catch (Exception e) {
						System.out.println("Error !!!!!!");
					}
					finally {
						if(conn != null && !conn.isClosed()) conn.close();						
					}
				}
			}
			
			for(String category : hmCategoryToVisit.keySet()) {
				osw.write(category + "," + hmCategoryToVisit.get(category).intValue() + "\n");
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		finally {
			try {
				if(conn != null && !conn.isClosed()) conn.close();
				if(osw != null) osw.close(); if(fos != null) fos.close();
			}
			catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

  • Visit frequency in a day according to categories (related to Figure 7)
    • Input Parameters
      • String dir: directory that stores database file (e.g., "C:\\LifeMap_Database\\")
      • String outputDir: directory that stores the results
    • Fields in output file (The results are printed as vertical orders. You should switch the column and row for normal view.)
      • CategoryWeekday: Visit frequency according to categories at weekday
      • CategoryWeekend: Visit frequency according to categories at weekend
	public void showMobilityDayByCategory(String dir, String outputDir) {
		FileOutputStream fos = null;
		OutputStreamWriter osw = null;
		SimpleDateFormat sdfDate = new SimpleDateFormat("yyyyMMddHHmmss");
		
		try {
			String outputFileName = outputDir + LifeMapParameter.longToTimeString(System.currentTimeMillis()) + "_MobilityDayByCategory.csv";
			File outputFile = new File(outputFileName);
			fos = new FileOutputStream(outputFile);
			osw = new OutputStreamWriter(fos, "UTF8");
			
			HashMap hmSubToMajorCategory = new HashMap();
			for(int i=0 ; i < subCategory.length ; i++) {
				hmSubToMajorCategory.put(subCategory[i], majorCategory[i]);
			}
			
			HashMap hmCateToMob = new HashMap(); 
			HashMap hmCateToMobWeekend = new HashMap();
			
			File root = new File(dir);
			if(!root.isDirectory()) return;
			String[] list = root.list();
			for(int k=0 ; k < list.length ; k++) {
				String filename = list[k];
				if(filename.equals(".") || filename.equals("..")) continue;
				File f = new File(dir + filename);
				if(f.isDirectory()) continue;
				else if(filename.contains(".db")) {
					if(conn != null && !conn.isClosed()) conn.close();
					conn = DriverManager.getConnection("jdbc:sqlite:" + dir + filename);
					System.out.println("Filename(" + (k+1) + "/" + list.length + "): " + filename);
					
					Statement stm = conn.createStatement();
					ResultSet rs = this.getAllEntries(stm, LOCATION_TABLE, LOCATION_KEY_ACTIVITY + "=" + LifeMapParameter.ACTIVITY_STAY);
					while(rs.next()) {
						long locId = rs.getLong(rs.findColumn(LOCATION_KEY_ID));
						String name = rs.getString(rs.findColumn(LOCATION_KEY_PLACE_NAME));
						String category = this.getCategoryName(locId);
						if(hmSubToMajorCategory.containsKey(category)) category = hmSubToMajorCategory.get(category);
						
						if(name == null || category == null || category.equals("Unknown")) continue;
						
						double[] mob = hmCateToMob.containsKey(category) ? hmCateToMob.get(category) : new double[24*6+1];
						double[] mobWeekend = hmCateToMobWeekend.containsKey(category) ? hmCateToMobWeekend.get(category) : new double[24*6+1];
						Statement stmCheckin = conn.createStatement();
						ResultSet rsCheckin = this.getAllEntries(stmCheckin, STAY_TABLE, STAY_KEY_NODE_ID + "=" + locId);
						// Iterate each visit
						while(rsCheckin.next()) {
							String startTimestamp = rsCheckin.getString(rsCheckin.findColumn(STAY_KEY_STAY_START_TIME));
							String endTimestamp = rsCheckin.getString(rsCheckin.findColumn(STAY_KEY_TIME));
							long duration = rsCheckin.getLong(rsCheckin.findColumn(STAY_KEY_STAY_TIME));
							if(duration < 0 || duration > 2 * LifeMapParameter.DAY) continue;
							Calendar startCal = Calendar.getInstance(), endCal = Calendar.getInstance();
							startCal.setTime(sdfDate.parse(startTimestamp.substring(0, 14)));
							endCal.setTime(sdfDate.parse(endTimestamp.substring(0, 14)));
							// Add visit frequency by 10 minutes
							while(startCal.getTimeInMillis() < endCal.getTimeInMillis()) {
								int index = (startCal.get(Calendar.HOUR_OF_DAY) * 60 + startCal.get(Calendar.MINUTE)) / 10;	
								if(startCal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || startCal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) {
									mobWeekend[index] += 1;
								}
								else
									mob[index] += 1;
								startCal.add(Calendar.MINUTE, 10);
							}
						}
						rsCheckin.close();
						stmCheckin.close();				
						
						hmCateToMob.put(category, mob);
						hmCateToMobWeekend.put(category, mobWeekend);
					}
				}
			}
			
			// Print weekday distribution
			osw.write("CategoryWeekday,");
			for(int i=0 ; i < 24*6+1 ; i++) {
				osw.write((double)(i)/6.0 + ",");
			}
			osw.write("\n");
			for(String category : hmCateToMob.keySet()) {
				osw.write(category + ",");
				double[] mob = hmCateToMob.get(category);
				for(int i=0 ; i < mob.length ; i++) {
					osw.write(mob[i] + ",");
				}
				osw.write("\n");
			}
			osw.write("\n");
			// Print weekend distribution
			osw.write("CategoryWeekend,");
			for(int i=0 ; i < 24*6+1 ; i++) {
				osw.write((double)(i)/6.0 + ",");
			}
			osw.write("\n");
			for(String category : hmCateToMobWeekend.keySet()) {
				osw.write(category + ",");
				double[] mob = hmCateToMobWeekend.get(category);
				for(int i=0 ; i < mob.length ; i++) {
					osw.write(mob[i] + ",");
				}
				osw.write("\n");
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		finally {
			try {
				if(osw != null) osw.close(); if(fos != null) fos.close();
				if(conn != null && !conn.isClosed()) conn.close();
			}
			catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
  • Visit probability distances from top two places (related to Figure 8)
    • Input Parameters
      • String dir: directory that stores database file (e.g., "C:\\LifeMap_Database\\")
      • String outputDir: directory that stores the results
    • Fields in output file
      • Distance: minimum distances in meters between target place to top 1 or top 2 place
      • VisitCount: total number of visit counts within distance 
	public void showVisitProbabilityToDistance(String dir, String outputDir) {
		FileOutputStream fos = null;
		OutputStreamWriter osw = null;
		
		try {
			String outputFileName = outputDir + LifeMapParameter.longToTimeString(System.currentTimeMillis()) + "_VisitProbabilityToDistance.csv";
			File outputFile = new File(outputFileName);
			fos = new FileOutputStream(outputFile);
			osw = new OutputStreamWriter(fos, "UTF8");
			
			osw.write("Distance,VisitCount\n");
			
			HashMap hmDistToVisit = new HashMap();
			
			File root = new File(dir);
			if(!root.isDirectory()) return;
			String[] list = root.list();
			for(int k=0 ; k < list.length ; k++) {
				String filename = list[k];
				if(filename.equals(".") || filename.equals("..")) continue;
				File f = new File(dir + filename);
				if(f.isDirectory()) continue;
				else if(filename.contains(".db")) {
					if(conn != null && !conn.isClosed()) conn.close();
					conn = DriverManager.getConnection("jdbc:sqlite:" + dir + filename);
					System.out.println("Filename(" + (k+1) + "/" + list.length + "): " + filename);

					// Find two major places (i.e., normally home and workplace)
					long top1nodeId = this.getTopPlace(1);
					long top2nodeId = this.getTopPlace(2);
					int lat1 = this.getLatitude(top1nodeId), lng1 = this.getLongitude(top1nodeId);
					int lat2 = this.getLatitude(top2nodeId), lng2 = this.getLongitude(top2nodeId);
					
					Statement stm = conn.createStatement();
					ResultSet rs = this.getAllEntries(stm, LOCATION_TABLE, LOCATION_KEY_ACTIVITY + "=" + LifeMapParameter.ACTIVITY_STAY);
					while(rs.next()) {
						long locId = rs.getLong(rs.findColumn(LOCATION_KEY_ID));
						// Filter out top-1 and top-2 place
						if(locId == top1nodeId || locId == top2nodeId) continue;
						int visitCount = this.getVisitedNumberOfDate(STAY_KEY_NODE_ID + "=" + locId);
						int lat = rs.getInt(rs.findColumn(LOCATION_KEY_LATITUDE));
						int lng = rs.getInt(rs.findColumn(LOCATION_KEY_LONGITUDE));
						// Filter out locations with unknown location or same latitude/longitude
						if(lat == LifeMapParameter.UNKNOWN_LOCATION || lng == LifeMapParameter.UNKNOWN_LOCATION || (lat1 == lat && lng1 == lng) || (lat2 == lat && lng2 == lng)) continue;
						
						double distanceToTop1 = LifeMapParameter.getDistance(lat1/1E6, lng1/1E6, lat/1E6, lng/1E6);
						double distanceToTop2 = LifeMapParameter.getDistance(lat2/1E6, lng2/1E6, lat/1E6, lng/1E6);
						
						double minDistance = Math.min(distanceToTop1, distanceToTop2);
						int minDistanceIndex = (int)(minDistance / 10) * 10;
						// Filter out locations within 10 meters which normally indicate same place
						if(minDistanceIndex < 10) continue;
						int totalVisit = hmDistToVisit.containsKey(minDistanceIndex)?hmDistToVisit.get(minDistanceIndex):0;
						hmDistToVisit.put(minDistanceIndex, totalVisit + visitCount);
					}
				}
			}			
			
			Set hsDist = hmDistToVisit.keySet();
			ArrayList listDist = new ArrayList(hsDist);
			Collections.sort(listDist);
			for(int dist : listDist) {
				osw.write(dist + "," + hmDistToVisit.get(dist).intValue() + "\n");
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		finally {
			try {
				if(osw != null) osw.close(); if(fos != null) fos.close();
				if(conn != null && !conn.isClosed()) conn.close();
			}
			catch (Exception e) {
				e.printStackTrace();
			}
		}
	}


저작자 표시 비영리 동일 조건 변경 허락
신고
크리에이티브 커먼즈 라이선스
Creative Commons License
Review 2011.09.27 20:22 by Yohan Chon
LaTeX 의 장점
  • 글씨체가 이쁘다. 한 줄에 들어가는 글자수 조절이 일정해 딱 보기에 아름답게 나온다.
  • 수식이 이쁘다. 있어 보인다.
  • Figure 위치 지정이 자동이다. 알아서 해준다. Word 는 텍스트 수정할 때마다 이리저리 날라다닌다.
  • Template 바꾸기가 쉽다. IEEE, ACM 간에 템플릿 파일만 교체해주면 바로 모양 변경 !
  • Bookmark 넣기가 편하다. Section, Figure, Equation, Reference 에 북마크 넣어주면 읽을 때 마우스 클릭만으로 휙휙 날아다닐수 있다.

IEEE Template (IEEEtran.cls)

Space Saving

// begin document 앞에다가 적기
\setlength{\textfloatsep}{0.6\baselineskip plus  0.1\baselineskip minus  0.1\baselineskip}
\setlength{\intextsep}{0.2\baselineskip plus  0.1\baselineskip minus  0.1\baselineskip}
\setlength{\abovedisplayskip}{8pt plus 2pt minus 2pt}
\setlength{\belowdisplayskip}{8pt plus 2pt minus 2pt}

\begin{document}

textfloatsep 은 텍스트와 Float 간의 간격을 조절해준다. Figure 와 텍스트간의 간격 조절이 수정된다. 뒤에 숫자가 10mm plus 5mm minus 2mm 이라는건 기본 10mm 에 상황에 따라 최대 15mm 까지 최소 8mm 까지 조절하라는 뜻.

Letter Size + Embedded All Fonts

US 는 대부분 A4 대신 Letter 크기를 많이 쓰고, IEEE 는 PDF 제출시 모든 폰트가 Embedded 되어 있어야 한다.
이를 위한 DviPs 와 Ghostscript (ps2pdf) 옵션들

dvips -Ppdf -G0 -tletter
gswin32c -sPAPERSIZE=letter -dPDFSETTINGS=/prepress -dEmbedAllFonts=true

Bookmark 막기

IEEE 는 Bookmark 가 들어가 있으면 안된다. (아니 대체 왜 !!)
hyperref 패키지를 쓰면 안된다.

Tight Equation: 편법으로 간격줄이기. Space 지정이 있을거 같은데 못 찾겠다. (아시는 분?)
// before
\begin{center}
$S_i=\sum_{j=1}^{m}(p_{ij}S_{ij})$,
\end{center}
// after
\vspace{-4pt}\begin{center}
$S_i=\sum_{j=1}^{m}(p_{ij}S_{ij})$,\vspace{-4pt}
\end{center}
모양새는 이렇게




ACM Template

Shared Affiliation
// begin document 앞에
\def\sharedaffiliation{%
\end{tabular}
\begin{tabular}{c}}

\begin{document}

\numberofauthors{4}
\author{
\alignauthor Yohan Chon\\
\email{user1@abc.xyz.ac.kr}
\alignauthor Elmurod Talipov\\
\email{user2@abc.xyz.ac.kr}
\alignauthor Hyojeong Shin\\
\email{user3@abc.xyz.ac.kr}
\and
\alignauthor Hojung Cha\\
\email{user4@abc.xyz.ac.kr}

\sharedaffiliation
\affaddr{Department of Computer Science }  \\
\affaddr{Yonsei University}   \\
\affaddr{Seoul, Korea}
}
모양새는 이렇다.


Tight Bibliography
// begin document 앞에
\let\oldthebibliography=\thebibliography
  \let\endoldthebibliography=\endthebibliography
  \renewenvironment{thebibliography}[1]{%
    \begin{oldthebibliography}{#1}%
      \setlength{\parskip}{0ex}%
      \setlength{\itemsep}{0ex}%
  }%
  {%
    \end{oldthebibliography}%
  }
\setlength{\parindent}{5mm}

\begin{document}



각종 적어두면 좋은 것들

일반 Figure

\begin{figure}
\centering
\epsfig{file=figure2.eps, width=7cm}
\caption{Ratio of residence-time in frequently visited place for all users.}
\label{fig:stay_in_place}
\end{figure}

Sub-Figure
\usepackage[tight,footnotesize]{subfigure} // subfigure package 사용

\begin{figure}
\centering
\subfigure[ ]{	
    \includegraphics[width=7cm]{figure3a}
}
\subfigure[ ]{	
    \includegraphics[width=7cm]{figure3b}
}
\caption{Temporal regularity according to different types: (a) day, weekday, weekend, and (b) week bucket.}
\label{fig:temporal_regularity}
\end{figure}

Table: LaTeX Table 은 별로 안 이뻐서 테이블은 Word 에서 만들어서 그림으로 넣는다.
\begin{table}
\centering
\caption{Description of data set}
\label{tab:data_set}
\epsfig{file=table1.eps, width=8cm}
\end{table}

저작자 표시 비영리 동일 조건 변경 허락
신고
크리에이티브 커먼즈 라이선스
Creative Commons License
1 2 3 4 ··· 23 
BLOG main image
while ( i != you ) i++;
시간은 가고 있습니다. 사랑하는 사람과. Talk Play Love.
by Yohan Chon

카테고리

John (68)
Life (12)
Review (17)
Theory (0)
IT (5)
Problem Solution (28)
Project (5)

달력

«   2017/06   »
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
tistory!get rss Tistory Tistory 가입하기!
CodeCogs - An Open Source Scientific Library

티스토리 툴바