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, useState } from 'react'; | |
import { Paper, InputAdornment } from '@mui/material'; | |
import { InlineLabelTextInput } from '../InlineLabelTextInput'; | |
import { InlineLabelAutocomplete } from './InlineLabelAutocomplete'; | |
import { LinkButtonGrey } from './InlineLabelAutocomplete.styled'; | |
import { DeletableChip } from '../../../Chips'; | |
const emailAddresses = [ | |
'[email protected]', | |
'[email protected]', |
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
A precedence rule is given as "P>E", which means that letter "P" is followed by letter "E". | |
Write a function, given an array of precedence rules, that finds the word represented by the given rules. | |
Note: Each represented word contains a set of unique characters, | |
i.e. the word does not contain duplicate letters. | |
findWord(["P>E", "E>R","R>U"]) // PERU | |
findWord(["I>N", "A>I","P>A","S>P"]) // SPAIN | |
findWord(["U>N", "G>A", "R>Y", "H>U", "N>G", "A>R"]) // HUNGARY | |
findWord(["I>F", "W>I", "S>W", "F>T"]) // SWIFT | |
findWord(["R>T", "A>L", "P>O", "O>R", "G>A", "T>U", "U>G"]) // PORTUGAL |
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 collections | |
def solution(H): | |
result = 0 | |
queue = collections.deque() | |
queue.append(H) | |
# print(F"queue = {queue}") | |
while queue: | |
# print(queue) |
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
def solution(S): | |
# print(F"S = {S}") | |
def is_valid(x): | |
if x.isdigit(): | |
if len(x) % 2 == 1: | |
return True | |
# elif x in range(ord('A'), ord('Z') + 1) or x in range(ord('a'), ord('z') + 1): | |
elif x.isalpha(): | |
if len(x) % 2 == 0: | |
return True |
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
process.env.GOOGLE_APPLICATION_CREDENTIALS = "./auth.json"; | |
const dialogflow = require('@google-cloud/dialogflow'); | |
const projectId = "caloriestracking-ebxh" | |
const sessionId = "123453232121" | |
// Instantiates a session client | |
const sessionClient = new dialogflow.SessionsClient(); |
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
{ | |
user: { | |
first_name: 'jasper Megan', | |
last_name: 'Jay asd', | |
gender: 'female', | |
dob: 'Wed Jan 04 1989 00:00:00 GMT+0000 (Coordinated Universal Time)', | |
email: '[email protected]', | |
role: 'associate', | |
address: null, | |
_id: '5cfe67a6976df9625d27d60a', |
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, { useState } from "react"; | |
import { useQuery, useMutation } from "@apollo/client"; | |
import Capitalize from "../../helpers/capitalize"; | |
import { gql } from "@apollo/client"; | |
import Select from "react-select"; | |
import useUser from "../../customHooks/useUser"; | |
import * as R from "ramda"; | |
const GET_ORG_USERS = gql` | |
query getInboxUser($userId: String, $role: String, $manager: String) { |
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
for (int a = 1; a < 999; a++) { | |
for (int b = 1; b + a < 1000; b++) { | |
for (int c = 1; c+b+a < 1001; c++) { | |
if (a * a + b * b == c * c) { | |
p[a + b + c]++; | |
} | |
} | |
} | |
} |
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
#Is source/target an IP v4? | |
if len(rule['IpRanges']) > 0: | |
for ip_range in rule['IpRanges']: | |
cidr_block = ip_range['CidrIp'] | |
print("%s,%s,%s,%s,%s,%s" % ("", "", "", ip_protpcol, port_range, cidr_block, description)) | |
#Is source/target an IP v6? | |
if len(rule['Ipv6Ranges']) > 0: | |
for ip_range in rule['Ipv6Ranges']: | |
cidr_block = ip_range['CidrIpv6'] |
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, { Component } from 'react' | |
class App extends React.Component { | |
state = { | |
text: 'Peter' | |
} | |
divRef = React.createRef() | |
handleChange = (e) => { |
NewerOlder