본문 바로가기
[Java8 In Action] #5 스트림 활용 [Java8 In Action] #5 스트림 활용 Java8 In Action 내용을 보며 정리한 내용입니다.정리자는 기존에 Java8 을 한차례 rough 하게 공부한 적이 있고, Kotlin 역시 공부한 적이 있습니다.위의 prerequisite 가 있는 상태에서 추가적인 내용만 정리한 내용이므로, 제대로 공부를 하고 싶다면 책을 구매해서 보길 권장합니다! 5.1. 필터링과 슬라이싱 5.1.1. 프리디케이트로 필터링 -filter 메서드는 프레디케이트(불린을 반환하는 함수)를 인수로 받아서 프레디케이트와 일치하는 모든 요소를 포함하는 스트림을 반환한다. 5.1.2. 고유 요소 필터링 -고유 요소로 이루어진 스트림을 반환하는 distinct 라는 메서드가 있다.고유 여부는 스트림에서 만든 객체의 has.. 2018. 12. 25.
[android] ArrayMap 과 SparseArray 를 이용한 최적화 [android] ArrayMap 과 SparseArray 를 이용한 최적화 https://medium.freecodecamp.com/android-app-optimization-using-arraymap-and-sparsearray-f2b4e2e3dc47#.pg0eea2cx ArrayMap vs. HashMap -ArrayMap 은 android.util.ArrayMap 과 android.support.v4.util.ArrayMap 두 가지 형태가 있다.뒤의 녀석은 compat 이슈를 위한 것. -ArrayMap 은 HashMap 보다 더 memory 최적화된 데이터 구조를 가진다.ArrayMap 은 array 를 이용해 mapping 을 관리한다.Hash integer 를 가지고 있는 array 와,.. 2018. 3. 5.
[ios/tutorial] Core Data - Creating and Modifying Custom Managed Objects [ios/tutorial] Core Data - Creating and Modifying Custom Managed Objects https://developer.apple.com/library/watchos/documentation/Cocoa/Conceptual/CoreData/LifeofaManagedObject.html#//apple_ref/doc/uid/TP40001075-CH16-SW1-NSManagedObject 는 generic class 이다. Creating Custom Managed Object Subclasses -@interface MyManagedObject : NSManagedObject @property (nonatomic, strong) NSString *title;@prop.. 2017. 11. 5.
[ios/tutorial] Core Data - Creating a Managed Object Model [ios/tutorial] Core Data - Creating a Managed Object Model https://developer.apple.com/library/watchos/documentation/Cocoa/Conceptual/CoreData/KeyConcepts.html#//apple_ref/doc/uid/TP40001075-CH30-SW1 -model layer 를 관리하는 framework를 core data 라고 부른다.많은 것을 자동화시켜서 제공한다. -Core data 의 schema 는 managed object model 로 mapping 된다. ( NSManagedObjectModel )이 model 은 소위 table 이라고 부르는 entity 들의 집합이다. Creatin.. 2017. 11. 2.
[Kotlin Tutorial] Operator overload 와 convention #2 [Kotlin Tutorial] Operator overload 와 convention #2 출처 : Kotlin in action 7.3. Destructuring declarations and component functions -val p = Point(10, 20)val (x, y) = p // destructuringprintln(x)println(y) -destructuring 도 convention 을 사용한다.componentN 이 호출된다. ( N 은 숫자 )val (a, b) = p // val a = p.component1()// val b = p.component2() -data class 는 compiler 가 primaryConstructor 에 정의된 모든 property 에 .. 2017. 8. 29.
[android] xml 의  tool 을 사용하자 [android] xml 의 tool 을 사용하자 https://medium.com/sebs-top-tips/tools-of-the-trade-part-1-f3c1c73de898https://developer.android.com/studio/write/tool-attributes.html -xmlns:tools="http://schemas.android.com/tools" aapt 는 tools: attribute 를 ignore 한다.그래서 실제 apk 에는 들어가지 않는다. - 위와 같이 tools: 를 사용하면 실제 xml 에서 pre draw 할 때는 tools:text 가 android:text 처럼 작동하지만,apk 는 들어가지 않는다. aapt( android asset packaging .. 2017. 5. 30.
[android] ListView 에서 RecyclerView 로 migration 하세요. [android] ListView 에서 RecyclerView 로 migration 하세요. http://andraskindler.com/2014/11/22/migrating-to-recyclerview/ - Google 에서도 RecyclerView 을 Support library 에 넣으면서 ListView 를 대체하려는 움직임을 보이고 있다. RecyclerView 는 새롭고, 효율적이고, customize 하기에도 좋다. ListView 뿐만 아니라 GridView, StaggeredGridView, ExpandableListView 역시 모두 migration 가능하다. RecyclerView and LayoutManager RecyclerView 는 제한된 수의 window 를 이용하여 lar.. 2017. 4. 13.
[Django] 파이썬 웹 프로그래밍 - Django 의 핵심 기능 #2 [Django] 파이썬 웹 프로그래밍 - Django 의 핵심 기능 #2 * 4.4.1. HTML 에서의 폼 -HTTP 프로토콜 중 폼에서 사용할 수 있는 HTTP 메소드는 GET 과 POST 뿐이다.장고는 이 중에서도 폼 처리에는 POST 방식만을 사용하고 있다.추가적으로 장고는 보안을 강화하기 위해 CSRF 방지 기능을 제공한다. * 4.4.2. 장고의 폼 기능 -장고는 폼 처리를 위해 다음 3가지 기능을 제공한다. 폼 생성에 필요한 데이터를 폼 클래스로 구조화하기 폼 클래스의 데이터를 랜더링하여 HTML 폼 만들기 사용자로부터 제출된 폼과 데이터를 수신하고 처리하기 -장고의 모델 클래스가 데이터베이스 테이블의 논리적인 구조 및 동작 기능, 우리에게 보여지는 방식들을 기술.. 2016. 12. 15.
[Android] activity-alias 태그를 사용하는 좋은 예. [Android] activity-alias 태그를 사용하는 좋은 예. 런처는 기본적으로 intent-filter 의 category 가 android.intent.category.LAUNCHER 로 등록된 녀석의 Activity Name 을 shortcut 과 mapping 시켜서 바탕화면에 바로가기 아이콘을 생성한다.( 기본적인 것으로 모든 런처 구현이 그렇다는 것은 아니다. ) 그래서 만약에 업데이트를 하면서 category LAUNCHER 로 지정했던 녀석의 이름이 바뀌게 되면,런처 구현에 따라 다르지만 보통 바로가기가 삭제되거나 혹은 아이콘은 존재하지만 "존재하지 않는 앱입니다." 와 같은 메세지를 보이며 연결이 제대로 되지 않는다. 그냥 기존의 바탕화면 아이콘을 제거하거나, 모든 프로그램에서 .. 2014. 6. 6.
반응형