Code()
For jData on the cloud, MongoDB is mainly used for persistence mainly due to the fact that its support for schema-less structure, rich indexing for query support, and scalability. While each jNode on the fog has their own Redis instance running, analytics is done on a centralized persistence data in MongoDB on the cloud. While Redis can be used as a database on its own, it is limiting for it to be used as a centralized database on the cloud since it is in-memory database, RAM size is a condition to be considered and meanwhile analytics in Lua might be tedious. However, in the architect, there is still an instance of Redis running on the cloud jNode for caching.
During our development of Settlers of Catan, we met a subfunction level problem of synchronizing a dice and read the dice result based on the face exposing up.
For example, given two dices in the following positions. You need to detect the facial values of the dices.
The number is printed in console.
The Settlers of Catan, sometimes shortened to just Catan, is a multiplayer board game designed by Klaus Teuber and first published in 1995 in Germany by Franckh-Kosmos Verlag (Kosmos) as Die Siedler von Catan. Players assume the roles of settlers, each attempting to build and develop holdings while trading and acquiring resources. Players are rewarded points as their settlements grow; the first to reach a set number of points, typically 10, is the winner. The game and its many expansions are also published by Mayfair Games, Filosofia, Capcom, 999 Games, Κάισσα, and Devir. -- Wikipedia
Our Catan Gaming System(CGS) will be based on Server-Client architecture. CGS is based on Unity engine, and since Unity’s networking is integrated into the engine and the editor, it is redundant to treat Server and Client as different executables like how a traditional Server-Client architecture would. In our design, we are treating the entire CGS as one executable, and within the executable there are Server and Client components. An overview structure of our executable is shown here:
Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs. (Definition on its homepage http://www.slimframework.com/)
Here you can have a taste of it :)
<?php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
require 'vendor/autoload.php';
$app = new \Slim\App;
$app->get('/hello/{name}', function (Request $request, Response $response) {
$name = $request->getAttribute('name');
$response->getBody()->write("Hello, $name");
return $response;
});
$app->run();
I just got introduced to Slim Framework recently, and speaking frankly it is not a good experience working with it and the poor community is nothing like npmjs, which is a place where I hang around most of the time. All the tutorials online are mostly theory-based and really not organized, some of them don't even run properly.
When I joined Business Process and Information Technology Department of Baidu.inc, I was assigned to a team which was responsible for a development of the Internet giant's ERP system. During my service at the company, I was amazed by the amount of efficiency improvement owning to process management software. Meanwhile, there exists such a similarity between Redux, which is a functional programming based framework suggested by Facebook, and ERP process management.
Redux is a Javascript library that is based on concept of Flux, which provides a great framework to maintain state management (it plays a crucial role combining with React.js which renders JSX based on state-change). Following diagram illustrates a simple paradigm.