Issue 42 - December 2015 - Today Software Magazine

Page 1

Nr. 42 • www.todaysoftmag.ro • www.todaysoftmag.com No. 36••December June 2015 2015 • www.todaysoftmag.ro • www.todaysoftmag.com

TSM

Download from

T O D A Y S O F T WA R E MAG A Z I NE

Windows Store

Real-Time Web-Chat Using LeapMotion and SignalR

IoT: from device to cloud

M E R R Y

C H R I S T M A S

Cluj IT Days 2015 Quality Assurance 101 ECMAScript 6 - why and how to use it today Zero to RESTful in 4 easy steps

Taxes on buildings – what to expect in 2016? Seven Myths About Work That Are Bad for Your Brain Challenges for companies in 2016



6 Cluj IT Days 2015 Ovidiu Măţan

8 How to Web Startup Spotlight Irina Scarlat

12 Real-Time Web-Chat Using LeapMotion and SignalR George Rus and Daniela Fati

16 IoT: from device to cloud Leonard Pitu

19 ECMAScript 6 - why and how to use it today Adrian Ulici

23 Quality Assurance 101 Vasile Selegean

28 Zero to RESTful in 4 easy steps Georgiana Gligor

31 Taxes on buildings – what to expect in 2016? Ioana Costea

33 Seven Myths About Work That Are Bad for Your Brain Steelcase Team

35 Challenges for companies in 2016 Ana-Maria Trifan


editorial

A Ovidiu Măţan

ovidiu.matan@todaysoftmag.com Editor-in-chief Today Software Magazine

t the end of the year, we conclude by a short review of our activity throughout the year 2015. We are glad to notice that the popularity of our magazine is increasing, as it is proven by the release events, attended by more and more people. The number of online views is over 12.000 sessions per month. Moreover, the interest has increased also form the part of the programmers, who send their article proposals. In respect to Cluj IT Days, the event organized towards the end of the year, which somehow crowns the activity carried on during the entire year, has been appreciated as a success. The analysis of the feedback given to us by the public proves this fact, but at the same time it has pointed to the necessity of optimizing some aspects related to the organization of events of this type. A first article of this type reveals precisely the echo this event has had among the participants. Regarding the unfolding of the release of this issue, we are introducing something new – as we no longer have patience till 2016 – the live broadcasting of the release event on our YouTube channel. This way, you will be able to join us even if you are not in Cluj and you have the opportunity of asking us questions. It is also in this issue that we are launching a new column dedicated to novelties in the IT industry. Our future plans include the introduction of some permanent columns that will tackle software languages and technologies. This will be achieved by creating some groups of specialists who will be able to collaborate and draw specific reviews. The surprise will come at the 2016 edition of Cluj IT Days, when we are planning to publish a few books containing the articles published in the magazine during the year.

Ovidiu Măţan

Founder of Today Software Magazine

4

nr. 42/2015, www.todaysoftmag.com


Authors list Editorial Staf Editor-in-chief: Ovidiu Mățan ovidiu.matan@todaysoftmag.com

Ovidiu Măţan ovidiu.matan@todaysoftmag.com Editor-in-chief Today Software Magazine

Irina Scarlat

Graphic designer: Dan Hădărău dan.hadarau@todaysoftmag.com Copyright/Proofreader: Emilia Toma emilia.toma@todaysoftmag.com

Accountant : Delia Mircea delia.mircea@todaysoftmag.com Web developer: Alexandru Diniș alexandru.dinis@todaysoftmag.com Marketing and tehnoredactor: Ana-Maria Bivol anamaria.bivol@todaysoftmag.com Printed by Daisler Print House

QA Officer @ISDC

irina.scarlat@howtoweb.co

Răzvan Ariciuc razvan.ariciuc@yonder.com

PR Manager @ How to Web & TechHub Bucharest

QC engineer @ Yonder

Robin Molnar

Translator: Roxana Elena roxana.elena@todaysoftmag.com

Vasile Selegean vasile.selegean@ isdc.eu

robin.molnar@3pillarglobal.com

Georgiana Gligor gb@tekkie.ro

QA Engineer @ 3Pillar Global Blog @ robintel.ro

Owner @Tekkie Consulting

George Rus George.Rus@yardi.com

Ioana Costea ioana.costea@ aiconsulting.ro

Software Developer @ Yardi România

Daniela Fati Daniela.Fati@yardi.com Software Developer @ Yardi România

Bookkeeper Managing Partner @ A&I Consulting

Adrian Ulici Adrian.Ulici@3pillarglobal.com Software Engineer @3Pillar Global

Made by

Today Software Solutions SRL str. Plopilor, nr. 75/77 Cluj-Napoca, Cluj, Romania contact@todaysoftmag.com

Leonard Pitu leonard.pitu@siemens.com

Ana-Maria Trifan anamaria.trifan@happy-employees.eu

Senior Key Expert/Research Engineer @CT RTC ELE ELD-RO @ Siemens

PR & Custumer Care Specialist @ Azimut Happy Employees

www.todaysoftmag.com www.facebook.com/todaysoftmag twitter.com/todaysoftmag ISSN 2285 – 3502 ISSN-L 2284 – 8207

Copyright Today Software Magazine Any reproduction or total or partial reproduction of these trademarks or logos, alone or integrated with other elements without the express permission of the publisher is prohibited and engage the responsibility of the user as defined by Intellectual Property Code www.todaysoftmag.ro www.todaysoftmag.com

www.todaysoftmag.com | nr. 42/december, 2015

5


event

Cluj IT Days 2015

C

luj IT Days 2015 has become a reference event for the IT community in Cluj. We had more than 320 participants who, during the two days, were able to attend high quality technical presentations and prove our innovation capacity, but also that of integrating the latest technologies in our current projects. For this review article, we have decided to publish the article posted by Robin Morar on his blog, article which we have discovered by chance, after the event. Just like in any other multi-disciplinary and multi-technologic event, some presentations were very interesting for me, others not, some were more interactive, others more static… The most important thing, however, is the fact that: 1. I had access to technologies which otherwise I wouldn’t have had access to. 2. I had access to a few ideas which, in other circumstances, I would have found out only if I had paid for them, after months or years of work. Ideas and information on the processing of a great number of messages per second using Microsoft Azure, or on how to automatize a smart house. I found out that my generation, the Y generation, only has 39% chances of changing the world, while the new generation, generation Z, has 60% chances of changing the world or, more important to me, what problems you can encounter in automated testing and performance testing and especially why.

3. I found particularly useful Peter Lawrey’s presentation on Low Latency in Java 8. It has been many years since I met anyone to deal with bytecode on such a level. Basically, the man teaches you to do what the first programmers used to do very often: having little memory and few CPU cycles, they used to optimize their code to the maximum. If it seems to you that nowadays we do not need this anymore, then you really have to attend a presentation by Peter Lawrey, in order for you to understand what you do not understand now. Great presentation, delivered by a hacker in the old fashioned meaning of the word. 4. I played with Oculus Rift2, with another virtual reality headset from HTC, I can’t remember the model right now, and the extremely detailed game was built by Exosyphen Studios. I play Fallout 4, a very detailed game, but what these people have done is even more detailed! I drank coffee made by a robot named Baxter, I played

with Vector Watch and different devices with Windows 10, from Lenovo and not only, I stared at 3D printers and learned how to program some of them… 5. Though it was tiring and noisy, it was worth participating in Cluj IT Days. I lived new experiences, tried new stuff, got into contact with new technologies. It was a novelty!

Source: http://www.robintel.ro/blog/tech/cluj-it-days-2015/

6

nr. 42/december, 2015 | www.todaysoftmag.com

Robin Molnar

robin.molnar@3pillarglobal.com QA Engineer @ 3Pillar Global Blog @ robintel.ro


TODAY SOFTWARE MAGAZINE

Future plans and statistics We are thankful, first of all, for the feedback given, which is very useful for planning Cluj IT Days in 2016. In the next edition, we would like to have a Hands on Lab track, where the presentations be at least one hour long. We would like one of the tracks to be carried out in English. From the perspective of the organizers, the main novelties and challenges of this edition were: • carrying out the two parallel tracks; • creating a gadget show area within which the partners could display their latest novelties and achievements; • restructuring the entire agenda, so that we no longer have to deal with the problem of exceeding the allotted time; • recording the entire event professionally and posting it and the slides on the site.

Overall, how would you rate the quality of the event?

A project we will try to carry out in 2016 is the publishing of specialized books. It will be based on articles published by different technical groups: Java, .NET, SAP, Management/Agile, HR, Mobile (iOS, Android, Windows Phone) & IoT, Students/ University, Big Data/Machine learning, Architecture, Securitate, web & design and Testing. So, the participants to the event will be able to choose the book they want to receive in their welcome package. The local media broadcast the event: a coverage and an interview were broadcast on the 6 o’clock news on Digi24 Cluj, and Ziarul de Cluj published an article on this. Below, we will present the feedback received from the participants. On a first analysis, it shows that the 2015 edition of Cluj IT Days can be considered a success, but also that there are some aspects which can be improved.

How helpful was the content presented at the event?

In the end, we would like to thank the partners who stood by us in this edition: Microsoft, Yardi, 3Pillar Global, Gemini Solutions, Accenture, Accesa, Blade Solutions, Banca Transilvania, Subsign, Colors in Projects, Telenav, Yonder, Betfair, Bosch, Frequentis, Ve Interactive, Ullink, Lohika, Cos, Endava, as well as to those who helped us in promoting the event: Cluj IT Cluster, Cluj Hub, Agora, AdHugger, Loopa, Softlead, RABS, Free Wifi, IT Channel and Tech Hub. We thank the participants and we are waiting for you again in Cluj IT Days 2016! How engaging were the speakers at the event?

Ovidiu Măţan

ovidiu.matan@todaysoftmag.com Editor-in-chief @ Today Software Magazine Organizator @ Cluj IT Days

www.todaysoftmag.com | nr. 42/december, 2015

7


event

Branch Track, SaaS that creates interactive customer simulations for scenario-based learning, wins How to Web Startup Spotlight

B

u chare st , D e c e mb e r 3 rd, 2 0 1 5 - Br anch Tr a ck , S a a S pro du c t that creates interactive customer simulations for scenario-based learning, recently won the Best Startup Award at How to Web Startup Spotlight, competition and mentoring program with 20.000 USD cash prizes.

Irina Scarlat

