/**
* @param {string} word
* @return {string}
*/
var compressedString = function(word) {
// Initialize an empty string to store the compressed result
let comp = '';
// While there are characters left in the word
while (word.length > 0) {
// Get the current character to process
let currentChar = word[0];
// Initialize the count for the current character
let count = 0;
// Count the number of consecutive occurrences of the current charact
```
git add .
````
```
git commit --amend --no-edit
```
Si hace falta actualizar en Github
```
git push --force
```
SELECT CASE
WHEN EXISTS (
SELECT 1
FROM fact_combination_selections_temp src
JOIN $ENRICHED_SCHEMA.fact_combination_selections tgt
ON src.combination_selection_rn = tgt.combination_selection_rn
AND src.exchange_rate = tgt.exchange_rate
AND src.bet_resettled_flag = tgt.bet_resettled_flag
) THEN 'true'
ELSE 'false'
END AS match_exists;
df = df.astype({col: 'float32' for col in df.select_dtypes(include='float64').columns})
SELECT CASE
WHEN EXISTS (
SELECT 1
FROM fact_combination_selections_temp src
JOIN $ENRICHED_SCHEMA.fact_combination_selections tgt
ON src.combination_selection_rn = tgt.combination_selection_rn
AND src.exchange_rate = tgt.exchange_rate
AND src.bet_resettled_flag = tgt.bet_resettled_flag
) THEN 'true'
ELSE 'false'
END AS match_exists;
boottime=`sysctl -n kern.boottime | awk '{print $4}' | sed 's/,//g'`
unixtime=`date +%s`
timeAgo=$(($unixtime - $boottime))
uptime=`awk -v time=$timeAgo 'BEGIN { seconds = time % 60; minutes = int(time / 60 % 60); hours = int(time / 60 / 60 % 24); days = int(time / 60 / 60 / 24); printf("%.0f days, %.0f:%.0f:%.0f", days, hours, minutes, seconds); exit }'`
echo "Uptime: " $uptime
cal | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/./#/g') /"
import React from 'react';
const Dropdown = ({ options, onSelect }) => {
return (
onSelect(e.target.value)}> {options.map((option) => ( {option.label} ))}
);
};
export default Dropdown;
import React from 'react';
const Spinner = ({ size, color }) => {
const spinnerStyle = {
width: size,
height: size,
borderTopColor: color,
borderLeftColor: 'transparent',
animation: 'spin 1s linear infinite',
borderWidth: '2px',
borderStyle: 'solid',
borderRadius: '50%',
};
return (
);
};
Spinner.defaultProps = {
size: '6',
color: 'rgba(59, 130, 246, 1)',
};
export default Spinner;
import React from 'react';
import PropTypes from 'prop-types';
const Button = ({ type, className, children, ...props }) => {
return (
type={type}
className={className}
{...props}
>
{children}
);
};
Button.propTypes = {
type: PropTypes.oneOf(['button', 'submit', 'reset']),
className: PropTypes.string,
children: PropTypes.node.isRequired,
};
Button.defaultProps = {
type: 'button',
className: '',
};
export default Button;
import React, { useState } from 'react';
const ImageSlider = ({ images }) => {
const [currentIndex, setCurrentIndex] = useState(0);
const nextSlide = () => setCurrentIndex((prevIndex) => (prevIndex === images.length - 1 ? 0 : prevIndex + 1));
const prevSlide = () => setCurrentIndex((prevIndex) => (prevIndex === 0
images.length - 1 : prevIndex - 1));
return (
Prev Next
);
};
export default ImageSlider;
import React, { useState } from 'react';
const Tabs = ({ tabs }) => {
const [activeTab, setActiveTab] = useState(0);
return (
{tabs.map((tab, index) => ( key={index} className={`tab ${index === activeTab ? 'active' : ''}`} onClick={() => setActiveTab(index)} > {tab.title}
))}
{tabs[activeTab].content}
);
};
export default Tabs;
import React from 'react';
const Modal = ({ isOpen, onClose, children }) => {
return isOpen ? (
{children} Close
) : null;
};
export default Modal;
import { useState, useEffect } from 'react';
const useFetch = (url) => {
const [data, setData] = useState(null);
const [loading, setLoading] = useState(true);
useEffect(() => {
const fetchData = async () => {
const response = await fetch(url);
const data = await response.json();
setData(data);
setLoading(false);
};
fetchData();
}, [url]);
return { data, loading };
};
export default useFetch;
import React, { useState } from 'react';
const Form = () => {
const [value, setValue] = useState('');
const handleChange = (e) => setValue(e.target.value);
const handleSubmit = (e) => {
e.preventDefault();
// Handle form submission
};
return (
Submit
);
};
export default Form;