Creating a Java 10 project in IntelliJ IDEA with JUnit 5 and Gradle support

IntelliJ IDEA is a free and open-source (yay!) IDE for Java development. It’s a huge-huge-huge improvement over the slow and ageing Eclipse. Recently, I wanted to do some programming practice, so I thought why not in Java. I started by writing my code in good ol’ Notepad++. Very soon I reminded myself about my TDD resolution — to never write code without unit tests. This meant needing something serious to write my Java code. It was a good opportunity to try out IDEA, something I had been meaning to do since I learnt that Android Studio is based on it (that was long ago, like 3-4 years ago).

Creating a Java project and running/debugging code in IDEA is pretty simple and quick. Configuring IDEA to support JUnit 5 tests, on the other hand, is no child’s play. It took my literally more than a day to get it to work. And hence this blog post, which is a note to self to quickly set up things in future.

If you are interested in checking the Java project that I had created in IDEA (referred to in my screenshots below), check my GitHub repo.

Continue reading Creating a Java 10 project in IntelliJ IDEA with JUnit 5 and Gradle support

Hackeam ’18 – A hackathon that left a lot to be desired

I am back from two days of sheer coding, brainstorming, strategizing and bonding. It was one of the most tiring weekends I’ve ever had. I drove more than 100 kilometers going to and fro.

When Shivam told me about the 2018 edition of Hackeam, I was not immediately excited. It was when I heard about its unique methodology that I decided to participate. Like regular hackathons, its main event is about 24 hours of non-stop coding. Unlike regular hackathons, that’s only one aspect of the whole thing. Their motto says it all:

Trek. Report. Hack. Adapt. Achieve.

This year’s theme was using technology to make a significant social change. It was a good theme — a practical one — given that most hackathons focus on bringing out the best programming talent.

Continue reading Hackeam ’18 – A hackathon that left a lot to be desired

Rails: Two different layouts with two different CSS frameworks

I have said it before. Rails is awesome. I find myself creating a new web application in Rails rather than, say, ASP.NET or even PHP much more often. It is intuitive and uncomplicated. Command-line tools and pre-handpicked components allow me to focus more on writing code and implementing business logic.

While working on a Rails application, I was faced with a (reasonably) common situation — having one layout for the end-users and another for administrators. I had my admin pages all written and finished. My CSS framework of choice at the time I started was Ink, mostly because of its fresh UX and Bootstrap‘s aging grid system. When I was about to start with end-user pages, I found out about the release of Bootstrap v4.0.0 (something I had been waiting for since long). The examples made using this version were very much in line with what I wanted for my own purpose. I had made a decision: use Bootstrap for end-user pages and stick to Ink for the admin interface. Realizing this decision in Rails was not as easy as I had thought.

As good as the Rails documentation is, I frequently find myself wanting for more code snippets and examples for things that are apparently presumed to be too basic to explain. After stackoverflowing into the problem and applying some common sense, I came up with the following solution.

Continue reading Rails: Two different layouts with two different CSS frameworks

Talking to a Bot: Awesome times with AI and NLU

Credit: inago.com/technology

Everyone is talking about Artificial Intelligence (AI). Recent times have seen a big surge in AI research and huge investments in that direction by corporates and academia. Major IT and consulting players have even declared AI as an emerging trend, and have started offering AI-based services to their clients.

Working at Accenture Labs, it’s a privilege to play with the latest and the greatest trends. All cutting edge work at Accenture begins at Labs. My team was tasked with creating a Skype for Business bot: a virtual agent – just like a Facebook chat bot – to intelligently understand and respond to user’s queries, in a way a human does. As some people would guess, this required some sort of natural language processing (NLP) capabilities to be added to the bot.

With the recent explosion of cognitive offerings from the “biggies”, we didn’t have to start from scratch in order to implement such a profound functionality. We relied on Microsoft’s LUIS for our bot’s language understanding capability. Although working with LUIS was fun, the curious keeda (bug) in me had me looking for alternatives. I soon found out that the concept of intents and entities was common across NLU frameworks. Google’s API.ai and Facebook’s Wit.ai both work on similar models, except they have a slight edge over LUIS in their ability to keep track of context.

It’s been a great learning experience so far, and I intend to delve deeper into NLU. And, maybe, explore other AI-based cognitive technologies, such as speech recognition and computer vision (I have dabbled in both in the past).

C’est génial!

P.S.: On this topic, check out Mark Zuckerberg’s attempt at building Jarvis, his home automation AI.

Progressive Web Apps

Credit: blog.ionic.io
Credit: blog.ionic.io

You have no doubt heard of Progressive Web Apps by now, PWA for short, haven’t you? No? That’s okay. The thing is still pretty new.

Although the concept is not entirely unique, recent advances in web standards & technologies have now made it possible to create mobile-first web apps that work equally well on desktops web apps that look good & consistent on different devices and that can “progressively” use additional underlying features in a device. Still don’t get what’s new?

Google presented the concept in its I/O developers’ conference earlier this year. As per Google:

A Progressive Web App uses modern web capabilities to deliver an app-like user experience.

Do check out Google’s developer website for a more elaborate introduction to PWA, although I found Smashing Magazine’s description of the same to me much more clearer.

I had been hearing about the hype since a few months but didn’t care much to explore it in detail. Up until Ionic, my favorite mobile app SDK, made their PWA support official.

I think it’s a smart move by Ionic to include PWA support. Until now, Ionic apps were too mobile-ish to be used as web apps. PWA support is an important update to an already great mobile SDK, and I hope this changes many things for the good.

Today, creating a new app essentially means (a) creating a solid backend API (b) creating client apps for various popular platforms (Android, iOS, etc.), and (c) optionally, creating a complementary web app for the desktop. PWA could be a game changer as it takes care of both (b) and (c) in a single development cycle.

While browsing the Google developer website, I stumbled across a very interesting case study for PWA.

Flipkart, India’s largest e-commerce site, decided to combine their web presence and native app into a Progressive Web Application that has resulted in a 70% increase in conversions.

In 2015, Flipkart, India’s largest e-commerce site, adopted an app-only strategy and temporarily shut down their mobile website. The company found it harder and harder to provide a user experience that was as fast and engaging as that of their mobile app. But then, Flipkart decided to rethink their development approach. They were drawn back to the mobile web by the introduction of features that made the mobile web run instantly, work offline, and re-engage users.

Yep, going app-only was a really stupid move by Flipkart. Thank God sense prevailed.

I am going to try out Polymer, a JavaScript library, from Google, for building progressive web apps. I think I’m going to make my next web app using Polymer rather than Bootstrap.