๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ป๊ฐœ๋ฐœ23

[Python] ์„œ๋ฒ„์˜ MySQL ํ…Œ์ด๋ธ”์„ 1์‹œ๊ฐ„๋งˆ๋‹ค dumpํ•˜๊ณ  ๋กœ์ปฌ๋กœ ๋ฐฑ์—…ํ•˜๋Š” ์ฝ”๋“œ Python์˜ Paramiko๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์„œ๋ฒ„์— ์•ก์„ธ์Šค ํ•˜์—ฌ ์„œ๋ฒ„์˜ MySQL ํŠน์ • ํ…Œ์ด๋ธ”์„ dumpํ•ด์„œ ํŒŒ์ผ์„ PC๋กœ์ปฌ๋กœ ๊ฐ€์ ธ์˜ค๋Š” ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค. import paramiko import os import time # ์„œ๋ฒ„ ์ ‘์† ์ •๋ณด hostname = 'your_server_ip' port = 22 username = 'your_username' password = 'your_password' # MySQL ์ •๋ณด mysql_user = 'your_mysql_user' mysql_password = 'your_mysql_password' mysql_database = 'your_database' mysql_table = 'your_table' # ๋กœ์ปฌ ํŒŒ์ผ ๊ฒฝ๋กœ local_file_path = os.pat.. 2023. 3. 29.
JavaScript์—์„œ alert()์„ ์‚ฌ์šฉํ•  ๋•Œ Android WebView์—์„œ ํƒ€์ดํ‹€ ์—†์ด ์ถœ๋ ฅํ•˜๋Š” ๋ฐฉ๋ฒ• JavaScript์—์„œ alert() ๋ฉ”์†Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ Android WebView์—์„œ ํƒ€์ดํ‹€ ์—†์ด ์ถœ๋ ฅํ•˜๋Š” ๋ฐฉ๋ฒ• WebChromeClient ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ onJsAlert() ๋ฉ”์„œ๋“œ๋ฅผ ์˜ค๋ฒ„๋ผ์ด๋“œํ•˜๊ณ  alert ์ฐฝ์„ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. webView.setWebChromeClient(new WebChromeClient() { @Override public boolean onJsAlert(WebView view, String url, String message, JsResult result) { AlertDialog.Builder builder = new AlertDialog.Builder(view.getContext()) .setMessage(message) .setPositiveButt.. 2023. 3. 28.
[Swift] iOS ๊ธฐ๊ธฐ์˜ ์ž์ด๋กœ์„ผ์„œ ๊ฐ’์„ ์ฝ์–ด์˜ค๋Š” ๋ฐฉ๋ฒ• ์ž์ด๋กœ ์„ผ์„œ ๊ฐ’์„ ์ฝ์–ด์˜ค๊ธฐ ์œ„ํ•ด์„ , Core Motion ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ์€ Core Motion ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ์ด์šฉํ•˜์—ฌ ์ž์ด๋กœ ์„ผ์„œ ๊ฐ’์„ ์ฝ์–ด์˜ค๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. import CoreMotion // CMMotionManager ์ธ์Šคํ„ด์Šค๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. let motionManager = CMMotionManager() // ๋””๋ฐ”์ด์Šค์—์„œ ์ž์ด๋กœ์Šค์ฝ”ํ”„๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ์ฒดํฌํ•ฉ๋‹ˆ๋‹ค. if motionManager.isGyroAvailable { // ์ž์ด๋กœ์Šค์ฝ”ํ”„ ์„ผ์„œ ๊ฐ์ง€ ๊ฐ„๊ฒฉ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. motionManager.gyroUpdateInterval = 0.1 // ์ž์ด๋กœ์Šค์ฝ”ํ”„ ๊ฐ’ ์—…๋ฐ์ดํŠธ๋ฅผ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค. motionManager.startGyroUpdates(to: OperationQueue... 2023. 3. 21.
์•ˆ๋“œ๋กœ์ด๋“œ ์›น๋ทฐ ์œ„์น˜์„œ๋น„์Šค (Android WebView Location Service) Java ์•ˆ๋“œ๋กœ์ด๋“œ ์›น๋ทฐ์—์„œ ์œ„์น˜์„œ๋น„์Šค๊ฐ€ ๊บผ์ ธ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๊ณ  ๊บผ์ ธ์žˆ์œผ๋ฉด ์œ„์น˜ ์„œ๋น„์Šค๋ฅผ Activeํ•˜๋Š” ์ฐฝ์ด ๋œจ๋„๋ก ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. private void checkLocationEnabled() { LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); boolean gpsEnabled = false; boolean networkEnabled = false; try { gpsEnabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER); } catch (Exception ex) { ex.printStackTrace(); } try { network.. 2023. 3. 16.