<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4864125858165953220</id><updated>2024-09-19T20:08:25.283+05:30</updated><category term="3 Sum Problem"/><category term="5 Features in Java 8 that Will Change How You Code"/><category term="8 Great Java 8 Features No One is Talking about"/><category term="Auto Format in Eclipse"/><category term="Creating new profile in WAS Server"/><category term="DOS tricks for Java"/><category term="Deployment in Tomcat Apache Server"/><category term="Eclipse Code Formatters"/><category term="Eclipse auto formatting"/><category term="Export/Import the Eclipse XML Formatting Rules"/><category term="Formatting Code in Eclipse"/><category term="Import mysql database"/><category term="Java 8 features"/><category term="Java 8 features."/><category term="Java 8 hidden features"/><category term="Python indentation"/><category term="SCA Support in WAS"/><category term="Three Sum Problem"/><category term="WAR deploy in tomcat"/><category term="WAR file deploy in tomcat"/><category term="WAR file deploy on tomcat startup"/><category term="WAR file deploy using tomcat manager"/><category term="WAS Configuration for eclipse"/><category term="creating vlc media player plugin for gtalk"/><category term="current soundtrack as ur gtalk status using java"/><category term="eclipse formatter xml"/><category term="export mysql database"/><category term="import/export mysql database"/><category term="indentation checker"/><category term="indentation in python"/><category term="tabnanny"/><category term="tasklist command in Java"/><title type='text'>Technical Discussion</title><subtitle type='html'>Few technical tricks and tactics</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://adityangoyal.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://adityangoyal.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Aditya Goyal</name><uri>http://www.blogger.com/profile/06314586793374570427</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVzkkcdRCFN90-Ws96mUCl7t8CooADL5gjz5VVUy_USe7QWidMptXkza-i-5YZZq4_q8GF8uGO4na9QH2I7uSKeVyLy3eAoTyPMA6k9GfZIhr3QtH8H_OQ-RcRYb1Ru7w/s150/IMG_1203.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4864125858165953220.post-6679111642015151959</id><published>2017-03-25T15:52:00.000+05:30</published><updated>2017-03-25T15:52:49.489+05:30</updated><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
Static method vs default method in Interface(Java 8)&lt;/h2&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Designing interfaces have always been a tough job because if we want to add additional methods in the interfaces, it will require change in all the implementing classes. As interface grows old, the number of classes implementing it might grow to an extent that it’s not possible to extend interfaces. That’s why when designing an application, most of the frameworks provide a base implementation class and then we extend it and override methods that are applicable for our application.&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
If they add them as static methods, then programmers would regard them as utility methods, not as essential, core methods.&lt;br /&gt;&lt;br /&gt;Default methods enable you to add new functionality to the interfaces of your libraries and ensure binary compatibility with code written for older versions of those interfaces.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;Consider the following interface, &lt;a href=&quot;https://docs.oracle.com/javase/tutorial/java/IandI/examples/TimeClient.java&quot;&gt;TimeClient&lt;/a&gt;, as described in &lt;a href=&quot;https://docs.oracle.com/javase/tutorial/java/IandI/QandE/interfaces-answers.html&quot;&gt;Answers to Questions and Exercises: Interfaces&lt;/a&gt;:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;import java.time.*; 
 
public interface TimeClient {
    void setTime(int hour, int minute, int second);
    void setDate(int day, int month, int year);
    void setDateAndTime(int day, int month, int year,
                               int hour, int minute, int second);
    LocalDateTime getLocalDateTime();
}
&lt;/pre&gt;
&lt;pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
The following class,&amp;nbsp;&lt;a class=&quot;SourceLink&quot; href=&quot;https://docs.oracle.com/javase/tutorial/java/IandI/examples/defaultmethods/SimpleTimeClient.java&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;SimpleTimeClient&lt;/code&gt;&lt;/a&gt;, implements&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;TimeClient&lt;/code&gt;:&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;package defaultmethods;

import java.time.*;
import java.lang.*;
import java.util.*;

public class SimpleTimeClient implements TimeClient {
    
    private LocalDateTime dateAndTime;
    
    public SimpleTimeClient() {
        dateAndTime = LocalDateTime.now();
    }
    
    public void setTime(int hour, int minute, int second) {
        LocalDate currentDate = LocalDate.from(dateAndTime);
        LocalTime timeToSet = LocalTime.of(hour, minute, second);
        dateAndTime = LocalDateTime.of(currentDate, timeToSet);
    }
    
    public void setDate(int day, int month, int year) {
        LocalDate dateToSet = LocalDate.of(day, month, year);
        LocalTime currentTime = LocalTime.from(dateAndTime);
        dateAndTime = LocalDateTime.of(dateToSet, currentTime);
    }
    
    public void setDateAndTime(int day, int month, int year,
                               int hour, int minute, int second) {
        LocalDate dateToSet = LocalDate.of(day, month, year);
        LocalTime timeToSet = LocalTime.of(hour, minute, second); 
        dateAndTime = LocalDateTime.of(dateToSet, timeToSet);
    }
    
    public LocalDateTime getLocalDateTime() {
        return dateAndTime;
    }
    
    public String toString() {
        return dateAndTime.toString();
    }
    
