기본 콘텐츠로 건너뛰기

글

objc, constraint, programmatically, ex

[self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.subview1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:0]];                 [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.lblTermsOfUse attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.subview2 attribute:NSLayoutAttributeTop multiplier:1 constant:20]];

Kotlin, Calendar, Date

private fun getFirstWeek (year:Int , month:Int):Int{ var strMonth = "0" if (month < 10 ) strMonth += month else strMonth = month.toString() var strDate = year.toString() + strMonth + "01" val format = SimpleDateFormat( "yyyyMMdd" ) val date = format.parse(strDate) val calendar = Calendar.getInstance() calendar. time = date return calendar.get(Calendar. DAY_OF_WEEK ) } private fun getWeekStr (week:Int):String{ when (week){ 1 -> return "日" 2 -> return "月" 3 -> return "火" 4 -> return "水" 5 -> return "木" 6 -> return "金" 7 -> return "土" } return "" }

iOS, DB Error: 26 "file is not a database"

error after "pod update" 암호화라이브러리에서 문제가 있는듯. 버전에 따라 암호화형식이 바뀌는 모양. SQLCipher ( 3.4 . 2 ) -> SQLCipher ( 4.0.1 )   Podfile ***   ## 수정전. 버전 지정이 없음. pod 'FMDB/SQLCipher'   # 버정지정을 해봄.  # FMDB/SQLCipher로는 SQLCipher의 버전이 아닌 FMDB의 버전으로 인식되었다. pod 'FMDB/SQLCipher', '3.4.2' # FMDB와 SQLCipher를 따로따로 # 버전지정은 성공했으나, 데이터베이스의 인식에 실패 (Error: 26 "file is not a database") pod 'FMDB', '~>2.5' pod 'SQLCipher', '3.4.2'   # FMDB의 버전지정을 FMDB/SQLCipher로 해봄. # 데이터 베이스의 인식에 성공. pod 'FMDB/SQLCipher', '~>2.5'  pod 'SQLCipher', '3.4.2'   ***********

Android, HttpURLConnection, file parameter

-- Not confirmed -- confirmed just 1 file parameter. public static void sendMultipart(HttpURLConnection connection, String[] filefield, File[] filepath, Map<String, String> textdata) throws IOException {         final String twoHyphens = "--";         final String boundary =  "*****"+ UUID.randomUUID().toString()+"*****";         final String lineEnd = "\r\n";         final int maxBufferSize = 1024*1024*3;         DataOutputStream outputStream;         connection.setDoInput(true);         connection.setDoOutput(true);         connection.setUseCaches(false);         connection.setRequestMethod("POST"); //        con...