{"id":216059,"date":"2014-03-17T11:40:03","date_gmt":"2014-03-17T07:40:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=216059"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=216059","title":{"rendered":"<span class=\"post_title\">iToilet. \u041e\u0444\u0438\u0441\u043d\u044b\u0439 \u0442\u0443\u0430\u043b\u0435\u0442 \u0441\u0432\u043e\u0431\u043e\u0434\u0435\u043d<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/a28\/0c3\/e0a\/a280c3e0a2f5e60239b036b387bc989d.png\"\/><br \/>  <a name=\"habracut\"><\/a><br \/>  \u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<br \/>  \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 Serg Krivoblotsky \u0438 \u044f <s>\u0430\u043b\u043a\u043e\u0433\u043e\u043b\u0438\u043a<\/s> iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u042f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u0438\u0435\u0432\u0441\u043a\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 iOS \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438 \u0434\u0438\u0437\u0430\u0439\u043d\u0435 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u00ab\u041b\u044e\u0431\u0438 \u0442\u043e, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0448\u044c \u0438 \u0434\u0435\u043b\u0430\u0439 \u0442\u043e, \u0447\u0442\u043e \u043b\u044e\u0431\u0438\u0448\u044c\u00bb, \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u0443 \u043d\u0430\u0441. \u0414\u0435\u043b\u0430\u0435\u043c. \u041b\u044e\u0431\u0438\u043c.<\/p>\n<p>  \u0418\u0434\u0435\u044f \u0435\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0445 \u0445\u0430\u043a\u0430\u0442\u043e\u043d\u043e\u0432 \u043f\u0440\u0438\u0436\u0438\u043b\u0430\u0441\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u0438\u0432\u0435 \u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u043e. \u0420\u0430\u0437 \u0432 \u043c\u0435\u0441\u044f\u0446, \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430, \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439, \u043f\u0440\u043e\u0441\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0434\u0435\u0439, \u0438\u043b\u0438 \u043f\u043e\u0435\u0434\u0430\u043d\u0438\u044f \u043f\u0438\u0446\u0446\u044b. \u0417\u0430\u0434\u0430\u0447\u0438 \u0431\u044b\u0432\u0430\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u0435: \u043e\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e planning poker&#8217;\u0430, \u0434\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0446\u0435\u043d\u044b \u043d\u0430 \u0447\u0435\u043a\u0435 \u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0432 \u043d\u0430\u0446. \u0432\u0430\u043b\u044e\u0442\u0443. \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u2014 \u043d\u0435 \u0437\u0430\u0440\u0435\u043b\u0438\u0437\u0438\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442, \u0430 \u0441\u043a\u043e\u0440\u0435\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f, a.k.a MVP, \u043a\u0430\u043a \u0445\u043e\u0442\u0438\u0442\u0435.<br \/>  \u041e\u0431 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0438\u0434\u0435\u0439 \u0438 \u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u044f \u0431\u044b \u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 \u043a\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 co-working&#8217;\u0435, \u0438\u043b\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043e\u0444\u0438\u0441\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u0442\u0430\u043a\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0441\u0432\u043e\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439:  <\/p>\n<ol>\n<li> \u041f\u043e\u0434\u0445\u043e\u0434\u0438\u0448\u044c \u043a \u0442\u0443\u0430\u043b\u0435\u0442\u0443<\/li>\n<li> \u0423\u043f\u0441, \u0437\u0430\u043d\u044f\u0442\u043e<\/li>\n<li> \u0418\u0434\u0435\u0448\u044c \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u043c\u0435\u0441\u0442\u043e. <\/li>\n<li> \u0416\u0434\u0435\u0448\u044c \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u0441\u044f. <\/li>\n<\/ol>\n<p>  \u0415\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u2014 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0411\u044b\u043b\u043e \u0431\u044b \u0443\u0434\u043e\u0431\u043d\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0441\u044c \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043c\u0435\u0441\u0442\u0435 \u044f \u0443\u0436\u0435 \u0437\u043d\u0430\u043b, \u0437\u0430\u043d\u044f\u0442 \u043b\u0438 \u0442\u0443\u0430\u043b\u0435\u0442 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u043c\u043d\u0435 \u0442\u0443\u0434\u0430 \u0438\u0434\u0442\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/09e\/935\/925\/09e935925dfad1d8cb666b4c361d5e09.png\"\/><br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/c6c\/93f\/f65\/c6c93ff65f4b1bce410f823f6abcc58c.png\"\/><\/p>\n<p>  \u0427\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e:  <\/p>\n<ul>\n<li>\u0414\u0430\u0442\u0447\u0438\u043a \u0441\u0432\u0435\u0442\u0430. (\u0421\u0432\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d == \u0442\u0443\u0430\u043b\u0435\u0442 \u0437\u0430\u043d\u044f\u0442)<\/li>\n<li>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0435 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f. <\/li>\n<li>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 PHP \u0438 Objective C. <\/li>\n<\/ul>\n<p>  <b>\u0411\u044b\u043b\u043e \u043a\u0443\u043f\u043b\u0435\u043d\u043e: <\/b><\/p>\n<ol>\n<li>PCduino<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/6da\/843\/0b6\/6da8430b63af12b27dfb48b564595218.png\"\/><\/li>\n<li>\u0421\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0439 \u0434\u0430\u0442\u0447\u0438\u043a \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u0438<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/0da\/f01\/43e\/0daf0143ef4d1e64b32f8b23e980a24d.png\"\/><\/li>\n<li>\u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u0432 \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u043e\u0432<\/li>\n<\/ol>\n<p>  <b>\u0425\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u044b:<\/b><br \/>  \u041a\u043e\u0434\u0430 \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0443, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u043f\u043e\u043d\u044f\u0442\u0435\u043d \u043a\u0430\u043a hello world. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 Github.<\/p>\n<ol>\n<li> \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0434\u0430\u0442\u0447\u0438\u043a \u043a pcduino:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/8db\/96b\/0e5\/8db96b0e5e21617a5d8ef1556d063af7.png\"\/><br \/>  \u0414\u0430\u0442\u0447\u0438\u043a \u0432\u0435\u0440\u043d\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 0..4096. <br \/>  \u042d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0443\u0442\u0435\u043c \u0431\u044b\u043b\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e, \u0447\u0442\u043e \u043d\u0430\u0448\u0430 \u043b\u0430\u043c\u043f\u043e\u0447\u043a\u0430 \u0432 \u0442\u0443\u0430\u043b\u0435\u0442\u0435 \u0432 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0432\u044b\u0434\u0430\u0435\u0442:<br \/>  &gt;3400 \u2014 \u0442\u0435\u043c\u043d\u043e\u0442\u0430<br \/>  &lt;3400 \u2014 \u0441\u0432\u0435\u0442  <\/li>\n<li> \u041f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c apache. (\u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0443\u0434\u0430 ubuntu \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438).<\/li>\n<li> \u041f\u0438\u0448\u0435\u043c \u043a\u043e\u0434 \u043d\u0430 php \u0434\u043b\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u0439 (\u0432\u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 GitHub):\n<pre><code>$this-&gt;port = (isset($_GET[&quot;port&quot;]) && is_numeric($_GET[&quot;port&quot;])) ? $_GET[&quot;port&quot;]:2; $this-&gt;data = exec(&quot;cat \/proc\/adc&quot;.$this-&gt;port);<\/code><\/pre>\n<\/li>\n<li> \u041f\u0438\u0448\u0435\u043c API \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445, \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e, \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432:<br \/> \n<pre><code>        $this-&gt;answer(array(             'light_value' =&gt; (int)$this-&gt;data,             'light_status' =&gt; (bool)$l_status,             'light_change' =&gt; (int)$l_change,             'sensor_status' =&gt; true         ));<\/code><\/pre>\n<\/li>\n<li>\u041e\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u043f\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043b\u044e\u0431\u044b\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c:<br \/>  OSX:<br \/> \n<pre><code>    NSURL *toiletURL = [NSURL URLWithString:kToiletURLString];     NSError *requestError = nil;     NSData *responseData = [NSData dataWithContentsOfURL:toiletURL options:NSDataReadingUncached error:&requestError];<\/code><\/pre>\n<p>  iOS:  <\/p>\n<pre><code>    NSURL *url = [NSURL URLWithString:urlString];     NSURLRequest *request = [NSURLRequest requestWithURL:url];     \/\/Send NSURLSession dataTask     [self sendRequest:request withCompletion:completion]; <\/code><\/pre>\n<p>  <\/li>\n<li>\u041f\u043e\u0441\u0442\u0438\u043c notification:<br \/> \n<pre><code>[self.notificationController deliverNotificationWithTitle:kBusyNotificationText andText:notificationText]; <\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  \u2026 \u0412 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e \u044d\u0442\u043e \u0438 \u0432\u0441\u0435 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e. \u041f\u043e\u0437\u0436\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043b\u044e\u0448\u0435\u043a \u0432 \u0432\u0438\u0434\u0435 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0435\u0439\u0448\u043d\u044b.<br \/>  <b>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/b><br \/>  OSX:<br \/>  <iframe loading=\"lazy\" width=\"560\" height=\"349\" src=\"\/\/www.youtube.com\/embed\/UCWMOrLL4co?wmode=opaque\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>  iOS<br \/>  <iframe loading=\"lazy\" width=\"560\" height=\"349\" src=\"\/\/www.youtube.com\/embed\/lsY08fB-Fw0?wmode=opaque\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>  <b>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0445\u0430\u043a\u0430\u0442\u043e\u043d\u0430:<\/b><br \/>  OSX:<br \/>  <a href=\"https:\/\/github.com\/Krivoblotsky\/iToilet-Mac-OS\">github.com\/Krivoblotsky\/iToilet-Mac-OS<\/a><\/p>\n<p>  iOS<br \/>  <a href=\"https:\/\/github.com\/Krivoblotsky\/iToilet\">github.com\/Krivoblotsky\/iToilet<\/a><\/p>\n<p>  PHP:<br \/>  <a href=\"https:\/\/github.com\/Krivoblotsky\/iToilet-PHP\">github.com\/Krivoblotsky\/iToilet-PHP<\/a><\/p>\n<p>  <a href=\"http:\/\/twitter.com\/Krivoblotsky\"><a href=\"http:\/\/habrahabr.ru\/users\/krivoblotsky\/\" class=\"user_link\">Krivoblotsky<\/a><\/a>    \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\/216059\/\"> http:\/\/habrahabr.ru\/post\/216059\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/a28\/0c3\/e0a\/a280c3e0a2f5e60239b036b387bc989d.png\"\/>  <\/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-216059","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/216059","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=216059"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/216059\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=216059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=216059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=216059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}