분류 전체보기(864)
-
Realm, Alamofire 사용 팁
GET request에 JSON 바디로 값을 넘기고자 할 경우 Just replace JSON.encoding -> URLEncoding Alamofire.request(path,method: .get, parameters: params, encoding: URLEncoding.default, headers: nil) https://stackoverflow.com/questions/55858837/how-to-send-a-json-body-in-a-get-request-with-alamofire How to send a JSON body in a get request with Alamofire I'm facing a problem since 3 weeks now, I'm using an API prett..
2021.06.25 -
MongoDB ReplicaSet을 Shard로 추가하기
먼저 3개의 인스턴스로 ReplicaSet을 구성한 다음, 해당 ReplicaSet을 샤딩 시스템의 샤드로 추가하면 된다. 모든 샤드가 ReplicaSet으로 구성되어 있다면 거의 무중단 서비스가 가능한 상태로 만들수 있다. https://docs.mongodb.com/manual/tutorial/convert-replica-set-to-replicated-shard-cluster/ Convert a Replica Set to a Sharded Cluster — MongoDB Manual Sharding > Sharded Cluster Administration This tutorial converts a single three-member replica set to a sharded cluster wi..
2021.06.07 -
키보드 자판이 나왔을때 화면 레이아웃 변경
입력창의 위치를 키보드 자판이 나올때 적정한 위치로 변경하는 방법 https://fluffy.es/move-view-when-keyboard-is-shown/ Move view when keyboard is shown (guide) Just want the code to move the view up? Just want the code to scroll the scrollview up?Most likely you have worked on an app with multiple textfields, and when the keyboard show up, there's a chance that your text field will get covered by the keyboard! On fluffy.es
2021.06.01 -
Elasticsearch에서 대량의 도큐멘트 조회하기
최대 10000개까지 가져올수 있고, scroll_id를 이용하여 이어서 가져올수 있다. es = Elasticsearch(['http://x.x.x.x:9200/']) doc = { 'size' : 10000, 'query': { 'match_all' : {} } } res = es.search(index="myIndex", doc_type='myType', body=doc,scroll='1m') scroll = res['_scroll_id'] res2 = es.scroll(scroll_id = scroll, scroll = '1m') https://discuss.elastic.co/t/get-all-documents-from-an-index/86977/5 Get all documents from an..
2021.05.28 -
접속 불가능한 MongoDB 샤드 제거 방법
아쉽게도 뭔가 놓친부분이 있어서인지 이것만으로는 완전히 복구되지 않았지만, 유용한 팁이니 공유한다. I tried several options to do this in version 4.2. At the end I ended to these commands to be executed on Config Server: use config db.databases.updateMany( {primary: "shard0002"}, {$set: {primary: "shard0000"} }) db.shards.deleteOne({_id : "shard0002" }) db.chunks.updateMany( {shard : "shard0002"}, {$set: {shard: "shard0000"} }) while ( db..
2021.05.28 -
Swift TableView 가변 높이 처리
앱 개발을 하다보면 가변하는 컨텐츠 크기에 맞춰서 TableView의 Cell 높이를 동적으로 처리해야하는 경우가 있다 func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return UITableView.automaticDimension } https://www.hackingwithswift.com/example-code/uikit/how-to-make-uitableviewcells-auto-resize-to-their-content How to make UITableViewCells auto resize to their content - free Swift 5.1 example code an..
2021.05.19