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
!function() { | |
var d3 = { | |
version: "3.5.17" | |
}; | |
var d3_arraySlice = [].slice, d3_array = function(list) { | |
return d3_arraySlice.call(list); | |
}; | |
var d3_document = this.document; | |
function d3_documentElement(node) { | |
return node && (node.ownerDocument || node.document || node).documentElement; |
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 React, { useEffect, useRef } from 'react'; | |
import PropTypes from 'prop-types'; | |
import { findMatchedKey } from './keyEvents'; | |
let exclusiveHandlers = []; | |
const KeyboardEventHandler = ({ | |
handleKeys = [], | |
handleEventType = 'keydown', | |
handleFocusableElements = false, |
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 { useEffect, useRef } from "react"; | |
export default function FormWithoutState() { | |
// The count will increment by 2 on initial render due to strict mode then by 1 on subsequent renders | |
const countRef = useRef(0); | |
useEffect(() => { | |
countRef.current = countRef.current + 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
{ | |
"data": [ | |
{ | |
"State": "Vermont", | |
"unemploymentRateRank": 1, | |
"unemploymentRate": "0.0210", | |
"Pop": 628061 | |
}, | |
{ | |
"State": "North Dakota", |
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
/* | |
We are building a word processor and we would like to implement a "word-wrap" functionality. | |
Given a list of words followed by a maximum number of characters in a line, return a collection of strings where each string element represents a line that contains as many words as possible, with the words in each line being concatenated with a single '-' (representing a space, but easier to see for testing). The length of each string must not exceed the maximum character length per line. | |
Your function should take in the maximum characters per line and return a data structure representing all lines in the indicated max length. | |
Examples: | |
words1 = [ "The", "day", "began", "as", "still", "as", "the", |
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 * as React from "react" | |
export function useDebounce<T>(value: T, delay?: number): T { | |
const [debouncedValue, setDebouncedValue] = React.useState<T>(value) | |
React.useEffect(() => { | |
const timer = setTimeout(() => setDebouncedValue(value), delay || 500) | |
return () => { | |
clearTimeout(timer) |
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
find ./src -type f -name '*.js' -not -name '*.jsx' -not -name '*.ejs' -exec bash -c 'grep -l "</\|/>" $0' {} \; -exec bash -c 'mv "$0" "${0%.js}.jsx"' {} \; |
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
testCount = 0 | |
while True: | |
try: | |
n = int(input()) | |
if (n == 0): | |
break | |
if (testCount > 0): | |
print("") |
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
while True: | |
try: | |
text = input() | |
shortcuts = [] | |
resultText = "" | |
for i in range(len(text)): | |
currentChar = text[i] | |
if (currentChar == "_"): | |
if (len(shortcuts) > 0 and shortcuts[-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
# https://www.beecrowd.com.br/judge/pt/problems/view/1222 | |
while True: | |
try: | |
wordsLength, maxLinesPerPage, maxCharPerLine = map(int, input().split(" ")) | |
shortStory = input() | |
lines = 0 | |
pages = 0 |
NewerOlder