    public static void main(String... args) {
        TimeClient myTimeClient = new SimpleTimeClient();
        System.out.println(myTimeClient.toString());
    }
}
&lt;/pre&gt;
&lt;pre&gt;
&lt;/pre&gt;
&lt;pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
Suppose that you want to add new functionality to the TimeClient interface, such as the ability to specify a time zone through a &lt;a href=&quot;https://docs.oracle.com/javase/8/docs/api/java/time/ZonedDateTime.html&quot;&gt;ZonedDateTime&lt;/a&gt; object (which is like a &lt;a href=&quot;https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html&quot;&gt;LocalDateTime&lt;/a&gt; object except that it stores time zone information):&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;public interface TimeClient {
    void setTime(int hour, int minute, int second);
    void setDate(int day, int month, int year);
    void setDateAndTime(int day, int month, int year,
        int hour, int minute, int second);
    LocalDateTime getLocalDateTime();                           
    &lt;strong&gt;ZonedDateTime getZonedDateTime(String zoneString);&lt;/strong&gt;
}
&lt;/pre&gt;
&lt;pre&gt;
&lt;/pre&gt;
&lt;pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
Following this modification to the TimeClient interface, you would also have to modify the class SimpleTimeClient and implement the method getZonedDateTime. However, rather than leaving getZonedDateTime as abstract (as in the previous example), you can instead define a default implementation. (Remember that an &lt;a href=&quot;https://docs.oracle.com/javase/tutorial/java/IandI/abstract.html&quot;&gt;abstract method&lt;/a&gt; is a method declared without an implementation.)&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;package defaultmethods;
 
import java.time.*;

public interface TimeClient {
    void setTime(int hour, int minute, int second);
    void setDate(int day, int month, int year);
    void setDateAndTime(int day, int month, int year,
                               int hour, int minute, int second);
    LocalDateTime getLocalDateTime();
    
    static ZoneId getZoneId (String zoneString) {
        try {
            return ZoneId.of(zoneString);
        } catch (DateTimeException e) {
            System.err.println(&quot;Invalid time zone: &quot; + zoneString +
                &quot;; using default time zone instead.&quot;);
            return ZoneId.systemDefault();
        }
    }
        
    default ZonedDateTime getZonedDateTime(String zoneString) {
        return ZonedDateTime.of(getLocalDateTime(), getZoneId(zoneString));
    }
}
&lt;/pre&gt;
&lt;pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;You specify that a method definition in an interface is a default method with the default keyword at the beginning of the method signature. All method declarations in an interface, including default methods, are implicitly public, so you can omit the public modifier.&lt;br /&gt;&lt;br /&gt;With this interface, you do not have to modify the class SimpleTimeClient, and this class (and any class that implements the interface TimeClient), will have the method getZonedDateTime already defined. The following example, &lt;a href=&quot;https://docs.oracle.com/javase/tutorial/java/IandI/examples/defaultmethods/TestSimpleTimeClient.java&quot;&gt;TestSimpleTimeClient&lt;/a&gt;, invokes the method getZonedDateTime from an instance of SimpleTimeClient:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;package defaultmethods;
 
import java.time.*;
import java.lang.*;
import java.util.*;

public class TestSimpleTimeClient {
    public static void main(String... args) {
        TimeClient myTimeClient = new SimpleTimeClient();
        System.out.println(&quot;Current time: &quot; + myTimeClient.toString());
        System.out.println(&quot;Time in California: &quot; +
            myTimeClient.getZonedDateTime(&quot;Blah blah&quot;).toString());
    }
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;h2 style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 17px;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;extending&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;h2 style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 17px;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;extending&quot;&gt;Extending Interfaces That Contain Default Methods&lt;/a&gt;&lt;/h2&gt;
When you extend an interface that contains a default method, you can do the following:&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Not mention the default method at all, which lets your extended interface inherit the default method&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Redeclare the default method, which makes it abstract.&lt;/li&gt;
&lt;li&gt;Redefine the default method, which overrides it.&lt;/li&gt;
&lt;/ul&gt;
Suppose that you extend the interface TimeClient as follows:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;public interface AnotherTimeClient extends TimeClient { }
&lt;/pre&gt;
&lt;pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Any class that implements the interface&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12.8px;&quot;&gt;AnotherTimeClient&lt;/code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;will have the implementation specified by the default method&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12.8px;&quot;&gt;TimeClient.getZonedDateTime&lt;/code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
Suppose that you extend the interface TimeClient as follows:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;public interface AbstractZoneTimeClient extends TimeClient {
    public ZonedDateTime getZonedDateTime(String zoneString);
}
&lt;/pre&gt;
&lt;pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
Any class that implements the interface&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12.8px;&quot;&gt;AbstractZoneTimeClient&lt;/code&gt; will have to implement the method&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12.8px;&quot;&gt;getZonedDateTime&lt;/code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;this method is an abstract method like all other nondefault (and nonstatic) methods in an interface.&lt;br /&gt;
Suppose that you extend the interface &lt;code&gt;&lt;span style=&quot;font-family: Monaco, Courier, Courier New;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;TimeClient&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;public interface HandleInvalidTimeZoneClient extends TimeClient {
    default public ZonedDateTime getZonedDateTime(String zoneString) {
        try {
            return ZonedDateTime.of(getLocalDateTime(),ZoneId.of(zoneString)); 
        } catch (DateTimeException e) {
            System.err.println(&quot;Invalid zone ID: &quot; + zoneString +
                &quot;; using the default time zone instead.&quot;);
            return ZonedDateTime.of(getLocalDateTime(),ZoneId.systemDefault());
        }
    }
}
&lt;/pre&gt;
&lt;pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
Any class that implements the interface&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12.8px;&quot;&gt;HandleInvalidTimeZoneClient&lt;/code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;will use the implementation of&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12.8px;&quot;&gt;getZonedDateTime&lt;/code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;&amp;nbsp;specified&lt;/span&gt;&lt;/span&gt; by this interface instead of the one specified by the interface&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12.8px;&quot;&gt;TimeClient&lt;/code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12.8px;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2 style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 17px;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;static&quot;&gt;Static Methods&lt;/a&gt;&lt;/h2&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
In addition to default methods, you can define&amp;nbsp;&lt;a class=&quot;TutorialLink&quot; href=&quot;https://docs.oracle.com/javase/tutorial/java/javaOO/classvars.html&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_top&quot;&gt;static methods&amp;nbsp;&lt;/a&gt;in interfaces. (A static method is a method that is associated with the class in which it is defined rather than with any object. Every instance of the class shares its static methods.) This makes it easier for you to organize helper methods in your libraries; you can keep static methods specific to an interface in the same interface rather than in a separate class. The following example defines a static method that retrieves a&amp;nbsp;&lt;a class=&quot;APILink&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/time/ZoneId.html&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;ZoneId&lt;/code&gt;&lt;/a&gt;&amp;nbsp;object corresponding to a time zone identifier; it uses the system default time zone if there is no&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;ZoneId&lt;/code&gt;&amp;nbsp;object corresponding to the given identifier. (As a result, you can simplify the method&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;getZonedDateTime&lt;/code&gt;):&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;public interface TimeClient {
    // ...
    static public ZoneId getZoneId (String zoneString) {
        try {
            return ZoneId.of(zoneString);
        } catch (DateTimeException e) {
            System.err.println(&quot;Invalid time zone: &quot; + zoneString +
                &quot;; using default time zone instead.&quot;);
            return ZoneId.systemDefault();
        }
    }

    default public ZonedDateTime getZonedDateTime(String zoneString) {
        return ZonedDateTime.of(getLocalDateTime(), getZoneId(zoneString));
    }    
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
Like static methods in classes, you specify that a method definition in an interface is a static method with the&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;static&lt;/code&gt;&amp;nbsp;keyword at the beginning of the method signature. All method declarations in an interface, including static methods, are implicitly&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;public&lt;/code&gt;, so you can omit the&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;public&lt;/code&gt;&amp;nbsp;modifier.&lt;/div&gt;
&lt;h2 style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 17px;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;existing_libraries&quot;&gt;Integrating Default Methods into Existing Libraries&lt;/a&gt;&lt;/h2&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
Default methods enable you to add new functionality to existing interfaces and ensure binary compatibility with code written for older versions of those interfaces. In particular, default methods enable you to add methods that accept lambda expressions as parameters to existing interfaces. This section demonstrates how the&amp;nbsp;&lt;a class=&quot;APILink&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&lt;/a&gt;&amp;nbsp;interface has been enhanced with default and static methods.&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
Consider the&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Card&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Deck&lt;/code&gt;&amp;nbsp;classes as described in&amp;nbsp;&lt;a class=&quot;TutorialLink&quot; href=&quot;https://docs.oracle.com/javase/tutorial/java/javaOO/QandE/creating-questions.html&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_top&quot;&gt;Questions and Exercises: Classes&lt;/a&gt;. This example rewrites the&amp;nbsp;&lt;a class=&quot;SourceLink&quot; href=&quot;https://docs.oracle.com/javase/tutorial/java/IandI/examples/defaultmethods/Card.java&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Card&lt;/code&gt;&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a class=&quot;SourceLink&quot; href=&quot;https://docs.oracle.com/javase/tutorial/java/IandI/examples/defaultmethods/Deck.java&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Deck&lt;/code&gt;&lt;/a&gt;&amp;nbsp;classes as interfaces. The&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Card&lt;/code&gt;&amp;nbsp;interface contains two&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;enum&lt;/code&gt;&amp;nbsp;types (&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Suit&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Rank&lt;/code&gt;) and two abstract methods (&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;getSuit&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;getRank&lt;/code&gt;):&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;package defaultmethods;

public interface Card extends Comparable&amp;lt;Card&amp;gt; {
    
    public enum Suit { 
        DIAMONDS (1, &quot;Diamonds&quot;), 
        CLUBS    (2, &quot;Clubs&quot;   ), 
        HEARTS   (3, &quot;Hearts&quot;  ), 
        SPADES   (4, &quot;Spades&quot;  );
        
        private final int value;
        private final String text;
        Suit(int value, String text) {
            this.value = value;
            this.text = text;
        }
        public int value() {return value;}
        public String text() {return text;}
    }
    
    public enum Rank { 
        DEUCE  (2 , &quot;Two&quot;  ),
        THREE  (3 , &quot;Three&quot;), 
        FOUR   (4 , &quot;Four&quot; ), 
        FIVE   (5 , &quot;Five&quot; ), 
        SIX    (6 , &quot;Six&quot;  ), 
        SEVEN  (7 , &quot;Seven&quot;),
        EIGHT  (8 , &quot;Eight&quot;), 
        NINE   (9 , &quot;Nine&quot; ), 
        TEN    (10, &quot;Ten&quot;  ), 
        JACK   (11, &quot;Jack&quot; ),
        QUEEN  (12, &quot;Queen&quot;), 
        KING   (13, &quot;King&quot; ),
        ACE    (14, &quot;Ace&quot;  );
        private final int value;
        private final String text;
        Rank(int value, String text) {
            this.value = value;
            this.text = text;
        }
        public int value() {return value;}
        public String text() {return text;}
    }
    
    public Card.Suit getSuit();
    public Card.Rank getRank();
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
The&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Deck&lt;/code&gt;&amp;nbsp;interface contains various methods that manipulate cards in a deck:&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;package defaultmethods; 
 
import java.util.*;
import java.util.stream.*;
import java.lang.*;
 
public interface Deck {
    
    List&amp;lt;Card&amp;gt; getCards();
    Deck deckFactory();
    int size();
    void addCard(Card card);
    void addCards(List&amp;lt;Card&amp;gt; cards);
    void addDeck(Deck deck);
    void shuffle();
    void sort();
    void sort(Comparator&amp;lt;Card&amp;gt; c);
    String deckToString();

    Map&amp;lt;Integer, Deck&amp;gt; deal(int players, int numberOfCards)
        throws IllegalArgumentException;

}
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
The class&amp;nbsp;&lt;a class=&quot;SourceLink&quot; href=&quot;https://docs.oracle.com/javase/tutorial/java/IandI/examples/defaultmethods/PlayingCard.java&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;PlayingCard&lt;/code&gt;&lt;/a&gt;&amp;nbsp;implements the interface&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Card&lt;/code&gt;, and the class&amp;nbsp;&lt;a class=&quot;SourceLink&quot; href=&quot;https://docs.oracle.com/javase/tutorial/java/IandI/examples/defaultmethods/StandardDeck.java&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;StandardDeck&lt;/code&gt;&lt;/a&gt;&amp;nbsp;implements the interface&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Deck&lt;/code&gt;.&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
The class&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;StandardDeck&lt;/code&gt;&amp;nbsp;implements the abstract method&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Deck.sort&lt;/code&gt;&amp;nbsp;as follows:&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;public class StandardDeck implements Deck {
    
    private List&amp;lt;Card&amp;gt; entireDeck;
    
    // ...
    
    public void sort() {
        Collections.sort(entireDeck);
    }
    
    // ...
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
The method&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Collections.sort&lt;/code&gt;&amp;nbsp;sorts an instance of&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;List&lt;/code&gt;&amp;nbsp;whose element type implements the interface&amp;nbsp;&lt;a class=&quot;APILink&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparable&lt;/code&gt;&lt;/a&gt;. The member&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;entireDeck&lt;/code&gt;&amp;nbsp;is an instance of&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;List&lt;/code&gt;&amp;nbsp;whose elements are of the type&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Card&lt;/code&gt;, which extends&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparable&lt;/code&gt;. The class&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;PlayingCard&lt;/code&gt;&amp;nbsp;implements the&amp;nbsp;&lt;a class=&quot;APILink&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html#compareTo-T-&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparable.compareTo&lt;/code&gt;&lt;/a&gt;&amp;nbsp;method as follows:&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;public int hashCode() {
    return ((suit.value()-1)*13)+rank.value();
}

public int compareTo(Card o) {
    return this.hashCode() - o.hashCode();
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
The method&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;compareTo&lt;/code&gt;&amp;nbsp;causes the method&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;StandardDeck.sort()&lt;/code&gt;&amp;nbsp;to sort the deck of cards first by suit, and then by rank.&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
What if you want to sort the deck first by rank, then by suit? You would need to implement the&amp;nbsp;&lt;a class=&quot;APILink&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&lt;/a&gt;&amp;nbsp;interface to specify new sorting criteria, and use the method&amp;nbsp;&lt;a class=&quot;APILink&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/util/Collections.html#sort-java.util.List-java.util.Comparator-&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;sort(List&amp;lt;T&amp;gt; list, Comparator&amp;lt;? super T&amp;gt; c)&lt;/code&gt;&lt;/a&gt;&amp;nbsp;(the version of the&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;sort&lt;/code&gt;&amp;nbsp;method that includes a&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;parameter). You can define the following method in the class&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;StandardDeck&lt;/code&gt;:&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;public void sort(Comparator&amp;lt;Card&amp;gt; c) {
    Collections.sort(entireDeck, c);
}  
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
With this method, you can specify how the method&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Collections.sort&lt;/code&gt;&amp;nbsp;sorts instances of the&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Card&lt;/code&gt;&amp;nbsp;class. One way to do this is to implement the&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;interface to specify how you want the cards sorted. The example&amp;nbsp;&lt;a class=&quot;SourceLink&quot; href=&quot;https://docs.oracle.com/javase/tutorial/java/IandI/examples/defaultmethods/SortByRankThenSuit.java&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;SortByRankThenSuit&lt;/code&gt;&lt;/a&gt;&amp;nbsp;does this:&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;package defaultmethods;

import java.util.*;
import java.util.stream.*;
import java.lang.*;

public class SortByRankThenSuit implements Comparator&amp;lt;Card&amp;gt; {
    public int compare(Card firstCard, Card secondCard) {
        int compVal =
            firstCard.getRank().value() - secondCard.getRank().value();
        if (compVal != 0)
            return compVal;
        else
            return firstCard.getSuit().value() - secondCard.getSuit().value(); 
    }
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
The following invocation sorts the deck of playing cards first by rank, then by suit:&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;StandardDeck myDeck = new StandardDeck();
myDeck.shuffle();
myDeck.sort(new SortByRankThenSuit());
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
However, this approach is too verbose; it would be better if you could specify&amp;nbsp;&lt;em&gt;what&lt;/em&gt;&amp;nbsp;you want to sort, not&amp;nbsp;&lt;em&gt;how&lt;/em&gt;&amp;nbsp;you want to sort. Suppose that you are the developer who wrote the&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;interface. What default or static methods could you add to the&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;interface to enable other developers to more easily specify sort criteria?&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
To start, suppose that you want to sort the deck of playing cards by rank, regardless of suit. You can invoke the&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;StandardDeck.sort&lt;/code&gt;&amp;nbsp;method as follows:&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;StandardDeck myDeck = new StandardDeck();
myDeck.shuffle();
myDeck.sort(
    (firstCard, secondCard) -&amp;gt;
        firstCard.getRank().value() - secondCard.getRank().value()
); 
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
Because the interface&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;is a&amp;nbsp;&lt;a class=&quot;TutorialLink&quot; href=&quot;https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html#approach6&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_top&quot;&gt;functional interface&lt;/a&gt;, you can use a lambda expression as an argument for the&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;sort&lt;/code&gt;&amp;nbsp;method. In this example, the lambda expression compares two integer values.&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
It would be simpler for your developers if they could create a&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;instance by invoking the method&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Card.getRank&lt;/code&gt;&amp;nbsp;only. In particular, it would be helpful if your developers could create a&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;instance that compares any object that can return a numerical value from a method such as&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;getValue&lt;/code&gt;&amp;nbsp;or&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;hashCode&lt;/code&gt;. The&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;interface has been enhanced with this ability with the static method&lt;a class=&quot;APILink&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#comparing-java.util.function.Function-java.util.Comparator-&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;comparing&lt;/code&gt;&lt;/a&gt;:&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;myDeck.sort(Comparator.comparing((card) -&amp;gt; card.getRank()));  
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
In this example, you can use a&amp;nbsp;&lt;a class=&quot;TutorialLink&quot; href=&quot;https://docs.oracle.com/javase/tutorial/java/javaOO/methodreferences.html&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_top&quot;&gt;method reference&lt;/a&gt;&amp;nbsp;instead:&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;myDeck.sort(Comparator.comparing(Card::getRank));  
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
This invocation better demonstrates&amp;nbsp;&lt;em&gt;what&lt;/em&gt;&amp;nbsp;to sort rather than&amp;nbsp;&lt;em&gt;how&lt;/em&gt;&amp;nbsp;to do it.&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
The&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;interface has been enhanced with other versions of the static method&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;comparing&lt;/code&gt;&amp;nbsp;such as&amp;nbsp;&lt;a class=&quot;APILink&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#comparingDouble-java.util.function.ToDoubleFunction-java.util.Comparator-&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;comparingDouble&lt;/code&gt;&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a class=&quot;APILink&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#comparingLong-java.util.function.ToLongFunction-&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;comparingLong&lt;/code&gt;&lt;/a&gt;&amp;nbsp;that enable you to create&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;instances that compare other data types.&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
Suppose that your developers would like to create a&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;instance that could compare objects with more than one criteria. For example, how would you sort the deck of playing cards first by rank, and then by suit? As before, you could use a lambda expression to specify these sort criteria:&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;StandardDeck myDeck = new StandardDeck();
myDeck.shuffle();
myDeck.sort(
    (firstCard, secondCard) -&amp;gt; {
        int compare =
            firstCard.getRank().value() - secondCard.getRank().value();
        if (compare != 0)
            return compare;
        else
            return firstCard.getSuit().value() - secondCard.getSuit().value();
    }      
); 
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
It would be simpler for your developers if they could build a&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;instance from a series of&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;instances. The&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;interface has been enhanced with this ability with the default method&amp;nbsp;&lt;a class=&quot;APILink&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#thenComparing-java.util.Comparator-&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;thenComparing&lt;/code&gt;&lt;/a&gt;:&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;myDeck.sort(
    Comparator
        .comparing(Card::getRank)
        .thenComparing(Comparator.comparing(Card::getSuit)));
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
The&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;interface has been enhanced with other versions of the default method&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;thenComparing&lt;/code&gt;&amp;nbsp;(such as&amp;nbsp;&lt;a class=&quot;APILink&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#thenComparingDouble-java.util.function.ToDoubleFunction-&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;thenComparingDouble&lt;/code&gt;&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a class=&quot;APILink&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#thenComparingLong-java.util.function.ToLongFunction-&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;thenComparingLong&lt;/code&gt;&lt;/a&gt;) that enable you to build&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;instances that compare other data types.&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
Suppose that your developers would like to create a&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;instance that enables them to sort a collection of objects in reverse order. For example, how would you sort the deck of playing cards first by descending order of rank, from Ace to Two (instead of from Two to Ace)? As before, you could specify another lambda expression. However, it would be simpler for your developers if they could reverse an existing&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;by invoking a method. The&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;interface has been enhanced with this ability with the default method&amp;nbsp;&lt;a class=&quot;APILink&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#reversed--&quot; style=&quot;color: #3a87cf; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;reversed&lt;/code&gt;&lt;/a&gt;:&lt;/div&gt;
&lt;div class=&quot;codeblock&quot; style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;; font-size: 12px; margin: 0px 30px;&quot;&gt;
&lt;pre&gt;myDeck.sort(
    Comparator.comparing(Card::getRank)
        .reversed()
        .thenComparing(Comparator.comparing(Card::getSuit)));
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 12.8px;&quot;&gt;
This example demonstrates how the&amp;nbsp;&lt;code style=&quot;font-family: Monaco, Courier, &amp;quot;Courier New&amp;quot;;&quot;&gt;Comparator&lt;/code&gt;&amp;nbsp;interface has been enhanced with default methods, static methods, lambda expressions, and method references to create more expressive library methods whose functionality programmers can quickly deduce by looking at how they are invoked. Use these constructs to enhance the interfaces in your libraries.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://adityangoyal.blogspot.com/feeds/6679111642015151959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://adityangoyal.blogspot.com/2017/03/static-method-vs-default-method-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/6679111642015151959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/6679111642015151959'/><link rel='alternate' type='text/html' href='http://adityangoyal.blogspot.com/2017/03/static-method-vs-default-method-in.html' title=''/><author><name>Aditya Goyal</name><uri>http://www.blogger.com/profile/06314586793374570427</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVzkkcdRCFN90-Ws96mUCl7t8CooADL5gjz5VVUy_USe7QWidMptXkza-i-5YZZq4_q8GF8uGO4na9QH2I7uSKeVyLy3eAoTyPMA6k9GfZIhr3QtH8H_OQ-RcRYb1Ru7w/s150/IMG_1203.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4864125858165953220.post-5646197278225962390</id><published>2016-10-17T02:35:00.000+05:30</published><updated>2016-10-17T03:09:25.776+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="8 Great Java 8 Features No One is Talking about"/><category scheme="http://www.blogger.com/atom/ns#" term="Java 8 features"/><category scheme="http://www.blogger.com/atom/ns#" term="Java 8 hidden features"/><title type='text'>8 Hidden Great Java 8 Features</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
If you haven’t seen some of the videos or tutorials around Java 8, you’ve probably been super-busy or have a more interesting social life than I do (which isn’t saying much). With new features like lambda expressions and Project Nashorn taking so much of the spotlight, I wanted to focus on some new APIs that have been a bit under the radar, but make Java 8 better in so many ways.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: none; color: #222222; float: none; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; font-weight: normal; line-height: 24px; margin: 0px 0px 10px; padding: 0px; width: 610px;&quot;&gt;
1. &lt;u&gt;Stamped Locks&lt;/u&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;a href=&quot;http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/StampedLock.html&quot;&gt;http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/StampedLock.html&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
Multi-threaded code has long been the bane of server developers (just ask Oracle Java Language Architect and concurrency guru&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;Brian Goetz). Over time complex idioms were added to the core Java libraries to help minimize thread waits when accessing shared resources.&lt;br /&gt;
&lt;span style=&quot;color: #474747; font-family: &amp;quot;dejavu serif&amp;quot; , &amp;quot;georgia&amp;quot; , &amp;quot;times new roman&amp;quot; , &amp;quot;times&amp;quot; , serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #474747; font-family: &amp;quot;dejavu serif&amp;quot; , &amp;quot;georgia&amp;quot; , &amp;quot;times new roman&amp;quot; , &amp;quot;times&amp;quot; , serif;&quot;&gt;A capability-based lock with three modes for controlling read/write access. The state of a StampedLock consists of a version and mode. Lock acquisition methods return a stamp that represents and controls access with respect to a lock state; &quot;try&quot; versions of these methods may instead return the special value zero to represent failure to acquire access. Lock release and conversion methods require stamps as arguments, and fail if they do not match the state of the lock. The three modes are:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;color: #474747; font-family: &amp;quot;DejaVu Serif&amp;quot;, Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif;&quot;&gt;
&lt;li&gt;&lt;b&gt;Writing.&lt;/b&gt;&amp;nbsp;Method&amp;nbsp;&lt;a href=&quot;http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/StampedLock.html#writeLock--&quot; style=&quot;color: #4a6782; text-decoration: none;&quot;&gt;&lt;code style=&quot;font-family: &amp;quot;DejaVu Sans Mono&amp;quot;, monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;&quot;&gt;writeLock()&lt;/code&gt;&lt;/a&gt;&amp;nbsp;possibly blocks waiting for exclusive access, returning a stamp that can be used in method&amp;nbsp;&lt;a href=&quot;http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/StampedLock.html#unlockWrite-long-&quot; style=&quot;color: #4a6782; text-decoration: none;&quot;&gt;&lt;code style=&quot;font-family: &amp;quot;DejaVu Sans Mono&amp;quot;, monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;&quot;&gt;unlockWrite(long)&lt;/code&gt;&lt;/a&gt;&amp;nbsp;to release the lock. Untimed and timed versions of&amp;nbsp;&lt;code style=&quot;font-family: &amp;quot;DejaVu Sans Mono&amp;quot;, monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;&quot;&gt;tryWriteLock&lt;/code&gt;&amp;nbsp;are also provided. When the lock is held in write mode, no read locks may be obtained, and all optimistic read validations will fail.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Reading.&lt;/b&gt;&amp;nbsp;Method&amp;nbsp;&lt;a href=&quot;http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/StampedLock.html#readLock--&quot; style=&quot;color: #4a6782; text-decoration: none;&quot;&gt;&lt;code style=&quot;font-family: &amp;quot;DejaVu Sans Mono&amp;quot;, monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;&quot;&gt;readLock()&lt;/code&gt;&lt;/a&gt;&amp;nbsp;possibly blocks waiting for non-exclusive access, returning a stamp that can be used in method&amp;nbsp;&lt;a href=&quot;http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/StampedLock.html#unlockRead-long-&quot; style=&quot;color: #4a6782; text-decoration: none;&quot;&gt;&lt;code style=&quot;font-family: &amp;quot;DejaVu Sans Mono&amp;quot;, monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;&quot;&gt;unlockRead(long)&lt;/code&gt;&lt;/a&gt;&amp;nbsp;to release the lock. Untimed and timed versions of&amp;nbsp;&lt;code style=&quot;font-family: &amp;quot;DejaVu Sans Mono&amp;quot;, monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;&quot;&gt;tryReadLock&lt;/code&gt;&amp;nbsp;are also provided.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Optimistic Reading.&lt;/b&gt;&amp;nbsp;Method&amp;nbsp;&lt;a href=&quot;http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/StampedLock.html#tryOptimisticRead--&quot; style=&quot;color: #4a6782; text-decoration: none;&quot;&gt;&lt;code style=&quot;font-family: &amp;quot;DejaVu Sans Mono&amp;quot;, monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;&quot;&gt;tryOptimisticRead()&lt;/code&gt;&lt;/a&gt;&amp;nbsp;returns a non-zero stamp only if the lock is not currently held in write mode. Method&amp;nbsp;&lt;a href=&quot;http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/StampedLock.html#validate-long-&quot; style=&quot;color: #4a6782; text-decoration: none;&quot;&gt;&lt;code style=&quot;font-family: &amp;quot;DejaVu Sans Mono&amp;quot;, monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;&quot;&gt;validate(long)&lt;/code&gt;&lt;/a&gt;&amp;nbsp;returns true if the lock has not been acquired in write mode since obtaining a given stamp. This mode can be thought of as an extremely weak version of a read-lock, that can be broken by a writer at any time. The use of optimistic mode for short read-only code segments often reduces contention and improves throughput. However, its use is inherently fragile. Optimistic read sections should only read fields and hold them in local variables for later use after validation. Fields read while in optimistic mode may be wildly inconsistent, so usage applies only when you are familiar enough with data representations to check consistency and/or repeatedly invoke method&amp;nbsp;&lt;code style=&quot;font-family: &amp;quot;DejaVu Sans Mono&amp;quot;, monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;&quot;&gt;validate()&lt;/code&gt;. For example, such steps are typically required when first reading an object or array reference, and then accessing one of its fields, elements or methods.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;clear&quot; style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, Helvetica, sans-serif; font-size: 0px; height: 0px; margin: 0px; padding: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
&lt;br /&gt;
StampedLock has an &quot;optimistic&quot; mode that issues a stamp that is returned by each locking operation to serve as a sort of admission ticket; each unlock operation needs to be passed its correlating stamp. Any thread that happens to acquire a write lock while a reader was holding an optimistic lock, will cause the optimistic unlock to be invalidated (the stamp is no longer valid). At that point the application can start all over, perhaps with a pessimistic lock (also implemented in StampedLock.) Managing that is up to you, and one stamp cannot be used to unlock another – so be super careful.On paper this sounds great. The problem is that the ReadWriteLock can be&amp;nbsp;&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;super slow&lt;/span&gt;&lt;/span&gt;(up to 10x), which kind of defeats its purpose. Java 8 introduces a new ReadWrite lock – called&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;StampedLock. The good news here is that this guy is seriously fast. The bad news is that it’s more complicated to use and lugs around more state. It’s also not reentrant, which means a thread can have the dubious pleasure of deadlocking against itself.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
Let’s see this lock in action-&lt;/div&gt;
&lt;div id=&quot;lowerFullwidthVCR&quot; style=&quot;background-color: white; border: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;
&lt;/div&gt;
&lt;pre style=&quot;background-color: #f5f2f0; background-position: -29px 0px; border: 1px solid rgb(232, 232, 232); clear: none; color: #314e64; float: none !important; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, monospace; font-size: 14px; line-height: 21px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px 10px 10px 5px; width: 597.797px;&quot;&gt;&lt;div class=&quot;block&quot; style=&quot;background-color: white; color: #474747; font-family: &amp;quot;DejaVu Serif&amp;quot;, Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif; margin: 3px 10px 2px 0px; white-space: normal;&quot;&gt;
&lt;pre style=&quot;font-family: &amp;quot;DejaVu Sans Mono&amp;quot;, monospace;&quot;&gt;&lt;code style=&quot;font-family: &amp;quot;DejaVu Sans Mono&amp;quot;, monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;&quot;&gt; class Point {
   private double x, y;
   private final StampedLock sl = new StampedLock();

   void move(double deltaX, double deltaY) { &lt;/code&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: &amp;quot;DejaVu Sans Mono&amp;quot;, monospace;&quot;&gt;&lt;code style=&quot;font-family: &amp;quot;DejaVu Sans Mono&amp;quot;, monospace; line-height: 1.4em; margin-top: 8px; padding-top: 4px;&quot;&gt;// an exclusively locked method
     long stamp = sl.writeLock();
     try {
       x += deltaX;
       y += deltaY;
     } finally {
       sl.unlockWrite(stamp);
     }
   }

   double distanceFromOrigin() { // A read-only method
     long stamp = sl.tryOptimisticRead();
     double currentX = x, currentY = y;
     if (!sl.validate(stamp)) {
        stamp = sl.readLock();
        try {
          currentX = x;
          currentY = y;
        } finally {
           sl.unlockRead(stamp);
        }
     }
     return Math.sqrt(currentX * currentX + currentY * currentY);
   }

   void moveIfAtOrigin(double newX, double newY) { // upgrade
     // Could instead start with optimistic, not read mode
     long stamp = sl.readLock();
     try {
       while (x == 0.0 &amp;amp;&amp;amp; y == 0.0) {
         long ws = sl.tryConvertToWriteLock(stamp);
         if (ws != 0L) {
           stamp = ws;
           x = newX;
           y = newY;
           break;
         }
         else {
           sl.unlockRead(stamp);
           stamp = sl.writeLock();
         }
       }
     } finally {
       sl.unlock(stamp);
     }
   }
 }&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;dl style=&quot;background-color: white; color: #353833; font-family: &amp;quot;DejaVu Sans&amp;quot;, Arial, Helvetica, sans-serif; white-space: normal;&quot;&gt;&lt;/dl&gt;
&lt;/pre&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: none; color: #222222; float: none; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; font-weight: normal; line-height: 24px; margin: 0px 0px 10px; padding: 0px; width: 610px;&quot;&gt;
&amp;nbsp;&lt;/h2&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: none; color: #222222; float: none; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; font-weight: normal; line-height: 24px; margin: 0px 0px 10px; padding: 0px; width: 610px;&quot;&gt;
2. &lt;u&gt;Concurrent Adders&lt;/u&gt;&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
Another beautiful addition to Java 8, meant specifically for code running at scale, is the concurrent “Adders”. One of the most basic concurrency patterns is reading and writing the value of a numeric counter. As such, there are many ways in which you can do this today, but none so efficient or elegant as what Java 8 has to offer.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
Up until now this was done using Atomics, which used a direct CPU compare and swap (CAS) instruction (via the&amp;nbsp;&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;sun.misc.Unsafe&lt;/span&gt;&lt;/span&gt;&amp;nbsp;class) to try and set the value of a counter. The problem was that when a CAS failed due to contention, the AtomicInteger would spin, continually retrying the CAS in an infinite loop until it succeeded. At high levels of contention this could prove to be pretty slow.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
Enter Java 8’s&amp;nbsp;LongAdders(&lt;a href=&quot;http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/LongAdder.html&quot;&gt;http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/LongAdder.html&lt;/a&gt;&amp;nbsp;). This set of classes provides a convenient way to concurrently read and write numeric values at scale. Usage is super simple. Just instantiate a new LongAdder and use its&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;add()&amp;nbsp;and&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;intValue()&amp;nbsp;methods to increase and sample the counter.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
The difference between this and the old Atomics is that here, when a CAS fails due to contention, instead of spinning the CPU, the Adder will store the delta in an internal cell object allocated for that thread. It will then add this value along with any other pending cells to the result of intValue(). This reduces the need to go back and CAS or block other threads.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
If you’re asking yourself when should I prefer to use concurrent Adders over Atomics to manage counters? The simple answer is – always.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: none; color: #222222; float: none; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; font-weight: normal; line-height: 24px; margin: 0px 0px 10px; padding: 0px; width: 610px;&quot;&gt;
3. &lt;u&gt;Parallel Computaion on Arrays&lt;/u&gt;&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
1. &lt;b&gt;parallelSort&lt;/b&gt;&lt;/h4&gt;
Just as concurrent Adders speed up counting, Java 8 delivers a concise way to speed up sorting. The recipe is pretty simple. Instead of -&lt;br /&gt;
&lt;span style=&quot;border: 0px; color: #400080; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , monospace; margin: 0px; padding: 0px;&quot;&gt;Array&lt;/span&gt;&lt;span style=&quot;background-color: #f5f2f0; color: #314e64; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , monospace;&quot;&gt;.sort(myArray);&lt;/span&gt;&lt;br /&gt;
You can now use –&lt;br /&gt;
&lt;span style=&quot;border: 0px; color: #400080; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , monospace; margin: 0px; padding: 0px;&quot;&gt;Arrays&lt;/span&gt;&lt;span style=&quot;background-color: #f5f2f0; color: #314e64; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;monaco&amp;quot; , &amp;quot;andale mono&amp;quot; , monospace;&quot;&gt;.parallelSort(myArray);&lt;/span&gt;&lt;br /&gt;
This will automatically break up the target collection into several parts, which will be sorted independently across a number of cores and then grouped back together. The only caveat here is that when called in highly multi-threaded environments, such as a busy web container, the benefits of this approach will begin to diminish (by&amp;nbsp;&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;more than 90%&lt;/span&gt;&lt;/span&gt;) due to the cost of increased CPU context switches.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
2. &lt;b&gt;parallelPrefix&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;border: 0px none; color: #333333; font-family: Tahoma, Arial, Verdana, sans-serif; font-size: 15px; list-style: none; outline: none; padding: 0px 0px 1em;&quot;&gt;
There are cases where we would like to perform operations in each element of an array (or in a range of them) based on the previous value. This is possible by using the method&amp;nbsp;&lt;code style=&quot;background: url(&amp;quot;/wp-content/themes/jarida/images/code-bg.png&amp;quot;); border-color: rgb(225, 225, 225) rgb(240, 240, 240) rgb(240, 240, 240) rgb(225, 225, 225); border-image: initial; border-style: solid; border-width: 1px; color: #666666; direction: ltr; display: inline; font-family: &amp;quot;andale mono&amp;quot;, &amp;quot;lucida console&amp;quot;, monospace; font-size: 11px; font-stretch: normal; line-height: 19px; list-style: none; margin: 0px 0px 20px; outline: none; overflow-x: visible; overflow-y: hidden; padding: 3px;&quot;&gt;parallelPrefix()&lt;/code&gt;:&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_939766&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 1px solid rgb(224, 224, 224) !important; bottom: auto !important; color: #333333; direction: ltr !important; display: inline-block; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 15px; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 1em 0px !important; outline: 0px !important; padding: 0px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 811.797px;&quot;&gt;
&lt;div class=&quot;lines&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;01&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;DoubleBinaryOperator binaryOperator =&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;new&lt;/code&gt;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;DoubleBinaryOperator()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background: none rgb(248, 248, 248) !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;02&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;03&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;spaces&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;color1&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(128, 128, 128) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;@Override&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background: none rgb(248, 248, 248) !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;04&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;spaces&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;public&lt;/code&gt;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;double&lt;/code&gt;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;applyAsDouble(&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;double&lt;/code&gt;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;x,&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;double&lt;/code&gt;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;y )&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;05&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;spaces&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;{&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background: none rgb(248, 248, 248) !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;06&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;spaces&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;return&lt;/code&gt;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;x + y;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;07&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;spaces&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background: none rgb(248, 248, 248) !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;08&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;};&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;09&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;comments&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;// we can use binary operators as prefix in parallel&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background: none rgb(248, 248, 248) !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;10&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;Arrays.parallelPrefix( array, binaryOperator );&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;11&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;comments&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 130, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;// also using lambdas&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background: none rgb(248, 248, 248) !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;12&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;Arrays.parallelPrefix( array, ( x, y ) -&amp;gt; x + y );&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;border: 0px none; color: #333333; font-family: Tahoma, Arial, Verdana, sans-serif; font-size: 15px; list-style: none; outline: none; padding: 0px 0px 1em;&quot;&gt;
In the code above we can see that it is also possible to use Lambda expressions directly as parameter, as it was for the method&amp;nbsp;&lt;code style=&quot;background: url(&amp;quot;/wp-content/themes/jarida/images/code-bg.png&amp;quot;); border-color: rgb(225, 225, 225) rgb(240, 240, 240) rgb(240, 240, 240) rgb(225, 225, 225); border-image: initial; border-style: solid; border-width: 1px; color: #666666; direction: ltr; display: inline; font-family: &amp;quot;andale mono&amp;quot;, &amp;quot;lucida console&amp;quot;, monospace; font-size: 11px; font-stretch: normal; line-height: 19px; list-style: none; margin: 0px 0px 20px; outline: none; overflow-x: visible; overflow-y: hidden; padding: 3px;&quot;&gt;parallelSetAll()&lt;/code&gt;.&lt;/div&gt;
&lt;div style=&quot;border: 0px none; color: #333333; font-family: Tahoma, Arial, Verdana, sans-serif; font-size: 15px; list-style: none; outline: none; padding: 0px 0px 1em;&quot;&gt;
If we want to perform these operations only in a range of the array elements we can pass the start and end indexes and the operation will only be done between the range extremes:&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_358112&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 1px solid rgb(224, 224, 224) !important; bottom: auto !important; color: #333333; direction: ltr !important; display: inline-block; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 15px; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 1em 0px !important; outline: 0px !important; padding: 0px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 811.797px;&quot;&gt;
&lt;div class=&quot;lines&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;int&lt;/code&gt;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;startIndex =&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;value&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 153, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;100&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background: none rgb(248, 248, 248) !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;int&lt;/code&gt;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;endIndex =&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;value&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 153, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;150&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;Arrays.parallelPrefix( array, startIndex, endIndex, ( x, y ) -&amp;gt; x + y );&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;border: 0px none; color: #333333; font-family: Tahoma, Arial, Verdana, sans-serif; font-size: 15px; list-style: none; outline: none; padding: 0px 0px 1em;&quot;&gt;
The method&amp;nbsp;&lt;code style=&quot;background: url(&amp;quot;/wp-content/themes/jarida/images/code-bg.png&amp;quot;); border-color: rgb(225, 225, 225) rgb(240, 240, 240) rgb(240, 240, 240) rgb(225, 225, 225); border-image: initial; border-style: solid; border-width: 1px; color: #666666; direction: ltr; display: inline; font-family: &amp;quot;andale mono&amp;quot;, &amp;quot;lucida console&amp;quot;, monospace; font-size: 11px; font-stretch: normal; line-height: 19px; list-style: none; margin: 0px 0px 20px; outline: none; overflow-x: visible; overflow-y: hidden; padding: 3px;&quot;&gt;parallelPrefix()&lt;/code&gt;&amp;nbsp;is not that intuitive and, in my opinion, its name is confusing; so I am going to provide a very basic example that would help to understand a bit this method. If we have an array like the following one:&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_72232&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 1px solid rgb(224, 224, 224) !important; bottom: auto !important; color: #333333; direction: ltr !important; display: inline-block; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 15px; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 1em 0px !important; outline: 0px !important; padding: 0px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 811.797px;&quot;&gt;
&lt;div class=&quot;lines&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;double&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;[] array = {&lt;/code&gt;&lt;code class=&quot;value&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 153, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;1.0&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;,&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;value&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 153, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;2.0&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;,&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;value&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 153, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;3.0&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;};&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;border: 0px none; color: #333333; font-family: Tahoma, Arial, Verdana, sans-serif; font-size: 15px; list-style: none; outline: none; padding: 0px 0px 1em;&quot;&gt;
And we want to apply to every entry a calculation based in the previous value, for example, if previous value is odd, we multiply the current entry by 2, otherwise leave the value as it is, so more or less we are going to multiply by 2 all entries which previous value is odd (I do not know why we would like to do this, but it is just an example). We can write something like the following (using Lambdas):&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_748342&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 1px solid rgb(224, 224, 224) !important; bottom: auto !important; color: #333333; direction: ltr !important; display: inline-block; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 15px; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 1em 0px !important; outline: 0px !important; padding: 0px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 811.797px;&quot;&gt;
&lt;div class=&quot;lines&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;Arrays.parallelPrefix( array, ( x, y ) -&amp;gt; {&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background: none rgb(248, 248, 248) !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;spaces&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;if&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;( x %&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;value&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 153, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;2&lt;/code&gt;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;!=&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;value&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 153, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;0&lt;/code&gt;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;)&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;spaces&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;return&lt;/code&gt;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;y *&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;value&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 153, 0) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;2&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background: none rgb(248, 248, 248) !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;spaces&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;return&lt;/code&gt;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;y;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;} );&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;border: 0px none; color: #333333; font-family: Tahoma, Arial, Verdana, sans-serif; font-size: 15px; list-style: none; outline: none; padding: 0px 0px 1em;&quot;&gt;
The result of printing out this array before and after the operation is done would be:&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_129413&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 1px solid rgb(224, 224, 224) !important; bottom: auto !important; color: #333333; direction: ltr !important; display: inline-block; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 15px; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 1em 0px !important; outline: 0px !important; padding: 0px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 811.797px;&quot;&gt;
&lt;div class=&quot;lines&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;element at pos 0 previously 1.0&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background: none rgb(248, 248, 248) !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;element at pos 1 previously 2.0&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;element at pos 2 previously 3.0&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background: none rgb(248, 248, 248) !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;element at pos 0 after 1.0&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;element at pos 1 after 4.0&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background: none rgb(248, 248, 248) !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;table style=&quot;background: none !important; border-collapse: collapse !important; border-radius: 3px; border-spacing: 0px; border: 0px !important; bottom: auto !important; color: #333333; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;tbody style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;number&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 3em !important;&quot;&gt;&lt;code style=&quot;background: none !important; border: 0px !important; bottom: auto !important; color: #666666; direction: ltr !important; display: block !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px 0.3em 0px 0px !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: 2.7em !important;&quot;&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot; style=&quot;background: none !important; border-bottom-color: initial !important; border-bottom-style: initial !important; border-image: initial !important; border-left-color: rgb(108, 226, 108) !important; border-left-style: solid !important; border-right-color: initial !important; border-right-style: initial !important; border-top-color: initial !important; border-top-style: initial !important; border-width: 0px 0px 0px 3px !important; bottom: auto !important; color: rgb(0, 0, 0) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px 0px 0px 0.5em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: top !important; width: 820px;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;background: none !important; border: 0px !important; bottom: auto !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-stretch: normal; height: auto !important; left: auto !important; line-height: 1.1em !important; list-style: none; margin: 0px !important; outline: 0px !important; overflow-x: visible; overflow-y: hidden; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;element at pos 2 after 3.0&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;border: 0px none; color: #333333; font-family: Tahoma, Arial, Verdana, sans-serif; font-size: 15px; list-style: none; outline: none; padding: 0px 0px 1em;&quot;&gt;
We can see how the only entry that has been changed is the second one because its previous value is odd.&lt;/div&gt;
&lt;div style=&quot;border: 0px none; color: #333333; font-family: Tahoma, Arial, Verdana, sans-serif; font-size: 15px; list-style: none; outline: none; padding: 0px 0px 1em;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px none; color: #333333; font-family: Tahoma, Arial, Verdana, sans-serif; font-size: 15px; list-style: none; outline: none; padding: 0px 0px 1em;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: none; color: #222222; float: none; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; font-weight: normal; line-height: 24px; margin: 0px 0px 10px; padding: 0px; width: 610px;&quot;&gt;
4. &lt;u&gt;Switching to the new Date API&lt;/u&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div&gt;
&lt;u&gt;http://www.oracle.com/technetwork/articles/java/jf14-date-time-2125367.html&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
Java 8 introduces a complete new&amp;nbsp;&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;date-time&lt;/span&gt;&lt;/span&gt;&amp;nbsp;API.&amp;nbsp; You kind of know it’s about time when most of the methods of the current one are marked as deprecated... The new API brings ease-of-use and accuracy long provided by the popular Joda time API into the core Java library.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
As with any new API the good news is that it’s more elegant and functional. Unfortunately there are still vast amounts of code out there using the old API, and that won’t change any time soon.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
&lt;div style=&quot;font-family: arial, helvetica, sans-serif; font-size: 14px;&quot;&gt;
To help bridge the gap between the old and new API’s, the venerable Date class now has a new method called&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;toInstant()&amp;nbsp;which converts the Date into the new representation. This can be especially effective in those cases where you&#39;re working on an API that expects the classic form, but would like to enjoy everything the new API has to offer.&lt;/div&gt;
&lt;div style=&quot;font-family: arial, helvetica, sans-serif; font-size: 14px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: arial, helvetica, sans-serif; font-size: 14px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;b&gt;LocalDate and LocalTime&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;The first classes you will probably encounter when using the new API are LocalDate and LocalTime. They are local in the sense that they represent date and time from the context of the observer, such as a calendar on a desk or a clock on your wall. There is also a composite class called LocalDateTime, which is a pairing of LocalDate and LocalTime.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;All the core classes in the new API are constructed by fluent factory methods. When constructing a value by its constituent fields, the factory is called of; when converting from another type, the factory is called from.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border: 0px; clear: none; color: black; float: none; font-family: arial, helvetica, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; line-height: 21px; margin-bottom: 10px; orphans: 2; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 610px; word-spacing: 0px;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;pre style=&quot;-webkit-text-stroke-width: 0px; background-color: #f5f2f0; background-position: -29px 0px; border: 1px solid rgb(232, 232, 232); clear: none; color: #314e64; float: none; font-family: consolas, monaco, &amp;quot;andale mono&amp;quot;, monospace; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; line-height: 21px; margin: 10px 0px; orphans: 2; overflow: auto; padding: 10px 10px 10px 5px; text-align: left; text-indent: 0px; text-transform: none; widows: 2; width: 597.797px; word-spacing: 0px;&quot;&gt;&lt;pre style=&quot;-webkit-font-smoothing: antialiased; background-color: white; color: black; font-size: 12px; list-style: none; padding: 0px;&quot;&gt;LocalDateTime timePoint = LocalDateTime.now();     // The current date and time
LocalDate.of(2012, Month.DECEMBER, 12); // from values
LocalDate.ofEpochDay(150);  // middle of 1970
LocalTime.of(17, 18); // the train I took home today
LocalTime.parse(&quot;10:15:30&quot;); // From a String&lt;/pre&gt;
&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: none; color: #222222; float: none; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; font-weight: normal; line-height: 24px; margin: 0px 0px 10px; padding: 0px; width: 610px;&quot;&gt;
5. &lt;u&gt;Controlling OS Processes&lt;/u&gt;&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
Launching an OS process from within your code is right there with JNI calls – it’s something you do half-knowing there’s a good chance you’re going to get some unexpected results and some really bad exceptions down the line.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
Even so, it’s a necessary evil. But processes have another nasty angle to them - they have a tendency to dangle. The problem with launching process from within Java code so far has been that is was hard to control a process once it was launched.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
To help us with this Java 8 introduces three new methods in the&amp;nbsp;&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;Process&lt;/span&gt;&lt;/span&gt;&amp;nbsp;class -&lt;/div&gt;
&lt;ol style=&quot;background-color: white; border: 0px; clear: left; font-family: Arial, Helvetica, sans-serif; font-size: 14px; margin: 10px 0px 10px 10px; padding: 0px 0px 0px 20px; width: 549px;&quot;&gt;
&lt;li style=&quot;border: none; clear: none; float: none; margin: 4px 0px; padding: 0px 0px 0px 10px; text-align: left;&quot;&gt;&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;destroyForcibly&lt;/span&gt;&lt;/span&gt;&amp;nbsp;- terminates a process with a much higher degree of success than before.&lt;/li&gt;
&lt;li style=&quot;border: none; clear: none; float: none; margin: 4px 0px; padding: 0px 0px 0px 10px; text-align: left;&quot;&gt;&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;isAlive&lt;/span&gt;&lt;/span&gt;&amp;nbsp;tells if a process launched by your code is still alive.&lt;/li&gt;
&lt;li style=&quot;border: none; clear: none; float: none; margin: 4px 0px; padding: 0px 0px 0px 10px; text-align: left;&quot;&gt;A new overload for waitFor() lets you specify the amount of time you want to wait for the process to finish. This returns whether the process exited successfully or timed-out in which case you might terminate it.&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
Two good use-cases for these new methods are -&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; clear: left; font-family: Arial, Helvetica, sans-serif; font-size: 14px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 10px 10px; padding: 0px;&quot;&gt;
&lt;li style=&quot;border: 0px; clear: none; float: none; margin: 0px 0px 0px 15px; padding: 0px;&quot;&gt;If the process did not finish in time, terminate and move forward:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre style=&quot;background-color: #f5f2f0; background-position: -29px 0px; border: 1px solid rgb(232, 232, 232); clear: none; color: #314e64; float: none !important; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, monospace; font-size: 14px; line-height: 21px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px 10px 10px 5px; width: 597.797px;&quot;&gt;&lt;span style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;if &lt;/span&gt;(process.wait(MY_TIMEOUT, &lt;span style=&quot;border: 0px; color: #400080; margin: 0px; padding: 0px;&quot;&gt;TimeUnit&lt;/span&gt;.MILLISECONDS)){
&lt;span style=&quot;border: 0px; color: #800040; margin: 0px; padding: 0px;&quot;&gt;       //success! &lt;/span&gt;}
&lt;span style=&quot;border: 0px; color: #400080; margin: 0px; padding: 0px;&quot;&gt;else&lt;/span&gt; {
    process.destroyForcibly();
}&lt;/pre&gt;
&lt;ul style=&quot;background-color: white; border: 0px; clear: left; font-family: Arial, Helvetica, sans-serif; font-size: 14px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 10px 10px; padding: 0px;&quot;&gt;
&lt;li style=&quot;border: 0px; clear: none; float: none; margin: 0px 0px 0px 15px; padding: 0px;&quot;&gt;Make sure that before your code is done, you&#39;re not leaving any processes behind. Dangling processes can slowly but surely deplete your OS.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre style=&quot;background-color: #f5f2f0; background-position: -29px 0px; border: 1px solid rgb(232, 232, 232); clear: none; color: #314e64; float: none !important; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, monospace; font-size: 14px; line-height: 21px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px 10px 10px 5px; width: 597.797px;&quot;&gt;&lt;span style=&quot;border: 0px; color: #400080; margin: 0px; padding: 0px;&quot;&gt;for &lt;/span&gt;(&lt;span style=&quot;border: 0px; color: #400080; margin: 0px; padding: 0px;&quot;&gt;Process&lt;/span&gt; p : processes) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt; if&lt;/span&gt; (p.isAlive()) {
             p.destroyForcibly();
       }
}&lt;/pre&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: none; color: #222222; float: none; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; font-weight: normal; line-height: 24px; margin: 0px 0px 10px; padding: 0px; width: 610px;&quot;&gt;
&lt;/h2&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: none; color: #222222; float: none; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; font-weight: normal; line-height: 24px; margin: 0px 0px 10px; padding: 0px; width: 610px;&quot;&gt;
6. &lt;u&gt;Exact Numeric Operations&lt;/u&gt;&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
Numeric overflows can cause some of the nastiest bugs due to their implicit nature. This is especially true in systems where int values (such as counters) grow over time. In those cases things that work well in staging, and even during long periods in production, can start breaking in the weirdest of ways, when operations begin to overflow and produce completely unexpected values.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
To help with this Java 8 has added several&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;new “exact” methods&amp;nbsp;to the Math class geared towards protecting sensitive code from implicit overflows, by throwing an unchecked ArithmeticException when the value of an operation overflows its precision.&lt;/div&gt;
&lt;pre style=&quot;background-color: #f5f2f0; background-position: -29px 0px; border: 1px solid rgb(232, 232, 232); clear: none; color: #314e64; float: none !important; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, monospace; font-size: 14px; line-height: 21px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px 10px 10px 5px; width: 597.797px;&quot;&gt;&lt;span style=&quot;border: 0px; color: #400080; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt; safeC = &lt;span style=&quot;border: 0px; color: #400080; margin: 0px; padding: 0px;&quot;&gt;Math&lt;/span&gt;.multiplyExact(bigA, bigB); &lt;span style=&quot;border: 0px; color: #800040; margin: 0px; padding: 0px;&quot;&gt;// will throw ArithmeticException if result exceeds +-2^31&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
The only downside is that it’s up to you to find those places in your code where overflows can happen. Not an automagical solution by any stretch, but I guess it’s better than nothing.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: none; color: #222222; float: none; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; font-weight: normal; line-height: 24px; margin: 0px 0px 10px; padding: 0px; width: 610px;&quot;&gt;
&lt;/h2&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: none; color: #222222; float: none; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; font-weight: normal; line-height: 24px; margin: 0px 0px 10px; padding: 0px; width: 610px;&quot;&gt;
7. &lt;u&gt;Secure Random Generation&lt;/u&gt;&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
Java has been under fire for several years for having security holes. Justified or not, a&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;lot of workhas been done to fortify the JVM and frameworks from possible attacks. Random numbers with a low-level of entropy make systems that use random number generators to create encryption keys or hash sensitive information more susceptible to hacking.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
So far selection of the Random Number Generation algorithms has been left to the developer. The problem is that where implementations depend on specific hardware / OS / JVM, the desired algorithm may not be available. In such cases applications have a tendency to default to weaker generators, which can put them at greater risk of attack.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
Java 8 has added a new method called&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;SecureRandom.getInstanceStrong()&amp;nbsp;whose aim is to have the JVM choose a secure provider for you. If you’re writing code without complete control of the OS / hardware / JVM on which it would run (which is very common when deploying to the cloud or PaaS), my suggestion is to give this approach some serious consideration.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: none; color: #222222; float: none; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; font-weight: normal; line-height: 24px; margin: 0px 0px 10px; padding: 0px; width: 610px;&quot;&gt;
&lt;/h2&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: none; color: #222222; float: none; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, Times, serif; font-size: 20px; font-weight: normal; line-height: 24px; margin: 0px 0px 10px; padding: 0px; width: 610px;&quot;&gt;
8. &lt;u&gt;Optional References&lt;/u&gt;&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
NulPointers are like&amp;nbsp;&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;stubbing your toes&lt;/span&gt;&lt;/span&gt;&amp;nbsp;- you’ve been doing it since you could stand up, and no matter how smart you are today - chances are you still do. To help with this age-old problem Java 8 is introducing a new template called&amp;nbsp;&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;Optional&amp;lt;T&amp;gt;&lt;/span&gt;&lt;/span&gt;.&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
Borrowing from Scala and Haskell, this template is meant to explicitly state when a reference passed to or returned by a function can be null. This is meant to reduce the guessing game of whether a reference can be null, through over-reliance on documentation which may be out-of-date, or reading code which may change over time.&lt;/div&gt;
&lt;pre style=&quot;background-color: #f5f2f0; background-position: -29px 0px; border: 1px solid rgb(232, 232, 232); clear: none; color: #314e64; float: none !important; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, monospace; font-size: 14px; line-height: 21px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px 10px 10px 5px; width: 597.797px;&quot;&gt;&lt;span style=&quot;border: 0px; color: #400080; margin: 0px; padding: 0px;&quot;&gt;Optional&lt;/span&gt;&amp;lt;&lt;span style=&quot;border: 0px; color: #400080; margin: 0px; padding: 0px;&quot;&gt;User&lt;/span&gt;&amp;gt; tryFindUser(&lt;span style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt; userID) {&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
or -&lt;/div&gt;
&lt;pre style=&quot;background-color: #f5f2f0; background-position: -29px 0px; border: 1px solid rgb(232, 232, 232); clear: none; color: #314e64; float: none !important; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, monospace; font-size: 14px; line-height: 21px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px 10px 10px 5px; width: 597.797px;&quot;&gt;&lt;span style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; processUser(&lt;span style=&quot;border: 0px; color: #400080; margin: 0px; padding: 0px;&quot;&gt;User&lt;/span&gt; user, &lt;span style=&quot;border: 0px; color: #400080; margin: 0px; padding: 0px;&quot;&gt;Optional&lt;/span&gt;&amp;lt;&lt;span style=&quot;border: 0px; color: #400080; margin: 0px; padding: 0px;&quot;&gt;Cart&lt;/span&gt;&amp;gt; shoppingCart) {&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
The Optional template has a set of functions that make sampling it more convenient, such as&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;isPresent()&lt;/span&gt;&lt;/span&gt;&amp;nbsp;to check if an non-null value is available, or&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #286ab2;&quot;&gt;&lt;span style=&quot;border-color: initial; border-image: initial; border-style: initial; outline-color: initial !important; outline-width: initial !important;&quot;&gt;ifPresent()&lt;/span&gt;&lt;/span&gt;&amp;nbsp;to which you can pass a Lambda function that will be executed if isPresent is true. The downside is that much like with Java 8’s new date-time APIs, it will take time and work till this pattern takes hold and is absorbed into the libraries we use and design everyday.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: none; float: none; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 10px; padding: 0px; width: 610px;&quot;&gt;
New Lambda syntax for printing an optional value -&lt;/div&gt;
&lt;pre style=&quot;background-color: #f5f2f0; background-position: -29px 0px; border: 1px solid rgb(232, 232, 232); clear: none; color: #314e64; float: none !important; font-family: Consolas, Monaco, &amp;quot;Andale Mono&amp;quot;, monospace; font-size: 14px; line-height: 21px; margin-bottom: 10px; margin-top: 10px; overflow: auto; padding: 10px 10px 10px 5px; width: 597.797px;&quot;&gt;value.ifPresent(&lt;span style=&quot;border: 0px; color: #400080; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;::&lt;span style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;print&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://adityangoyal.blogspot.com/feeds/5646197278225962390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://adityangoyal.blogspot.com/2016/10/8-great-java-8-features-no-ones-talking.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/5646197278225962390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/5646197278225962390'/><link rel='alternate' type='text/html' href='http://adityangoyal.blogspot.com/2016/10/8-great-java-8-features-no-ones-talking.html' title='8 Hidden Great Java 8 Features'/><author><name>Aditya Goyal</name><uri>http://www.blogger.com/profile/06314586793374570427</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVzkkcdRCFN90-Ws96mUCl7t8CooADL5gjz5VVUy_USe7QWidMptXkza-i-5YZZq4_q8GF8uGO4na9QH2I7uSKeVyLy3eAoTyPMA6k9GfZIhr3QtH8H_OQ-RcRYb1Ru7w/s150/IMG_1203.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4864125858165953220.post-1340551589194192715</id><published>2016-10-17T02:31:00.002+05:30</published><updated>2016-10-17T02:33:22.552+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="5 Features in Java 8 that Will Change How You Code"/><category scheme="http://www.blogger.com/atom/ns#" term="Java 8 features."/><title type='text'>5 Features in Java 8 that Will Change How You Code</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div pid=&quot;1&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
Java 8 is packed full of some really exciting features at both the JVM and language level. While some of the features initially envisioned for this release got scoped out or pushed out to release 9, there are literally dozens of new features. Many of the new additions are under-the-hood improvements either at the compiler, JVM or help-system level. As such, while we may benefit from them, there’s nothing we need to actively do (other than install Java 8 of course) to enjoy them.&lt;/div&gt;
&lt;div pid=&quot;2&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
Having said that, let’s look at 5 features that we feel are an absolute must for you to know about:&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #262626; font-family: &amp;quot;helvetica neue&amp;quot;, helvetica, arial, sans-serif; font-size: 30px; line-height: 1.2; margin-bottom: 5px; margin-top: 20px;&quot;&gt;
1.&amp;nbsp;Lambda Expressions&lt;/h2&gt;
&lt;div pid=&quot;3&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
Even if we really didn’t want to go mainstream here, there’s little doubt that from a developer’s perspective, the most dominant feature of Java 8 is the new support for Lambda expressions. This addition to the language brings Java to the forefront of functional programming, right there with other functional JVM-based languages such as Scala and Clojure.&lt;/div&gt;
&lt;div pid=&quot;4&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
We’ve previously looked into how&amp;nbsp;Java implemented Lambda expressions, and how it compared to the approach taken by Scala. From Java’s perspective this is by far one of the biggest additions to the language in the past decade.&lt;/div&gt;
&lt;div pid=&quot;5&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
At minimum, it’s recommended you become familiar with the Lambda syntax, especially as it relates to array and collection operations, where Lambdas have been tightly integrated into the core language libraries. It is highly likely that you’ll start seeing more and more code like the snippet below in both 3rd party and within your organization’s code.&lt;/div&gt;
&lt;div class=&quot;CodeMirror cm-s-default&quot; style=&quot;background: white; border: 1px solid rgb(217, 220, 221); box-sizing: border-box; clear: both; font-family: monospace; font-size: 13px; height: auto !important; overflow: hidden; position: relative;&quot;&gt;
&lt;div class=&quot;CodeMirror-scroll&quot; style=&quot;box-sizing: content-box; height: 44px; margin-bottom: -30px; margin-right: -30px; outline: none; overflow: scroll !important; padding-bottom: 30px; position: relative;&quot;&gt;
&lt;div class=&quot;CodeMirror-sizer&quot; style=&quot;border-right: 30px solid transparent; box-sizing: content-box; margin-bottom: 0px; margin-left: 29px; min-height: 26px; min-width: 319px; padding-bottom: 0px; padding-right: 0px; position: relative;&quot;&gt;
&lt;div style=&quot;box-sizing: border-box; position: relative; top: 0px;&quot;&gt;
&lt;div class=&quot;CodeMirror-lines&quot; style=&quot;box-sizing: border-box; cursor: text; min-height: 1px; padding: 4px 0px;&quot;&gt;
&lt;div style=&quot;box-sizing: border-box; outline: none; position: relative;&quot;&gt;
&lt;div class=&quot;CodeMirror-code&quot; style=&quot;box-sizing: border-box; outline: none;&quot;&gt;
&lt;div style=&quot;box-sizing: border-box; position: relative;&quot;&gt;
&lt;div class=&quot;CodeMirror-gutter-wrapper&quot; style=&quot;-webkit-user-select: none; background: none !important; border: none !important; box-sizing: border-box; left: -29px; position: absolute; width: 29px; z-index: 4;&quot;&gt;
&lt;div class=&quot;CodeMirror-linenumber CodeMirror-gutter-elt&quot; data-line-number=&quot;1&quot; style=&quot;box-sizing: content-box; color: #999999; cursor: default; left: 0px; min-width: 20px; padding: 0px 3px 0px 5px; position: absolute; text-align: right; white-space: nowrap; width: 20px; z-index: 4;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;pre style=&quot;-webkit-tap-highlight-color: transparent; background: transparent; border-radius: 0px; border: 0px solid rgb(204, 204, 204); box-sizing: border-box; color: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; padding-right: 29px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;Person&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;Sex&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;byGender&lt;/span&gt; &lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; position: relative;&quot;&gt;
&lt;div class=&quot;CodeMirror-gutter-wrapper&quot; style=&quot;-webkit-user-select: none; background: none !important; border: none !important; box-sizing: border-box; left: -29px; position: absolute; width: 29px; z-index: 4;&quot;&gt;
&lt;div class=&quot;CodeMirror-linenumber CodeMirror-gutter-elt&quot; data-line-number=&quot;2&quot; style=&quot;box-sizing: content-box; color: #999999; cursor: default; left: 0px; min-width: 20px; padding: 0px 3px 0px 5px; position: absolute; text-align: right; white-space: nowrap; width: 20px; z-index: 4;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;pre style=&quot;-webkit-tap-highlight-color: transparent; background: transparent; border-radius: 0px; border: 0px solid rgb(204, 204, 204); box-sizing: border-box; color: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; padding-right: 29px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;roster&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;stream&lt;/span&gt;().&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;collect&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;Collectors&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;groupingBy&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;Person&lt;/span&gt;::&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;getGender&lt;/span&gt;));&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;CodeMirror-gutters&quot; style=&quot;background-color: #f7f7f7; border-right: 1px solid rgb(221, 221, 221); box-sizing: content-box; height: 44px; left: 0px; position: absolute; top: 0px; white-space: nowrap; z-index: 3;&quot;&gt;
&lt;div class=&quot;CodeMirror-gutter CodeMirror-linenumbers&quot; style=&quot;box-sizing: content-box; display: inline-block; height: 44px; margin-bottom: -30px; white-space: normal; width: 28px;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div pid=&quot;6&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
* A pretty efficient way of grouping a collection by the value of a specific class field.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #262626; font-family: &amp;quot;helvetica neue&amp;quot;, helvetica, arial, sans-serif; font-size: 30px; line-height: 1.2; margin-bottom: 5px; margin-top: 20px;&quot;&gt;
2.&amp;nbsp;Parallel Operations&lt;/h2&gt;
&lt;div pid=&quot;7&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
With the addition of Lambda expressions to arrays operations, Java introduced a key concept into the language of internal iteration. Essentially as developers we’re used to use loop operations as one of the most basic programming idioms, right up there with if and else.&lt;/div&gt;
&lt;div pid=&quot;8&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
The introduction of Lambda expressions turned that paradigm around with the actual iteration over a collection over which a Lambda function is invoked is carried out by the core library.&lt;/div&gt;
&lt;div pid=&quot;9&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
You can think of this as an extension of iterators where the actual operation of extracting the next item from a collection on which to operate is carried out by an iterator. An exciting possibility opened by this design pattern is to enable operations carried out on long arrays such as sorting, filtering and mapping to be carried out in parallel by the framework. When dealing with server code that’s processing lengthy collections on a continuous basis, this can lead to major throughput improvements with relative work from your end.&lt;/div&gt;
&lt;div pid=&quot;10&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
Here’s the same snippet as above, but using the&amp;nbsp;framework’s&amp;nbsp;new parallel processing capabilities -&lt;/div&gt;
&lt;div class=&quot;CodeMirror cm-s-default&quot; style=&quot;background: white; border: 1px solid rgb(217, 220, 221); box-sizing: border-box; clear: both; font-family: monospace; font-size: 13px; height: auto !important; overflow: hidden; position: relative;&quot;&gt;
&lt;div class=&quot;CodeMirror-scroll&quot; style=&quot;box-sizing: content-box; height: 62px; margin-bottom: -30px; margin-right: -30px; outline: none; overflow: scroll !important; padding-bottom: 30px; position: relative;&quot;&gt;
&lt;div class=&quot;CodeMirror-sizer&quot; style=&quot;border-right: 30px solid transparent; box-sizing: content-box; margin-bottom: 0px; margin-left: 29px; min-height: 26px; min-width: 319px; padding-bottom: 0px; padding-right: 0px; position: relative;&quot;&gt;
&lt;div style=&quot;box-sizing: border-box; position: relative; top: 0px;&quot;&gt;
&lt;div class=&quot;CodeMirror-lines&quot; style=&quot;box-sizing: border-box; cursor: text; min-height: 1px; padding: 4px 0px;&quot;&gt;
&lt;div style=&quot;box-sizing: border-box; outline: none; position: relative;&quot;&gt;
&lt;div class=&quot;CodeMirror-code&quot; style=&quot;box-sizing: border-box; outline: none;&quot;&gt;
&lt;div style=&quot;box-sizing: border-box; position: relative;&quot;&gt;
&lt;div class=&quot;CodeMirror-gutter-wrapper&quot; style=&quot;-webkit-user-select: none; background: none !important; border: none !important; box-sizing: border-box; left: -29px; position: absolute; width: 29px; z-index: 4;&quot;&gt;
&lt;div class=&quot;CodeMirror-linenumber CodeMirror-gutter-elt&quot; data-line-number=&quot;1&quot; style=&quot;box-sizing: content-box; color: #999999; cursor: default; left: 0px; min-width: 20px; padding: 0px 3px 0px 5px; position: absolute; text-align: right; white-space: nowrap; width: 20px; z-index: 4;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;pre style=&quot;-webkit-tap-highlight-color: transparent; background: transparent; border-radius: 0px; border: 0px solid rgb(204, 204, 204); box-sizing: border-box; color: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; padding-right: 29px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;ConcurrentMap&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;Person&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;Sex&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;byGender&lt;/span&gt; &lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; position: relative;&quot;&gt;
&lt;div class=&quot;CodeMirror-gutter-wrapper&quot; style=&quot;-webkit-user-select: none; background: none !important; border: none !important; box-sizing: border-box; left: -29px; position: absolute; width: 29px; z-index: 4;&quot;&gt;
&lt;div class=&quot;CodeMirror-linenumber CodeMirror-gutter-elt&quot; data-line-number=&quot;2&quot; style=&quot;box-sizing: content-box; color: #999999; cursor: default; left: 0px; min-width: 20px; padding: 0px 3px 0px 5px; position: absolute; text-align: right; white-space: nowrap; width: 20px; z-index: 4;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;pre style=&quot;-webkit-tap-highlight-color: transparent; background: transparent; border-radius: 0px; border: 0px solid rgb(204, 204, 204); box-sizing: border-box; color: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; padding-right: 29px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;roster&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;parallelStream&lt;/span&gt;().&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;collect&lt;/span&gt;(&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;box-sizing: border-box; position: relative;&quot;&gt;
&lt;div class=&quot;CodeMirror-gutter-wrapper&quot; style=&quot;-webkit-user-select: none; background: none !important; border: none !important; box-sizing: border-box; left: -29px; position: absolute; width: 29px; z-index: 4;&quot;&gt;
&lt;div class=&quot;CodeMirror-linenumber CodeMirror-gutter-elt&quot; data-line-number=&quot;3&quot; style=&quot;box-sizing: content-box; color: #999999; cursor: default; left: 0px; min-width: 20px; padding: 0px 3px 0px 5px; position: absolute; text-align: right; white-space: nowrap; width: 20px; z-index: 4;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;pre style=&quot;-webkit-tap-highlight-color: transparent; background: transparent; border-radius: 0px; border: 0px solid rgb(204, 204, 204); box-sizing: border-box; color: inherit; line-height: inherit; overflow: visible; padding: 0px 4px; position: relative; word-break: break-all; word-wrap: normal; z-index: 2;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; padding-right: 29px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;Collectors&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;groupingByConcurrent&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;Person&lt;/span&gt;::&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box;&quot;&gt;getGender&lt;/span&gt;))&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;CodeMirror-gutters&quot; style=&quot;background-color: #f7f7f7; border-right: 1px solid rgb(221, 221, 221); box-sizing: content-box; height: 62px; left: 0px; position: absolute; top: 0px; white-space: nowrap; z-index: 3;&quot;&gt;
&lt;div class=&quot;CodeMirror-gutter CodeMirror-linenumbers&quot; style=&quot;box-sizing: content-box; display: inline-block; height: 62px; margin-bottom: -30px; white-space: normal; width: 28px;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div pid=&quot;11&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
* It’s a fairly small change that’s required to make this algorithm run on multiple threads.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #262626; font-family: &amp;quot;helvetica neue&amp;quot;, helvetica, arial, sans-serif; font-size: 30px; line-height: 1.2; margin-bottom: 5px; margin-top: 20px;&quot;&gt;
3.&amp;nbsp;Java + JavaScript = ❤&lt;/h2&gt;
&lt;div pid=&quot;12&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
Java 8 is looking to right one of its biggest historical wrongs – the ever growing distance between Java and JavaScript, one that has only increased in the past few years. With this new release, Java 8 is introducing a completely new JVM JavaScript engine – Nashorn. This engine makes unique use of some of the&amp;nbsp;new features introduced in Java 7&amp;nbsp;such as invokeDynamic to provide JVM-level speed to JavaScript execution right there with the likes of V8 and SpiderMonkey.&lt;/div&gt;
&lt;div pid=&quot;13&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
This means that the next time you’re looking to integrate JS into your backend, instead of setting up a node.js instance, you can simply use the JVM to execute the code. The added bonus here is the ability to have seamless interoperability between your Java and JavaScript code in-process, without having to use various IPC/RPC methods to bridge the gap.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #262626; font-family: &amp;quot;helvetica neue&amp;quot;, helvetica, arial, sans-serif; font-size: 30px; line-height: 1.2; margin-bottom: 5px; margin-top: 20px;&quot;&gt;
4.&amp;nbsp;New Date / Time APIs&lt;/h2&gt;
&lt;div pid=&quot;14&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
The complexity of the current native Java library API has been a cause of pain for Java developers for many years. Joda time has been filling this vacuum for years now, and with Java 8. An immediate&amp;nbsp;question that arose&amp;nbsp;early on was why didn’t Java 8 adopt Joda as its native time framework. Due to what was perceived as a design flaw in Joda, Java 8 implemented its own new date / time API from scratch. The good news is that unlike Calendar.getInstance(), the&amp;nbsp;new APIs were designed with simplicity in mind, and clear operations to operate on manipulated values in both human readable and machine time formats.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #262626; font-family: &amp;quot;helvetica neue&amp;quot;, helvetica, arial, sans-serif; font-size: 30px; line-height: 1.2; margin-bottom: 5px; margin-top: 20px;&quot;&gt;
5.&amp;nbsp;Concurrent Accumulators&lt;/h2&gt;
&lt;div pid=&quot;15&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
One of the most common scenarios in concurrent programming is updating of numeric counters accessed by multiple threads. There have been many idioms to do this over the years, starting from synchronized blocks (which introduce a high level of contention), to read/write locks to AtomicInteger(s). While the last ones are more efficient, as they rely directly on processor CAS instructions, they require a higher degree of familiarity to implement the required semantics correctly.&lt;/div&gt;
&lt;div pid=&quot;16&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
With Java 8 this problem is solved at the framework level with new concurrent&amp;nbsp;accumulator classes&amp;nbsp;that enable you to very efficiently increase / decrease the value of a counter in a thread safe manner. This is really a case where it’s not a question of taste, or preference – using these new classes in your code is really a no-brainer.&lt;/div&gt;
&lt;div pid=&quot;17&quot; style=&quot;background-color: white; box-sizing: border-box; color: #262626; font-family: georgia, serif; font-size: 19px; margin-bottom: 15px; margin-top: 5px; padding-top: 0px;&quot;&gt;
Are there any other language features you think every developers should know about? Add them in the comments section.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://adityangoyal.blogspot.com/feeds/1340551589194192715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://adityangoyal.blogspot.com/2016/10/5-features-in-java-8-that-will-change.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/1340551589194192715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/1340551589194192715'/><link rel='alternate' type='text/html' href='http://adityangoyal.blogspot.com/2016/10/5-features-in-java-8-that-will-change.html' title='5 Features in Java 8 that Will Change How You Code'/><author><name>Aditya Goyal</name><uri>http://www.blogger.com/profile/06314586793374570427</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVzkkcdRCFN90-Ws96mUCl7t8CooADL5gjz5VVUy_USe7QWidMptXkza-i-5YZZq4_q8GF8uGO4na9QH2I7uSKeVyLy3eAoTyPMA6k9GfZIhr3QtH8H_OQ-RcRYb1Ru7w/s150/IMG_1203.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4864125858165953220.post-5757442400016988160</id><published>2016-05-16T03:08:00.002+05:30</published><updated>2016-10-17T02:29:03.906+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="indentation checker"/><category scheme="http://www.blogger.com/atom/ns#" term="indentation in python"/><category scheme="http://www.blogger.com/atom/ns#" term="Python indentation"/><category scheme="http://www.blogger.com/atom/ns#" term="tabnanny"/><title type='text'>Indentation problem in Python</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
Solving indentation problem in Python&lt;/h2&gt;
&lt;br /&gt;
&lt;div class=&quot;example&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;d0e4759&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; font-family: &#39;Book Antiqua&#39;, Georgia, Palatino, Times, &#39;Times New Roman&#39;, serif; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 23.2px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;abstract&quot;&gt;
&lt;span class=&quot;application&quot;&gt;Python&lt;/span&gt;&amp;nbsp;functions have no explicit&amp;nbsp;&lt;tt class=&quot;literal&quot;&gt;begin&lt;/tt&gt;&amp;nbsp;or&amp;nbsp;&lt;tt class=&quot;literal&quot;&gt;end&lt;/tt&gt;, and no curly braces to mark where the function code starts and stops. The only delimiter is a colon (&lt;tt class=&quot;literal&quot;&gt;:&lt;/tt&gt;) and the indentation of the code itself.&lt;br /&gt;
So indentation plays a major part in python coding.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;But how to check indentation in python?&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
There is a library in python called tabnanny, that provides user to check indentation of your code both at file and directory level.&lt;br /&gt;
&lt;br /&gt;
to check indentation of any python file:-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
open python console&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;gt;&amp;gt;&amp;gt; import tabnanny;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;gt;&amp;gt;&amp;gt; tabnanny.check(&quot;main.py&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;







&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;main.py&#39;: Indentation Error: unindent does not match any outer indentation level (&amp;lt;tokenize&amp;gt;, line 9)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;line-height: 20.8px;&quot;&gt;
&lt;code class=&quot;descclassname&quot; style=&quot;background-color: transparent; font-size: 0.95em; padding: 0px 1px;&quot;&gt;tabnanny.&lt;/code&gt;&lt;code class=&quot;descname&quot; style=&quot;background-color: transparent; font-size: 1.2em; font-weight: bold; padding: 0px 1px;&quot;&gt;check&lt;/code&gt;&lt;span class=&quot;sig-paren&quot;&gt;(&lt;/span&gt;&lt;em&gt;file_or_dir&lt;/em&gt;&lt;span class=&quot;sig-paren&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;blockquote&gt;
If&amp;nbsp;&lt;em&gt;file_or_dir&lt;/em&gt;&amp;nbsp;is a directory and not a symbolic link, then recursively descend the directory tree named by&amp;nbsp;&lt;em&gt;file_or_dir&lt;/em&gt;, checking all&amp;nbsp;&lt;code class=&quot;file docutils literal&quot; style=&quot;background-color: #ecf0f3; font-size: 0.95em; padding: 0px 1px;&quot;&gt;&lt;span class=&quot;pre&quot;&gt;.py&lt;/span&gt;&lt;/code&gt;&amp;nbsp;files along the way. If&lt;em&gt;file_or_dir&lt;/em&gt;&amp;nbsp;is an ordinary Python source file, it is checked for whitespace related problems. The diagnostic messages are written to standard output using the print statement.&lt;/blockquote&gt;
&lt;/blockquote&gt;
So check method of tabnanny checks for indentation on file level and also on directory level by scanning .py files.&lt;br /&gt;
You can also check for indentation from terminal without opening python console.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;$ python -m tabnanny main.py&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;main.py&#39;: Indentation Error: unindent does not match any outer indentation level (&amp;lt;tokenize&amp;gt;, line 9)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
For more info about it take a look into tabnanny documentation and examples(&lt;a href=&quot;https://docs.python.org/2/library/tabnanny.html&quot;&gt;https://docs.python.org/2/library/tabnanny.html&lt;/a&gt;&amp;nbsp;)&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://adityangoyal.blogspot.com/feeds/5757442400016988160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://adityangoyal.blogspot.com/2016/05/solving-indentation-problem-in-python.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/5757442400016988160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/5757442400016988160'/><link rel='alternate' type='text/html' href='http://adityangoyal.blogspot.com/2016/05/solving-indentation-problem-in-python.html' title='Indentation problem in Python'/><author><name>Aditya Goyal</name><uri>http://www.blogger.com/profile/06314586793374570427</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVzkkcdRCFN90-Ws96mUCl7t8CooADL5gjz5VVUy_USe7QWidMptXkza-i-5YZZq4_q8GF8uGO4na9QH2I7uSKeVyLy3eAoTyPMA6k9GfZIhr3QtH8H_OQ-RcRYb1Ru7w/s150/IMG_1203.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4864125858165953220.post-2214813688247284103</id><published>2013-04-14T10:44:00.004+05:30</published><updated>2013-04-19T19:31:49.341+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="export mysql database"/><category scheme="http://www.blogger.com/atom/ns#" term="Import mysql database"/><category scheme="http://www.blogger.com/atom/ns#" term="import/export mysql database"/><title type='text'>Import/Export MySQL Database</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 18pt;&quot;&gt;&lt;br /&gt;
IMPORT MYSQL DATABASE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;There are many ways to
import .sql file in MySQL Database.Some of which are discussed below:-&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&lt;br /&gt;
&lt;b&gt;First Way&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Open MySQL command line client or execute mysql.exe
     from command prompt present in&amp;nbsp;&amp;nbsp;MySQL installation path or add
     mysql(make sure mysql path till bin is placed in system environment path)
     ,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Create a new database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 10pt;&quot;&gt;mysql&amp;gt;
Create database test&lt;br /&gt;
mysql&amp;gt; use test&lt;br /&gt;
Then import the database into test databse by using one of this commend:-&lt;br /&gt;
source test.sql&lt;br /&gt;
or&lt;br /&gt;
./ test.sql&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;Second Way&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Using&amp;nbsp;command&amp;nbsp;prompt:-&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Go to&amp;nbsp;the&amp;nbsp;location where mysql is installed
     or add MySQL.exe location(installationlocation/bin) in system&amp;nbsp;environment&amp;nbsp;path:-&lt;br /&gt;
     &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;MySQL-&amp;gt;bin&lt;br /&gt;
     &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;now&amp;nbsp;execute&amp;nbsp;following
     command:-&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 10pt;&quot;&gt;mysql
-u &amp;lt;user&amp;gt; -p&amp;lt;password&amp;gt; -h &amp;lt;hostname&amp;gt; &amp;lt;database&amp;gt; &amp;lt;
/path/to/updated_script/database.sql&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;3&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;You&amp;nbsp;can also invoke&amp;nbsp;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/mysql.html&quot; title=&quot;4.5.1. mysql — The MySQL Command-Line Tool&quot;&gt;&lt;span style=&quot;color: black; text-decoration: none; text-underline: none;&quot;&gt;mysql&lt;/span&gt;&lt;/a&gt;&amp;nbsp;with
     the&amp;nbsp;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/mysql-command-options.html#option_mysql_verbose&quot;&gt;&lt;span style=&quot;color: black; text-decoration: none; text-underline: none;&quot;&gt;--verbose&lt;/span&gt;&lt;/a&gt;&amp;nbsp;option,
     which causes each statement to be&amp;nbsp;displayed&amp;nbsp;before the result
     that it produces.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 10pt;&quot;&gt;mysql
-u username -p password -h localhost DATA-BASE-NAME &amp;lt; data.sql&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;Dedicated server&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;If you have a dedicated
database server, replace localhost hostname with actual server name or IP
address as follows:&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 10pt;&quot;&gt;mysql
-u username -p -h 202.54.1.10 databasename &amp;lt; data.sql&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;Import multiple files into a single sql file&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 10pt;&quot;&gt;C:\&amp;gt;Copy
*.sql combined.sql&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 13.5pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 18pt;&quot;&gt;EXPORTING DATABASE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;To export MySQL database
follow following steps:-&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 10pt;&quot;&gt;mysqldump -u username
-ppassword -h database &amp;gt; database_with_location.sql&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;or&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 10pt;&quot;&gt;mysqldump
-u username -ppassword -h database
--result-file=&quot;location_to_export_database.sql&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &#39;&#39;, serif, &#39;&#39;, serif; font-size: 12pt;&quot;&gt;Taking backup of more than one database&amp;nbsp; database1,database2&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 10pt;&quot;&gt;mysqldump -u root -ptmppassword --databases database1 database2
&amp;gt; database1_database2.sql&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &#39;&#39;, serif, &#39;&#39;, serif; font-size: 12pt;&quot;&gt;Backup all databases&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;span style=&quot;color: #111111; font-family: Consolas; font-size: 10.5pt; mso-bidi-font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 10pt;&quot;&gt;mysqldump -u root -ptmppassword --all-databases
&amp;gt; /tmp/all-database.sql&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &#39;&#39;, serif, &#39;&#39;, serif; font-size: 12pt;&quot;&gt;Backup a specific table&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: #111111; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Backup
only the accounts_contacts table from sugarcrm database&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 10pt;&quot;&gt;mysqldump
-u root -ptmppassword sugarcrm accounts_contacts \&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;gt; tmp/sugarcrm_accounts_contacts.sql&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: #111111; font-family: &amp;quot;&amp;quot;sans-serif&amp;quot;&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.5pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;&#39;, serif, &#39;&#39;, serif; font-size: 12pt;&quot;&gt;Backup a local database and restore to remote server using single
command:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: #111111; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;This
is a sleek option, if you want to keep a read-only database on the
remote-server, which is a copy of the master database on local-server. The
example below will backup the sugarcrm database on the local-server and restore
it as sugarcrm1 database on the remote-server. Please note that you should
first create the sugarcrm1 database on the remote-server before executing the
following command.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 10pt;&quot;&gt;mysqldump
-u root -ptmppassword sugarcrm | mysql \&amp;nbsp;&amp;nbsp; -u root -ptmppassword
--host=remote-server -C sugarcrm1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://adityangoyal.blogspot.com/feeds/2214813688247284103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://adityangoyal.blogspot.com/2013/04/importexport-mysql-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/2214813688247284103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/2214813688247284103'/><link rel='alternate' type='text/html' href='http://adityangoyal.blogspot.com/2013/04/importexport-mysql-database.html' title='Import/Export MySQL Database'/><author><name>Aditya Goyal</name><uri>http://www.blogger.com/profile/06314586793374570427</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVzkkcdRCFN90-Ws96mUCl7t8CooADL5gjz5VVUy_USe7QWidMptXkza-i-5YZZq4_q8GF8uGO4na9QH2I7uSKeVyLy3eAoTyPMA6k9GfZIhr3QtH8H_OQ-RcRYb1Ru7w/s150/IMG_1203.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4864125858165953220.post-4505197902188181008</id><published>2012-11-03T10:23:00.001+05:30</published><updated>2012-11-03T10:23:43.057+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Auto Format in Eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse auto formatting"/><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse Code Formatters"/><category scheme="http://www.blogger.com/atom/ns#" term="eclipse formatter xml"/><category scheme="http://www.blogger.com/atom/ns#" term="Export/Import the Eclipse XML Formatting Rules"/><category scheme="http://www.blogger.com/atom/ns#" term="Formatting Code in Eclipse"/><title type='text'>Formatting Code in eclipse</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Eclipse has one beautiful feature to create a new rule to format code in eclipse and then export the same set of rules in XML format and import the same set of rules(XML File) and hence supports quick formatting.&lt;br /&gt;
It is used for formatting indentation,braces,white spacing,blank lines,new line,control statement,line wrapping and comment section.&lt;br /&gt;
&lt;br /&gt;
Steps to follow to create a set of rules for formatting the code according to your business requirements are described below:-&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Go to Windows(Ctrl + W) -&amp;gt; Preferences(P).Now select Java -&amp;gt; Code Style -&amp;gt; Formatter.
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1KPRJRwvELImuV9QXdzOXtv2lRGX73aYAWVcGyaDS85aohgLVM8sEGFMG2WgdYFbcItxkQgH6sx6vcc34tkszzB_aIVSw12CuWqW8eZ_prO_ignQEW_xbX-YSODQPhEHoj3s_MYfMQ9EM/s1600/format1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Formatting in Eclipse&quot; border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1KPRJRwvELImuV9QXdzOXtv2lRGX73aYAWVcGyaDS85aohgLVM8sEGFMG2WgdYFbcItxkQgH6sx6vcc34tkszzB_aIVSw12CuWqW8eZ_prO_ignQEW_xbX-YSODQPhEHoj3s_MYfMQ9EM/s640/format1.JPG&quot; title=&quot;Formatting in Eclipse&quot; width=&quot;556&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Formatting in Eclipse&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;li&gt;Create a new profile.Click on new and give a name to your profile.
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDrSQqb7tQM6vC2dez8tub7HrTaxIoUXMRJeDPSMPghVRuZCrfnbQv8RApYyIGdtGi0DDB3Qk3FTc_x7B2Vp9w_4q-FrIEwyId410Em66_d3LDcRRqIzwGbPr1vH-o5AveaxR20GAXZAVN/s1600/format2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Creating new Formatting Profile&quot; border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDrSQqb7tQM6vC2dez8tub7HrTaxIoUXMRJeDPSMPghVRuZCrfnbQv8RApYyIGdtGi0DDB3Qk3FTc_x7B2Vp9w_4q-FrIEwyId410Em66_d3LDcRRqIzwGbPr1vH-o5AveaxR20GAXZAVN/s640/format2.JPG&quot; title=&quot;Creating new Formatting Profile&quot; width=&quot;556&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Creating new Formatting Profile&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;li&gt;Set the rules for formatting by checking the rules that you want to use in your application.
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNSksm51CD6x4q-iderbdgAaDOtCfnq_1cW6tUNqWeu3-39zV6WMyknp_TpV81yH2QJfrDQSVh0AKtuq5tOSzw0RtOkADg41bvBnrb9HPY-Jx_4aOZLVjtDPT2XKCfQoTWGjUE0kBQk4Sw/s1600/format3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Create rules for formatting&quot; border=&quot;0&quot; height=&quot;467&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNSksm51CD6x4q-iderbdgAaDOtCfnq_1cW6tUNqWeu3-39zV6WMyknp_TpV81yH2QJfrDQSVh0AKtuq5tOSzw0RtOkADg41bvBnrb9HPY-Jx_4aOZLVjtDPT2XKCfQoTWGjUE0kBQk4Sw/s640/format3.JPG&quot; title=&quot;Create rules for formatting&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Create rules for formatting&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
For formatting the width,Select Line Wrapping and set maximum line width and set line breaking policy and indentation policy for Class Declarations,Constructor Declarations,Method declarations,enum Declarations,Function Calls,Expressions,Statements.After setting all the formatting rules,click on apply -&amp;gt; OK.You can see the code after formatting preview in the Preview of the setting.
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM7Q_HX8d3C8xg3h5Z-KOGfvW1myRbIBKV3NdNQQEw8r4tsaRc7J79TSfi5lO-oyZ0jz3m-c6xOzpKXeARuVx-_YO5a6qdBYX1dDx6C7YzvlBzcEBLXx3ZAxYSg4EhSxqQQ2f5Idzi6u50/s1600/format4.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Line Wrapping rules for formatting&quot; border=&quot;0&quot; height=&quot;470&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM7Q_HX8d3C8xg3h5Z-KOGfvW1myRbIBKV3NdNQQEw8r4tsaRc7J79TSfi5lO-oyZ0jz3m-c6xOzpKXeARuVx-_YO5a6qdBYX1dDx6C7YzvlBzcEBLXx3ZAxYSg4EhSxqQQ2f5Idzi6u50/s640/format4.JPG&quot; title=&quot;Line Wrapping rules for formatting&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Line Wrapping rules for formatting&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;li&gt;Click on Export in top right corner to export these settings.Give a name to the file and Click on Save.&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnmpwGrtu4whl6NiNiaNMef8O0Hzwp-Uu8LJYDWgwQb923E5QuMCMRQVf7Sqfo0tc_sUp6wSSXRmPD9kgXyvlNUjAdh8jBARlMOAeraG3XnYPyGwYptW5xbdEYwhSE5bpW_suzlu9WI0un/s1600/format5.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Export these Settings&quot; border=&quot;0&quot; height=&quot;467&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnmpwGrtu4whl6NiNiaNMef8O0Hzwp-Uu8LJYDWgwQb923E5QuMCMRQVf7Sqfo0tc_sUp6wSSXRmPD9kgXyvlNUjAdh8jBARlMOAeraG3XnYPyGwYptW5xbdEYwhSE5bpW_suzlu9WI0un/s640/format5.JPG&quot; title=&quot;Export these Settings&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Export these Settings&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;li&gt;To use these settings throughout the project team,import these settings by importing the XML file created above and click on Apply-&amp;gt; OK.&lt;/li&gt;
&lt;li&gt;If you want this setting to be applicable for a particular project.Go to Project Properties,select Formatter from Java Code Style and click on the&amp;nbsp;check-box&amp;nbsp;Enable project specific settings.Select the Active Profile and click on Apply.
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik_Dp368l06TrMMGxz1TMCkjJv5xdeEywgYIJABPsX8Zh_psav9AWIAc3NOZYkr_WteClMLZ4ITb6oTVFtt1O_-GGL8iPATU-NhLjjYXYKVxeM4WtciYUxtOqdf7yN-4WzC9btZt25q0PU/s1600/format6.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Project Specific Settings&quot; border=&quot;0&quot; height=&quot;370&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik_Dp368l06TrMMGxz1TMCkjJv5xdeEywgYIJABPsX8Zh_psav9AWIAc3NOZYkr_WteClMLZ4ITb6oTVFtt1O_-GGL8iPATU-NhLjjYXYKVxeM4WtciYUxtOqdf7yN-4WzC9btZt25q0PU/s640/format6.JPG&quot; title=&quot;Project Specific Settings&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Project Specific Formatting&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;li&gt;Now to apply formatting to the code everytime you save a File,follow following process:-&lt;br /&gt;
Under Preferences, choose Java -&amp;gt; Editor -&amp;gt; Save Actions. Check the &quot;Perform the selected actions on save&quot;, and check the &quot;Format source code&quot; box.You can select the profile to be used for formatting from there.&lt;/li&gt;
&lt;br/&gt;
Njoy...:)
&lt;/ol&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://adityangoyal.blogspot.com/feeds/4505197902188181008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://adityangoyal.blogspot.com/2012/11/formatting-code-in-eclipse.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/4505197902188181008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/4505197902188181008'/><link rel='alternate' type='text/html' href='http://adityangoyal.blogspot.com/2012/11/formatting-code-in-eclipse.html' title='Formatting Code in eclipse'/><author><name>Aditya Goyal</name><uri>http://www.blogger.com/profile/06314586793374570427</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVzkkcdRCFN90-Ws96mUCl7t8CooADL5gjz5VVUy_USe7QWidMptXkza-i-5YZZq4_q8GF8uGO4na9QH2I7uSKeVyLy3eAoTyPMA6k9GfZIhr3QtH8H_OQ-RcRYb1Ru7w/s150/IMG_1203.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1KPRJRwvELImuV9QXdzOXtv2lRGX73aYAWVcGyaDS85aohgLVM8sEGFMG2WgdYFbcItxkQgH6sx6vcc34tkszzB_aIVSw12CuWqW8eZ_prO_ignQEW_xbX-YSODQPhEHoj3s_MYfMQ9EM/s72-c/format1.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4864125858165953220.post-96821624533195778</id><published>2012-10-24T09:13:00.000+05:30</published><updated>2012-10-24T09:32:45.384+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Deployment in Tomcat Apache Server"/><category scheme="http://www.blogger.com/atom/ns#" term="WAR deploy in tomcat"/><category scheme="http://www.blogger.com/atom/ns#" term="WAR file deploy in tomcat"/><category scheme="http://www.blogger.com/atom/ns#" term="WAR file deploy on tomcat startup"/><category scheme="http://www.blogger.com/atom/ns#" term="WAR file deploy using tomcat manager"/><title type='text'>Deployment in Tomcat Apache Server</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;&lt;b style=&quot;font-size: 15px; line-height: 17px;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Export the project in WAR file by selecting the project to deploy -&amp;gt; Export -&amp;gt; WAR file&lt;/span&gt;&lt;/b&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Calibri, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px;&quot;&gt;&lt;b&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1G0uD5aJHkFRrNZs2kTvMn13r3BdtrXwdd9H0cnyhpRj8hTIHS4HmsL2n2mkZuGc-ZerO3lRuXedFXcp8J8RxF66Zjpyts0qAF-I3xNEO6yxpfYzhWL1BqjAwOYgn977DYdHtmRnH00Hd/s1600/deploy2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Select Project &amp;gt; Export &amp;gt;  WAR file&quot; border=&quot;0&quot; height=&quot;344&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1G0uD5aJHkFRrNZs2kTvMn13r3BdtrXwdd9H0cnyhpRj8hTIHS4HmsL2n2mkZuGc-ZerO3lRuXedFXcp8J8RxF66Zjpyts0qAF-I3xNEO6yxpfYzhWL1BqjAwOYgn977DYdHtmRnH00Hd/s640/deploy2.JPG&quot; title=&quot;Export as WAR&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Export project as WAR&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;font-size: 15px; line-height: 17px;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;There are two ways to deploy WAR file in Apache Tomcat Server.First is through tomcat manager.The steps to deploy WAR from tomcat manager is described below:-&lt;/span&gt;

&lt;/b&gt;
&lt;/li&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;div class=&quot;MsoListParagraph&quot; style=&quot;text-indent: -0.25in;&quot;&gt;
&lt;div style=&quot;text-indent: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;Open&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;tomcat-users.xml present at&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif; text-indent: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif; text-indent: 0px;&quot;&gt;appBase location&lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif; text-indent: 0px;&quot;&gt;(default appBase is &quot;$CATALINA_BASE)&lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif; text-indent: 0px;&quot;&gt;/config or from eclipse go to server &amp;gt;&lt;/span&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Tomcat v6.0 Server at localhost-config&amp;nbsp;and add user with manager
role.For Ex:- Add the following line&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;text-indent: -0.25in;&quot;&gt;
&lt;/div&gt;
&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px;&quot;&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;text-indent: -0.25in;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;lt;user username=&quot;admin&quot; password=&quot;admin&quot;
roles=&quot;manager&quot;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaKA2NLsevdMfEm0vYkbtjnftp5OorT9XkAZLUtbhzqhYi8flHzEpgnub46J6MtXmTziCDAjqBZZmzwHtVoNpjeJlisJWnIhYXLBuKd6mQ-WeCWu_QOKVq8jd8N8vaIMYbPA_z6eIVhYhk/s1600/deploy3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;tomcat-users.xml&quot; border=&quot;0&quot; height=&quot;393&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaKA2NLsevdMfEm0vYkbtjnftp5OorT9XkAZLUtbhzqhYi8flHzEpgnub46J6MtXmTziCDAjqBZZmzwHtVoNpjeJlisJWnIhYXLBuKd6mQ-WeCWu_QOKVq8jd8N8vaIMYbPA_z6eIVhYhk/s640/deploy3.JPG&quot; title=&quot;tomcat-users.xml&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;tomcat_users.xml&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Start the tomcat server by executing startup.bat file present at bin folder of apache-tomcat.Open
the Apache Manager by clicking &lt;a href=&quot;http://localhost:8080/&quot;&gt;http://localhost:8080&lt;/a&gt;&amp;nbsp;and select Tomcat Manager.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 115%;&quot;&gt;&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;display: inline !important;&quot;&gt;
&lt;div style=&quot;display: inline !important;&quot;&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;font-weight: bold; margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7yYbEMT3vfr34U8_g5oitV8Mg6Asj7nUdc8gHY7hzuMrdR6n-PuPzEnZfoEi-XJznAiSfeFEO6l5saJ8BD-anAitqvkOHocddPmgxDSyv1k2ArXC9sniN_ddenoyyiUxtAi0fQ86i4TdU/s1600/deploy4.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;http://localhost:8080/&quot; border=&quot;0&quot; height=&quot;312&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7yYbEMT3vfr34U8_g5oitV8Mg6Asj7nUdc8gHY7hzuMrdR6n-PuPzEnZfoEi-XJznAiSfeFEO6l5saJ8BD-anAitqvkOHocddPmgxDSyv1k2ArXC9sniN_ddenoyyiUxtAi0fQ86i4TdU/s640/deploy4.JPG&quot; title=&quot;Apache tomcat manager&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Apache tomcat manager&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Enter user name and password created using
tomcat-users.xml.For our case it will be :-&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 115%;&quot;&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;display: inline !important;&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;display: inline !important;&quot;&gt;
Username = “admin”&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 115%;&quot;&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;display: inline !important;&quot;&gt;
&lt;div style=&quot;display: inline !important;&quot;&gt;
Password=”admin&quot;&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 115%;&quot;&gt;Upload WAR file as shown below.
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh50nkg54VlwKKdxfv-vCyP5c_jDoBVJzrGe2S1xaZ2BTJNZ99CyEJnZVELCoH7HO1L78yAX2FmhY9Pft7zsx_YTGI5KB6TEn1xE2SZpyQ-UqFwiJI-_TGc4mXFwonQUAcg5mogomRkKjIx/s1600/deploy6.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Add WAR file&quot; border=&quot;0&quot; height=&quot;302&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh50nkg54VlwKKdxfv-vCyP5c_jDoBVJzrGe2S1xaZ2BTJNZ99CyEJnZVELCoH7HO1L78yAX2FmhY9Pft7zsx_YTGI5KB6TEn1xE2SZpyQ-UqFwiJI-_TGc4mXFwonQUAcg5mogomRkKjIx/s640/deploy6.JPG&quot; title=&quot;Add WAR file&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add WAR file&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;Deployment on Tomcat startup&lt;/b&gt;&lt;/span&gt;&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;The location you deploy web applications to for this type of deployment is called the&amp;nbsp;&lt;code&gt;appBase&lt;/code&gt;&amp;nbsp;which is specified per Host. Copy the WAR file to be deployed to appBase location.(default appBase is &quot;$CATALINA_BASE/webapps&quot;).This method will work only if&amp;nbsp;Host&#39;s&amp;nbsp;&lt;code&gt;deployOnStartup&lt;/code&gt;&amp;nbsp;attribute is &quot;true&quot;.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Calibri, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Calibri, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Calibri, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Calibri, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://adityangoyal.blogspot.com/feeds/96821624533195778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://adityangoyal.blogspot.com/2012/10/deployment-in-tomcat-apache-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/96821624533195778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/96821624533195778'/><link rel='alternate' type='text/html' href='http://adityangoyal.blogspot.com/2012/10/deployment-in-tomcat-apache-server.html' title='Deployment in Tomcat Apache Server'/><author><name>Aditya Goyal</name><uri>http://www.blogger.com/profile/06314586793374570427</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVzkkcdRCFN90-Ws96mUCl7t8CooADL5gjz5VVUy_USe7QWidMptXkza-i-5YZZq4_q8GF8uGO4na9QH2I7uSKeVyLy3eAoTyPMA6k9GfZIhr3QtH8H_OQ-RcRYb1Ru7w/s150/IMG_1203.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1G0uD5aJHkFRrNZs2kTvMn13r3BdtrXwdd9H0cnyhpRj8hTIHS4HmsL2n2mkZuGc-ZerO3lRuXedFXcp8J8RxF66Zjpyts0qAF-I3xNEO6yxpfYzhWL1BqjAwOYgn977DYdHtmRnH00Hd/s72-c/deploy2.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4864125858165953220.post-2590495646036190494</id><published>2012-06-30T12:37:00.000+05:30</published><updated>2012-06-30T16:05:13.939+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Creating new profile in WAS Server"/><category scheme="http://www.blogger.com/atom/ns#" term="SCA Support in WAS"/><category scheme="http://www.blogger.com/atom/ns#" term="WAS Configuration for eclipse"/><title type='text'>Creating new Profile in WAS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;div style=&quot;text-align: left; text-indent: -24px;&quot;&gt;
&lt;div align=&quot;center&quot; style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;w:sdt docpart=&quot;F741F0A32101445B879E2F6BB4D42178&quot; id=&quot;8276291&quot; prefixmappings=&quot;xmlns:ns0=&#39;http://schemas.microsoft.com/office/2006/coverPageProps&#39;&quot; storeitemid=&quot;X_55AF091B-3C7A-41E3-B477-F2FDAA23CFDA&quot; text=&quot;t&quot; title=&quot;Abstract&quot; xpath=&quot;/ns0:CoverPageProperties[1]/ns0:Abstract[1]&quot;&gt;
    &lt;/w:sdt&gt;&lt;br /&gt;
&lt;table align=&quot;left&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; margin-left: 7.1pt; margin-right: 7.1pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-table-anchor-horizontal: margin; mso-table-anchor-vertical: margin; mso-table-left: center; mso-table-lspace: 9.35pt; mso-table-rspace: 9.35pt; mso-table-top: bottom; mso-yfti-tbllook: 1184; width: 100.0%;&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
   &lt;td style=&quot;padding: 0in 5.4pt 0in 5.4pt; width: 100.0%;&quot; valign=&quot;top&quot; width=&quot;100%&quot;&gt;&lt;div class=&quot;MsoNoSpacing&quot;&gt;
Creating
    and configuring Profile in WAS server with SCA Support&lt;w:sdtpr&gt;&lt;/w:sdtpr&gt;&lt;/div&gt;
&lt;/td&gt;
   
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;b&gt;&lt;span style=&quot;font-family: Calibri, sans-serif; font-size: 12pt; line-height: 115%;&quot;&gt;&lt;br clear=&quot;all&quot; style=&quot;mso-special-character: line-break; page-break-before: always;&quot; /&gt;
 &lt;/span&gt;&lt;/b&gt;

&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;mso-list: l0 level1 lfo1; mso-outline-level: 1; text-indent: -.25in;&quot;&gt;
&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: 12pt; line-height: 115%; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;First go to windows -&amp;gt; preferences&lt;/span&gt;&lt;/li&gt;
&lt;br /&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: 12pt; line-height: 18px; text-align: left; text-indent: -0.25in;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi75Y8umcYkH-Xi1fCK71uv17kVXZbdwahpaythPNV4mXUu73usA2PkA7h7fgTInEUZsKh7AjpzsI9-uH5mxXzpe6swyN6sTxTPb1LRdFyxHAO440xA638hJWZMPQL32NuB5t5TewF74CjE/s1600/1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;512&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi75Y8umcYkH-Xi1fCK71uv17kVXZbdwahpaythPNV4mXUu73usA2PkA7h7fgTInEUZsKh7AjpzsI9-uH5mxXzpe6swyN6sTxTPb1LRdFyxHAO440xA638hJWZMPQL32NuB5t5TewF74CjE/s640/1.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;

&lt;li&gt;&lt;span style=&quot;font-size: 12pt; line-height: 115%; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;Then Click on Server -&amp;gt; WebSphere Application Server&lt;/span&gt;&lt;/li&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;text-align: left; text-indent: -0.25in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;mso-list: l0 level1 lfo1; mso-outline-level: 1; text-indent: -.25in;&quot;&gt;
&lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzRhk5XMAk1ak8eUN4Nvp7ZoymgcWV4lflvz5YBwqWltM60znH-dMdiaDHulfPYsFPUy7VEtYKEx4fPGwFtQvTreabupdwZfK6Pw-Qv6VY1DcYnd5-0-ABOeTSTyuebT2aKRVUJoCTYV8R/s1600/2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;513&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzRhk5XMAk1ak8eUN4Nvp7ZoymgcWV4lflvz5YBwqWltM60znH-dMdiaDHulfPYsFPUy7VEtYKEx4fPGwFtQvTreabupdwZfK6Pw-Qv6VY1DcYnd5-0-ABOeTSTyuebT2aKRVUJoCTYV8R/s640/2.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;

&lt;li&gt;&lt;span style=&quot;font-size: 12pt; line-height: 115%; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;Click on Run Profile Management Tool and select yes in the pop up box.You will get this window(If they above process doesn’t work,then go to C:\Program Files(x86)\IBM\SDP\runtimes\base_v7\bin\ProfileManagement and click on pmt.bat)&lt;/span&gt;&lt;/li&gt;
&lt;br /&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQay08mv7k-k3ooVxQF6xtZamiAeyAgoKy13ILPZ2T3pEX0u1IIrVPc1nI4QvkYRF05pqKuPl0elwbnAl1j5HfiUmGhsrzVVKcMRYElwW4Y5mdZ7esCnVSUZjYvUJHPUwDYut8iDf6dm0E/s1600/3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;512&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQay08mv7k-k3ooVxQF6xtZamiAeyAgoKy13ILPZ2T3pEX0u1IIrVPc1nI4QvkYRF05pqKuPl0elwbnAl1j5HfiUmGhsrzVVKcMRYElwW4Y5mdZ7esCnVSUZjYvUJHPUwDYut8iDf6dm0E/s640/3.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br/&gt;

&lt;li&gt;&lt;span style=&quot;font-size: 12pt; line-height: 115%; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;Click on Launch Profile Management Tool. You will get the window shown below.&lt;/span&gt;&lt;/li&gt;
&lt;br /&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHhrHI1V-sXoUBfJlUn7wx8e7AGYT_X8QJP50bsqmUvo3dl7uyL9NbThhkkpcmwh4KXwiU5hS3T-bUl2sRiJASzJdl69HKl0bg4dtQYr2EKuUQWGpA97yoc7gEOi6taGS3tSg60l6qiX14/s1600/4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;512&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHhrHI1V-sXoUBfJlUn7wx8e7AGYT_X8QJP50bsqmUvo3dl7uyL9NbThhkkpcmwh4KXwiU5hS3T-bUl2sRiJASzJdl69HKl0bg4dtQYr2EKuUQWGpA97yoc7gEOi6taGS3tSg60l6qiX14/s640/4.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;

&lt;li&gt;&lt;span style=&quot;font-size: 12pt; line-height: 115%; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;Click
on Create and Select Application Server and click on next.Again click on next.&lt;/span&gt;&lt;/li&gt;

&lt;li&gt;&lt;span style=&quot;font-size: 12pt; line-height: 115%; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;Uncheck
the Enable Administrative Security(IF U DON&#39;T WANT LOGIN USERNAME AND PASSWORD) and click on next.&lt;/span&gt;&lt;/li&gt;
&lt;br/&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq_WHzjyaG4mOYUashy9yZCrt7IEiQ_lGYCmkfqEehxHpA0m4La3IBEawpC3CATNOBweM086xhF1xC6Y1bEoCGv8J6lrragHnWqsPdAHIpSreBKssHYqN8AOb8UVYEtn0xfegVCtTZ0m3S/s1600/5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;512&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq_WHzjyaG4mOYUashy9yZCrt7IEiQ_lGYCmkfqEehxHpA0m4La3IBEawpC3CATNOBweM086xhF1xC6Y1bEoCGv8J6lrragHnWqsPdAHIpSreBKssHYqN8AOb8UVYEtn0xfegVCtTZ0m3S/s640/5.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;

&lt;li&gt;&lt;span style=&quot;font-size: 12pt; line-height: 115%; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;Click on create -&amp;gt; Finish and the new profile with AppSrv02 is created.&lt;/span&gt;&lt;/li&gt;

&lt;li&gt;&lt;span style=&quot;font-size: 12pt; line-height: 115%; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;Select the newly created profile and click on Augment&amp;nbsp;&lt;/span&gt;
&lt;/li&gt;&lt;/br&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnBoAsdcruAUWmCAakTAD76o_mRPAuH6WG6Bs00MYWkTRpNWFuDgr96DGtcYNJYc-X28NknICRs-tYysE4R72w-L4JVG9natoNsjToNEwbTC7uM_AMymsweGa0yxKeUztlNjMfgnZQKW95/s1600/6.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center; text-indent: -0.25in;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;512&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnBoAsdcruAUWmCAakTAD76o_mRPAuH6WG6Bs00MYWkTRpNWFuDgr96DGtcYNJYc-X28NknICRs-tYysE4R72w-L4JVG9natoNsjToNEwbTC7uM_AMymsweGa0yxKeUztlNjMfgnZQKW95/s640/6.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;/div&gt;

&lt;li&gt;&lt;span style=&quot;font-size: 12pt; line-height: 115%; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;Add
one by one all augments (Application Server with Feature Pack SCA must be
included otherwise it won’t support SCA)&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1TV54FsOEAt11cYrE39fSeGieppXSAvQTjf3D6GOU84kzBp1KDdLH0-nIysRiuHE9GrWxT8uXkFlEcS4tEv191WUGxt6WlFZs1BP4yaql2HD544O6IcYX6m8ol1QIcKYbiGEWbLrYRCym/s1600/7.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;512&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1TV54FsOEAt11cYrE39fSeGieppXSAvQTjf3D6GOU84kzBp1KDdLH0-nIysRiuHE9GrWxT8uXkFlEcS4tEv191WUGxt6WlFZs1BP4yaql2HD544O6IcYX6m8ol1QIcKYbiGEWbLrYRCym/s640/7.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
If you have any other problem in configuring WAS,feel free to ask or mail me @ &lt;a href=&quot;mailto:adiadidas9000@gmail.com&quot;&gt;adiadidas9000[at]gmail.com&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot;&gt;
&lt;br /&gt;&lt;/div&gt;

&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adityangoyal.blogspot.com/feeds/2590495646036190494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://adityangoyal.blogspot.com/2012/06/creating-new-profile-in-was.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/2590495646036190494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/2590495646036190494'/><link rel='alternate' type='text/html' href='http://adityangoyal.blogspot.com/2012/06/creating-new-profile-in-was.html' title='Creating new Profile in WAS'/><author><name>Aditya Goyal</name><uri>http://www.blogger.com/profile/06314586793374570427</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVzkkcdRCFN90-Ws96mUCl7t8CooADL5gjz5VVUy_USe7QWidMptXkza-i-5YZZq4_q8GF8uGO4na9QH2I7uSKeVyLy3eAoTyPMA6k9GfZIhr3QtH8H_OQ-RcRYb1Ru7w/s150/IMG_1203.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi75Y8umcYkH-Xi1fCK71uv17kVXZbdwahpaythPNV4mXUu73usA2PkA7h7fgTInEUZsKh7AjpzsI9-uH5mxXzpe6swyN6sTxTPb1LRdFyxHAO440xA638hJWZMPQL32NuB5t5TewF74CjE/s72-c/1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4864125858165953220.post-7963183738941183401</id><published>2012-06-03T09:40:00.001+05:30</published><updated>2013-02-23T10:41:11.403+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="creating vlc media player plugin for gtalk"/><category scheme="http://www.blogger.com/atom/ns#" term="current soundtrack as ur gtalk status using java"/><category scheme="http://www.blogger.com/atom/ns#" term="DOS tricks for Java"/><category scheme="http://www.blogger.com/atom/ns#" term="tasklist command in Java"/><title type='text'>DOS Tricks in JAVA</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;h2&gt;






&lt;/h2&gt;
&lt;/div&gt;
One of the most important DOS command is tasklist command.We can&amp;nbsp;perceive&amp;nbsp;this command in many ways.&lt;br /&gt;
&lt;br /&gt;
&quot;tasklist&quot; is a DOS command that displays the running processes in the Windows OS.It displays all the applications and services running with their PID(process ID).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Syntax&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
tasklist[.exe] [/s computer] [/u domain\user [/p password]] [/fo {TABLE|LIST|CSV}] [/nh] [/fi FilterName [/fi FilterName2 [ ... ]]] [/m [ModuleName] | /svc | /v]&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;table cellpadding=&quot;5&quot; cellspacing=&quot;1&quot; class=&quot;mtable&quot; style=&quot;background-color: #dbdbdb; border: 0px solid silver; clear: both; color: #333333; font-family: verdana, arial;&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;tcb wt&quot; style=&quot;background-color: #005cb9; background-image: url(http://cdn.computerhope.com/backbar.jpg); background-position: 0% 0%; background-repeat: repeat no-repeat; color: white; font-weight: 700;&quot;&gt;&lt;th&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Parameters&lt;/span&gt;&lt;/th&gt;&lt;th&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Uses&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;/S system&lt;/span&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Specifies the remote system to connect to.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;/U [domain\]user&lt;/span&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Specifies the user context under which the command should execute.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;/P [password]&lt;/span&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Specifies the password for the given user context. Prompts for input if omitted.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;/M [module]&lt;/span&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Lists all tasks currently using the given exe/dll name. If the module name is not specified all loaded modules are displayed.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;/SVC&lt;/span&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Displays services hosted in each process.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;/V&lt;/span&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Displays verbose task information.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;/FI filter&lt;/span&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Displays a set of tasks that match a given criteria specified by the filter.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;/FO format&lt;/span&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Specifies the output format. Valid values: &quot;TABLE&quot;, &quot;LIST&quot;, &quot;CSV&quot;.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;/NH&lt;/span&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Specifies that the &quot;Column Header&quot; should not be displayed in the output. Valid only for &quot;TABLE&quot; and &quot;CSV&quot; formats.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div color:=&quot;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Filters&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;table cellpadding=&quot;5&quot; cellspacing=&quot;1&quot; class=&quot;mtable&quot; style=&quot;background-color: #dbdbdb; border: 0px solid silver; clear: both; color: #333333;&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;tcb wt&quot; style=&quot;background-color: #005cb9; background-image: url(http://cdn.computerhope.com/backbar.jpg); background-position: 0% 0%; background-repeat: repeat no-repeat; color: white; font-weight: 700;&quot;&gt;&lt;th&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Filter Name&lt;/span&gt;&lt;/th&gt;&lt;th&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Valid Operators&lt;/span&gt;&lt;/th&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Valid values&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;STATUS&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;eq, ne&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;RUNNING | NOT RESPONDING | UNKNOWN&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;IMAGENAME&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;eq, ne&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Image name&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td&gt;&lt;a href=&quot;http://www.computerhope.com/jargon/p/pid.htm&quot; style=&quot;color: #005177;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;PID&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;eq, ne, gt, lt, ge, le&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;PID value&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;SESSION&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;eq, ne, gt, lt, ge, le&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Session number&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;SESSIONNAME&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;eq, ne&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Session name&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;CPUTIME&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;eq, ne, gt, lt, ge, le&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;CPU time in the format of hh:mm:ss.&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;hh - hours,&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;mm - minutes&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;ss - seconds&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;MEMUSAGE&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;eq, ne, gt, lt, ge, le&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Memory usage in KB&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;USERNAME&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;eq, ne&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;User name in [domain\]user format&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;SERVICES&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;eq, ne&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Service name&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;WINDOWTITLE&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;eq, ne&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;Window title&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;tcw&quot; style=&quot;background-color: white;&quot;&gt;&lt;td&gt;&lt;h4&gt;
















&lt;span style=&quot;font-family: inherit; font-size: x-small; font-weight: normal;&quot;&gt;MODULES&lt;/span&gt;&lt;/h4&gt;
&lt;/td&gt;&lt;td&gt;&lt;h4&gt;
















&lt;span style=&quot;font-family: inherit; font-size: x-small; font-weight: normal;&quot;&gt;eq, ne&lt;/span&gt;&lt;/h4&gt;
&lt;/td&gt;&lt;td&gt;&lt;h4&gt;
















&lt;span style=&quot;font-family: inherit; font-size: x-small; font-weight: normal;&quot;&gt;DLL name&lt;/span&gt;&lt;/h4&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now let us see how we can make utilization of this command with the help of some examples:-&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&amp;nbsp;tasklist /s Computer&lt;/li&gt;
&lt;/ul&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguCvB2hT-OsEsR-G9Q6xAdF3aUn9_D6Ku_i-ce607GE-_r-mZDYjX5Z556ZLLS3RcE089xy48m9ZW7cX4YzO9W_eij_tEFp91HsQIouFWYDvEaG3Dn7E1ncQoXb0ntbWICcejaNArxfwnC/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;tasklist /s&quot; border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguCvB2hT-OsEsR-G9Q6xAdF3aUn9_D6Ku_i-ce607GE-_r-mZDYjX5Z556ZLLS3RcE089xy48m9ZW7cX4YzO9W_eij_tEFp91HsQIouFWYDvEaG3Dn7E1ncQoXb0ntbWICcejaNArxfwnC/s640/Capture.PNG&quot; title=&quot;tasklist /s&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Process info of local/remote System&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;tasklist -v&lt;/li&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;tasklist -fi&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIKh5c9H0inJ956u3Jf7-TTItW86TwzRftzhh6x7x7tTcJu5QjV2Vz7TKJcY3_T-FRXpsPtFDBCjDXSl3FvhbXlmzjZjN21YrriUoLySoPpIUAYCGwqmYT0YoJMpZzRSCihuDnW1FekNlE/s1600/tasklist1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;tasklist -fi&quot; border=&quot;0&quot; height=&quot;416&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIKh5c9H0inJ956u3Jf7-TTItW86TwzRftzhh6x7x7tTcJu5QjV2Vz7TKJcY3_T-FRXpsPtFDBCjDXSl3FvhbXlmzjZjN21YrriUoLySoPpIUAYCGwqmYT0YoJMpZzRSCihuDnW1FekNlE/s640/tasklist1.JPG&quot; title=&quot;tasklist -fi&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;font-size: 13px;&quot;&gt;Filter Result of tasklist&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;tasklist -v -fi &quot;ImageName eq VLC.exe&quot; /fo csv&lt;/li&gt;
&lt;/ul&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdbQeuuvNxHfpL5l84DibNfn1w8pAdHUqYA6Dd_tbPwsrQNlr1a50Ac-u5XUr6z860q0qtEut5WaL4NvtCy0arRI_M8Rp66uqKQVl4m9SDRL8X_kEqgX2_M_U1TGX5D_T24eSOkwjCSD8p/s1600/tasklist2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;352&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdbQeuuvNxHfpL5l84DibNfn1w8pAdHUqYA6Dd_tbPwsrQNlr1a50Ac-u5XUr6z860q0qtEut5WaL4NvtCy0arRI_M8Rp66uqKQVl4m9SDRL8X_kEqgX2_M_U1TGX5D_T24eSOkwjCSD8p/s640/tasklist2.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;To get VLC Windows Title&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;b&gt;CODE SNIPPET to get current sound Track name in VLC
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: white;&quot;&gt;&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #999999;&quot;&gt;public String CallMe()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; Runtime runtime = Runtime.getRuntime();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String cmds[] = {&quot;cmd&quot;, &quot;/c&quot;, &quot;tasklist&quot;,&quot;/v&quot;,&quot;/fi&quot;,&quot;ImageName eq VLC.exe&quot;,&quot;/fo&quot;,&quot;CSV&quot;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Process proc;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String val = null;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;proc = runtime.exec(cmds);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;InputStream inputstream = proc.getInputStream();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;InputStreamReader inputstreamreader = new InputStreamReader(inputstream);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BufferedReader bufferedreader = new BufferedReader(inputstreamreader);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String line;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int count = 0;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;while ((line = bufferedreader.readLine()) != null) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp;if(count==1)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp;String[] a = line.split(&quot;,&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;val = a[9];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp;count++;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (IOException e) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;e.printStackTrace();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return val;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
This can be used to set curent soundtrack as your GTalk status by using SMACK api to communicate with GOOGLE.&lt;br /&gt;
This will be explained in more depth in my next Blog.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://adityangoyal.blogspot.com/feeds/7963183738941183401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://adityangoyal.blogspot.com/2012/06/dos-tricks-in-java-one-of-most.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/7963183738941183401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/7963183738941183401'/><link rel='alternate' type='text/html' href='http://adityangoyal.blogspot.com/2012/06/dos-tricks-in-java-one-of-most.html' title='DOS Tricks in JAVA'/><author><name>Aditya Goyal</name><uri>http://www.blogger.com/profile/06314586793374570427</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVzkkcdRCFN90-Ws96mUCl7t8CooADL5gjz5VVUy_USe7QWidMptXkza-i-5YZZq4_q8GF8uGO4na9QH2I7uSKeVyLy3eAoTyPMA6k9GfZIhr3QtH8H_OQ-RcRYb1Ru7w/s150/IMG_1203.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguCvB2hT-OsEsR-G9Q6xAdF3aUn9_D6Ku_i-ce607GE-_r-mZDYjX5Z556ZLLS3RcE089xy48m9ZW7cX4YzO9W_eij_tEFp91HsQIouFWYDvEaG3Dn7E1ncQoXb0ntbWICcejaNArxfwnC/s72-c/Capture.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4864125858165953220.post-1001500523908968217</id><published>2012-04-15T12:30:00.001+05:30</published><updated>2012-10-31T20:37:04.774+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="3 Sum Problem"/><category scheme="http://www.blogger.com/atom/ns#" term="Three Sum Problem"/><title type='text'>Three Sum Problem</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
A three sum problem is one in which sum of 3 numbers from a given inter array is zero.Find all pairs from the given array of n size along with the algorithm complexity.&lt;br /&gt;
&lt;div&gt;
A[i]+A[j]+A[k]=0&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Approach&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
1) Sort the array&lt;/div&gt;
&lt;div&gt;
2) Loop i from 1 to n.&lt;/div&gt;
&lt;div&gt;
3)Initialize j to i and k to n-1&lt;/div&gt;
&lt;div&gt;
4)while k&amp;gt;j:do&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;sum = a[i]+a[j]+a[k]&lt;/li&gt;
&lt;li&gt;if sum greater than zero increment j&lt;/li&gt;
&lt;li&gt;else decrement k&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;Complexity :-O(n&lt;sup&gt;2&lt;/sup&gt;)&lt;br /&gt;
&lt;br /&gt;
For Eg:-&lt;br /&gt;
In JAVA,&lt;br /&gt;
The source code for ThreeSum problem will be:-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot;  cellpadding=&quot;10&quot;&gt;
&lt;tr&gt;&lt;td&gt;
package com.collection.collection_ex;&lt;br /&gt;
&lt;br /&gt;
import java.util.ArrayList;&lt;br /&gt;
import java.util.Arrays;&lt;br /&gt;
import java.util.Collections;&lt;br /&gt;
import java.util.HashSet;&lt;br /&gt;
import java.util.Set;&lt;br /&gt;
&lt;br /&gt;
public class ThreeSum {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;static Set&amp;lt;ArrayList&amp;lt;Integer&amp;gt;&amp;gt; l=new HashSet&amp;lt;ArrayList&amp;lt;Integer&amp;gt;&amp;gt;();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static void main(String args[])&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; int[] array = {2,7,6,-7,0,8,-3,-5,-1,7,-7,14};&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(threeSum(array));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(threeSum(array).size());&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static Set&amp;lt;ArrayList&amp;lt;Integer&amp;gt;&amp;gt; threeSum(int[] array) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;if(array == null) return null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;int n = array.length;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;if(n &amp;lt; 3) return null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;Arrays.sort(array);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;int count = 0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;for(int i = 0; i &amp;lt; n - 1; i++) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int j = i ;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int k = n - 1;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while(k &amp;gt;j) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;count++;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int sum = array[i] + array[j] + array[k];&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(sum == 0)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; ArrayList&amp;lt;Integer&amp;gt; s = new ArrayList&amp;lt;Integer&amp;gt;();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;s.add(array[i]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;s.add(array[j]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;s.add(array[k]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Collections.sort(s);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;l.add(s);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(sum &amp;lt; 0) j++; else k--;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;return l;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adityangoyal.blogspot.com/feeds/1001500523908968217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://adityangoyal.blogspot.com/2012/04/three-sum-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/1001500523908968217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4864125858165953220/posts/default/1001500523908968217'/><link rel='alternate' type='text/html' href='http://adityangoyal.blogspot.com/2012/04/three-sum-problem.html' title='Three Sum Problem'/><author><name>Aditya Goyal</name><uri>http://www.blogger.com/profile/06314586793374570427</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVzkkcdRCFN90-Ws96mUCl7t8CooADL5gjz5VVUy_USe7QWidMptXkza-i-5YZZq4_q8GF8uGO4na9QH2I7uSKeVyLy3eAoTyPMA6k9GfZIhr3QtH8H_OQ-RcRYb1Ru7w/s150/IMG_1203.JPG'/></author><thr:total>0</thr:total></entry></feed>