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
pragma solidity ^0.8.9; | |
import "@openzeppelin/contracts/metatx/ERC2771Context.sol"; | |
contract OnChainLRU is ERC2771Context { | |
constructor( | |
address trustedForwarder_ | |
) ERC2771Context(trustedForwarder_){} | |
address public lastCaller; |
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 { ChainEngineSdk } from "chainengine-sdk"; | |
import fs from "fs"; | |
(async () => { | |
const GAME_ID = '2fd5f2de-2c8c-4d2e-9139-211175244cb6'; | |
const API_URL = 'http://localhost:3000' | |
const API_KEY = 'testApiKey'; | |
const API_SECRET = 'testApiSecret'; | |
const NETWORK = 'testnet'; |
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
I am attesting that this GitHub handle niltonheck is linked to the Tezos account tz1LyzQz9Vr8jw8w15kN4zzszGbpAJuoHF4h for tzprofiles | |
sig:edsigtZjPbiSGeuqjFuDegNpirYgBEt646Xin3errXuyJL3wqz8apQ9xaLJF4MbmmNFM1gFKpd5cVj1hW9PsJLABM2HCUNWVRNA |
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
Trie trie = new Trie(); | |
Node root = new Node(); | |
foreach (var key in conversions.Keys) | |
{ | |
trie.insertIntoTrie(root, (key as String).ToArray(), 0); | |
} | |
// For de exemplo para validar performance. | |
for (int i = 0; i < 1000000; i++) { |
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
Hashtable conversions = new Hashtable(); | |
conversions.Add("C Manut ", "Centro Manutenção"); | |
conversions.Add("Centro Manut ", "Centro Manutenção"); | |
conversions.Add("C M ", "Centro Manutenção"); | |
... | |
String formatName(Trie trie, String record, Hashtable conversions) { | |
ClosestMatch close = trie.Search(record.name, root); | |
if ( close != null ) { | |
return conversions[close.Match] + record.name.Substring(close.Index); |
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
data class ClosestMatch ( | |
val match: String, | |
val index: Int | |
) | |
data class Node( | |
var value: Char? = null, | |
var word: String? = null, | |
val children: MutableList<Node> = emptyList<Node>().toMutableList() | |
) |
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
using System.Collections; | |
class ClosestMatch { | |
public String Match; | |
public Int32 Index; | |
public ClosestMatch(String incomingMatch, Int32 incomingIndex) { | |
Match = incomingMatch; | |
Index = incomingIndex; | |
} |
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 kotlin.system.measureTimeMillis | |
data class ClosestMatch ( | |
val match: String, | |
val index: Int | |
) | |
data class Node( | |
var value: Char? = null, | |
var word: String? = null, |
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
cd ~ | |
sudo add-apt-repository ppa:openjdk-r/ppa | |
sudo apt-get update | |
sudo apt-get install unzip zip | |
wget https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip | |
unzip commandlinetools-linux-6514223_latest.zip -d cmdline-tools | |
mkdir Android | |
mv cmdline-tools ./Android/ | |
rm commandlinetools-linux-6514223_latest.zip | |
sudo apt-get install -y lib32z1 openjdk-8-jdk |
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
class Node { | |
constructor(info) { | |
this.info = info; | |
this.leftNode = null; | |
this.rightNode = null; | |
} | |
insert(value) { | |
if(value <= this.info) { | |
if(this.leftNode == null) { |