Issue 28 - October - Today Software Magazine

Page 1

No. 28 • October 2014 • www.todaysoftmag.ro • www.todaysoftmag.com

TSM

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

Haskell Data Analysis Cookbook

ications

vNext: The future trend of .NET appl

Applied Creativity

Smartweb conference review

Build for fun @ FedEx Day

Software Testing World Cup

How a tech company can become seed investor in startups Websockets – http on steroids TinTag - Internet of Things startup à la Cluj

Concurrency and data binding in JavaFX Clean Code – Comments and Formatting Gogu, Petrică and The Wolf Marketing budget = Advertising budget?



6 Trends, technologies, entrepreneurship and research projects at Cluj IT Days 2014 Ovidiu Măţan

8 Tintag - Internet of Things startup à la Cluj Mircea Vădan

10 What makes you go further? Cornelia Stan

11 Smartweb conference review Claudia Mihu

14 How to Web 2014 Irina Scarlat

16 How a tech company can become seed investor in startups Tudor Bîrlea

18 BUILD FOR FUN @ FedEx Day

28 vNext: The future trend of .NET applications Claudiu Mera

31 Websockets – http on steroids Philip Peterhansl

34 Concurrency and data binding in JavaFX Silviu Dumitrescu and Diana Bălan

37 Clean Code – Comments and Formatting Radu Vunvulea

40 Software Testing World Cup Cazacu Lavinia

42 Marketing budget = Advertising budget? Adrian Abrudan

43 The drones are here Thomas Morris

Andreea Misaras and Camelia Hanga

21 Applied Creativity

44 Gogu, Petrică and The Wolf

Alexandru Palade

Simona Bonghez, Ph.D.

24 Review for “Haskell Data Analysis Cookbook” Radu Marius Florin


editorial

A

Ovidiu Măţan

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

lot of people think that IT is generally comfortable and that it does not narrow down your creativity. The statement is entirely true if we look at it from the perspective of the fact that the employees in this domain can dedicate their time to improving or developing some new applications, whether they are outsourcing or their own. However, the IT ecosystem must be permanently monitored and subjected to an effort of improving the balance between its component parts. Cluj IT Cluster or individual persons have already become aware of this effort. In this respect, we mention Mirel Borodi’s initiative of proposing a law which could bring the development of crowdsourcing financing under regulation. I also recall from the media another proposal regarding the settlement of the business angels type of financing. All these initiatives can bring their contribution to the creation of a favourable climate for putting into practice and developing some innovative local projects. As a matter of fact, you can read in this issue about the first success of a local company, TinTang, which got international validation and support by posting their project on Indiegogo. We cannot talk about initiatives without mentioning the launching in the private environment of two educational projects. I am talking about Simplon, http://ro.simplon.co/, the school preparing the future web developers and entrepreneurs within 6 months, as well as Academy+Plus, http://www.pitechplus.com/#!academy plus designed by Pitech+Plus in collaboration with Ecole 42 from Paris. This second project which aims at developing young programmers unfolds over a period of three years. We have noticed in Cluj, lately, an evolution of the local companies in respect to the transformation of the working place into one which also offers, besides the purely practical advantages, those of illustrating the specific identity of each company. We welcome this movement, which has been accelerated in 2014 by moving into new headquarters that have facilitated this representation. As a matter of fact, in the last few months we had our monthly release events within such new headquarters. The trend will go on for all the release events scheduled until the end of the year. Let’s have a review of the articles in this issue. We begin, of course, with IT Days 2014, the annual event organized by Today Software Magazine, whose agenda is now complete. For registration, we invite you to itdays.ro. What makes you go further? presents the initiative of Accesa TechLeague, which invites you to a workshop led by Florian Ivan. We go on with invitations to take part in How To Web 2014 and Starcelerate. Build for fun @ FedexDay presents the idea of a company from Cluj to stimulate creative projects and introduce them in production. Among the technical articles, we suggest the book review Haskell Data Analysis Cookbook, Clean Code- Comments and Formatting, vNext: The Future Trend of .NET Applications or Websockets – http on steroids. We also invite you to read a new article from the JavaFX series: Concurrency and Data Binding in JavaFX. Finally, I would like to thank the SubSign agency for the new site design of the magazine and my colleague Dan Hadarau, the web magician who has fascinated us with his talent in the implementation of the new site. Thank you !!!

Ovidiu Măţan

Founder of Today Software Magazine

4

no. 28/2014, www.todaysoftmag.com


Editorial Staf Editor-in-chief: Ovidiu Mățan ovidiu.matan@todaysoftmag.com Editor (startups & interviews): Mircea Vădan marius.mornea@todaysoftmag.com Graphic designer: Dan Hădărău dan.hadarau@todaysoftmag.com

Authors list Tudor Bîrlea

Mircea Vădan

Co-fondator @ Starcelerate

www.clujstartups.com

Camelia Hanga

Irina Scarlat

Training Manager @ Betfair

PR Manager @ How to Web & TechHub Bucharest

Claudia Mihu

Misaras Andreea

Software Developer @ Endava

Learning & Development Partner @ Betfair

Cornelia Stan

Ioana Armean

tudor@startcelerate.com

Camelia.Hanga@betfair.com

Copyright/Proofreader: Emilia Toma emilia.toma@todaysoftmag.com Translator: Roxana Elena roxana.elena@todaysoftmag.com Reviewer: Tavi Bolog tavi.bolog@todaysoftmag.com Reviewer: Adrian Lupei adrian.lupei@todaysoftmag.com Accountant : Delia Coman delia.coman@todaysoftmag.com Made by

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

ISSN 2285 – 3502 ISSN-L 2284 – 8207

Claudia.Mihu@endava.com

cornelia.stan@accesa.eu Communications Officer @ Accesa

mircea.vadan@gmail.com

irina.scarlat@howtoweb.co

Andreea.Misaras@betfair.com

ioanaa@imprezzio.com Business Analyst @ Imprezzio Global

Simona Bonghez, Ph.D.

Philip Peterhansl

Speaker, trainer şi consultant în managementul proiectelor,

IT Consultant Automotive @ msg systems ag

simona.bonghez@confucius.ro

Philip.Peterhansl@msg-systems.com

Owner al Colors in Projects

Radu Vunvulea

Silviu Dumitrescu

Senior Software Engineer @iQuest

Java Line Manager @ Accesa

Adrian Abrudan

Thomas Morris

Senior partner & research director @ Loopaa

Freelance Web Developer

Alexandru Palade

Diana Bălan

Director of Product Development @ Yardi România

Java developer @ Accesa

Claudiu Mera

Radu Marius Florin

Software Developer @ Endava

Business & Data Analyst @Fortech

Lavinia Cazacu

Irina Savescu

Quality Assurance Manager @ HP România

Quality Assurance Engineer @ HP România

Radu.Vunvulea@iquestgroup.com

adrian.abrudan@loopaa.ro

alexandru.palade@yardi.com

silviu.dumitrescu@accesa.eu

thomas.imorris@gmail.com

Diana.Balan@accesa.eu

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

Claudiu.mera@endava.com

lavinia.pop@hp.com

radu.florin@fortech.ro

irina.savescu@hp.com

www.todaysoftmag.com | no. 28/october, 2014

5


events

Trends, technologies, entrepreneurship and research projects at Cluj IT Days 2014

W

e continue the series of articles on Cluj IT Days with a new invitation. We had a month to fill in the blanks. We thank all those who have sent us a suggestion for presentation and we are sorry we couldn’t include them all. We will try to include them within our next editions. Let’s have a look over the main sections of the event as well as those of the presentations. Ovidiu Măţan

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

6

no. 28/2014, www.todaysoftmag.com

The event is scheduled to start at 9:00 with the registration, followed by the opening of the event, when we will also release the book entitled “How to build a product”. The f irst s e c t ion, Trends and Leadership, is meant to inspire and set some of the evolution trends for the local companies. The CEO of Accesa, Iulian Iuga, will present to us the evolution of his company from the beginnings till now, as well as the direction it will follow. An originally entitled presentation, The Black Swan, belongs to Dan Ionescu. Firefox OS is a novelty on the market of the mobile operating systems, seen as an exotic and different system. Alex Lakatos, representative of Mozilla and QA team lead in Xoomworks, will present its main characteristics to us. We continue after a short break with an analysis of the local IT market from the perspective of Voicu Oprean, CEO Arobs. He will be followed by Bogdan Herea, Pitech Plus CEO, whose presentation will focus on the evolution

from outsourcing to products. In fact, the subject of his presentation, often seen as an important trend among the companies in Cluj, will constitute the main theme of the presentations in this section. We end this first round of presentations with that of Diana Ciorba, who will analyze feminine leadership, especially in the IT area. After the first break, the series of presentations having the technical area as a theme will be opened by Silviu Dumitrescu, who will present the novelties of Java 8 and Java FX. Peter Lawrey, our special guest to this edition of IT Days, whom I introduced in detail in my previous article, will speak to us about Java Performance and what we can do to improve it in our applications. We go on with a presentation from the software architecture, belonging to Sergiu Damian, who will talk to us about software Architecture for startups and will explain why it is more difficult to build the next Twitter than a banking platform.


TODAY SOFTWARE MAGAZINE

Functional languages such as Scala or F# have made the transition from fashion to necessity in the commercial applications. More and more companies are adopting the transition towards them in their projects. Ovidiu Deac, employee of Ullink and software consultant, will detail upon the conditions ensuring this evolution from the perspective of the advantages offered by these languages. Why do we develop software? This is the question which Adrian Bolboaca, Mozaic Works consultant, will try to answer. We got used to building software, but most of the times we forget the reason why we are doing this. The purpose of the presentation is to show what a quality software product is, how accompany can have an organic growth and how programmers can help their clients and companies to develop quality products. Our next speaker is an UX & interaction designer, trained as a philosopher. His presentation, How can we interactively think about user experience?, has as a subject the UX design which incorporates aspects of the technical domains such as informatics, architecture, graphical design, industrial design on the one hand, and on the other hand it tries to integrate aspects of the liberal arts: cognitive sciences, psychology, anthropology, sociology. Why liberal arts? Because their activity domain is precisely the human being (the user) and his existence (experience). Human sciences are, however, a rather recent invention (150 years at most) compared to the discipline having the same activity object, of which they have developed: philosophy. In respect to the human being and what happens to him, philosophy has an expertise of over 2000 years. Big Data is still a fashionable subject, and Silvia Rausanu promises to tell us

more about this tendency which puts a lot of pressure on the leaders of the business based on online applications, on the IT companies, but also on each developer who wants to keep up with everything that is fashionable. The business world is pressured not only by the alignment to the new technologies, but also by the bigger and bigger quantity of data and by the increase in the number of data sources. There is no success recipe on how one can approach the big data issue, not even from the technical point of view – there are at least 20 NoSQL data bases and innumerable mapreduce executor distributions. But once we acknowledge the importance and the positive impact on business development, the architecture, the storage solution and the algorithmic approach derive much more easily from the functional requirements. Victor Ionescu’s presentation, A new enterprise user experience of UI5 and SAP Fiory, will prove to us that the applications developed from the perspective of the user lead to a higher productivity and help the enterprise users to become more Agile. These concepts will be put into practice by using SAP methodologies and technologies. The theme of testing is also approached on the first day of the event, in the second presentation of Alex Lakatos, Testing in the main league, which will describe the testing methods in the big companies such as Facebook. At the end of the first day, we invite you to a glass of wine and a little bit of socializing. T he e ve n i ng c ont i nu e s i n t he building of the old Casino, where our colleagues from the Contemporary Cultural Association invite you to take part, from 18:30, to an event entitled Origins, which will be a real lesson on the history of the

Romanians. Among the changes we have made this year in comparison to the 2013 edition was introducing the Java Performance and Agile & Software Craftmanship workshops on November the 24th, scheduled one day before the beginning of the event. The interest shown by the local companies is high. In the case of the Java workshop, we will have Peter Lawrey as a speaker, who is 3rd in Java on Stackoverflow and 2nd in concurrency. Though initially it was not part of the plan, we were asked to even introduce a branding of this workshop. In the case of the Agile & Software Craftmanship one, the purpose is to improve the manner of reaching performance through a better estimation and planning of the sprints as well as an introduction to coding Kata. The workshop targets the programmers, testers, software architects and managers. I hope I’ve managed to talk you into participating. The number of participants is limited to approximately 230 people, and registration for the event can be done online. In order for the share of information to be complete, participants will go home with the book called “How to build a product”, where part of the presentations will be detailed.

www.todaysoftmag.com | no. 28/october, 2014

7


startups

Tintag - Internet of Things startup à la Cluj

D

uring the last year, I forgot my tablet in various places at least 3 times (in the supermarket, in restaurants, at events) - luckily I recovered it quite quickly every time. One of my phones is still in Bulgaria somewhere, it had fallen from my pocket. With the wallet there’s no problem: I forget it at home all the time, this way I know for sure where it is. Let me be clear about all these: I’m not forgetful! Perhaps, a little careless, but I’d rather prefer to think it happens to anyone, anytime and anywhere.

As a proof, Andrei Alexandru and Chis Vig told me they had the same problem, just that they do not have to make a mess out of the whole room to find their keys, but they’re using now Tintag, a device invented by them that comes with an app for iPhone (Android version is in the works).

8

More specific: Tintag (www.thetintag. com) helps you find things almost lost (in the future, even those lost forever!?!). Simply attach the device (it has the size of a coin) as a keychain to an object, pet or other items. In the smartphone application, you can set a range (1 to 50 meters) and the new Tintag will send a signal to your smartphone if it is taken out of this range. In addition, you can see the distance to that Tintag device. It works the other way around as well: if you lost your smartphone, but you have a Tintag device around you, just click on it and the smartphone will start to vibrate and ring (provided it is within range, of course). Sounds quite simple, right? Errr, not really: the two co-founders have been working on this idea for more than a year now, along with 4 other employees. Both Andrei and Alex have almost 10 years of experience in IT and tracking devices and, as a team, they have been working together for several years already, they began with outsourcing, but meanwhile they have also developed their own products. After some serious thought, the founders decided not to seek investors, but instead they created a crowdfunding campaign, also with the aim of getting market validation. Actually, a really good thought: if potential users do not want to support

no. 28/october, 2014 | www.todaysoftmag.com

the campaign, then there is no point to continue. The Indiegogo campaign was launched on September 7th and just 31 days later they reached their proposed amount: $50,000 from 1,200 funders (mostly in Romania, USA and Canada). The campaign continues for another month, so it can reach the amount of 100 thousand dollars, thus having more resources to develop other product features. The prototypes will be delivered in November and their improved version in April, next year. Regarding the technical implementation, the biggest challenges were related to devices size and parts combination, more specifically positioning them so that the range is not affected. Tintag uses BLE (Bluetooth Low Energy) technology, operating on a frequency of 2.4 GHz. The next challenges for them were to obtain the CE and FCC certifications, to deliver the prototypes to backers and finding a reliable supplier to scale up the device production. If the campaign will get to $150,000, they will even think about opening their own production line. Future device versions will provide the opportunity for customization (various lights and sounds, adding accessories), the SDK will be released to other developers and they even consider the use of the


