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
val xs = List.fill(100)("X") | |
var count = 0 | |
xs.maxBy { x => | |
{ | |
count += 1 | |
x.length() | |
} | |
} //> res0: String = X |
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 check(v) { | |
var out = {} | |
out.value = v | |
if (v) { | |
out.ifCheck = true | |
} else { | |
out.ifCheck = false | |
} |
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
// Groovy script to rename TV series media files and subtitles | |
// so that the subtitles picket automatically by the media player. | |
import groovy.io.FileType | |
import java.nio.file.Path | |
import java.nio.file.Paths | |
import java.util.regex.Pattern | |
def pattern = ~/[s|S](\d{2})?[e|E](\d{2})?.*\.(.*)?/ |
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
$('.teams li').map(function(){ | |
var that = $(this); | |
var o = {}; | |
['name', 'job-title', 'location'].forEach(function(e){ | |
o[e] = that.find('.' + e).text(); | |
}); | |
console.log(o); | |
}); |
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 static void main(String[] args) { | |
System.out.println(getEmployeeNames(simulateWsResult1())); | |
System.out.println(getEmployeeNames(simulateWsResult2())); | |
System.out.println(getEmployeeNames(simulateWsResult3())); | |
System.out.println(getEmployeeNames(simulateWsResult4())); | |
} | |
static class Result { |
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 test; | |
import java.util.List; | |
import java.util.Map; | |
import javax.persistence.Entity; | |
import javax.persistence.GeneratedValue; | |
import javax.persistence.GenerationType; | |
import javax.persistence.Id; | |
import javax.persistence.Table; |
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
<!DOCTYPE html> | |
<!-- http://gmaps-samples-v3.googlecode.com/svn/trunk/drawing/drawing-tools.html --> | |
<!-- https://developers.google.com/maps/documentation/javascript/examples/places-searchbox --> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> | |
<meta charset="UTF-8"> | |
<title>Drawing Tools (B)</title> | |
<!-- NOTE: two libraries to load are comma-separated; otherwise last mention of the query string arg overwrites the previous --> | |
<script type="text/javascript" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<MPD | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="urn:mpeg:dash:schema:mpd:2011" | |
xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" | |
xmlns:cenc="urn:mpeg:cenc:2013" | |
xmlns:mas="urn:marlin:mas:1-0:services:schemas:mpd" | |
xmlns:drm="http://example.net/052011/drm" | |
type="static" | |
mediaPresentationDuration="PT1H26M45.269334S" |
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
// The domain Object | |
public class Employee | |
{ | |
string firstName; | |
string lastName; | |
} | |
// The Business Layer |
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
import java.util.Optional; | |
import java.util.function.Function; | |
import java.util.function.Predicate; | |
import java.util.stream.Stream; | |
public class Test { | |
public static void main(String[] args) { | |
Request request = new Request(600, "Abbas"); |