{"id":1210,"date":"2010-02-28T17:17:37","date_gmt":"2010-03-01T01:17:37","guid":{"rendered":"https:\/\/mathpirate.net\/log\/?p=1210"},"modified":"2010-02-28T17:17:37","modified_gmt":"2010-03-01T01:17:37","slug":"serialization-ftw","status":"publish","type":"post","link":"https:\/\/mathpirate.net\/log\/2010\/02\/28\/serialization-ftw\/","title":{"rendered":"Serialization FTW!"},"content":{"rendered":"<p>NXC has a basic serializer.<\/p>\n<p>Flatten(obj) gives you a &#8220;string&#8221; representation of the item you pass it.<\/p>\n<p>UnflattenVar(str, obj) will take the &#8220;string&#8221; and turn it into an object.<\/p>\n<p>I put &#8220;string&#8221; in quotes, because it&#8217;s really just bytes, so you&#8217;re not getting a text representation of the object, it&#8217;s just moving a byte array around.\u00c2\u00a0 Still, it&#8217;s very useful.\u00c2\u00a0 It&#8217;s letting me pass a small packet to the NXT with one Bluetooth message, instead of three.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NXC has a basic serializer. Flatten(obj) gives you a &#8220;string&#8221; representation of the item you pass it. UnflattenVar(str, obj) will take the &#8220;string&#8221; and turn it into an object. I put &#8220;string&#8221; in quotes, because it&#8217;s really just bytes, so you&#8217;re not getting a text representation of the object, it&#8217;s just moving a byte array [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[125,7],"tags":[15,20,128],"_links":{"self":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts\/1210"}],"collection":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/comments?post=1210"}],"version-history":[{"count":2,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts\/1210\/revisions"}],"predecessor-version":[{"id":1212,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts\/1210\/revisions\/1212"}],"wp:attachment":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/media?parent=1210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/categories?post=1210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/tags?post=1210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}