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
// This is a class that attempts to stop you accessing variables outside a lock. | |
// | |
// It does not do a perfect job, but can catch some common kinds of mistake, in | |
// particular when you accidentally try to work with objects inside closures that | |
// end up running later, outside the locked region (or in a different thread). | |
// EXAMPLE | |
val bank = ThreadBox(object { | |
val accounts by arrayListOf(10, 0, 0, 0).guard() |
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
import static com.jayway.jsonpath.JsonPath.parse | |
def json = '''{"quote": { | |
"id": 12345, | |
"am ount": 100, | |
"links": [ | |
{ | |
"rel": "self", | |
"href": "http://localhost:8080/quote/777" | |
}, |
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
#!/usr/bin/python3 | |
# Copyright (C) 2020 Stefan Vargyas | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
OlderNewer