irina.scarlat@howtoweb.co PR Manager @How to Web & TechHub Bucharest

The runner up was Jaboo, a set of smart The runner up was Jaboo, a set of smart wrist bands that accelerate and improve wrist bands that accelerate and improve the athletes’ techniques by tracking their the athletes’ techniques by tracking their speed, force or training patterns. speed, force or training patterns. Symme 3D, multifunctional Delta platform for 3D 30 tech startups from 9 CEE countries printing, PCB milling, and laser engraving attended How to Web Startup Spotlight won the IXIA Innovation Award, while 2015. The first day of the program was SafeDrive, a mobile app that enhances organized in a private setting, at TechHub road traffic safety by rewarding drivers Bucharest, and started with a pitching for NOT texting while driving, received competition where the jury chose the 8 the award for the best pitch in show. The teams that further on presented their pro- winners received 20.000 USD total cash ducts on the main stage of the conference. prizes offered by IXIA, main partner of The day continued with 2 dedicated work- the program. shops: “Ecommerce tactics to increase software sales” by Adriana Iordan, Chief Startup Spotlight was organized as Product Evangelist, Avangate, and “SaaS part of How to Web Conference 2015, in practice” by Sorin Peste, Technical the most important event on tech innoEvangelist, Microsoft. vation and startups in South Eastern Europe. Organized in collaboration with Over the next 2 days, the Startup Telekom Romania, Bitdefender, IXIA, Spotlight finalists showcased their pro- and CyberGhost, the 6th edition of How ducts on one of the two stages of How to Web Conference 2015 took place on to Web Conference 2015, got feedback, November 26 & 27 in Bucharest and and had access to unique investment and brought together startup founders, prodistribution opportunities by attending a duct managers, developers, marketers total number of 384 one-on-one mento- and community leaders from all around ring sessions. the CEE. Besides, the startups competed for the 20.000 USD total cash prizes offered by IXIA, main partner of the program. The jury had the difficult mission to choose the winners of the competition out of 30 promising teams. Branch Track, Latvian startup that creates interactive customer simulations for scenario-based learning, won the Best Startup award in the competition.

8

nr. 42/2015, www.todaysoftmag.com

How to Web brought in the same room some of the best & brightest tech minds in the region and beyond. These people connected during the conference, exchanged best practices and explored possible collaboration opportunities for the future. All these, using a wide array of dedicated networking activities set up for them: the “ask the expert” sessions, the roundtables, the exclusive networking


TODAY SOFTWARE MAGAZINE cocktails and parties organized at the end of each day of the conference. These add up to How to Web Meet, the official mobile app of the conference, that enabled attendees to get in touch with others, set meetings, receive interests-based recommendations and make sure they don’t miss a thing that was happening around. Moreover, the innovators community had the unique opportunity to learn best practices from remarkable entrepreneurs & top-notch professionals that took the 2 stages of the conference and delivered

how tech is reshaping the world. From exoskeletons and the world’s first intelligent electric scooter, to the security device that protects all things connected to the internet, the How to Web attendees got the chance to test 12 innovative products in the gadget expo area, as well as see the 6 live product demos that took place on the main stage of the conference. 89 speakers, mentors & investors from all around the world… 28 remarkable keynotes & talks… 11 insightful panels… 30 promising startups from 9 CEE coun-

“How to Web is a community event that happens every year for the community, with the support of lots of people out there that join forces to make things happen. Our special thanks go to our trusted partners, ambassadors, volunteers, the entire How to Web team, as well as to each and every attendee. How to Web Conference 2015 was a blast thanks to all these people and we are confident that together we can make an even better conference next year”, said Daniel Dragomir, CEO of How to Web Conference 2015. How to Web Conference 2015 was an event organized in collaboration with Telekom Romania, Bitdefender, IXIA, and CyberGhost, with the support of Microsoft, Avangate, hub:raum, the Canadian Embassy in Romania, Mozilla, EIT Digital, Okapi Studio, and Softlayer, and the logistical partners Clever Taxi, mReady, Aqua Consulting, Mucca, mobilPay, Marketizator, Zelist Monitor, TradeAds Interactive, AdLemonade, Ciuc, Aqua Carpatica, and Domeniile Sâmburești.

About How to Web 28 hands-on talks on topics of interest for the creators of products with disruptive potential at global scale. Add these to the 11 insightful panels & fireside chats approaching subjects relevant for the early-stage tech startups in the audience. The videos will the available soon on the How to Web YouTube channel1. Add these to the opportunities to discover the latest industry trends and 1 h t t p s : / / w w w . y o u t u b e . c o m / c h a n n e l /

tries pitching on stage… 384 curated mentoring sessions… 21 communities presenting their initiatives during How to Web Community Spotlight… 8 “Ask the expert” sessions… 12 innovative products presented in the expo area… 6 live product demos on stage… 2 exclusive parties… A great vibe created by all the people there… How to Web in a nutshell looks promising and brings along great news for the tech professionals community, as well as for the ecosystem as a whole.

How to Web Conference is the most important event on tech innovation and entrepreneurship in South Eastern Europe. The conference brings together startup founders, investors, accelerators, product managers, developers, online marketers & community leaders from all around the CEE. More details about this year’s event and the updated speakers list are available online on the conference website.

UCmjNDMVpQNejLMvhIqCB_zA

www.todaysoftmag.com | nr. 42/december, 2015

9


news

IT News

W

e are hereby launching the column of news in our industry. It will contain a series of global, but also local news. The news can be signaled right to: news@todaysoftmag.com.

Google: The quantic D-Wave 2X computer is 100 million times quicker than a normal computer D-Wave 2X uses qubit1 which, besides the 0 and 1 states of a byte, also has the superposition state of both the states. Compared to a simulation on a single core computer, D-Wave 2X is 10â ¸ times faster. Moreover, the processors2 used are on 1000 qubytes, while the classical processors are on 64 bytes. You can find more details on Google Research Blog3.

Windows 10 open source under MIT license6. Source: http://arstechnica.com/information-technology/2015/12/microsoft-to-open-source-chakra-the-javascript-heart-of-its-edge-browser/

Microsoft: Objective-C support in Visual Studio

Though it seems unreal, the preview version of Windows Bridge for iOS (v.01) has been launched. Through it we will be able to port the Objective-C applications on the Universal Windows platform or even develop new applications. For those who are Oracle: Java 9 will be released only in 2017 interested, a virtual machine (~20GB), for a quick startup, can The main purpose of the Jigsaw project (Java 9) is to add be downloaded from the page of the project, without having to modularity to the components used at runtime. Thus, we will fill in any form. be able to create a runtime jar (rt.jar) which will contain only Source: https://dev.windows.com/en-us/bridges/ios the necessary components. This way, Java will scale more easily on devices with a reduced power of processing. The new date TechCrunch: The Jukedeck Startup is the winner of TechCrunch announced is March 2017. Disrupt London Source: https://dzone.com/articles/ Jukedeck 7, a startup that automatically generates music oracle-announces-jigsaw-delays-push-java-9-launch by using artificial intelligence, won the TechCrunch Disrupt London competition. The solution they proposed is for generaApple: Swift is now open source ting soundtrack in a cheap way for videos, without breaching the Anyone is able now to download the code4, the develop- intellectual property rights of the artists. ment builds or fix the bugs in Swift. They have created swift.org5, Source: http://techcrunch.com/2015/12/08/ which is dedicated to the community of programmers who wish jukedeck-wins-disrupt-london-2015/ to contribute. Source: https://developer.apple.com/swift/blog/?id=34

PHP: Version 7.0.0 of the popular language is available

PHP 7.0 comes with a new version of the Zend engine, which is up to two times faster than the previous versions and many Microsoft: Chakra, the JavaScript engine of the new Edge browser other improvements, such as a better usage of the memory or is open-source syntax improvements. This is the 2 year effort of the project team During the JSConf conference in Florida, Microsoft announ- and numerous contributors. You can find out more on this new ced they will make the engine of their new browser from PHP version in the article8. Source: http://php.net/archive/2015.php#id2015-12-03-1 1 https://en.wikipedia.org/wiki/Qubit 2 http://www.dwavesys.com/press-releases/d-wave-systems-breaks-1000-qubit-quantumcomputing-barrier 3 http://googleresearch.blogspot.ca/2015/12/when-can-quantum-annealing-win.html 4 http://github.com/apple 5 http://swift.org

Adobe: Animate CC will replace Flash Professional Animate CC will be available from the beginning of the year 2016 and will contain native support for HTML5 and WebGL. The new product will continue to support Flash (SWG) and the AIR format, but it will also be able to export other formats such as SVG. Source: http://blogs.adobe.com/conversations/2015/11/flash-html5-andopen-web-standards.html

6 https://en.wikipedia.org/wiki/MIT_License 7 https://www.jukedeck.com/ 8 http://todaysoftmag.ro/article/1679/php-7-o-privire-spre-viitor

10

nr. 42/december, 2015 | www.todaysoftmag.com


communities

TODAY SOFTWARE MAGAZINE

IT Communities

W

e wish you Merry Christams and a Happy New Year !!!

Transylvania Java User Group Community dedicated to Java technology Website: www.transylvania-jug.org Since: 15.05.2008 / Members: 598 / Events: 47 TSM Community Community built around Today Software Magazine Websites: www.facebook.com/todaysoftmag www.meetup.com/todaysoftmag www.youtube.com/todaysoftmag Since: 06.02.2012 /Members: 2700/ Events: 33

Calendar December 15 (Cluj) Launch of the issue 42 of Today Software Magazine www.todaysoftmag.ro December 16 (Cluj) Apache Spark Workshop meetup.com/Big-Data-Data-Science -Meetup-Cluj-Napoca/events/227169515/

Cluj Business Analysts Comunity dedicated to business analysts Website: www.meetup.com/Business-Analysts-Cluj Since: 10.07.2013 / Members: 91 / Events: 8

December 16 (București) PMI: Symptoms of a Sick-Project meetup.com/PMI-Romania-BucharestProject-Management-Meetup-Group/events/227335062/

Cluj Mobile Developers Community dedicated to mobile developers Website: www.meetup.com/Cluj-Mobile-Developers Since: 05.08.2011 / Members: 264 / Events: 17

December 16 (Cluj) Kick-off sample learning project meetup.com/PHP-Cluj/events/227158930/ December 17 (Iași) Romanian Business Analysis Conference 2015 eventbrite.com/e/romanian-business-analysis-conference2015-rbac-2015-tickets-19080768091

