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
// This file is cloned from https://github.com/google/or-tools/blob/master/ortools/constraint_solver/samples/VrpTimeWindows.cs | |
// It is just modified to work with 7.0.6150-beta | |
// Copyright 2010-2018 Google LLC | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 |
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
from ortools.constraint_solver import pywrapcp | |
from ortools.constraint_solver import routing_enums_pb2 | |
import argparse | |
import json | |
import sys | |
is_debug = False | |
class CreateDistanceCallback(object): |
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
const MILLISECONDS_IN_A_SECOND = 1000; | |
const SECONDS_IN_A_MINUTE = 60; | |
const MINUTES_IN_AN_HOUR = 60; | |
const HOURS_IN_A_DAY = 24; | |
const DAYS_IN_A_WEEK = 7; | |
const MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE; | |
const MILLISECONDS_IN_AN_HOUR = MILLISECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR; | |
const MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_AN_HOUR * HOURS_IN_A_DAY; | |
const MILLISECONDS_IN_A_WEEK = MILLISECONDS_IN_A_DAY * DAYS_IN_A_WEEK; |
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
pragma solidity ^0.5.0; | |
contract C1 { | |
uint public num; | |
address public sender; | |
function callSetNum(address c2, uint _num) public { | |
(bool res,) = c2.call(abi.encodePacked(bytes4(keccak256("setNum(uint256)")), _num)); | |
if(!res) revert(); // C2's num is set | |
} |
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
contract ManagableAuthorization{ | |
//Simplified in a way that all readers can read all data. In real case scenario you will have more complex logic. | |
mapping(address => bool) readers; | |
modifier canRead(){ | |
//your logic for example: | |
require(readers[msg.sender]); | |
_; | |
} | |
//........ the rest of the class code......... | |
} |
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
Verifying my Blockstack ID is secured with the address 1HX9ZVMxMHtxxeEzUFs9VVwRVseCyvaEfS https://explorer.blockstack.org/address/1HX9ZVMxMHtxxeEzUFs9VVwRVseCyvaEfS |