Read Reconfigure Online

Authors: Epredator,Ian Hughes

Tags: #Sci-Fi & Fantasy

Reconfigure (7 page)

BOOK: Reconfigure
7.04Mb size Format: txt, pdf, ePub
ads
Chapter 6 - RC UI

 

For Roisin talking to RC, so far, had been via the Web interface for Twitter. The Direct Message box posted the text across the Web into the servers at Twitter, and popped out at RC. Roisin had no idea if RC was screen scrapping the Web page, tapped into the Twitter API or having a well trained monkey retype everything for it. Either way the Web response came back to a RESTful webpage. It was not really any different to the very origins of the Web. POST and GET methods had been the same for years, a URL and a payload of data. It is asynchronous, unless the other end shakes hands using cookies, identifiers or other flags. Stuff just happens to look like it is realtime but in reality it is two distinct request/response attempts to a server. Each means something to each end of the conversation in context. Context is everything. Roisin checked the Twitter API documentation. She was pleased to see there was a section called User Streams. It looked as if she could open a more direct connection to any user via this API. It was as close to a remote terminal as Roisin could get at the moment. Unless she found another way into RC? It seemed odd that something this powerful would only talk via Twitter, but hey! Even the omnipotent want to join in on comedy hashtags like #filmswithfruitandveg, Tweeting, “A Fistful of Carrots”, “The PeaPodFather”, “Potato Blight Club” and alike. She couldn’t help it, even thinking about these quirky hashtag storms, of shared corny comedy lines, made her want to join in and think of some more.

Like any system she had built before, for herself, she had a good starting requirement. A solid idea that she needed at the core. To enable a more direct and live continuous data flow with RC. The non-functional requirements were less obvious, or less in her control. Some of this would only be under the control of the conduit services she was using. Security and accessibility she could manage partly at her end, any downtime would all be outside her influence. She had an idea of the sort of usability improvements she was heading towards. Number one, NO CLI! That was her goal. She liked to have a spirit or core for a project. She was extrapolating the concept to a much loftier end experience in her mind. She was thinking of a meta Minecraft or a real world OpenSim. Virtual worlds are altered and interacted with by their users, with the visual tools provided. If she could get a decent connection to RC she could make the next layer of abstraction, from CLI to a visual 3D environment. Roisin felt another shudder of excitement as she took the idea further and mentally zoomed through the possible futures this all hinted at. It was not a totally clear vision. It was like a misty shimmering haze in her mind with sparkling gems floating around at the very edges of her thoughts. She knew from playing so many exploration games that this ‘Fog of War’ could only be cut through by visiting the places, or sending out probes to map the areas. Right now she felt she was about to set out on a long journey of discovery. The last few hours she had been just strolling around smelling the wild flowers. She smirked to herself as she thought of all those free roaming sandbox games she loved. No matter how tough the lead character was, they always ended up collecting wild flowers for some odd game mechanic. Now, to keep her gaming analogy, she was going to build a vehicle to help her reach out further. Whilst this first stage was inventing the wheel, she knew that once she had the basic building blocks she would be building a veritable kick ass Warthog APC in no time.

Picking a language to write code in may have been straight forward once upon a time. Roisin had learned a good few at college and written in even more out in the real world. There were literally hundreds of languages to choose from. “Do you know C++?” or “PHP experience?” would litter many a conversation as she pitched for work on various projects. Back in the day she had known that people just specialised in one language, that was it. The Web and the explosion of open source meant every woman, man, dog and their grumpy cat were creating new languages or extensions to languages. Class libraries, helper routines and the most annoying, the API stub littered the digital landscape. Repositories were full of half done pieces of code. Still, if ever Roisin needed anything new she would always check first before ploughing into writing custom code. What was the point if it was already done and working? She had become increasingly wary of other peoples libraries. They often did the simple stuff really well, then so did everything else. She would get excited seeing a function described like ‘Solve fast Fourier transform’ and then see the code comment ‘//TO DO’ at the difficult bit. She was fairly certain there wouldn’t be a handy terminal layer abstraction to Twitter Direct Messages. Primarily because, well, why would you need one? She started to feel a slight paranoia. If she was too specific in asking or searching for help she might give the game away. Not that she was doing anything wrong? Yet? Being able to reconfigure the World started to worry her, especially if lots of people might end up doing it. She tried an abstract Google search. She looked for ‘Terminal Emulation on Twitter.’ All she got back were either Tweets about terminal emulation, which to be fair was what the question could have sounded like in a different context, and the odd terminal emulator product, that had a Twitter account itself.