The Cluj Napoca Agile Software Meetup Group Community dedicated to Agile methodology Website: www.agileworks.ro Since: 04.10.2010 / Members: 437 / Events: 93 PHP Cluj Our love for PHP gets us together Website: www.meetup.com/PHP-Cluj/ Since: 25.01.2013 / Members: 112 / Events: 6 Romanian Association for Better Software Community dedicated to experienced developers Website: www.rabs.ro Since: 10.02.2011 / Members: 251/ Events: 14

December 17 (Cluj) OpenStreetMapTime - missing bus stations in Cluj facebook.com/events/1523158184664319/ January 16 (Cluj) Winning the Game of Business-Entrepreneur Night e ve nt br ite. c om / e / e nt re pre ne u r- n i g ht - w i n n i ng the-game-of-business-guest-of-svp-christine-sherberttickets-19137128667

Testing camp Testers community from IT industry with monthly meetings Website: www.tabaradetestare.ro Since: 15.01.2012/Members: 1243/ Events: 107

www.todaysoftmag.com | nr. 42/december, 2015

11


noutati

programming

Human-Computer Interaction: RealTime Web-Chat Using LeapMotion and SignalR

I

n a world of technology and smart devices, communication should be treated as a key factor and new ways of human – computer interaction should be considered besides traditional ones. The aim of this article is to illustrate the idea of using alternative ways of interaction with the computer in accordance with current available and affordable technologies. The proposal will be exemplified by a real-time web chat application that will be built using ASP.NET MVC and SignalR and will receive input from a virtual keyboard controlled by a Leap Motion Controller.

Technologies In order to implement the real-time web-chat application supporting gesture input from the leap motion controller translated to the virtual keyboard, the following technologies were used: • ASP.NET MVC 5 - http://www.asp.net/mvc/mvc5 • SignalR - http://www.asp.net/signalr • LeapJS - https://github.com/leapmotion/leapjs • THREE.js - http://threejs.org/ • Tween.js - https://github.com/tweenjs/tween.js/

other smart and highly capable gadget. Nowadays almost all our gadgets run a browser that allows us to surf the internet. We want the web applications we develop to be accessible on all these devices. The wide variety of browsers and rendering engines puts us in the situation where our content might look good on some but bad on others. Also we want applications like a monitoring system or a weather application to display new information real-time (as soon as the information becomes available) without us having to request for it. If we connect from our devices to an online social media application, we expect any update we make from our mobile device to be instantly visible on our tablet, smart tv etc. as well as on our friends devices without having to explicitly request for these updates.

The web-chat functionality is developed using ASP.NET MVC and SignalR, the virtual keyboard is implemented based on THREE.js and CSS3DRenderer, and the gesture input and feedback signals of the Leap Motion Controller are interpreted making So how can we build real-time web applications that we use of LeapJS API and Leap-widgets.js extension. can access on all the devices that are out there? SignalR comes in to help us decide on how we can transport data between the server and the client in a fast and reliable way for real-time Real-Time Communication – SignalR communication. In the past the web pages were static, no one expected them to refresh themselves after some time and each user action required SignalR is an open source library supported by Microsoft. It all the content to be resent from the server. Slowly the web began offers bidirectional (full duplex) communication between the serits expansion and the road to dynamic pages started to outline ver and the client. So as opposed to the classic client-server model itself. A first attempt came with the introduction of the iFrame in which the client initiates a request to the server, this time the tag and the ActiveX control. Later with the introduction of Ajax client and the server share an open channel and the server can and jQuery dynamic web pages took over the old static html web also contact the client. It can also provide content asynchronopages (http://www.evolutionoftheweb.com/) usly, supports all browsers and has a smart way of deciding on what kind of transport to use to pass messages. When we surf the internet we make use of a web browser to access and display a web page. This web browser has its own renTransport decision is based on browser user agent, and other dering engine which helps interpret and coordinate the various client and server configurations and it tries several transports tags, elements and resources of that page so it can display it to the techniques like websocket, server sent events, forever frame user. A couple of years ago we used our pc to surf the internet, we and long pooling, having a fallback mechanism if one is not did not have any smartphones, tablets, smart TVs, watches or any supported.

12

nr. 42/december, 2015 | www.todaysoftmag.com


programming

TODAY SOFTWARE MAGAZINE

The connection is started as standard HTTP and if possible it is promoted to websocket which would be the ideal transport from SignalR perspective. Websocket protocol is rather new on the market (2011) and older devices have no support for it. With SignalR we don’t have to worry and code our application for older clients, because it can wisely decide what other kind of transport it can use to make its connections. If websocket is not available it decides between server sent events (not supported by Internet Explorer), forever frame (only for Internet Explorer) and Ajax long polling. SignalR provides Persistent Connections and Hubs communication models. Persistent connection is configurable and similar to web sockets. If for example our application has special requirements and we need to get control of the actions we need to perform when we open a connection we can choose to override it. Hubs are built over the Connection API. We can choose to use the hubs offered by SignalR and call methods on the server from the client and vice-versa directly. All the connections management part is offered by SignalR. So with Hubs we let SignalR do the dirty work. Server side: //DemoHub class is derived from class. This allows us to create public methods that can be called from script in web pages public class DemoHub : Hub { //method that can be called from the client public void MessageToServer(string sampleText) { //specify the function to call on the client, this function has to be defined on the client; This will execute the js function messageToClient on all the clients connected to the hub due to Clients.All property that gives access to all connected clients Clients.All.messageToClient(“message received”); } } Client Side: //reference to a hub proxy var demo = jQuery.connection.demoHub; //js function on the client that can be called

from the hub demo.client.messageToClient = function (message) { alert(message); }; //opening a connection to a hub jQuery.connection.hub.start().done(function () { //call MessageToServer method on the hub from the client demo.server.messageToServer(“Sending message”), });

Listing 1. SignalR Hub Communication Sample

LeapMotion Controller The Leap Motion Controller is a device that captures and interprets signals from optical and infrared sensors in order to identify hands, fingers and pointing tools. This tracking device is a good choice for introduction to motion control due to the fact that it has multi-language API support. It also offers a virtual space mapping along with real-time feedback, gesture training and recognition. The next image presents the device along with its coordinate system. The field of view of the optical sensors is about 150 degrees and the working / detection range extends from 25 to 600 millimeters above the device. Measurement units of the device are represented by millimeters for distance, microseconds for time, millimeters per second for speed and radians for angles. The entity model of the data captured by the controller is denoted by a Frame, containing information from the working space, such as motion and gestures, hands, fingers and/or pointing tools. Using this information gestures such as circle, key tap, screen tap, or swipe may be identified. The integration of the Leap Motion Controller in the application will be based on the WebSocket interface provided by the system architecture. Data captured by the device is transmitted in a JSON structure through a WebSocket. In this way, client side JavaScript libraries can interpret and parse the messages. The interpretation of the raw data coming from the WebSocket server is done in the browser by the leap.js framework.

Figure 1. Leap Motion Controller Coordinates System eap_Overview.html Source: https://developer.leapmotion.com/documentation/cpp/devguide/L

www.todaysoftmag.com | nr. 42/december, 2015

13


programming Human-Computer Interaction: Real-Time Web-Chat Using LeapMotion and SignalR

Virtual Keyboard The visual element that intermediates the communication with the computer is the virtual keyboard. This keyboard is implemented using client-side JavaScript technologies such as THREE.js, Tween.js and CSS3DRENDERER as a rendering engine. Using THREE.js a 3D scene is created in order to present the elements of the keyboard. Some animations are easily integrated with the help of the functionality offered by the Tween. js framework. The rendering choice is represented by the CSS3DRENDERER due to the fact that this kind of rendering is fast, works also on mobile browsers, it is lightweight and it is mainly based on CSS. The next JavaScript lines will present the minimal code that is necessary to be written in order to create a THREE.CSS3DObject denoting a key and to initialize the scene. function CreateButton(key, keyDescription) { var keyElement = document.createElement(‚div’); keyElement.className = ‚key’; keyElement.id = key; var letter = document.createElement(‚div’); letter.className = ‚letter’; letter.textContent = key; keyElement.appendChild(letter); var description = document.createElement(‚div’); description.className = ‚description’; description.innerHTML = keyDescription; keyElement.appendChild(description); var css3dObject = new THREE. CSS3DObject(keyElement); css3dObject.name = key; }

return css3dObject;

function InitScene() { var camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 1000); camera.position.set(0, 0, 200); var scene = new THREE.Scene(); var key = CreateButton(‚w’, ‚w key’); key.position.set(20, 20, 20) scene.add(key); var css3dRenderer = new THREE.CSS3DRenderer(); css3dRenderer.setSize(window.innerWidth, window. innerHeight); document.getElementById(‚scene’). appendChild(css3dRenderer.domElement); var trackballControls = new THREE. TrackballControls(camera, css3dRenderer.domElement); trackballControls.minDistance = 50; trackballControls.maxDistance = 1000; }

The following picture illustrates the states of a key – normal, hover and tapped. All these states are realized using CSS rules applied to HTML elements transposed into THREE.CSS3DObjects and rendered into the scene by the CSS3DRENDERER.

14

nr. 42/december 2015 | www.todaysoftmag.com

These CSS classes will be used during the interaction of the keys with the Leap Motion Controller in order to provide a visual feedback to the user actions.

LeapJS and Interaction with the Virtual Keyboard The interaction between the virtual keyboard and the LeapMotion controller will be realized through the LeapJS framework. The information provided by the framework will be updated in a loop capturing data with a frequency of 60 frames per second. Due to the fact that we will need information related about the position of the hand onto the screen and the gestures made by the user, the initialization of the controller will be described by the following lines of JavaScript code: var leapController = Leap.loop({ enableGestures: true }) .use(‚screenPosition’); leapController.connect();

