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
conn.executemany('insert into houses (field1, sqft, bdrms, age, price) values (?, ?, ?, ?, ?)', field1, sqft, bdrms, age, price) |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.spekframework</groupId> | |
<artifactId>kotlin-spek-maven</artifactId> | |
<packaging>jar</packaging> | |
<version>1.0-SNAPSHOT</version> | |
<name>Sample kotlin tests</name> | |
<url>http://github.com/spekframework/kotlin-spek-maven</url> |
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 org.jetbrains.spek.api.dsl.describe | |
import org.jetbrains.spek.api.dsl.given | |
import org.jetbrains.spek.api.dsl.it | |
import org.jetbrains.spek.api.dsl.on | |
import org.jetbrains.spek.subject.SubjectSpek | |
import org.jetbrains.spek.subject.itBehavesLike | |
import org.junit.Assert.assertFalse | |
import org.junit.Assert.assertTrue | |
interface Collaborator: () -> Unit { |
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
bucket: Map<Bits, IntArray> = ... | |
fun getEntities(aspect: Aspect): IntArray { | |
var result = HashMap<Bits, IntArray>() | |
// 1st pass, "allOf" | |
if (aspect.required == Bits.ZERO) { | |
result.addAll(bucket) | |
} else { | |
bucket.forEach { (bits, entities) -> |
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
#include <iostream> | |
#include <conio.h> | |
using namespace std; | |
void main() { | |
// letters[0] => 'A' ... letters[25] => 'Z' | |
int letters[26]; | |
bool lettersIsDisplayed[26]; | |
// numbers[0] => 0 .. numbers[9] => 9 | |
int numbers[10]; |
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
Toolkit xToolkit = Toolkit.getDefaultToolkit(); | |
java.lang.reflect.Field awtAppClassNameField = | |
xToolkit.getClass().getDeclaredField("awtAppClassName"); | |
awtAppClassNameField.setAccessible(true); | |
awtAppClassNameField.set(xToolkit, applicationName) |
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
#bs { | |
.bootstrap() { | |
@import "bootstrap.less"; | |
} | |
} |
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 Foo { | |
private Bar bar; | |
public Foo() { | |
// call to new omitted | |
} | |
} | |
public class Bar { | |
private int 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
public class Foo { | |
private Bar bar; | |
public Foo() { | |
bar = new Bar(1, 2); | |
} | |
} | |
public class Bar { | |
private int x; |