TODAY SOFTWARE MAGAZINE

device as a panic button (when pressed, it sends a default alert/message to someone). And that’s not all: in the future, the device will send a signal to any smartphone in its range that has the Tintag application installed, which in turn will send information to Tintag servers and you’ll find out where the lost/stolen object was detected. By the way, another suggestion: Tintag for forgotten passwords - many would need/use such a device :-)

PCB prototyping machine

R el ate d to t he i r c amp ai g n on Indiegogo, you can read bellow some good tips, coming directly from Andrei and Alex: • a pre-campaign helps quite a lot in promotion (in just 3 weeks, they collected 1,000 email addresses from people interested). Ideally, the pre-campaign should start 2-3 months before;

• even if it may seem boring, reading the Indiegogo documentation and recommendations is very useful: a lot of practical advice gathered during previous campaigns (so far on Indiegogo there were more than 50,000 campaigns, the success rate being of 30%); • social media is extremely important, both for spreading the word and for keeping in touch with the campaign supporters, book time for replying to their questions; • „stick to what you know” - not having so much experience on the marketing side, they got help from another company on this side (DirectSpark, http://directspark.ro/), help which proved to be a really good choice. Of course, there is competition, I assume you’ve already thought of Tile ($15,8 million in investments), only that once Tile’s battery is empty it can be thrown away as it would be no longer possible to use. Well, Tintag is the only rechargeable device of this type. After 6 hours of charging, the battery lasts for four months. Tintag is among the local pioneers in at least two areas: hardware product and crowdfunding, their campaign being among the first successful campaigns on Indiegogo with a Romanian product. I’m really glad to see that it was initiated in

Cluj and I hope to see other local projects following this successful path. PS: In the meantime, until I get my ordered Tintag devices, if you see a tablet with a sticker „I love startups”, please contact me, it is likely that I have forgotten it somewhere.

Mircea Vădan

mircea.vadan@gmail.com www.clujstartups.com

www.todaysoftmag.com | no. 28/october, 2014

9


education

What makes you go further?

S

omething more than the overall perspective, farthest from the barrier of any conventional solution, beyond the individual knowledge, regardless of the time frames and against mainstream.

You and TechLeague

You are the one who lets your curiosity reign beyond any known limits. The one to whom details make a difference. The one who, through experimentation and exploration, decants its experience and further shares it with others, thus by setting even higher milestones for himself from which resumes its learning. You are the one who is the pedagogue, the autodidact, pursuing innovation and stating your initiatives; the one who doesn’t have boundaries in your evolution. You are the one that always goes further. Over time, we have learnt what matters most for people like you - the ones who have always overcome expectations, only to bring to light new solutions and to refine – day by day - the definitions of performance and efficiency. People whose contribution – both as individuals and as a team - manages to bring a change in technology and IT. For these things, which matter in your evolution, we have founded TechLeague. Thinking about learning, mentoring, knowledge-sharing, promoting excellence in the IT field, innovation and initiative – we built six pillars that are meant to speed up the access to these opportunities through special events and programs that support IT enthusiasts to reach their potential in their way to exceed their own boundaries. TechLeague’s 6 development pillars are: TechCampus, TechTraining, TechInspire, TechCorner, TechExcellence and Tech Initiative, each one of them being meant to contribute to an IT specialist’s career.

Intensive Agile TechTraining

TechLeague’s most recent event is Intensive Agile TechTraining, and it covers topics as: • Introduction to Agile methodologies and practices • Various approaches in Agile: Scrum, XP, Kanban, Lean, FDD, Crystal, DSDM;

10

• Agile teams: roles and responsibilities, responsibilities for project teams, communication and stakeholders’ management, leadership and management in Agile projects, best practices and instruments; • P r o j e c t i n i t i a t i o n : portfolio and project management, key indicators in projects; • Backlog management: value, planning, organizing and prioritizing, reprioritizing, change management; • R e l e a s e / i t e r a t i o n planning: agile planning concepts, estimation-related techniques, story mapping, product roadmaps, wireframes; • Iteration: daily standups, ret rosp e c t ives and reviews.

Organized by

Part of

INTENSIVE AGILE Cluj-Napoca, 14th – 15th of November 2014

2 days of training in managing agile projects, increasing productivity and developing strong collaborative relationships by using Agile methodologies

TRAINER Florian Ivan CSM, CSP, PMI-ACP, PMP, Prince2 Practitioner, MCTS

Embrace change, deliver excellent results and learn more about: agile delivery teams, project initiation, backlog management, release & iteration

The 2 days training aims to offer a better insight on improving project management, boosting productivity Available places 10 Be the first to register at: and developing stronger collaParticipation fee 150 € diana@tech-league.net boration relationships between until 31.10.2014 team members by using Agile methodology. The program will be held by Florian Ivan, trainer with over 15 years of PMI-ACP, CSM, CSP, Prince2 Practitioner, experience in the software industry. MCTS. Intensive Agile TechTraining Florian is a project management con- takes place on 14-15 November 2014, in sultant and trainer with a strong focus Cluj-Napoca, at Ferdinand Galleries (6 on Agile methodologies. His prior work Ferdinand Street). It’s an open event, with experience includes managing programs limited number of seats: 10. If you want to for Microsoft Corporation and overseeing attend, send us an e-mail at diana@techthe development of a business intelligence league.net, until 31.10.2014! start-up from creation to acquisition. Since 2011, he is the Managing Partner of Rolf Cornelia Stan cornelia.stan@accesa.eu Consulting, a German company specialized in change management. He holds a Communications Officer @ Accesa master’s degree in project management from the George Washington University and the following certifications: PMP,

no. 28/october, 2014 | www.todaysoftmag.com


events

TODAY SOFTWARE MAGAZINE

Smartweb conference review

S

martweb is an annual event dedicated to designers, developers and entrepreneurs from South Eastern Europe. This year, Smartweb was held in Bucharest, organized by Evensys, and I had the chance to be there thanked to Today Software Magazine. The event is split in two parts lasting two days: on the first day, there are two parallel eight hour workshops, and on the second day, there is a conference with worldwide known speakers. This year, Jeremy Keith, Kaelig, Marko Dugonjic, Harry Roberts, Remy Sharp, Zoe Gillentwater, Ana Tudor and Bruce Lawson were present in Bucharest. Their presentations tackled themes like responsive design, Html, Css, Javascript and web standards. Jeremy Keith is the author of the books “Bulletproof Ajax”, “DOM Scripting” and “Html5 for designers”. He came with the proposal that websites don’t have to look the same on every browser. He sustains that it is acceptable that some elements appear different on some browsers, basically the older versions that will not be used for long time from now on. The developers should concentrate on a website’s functionality, then on its form. Users choose the browsers and devices based on their needs and we, as developers, should respect their decisions by building adaptive and responsive websites. He advises to invest out time in the newer versions, to be “future friendly” and he gave as example the first website 1 ever. The website appeared in 1989 within a nuclear research institute in Sweden, and indeed the first web pages don’t have a modern design (in time, there were new pages added with a new design) but they work on today’s browsers with the same purpose they were built in the first place! He expects us developers to understand that the differences between

browsers are a feature of the web and we have to accept it that way. The real problem is in understanding those differences, and the solution would be to convince our customers, even our project managers, of this. Good luck convincing the testing team! For this purpose, there is a site2 that can help us sustain our point of view. Agreeing with Jeremy, I mention what Brad Frost wrote in an article on a similar subject: ”there are a lot of different Blackberry versions out there and there is not enough time in the day to make our website rock solid on every version”. Our duty as developers is to offer users a decent experience on our website on different browsers. Kaelig was a front end developer at the newspaper http://www.theguardian.com/ uk and the author of the book “Css maintenable with Saas”. Thirty engineers from different parts of the world are working on Css and Html at The Guardian3, and the Css code has about 25000 lines. 2 d ow e b s it e s n e e dt o l o o k e x a c t l y t h e s a m e i n e verybrowser.com

1 info.cern.ch/hypertext/WWW/TheProject.html

He told us how the communication gap between developers and designers was reduced at the guardian using Saas. Saas is a Css preproccessor that adds programming to Css by using functions, operations and variables. At the guardian there are so many fonts and colors that their use in Css can get difficult. By declaring variables as in the example below, in Saas you can define a font only once and later use the variable containing the font name without being necessary to remember each time the exact font name: $font-stack: Helvetica, sans-serif; body { font: 100% $font-stack;}

You can nest selectors like in Html to have a better view of the elements hierarchy. Declaration blocks can also be reusable through mixins which can have input parameters and can be used later with the @include directive, for example: @mixin border-radius($radius){ -webkit-border-radius:$radius; -moz-border-radius:$radius; -ms-border-radius:$radius; border-radius:$radius;}

3 www.theguardian.com/uk

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 | no. 28/october, 2014

11


events Smartweb conference review You can also create partial Sass files in which you can place a reusable piece of style; the files will be preceded by “_” and will have the .sccs extension( for example _header.scss), and it can be usable in your main Css file with the @import directive and the partial name( example @import ‘header’;). You can even use the advantages of inheritance in Saas: .message { border: 1px solid #ccc; padding: 10px; color: #333; } .success { @extend .message; border-color: green; }

Theguardian.com has reached, from 20 deploys per year, to 4 deploys per day. Within this context, an efficient and well organized communication seems more than necessary for the website’s success, so people working there made up a fonts matrix, in which they have, for each font used in different page sections (title, subtitle, article body), values containing: the font name in Photoshop , real Css font name, abstract name for developers, and a friendly name for meetings and discussions. Marko Dugonjic from Croatia is the runner of the website4, editor at Smashing Magazine and coauthor of “The Smashing Book #4”. His presentation targeted replacing lorem ipsum content with content prototyping. If we as developers don’t know the content our site is going to have, most probably the website will end up with a generic structure that is hard to modify afterwards and a generic design. The first step he recommends is to do anything to collect the content from: brochures, reports, FAQs from the domain of the company for which the website will be and to personally ask questions about the company. If we have the chance to pay the client a visit, he considers useful to take a camera to capture their physical logos that will help us establishing the design, the colors and can be used even as resources. He thinks it is a good idea to steal competition content so our customer will have a starting point in creating their own content: he will try to overcome his competition by coming up with a better content. He recommends early establishment of the content lifespan: there can be permanent content (profile, contact information) and there also can be temporary content formed by campaigns and sales. We can establish the skeleton of the future pages from the beginning, in CMS if we use one, and it would be important in this phase to leave aside any design, so the fact 4 www.creativenights.com/about

12

that certain pages still need work remains out there; otherwise if a page has a certain amount of design implemented, the client tends to consider that page as finished and he will ignore it even if the functionality behind it is not done yet. Implementing authentication could be of great help if you give the client some roles, by sharing with him the responsibility of browsing and filling the content gaps as soon as possible. Once we have the above drafts, we can establish much easier the website’s architecture and design to better emphasize the content. We can, at this point, establish the content templates. Marko recommends the gradual distribution of the content on the page, depending on user experience. For new users the information should be grouped in the part of the page that is most accessible visually. For intermediate users he recommends a different part of the page. For experienced users that are already familiarized with our website and know where they can find the information, we can assign a less visual part of the page. For sorting the content we can also use the page meta data and include there the concise information for new users. For easier browsing, Marko recommends the creation of a user manual, with simple and clear steps, and if payment methods are involved, it would be good that we expose a clear explanation, so keep in mind as early as possible the templates for this type of content. We can think of a template for a glossary where we can have definitions for terms from the area of the website, and other templates to present the company’s time line. It is said that exposing employees profiles on the website with concise information about their activity, education and especially hobbies would humanize the company for which we create the website. The usage of high resolution images and anticipated implementation of configurable content limits are the next recommended steps. For temporary content for loyal customers he believes it would be optimal to establish as early as possible with the client: • the schedule for publishing the content of campaigns (Halloween, Christmas, etc.) • the presence of recurring activities, don’t delete the content, but hide / show it regularly (example: articles about cold) • the list of categories and possible future topics; • different typography per category; could highlight more the categories

no. 28/october, 2014 | www.todaysoftmag.com

• charts needs • images size and variations • menu, that should be organized by user experience. By having the content as early as possible we can achieve a stable architecture of the website, we can set customer expectations early and most importantly, we can create a specific design. Remy Sharp is the founder of the UK conference on Javascript, Full Frontal, coauthor of “Introducing HTML5” and one of the administrators of Html5Doctor. com. He made ​​a small demonstration using NodeJS of a real-time application in which the audience was involved. Harry Roberts , author of numerous articles on UI , made ​​a presentation of the Css frameworks comparing them to UI toolkits, they are often confused with. A CSS framework is obviously a framework that facilitates working with CSS by providing several tools to help, but not the complete solution. Examples of CSS frameworks are: Bootstrap, Foundation, and Inuit Css. He personally collected the reasons why Css frameworks are avoided: they have too many warnings, too many opinions, they don’t offer complete tools. Apparently the exact purpose of a CSS framework is not understood: a CSS framework is useful for a unique project for which we need to write from scratch a particular, unique solution, we therefore need just a “helping hand”. If what is on the market regarding Css frameworks is not useful for us he recommends we implement our very own Css framework, instead of customizing an UI toolkit. Zoe Gillentwatter from Booking. com talked about the advantages of CSS3 Flexible Box ( or flexbox ), a very effective way to place Html elements in a container, relating their coordinates and direction to it. Elements can expand or compress to fit parent container. Although it has a high enough coverage, not all browsers support it yet. It is implemented by FF18 +, Chrome 21+, IE11, 12.10+ Opera, Safari 6.1 and in some browsers it must be preceded by --webkit. She gave the example of a table header spacing with table-layout: fixed. As cells, the columns of the table are at an equal distance from each other. But if we look only at the text inside them, which obviously will not have the same length in each cell, the text will be at different distances. Flexbox has the solution to this problem with the following two properties


TODAY SOFTWARE MAGAZINE applied to the container:

display: flex; Justify-content: space-between;

Ana Tudor was the only Romanian presenter at the conference. The title of her presentation was “Css use and abuse”. Using Codepen, a “playground” for web designers, in which you can play with Html, Css, and Javascript, she made several 3D animations in CSS3, without any Javascript. She reminded us of the example of Mona Lisa painting made entirely in Css with over 7000 lines of code5. She implemented an expandable polyhedron, an icosidodecahedron, the 3D rotation of an elastic curvy surface, a seasonal animation: a figure that resembles a Halloween pumpkin that jumps on the x axis and expands and contracts when reaching axis limits6. The last presentation was a very funny one, by Bruce Lawson, who was also the host of the event. He is co-author of “Introducing HTML 5” book, part of the organization “Web standards project” and currently works at Opera. In his presentation he made a summary of important moments in the history of web standards in a very comic manner. He presented the moment in 2009 when HTML5 has won the battle with XHTML2 not because HTML5 is trying to support old browsers but because it supports old content. He drew attention to a strange error in HTML 3.0 in which appeared a new element <figure> that included the element <caption> but it did not work. The reason was that, in previous versions, <caption> was designed to operate only within the <table> element, so it was replaced with <figcaption> in Html5. The entire conference was exciting, informative, well organized, and left me feeling that it is not addressed only to developers and designers, but there were useful information for you Today Software Magazine for the invitation to the conference anyone in the IT field. Sponsor from booking.com launched a and I recommend you all to attend the next edition! challenge: the first to finish Amsterdam’s coat of arms in Css and Html won a trip to Amsterdam. I had the opportunity to exchange ideas with branch colleagues from Bucharest. The number of participants was very high, several hundred people, from where I Claudia Mihu Claudia.Mihu@endava.com understand it was a success in previous years. The speakers were relaxed, very well prepared with technical demonstrations and Software Developer tips (which I try to apply on projects that I’m working), with clear @ Endava and interesting examples, and latest trends in the industry. Thank 5 cssdeck.com/labs/mona-lisa-with-pure-css 6 codepen.io/thebabydino/

www.todaysoftmag.com | no. 28/october, 2014

13


events

Future tech trends, game development, product management

B

and angel investment at How to Web Conference 2014

ucharest, October 8th 2014 – How to Web, the most important event about innovation, technology and entrepreneurship in South Eastern Europe, will take place on November 20 - 21 in Bucharest, Romania. The conference reaches its 5th international edition this year and it showcases an enhanced format, with a main track that will explore future tech trends and entrepreneurship and secondary tracks dedicated to game development, product management and angel investment. Very Early Bird tickets are available until Wednesday, October 22nd, on the conference website howtoweb.co The 5th international edition of How to Web marks a new beginning for the conference: the event brings about a more mature format and discusses in depth several specific subjects. The main stage of the event will host thrilling talks about future trends that will impact businesses and industries worldwide, tech entrepreneurship, getting an investment or building tech products with disruptive potential. Technology leaders focusing on innovation in a broad range of disciplines and worldwide known professionals will take the stage to share their expertise and best practices learned over the years. Among the guest speakers that have confirmed their attendance to How to Web Conference 2014 there are: Manuel Heilmann (Co-Founder & CEO Coinzone, startup that enables businesses and individuals to easily conduct transactions with digital currencies such as bitcoin), Ze Pinto Ferreira (Co-Founder & CEO FNV Labs, the producers of Mellow, the first sous-vide machine for cooking controlled through smartphone whose crowdfunding campaign was oversubscribed 300%), Florian Meissner (CEO & Co-Founder EyeEm, Germany, the world’s premier mobile community and marketplace for photography aficionados having more than 10 million users from over 100 countries),

14

Paul Papadimitrou (Innovation Strategist, UK, reputed analyst and coveted speaker that has delivered keynotes at events all around the world such as LeWeb – Paris, London; SXW – US; or Social and Digital Marketing Conference – New York, Singapore, London), Michael Ni (Senior VP Marketing & Products Avangate, US, Romanian company that was acquired last year by the leading VC Francisco Partners) or Dennis Cox (Chief Product Officer IXIA, US, entrepreneur whose company was bought by IXIA in 2012 for

no. 28/october, 2014 | www.todaysoftmag.com

160 million USD in cash). The novelty of How to Web Conference 2014 consists in the three specialized tracks on product management, game development and angel investment that will be organized as part of the event. These are addressed to specific categories of audience that will get the chance to acquire essential competences matching their interests and field of activity, as well as the opportunity to network with renowned professionals in the industry. The Product Track is developed in collaboration with Mozaic Works and will teach the audience how to manage tech products, get user input and prioritize development stages while coordinating a flawless execution. Ragnar Saas (Co-Founder PipeDrive) or Mark Tolmacs (Product Manager Ustream) are among the specialists that will deliver instrumental talks on best practices and success stories, thus setting new quality benchmarks for delivering a great user experience from the first click to the last.


TODAY SOFTWARE MAGAZINE Game developers will also have the opportunity to learn from the experience of some of the most important gaming companies in the world by attending the GAME DEVELOPMENT TRACK organized together with Romanian Game Developers Association (RGDA) with the support of King and Mobility Games. Renown professionals such as Vlad Micu (Head of Studio, Critical Force Entertainment) or Mathieu Muller (Field Engineer, Unity Technologies) will share the secrets to their games’ global success through practical examples and hands-on case studies, thus helping the participants feel the pulse of the regional gaming industry, meet the people behind the games, and understand the mechanics underlying global hits. Organized in collaboration with Angelbootcamp with the support of Trento Rise, the ANGEL INVESTMENT TRACK is an event exclusively dedicated to angel investors that brings into discussion best practices for investing in early-stage startups and derivative opportunities. Jonathan Bixby (Executive Director GrowLab, having raised the biggest business angel financing round in Canadian history), Rune Theill (Co-Founder & Program Director Rockstart Accelerator), Simon Jenner (investor & Co-Founder Oxygen Accelerator), Adrian Gheară ( a n g e l i nv e s t o r t h at h a s f u n d e d 123ContactForm), Mălin Ştefănescu (angel investor supporting Green Horse Games), Lyuben Belov (angel investor and Managing Director LauncHub), as well as other top-notch angel investors and accelerators from all around the world will discuss about how to get the best deals, hands on investing, the due diligence process, raising angel money or working alongside accelerators. How to Web Conference 2014 is an event organized with the support of Telekom Romania, IXIA, Bitdefender, G r a p e f r u i t , Av a n g a t e , S o f t l a y e r, CyberGhost, Hub:raum, Domain.me, the Canadian Embassy in Romania and Reea and will take place on November 20 and 21 at Crystal Palace Ballrooms, Bucharest, Romania. Very early bird tickets starting at 49 EUR are available online until Wednesday, October 22nd, on the conference website http://howtoweb.co Early stage tech startups in Central and Eastern Europe that are building innovative products with disruptive potential are invited to apply for the third edition of Startup Spotlight, competition

and orientation program for the best 32 teams in the region that will take place in between November 19th and 22nd. The finalists that will be accepted into the program will compete for the 20.000 USD cash prizes offered by IXIA, main partner of Startup Spotlight, and will attend mentoring sessions and dedicated workshops. Startup Spotlight applications are open until October 20 and they are made online on the program website startupspotlight. co The visibility of the event is ensured by the main media partners Netocratic, Inventures.eu, Newtrend.bg, IT Dogadjaji, Digjitale, The Pole Society, Adevărul Tech, Play Tech, Hotnews.ro, Forbes România, Wall Street, Capital, Yoda, Times New Roman and the media partners Cariere, Business Review, Business Woman, Business Cover, Business 24, Incont. ro, Manager Express, Today Software

Magazine, Gadget Trends, Comunicaţii Mobile, PC World, Agora, Games Arena, Ctrl-D, Startups.ro, România Liberă, Academia Caţavencu, Evenimentul Zilei, Zelist, Comunicatedepresa.ro, Ziare.com and Ejobs.

Irina Scarlat

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

www.todaysoftmag.com | no. 28/october, 2014

15


events

How a tech company can become seed investor in startups

I

n 2011, Marc Andreeseen, general partner and cofounder of Silicon Valley venture capital firm Andreeseen Horowitz, stated that “software is eating the world” and will continue to do so. Fast forward to now. We are reaching the end of 2014, and now more than ever there is an “entrepreneurial explosion” in which new companies are disrupting every niche of every industry. There are building blocks that allow for faster iteration (APIs, open sourced code, cheap hosting, free education on programming frameworks, etc.), industry methods that make it accessible for an aspiring entrepreneur to launch a company (eg, the lean startup), and accelerators and programs that offer hands-on support and assistance throughout the journey. Internet companies have so many resources and building blocks that it’s getting quicker and leaner for them to iterate and find market opportunities. In essence, there are a lot of high quality startup investment opportunities out there, and they’re only increasing. It was only a matter of time to see tech companies ride this opportunity wave and for good reason. By getting involved as investors, tech companies open a new space where they can get early in exciting projects, make better use of their internal talent and expertise, work with (and for!) amazing people, and brand themselves as experts in certain industries. And very important it is the opportunity to bring in higher profits, through successful investments and also by leveraging the new connections created in the process. Tech companies looking to start investing their resources in startups often ask what is required to do that the right way. Similar to angel investors, tech companies have to decide on what resources they have available for investing – best practices advise on maximum 5% to 10% of their total resources, but at least 100-200 man hours per year. Then they need to have a process in place: the deal flow. This process covers key issues: where to find the right startups, how to evaluate an opportunity, how to invest and how manage the investment and partnership. Motivation plays a very important role here and by setting clear objectives, a tech company can open a new field of opportunities. The ultimate objective is, of course, reaching higher ROIs. But investing in startups, admittedly risky, comes with opportunities otherwise unavailable. Here are some of them for a company in Europe: 1. Marketing – getting involved with exciting projects located in the

16

entrepreneurial centers of Europe is a chance to brand a tech company in a new way; it is a way to position the company above the competition, by showing forward thinking and good will. 2. Business development – as part of the startup, you will have the attention and the opportunity to network with high profile entities located in different markets. 3. Skill building and recruitment – the direct effect of your involvement in a startup project will be the creation or expanding of the new skillsets for your employees and getting in touch with entrepreneurs and professionals based in new markets creates talent opportunities.

efficient way to work with startups; and how to structure an investment, covering issues like valuation and legal paperwork.

If you want to see live how this works, you can join us as tech company in the next Startcelerate event. We have our next Startcelerate Pitch & Match event in London, on the 31st of October and 1st of November this year, at Level39 in Canary Wharf, and it is a great opportunity for tech companies to meet startups that fit the companies’ interest. It is also a networking opportunity, as event partners and guests include big universities, accelerators, law firms and corporations from the UK, Germany, Belgium and Holland. To get this conversation going, check our event page at www.london.startceleNow, creating all the above mentio- rate.com and drop me a line at tudor(at) ned elements that would allow a company startcelerate.com. to pursue the opportunity is neither an easy job, nor a job that requires just some attention. But this is where Startcelerate, the startup my team and I are developing, steps in and lifts some of the burdens and facilitates tech companies’ entry into this new opportunity area. Very briefly, Startcelerate is a Londonbased startup that facilitates the direct investment of resources from established companies into startups, covering the entire flow: from discovery, to matching, to the partnership creation and partnership management. Our main product, Startcelerate Pitch & Match event, and our legal framework are the main elements for delivering such solutions. Startcelerate also provides support to tech companies interested in investing in startups by organizing an interactive workshop that covers Tudor Bîrlea tudor@starcelerate.com the very practical issues of how to find, filter and evaluate startups; how to set up a Co-fondator @ Starcelerate deal flow so tech companies can have an

no. 28/october, 2014 | www.todaysoftmag.com


TODAY SOFTWARE MAGAZINE

communities

IT Communities

A

utumn in IT comes with an increased number of events having a large audience. We hereby invite you to take part in Cluj IT Days 2014 and the conference dedicated to the developers of mobile applications MobOS and T3EE in Cluj. In Bucharest, we note DefCamp in the end of November.

Transylvania Java User Group Community dedicated to Java technology Website: www.transylvania-jug.org Since: 15.05.2008 / Members: 589 / Events: 47 TSM community Community built around Today Software Magazine Websites: www.facebook.com/todaysoftmag www.meetup.com/todaysoftmag www.issuu.com/todaysoftmag www.youtube.com/todaysoftmag Since: 06.02.2012 /Members: 1826/ Events: 24 Cluj Business Analysts Comunity dedicated to business analysts Website: www.meetup.com/Business-Analysts-Cluj Since: 10.07.2013 / Members: 91 / Events: 8 Cluj Mobile Developers Community dedicated to mobile developers Website: www.meetup.com/Cluj-Mobile-Developers Since: 05.08.2011 / Members: 260 / Events: 16 The Cluj Napoca Agile Software Meetup Group Community dedicated to Agile methodology Website: www.agileworks.ro Since: 04.10.2010 / Members: 433 / Events: 91 Cluj Semantic WEB Meetup Community dedicated to semantic technology. Website: www.meetup.com/Cluj-Semantic-WEB Since: 08.05.2010 / Members: 191/ Events: 28 Romanian Association for Better Software Community dedicated to experienced developers Website: www.rabs.ro Since: 10.02.2011 / Members: 249/ Events: 14 Testing camp Testers community from IT industry with monthly meetings Website: www.tabaradetestare.ro Since: 15.01.2012 / Members: 1219/ Events: 35

Calendar October 21 (Cluj) Launch of issue 28 of Today Software Magazinewww. todaysoftmag.ro October 22 (Cluj) Digital Marketing Community Launch meetup.com/DigitalMarketingCluj/events/213782162/ October 23 (Cluj) 3rd BIG data/Data science Cluj-Napoca Meetup meetup.com/Big-Data-DataScience-Meetup-Cluj-Napoca/events/213544492/ October 24 (Cluj) Catalysts Coding Contest in Cluj codingcontest.catalysts.cc October 30 (Cluj) TeCOMM tecomm.ro October 31-1 November (Cluj-Napoca) Typo 3 - T3EE conference www.t3ee.org November 4 (București) The D Programming Language: Getting Started eventbrite.com/e/the-d-programming-language-gettingstarted-tickets-8870803813 November 20-21 (Cluj) MobOS Conference romobos.com November 22 (Cluj) OSOM – Open Source Open Mind osom.ro November 25-26 (Cluj) Cluj IT Days - TSM recommandation itdays.ro November 28-29 (București) DefCamp 2014 defcamp.ro www.todaysoftmag.com | no. 28/october, 2014

17


contest

programare

BUILD FOR FUN @ FedEx Day

I

Andreea Misaras

Andreea.Misaras@betfair.com Learning & Development Partner @ Betfair

Camelia Hanga

Camelia.Hanga@betfair.com Learning & Development Manager @ Betfair

f you happen to pass by Betfair’s office in October, there are high chances you’ll hear everybody talking about FedEx Day. You don’t really know what to expect. Are we ordering something? Is this some kind of special delivery that everybody’s excited about? Are we getting something cool? Besides, if you’re a manager it looks bad not to have the tiniest clue of what’s going on. But I’m freaking out for no good reason. Just when I could picture the FedEx van in front of the office, things start to get clearer. Some posters show up around the office saying:” FedEx Day. 9-10 October” &”Watch your inbox”. OK...I’m sitting, working, waiting …and, hold it, I’ve got email. This is strange. It sounds as if we’re about to exchange work experiences with FedEx employees. It smells like a reality show and I wouldn’t be surprised if Donald Trump showed up at the door. Confused and impatient already, I do what I should have done from the very beginning. I simply ask. What I found out has taken by surprise even my skepticism.

In short, I found out that FedEx day means 24h during which employees can work on whatever they want, not necessarily work related. The only rule is that at the end of the 24 h, they have to deliver a working prototype of something that can

18

no. 28/2014, www.todaysoftmag.com

be any product of their imagination and surprisingly, it doesn’t even have to be Betfair related. All right but still, where is the FedEx van, and why FedEx Day? Why not Fan Currier Day? As I appear slow, I’m being given explanations. We’re actually talking about an analogy with FedEx Company who takes pride in delivering anything, anywhere in 24 hours. Sticking to the analogy, if you enter the FedEx Day competition, you have to deliver a product or service in 24 h, so to say overnight and prove to your colleagues that the prototype works, do a demo as the programmers say. And given my colleagues are fair play they admit they haven’t invented the wheel. The idea of organizing a FedEx Day was 1 st implemented by the Australian Company Atlassian (if you like the wiki format – Confluence is their product). During the 18 FedEx Day editions in Atlassian, 550 projects were generated, out of which 47 had major impact on the company’s products. Having these statistics in mind, there’s no wonder that this concept of event has become so popular among software companies. Whether they call it FedEx Day or Hack Day, in time, several companies have chosen to implement this concept


programare in their own fashion. Among them there are: Google, Yahoo, Twitter, Dropbox, Flicker, Symantec, Spotify. Actually, Twitter, Dropbox and Spotify have extended the 24h to one week, their hack days being already very popular. Well, believe that. I still don’t get it how someone becomes creative overnight and why this FedEx day idea is so smart. And just as reality often hits you bluntly in the face, the same did the answer I got. Innovative ideas cannot come out of the blue, as long as your mind is busy with day to day tasks and requirements that you need to implement. At FedEx day, innovative, brilliant ideas occur because where there are no rules, anything is possible. Innovation is not about structuring a process for getting to a result, it’s about making room for us to think differently, look at things from different perspectives. More too often, companies, guided by their best intentions, hire brilliant people and then 100% of the time they keep their minds busy with all the projects that must be delivered. The downside of this is that there is no time left for innovation, for trying out new technologies, new tools, for exploring in depth various ideas. Making time for innovation is exactly what FedEx Day does. During FedEx Day, all day to day projects get suspended for 24 h and a new ideas „friendly environment” is created. Each employee is given the opportunity to work on something he’s interested, curious, or passionate about. It’s as if you were CTO or Product Director for a day. Given the 24 h timeframe, FedEx Day starts on a Thursday at 3.00 p.m. and the actual work lasts until Friday at 3.00 p.m. After 30 minutes, the exact amount needed for teams to pack and deliver their prototypes, it’s show time. The demo session starts. Each team is given 10 minutes to shine, namely to show their prototype in action. Having a brilliant idea is a must, but being among the 3 teams who win at FedEx day, the prototype delivered in those 24 h has to be functional. What matters at FedEX Day? There are three criteria taken into account: the technical complexity delivered, usefulness for the customer or the product value, and the innovation brought by the designed prototype. How do things look like at FedEx Day? Every year the face of the event is changing but what’s here to stay, year by year, is the idea of Build for Fun- that is take the boldest idea that comes to your mind and turn it into a working prototype. Last year, the office looked like a building site with: hammers, scaffolds, building blocks and a myriad of people all set on „building” something. This year, as you step into the building, it’s full of fluffy clouds that come into various shapes. They resemble to the multitude of ideas, out there, floating in the air; they could turn out to be brilliant ideas but that depends on how they come in

TODAY SOFTWARE MAGAZINE

to shape and the course you set them on. Close to FedEx Day, wherever you look you see groups of people making plans about what they will do at FedEx day and what team name should they choose (Betmen, Noctopos, Brilliant Beavers, Promo Chefs, Fantastic Four etc.). If it’s almost 2.30 pm, you feel how the entire building is shaking and 200 faces with shiny eyes show up – we’re getting the cool t-shirts, all FedEx branded. Some dress them up right away; others fold them carefully, to be perfect for the great moment – the demo session on Friday. At 3.00 pm the planning sessions start: stand up meetings, laughter and everybody is all set to work; some write code, others provide resources, do tests, everybody is caught up in FedEx projects. You see how it’s getting dark, but nobody is leaving. At 11.00 pm, just when it starts to feel like everyone’s batteries is empty, the Red Bull, chocolate, and other „healthy” dishes show up. It’s 3.00 a.m. and there are still people in the office, FedExing. Though nobody keeps them there, they choose to stay. Next morning, at Breakfast you can see tired faces, but the adrenaline rush is still in the air. Around lunch, pressure gets higher and higher. Something is not working, we’re not going to finish on time, we ruined everything, a security certificate has just expired, and all Murphy’s laws seem to be true. At 3.00 pm, just like when we were students giving written exams, one can see the time has expired but there still is just one last sentence to write; there’s a last line of code that needs to be changed, a last test to run, something, just for another little bit; but its’ too late. All computer screens are „hacked” by a pop up saying time is up, start packing, delivery starts now. And if „Escape” on your keyboard will get you to ignore this, you can’t mute the bullhorn voice invading the office www.todaysoftmag.com | no. 28/october, 2014

19


contest BUILD FOR FUN @ FedEx Day insisting that it’s delivery time.

to day projects. Even if FedEx day means working on whatever you want, often employees choose to explore work related functionality. This way, bold ideas that seemed too extravagant to be even trialed and had poor chances to make it in the backlog, get to be put on the red carpet. During the years, at least two of the ideas prototyped at FedEx Days, were released in production, generating revenue, and others demonstrated the level of technical complexity of the projects that can be delivered by the teams (e.g. a Blackjack Live Dealer delivered in 24h). When it comes about what makes employees be so much into FedEx Day, things become really interesting. Employees don’t enter the FedEx day to win the prizes at stake. They enter it because they can work on their idea - their baby, they grow, they learn something new, something of their particular interest, and the project they choose to work on is meaningful for them. All these matters are about intrinsic motivation, so there’s no wonder that FedEx Day works.

Watching the delivered prototypes is a one of a kind show. Making your way to the demo session is quite a challenge; there is no room to move around. You can see all kind of objects carried on the stairs as they can’t fit in the elevator and excited faces. Finally the demos start. Questions, laughter, applauses, our colleagues keep amazing us with their brilliant, crazy ideas. It’s 8.00 pm already. Demo session is over. It’s the moment of truth. What will be the 3 winning projects this year? And who gets to decide this? Oh well, naturally, it’s the participants who get to decide. What’s left after FedEx day? Employees feel good, are energiGiven that you cannot rate your own project, only the projects of your colleagues, everyone is highly motivated to be as accu- zed, engaged, and the company is left with innovative ideas, and rate and objective as possible in their assessment. The scores are motivated employees to deliver them. tight but only 3 projects get to win. What can you win on FedEx That’s all. I’m out of questions, comments, words. Day? Besides the experience per se, and the valuable time spent with you team, there are always 3 special prizes. After announcing the winners, and celebrating, finally it’s weekend. What’s really interesting is that on Monday, Tuesday and quite a while after, people keep talking about FedEx Day and as they speak, their enthusiasm shows. Everything sounds great. However I’ve still got a few questions on my mind; two questions actually. First, what’s left after FedEx Day so that the business is willing to somehow „waste” 1 full day of work for people to Build for Fun? And second, why does FedEx day have motivational value for employees? For an answer, I’m being given statistics. After five editions of FedEx Day, we’ve ended with plenty of innovative ideas that wouldn’t have turned up if employees had to work on their day

20

no. 28/october, 2014 | www.todaysoftmag.com


others

Applied Creativity

S

oftware development is a creative industry. We hear this statement frequently and, in time, even find ourselves repeating it. We accept its obvious truth but expend less thought on what it actually means.

Alexandru Palade

alexandru.palade@yardi.com Director of Product Development @ Yardi România

Ask any aspiring IT professional who gives a damn about his personal development what kind of work environment he’s looking for. Sometimes you’ll get a direct creative environment while at other times you’ll hear about wanting to have my ideas taken into account or work on diverse and challenging projects. They all mean the same thing. People who work in IT need an outlet to express themselves. They thrive on challenge and overcoming barriers, real or imagined, personal or external. Unfortunately, if we look closely, we will find that the perception of creativity in this industry is plagued by many misconceptions. Programmers and other IT professionals are creative by nature but often fail to see how creativity is applied in their work. I’ve seen my fair share of good people chasing red herrings of self-expression. The most common trope is that creativity is the stuff of product managers and entrepreneurs so we should all try to hop on the innovation train and come up with ideas! I have to wonder who would be dealing with all the engineering challenges if we all did that. This limited view of creativity being manifested solely in product related ideas is the first step towards a distorted perception. Add it up with others and you can easily end up on a path of unhappiness and lack of self-fulfillment. So let’s bust some myths!

Creativity is not Innovation

Creative Jack is an IT professional who is living the dream and has the best job he could have imagined. He works in one of the most innovative environments on earth, for a company that really values its employees and

encourages them to think outside the box. Jack parks his electric, single seat car in the company parking lot and heads for the main building. In the lobby he is greeted by a large sign that hangs above reception. It reads: “Sometimes you find yourself in the middle of nowhere. And sometimes in the middle of nowhere you find yourself.” He pauses for a second as he tries to find himself and then continues towards his office. He passes the “Spirit” conference room where the interns are doing Monday Yoga. He stops by the Hall of Nourishment (what you and I would call the kitchen) for some coffee and chit-chat with Anne, the new Mongo administrator. Finally at his destination, Jack sits back in his bean bag chair and sets to thinking about how he will change the world today. The myth of the ideal start-up environment as sole catalyst for creativity is very popular. It’s caused by the confusion inflicted on us by the buzzword of the day that is Innovation and our pursuit of it. This ideal environment prescribes inspiration hanging on every corner and is geared to make every single employee the next Steve Jobs. How else to be creative than having a constant stream of great ideas? There is absolutely nothing wrong with quirky office environments that stimulate this type of creativity. In fact, having written about it, I kind of want a kitchen called the Hall of Nourishment in our office now. But are we really saying that the innovation conducted by these places is the only kind of creativity we can find in IT? Is this the only

www.todaysoftmag.com | no. 28/october, 2014

21


others Applied Creativity outlet for our desire of self-expression? To start answering that question, let’s remind ourselves that our main job as engineers is to solve problems. Most of us are not product managers or entrepreneurs but we are also not writers of code, runners of tests or installers of system packages. We solve problems through the thorough application of engineering skills. Problem solving in itself is a creative process. The hacker that finds security loopholes is undoubtedly creative. So is the architect that comes up with an elegant system design that’s easy to maintain and extend. Partition your data just right between the multiple data stores you’re using and you can increase performance tenfold. The administrator that just automated a process which used to take hours of manual labor every day did so because she remembered that tool she used on another project a few years ago. So yes, IT engineering is a creative enterprise. You should care about the product you’re building or supporting. You should try to understand what problems you’re solving so as to better come up with solutions. You should also contribute to the product vision if you’re so inclined, but unless you’re pondering a switch to product management remember what your core strengths are. Your skills are best suited for engineering challenges and there’s no shortage of opportunity to be creative there.

As Jack leans back in his chair, his mind is whirring. He needs to come up with an idea, something that will make his video sharing platform stand out and capture the imagination. He looks around the room looking for inspiration. Staring at the lava lamp on his desk and watching the odd blob patterns taking shape and disintegrating, Jack suddenly has a moment of clarity. His idea is born and he knows exactly what he has to do. I am personally guilty of falling for this one. It started from my moderate interest in art. As a technical person I have almost no personal experience in making art and few artist friends, so I just couldn’t imagine where artists come up with this stuff that I could never conceive myself. I honestly thought this is how inspiration works. There could be no other explanation. But then again, have you ever found yourself staring at a wall trying to come up with a solution for something? It doesn’t really work, does it? Though it may seem different, Jack’s conundrum of trying to find a great idea for his video platform is in fact quite similar to that of a painter attempting to put the first brushstroke on canvas or that of Anne the administrator trying to find an efficient sharding solution for her new Mongo cluster. It’s that first action that paralyses writers and programmers alike. Where to start? What to do first? Unless you’re doing a routine job that you’ve done a million times before, you will have this problem.

experience, practice, and having the right state of mind rather than a divine bolt from Zeus. We must have a vast pool of knowledge to build on. We must constantly expose ourselves to new ideas and have an open mind. We must practice what we learn in routine scenarios, so that we can rely on it when we need to apply it in novel ones. Here’s how to get that Mongo sharing just right without having to stare at the wall: • Be curious and read up on interesting articles and approaches. Always keep learning and you will have a broad knowledge pool to draw on. • When starting on a problem, browse through your memory and pick some approaches that have even a remote chance of working. Do a quick proof of concept then rinse and repeat. Think about what you’ve learned in the process and store the knowledge. • Bouncing ideas around – or brainstorming – can be extremely useful, but only if everybody has had a chance to think about the problem and brings their own input. Otherwise we’ll be staring at the wall in a group setting.

Few problems require the creation of something completely new. Creativity is required however in combining existing elements in a new way, or even applying known solutions to our particular projects. This is as true for programmers as it is for painters, writers or product managers. To Divine Inspiration put it another way, creativity covers not Let’s go back to our creative friend for just the invention of something new but a moment. Fishing for Knowledge S o how does it actually work? also the novel application of an approach Well, inspiration actually comes from to a specific context. Being creative in both

Objective C

jobs-cluj@yardi.com Yardi Romania

22

no. 28/october, 2014 | www.todaysoftmag.com


TODAY SOFTWARE MAGAZINE of these senses requires knowledge, experi- knowledge indicates that a DBA will cut your delivery time in half it may be a good ence and an open mind. idea to let your manager know. She may change her mind. Creative Problem Solving The mind of an IT professional is finetuned to understand systems and systems The Red Herrings are bound by rules, states and assumptiThe first fabled fish is the innovative ons. This inclination can be a drawback startup environment where inspiration when trying to be creative. hangs on every corner. This is the Mecca There are oftentimes fewer limits and sought especially by those who think creconstraints in any problem space than we ativity in IT is limited to product ideas. may think. What we’re actually dealing Others see past this and express themselwith is a large number of assumptions ves through solutions to the engineering that can be easily confused with immuta- problems they are best equipped (and most ble constraints. Sometimes they are hard inclined) to handle. But there’s another pitto identify but that’s exactly what makes fall looming. a creative problem solver. By challenging The second herring is false diversity. A assumptions they can find novel solutions lot of developers seek diversity of projects that others may completely miss. and technology. I dare say that this is often a misguided desire. I’m not suggesting Anne is trying to fix an elusive data- that this exposure is not useful in varibase bug that manifests every week like ous stages of the IT professional’s career, clockwork and can’t for the life of her figure but let’s explore the reasons. People seek it out. After countless hours debugging sto- environments like this because they want red procedures she finds the problem in the to have opportunities to learn. I would most unlikely of places. As she walks past the argue that having a diversity of problems server room, she notices the janitor happily to solve is at least as important as having cleaning the door window, all the while lea- a diversity of projects or technology. They ning his broom on the main router. are all important for different reasons, but “Hey Bob”, Anne asks, “how often do don’t be fooled into thinking that having you come by here to clean the windows?” many projects spanning a lot of technolo“Every Friday!” Bob explains proudly. gies automatically creates opportunities to “Never miss a week.” learn and grow. Assumptions come in many forms and finding them is not easy. Am I looking in the right place? Am I solving the right problem? Everything from requirements to resources, infrastructure and any other “immutable” variable can be challenged. You may have heard 3 months ago that there is absolutely no way to add another person to the team, but if recently surfaced

recognition software to detect faces in the videos and replace all of them with funny cat faces. This will take our core KPI of average-cats-per-video through the roof!” Creative Jack is a great guy and his cat idea might even work. But I’d like to suggest an alternative. Let’s be pragmatic creative. Let’s not chase the red herrings and remember that creativity is not limited to innovation. We have plenty of ways to learn and express ourselves in our area of expertise. Creativity does not come from divine intervention; it comes from curiosity, knowledge and challenging rules and assumptions. Essentially – and there’s no way to put it mildly – it comes from yourself and how much effort you’re willing to dedicate to your work. In closing, one final thought. While creativity is an important quality for the IT professional, it’s far from being the only one. You need perseverance, patience, great communication skills and a good work ethic among many others. Don’t despair if you find you aren’t wildly creative. Like anything else it can be learned in time but, more importantly, you may find you have other important strengths that more than make up for it.

A Creative IT Professional

“I got it!” Jack shouts as he bursts out of his office. He runs to the CEO’s office, breath ragged from overexertion. As he leaps into the imitation jungle corner office, he can barely contain his excitement. “Johnny, I got it! I know what will take VCShare to the top! We need a facial

www.todaysoftmag.com | no. 28/october, 2014

23


programming

programare

Review for “Haskell Data Analysis Cookbook”

I

have experimented with Haskell various exercises for my curiosity and for learning purposes. I consider myself an old-school statistician, an R programmer and sometimes Python. I am interested in statistics and data analysis, in concepts and new paradigms such as NoSQL, Big Data, MapReduce or functional programming.

Radu Marius Florin radu.florin@fortech.ro

Business & Data Analyst @Fortech

24

no. 28/2014, www.todaysoftmag.com

Note to readers: this is not an introductory book for Haskell or functional programming but rather the author assumes that the reader is familiar with the syntax and system of types of Haskell - which is significantly different from other programming languages. There are functional programming concepts, such as monad or purity, frequently used in the book. The book is presented as a beautiful collection of well-organized examples. The reader can find recipes accompanied by brief sections of code designed in general to solve problems of data analysis and processing, but many parts and concepts are addressed to experienced programmers. The book covers a very wide variety of topics regarding programming and data analysis. In the content of the book, a broad set of concepts and techniques are reviewed, which a “complete” analyst should master. However the book doesn’t

succeed to cover in depth all of these topics and many of them are treated as: Haskell can do this, but this is just an introduction.

What can we achieve with Haskell?

In terms of interactivity with the data (read-evaluate-print loop), the Haskell GHCi is comparable to iPython or REPL from Clojure, but it is quite far from what is actually available in RStudio, or Matlab. During an exploratory analysis process, the interactivity aspect is highly important. While working on the book exercises, I realized that the data investigation in Haskell is not so fast and easy and the work with data structures is not straightforward. In general, a data analyst wants a fast interactivity with the data, a swift investigation to their structure, and graphs generation without too much programming effort. For example in Clojure - another functional language which has a critical mass of users, there is Incanter, a platform for


programare statistical analysis and graphics generation. From what I know, so far there isn’t anything similar in Haskell. The fact that Haskell does not offer this easy possibility makes it a second option for a data analyst or statistician. Obviously, these conclusions are highly influenced by my experience with R, Python, or Matlab. In another train of thoughts, when I put my statistical programmer hat, a programmer who develops data-driven software, I start to appreciate Haskell programming language more and more. Parallelism and concurrency elements of Haskell language make it highly appreciated by a programmer, even if he considers developing a prototype or a small application which uses data sources of a considerable size, spread or with a complex structure (ex. NoSQL, Big Data). Haskell is a purely functional, lazy and statically typed programming language. This book succeeds in illustrating all these aspects of Haskell programming language very well. A lot of explanations are offered in the context of problems and examples, showing the importance of these peculiarities of the language. For a developer who wants to build data analysis software in Haskell, all the presented examples and models might be very useful. I’ve noticed there are some slight differences between the code from the book and code downloaded from GitHub, and this is probably because the GitHub code files are frequently updated. I have used the code already written from GitHub and I have made small changes or adjustments to play with the exercises files. Overall the exercises and the correspondent code have worked well. I had minor problems while installing Haskell libraries. This is more related to my experience while using the book and it concerns the content of the book itself less.

Let’s see the facts

Going through the examples, I felt a slight annoyance when I saw that I did not have an equivalent of “data.frame” as in R or Python. In Python this data structure is available using the library “pandas”, and R is a primary structure - a structure of a two-dimensional table where each column contains the features of a variable. This data structure supports easier processing of categorical and nominal variables, offering also a more intuitive way of interaction with data sources for in the analysis process. Considering the proportion of mathematicians and researchers

TODAY SOFTWARE MAGAZINE

of the Haskell community and the pace of the language development, we will probably very soon see specific libraries that address this issue. In the following paragraphs I will describe the aspects that I’ve enjoyed the most and also the perceived minuses regarding chapters or topics encountered while reading the book.

The good and the bad parts

The book begins with a chapter on data input - I/O operations. When compared to other programming languages, purity concept is one of the main strengths of Haskell. I/O actions are a kind of “Achilles tendon” when it comes to challenge the purity concept. The author avoids to get stuck with a theoretical discourse gathered around this concept in Haskell. Nishant Shukla begins the book in a pragmatic way with a very important subject for any analyst or programmer: data input - how to enter or import into the Haskell environment. In this chapter, examples regarding input of data are presented in various formats: CSV,

JSON or XML. Furthermore, the author provides examples of data gathering from the API, web pages (parsing), or No-SQL databases (e.g. MongoDB). The recipes presented are quite useful and contain a lot of “how-to” code for data processing. In Chapter 2, generically called “Integrity and Inspection”, some distinct categories of data analysis topics are treated. The first part presents recipes for data cleansing (trimming, parsing). Then, in the second part, there begin to appear also recipes for data aggregation, summarization and reporting (frequency tables) and on the third place there are recipes regarding the similarity concept (distances, correlations). All these three topics play a central role in data analysis activity and in this purpose it would be better to give them a higher consideration, and eventually to split them in separated detailed chapters. Cleaning and data aggregation occupies probably more than 80% of the activity of a data analyst. The examples present how specific problems are resolved without using some specialized libraries,

www.todaysoftmag.com | no. 28/october, 2014

25


programming Review for “Haskell Data Analysis Cookbook” but just using Haskell base code instead. When a developer considers building a software application, this approach is very good, and for these cases the examples and code snippets are very helpful. In general, an analyst wants to invest less effort in data scrubbing and preparation, therefore specialized libraries for these purposes would be more appreciated. In most cases an analyst is rather interested in the information and value from the data and I would say she or he is less focused on code quality, performance or elegance. While reading the book, I would have appreciated to see examples on how to generate in Haskell a column percentages table or how to obtain the average by categories of data. The examples are simple and brief and the code is very nicely written and commented; anyway when it comes to a data report generation it would have been helpful to see examples how to run certain statistical tests fast, at least basic ones like t-test or non-parametric tests. Further on in the chapter the concepts of similarity, distance and correlation are briefly presented. The Haskell syntax helps the reader to see the code regarding statistical formulas in a form very close to their mathematical expressions. I like very much this aspect that is emphasized in the examples from the book, making the code clearer and easier to read. After Chapter 2, I have jumped directly to Chapters 7 and 8 - “Statistics and Analysis” and respective “Clustering” chapters which are more relevant for my work as data analyst and statistician. Here

I’ve discovered some very interesting things such as cluster analysis using lexemes, building text n-grams with just few lines of code, or the approximation of a quadratic regression. Also, for these two subjects the author doesn’t enter into the depth of topics, and the exercises presented are not so close to real business or practical cases. It is obvious that it is quite hard to get this for such a broad spectrum of topics and concepts. I think it would have been more appropriate and relevant to use larger data sets with more than 3-5 records. I personally can see more added values for “Hello World!” like examples from these chapters when using classic datasets such as “Iris” or “German credit”. These kind of classic data sets are frequently used in books or tutorials regarding other programming languages. ​In general, they are useful for benchmarking of data processing, or for illustration of multivariate analysis exercises. Chapter 9 approaches the parallelism and concurrency programming concepts. The explanation of the concepts and the examples presented were straightforward. The author doesn’t go into much detail, but for me, presenting the concepts accompanied by examples of code was very useful. Similar with the previous chapter, in Chapter 10 - “Real Time Data” the author presents less content regarding data analysis; software engineering problems or cases like streamed data acquisition from Twitter or IRC channels are treated, and real-time communication with sockets. Chapter 3 - “The Science of Words” covers algorithms for data manipulation

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

26

no. 28/october, 2014 | www.todaysoftmag.com

and conversion. Chapter 4 - “Data hashing” shows various “hashing” functions. Not only in these chapters but overall the book recipes, the author uses the doNotation making the examples more readable. Do-Notation is syntactic sugar provided in Haskell, a convenient way to write code, but not a way to write imperative code as someone might misinterpret. Basically, when the compiler encounters a do block, it is translated into bind operators and lambda expressions. Chapter 5 “The Dance with Trees” and 6 “Graph Fundamentals” were the most difficult but also the most interesting chapters. Chapter 6, regarding graphs, is a natural extension as the author calls it, of the previous chapter regarding the trees. The author Nishant Shukla exemplifies in these two how to use an exceptional and unique software library that is at programmers’ disposal in Haskell - Lens library. In general, data manipulation in nested immutable data structures is always difficult, but in Haskell the problem is more obvious, as almost everything here is immutable. The Lens Library offers an elegant way to access and manipulate data in complex nested data structures. The last two chapters are focused on another main topic of interest for data analysts: visualization and presentation of data. In Chapter 12 - “Exporting and Presenting” the author presents a recipe for building a LaTeX table and this reminds me somehow of the fact that Haskell is a programming language preferred especially by


TODAY SOFTWARE MAGAZINE researchers. LaTeX is the standard format for the communication and publishing of scientific papers. Chapter 11 - “Visualizing Data” covers recipes for producing graphical representations of data using Google Chart API, gnuplot or JavaScript library D3.js. I was impressed how easy other tools and frameworks can be complementarily used with Haskell. I’ve been surprised also by the Diagrams library utility. It is beautifully designed, declarative drawing library that can be used to create composable drawings. In the last recipe from this chapter the author describes how to mark a route on a map using this library. All in all, I liked the book very much and I recommend it to all programmers interested in an intellectual challenge. The author has a very broad level of knowledge, managing to approach a wide range of problems from different fields such as statistics, data analysis, programming, software engineering and linguistics. I have found many practical examples in

the book, and further on I recommend it to data analysts passionate by functional programming. I am eager to see new books from Nishant Shukla and l will follow with interest the Packt Publishing activity in the “Big Data & Business Intelligence” website section.

www.todaysoftmag.com | no. 28/october, 2014

27


programming

programare

vNext: The future trend of .NET applications

I

n the past years, we could notice major changes of the fundamental concepts software development relies on: a faster pace of innovation and releases, the focus on cross-device development strategies and the collaboration within the community of developers that is based more and more on open source. In addition to this, there is an increasing need for developers to maintain older applications up to date and to integrate easily new technologies within them. Claudiu „

Claudiu.mera@endava.com Software Developer @ Endava

Microsoft tried to find an answer for all these demands by establishing a new trend of its well-known framework .NET, a trend that is referred to as vNext.

What is vNext?

During the TechEd conference of this year, Microsoft unveiled the next version of .NET framework called vNext, which came out as a solution for fulfilling all the current needs of the developers. More precisely, Microsoft wants all these changes to bring the way applications are implemented to a totally new level. vNext sums up several changes to the .NET platform. These changes consist of: high degree of modularization, an easier transition of the applications to the cloud, enabling more contributions to the framework by open source code, a faster development cycle, free choice of programming tools, and last but not least, the option to select the platform where applications can be run. Given all these premises, the main questions that one would address are how is vNext reflected in software development process and what features does it bring to the tools?

Complete modularization of references

One of the major changes to .NET platform is the total modularity. Until now

28

no. 28/2014, www.todaysoftmag.com

it was required to install the global .NET framework on the target machine in order to run your applications. This involved more storage size on the disk. Moreover, there are problems when we want to run an application under a different .NET version than the current one. This implies changing the global version of the framework on the system and it might cause other applications to break. All of these issues request more time for setting up the applications on a particular environment. vNext relies on features organized as packages. As a result, all the dependencies of a solution (including the framework, Common Language Runtime) are built as Nuget packages that are deployed together with the application. Moreover, in order to optimize resources for the cloud, Microsoft has decided to split the current framework into 2 flavors: one for on-premise solutions and one for cloud applications. The cloud optimized framework contains only the resources that are strictly required from the deployment of an application on cloud and nothing more. Therefore, this flavor of the framework will not contain references for Windows Forms or Windows Presentation Foundation, for example. The modularization of the framework is visible in the next version of Visual Studio IDE that provides a new way


programare for structuring a solution. References are not listed in linear form anymore; from now on, they are structured in a tree-like form so that they provide a more clear view of the dependencies, regardless if they are Nuget packages or class libraries. Furthermore, if we go for a Web application, the first thing that can be observed in the IDE is the absence of Web.config file. On the other hand, there has been added a new file named project. json that is included for any type of project. The project.json file plays an essential role when configuring vNext applications. This contains a list of project dependencies, definitions for custom command or settings for several configurations. Visual Studio provides Intellisense support for editing this file and for searching references. Moreover, the dependencies that are specified within the file are synchronized in real time with the references tree from Solution Explorer. “dependencies”: { “EntityFramework.SqlServer”: “7.0.0”, “Microsoft.AspNet.Mvc”: “6.0.0”, “Microsoft.AspNet.Identity.EntityFramework”: “3.0.0”, “Microsoft.AspNet.Identity.Authentication”: “3.0.0”, “Microsoft.AspNet.Security.Cookies”: “1.0.0”, “Microsoft.AspNet.Server.IIS”: “1.0.0-*”, “Microsoft.AspNet.Server.WebListener”: “1.0.0-*”, “Microsoft.AspNet.StaticFiles”: “1.0.0”, “Microsoft.Framework.ConfigurationModel.Json”: “1.0.0”, “Microsoft.VisualStudio.Web.BrowserLink. Loader”: “14.0-*”, “UserManagement.BusinessLogic”: “” }, “commands”: { “web”: “Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000” }, “configurations”: { “net451” : { }, “k10” : { } }

The json file is a very powerful resource. A developer can choose between a particular version of a package or the last version. This proves to be extremely useful because one can load in the project the latest versions of the packages that often contain fixes for bugs from previous versions. In addition to this, if bugs

TODAY SOFTWARE MAGAZINE form open source packages are detected, the packages can be cloned on the local system and they can be fixed. Later on, their package references can be updated to point to the newest version (the one that contains the fixes). Besides specifying dependencies, the project.json file can be used for the complete recovery of a solution in Visual Studio, in case that some .proj file have been deleted accidentally from the application.

Enhanced control through Dependency Injection

The future trend of .NET framework puts a great emphasis on Dependency Injection concept which becomes a built in mechanism for setting up applications. This configuration is performed in Startup class within Configure method that is shown below: public void Configure(IBuilder app) { // Setup configuration sources var configuration = new Configuration(); configuration.AddJsonFile(“config.json”);

configuration.AddEnvironmentVariables(); string connString = configuration.Get( “Data:DefaultConnection:ConnectionString”); // Set up application services app.UseServices(services => { // Add EF services to the services container services.AddEntityFramework().AddSqlServer();

// Configure DbContext services.SetupOptions<DbContextOptions>(options => { options.UseSqlServer(configuration.Get( “Data:DefaultConnection:ConnectionString”)); }); //Add Identity services to the services container services.AddIdentity<ApplicationUser>() .AddEntityFramework<ApplicationUser, ApplicationDbContext>().AddHttpSignIn(); // Add MVC services to the services container services.AddMvc(); }); // Add MVC to the request pipeline app.UseMvc(routes => { routes.MapRoute( name: “default”, template: “{controller}/{action}/{id?}”,

www.todaysoftmag.com | no. 28/october, 2014

29


programming vNext: The future trend of .NET applications defaults: new { controller = “Home”, action = brings a performance boost to the execution of an application. “Index” });

}

routes.MapRoute( name: “api”, template: “{controller}/{id?}”); });

