본문 바로가기

Computer

(112)
Effective Kotlin - Properties should represent state, not behavior 코틀린의 속성은 자바의 필드와 비슷해 보입니다. 그렇지만, 서로 다른 컨셉을 갖고 있습니다. //Kotlinproperty var name:String?=null //Javafield String name=null; 같은 방식으로 사용할지라도, 코틀린의 속성은 좀 더 많은 것을 할 수 있다. property 선언에 대한 전체 구문 var [: ] [= ] [] [] Custom Get, Set ( var ) var name: String? = null get() = field?.toUpperCase() set(value) { if(!value.isNullOrBlank()) { field = value } Custom Get ( val ) val fullName: String? get() = "$name ..
Effective Kotlin - 변수의 범위 최소화 변수의 범위를 최소화 하자 핵심포인트 property 대신 지역변수를 사용하자 가능한한 가장 작은 범위에서 변수를 사용하자 책에서말하는 근거 Scope 이 넓은 변수의 경우, 그 만큼의 코드를 다른 개발자들이 파악해야한다. 언제 정의되었고 초기화되는지. ( 일반적으로 우리는 정의를 함과 동시에 초기화를 진행하는 경우가 많다. 그렇지 않으면, 코드상에서 해당 변수가 언제 초기화되는지도 찾아봐야 하기 떄문이다. ) for 문을 마치고 나서, 변경된 값의 내용을 추리해야한다던지. Sequence 내부 로직 처리시, 의도치 않는 값이 나올 수 있다. 에라토스테네스 체 ( 소수 구하는 방법 중 하나 ) 동작하는 코드 ``` val primes: Sequence = sequence { var numbers = ge..
The Cap Theorem What is the CAP theorem? Before talk about CAP theroem. we need to know about distributed system. and why. As you know in the mobile era, the amount of request and data has increased exponentially. In accordance with this situation, in the database environment, there are also requirements that can be easily extended and data must be delivered quickly. A distributed system environment was devised..
Webflux exchange 와 retrieve 의 차이 Under what circumstances? I was using webflux with spring boot version 2.x.x When i was using Webclient in my codes. I was usually using exchange() after request. cause, api what i used. when failed. it response 200 HTTP Status with error body. At that time i had a big mistake. that I thought exchange() and retrieve() is same. If you think like that. you are wrong. they are different. then what ..
xcode swift print 디버그 모드일때만 동작하게 하기 Under what circumstances?Under Xcode 12.2With Swift5How to do?It's very simple way to be disable print function.If you are developing using Swift, it doesn't matter which swift file. Please insert the code below. In my case, I inserted it at the top of the AppDelegate.import UIKitimport CoreData...func print(_ items: Any...) { #if DEBUG Swift.print(items[0]) #endif}@UIApplicationMai..
package.json security issue Under what circumstances? I was using webpack 3.8.1 and run webpack build after build i got main.[chunkhash:8].js At that time my package.json data was included in main.xxxx.js file. That makes secure issue when i deployed that onto service. Actually i used private npm module own private npm repository. At this point, someone read my main.js file and got the package.json data. After that, he cre..
가상화폐 이건 확인해보고 투자하자 ! 블록체인을 알기전에 분산처리에 대해 알고 갑시다. 분산 시스템의 장점 ( 단일 컴퓨터와 비교했을때) 1. 계산 능력이 더 뛰어나다 2. 비용이 절감된다. 3. 더 안정적이다. 4. 자연스럽게 확장된다. 분산 시스템의 단점 1. 조정 오버헤드가 발생한다. ( 구성 요소들간의 상태 전파 ) 2. 통신 오버헤드가 발생한다. 3. 네트워크 의존도가 높다. 4. 프로그램이 복잡해진다. 5. 보안에 신경써야 한다. 블록체인을 알기전에 P2P 시스템에 대해서도 알고 갑시다. P2P 시스템 ? P2P 시스템의 장점은 중개자를 통해 간접적으로 상호작용하지 않고 거래 당사자끼리 직접 상호작용한다는 점이다. 따라서 처리 시간과 비용이 현저히 줄어든다. P2P 시스템의 추종자들은 디지털화와 P2P 네트워크의 등장으로 출생증명..
Bee coin 채굴 안녕하세요? 이번에는 bee coin 이라는 모바일 채굴 앱을 소개하려고 합니다. 아래는 앱을 다운로드하는 링크입니다. 다음은 가입 순서를 알려드리겠습니다. 1. 소셜 네트워크, 핸드폰 번호를 이용해서 가입합니다. 2. 추천인이 있어야만 가입이 가능한데요. 이 때 추천인 란에 beetocoin 을 입력해주세요 이후 24시간마다 한번씩 터치만 해주시면 채굴이 진행됩니다. 읽어주셔서 감사합니다.