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 enum | |
import ( | |
"fmt" | |
"strings" | |
"github.com/pkg/errors" | |
) | |
type Value struct { |
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 ThymeleafBenchmark implements Benchmark { | |
private Context context; | |
private TemplateEngine engine; | |
public ThymeleafBenchmark(Collection<Todo> todos) { | |
engine = new TemplateEngine(); | |
final ClassLoaderTemplateResolver templateResolver = new ClassLoaderTemplateResolver(); | |
templateResolver.setPrefix("templating/clash/thymeleaf/"); | |
templateResolver.setCacheable(true); | |
engine.setTemplateResolver(templateResolver); |
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
It depends whether you want to implement java-like checked exceptions or not. | |
In my case, that's not a goal, i.e. I don't want to enforce what exceptions can be thrown in a method, not what exceptions can/must be caught in a catch clause. | |
I'm using a Hindley-Milner (HM) type system, and a central piece in HM type checking is unification, i.e. trying to make 2 types the same. | |
For example, when trying to type-check an if-then-else expression, the algorithm will separately analyze the types of the then and else arms, then try to unify them, so you won't end up with something like: | |
if x > 0 then 5 else "b" | |
But once you have exceptions in your type system, the unification process gets messier: |
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
* Hindley-Milner (total) type inference | |
* Parametric Polymorphism | |
* Primitive types, Tuples and Algebraic Data Types | |
* Deep/Structural pattern matching | |
* Destructuring | |
* Functions are curried by default | |
* Clutter-free syntax, and indentation-based blocs à la Python |
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 Dream { | |
public void dream(final Sleeper s) { | |
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
s.enter(new Dream() { | |
public void dream(Sleeper s) { | |
synchronized (s) { | |
s.notify(); | |
} |
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
[info] Compiling 20 Scala sources to /Users/jawher/Dropbox/coding/moulder-s/target/scala-2.9.1/classes... | |
[error] /Users/jawher/Dropbox/coding/moulder-s/src/main/scala/moulder/moulds/Repeater.scala:19: type mismatch; | |
[error] found : (A, Int) => List[org.jsoup.nodes.Node] | |
[error] required: (A, Int) => scala.collection.GenTraversableOnce[org.jsoup.nodes.Node] | |
[error] data.zip(0 until data.length).flatMap[Node, List[Node]]((item: A, index: Int) => { | |
[error] ^ |
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.io.InputStream; | |
import java.io.StringWriter; | |
import java.net.URISyntaxException; | |
import java.util.Locale; | |
import javax.xml.transform.TransformerFactory; | |
import javax.xml.transform.sax.SAXTransformerFactory; | |
import javax.xml.transform.sax.TransformerHandler; | |
import javax.xml.transform.stream.StreamResult; |
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("/test") | |
public class Resource { | |
@GET | |
@Produces("application/json") | |
public List<String> pascal() { | |
return Arrays.asList("a", "b"); | |
} | |
} |
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
Characters failed: Was expecting 'Characters' but got '</AuthorsText>' | |
((Until <AuthorsText>)) ~> (Characters) failed due to the previous error | |
(((Until <AuthorsText>)) ~> (Characters)) <~ ((Until </AuthorsText>)) failed due to the previous error | |
((((Until <AuthorsText>)) ~> (Characters)) <~ ((Until </AuthorsText>))) <~ ((((Until <PublisherText>)) ~> (Characters)) <~ ((Until </PublisherText>))) failed due to the previous error | |
(((Until <BookData>)) ~ (((((Until <Title>)) ~> (Characters)) <~ ((Until </Title>))) <~ ((((Until <TitleLong>)) ~> ([Characters])) <~ ((Until </TitleLong>))))) ~ (((((Until <AuthorsText>)) ~> (Characters)) <~ ((Until </AuthorsText>))) <~ ((((Until <PublisherText>)) ~> (Characters)) <~ ((Until </PublisherText>)))) failed due to the previous error | |
(((Until <BookData>) ~ ((((Until <Title>)) ~> (Characters)) <~ ((Until </Title>))) <~ ((((Until <TitleLong>)) ~> ([Characters])) <~ ((Until </TitleLong>))) ~ ((((Until <AuthorsText>)) ~> (Characters)) <~ ((Until </AuthorsText>))) <~ ((((Until <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
- In skype, options, Sound, uncheck the "Allow skype to adjust mixer levels" | |
- sudo apt-get install pavucontrol | |
- pavucontrol | |
- Go to the input devices tab, and set one of the channels (left/right) volume to 0 | |
- Voila ! |
NewerOlder