One can notice that there is an enhanced control which allows explicit setting for the features that are required. It is very important for the required services to be registered in the json config file. In the previous section, we mentioned that Web.config file is not present in Web applications. This is due to the fact that developers have the opportunity to select their own configuration mode: specified by xml, json or ini files. And of course, this is done in Configure method, by setting the chosen file as a reference within configuration object. In this method we can specify also if we want to include Entity Framework or MVC in the project, for example. This is done by calling methods like AddEntityFramework or AddMvc. Moreover, we can set several parameters of the included features (by calling methods like UseEntityFramework or UseMvc). Such an example would be calling UseMvc for configuring MVC routes. Even though there are 3rd party containers for Dependency Injection in .NET (Autofac, NInject), from now on it is provided also built in support for this. The built in mechanism allows a much better control of the features that are used. If we want to use a 3rd party container for Dependency Injection, we can do this by specifying particular dependencies in project.json file, followed by the explicit setting of parameters in Configure method.

Speed and performance

Another important advantage that is included in vNext applications (and not only) is the dynamic compiler. The new platform of .NET compilers, which is codenamed Roslyn, provides an open source API. If developers have access to the API of .NET compilers, they will create more easily applications for code analysis, custom diagnostics or even optimized versions of the compilers. Since the dynamic compilation is performed in the system memory and does not involve rewriting assemblies on disk, it

