Azure Developer Stories

We recently wrapped-up our 2nd edition of Azure Developer Stories — a technical blogging contest cum learning program targeting developers.

About Azure Developer Stories

The goal of the initiative is to skill developers to learn new technologies on MS Learn and write technical blogs, articles or video content with demos & code samples sharing their experiences while building on Azure. The stories help other developers across the globe to scale in building solutions on Azure.

Our motto is to make a difference in the developer ecosystem across India by helping developers knowledge-share within the community.

The first Azure Developers Stories was organised in 2020…


by Ganesh Samarthyam (from KonfHub technologies LLP)

PyCharm is an amazing tool! One of the benefits of using IDEs — esp. powerful ones like PyCharm — is that you can do many things automatically. In this article, I cover how to use PyCharm effectively to perform common refactoring tasks that you typically do manually. You’ll also know specific tips & techniques for using PyCharm effectively for refactoring (for example, how to inline a method or extract a method). …


‘Namma’ Cloud Conference is one of the largest of its kind in India — don’t miss it!

We are happy to announce ‘Namma’ Cloud Conference — one of the largest of its kind in India — that will help you to get a run-down on everything cloud.

Cloud Native — Ride the wave of latest and best in Containers (esp. K8s), Serverless, AI & ML, and more.

Embrace Agility — Understand from experts the tools and approaches to help businesses become more nimble

Foster Innovation — Leverage the convergence of cloud infrastructure and AI & ML to innovate at never before speed and scale

Event details:

  • When: 06 March 2020 (600+ developers, 4 parallel…


We learn programming by looking at example code!

We learn programming by doing and by looking at sample code. In this blog post, I’m going to show how write a simple program to generate PDF documents / reports.

Sample Data

What content to use as part of the PDF document? Just for sample data and show how to create tables, let’s try out this simple code:

Arrays.stream(ChronoUnit.values())
.forEach(val ->
System.out.printf("%40s %s \n", val, val.getDuration()));

This prints:


Thanks to Murughan Palaniachari from DevOps & Cloud meetup for contributing to the community by organizing meetups (touching 5k members in just a couple of years now)!

Some techies are Talent+. They are more than just developers — they have something more than raw talent. For example, they create new solutions; contribute to open source; write blogs, vlogs, screen casts; and some others contribute by building communities.

In this blog post, I am going to focus on one such way to become a Talent+ person — building communities by organizing meetups.

Why Organize Meetups?

The primary reason for organizing a meetup is to build and be part of a community.

If that’s not an attractive answer to you, here are other reasons to organise meetups:

  1. Get good connects with the…


Large constructors suck! With IntelliJ IDEA, you can automagically refactor the large constructor to a builder.

Here is an example. Consider this Device class:

class Device {
private UUID deviceId;
private String name;
private boolean status;
private LocalDateTime startDateTime;
private double generatedPower;

public Device(UUID deviceId, String name, boolean status,
LocalDateTime startDateTime, double generatedPower) {
this.deviceId = deviceId;
this.name = name;
this.status = status;
this.startDateTime = startDateTime;
this.generatedPower …

In this blog post, let’s see how to zip a file in Java. The objective is to show how you can use the Java language features and IDE effectively by making improvements as we write the code.

Say you want to zip a txt of csv file. We need to provide the path of the original file and the zip file that is to be created:

var fileName = System.getProperty("user.dir") + "/resources/airquality.csv";
var zipFileName = fileName.replaceAll("csv", "zip");

Let’s open the input file now and keep it ready for reading:

var fileIn = new FileInputStream(fileName);

Its time for opening the zip…


Processing CSV files in Java is fun and easy with streams!

Let’s say we have a CSV file like this:

Country,State,city,place,lastupdate,Avg,Max,Min,Pollutants
India,Andhra_Pradesh,Amaravati,Secretariat Amaravati - APPCB,21-12-2018 03:00:00,70,108,42,PM2.5
India,Bihar,Gaya,Collectorate Gaya - BSPCB,21-12-2018 03:00:00,342,456,226,PM2.5
India,Andhra_Pradesh,Rajamahendravaram,Anand Kala Kshetram Rajamahendravaram - APPCB,21-12-2018 03:00:00,NA,NA,NA,PM2.5
India,Andhra_Pradesh,Tirupati,Tirumala Tirupati - APPCB,21-12-2018 03:00:00,46,72,28,PM2.5
India,Bihar,Muzaffarpur,Muzaffarpur Collectorate Muzaffarpur - BSPCB,21-12-2018 03:00:00,436,500,270,PM2.5
India,Andhra_Pradesh,Vijayawada,PWD Grounds Vijayawada - APPCB,21-12-2018 03:00:00,46,73,32,PM2.5

Its in a directory in your IntelliJ IDEA and it’s path is: “/resources/airquality.csv”

Now, your task is to read this file, and print the entries starting with “India,Bihar”; also you need to skip the header (the first line in the csv file).

Here is how you could go about implementing it:

var filePath = System.getProperty("user.dir") +…


The old-style file processing in Java sucks —instead, use new APIs with stream-style processing!

How do you read a text file in Java? If this is your answer, then its bad:

try (var inputFile = new FileReader("/Users/ganesh/limerick.txt")) {
int ch = 0;
while( (ch = inputFile.read()) != -1) {
// ch is of type int - convert it back to char
System.out.print( (char)ch );
}
}

Two problems are:

  1. It is verbose — quite a few lines of code for something as simple as reading the contents of a text file!
  2. It is low-level — like why do we have to use a int (not char, mind you!) …

Java Stream processing is fun!

In this blog post, I show a simple example of how you can simplify your code (on stream processing) by automatically improving the code in IntelliJ IDEA.

Let’s start with a simple string:

var pearlOfWisdom = "follow your heart but take your head with you";

You can split this sentence like this to get an array of words:

var words = pearlOfWisdom.split(" ");

Now, let’s print the words:

Arrays.stream(words)
.forEach(System.out::println);

This prints:

follow
your
heart
but
take
your
head
with
you

Note that there are some duplicates (“your”). Let’s remove it by calling distinct():

Arrays.stream(words)
.distinct()
.forEach(System.out::println);

Now, let’s sort…

KonfHub

Want to know about the upcoming tech conferences - follow this twitter handle for updates!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store