Python3 implements full-width and half-width conversion.
Preface
This article describes how to convert the full-width and half-width characters in python3 for your reference.
I. background
What problems can be solved:Quick and convenient automatic conversion of full-width and half-width text
Applicable scenarios:Replace all-round characters with half-width characters in student answer data
Ii. Principle of full-width halfwidth
Full angle:Double Byte Character (DBC)
The half corner is:Single Byte
. implementation
1. there are two unicode and character conversion functions:
1/*** convert unicode to character 3 * @ param int $ unicode 4 * @ return string UTF-8 character 5 */6 function unicode2Char ($ unicode) {7 if ($ unicode
2. Full-angle to half-angle
1/** 2 * fullwidth to halfwidth 3 * @ param string $ str 4 * @ return string 5 **/6 function sbc2Dbc ($ str) {7 return preg_replace (8 // full-width character 9'/[\ x {3000} \ x {ff01}-\ x {ff5f}]/ue ', 10 // code conversion 11 // 0x3000 i
a large amount of historical data, we will carry out a physical sub-table, otherwise every day millions records, a year down is hundreds of millions of. So, the structure of our table is this:CREATE TABLE [dbo]. [His20140822] ([No] [bigint] IDENTITY (null,[dtime) not "[datetime] not Null,[mgrobjid] [varchar] (*) not null,[id] [varchar] (NO) Null,[value] [varchar] () not NULL, CONSTRAINT [pk_his20140822] PRIMARY KEY CLUSTERED ([No] ASC) with (Pad_index = OFF, S Tatistics_norecompute = off, Igno
will carry out a physical sub-table, otherwise every day millions records, a year down is hundreds of millions of. So, the structure of our table is this:CREATETABLE [dbo]. [His20140822] ([No] [bigintIDENTITY (1,1)NotNull,[dtime] [datetime]NotNull,[mgrobjid] [VARCHAR] (36)NotNull,[id] [varchar] (50) not NULL,[value" [varchar] (50) not null, CONSTRAINT [PK_ HIS20140822] primary key CLUSTERED ([ no] ASC) with (pad_index = off, Statistics_norecompute = off, Ignore_dup_key = off, Allow_row_locks =
millions of. So, the structure of our table is this:CREATETABLE [dbo]. [His20140822] ([No] [bigintIDENTITY (1,1)NotNull,[dtime] [datetime]NotNull,[mgrobjid] [VARCHAR] (36)NotNull,[id] [varchar] (50) not NULL,[value" [varchar] (50) not null, CONSTRAINT [PK_ HIS20140822] primary key CLUSTERED ([ no] ASC) with (pad_index = off, Statistics_norecompute = off, Ignore_dup_key = off, Allow_row_locks = on, allow_page_locks = on) ON [primary]) on [PRIMARY] No as the unique identification, acquisition
store a large amount of historical data, we will carry out a physical sub-table, otherwise every day millions records, a year down is hundreds of millions of. So, the structure of our table is this:CREATETABLE [dbo]. [His20140822] ([No] [bigintIDENTITY (1,1)NotNull,[dtime] [datetime]NotNull,[mgrobjid] [VARCHAR] (36)NotNull,[id] [varchar] (50) not NULL,[value" [varchar] (50) not null, CONSTRAINT [PK_ HIS20140822] primary key CLUSTERED ([ no] ASC) with (pad_index = off, Statistics_norecompute = o
will carry out a physical sub-table, otherwise every day millions records, a year down is hundreds of millions of. So, the structure of our table is this:CREATETABLE [dbo]. [His20140822] ([No] [bigintIDENTITY (1,1)NotNull,[dtime] [datetime]NotNull,[mgrobjid] [VARCHAR] (36)NotNull,[id] [varchar] (50) not NULL,[value" [varchar] (50) not null, CONSTRAINT [PK_ HIS20140822] primary key CLUSTERED ([ no] ASC) with (pad_index = off, Statistics_norecompute = off, Ignore_dup_key = off, Allow_row_locks =
-level speaker market)ThreeFrench speaker Brand1, JMLab (Jin Wave) (Jm-lab) is a world-renowned high-level speaker manufacturer, it was founded in France in 1979)2, the Sound of Dream/visionacoustique (world famous speaker brand)FourDanish speaker Brand:1. avance/Crown (Danish brand, world famous speaker)2, dynaudio/Dan (hi-end class speaker brand, across the civil and professional these two areas)3. dali/Danny (Danish brand, world famous speaker)4, Jamo (Danish prestige Treasure was established
Red cherry Maple software --- another tool to flexibly apply data to mobile phones XML -based Data Transformation Server SoftwareBeijing Red Cherry Maple Software Co., Ltd.The server Based Converter (SBC) products based on XML applications were released with the Japanese head office Antena House. in the rapidly developing communication industry, mobile communication has become the most important communication service, and the mobile terminal has beco
input from IME to set the value of this attribute to nocontrol.
Important:Unless imemode has been set to imemode. Disable programmatically, you can change it interactively. In the previous case, you cannot use ime.
(2) meanings of imemode attributes:Imemode enumeration: Specifies a value that is used to determine the status of the Input Method Editor (IME) of the selected object.The following is Microsoft's explanation:
Member name
Description
map.Of course, we may also encounter a situation where the webpage is wider than the screen. This is the first clip of our program, and then the browser scroll bar moves horizontally to capture the rest, then, connect and perform the preceding steps.// Get bitmap to hold screen fragment.Bitmap Bm = new Bitmap (screenwidth, screenheight,System. Drawing. imaging. pixelformat. format16bpprgb555 );
// Create a target bitmap to draw.Bitmap bm2 = new Bitmap (widthsize + urlextraleft, heightsize +Ur
line BC,The second time period is completed, and the object is found in C, which is in the same plane as the triangle ASB.Connection SC. Because Sb and CC are parallel, the area SBC is equal to the area SBC, so it is equal to the area SAB.Similarly, if the centripetal force has successively played a role in C, D, E, and so on,Allows objects to draw straight lines such as CD, de, and EF in their respective
-wide viewingSIP
In a non-IMS network, the topology is as follows:
In this structure, there are three main parts:
Public Network and business customizer node: This is a PSTN network and a user-level device.
DMZ zone: Some network elements connected to the Internet for security purposes.
Core network: the core area of network message processing.
Note:
1. The media server in the core network can sometimes play the role of UA. For example, if you customize the voice message service, the Media Serv
) =s (+s) (1,3,4) +s (1,4,5) +s (1,5,6)Here we have some doubts, first, figure 1 is given a convex polygon, then this algorithm for non-convex polygon is also applicable? For example, the following is the simplest shape of a convex polygon:Figure 2With just the division method, there will be a strange problem, that is, there is a triangle appears in the outside of the graph, and the other one is beyond the scope of the polygon (divided in order to SAB,SBC
function Sbc_dbc ($STR, $args 2) {//half-width and full-width conversion functions, the second parameter if 0, is half-width to full-width; if 1, it is full-width to half-width
$DBC = Array (
0, 1, 2, 3, 4,
5, 6, 7, 8, 9,
A, B, C, D, E,
F, G, H, I, J,
K, L, M, N, O,
P, Q, R, S, T,
U, V, W, X, Y,
Z, a, B, C, D,
E, F, G, H, I,
J, K, L, M, N,
O, p, Q, R, S,
T, u, V, W, X,
Y, Z,-,,:,
. , , , / , % , # ,
! , @ , & , ( , ) ,
",", ",",? ,
[ , ] , { , } , \ ,
|, +, =, _, ^,
¥, ̄, '
);
$
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.