Programming Development

Kotlin/Android detect text encoding

Recently doing Android version of drop-box input method,I had a problem importing the code table。Because the code table of the drop-box input method supports two encoding formats: utf8 and gb18030.,Even my own built-in code table uses a mixture of these two formats.。In Swift or Python,If you use the wrong encoding to decode text,You will receive an error。Use this method,I can do it easily[……]

Click link to continue reading...

Open Xcode Live Preview for UIKit

One of the big benefits of using SwiftUI is that you can hot update the App like Flutter,UI code changed,Will be directly reflected in the simulator or the real machine,Greatly improve the efficiency of writing user interfaces,No need to change 1px,run,Various clicks,Then check the loop of effects。But it's too early to use SwiftUI,After all, there is still a lot of iOS 12 Equipment in operation[……]

Click link to continue reading...

macOS uses the atos command to parse arbitrary crash records and sample data

Recently, the drop grid input method has encountered several difficult to reproduce problems-the key is that it will not cause a crash。This makes the crash statistics function completely ineffective,The specific performance is that the input method will suddenly get stuck for a few seconds in some cases,Very annoying。Then I thought,macOS comes with activity manager,There is a "sampling" function,You can see the current execution (call) status of the corresponding process,Can I use it to analyze the cause of the error?

In Japan[……]

Click link to continue reading...

clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9

Normal,You will encounter this error when installing a Python package,This package must be a package containing C ++ code。

This is due to incompatibility after macOS update,In General,The maintainer of this package should already be compatible with this particular situation:

So on macOS[……]

Click link to continue reading...

Python detects its own memory footprint in real time

Recently doing text statistics,Implemented in Python,Encountered an interesting problem-how to save statistical results。

Writing directly into memory is really impossible,Memory exhausted after ten hours,The program was forced to close。If you write directly to the database,Each write is too slow,It's been more than ten hours,If you go on like this, you will have to count on the week,Not a solution。

At last,I thought of a solution that does both[……]

Click link to continue reading...