Skip to content

Instantly share code, notes, and snippets.

View dstarcev's full-sized avatar

Dmitriy Startsev dstarcev

View GitHub Profile
peer.discovery = {
# if peer discovery is off
# the peer window will show
# only what retrieved by active
# peer [true/false]
enabled = true
# number of workers that
{
"nonce": "0x0000000000000042",
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"difficulty": "0x004",
"alloc": {
"0xdc6de66342a74c3bb5483dab98958cfd1d5d2dde": {
"balance": "100000000000000000000000000000"
},
"0x908cfe80cfeadf9831bce22f3bc8ba061c94c3d9": {
"balance": "100000000000000000000000000000"
peer.discovery = {
# if peer discovery is off
# the peer window will show
# only what retrieved by active
# peer [true/false]
enabled = false
# number of workers that
/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/java -ea -Didea.launcher.port=7535 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 2016.3 EAP.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA 2016.3 EAP.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA 2016.3 EAP.app/Contents/plugins/junit/lib/junit-rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92
import be.vergauwen.simon.mockito1_kotlin.any
import be.vergauwen.simon.mockito1_kotlin.doNothing
import be.vergauwen.simon.mockito1_kotlin.spy
import be.vergauwen.simon.mockito1_kotlin.whenever
import org.junit.Test
class KotlinMockitoTest {
@Test
fun test() {
val spy = spy<TestInterface>(TestClass())
@dstarcev
dstarcev / KotlinJacksonBug.kt
Created October 26, 2016 11:05
Jasckson with Kotlin module fails to deserialize an object with 32 properties. Last property is ignored.
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import org.junit.Assert
import org.junit.Test
class KotlinJacksonBug {
@Test fun `map 32 properties`(){
// given
val json = """{"prop1":true,"prop2":true,"prop3":true,"prop4":true,"prop5":true,"prop6":true,"prop7":true,"prop8":true,"prop9":true,"prop10":true,"prop11":true,"prop12":true,"prop13":true,"prop14":true,"prop15":true,"prop16":true,"prop17":true,"prop18":true,"prop19":true,"prop20":true,"prop21":true,"prop22":true,"prop23":true,"prop24":true,"prop25":true,"prop26":true,"prop27":true,"prop28":true,"prop29":true,"prop30":true,"prop31":true,"prop32":true}"""
val mapper = jacksonObjectMapper()
Dmitriys-MBP:~ dstarcev$ docker version
Client:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:04:48 2016
OS/Arch: darwin/amd64
Experimental: true
<?php
namespace App;
require_once "Solution.php";
class SolutionTest extends \PHPUnit_Framework_TestCase
{
/**
* @dataProvider additionProvider
def sum_str(left, right):
if left == '': return right
elif right == '': return left
char_sum_str = sum_char(left[-1], right[-1])
rest_sum_str = sum_str(left[:-1], right[:-1]).strip('0')
if len(char_sum_str) == 1:
return rest_sum_str + char_sum_str
[Serializable]
public class UpdateUserName : ICommand {
public UpdateUserName(long userId, string name) {
Contract.Requires(name != null);
UserId = userId;
Name = name;
}
public long UserId { get; }