{"id":208756,"date":"2014-01-13T08:13:03","date_gmt":"2014-01-13T04:13:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=208756"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=208756","title":{"rendered":"<span class=\"post_title\">\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0432 Go \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/248\/90d\/75e\/24890d75e350c3292be5a7a150c7ab15.png\" alt=\"image\"\/> <i>\u00ab\u041f\u043e\u0439\u0434\u0443 \u043f\u043e\u0438\u0449\u0443 \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 Google\u00bb<\/i><\/p>\n<p>  \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u043b\u044e\u0431\u044b\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u0447\u0443\u0436\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e. \u0421 \u043a\u0430\u0436\u0434\u044b\u043c \u0433\u043e\u0434\u043e\u043c, \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u0431\u043e\u043b\u0435\u0435 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438 \u0433\u043b\u0430\u0434\u043a\u0438\u043c. \u0417\u0430\u0431\u044b\u043b\u0438, \u043a\u0430\u043a \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0432\u0441\u0435 \u0441\u043b\u043e\u0432\u0430? \u041d\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0438\u0434\u0451\u043c \u043d\u0430 Stack Overflow \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0441\u043d\u0438\u043f\u043f\u0435\u0442. \u0414\u043b\u044f \u043e\u0441\u043e\u0431\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0435\u0441\u0442\u044c \u0434\u0430\u0436\u0435 <a href=\"https:\/\/github.com\/azac\/sublime-howdoi-direct-paste\">\u043f\u043b\u0430\u0433\u0438\u043d<\/a> \u0434\u043b\u044f Sublime Text, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u0445\u043e\u0442\u043a\u0435\u044e \u0438\u0449\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043d\u0430 SO \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u0438\u0437 \u043f\u0440\u0438\u043d\u044f\u0442\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u0440\u044f\u043c\u043e \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432\u0435\u0434\u0451\u0442 \u043a \u0440\u044f\u0434\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u2026<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0425\u043e\u0442\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0448\u0435 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0440\u0430\u0439\u043d\u043e\u0441\u0442\u044c\u044e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0432\u043e\u0434\u043e\u043c \u0434\u043b\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0448\u0443\u0442\u043a\u0438, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0441\u0442\u044c. \u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0451\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 float64 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 JavaScript. \u042f \u043d\u0435 \u0445\u043e\u0447\u0443 \u0434\u0443\u043c\u0430\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u043e\u043a, \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044f\u043c JavaScript. \u041c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0430\u0441\u044c \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0430 Go, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0443 \u0433\u0435\u0440\u043e\u044f \u0432\u044b\u0448\u0435, \u043f\u0443\u0442\u044c \u043c\u043e\u0439 \u043b\u0451\u0433 \u0447\u0435\u0440\u0435\u0437 \u0433\u0443\u0433\u043b.<\/p>\n<p>  <font color=\"#2980b9\">Disclaimer:<\/font> \u043f\u043e\u0441\u0442 \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0441 Go. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u0441\u044c \u043a \u043f\u0440\u0435\u0434\u0432\u0437\u044f\u0442\u044b\u043c \u0442\u043e\u0447\u043a\u0430\u043c \u0437\u0440\u0435\u043d\u0438\u044f, \u0432\u0430\u043c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<h4><font color=\"#2980b9\">\u041d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0435<\/font><\/h4>\n<p>  \u041f\u0435\u0440\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 <i>\u00abhuman sort strings\u00bb<\/i> \u043f\u043e\u043f\u0430\u043b\u0430\u0441\u044c <a href=\"http:\/\/www.codinghorror.com\/blog\/2007\/12\/sorting-for-humans-natural-sort-order.html\">\u0441\u0442\u0430\u0442\u044c\u044f 2007 \u0433\u043e\u0434\u0430<\/a> \u0437\u0430 \u0430\u0432\u0442\u043e\u0440\u0441\u0442\u0432\u043e\u043c @CodingHorror (Jeff Atwood). \u0427\u0435\u043b\u043e\u0432\u0435\u043a \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0439, \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u043d\u0435 \u043f\u043e\u0441\u043e\u0432\u0435\u0442\u0443\u0435\u0442. \u041f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/www.davekoelle.com\/alphanum.html\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0446\u0435\u043b\u044b\u0439 \u0431\u0443\u043a\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u043f\u043e\u0434 \u043b\u044e\u0431\u043e\u0439 \u044f\u0437\u044b\u043a.<\/p>\n<p>  \u0424\u0430\u0432\u043e\u0440\u0438\u0442 \u0414\u0436\u0435\u0444\u0444\u0430 \u043f\u043e\u0434 Python \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"python\">import re   def sort_nicely( l ):    &quot;&quot;&quot; Sort the given list in the way that humans expect.    &quot;&quot;&quot;    convert = lambda text: int(text) if text.isdigit() else text    alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ]    l.sort( key=alphanum_key ) <\/code><\/pre>\n<p>  <font color=\"#2980b9\">\u041e\u043a\u0435\u0439, \u0447\u0442\u043e \u0441 \u044d\u0442\u0438\u043c \u0434\u0435\u043b\u0430\u0442\u044c? \u041a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u043b\u044e\u0434\u0438?<\/font> \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043f\u043e\u043f\u0440\u043e\u0441\u0442\u0443 \u043d\u0435\u0442 \u2013 \u0432\u044b \u0431\u0435\u0440\u0451\u0442\u0435 \u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u0441\u0435\u0431\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442, \u043f\u0440\u044f\u043c\u043e \u043f\u043e-\u043c\u0435\u0441\u0442\u0443. 10 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u2013 10 \u043c\u0435\u0441\u0442. \u0427\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0446\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043b\u044e\u0434\u0438 \u0432\u044b\u043d\u043e\u0441\u044f\u0442 \u0432 \u0444\u0430\u0439\u043b-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0437\u043d\u044f\u0448\u0435\u043a, \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0430\u043a\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u0432\u043e\u044f.<br \/>  \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0438\u043c\u0435\u044e\u0449\u0438\u0439 \u0434\u0435\u043b\u043e \u0441 \u0432\u0430\u0448\u0438\u043c \u043a\u043e\u0434\u043e\u043c, \u0441\u043f\u043e\u0442\u044b\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u0431 \u044d\u0442\u043e\u0442 \u0443\u0447\u0430\u0441\u0442\u043e\u043a, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e:<\/p>\n<ol>\n<li><i>\u00abthe way that humans expect\u00bb<\/i>, \u2013 \u0438 \u043a\u0430\u043a \u0436\u0435 \u043e\u043d\u0438 expect?<\/li>\n<li>\u041a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e <code>alphanum_key<\/code> \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442? \u041d\u0430\u0434\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c&#8230;<\/li>\n<li><i>(\u0441\u043f\u0443\u0441\u0442\u044f 2 \u0447\u0430\u0441\u0430 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438)<\/i> \u0427\u0451\u0440\u0442, \u0430 \u0432\u0435\u0434\u044c \u043d\u0430 <code>['01', '001', '01', '001']<\/code> \u043d\u0438\u0444\u0438\u0433\u0430 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 <code>sort<\/code> \u2013 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0438 <code>key<\/code> \u0443 \u044d\u0442\u0438\u0445 \u043a\u0443\u0441\u043a\u043e\u0432 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439;<\/li>\n<li>\u041a\u0430\u043a \u043d\u0430\u0441\u0447\u0451\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438? \u0410 \u0435\u0441\u043b\u0438 10000 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e <code>re.split<\/code>; <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/ea7\/ae1\/2f2\/ea7ae12f287f6b9881a121e40b02c81c.gif\" alt=\"image\"\/><\/li>\n<li>\u0421\u0442\u043e\u043f, \u0434\u0430 \u044f \u0436\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0438\u0448\u0443 \u043d\u0430 Go, \u043c\u043d\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0432\u0430\u0448\u0438 one-liner\u044b, \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0435\u0440\u0430\u0431\u043e\u0447\u0438\u0439.<\/li>\n<\/ol>\n<p>  \u041a\u043e\u0434 \u043d\u0430 C# \u0442\u043e\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b RegExp&#8217;\u044b, \u043a\u043e\u0434 \u043d\u0430 C++ \u0432\u043e\u043e\u0431\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0443\u0440\u0430\u043d\u043e\u0432\u044b\u0445 \u043c\u0435\u0434\u0432\u0435\u0434\u0435\u0439 \u0438 MFC (\u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0443\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0430\u044f MFC \u0432\u0435\u0440\u0441\u0438\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0441 Perl-\u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430 C++). \u0423\u0432\u0435\u0440\u0435\u043d, \u0443 \u043c\u043d\u043e\u0433\u0438\u0445 \u044d\u0442\u043e \u0447\u0438\u0442\u0430\u044e\u0449\u0438\u0445 \u043d\u0430\u0439\u0434\u0451\u0442\u0441\u044f \u043d\u0438 \u043e\u0434\u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u0440\u043e \u0442\u043e, \u043a\u0430\u043a \u043e\u043d\u0438 \u0440\u044b\u043b\u0438\u0441\u044c \u043d\u0430 \u00ab\u043f\u043e\u043c\u043e\u0439\u043a\u0430\u0445\u00bb \u0441\u043e \u0441\u043d\u0438\u043f\u043f\u0435\u0442\u0430\u043c\u0438 \u043a\u043e\u0434\u0430 \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438, \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0435\u0439 \u0430\u0432\u0442\u043e\u0440\u043e\u0432, \u043b\u043e\u0432\u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438\u2026<\/p>\n<blockquote><p><i>\u00ab\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0439\u0441\u044f \u0432 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0435 \u043a \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0439 \u0431\u043e\u043b\u044c\u043d\u0438\u0446\u0435. \u041e\u0431\u044b\u0447\u043d\u043e \u0432 \u043e\u043a\u0440\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435\u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u0441\u0432\u0430\u043b\u043a\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432\u0441\u0451 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e. \u0422\u0432\u043e\u0439 \u043f\u0440\u0430\u0439\u043c\u0430\u0440\u0438 \u043e\u0431\u0436\u0435\u043a\u0442\u0438\u0432 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0448\u043f\u0440\u0438\u0446\u044b. \u041e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u0432\u0432\u0435\u0434\u0438 \u0432\u0441\u0451 \u0438\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432 \u0441\u0432\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043c \u0438 \u0436\u0434\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430.\u00bb<\/i> \u2013 \u0421\u043f\u043e\u0441\u043e\u0431 \u21162, \u0414\u0430\u043d\u0438\u0438\u043b \u0428\u0435\u043f\u043e\u0432\u0430\u043b\u043e\u0432.<\/p><\/blockquote>\n<p>  <\/p>\n<h4><font color=\"#2980b9\">\u041f\u043e\u0434\u0445\u043e\u0434 Go<\/font><\/h4>\n<p>  \u0417\u0430 \u043f\u0430\u0440\u0443 \u0447\u0430\u0441\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430 Go \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c. \u041f\u043e\u0442\u043e\u043c \u044f \u043f\u043e\u0433\u043e\u043d\u044f\u043b \u0442\u0435\u0441\u0442\u044b, \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438, \u0435\u0449\u0451 \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"go\">\/\/ StringLess compares two alphanumeric strings correctly. func StringLess(s1, s2 string) (less bool) { \t\/\/ uint64 = max 19 digits \tn1, n2 := make([]rune, 0, 18), make([]rune, 0, 18)  \tfor i, j := 0, 0; i &lt; len(s1) || j &lt; len(s2); { \t\tvar r1, r2 rune \t\tvar w1, w2 int \t\tvar d1, d2 bool  \t\t\/\/ read rune from former string available \t\tif i &lt; len(s1) { \t\t\tr1, w1 = utf8.DecodeRuneInString(s1[i:]) \t\t\ti += w1  \t\t\t\/\/ if digit, accumulate \t\t\tif d1 = ('0' &lt;= r1 && r1 &lt;= '9'); d1 { \t\t\t\tn1 = append(n1, r1) \t\t\t} \t\t}  \t\t\/\/ read rune from latter string if available \t\tif j &lt; len(s2) { \t\t\tr2, w2 = utf8.DecodeRuneInString(s2[j:]) \t\t\tj += w2  \t\t\t\/\/ if digit, accumulate \t\t\tif d2 = ('0' &lt;= r2 && r2 &lt;= '9'); d2 { \t\t\t\tn2 = append(n2, r2) \t\t\t} \t\t}  \t\t\/\/ if have rune and other non-digit rune \t\tif (!d1 || !d2) && r1 &gt; 0 && r2 &gt; 0 { \t\t\t\/\/ and accumulators have digits \t\t\tif len(n1) &gt; 0 && len(n2) &gt; 0 { \t\t\t\t\/\/ make numbers from digit group \t\t\t\tin1 := digitsToNum(n1) \t\t\t\tin2 := digitsToNum(n2) \t\t\t\t\/\/ and compare \t\t\t\tif in1 != in2 { \t\t\t\t\treturn in1 &lt; in2 \t\t\t\t} \t\t\t\t\/\/ if equal, empty accumulators and continue \t\t\t\tn1, n2 = n1[0:0], n2[0:0] \t\t\t} \t\t\t\/\/ detect if non-digit rune from former or latter \t\t\tif r1 != r2 { \t\t\t\treturn r1 &lt; r2 \t\t\t} \t\t} \t}  \t\/\/ if reached end of both strings and accumulators \t\/\/ have some digits \tif len(n1) &gt; 0 || len(n2) &gt; 0 { \t\tin1 := digitsToNum(n1) \t\tin2 := digitsToNum(n2) \t\tif in1 != in2 { \t\t\treturn in1 &lt; in2 \t\t} \t}  \t\/\/ last hope \treturn len(s1) &lt; len(s2) }  \/\/ Convert a set of runes (digits 0-9) to uint64 number func digitsToNum(d []rune) (n uint64) { \tif l := len(d); l &gt; 0 { \t\tn += uint64(d[l-1] - 48) \t\tk := uint64(l - 1) \t\tfor _, r := range d[:l-1] { \t\t\tn, k = n+uint64(r-48)*uint64(10)*k, k-1 \t\t} \t} \treturn } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043a\u0435\u0442 <code>&quot;unicode\/utf8&quot;<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0442\u044c \u0431\u0430\u0439\u0442\u044b \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0448\u0438\u0440\u0438\u043d\u044b \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 (\u0432 Go \u043e\u043d\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0440\u0443\u043d\u0430\u043c\u0438). \u0418\u0442\u0430\u043a, \u0432 \u0446\u0438\u043a\u043b\u0435 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u0440\u0443\u043d\u044b \u0432 \u0434\u0432\u0443\u0445 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 (\u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0442\u0430\u043c \u0435\u0449\u0451 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c), \u043f\u043e\u043a\u0430 \u043d\u0435 \u0434\u043e\u0448\u043b\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u043e\u0432 <font color=\"#2980b9\">\u043e\u0431\u043e\u0438\u0445<\/font> \u0441\u0442\u0440\u043e\u043a. \u041f\u043e\u043f\u0443\u0442\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u0443\u044e \u0440\u0443\u043d\u0443 \u043d\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 ASCII \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d (&#8216;0&#8217; \u2264 R \u2264 &#8216;9&#8217;) \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u2013 \u0430\u043a\u043a\u0443\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u0432 \u0431\u0443\u0444\u0435\u0440 \u0440\u0443\u043d. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 <font color=\"#2980b9\">s1, s2<\/font> \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u044f \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0440\u0443\u043d\u0430 <font color=\"#2980b9\">r1, r2<\/font> \u0438 \u0441\u0432\u043e\u0438 \u0431\u0443\u0444\u0435\u0440\u044b <font color=\"#2980b9\">n1, n2<\/font>. \u0428\u0438\u0440\u0438\u043d\u0430 \u0440\u0443\u043d\u044b <font color=\"#2980b9\">w1, w2<\/font> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043e\u0434\u043d\u0430 \u0438\u0437 \u0440\u0443\u043d \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0446\u0438\u0444\u0440\u043e\u0439, \u0442\u043e \u043e\u0431\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0431\u0443\u0444\u0435\u0440\u0430 \u0446\u0438\u0444\u0440 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0434\u0432\u0430 uint64 \u0447\u0438\u0441\u043b\u0430 <font color=\"#2980b9\">in1, in2<\/font> \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f. \u0421\u0440\u0430\u0437\u0443 \u0437\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0441\u0430\u043c\u043e\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>digitsToNum<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 <a href=\"http:\/\/golang.org\/pkg\/strconv\/#ParseUint\">strconv.ParseUint<\/a> \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u0415\u0441\u043b\u0438 \u0447\u0438\u0441\u043b\u0430 \u0432 \u0431\u0443\u0444\u0435\u0440\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b, \u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0440\u0443\u043d\u044b (\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e &#8216;0&#8217; &lt; &#8216;a&#8217;, \u043e\u0434\u043d\u0430\u043a\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u0432\u0430\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e <font color=\"#2980b9\">r1 != r2<\/font>, \u0435\u0441\u043b\u0438 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 &#8216;a&#8217; \u0438 &#8216;a&#8217;).<\/p>\n<p>  \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0448\u043b\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u043e\u0431\u043e\u0438\u0445 \u0441\u0442\u0440\u043e\u043a (\u0437\u043d\u0430\u0447\u0438\u0442, \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u043a\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0440\u0430\u0432\u043d\u044b) \u0438 \u043a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0432 \u0431\u0443\u0444\u0435\u0440\u0430\u0445 \u0446\u0438\u0444\u0440 \u0447\u0442\u043e-\u0442\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0447\u0438\u0441\u043b\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u043e\u043d\u0446\u0430\u0445 \u0441\u0442\u0440\u043e\u043a \u00abhello123\u00bb \u0438 \u00abhello124\u00bb). \u0415\u0441\u043b\u0438 \u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438, \u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u0440\u0438\u0451\u043c \u2013 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u0438\u043d, \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043a \u00aba001\u00bb <font color=\"#2980b9\">&lt;<\/font> \u00aba00001\u00bb.<\/p>\n<h4><font color=\"#2980b9\">\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/font><\/h4>\n<blockquote><p><i>\u00abThe tests and the code work together to achieve better code.\u00bb<\/i><\/p><\/blockquote>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u044f \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b \u0432 \u0444\u0430\u0439\u043b\u0435 <font color=\"#2980b9\">strings.go<\/font>, \u0437\u043d\u0430\u0447\u0438\u0442 \u0442\u0435\u0441\u0442\u044b \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 \u0444\u0430\u0439\u043b <font color=\"#2980b9\">strings_test.go<\/font>.<br \/>  \u041f\u0435\u0440\u0432\u044b\u0439 \u0442\u0435\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>StringLess<\/code>:<\/p>\n<pre><code class=\"go\">func TestStringLess(t *testing.T) { \t\/\/ \u043d\u0430\u0431\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432 \u0432 \u0432\u0438\u0434\u0435 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \t\/\/ \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 table driven test \ttestset := []struct { \t\ts1, s2 string \/\/ \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \t\tless   bool \/\/ \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \t}{ \t\t{&quot;aa&quot;, &quot;ab&quot;, true}, \t\t{&quot;ab&quot;, &quot;abc&quot;, true}, \t\t{&quot;abc&quot;, &quot;ad&quot;, true}, \t\t{&quot;ab1&quot;, &quot;ab2&quot;, true}, \t\t{&quot;ab1c&quot;, &quot;ab1c&quot;, false}, \t\t{&quot;ab12&quot;, &quot;abc&quot;, true}, \t\t{&quot;ab2a&quot;, &quot;ab10&quot;, true}, \t\t{&quot;a0001&quot;, &quot;a0000001&quot;, true}, \t\t{&quot;a10&quot;, &quot;abcdefgh2&quot;, true}, \t\t{&quot;\u0430\u04312\u0430\u0431&quot;, &quot;\u0430\u043110\u0430\u0431&quot;, true}, \t\t{&quot;2\u0430\u0431&quot;, &quot;3\u0430\u0431&quot;, true}, \t}  \tfor _, v := range test set { \t\tif res := StringLess(v.s1, v.s2); res != v.less { \t\t\tt.Errorf(&quot;Compared %s to %s: expected %v, got %v&quot;, \t\t\t\tv.s1, v.s2, v.less, res) \t\t} \t} } <\/code><\/pre>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u0442\u0435\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u044d\u0442\u043e \u043f\u043e\u043a\u0440\u043e\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>Len<\/code>, <code>Swap<\/code>, <code>Less<\/code> \u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <code>sort.Interface<\/code>.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">TestStringSort<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"go\">func TestStringSort(t *testing.T) { \ta := []string{ \t\t&quot;abc1&quot;, &quot;abc2&quot;, \t\t&quot;abc5&quot;, &quot;abc10&quot;, \t} \tb := []string{ \t\t&quot;abc5&quot;, &quot;abc1&quot;, \t\t&quot;abc10&quot;, &quot;abc2&quot;, \t} \tsort.Sort(Strings(b)) \tif !reflect.DeepEqual(a, b) { \t\tt.Errorf(&quot;Error: sort failed, expected: %v, got: %v&quot;, a, b) \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043f\u0443\u0441\u0442\u044f \u043f\u043e\u043b\u0447\u0430\u0441\u0430 \u043d\u0430\u0448 \u0441\u043d\u0438\u043f\u043f\u0435\u0442 \u043f\u043e\u043a\u0440\u044b\u0442 \u0442\u0435\u0441\u0442\u0430\u043c\u0438.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043b\u044e\u0431\u043e\u0439, \u043a\u0442\u043e \u0441\u043e\u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e, \u0441\u043c\u043e\u0436\u0435\u0442 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043b\u0438\u0447\u043d\u043e:<\/p>\n<pre><code>$ go test -v -cover === RUN TestStringSort --- PASS: TestStringSort (0.00 seconds) === RUN TestStringLess --- PASS: TestStringLess (0.00 seconds) PASS coverage: 100.0% of statements ok  \tgithub.com\/Xlab\/handysort\t0.019s <\/code><\/pre>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c. \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u044d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0441\u0430\u043c\u043e\u0433\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u043e\u0432 \u044f \u0443\u0441\u043a\u043e\u0440\u0438\u043b \u043a\u043e\u0434 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0442 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c <code>regexp<\/code> \u2013 \u0445\u043e\u0442\u044c \u043e\u043d\u0430 \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0430 6 \u0441\u0442\u0440\u043e\u0447\u0435\u043a, \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0448 \u043f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 \u0431\u044b\u043b \u043a\u043e\u043b\u043e\u0441\u0441\u0430\u043b\u044c\u043d\u044b\u043c. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>strconv<\/code> \u0438 <code>unicode.IsDigit<\/code> \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u0443 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a \u0448\u0442\u0430\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Go, \u0432 \u0442\u043e\u043c \u0436\u0435 \u0444\u0430\u0439\u043b\u0435 <font color=\"#2980b9\">strings_test.go<\/font>:<\/p>\n<pre><code class=\"go\">func BenchmarkStringSort(b *testing.B) { \t\/\/ \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c 1000 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043f\u043e 10000 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u0432 \u043a\u0430\u0436\u0434\u043e\u043c: \t\/\/ \t* \u0434\u043b\u0438\u043d\u0430 \u0431\u0443\u043a\u0432\u0435\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 3-8 \u0431\u0443\u043a\u0432\u044b; \t\/\/ \t* \u0434\u043b\u0438\u043d\u0430 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 1-3 \u0446\u0438\u0444\u0440\u044b; \t\/\/ \t* \u0438\u043d\u0434\u0435\u043a\u0441 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u043b\u0443\u0447\u0430\u0435\u043d. \t\/\/ 300 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e random seed, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043e\u0431\u043e\u0438\u0445 \t\/\/ \u043a\u0435\u0439\u0441\u0430\u0445 \u043d\u0430\u0431\u043e\u0440\u044b \u0441\u0442\u0440\u043e\u043a \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438; \t\/\/ \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f func testSet \u0435\u0441\u0442\u044c \u0432 \u043f\u043e\u043b\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0444\u0430\u0439\u043b\u0430. \tset := testSet(300) \/\/ [][]string  \tb.ResetTimer() \/\/ \u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c \u0442\u0430\u0439\u043c\u0435\u0440 \u043f\u0435\u0440\u0435\u0434 \u0441\u0442\u0430\u0440\u0442\u043e\u043c \u0437\u0430\u043c\u0435\u0440\u0430 \t\/\/ b.N \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \tfor i := 0; i &lt; b.N; i++ { \t\t\/\/ \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043b\u0435\u043a\u0441\u0438\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a \t\tsort.Strings(set[b.N%1000]) \t} }  func BenchmarkHandyStringSort(b *testing.B) { \tset := testSet(300) \tb.ResetTimer() \tfor i := 0; i &lt; b.N; i++ { \t\t\/\/ \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u043c \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a \t\tsort.Sort(Strings(set[b.N%1000])) \t} } <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0441 \u0434\u0432\u0443\u043c\u044f \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u0434\u0432\u0443\u043c\u044f \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430\u043c\u0438:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">strings_test.go<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"go\">package handysort  import ( \t&quot;math\/rand&quot; \t&quot;reflect&quot; \t&quot;sort&quot; \t&quot;strconv&quot; \t&quot;testing&quot; )  func TestStringSort(t *testing.T) { \ta := []string{ \t\t&quot;abc1&quot;, &quot;abc2&quot;, \t\t&quot;abc5&quot;, &quot;abc10&quot;, \t} \tb := []string{ \t\t&quot;abc5&quot;, &quot;abc1&quot;, \t\t&quot;abc10&quot;, &quot;abc2&quot;, \t} \tsort.Sort(Strings(b)) \tif !reflect.DeepEqual(a, b) { \t\tt.Errorf(&quot;Error: sort failed, expected: %v, got: %v&quot;, a, b) \t} }  func TestStringLess(t *testing.T) { \ttestset := []struct { \t\ts1, s2 string \t\tless   bool \t}{ \t\t{&quot;aa&quot;, &quot;ab&quot;, true}, \t\t{&quot;ab&quot;, &quot;abc&quot;, true}, \t\t{&quot;abc&quot;, &quot;ad&quot;, true}, \t\t{&quot;ab1&quot;, &quot;ab2&quot;, true}, \t\t{&quot;ab1c&quot;, &quot;ab1c&quot;, false}, \t\t{&quot;ab12&quot;, &quot;abc&quot;, true}, \t\t{&quot;ab2a&quot;, &quot;ab10&quot;, true}, \t\t{&quot;a0001&quot;, &quot;a0000001&quot;, true}, \t\t{&quot;a10&quot;, &quot;abcdefgh2&quot;, true}, \t\t{&quot;\u0430\u04312\u0430\u0431&quot;, &quot;\u0430\u043110\u0430\u0431&quot;, true}, \t\t{&quot;2\u0430\u0431&quot;, &quot;3\u0430\u0431&quot;, true}, \t}  \tfor _, v := range testset { \t\tif res := StringLess(v.s1, v.s2); res != v.less { \t\t\tt.Errorf(&quot;Compared %s to %s: expected %v, got %v&quot;, \t\t\t\tv.s1, v.s2, v.less, res) \t\t} \t} }  func BenchmarkStringSort(b *testing.B) { \tset := testSet(300) \tb.ResetTimer() \tfor i := 0; i &lt; b.N; i++ { \t\tsort.Strings(set[b.N%1000]) \t} }  func BenchmarkHandyStringSort(b *testing.B) { \tset := testSet(300) \tb.ResetTimer() \tfor i := 0; i &lt; b.N; i++ { \t\tsort.Sort(Strings(set[b.N%1000])) \t} }  \/\/ Get 1000 arrays of 10000-string-arrays. func testSet(seed int) [][]string { \tgen := &generator{ \t\tsrc: rand.New(rand.NewSource( \t\t\tint64(seed), \t\t)), \t} \tset := make([][]string, 1000) \tfor i := range set { \t\tstrings := make([]string, 10000) \t\tfor idx := range strings { \t\t\t\/\/ random length \t\t\tstrings[idx] = gen.NextString() \t\t} \t\tset[i] = strings \t} \treturn set }  type generator struct { \tsrc *rand.Rand }  func (g *generator) NextInt(max int) int { \treturn g.src.Intn(max) }  \/\/ Gets random random-length alphanumeric string. func (g *generator) NextString() (str string) { \t\/\/ random-length 3-8 chars part \tstrlen := g.src.Intn(6) + 3 \t\/\/ random-length 1-3 num \tnumlen := g.src.Intn(3) + 1 \t\/\/ random position for num in string \tnumpos := g.src.Intn(strlen + 1)  \tvar num string \tfor i := 0; i &lt; numlen; i++ { \t\tnum += strconv.Itoa(g.src.Intn(10)) \t} \tfor i := 0; i &lt; strlen+1; i++ { \t\tif i == numpos { \t\t\tstr += num \t\t} else { \t\t\tstr += string('a' + g.src.Intn(16)) \t\t} \t} \treturn str } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0441\u0435 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u043a\u0430\u043a \u0438 \u0442\u0435\u0441\u0442\u044b: \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <code>go test<\/code> \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0444\u043b\u0430\u0433\u0430 \u0438 \u043c\u0430\u0441\u043a\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e <code>BenchmarkHandyStringSort<\/code>, \u0443\u043a\u0430\u0437\u0430\u0432 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0430\u0441\u043a\u0438 <code>Handy<\/code>. \u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u043e\u0431\u0430:<\/p>\n<pre><code>$ go test -bench=. PASS BenchmarkStringSort\t     500\t   3513466 ns\/op BenchmarkHandyStringSort\t     100\t  16527577 ns\/op ok  \tgithub.com\/Xlab\/handysort\t91.389s <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0438\u0437 10000 \u0441\u0442\u0440\u043e\u043a \u0440\u0430\u0437\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b, \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0441\u0435\u0431\u044f \u0432 4.7 \u0440\u0430\u0437\u0430 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 <font color=\"#2980b9\"><i>10000 \u0441\u0442\u0440\u043e\u043a \u0437\u0430 16.5ms<\/i><\/font> \u043d\u0430 Intel i5 1.7GHz \u2013 \u044d\u0442\u043e \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u044f \u0441\u0447\u0438\u0442\u0430\u044e, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0438\u043c. \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0435\u0442 \u043d\u0435\u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0438 \u0435\u0433\u043e \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u043f\u043e\u043a\u0430\u0436\u0443\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 5ms (\u0441\u0440\u0430\u0432\u043d\u0438\u043c\u044b\u0439 \u0441 3.5ms \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438) \u2013 \u0432\u0441\u0435 \u0431\u0443\u0434\u0443\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0434\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0431\u0443\u0434\u0435\u0442 <font color=\"#2980b9\"><i>\u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043e<\/i><\/font>.<\/p>\n<p>  <font color=\"#2980b9\">\u0412\u0430\u0436\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u0430\u0441\u043f\u0435\u043a\u0442\u0430\u0445 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 Go:<\/font>  <\/p>\n<ul>\n<li><a href=\"http:\/\/golang.org\/doc\/code.html#Testing\">golang.org\/doc\/code.html#Testing<\/a><\/li>\n<li><a href=\"http:\/\/golang.org\/pkg\/testing\/\">golang.org\/pkg\/testing\/<\/a><\/li>\n<li><a href=\"http:\/\/golang.org\/doc\/faq#testing_framework\">golang.org\/doc\/faq#testing_framework<\/a><\/li>\n<li><a href=\"http:\/\/blog.golang.org\/cover\">blog.golang.org\/cover<\/a><\/li>\n<\/ul>\n<h4><font color=\"#2980b9\">\u0420\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435<\/font><\/h4>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u043f\u0440\u0438\u0447\u0435\u0441\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 \u0441\u043d\u0438\u043f\u043f\u0435\u0442, \u043f\u043e\u043a\u0440\u044b\u043b\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u0438\u0437\u043c\u0435\u0440\u0438\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c. \u0418\u043c\u044f \u043f\u0430\u043a\u0435\u0442\u0430 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u043e\u0441\u044c <code>handysort<\/code>, \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 GitHub, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u043d\u043e\u0435 \u0438\u043c\u044f \u043f\u0430\u043a\u0435\u0442\u0430 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c <code>github.com\/Xlab\/handysort<\/code> \u2013 \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0440\u0435\u0441\u0435\u043a\u0430\u0435\u0442 \u043b\u044e\u0431\u044b\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u044b \u0438\u043c\u0451\u043d \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0434\u043b\u0438\u043d\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u0440\u0443\u0442\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0430\u043a\u0435\u0442\u043e\u043c.<\/p>\n<pre><code>. \u251c\u2500\u2500 LICENSE \u251c\u2500\u2500 README.md \u251c\u2500\u2500 strings.go \u2514\u2500\u2500 strings_test.go  0 directories, 4 files <\/code><\/pre>\n<p>  \u2191 \u0424\u0430\u0439\u043b\u044b \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430. \u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c, \u043c\u043e\u0436\u0435\u0442, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043a\u043e\u0434 java-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043a\u0430\u043a\u043e\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c:<br \/>  <a href=\"https:\/\/github.com\/ex3ndr\/telegram-api\/blob\/master\/src\/main\/java\/org\/telegram\/api\/engine\/file\/UploadListener.java\">telegram-api &gt; src &gt; main &gt; java &gt; org &gt; telegram &gt; api &gt; engine &gt; file &gt; UploadListener.java<\/a><br \/>  \u2013 \u0438 \u0432\u0441\u0451?! \u043d\u0443 \u043e\u043e\u043e\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u0449\u0451\u043b\u043a\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e.<\/p>\n<p>  <font color=\"#2980b9\"><i>\u041f\u043e\u0434\u0445\u043e\u0434 I<\/i><\/font><br \/>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430: \u0432\u044b \u0431\u0435\u0440\u0451\u0442\u0435 \u0441\u0432\u043e\u0439 \u043a\u043e\u0434, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0435, \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0435 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0435 \u043d\u0430 GitHub. \u0422\u0435\u043f\u0435\u0440\u044c \u043b\u044e\u0431\u043e\u0439 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u043f\u0430\u043a\u0435\u0442\u043e\u043c, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0432 \u0435\u0433\u043e \u0432 <code>include<\/code>-\u0441\u0435\u043a\u0446\u0438\u0438 \u0441\u0440\u0435\u0434\u0438 \u043f\u0440\u043e\u0447\u0438\u0445:<\/p>\n<pre><code class=\"go\">import ( \t&quot;bufio&quot; \t&quot;bytes&quot; \t&quot;errors&quot; \t&quot;fmt&quot; \t&quot;github.com\/Xlab\/handysort&quot; \t&quot;io&quot; ) <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u0430\u043a\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u0442\u044f\u043d\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043f\u0438\u0438 \u043d\u0435\u0442 \u0438\u043b\u0438 \u043e\u043d\u0430 \u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0430. \u0410\u0432\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0443\u043b\u0443\u0447\u0448\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442, \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u0432\u0430\u0448 \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d \u0441\u0432\u0435\u0436\u0438\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0441\u043a\u0443\u043f\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c (\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0431\u0443\u043a\u0432\u044b, \u0432\u043d\u0443\u0442\u0440\u0438 \u2013 \u043d\u0435\u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438) \u0438 \u043d\u0435 \u0437\u0430\u0431\u044b\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043a \u043f\u0430\u043a\u0435\u0442\u0443, \u043a\u0430\u043a \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441 <code>handysort<\/code>:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">strings.do<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"go\">\/\/ Copyright 2014 Maxim Kouprianov. All rights reserved. \/\/ Use of this source code is governed by the MIT license \/\/ that can be found in the LICENSE file.  \/* Package handysort implements an alphanumeric string comparison function in order to sort alphanumeric strings correctly.  Default sort (incorrect): \tabc1 \tabc10 \tabc12 \tabc2  Handysort: \tabc1 \tabc2 \tabc10 \tabc12  Please note, that handysort is about 5x-8x times slower than a simple sort, so use it wisely. *\/ package handysort  import ( \t&quot;unicode\/utf8&quot; )  \/\/ Strings implements the sort interface, sorts an array \/\/ of the alphanumeric strings in decreasing order. type Strings []string  func (a Strings) Len() int           { return len(a) } func (a Strings) Swap(i, j int)      { a[i], a[j] = a[j], a[i] } func (a Strings) Less(i, j int) bool { return StringLess(a[i], a[j]) }  \/\/ StringLess compares two alphanumeric strings correctly. func StringLess(s1, s2 string) (less bool) { \t\/\/ uint64 = max 19 digits \tn1, n2 := make([]rune, 0, 18), make([]rune, 0, 18)  \tfor i, j := 0, 0; i &lt; len(s1) || j &lt; len(s2); { \t\tvar r1, r2 rune \t\tvar w1, w2 int \t\tvar d1, d2 bool  \t\t\/\/ read rune from former string available \t\tif i &lt; len(s1) { \t\t\tr1, w1 = utf8.DecodeRuneInString(s1[i:]) \t\t\ti += w1  \t\t\t\/\/ if digit, accumulate \t\t\tif d1 = ('0' &lt;= r1 && r1 &lt;= '9'); d1 { \t\t\t\tn1 = append(n1, r1) \t\t\t} \t\t}  \t\t\/\/ read rune from latter string if available \t\tif j &lt; len(s2) { \t\t\tr2, w2 = utf8.DecodeRuneInString(s2[j:]) \t\t\tj += w2  \t\t\t\/\/ if digit, accumulate \t\t\tif d2 = ('0' &lt;= r2 && r2 &lt;= '9'); d2 { \t\t\t\tn2 = append(n2, r2) \t\t\t} \t\t}  \t\t\/\/ if have rune and other non-digit rune \t\tif (!d1 || !d2) && r1 &gt; 0 && r2 &gt; 0 { \t\t\t\/\/ and accumulators have digits \t\t\tif len(n1) &gt; 0 && len(n2) &gt; 0 { \t\t\t\t\/\/ make numbers from digit group \t\t\t\tin1 := digitsToNum(n1) \t\t\t\tin2 := digitsToNum(n2) \t\t\t\t\/\/ and compare \t\t\t\tif in1 != in2 { \t\t\t\t\treturn in1 &lt; in2 \t\t\t\t} \t\t\t\t\/\/ if equal, empty accumulators and continue \t\t\t\tn1, n2 = n1[0:0], n2[0:0] \t\t\t} \t\t\t\/\/ detect if non-digit rune from former or latter \t\t\tif r1 != r2 { \t\t\t\treturn r1 &lt; r2 \t\t\t} \t\t} \t}  \t\/\/ if reached end of both strings and accumulators \t\/\/ have some digits \tif len(n1) &gt; 0 || len(n2) &gt; 0 { \t\tin1 := digitsToNum(n1) \t\tin2 := digitsToNum(n2) \t\tif in1 != in2 { \t\t\treturn in1 &lt; in2 \t\t} \t}  \t\/\/ last hope \treturn len(s1) &lt; len(s2) }  \/\/ Convert a set of runes (digits 0-9) to uint64 number func digitsToNum(d []rune) (n uint64) { \tif l := len(d); l &gt; 0 { \t\tn += uint64(d[l-1] - 48) \t\tk := uint64(l - 1) \t\tfor _, r := range d[:l-1] { \t\t\tn, k = n+uint64(r-48)*uint64(10)*k, k-1 \t\t} \t} \treturn } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u043e \u0442\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u044e\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <a href=\"http:\/\/golang.org\/cmd\/godoc\/\">godoc<\/a>. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u0430\u043a\u0435\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043c\u043d\u043e\u0433\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438: <code>godoc &lt;\u0438\u043c\u044f \u043f\u0430\u043a\u0435\u0442\u0430&gt;<\/code>. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441 <a href=\"http:\/\/godoc.org\">godoc.org<\/a>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u043e\u0432 \u043a\u043e\u0434\u0430. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 github, \u0442\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"http:\/\/godoc.org\/github.com\/Xlab\/handysort\">godoc.org\/github.com\/Xlab\/handysort<\/a> (\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0435 \u043f\u043e\u043b\u043d\u043e\u0435 \u0438\u043c\u044f \u043f\u0430\u043a\u0435\u0442\u0430). \u0412\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"http:\/\/godoc.org\/fmt\">godoc.org\/fmt<\/a>), \u043f\u0440\u0438 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e godoc-\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u043d\u043e \u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/cl.ly\/TKPb\/godoc.gif\" alt=\"image\"\/><\/p>\n<p>  <font color=\"#2980b9\">\u0412\u0430\u0436\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u0430\u0441\u043f\u0435\u043a\u0442\u0430\u0445 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 Go:<\/font>  <\/p>\n<ul>\n<li><a href=\"http:\/\/blog.golang.org\/organizing-go-code\">blog.golang.org\/organizing-go-code<\/a><\/li>\n<li><a href=\"http:\/\/blog.golang.org\/go-fmt-your-code\">blog.golang.org\/go-fmt-your-code<\/a><\/li>\n<li><a href=\"http:\/\/blog.golang.org\/godoc-documenting-go-code\">blog.golang.org\/godoc-documenting-go-code<\/a><\/li>\n<\/ul>\n<p>  <font color=\"#2980b9\"><i>\u041f\u043e\u0434\u0445\u043e\u0434 II<\/i><\/font><br \/>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0434\u043e\u0432\u0435\u0440\u0438\u044f \u00ab\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u043c\u0443 \u0447\u0443\u0432\u0430\u043a\u0443 \u043d\u0430 GitHub\u00bb \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0430\u043a\u0435\u0442\u0430, \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0444\u043e\u0440\u043a\u043d\u0443\u0442\u044c \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442 \u0443\u0436\u0435 \u043a\u0430\u043a <code>github.com\/VasyaPupkin\/handysort<\/code>, \u0441\u0443\u0442\u044c \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u0417\u0430\u043e\u0434\u043d\u043e \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043f\u0430\u0441\u0442\u0438 \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u0442\u0432\u043e, \u0435\u0441\u043b\u0438 \u0432 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0434\u0435\u043d\u044c \u0430\u0432\u0442\u043e\u0440 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f <a href=\"http:\/\/ru.wikipedia.org\/wiki\/Bus_factor\">\u043d\u0430\u0432\u0435\u0440\u043d\u0451\u0442 \u043a\u043e\u043b\u0451\u0441\/\u0433\u0440\u0438\u0431\u043e\u0432<\/a> \u0438 \u043d\u0430\u0447\u043d\u0451\u0442 \u043c\u0435\u0442\u043e\u0434\u0438\u0447\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443 \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u0442\u043e\u044f\u0442 \u043f\u0440\u044f\u043c\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445.<\/p>\n<p>  <font color=\"#2980b9\"><i>\u041f\u043e\u0434\u0445\u043e\u0434 III<\/i><\/font><br \/>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0435\u0441\u043b\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0447\u0443\u0436\u043e\u0439 \u043f\u0430\u043a\u0435\u0442 \u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 github, \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 \u0441\u0432\u043e\u0439 \u043f\u0430\u043a\u0435\u0442 \u2013 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 <code>strings.go<\/code> \u0438 <code>strings_test.go<\/code> \u0441\u0435\u0431\u0435 \u0432 <code>handysort.go<\/code> \u0438 <code>handysort_test.go<\/code>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0437\u0430\u0434\u0435\u043d\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u0430 \u0442\u0435\u0441\u0442\u044b \u0438 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438 \u0441\u0442\u0430\u043d\u0443\u0442 \u043e\u0431\u0449\u0438\u043c\u0438. \u041a\u0441\u0442\u0430\u0442\u0438, \u043a\u043e\u0434 \u0432 Go \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043b\u044e\u0431\u0430\u044f \u0447\u0443\u0436\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0430 \u0432 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u043c \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435.<\/p>\n<h4><font color=\"#2980b9\">\u0412\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/font><\/h4>\n<p>  <img decoding=\"async\" src=\"http:\/\/cs312621.vk.me\/v312621963\/81ee\/C0rNKUlkth8.jpg\" alt=\"image\"\/><br \/>  \u041f\u043e\u0441\u0442 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u043f\u0440\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 <a href=\"https:\/\/github.com\/DisposaBoy\/GoSublime\">GoSublime<\/a> \u0434\u043b\u044f Sublime Text.<br \/>  \u0412\u0441\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/208756\/\"> http:\/\/habrahabr.ru\/post\/208756\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/248\/90d\/75e\/24890d75e350c3292be5a7a150c7ab15.png\" alt=\"image\"\/> <i>\u00ab\u041f\u043e\u0439\u0434\u0443 \u043f\u043e\u0438\u0449\u0443 \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 Google\u00bb<\/i><\/p>\n<p>  \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u043b\u044e\u0431\u044b\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u0447\u0443\u0436\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e. \u0421 \u043a\u0430\u0436\u0434\u044b\u043c \u0433\u043e\u0434\u043e\u043c, \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u0431\u043e\u043b\u0435\u0435 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438 \u0433\u043b\u0430\u0434\u043a\u0438\u043c. \u0417\u0430\u0431\u044b\u043b\u0438, \u043a\u0430\u043a \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0432\u0441\u0435 \u0441\u043b\u043e\u0432\u0430? \u041d\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0438\u0434\u0451\u043c \u043d\u0430 Stack Overflow \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0441\u043d\u0438\u043f\u043f\u0435\u0442. \u0414\u043b\u044f \u043e\u0441\u043e\u0431\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0435\u0441\u0442\u044c \u0434\u0430\u0436\u0435 <a href=\"https:\/\/github.com\/azac\/sublime-howdoi-direct-paste\">\u043f\u043b\u0430\u0433\u0438\u043d<\/a> \u0434\u043b\u044f Sublime Text, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u0445\u043e\u0442\u043a\u0435\u044e \u0438\u0449\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043d\u0430 SO \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u0438\u0437 \u043f\u0440\u0438\u043d\u044f\u0442\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u0440\u044f\u043c\u043e \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432\u0435\u0434\u0451\u0442 \u043a \u0440\u044f\u0434\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u2026  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-208756","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208756","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=208756"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208756\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=208756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=208756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}