Writing a CLI in C

The first time I learned C was when I was in the first year of my undergrad studies at IIT Guwahati, India. After learning many other languages like C++ and Java, I wanted to try something out in C. So, I wrote a simple time reminder for my Ubuntu PC that notifies me of the time after every 30 minutes. Currently, this is a simple limit, but this can be changed easily. …

Playing around with maven

Today I played around with maven while working on a personal project and it turned out to be a great decision. What I learned What I learned in the process: Using maven plugins Maven plugins can reduce a lot of work when it comes to automating things. I used maven-assembly-plugin to create an executable jar file, which includes all the resources and dependencies of the project as well. In my project, I added this part to my plugins: <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>path.to.MainClass</mainClass> <addClasspath>true</addClasspath> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> <executions> <execution> <id>make-assembly</id> <!-- this is used for inheritance...…

Hacktoberfest 2017

Hacktoberfest 2017

Hacktoberfest is an initiative by DigitalOcean and Github that is held every year in October to promote Open Source software development. To win a T-Shirt and some goodies, one had to submit four pull requests for any project on Github and get it merged. I contributed by adding 3 of my projects to this challenge as I wanted to help the people who were new to the open source world. These were: stlmp: Implementation of data structures and algorithms in C++, like the Standard Template Library (STL). I added this because I hoped the newer people who did not have...…

Reducing redundancies while using git

With people who use git on a daily basis and use a pattern in their branch names and commit messages, for eg. for a task number, say 12345, the branch name should be ticket-12345 and the commit should be something like: refs #123456 descriptive commit message, it can become really tedious after a while. So, I wrote a bash function that you can use as an alias by adding it to the .bashrc or .bash_aliases. …

New Year resolutions

It’s a new year, everybody! Here are some things that I plan to accomplish this year: Knowledge I plan to learn a lot of things this year, which I will be tracking using this Trello board: I also plan to read topics other than technology. Health I’ve been trying to lose weight since a few years now, but failed due to some reason or the other. I hope I can do it this year. Be tidier Organize time better Exercise more regularly Drink more water Eat healthy Planks, pushups everyday Relationships Value people, who value you, more Be more polite...…

Maven dependency exclusions

Maven is an amazing build tool for Java software projects. One of the best uses of Maven is importing external libraries and using them in your project. There is a mechanism called Dependency management1, which can be used to centralize the dependency information. The drawback While adding a new library or while upgrading an existing library in a large project, it may happen that the new/updated project introduces new dependencies that were previously excluded in the dependency management for some reason (like the library was already present in the JDK). Simulating the situation Let’s simulate this situation. I’ll be using...…

Understanding Java projects structures and how it all works

While working in Java using Eclipse or any other IDE, we usually forget / don’t know how it works underneath the hood. I tried to look up how to make a simple application using a nice directory structure in pure Java, all I could see was articles related to Maven and Gradle. So, I tried to explore how this works using the command line. I was finally able to make it work by observing the Eclipse directory structure. This post contains my experience during the same. Directory structure src ├── main │ └── java │ └── Main.java └── test └──...…