In order to identify what action is intended by the user, the Frame object provided by LeapJS framework should be considered. The Frame object provides useful information captured from the detection area, regarding its id, the current frame rate, fingers, gestures, hands, pointables, tools, interaction box, and also a flag indicating the validity of the data provided. A Frame is considered to be valid when it contains data for all of the detected items. Along with these attributes the Frame object provides also a set of functions, such as: dump() , finger(), hand(), pointable(), rotationAngle(), rotationAxis(), rotationMatrix(), scaleFactor(), tool(), toString(), translation(). These functions are very useful in the process of interrogation and processing of the captured data. Frame Event Callbacks are used in order to handle the information about the gestures recognized and take the necessary actions. First of all, the position of the hand is transposed onto the screen. This is accomplished using the ‚hand’ detection event as illustrated bellow: var leapController = Leap.loop({ enableGestures: true }, { hand: function (hand) { var screenPosition = hand. screenPosition(hand.palmPosition); //... screen position related logic implementation } }) .use(‚screenPosition’);


TODAY SOFTWARE MAGAZINE Relative to the hand position onto the screen, elements of interest will be identified, in this case, the key that is intended to be tapped. As a feedback to the user, CSS classes presented in the previous section will be used in order to illustrate the hover and tapped states. The tapped state is transposed to a key state using gesture related information from the current Frame object. If there is a keyTap gesture after interrogating the gestures collection, then the key situated at that position will change its state and it will be added to a collection in order to create a message that will be sent to the chat mechanism.

Conclusion Using ASP.NET MVC and SignalR, a real-time web chat mechanism was implemented. Combining the THREE.js along with the CSS3DRENDERER, a virtual 3D keyboard was realized using CSS styled HTML elements. Interpretation of the user gestures as a form of interaction with the keyboard was accomplished from the integration of the LeapMotion Controller in the application through LeapJS and Leap-widgets.js. The result of linking together these information is a functional real-time web-chat application having as input an interactive keyboard that understands user’s gestures.

[4] https://en.wikipedia.org/wiki/WebSocket [5] http://www.asp.net/signalr [ 6 ] h t t p : / / w w w. a s p . n e t / s i g n a l r / o v e r v i e w / g e t t i n g - s t a r t e d / tutorial-getting-started-with-signalr [7] https://developer.leapmotion.com/documentation/cpp/devguide/Leap_ Overview.html [8] https://developer.leapmotion.com/documentation/javascript/devguide/ Leap_Architecture.html [9] http://leapmotion.github.io/leapjs-plugins/docs/#screen-position [10] https://github.com/leapmotion/leapjs-widgets [11] https://developer.leapmotion.com/documentation/javascript/devguide/ Leap_Frames.html [12] https://developer.leapmotion.com/documentation/javascript/devguide/ Leap_Gestures.html [13] http://threejs.org/docs/ [14] http://threejs.org/examples/ [15] https://github.com/mrdoob/three.js/blob/master/examples/css3d_periodictable.html George Rus

George.Rus@yardi.com Software Developer @ Yardi România

Bibliography Daniela Fati [1] http://www.evolutionoftheweb.com/ [2] https://en.wikipedia.org/wiki/History_of_the_World_Wide_Web [3] https://en.wikipedia.org/wiki/Ajax_(programming)

Daniela.Fati@yardi.com Software Developer @ Yardi România

www.todaysoftmag.com | nr. 42/december, 2015

15


programming

IoT: from device to cloud

D

igital security has been and still is a controversial subject. Needed but extremely difficult to implement, digital security is a major challenge to both customers and manufacturers of IT equipment used in connecting industrial automation systems. Over the years, the evolution was tremendous, starting from a niche research field up to what we call a „mainstream” technology. Leonard Pitu leonard.pitu@siemens.com Senior Key Expert/Research Engineer @CT RTC ELE ELD-RO @ Siemens

16

nr. 42/2015, www.todaysoftmag.com

The IT domain has gone through a fast evolution cycle, starting a few decades ago from a simple transistor. This evolution had two main directions – easing of human activities and facilitating their communication. The appearance of the „Internet-of-Things” represents a major step in this evolution. The basic concept is very easy to grasp: each device, „thing”, can be connected to the Internet and accessed remotely – regardless of it being a central heating system of an entire factory. The potential is huge – all devices surrounding us are instantaneous becoming intelligent and can collaborate with each other or with other online services. A very simple example could be a central heating system. Currently the device is set-up by the manufacturer, in the factory. The user can set a few parameters such as the desired temperature during a certain time interval. A smart heating system introduces many more parameters such as weather forecast or the owner’s calendar.

As such, if the owner is on vacation and the outside temperature is set to drop, the heating system will start on its own, in due time for the owner to have a pleasant room temperature upon arrival. Even more, the manufacturer can optimize the heating system also over the Internet, using software updates-like mechanisms. In this way the IoT is offering a complete new view over the human-machine interaction – everything becomes interconnected and as such reachable. Still this advantage brought by the IoT becomes a powerful weapon in the hands of digital attackers. With the same ease with which the heating system is configured an attacker is able to compromise it. Even during the so-called concept phase of the IoT it became obvious that assuring security of digital systems that form the actual IoT is a must. Interconnecting systems which until lately were isolated opens new opportunities to


TODAY SOFTWARE MAGAZINE

Figure 1: Number of attacks in dramatically rising (source: Data Breach Investigation Report 2014)

attackers, regardless of their motivation, as one can see from the technical literature which almost weekly presents new vulnerabilities that were exploited in attacks more complex than ever. By their nature, isolated systems are easier to protect – the simple fact that these are inaccessible to the large public eases the task. These systems are protected by private security solutions, mostly developed by a single company, without a dedicated security evaluation program meant to identify breaches and/or development problems. Reaching over physical barriers also meant that technical knowledge related to security, cryptography and cryptanalysis have become mainstream technologies and known to the public at large. This helped opening up, to both users and attackers, the until recently „closed source” domain called „security”. These facts helped invalidate in a very short time many technologies used in securing isolated systems. Attacks have revealed concept and implementation errors as well as security policies flaws. Modern digital viruses are getting more powerful with every generation having usually multiple data collection and self-replication mechanisms. For example, FLAME has a physical dimension of 20MB with a code base of a few million lines of code. FLAME has 5 independent data encryption mechanisms and a SQL database for collecting and storing structured data. FLAME is capable to infect a system without leaving any trace – there is no process running on the system, which can point to its existence, and the memory allocated by the malware is not visible from the user space. Given this context, the necessity of developing new security concepts and models become necessary. Dedicated solutions, which were mostly very complex, have proven to be inefficient in the light of modern attacks. Given the scalable nature of the IoT very few „old” security concepts could be adapted to present day needs. By its nature, the IoT exposes private information related directly to human individuals and as such, privacy has become a primary concern. Implementing this assumes the utilization of modern cryptographic primitives as well as authentication and authorization techniques. The on-line data transfer, which lies at the basis of the Internet and even the modern society, also need to be secured. As such, the basic security needs of the IoT have crystallized.

sense is a utility provider, which easily has millions of users. All these users need to be able to securely use the same service at the same time; all users must authenticate, must be authorized, must be able to view their balance, current bill and historic data and even pay their bills. In this context digital security has evolved to an integral part of the design process influencing both hardware and software architectures. Software solutions offer more flexibility, can be developed faster, and with less effort yet are prone to errors (a classic example would be the famous „buffer overflow” error, which is extremely easy to exploit. Hardware solutions on the other side are much more difficult to implement, require more human and financial effort but are less prone to errors and security vulnerabilities. Finding the right balance between hardware and software solutions is the optimum approach for developing secure systems. Currently there is no standard or methodology to facilitate this – the only way to go is to rely on human experience. Over the course of a risk analysis developers can identify the major threats the system will probably encounter. This is followed by the identification and/or development of technologies needed to implement protection measures against these threats. The architecture of a digital system can be drastically influenced by the indentified risks. Still introducing supplementary security levels can reduce performance therefore more architectural changes are needed. Usually just one protection method is not enough so a multitude is used. Systems need to be active and not just passive or reactive. As such, a system must be capable to detect, identify and react to security threats very much like our immune system. All these traits define the security level a system is capable to offer. An important aspect of developing security solutions is the verification. Again, there is no standard to assist the developers in their activities - the only help consists of a few guidelines. This domain is currently shifting its focus from a weak, experience based verification to a formal one, based on mathematical models.

Figure 2: Digital security - a multitude of technologies (source: www.microsemi.com)

In order to be able to develop long-term solutions, the trend is to apply simple yet scalable techniques. An example in this www.todaysoftmag.com | nr. 42/december, 2015

17


programming IoT: from device to cloud

Figure 2: Top 10 security threats (source: Cloud Security Alliance)

IT systems, which lie at the foundation of the IoT are spread over a large geographical area splitting the security problem between the cloud and the multitude of things. Even more, a third party making security very difficult to implement usually represents the cloud. Besides the technological aspect, there is also the legal one, which needs to enable the usage of powerful cryptographic methods.

Organizations such as the „Cloud Security Alliance” or „European Cloud Partnership” are also announcing a better legal framework for the IoT.

The race between attackers and „protectors” is far from over as one can see from the rising number of vulnerabilities being exploited in attacks therefore making security a living technology, which has yet to mature over the next few years. The transition to intrinsic security, which exploits the physical properties of a silicon device, will offer a root-of-trust to developers allowing them to implement more powerful protection methods. In the cloud, a major leap forward will be the usage of homomorphic cryptography, which will allow encrypted data to be processed without the need for decryption. This technology will assure users with the much-needed privacy without depriving them of the benefits of cloud-based solutions.

Corporate Technology Romania

18

nr. 42/december 2015 | www.todaysoftmag.com


programming

programming

ECMAScript 6 - why and how to use it today

F

or those of you who haven’t heard of ECMAScript, simply put, ECMAScript is the standard which defines the programming language which we popularly know as JavaScript. The previous edition of the standard, ECMAScript 5, was released at the end of 2009, with significant improvements to the language, but it was still lacking some important features. ECMAScript 6 (ES6), on the other hand, has finally introduced features developers were

Adrian Ulici Adrian.Ulici@3pillarglobal.com Software Engineer @3Pillar Global

waiting for years. Actually, the official name As you can see, we dropped the “funcis ECMAScript 2015, but it seems that in the tion” keyword, which already saves us some community ES6 is still the version that most characters, but it gets even better. If the arrow people recognize (at least for now). function only needs one argument, you can also get rid of the opening and closing I will discuss below some of the improve- parentheses from the arguments list: 3].map(item => { ments which I personally like and think will [1, 2, return item * 2; help me most. Of course, depending on the }); type of the project you may find other features useful. That looks good, but we’re not done! There’s still an improvement we can do here: Some new major features if the body of the arrow function is only a return statement, we can get rid of the Arrow functions brackets and of the “return” keyword also, Arrow functions are a new, shorter way and we get something like: 2, 3].map(item => item * to write anonymous functions. If you are a [1, 2).filter(item => item % 3 === 0); // programmer with a preference for functio- this will return [6] nal programming you will definitely love it. Here’s a short example: Now let’s compare that with the ES5 // es6 version version: [1, 2, 3].map((item, index) => { });

return item * 2;

// es5 version [1, 2, 3].map(function(item, index) { return item * 2; });

[1, 2, 3].map(function (item) { return item * 2; }).filter(function (item) { return item % 3 === 0; });

www.todaysoftmag.com | nr. 42/december, 2015

19


programming ECMAScript 6 - why and how to use it today MY_CONSTANT, There’s an obvious improvement not only in the fact that we loremIpsum can write the same code with less characters, but also in readabi- }; lity. If you don’t have any arguments to your function you should use the following syntax: const func = () => { This way it’s a bit more visible what you’re actually exporting // do something } from a module. As a side node, you probably noticed that I’ve used “let” to declare the “loremIpsum” variable. “let” is also part There’s a single caveat which you have to take in considera- of the ES6 specification, and it’s a new way to declare variables. tion: unlike the normal anonymous functions which create a new The difference between “let” and “var” is that “let” is block scoped context each one, the arrow functions will keep the context of instead of being function scoped (or global if not in a function), their parent scope. Developers often had troubles in identifying like “var”. the context in which their function is running, this should make That being said, importing from modules looks like this: // main.js things a bit easier to understand. Here’s an example: import { helloWorld, MY_CONSTANT } from ‚my_module’; document.body.addEventListener(‚click’, function (event) { console.log(this); // ‚this’ will refer to the body element });

document.body.addEventListener(‚click’, (event) => { console.log(this); // ‚this’ will refer to the Window object (i.e. the parent scope’s context) });

helloWorld(); // will log ‚Hello world’

// or import all the named exports import * as m from ‚my_module’; m.helloWorld(); // you can use the dot notation now to access the named exports

Default exports have a sweet and short syntax:

// sum.js export default function (a, b) { return a + b; };

So, you cannot just do a quick find and replace all your anonymous functions with arrow functions, because it will most certainly break something. // main.js

import sum from ‚sum’;

Modules An anticipated addition to JavaScript was the ability to create and load modules. With the increasing complexity of web applications, it was clear that this feature is a must have, that’s why the JavaScript community took it upon itself and created a few solutions for it. The most popular are the CommonJS standard, used by Node JS and Browserify, and Asynchronous Module Definition (AMD), used by RequireJS. The ES6 solution to modules incorporates features from both these popular module systems, but it adds even more useful functionality. An important change that was made to ES6 modules is that they have a static structure, i.e. the imports will be statically analyzable at compile time. This has a great benefit because linting tools will be able to analyze our code much better. The ES6 modules syntax gives us multiple ways to export values: named exports (we can have multiple in a module) and default exports (only one per file). The nice part is that we can have both in the same module. Named exports look like this: // my_module.js export function helloWorld () { console.log(‚Hello world’); } export const MY_CONSTANT = 5; export let loremIpsum = ‚dolor’;

You also have the option to define all the functions / variables which you want to export and then export them separately like this: // my_module.js const helloWorld = () => { console.log(‚Hello world’); } const MY_CONSTANT = 5; let loremIpsum = ‚dolor’; export { helloWorld,

20

nr. 42/december 2015 | www.todaysoftmag.com

alert(sum(4, 5)); // will alert ‚9’

Having both named exports and a default export in the same module is also possible, and it looks like this: // module.js const func1 = () => { ... };

const func2 = () => { ... }; // Export the default export default function () { ... }; // Export the named export { func1, func2 }; // main.js import defaultFunction, { func1, func2 } from ‚module’;

There is a drawback to this import syntax: it cannot be used inside a script tag (since it’s a synchronous tag) and you cannot conditionally load a module. There is, however, an alternative way to load modules, using the module loader API. The syntax looks like this: System.import(‚my_module’).then(my_module => { my_module.helloWorld(); }).catch(error => { alert(‚Cannot load module’); });

Promises Due to JavaScript’s asynchronous nature, we often find ourselves in what is known as the “callback hell”, i.e. lots of callbacks in callbacks which reduce readability a lot: doSomething(param1, param2, () => { doSomethingElse((param3) => { doMore((param4) => {


TODAY SOFTWARE MAGAZINE

});

});

});

andMore((param5) => { // Where am I? });

I think one can see how things can get ugly quite fast, and most of the JavaScript developers have encountered situations like this. Promises are an alternative to callbacks in order to tackle asynchronous code. Just like modules, there are quite a few open source implementations for promises, like Q1, RSVP2 or Bluebird3. The popular jQuery has a Deferred object, which offers the same kind of functionality but its syntax is different and it isn’t ES6 compliant.

console.log(‚async function finished’); }).catch((error) => { console.log(‚Something bad happened: ‚ + error); });

The great part of promises is that they are chainable which really flattens out the code: myAsyncFunction().then(() => { // myAsyncFunction finished successfully return anotherAsyncFunction(); }).then(() => { // anotherAsyncFunction finished successfully }).catch((error) => { // either myAsyncFunction or anotherAsyncFunction failed });

Classes

Yes, classes finally arrived in JavaScript. As much as it is an anticipated feature, it is also a controversial one because there are quite a lot of developers who oppose the introduction of classes, since javascript already has prototypal inheritance which can also provide classical inheritance. Classes in ES6 are mostly syntactic sugar, since the same kind of functionality could have been created using ES5, but introducing them will allow future editions of ECMAscript to add Every Promise receives a callback function as a parameter. more functionality to them. There are already some intentions This callback function gets two parameters: a fullfill function, i.e. to extend the classes in ES7 by adding private variables and other the operation finished successfully, and a reject function, i.e. the features. operation failed. The basic usage of promises looks something like this: The syntax for classes looks like this: Promises are basically objects which can be in one of the following 3 states: • pending: waiting for the operation to finish. This is the initial state when creating a promise. • fulfilled: the operation finished successfully. • rejected: the operation failed.

// Define an async function (like an ajax call for example) which returns a promise const myAsyncFunction = () => { return new Promise((fulfill, reject) => { // do something if (...) { fulfill(param1, param2); } else { reject(error); } }); }

class Vehicle { constructor(type, color) { this.type = type; this.color = color; }

// Call the async function myAsyncFunction().then((param1, param2) => {

// Extending the Vehicle class Car extends Vehicle { constructor(color, maxSpeed) { super(‚car’, color); this.maxSpeed = maxSpeed; }

1 https://github.com/kriskowal/q 2 https://github.com/tildeio/rsvp.js 3 https://github.com/petkaantonov/bluebird

}

getColor() { return this.color; }

This will create a “Vehicle” class with a constructor and a “getColor” method. You can also extend classes:

getMaxSpeedFormatted() {

Our core competencies include:

Product Strategy

Product Development

Product Support

3Pillar Global, a product development partner creating software that accelerates speed to market in a content rich world, increasingly connected world. Our offerings are business focused, they drive real, tangible value.

www.3pillarglobal.com

www.todaysoftmag.com | nr. 42/december, 2015

21


programming ECMAScript 6 - why and how to use it today }

}

return this.maxSpeed + ‚km/h’;

let car = new Car(‚blue’, 200); console.log(‚We have a ‚ + car.getColor() + ‚ car with a max speed of ‚ + car.getMaxSpeedFormatted());

You’ll notice that we’re using “super(...)” here to call the parent constructor. Most of the object oriented languages give you this possibility as an option, but in JavaScript this is required if you are overriding the constructor. You have to call the super constructor before trying to access “this”, otherwise you’ll get an “Uncaught ReferenceError: this is not defined”: class Car extends Vehicle { constructor(color, maxSpeed) { maxSpeed *= 0.6214; // transform to miles. You can do this before calling ‚super’ this.maxSpeed = maxSpeed; // but you cannot reference to ‚this’. This will throw a ReferenceError super(‚car’, color); } }

You can call other methods on the base class, not only the constructor, using “super.methodName()”.

But that’s not all! There are a lot of new features in ES6 you have to know about, like the new way to declare variables using “let” or default values for function arguments, a lot of new methods on the String’s and Array’s prototypes, and much more. This was just a higher overview and I hope I succeeded in making you want to know more. For a more extensive list of the new features in ES6, see the actual language specification here: http://www.ecma-international.org/ecma-262/6.0/ Another great resource if you want to get into ES6 is Dr. Axel Rauschmayer’s book “Exploring ES6” which he kindly offers for free in online version here: http://exploringjs.com/es6/ or you can buy the book to support his work here: https://leanpub.com/ exploring-es6/

implement all the features. Evergreen browsers are catching up quite fast, but even if they will implement ES6 fully, most of us still have to support older browser versions (we all know I’m talking about Internet Explorer here). So, how can we use all, or at least a subset, of these great features today? The solution? Transpilers! There are quite a few ES6 to ES5 transpilers available at the moment, with Babel JS and Traceur being the most popular. An up to date list with the most used transpilers and their feature support (plus browser support) can be found at kangax’s compatiblity table: https://kangax.github.io/ compat-table/es6/ . At the moment of writing this article, Babel JS (which has evolved a lot meantime and is more a platform than a transpiler now, see http://babeljs.io/blog/2015/10/29/6.0.0/) has the best support, with over 71% of the features being supported, which is pretty good for a transpiler! Babel, and most of the other transpilers, also have gulp (and Grunt) plugins available, so it’s easy and quick to set them up right into your build system. Take a look at this short and minimal example of using Babel with gulp: var gulp = require(‚gulp’); var babel = require(‚gulp-babel’); gulp.task(build-js, function () { return gulp.src(‚src/app.js’) .pipe(babel()) .pipe(gulp.dest(‚dist’)); });

Conclusion

ES6 definitely brought us lots of improvements, from simple syntactic sugar (like classes) to new and complex features, such as promises and modules. Some of the new features are game changers (e.g. modules, promises, etc.), some will make our code cleaner and more readable (e.g. arrow functions, template strings, etc.), others are simply useful (e.g. new methods for arrays). This new release of ECMAScript will not only change the way we write JavaScript, but it will also change the way we think and organize our JavaScript code. Simply put, it will make our lives easier.

How to use ES6 today

Suggested links

Well, all these features are shiny and great, but how could we use them today? ES6 was officially approved as of June 2015, but we all know it will take time until the browsers will fully

http://www.ecma-international.org/ecma-262/6.0/ http://exploringjs.com/es6/ https://github.com/lukehoban/es6features

22

nr. 42/december 2015 | www.todaysoftmag.com


programming

Quality Assurance 101

I

n an article here on TSM, earlier this year, I have tried to explain what Quality Assurance is and how it fits into an agile environment. Today I will move forward and describe the first steps in defining and implementing a Quality Management process in a software development project, be it agile or not.

Vasile Selegean vasile.selegean@isdc.eu QA Officer @ISDC

As any other managerial activity, it should start with the goal and a plan detailing: • every activity to be taken in order to reach the goal; • the resources that are needed to fulfill the activities; • the time frame; • monitoring measures – to make sure everything goes into the right direction and it stays on the agreed track • retrospective sessions – to review and evaluate the outcome of the plan. Success criteria and return of investments are also recommended to be part of this plan.

The Goal In very few words, the quality of a product or service is what differentiates your work when compared to your competitors’, the one thing that makes your product or service standing out from the crowd. Quality should be the ultimate goal when building anything – everything else is just a means (or support tool) to achieve it. Quality is a

sum of various quality objectives or criteria that must be clearly stated and agreed upfront, mandatory within the team and, if possible, together with the customer, as early as possible in the project’s lifecycle. It goes without saying that these objectives should be SMART (specific, measurable, achievable, relevant and time-bound) in order to be useful. Quality objectives are useful tools for the project team to evaluate and improve its own way of working and its work product before it is completed and before any eventual defects or inconsistencies are delivered to the customer. They are not to be confused with the larger group of the non-functional requirements, also referred as quality attributes. NFR’s are supposed to address (either explicit or not!) an user need, such as uptime or number of concurrent users supported by a web application – that is subject to the project’s architecture and infrastructure management.

www.todaysoftmag.com | nr. 42/december, 2015

23


programming Quality Assurance 101 Some examples of such quality objectives are: • “reduce number of bugs by 25% during the next quarter” – assuming that the number of bugs reported during previous quarter is known; • “keep re-work time below 25% of the total time spent of development in every sprint”; • “increase internal testing effectiveness” – targeting a defect detection rate (before vs. after delivery) higher than, let’s say, 90% per release or major milestone.

Any work product of a team can be appraised: requirements, the product itself, any plans or documents created during the project’s lifecycle as well as the activities performed by the team on its daily routine (that ends in the physical product). Requirement documents, architecture, configuration management can be the subject of an appraisal! This way the team is confident they are build a correct and complete product and it ensures the customer or the relevant stakeholder that their business needs are addressed and well implemented. Performed work proAn example of a bad quality objective cesses can benefit too from such objective could be something like “Reduce num- evaluations! ber of bugs by 25% in every sprint”, as it is not really achievable or time-bound – If review and test are well known actisee the first example above! vities, audits are a bit different: they must be done by a trained, independent auditor, The activities outside the project team (i.e. a peer/senior What activities are to be taken in order software architect for project’s software to reach the goal(s) defined by the quality architecture; an external consultant if objectives? They can be grouped into 3 you want to evaluate your work against categories: preventive actions; appraisal an industry standards such as ISO stanactivities and fix/repair activities. dards and so on). Audits are to be carefully planned and the scope and the objectives Preventive actions include trainings should be known and agreed upfront. - so your staff will perform better, maximizing tool and their knowledge usage; The objectives can be internally defiR&D activities - so your team will stay on ned (either following an existing model the edge of their field of work; planning; –such as CMMI - or not) or a set of indusmonitoring and measurement activities - so try standards. The audit findings must be you will be able to determine deviations, formalized into a report at the end of the observe trends and take corrective actions process and acknowledged by the relevant before inconsistencies in your work pro- stakeholders. The findings, either inconduct or way of working turn into issues. sistencies, non-compliances (in respect to the agreed standard or set of rules) or good Appraisal is an objective evaluation practices, can be transformed into action or check of something against an agreed points for the team (with an owner and set of standards, expectations or model. deadline assigned) and re-evaluated in a Appraisal activities include reviews, tests follow up session if necessary. and audits.

24

nr. 42/december 2015 | www.todaysoftmag.com

Fixing activities include all effort that is needed to repair the defects found in the product, before or after the delivery. In our industry it is better known as “bug fixing”, but it should NOT be limited to this! The way of working can be improved if necessary; the team structure may need to be changed and so on. Of course, any change should be preceded by a thorough analyze – you don’t want the cost of the change to exceed your budged or find out it was not as useful as expected or, even worse, not necessary.

Resources There are 3 “actors” within a team that coexist and each one has an influence on the dynamic of the body that is a team: people (their availability, skills and knowledge), technology (that supports and enables people to do their work efficiently) and work processes (how people are using their knowledge and the technology available in their day-to-day activities). At any given moment in a project’s lifecycle there should be a fine balance between those 3 “ingredients”. Of course, as for any resource, they come with a cost that should be taken into consideration – at least to make sure the expenses are not exceeding the estimated gain from the project or the product that is built. When it comes to quality, its “cost” (the CoQ) can be summarized to this formula: CoQ = CoP + CoN + CoA Where: • CoP is the cost of prevention resources and activities: hardware or software upgrades, trainings, planning and analysis activities etc.


TODAY SOFTWARE MAGAZINE • CoN is the cost of non-conformities: effort needed to fix defects, re-testing and reworking / refactoring your product; effort needed deliver the fixes to your product; perhaps a 24/7 support team is needed for your customer in case your product is critical for its business and so on. • CoA is the cost of appraisals: review time (not only code review, but also the plans, design, architecture, work processes are to be reviewed from time to time), first time testing of new or changed functionalities, independent verification, validation or audit sessions. A successful quality assurance plan will aim to keep the CoQ within an acceptable range in the overall project’s budget by keeping an optimal balance between CoP and CoA so that the CoN stays as low as possible. The cost of quality assurance activities can be supported internally by your organization or can be shared with the customer – assuming you’ve done your homework and the sales department can convince the client it is in their best

interest. Having a proven track of the success of the QA activities can help the sales department win a bid (i.e. investing time or money in appraisal activities can lead to a more reliable product and an overall decrease of the total project cost as without the appraisal). More on measurements and monitoring activities will be detailed later in this article.

be more accurate, they are not changed very often. Yet they should be reviewed! The frequency and the trigger of a review session should be clearly described: a contract can be reviewed / renewed yearly or in case of force majeure. Software architecture or the important milestones described in high-level planning can be updated as well, and this must trigger at least a review (if not an update) of all managerial plans, Timing making sure they are still aligned to the Some of the activities described above business or project objectives. are “one-off ” or time-bound, some are to be continuously performed during the Review, verification, validation and project’s lifecycle. monitoring activities should be performed continuously, on all work products, be One-off activities include contract it requirements, software packages, user negotiation, architecture design or ini- manuals or working processes. Weekly or tial (high-level) planning and estimation. per sprint (in Scrum teams), it does not From the quality assurance perspective, make any difference, but they should be defining project quality objectives, defining always in focus of the entire team. measurement procedures and collecting frequency, identifying (technical) skills Audit sessions should be described as needed to complete the work versus what’s well. Not the exact date and time, but the available (in order to plan some trainings, frequency (yearly.. quarterly.. monthly.. if necessary) are examples of one-off acti- once per major milestone..) and the set of vities. Once such documents are available rules and procedures that apply. and approved by the relevant stakeholders it is unlikely to be changed. Or, to

Fig. 1 - An extended Jira workflow scheme

www.todaysoftmag.com | nr. 42/december, 2015

25


programming Quality Assurance 101 Monitoring quality objectives

working progress throughout the project lifecycle to identify deviations, trends and use this to improve your predictability. Make sure that issues are logged with the correct issue type so that the source of any issue can be traced: was it found during review, test or, in the worst case scenario, by the client? The number of non-conformities (or quality issues) and time spent on analyze and fix them can be monitored apart from the “normal” project activities To properly monitor the activities -and and this can tell a lot of information about make sure the team stays on the agreed the overall project quality. track- a set of measurements is to be defined, specific for each quality objective, plus This information can be displayed in the frequency of collecting and analyzing a nice graph so the trends can be easily measurements data. The plethora of moni- observed. Based on these trends, observed toring and reporting tools available is good practices can be used by the team to outstanding: starting with Jira or TFS for set future objectives and also promoted time and issue management and going all to other projects or to the organizational the way to the good old Excel worksheet level while practices that cause an increfor consolidation and graphs. ased number of non-conformities can be addressed in a timely manner and their The issue type schema and the usage stopped before causing real issues. workflow –the status and possible transitions of an issue- in (e.g.) Jira has to be Furthermore, every document and adjusted to reflect the quality objectives activities described in this article can be defined and agreed upon. You will be reused in a new project and any good able to quickly identify, count and filter practices identified can become the norm those quality-related activities and their or internal standard and used by anyone associated costs! Encourage logging of across the organization. The measurements all estimations upfront and monitor the collected will make a strong argument in Once the quality objectives are defined and the draft plans are available, the team and upper management (or any other relevant stakeholders) commit to them and they become goals for the project team. It is the responsibility of the project manager, or another team member specially assigned, to make sure they’re reached within the defined time frame.

favor of any observed good practice when it comes to implement it into another project or they’ll make a good case-study to present to a potential client. The reciprocal is also true: measurements will make easier to convince any person or team to get rid of any bad habits if the outcome is not as good as expected! Just keep in mind that the measurements data collected is to be used as a tool or baseline to improve the way of working of the entire team and not as a tool to punish individuals!

Retrospective It is the moment of reflection when one looks back and evaluates the journey so far. It must be planned at regular intervals or after reaching a major milestone; waiting for the project’s end is not recommended, as there’s little to be done in case of a “malfunction”. Lessons learned during the time passed from the previous retrospective must be captured and can be used to improve the quality management plan in all its aspects: quality objectives; resources; measurements collecting procedures and thresholds; activities and when/how they’re performed.

Fig. 2 - Different graphical representation of measurements data

26

nr. 42/december 2015 | www.todaysoftmag.com


TODAY SOFTWARE MAGAZINE

Fig. 2 - Different graphical representation of measurements data

To summarize The quality of any work product is of a paramount importance nowadays. The ultimate goal of a software development project must be a quality product, not just to finish the agreed functionality within the agreed time frame and within the agreed budget. In order to keep everyone focused on the product quality, a team must clearly identify the quality objectives and, of course, plan all the related activities. It is an investment that, when completely and correctly done, returns a great value, in terms of both team and customer satisfaction, by reducing the number of possible defects and thus the effort to fix the already completed / shipped product. It should go without saying that a good plan available upfront will save a lot later in the project lifecycle – the team will be proactive, acting towards a goal, not reacting to stimuli, sometimes without having the luxury to properly analyze all the input and possible consequences .

www.todaysoftmag.com | nr. 42/december, 2015

27


programming

Zero to RESTful in 4 easy steps

D

eveloping applications professionally on the LAMP stack imposes use of modern frameworks. They standardize the way we work by using a predictable code and file organization, come prepackaged with basic utilities and libraries. Moreover, frameworks address security concerns at the core of the software, are a key factor in teamwork by enforcing code standards and easier onboarding of teammates. Last but not least, they are backed by fantastic communities, and make us more efficient by helping focus on the functionality of our project. However, there are projects where using a full-fledged framework feels heavy on the developer. Individual microservices, quick prototypes, small websites, simple APIs, mock functionality, these are all cases when a developer would rather benefit from the smaller footprints of ready-made (and tested) libraries. That’s where micro-frameworks come into play, providing the necessary glue between them.

have a look at how its Dependency Injection Container (Pimple8) compares to the Symfony one (taken from a presentation of Igor Wiedler):

Project setup

Let’s start by creating a new project: create a folder to work in and then navigate to it. Here I use an absolute path on my We will build an application to track data about our vehicles, machine: and get alerted when certain operations need to happen. This will mkdir -p /Users/g/Sites/learn/silex-tutorial happen over the course of several articles, let’s quickly check the $ $ cd /Users/g/Sites/learn/silex-tutorial roadmap: 1. project setup and dependencies, TDD support and logging capabilities 2. design the RESTful API; BDD with Behat 3. implement APIs defined in the previous step 4. development Install Composer environment with Vagrant and Ansible; build automation; conWe will use Composer to manage my dependencies. It comes tinuous integration packaged as a Phar archive, so it’s a good idea to first check that the corresponding extension is enabled in php.ini: In the PHP world, micro-frameworks have become first-class extension=phar.so # should be un-commented citizens a long time ago. Slim1, Flight2, Limonade3, GluePHP4, I prefer to have Composer globally available, since it will Phlyty5 are a few well-known examples. Our micro-framework come in handy for other projects as well. We will need sudo just of choice is Silex6, based on the highly popular Symfony7 com- for the installation bit. curl -sS https://getcomposer.org/installponents. To get a feeling about how much lighter Silex is, let’s $ er | sudo php -- --install-dir=/usr/local/bin --filename=composer

1 http://www.slimframework.com 2 http://flightphp.com 3 http://limonade-php.github.io 4 http://gluephp.com 5 http://phlyty.readthedocs.org/en/latest/

Declare Silex as a dependency Next step is to create composer.json to manage our dependencies. {

6 http://silex.sensiolabs.org 7 http://symfony.com

}

„require” : { „silex/silex” : „1.*” }

Let’s now execute in the working folder the install command:

$ composer install

This will not only install Silex and its declared dependencies, but also create a composer.lock file that locks the version of all installed components to a known state.

Making the first request Let’s prepare a small strategy on the layout of the files we want.It is good practice to keep the publicly accessible files in a separate folder, so we will use web/ for this purpose. 8 http://pimple.sensiolabs.org

28

nr. 42/december, 2015 | www.todaysoftmag.com


security

The resource loading and other internal kitchen will live in app/bootstrap.php. Here’s how we plan our file layout to be. The bootstrap file defines the Silex application object and returns it, while the contents of our publicly accessible file is very simple, instantiates the application object from the bootstrap file and run()s it. Have a look on how we make use of Composer’s autoload feature: require_once(__DIR__ . ‚/../vendor/autoload.php’);

TODAY SOFTWARE MAGAZINE

If we want the same closure function to be executed for multiple HTTP methods, we can use the following approach: $app ->match(‚/’, function () {return ‚Up and running’; }) ->method(‚GET|POST’);

Let’s decompose this for a moment: we matches the pattern first, attach the closure function, and then specify the list of methods the pattern can be accessed at.

This saves us from a lot of trouble because it loads all classes inside vendor/ without us needing to do anything extra than the Add TDD support file require. It is important to have a way of writing tests for our API appliLet’s see what happens if we access the public web/index.php cation. The de-facto standard in the PHP world is PHPUnit9, and file right now: even Drupal8 has switched to use it from previous SimpleTest10. Let’s revisit the file layout and see how we can add a simple way of benefiting from test-driven development.

Here’s Silex responding to our request. It tells us that it has no idea what to do with our request, because we have not defined any behavior for our application so far. Time to add some, right? Let’s define a simple behavior that serves GET requests and responds with some simple text. We do this by defining a route pattern, which is composed of: * the pattern itself (‚/’ in the example below) * the HTTP method that the pattern can be accessed at (the verb get() called on the application object) * the closure function which will be executed $app->get(‚/’, function () { return ‚Up and running.’; });

As you can see, we have added a simple PHPUnit configuration file, and created a folder to hold our tests. When we attempt to use it, everything seems fine: We’ll create a test class to check the main route we have defined previously; we’ll refer to it further as “status route”, since it tells us our application is up. In the file tests/BasicTest.php we’ll define /** * Basic test class to check the application status route */ class BasicTest extends WebTestCase 9 https://phpunit.de

10 https://www.drupal.org/node/2012184

www.todaysoftmag.com | nr. 42/december, 2015

29


programming Zero to RESTful in 4 easy steps Logging capabilities

Note that we are extending Silex\WebTestCase for our functional test, therefore we need to implement the createApplication() method to tell the test how it can be aware of the Silex application object. It is pretty simple, we are requiring the bootstrap file and returning the $app object. The WebTestCase is defined in an external package, so we need to enhance our composer.json with the following section „require-dev” : { „symfony/browser-kit”: „>=2.3,<2.4-dev” }

The actual test method is extremely simple: we initiate a GET request on the status route, verify that the response is ok (has status code 200) and the actual content is “Up and running”. /** * Checking the status route */ public function testStatusRoute() { $client = $this->createClient(); $client->request(‚GET’, ‚/’); $this->assertTrue($client->getResponse()->isOk()); $this->assertEquals( ‚Up and running’, $client->getResponse()->getContent() ); }

As a matter of personal preference, I like to have tests under their own namespace, therefore namespace TutorialTest needs some autoloading love in composer.json before it can be used. We will need to add to composer.json the following section: „autoload” : { „psr-0” : { „TutorialTest” : „tests” } }

After making thischange, we will need to run

$ composer update

This will resolve all dependencies of the current project, and write the new versions to composer.lock. Let’s run the tests again:

This was just the start of functional testing, you can find out much more on $client usage in Symfony2’s testing documentation.11 11 http://symfony.com/doc/current/book/testing.html#functional-tests

30

nr. 42/december 2015 | www.todaysoftmag.com

Integrating external libraries is done in Silex via providers. Let’s say we want to use the powerful Monolog library12 for our logging purposes. We would view it as a service, and integrate it in our application via a service provider. Luckily, there already is a MonologServiceProvider13 handy, so let’s use it. We start by adding a new requirement in composer.json: „monolog/monolog”: „>=1.6.0” and then run composer update to grab it. We’ll now create the logs folder and give appropriate permissions: $ mkdir logs $ touch logs/dev.log $ chmod -R 766 logs/

Also, we will add the new folder to the .gitignore list, as we don’t want to commit our logs to versioning control. Let’s see a simple usage example of the logging service. Our status route code will be $app ->match(‚/’, function () use ($app) { $app[‚monolog’]->addInfo(‚Logging example in the status route’); return ‚Up and running’; }) ->method(‚GET|POST’);

Checking our logfile will show any request we make. So far, we have an application where we installed a vanilla Silex, responds to a simple GET request, and added TDD support and logging capabilities. In the next part, we’ll design our RESTful API. 12 https://github.com/Seldaek/monolog 13 http://silex.sensiolabs.org/doc/providers.html#service-providers

Georgiana Gligor gb@tekkie.ro Owner @Tekkie Consulting


bookkeeping

Taxes on buildings – what to expect in 2016?

A

ccording to the Tax Code, as of 2016, with some exceptions, any person who owns a building located in Romania shall be required to pay an annual tax for that building. The approval of the New Tax Code will radically change the real estate property tax system, mostly affecting natural persons who own non-residential buildings used for business purposes, namely commercial premises or offices. Ioana Costea ioana.costea@aiconsulting.ro Bookkeeper Managing Partner @ A&I Consulting

The purpose of a building - residential or non-residential – is the main criterion for establishing local taxes for next year. The current Tax Code does not make this distinction and the calculation formulas (tax rate, taxable amount) depend on the owner’s standing: natural or legal person. Therefore, starting with 2016, natural persons currently paying the same taxes, regardless of the purpose of the building, shall pay an increased tax. For commercial premises or offices, they shall pay the same amount as a legal person. The tax will be at least double and could even be 20 times higher. The rate level is decided by the local councils, ranging from 0.2% to 1.3%. The alignment of tax rates depending on the purpose of the building shall redefine the real estate market where, so far, natural persons benefited from lower taxes. Starting with 2016, natural persons, owners of nonresidential buildings, shall be subject to the same tax treatment as companies. Until now, particularly in large cities, the tendency was for local administrations to select their maximum threshold of the tax rate, stipulated by the Tax Code. Consequently, we expect this increase to be significant for natural persons. However, the new Tax Code eliminates increased taxes for owners of multiple real estate properties, as well as the taxes for real estate properties larger than 150 sqm.

Currently, natural persons who own two or several buildings pay an increased tax: 65% higher for the first building in addition to the main residence, 150% higher for the second building and 300% higher for the third and the following buildings. This provision is not included in the new Tax Code.

Residential buildings As of 2016, the tax shall be calculated by applying a rate which ranges between 0.08% and 0.2% from the taxable amount of the building. The taxable amount of the building shall be determined by multiplying the gross built area, expressed in square meters, with the corresponding taxable amount, expressed in RON/sqm., from the table stipulated by the Tax Code. For instance, the taxable amount for a building with reinforced concrete frames or with exterior walls made of burnt brick or any other materials subject to thermal and/or chemical treatment, with water and sewerage system, electricity and heating shall be 1,000 RON/sqm. (for other types of buildings it decreases up to 75 RON/sqm.). Currently, the highest taxable amount is 935 RON/sqm., and the lowest 63 RON/sqm.. The taxable amount shall be adjusted depending on the rank of the city and the area where the building is located,

www.todaysoftmag.com | nr. 42/december, 2015

31


bookkeeping Taxes on buildings – what to expect in 2016? multiplied with a correction coefficient. For instance, for a building located in a city with rank 0, in the A area, the coefficient shall be 2.6 (and it decreases, depending on the rank and area, up to 0.9). The correction coefficient is reduced by 0.10 for apartments located in buildings with more than 3 floors and 8 apartments. Moreover, the taxable amount of the building is reduced depending on the year of construction (by 50%, if the building is more than 100 years old, and it can decrease up to 10%, if the building is aged between 30 and 50 years, including.)

Non-residential buildings

Starting with 2016, the tax shall be calculated by applying a rate ranging between 0.2% and 1.3%, including, on the resulting taxable amount: • Resulted from an assessment report prepared by an authorized assessor1, within the last 5 years prior to the reference year • To construction works, in case of new buildings, built within the last 5 years prior to the reference year • To buildings resulting from the property transfer document, in case of buildings acquired within the last 5 years. In the event that the building amount cannot be calculated using one of the three above-stated values, the tax rate shall be 2%, applicable on the taxable amount calculated for non-residential buildings.

Mixed-purpose buildings The tax shall be the sum between the tax calculated for the area used for residential purposes and the tax for the area used for non-residential purposes. If the two types of surfaces cannot be distinctly separated, the tax shall be calculated for: • Residential buildings, in the event of a registered office, without any business activity carried out in the premises; • Non-residential buildings, in the event of a registered office, with business activity carried out in the premises, and utility expenses registered to the person carrying out the 1 http://www.aiconsulting.ro/servicii-contabilitate-si-cluj-napoca-si-evaluari-bunurimobile-si-imobile/evaluare-bunuri-mobile-si-imobile-cluj-napoca-evaluari-bunuri-cluj

32

nr. 42/december 2015 | www.todaysoftmag.com

business activity. The taxable amount of buildings owned by legal entities shall be the amount applicable on December 31st of the prior year for which the tax is payable and it can be: • The last taxable amount registered by tax bodies; • The resulting amount of an assessment report prepared by an authorised assessor2; • The final amount of construction works, in case of new buildings, built during the prior financial year; • The amount of buildings resulting from the property transfer document, in case of buildings acquired during the prior financial year; • The book value recorded in the accounts by the building owner and submitted to the Concessionaire, Tenant, holder of administration or use right, as applicable. The taxable amount shall be updated at least once each three years, based on an assessment report. Otherwise, the tax rate shall be 5%. At present, if the assessment has not been carried out for 3 years, the tax rate shall range between 10% and 20%, and for buildings which have not been assessed within the last 5 years, the rate shall range between 30% and 40%. Currently, according to local council decisions, large cities apply a tax rate that is very close to the maximum threshold stipulated by the Tax Code for legal entities who reassessed their building within the last three years prior to the reference year. Pursuant to the Tax Code, the councils may decide on a rate ranging from 0.25% to 1.50%. The rates proposed for Cluj Napoca under the Local Council Decision draft for 2016 are as follows: • Residential buildings – a rate of 0.1%/year from the taxable amount • Non-residential buildings – a rate of 1%/ year from the taxable amount Consequently, starting with 2016, the building tax for a natural person, owner of an apartment assessed at EUR 100,000 and rented to a company, with business activity carried out within said premises, shall amount to 1,000 EUR/year. 2 http://www.aiconsulting.ro/servicii-contabilitate-si-cluj-napoca-si-evaluari-bunurimobile-si-imobile/evaluare-bunuri-mobile-si-imobile-cluj-napoca-evaluari-bunuri-cluj


education

Seven Myths About Work That Are Bad for Your Brain

N

ear-constant distractions have become the norm in workplaces around the world. Workers are struggling to get more done and focus harder with little understanding of what attention is or how to attain or manage it productively. Steelcase research revealed seven myths (and their truths) about how to manage your attention at work.

Steelcase Team

1. I can pay attention from the back of the room. Attention depends on how close we are to sensory stimuli. To create new ideas, we have to work in spaces where people can hear well, have eye contact with one another and can easily view shared documents and materials.

2. Sitting down all day will help me focus more. Static sitting sabotages our ability to concentrate, but movement stimulates production of the protein BDNF (brainderived neuro- trophic factor), which helps brain areas vital to learning, memory and concept thinking. Get up, take a walk or encourage your workplace to add a treadmill desk.

3. Drawing is only for creative types. People think in shapes, pictures and patterns— not in numbers and letters. Using digital and analog tools to visualize information can support better

thinking and increase focus. Help your brain organize information by sketching out your ideas or projecting what you are working on.

4. I will be more productive if I respond to email during this phone call. We cannot consciously keep more than two things in our brain at one time. When we think we are multitasking, we are really switching our attention rapidly between things—and the more we do it, the worse we become at prioritizing. Create workspaces away from distractions to encourage focusing on one task at a time.

5. My brain is easily distracted and cannot change. Mindfulness—keeping your mind tuned in to the current moment—can train the brain. The practice has proven to increase gamma activity in the brain, indicating intensely focused thought. Consider identifying a place for moments of mindfulness and peace in the workplace.

www.todaysoftmag.com | nr. 42/december, 2015

33


education Seven Myths About Work That Are Bad for Your Brain

6. If I work more hours, I will get more done. Brains get tired. The brain’s capacity is limited and complete focus isn’t usually possible for longer than 45 minutes. Do your brain a favor and take breaks throughout the day. Move to a café or social area for rejuvenation after an extended period of focused work.

7. I can sleep when I’m dead. Sleep plays an important role in our ability to focus and hold attention. When we are sleep–deprived, our ability to learn, focus and regulate our mood decreases. Consider adding nap rooms or taking short breaks to rejuvenate and refresh the brain. Learning from these myths can help us change our existing habits and gain more control of our brains and our lives. The workplace can help, too. In a work environment designed as an ecosystem of different zones and settings, workers can appropriately select spaces that match their brain modes and needs, helping them Think Better.

34

nr. 42/december 2015 | www.todaysoftmag.com


business

Challenges for companies in 2016

A

new year is always regarded as an opportunity to do things better and to evolve. 2016 could also be an ideal year for the growth of our company, if we manage to properly tackle the challenges in store.

Ana-Maria Trifan anamaria.trifan@ happy-employees.eu PR & Custumer Care Specialist @ Azimut Happy Employees

Before we start talking about next year’s specifics though, let’s review the general context our world is currently facing1 : • A new talent crisis will emerge, due to aging population and outdated educational standards • Until 2020 more people will retire than those who will start working • Europe will need 45 million more workers by 2030 than in 2010, in order to maintain its economic growth; while the United States of America will need 25 million more • 70% of German employers have declared that they feel pressed to find the right people for a job Despite the fact at there is still time until then and we may feel that the situation is not at bleak, the truth of the matter is that the first signs of this crisis are beginning to show. Already several sectors of the workforce market in Romania are beginning to show a dire need of adequate candidates to fill in open roles, which recruiters are having a hard time finding. Only by becoming informed and by 1

Source: Oxford Economics, Workforce 2020: The

Looming Talent Crisis

starting to act now can we avert sinking deeper into this crisis. Let’s begin to analyze the dangers of 2016, and try to come up with solutions for avoiding them.

2016 – a new generation on the workforce market Up to this point, the workforce market was typically made up of Traditionalists (those born before 1945), Baby Boomers (1945-1964), the X Generation (1964-1980), the Millennials, or the Y Generation (19801994). 2016 will bring several new elements into the equation. The first one is that a new generation will hit the workforce market – Generation Z. This generation is made up of individuals born between 1995 and 2010, and revolves around several traits2 such as an increased entrepreneurship sense, increased loyalty, better flexibility, and are more realistic when setting career goals compared to the Y Generation. Almost a third of them aim to become managers in the next 5 years, and 45% of them claim that it will be a challenge to work with the ones from the Baby Boomer generation. 2

Source:

http : / / w w w. h r n e x t . c om /

blog/5-hr-trends-to-watch-for-in-2016/

www.todaysoftmag.com | nr. 42/december, 2015

35


business Challenges for companies in 2016

What can we do in this context? Well, first we must understand that this generation is more prone to picking personal development opportunities and a job that offers a better balance between work and life, than a higher salary paying job. Knowing this, we will be able to better position ourselves on the job market as a company, and we will know how to approach these new managers or colleagues.

A dire need for leaders About 3.6 million Baby Boomers will retire next year3 , leaving behind a significant leadership gap. About a quarter of the millennials will become managers. However, while capable, these individuals still lack the technical expertise and influence of the previous generation. To mend this, we need to focus our attention towards our current employees, offer constructive feedback as much as possible instead of an annual review, invest in a transition plan, and invest in technical trainings and on-line courses.

More and more boomerang employees A boomerang employe is one who leaves a company, only to come back later attracted by the prospect of bonuses, 3

S o u r c e :

h t t p : / / w w w . f o r b e s . c o m / s i t e s /

danschawbel/2015/11/01/10-workplace-trends-for-2016/

Young spirit Mature organization A shared vision Join our journey! www.fortech.ro

36

nr. 42/december 2015 | www.todaysoftmag.com

opportunities or familiar surroundings. Because of the current talent crisis, more and more companies are inclined to use this solution in order to cover the company’s needs. The benefits of this compromise include: less training required, since the employee is mostly familiar with the work, a better familiarization with the company and its work environment, and the added benefit of a fresh employee perspective, gained from his or her time spent outside the company. The challenge here is to find strategies for a smooth reintegration of the employee in the company, and on client projects. We live in a dynamic era and 2016 will only add new challenges. Are we ready to face them? Now that we have a general overview on things, will we, as employers and employees, act in order to benefit, or at least not suffer, from these challenges? If the answer is yes, what will we do specifically? It all depends on us!



sponsors

powered by


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.