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
### SPARK IS OPTIONAL ### | |
### REMOVE OR COMMENT IF YOU DO NOT NEED IT ### | |
### SPARK ALSO NEED SOME CONF TO WORK CORRECTLY ### | |
spark-master: | |
image: bde2020/spark-master:1.6.2-hadoop2.6 | |
container_name: spark-master | |
ports: | |
- "8080:8080" | |
- "7077:7077" | |
environment: |
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
#include "ThingSpeak.h" | |
#include <SPI.h> | |
#include <Ethernet.h> | |
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; | |
EthernetClient client; | |
unsigned long myChannelNumber = 584073; | |
const char * myWriteAPIKey = "701TW43AXK9N4770"; | |
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
const https = require('https'); | |
https.get('https://thingspeak.com/channels/584073/feed.json', (res) => { | |
let data = ''; | |
res.on('data', (chunk) => { | |
data += chunk; | |
}); | |
res.on('end', () => { |
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) { |
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
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
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
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
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
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++) { |
OlderNewer