본문 바로가기
[android] AsyncTask 를 Coroutine 으로 바꿔본 후기 -일반적으로 잘 사용하는 아래의 패턴은 꽤 나이스하게 바뀐다. onPreExecute 에서 progressdoInBackground 에서 bg jobonPostExecute 에서 progress 닫고 UI 작업 -// AsyncTask object : AsyncTask() { override fun onPreExecute() { showProgress(R.string.loading) } override fun doInBackground(vararg params: Void): List { return getMyAccountItemList(); } override fun onPostExecute(result: List) { if (isFinishing) return hideProgress() updateUI.. 2019. 2. 7.
[Kotlin Tutorial] Annotation 과 Reflection #2 [Kotlin Tutorial] Annotation 과 Reflection #2 참조 : Kotlin in action 10.2. Reflection: introspecting Kotlin objects at runtime -Kotlin 에서의 reflection 은 java.lang.reflect package 의 API 들과 kotlin.reflect package 의 API 들을 사용한다.Kotlin 의 reflection 은 Java 에 없는 nullable type 이나 properties 들의 접근을 가능하게 한다. -runtime lib 의 size 를 줄이기 위해, kotlin 의 reflection API 는 kotlin-reflect.jar 라는 별개의 jar 로 pakcage 되어 있.. 2017. 9. 12.
[Kotlin Tutorial] Operator overload 와 convention #1 - Chap7. Operator overloading and other conventions [Kotlin Tutorial] Operator overload 와 convention #1 - Chap7. Operator overloading and other conventions 참조 : Kotlin in action -Java 에는 특정 class 에 결속되어 있는 언어적 기능이 있다.예를 들어 Iterable 를 구현하면 for loop 에서 쓸 수 있고, AutoCloseable 을 구현하면 try-with-resources 에서 사용할 수 있다. Kotlin 도 비슷한 것들이 있다.그러나 specific type 에 결속된 것이 아니라 specific name 에 결속되는 기능들이 있다.예를 들어 plus 라는 이름으로 class 에 function 을 추가하면, + operator 를 해.. 2017. 8. 24.
[Kotlin Tutorial] Kotlin 기초 #2 - Chap2. Kotlin basics [Kotlin Tutorial] Kotlin 기초 #2 - Chap2. Kotlin basics 참조 : Kotlin in Action 2.4. Iterating over things: "While" and "For" loops -Kotlin 에서 for loop 은 for-each loop 하나밖에 없다. 2.4.1. The “while” loop -Java 와 동일 2.4.2. Iterating over numbers: ranges and progressions -일반적인 for loop 를 쓰려면 range 를 쓰면 된다.Range 는 closed, inclusive 하다 즉 아래의 예에서는 1과 10 모두를 포함한다.val oneToTen = 1..10 -val hundredToOneWithSte.. 2017. 7. 25.
[Kotlin Tutorial] Kotlin 기초 #1 - Chap2. Kotlin basics [Kotlin Tutorial] Kotlin 기초 #1 - Chap2. Kotlin basics 참조 : Kotlin in Action 2.1. Basic elements : Functions and variables 2.1.1. Hello, world! -fun main(args: Array){ println(“Hello, world!”)} fun 는 function 을 정의하는 keywordtype 은 variable 이름 다음에 옴function이 class 정의 안에 있지 않아도 된다Array 가 class 이다 ( Java 는 아니징 ) -> Kotlin 에서는 모든 것이 Object 이다System.out.println 대신 println; (semicolon) 넣을 필요 없다 ( option.. 2017. 7. 25.
[jQuery] Slider 컨트롤. ( control ) Slider Control Slider 컨트롤 만들고, 사용하기 Sliderbar의 값을 get, set 하는 것은 val() 함수를 통해서 한다. //Get$("#slider").val(); //Set$("#slider").val( 10 ); data-highlight="true" 를 통해서 왼쪽편의 색깔을 바꿀 수 있고,data-track-theme="b" 를 통해서 slider 부분만의 테마도 변경 할 수 있다. data-highlight, data-track-theme, Get, input, jQuery, Max, Min, RANGE, Set, slider, slider control, step, type, Val, Value 2013. 11. 5.
[android] Lombok 뭐 하는 녀석이냐? 안드로이드, Lombok 뭐 하는 녀석이냐? Lombok 이 뭐야? OpenSource project 로 eclipse 에 설치해서 사용하는 유용한 녀석이다. add-on 비슷한 녀석이랄까?annotation 등을 이용하여 반복적으로 생성하는 지루한 코드들을 모두 생략할 수 있다. Lombok Features Lombok Feature Official Page @Getter, @Setter 자동으로 getter, setter 들을 만들어준다.accesslevel 도 지정가능하고, override 도 가능하다. @Getter(lazy=true) thread-safe 한 getCached() 라는 함수를 만들어준다. 이 함수는 expensive 한 작업에 대해서 cache를 뜬다. @ToString 필자가 .. 2013. 7. 14.
[VB6] Built-in Function 들에 대해 공부해보자. ( MsgBox, Input, Math 함수, Formating 함수, String 함수 ) Built-in Function 들에 대해 공부해보자. [이전강좌] Control 문들에 대해 공부해보자. ( If Else, Select, Do while, For문 ) Dialog Box 들 returnValue = MsgBox( PromptStr, StyleValue, Title ) StlyeValue Constant0 vbOkOnly 1 vbOkCancel 2 vbAbortRetryIgnore 3 vbYesNoCancel 4 vbYesNo 5 vbRetryCancel StyleValue 에는 다음의 값을 더해서, icon 도 함께 표시할 수 있다. StyleValue Constant 16 vbCritical 32 vbQuestion 48 vbExclamation 64 vbInformation Re.. 2013. 6. 5.
[VB6] 대표적인 Control 들에 대해 공부해보자. VB의 대표적인 Control들에 대해 공부해보자. [이전강좌] Property(속성값) 다루는 법이 궁금하세요? 여기를 클릭 TextBox String Input 을 받을 수 있는 Box. 숫자를 다룰 때는 Val() 함수와 함께 잘 쓰인다. Label Caption property 를 이용하여 정보를 표시할 때 사용한다. CommandButton 일반적 버튼을 말한다. 보통 Click 이벤트가 가장 많이 쓰인다. PictureBox 이미지를 표시할 때 사용된다. LoadPicture 함수를 이용해서 runtime 에 그림을 바꿀 수도 있다. ImageBox Picture Box 와 거의 같으나, image 를 stretch 하는 기능이 있다.Picture Box 와 마찬가지로 runtime 에 Loa.. 2013. 5. 31.
반응형