Articles on Trending Technologies

Technical articles with clear explanations and examples

Java variable declaration best practices

Fendadis John
Fendadis John
Updated on 15-Jun-2020 2K+ Views

Following are the best practices while declaring a variable.Variables names should be short or long enough as per the scope. For example, loop counter variable, i is fine whereas employee as a loop variable.Specific words should not be used as equals, compare, data.Use meaningful names which can explain the purpose of the variable. For example cnt Vs counter.Don't use _ to declare a variable name, Use camel casing. For example, employeeName is better than employee_name.Each organization has its own syntax specific standards. Follow those rules to maintain consistency and readability.

Read More

Why is Java slower than C++ programs?

Akshaya Akki
Akshaya Akki
Updated on 13-Jun-2020 1K+ Views

Modern Java is quite fast and is comparable to C++ code base but it still takes lot of memory. Slowness of Java programs is primarily because of bad programming practices. But following areas are where Java can be improved.Java libraries are written keeping readability and correctness in mind, not performance.Slow String based operations as Strings are UTF-16 encoded objects and are immutable. So more String are used, more memory is required.Boundary checks on arrays also make its operations bit slow.I/O Stream operations are slow considering synchronization checks on each access.Lacking low level functionality like C also attributes to slowness in ...

Read More

Troubleshooting tips

Rishi Raj
Rishi Raj
Updated on 13-Jun-2020 998 Views

Following steps are mostly required to Troubleshoot any problem that occurred in production.As the first step, get the time frame from the user when a particular issue occurred. Get the logs for that particular time period.If logs are very large in size, use grep command to filter out errors.$ grep -o "\w*Exception" error.log | sort -r | uniq -cIt will help to get all the exceptions in error.log sorted in reversed order and give the unique result and with counts.

Read More

What is Java Development Kit (JDK)?

Manikanth Mani
Manikanth Mani
Updated on 13-Jun-2020 954 Views

JDK, contains development tools and JRE.

Read More

Why would a jQuery variable start with a dollar sign?

Johar Ali
Johar Ali
Updated on 13-Jun-2020 424 Views

When you will begin working about jQuery, you will get to know about the usage of the $ sign. A $ sign is used to define jQuery.jQuery variables begin with $ to distinguish them from a standard JavaScript object. Also, it is a convention. jQuery selectors start with the dollar sign and parentheses() − $.Let's take an Example −// jQuery object var $phone = $("#myphone"); // dom object var phone_el = $("#myphone").get(1);

Read More

How to set JAVA_HOME for Java in Windows?

Alankritha Ammu
Alankritha Ammu
Updated on 13-Jun-2020 1K+ Views

Assuming you have installed Java in c:\Program Files\java\jdk directory −Right-click on 'My Computer' and select 'Properties'.Click the 'Environment variables' button under the 'Advanced' tab.Now, add the 'JAVA_HOME' variable and set the path to the c:\Program Files\java\jdk'.

Read More

How to Set Permanent Path of JDK in Windows?

Akshaya Akki
Akshaya Akki
Updated on 13-Jun-2020 1K+ Views

Following are the required steps −Assuming you have installed Java in c:\Program Files\java\jdk directory −Right-click on 'My Computer' and select 'Properties'.Click the 'Environment variables' button under the 'Advanced' tab.Now, alter the 'Path' variable so that it also contains the path to the Java executable. Example, if the path is currently set to 'C:\WINDOWS\SYSTEM32', then change your path to read 'C:\WINDOWS\SYSTEM32;c:\Program Files\java\jdk\bin'.

Read More

What happens in Java Program at compile time?

Alankritha Ammu
Alankritha Ammu
Updated on 13-Jun-2020 516 Views

During compile time, java compiler (javac) takes the source file .java file and convert it to bytecode .class file.

Read More

How to use special characters in Python Regular Expression?

Rajendra Dharmkar
Rajendra Dharmkar
Updated on 13-Jun-2020 7K+ Views

From Python documentationNon-special characters match themselves. Special characters don't match themselves −\ Escape special char or start a sequence..Match any char except newline, see re.DOTALL^Match start of the string, see re.MULTILINE $ Match end of the string, see re.MULTILINE[ ]Enclose a set of matchable charsR|S Match either regex R or regex S.()Create capture group, & indicate precedenceAfter '[', enclose a set, the only special chars are −]End the set, if not the 1st char-A range, eg. a-c matches a, b or c^Negate the set only if it is the 1st char Quantifiers (append '?' for non-greedy) ...

Read More

Where should the Google Analytics Tracking Code be placed?

Johar Ali
Johar Ali
Updated on 13-Jun-2020 151 Views

When integrating your website with Google Analytics, add the Tracking Code in your code. This will allow Google Analytics to track the page views and provide other analytics.Copy the code and place it just before closing tag i.e. in your website code. When you will integrate, the following steps and the tracking code will be visible. This shows how and where to add the tracking code −

Read More
Showing 54011–54020 of 61,297 articles
Advertisements