tag:blogger.com,1999:blog-55307590474169383612024-03-08T23:49:49.632-03:00Comércio IturamaFelipebroshttp://www.blogger.com/profile/15410389181170147330noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-5530759047416938361.post-22515486237139077412023-11-13T23:38:00.001-03:002023-11-13T23:38:37.127-03:00Comparação, correspondência e patch de texto
<!--saved from url=(0066)https://neil.fraser.name/software/diff_match_patch/demos/diff.html-->
<html>
<head>
<meta charset="utf-8"></meta>
<!-- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> -->
<title>Comparação, correspondência e patch: Demonstração do Diff</title>
<script crossorigin="anonymous" integrity="sha512-5YZxUisfaneUbwv58nPp10qwt6DefHuJ+iAfvPoABZAYwLg4WGJHITaLpyyxJdrljfc0ggUoWc87Z0lfoDS84Q==" referrerpolicy="no-referrer" src="https://cdnjs.cloudflare.com/ajax/libs/diff_match_patch/20121119/diff_match_patch.js"></script>
</head>
<body>
<h3>Comparação, correspondência e patch</h3>
<h3>Demonstração do Diff</h3>
<p>Diff pega dois textos e encontra as diferenças. Essa implementação funciona em uma base de caractere por caractere. O resultado de qualquer diff pode conter "joio", pequenas semelhanças irrelevantes que complicam a saída. Um algoritmo de limpeza pós-diff leva em consideração essas semelhanças triviais.</p>
<script>
var dmp = new diff_match_patch();
function launch() {
var text1 = document.getElementById('text1').value;
var text2 = document.getElementById('text2').value;
dmp.Diff_Timeout = parseFloat(document.getElementById('timeout').value);
dmp.Diff_EditCost = parseFloat(document.getElementById('editcost').value);
var ms_start = (new Date()).getTime();
var d = dmp.diff_main(text1, text2);
var ms_end = (new Date()).getTime();
if (document.getElementById('semantic').checked) {
dmp.diff_cleanupSemantic(d);
}
if (document.getElementById('efficiency').checked) {
dmp.diff_cleanupEfficiency(d);
}
var ds = dmp.diff_prettyHtml(d);
document.getElementById('outputdiv').innerHTML = ds + '<BR>Tempo: ' + (ms_end - ms_start) / 1000 + 's';
}
</script>
<form action="#" onsubmit="return false">
<table style="width: 100%;">
<tbody>
<tr>
<td width="50%">
<h3>Versão do texto 1:</h3>
<textarea id="text1" rows="10" style="width: 100%;"></textarea>
</td>
<td width="50%">
<h3>Versão do texto 2:</h3>
<textarea id="text2" rows="10" style="width: 100%;"></textarea>
</td>
</tr>
</tbody>
</table>
<h3>Tempo limite de comparação:</h3>
<p><input id="timeout" maxlength="5" size="3" type="text" value="1" /> segundos<br />
Se a fase de mapeamento da computação de comparação demorar mais do que isso, a computação
é truncado e a melhor solução até o momento é retornada. Embora garantido ser correto,
pode não ser o ideal. Um tempo limite de '0' permite computação ilimitada.</p>
<h3>Limpeza pós-diff:</h3>
<dl>
<dt><input id="semantic" name="cleanup" type="radio" />
<label for="semantic">Limpeza semântica</label>
</dt>
<dd>Aumentar a legibilidade humana considerando pontos comuns que provavelmente serão Coincidência.</dd>
<dt><input id="efficiency" name="cleanup" type="radio" />
<label for="efficiency">Limpeza de eficiência</label>,
custo de edição: <input id="editcost" maxlength="5" size="3" type="text" value="4" />
</dt>
<dd>Aumente a eficiência computacional fatorando pontos em comum que são curtos
não vale a pena a sobrecarga. Quanto maior o custo de edição, mais agressiva é a limpeza.</dd>
<dt><input checked="" id="raw" name="cleanup" type="radio" />
<label for="raw">Sem limpeza</label>
</dt>
<dd>Produção bruta.</dd>
</dl>
<p><input onclick="launch()" type="button" value="Processar Diferença" /></p>
</form>
<div id="outputdiv"></div>
<hr />
Voltar para <a href="https://github.com/google/diff-match-patch">Diff, Match and Patch</a>
</body>
</html>Felipebroshttp://www.blogger.com/profile/15410389181170147330noreply@blogger.com0tag:blogger.com,1999:blog-5530759047416938361.post-1655062865680785652023-04-11T16:13:00.005-03:002023-04-28T17:01:21.448-03:00Prepare binding sql Laravel Substituindo Interrogação do SQL<textarea id="entrada" rows="4" cols="50">select * from tabela where id in (?, ?, ?)</textarea><br><br>
<textarea id="array" rows="4" cols="50">array (0 => 1, 1 => 2, 2 => 3)</textarea><br><br>
<textarea id="saida" rows="4" cols="50"></textarea><br><br>
<button onclick="substituir()">Substituir</button>
<script>
function substituir() {
const entrada = document.getElementById("entrada").value;
const arrayEntrada = document.getElementById("array").value;
array = arrayEntrada.replace("array", "").replace(/[()]/g, "").split(", ").map((el) => el.split(" => ")[1]);
resultado = entrada;
for (let i = 0; i < array.length; i++) {
resultado = resultado.replace("?", array[i]);
}
document.getElementById("saida").value = resultado;
}
</script>Felipebroshttp://www.blogger.com/profile/15410389181170147330noreply@blogger.com0tag:blogger.com,1999:blog-5530759047416938361.post-44431066844743069232023-03-10T13:18:00.000-03:002023-04-11T16:12:14.665-03:00Conversão de lista ordenada HTML para Texto<h1>Digite o HTML da lista ordenada:</h1>
<textarea id="input" rows="10" cols="50"></textarea>
<h1>Veja o texto convertido:</h1>
<textarea id="output" rows="10" cols="50" readonly></textarea>
<script>
// Seleciona as áreas de texto
var input = document.getElementById("input");
var output = document.getElementById("output");
// Cria uma função para converter o HTML em texto
function converter() {
// Cria um elemento temporário para inserir o HTML digitado
var temp = document.createElement("div");
temp.innerHTML = input.value;
// Seleciona todos os elementos <li> da lista ordenada
var lista = temp.querySelectorAll("ol li");
// Obtém o valor do atributo start da tag <ol>
var start = parseInt(temp.querySelector("ol").getAttribute("start")) || 1;
// Extrai o texto de cada elemento e soma o valor inicial da lista ao index
var texto = Array.from(lista).map((item, index) => {
return (start + index) + ". " + item.innerText;
});
// Mostra o resultado na segunda área de texto
output.value = texto.join("\n");
}
// Adiciona um evento para executar a função quando o usuário digitar algo na primeira área de texto
input.addEventListener("input", converter);
</script>Felipebroshttp://www.blogger.com/profile/15410389181170147330noreply@blogger.com0tag:blogger.com,1999:blog-5530759047416938361.post-45828897724464741962020-05-11T03:59:00.006-03:002023-04-11T16:12:10.385-03:00Abrir Múltiplos Links Aleatórios<center>
<form id="formulario">
<textarea id="texto" name="texto" rows="20" cols="50" tabindex="1" wrap="off"></textarea>
<br>
<label for="amount">Quantidade a ser aberta:</label>
<input id="amount" name="amount" type="number" tabindex="2">
<input id="botao" name="botao" type="submit" tabindex="3" value="Abrir links">
</form>
<a href="" target="_blank" id="link"></a>
</center>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
if (window.location.href.includes('abrir-multiplos-links-aleatorios.html')) {
document.getElementById('texto').focus();
}
document.getElementById("botao").onclick = function (e) {
e.preventDefault();
var murls = document.getElementById("texto").value;
var amount = document.getElementById("amount").value;
var murls = murls.split(/[\s,]+/);
if (amount == 0) {
var count_murls = murls.length;
} else if (amount > murls.length) {
var count_murls = murls.length;
} else {
var count_murls = amount;
}
var strLink;
var unique_numbers = [];
var random_number = '';
for (var i = 0; i <= count_murls - 1; i++) {
var j = 0;
while (j<1) {
random_number = Math.floor(Math.random() * murls.length);
if (unique_numbers.includes(random_number) === true) {
j = 0;
} else {
j = 1;
unique_numbers.push(random_number);
}
}
strLink = murls[random_number];
if (strLink) {
if (strLink.substr(0, 5) != 'http:' && strLink.substr(0, 6) != 'https:') {
strLink = 'https://' + strLink
}
WindowOpened = window.open(strLink);
}
}
}
})
</script>Felipebroshttp://www.blogger.com/profile/15410389181170147330noreply@blogger.com0tag:blogger.com,1999:blog-5530759047416938361.post-33246697721200173462020-05-11T03:40:00.002-03:002023-04-11T16:12:06.073-03:00Abrir múltiplos links<center>
<form id="formulario">
<textarea id="texto" name="texto" rows="20" cols="50" tabindex="1" wrap="off"></textarea>
<br>
<input id="botao" name="botao" type="submit" tabindex="2" value="Abrir links">
</form>
<a href="" target="_blank" id="link"></a>
</center>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
if (window.location.href.includes('abrir-multiplos-links.html')) {
document.getElementById('texto').focus();
}
document.getElementById("botao").onclick = function (e) {
e.preventDefault();
var murls = document.getElementById("texto").value;
var murls = murls.split(/[\s,]+/);
var count_murls = murls.length;
var strLink;
for (var i = 0; i <= count_murls; i++) {
strLink = murls[i];
if (strLink) {
if (strLink.substr(0, 5) != 'http:' && strLink.substr(0, 6) != 'https:') {
strLink = 'https://' + strLink
}
WindowOpened = window.open(strLink);
}
}
}
})
</script>Felipebroshttp://www.blogger.com/profile/15410389181170147330noreply@blogger.com0tag:blogger.com,1999:blog-5530759047416938361.post-51196114889603102452020-04-21T01:09:00.001-03:002020-04-21T01:13:47.229-03:00Jogo da ForcaFelipebroshttp://www.blogger.com/profile/15410389181170147330noreply@blogger.com0tag:blogger.com,1999:blog-5530759047416938361.post-30329689616168425832020-04-20T08:33:00.030-03:002023-08-15T18:00:11.381-03:00Inverter Texto<center>
<form id="formulario">
<input id="texto" name="texto" type="text" />
<input
id="botao_inverter"
name="botao_inverter"
type="submit"
value="Inverter Texto"
/>
</form>
<p>
Original:
<a href="" target="_blank" id="link_original"></a>
</p>
<p>
Invertido:
<a href="" target="_blank" id="link"></a>
</p>
</center>
<script type="text/javascript">
if(window.location.href.includes('inverter-texto.html')) {
document.getElementById('texto').focus();
}
function getQueryVariable2(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return '';
}
function getQueryVariable(parameter) {
let params = new URLSearchParams(document.location.search.substring(1));
return params.get("link");
}
function inverter(x) {
return x.split('').reverse().join('');
}
function setURLParameter(parameter, value) {
let newUrl = new URL(window.location.href);
if (newUrl.searchParams.get(parameter) === value) {
return newUrl;
}
newUrl.searchParams.set(parameter, value);
window.history.replaceState({}, "", newUrl);
return newUrl.href;
}
/*function setURLParameter(url, parameter, value) {
let url = new URL(url);
if (url.searchParams.get(parameter) === value) {
return url;
}
url.searchParams.set(parameter, value);
return url.href;
}*/
/*var form = document.getElementById('formulario');
form.addEventListener('submit', function(e) {
textoInvertido = inverter(document.getElementById("texto").value);
document.getElementById("texto").value = textoInvertido;
e.preventDefault();
});*/
function inverterCaracteresInput() {
textoInvertido = inverter(document.getElementById("texto").value);
document.getElementById("texto").value = textoInvertido;
if(!textoInvertido.includes('http')) {
textoInvertido = "http://" + textoInvertido;
}
document.getElementById("link").href = textoInvertido;
document.getElementById("link").text = textoInvertido;
}
function alterarLinkOriginal(value) {
document.getElementById("link_original").href = value;
document.getElementById("link_original").text = value;
}
document.getElementById("texto").value = getQueryVariable("link");
alterarLinkOriginal(document.getElementById("texto").value);
inverterCaracteresInput();
document.getElementById("botao_inverter").onclick = function(e) {
alterarLinkOriginal(document.getElementById("texto").value);
inverterCaracteresInput();
var input_texto = document.getElementById("texto").value;
var newUrl = setURLParameter('link', input_texto);
e.preventDefault();
}
</script>
Felipebroshttp://www.blogger.com/profile/15410389181170147330noreply@blogger.com0tag:blogger.com,1999:blog-5530759047416938361.post-21331933402827387242015-05-03T22:55:00.012-03:002021-02-25T11:48:15.510-03:00Sites de compras confiáveis<div>Veja abaixo uma lista compilada de sites de compras confiáveis.</div><div><br /></div>Consulte a empresa no site Reclaque Aqui antes da contratar algum serviço ou realizar alguma compra
<a href="http://www.reclameaqui.com.br/" target="_blank">http://www.reclameaqui.com.br/</a>.<br />
<br />Anti-vírus<br />
Bitdefender <a href="https://store.bitdefender.com/affiliate.php?ACCOUNT=BTDLLC&AFFILIATE=44489&PATH=http%3A%2F%2Fwww.bitdefender.com" target="_blank">https://store.bitdefender.com/affiliate.php?ACCOUNT=BTDLLC&AFFILIATE=44489&PATH=http%3A%2F%2Fwww.bitdefender.com</a><br />
<br />Varejo<br />
Magazine Luiza <a href="https://www.magazinevoce.com.br/magazinefelipebros/" target="_blank">https://www.magazinevoce.com.br/magazinefelipebros/</a> <a href="https://www.parceiromagalu.com.br/magazinefelipebros" target="_blank">https://www.parceiromagalu.com.br/magazinefelipebros</a><br />
Americanas.com <a href="http://compre.vc/s/759ba667" target="_blank">http://compre.vc/s/759ba667</a><br />
Submarino <a href="http://compre.vc/s/186df1bf" target="_blank">http://compre.vc/s/186df1bf<span></span></a><br />
Buscapé e Bondfaro <a href="http://compre.vc/s/81fd891f" target="_blank">http://compre.vc/s/81fd891f</a><br />
Ricardo Eletro <a href="http://compre.vc/s/13936f9e" target="_blank">http://compre.vc/s/13936f9e</a><br />
Girafa <a href="http://compre.vc/s/27bbd4cd" target="_blank">http://compre.vc/s/27bbd4cd</a><br />
Extra <a href="http://compre.vc/s/e11a4482" target="_blank">http://compre.vc/s/e11a4482</a><br />
Ponto Frio <a href="http://compre.vc/s/f9cb248f" target="_blank">http://compre.vc/s/f9cb248f</a><br />
Fast Shop <a href="http://compre.vc/s/319c9ba9" target="_blank">http://compre.vc/s/319c9ba9</a><br />
Casas Bahia <a href="http://compre.vc/s/bbb5c918" target="_blank">http://compre.vc/s/bbb5c918</a><br />
Walmart <a href="http://compre.vc/s/8a62c9ae" target="_blank">http://compre.vc/s/8a62c9ae</a><br />
Shoptime <a href="http://compre.vc/s/9f89af50" target="_blank">http://compre.vc/s/9f89af50</a><br />
Polishop <a href="http://compre.vc/s/0523a73e" target="_blank">http://compre.vc/s/0523a73e</a><br />
Shopfato <a href="http://compre.vc/s/05f9eb4e" target="_blank">http://compre.vc/s/05f9eb4e</a><br />
eFácil <a href="http://compre.vc/s/d5d3252a" target="_blank">http://compre.vc/s/d5d3252a</a><br />
Mega Mamute <a href="http://compre.vc/s/7ced57a2" target="_blank">http://compre.vc/s/7ced57a2</a><br />
MXT shop <a href="http://compre.vc/s/8bbf76b2" target="_blank">http://compre.vc/s/8bbf76b2</a><br />
Liquidae <a href="http://compre.vc/s/6ad6274a" target="_blank">http://compre.vc/s/6ad6274a</a><br />
Enjoei <a href="http://compre.vc/s/4b8098aa" target="_blank">http://compre.vc/s/4b8098aa</a><br />
Salfer <a href="http://compre.vc/s/c8b7103c" target="_blank">http://compre.vc/s/c8b7103c</a><br />
Sensual Sex Shop <a href="http://compre.vc/s/090f8dc1" target="_blank">http://compre.vc/s/090f8dc1</a><br />
Havan <a href="http://compre.vc/s/9702c45c" target="_blank">http://compre.vc/s/9702c45c</a><br />
Drogaria São Paulo <a href="http://compre.vc/s/1181d3ac" target="_blank">http://compre.vc/s/1181d3ac</a><br />
Drogaria Pacheco <a href="http://compre.vc/s/6528dd95" target="_blank">http://compre.vc/s/6528dd95</a><br />
Mania Pop <a href="http://compre.vc/s/764e98cb" target="_blank">http://compre.vc/s/764e98cb</a><br />
<br />Moda e acessórios<br />
Primu's Jóias <a href="http://www.primusjoias.com.br/" target="_blank">www.primusjoias.com.br</a><br />
Camiseteria <a href="http://compre.vc/s/c88fef5f" target="_blank">http://compre.vc/s/c88fef5f</a><br />
Dress It <a href="http://compre.vc/s/9da66822" target="_blank">http://compre.vc/s/9da66822</a><br />
Nina Bruni <a href="http://compre.vc/s/557b898f" target="_blank">http://compre.vc/s/557b898f</a><br />
Mash <a href="http://compre.vc/s/1d7b8f43" target="_blank">http://compre.vc/s/1d7b8f43</a><br />
Calçados Online <a href="http://compre.vc/s/9b9867fa" target="_blank">http://compre.vc/s/9b9867fa</a><br />
Amaro <a href="http://compre.vc/s/450be2c6" target="_blank">http://compre.vc/s/450be2c6</a><br />
Olho Fashion <a href="http://compre.vc/s/c1aa727c" target="_blank">http://compre.vc/s/c1aa727c</a><br />
Pandora Joias <a href="http://compre.vc/s/617945b0" target="_blank">http://compre.vc/s/617945b0</a><br />
<br />Alimentos e Bebidas<br />
Clube do Malte <a href="http://compre.vc/s/5f19cbea" target="_blank">http://compre.vc/s/5f19cbea</a><br />
<br />Brinquedos e Bebês<br />
Abracadabra <a href="http://compre.vc/s/4e899720" target="_blank">http://compre.vc/s/4e899720</a><br />
<br />Casa e Construção<br />
Madeira Madeira <a href="http://compre.vc/s/17356f59" target="_blank">http://compre.vc/s/17356f59</a><br />
<br />Clube de Compras<br />
Clube do Ricardo <a href="http://compre.vc/s/bb87ea34" target="_blank">http://compre.vc/s/bb87ea34</a><br />
<br />Cosméticos e Perfumaria<br />
Sepha <a href="http://compre.vc/s/fb0034d4" target="_blank">http://compre.vc/s/fb0034d4</a><br />
Sephora <a href="http://compre.vc/s/428cc94e" target="_blank">http://compre.vc/s/428cc94e</a><br />
L`Occitane <a href="http://compre.vc/s/8687f0dc" target="_blank">http://compre.vc/s/8687f0dc</a><br />
Época Cosméticos Perfumaria <a href="http://compre.vc/s/0cd81152" target="_blank">http://compre.vc/s/0cd81152</a><br />
Anna Pegova <a href="http://compre.vc/s/eddc5bfd" target="_blank">http://compre.vc/s/eddc5bfd</a><br />
Strawberry.Net <a href="http://compre.vc/s/70dcf6c3" target="_blank">http://compre.vc/s/70dcf6c3</a><br />
Sieno Perfumes <a href="http://compre.vc/s/25c67a21" target="_blank">http://compre.vc/s/25c67a21</a><br />
The Beauty Box <a href="http://compre.vc/s/d93a0d62" target="_blank">http://compre.vc/s/d93a0d62</a><br />
Quem disse, berenice? <a href="http://compre.vc/s/536f1db8" target="_blank">http://compre.vc/s/536f1db8</a><br />
Eudora <a href="http://compre.vc/s/f960b0dc" target="_blank">http://compre.vc/s/f960b0dc</a><br />
Loccitane Au Bresil <a href="http://compre.vc/s/3194c412" target="_blank">http://compre.vc/s/3194c412</a><br />
O Boticario <a href="http://compre.vc/s/60bcac37" target="_blank">http://compre.vc/s/60bcac37</a><br />
<br />Esporte e Lazer<br />
Nike <a href="http://compre.vc/s/0740b88d" target="_blank">http://compre.vc/s/0740b88d</a><br />
Centauro <a href="http://compre.vc/s/26a32847" target="_blank">http://compre.vc/s/26a32847</a><br />
Bee Fitness <a href="http://compre.vc/s/8edef19f" target="_blank">http://compre.vc/s/8edef19f</a><br />
Classic Tennis <a href="http://compre.vc/s/119b2173" target="_blank">http://compre.vc/s/119b2173</a><br />
FutFanatics <a href="http://compre.vc/s/ab609f49" target="_blank">http://compre.vc/s/ab609f49</a><br />
Churrasqueiras Weber <a href="http://compre.vc/s/63c6f231" target="_blank">http://compre.vc/s/63c6f231</a><br />
<br />Instrumentos Musicais<br />
Ovelha Negra <a href="http://compre.vc/s/951f1580" target="_blank">http://compre.vc/s/951f1580</a><br />
<br />Livraria<br />
Saraiva <a href="http://compre.vc/s/c0d79a1b" target="_blank">http://compre.vc/s/c0d79a1b</a><br />
Fnac <a href="http://compre.vc/s/55afd69d" target="_blank">http://compre.vc/s/55afd69d</a><br />
Livraria da Travessa <a href="http://compre.vc/s/5c6ef124" target="_blank">http://compre.vc/s/5c6ef124</a><br />
Livraria da Folha <a href="http://compre.vc/s/e6bc911e" target="_blank">http://compre.vc/s/e6bc911e</a><br />
Livraria Cultura <a href="http://compre.vc/s/bf71e37e" target="_blank">http://compre.vc/s/bf71e37e</a><br />
<br />Móveis & Decoração<br />
Mobly <a href="http://compre.vc/s/85933353" target="_blank">http://compre.vc/s/85933353</a><br />
Ecolchão <a href="http://compre.vc/s/2f3a22e0" target="_blank">http://compre.vc/s/2f3a22e0</a><br />
Abracasa <a href="http://compre.vc/s/87cac9f6" target="_blank">http://compre.vc/s/87cac9f6</a><br />
<br />Viagens e Turismo<br />
Click Bus <a href="http://compre.vc/s/e8024831" target="_blank">http://compre.vc/s/e8024831</a><br />
Viajanet <a href="http://compre.vc/s/4913c394" target="_blank">http://compre.vc/s/4913c394</a><br />Felipebroshttp://www.blogger.com/profile/15410389181170147330noreply@blogger.com1