1. unit synedittextdoublewidthchars2;
  2. // fix up chinese symbel width
  3. //by steven
  4.  
  5. {$mode objfpc}{$H+}
  6.  
  7. interface
  8.  
  9. uses
  10. Classes, SysUtils;
  11.  
  12. type TInterval=record
  13. first:longword;
  14. last:longword;
  15. end;
  16.  
  17. function mk_wcswidth(wcs:unicodestring ):integer;
  18. function mk_wcwidth(ucs:longword):integer;
  19.  
  20. implementation
  21.  
  22. const combining:array[0..122] of Tinterval=
  23. ((first: $0300;last:$0357 ),
  24. (first: $035D;last:$036F ),
  25. (first: $0483;last:$0486 ),
  26. (first: $0488;last:$0489 ),
  27. (first: $0591;last:$05A1 ),
  28. (first: $05A3;last:$05B9 ),
  29. (first: $05BB;last:$05BD ),
  30. (first: $05BF;last:$05BF ),
  31. (first: $05C1;last:$05C2 ),
  32. (first: $05C4;last:$05C4 ),
  33. (first: $0600;last:$0603 ),
  34. (first: $0610;last:$0615 ),
  35. (first: $064B;last:$0658 ),
  36. (first: $0670;last:$0670 ),
  37. (first: $06D6;last:$06E4 ),
  38. (first: $06E7;last:$06E8 ),
  39. (first: $06EA;last:$06ED ),
  40. (first: $070F;last:$070F ),
  41. (first: $0711;last:$0711 ),
  42. (first: $0730;last:$074A ),
  43. (first: $07A6;last:$07B0 ),
  44. (first: $0901;last:$0902 ),
  45. (first: $093C;last:$093C ),
  46. (first: $0941;last:$0948 ),
  47. (first: $094D;last:$094D ),
  48. (first: $0951;last:$0954 ),
  49. (first: $0962;last:$0963 ),
  50. (first: $0981;last:$0981 ),
  51. (first: $09BC;last:$09BC ),
  52. (first: $09C1;last:$09C4 ),
  53. (first: $09CD;last:$09CD ),
  54. (first: $09E2;last:$09E3 ),
  55. (first: $0A01;last:$0A02 ),
  56. (first: $0A3C;last:$0A3C ),
  57. (first: $0A41;last:$0A42 ),
  58. (first: $0A47;last:$0A48 ),
  59. (first: $0A4B;last:$0A4D ),
  60. (first: $0A70;last:$0A71 ),
  61. (first: $0A81;last:$0A82 ),
  62. (first: $0ABC;last:$0ABC ),
  63. (first: $0AC1;last:$0AC5 ),
  64. (first: $0AC7;last:$0AC8 ),
  65. (first: $0ACD;last:$0ACD ),
  66. (first: $0AE2;last:$0AE3 ),
  67. (first: $0B01;last:$0B01 ),
  68. (first: $0B3C;last:$0B3C ),
  69. (first: $0B3F;last:$0B3F ),
  70. (first: $0B41;last:$0B43 ),
  71. (first: $0B4D;last:$0B4D ),
  72. (first: $0B56;last:$0B56 ),
  73. (first: $0B82;last:$0B82 ),
  74. (first: $0BC0;last:$0BC0 ),
  75. (first: $0BCD;last:$0BCD ),
  76. (first: $0C3E;last:$0C40 ),
  77. (first: $0C46;last:$0C48 ),
  78. (first: $0C4A;last:$0C4D ),
  79. (first: $0C55;last:$0C56 ),
  80. (first: $0CBC;last:$0CBC ),
  81. (first: $0CBF;last:$0CBF ),
  82. (first: $0CC6;last:$0CC6 ),
  83. (first: $0CCC;last:$0CCD ),
  84. (first: $0D41;last:$0D43 ),
  85. (first: $0D4D;last:$0D4D ),
  86. (first: $0DCA;last:$0DCA ),
  87. (first: $0DD2;last:$0DD4 ),
  88. (first: $0DD6;last:$0DD6 ),
  89. (first: $0E31;last:$0E31 ),
  90. (first: $0E34;last:$0E3A ),
  91. (first: $0E47;last:$0E4E ),
  92. (first: $0EB1;last:$0EB1 ),
  93. (first: $0EB4;last:$0EB9 ),
  94. (first: $0EBB;last:$0EBC ),
  95. (first: $0EC8;last:$0ECD ),
  96. (first: $0F18;last:$0F19 ),
  97. (first: $0F35;last:$0F35 ),
  98. (first: $0F37;last:$0F37 ),
  99. (first: $0F39;last:$0F39 ),
  100. (first: $0F71;last:$0F7E ),
  101. (first: $0F80;last:$0F84 ),
  102. (first: $0F86;last:$0F87 ),
  103. (first: $0F90;last:$0F97 ),
  104. (first: $0F99;last:$0FBC ),
  105. (first: $0FC6;last:$0FC6 ),
  106. (first: $102D;last:$1030 ),
  107. (first: $1032;last:$1032 ),
  108. (first: $1036;last:$1037 ),
  109. (first: $1039;last:$1039 ),
  110. (first: $1058;last:$1059 ),
  111. (first: $1160;last:$11FF ),
  112. (first: $1712;last:$1714 ),
  113. (first: $1732;last:$1734 ),
  114. (first: $1752;last:$1753 ),
  115. (first: $1772;last:$1773 ),
  116. (first: $17B4;last:$17B5 ),
  117. (first: $17B7;last:$17BD ),
  118. (first: $17C6;last:$17C6 ),
  119. (first: $17C9;last:$17D3 ),
  120. (first: $17DD;last:$17DD ),
  121. (first: $180B;last:$180D ),
  122. (first: $18A9;last:$18A9 ),
  123. (first: $1920;last:$1922 ),
  124. (first: $1927;last:$1928 ),
  125. (first: $1932;last:$1932 ),
  126. (first: $1939;last:$193B ),
  127. (first: $200B;last:$200F ),
  128. (first: $202A;last:$202E ),
  129. (first: $2060;last:$2063 ),
  130. (first: $206A;last:$206F ),
  131. (first: $20D0;last:$20EA ),
  132. (first: $302A;last:$302F ),
  133. (first: $3099;last:$309A ),
  134. (first: $FB1E;last:$FB1E ),
  135. (first: $FE00;last:$FE0F ),
  136. (first: $FE20;last:$FE23 ),
  137. (first: $FEFF;last:$FEFF ),
  138. (first: $FFF9;last:$FFFB ),
  139. (first: $1D167;last:$1D169 ),
  140. (first: $1D173;last:$1D182 ),
  141. (first: $1D185;last:$1D18B ),
  142. (first: $1D1AA;last:$1D1AD ),
  143. (first: $E0001;last:$E0001 ),
  144. (first: $E0020;last:$E007F ),
  145. (first: $E0100;last:$E01EF ));
  146.  
  147. function bisearch(ucs:word; table: array of TInterval ;max:integer):boolean;
  148. var min,mid:word;
  149. begin
  150. min := 0;
  151. if(ucs < table[0].first) and (ucs > table[max].last) then
  152. begin
  153. result :=false;
  154. exit;
  155. end;
  156.  
  157. while max >= min do
  158. begin
  159. mid := (min + max ) div 2;
  160. if (ucs > table[mid].last ) then
  161. min := mid + 1
  162. else if (ucs < table[mid].first) then
  163. max := mid -1
  164. else
  165. begin
  166. result := true;
  167. exit;
  168. end;
  169. end;
  170.  
  171. result := false;
  172. end;
  173.  
  174. function mk_wcwidth(ucs:longword):integer;
  175. //var ucs:longword;
  176. begin
  177. //ucs := ord(aucs);
  178. if ucs=0 then
  179. begin
  180. result := 0;
  181. exit;
  182. end;
  183.  
  184. if ucs in [32,$7f..$a0] then
  185. begin
  186. result := -1;
  187. exit;
  188. end;
  189.  
  190. if (ucs = $2220)or
  191. (ucs = $2312)or
  192. (ucs = $2299)or
  193. (ucs = $224c)or
  194. (ucs = $223d)or
  195. (ucs = $221a)or
  196. (ucs = $e022)or
  197. (ucs = $203b)or
  198. (ucs = $2116)or
  199. (ucs = $ffE0)or
  200. (ucs = $2103)or
  201. (ucs = $2235)or
  202. (ucs = $2234)or
  203. (ucs = $22A5)or
  204. (ucs = $2225)or
  205. (ucs = $222E)or
  206. (ucs = $221D)or
  207. (ucs = $221E)or
  208. (ucs = $2227)or
  209. (ucs = $2228)or
  210. (ucs = $2211)or
  211. (ucs = $220F)or
  212. (ucs = $222A)or
  213. (ucs = $2229)or
  214. (ucs = $2208)or
  215. (ucs = $226E)or
  216. (ucs = $226F)or
  217. (ucs = $216A)or
  218. (ucs = $216B)or
  219. (ucs = $2160)or
  220. (ucs = $2161)or
  221. (ucs = $2162)or
  222. (ucs = $2163)or
  223. (ucs = $2164)or
  224. (ucs = $2165)or
  225. (ucs = $2166)or
  226. (ucs = $2167)or
  227. (ucs = $2168)or
  228. (ucs = $2169)or
  229. (ucs = $2236)or ////------
  230. (ucs = $2016)
  231. then
  232. begin
  233. result := 2;
  234. exit;
  235. end;
  236.  
  237. if bisearch(ucs,combining,length(combining) - 1) then
  238. begin
  239. result := 0;
  240. exit;
  241. end;
  242.  
  243. result := 1 ;
  244.  
  245. // Hangul Jamo init. consonants */
  246. // CJK ... Yi */
  247. // Hangul Syllables */
  248. // CJK Compatibility Ideographs */
  249. // CJK Compatibility Forms */
  250. // Fullwidth Forms */
  251. //BUG, duplicate
  252. if(ucs <> $303f)
  253. and(
  254. (ucs = $232a) or
  255. (ucs = $2e80) or
  256. //****************patched by steven
  257. //unicode , high byte , low byte
  258.  
  259. //----------------------end patch
  260. (ucs > $1100) and (ucs <$115f) or
  261. (ucs > $2329) and (ucs <$a4cf)or
  262. (ucs > $ac00) and (ucs <$d7a3)or
  263. (ucs > $f900) and (ucs <$faff)or
  264. (ucs > $fe30) and (ucs <$fe6f)or
  265. (ucs > $ff00) and (ucs <$ff60)or
  266. (ucs >$ffe0) and (ucs <$ffe6) or
  267. (ucs > $20000) and (ucs <$2fffd)or
  268. (ucs > $30000) and (ucs <$3fffd))then
  269. inc(result);
  270. end;
  271.  
  272. function mk_wcswidth(wcs:unicodestring ):integer;
  273. var w,l,width:integer;
  274. i:integer;
  275. begin
  276. i:=1;
  277. width := 0;
  278. l :=length(wcs);
  279. while (i<=l) do
  280. begin
  281. w := mk_wcwidth(ord(wcs[i]));
  282. if w < 0 then
  283. begin
  284. result := -1;
  285. exit;
  286. end;
  287. width := width + w;
  288. inc(i);
  289. end;
  290. result := width;
  291.  
  292. end;
  293.  
  294. end.
  1. {------------------------------------------------------------------------------- The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Alternatively, the contents of this file may be used under the terms of the GNU General Public License Version 2 or later (the "GPL"), in which case the provisions of the GPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the GPL and not to allow others to use your version of this file under the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL. If you do not delete the provisions above, a recipient may use your version of this file under either the MPL or the GPL. -------------------------------------------------------------------------------} (* visit the following URL for more information http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt http://unicode.org/reports/tr11/ *) unit SynEditTextDoubleWidthChars; {$I synedit.inc} interface uses Classes, SysUtils, LazSynEditText ,synedittextdoublewidthchars2; type { SynEditTextDoubleWidthChars } SynEditStringDoubleWidthChars = class(TSynEditStringsLinked) protected procedure DoGetPhysicalCharWidths(Line: PChar; LineLen, Index: Integer; PWidths: PPhysicalCharWidth); override; end; implementation { SynEditTextDoubleWidthChars } procedure SynEditStringDoubleWidthChars.DoGetPhysicalCharWidths(Line: PChar; LineLen, Index: Integer; PWidths: PPhysicalCharWidth); var i: Integer; str:ansistring; begin inherited DoGetPhysicalCharWidths(Line, LineLen, Index, PWidths); if not IsUtf8 then exit; dec(Line); dec(PWidths); for i := 0 to LineLen - 1 do begin inc(Line); inc(PWidths); if Line^ < #$e1 then continue; if PWidths^ = 0 then continue; //读3个字节,转换成unicode //获得绘制宽度 str := ''; str := str + line^ + line[1] + line[2]; //DebugLn(str); // ..writeln(utf8decode(str)); pWidths^ := mk_wcwidth(longword(ord(utf8decode(str)[1]))) ; {* case Line^ of #$e1: case Line[1] of #$84: if (Line[2] >= #$80) then PWidths^ := 2; #$85: if (Line[2] <= #$9f) then PWidths^ := 2; end; #$e2: case Line[1] of #$8c: if (Line[2] = #$a9) or (Line[2] = #$aa) then PWidths^ := 2; #$ba: if (Line[2] >= #$80) then PWidths^ := 2; #$bb..#$ff: PWidths^ := 2; end; #$e3: case Line[1] of #$81: if (Line[2] >= #$81) then PWidths^ := 2; #$82..#$8e: PWidths^ := 2; #$8f: if (Line[2] <= #$bf) then PWidths^ := 2; #$90: if (Line[2] >= #$80) then PWidths^ := 2; #$91..#$FF: PWidths^ := 2; end; #$e4: case Line[1] of #$00..#$b5: PWidths^ := 2; #$b6: if (Line[2] <= #$b5) then PWidths^ := 2; #$b8: if (Line[2] >= #$80) then PWidths^ := 2; #$b9..#$ff: PWidths^ := 2; end; #$e5..#$e8: PWidths^ := 2; #$e9: if (Line[1] <= #$bf) or (Line[2] <= #$83) then PWidths^ := 2; #$ea: case Line[1] of #$80, #$b0: if (Line[2] >= #$80) then PWidths^ := 2; #$81..#$92, #$b1..#$ff: PWidths^ := 2; #$93: if (Line[2] <= #$86) then PWidths^ := 2; end; #$eb..#$ec: PWidths^ := 2; #$ed: if (Line[1] <= #$9e) or (Line[2] <= #$a3) then PWidths^ := 2; #$ef: case Line[1] of #$a4: if (Line[2] >= #$80) then PWidths^ := 2; #$a5..#$aa: PWidths^ := 2; #$ab: if (Line[2] <= #$99) then PWidths^ := 2; #$b8: if (Line[2] in [#$90..#$99,#$b0..#$ff]) then PWidths^ := 2; #$b9: if (Line[2] <= #$ab) then PWidths^ := 2; #$bc: if (Line[2] >= #$81) then PWidths^ := 2; #$bd: if (Line[2] <= #$a0) then PWidths^ := 2; #$bf: if (Line[2] >= #$a0) and (Line[2] <= #$a6) then PWidths^ := 2; end; #$f0: case Line[1] of #$a0, #$b0: case Line[2] of #$80: if (Line[3] >= #$80) then PWidths^ := 2; #$81..#$ff: PWidths^ := 2; end; #$a1..#$ae, #$b1..#$be: PWidths^ := 2; #$af, #$bf: case Line[2] of #$00..#$be: PWidths^ := 2; #$bf: if (Line[3] <= #$bd) then PWidths^ := 2; end; end end; *} end end; (* Ranges that are FullWidth char 1100 e1 84 80 .. 115F e1 85 9f 2329 e2 8c a9 .. 232A e2 8c aa 2E80 e2 ba 80 .. 303E e3 80 be 3041 e3 81 81 .. 33FF e3 8f bf 3400 e3 90 80 .. 4DB5 e4 b6 b5 4E00 e4 b8 80 .. 9FC3 e9 bf 83 A000 ea 80 80 .. A4C6 ea 93 86 AC00 ea b0 80 .. D7A3 ed 9e a3 F900 ef a4 80 .. FAD9 ef ab 99 FE10 ef b8 90 .. FE19 ef b8 99 FE30 ef b8 b0 .. FE6B ef b9 ab FF01 ef bc 81 .. FF60 ef bd a0 FFE0 ef bf a0 .. FFE6 ef bf a6 20000 f0 a0 80 80 .. 2FFFD f0 af bf bd 30000 f0 b0 80 80 .. 3FFFD f0 bf bf bd *) end.

{-------------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
the specific language governing rights and limitations under the License.

Alternatively, the contents of this file may be used under the terms of the
GNU General Public License Version 2 or later (the "GPL"), in which case
the provisions of the GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms
of the GPL and not to allow others to use your version of this file
under the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the GPL.
If you do not delete the provisions above, a recipient may use your version
of this file under either the MPL or the GPL.

-------------------------------------------------------------------------------}

(*
 visit the following URL for more information
 http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt
 http://unicode.org/reports/tr11/
*)

unit SynEditTextDoubleWidthChars;

{$I synedit.inc}
interface

uses
  Classes, SysUtils, LazSynEditText ,synedittextdoublewidthchars2;

type

{ SynEditTextDoubleWidthChars }

SynEditStringDoubleWidthChars = class(TSynEditStringsLinked)
  protected
    procedure DoGetPhysicalCharWidths(Line: PChar; LineLen, Index: Integer; PWidths: PPhysicalCharWidth); override;
  end;

implementation

{ SynEditTextDoubleWidthChars }

procedure SynEditStringDoubleWidthChars.DoGetPhysicalCharWidths(Line: PChar;
  LineLen, Index: Integer; PWidths: PPhysicalCharWidth);
var
  i: Integer;  str:ansistring;
begin
  inherited DoGetPhysicalCharWidths(Line, LineLen, Index, PWidths);
  if not IsUtf8 then
    exit;

dec(Line);
  dec(PWidths);
  for i := 0 to LineLen - 1 do begin
    inc(Line);
    inc(PWidths);
    if Line^ < #$e1 then continue;
    if PWidths^ = 0 then continue;
   
    //读3个字节,转换成unicode
    //获得绘制宽度
    str := '';
    str := str + line^  + line[1] + line[2];
    //DebugLn(str);
   // ..writeln(utf8decode(str));
    pWidths^ := mk_wcwidth(longword(ord(utf8decode(str)[1]))) ;
    {*
    case Line^ of
      #$e1:
        case Line[1] of
          #$84:
            if (Line[2] >= #$80) then PWidths^ := 2;
          #$85:
            if (Line[2] <= #$9f) then PWidths^ := 2;
        end;
      #$e2:
        case Line[1] of
          #$8c:
            if (Line[2] = #$a9) or (Line[2] = #$aa) then PWidths^ := 2;
          #$ba:
            if (Line[2] >= #$80) then PWidths^ := 2;
          #$bb..#$ff:
            PWidths^ := 2;
        end;
      #$e3:
        case Line[1] of
          #$81:
            if (Line[2] >= #$81) then PWidths^ := 2;
          #$82..#$8e:
            PWidths^ := 2;
          #$8f:
            if (Line[2] <= #$bf) then PWidths^ := 2;
          #$90:
            if (Line[2] >= #$80) then PWidths^ := 2;
          #$91..#$FF:
            PWidths^ := 2;
        end;
      #$e4:
        case Line[1] of
          #$00..#$b5:
            PWidths^ := 2;
          #$b6:
            if (Line[2] <= #$b5) then PWidths^ := 2;
          #$b8:
            if (Line[2] >= #$80) then PWidths^ := 2;
          #$b9..#$ff:
            PWidths^ := 2;
        end;
      #$e5..#$e8:
        PWidths^ := 2;
      #$e9:
        if (Line[1] <= #$bf) or (Line[2] <= #$83) then PWidths^ := 2;
      #$ea:
        case Line[1] of
          #$80, #$b0:
            if (Line[2] >= #$80) then PWidths^ := 2;
          #$81..#$92, #$b1..#$ff:
            PWidths^ := 2;
          #$93:
            if (Line[2] <= #$86) then PWidths^ := 2;
        end;
      #$eb..#$ec:
        PWidths^ := 2;
      #$ed:
        if (Line[1] <= #$9e) or (Line[2] <= #$a3) then PWidths^ := 2;

#$ef:
        case Line[1] of
          #$a4:
            if (Line[2] >= #$80) then PWidths^ := 2;
          #$a5..#$aa:
            PWidths^ := 2;
          #$ab:
            if (Line[2] <= #$99) then PWidths^ := 2;
          #$b8:
            if (Line[2] in [#$90..#$99,#$b0..#$ff]) then PWidths^ := 2;
          #$b9:
            if (Line[2] <= #$ab) then PWidths^ := 2;
          #$bc:
            if (Line[2] >= #$81) then PWidths^ := 2;
          #$bd:
            if (Line[2] <= #$a0) then PWidths^ := 2;
          #$bf:
            if (Line[2] >= #$a0) and (Line[2] <= #$a6) then PWidths^ := 2;
        end;
      #$f0:
        case Line[1] of
          #$a0, #$b0:
            case Line[2] of
              #$80:
                if (Line[3] >= #$80) then PWidths^ := 2;
              #$81..#$ff:
                PWidths^ := 2;
            end;
          #$a1..#$ae, #$b1..#$be:
            PWidths^ := 2;
          #$af, #$bf:
            case Line[2] of
              #$00..#$be:
                PWidths^ := 2;
              #$bf:
                if (Line[3] <= #$bd) then PWidths^ := 2;
            end;
        end
    end;
    *}

end
end;

(* Ranges that are FullWidth char

1100  e1 84 80  ..  115F  e1 85 9f
 2329  e2 8c a9  ..  232A  e2 8c aa
 2E80  e2 ba 80  ..  303E  e3 80 be
 3041  e3 81 81  ..  33FF  e3 8f bf
 3400  e3 90 80  ..  4DB5  e4 b6 b5
 4E00  e4 b8 80  ..  9FC3  e9 bf 83
 A000  ea 80 80  ..  A4C6  ea 93 86
 AC00  ea b0 80  ..  D7A3  ed 9e a3
 F900  ef a4 80  ..  FAD9  ef ab 99
 FE10  ef b8 90  ..  FE19  ef b8 99
 FE30  ef b8 b0  ..  FE6B  ef b9 ab
 FF01  ef bc 81  ..  FF60  ef bd a0
 FFE0  ef bf a0  ..  FFE6  ef bf a6
20000  f0 a0 80 80  .. 2FFFD f0 af bf bd
30000  f0 b0 80 80  .. 3FFFD f0 bf bf bd

*)
end.

lazarus,synedit输入小键盘特殊符号的补丁,这两个单元是解决synedit输入符号的时候发生重叠的问题的。

lazarus,synedit输入小键盘特殊符号的补丁的更多相关文章

  1. TeXmacs 中输入狄拉克 braket 符号

    TeXmacs的数学模式下,默认会对括号进行自动补齐.这也导致输入狄拉克 braket 符号时得到的可能不是你想要的结果.经测试,可用以下输入方式输入 (以下 _ 表示光标所在位置,Tab代表Tab键 ...

  2. MathType输入几何符号的技巧

    通过学习几何学的知识,我们发现其中包含的几何符号有很多,比如有表示图形的符号,如三角形,平行四边形,圆,角,圆弧等:还有表示位置关系的符号,如平行,垂直等:还有表示矢量等其他符号,那么MathType ...

  3. 利用MathType在Word里输入几何符号的技巧

    通过学习几何学的知识,我们发现其中包含的几何符号有很多,比如有表示图形的符号,如三角形,平行四边形,圆,角,圆弧等:还有表示位置关系的符号,如平行,垂直等:还有表示矢量等其他符号,那这些符号怎么打出来 ...

  4. Excel 怎样去掉单元格中的回车符号

    1.同时按下 CTRL+H调出"查找---替换"对话框:2.在查找中输入:按住ALT ,小键盘输入 10 ,然后松开ALT:3.在替换中写入要替换的符号:这样就将回车符换成其他符号 ...

  5. gets和从键盘输入换行符

    i was wrong! 虽然setbuf可以让程序自己管理缓冲,但是像getchar,gets这些标准IO函数还是要通过隐藏的stdin进行操作,而stdin是啥呢?还是一个FILE*,而FILE* ...

  6. 限制TextBox输入,只能输入Double类型数字

    public class TextBoxDouble : TextBox { public TextBoxDouble() { KeyDown += TextBoxDouble_KeyDown; Te ...

  7. 利用Pattern和Mather来禁止特殊字符的输入

    String regEx="[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}[]‘::”“’.,.?]&q ...

  8. 批量安装XP补丁的命令

    方法一: 新建一个bat文件,把这个文件和所有补丁文件放在同一个目录下,双击运行. BAT代码如下 @echo offfor %%i in (*.exe) do %%i /passive /nores ...

  9. Linux-使用patch命令给uboot打补丁(3)

    patch:修改文件,让用户对原文件打补丁 用法        patch -p[剥离层级]  <[补丁文件] 打补丁示例: u-boot-1.1.6_jz2440.patach补丁文件给u-b ...

随机推荐

  1. ORACLE 把不是SYS用户下的所有JOB删除掉

    BEGIN  FOR job_id in(select job,log_user,priv_user,schema_user from dba_jobs)   LOOP    IF(job_id.lo ...

  2. 设置,获取,删除cookie

    function setCookie(key,value,options){ if (value !== undefined ) { if(options === undefined || optio ...

  3. 简单web测试流程(转载)

    转载自 http://blog.csdn.net/qq_35885203 1.界面操作模式打开jmeter 进入jmeter安装目录的bin目录下,双击“jmeter.bat”文件即可打开jmeter ...

  4. 最小k度限制生成树

    [题目描述] 给你一个图,n个点,m条边,求一颗生成树满足如下条件: (1)结点1的度不超过k. (2)在(1)条件下所求生成树最小. [算法引入] 最小k度限制生成树,就是指有特殊的某一点的度不能超 ...

  5. 贪吃蛇Global Java实现(二)

    package cn.tcc.snake.util; public class Global {public static final int CELL_SIZE=20;public static f ...

  6. 十个前端UI优秀框架

    最近需要一些前端框架,于是在网上整理了一些感觉不错的前端框架,有pc端和移动端,为了方便日后自己先记录下来了... Bootstrap 首先说 Bootstrap,估计你也猜到会先说或者一定会有这个( ...

  7. stm32中adc的常规通道和注入通道的区别

    STM32的每个ADC模块通过内部的模拟多路开关,可以切换到不同的输入通道并进行转换.STM32特别地加入了多种成组转换的模式,可以由程序设置好之后,对多个模拟通道自动地进行逐个地采样转换. 有2种划 ...

  8. “东信杯”广西大学第一届程序设计竞赛(同步赛)H

    链接:https://ac.nowcoder.com/acm/contest/283/H来源:牛客网 题目描述 由于临近广西大学建校90周年校庆,西大开始了喜闻乐见的校园修缮工程! 然后问题出现了,西 ...

  9. Springboot学习01- 配置文件加载优先顺序和本地配置加载

    Springboot学习01-配置文件加载优先顺序和本地配置加载 1-项目内部配置文件加载优先顺序 spring boot 启动会扫描以下位置的application.properties或者appl ...

  10. [leetcode]445. Add Two Numbers II 两数相加II

    You are given two non-empty linked lists representing two non-negative integers. The most significan ...