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
pkgname=ever-surf | |
pkgver=8.2.1 | |
pkgrel=1 | |
pkgdesc="Ever Surf. Blockchain Communicator: data browser, crypto wallet and private chat." | |
arch=('x86_64') | |
url="https://ever.surf/download/" | |
license=('unknown') | |
checkdepends=('curl' 'coreutils') | |
source=("https://distribution.services.ever.surf/download/flavor/default/${pkgver}-release/linux_64/${pkgname}_${pkgver}_amd64.deb") | |
sha256sums=('16414f1161daf8cb79d00297b59cf71d4b9489b00997cb5297fdfd1f27cd6860') |
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
#!/bin/bash | |
RESTORE_DB=${RESTORE_DB:-false} | |
jq ".restore_db = ${RESTORE_DB}" /mnt/node/config.json > /tmp/config.json | |
mv /tmp/config.json /mnt/node/config.json |
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 <string> | |
#include <sstream> | |
#include <ostream> | |
#include <cassert> | |
using namespace std; | |
static const int MultiplyDeBruijnBitPosition[] = | |
{ |
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
/* | |
* Open addressing, linear probing. | |
*/ | |
template < typename Key, typename Value, class Hash > | |
class hashtable | |
{ | |
public: | |
using capacity_t = uint64_t; | |
using item_t = struct item |
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
int findNearest( int distances[], bool spt_flags[] ) | |
{ | |
auto min_value = numeric_limits< int >::max(), min_index = 0; | |
for ( auto v = 0; v < N; v++ ) | |
{ | |
auto not_in_spt = ( ! spt_flags[ v ] ); | |
auto closer = ( distances[ v ] < min_value ); | |
if ( not_in_spt && closer ) |
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
/* | |
* Recursive implementation | |
*/ | |
int bsearch(int arr[], int low, int high, int x) | |
{ | |
if (high >= low) | |
{ | |
int mid = low + (high - low)/2; |
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
unsigned long hash(unsigned char *str) | |
{ | |
unsigned long hash = 5381; | |
int c; | |
while (c = *str++) | |
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ | |
return hash; | |
} |
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
int64_t bfs( int64_t value ) | |
{ | |
auto adjacency_lists = new uint8_t * [ MAXN ]; | |
auto adjacency_lists_lengths = new uint8_t [ MAXN ]; | |
// ... | |
QueueT< int64_t > q( MAXN ); | |
auto visited = new bool [ MAXN ]; | |
auto distances = new int64_t [ MAXN ]; |
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
template < typename T > | |
class QueueT | |
{ | |
public: | |
QueueT( int64_t max_size ) | |
: _max_size( max_size ) | |
, _size( 0 ) | |
, _front( 0 ) | |
, _rear( -1 ) | |
{ |
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
uint64_t ** adj_lists = nullptr; | |
bool * visited = nullptr; | |
uint64_t * adj_sizes = nullptr; | |
bool is_visited( uint64_t id ) | |
{ | |
return visited[ id ]; | |
} | |
void set_visited( uint64_t id ) |
NewerOlder