She was back to deciding what language to write in, and where to run it. Ideally she was aiming for a mobile solution. Whilst she could Zone anything from anywhere, such as her breakfast Marmite, she figured that line of sight was going to be easier to deal with. She could easily cause unintended harm, working at distances not being able to observe the full impact. She didn’t want any of that to worry about. Her preference was to use the game development engine Unity3D. Roisin liked its workflow and approach. Also its model of 3D environments seemed to fit pretty well her RC interactions so far. Translation and Transformations were all the same principles. She hoped that she could use the engine to represent the objects in space and also make streaming connection requests to RC from it. Another bolt of inspiration almost set light to her hair with the buzz of electric excitement it caused. If she could do that she could also make it a full blended reality application. Mixing a camera feed of the visible world and the deeper instrumentation of everything on the planet? Step aside gaming headsets she thought. Your demos may have seemed like the killer app for blended reality, or mixed reality, or augmented reality, or whatever the flavour of the day was, but this?

“Now this Death Star is the ultimate power in the Universe! Aaaaand breathe!” She said. Roisin had got a little carried away with herself, again! She had not written any code. Fancy extra requirements were not getting her anywhere near to solving the basic problem. That’s decided! Unity3D it is, she mentally confirmed. She sparked up the environment with a click on the cartoon cube logo. Did she want to start a new project or load an existing one? New project of course. She typed ‘Full Metal Marmite’. Project names were never a problem for Roisin. She simply picked some recent events and mixed them with some other media like a film or a book. She thought of a bootcamp and how, now, she was going to make the transition into the field. She considered starting a hashtag on Twitter #filmswithyeast, she could then choose another project name from the comedy gold that would come in. This project was on the down-low so FMM it was.

Twitter didn’t have a mainstream C# client example. Java, C++, Javascript for Node.JS, Go and more all were supported. She had actually found a proper, apparently complete, implementation of C# for Twitter for a previous project. Her project hadn’t gone anywhere but she had started to look at it. She found the module she had written when exploring the C# version. It was great to have already written the OAuth authentication connection, the read a timeline and then disconnect, pieces of code. Those had been for a traditional RESTful connection but it was very easy to swap out for the User Stream constant connection. In the code she kept the connection alive and didn’t destroy the class instance variables straight away. Rather than the ‘Update()’ being used to look for changes, the underlying connection was keeping a constant flow of information to and fro with the Twitter DM. She had to code the responses to the events that occurred with the correct message handling routines. The messages that indicated data responses were the most important. The connect, disconnect, error, stall etc. were less important to her right at this moment. A JSON message, encoded and delivered to a string array was what she was after. She started just dumping that to the console log. She made a mental note to think about the parsing structure, and how to relate that to a 3D world, next. The whole design ethic was ‘NO CLI!’ For now text was going to have to be the vehicle to test with. There was something different about a nice shiny user interface entry field with delicate round corners and drop shadow, to the blinking terminal cursor of an emulator. She knew she was kidding herself, but it felt like progress. She wrote a function to accept a string, and send the message to the Twitter stream, that she would be connected to when all this wiring and configuration was complete.

After about forty-five minutes of tappety tap tapping, pausing only to mentally tick off tasks, she had the first pass done. FMM v0.1 alpha was ready to run. She had done her usually trick in that all the major variables were wildly public. As she attached the script on the main stage to her invisible ‘MyController’ object, the inspection panel on the right lit up, listing everything that was or could be set. It included little triangle twisties offering expansion of the more complex object structures.

When she had tested her previous C# version she had set up a Twitter App ID on the site and generated all the secret and public key strings she had needed. Just to be sure, she created a brand new app. She called the app DrillInstructor in keeping with the FMM theme. She liked the idea that this would be barking orders at RC. She riffed again, thinking both parts out loud. “How tall are you private RC?”, “5 fractal levels sir!”,”5 fractal levels? I didn’t know they stacked Marmite that high!"

