Quickly update Python packages

Python is a good thing,Many times we like to use it to write small things... For example, many services on my server are written in Python ( Supervisor will use your Python program becomes Services ),Accumulate,Many dependency packages are actually used。

but,These Python dependencies will not follow your apt upgrade 进行更新,Today, after a long time,I found a package I am using[……]

Click link to continue reading...

Cocoa Binding practical tutorial

First of all, this is not a new technology,It's very old,So old that almost no one mentions it。

This is a product of Apple's MVC model,It was born when there was no iPhone,It is used in conjunction with the Xcode graphical setting interface-such as NIB,of course,Now it has become XIB,Oh,And storyboard。

Now if you want to bind a storyboard object to the code,All you may find are like this:

Click the right mouse button in the left column to open a small window[……]

Click link to continue reading...

Xcode plugin is missing and does not display the solution

In system preferences,Xcode extensions are not displayed

In a previous article, I introduced a way to install multiple versions at the same time Xcode Tool ofUse xcode-install to manage Xcode versionsBut when there are multiple Xcodes in your system at the same time,Will cause system confusion,Make Xcode plugins unrecognizable,The main manifestation is that it is not visible at all in the system preferences Xcode pluginOptions-as if you haven't installed them at all。

In short,I'm hereHereFound the answer

First execute the command:

Click link to continue reading...

Use a third-party mouse without a driver on macOS

Enable management of Logitech mouse

All to known,macOS to third partiesmouseVery picky,If it is an ordinary office mouse,That almost works,At most, the fixed DPI requires adjusting the mouse speed.,But if it goes up to a gaming mouse with more buttons,There are many problems。

Not necessarily for playing games,For example, a mouse with forward and back buttons is very useful when writing code。

In General,The mouse of the famous manufacturer will support macOS better,Mainly because the big factory has the energy to make a mouse for macOSdrive,If a mouse is natively driven by Windows only,[……]

Click link to continue reading...

Use xcodebuild to archive and export app

I wrote an article beforemacOS app script to automate notarize,But there is no mention of using code to automatically compile and generate App scripts,After all, there are many tools to complete this step,For example, fastlane。

I didn’t think about automation before notarize,At the time of writing that article, fastlane did not support notarized upload,So I wrote it myself,The specific compilation command is like this:

Click link to continue reading...

/usr/libexec/lsd occupied 100% CPU solution

Suddenly discovered a large number of writes on the disk recently,Open the task manager,Found a process called "lsd" continues to occupy 20% – 40% CPU,Very strange。

After some inquiries,Learned that this process is a system process on macOS and iOS,Full name is "Launch Service Daemon",Responsible for all App file type association and startup。But its database is sometimes damaged,This causes it to frequently read and verify certain data。

Once its database is damaged,You will encounter lsd[……]

Click link to continue reading...

Use xcode-install to manage Xcode versions

we all know,There is pyenv when using Python,If you use ruby, there is rbenv,Can easily control and manage the version of the programming language environment,Then,Is there any way,Can Xcode switch versions like this?

Every time Xcode releases an update,More or not has become a problem,Difficult to download,Can't resume,Can't use third-party tools to download,It's really terrible... not to mention the compatibility issue when multiple versions。

use xcode-install,One time[……]

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 that it can be successfully compiled on macOS。

But if you are using PyPy,Maybe even if the maintainer includes this sentence,You can't succeed[……]

Click link to continue reading...

Categorized as Python Tagged

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 combines both-using memory as a buffer,After reaching a certain amount, all the current data will be merged into the hard disk at one time。

But then there is a threshold,How to confirm[……]

Click link to continue reading...