I hereby claim:
- I am jonasraoni on github.
- I am jonasraoni (https://keybase.io/jonasraoni) on keybase.
- I have a public key whose fingerprint is C6B8 2A63 2F58 4784 159E 802F 5ECC 07E6 0269 4752
To claim this, I am signing this object:
using System; | |
using System.IO; | |
using System.Web; | |
using System.Text; | |
using System.Collections.Generic; | |
using System.Collections; | |
namespace Raoni { | |
public delegate bool Generator<T>(out T value); | |
public delegate bool Enumerator<T>(T value); |
/* | |
Twin Strings | |
Two strings, a and b, are said to be twins only if they can be made equivalent by performing some number of operations on one or both strings. There are two possible operations: | |
SwapEven: Swap a character at an even-numbered index with a character at another even-numbered index. | |
SwapOdd: Swap a character at an odd-numbered index with a character at another odd-numbered index. | |
For example, a = "abcd" and b = "cdab" are twins because we can make them equivalent by performing operations. Alternatively, a = "abcd" and b = "bcda" are not twins (operations do not move characters between odd and even indices), and neither are a = "abc" and b = "ab" (no amount of operations will insert a 'c' into string b). | |
Complete the twins function in the provided code. It has two parameters: |
I hereby claim:
To claim this, I am signing this object:
EXEC sp_addlinkedserver @server='SERVER_ADDRESS'; | |
EXEC sp_addlinkedsrvlogin @rmtsrvname='SERVER_ADDRESS',@useself=false, @rmtuser='USER', @rmtpassword='PASSWORD'; | |
-------------- | |
INSERT INTO LOCAL_TABLE | |
SELECT * | |
FROM | |
[SERVER_ADDRESS].DATABASE.dbo.REMOTE_TABLE |
{"lastUpload":"2021-11-02T08:34:50.367Z","extensionVersion":"v3.4.3"} |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
/// <summary> | |
/// Extends the Array with the Flatten method | |
/// </summary> | |
public static class Flattener { | |
/// <summary> | |
/// Given a N-dimensional array, flattens it into a new one-dimensional array without modifying the elements' order |
/* | |
There is a table in database. This table contains unduplicated natural numbers. There may be gaps in the sequence of natural numbers in the table. You need to output missing numbers. | |
Table of natural numbers: declare @values as table ([number] int not null). | |
Test data: insert into @values([number]) values (1), (2), (3), (5), (9). | |
Result: declare @missing as table ([left] int not null, [right] int not null). | |
*/ | |
DECLARE @values AS TABLE ([number] INT NOT NULL); | |
INSERT INTO @values([number]) VALUES (1), (2), (3), (5), (9); | |
DECLARE @missing AS TABLE ([left] INT NOT NULL, [right] INT NOT NULL) |
function numberToOrdinal(n) { | |
const | |
number = Math.abs(n) || 0, | |
units = number % 10, | |
tens = ~~(number % 100 / 10), | |
suffix = new Map([ | |
[1, 'st'], | |
[2, 'nd'], | |
[3, 'rd'] | |
]); |
//+ Jonas Raoni Soares Silva | |
//@ http://raoni.org | |
export default (...values) => Math.max(...values.map(value => | |
(value = (value + '').split(/[.,]/)).length > 1 && value.pop().length | |
)); |
//+ Jonas Raoni Soares Silva | |
//@ http://raoni.org | |
export default function debounce (action, delay) { | |
let handle; | |
return function (...args) { | |
if (handle) { | |
clearTimeout(handle); | |
handle = null; | |
} |