{"id":28309,"date":"2018-01-09T12:15:47","date_gmt":"2018-01-09T10:15:47","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=28309"},"modified":"2018-01-09T12:15:47","modified_gmt":"2018-01-09T10:15:47","slug":"the-rise-of-the-state-machines","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2018\/01\/09\/the-rise-of-the-state-machines\/","title":{"rendered":"The Rise Of The State Machines"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p><a href=\"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/01\/state-machine.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"28310\" data-permalink=\"https:\/\/mamchenkov.net\/wordpress\/2018\/01\/09\/the-rise-of-the-state-machines\/state-machine\/\" data-orig-file=\"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/01\/state-machine.png?fit=1056%2C501&amp;ssl=1\" data-orig-size=\"1056,501\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"state machine\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/01\/state-machine.png?fit=660%2C313&amp;ssl=1\" class=\"aligncenter size-medium wp-image-28310\" src=\"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/01\/state-machine-500x237.png?resize=500%2C237&#038;ssl=1\" alt=\"\" width=\"500\" height=\"237\" srcset=\"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/01\/state-machine.png?resize=500%2C237&amp;ssl=1 500w, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/01\/state-machine.png?resize=768%2C364&amp;ssl=1 768w, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/01\/state-machine.png?resize=1024%2C486&amp;ssl=1 1024w, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/01\/state-machine.png?w=1056&amp;ssl=1 1056w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p>&#8220;<a href=\"https:\/\/www.smashingmagazine.com\/2018\/01\/rise-state-machines\/\">The Rise Of The State Machines<\/a>&#8221; is a nice introductory article into the domain of process management and state machines.<\/p>\n<blockquote><p>A state machine is a mathematical model of computation. It\u2019s an abstract concept whereby the machine can have different states, but at a given time fulfills only one of them. There are different types of state machines. The most famous one, I believe, is the\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Turing_machine\">Turing machine<\/a>. It is an infinite state machine, which means that it can have a countless number of states. The Turing machine does not fit well in today\u2019s UI development because in most cases we have a finite number of states. This is why finite state machines, such as\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Mealy_machine\">Mealy<\/a>and\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Moore_machine\">Moore<\/a>, make more sense.<\/p>\n<p>The difference between them is that the Moore machine changes its state based only on its previous state. Unfortunately, we have a lot of external factors, such as user interactions and network processes, which means that the Moore machine is not good enough for us either. What we are looking for is the Mealy machine. It has an initial state and then transitions to new states based on input and its current state.<\/p><\/blockquote>\n<p>There are quite a few JavaScript code examples and library references, illustrating the basic concepts and implementation.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>&#8220;The Rise Of The State Machines&#8221; is a nice introductory article into the domain of process management and state machines. A state machine is a mathematical model of computation. It\u2019s an abstract concept whereby the machine can have different states, but at a given time fulfills only one of them. There are different types of &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2018\/01\/09\/the-rise-of-the-state-machines\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">The Rise Of The State Machines<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"The Rise Of The State Machines #WebDev #JavaScript #workflow","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,18,62,1334],"tags":[1139,1330,92],"keyring_services":[],"class_list":["post-28309","post","type-post","status-publish","format-standard","hentry","category-general","category-programming","category-technology","category-web-work","tag-javascript","tag-web-development","tag-workflow"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":15472,"url":"https:\/\/mamchenkov.net\/wordpress\/2011\/09\/06\/bayes-theorem-history\/","url_meta":{"origin":28309,"position":0},"title":"Bayes theorem history","author":"Leonid Mamchenkov","date":"September 6, 2011","format":false,"excerpt":"A fascinating read on the Bayes theorem history: The German codes, produced by Enigma machines with customizable wheel positions that allowed the codes to be changed rapidly, were considered unbreakable, so nobody was working on them. This attracted\u00a0Alan Turing\u00a0to the problem, because he liked solitude. He built a machine that\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26278,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/07\/24\/packer-a-tool-for-creating-vm-and-container-images\/","url_meta":{"origin":28309,"position":1},"title":"Packer &#8211; a tool for creating VM and container images","author":"Leonid Mamchenkov","date":"July 24, 2016","format":false,"excerpt":"With the recent explosion in the virtualization and container technologies, one is often left disoriented. \u00a0Questions like \"should I use virtual machines or containers?\", \"which technology should I use\", and \"can I migrate from one to another later?\" are just some of those that will need answering. Here is an\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":28588,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/05\/19\/pvm-php-process-virtual-machine-for-building-and-executing-workflows\/","url_meta":{"origin":28309,"position":2},"title":"pvm &#8211; PHP Process virtual machine for building and executing workflows","author":"Leonid Mamchenkov","date":"May 19, 2018","format":false,"excerpt":"At some point last year I wrote the blog post titled \"Getting started with workflows in PHP\".\u00a0 I received quite a bit of feedback about it, but, unfortunately, the priorities at work shifted and I haven't done much more with workflows since than. The world, however, hasn't stopped.\u00a0 The tools\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/05\/pizza-process-500x211.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":16526,"url":"https:\/\/mamchenkov.net\/wordpress\/2012\/07\/20\/wp-config-php-and-git\/","url_meta":{"origin":28309,"position":3},"title":"wp-config.php and git","author":"Leonid Mamchenkov","date":"July 20, 2012","format":false,"excerpt":"If you are storing your WordPress changes in git and then deploy the project between different machines (local, test server, production environment, etc), then you are probably familiar with a problem of wp-config.php file. \u00a0WordPress uses it for things like database credentials, which vary from machine to machine. \u00a0But you\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8991,"url":"https:\/\/mamchenkov.net\/wordpress\/2005\/05\/22\/finding-uptime-on-windows-2000-machines\/","url_meta":{"origin":28309,"position":4},"title":"Finding uptime on Windows 2000 machines","author":"Leonid Mamchenkov","date":"May 22, 2005","format":false,"excerpt":"I tried to check the uptime on some of our Windows 2000 servers, but discovered that there is no such command. Neither there is utime or anything alike. Puzzled I turned to Google and found this article. In short, I had to issue net statistics server command. The first line\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":12267,"url":"https:\/\/mamchenkov.net\/wordpress\/2010\/03\/19\/copy-ssh-key-to-remote-machine\/","url_meta":{"origin":28309,"position":5},"title":"Copy SSH key to remote machine","author":"Leonid Mamchenkov","date":"March 19, 2010","format":false,"excerpt":"Those of us who use secure shell (SSH) for logging in to remote machines, already know about key authentication, which is so much easier and sometimes more secure than password authentication.\u00a0 We also know that in order to make it work you need to: generate a pair of keys with\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/28309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=28309"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/28309\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=28309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=28309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=28309"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=28309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}