30

no. 28/october, 2014 | www.todaysoftmag.com

Therefore, once the application process is started, one can edit the source code and after saving the edited file(s) will see the changes in real time. It is important to notice that there is no need for rebuilding the software (process that takes up time and resources) and the only thing we need is to save the modified sources. For instance, if someone implements a Web application, he only needs to edit the source code and press F5 in the browser to see his changes applied there. This enhancement results in a faster cycle for both software implementation and bug fixing and it increases a lot the productivity of all developers.

Conclusions

vNext comes up with many more other innovations. Among the novelties brought by vNext there are the merging of Web Pages, MVC and Web API within a single model and an increased support for Mono (used for running .NET applications on other platforms). The high degree of modularization and the enhanced control facilitate the deployment and maintenance of the applications on each environment. The software will be able to run even on portable drives like memory sticks. Even more, multiple versions of the same application will be able to run simultaneously. Last but not least, vNext represents a new era for .NET framework, an era where developers can choose freely their own tools and operating systems. Since it is open-source, the entire community can see the latest updates of vNext; moreover, its development is highly influenced by a continuous feedback process. The future version of .NET framework will definitely revolutionize the entire implementation phase. We are looking forward for it to be officially released in order to explore all the features that it provides.


programming

Websockets – http on steroids

H

