This file contains hidden or 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
<Human> | |
<title>Mr.</title> | |
<name>Johnny</name> | |
<coats> | |
<Coat> | |
<brand>BOSS</brand> | |
</Coat> | |
<Coat> | |
<brand xsi:nil="true"/> | |
</Coat> |
This file contains hidden or 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"?> | |
<root> | |
<heading>Hello</heading> | |
<paragraph>This is my first paragraph</paragraph> | |
<paragraph>This is my second paragraph</paragraph> | |
<heading>Hello!</heading> | |
<heading>HelloOooo!</heading> | |
<paragraph>Coolness.</paragraph> | |
</root> |
This file contains hidden or 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
@echo off | |
setlocal EnableDelayedExpansion | |
set "groupId=" | |
set "rest=%1" | |
set "f=" | |
if "%rest" == "" goto bad | |
:bang | |
for /f "tokens=1* delims=." %%p in ("%rest%") DO ( |
This file contains hidden or 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
scala> val myMap = Map("test"->"best") | |
myMap: scala.collection.mutable.Map[String,String] = Map(test -> best) | |
scala> val fn = myMap.lift | |
fn: String => Option[String] = <function1> | |
scala> (fn("test"), fn("lest")) | |
res5: (Option[String], Option[String]) = (Some(best),None) | |
scala> myMap("lest") = "zest" |
This file contains hidden or 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 packer[A](l: List[A])(f: A => Boolean): List[(A, List[A])] = { | |
if ( l.isEmpty ) List() | |
else if ( !f(l.head) ) List() | |
else { | |
val heading :: rest = l | |
val (paragraphs, nextBunch) = rest span (false == f(_)) | |
(heading, paragraphs) :: packer(nextBunch)(f) | |
} | |
} | |
case class Heading(title: String) |
This file contains hidden or 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 continuousPartitions[A](l: List[A])(f: A => Boolean): List[(List[A], List[A])] = { | |
if ( l.isEmpty ) Nil | |
else { | |
val (continuousTrue, followingPartition) = l span f | |
val (continuousFalse, nextGroup) = followingPartition span (!f(_)) | |
(continuousTrue, continuousFalse) :: continuousPartitions(nextGroup)(f) | |
} | |
} | |
val hav = continuousPartitions(List("a", "b", "a", "a", "b", "b", "a"))(_=="a") |
This file contains hidden or 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
// ==UserScript== | |
// @name NoPulses | |
// @namespace https://www.linkedin.com/ | |
// @include https://www.linkedin.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
function removeNonsense() { |
This file contains hidden or 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
http://support-sg.canon-asia.com/P/search?model=PIXMA+MG7170&menu=download&filter=0&tagname=g_os&g_os=Linux | |
also deutsch http://aram.loosman.ch/canon-pixma-mg7150-und-ubuntu-13-04/ |
This file contains hidden or 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 com.scalawilliam.examples | |
import scala.xml.Node | |
/** | |
* Add .sum and .product functionality to Scala XML nodes. | |
*/ | |
object NumericNodesExample extends App { | |
import NumericUtility._ |
This file contains hidden or 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 initialiseApp[T<:LifeCycle](port: Int) = { | |
val server = new Server(port) | |
val context = new WebAppContext() | |
context.setContextPath("/") | |
context.setResourceBase(new File(getClass.getResource("/webresources/index.html").getFile).getCanonicalFile.getParentFile.getCanonicalPath) | |
context.addEventListener(new ScalatraListener) | |
context.addServlet(classOf[DefaultServlet], "/") | |
context.setInitParameter(ScalatraListener.LifeCycleKey, classOf[ConfiguredBootstrap].getCanonicalName) | |
context.setAttribute(WebInfConfiguration.WEBINF_JAR_PATTERN, ".*\\.jar$") |
OlderNewer