Posts

Showing posts from December, 2015

How to implement board games by Swing

Image
Overview Programming games could be super complicated, just imagine how fancy the scenes you can see in the Counter-Strike are, how sophisticated the weapon facilities are available in the Warcraft. However, on the flip side, building a game based on computer can also be reasonably easy and entertaining. Board games come into this category, in this article, I am going to use Java Swing to build a simple board game involved with board, layout and pieces, etc, which can serve as the entry level game programming that certainly paves the way to more advanced stages of game programming. Of note, Java Swing gains massive performance improvements in recent years due to the optimisations across multiple levels. The game rules and illustrations Game Board: There are two players, for each player there are three pieces. There are four borderlines forming square of the board; one horizontal line, one vertical line and two sloped lines are crossed at the centre point on the board.

A trick for connecting spring security oauth2 and wso2 api manager

Image
Overview Wso2 api manager is a popular APIs gateway acting as a facade of a bunch of APIs residing on the certain backend server. API manager can be an independent server connecting the real backend. By leveraging the API manager, the api services are free from the burdens of some non-business logic such as scalability, security and analytics. More info: http://wso2.com/api-management/try-it/ On the flip side, spring security oauth2 lies in the client side of APIs service, api consumers can naturally build the client based on spring security oauth2 library in that wso2 api manger follows the principles of OAuth2 to secure all API calls. More info:  http://projects.spring.io/spring-security-oauth/ In this article, I will demonstrate the basic steps to bridge a client based on spring-security-oauth2 to the api server side that's governed by the wso2 api manager. Moreover, there is a small trick to ensure the connection in-between really working. Prerequisite