?Windows+R?????????regedit??????????????????\HKEY_CURRENT_USER\Software\Typora????Typora??????????Administrtors????????????
Category Archives: ???
?????
?????DNS?????
DNS??????????????????????IP?????Domain Name System??????????????????????DNS?????????????????????????????????????????????????????????????????????????DNS??????????????????DNS??????
????????????DNS?????????????????DNS??????????????????????????????????
1.114DNS
???DNS????????????????DNS????????????????
???????????????????????????
114.114.114.114
114.114.115.115
????????????????????????????????
114.114.114.119
114.114.115.119
????????????????????????????????
114.114.114.110
114.114.115.110
114DNS–???DNS??????????DNS?????DNS?????114.114.114.114
114DNS–???DNS??????????DNS?????DNS?????114.114.114.114
2.??DNS
??DNS??????????DNS???????????????????????????DNS????????????????
223.5.5.5
223.6.6.6
3.SDNS
SDNS?????????????CNNIC?????????????????????????SecureDNS???SDNS???????????????????????????
??????????????????????????????????DNS???????????
1.2.4.8
210.2.4.8
4.????DNS
?????????????????????????????????Ubuntu??????????????????????????????
202.38.64.1
202.112.20.131
202.141.160.95
202.141.160.99
202.141.176.95
202.141.176.99
5.OneDNS
???2013??DNS????????????????????????OneDNS??????????????DNS??????????????????????????????????ISP?DNS???????????????????????????
112.124.47.27 ????/????
114.215.126.16 ????/????
oneDNS??????????????DNS????????????????????????????????????ISP?DNS????????????????????????????????????????
6.DNS?
360???????????????????????????????????????????????????????????????????????????????????????????
????????101.226.4.6? ?????218.30.118.6
????????123.125.81.6??????140.207.198.6
????????101.226.4.6? ?????218.30.118.6
????????101.226.4.6? ?????218.30.118.6
DNS?????????DNS???????????????????????DNS??????????????????????????????????????? ???????????????DDOS??? CC?????DNS?????????????????????????????????
7.Google DNS
??DNS?????????Google?2009?12?5?????????????????????????????????????????DNS???????????????????
8.8.8.8
8.8.4.4
8.OpenDNS
???2006??????????????????????????????
208.67.220.220
208.67.222.222
9.Norton DNS
Norton DNS?????????????????????????DNS?????????????DNS??????????????:
A – ???????????????????
199.85.126.10
199.85.127.10
B – ??+??
199.85.126.20
199.85.127.20
C – ??+??+???
199.85.126.30
199.85.127.30
10.V2EX DNS
?V2EX??????????????????????App Store???????????????????????????????????????????????App Store??????????
178.79.131.110
11.??DNS
119.29.29.29
????????????????????DNS???????????????http://publicdns.cn/?
??????access/mssql
??
Access:
UPDATE TABLE1 INNER JOIN [TABLE2] ON (XXXX) SET [FIELD1]=XXXX
DELETE TABLE1.* from TABLE1 INNER JOIN [TABLE2] ON (XXXXX)
MSSQL:
UPDATE TABLE1 SET [FIELD1]=XXXX FROM TABLE1 INNER JOIN TABLE2 ON (XXXXX)
DELETE TABLE1 FROM TABLE1 INNER JOIN [TABLE2] ON (XXXXX)
TPC,TPCC,TPMC(?????????)
??? ???TPC?tpmC?
1 TPC
TPC(Transaction Processing Performance Council??????????)???10????????????????????????????????????????????????????????TPC?????????????????????????? ????????????(Benchmark)?????????????????? ???????
TPC?????????????????(http://www.tpc.org)?TPC????????????????????????(Standard Specification)??????????????????????????????(?????????)?????????????????(?????)?????TPC???????(Full Disclosure Report)??????????????????????????????? ????????TPC????????(TPC???????)???????????????????
TPC???????????????TPC?A?TPC?B?TPC?C?TPC?D???A?B???????????TPC?C???????(OLTP)??????TPC?D?????(Decision Support) ??????TPC???TPC?E???????(Enterprise)??????????
2 tpmC
tpmC??????? ????????????????????????tpmC????????? ??????????????????????????????????? ?tpmC???????????tpmC??????????TPM?TPMC?
TPC-C?????????????????????N??????????10???????????3000?????????????10?????????????????????10×N???????????????5????????????????????????????????????????????????? ????N?????????????????N???????????
TPC-C?????????????????TPC-C?????????tpmC?tpm?transactions per minute????C?TPC??C???????????????????????????????????????????????1???????4??? ?????1??????????????????????45???????? ??????1000tpmC???????????????2000???????? ?????????????????????????÷???????/tpmC?
tpmC??: TPC-C????????TPC-C????????????????????????12???
???????????/????/?????
??? TPCC
1 ????
TPCC????????C/S???,??????????????????,????????????TPC?Transaction Processing Corp???,TPC??????????
TPCC???????????????TPCC?????????????,???tpm,(transactions per minute)????????(?????)??TPCC?,????????????,?????????,?????????
??????,TPC-C?????C/S???????,???????????????????,????,??????????????????TPCC?,?????????????TPC?????????????????,??????????TPC???
—————————————————————————————————————
2 ????????
TPC-C
?????????????????????TPC???????TPC-C?TPC-H?TPC-W??????????????????????????????????????????TPC?????????????????????????????????????????????????????????????????
??????TPC???????????????????????????????????????????????????????????????
TPC-C??????????????OLTP?????????????????????????????????????????????????????????????????IT?????TPC-C????“??”OLTP???????????
TPC-C?????????????????????????????tpmC?????????????????????????????????????????????????????????????????????????????????????????????????TPC????????????????????????TPC Web??(http://www.tpc.org)????
3 TPC-C????
TPC-C??????????????OLTP???????????????????????????
TPC-C??????????????????????OLTP????:??????????????????????????????????????10?????????????3000???????????????????10???;??????1%????????????????????????????????
????????????????
New-Order??????????????
Payment:????????????????;
Delivery:??(???????);
Order-Status:????????????
Stock-Level:??????????????????
??????????????????5??????????????????????20????
4????
TPC-C?????????????1992?7?????????OLTP???????????????????TPC-C???????????????????????????????
TPC-C?????????????
?????(Throughput???tpmC)
??TPC????????????????Payment?Order-status?Delivery?Stock-Level???????????????????New-Order????????????????TPC-C????????
??????????
????(Price/Performance???Price/tpmC)
?????????????????????????
????????
????TPCC????????????????
????????????????????????????????????????“?????”?????“????”???????????????????????????????????????????????“????”?????????????????5???????????????????????????????????????????????????????????????????????????????????????????????
1???????? ????
?????????????????????????????(???????????)??? ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
2???????????
????????????????????????????????????????????? ?????????????R/3?????????SAP????????????????????????????????????????????????????????????????????????????????????
3????????
???1???2???????????TPC-C???????????????????????? ??tpmC???????????????????
??????????????
???????????????????????????????????????(????????????)????TPC?C??????????????????????????????????1????????????????1????????tpmC????????????
?TPC?????
TPC??????????????????????????????????????“??”???????(????RAID)??????????????????????? ???????????????????????TPC???????????????????1/4???????????????????1/3?????TPC?C??????????180????????????????????????????tpmC???????????????????????TPC??????????????????????????tpmC???????????????????????????
?????????? ????????????????????1GB????50GB??????A?B?C ?????????????tpmC????3000?2800?2600??????????A???????????????????tpmC??????????????????????tpmC?????C??????????????????? ????????tpmC?????????????????
?TPC?????
TPC?C?TPC?D??????????????????????????????????????????????????????????????????TPC?C??? ?????????????????????????????TPC????? ???????????????????????????????????? ??????????????????????????????????????
?????????? ??(??????)?????????????????
??????????????????????????????????
?????????????????????????????????????????????????????????????????????????????????????
“????”?????????????????????????????????????????????????????????????????????????????????
?????????????????????TPC???????TPC-C?TPC-H?TPC-W??????????????????????????????????????????TPC?????????????????????????????????????????????????????????????????
??????TPC???????????????????????????????????????????????????????????????
TPC-C??????????????OLTP?????????????????????????????????????????????????????????????????IT?????TPC-C????“??”OLTP???????????
TPC-C?????????????????????????????tpmC?????????????????????????????????????????????????????????????????????????????????????????????????TPC????????????????????????TPC Web??(http://www.tpc.org)????
??? TPCC????
1??
???TPC-C??SPECjbb2000??????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????
1? ?????????????????????????????????????????????????????????????????????CPU????
2? ???????????????????
????????????????????????????????????????????????????????????????????
1? ?????????????????????????????????????????????????????????????????
2? ?????????????????????????????2???????????????????????????????????????????????????????????????
3? WEB???????????????????????????
2??????????
??1
?????????????????????
” ??????????1500??U1??
” ???????????2??????N1??
” ?????????????????????1/3?
” ??????????3????T1??
” ??????????8????T2??
” ??????????13????T3??
” ??????????????5??
” ?????1.6?(??????)
” ???????30?????
????????????
TPC-C=U1*N1*?T1+T2+T3?/3*5*????/????
???????????????
TPC-C= 1500*2*?3+8+13?/3*5*1.6/0.7= 274,285 tpmC
??????????????????????????????????????????????????????TPC-C????28????????????
??2
????????????????????????????????????????
?????1?????????????????????????1??????????????????
1. ????????????5?????????220,000 ????????????????????????????????;
2. ???????=220000/22=10,000 ???? 1???
3. ????????????80%?4????????10000*80%/4=2000??/???
4. ???????2000*2=4000??/???????????????4000??? 67?/?????????????100??????????0.7??
5. ??????????????=20???TPC????????=8?cpu??30%???????????????????????????4 ??????????????????????
? tpmC???
tpmC= 67*20*8*4/(1-30%)= 61257[?????????/??*????????????*??TPC????????*??????????????????/?1- cpu??30%????????
??? ???? = 61257/10000=6.1
???????tpmC= ??????? * 6.1 ?????????????
?????? tpmC = ?????? tpmC *50% ????
?????? tpmC = ?????? tpmC *70% ????????????????
SimCity BuildIt????4000???/??
?????SCBuildit.com????????????????????????????????????
??????????????????????????“??”????????????????????????????????????????????????????????“??”???????
??????????????????0?
???????????
???????????????????“??x1”??????????“A??”???????“B??”???????????
??????“A??”?????????????????????“A??”?????????????“C??”???“A??”????????????“C??”????????“??x1”?
????“A??”????700???????????????(???????????????????????????????????????????????????)????“C??”?????“B??”?????????
??????????????????????????
??????????????????????????????????????????“??x1”????????????????????????21??????????4???????????3?????????????
?8~10?????????????4200????????????????????????????????3000~4000???/??????
????????????????
????????????????????????????????????????????Facebook???
Strict mode – JavaScript
ECMAScript 5??????Javascript??????????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????JavaSript?????? ?????????JavaScript?????????????????????????????????????????????????????????? ??????????????????????????????????JavaScript???????????????????????
??????
???????????script??????????????????? {} ?????;?????????????????? ???eval ???Function ???????????? setTimeout?????? ?????????????????????????
???script????????
???script????????, ???????????????? “use strict”; ?? ‘use strict’;?
// ?????????????? "use strict"; var v = "Hi! I'm a strict mode script!";
?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????.
??????????????????????????????????????????????????????????????????????????????
???????????
??????????????????? “use strict”; (? ‘use strict’;) ???????????
function strict() { // ?????????? 'use strict'; function nested() { return "And so am I!"; } return "Hi! I'm a strict mode function! " + nested(); } function notStrict() { return "I'm not strict."; }
?????????
???????????????????????????????????????????????????, ????????????????????? eval ?? arguments, ??”??“JavaScript??????????????????ECMAScript??????
????????
??????, ??????????????????. JavaScript????????????????, ????????????????????????(non-error semantics). ?????????????, ????????????????. ??????????????, ?????????????.
????????????????????????JavaScript??????????????????????????????“??”??????????????JavaScript???????????????????????????
"use strict"; mistypedVariable = 17; // ?? ReferenceError
??, ????????????(silently fail,?:??????????)?????????. ??, NaN ???????????. ??????, ? NaN ??????????; ??????????????. ???????, ? NaN ?????????. ??????????????????? (????????, ?????(getter-only)????, ???????(non-extensible object)??????) ??????:
"use strict"; // ???????? var obj1 = {}; Object.defineProperty(obj1, "x", { value: 42, writable: false }); obj1.x = 9; // throws a TypeError // ??????? var obj2 = { get x() { return 17; } }; obj2.x = 5; // throws a TypeError // ????????????? var fixed = {}; Object.preventExtensions(fixed); fixed.newProp = "ohai"; // throws a TypeError
??, ??????, ?????????????????(??????????????):
"use strict"; delete Object.prototype; // throws a TypeError
??, ?????????????????????????. ?????????????, ???????????????. ????????????, ?????????????????????????????, ???????bug???. ??????, ????????????:
"use strict"; var o = { p: 1, p: 2 }; // !!! ????
??, ??????????????. ??????, ???????????????????. ??????????? arguments[i] ???, ?????????. ??, ????????????????? (??, ????????), ????????????????????:
function sum(a, a, c) // !!! ???? { "use strict"; return a + b + c; // ?????????,?????bug }
??, ?????????????. ECMAScript?????????, ??????????????(0)????????: 0644 === 420 ?? “\045” === “%”. ?????????????????????, ??????????? — ????????????! ??????????????????, ???????????????????:
"use strict"; var sum = 015 + // !!! ???? 197 + 142;
???????
????????????????????????. Many compiler optimizations rely on the ability to say that variable X is stored in that location: ??????JavaScript??????. JavaScript??????????????????????????????. ?????????????????, ???????????????????.
??, ?????? with. with ??????????????????(map)?with?????????, ???????????????????(???????), ????????????: ?????????????. ?????, ?? with ???????, ??????? with ?????????????????????:
"use strict"; var x = 17; with (obj) // !!! ???? { // ??????????,with????x???with?????x,??obj.x????????,??????,??,?????????????,????????. x; }
???? with ????????????????????????????????????.
??, ?????? eval ???????(surrounding scope,?:??eval??????)?????. ??????, ?? eval(“var x;”) ??????(surrounding function)???????????? x . ????, ?????, ????? eval ?????????????????????????????????????????? (?? eval ?????????????????). ?????? eval ?????????????, ?? eval ??????????????????????:
var x = 17; var evalX = eval("'use strict'; var x = 42; x"); assert(x === 17); assert(evalX === 42);
???, ???? eval ????????eval(…)??????????, ?????????????????. ?????????????????, ??????????.
function strict1(str) { "use strict"; return eval(str); // str????????????????? } function strict2(f, str) { "use strict"; return f(str); // f????????????,??f?eval?str??????????"use strict"????,str?????????????? } function nonstrict(str) { return eval(str); // ???str??????????"use strict",str?????????????? } strict1("'Strict mode code!'"); strict1("'use strict'; 'Strict mode code!'"); strict2(eval, "'Non-strict code.'"); strict2(eval, "'use strict'; 'Strict mode code!'"); nonstrict("'Non-strict code.'"); nonstrict("'use strict'; 'Strict mode code!'"); Thus names in strict mode eval code behave identically to names in strict mode code not being evaluated as the result of eval.
??, ????????plain names. delete name ?????????????:
"use strict"; eval("var x; delete x;"); // !!! ????
?eval?arguments????
?????arguments?eval??????????????????????????????? eval to add or remove bindings and to change binding values, and arguments by its indexed properties aliasing named arguments. Strict mode makes great strides toward treating eval and arguments as keywords, although full fixes will not come until a future edition of ECMAScript.
??, ?? eval ? arguments ?????(be bound)??? in language syntax. ??????????????:
"use strict"; eval = 17; arguments++; ++eval; var obj = { set p(arguments) { } }; var eval; try { } catch (arguments) { } function x(eval) { } function arguments() { } var y = function eval() { }; var f = new Function("arguments", "'use strict'; return 17;");
??, strict mode code doesn’t alias properties of arguments objects created within it. ??????, ??????? arg ????, ?? arg ??????? arguments[0], ????(???????? arguments[0] ????). ?????, ????? arguments ??????????????. arguments[i] ???????????????, ???????????? arguments[i].
function f(a) { "use strict"; a = 42; return [a, arguments[0]]; } var pair = f(17); assert(pair[0] === 42); assert(pair[1] === 17);
???,????arguments.callee??.???????,arguments.callee???????????. ??????: ?????????! ??, arguments.callee substantially hinders optimizations like inlining functions, because it must be made possible to provide a reference to the un-inlined function if arguments.callee is accessed. ????????? arguments.callee ?????????, ????????????:
"use strict"; var f = function() { return arguments.callee; }; f(); // throws a TypeError
“Securing” JavaScript
Strict mode makes it easier to write “secure” JavaScript. Some websites now provide ways for users to write JavaScript which will be run by the website on behalf of other users. JavaScript in browsers can access the user’s private information, so such JavaScript must be partially transformed before it is run, to censor access to forbidden functionality. JavaScript’s flexibility makes it effectively impossible to do this without many runtime checks. Certain language functions are so pervasive that performing runtime checks has considerable performance cost. A few strict mode tweaks, plus requiring that user-submitted JavaScript be strict mode code and that it be invoked in a certain manner, substantially reduce the need for those runtime checks.
First, the value passed as this to a function in strict mode isn’t boxed into an object. For a normal function, this is always an object: the provided object if called with an object-valued this; the value, boxed, if called with a Boolean, string, or number this; or the global object if called with an undefined or null this. (Use call, apply, or bind to specify a particular this.) Automatic boxing is a performance cost, but exposing the global object in browsers is a security hazard, because the global object provides access to functionality “secure” JavaScript environments must restrict. Thus for a strict mode function, the specified this is used unchanged:
"use strict"; function fun() { return this; } assert(fun() === undefined); assert(fun.call(2) === 2); assert(fun.apply(null) === null); assert(fun.call(undefined) === undefined); assert(fun.bind(true)() === true);
Second, in strict mode it’s no longer possible to “walk” the JavaScript stack via commonly-implemented extensions to ECMAScript. In normal code with these extensions, when a function fun is in the middle of being called, fun.caller is the function that most recently called fun, and fun.arguments is the arguments for that invocation of fun. Both extensions are problematic for “secure” JavaScript, because they allow “secured” code to access “privileged” functions and their (potentially unsecured) arguments. If fun is in strict mode, both fun.caller and fun.arguments are non-deletable properties which throw when set or retrieved:
function restricted() { "use strict"; restricted.caller; // throws a TypeError restricted.arguments; // throws a TypeError } function privilegedInvoker() { return restricted(); } privilegedInvoker();
Third, arguments for strict mode functions no longer provide access to the corresponding function call’s variables. In some old ECMAScript implementations arguments.caller was an object whose properties aliased variables in that function. This is a security hazard because it breaks the ability to hide privileged values via function abstraction; it also precludes most optimizations. For these reasons no recent browsers implement it. Yet because of its historical functionality, arguments.caller for a strict mode function is also a non-deletable property which throws when set or retrieved:
"use strict"; function fun(a, b) { "use strict"; var v = 12; return arguments.caller; // throws a TypeError } fun(1, 2); // doesn't expose v (or a or b)
Paving the way for future ECMAScript versions
Future ECMAScript versions will likely introduce new syntax, and strict mode in ECMAScript 5 applies some restrictions to ease the transition. It will be easier to make some changes if the foundations of those changes are prohibited in strict mode.
First, in strict mode a short list of identifiers become reserved keywords. These words are implements, interface, let, package, private, protected, public, static, and yield. In strict mode, then, you can’t name or use variables or arguments with these names.
function package(protected) // !!! { "use strict"; var implements; // !!! interface: // !!! while (true) { break interface; // !!! } function private() { } // !!! } function fun(static) { 'use strict'; } // !!!
Two Mozilla-specific caveats: First, if your code is JavaScript 1.7 or greater (you’re chrome code, or you’ve used the right, won’t be able to use let/yield as identifiers. Second, while ES5 unconditionally reserves the words class, enum, export, extends, import, and super, before Firefox 5 Mozilla reserved them only in strict mode.
Second, strict mode prohibits function statements not at the top level of a script or function. In normal code in browsers, function statements are permitted “everywhere”. This is not part of ES5 (or even ES3)! It’s an extension with incompatible semantics in different browsers. Future ECMAScript editions will hopefully specify new semantics for function statements not at the top level of a script or function. Prohibiting such function statements in strict mode “clears the deck” for specification in a future ECMAScript release:
"use strict"; if (true) { function f() { } // !!! syntax error f(); } for (var i = 0; i < 5; i++) { function f2() { } // !!! syntax error f2(); } function baz() // kosher { function eit() { } // also kosher }
This prohibition isn’t strict mode proper, because such function statements are an extension of basic ES5. But it is the recommendation of the ECMAScript committee, and browsers will implement it.
????????
????????????????????????????? Strict mode changes semantics. Relying on those changes will cause mistakes and errors in browsers which don’t implement strict mode. Exercise caution in using strict mode, and back up reliance on strict mode with feature tests that check whether relevant parts of strict mode are implemented. Finally, make sure to test your code in browsers that do and don’t support strict mode. If you test only in browsers that don’t support strict mode, you’re very likely to have problems in browsers that do, and vice versa.
SQL Server delete??????
?????????????????
DELETE t1 FROM [?] t1
WHERE EXISTS (..);
????
“????”??????????”???·???Edward A. Murphy?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
??????????????????
1???????????????????????????
2?????????????????????????
3????????????????????????????????
4??????????????
5???????????????????????????
6???????????????????????——????????????
7?????——????????????????????????
8??????????????????????????????
9??????????????????????
10?????????????????????????????
11????????????????????????????????????
12???????????
13???????60????????????61????????
14?????????????????????????????????
15?????????????????????????????????
16?????????????????
17??????????????????????????
18??????????????????????????????????????????????????????
19???????? ?????????????????????
20?????????
21?????????
22???????????????????????
23??????????
24????????????
25??????????????????????
26?????????????????????????
27?????????
28???????????????
29????????????
30?????????
31????????????