{"id":211653,"date":"2014-02-06T14:08:03","date_gmt":"2014-02-06T10:08:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=211653"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=211653","title":{"rendered":"<span class=\"post_title\">\u0411\u0443\u0444\u0435\u0440\u0430 \u0434\u043b\u044f \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u0438\u043b\u0438 \u043f\u0438\u0448\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440 \u043e\u0431\u043c\u0435\u043d\u0430 \u043d\u0430 C# \u043d\u0435 \u0432 30 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/236\/acf\/4b6\/236acf4b69a69980747d144678d3be75.jpg\"\/><\/p>\n<p>  \u0422\u0430\u043a \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432 \u0442\u0430\u043a\u0443\u044e \u043c\u0440\u0430\u0447\u043d\u0443\u044e \u043f\u043e\u0433\u043e\u0434\u0443, \u043e\u0431\u043b\u043e\u0436\u0438\u0432 \u0441\u0435\u0431\u044f \u0442\u0430\u0431\u043b\u0435\u0442\u043a\u0430\u043c\u0438 \u0438 \u043f\u0440\u0435\u043f\u0430\u0440\u0430\u0442\u0430\u043c\u0438 \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u0443\u0434\u044b \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0442 \u043d\u0435\u0447\u0435\u0433\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0445\u0430\u0431\u0440\u0430-\u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0438 \u0443\u0436\u0435 \u043f\u043e\u0447\u0442\u0438 \u0447\u0442\u043e \u043c\u0435\u0441\u044f\u0446 \u0438\u043c \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c. \u0420\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e windows-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u0431\u0443\u0444\u0435\u0440 \u043e\u0431\u043c\u0435\u043d\u0430 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0437 \u0440\u0430\u043d\u043d\u0435\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u043b\u044e\u0431\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442.<a name=\"habracut\"><\/a><\/p>\n<h4>\u0421 \u0447\u0435\u0433\u043e \u0432\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c<\/h4>\n<p>\u041a\u0430\u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443, \u043c\u043d\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043a\u043e\u0434\u043e\u043c. \u041f\u043e\u043c\u0438\u043c\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 C#, \u043c\u043d\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c sql-\u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u041f\u0440\u0438\u0447\u0435\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b: \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u043f\u043e\u0434\u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u0441 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u0441 \u043a\u0443\u0447\u0435\u0439 LEFT JOIN \u0438 RIGHT JOIN-\u043e\u0432. \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u0438 \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u043a \u0447\u0435\u043c\u0443 \u0438 \u0437\u0430\u0447\u0435\u043c\/\u0434\u043b\u044f \u0447\u0435\u0433\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u043f\u0438\u0441\u0430\u043b\u043e\u0441\u044c.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0434\u043d\u043e\u0433\u043e sql-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u044b\u0442\u0430\u0439\u0442\u0435\u0441\u044c \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442)<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">SELECT IFNULL(SUM(t_step3.half_step3 - IFNULL(t_step1.bonus, 0) - IFNULL(t_step2.bonus, 0)), 0) AS 'bonus' FROM (    \t\tSELECT t_orders2cat.order_id\tAS 'id', \t\t\t   (t_o.balance_rub - SUM(t_orders2cat.dprice_rub - t_orders2cat.delivery_cost_rub) - IFNULL(t_gurkin.half_step3, 0) - IFNULL(t_o2p.cost_expenses_rub, 0)) *  \t\t\t   ( \t\t\t\t\tIF(base_on_tender = 0, IFNULL(t_category_percent.percent, 1),   \t\t\t\t\t\t\t\t\t\t\tIF(base_on_tender = 1, \t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\tIFNULL(t_category_percent.percent, 1) - 0.1, \t\t\t\t\t\t\t\t\t\t\t\tIFNULL(t_category_percent.percent, 1) - 0.5) \t\t\t\t\t) -  \t\t\t\t\tIF(t_orders.tech_helper_id != 0, t_users.tech_bonus_percent, 0) \t\t\t   ) \/ 100 AS 'half_step3' \t\tFROM t_orders2cat, \t\t\t t_orders LEFT JOIN t_category_percent ON t_orders.category_percent_id = t_category_percent.id \t\t\t\t\t  LEFT JOIN t_users ON t_orders.tech_helper_id = t_users.id \t\t\t\t\t  LEFT JOIN (SELECT order_id, SUM(cost_expenses_rub) AS 'cost_expenses_rub' \t\t\t\t\t\t\t\t FROM t_orders2pnr \t\t\t\t\t\t\t\t GROUP BY t_orders2pnr.order_id \t\t\t\t\t\t\t\t HAVING SUM(cost_expenses_rub) &gt; 0) AS t_o2p ON t_orders.id = t_o2p.order_id \t\t\t\t\t  LEFT JOIN (\t \t\t\t\t\t\t\t\t\tSELECT t_orders.id\tAS 'order_id', \t\t\t\t\t\t\t\t\t\t   SUM(deg_discount(deg_convert_money( t_orders.rate_eur, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   t_orders.rate_usd, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   t_orders.rate_jpy, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   t_orders2cat.price, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   t_orders2cat.currency_id, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   t_orders.currency_id),  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tt_orders2cat.discount) * t_orders2cat.count - \t\t\t\t\t\t\t\t\t\t\t\tt_orders2cat.dprice_rub - \t\t\t\t\t\t\t\t\t\t\t\tt_orders2cat.delivery_cost_rub -  \t\t\t\t\t\t\t\t\t\t\t\tIFNULL(t_orders2pnr.cost_expenses_rub, 0) \t\t\t\t\t\t\t\t\t\t\t  ) * t_p.balance_rub \/ t_orders.balance AS 'half_step3' \t\t\t\t\t\t\t\t\tFROM t_orders LEFT JOIN t_orders2pnr ON t_orders.id = t_orders2pnr.order_id, \t\t\t\t\t\t\t\t\t\t t_orders2cat, \t\t\t\t\t\t\t\t\t\t t_cat, \t\t\t\t\t\t\t\t\t\t t_vendors, \t\t\t\t\t\t\t\t\t\t ( \t\t\t\t\t\t\t\t\t\t\tSELECT order_id, \t\t\t\t\t\t\t\t\t\t\t\t   SUM(summa_rub) AS 'balance_rub' \t\t\t\t\t\t\t\t\t\t\tFROM t_payments \t\t\t\t\t\t\t\t\t\t\tGROUP BY order_id \t\t\t\t\t\t\t\t\t\t ) AS t_p, \t\t\t\t\t\t\t\t\t\t (   \t\t\t\t\t\t\t\t\t\t\tSELECT t_o.id, \t\t\t\t\t\t\t\t\t\t\t\t   GREATEST(IFNULL(t_o.date_shipment, t_o.date_pnr_finish), IFNULL(t_o.date_pnr_finish, t_o.date_shipment), MAX(t_payments.date_payment)) AS 'date_closed', \t\t\t\t\t\t\t\t\t\t\t\t   SUM(t_payments.summa_rub)\tAS 'balance_rub' \t\t\t\t\t\t\t\t\t\t\tFROM t_payments, \t\t\t\t\t\t\t\t\t\t\t\t ( \t\t\t\t\t\t\t\t\t\t\t\t\tSELECT t_orders.id, \t\t\t\t\t\t\t\t\t\t\t\t\t\t   COUNT(t_orders2cat.id)\t\tAS 'orders2cat_count', \t\t\t\t\t\t\t\t\t\t\t\t\t\t   MAX(t_orders2cat.date_from)\tAS 'date_shipment', \t\t\t\t\t\t\t\t\t\t\t\t\t\t   MAX(t_orders2cat.status_id)\tAS 'orders2cat_status', \t\t\t\t\t\t\t\t\t\t\t\t\t\t   COUNT(t_orders2pnr.id)\t\tAS 'pnr_count', \t\t\t\t\t\t\t\t\t\t\t\t\t\t   MAX(t_orders2pnr.date)\t\tAS 'date_pnr_finish', \t\t\t\t\t\t\t\t\t\t\t\t\t\t   MAX(t_orders2pnr.status_id)\tAS 'pnr_status' \t\t\t\t\t\t\t\t\t\t\t\t\tFROM t_orders LEFT JOIN t_orders2cat ON t_orders.id = t_orders2cat.order_id \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  LEFT JOIN t_orders2pnr ON t_orders.id = t_orders2pnr.order_id \t\t\t\t\t\t\t\t\t\t\t\t\tWHERE t_orders.user_id = in_user_id AND \t\t\t\t\t\t\t\t\t\t\t\t\t\t  t_orders.items_finished &gt;= t_orders.items_count AND t_orders.summa - t_orders.balance &lt; 2 \t\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY t_orders.id \t\t\t\t\t\t\t\t\t\t\t\t ) AS t_o \t\t\t\t\t\t\t\t\t\t\tWHERE t_payments.order_id = t_o.id \t\t\t\t\t\t\t\t\t\t\tGROUP BY t_payments.order_id \t\t\t\t\t\t\t\t\t\t\tHAVING EXTRACT(YEAR_MONTH FROM date_closed) = EXTRACT(YEAR_MONTH FROM in_date) \t\t\t\t\t\t\t\t\t\t ) AS t_o \t\t\t\t\t\t\t\t\tWHERE t_orders.id = t_o.id AND \t\t\t\t\t\t\t\t\t\t  t_orders.id = t_p.order_id AND \t\t\t\t\t\t\t\t\t\t  t_orders.id = t_orders2cat.order_id AND \t\t\t\t\t\t\t\t\t\t  t_orders2cat.cat_id = t_cat.id AND \t\t\t\t\t\t\t\t\t\t  t_orders.user_id = in_user_id AND \t\t\t\t\t\t\t\t\t\t  t_cat.vendor_id = t_vendors.id AND \t\t\t\t\t\t\t\t\t\t  t_vendors.user_id = 158 \t\t\t\t\t\t\t\t\tGROUP BY t_orders.id \t\t\t\t\t\t\t\t) AS t_gurkin ON t_orders.id = t_gurkin.order_id, \t\t\t\t(    \t\t\t\t\tSELECT t_o.id, \t\t\t\t\t\t   GREATEST(IFNULL(t_o.date_shipment, t_o.date_pnr_finish), IFNULL(t_o.date_pnr_finish, t_o.date_shipment), MAX(t_payments.date_payment)) AS 'date_closed', \t\t\t\t\t\t   SUM(t_payments.summa_rub)\tAS 'balance_rub' \t\t\t\t\tFROM t_payments, \t\t\t\t\t\t ( \t\t\t\t\t\t\tSELECT t_orders.id, \t\t\t\t\t\t\t\t   COUNT(t_orders2cat.id)\t\tAS 'orders2cat_count', \t\t\t\t\t\t\t\t   MAX(t_orders2cat.date_from)\tAS 'date_shipment', \t\t\t\t\t\t\t\t   MAX(t_orders2cat.status_id)\tAS 'orders2cat_status', \t\t\t\t\t\t\t\t   COUNT(t_orders2pnr.id)\t\tAS 'pnr_count', \t\t\t\t\t\t\t\t   MAX(t_orders2pnr.date)\t\tAS 'date_pnr_finish', \t\t\t\t\t\t\t\t   MAX(t_orders2pnr.status_id)\tAS 'pnr_status' \t\t\t\t\t\t\tFROM t_orders LEFT JOIN t_orders2cat ON t_orders.id = t_orders2cat.order_id \t\t\t\t\t\t\t\t\t\t  LEFT JOIN t_orders2pnr ON t_orders.id = t_orders2pnr.order_id \t\t\t\t\t\t\tWHERE t_orders.user_id = in_user_id AND \t\t\t\t\t\t\t\t  t_orders.items_finished &gt;= t_orders.items_count AND t_orders.summa - t_orders.balance &lt; 2 \t\t\t\t\t\t\tGROUP BY t_orders.id \t\t\t\t\t\t ) AS t_o \t\t\t\t\tWHERE t_payments.order_id = t_o.id \t\t\t\t\tGROUP BY t_payments.order_id \t\t\t\t\tHAVING EXTRACT(YEAR_MONTH FROM date_closed) = EXTRACT(YEAR_MONTH FROM in_date) \t\t\t\t) AS t_o\t \t\tWHERE t_orders2cat.order_id = t_o.id AND \t\t\t  t_orders2cat.order_id = t_orders.id \t\tGROUP BY t_orders2cat.order_id \t ) AS t_step3 \t LEFT JOIN \t (   \t\tSELECT t_orders.id, \t\t\t   t_o.average_curs * (t_orders.summa - IFNULL(t_gurkin.step1, 0)) *  \t\t\t   ( \t\t\t\t\tIF(base_on_tender = 0, IFNULL(t_category_percent.percent, 1), \t\t\t\t\t\t\t\t\t\t   IF(base_on_tender = 1, \t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\tIFNULL(t_category_percent.percent, 1) - 0.1, \t\t\t\t\t\t\t\t\t\t\t\tIFNULL(t_category_percent.percent, 1) - 0.5 \t\t\t\t\t\t\t\t\t\t\t  ) \t\t\t\t\t) - \t\t\t\t\tIF(t_orders.tech_helper_id != 0, t_users.tech_bonus_percent, 0) \t\t\t   ) \/  \t\t\t   100 * 0.3 AS 'bonus' \t\tFROM t_orders LEFT JOIN t_category_percent ON t_orders.category_percent_id = t_category_percent.id \t\t\t\t\t  LEFT JOIN t_users ON t_orders.tech_helper_id = t_users.id \t\t\t\t\t  LEFT JOIN ( \t\t\t\t\t\t\t\t\tSELECT t_orders.id AS 'order_id', \t\t\t\t\t\t\t\t\t\t\tSUM(deg_discount(deg_convert_money( t_orders.rate_eur, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tt_orders.rate_usd, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tt_orders.rate_jpy, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tt_orders2cat.price, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tt_orders2cat.currency_id, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tt_orders.currency_id),  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t t_orders2cat.discount) * t_orders2cat.count) * t_o.payment_rub \/ t_o.payment_currency AS 'step1' \t\t\t\t\t\t\t\t\tFROM t_orders, \t\t\t\t\t\t\t\t\t\t t_orders2cat, \t\t\t\t\t\t\t\t\t\t t_cat, \t\t\t\t\t\t\t\t\t\t t_vendors, \t\t\t\t\t\t\t\t\t\t (   \t\t\t\t\t\t\t\t\t\t\tSELECT t_orders.id, \t\t\t\t\t\t\t\t\t\t\t\t\tSUM(t_payments.summa_rub) AS 'payment_rub', \t\t\t\t\t\t\t\t\t\t\t\t\tSUM(deg_convert_money(t_rates.eur, t_rates.usd, t_rates.jpy, t_payments.summa_rub, 1, t_orders.currency_id)) AS 'payment_currency', \t\t\t\t\t\t\t\t\t\t\t\t\tt_orders.summa \t\t\t\t\t\t\t\t\t\t\tFROM t_orders, \t\t\t\t\t\t\t\t\t\t\t\t t_payments, \t\t\t\t\t\t\t\t\t\t\t\t t_rates \t\t\t\t\t\t\t\t\t\t\tWHERE t_orders.id = t_payments.order_id AND \t\t\t\t\t\t\t\t\t\t\t\t  t_payments.date_rates = t_rates.date AND \t\t\t\t\t\t\t\t\t\t\t\t  EXTRACT(YEAR_MONTH FROM t_orders.date_firstpay) = EXTRACT(YEAR_MONTH FROM t_payments.date_payment) \t\t\t\t\t\t\t\t\t\t\tGROUP BY t_payments.order_id \t\t\t\t\t\t\t\t\t\t\tHAVING payment_currency \/ t_orders.summa &gt;= 0.3 \t\t\t\t\t\t\t\t\t\t ) AS t_o \t\t\t\t\t\t\t\t\tWHERE t_orders.id = t_orders2cat.order_id AND \t\t\t\t\t\t\t\t\t\t  t_orders2cat.order_id = t_o.id AND \t\t\t\t\t\t\t\t\t\t  t_orders.user_id = in_user_id AND \t\t\t\t\t\t\t\t\t\t  t_orders2cat.cat_id = t_cat.id AND \t\t\t\t\t\t\t\t\t\t  t_vendors.user_id = 158 AND \t\t\t\t\t\t\t\t\t\t  t_cat.vendor_id = t_vendors.id \t\t\t\t\t\t\t\t\tGROUP BY t_o.id \t\t\t\t\t\t\t\t) AS t_gurkin ON t_orders.id = t_gurkin.order_id, \t\t\t(\t \t\t\t\tSELECT t_orders.id, \t\t\t\t\t   SUM(t_payments.summa_rub) \/ SUM(deg_convert_money(t_rates.eur, t_rates.usd, t_rates.jpy, t_payments.summa_rub, 1, t_orders.currency_id)) AS 'average_curs' \t\t\t\tFROM t_payments, \t\t\t\t\t t_rates, \t\t\t\t\t t_orders, \t\t\t\t\t (   \t\t\t\t\t\tSELECT t_payments.order_id, \t\t\t\t\t\t\t   MIN(t_payments.date_payment) AS 'date_payment' \t\t\t\t\t\tFROM t_payments \t\t\t\t\t\tWHERE 0.3 &lt;= ( \t\t\t\t\t\t\t\t\t\tSELECT SUM(deg_convert_money(t_rates.eur, t_rates.usd, t_rates.jpy, t_p.summa_rub, 1, t_o.currency_id)) \/ t_o.summa AS 'summa_cur' \t\t\t\t\t\t\t\t\t\tFROM t_payments AS t_p, \t\t\t\t\t\t\t\t\t\t\t t_orders AS t_o, \t\t\t\t\t\t\t\t\t\t\t t_rates \t\t\t\t\t\t\t\t\t\tWHERE t_p.order_id = t_o.id AND \t\t\t\t\t\t\t\t\t\t\t  t_p.date_rates = t_rates.date AND \t\t\t\t\t\t\t\t\t\t\t  t_p.date_payment &lt;= t_payments.date_payment AND \t\t\t\t\t\t\t\t\t\t\t  t_o.id = t_payments.order_id \t\t\t\t\t\t\t\t\t ) \t\t\t\t\t\tGROUP BY t_payments.order_id \t\t\t\t\t ) AS t_o \t\t\t\tWHERE t_payments.order_id = t_o.order_id AND \t\t\t\t\t  t_payments.order_id = t_orders.id AND \t\t\t\t\t  t_payments.date_rates = t_rates.date AND \t\t\t\t\t  EXTRACT(YEAR_MONTH FROM t_payments.date_payment) &lt;= EXTRACT(YEAR_MONTH FROM t_o.date_payment) AND \t\t\t\t\t  t_orders.user_id = in_user_id \t\t\t\tGROUP BY t_orders.id \t\t\t) AS t_o\t\t \t\tWHERE t_orders.id = t_o.id AND \t\t\t  t_orders.user_id = in_user_id \t ) AS t_step1 \t ON t_step3.id = t_step1.id \t LEFT JOIN \t (   \t\tSELECT t_orders.id, \t\t\t   SUM(t_payments.summa_rub) \/ SUM(deg_convert_money(t_rates.eur, t_rates.usd, t_rates.jpy, t_payments.summa_rub, 1, t_orders.currency_id)) * (t_orders.summa - IFNULL(t_gurkin.step2, 0)) * \t\t\t   ( \t\t\t\t\tIF(base_on_tender = 0, IFNULL(t_category_percent.percent, 1), \t\t\t\t\t\t\t\t\t\t   IF(base_on_tender = 1, \t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t  IFNULL(t_category_percent.percent, 1) - 0.1, \t\t\t\t\t\t\t\t\t\t\t  IFNULL(t_category_percent.percent, 1) - 0.5 \t\t\t\t\t\t\t\t\t\t\t ) \t\t\t\t\t) - \t\t\t\t\tIF(t_orders.tech_helper_id != 0, t_users.tech_bonus_percent, 0) \t\t\t   ) \/ 100 * 0.3 AS 'bonus' \t\tFROM t_payments, \t\t\t t_rates, \t\t\t t_orders LEFT JOIN t_category_percent ON t_orders.category_percent_id = t_category_percent.id \t\t\t\t\t  LEFT JOIN t_users ON t_orders.tech_helper_id = t_users.id \t\t\t\t\t  LEFT JOIN (   \t\t\t\t\t\t\t\t\tSELECT t_orders.id AS 'order_id', \t\t\t\t\t\t\t\t\t\t   SUM(deg_discount(deg_convert_money( t_orders.rate_eur, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   t_orders.rate_usd, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   t_orders.rate_jpy, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   t_orders2cat.price, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   t_orders2cat.currency_id, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   t_orders.currency_id),  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tt_orders2cat.discount) * t_orders2cat.count) * t_o.payment_rub \/ t_o.payment_currency  AS 'step2' \t\t\t\t\t\t\t\t\tFROM t_orders, \t\t\t\t\t\t\t\t\t\t t_orders2cat, \t\t\t\t\t\t\t\t\t\t t_cat, \t\t\t\t\t\t\t\t\t\t t_vendors, \t\t\t\t\t\t\t\t\t\t ( \t\t\t\t\t\t\t\t\t\t\tSELECT t_orders.id, \t\t\t\t\t\t\t\t\t\t\t\t   SUM(t_payments.summa_rub)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAS 'payment_rub', \t\t\t\t\t\t\t\t\t\t\t\t   SUM(deg_convert_money(t_rates.eur, t_rates.usd, t_rates.jpy, t_payments.summa_rub, 1, t_orders.currency_id))\tAS 'payment_currency' \t\t\t\t\t\t\t\t\t\t\tFROM t_payments, \t\t\t\t\t\t\t\t\t\t\t\t t_rates, \t\t\t\t\t\t\t\t\t\t\t\t t_orders, \t\t\t\t\t\t\t\t\t\t\t\t (   \t\t\t\t\t\t\t\t\t\t\t\t\tSELECT t_o.id, \t\t\t\t\t\t\t\t\t\t\t\t\t\t   GREATEST(date_exit, date_payment)\tAS 'date_payment_bonus' \t\t\t\t\t\t\t\t\t\t\t\t\tFROM ( \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSELECT t_o.id\t\t\t\t\t\t\tAS 'id', \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   MAX(t_containers.date_port_exit) AS 'date_exit' \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM t_orders2cat, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t t_invoices2orders2cat, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t t_containers2invoices, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t t_containers, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ( \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSELECT t_orders.id \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM t_orders, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t t_orders2cat \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE t_orders.id = t_orders2cat.order_id AND \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  t_orders.user_id = in_user_id AND \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  4 &lt;= ALL (SELECT t_o2c.status_id FROM t_orders2cat AS t_o2c WHERE t_o2c.order_id = t_orders.id) \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY t_orders.id \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ) AS t_o \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE t_orders2cat.id = t_invoices2orders2cat.order2cat_id AND \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  t_invoices2orders2cat.invoice_id = t_containers2invoices.invoice_id AND \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  t_containers2invoices.container_id = t_containers.id AND \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  t_orders2cat.order_id = t_o.id \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY t_o.id \t\t\t\t\t\t\t\t\t\t\t\t\t\t ) AS t_o, \t\t\t\t\t\t\t\t\t\t\t\t\t\t (\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSELECT t_payments.order_id, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   MIN(t_payments.date_payment) AS 'date_payment' \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM t_payments \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE 0.8 &lt;= ( \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSELECT SUM(deg_convert_money(t_rates.eur, t_rates.usd, t_rates.jpy, t_p.summa_rub, 1, t_o.currency_id)) \/ t_o.summa AS 'summa_cur' \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM t_payments AS t_p, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t t_orders AS t_o, \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t t_rates \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE t_p.order_id = t_o.id AND \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  t_o.user_id = in_user_id AND \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  t_p.date_rates = t_rates.date AND \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  t_p.date_payment &lt;= t_payments.date_payment AND \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  t_o.id = t_payments.order_id \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ) \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY t_payments.order_id \t\t\t\t\t\t\t\t\t\t\t\t\t\t ) t_p \t\t\t\t\t\t\t\t\t\t\t\t\tWHERE t_o.id = t_p.order_id \t\t\t\t\t\t\t\t\t\t\t\t ) AS t_o \t\t\t\t\t\t\t\t\t\t\tWHERE t_payments.order_id = t_o.id AND \t\t\t\t\t\t\t\t\t\t\t\t  t_payments.date_rates = t_rates.date AND \t\t\t\t\t\t\t\t\t\t\t\t  t_payments.order_id = t_orders.id AND \t\t\t\t\t\t\t\t\t\t\t\t  EXTRACT(YEAR_MONTH FROM t_payments.date_payment) &lt;= EXTRACT(YEAR_MONTH FROM t_o.date_payment_bonus) \t\t\t\t\t\t\t\t\t\t\tGROUP BY t_orders.id \t\t\t\t\t\t\t\t\t\t ) AS t_o \t\t\t\t\t\t\t\t\tWHERE t_orders.id = t_orders2cat.order_id AND \t\t\t\t\t\t\t\t\t\t  t_orders2cat.order_id = t_o.id AND \t\t\t\t\t\t\t\t\t\t  t_orders2cat.cat_id = t_cat.id AND \t\t\t\t\t\t\t\t\t\t  t_orders.user_id = in_user_id AND \t\t\t\t\t\t\t\t\t\t  t_vendors.user_id = 158 AND \t\t\t\t\t\t\t\t\t\t  t_cat.vendor_id = t_vendors.id\t   \t\t\t\t\t\t\t\t\tGROUP BY t_o.id \t\t\t\t\t\t\t\t ) AS t_gurkin ON t_orders.id = t_gurkin.order_id, \t\t\t (\t \t\t\t\tSELECT t_o.id, \t\t\t\t\t   GREATEST(date_exit, date_payment)\tAS 'date_payment_bonus' \t\t\t\tFROM ( \t\t\t\t\t\tSELECT t_o.id\t\t\t\t\t\t\tAS 'id', \t\t\t\t\t\t\t   MAX(t_containers.date_port_exit) AS 'date_exit' \t\t\t\t\t\tFROM t_orders2cat, \t\t\t\t\t\t\t t_invoices2orders2cat, \t\t\t\t\t\t\t t_containers2invoices, \t\t\t\t\t\t\t t_containers, \t\t\t\t\t\t\t ( \t\t\t\t\t\t\t\tSELECT t_orders.id \t\t\t\t\t\t\t\tFROM t_orders, \t\t\t\t\t\t\t\t\t t_orders2cat \t\t\t\t\t\t\t\tWHERE t_orders.id = t_orders2cat.order_id AND \t\t\t\t\t\t\t\t\t  t_orders.user_id = in_user_id AND \t\t\t\t\t\t\t\t\t  4 &lt;= ALL (SELECT t_o2c.status_id FROM t_orders2cat AS t_o2c WHERE t_o2c.order_id = t_orders.id) AND \t\t\t\t\t\t\t\t\t  t_orders.user_id = in_user_id \t\t\t\t\t\t\t\tGROUP BY t_orders.id \t\t\t\t\t\t\t ) AS t_o \t\t\t\t\t\tWHERE t_orders2cat.id = t_invoices2orders2cat.order2cat_id AND \t\t\t\t\t\t\t  t_invoices2orders2cat.invoice_id = t_containers2invoices.invoice_id AND \t\t\t\t\t\t\t  t_containers2invoices.container_id = t_containers.id AND \t\t\t\t\t\t\t  t_orders2cat.order_id = t_o.id \t\t\t\t\t\tGROUP BY t_o.id \t\t\t\t\t ) AS t_o, \t\t\t\t\t ( \t\t\t\t\t\tSELECT t_payments.order_id, \t\t\t\t\t\t\t   MIN(t_payments.date_payment) AS 'date_payment' \t\t\t\t\t\tFROM t_payments \t\t\t\t\t\tWHERE 0.8 &lt;= ( \t\t\t\t\t\t\t\t\t\tSELECT SUM(deg_convert_money(t_rates.eur, t_rates.usd, t_rates.jpy, t_p.summa_rub, 1, t_o.currency_id)) \/ t_o.summa AS 'summa_cur' \t\t\t\t\t\t\t\t\t\tFROM t_payments AS t_p, \t\t\t\t\t\t\t\t\t\t\t t_orders AS t_o, \t\t\t\t\t\t\t\t\t\t\t t_rates \t\t\t\t\t\t\t\t\t\tWHERE t_p.order_id = t_o.id AND \t\t\t\t\t\t\t\t\t\t\t  t_o.user_id = in_user_id AND \t\t\t\t\t\t\t\t\t\t\t  t_p.date_rates = t_rates.date AND \t\t\t\t\t\t\t\t\t\t\t  t_p.date_payment &lt;= t_payments.date_payment AND \t\t\t\t\t\t\t\t\t\t\t  t_o.id = t_payments.order_id \t\t\t\t\t\t\t\t\t ) \t\t\t\t\t\tGROUP BY t_payments.order_id \t\t\t\t\t ) t_p \t\t\t\tWHERE t_o.id = t_p.order_id \t\t\t ) AS t_o \t\tWHERE t_o.id = t_payments.order_id AND \t\t\t  t_orders.id = t_o.id AND \t\t\t  t_orders.user_id = in_user_id AND \t\t\t  t_payments.date_rates = t_rates.date AND \t\t\t  EXTRACT(YEAR_MONTH FROM t_payments.date_payment) &lt;= EXTRACT(YEAR_MONTH FROM t_o.date_payment_bonus) \t\tGROUP BY t_orders.id \t ) AS t_step2 \t ON t_step3.id = t_step2.id; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041f\u043e\u0447\u0438\u0442\u0430\u0432 \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"http:\/\/http:\/\/habrahabr.ru\/post\/208314\/\">\u041f\u0438\u0448\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0443\u0444\u0435\u0440 \u043e\u0431\u043c\u0435\u043d\u0430 \u043d\u0430 C#<\/a>, \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u043d\u0430\u043c <a href=\"http:\/\/habrahabr.ru\/users\/yanzlatov\/\" class=\"user_link\">yanzlatov<\/a>, \u043d\u043e \u0435\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0431\u044b\u043b \u043d\u0435\u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c: \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u043a \u0431\u044b\u0441\u0442\u0440\u043e\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u0443 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0443\u0444\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u043e\u0432, \u0433\u043b\u044e\u0447\u043d\u043e\u0441\u0442\u044c\u2026<\/p>\n<h5>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/h5>\n<p>\u0421\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0432 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0447\u0435\u0442\u043a\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u043d\u043e\u0432\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434.  <\/p>\n<ul>\n<li>\u0422\u0430\u043a \u043a\u0430\u043a \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u043d\u0430 \u043d\u043e\u0443\u0442\u0435 (Win7x64), \u043d\u0430 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 (Win8.1&#215;64) \u0438 \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 (Win8x64), \u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u0442\u0440\u0435\u0445 \u043e\u0441\u044f\u0445 Windows 7&#215;64, 8&#215;64, 8.1&#215;64 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c .Net Framework \u0432\u0435\u0440\u0441\u0438\u0438 4 \u0438 \u0432\u044b\u0448\u0435.<\/li>\n<li>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u0442\u0438\u0445\u0430\u0440\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u041e\u0421<\/li>\n<li>\u041f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u0431\u0443\u0444\u0435\u0440 \u043e\u0431\u043c\u0435\u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438<\/li>\n<li>\u041f\u0440\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u043a\u043b\u0430\u0432\u0438\u0448 ctrl + v \u0438\u043b\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043f\u0443\u043d\u043a\u0442\u043e\u043c \u043c\u0435\u043d\u044e) \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u0431\u0443\u0444\u0435\u0440 \u0442\u0435\u043a\u0441\u0442<\/li>\n<li>\u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 <b>ctrl + alt + v<\/b> \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u043a\u043d\u043e \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u0431\u043e\u0440\u0430 \u0431\u0443\u0444\u0435\u0440\u0430<\/li>\n<li>\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/li>\n<li>\u041a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u043a\u043b\u0430\u0432\u0438\u0448<\/li>\n<li>\u0422\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0432\u0441\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c<\/li>\n<\/ul>\n<h4>\u041a\u043e\u0434<\/h4>\n<p> <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/702\/bec\/67f\/702bec67f517dee450e10abf34c72934.png\"\/><br \/>  \u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c <a href=\"https:\/\/github.com\/kin9pin\/ClipboardToClipboard\">\u0437\u0434\u0435\u0441\u044c<\/a>. Exe-\u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0431\u0440\u0430\u0442\u044c <a href=\"https:\/\/www.dropbox.com\/s\/t0bbw7yasn5e1fp\/ClipboardToClipboard.exe\">\u0437\u0434\u0435\u0441\u044c<\/a>.<br \/>  \u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0437\u0430\u043e\u0441\u0442\u0440\u044f\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u0441\u0451\u043c \u043a\u043e\u0434\u0435. \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u0445.<\/p>\n<p>  \u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u044c\u044e\u0442\u0435\u043a\u0441\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"cs\">static void Main() { \tbool createdNew; \tMutex mutex = new Mutex(true, &quot;MY_UNIQUE_MUTEX_ClipboardToClipboard&quot;, out createdNew);  \tif (!createdNew) \t{ \t\tMessageBox.Show(&quot;\u0412 \u043f\u0430\u043c\u044f\u0442\u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0443\u0436\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u043e\u0434\u0438\u043d \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f&quot;, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); \t\tProcess.GetCurrentProcess().Kill(); \t} ... ... ... \t \tmutex.ReleaseMutex(); } <\/code><\/pre>\n<p>  \u0421\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 ctrl + alt + v  <\/p>\n<pre><code class=\"cs\">public static EventCtrlAltVHandler EventPressCtrlAltV; private static Keys lastKey = Keys.FinalMode;  private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) { \tif ((nCode &gt;= 0) && (wParam == (IntPtr)WM_KEYDOWN)) \t{ \t\tKeys key = (Keys)Marshal.ReadInt32(lParam);  \t\tif (lastKey == Keys.LMenu && key == Keys.V) \t\t\tEventPressCtrlAltV();  \t\tlastKey = key; \t}  \treturn CallNextHookEx(_hookID, nCode, wParam, lParam); } <\/code><\/pre>\n<p>  \u0412 MainForm.cs \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u0442 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 ctrl + {<em>\u043a\u043b\u0430\u0432\u0438\u0448\u0430<\/em>}. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0431\u044b\u043b\u043e ctrl + v \u043d\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435  <\/p>\n<pre><code class=\"cs\">private static void SendCtrlhotKey(char key) { \tkeybd_event(VK_CONTROL, 0, 0, 0); \tkeybd_event((byte)key, 0, 0, 0); \tkeybd_event((byte)key, 0, KEYEVENTF_KEYUP, 0); \tkeybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0); } <\/code><\/pre>\n<p>  \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0442\u0430\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0435\u0442\u0443. \u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 xml-\u0444\u0430\u0439\u043b\u0435, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u2014 \u043f\u0440\u044f\u043c \u0432 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u2026 \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0439\u0442\u0435\u0441\u044c \u0441\u0430\u043c\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f. \u0415\u0441\u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043c\u043e\u0433\u0443 \u043d\u0430 \u043d\u0438\u0445 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c.<\/p>\n<h4>\u041a\u0430\u043a \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u043e \u0432\u0441\u0451 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h4>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0451 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c exe-\u0448\u043d\u0438\u043a. \u0412\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0442\u0435\u043a\u0441\u0442\u0430, \u0436\u043c\u0430\u043a\u0430\u0435\u0442\u0435 ctrl + c \u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c \u0442\u0440\u0435\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435:<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/0e7\/c3e\/66b\/0e7c3e66b0cba3c0c1a64417221da736.jpg\"\/><\/p>\n<p>  \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0447\u0442\u043e \u044d\u0442\u0430 \u0444\u0438\u0447\u0430 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u0430, \u043d\u043e \u0437\u0430 \u043d\u0435\u0439 \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0443\u0442\u0430\u044f \u0444\u0438\u0447\u0430 \u2014 \u0435\u0441\u043b\u0438 \u043d\u0430 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0435\u0439 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0435 \u043a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u043c\u044b\u0448\u044c\u044e, \u0442\u043e \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043e\u043a\u043d\u043e \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f:<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/956\/093\/4f6\/9560934f65fc45bd2bb2a7aa802f06d4.jpg\"\/><\/p>\n<p>  \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u043e\u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0444\u0438\u0433 \u0437\u043d\u0430\u0435\u0442 \u043a\u043e\u0433\u0434\u0430 \u0431\u044b\u043b \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u0431\u0443\u0444\u0435\u0440 \u043e\u0431\u043c\u0435\u043d\u0430. \u041d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u2014 \u0436\u043c\u0451\u043c ctrl + alt + v:<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/807\/9fb\/033\/8079fb03328814570d96fc6444c442b4.jpg\"\/><\/p>\n<p>  \u041c\u044b \u0442\u0443\u0442 \u0436\u0435 \u043c\u043e\u0436\u0435\u043c, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u044f\u0441\u044c \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u043a\u043b\u0430\u0432\u0438\u0448\u0430\u043c\u0438 \u0432\u0432\u0435\u0440\u0445 \u0438\u043b\u0438 \u0432\u043d\u0438\u0437, \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c \u0442\u0435\u043a\u0441\u0442. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c, \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u0430 \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0442\u0435\u043a\u0441\u0442 \u2014 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0439. \u041a\u0441\u0442\u0430\u0442\u0438 \u0433\u043e\u0432\u043e\u0440\u044f, \u0432\u043e\u0442 \u0442\u0443\u0442 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u0430\u043d\u043d\u0435\u0435:<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/ea0\/960\/0b7\/ea09600b78b60093ba91694a460c223e.jpg\"\/><\/p>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c, \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0444\u0438\u0447\u0430 \u043f\u0440\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u043d\u0434\u0443\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430)<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0432\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u043d\u0443\u0436\u043d\u044b\u0439 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442\u0435 Enter \u0438 \u0442\u0435\u043a\u0441\u0442 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u0432 \u0442\u0443 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430, \u0433\u0434\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043a\u0443\u0440\u0441\u043e\u0440.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u043e\u043a\u043d\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043a\u0430\u043a \u043f\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 Del, \u0442\u0430\u043a \u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0432\u0435\u0441\u044c \u0431\u0443\u0444\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u043e\u0432; \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0437\u0430\u0434\u0430\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 ctrl + R.<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/947\/61f\/3fc\/94761f3fc09273da4f5aede2c9a2970f.jpg\"\/><\/p>\n<p>  \u041d\u0430\u0436\u0438\u043c\u0430\u044f escape, \u043e\u043a\u043d\u043e \u043f\u0440\u044f\u0447\u0435\u0442\u0441\u044f \u0432 \u0442\u0440\u0435\u0439.<br \/>  \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u044f \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0438\u0441\u043a. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0430\u0434\u043e \u0447\u0442\u043e-\u0442\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0441\u0440\u0435\u0434\u0438 \u0431\u0443\u0444\u0435\u0440\u043e\u0432, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u043e\u0438\u0441\u043a: ctrl + alt + v -&gt; ctrl + f. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0444\u043e\u043a\u0443\u0441 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u043e\u0438\u0441\u043a\u0430. <br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/600\/834\/059\/600834059e42480f36579a1a00a0fba6.jpg\"\/><br \/>  \u0412\u0432\u043e\u0434\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0431\u0443\u043a\u0432, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 Enter -&gt; \u0442\u0435\u043f\u0435\u0440\u044c \u0444\u043e\u043a\u0443\u0441 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0435, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0430\u043c\u0438 \u0432\u0432\u0435\u0440\u0445 \u0438\u043b\u0438 \u0432\u043d\u0438\u0437. \u0415\u0441\u043b\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u0444\u043e\u043a\u0443\u0441 \u0438 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0442\u0435\u043a\u0441\u0442, \u0442\u043e \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 escape \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u043e\u0447\u0438\u0449\u0430\u0435\u0442\u0441\u044f. \u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 escape \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043e\u043a\u043d\u043e.<\/p>\n<p>  \u0412 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0433\u043e. \u041a\u0430\u043a-\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u0438, \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0444\u0438\u0447\u0430. \u041d\u0430 \u0434\u0435\u043b\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0442\u043e\u043b\u043a\u0443 \u043e\u0442 \u043d\u0435\u0435 \u043c\u0430\u043b\u043e. \u041e\u0441\u0442\u0430\u0432\u0438\u043b \u0435\u0435, \u043d\u043e \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u043e\u0441\u0442\u0430\u0432\u0438\u043b 100%:<br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/da2\/d97\/6ab\/da2d976abbc42d932dceb64b025064d1.jpg\"\/><\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043c\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u0435\u043d. \u0412\u0435\u0441\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u0430\u043a \u0435\u0441\u0442\u044c. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0435\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044e, \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a \u043d\u0435\u043c\u0443 \u043f\u043e \u0432\u043a\u0443\u0441\u0443 \u0441\u043e\u043b\u044c\/\u043f\u0435\u0440\u0435\u0446, \u043a\u043e\u0442\u044f\u0442 \u0438 \u0442. \u0434. \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 \u0443 \u043c\u0435\u043d\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u042f \u043d\u0435 \u043f\u0430\u0442\u0435\u043d\u0442\u043d\u044b\u0439 \u0442\u0440\u043e\u043b\u043b\u044c)    \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\/211653\/\"> http:\/\/habrahabr.ru\/post\/211653\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/236\/acf\/4b6\/236acf4b69a69980747d144678d3be75.jpg\"\/><\/p>\n<p>  \u0422\u0430\u043a \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432 \u0442\u0430\u043a\u0443\u044e \u043c\u0440\u0430\u0447\u043d\u0443\u044e \u043f\u043e\u0433\u043e\u0434\u0443, \u043e\u0431\u043b\u043e\u0436\u0438\u0432 \u0441\u0435\u0431\u044f \u0442\u0430\u0431\u043b\u0435\u0442\u043a\u0430\u043c\u0438 \u0438 \u043f\u0440\u0435\u043f\u0430\u0440\u0430\u0442\u0430\u043c\u0438 \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u0443\u0434\u044b \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0442 \u043d\u0435\u0447\u0435\u0433\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0445\u0430\u0431\u0440\u0430-\u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0438 \u0443\u0436\u0435 \u043f\u043e\u0447\u0442\u0438 \u0447\u0442\u043e \u043c\u0435\u0441\u044f\u0446 \u0438\u043c \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c. \u0420\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e windows-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u0431\u0443\u0444\u0435\u0440 \u043e\u0431\u043c\u0435\u043d\u0430 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0437 \u0440\u0430\u043d\u043d\u0435\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u043b\u044e\u0431\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442.<\/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-211653","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/211653","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=211653"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/211653\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=211653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=211653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=211653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}