Blog

  • 싱가포르 거주지역 탐방: Paya Lebar Esta Ruby의 매력

    싱가포르 거주지역 탐방: Paya Lebar Esta Ruby의 매력

    2년전 싱가포르에 처음 왔을 때 회사에서 리로케이션 패키지로 파야레바에 있는 콘도 마스터룸을 약 3주간 지원해주었었다

    그때 기억을 되살리며 이 지역에 대한 간단한 포스팅

    내가 머문 콘도, Easycity @ Esta Ruby

    일단 여기는 한동 짜리 콘도이다. 특이했던 점은 내가 머문 집은 엘리베이터와 거실이 직방으로 연결되어 있다는 점이다.

    즉 엘리베이터에서 예를 들어 3층을 누르고 내리면 바로 거실이다

    거실에서 바라본 엘리베이터

    이 방식은 별로인 것 같다. 같이 탑승한 다른 층 사람들이 내가 내릴 때 거실이 공개되기 때문

    그래도 발코니가 있어서 답답하지는 않았다. 마스터룸에 짱박혀서 밖으로 연결된 공간이 없다면 진짜 답답할 거 같다

    이 콘도의 단점은 편의시설이 옥상에 있다는 점

    옥상에 올라가면 수영장이 보인다

    수영장 옆에 운동기구들이 있다. 여기 헬스장이 따로 있었는지 정확히 기억이 안남

    위치

    MRT까지는 걸어서 7-10분 잡아야 될 것 같다. 그런데 걸어다닐 만 한 거리이다. 이 지역은 근처에 큰 쇼핑몰 4개 정도가 몰려있어서 진짜 번화가이다

    위치는 최고라고 생각함.

    마치며

    싱가포르에 처음와서 혼자 머물 집을 구하는 경우 마스터룸(화장실이 있는 방) + 발코니 연결된 방을 추천한다. 발코니가 없으면 상당히 답답하다

  • 워드프레스 사진용량 획기적으로 아끼는 팁 3가지!

    워드프레스는 기본 용량 3기가를 제공한다. 사진 사이즈만 잘 조절한다면 보통 한장에 500-600KB (사진 크기는 900px 이상)이다.

    3GB = 3145728 KB

    3145728KB / 500KB = 대략 6291 개의 사진을 업로드할 수 있는 용량이다.

    그러나 우리는 잘못된 세팅으로 인해 금방 3GB를 소진할 수 있다.

    팁 1. 워드프레스 앱(JetPack)에서 사진 업로드 설정하기

    우측 상단 프로필 이미지 선택하면 세팅 메뉴가 나온다

    App Setting을 선택하자

    위에 메뉴에서 첫 번째 두번째를 보면 이미지 용량 및 비디오 사이즈를 선택할 수 있다. 이미지는 900으로설정하고 비디오는 480으로 설정하자. 그러면 앱에서 사진 올릴때 사진 및 비디오가 원본으로 업로드 되지 않기 때문에 획기적으로 줄일 수 있다

    팁 2, 구글 포토를 이용하자

    이 방법은 앱이 아닌 웹 브라우저로 워드프레스 사이트로 들어가서 포스팅 하는 경우에만 가능하다. 사진 블록에서 미디어 라이브러리가 아닌 구글 포토를 선택하자.

    만약 구글 계정 연결이 안되어있다면 연결하라는 팝업이 뜰 것이다. 아무튼 연결하자. 그러면 구글 포토에 올린 사진을 선택해서 워드프레스 블로그 포스팅을 계속 할 수 있다. 이렇게 선택된 사진은 워드프레스 자체 사진첩 용량을 소모하지 않기 때문에 비용을 아낄 수 있다.

    팁 3, 블로그에 첨부하지 않은 사진을 필터링해서 삭제하자

    주의! 이 방법은 블로그 글을 작성할때 이미지 블록을 이용해서 사진을 편집 상태에서 직접 올린 경우에만 해당됨. 다시말해 미리 사진을 여러장 워드프레스 갤러리에 업로드 해놓고 나중에 글 작성할때 미디어 라이브러리에서 선택한 경우에는 이방법을 이용하면 블로그 포스팅에 포함된 사진이 삭제될 수 있음.

    워드프레스 어드민으로 들어가서 미디어를 선택하고 우측 상단에 보기에서 클래식 보기를 선택

    위와 같이 필터 옵션에서 Unattached를 선택하고 우측에 필터 버튼을 클릭하자

    그러면 포스팅에 포함되지 않은 지워도 되는 사진들이 쭉 나올 것이다. 이 사진들을 삭제해버리자.

  • How to check the unused Swift Code

    How to check the unused Swift Code

    Recently I faced an issue with compile -O for product build. I assumed that It caused by dead function issue. I reported it

    Apple Swift Git Repo

    This post I’ll introduce static analyzer tool for checking the unused swift codes

    Install Periphery

    Link You can install periphery tool using homebrew

    Here is homebrew install command.

    brew install peripheryapp/periphery/periphery

    And then setup peripheryapp on your project

    periphery scan --setup

    Select your App’s target name. Don’t forget to save configuration to .periphery.yml

    Check unused codes

    You can see the results.

    Make a script file to save result as text file

    I recommend make a bash script file to save results as text file to keep track progress of reducing unused codes. Here is the bash script. (I changed ruby code (https://www.youtube.com/watch?v=2OQiCj-BG2o) to bash script)

    #!/bin/bash
    
    echo "🔍 start dead code analysis"
    
    result="$(periphery scan --config .periphery.yml)"
    
    current_dir=$(pwd)
    
    result_stripped_of_absolute_path_prefix=$(echo "$result" | sed "s|$current_dir/||g")
    
    filtered_out_result=$(echo "$result_stripped_of_absolute_path_prefix" | awk '/:[0-9]+:[0-9]+:/{ print }')
    sorted_result=$(echo "$filtered_out_result" | sort)
    
    result_with_removed_code_line_number=$(echo "$sorted_result" | sed "s|:[0-9]+:[0-9]+:|:|")
    output=$(echo "$result_with_removed_code_line_number" | tr '\n' '\n' | sort)
    
    echo "$output" > unused-codes.txt 2>&1
    echo "🙌 done with dead code analysis"

    I saved bash script file as check-unused-codes.sh

    You can run bash script file by running sh check-unused.codes.sh in terminal (You can see the results of the unused codes)

    Results will be saved into the unused-codes.txt

    Reference

    Inside iOS Dev

    https://www.parasoft.com/blog/false-positives-in-static-code-analysis/

  • 한국 싱가포르 아시아나 탑승 후기 및 실제 걸리는 시간

    한국에서 싱가포르 가능 시간 및 메뉴는 몇번이나 나오는지 정리

    밥은 몇 번 나오나?

    첫 끼, 이륙 후 한시간내로 준다
    두번째는 끼니라기 보다는 간식, 도착 1시간 전쯤 준다

    실제 비행시간

    이륙 후 착륙까지 시간은 약 5시간 46분

  • UOB Debit Card, How did I report it

    I use UOB debit card, one day I opened bank app and I found a scam transaction.

    Someone used my debit card in USA and Canada (it almost 1000 USD) also My balance also deducted.

    I’m so stressed because that day is I have to send money to my home owner for rent.

    I reported it to HR team first and He guided me

    Process

    Fist, Do report it to police

    I asked why you guide me for reporting it to police first? He said that bank will more pay attention to you once you made a report it police

    Can report it onlice

    Second, Call Scam hotline

    Fortunately I can talk with scam manager at midnight.

    What’s the next?

    A manager blocked my debit card and reissued it. He said that It take around 7-10 working day to get my money. Sometimes take more time (1 month)

    Thought about it

    I issued debit card not a credit card to use money seriously. But after this issue, I changed my mind. Credit card is better because it can control the status of payment and cancel it. But Debit card cannot. If someone already use my card then It affect my balance too.

    To get my money, It take too long time. That’s not make sense!

  • UOB 체크카드, 카드 도용 결제 발견 및 신고후기

    UOB 체크카드를 쓰는데 월급을 확인 할 겸 통장 잔고를 확인해봤다

    그런데 미국과 캐나다에서 거의 1000불 가까이 누군가가 내 카드를 사용한 것을 발견했고 통장 잔고도 빠져나간 상태였다

    말로만 듣던 카드도용 결제건이 나에게 발생했다

    일단 곧바로 HR에 이런일이 발생했다고 보고하니까 두가지 절차를 알려줬다

    신고절차

    첫번째, 인근 경찰에 먼저 신고할 것

    이유를 물어봤는데 경찰에 먼저 신고 접수후에 은행에 신고하는 것이 더 안전하다고 했다. 은행에서도 경찰 신고접수건을 알게되면 더 신경쓴다는 것이 현지 친구가 조언해준 내용.

    온라인으로도 신고 접수가 가능하다

    두번째, 은행에 신고할 것.

    보통 카드도용의 경우 24시간 직원과 바로 통화연결이 가능하다.

    다음 조치는?

    일단 직원이 카드를 바로 중지해줬고 재발급을 진행해줬다. 그 이후에도 계속 카드 결제가 추가적으로 발생하지 않았는지 확인 중이다.

    일단 문제가 된 결제건은 빠르면 7-10일 늦으면 1달내에 해결해준다고 안내 받았다

    마치며

    돈을 계획있게 사용하려고 체크카드를 만들었는데 이런일을 겪어보니 차라리 신용카드를 쓰는게 더 안전하다는 생각이 들었다. 특히나 외국에선… 왜냐면 도용된 이후 카드사용 즉시 통장 잔고에서 돈이 빠져나가기 때문이다

  • 싱가포르 슈퍼에서 장보기 (아이템 추천)

    싱가포르 슈퍼에서 장보기 (아이템 추천)

    오늘 포스팅 내용은 싱가포르 슈퍼에서 장보기이다.

    여기 처음 왔을 때 모든 식재료와 브랜드가 생소해서 실패한 경우가 많았다. 종목별로 괜찮은 아이템 추천해보려고 한다.

    우유 (추천제품 FarmFresh 말레이시아 우유)

    우유는 하도 실패를 많이해서 인터넷으로 많이 찾아보고 싱가포르 사람들이 추천해주는 걸로 먹어봤다. 일단 일본 우유는 피하고 싶어서 패스했다.

    FarmFresh라는 제품으로 정착했다. 꽤 맛있고 고소하고 무엇보다 집에서 라떼 만들어 먹을때 잘 어울린다.

    오트밀 우유 (OATSIDE 혹은..)

  • City Commuter App Privacy Policy

    City Commuter App Privacy Policy

    At City Commuter App, we are committed to protecting the privacy of our users. This privacy policy explains the types of information we do not collect, how we use the information we do not collect, and the steps we take to protect it.

    Information We Do Not Collect

    • Personal information: We do not collect any personal information from our users such as names, email addresses, or contact information.

    • Usage information: We do not collect any information about how our users use our app, such as the features accessed or actions taken.

    • Device information: We do not collect any information about the devices used to access our app, such as the model, operating system, or screen resolution.

    Use of Information

    We do not collect any information from our users, so we do not use any information for any purposes.

    Sharing Information

    We do not collect any information from our users, so we do not share any information with third parties.

    Changes to Our Privacy Policy

    We may update this privacy policy from time to time to reflect changes to our information practices. We will notify you of any changes by posting the new privacy policy on this page.

    Contact Us

    If you have any questions or concerns about our privacy policy, please contact us at shawn@shawnbaek.com

    Please note that this is a sample privacy policy, but as you said your app doesn’t collect any user data, you don’t have to share anything about data collection. However, it’s always a good idea to have a privacy policy in place to inform users about your app’s data practices and to give them peace of mind.

  • How Swift Compile Optimazation Level works

    How Swift Compile Optimazation Level works

    Optimization Level

    Swift compiler has 3 optimization options (link)

    • -O

      • for product code

    • -Onone

      • for development and debugging mode.

    • -Osize

      • for size optimization over the optimizing code

     

    How to compile swift with optimization level?

    Here is a simple swift code for checking execution time. (main.swift)

    import Foundation
    func sum(from: Int, to: Int) -> Int {
        var result = 0
        for i in from...to {
            result += i
        }
        return result
    }
    
    let startTime = Date()
    let result = sum(from: 1, to: 10000000)
    let endTime = Date()
    
    print("Result: \(result)")
    print("Calculation Time: \(endTime.timeIntervalSince(startTime)) seconds")

    Compiled it with -Onone

    swiftc -Onone main.swift && ./main
    //Result
    Result: 50000005000000
    Time: 1.4896910190582275 seconds

    Compiled it with -O

    swiftc -O main.swift && ./main
    //Result
    Result: 50000005000000
    Time: 0.006083011627197266 seconds

    Results

    -O option is 24,389% faster than -Onone option

     

    Check SIL file

    swiftc -O main.swift is generating executable file. It is not a human readable file. The optimization process transforms the source code into machine code, which is the binary code that can be executed directly by the computer.

    Do you want to see the intermediate representation of the Swift code generated during the optimization process?

    You can use the -emit-sil flag with the swiftc command. This will output the SIL (Swift Intermediate Language) code generated by the compiler, which is a human-readable representation of the Swift code that has been optimized

    swiftc -O -emit-sil main.swift -o main.sil
    swiftc -Onone -emit-sil main.swift -o main.sil

    You can see the main.sil file. Let’s open it using TextEdit

    Now we can see the details by checking sil file. If you want to learn more about it visit here

     

    Conclusion

    I wanted to test how Swift’s optimization levels work, so I used the -emit-sil option to generate an SIL (Swift Intermediate Language) file. This file serves as a bridge between the Swift source code and the machine code, and allows the Swift compiler to perform optimizations such as dead code elimination, constant folding, inlining, and loop unrolling. By inspecting and analyzing the SIL file, we can better understand how the Swift compiler is optimizing our code. Additionally, SIL can be used for debugging purposes since it provides a more detailed and low-level view of the generated code compared to the original Swift source

    Notes
    This blog post has been edited using ChatGPT to refine some of the sentences

     

  • 한국에서 애플 홈킷 사용하기 (Leviton 2세대 제품 D215S-2RW)

    한국에서 애플 홈킷 사용하기 (Leviton 2세대 제품 D215S-2RW)

    한국에서 애플 홈킷 사용하기 두번째 포스팅이다.

    Leviton 1세대 사용후기를 보고 싶다면 여기를 클릭해서 확인할 것.

    Leviton 2세대 D215S-2RW를 설치하다

    이전에 사용했던 1세대 제품은 1년 6개월 남짓 사용하다보니 고장났다. 앱으로 스위치 상태를 확인할수는 있었으나 물리적인 스위치 동작이 되지 않았다.

    그래서 이번엔 보다 개선된 2세대 제품을 사용한 후기를 남긴다.

    1세대 제품과 달라진 점

    • 스위치 커버가 내장되어 있음
    • 외부의 전선을 스위치에 바로 연결하던 1세대와는 다르게 전선과 전선을 연결하는 방식으로 변경됨 (오히려 불편해짐)
    • 그러나 1세대보다 훨씬 안정적이고 평도 좋음. 고장이 잘 안난다는 피드백이 많음

    2세대 박스

    1세대에는 없었던 스위치 커버가 포함되어있다. 하단에 주황색 소켓단자는 결국 사용하지 않았다. 절연 테이프로 연결함

    가장 크게 달라진 부분이다. 1세대는 전선이 저렇게 나와있지 않았다. (이전 포스팅 참고)

    왼쪽 2세대 제품, 오른쪽 1세대 제품

    설명서

    1세대를 설치해봤다면 생각보다 어렵지 않다. 다만 한국의 스위치 소켓은 공간이 협소하기 때문에 1세대보다 훨씬 전선을 정리하기가 힘들다. 특히 주황색 전선 연결 소켓이 커서 스위치 박스에 넣기가 엄청 어려웠다.

    가격은?

    1개에 56.77 달러이다. 한화로 7만 4천원 정도이므로 저렴하지는 않다.

    1년 이상 한국에서 사용한 후기

    사실 1세대 제품들을 한 5개 정도 구매했었는데 2년안에 모두 고장났다. 그리고 2세대로 교체했다. 아마존 후기를 보면 1세대 문제가 많다는 댓글이 엄청 많은 걸 보면 확실히 문제가 있는 제품이었던 것 같다. 이런 모든 부분들을 개선한 2세대 제품은 아주 만족스럽다.

    구매하고 싶은 사람은 아마존에서 직구를 하거나 공홈에서 구매하면 된다.

    마치며

    한국에서 애플 홈킷 지원하는 스마트 스위치를 사용하려면 중성선이 필요했다. 나도 이걸 써보고 싶어서 전기공사하시는 분을 불러서 스위치가 있는 곳마다 중성선을 설치했다. 하지만 최근에는 Leviton에서도 중성선 연결이 필요없는 스마트 스위치를 출시했다.

    앞으로는 중성선 없는 스위치 제품들이 대세가 될 것 같다. 설치가 훨씬 간편하기 때문이다.

    중성선 없는 제품에 관심있는 분들은 여기를 참고해보면 좋을 것 같다. 모델명은 NO-NEUTRAL SWITCH, DN15S-2RW 이다. (단, 애플 홈킷에 바로 등록이 되는 제품인지는 아직 확인이 필요하지만 제품 설명에 Working with Apple Homekit이라고 적혀있는 것을 보면 분명 등록될 것이다)

    다음번에는 중성선 없는 스위치 설치 및 사용 후기로 찾아오겠다. 아무튼 애플 유저라면 애플 홈킷으로 스위치를 컨트롤 하는 것이 얼마나 편한지 써보면 알 것이다. 강추!

    업데이트 – 중선선 필요없는 제품 애플 홈킷 지원 확인

    참고로 중성선 연결없이 사용하는 제품 모델명은

    • DN6HD
    • DN15S

    그리고 브릿지 제품명은 MLWSB 이다.

    공식 유투브 계정에서 확인 완료