일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- CustomTab
- ChromeTab
- web
- sprintf
- Clojure
- stringprintf
- SHA512
- Observer
- RAII
- Reflect
- async
- design pattern
- go
- c++
- haskell
- kotlin
- Chrono
- Scala
- template
- program
- type_traits
- ranges
- Android
- sha256
- coroutines
- Functional
- traits
- AES
- WebView
- SHA1
- Today
- Total
목록분류 전체보기 (82)
프로그래밍 검색 블로그
간단한 웹 브라우징 기능에 대해서는 WebView 대신 Chrome Tab 기능도 사용할 수 있어 소개 한다 최신 안드로이드 폰에서는 크롬이 강제적으로 설치되어 있어서 무난하게 사용할 수 있을것이다 support 라이브러리에 맞는 버젼으로 build.gradle에 추가 1implementation 'com.android.support:customtabs:28.0.0'cs 여러가지 방법으로 CustomTab을 사용이 가능하지만 몇가지 이벤트를 전달받을 수 있도록 ServiceConnection 부분으로 사용한다 123456789 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); s..
1234567891011121314151617import urllib.requestimport json""" 나오는 응답 {'success': True, 'message': '', 'result': {'Bid': 4025.00092321, 'Ask': 4026.60175655, 'Last': 4024.00915298}} Bid : 살 때, Ask : 팔 때, Last : 최근 거래 가격"""coin_address = "https://bittrex.com/api/v1.1/public/getticker?market=USDT-BTC" req = urllib.request.urlopen(coin_address)res = req.readline() j = json.loads(res)print(j["result"]..
https://github.com/rudty/MuteSpeakerOnHeadsetUnplugged 시작프로그램에 등록하거나 윈도우 시작할때마다 실행 할 것.
go 에서 기본으로 제공하고 있는 패키지 중에 다른 언어에는 기본적으로는 없는 유용한 패키지중의 하나가 context 이다 context.Background() 기본적으로 Background()를 제외한 다른 context들은 다른 context를 받는데 기능 상으로 해당 인자로 준 context를 상속 받는다고 생각하면 된다 context의 동작은 조건이 충족되지 않을 시에는 Err() 함수의 반환값을 통해서 알 수 있다간단하게 nil이 아니면 에러 db 연결 부분은 제외하고 context만 사용하는 간단한 예제func main() { ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) defer cancel() //cance..
import java.io.File import java.io.FileInputStreamimport java.security.MessageDigestimport javax.xml.bind.DatatypeConverter fun digest(file: File, engine: String) : String{ val md = MessageDigest.getInstance(engine) FileInputStream(file).use { fi -> val bytes = ByteArray(4096) while (true) { val length = fi.read(bytes) if (length
package main import ( "crypto/aes" "crypto/cipher" "crypto/rand" "encoding/base64" "fmt" "io" ) type AESCipher struct { block cipher.Block } func NewAesCipher(key []byte) (*AESCipher, error) { block, err := aes.NewCipher(key) if err != nil { return nil, err } return &AESCipher{block}, nil } func (a *AESCipher) EncryptString(s string) string { byteString := []byte(s) encryptByteArray := make([]by..
package main import ( "fmt" "reflect" ) type controller struct { } func (c controller) Foo(a int, b string) string { fmt.Println("Foo") return fmt.Sprint(a, b) } func (c controller) Koo(a int, b string) string { fmt.Println("Koo") return fmt.Sprint(a, b) } func (c controller) goo() { //private는 안보임 } //reflection으로 함수 호출할때는 일반 인자 대신 reflect.Value를 넣는다 func valueToReflectionArguments(args ...inte..
package main import ( "archive/zip" "io" "io/ioutil" "os" "path/filepath" ) // ZipDir 폴더를 지정해서 그 폴더 안에 있는 파일들을 // saveFile에 저장합니다 // error nil 압축성공 // 그외: 압축 실패 func ZipDir(saveFile *os.File, savePath string) error { zipWriter := zip.NewWriter(saveFile) defer zipWriter.Close() z := zipType{zipWriter} return z.dir(savePath, "") } func main() { //실행 파일과 같은 위치에 있는 test폴더 안에 있는 요소를 //result.zip으로 압축..
코틀린 베타로 비동기 관련 Api 가 추가되었다 문법으로는 C#의 async/await의 코틀린식 구현이라고 볼수 있다 베타를 비동기 Api를 사용하기 위해 그레들 설정부터 보자면현재 코틀린 버전을 1.2.21 혹은 그 이상으로 맞춰준다 1ext.kotlin_version = '1.2.21'cs dependencies에 코루틴 api 를 추가한다현재는 베타라서 필요하지만 미래에는 필요 없을수도 있다 1compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:0.22.2"cs 1. 비동기 API async 는 비동기로 동작하고 블럭 안에 있는 것을 비동기로 수행한다간단하게 textview 글자를 바꿔주는걸로 시작해본다 launch 도 비슷한 기능을 수행하지만 코틀린..
기본적인 안드로이드의 SQLite 사용법과table 구성, 그리고 인덱스까지 알아본다 일단 테이블 구성은 Bread (name, price)로 만들어보았다테이블 생성 후 인덱스를 생성하여대용량 데이터베이스가 들어가도 문제가 없다 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394package com.example.d.sqliteexample; import android.content.Context;import android.database..