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
/* | |
based on http://stackoverflow.com/questions/1144783/replacing-all-occurrences-of-a-string-in-javascript | |
according to http://jsperf.com/replace-all-vs-split-join/25 | |
*/ | |
if (!String.prototype.replaceAll) | |
String.prototype.replaceAll = function (str, find, rep) { | |
return str.replace(new RegExp(find.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"), 'g'), rep); //faster for Firefox | |
return str.split(find).join(rep); //faster for Chrome | |
} |
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
// as seen on http://jsfiddle.net/9zxvE/383/ | |
// and http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser | |
// by http://stackoverflow.com/users/938089/rob-w | |
var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; | |
// Opera 8.0+ (UA detection to detect Blink/v8-powered Opera) | |
var isFirefox = typeof InstallTrigger !== 'undefined'; // Firefox 1.0+ | |
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; | |
// At least Safari 3+: "[object HTMLElementConstructor]" | |
var isChrome = !!window.chrome && !isOpera; // Chrome 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
public void ComputeResultWithTimeout() | |
{ | |
var task = Task.Factory.StartNew(() => ComputeResult("vrau")); | |
//task.Wait(0999); | |
task.Wait(1000); | |
if (task.IsCompleted) | |
Console.WriteLine($"oba! {task.Result}"); | |
else |
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
SELECT RANDOM()::INT::BOOLEAN; |
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
# Parâmetros do script | |
param ( | |
[string]$folderPath | |
) | |
# Função para normalizar o conteúdo do arquivo | |
function Normalize-Content { | |
param ( | |
[string]$content | |
) |
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
CREATE OR REPLACE FUNCTION public.sp_conta_filtros(p_idusuario numeric) | |
RETURNS TABLE(tabela character varying, counttabela numeric, countfiltro numeric) | |
LANGUAGE plpgsql | |
AS $function$ | |
declare tabelas record; | |
conta numeric; | |
begin | |
drop table if exists __contafiltro; | |
CREATE TEMPORARY TABLE __contafiltro | |
(tabela varchar(255), counttabela decimal(18), countfiltro decimal(18)) WITH ( OIDS=FALSE ); |