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 Mergesort { | |
def sort(items: List[Int], sorter: (Int, Int) => Boolean): List[Int] = { | |
if (items.length == 0) { | |
List[Int](); | |
} else if (items.length == 1) { | |
items; | |
} else { | |
merge( | |
sort(items.slice(0, items.length / 2), sorter), |
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 LoanApplication { | |
private long applicationNo; | |
private long amount; | |
private String email; | |
private String contact; | |
private boolean approved; | |
public LoanApplication() { | |
applicationNo = LoanHandler.getNextId(); |
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
def mergesort(toSort: List[Int]) : List[Int] = { | |
if(toSort.length<=1) toSort | |
else{ | |
val (left, right) = split(toSort) | |
merge(mergesort(left), mergesort(right)) | |
} | |
def split(toSplit: List[Int]): (List[Int], List[Int]) = toSplit splitAt toSplit.length/2 | |
def merge(left: List[Int], right: List[Int]):List[Int] = { | |
(left, right) match { |
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
implicit def newLocationToLocation(l: NewLocation):Location={ | |
val id:Int = 1 //sql"select s_id.nextval from dual".execute | |
new Location(id,l.name,l.serverId,s"${l.directory}/${l.regexp}",l.directory,l.quartzPattern,l.triggerBy,l.disabled,l.ftpConnectionMode,l.dataTransferMode,l.preSite,l.postSite,l.transferBy,l.wasModified,l.filterOutTransferred) | |
} |
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
... | |
scalaVersion := "2.11.4" | |
libraryDependencies ++= Seq( | |
... | |
"com.sksamuel.scrimage" %% "scrimage-core" % "1.4.1", | |
"com.sksamuel.scrimage" %% "scrimage-canvas" % "1.4.1", | |
"com.sksamuel.scrimage" %% "scrimage-filters" % "1.4.1" | |
) |
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
javascript:$('body').bind('ajaxSuccess',declutter);void(declutter());function declutter(){var rk=['java ee', 'java ee microservices', 'maven node plugin', 'maven grunt plugin', 'xml config'];$.each($('li.stream-item'), function(){var c = $(this).html(); var p = $(this); $.each(rk, function(i, v){ if(c.toLowerCase().indexOf(v) > 0){p.remove();}});});} |
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
<script id="jsbin-javascript"> | |
// object - contract/guard | |
var str = function (s) { | |
if (typeof s !== "string") { | |
throw new TypeError("Expected a string"); | |
} else { | |
return s; | |
} | |
}; |
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
var osa = require('osa'); | |
function generate_pdf(name, dir){ | |
path = Path(dir+"/"+name+".md"); | |
app = Application('Deckset'); | |
doc = app.open(path); | |
pdf = doc.slides.pdfdata; | |
app.quit(); |
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
# To build vim against homebrew Python 2.7.3. | |
# You'll also need to adjust the symbolic link of the current | |
# system Python framework (cf. http://goo.gl/b66fs): | |
# | |
# cd /System/Library/Frameworks/Python.framework/Versions | |
# sudo rm Current | |
# sudo ln -sf /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/Current Current | |
require 'formula' |
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
# Aliases for managing github issues | |
# | |
# preconditions: | |
# gem install ghi | |
# marks task as in progress | |
# creates task if it does not exist | |
# | |
# usage: | |
# ghidoing 1234 # will mark task 1234 as "in progress" |
OlderNewer