Wednesday, August 18, 2021

Some Tips to Reduce GIT Conflicts

 When  you  are working  on  same  project  with  many  co-workers  , I think those  small  steps  will  be  reduce pain  of  resolving  GIT conflicts .

1.  Re-base  every  day as  you  can   from  remote branch which you are wanted to merge ,your  local  branch .

2. If  any  thing standard git conflict  resolving ways  you  tried didn't  works , you may  use  this way. Create  a  backup  of  your  current  project  and then  create  a local new  branch  from  remote  branch  which  you  wanted  merge to  finally . Then  copy  paste  your  changes  from backup project  to  new  branch .  You  have to  make  sure  all  your  changes are  copying  to  new  branch .  After  that  please  make  do some  testing  to  check  all  changes  are there .  Then  push  your  changes to remote .  Finally  create  a pull  request . I  think  this  way  may not  be  much  professional  , but  this  also  can use as  your final  try.


Version  1.0.0

How to send email using Spring Boot Application with Gmail SMTP Server

Sunday, August 15, 2021

Short notes on different development technologies by GoalKicker

This web site may be useful  to get good notes about  various technologies  .


https://goalkicker.com/

Thursday, July 29, 2021

Fix issues before they exist - SonarLint is an IDE extension

 This  extension is  really  useful to  improve  our  code  quality .

Fix issues before they exist

SonarLint is an IDE extension that helps you detect and fix quality issues as you write code.
Like a spell checker, SonarLint squiggles flaws so that they can be fixed before committing code.

 

 

 

https://www.sonarlint.org/

Wednesday, July 21, 2021

How to create a icon to run for application in Ubuntu

 1.  Go   to   root  folder and  then open  a  terminal there .  If  not  use  Ctrl  +  L   and  search  "/usr/share/applications"

2. Then  go  to  path  "/usr/share/applications

     root@roshans-HP-PrBook-G4:/usr/share/applications#

3. Then  we have  to  give  a  name  for   icon  name as  we want ,

    Here  my  icon  name  is   "intelJIdea"

   sudo  touch intelJIdea.desktop 

4. After  that   sudo vi   intelJIdea.desktop .Then    we  have  to add following  code  to  that  file  

    [Desktop Entry]
    Name=IntelliJ IDEA
    Comment=IntelliJ IDEA IDE
    Exec=/home/roshans/Documents/Software/idea-IC-211.7628.21/bin/idea.sh
    Icon=/home/roshans/Documents/Software/idea-IC-211.7628.21/bin/idea.png
    Terminal=false
    StartupNotify=true
    Type=Application
    Categories=Development;IDE;

5. Then  save  that  file using :wq

6. Then  you  will  be  able  to  find   icon   for  any  application  you  wanted  to  run  using  icon  in the   your  application  list.  

 

 

 


 

Saturday, June 26, 2021

Arrays Utility Class in Java

The Arrays is a utility class which can be found in the  java.util  package. It is very  useful class  and  following  are some of useful methods it has:

  • asList(): returns a fixed-size list backed by an array.
  • binarySearch(): searches for a specific value in an array. Returns the index of the element if found, or -1 if not found. Note that the array must be sorted first.
               int  indexWhichFound  =  Arrays.binarySearch(arrayToSearch,  keyWhichWantToFind);
  • copyOf(): copies a portion of the specified array to a new one. 
               Interger[]   trimmedArray    =   Arrays.copyOf(originalArray, newLength);
  • copyOfRange(): copies a specified range of an array to a new one.
                Interger[]   croppedArray    =   Arrays.copyOfRange(originalArray, startLength,  endLength); 
  • equals(): compares two arrays to determine if they are equal or not.
  • fill(): fills same values to all or some elements in an array.
  • sort(): sorts an array into ascending order.
                 void sort(X[] a)
                 void sort(X[] a, int fromIndex, int toIndex)
                 void sort(T[] a, Comparator<? super T> c)
                 void sort(T[] a, int fromIndex, int toIndex, Comparator<? super T> c)

In addition, the System.arraycopy() is an efficient method for copying elements from one array to another. Remember using this method instead of writing your own procedure because this method is very efficient. Arrays.copyOf(originalArray, newLength)  method  internally  uses that  method .Refer  this  document  for more  about  creating  a  copy  of  array. 

System.arraycopy(Object  copyFromArray, int startingPositionOfArrayToCopy,
                             Object  copyToArray, int landingPositionOfArrayCopy, int totalNumerOfComponentsToBeCopy)

So far I have walked you through a tour of arrays in Java. Here’s the summary for today:

  • An array is an object.
  • Elements in an array are accessed by index (0-based).
  • Advantage of array: very fast access to elements.
  • Disadvantage of array: fixed length, not appropriate if a dynamic container is required.
  • The java.util.Arrays class provides useful utility methods for working with arrays such as filling, searching and sorting.
  • The System.arraycopy() method provides an efficient mechanism for copying elements from one array to another.

 

References Used  :-  Notes about Arrays in Java

Some interesting things to explore more

 Here  some  some  things  to  study  more ,     How Google Search works               https://developers.google.com/search/docs/fundamental...