Geeky Minds
https://blog.geekyminds.net/
Recent content on Geeky MindsHugo -- gohugo.ioen-usSun, 18 Feb 2018 20:40:41 +0000Stop Writing Code That You Can’t Test
https://blog.geekyminds.net/testing1011/
Sun, 18 Feb 2018 20:40:41 +0000https://blog.geekyminds.net/testing1011/<p>Hello There!</p>
<p>So, we at GeekyMinds were discussing on what to learn next along with you. We just had a look at our past and understood how far we have come.</p>
<p>We started from our childhood and thought of all the ways that helped us evolve. There was one common question that kept coming umpteen times in the discussion.</p>
<blockquote>
<p>How do we evaluate our growth?</p>
</blockquote>
<p>I understand there was no generic answer to that question. But in the world of Bits and Bytes, there is!</p>
<p><em>Testing</em>. So, we decided to learn how to test our code and focus on the best practice of TDD ( Test Driven Development ).</p>
<p>We will be writing a series of blogs on Testing and TDD. Here is the first blog of the series:</p>
<p></p>Code Sangalpam
https://blog.geekyminds.net/code-sangalpam/
Mon, 15 Jan 2018 13:01:50 +0000https://blog.geekyminds.net/code-sangalpam/<p>So, it was yet another sleepless night. It’s quite common to sleep late nights when you’re a bachelor. You will have the freedom to do things at your own pace and place. However, life changes after marriage and you may not have the same freedom.</p>
<p>It’s not that bad actually. Alright, enough of rants, let’s cut down to the chase.</p>
<p>Your coding style changes when you join an organization. There are enough stories out in the past and present. Promising companies have disappeared due to a messy codebase.</p>
<p>The codebase is the core of every software company out there as the codebase is what drives the product or service. It reflects the culture of the company.</p>
<p>I’d like to share with you a few short notes that helped me evolve as a better programmer, in this field:</p>
<p></p>What a Static Life?
https://blog.geekyminds.net/what-a-static-life/
Mon, 04 Dec 2017 17:22:11 +0000https://blog.geekyminds.net/what-a-static-life/<blockquote>
<p><em>“Life is so static nowadays!”</em>, says an old man combing his beard. Yes, when you get old, life would be static. because you’re no longer solving any problems.</p>
</blockquote>
<p>But not for Harland Sanders, who’s more widely known as Colonel Sanders or the man behind KFC.</p>
<p>In programming parlance, “_Static_” is an interesting word. It’s a common pitfall for budding developers like us. Let’s take a look at it and see how to use it!</p>
<h2 id="static-an-exciting-keyword">Static – An exciting Keyword</h2>
<p>So, what is the Static keyword in the context of programming and what is it associated with?</p>
<p>You can associate Static keyword to variables (properties in object-oriented parlance), methods, blocks, and classes (Yeah, with classes as well!). What it does is to change the behavior of the associated things. Let’s review this one by one:</p>
<p></p>Don’t Repeat Yourself
https://blog.geekyminds.net/dont-repeat-yourself-dry-principle/
Sun, 05 Nov 2017 13:15:00 +0000https://blog.geekyminds.net/dont-repeat-yourself-dry-principle/<p>Principles. Software Engineering principles. Anyone remember the syllabus/topics the paper covered in our Engineering? I wish I could. Less did I know that I would need those principles as I grew in my career.</p>
<blockquote>
<p>Anybody can write code. But in human understandable form?</p>
</blockquote>
<p>That’s the realization point. Coding is an art, Indeed. A maintainable codebase is something companies are thriving to achieve.</p>
<p>Philosophies apart. We are gonna try learning one essential principle. <strong>“Don’t Repeat Yourself (DRY).”</strong></p>
<p><strong>So, What’s this Principle is all about?</strong></p>
<p>One of the reasons why I didn’t learn Software Engineering principles in college is the overwhelming theoretical explanations without a practical approach to back it up.</p>
<p>Let’s jump straight into examples and learn from it.</p>
<p></p>Solving Project Euler Problem 42 – Coded Triangle Numbers
https://blog.geekyminds.net/solving-project-euler-problem-42-coded-triangle-numbers/
Mon, 16 Oct 2017 10:47:00 +0000https://blog.geekyminds.net/solving-project-euler-problem-42-coded-triangle-numbers/<p>Following up from my previous post, where I attempted <a href="http://blog.geekyminds.net/solving-project-euler-problem-13-large-sum/">Solving Project Euler Problem 13 – Large Sum</a>, I took up <a href="https://projecteuler.net/problem=42">Problem 42 – Coded Triangle Numbers</a></p>
<p>While the original problem is a bit more complex, <a href="http://hackerrank.com">Hackerrank</a> had broken it down a bit more simpler.</p>
<p><strong>Note</strong>: This solution times out after the first 2 test cases out of a total of 7 test cases. So, while the solution is technically correct, it’s not the most optimal way to go about it.</p>
<h4 id="problem-statement">Problem Statement</h4>
<p>The nth term of a sequence of triangle numbers is given by,</p>
<blockquote>
<p>tn= 0.5 n (n+1)</p>
</blockquote>
<p>So the first ten triangle numbers are:</p>
<p>1,3,6,10,15,21,28,36,45,55,⋯</p>
<blockquote>
<p>You are given an integer. If it is a triangular number tn, print the term n corresponding to this number, else print −1</p>
</blockquote>
<p></p>Solving Project Euler Problem 13 – Large Sum
https://blog.geekyminds.net/solving-project-euler-problem-13-large-sum/
Sun, 15 Oct 2017 09:34:00 +0000https://blog.geekyminds.net/solving-project-euler-problem-13-large-sum/<p>For my next problem, I decided to take one of the popular routes and experimented with few of the simpler problems from <a href="https://projecteuler.net">Project Euler</a></p>
<p>The first problem that I tried was <a href="https://projecteuler.net/problem=13">Problem 13 – Large Sum</a></p>
<h4 id="problem-statement">Problem Statement</h4>
<blockquote>
<p>Work out the first ten digits of the sum of N 50-digit numbers.</p>
</blockquote>
<h4 id="input-format">Input Format</h4>
<p>The first line contains N, next N lines contain a 50 digit number each.</p>
<h4 id="output-format">Output Format</h4>
<p>Print only first 10 digits of the final sum</p>
<h4 id="constraints">Constraints</h4>
<blockquote>
<p>1 ≤ N ≤ 10^3</p>
</blockquote>
<p></p>Simple Program For Finding Symmetrical Point
https://blog.geekyminds.net/simple-program-for-finding-symmetrical-point/
Sat, 14 Oct 2017 08:19:00 +0000https://blog.geekyminds.net/simple-program-for-finding-symmetrical-point/<p>Following up from the earlier post, I first started with a very simple mathematical problem of finding the symmetrical point, given a set of coordinates.</p>
<p>The problem statement is as follows:</p>
<blockquote>
<p>Given two points P and Q, output the symmetric point of point P about Q.</p>
</blockquote>
<h4 id="input-format">Input Format</h4>
<p>The first line contains an integer T representing the number of test cases</p>
<p>Each test case is a line containing four space-separated integers Px Py Qx Qy representing the (x,y) coordinates of P and Q.
</p>Archives
https://blog.geekyminds.net/archives/
Mon, 01 Jan 0001 00:00:00 +0000https://blog.geekyminds.net/archives/License
https://blog.geekyminds.net/license/
Mon, 01 Jan 0001 00:00:00 +0000https://blog.geekyminds.net/license/License textPrivacy Policy
https://blog.geekyminds.net/privacy-policy/
Mon, 01 Jan 0001 00:00:00 +0000https://blog.geekyminds.net/privacy-policy/Who we are Our website address is: https://blog.geekyminds.net.
What personal data we collect and why we collect it Comments When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor’s IP address and browser user agent string to help spam detection.
An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it.