ttp has been around since 1999, but the modern web applications‘ increasing demand for server push and a more efficient communication protocol, led to the definition of the Websocket protocol in 2011.

Philip Peterhansl

Philip.Peterhansl@msg-systems.com IT Consultant Automotive @ msg systems ag

The questions asked at the Java Java Server: Annotated ServerEndpoint Conference 2014 in Cluj were symptomatic First, we create the server, by using for the new technologies: the annotated ServerEndpoint defined in JSR-356. There’s also a specification for proW h o h e a r d a b o u t We b s o c k e t s ? grammatic endpoint creation, but that won’t Nearly everyone of the ~250 participants. be covered in this article. Code first, explanations below: W h o a l r e a d y u s e d We b s o c k e t s ? @ServerEndpoint(value = “/service”) Just a bunch of people, around 10 to 15. public class ChatServerEndpoint { private static final Set<ChatServerEndpoint> connections =

F i n a l l y , w h o u s e d We b s o c k e t s new CopyOnWriteArrayi n a c o m m e r c i a l p r o j e c t ? Set<>(); As expected, no one raised the hand. private Session session; @OnOpen

This article advertises Websockets and public void start(Session sesgives an overview of how to use them and the sion) { this.session = session; reasons, why you should use them. connections.add(this); } Websocket security is a major topic, but } cannot be covered in this article. See Useful Links for further information. The value property oft he ServerEndpoint defines, on which path this endpoint listens. The URL for connecting to this endpoint is How to use websockets? Websocket implementations share a ws://<host>:<port>/<webapp>/< common interface definition between ser- value property> ver, client and even across programming languages. The following code examples The @OnOpen annotation marks the will implement a basic chat example by con- start method to be called, when a client connecting both, a Java and a Javascript client to nects. You should do all the initialization, a Java server. that‘s necessary. In the chat example, the Use the following maven dependency in connecting client’s session gets stored into your Java server and client projects to include the connections set for later use inside the the JSR-356 API for Java Websockets: broadcast method. What happens, if a client disconnects? Define a method, annotate it with the @ <dependency> <groupId>javax.websocket</ OnClose annotation and it gets called groupId> <artifactId>javax.websocket-api</ everytime a client disconnects, regardless of artifactId> the cause: <version>1.1</version> </dependency>

