Skip to main content

Find duplicate line from file

Finding duplicated lines can be done easily using regular expressions, Nowadays many text editors support  regx.
Regx - ^(.*)(\r?\n\1)+$

find_duplicate

This is my favorite editor IDEA community edition .

Comments

Popular posts from this blog

is not a JMX compliant Standard MBean

I got the fallowing exception and issue solved. If your are using MBean , MBean Interface and Implementation should be in same package, Otherwise use MXBean. javax.management.NotCompliantMBeanException: MBean class comlanka.rest.controller.DataManagerController does not implement DynamicMBean, and neither follows the Standard MBean conventions (javax.management.NotCompliantMBeanException: Class comlanka.rest.controller.DataManagerController is not a JMX compliant Standard MBean) nor the MXBean conventions (javax.management.NotCompliantMBeanException: comlanka.rest.controller.DataManagerController: Class comlanka.rest.controller.DataManagerController is not a JMX compliant MXBean)         at com.sun.jmx.mbeanserver.Introspector.checkCompliance(Introspector.java:176)         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:317)         at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)        

git Update failed

  Issue -  when you work with a large team, the git repository may have many branch creation and deletion operations, sometimes we may getting git update failed, when we try to update the whole repository. Solution - Tyr >  git fetch -p -p, --prune After fetching, remove any remote-tracking references that no longer exist on the remote. Tags are not subject to pruning if they are fetched only because of the default tag auto-following or due to a --tags option. However, if tags are fetched due to an explicit refspec (either on the command line or in the remote configuration, for example if the remote was cloned with the --mirror option), then they are also subject to pruning.

hamcrest and junit java.lang.NoSuchFieldError: NONE

Issue - When you using hemcrest with JUnit5 you may get  java.lang.NoSuchFieldError: NONE error. Solution - Add junit-vintage-engine to classpath           <dependency>             <groupId>org.junit.vintage</groupId>             <artifactId>junit-vintage-engine</artifactId>             <version>5.3.1</version>             <scope>test</scope>         </dependency>  Full Exception - java.lang.NoSuchFieldError: NONE at org.hamcrest.DiagnosingMatcher.matches(DiagnosingMatcher.java:12) at org.hamcrest.beans.SamePropertyValuesAs.hasMatchingValues(SamePropertyValuesAs.java:63) at org.hamcrest.beans.SamePropertyValuesAs.matchesSafely(SamePropertyValuesAs.java:31) at org.hamcrest.TypeSafeDiagnosingMatcher.matches(TypeSafeDiagnosingMatcher.java:55) at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:12) at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8) at com.codegen.ShopTest.testExtern