Programming Development

iOS custom keyboard around the keyboard to move the cursor implement

Until we are,For example, third-party input method Sogou input method has a classic gesture - paddling around on the keyboard to move the cursor。And this feature I am also very common,so,I want to implement it yourself。

The first thing I think of is UISwipeGestureRecognizer ,However, with predictable results,Paddling can only move the cursor one space,This is not what I want[……]

Click link to continue reading...

Swift in regular expressions

At the beginning of a,Swift did not provide regular expression support,So we can only package,For example write a structure,Like this:

In fact, Swift already has support for regular expressions,We just need to:
[crayon-6902be1ea95f2610029[……]

Click link to continue reading...

Swift set cut scores

in most cases,If we want to get the contents of a section of the array (for example, front-to-middle,Some of the values ​​of the array or the last),This time you need to traverse the array to assign a new array:

Such an array of short, better said it does not matter,However, if the array is relatively large and we need to value and more,It is clear that it is a waste of time to traverse up。[……]

Click link to continue reading...

Let go pip Agent

When using python,Often you need to download some third-party framework,Fortunately, python has a similar apt package management tool,pip。

but,Although management packs can pip,But no source switching mirror,And we downloaded package,Most of the large foreign code hosting server,This often leads to a few hundred KB of package to download one hour。

 [……]

Click link to continue reading...

"Plugin invalidated" ios Customize Keyboard

Home for iOS system does not seem to be willing to write an input method,Except for a few oligarchs other than large companies do nothing else。Approaching China's unique Apple ecological platform,Find inside are empty shells,Meaningful applications is really very little of。

Pocketed blog recently is working to write in the first paragraph can really support the iOS platform the code table of double input method,First compatible double nature of the programme is open to the "Chick double",[……]

Click link to continue reading...

Use SQLite database in Swift Lane

SQLite

Speaking SQLite,It is well known to you as MySQL,It is a relational database management system,But unlike the latter is that,It does not necessarily correspond completely independent server!

Generally speaking,SQLite is in the form of a file exist,Mostly used in embedded applications in storage。SQLite library is loaded by the application code,It can easily direct access to SQL[……]

Click link to continue reading...

Xcode meanings in various Sent Event

In Xcode,We give iOS platform App,Will inevitably have to add a button to bind an event,At this time there is a statement,You will find a button touch event already not before a "Touch Up Inside" so simple。

Referring to FIG title,There are at least not so much in some events can be for your choice,In more features at the same time,Novices may be more ignorant of the force?[……]

Click link to continue reading...

nRF24L01 wireless transceiver module Arduino

nRF24L01 is a work in the world-wide 2.4 ~ 2.5GHz ISM band single-chip wireless transceiver chip。Wireless transceiver comprising:Frequency generator、Enhanced mode controller SchockBurstTM、PA、Crystal Oscillator、Modulator、Demodulator。Set the output power and channel selection protocol can be set via the SPI interface。

Easy setup and low[……]

Click link to continue reading...

embedXcode find Arduino system library header files

Arduino play on Mac,In addition to the official use of the simple addition of IDE,You can also choose to use Xcode to develop。

use embedXcode Plug-ins can make Xcode transformed into embedded development IDE,Including native compilation、Uploading full set of features。

but,In the standard library when it is a problem,For example, the[……]

Click link to continue reading...

Swift in the single mode

In the process of writing the code,We will meet when the need to ensure that only one instance of the global,This time use the singleton pattern。

Single mode--this ensures that only one instance of a class,And provide a global point of access to。

What about how to implement the singleton pattern? We take a look at the classic Java code,How to implement the singleton pattern。

We had a quick search on the Internet "java singleton pattern" will be able to find[……]

Click link to continue reading...

Using python write a domain whitelist reptiles

Some time ago I wrote an article,SayIt is time to use the whitelist to the wallIt's,But that has expired long whitelist,It is not so smooth with the,Then I say boasted:I want to implement your own a reptile,Come crawling China's domain,Good update whitelist。

Ok,All in all this crawler is written on the line and then climb took more than ten thousand,But in the end I found the former to do a better solution,So the project was abandoned reptile[……]

Click link to continue reading...

Strongly typed programming language、Weakly typed

in most cases,People use the programming language is implicitly convert data types to determine whether a languageWeakly typedLanguage,For example, C。

In fact,For in addition to the more classic foreign language,Most other common languages ​​Strong、Weak type could not tell - or,yesInconsistentof。So it will always be someone to argue。If we take as the basis for the concept of opening,Then the conflicts will appear:

比如 Pasc[……]

Click link to continue reading...

Swift sent through HTTP JSON-RPC command

While our Web development,Would inevitably have to obtain data from the Web server,In many cases also need to submit the data to the server,Which at the moment,We are used to using JSON formatted data,Because it is easy,This time we look,How to use Swift to send JSON-RPC command and get response。

JSON-RPC

JSON-RPC is a stateless and lightweight[……]

Click link to continue reading...

Swift Lane Stack implementation

Today in practice design patterns when there is no sudden discovery Swift stack - Stack class is。Since I was shining Java version of the design patterns to learn,So I had no choice but to implement a look at the。

But speaking,In Apple's official manual, "generic" chapter really have a stack of chestnuts,It is the structure implemented。This is actually in line with the Swift's style - after all,, S[……]

Click link to continue reading...

Xcode one of those plug-ins

Update:A blink of an eye 5 Years passed,This article is also invalid... Now Xcode no longer allows random installation of plugins,The only one recommended at the moment Swift Format for Xcode,Everybody,mutual encouragement。

Development on OSX,Then you necessarily involves dealing with this famous IDE。after all,We use IDE is to improve productivity[……]

Click link to continue reading...

A programming algorithms Huawei interview questions

Friend sent today a very special topic:

Topics:There are two array a,b,Size n,Any of the values of the array elements,Disorder;
Requirements:Through the exchange of a,Elements in the b,Elements of array a and b elements in the array, and the difference between the minimum。

I feel familiar at first glance the problem ... ... And domestic c exams almost,But a closer look seems to be a bit more difficult,Do not look like that has a clue what the problem。Ok,[……]

Click link to continue reading...

iOS Concurrency:Getting NSOperation and Dispatch Queues

Recommended by a friend,Encountered such a good article describes concurrent,I translated it for everyone to read。I am not a professional translator,Limited level。Error is inevitable,If readers find the text is wrong,Welcome messages treatise!
R0uter
Article translated appcoda iOS Concurrency: Getting Started with NSOperation a[……]

Click link to continue reading...