The complete source code of this example is available online, see <INSERT-LINK-HERE>.

@OnClose public void end() { connections.remove(this); }

In this simple chat example, the

www.todaysoftmag.com | no. 28/october, 2014

31


programming Websockets – http on steroids disconnected client is removed from the connections set. The core of any data driven application implementing Websockets is sending and receiving data. The most basic solution for receiving messages in an JSR Endpoint is annotating a method with the @OnMessage annotation and the following signature: @OnMessage public void incoming(String message) { broadcast(message); }

There are more sophisticated ways of receiving (and sending) messages using encoders and decoders with text and binary messages, but they won’t be covered in this article. Have a look at the JSR-356 API for further information. Sending messages is done via the session of the receiving client. The broadcast method steps through each connected client in the connections set and sends the message by using a BasicRemote: private static void broadcast(String msg) { for (ChatAnnotation client : connections) { try { synchronized (client) { client.session.getBasicRemote(). sendText(msg); } } catch (IOException e) { connections.remove(client); try { client.session.close(); } catch (IOException e1) { // Ignore } } } }

The BasicRemote acquired by the client session getBasicRemote() method sends the message in blocking mode. There’s a non-blocking implementation, called AsyncRemote, too. It’s acquired by using the getAsyncRemote() method of the client session. We now have a server, that can receive messages from any In this simple chat example, we only need to implement the client and forward them to all connected clients. Let’s have a look @OnMessage annotated method. The method just outputs the at the Java client implementation. received message to the console. You will need a JSR-356 implementation on the client side, as there’s no implementation contained in the Java JRE. The standard Java Client implementation is Project Tyrus and it is used in this example. For creating a Websocket client in Java, a ClientEndpoint has Add the following dependencies to your client project’s POM to be defined in a similar way as a ServerEndpoint: for using Tyrus in standalone mode: @ClientEndpoint public class RemoteWebsocketClient { private Session session; @OnOpen public void onOpen(Session session) { this.session = session; } @OnMessage public void onMessage(String message) { System.out.println(message); //TODO: output message in a chat window }

@OnClose public void onClose(Session session, CloseReason reason) { }

<dependency> <groupId>org.glassfish.tyrus</groupId> <artifactId>tyrus-client</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>org.glassfish.tyrus</groupId> <artifactId>tyrus-container-grizzly</artifactId> <version>1.0</version> </dependency>

Let’s connect the client to the server. It’s as easy as calling connectToServer method from a ClientManager. See the full source

}

32

<dependency> <groupId>org.glassfish.tyrus</groupId> <artifactId>tyrus-server</artifactId> <version>1.0</version> </dependency>

no. 28/october, 2014 | www.todaysoftmag.com


TODAY SOFTWARE MAGAZINE of the ChatClient: public class ChatClient { private ClientManager manager; public void connect(URI uri) { this.manager = ClientManager.createClient(); try { manager.connectToServer(ChatClientEndpoint.class, uri); } catch (DeploymentException | IOException e) { System.exit(-1); } } public void run() { String msg = System.in.readLine(); while (!””.equals(msg)) { manager.getSession().getBasicRemote().send(msg); msg = System.readLine(); } } public void main(String[] args) { ChatClient cc = new ChatClient(); cc.connect(URI.create( “ws://localhost:8080/chat/service”)); cc.run(); } }

• Low Latency. Eliminating one half of the full request/response-cycle, the latency effectively gets halved. • Low Bandwith. Message headers of websocket messages are only 2 bytes in size, compared to an average of 700-800 bytes of header data in common http requests. Response header sizes are smaller in byte count, but still significantly larger than 2 byte websocket message headers.

Drawbacks

The major drawback of the Websocket specification is, that there’s no application level protocol specified. That’s where we as developers are challenged to step in and develop some generic application communication protocols that fill this gap. With a generic application protocol, the second drawback could be addressed, too: The websocket protocol does not specify a mechanism for guaranteed message delivery – a major requirement for business use. While not unsolvable, those two issues are responsible for Webscokets not getting the momentum, they actually deserve.

Summary

In my opinion, Websockets do have really huge benefits compared to traditional http communication, and I’m looking forward to use Websockets in a commercial product in the future. I‘d like to compare Websockets to XMLHttpRequest before it got hyped as part of AJAX: As soon as XMLHttpRequest became usable with easy and reliable to use third party libraries, the Web 2.0 started. Websockets do need their issues worked around with some Javascript easy to use libraries, too, for eventually taking commercial clientThe code for a Javascript Websocket client is nearly the same as the Java ClientEndpoint. Connection is made in a browser- server applications to a new level. specific way, as Mozilla Firefox has an individual implementation named MozWebsocket instead of the standard Websocket: Useful Links The chat client connects to the server, by calling connectToServer providing a ClientEndpoint implementation class and an URI to connect to. The main loop waits for the user input to be sent to the client. The message handling is done by the ChatClientEndpoint.

var connect = function(url) { if (‘WebSocket’ in window) { socket = new WebSocket(url); } else if (‘MozWebSocket’ in window) { socket = new MozWebSocket(url); } };

Message handling is done inside the socket.onmessage method, that should be overriden. For displaying the chat messages, we create a new paragraph and append it to a div in the displaying html page. socket.onmessage = function(msg) { var log = document.getElementById(‘log’); var p = document.createElement(‘p’); p.style.wordWrap = ‘break-word’; p.innerHTML = msg.data; log.appendChild(p);

IETF Websocket protocol specification: http://tools.ietf.org/html/rfc6455 W3C Websocket API specification: http://dev.w3.org/html5/websockets/ JSR-356 Java API for Websockets: https://jcp.org/en/jsr/detail?id=356 Project Tyrus: https://tyrus.java.net/index.html Annotated and Programmatic Endpoints: https://blogs.oracle.com/ arungupta/entry/websocket_client_and_server_endpoint Comparison of Websockets and Comet: http://www.websocket.org/quantum.html Google specification for SPDY: http://dev.chromium.org/spdy/ spdy-whitepaper Web s o cke t s e c u r it y : http s : / / d e vc e nte r. he roku. c om / ar t i cl e s / websocket-security STOMP protocol as simple application protocol: http://stomp.github.io/ stomp-specification-1.2.html

} Sending is done by using the socket’s send method: send: function(msg) { socket.send(msg); }

Why to use websockets?

The Websockets specification addresses the issues, modern web applications face using the http protocol. With Websockets you get: • Real server push. After the websocket upgrade there’s no further request needed from the client. The server can send its messages as needed. www.todaysoftmag.com | no. 28/october, 2014

33


programming

Concurrency and data binding in JavaFX

T

Silviu Dumitrescu

silviu.dumitrescu@accesa.eu Java Line Manager @ Accesa

Diana Bトネan

Diana.Balan@accesa.eu Java developer @ Accesa

34

no. 28/2014, www.todaysoftmag.com

his month, too, we bring to your attention some technical challenges of the JavaFX world. In the second article we will discuss about concurrency and data binding. The javafx.concurrent package manages the multithread code of the interaction with the UI and ensures that this interaction takes place in the correct thread. The package consists of the Worker interface and two basic classes, Task and Service, both of them implementing the Worker interface. The Worker interface provides the API used by a background worker which communicates with the UI. The Task class is a fully observable implementation of the java.util.concurrent.FutureTask class and it allows developers to implement asynchronous tasks in the JavaFX applications. The Service class performs these tasks. A Worker is, thus, an object working in a background thread. The state of the Worker object is observable and usable from the threads of the JavaFX application. The lifecycle of a Worker is defined like this: when the Worker object is created, it is in the READY state. After it has been programmed for work, the Worker object makes the transition towards the SCHEDULED state. Afterwards, when the Worker object is running, its state becomes RUNNING. Note: Even if the Worker object started immediately, without being programmed, it first passes through the SCHEDULED stage and then goes to RUNNING. The state of the Worker object, when it has successfully performed becomes

SUCCEEDED, and the value property will be set according to the result of the Worker object. Thus, if exceptions are thrown during the runtime of the Worker object, its state becomes FAILED, and the exception property is set to the type of exception that has occurred. The Worker object can be interrupted in any state, by using the cancel () method, which sends


arhitectură the object into the CANCELLED state. The progress registered on the running of the Worker object may be obtained through three different properties: totalWork, workDone and progress. The Task class can be started in one of the following ways (the first two would be preferable): By using the ExecutorService API: ExecutorService.submit (task); By using the method task.run (); By starting a thread with the task given as a parameter: new Thread (task) .start () ; The Tasks are used to implement the work logic in a background thread. Firstly, we have to extend the Task class, which will overwrite the method as 11 (). The Task class inherits the java.utils.concurrent.FutureTask class, which implements the Runnable interface. That is why the Task object can be used with the Executor API and can be sent to a thread as parameter. We can call the Task object right from the FutureTask.run (), which allows us to call this task from another thread. We will create a CounterTask class, which extends the Task class. public class CounterTask extends Task<Void> { @Override public Void call() { final int max = 10000000; updateProgress(0, max); for (int i = 1; i <= max; i++) { updateProgress(i, max); } return null; } }

The call () method is invoked by the background thread; therefore, this method can manipulate states that are sure to b e re ad or written in a background thread. For instance, manipulation the active graphical stage from t he ca l l () met ho d will throw a runtime exception. On the other hand, the Task class is meant to be used with JavaFX applicat ions and it assures us that any modifications of the public properties, error notifications, event and stage manipulators appear in the JavaFX application thread. Within the call () method, we may use the methods: updateProgress (), updateMessage () and updateTitle () in order to update the values corresponding to the properties on the JavaFX thread. In the application, we created an instance of the previous class, called countTask and we executed it through an ExecutorService

TODAY SOFTWARE MAGAZINE (ExecutorService es = Executors.newSingleThreadExecutor (); ): @Override public void handle(ActionEvent event) { System.out.println(„Count Started”); bar.progressProperty().bind(countTask.progressProperty()); es.execute(countTask); }

The Service class is designed to execute a Task object in one or several threads. The methods and states of the Service class must be accessed from the JavaFX application thread. This class helps developers to implement a correct interaction between the background threads and the JavaFX application thread. We can start, stop, cancel and restart a Service. A Service may run a task more than once. Thus, a service may be declared and restarted upon request. A Service can be run in one of the following ways: • By an Executor object, if it is specified for the given service • By a daemon thread, if no Executor is specified • By a custom executor such as ThreadPoolExecutor Here we have an illustration of creating a custom service in the example below: public class CounterService extends Service<Void> { @Override protected Task<Void> createTask() { CounterTask ct = new CounterTask(); return ct; } }

We create a CounterService (CounterService cs = new CounterService (); ) in the JavaFX application and we start the thread like this: if (cs.getState() == State.READY) { cs.start(); }

Data Binding Data binging has the purpose of simplifying the task by synchronizing the view with the data of the model. The binding observes its lists of functions in order to detect changes and it updates if they have appeared. The binding API provides a simple way to create bindings for the most common situations. Binding is, thus, a powerful mechanism for expressing direct relations between variables. When the objects take part in bindings, the changes brought to one of them will automatically reflect upon the other. For instance, binding may be used in GUI for the automatic keeping of the read-outs synchronized with the data they refer. The bindings are assembled from one or several sources called dependences. In our previous example, we have used the bind () function to connect the progress bar to the counter Task. Here is the complete code of the JavaFX application: public class CounterBarAppService extends Application { StackPane root = new StackPane(); VBox mainBox = new VBox(); ProgressBar bar = new ProgressBar(0.0); CounterService cs = new CounterService(); @Override public void init() throws Exception { super.init();

mainBox.setAlignment(Pos.CENTER); mainBox.setSpacing(10);

www.todaysoftmag.com | no. 28/october, 2014

35


programming Concurrency and data binding in JavaFX Button btn = new Button(); btn.setText(“Count to Ten Million!”); btn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { System.out.println(“Count Started”); bar.progressProperty().bind( cs.progressProperty()); if (cs.getState() == State.READY) { cs.start(); } } }); Button restartBtn = new Button(); restartBtn.setText(“Restart”); restartBtn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { System.out.println(“Count Started”); bar.progressProperty().bind( cs.progressProperty()); cs.restart(); } }); mainBox.getChildren().add(btn); mainBox.getChildren().add(restartBtn); mainBox.getChildren().add(bar); root.getChildren().add(mainBox); } @Override public void stop() throws Exception {

36

no. 28/october, 2014 | www.todaysoftmag.com

super.stop(); } public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) { primaryStage.setTitle(“JavaFX Service Example”); primaryStage.setScene(new Scene(root, 400, 250)); primaryStage.show(); } }

We are looking forward to discussing the new JavaFX world with you. Enjoy your reading!


programming

Clean Code – Comments and Formatting

I

Radu Vunvulea

Radu.Vunvulea@iquestgroup.com Senior Software Engineer @iQuest

n the last two numbers of TSM we discovered what kind of naming we should use for our methods, fields, classes and so on. Related to this we saw we should always use meaningful names that are related to the problem that we want to solve. Also, we saw that a method name should always express an action (start with a verb) and a class name should be always a noun (or to express a noun). After this, we talked about function, where we found out that a function should be short, do only one thing and the number of parameters should be limited. All the information from this series is inspired from “Clean Code”, written by Robert C. Martin. I hope that in this way I will be able to make people read this book and write better code.

What next?

In this article we will talk about comments in our code and code formatting. Our purpose is to try to find out when we should add comments in our code and what these comments should look like. Because developers need to read code every day, we need to use a good formatting style that helps developers to read the code as easily as possible. Let’s start with code comments.

Comments

When we think about comments in code, we have in mind comments that explain what code is doing. The problem with comments is that they are not always updated. Very often the code is changed but the old comments remain the same. So, the comments don’t reflect the code anymore. In time, code is moved from one location to another, it is refactored, split, and moved. Even if the code location is changed, the old comments remain in the same location. In time, we end up with comments that don’t

reflect reality and the code around them. The hardest thing to do is to educate developers and make them understand that comments are part of the code. And, the moment the code is changed, the same thing should happen with the comments. But because of time pressure or indifference, we end up with outdated comments that don’t reflect reality anymore. We need to think of comments like documentation. It is an expensive artifact that needs to be maintained. Because of this we should add comments only in location where it is necessary and code itself cannot express what is happening there.

Bad example of comments Ugly code Often comments are used in locations where code is ugly and they are used to ‘fix’ the code. Don’t try to make a code more beautiful by adding comments. When you have an ugly code you should refactor it and write it in a way that expresses what you are doing there.

Code explanation When you have a code that cannot be understood, then comments are not the

www.todaysoftmag.com | no. 28/october, 2014

37


programming Clean Code – Comments and Formatting object. Usually in big companies and projects you end up with rules that require each method and class to have comments. You end up with a lot of comments that don’t add a real value. They are added by developers only because it is required. For example a property called “Id” had the following comment “Gets, sets the id of the current object”. No useful information is added by this comment, only additional 3 lines of comments that pollute the code. What about commenting a constructor – “Construct an instance of object Foo”. Come on, it is clear what the scope of a constructor is. In general, constructors should never be commented.

Journal 30 years ago, when source control was not used on every project maybe it was a good idea to write in the code the journal of code changes (when, what, why, who – changed the code). But now, with source control and other tracking mechanisms, there is no point to do this. Using a source control system you can see and track all the changes that happen on the code.

Position markers Try to avoid using position markers into your code. For example adding “/////////” into the code to find more easily a specific part of the code. solution. Try to rewrite the code or rename fields and other ele- Good example of comments ments in a way that the reader will understand the action that you Yes, there are cases when comments are useful and can add are doing there. value to our code. In many cases, you can extract a method with a mindful name. The reader will understand very easily what is happening Legal and Informative there based on the methods and fields name. There are cases when you need to add a comment because of the legal reason. The code can be under specific license terms and this needs to be specified. In this case you should add a comment Mumbling Adding comments into the code only because you think that that specifies this thing, but without adding all the license terms is necessary is a bad thing. Often it happens that somebody adds to it. You can point from the comment to a specific document or comments in code only because he thinks that it is good, without url link that describes the license terms. You don’t want to have a real background. In the end we end up with a lot of comments 200 lines of comments with this information There are cases when a comment can add value to a code. For that are not useful and make code more difficult to read and example when we give more information about what is returned understand. by a method. Be careful that there are cases when a good name of a method can remove the necessity of comments related to Redundant When you have a good name for your field or method, you no return value. longer need a comment that describes what the scope of that field or method is. For example a method that is named “SendEmail” Intention and Clarification doesn’t need any additional comments when it is called. It is clear A comment is always useful when intention is expressed. It from the name of the method that an email is send. is not important to comment what we have done in the code, Another good example is a field called ‘vatValueForCurren- because the reader can see the code itself. It is more important to tOrder’. From the name of the field it is pretty clear what value is explain what we wanted to do in the code. stored in this field. You don’t need a comment that says “The value There are cases when we cannot express exactly what our for the current order is stored”. The comment in this case doesn’t intention is. Because of this we need to add comments that add add valuable information. more clarification and explain why we didn′t take a specific action. Maybe there is a bug in an external library that we had to avoid or the client had an odd request. Misleading, Mandated and Noise In many cases, developers don’t express what they intended to do. Because of this you can end up with a comment that says that Amplification and Warning an email is sent to the customer, but you end up debugging and There are times when we know that some lines of code are trying to understand why the email is not sent. very important, and without them the application could crash, for In the end you realize that the method that is called under example. In these cases, comments could warn other developers that comment doesn’t send an email, only constructs the email about the importance of those lines of code.

38

no. 28/october, 2014 | www.todaysoftmag.com


TODAY SOFTWARE MAGAZINE A good example is a mutex variable that is used to access a shared resource. Maybe not all developers would understand the importance of that mutex and a warning is needed.

Fields

All public API that is intended to be used by external clients and developers should be documented very well. Since they will not be able to see the implementation, the naming of different functions and classes in combination with comments should express very clear what the purpose of each method is and how it should be called.

You want to group all the fields in the same location of the code. Fields with different attributes should be grouped together (visibility, scope – static/non-static, const. and so on). There is another trend that says you should group all the elements of a class based on functionality and where they are used. In this way you will have a zone in the file with methods, fields for a specific functionality. Even if the idea is pretty nice, it is pretty hard to read and change this kind of code, because very easily you can miss that a field is already declared for example.

Formatting

Functions

API Documentation

already available that can be used with success – don’t reinvent the wheel one more time. It is important to know that different teams may use different coding standards. Because of this developers should be open to accept and learn other coding standard, not only the one that is known by them.

Conclusion

Comments and code formatting can make a code more readable and easier to understand. Try to define these rules at the beginning of the project and be prepared to change them if it is necessary and if it makes sense. Don’t forget that the simplest rules are the best one!

Imagine that code is like the text from a book. It should be well formatted, indentation to be used in the same way everywhere, after each ‘,’ to have a space and so on. The most important thing when we are talking about formatting is not to respect a specific standard, but to respect the same standard everywhere. Even if you defined your own way of formatting it is okay as long as you respect that formatting everywhere. Code formatting should guide develops to read and understand the code. Imagine a book that is written with 10 types of text style, different sizes, color and space alignment. It would be a nightmare. The same thing is applicable to code also. Around this topic there are a lot of recommendations about how many lines of code a file should have, what is the optimal number of characters per line. You will not be able to find the magic number, but you will feel when the number of lines of code is too high and scrolling is annoying.

Functions that are dependent should “Don’t comment bad code—rewrite it.” be placed together. It is recommended to —Brian W. Kernighan and P. J. have the child function under the function that calls it. In this way you will be able to Plaugher1 read the code very easily, without having to navigate too much between different places inside the code.

Variables

Coding Style and Formatting

It is recommended to declare variables as close as possible to the location where they are used. You don’t want to declare a variable on line 1 and use it only from line 15.

Code Affinity The code with the same purpose and function should be placed in the same place. You don’t want to scroll or search in 10 files for a specific functionality.

Indentation It is very useful to respect an indentation standard in all your code, even if there are times when you want to break this rule. Obeying this rule you can easily spot a variable, the action executed by a FOR or IF clause and so on. With the new IDE’s and tools it is very easy to respect the same indentation everywhere. The most important thing in a team is to have a single formatting style that needs to be respected by all members of the team. Don’t waste days on code formatting and style. There are plenty of these rules

www.todaysoftmag.com | no. 28/october, 2014

39


testare

testing

Software Testing World Cup

S

Lavinia Cazacu

lavinia.pop@hp.com Quality Assurance Manager @ HP România

Irina Savescu

irina.savescu@hp.com Quality Assurance Engineer @ HP România

40

no. 28/2014, www.todaysoftmag.com

oftware Testing World Cup is an international software testing competition, now in its second year. The competition takes place in two stages: the continental preliminaries (Africa, Asia, Europe, North America, South America and Oceania) where anyone can sign up, and the world finals which take place during the Agile Testing Days conference in Berlin. This year the preliminaries where held between April and July and the finals will take place mid-November. Irina was the first one to hear about the competition and we all ventured into the idea quickly. None of us had ever participated in a testing competition and we gladly took on the challenge as it sounded so fun and exciting, a good personal and team experience. So, on June 13, 2014 we, Irina, Ileana, Sanda and Lavinia, took part in this unusual contest, where software testing teams around Europe had to test an application for 3 hours. Each team who competed in the Europeans round had the same application to test. The organizers set up a dedicated bug tracker project for each team to submit the bugs they find, and at the end of the testing session, we needed to send out a test report, in the format of our choice. Out of more than 100 teams attending the event, we were the winning team. Even if winning isn’t everything, it surely made our day, as we didn’t really expect it. Once we registered, the hard teeth of reality took a good bite on our excitement. There wasn’t any time to meet, there were just too many things to polish,

and contest hours were just too late to be able to be efficient (7 PM on a Friday?). In the end, all of us need to do our day job and go on with our lives, don’t we? But we did meet a couple of times, and we did look around a bit and we even planned a few aspects. Not too many, just enough to have that feeling that we’re serious about it. But not too serious, so it won’t be too painful if we have no results. The day of the contest is never as you wish to be. Still, we managed to draft the report we were all ok to use, and had a lovely dinner right before the contest started (having fun is still the best energizer we know). After that, it was an intense 3 hours struggle, at the end of which we felt like anything but a winning team. Throughout those hours all we really wanted was to do more and more. In our eyes we failed. We had trouble getting the right grip on the application, and we were too absorbed in our own ideas, always looking to catch the thing we just noticed. The application under test was a sales


testare tool demo, a concept new for us, and the business logic was not very intuitive. What’s more, it had dependencies on real data and there was no way to generate your test data on the spot. We had to google for real companies in specific countries and understand the specific formats in those countries (legal entity names, contact details etc.) and integrate the rules in our testing scenarios. Once you entered the details of a real business, and the tool recognizes it, it offers the possibility to generate a profile for that business and incorporate details like online footprint of the business, competitors and weak areas. The profile generation took around 10 min, and for a time box testing session, you just can’t afford to wait for a process to complete. Many times, we forgot to check it right away, and many of our testing flows died right away without being able to close the loop and asses the profile data. There was just no time to wait for results, and we sacrificed aspects that we would normally never ignore. The whole application was buggy, and some of the bugs were so obvious that you did not want to waste time on reporting them, but continue the hunt. Even if it was a real, production application, it felt that it was specially prepared for the event, spiced up with all sorts of small issues. There were a few areas where we could go deeper than the surface and explore the logic of the business, and time, again, was not on our side. The usability aspects could also be improved, the application targeted dedicated sales persons as main users, but the ramp up could be significantly reduced with a few standard improvements (hints and help, fluent screens navigation). A key aspect of the contest was the test report document that we needed to submit at the end of the session. This could be prepared in advance, but how much can you anticipate upfront? We were looking at 3 hours of exploratory testing on an application that we did not know. The content of a test report is always debatable, there are templates that capture what you did along with what you achieved, but in the

TODAY SOFTWARE MAGAZINE end, you just need to know your audience and tailor your data on their expectations. We chose to focus explicitly on the deliverable of the session, our feedback and bug statistics, and kept it as simple as possible. We generated 4 slides for our report: one with our overall feedback on the application; one with the results on the features that we tested (number of bugs, time spent on each area and explicit feedback for each section); one dedicated to bugs, with a graph that highlighted their severity and their type (functional/ performance / UI); and for the last one, we included our test environment, because even if not requested, we thought it is relevant to reveal what browsers and what devices we used in our testing. We did not give more details than this, and if there is one thing that we were happy with after the event, it was the report. Looking back, and ignoring that sound voice that keeps saying “you’re the best”, we wonder what really made us win. We are no testing experts, and will never pretend to be. Testing community is so overwhelming, you always find people more passionate than you, more creative and sharper than you’ll ever be. It’s a job where quick thinking makes a difference and where you need to differentiate yourself continuously. As software testing professionals, you just need to do it better, smarter and faster than the rest. In the heat of the moment, the time pressure made us doubt of our results. We felt uncomfortable and insecure of our output. We missed the security of being structured, being aware of the coverage, and being able to take calculated decisions. Every now and then, we’d breathe a little and bounce an idea around. We kept a few flexible boundaries and had 2 seconds checks if we are ok with what we are doing. There isn’t much you can put in place in such a short time and it’s important to trust each other, and follow what we feel is right. Everything was fast paced that day, and even if traditionally testing requires extensive work, we needed to find new ways to deliver solid results in a very short time

span. Coming back to the contest, and observing what others shared online about their experience, we discovered that we were not the team with the highest number of defects, nor with the most critical ones. We didn’t even win any of the special prizes. So how did we really win? It is a question that wanders in our minds from time to time, and one answer that we all believe in is that when you are into something, it shows! We come out of this first competition having learned two things. The first one is that we are spoiled in our day to day jobs and we don’t even know it. We have so much time to build our testing strategy, to be able to analyze the product in enough depth. And the second one is the importance of being able to trust and easily communicate with your team mates during critical situations, without these we would have wasted precious time and never met our deadline. Most importantly, the Software Testing World Cup preliminaries opened our appetite for this kind of exercises; it made us reflect on the areas where we would like to deepen our knowledge and most certainly enriched our testing style. Our team will take part in November in the finals of this competition. Regardless of the result, we feel like we’ve already won and we would like to encourage all testing professionals to enroll in this type of contests, where the experience gained is much more valuable than the prizes or the ranking!

www.todaysoftmag.com | no. 28/october, 2014

41


management

Marketing budget = Advertising budget?

L

et’s look at it from a different angle…Most small and medium sized companies do not use the marketing budget concept. Best case scenario is when they have an advertising budget.

But what about the other marketing investments? • Events for meeting customers • PR & Networking • Optimizing processes for a better service or a better product • Training the employees • Checking customers’ satisfaction • Studying the competition/market opportunities • Measuring the marketing costs efficiency Aaah… those are handled by other departments. Processes? By management. Competition? No one knows the competition better than the sales team. Cost efficiency? There’s a Financial Department…. and management. True, but marketing analyses are focused on different themes than financial analyses. If management doesn’t have any special professional marketing skills, then marketing should be directed to analyze all processes that are creating value for the customers and should have dedicated measurements in the marketing budget. Marketing realities will keep marketing budgets mixed with other departments’ budgets, but efforts should be made constantly by marketing responsibles to have an overview on the general value created

by a company on different market sectors and on different responsibility levels within the company. Managers have a difficult decision here. How much should they allow marketing to adjust other processes inside the company? These kinds of analyses and measures should be considered in the end, in the overall budget of the company. Reality is that the most credible, competent of them all will have the budget accepted. But sometimes they don’t check out the business from this angle. The General Manager and marketing responsibles are the only ones that can have angle views upon the business. In the end, having control on value proposal for customers is the objective.

communication plan 3. Keeps budgets flexible depending on revenues evolution 4. Tries to evaluate the return of investment for every money spent 5. Keeps the budget realistic (your financial specialist should monitor the expenses and revenues as those were planned and propose necessary adjustments periodically) 6. Makes sure your management team knows that they must spend their budgets smarter than competition 7. Makes sure you have in your management team long term partners and a clear vision of the future of the company, otherwise previous recommendation will have fewer chances to happen.

Also important! Encourage marketing to be creative, courageous in proposals and So… how should we build the marketmake the right decisions based on the real ing budget? context of the company and its long term The difficult mission of managers is also influenced by the complexity of value objectives! creating processes in the company. In the end Marketing is… everywhere. It isn’t necessary to have everything centralized in the marketing budget but make sure your management team: 1. Monitors the history of actions, expenses and performance 2. Monitors the competition and their

Adrian Abrudan

adrian.abrudan@loopaa.ro Senior partner & research director @ Loopaa

42

no. 28/october, 2014 | www.todaysoftmag.com


communities

TODAY SOFTWARE MAGAZINE

The drones are here

T

he drones are here. And it’s about time we got used to it. By now, you’ve probably already heard about the „Drone Revolution” that’s taking place. Sure, they started off with a bad wrap from their initial military applications but people all over the place, from Amazon to backyard hobbyists, are starting to see other uses for drones that can benefit our lives in amazing ways.

Imagine you want someone to record you while you’re out running the marathon this weekend. How do you do it? Sure, you could call up a friend and ask them to record you. But how would they do it? Really, just sit down and think of the logistics here. Would they run alongside you, camera in hand, bouncing up and down? Probably not. Well, maybe they could get in their car and drive slowly beside you, all the while keeping one hand on the camera and the other on the wheel. Oh yeah, and running over all the other marathoners along the way. That would be a story for the papers. Or you could have a drone do it. Strap a camera to it, start it up, and watch it effortlessly fly alongside your athletic self, recording as it goes (okay, maybe it’ll fly slightly higher than that, we still want to avoid the other runners). This is just one of the many ways that drones are enabling us to do innumerable things we couldn’t do before. Amazon is soon rolling out drones that can deliver packages to your door, just 30 minutes after you order them. Forest managers are now using drones to track wildfires - originally an expensive

and time-consuming task reserved for helicopter pilots. Farmers are letting drones take over the job of monitoring their crops, keeping an eye out for signs of disease or damage. Everywhere you look, drones are finding their way into everyday life, allowing us new ways to interact with our environment and to extend our capabilities. The amazing part is, they aren’t even some expensive technology far out of financial reach from the everyman. Depending on what you want to do with it, you can go online and order a standard sized drone (about 50 cm in diameter) for about 200 EUR or a micro drone that can land on your finger that costs as little as 25 EUR. Where we see the real innovation happening in terms of drones is in the Maker community – a subculture of technical minded individuals who create high quality electronics and gadgets at home. Unrestrained by the tangle of corporate bureaucracy and empowered by emerging technologies like home 3D printing, Makers worldwide are poised to rocket society into a new era that blurs the lines between consumer and producer as more and more people create customized gadgets at home to suit their individual needs. The Tech Makers and Designers group here in Cluj is one such coalition of people pooling its abilities to make brand new things. Last month, Tech Makers and Designers started plans to make a drone of its own. While still in the fund-raising phase of the project, the members of Tech Makers are excited to start working on this project. Once the drone is complete, the group plans to turn the drone over for its members to imagine new ways of using it to benefit the community and the city as a whole. In all, drones are bound to revolutionize the way we do everything. From selling houses to preventing poaching

to sending packages in the mail, drones

are well on their way to make a lasting impression in our lives. In the next few years, the word “drone” is likely to be as household a term as “smartphone”, tossed around casually without much thought given, meanwhile referring to an object we couldn’t possibly imagine our lives without. If you’re interested in learning more about Tech Makers and Designers and the work they do and/or would like to make a contribution, please contact drone@ clujhub.com.

Thomas Morris

thomas.imorris@gmail.com

Freelance Web Developer

www.todaysoftmag.com | no. 28/october, 2014

43


management

Gogu, Petrică and The Wolf

“Come, dad, come! There’s a fire!” Gogu hasted to the kitchen, felt the smell of smoke and quickly looked about for the possible source. However, with the tail of his eye he noticed that something wasn’t right and immediately realized what was fishy: both the mother and the child were leaning against the wall, the same playful smile on their face, but also in their eyes, both of them suspiciously calm. God, this child looks so much like his mother, Gogu couldn’t help noticing. “You, rascals, what are you up to here? What’s with all this smoke? ′Cause you wouldn’t smile to me like that if there were something more serious…” His wife smiled warmly and said: “I’ve managed to burn the pumpkin. The kid thought it funny to make you budge from that armchair on this occasion; maybe you could honor us with your presence, at least if there is a fire threat…” Gogu smiled: “Well, just wait and see! You little scapegrace… do you want to end up like in the story of Petrica and the wolf?!” “What story?” The child asked curiously. Gogu shook his head in disbelief: “I can’t believe you don’t know!” He immediately figured out that the story hadn’t been among the child’s readings and decided it was the time for a serious father-son talk. Obviously, having as background the story of Petrica, who had alarmed the village in vain for several times, lying that the wolf had made havoc among the sheep which he was watching over. And then, when the unwanted quadruped decided indeed to feast on the respective sheep, Petrica screamed in vain, cried, even begged the villagers for help, they refused to get out, thinking they were dealing once more with one of Petrica’s practical jokes. Gogu felt really proud… *** Send/Receive. Nothing. Gogu fetched a sigh, looked at his watch – it was near

44

the end of the work day – then clicked the Outlook update button once more. Still nothing. I should call him, he said to himself. But he immediately gave up. He knew that Chief reads his mails and – if he has the time – he answers. Especially to those mentioned as “important”. If he hasn’t answered yet, it means he hasn’t had the time, and if he hasn’t had the time, there is no point in me calling him”, Gogu continued his thread of thoughts. And he clicked again the Send/Receive. Wow, wait, it does budge… He waited impatiently, then sighed in disappointment: it was a message from Misu. He didn’t open the email, he knew too well what Misu wanted, but he had nothing to tell him since he hadn’t got a green light from the Chief. Send/Receive. Damn it! “What’s the trouble, Gogu?” “You startled me… What are you doing? Are you sending the email and then running quickly to see which one of you gets here first?! What do you want?” Gogu rounded on Misu, who had unexpectedly shown up behind him. “Ha, ha, which one gets here first”, Misu laughed while humming Gogu’s words. “That’s a good one… Well, I am waiting for an answer.” “Well, I am waiting, too”, said Gogu. Then he added in a sad voice: “Chief hasn’t answered…” “And why don’t you talk to him? He is in the hall, joking with the guys…” Gogu felt a blow in his stomach. What?! He is at his wit’s end with the project, going crazy while waiting for a sign from the Chief and Chief feels like joking in the hall?! He looked at his watch once more, worried, then rushed towards the hall. Misu followed him quickly. “Chief, I’m sorry to interrupt you, but I really need an answer from you; can you help me?” “An answer? To what, Gogu? Tell me quickly, ‘cause there’s little time left… I can

no. 28/october, 2014 | www.todaysoftmag.com

already feel the weekend breeze,” smiled Chief, obviously pleased at the perspective of the free days that were about to begin. Gogu, slightly confused, managed to babble in a mild rebuke: “The report, Chief; I’ve sent you the monthly report on my project.” “Yes, I know. I haven’t read it, ‘cause I saw it was ok; I will read it at leisure next week; there’s no hurry.” Gogu looked blank. What do you mean it’s ok? How come there’s no hurry? “Well, Chief, the report shows the project in a yellow state, meaning warning. And we have some suggestions there, which we wanted you to approve for us so that we can communicate to the client and move on. Yellow, meaning that we need some answers”, repeated Gogu in despair. Now it was Chief ’s turn to be confused: “I saw it was on yellow, but it has been like that for two months and you’ve never asked me for anything till now, you have just made me aware of some situations on their way of being solved. I thought that now it was the same; how was I supposed to know that things are different this time? See why I’ve asked you not to put on yellow but the situations that are getting serious?! Wouldn’t it have been better if you had let the project on green until now? I would have immediately seen that this time it requires an intervention… Hmm, do you know the story of Petrica and the wolf, Gogu?” The goddam wolf…

Simona Bonghez, Ph.D.

simona.bonghez@confucius.ro Speaker, trainer and consultant in project management, Owner of Colors in Projects



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.