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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import secrets | |
import sys | |
from hashlib import sha256 | |
from base64 import b64encode, b64decode | |
## | |
## Based on the logic here: https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/security/Sha256AuthenticationProvider.java |
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
## | |
## Python implementations of the search relevance evaluation metrics described at | |
## https://opensourceconnections.com/blog/2020/02/28/choosing-your-search-relevance-metric/ | |
## | |
## | |
def precision(docs): | |
return sum(docs) / len(docs) if docs else 0 | |
def avg_precision(docs): |
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 | |
## Usage: | |
## $ chmod +x fetcher.sh | |
## $fetcher.sh <output file> | |
SOLR_URL="http://localhost:8983/solr" | |
COLLECTION="teste" | |
ROWS=10 | |
FL=*,score # No space around commas |
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
import org.apache.lucene.analysis.*; | |
import org.apache.lucene.analysis.core.WhitespaceTokenizer; | |
import org.apache.lucene.analysis.miscellaneous.DelimitedTermFrequencyTokenFilter; | |
import org.apache.lucene.document.Document; | |
import org.apache.lucene.document.Field; | |
import org.apache.lucene.document.FieldType; | |
import org.apache.lucene.index.*; | |
import org.apache.lucene.search.IndexSearcher; | |
import org.apache.lucene.search.MatchAllDocsQuery; | |
import org.apache.lucene.search.TopDocs; |
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
package com.company; | |
import java.math.BigInteger; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Objects; | |
import java.util.stream.Collectors; |
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
//import org.apache.zookeeper.common.PathUtils; | |
import java.util.Arrays; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.NoSuchElementException; | |
public final class PathIterator implements Iterator<String>, Iterable<String> { | |
public static final String SEP = "/"; |
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
19 | |
paralelogramos | |
contextualizar | |
companheirismo | |
gradativamente | |
especificidade | |
idiossincrasia | |
disponibilizar | |
corporativismo | |
locupletamento |
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
#!/usr/bin/python | |
def ham(x,y): | |
cont = 0 | |
if len(x) == len(y): | |
for i in zip(x,y): | |
if i[0] != i[1]: | |
cont += 1 | |
else: | |
cont = -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
import java.util.HashSet; | |
import java.util.Set; | |
import java.util.concurrent.*; | |
public class MapComputeTest | |
{ | |
public static void main(String[] args) | |
{ |
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
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.51-b03 mixed mode): | |
"Attach Listener" #13 daemon prio=9 os_prio=31 tid=0x00007f943c05e000 nid=0x3507 waiting on condition [0x0000000000000000] | |
java.lang.Thread.State: RUNNABLE | |
"DestroyJavaVM" #12 prio=5 os_prio=31 tid=0x00007f943a817000 nid=0x1003 waiting on condition [0x0000000000000000] | |
java.lang.Thread.State: RUNNABLE | |
"Thread-1" #11 prio=5 os_prio=31 tid=0x00007f943a816000 nid=0x5003 waiting for monitor entry [0x00007000012cc000] | |
java.lang.Thread.State: BLOCKED (on object monitor) |
NewerOlder