This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VERSION BUILD=8881205 RECORDER=FX | |
TAB T=1 | |
URL GOTO=https://mail.google.com/mail/u/0/#inbox | |
TAG POS=1 TYPE=A ATTR=TXT:Important | |
WAIT SECONDS=30 | |
TAG POS=1 TYPE=A ATTR=TXT:SentMail | |
WAIT SECONDS=30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyClass myobject = new MyClass(); | |
CompletableFuture<Data> dataCompletableFuture1 = CompletableFuture.supplyAsync(() -> myobject.getData1()); // first Async call | |
CompletableFuture<Data> dataCompletableFuture2 = CompletableFuture.supplyAsync(() -> myobject.getData2()); // second Async call | |
CompletableFuture<Data> dataCompletableFuture3 = CompletableFuture.supplyAsync(() -> myobject.getData3()); // third Async call | |
//Now the code to combine in sequence | |
dataCompletableFuture1 | |
.thenCombine(dataCompletableFuture2, Aggregator::combine) | |
.thenCombine(dataCompletableFuture3, Aggregator::combine); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Aggregator { | |
public combine(Data data1, Data data2) { | |
//some magic for aggregating data | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyClass myobject = new MyClass(); | |
Data dataObject1 = myobject.getData1(); | |
Data dataObject2 = myobject.getData2(); | |
Data dataObject3 = myobject.getData3(); | |
Aggregator aggregator = new Aggregator(); | |
Data someDataCombined = aggregator.combine(dataObject1, dataObject2); // combines data of 2 objects | |
Data someDataCombined2 = aggregator.combine(someDataCombined, dataObject3); // combines data of 2 objects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyClass myobject = new MyClass(); | |
CompletableFuture<Data> dataCompletableFuture = CompletableFuture.supplyAsync(() -> myobject.getData()); // this is async call with supplier Lambda | |
Data dataObject = dataCompletableFuture.get(); // this is a blocking call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyClass myobject = new MyClass(); | |
Data dataObject = myobject.getData(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyClass { | |
public Data getData() { | |
// some remote processing code | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validateVin(vin) { | |
var re = new RegExp("^[A-HJ-NPR-Z\\d]{8}[\\dX][A-HJ-NPR-Z\\d]{2}\\d{6}$"); | |
return vin.match(re); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package browser.util; | |
import javax.servlet.http.HttpServletRequest; | |
import browser.util.BrowserUtil.BrowserType; | |
public class TestBrowserUtil { | |
public static void sample(HttpServletRequest request) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package browser.util; | |
public class BrowserUtil { | |
public static enum BrowserType { | |
INTERNET_EXPLORER, MOZILA_FIREFOX, SAFARI, NETSCAPE, GOOGLE_CHROME, FLOCK, UNKNOWN | |
} | |
/** | |
* Each browser sends a the user-agent field with different content | |
* |
NewerOlder