She copied the individual key strings from the API webpage and dropped them directly into her code. Whilst she performed these she sang to herself “I wanna be your drill instructor.” Tune!

The code inspector panel rippled with the changes as she hit save in the text editor. She now had a mostly blank stage on screen, save for a single text entry field looking all lonesome. She clicked the run button and the development environment swapped to the runtime view with the unlabelled, but very nice looking, entry field slightly off centre on the screen. The log file showed a stream of debug statements as Roisin had pretty much debug logged every operation. A good thing to do if you are going to start any project but particularly one that could make the Universe disappear! Connection to the stream looked good. There were no funny error messages from Twitter. She typed into her new text box.

“ls”

She gazed at the console window, not a glimmer of a response, not the slightest indication she had actually sent anything. She was expecting several ‘Got ls’, ‘Passed ls’, ‘Processed string’ and other short distinct messages from her code, but nothing! Every programmer knows this feeling. Roisin knew this feeling too well. Whilst quick and instinctive with her coding she did occasionally, (by occasionally she was deluding herself as it was almost every time at some time in a project), forget to call the functions she had written. Non tech geeks do this all the time too. Put water in the kettle and forget to turn it on, bread in a toaster but not started toasting, not plugging the phone in to charge overnight. She had written the routine to take the text, she had placed the field to collect it, but she had not got the field to call the routine. She hit stop, said “Doh!” She then rectified the situation. Sure enough there was no function being called from the ‘OnEnter’ on the input field. She selected her function AskRC() in the entry field configuration panel to lock it in place. Roisin realised that she might get a whole load of DM information back in any request, a history of the entire conversation. She made sure that the initial connection did not get all the DM’s up to the limit, but only new responses. She also stripped all the JSON to only look for ‘sender_screen_name’ and associated text. These messages tend to have a massive payload of metadata that she really didn’t want to bother with. Having checked the documentation she was happy she had the right string stripping going on. She hit run again and typed into her entry field.

“ls”

This time the console lit up once the connection stream had been made. Amongst all her debug noise she saw.

 

"sender_screen_name": "rayKonfigure",

"text": “Cap,Chair,Coin,ComputerDevice1,ComputerDevice2,Human,Phone,Power,Table"

 

Result! She gave a woot of excitement and a mini air punch. Working code pleased Roisin. A little shot of adrenaline hit her. Mastering the combination of multiple systems to do what she wanted had an emotional pay off. She stopped her self congratulation, as she realised she had overlooked something. Roisin looked at the list of items in the debug. In all the ‘CapCoin’ experimentation she had not reset the Zone to its default. It was still the zoomed in, on a smaller area. There were no walls, doors or windows in the comma delimited list back from RC.

The next test was to try another command to reset it, so she typed.

“Zone -R”

On screen she saw in her debug some confirmation.

 

 "sender_screen_name": "rayKonfigure",

 "text": “Zone set Human <4.0,4.0,4.0> <1.0,1.0,1.0>”

 

Another woot! She had sent a higher level command and it had also worked. Roisin now had a streaming open channel running in an environment she could work on. She could manipulate the ‘text:’ string as it came back. It would be baby steps to start off with. It was a response format designed, she assumed something had designed it anyway, to be human readable. It was now being squashed into the DM payload and she wanted it to be machine readable again. She also did not have the data format documentation, or any document of understanding or arrangement with RC, the provider of the data. It wouldn’t be the first time the other end formats she was using had the potential to be all messed up. Other programmers in companies had a knack for making small adjustments to their data formats in the name of progress. They didn’t seem to understand the adage, ‘There is no such thing as a small change’, that she knew so well. Every single bit, every one or zero in a computing system, carries an equal weight in being able to completely foo-bar the entire thing. Changes rippled and had consequences. It was sometimes a wonder with the ‘patch ahoy’ culture that anything ever worked? Roisin would be careful, but she did wonder how her small changes to the World, like CapCoin, might have consequences she did not intend. A depressing thought, snap out of it Roisin!

BOOK: Reconfigure
7.04Mb size Format: txt, pdf, ePub
ads

Other books

Don't Forget Me! by R.L. Stine
The Trial by James Patterson
Village Secrets by Shaw, Rebecca