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
| // Given an array of visited vertices, where each element represents the parent of the vertex, | |
| // fill the path array with the route between src and dest. | |
| int reconstructShortestPath(Vertex src, Vertex dest, int *visited, int nV, int *path) { | |
| // Based on the suggestion here: https://stackoverflow.com/questions/8379785/how-does-a-breadth-first-search-work-when-looking-for-shortest-path#comment27820665_8379892 | |
| // Record the route in a queue. | |
| Queue route = newQueue(); | |
| // Backtrack through the visited array, recording each vertex in the queue. | |
| int current = dest; |
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/env bash | |
| # Based on https://medium.com/@chim/ethereum-how-to-setup-a-local-test-node-with-initial-ether-balance-using-geth-974511ce712 | |
| # Initialise a local geth testnet with automine | |
| CHAIN_DIRECTORY=~/.testnet; | |
| STARTING_BALANCE="0x5337000000000000000000" | |
| if [ -d "$CHAIN_DIRECTORY" ]; then | |
| rm -r ${CHAIN_DIRECTORY} |
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
| /** | |
| * Use this file to configure your truffle project. It's seeded with some | |
| * common settings for different networks and features like migrations, | |
| * compilation and testing. Uncomment the ones you need or modify | |
| * them to suit your project as necessary. | |
| * | |
| * More information about configuration can be found at: | |
| * | |
| * truffleframework.com/docs/advanced/configuration | |
| * |
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 eyed3 | |
| import io | |
| import os | |
| from PIL import Image | |
| def is_progressive(img): | |
| return "progression" in img.info or "progressive" in img.info | |
| def deprogressify(filename): |
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
| // SPDX-License-Identifier: MIT | |
| pragma solidity >=0.7.0 <0.9.0; | |
| contract KV { | |
| bytes32[] private reservedKeys; | |
| mapping(bytes32 => string) private values; | |
| constructor(bytes32[] memory _reservedKeys) { | |
| reservedKeys = _reservedKeys; | |
| } |
OlderNewer