picker.MaxDate = DateTime.Now;
// 현재날짜 이후 선택불가
picker.MinDate = DateTime.Now;
// 현재날짜 이전 선택불가
'이것저것 > C# winform' 카테고리의 다른 글
String append (0) | 2017.11.28 |
---|
picker.MaxDate = DateTime.Now;
// 현재날짜 이후 선택불가
picker.MinDate = DateTime.Now;
// 현재날짜 이전 선택불가
String append (0) | 2017.11.28 |
---|
String Append.
string value = "abcd"; value += "efg";
Console.WriteLine(value);
--> abcdefg
c# Datetimepicker disable past dates (0) | 2017.12.08 |
---|
testDialog = new AlertDialog.Builder(mContext)
.setCustomTitle(title_tv) .
setMessage("1번 : 원격제어\n2번 : 센서 모니터링")
.create();
testDialog.show();
TextView msg_tv = (TextView)speechDialog.findViewById(android.R.id.message);
msg_tv.setTextSize(15);
msg_tv.setBackgroundColor(Color.WHITE);
Android Studio 3.0.1 업데이트 AAPT2 에러 (0) | 2018.02.20 |
---|---|
JAVA Google Geocoding API (0) | 2017.02.20 |
FCM (0) | 2017.02.03 |
안드로이드 EditText 다음 버튼 원하는 포커스 이동 (0) | 2017.01.23 |
안드로이드 scrollview 스크롤바 보이기 (0) | 2017.01.23 |
1 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@앱번들ID", UIApplicationOpenSettingsURLString]]]; | cs |
(Swift)
1 | UIApplication.sharedApplication().openURL(NSURL(string: "\(UIApplicationOpenSettingsURLString)앱번들ID")!) | cs |
ios http 통신 에러 // since it does not conform to ATS policy (0) | 2018.01.19 |
---|---|
코코아포드(cocoapods) 설치 및 사용법 (0) | 2018.01.18 |
맥 터미널로 시리얼 출력 (0) | 2016.11.24 |
맥 HomeBrew로 Mysql 설치하기 (0) | 2016.09.26 |
맥에 Homebrew 설치 (0) | 2016.09.26 |
PLX-DAQ 이용한 아두이노와 엑셀연동
https://www.parallax.com/downloads/plx-daq
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 | int sensorA = A0; int sensorA_value = 0; int sensorB = A1; int sensorB_value = 0; int sensorC = A2; int sensorC_value = 0; void setup() { Serial.begin(9600); Serial.println("CLEARDATA"); //시작시 데이터 클리어 Serial.println("LABEL,Time,SenserA,SenserB,SenserC"); // 테이블명 } void loop() { sensorA_value = analogRead(sensorA); sensorB_value = analogRead(sensorB); sensorC_value = analogRead(sensorC); Serial.print("DATA,TIME,"); Serial.print(sensorA_value); Serial.print(","); Serial.print(sensorB_value); Serial.print(","); Serial.println(sensorC_value); delay(300000); | cs |
pm2 ubuntu 18.04 (0) | 2018.10.29 |
---|---|
Node js + mysql error (0) | 2018.10.07 |
아두이노 수위센서 / 수분센서 (0) | 2017.02.20 |
라즈베리파이 카메라 파이썬 (0) | 2017.02.13 |
크롬에서 11번가 자동 새 탭 열림 문제해결 (0) | 2016.09.03 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | int analogPin = 0; // 워터센서 analog port 0 연결 선언 int val = 0; // 전류변화값 변수선언 void setup () { Serial.begin (9600); // 시리얼모니터 설정 } void loop() { val = analogRead(analogPin); // analogPin 의 변화값(전류값)을 읽음 Serial.println(val); // 시리얼모니터에 전류값 표시 delay (500); } | cs |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | int sensorPin = A0; // select the input pin for the potentiometer int sensorValue = 0; // variable to store the value coming from the sensor void setup() { // declare the ledPin as an OUTPUT: Serial.begin(9600); } void loop() { // read the value from the sensor: sensorValue = analogRead(sensorPin); delay(1000); Serial.print("sensor = " ); Serial.println(sensorValue); } | cs |
Node js + mysql error (0) | 2018.10.07 |
---|---|
아두이노 엑셀연동 (PLX-DAQ) (0) | 2017.03.08 |
라즈베리파이 카메라 파이썬 (0) | 2017.02.13 |
크롬에서 11번가 자동 새 탭 열림 문제해결 (0) | 2016.09.03 |
윈도우 태블릿 - 윈10 업글 (0) | 2016.07.12 |
구글 API 이용하여 원하는 주소값의 위도,경도 받아오기
google 프로젝트 등록 필요.
https://developers.google.com/maps/documentation/geocoding/get-api-key?hl=ko
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 | import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicNameValuePair; import org.apache.http.util.EntityUtils; public class Geocode { String response = ""; String run(String address) throws IOException { HttpPost httpPost = new HttpPost("https://maps.googleapis.com/maps/api/geocode/json?address="+address+"&components=country:KR"); HttpClient httpclient = new DefaultHttpClient(); HttpResponse httpResponse = httpclient.execute(httpPost); response = EntityUtils.toString(httpResponse.getEntity()); return response; } } | cs |
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | import java.io.IOException; import org.apache.http.ParseException; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.os.Bundle; import android.os.Handler; import android.os.Message; public class GeoThread extends Thread{ Handler handler; boolean isRun = true; String address = ""; public GeoThread(Handler handler){ this.handler = handler; } public void run(){ Geocode geo = new Geocode(); Bundle bun = new Bundle(); String response; try { response = geo.run(address); JSONObject json = new JSONObject(response); JSONArray results = (JSONArray) json.get("results"); JSONObject resultsArray = (JSONObject) results.get(0); JSONObject jsonObject = (JSONObject) resultsArray.get("geometry"); JSONObject jsonObject2 = (JSONObject) jsonObject.get("location"); double address_lat = (double) jsonObject2.get("lat"); double address_lng = (double) jsonObject2.get("lng"); bun.putDouble("address_lat", address_lat); bun.putDouble("address_lng", address_lng); Message msg = handler.obtainMessage(); msg.setData(bun); handler.sendMessage(msg); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } | cs |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 원하는 Activity에서 GeoThread geo = new GeoThread(addressHandler); String address = address_edt.getText().toString(); address = address.replaceAll(" ", ""); //주소에 geo.address = address; geo.start(); Handler addressHandler = new Handler() { public void handleMessage(Message msg) { Bundle bun = msg.getData(); double lat = bun.getDouble("address_lat"); double lng = bun.getDouble("address_lng"); } }; | cs |
Android Studio 3.0.1 업데이트 AAPT2 에러 (0) | 2018.02.20 |
---|---|
안드로이드 dialog setTextSize (0) | 2017.11.06 |
FCM (0) | 2017.02.03 |
안드로이드 EditText 다음 버튼 원하는 포커스 이동 (0) | 2017.01.23 |
안드로이드 scrollview 스크롤바 보이기 (0) | 2017.01.23 |
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 31 | 5초마다 반복하며 사진 찍는 코드 from picamera import PiCamera from time import sleep camera = PiCamera() camera.start_preview() for i in range(5): sleep(5) camera.capture('/home/pi/images.jpg' % i) camera.stop_preview() ///////////////////////////////////////////////////////////////////// camera.sharpness = 0 camera.contrast = 0 camera.brightness = 50 camera.saturation = 0 camera.ISO = 0 camera.video_stabilization = False camera.exposure_compensation = 0 camera.exposure_mode = 'auto' camera.meter_mode = 'average' camera.awb_mode = 'auto' camera.image_effect = 'none' camera.color_effects = None camera.rotation = 0 camera.hflip = False camera.vflip = False camera.crop = (0.0, 0.0, 1.0, 1.0) | cs |
https://www.raspberrypi.org/documentation/usage/camera/python/README.md
아두이노 엑셀연동 (PLX-DAQ) (0) | 2017.03.08 |
---|---|
아두이노 수위센서 / 수분센서 (0) | 2017.02.20 |
크롬에서 11번가 자동 새 탭 열림 문제해결 (0) | 2016.09.03 |
윈도우 태블릿 - 윈10 업글 (0) | 2016.07.12 |
TouchMousePointer (1) | 2016.06.19 |
AndroidManifest.xml
1 2 3 4 5 6 7 8 9 10 | <service android:name=".MyFcmListenerService"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> <service android:name=".MyInstanceIDListenerService"> <intent-filter> <action android:name="com.google.firebase.INSTANCE_ID_EVENT" /> </intent-filter> </service> | cs |
MyFcmListenerService.java
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 31 32 33 34 35 36 37 38 39 40 41 | public class MyFcmListenerService extends FirebaseMessagingService { @Override public void onMessageReceived(RemoteMessage message) { Map<String, String> data = message.getData(); String time = data.get("time"); String msg = data.get("message"); sendPushNotification(time, msg); } private void sendPushNotification(String title, String message) { Intent intent = new Intent(this, LoginActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent, PendingIntent.FLAG_ONE_SHOT); long[] pattern = {200, 100, 500, 300}; Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE); NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.icon) .setContentTitle(title) .setContentText(message) .setAutoCancel(true) .setVibrate(pattern) .setSound(defaultSoundUri) .setLights(000000255, 500, 2000) .setContentIntent(pendingIntent); NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); PowerManager pm = (PowerManager) this.getSystemService(Context.POWER_SERVICE); PowerManager.WakeLock wakelock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, "TAG"); wakelock.acquire(5000); notificationManager.notify(0 /* ID of notification */, notificationBuilder.build()); } } | cs |
MyInstanceIDListenerService.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | public class MyInstanceIDListenerService extends FirebaseInstanceIdService { @Override public void onTokenRefresh() { // Get updated InstanceID token. String refreshedToken = FirebaseInstanceId.getInstance().getToken(); Log.d(TAG, "Refreshed token: " + refreshedToken); // If you want to send messages to this application instance or // manage this apps subscriptions on the server side, send the // Instance ID token to your app server. sendRegistrationToServer(refreshedToken); } private void sendRegistrationToServer(String refreshedToken) { } } | cs |
안드로이드 dialog setTextSize (0) | 2017.11.06 |
---|---|
JAVA Google Geocoding API (0) | 2017.02.20 |
안드로이드 EditText 다음 버튼 원하는 포커스 이동 (0) | 2017.01.23 |
안드로이드 scrollview 스크롤바 보이기 (0) | 2017.01.23 |
안드로이드 xml 에서 inputType (0) | 2017.01.19 |
1 2 3 | android:nextFocusDown="@id/원하는 포커스" android:imeOptions="actionDone" //다음 없이 완료 // | cs |
JAVA Google Geocoding API (0) | 2017.02.20 |
---|---|
FCM (0) | 2017.02.03 |
안드로이드 scrollview 스크롤바 보이기 (0) | 2017.01.23 |
안드로이드 xml 에서 inputType (0) | 2017.01.19 |
자바 내일날짜 구하기 (0) | 2017.01.18 |