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
private String name; | |
private String surname; | |
private Integer age; | |
@Override | |
public boolean equals(Object o) { | |
if (this == o) return true; | |
if (o == null || getClass() != o.getClass()) return false; | |
Test test = (Test) 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
package pl.project13; | |
import java.util.Objects; | |
/** | |
* Date: 4/19/11 | |
* | |
* @author Konrad Malawski | |
*/ | |
public class Test { |
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 mypackage; | |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.net.InetAddress; | |
import java.net.ServerSocket; | |
import java.net.Socket; | |
import org.mortbay.jetty.Connector; | |
import org.mortbay.jetty.Server; | |
import org.mortbay.jetty.bio.SocketConnector; |
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
<!-- | |
## @noparams | |
#requireResource("confluence.web.resources:jquery") | |
--> | |
<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
var formatXml = this.formatXml = function (xml) { | |
var reg = /(>)(<)(\/*)/g; |
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 query = ScalasticSearch.boolQuery( | |
cond ( | |
must( | |
'nickname -> "Superman", // is equivalent to... | |
term('nickname -> "Superman"), // this | |
term("nickname" -> "Superman") // or this | |
), | |
should( | |
'nickname -> "Superman", // is equivalent to... | |
term('nickname -> "Superman"), // this |
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
// in onCreate of your Activity | |
phone.number.addListener({ myNumberText := phone.number.get() }, executor) |
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
object ShowcardImageUploadHandler extends RestHelper with Logger { | |
val uploadUrl = "upload-showcard" | |
lazy val roviImageTagShowUpdater = new RoviImageTagShowUpdater(new YapProgramMasterDetector) | |
lazy val persister = new ShowcardProcessor(LiftedConfig.is, LiftedConfig.is.roviAssetsAwsBucket, roviImageTagShowUpdater) | |
serve { | |
case ShowcardImageUploadHandler.uploadUrl :: Nil Post req => { |
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
@Path("/uptime") | |
@Produces(Array("application/json")) | |
class UtilService { | |
@GET | |
def getUptime(): Long = { | |
println("getUptime") | |
(new Date().getTime - UtilService.startDate.getTime)/1000 | |
} |
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
Person where(_.age > 18) foreach { p => /*...*/ } |
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
class Meter(val n: Int) extends AnyVal | |
def traveled(m: Meter) = | |
s"You traveled ${m.n} meters!" | |
val meters = new Meter(34) | |
traveled(meters) should equal ("You traveled 20 meters!") |