<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shamild on Medium]]></title>
        <description><![CDATA[Stories by Shamild on Medium]]></description>
        <link>https://medium.com/@shamild?source=rss-1f8b23e87c6a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Shamild on Medium</title>
            <link>https://medium.com/@shamild?source=rss-1f8b23e87c6a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 19:51:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shamild/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Reflection in Java]]></title>
            <link>https://medium.com/@shamild/reflection-in-java-16cd74d7108b?source=rss-1f8b23e87c6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/16cd74d7108b</guid>
            <category><![CDATA[java-reflection]]></category>
            <dc:creator><![CDATA[Shamild]]></dc:creator>
            <pubDate>Mon, 08 Jun 2020 18:45:27 GMT</pubDate>
            <atom:updated>2020-06-08T18:45:27.142Z</atom:updated>
            <content:encoded><![CDATA[<p>The reflection library is the main tool, that write programs which manipulate java code dynamically. There are programs which we can use to find out the capabilities of classes which known as reflective.</p><p>Java provide the features of inspecting classes, interfaces, fields and methods at run time even without knowing their names. It is also possible to instantiate new objects, invoke methods and get/set field values using reflection. This occur at run time irrespective of the access specifier used with them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*NSj0lxRWNKnOXmX9A99npw.png" /><figcaption>Accessing Methods in Run Time</figcaption></figure><p>To get main information about,</p><ul><li><strong>Class —</strong> <em>getClass() —</em> Class which the object belongs.</li><li><strong>Methods — </strong><em>getMethods()</em> — Get the public methods of the class to which an objects belongs.</li><li><strong>Constructors</strong> <strong>—</strong><em> getConstructors()</em> — Get the public constructors of the class to which an object belongs.</li></ul><p>Other than these main methods there are bunch of other methods can be used to perform several operations.</p><p><strong>getSuperclass(),getClasses(),getDeclaredClasses(),getDeclaringClass(),getPackage(),getModifiers(),getTypeParameters(),getFields() </strong>are some of those methods which we use in reflection.</p><p>Java run time system always maintain the run time type identification on all objects and it will useful to identify for which class the object belongs. The usage of this method is to select the correct methods to execute by virtual machine. To access these information we can use special java class called <strong><em>Class </em></strong>.</p><p>Particular type of object describes the properties of particular class. More generally if we define object variable as “<em>Class c1 = e.getClass();”</em>, then whatever type of object (e) gives its class properties. To get the class name mostly using <em>.getName()</em> method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*pzpeBPzfkBcxJdo7-QYhhQ.png" /><figcaption>simple code of how getClass() works</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*iad6ME-iDC7qzlofi7rZrw.png" /><figcaption>output of the code</figcaption></figure><p>If we know the class name and we need to obtain a class we can use static <em>forName() </em>method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*A795OgiUIhfO_Bj1NrV17g.png" /><figcaption>Create an object for particular class</figcaption></figure><p>To create new instant in another way. “e.getClass().newInstance();” is call for the particular class.</p><p>Now let us see how can analyze the capabilities of the class using <strong><em>Reflection.</em></strong></p><p>Within the <em>java.lang.reflect</em> package there are mainly three classes called Field, Method and Constructor. Those classes provide properties of the respective type within the given class. All three classes have a method called <em>getName</em> that returns the name of the item. The Field class has a method <em>getType</em> that returns an object, again of type Class, that describes the field type. All three of these classes also have a method called <em>getModifiers</em> that returns an integer, with various bits turned on and off, that describes the modifiers used, such as public and static. Use methods like isPublic, isPrivate, or isFinal in the Modifier class to tell whether a method or constructor was public, private, or final.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*sjE8-S2nGuoRCnE8T8Xg5Q.png" /><figcaption>Methods use to check states</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*LtsL4xl5TmGA9_BFpCmPrA.png" /><figcaption>output</figcaption></figure><p>Finally we can use this concept to find out values assigned for variables which user cannot see. (Example code is below)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*UgPvpputH8HtLKBi1Vefaw.png" /><figcaption>Main Class</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*IYPK7ZmVDEfQeaw2xNtyDw.png" /><figcaption>Child Class</figcaption></figure><p>Here, once <em>getVariableValues() </em>method calls it gets object name and the variable name as the string in arguments. Then the program checks particular class and the variable name for given object. Finally returns the value of given variable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16cd74d7108b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coding Practices]]></title>
            <link>https://medium.com/@shamild/coding-practices-51d6b601d03a?source=rss-1f8b23e87c6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/51d6b601d03a</guid>
            <category><![CDATA[coding-practice]]></category>
            <dc:creator><![CDATA[Shamild]]></dc:creator>
            <pubDate>Mon, 08 Jun 2020 18:44:43 GMT</pubDate>
            <atom:updated>2020-06-08T18:44:43.878Z</atom:updated>
            <content:encoded><![CDATA[<p>This best coding practices are not rules. Those are conventions that software development community has developed to create quality software.</p><ol><li>Commenting</li></ol><p>This should follow in smart manner. It is not a good habit to comment every single line in a code. If so it means that the code we wrote is not descriptive. This is a bad practice. We can limit those comment in function wise even only we need to note down some stuff.</p><p>2. Indentation</p><p>Indentations will helpful to make readable code blocks. There can be many ways of indentations. It will totally depends on the way your team mates follows. Finally what we should see is the code with same indentation style.</p><p>3. Grouping</p><p>Code blocks will helpful to group particular task. Usually task may contain several coding lines. By leaving small space in between these two blocks it will give a readable code.</p><p>4. Naming Scheme</p><p>In codes we can see two types of naming schemes. As mentioned in indentations this should match with other developers coding style.</p><p>— Camel Case : First letter is capitalized in each word except first word.</p><p>— Underscore : Word separation is with an underscore.</p><p>These names should reveal the intention of the task. It will save the time in by reducing conflicts of the code. Also should aware not to give wrong information from the name. It will miss lead the reader.</p><p>When we are dealing with temporary variables we no need to use full words. We can work with even one character. But if this variables contributes for further applications we have to follow name conventions as mentioned above.</p><p>If we dealing with databases those quarries should used in upper case to identify them easily.</p><p>5. Dry Principle</p><p>This means to the “Don’t Repeat Yourself”. Simply we uses codes to make a task easy. As an example in a web application it has several pages with similar type of headers and footers. So, the exact code should not copy paste in each code. This is because once we have to make a change we need to edit each and every place. We can avoid this by using DRY principle.</p><p>6. Deep Nesting</p><p>When we are going through the development stage to complete a task, it creates some logic which solve within a deep nested loop. But the issue is if someone who hasn’t idea on this code went through it it will creates a hard time for him. Even the developer could forget what he has done in the code. So, going deeply inside to the nest is not a good practice.</p><p>7. Limit line length</p><p>As humans our eyes mostly familiar with tall and narrow columns of text. Even in news papers we can see this type of text styles. If our code has very lengthy line which reader has to scroll right and read, this is not a good practice. Currently in new IDEs they notify the limit from a marked margin.</p><p>8. Files and folder organization</p><p>If we develop a small application this may not affect for us. But when we are working with large projects file locations will creates some conflicts. For this we can use an already developed file structure as well as we can imitate existing file structure in our project.</p><p>9. Code and Data</p><p>We can separately identify codes and data which we used within the code. Specially in web applications those HTML pages are referred as output data. We can separate those data and code in different file structure.</p><p>10. Object Oriented Structure</p><p>This structure is mostly used in programming which can use to create a structured program. This can use to represent data which we mostly used in databases. Even though, we no need completely convert procedural structures to the object oriented structures.</p><p>11. Open Source Codes</p><p>When a large project is going on, the code will make available for developers to get an idea on it. So it should have high level of readability. Then developers can get clear idea about what others have done.</p><p>12. Code Refactoring</p><p>This is not a case of changing functionality of the code. This only relates with making the code more readable. Even this has not any bug fixing features. Here we clean the code in the way that anyone can clearly understand the code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51d6b601d03a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basics on GitHub/Git]]></title>
            <link>https://medium.com/@shamild/basics-on-github-git-db937cab8003?source=rss-1f8b23e87c6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/db937cab8003</guid>
            <dc:creator><![CDATA[Shamild]]></dc:creator>
            <pubDate>Mon, 08 Jun 2020 18:44:08 GMT</pubDate>
            <atom:updated>2020-06-08T18:44:08.778Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi all, This is my first blog on GitHub. This contains all the basic steps that we need to follow when using GitHub.</p><p><strong>Git</strong> (/ɡɪt/) is a version control system for tracking changes in computer files and coordinating work on those files among multiple people. It is primarily used for source code management in software development, but it can be used to keep track of changes in any set of files.</p><ol><li>Create an GitHub account</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*zbsO6inI9Ujhrc_Gkaj8lw.png" /><figcaption>Sign up screen</figcaption></figure><p>Here we can add our user name, valid email and password as mentioned in above image. Once you click sign up button it will send a verification mail for mentioned e mail.</p><p>2. Configure Security Keys.</p><p>When we are communicating with GIT servers there are two alternative methods. HTTP and SSH are those two ways. In SSH it requires key connection for communication. The GIT SSH setup is mentioned in below link. (<a href="https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent">https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent</a>)</p><p>3. Create Repository</p><p>Before we start a project we need to create particular repository. At that point we can select who can access our repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*WGMOQhfHsiUVOyDwpmAp-A.png" /></figure><p>We can create a local repository in our work area by using <em>git init </em>command.</p><p>4. Committing</p><p>A commit in a git repository records a snapshot of all the files in your directory. Git maintain a history mainly about the commits made before. This will helpful for someone who join for the project later on. To keep commits in light weight GIT keep commits as compressed set of changes from one version to the next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/241/1*XUCMebF6azPWIXHH5ATkAg.png" /><figcaption>Initially two commits</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*a51JIsVaMGq5BFFmuYdW6A.png" /><figcaption>- git commit -</figcaption></figure><p>After adding command for committing, parent commit will change for C1.</p><p>5. Branching</p><p>Simply saying branches are the pointers for the specific commits. If we only creates a branch without checking out once we commit next time it makes changes in Master. To make changes in our new branch we have to checkout it and commit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/253/1*SFOJE9OBykgvbuGBC9G9Pw.png" /><figcaption>New changes are made in branch</figcaption></figure><p>6. Merging</p><p>This is using when we worked in several branches separately and going to combine those stuff together. In practical scenario we can develop several features in separate branches and combine them together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*EqayaK_-cRjbpr4tkwwu_g.png" /><figcaption>Before Merging</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*ySXN2cZR2ioz1HeOHzf1Jg.png" /><figcaption>After Merging to the master</figcaption></figure><p>7. Cherry-Picking</p><p>This is the method of moving work around. It is bit simple than we think. If we are currently checked into master branch and we need some commits which belongs to another branch, we use this git command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*QmhsqS_PVj9_ScIXhZGNIw.png" /><figcaption>Before Picking Commits</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*1C76eMo65AHg7nKt5sv37w.png" /><figcaption>After Picking Commits</figcaption></figure><p>8. Git Tags</p><p>In our project history flow there may be some points that we have to permanently marked in. We need a solution other than branches within this scenario. Since branches are easily mutated, often temporary, and always changing. Tags are not moving as more commits are created. We cannot checkout to the tag and do work in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/1*oBof60EBz7TN4xycgYCzKg.png" /><figcaption>Tag v1 in commit c1</figcaption></figure><p>9. Git Push</p><p>he git push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repository. Remote branches are configured using the <a href="https://www.atlassian.com/git/tutorials/syncing">git remote</a> command. Pushing has the potential to overwrite changes, caution should be taken when pushing.</p><p>git push is most commonly used to publish an upload local changes to a central repository. After a local repository has been modified a push is executed to share the modifications with remote team members.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*SjIQVUQDdOninNdpxptQpA.png" /><figcaption>Before Pushing</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*cfc8v7EE8goBLf_rBIGCrQ.png" /><figcaption>After Pushing</figcaption></figure><p>10. Conflict Resolving</p><p>To resolve a merge conflict caused by competing line changes, we must choose which changes to incorporate from the different branches in a new commit.</p><p>For example, if you and another person both edited the <em>same </em>file on the same lines in different branches of the same Git repository, you’ll get a merge conflict error when you try to merge these branches. You must resolve this merge conflict with a new commit before you can merge these branches.</p><p>To resolve a merge conflict caused by competing changes to a file, where a person deletes a file in one branch and another person edits the same file, you must choose whether to delete or keep the removed file in a new commit.</p><p>For example, if you edited a file, and another person removed the same file in another branch in the same Git repository, you’ll get a merge conflict error when you try to merge these branches. You must resolve this merge conflict with a new commit before you can merge these branches.</p><p>11. Git Commit Message Standard</p><p>When we add commits in the Git it should highly concern because this message helpful for someone to get into our code. Therefore it follows some strategic way of creating this messages.</p><p>-Limit the subject line to 50 characters.</p><p>-Capitalize only the first letter in the subject line.</p><p>-Don’t put a period at the end of the subject line.</p><p>-Put a blank line between the subject line and the body.</p><p>-Wrap the body at 72 characters.</p><p>-Use the imperative mood.</p><p>-Describe what was done and why, but not how.</p><p>12. Mind map for basic git commands</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MRl0Yh-gPJJPRxyTuuC8kA.png" /><figcaption>Basic Git Commands</figcaption></figure><p>References:</p><ul><li><a href="https://www.katacoda.com/courses/git">Learn Git Version Control using Interactive Browser-Based Labs | Katacoda</a></li><li><a href="https://try.github.io/">Set up Git - GitHub Docs</a></li><li><a href="https://www.theserverside.com/video/Follow-these-git-commit-message-guidelines">How to write a Git commit message properly with examples</a></li><li><a href="https://help.github.com/en">GitHub.com Help Documentation</a></li><li><a href="https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent">Generating a new SSH key and adding it to the ssh-agent</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db937cab8003" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Maven in Linux]]></title>
            <link>https://medium.com/@shamild/maven-in-linux-a652704de241?source=rss-1f8b23e87c6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a652704de241</guid>
            <category><![CDATA[maven]]></category>
            <dc:creator><![CDATA[Shamild]]></dc:creator>
            <pubDate>Sun, 29 Mar 2020 14:24:42 GMT</pubDate>
            <atom:updated>2020-03-29T14:24:42.791Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>What is Maven?</em></strong></p><p>Maven is primarily used in Java Projects. It is a build automation tool. It allows the developer to comprehend the complete state of a development effort in the shortest period of time. Other than this the build process of the project become easy. Also, it provides a uniform build system, provide quality project information, provide guidelines for best practices development and it allows transparent migration to new features.</p><p><strong><em>Dependency Management with Maven</em></strong></p><p>Dependency management is a mechanism to centralize the dependency information. It easily manages multi module projects with high degree of control and stability. <em>Transitive Dependency </em>is one of the features that dependency allows to avoid needing to discover and specify libraries that your own dependencies require. This will make easy because we no need to check whether our dependent libraries are depends on any other library and include it. It will happen automatically. To restrict this process it has defined scope.</p><ul><li>Compile — Default scope. Available in all class paths.</li><li>Provided — When JDK or web container going to provide a dependency at run time.</li><li>Runtime — Dependency is not required for compilation, but for runtime.</li><li>Test — Dependency is required during test compilation and execution phases.</li></ul><p><strong><em>What is Archetype?</em></strong></p><p>This is a Maven project template creating toolkit. Here we are trying to provide a system that provides a consistent means of generating Maven projects. Archetype will help authors create Maven project templates for users, and provides users with the means to generate parameterized versions of those project templates.</p><p>To create a new project based on an Archetype, you need to call <em>mvn archetype:generate</em></p><p>Maven provides several Archetype artifacts as mentioned below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zai2gis1HMkKk2_IX0oYpQ.png" /><figcaption>Archetype Artifacts</figcaption></figure><p><strong><em>How to setup Maven on Linux?</em></strong></p><p><strong>Step 1</strong>: Update your server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*zCoGzxkcS9zOFsCgfjGTrw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*KSb-IygBVN5bL9yVK0sf1w.png" /></figure><p><strong>Step 2</strong> : Download the latest version of the Apache Maven</p><p>Download the binary file which relates to Linux OS version. (Official web site: <a href="https://maven.apache.org/download.cgi">https://maven.apache.org/download.cgi</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*tv5nrlLZWfJK7qaN2PC5yg.png" /><figcaption>Download Menu</figcaption></figure><p><strong>Step 3 : </strong>Extract it in a particular directory.</p><p><strong>Step 4 : </strong>Go to the path where extracted the folder and open the terminal.</p><p><strong>Step 5 : </strong>Add class path variable in ~/.bashrc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*FBwIwsTWuvImlzZnFOpB3g.png" /></figure><p><strong>Step 6 : </strong>Add class path to it and save before exit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*tqzqUN47N_oHJzi2xJbXYA.png" /></figure><p><strong>Step 7 : </strong>To make sure class path is added use following code lines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*SO7dju6IdhQS4Aktcg8QSQ.png" /></figure><p><strong>Step 8 : </strong>To ensure that Maven installed successfully use following command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/186/1*suhbnPB_vWmefo0LXEK9kg.png" /></figure><p>Now once you can create and enjoy your java project.</p><p><strong>References:</strong></p><ul><li><a href="https://examples.javacodegeeks.com/enterprise-java/maven/use-maven-dependency-management-2/">How to Use Maven For Dependency Management | Examples Java Code Geeks - 2020</a></li><li><a href="https://maven.apache.org/guides/introduction/introduction-to-archetypes.html">Introduction to Archetypes</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a652704de241" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic Web Pages]]></title>
            <link>https://medium.com/@shamild/dynamic-web-pages-f56e53703f37?source=rss-1f8b23e87c6a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f56e53703f37</guid>
            <dc:creator><![CDATA[Shamild]]></dc:creator>
            <pubDate>Sun, 29 Mar 2020 14:23:35 GMT</pubDate>
            <atom:updated>2020-03-29T14:23:35.909Z</atom:updated>
            <content:encoded><![CDATA[<p>When a client gonna access a web page it has to make HTTP request from the HTTP server. Then in server side it look into particular page and pass it to client as HTTP service. This easily happens in static web pages (Contents are static). What if requested web page is not at the server???</p><p>For that purpose we have a web container at the server. This contains some programs which known as Servlets. Those programs are usually in a language like PHP, Java, Ruby etc. In runtime those programs fetch data from databases and create the web page. For this fetch purpose, Java uses JDBC. There is a responsible figure for this mapping this request for the respective servlet. it calls Development Descriptor which we can find as web.xml. Servers like Tomcat, Jetty have both this HTTP Server and Servlet(Server Component) to handle both static and dynamic web pages.</p><p>Those servlets are core java programs which extends HTTP Servlets. In new servlets it can use annotations instead of web.xml. In the deployment descriptor it has mainly two tags for this mapping purpose.</p><p>&lt;servlet&gt; : Class name of the servlet</p><p>&lt;servlet mapping&gt; : url pattern</p><p>The big picture of an example is given below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*BBlziosvZZD1_tTJnrZxkQ.png" /><figcaption>Client Server connection for dynamic web pages</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f56e53703f37" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>