thingnario logger 1.0

thingnario logger 1.0
*.pyc
/.venv/

670. Maximum Swap

You are given an integer num. You can swap two digits at most once to get the maximum valued number. Return the maximum valued number you can get.
/**
 * @param {number} num
 * @return {number}
 */
var maximumSwap = function(num) {
    // Convert the number to an array of digits
    let digits = num.toString().split('').map(Number);

    // Create a copy of the digits array to track the max digits to the right
    let maxDigits = [...digits];
    for (let i = maxDigits.length - 2; i >= 0; i--) {
        maxDigits[i] = Math.max(maxDigits[i], maxDigits[i + 1]);
    }

    // Traverse the digits array to find the first place where a swap woul

error errores quid php js

Si queremos en php mostrar un texto como error:

``` 
return "<div class='advertencia'>" .__("Identificador de herramienta incorrecto") . "</div>"; 
```
 
Si es una función que se llama por OPS, por js, podemos retornar
```
$this->quid->error("lo que sea");
```

🟣 ETF UP_ & DOWNTRENDS

import pandas as pd
import yfinance as yf

etf = 'SPY'
# etf = 'QQQ
trend = "downtrend"
# trend = "uptrend"
window = 30
year = 2024

start_date = '2019-01-01'
end_date = '2024-10-01'

data = yf.download(etf, start=start_date, end=end_date)
filtered_data = data['Adj Close'].to_frame('close_price')
filtered_data.index.names = ['period']
# print(filtered_data)
trends_detected = pytrendseries.detecttrend(filtered_data, trend=trend, window=window)
pytrendseries.vizplot.plot_trend(filtered_data, trend

削除されたオブジェクトがガベージコレクションされたかどうか監視する

const registry = new FinalizationRegistry((heldValue) => {
  console.log(`${heldValue} がガベージコレクションされました`);
});

function createObject() {
  const obj = {};
  // objがGCされたときにコールバックが呼ばれるようにする
  registry.register(obj, "対象オブジェクト");
  return obj;
}

let myObject = createObject();

// myObjectを明示的にnullに設定し、GCの対象にする
myObject = null;

1405. Longest Happy String

A string s is called happy if it satisfies the following conditions: s only contains the letters 'a', 'b', and 'c'. s does not contain any of "aaa", "bbb", or "ccc" as a substring. s contains at most a occurrences of the letter 'a'. s contains at most b occurrences of the letter 'b'. s contains at most c occurrences of the letter 'c'. Given three integers a, b, and c, return the longest possible happy string. If there are multiple longest happy strings, return any of them. If there is no such string, return the empty string "". A substring is a contiguous sequence of characters within a string.
/**
 * @param {number} a
 * @param {number} b
 * @param {number} c
 * @return {string}
 */
var longestDiverseString = function (a, b, c) {
    let result = ''; // Initialize the result as an empty string
    let prev = [null, null]; // Keep track of the last two characters added to result
    let len = 0; // Initialize the length tracker

    // Run the loop until all characters are exhausted
    while (a > 0 || b > 0 || c > 0) {
        // If 'a' has the highest count and doesn't violate the "a

CI_Swap_CS0001843

/* Tags: Swap Merge History Duplicate Correlation ID Health Dashboard Dedupe Task SCCM SerialNumber Sync
Migrates historical data (IN/PRB/CHG, etc) from duplicate CI we are deleting to the correct CI we are keeping
Do cascade delete while deleting the duplicate CI.
Close De-Dupe task.
Clear the Discovery source & correlation ID for CI we are keeping.
Clear the Correlation ID data from Sources (sys_object_source) table.
*/

// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// NOTE! Ensure all sections of this 

Prometheus

### Default port > 9090 ### Default root folder `cd /etc/prometheus` ### Prometheus service file - `sudo systemctl edit --full prometheus` - `sudo nano /etc/systemd/system/prometheus.service` ### Environment file `sudo nano /etc/default/prometheus` ``` ARGS="--web.config.file=/etc/prometheus/web-prometheus-config.yml" ``` ### Edit prometheus config file `nano /etc/prometheus/prometheus.yml` ### Prometheus web config file `sudo nano /etc/prometheus/web-prometheus-config.yml` ### Check rules: `sudo -u prometheus promtool check rules /etc/prometheus/rules/general.yml` ### Clean rules: `rm -rf /etc/prometheus/rules/*` ### Work with service - `sudo systemctl stop prometheus && sudo systemctl status prometheus` - `sudo systemctl daemon-reload && sudo systemctl restart prometheus && sudo systemctl status prometheus` - `sudo journalctl -n 1000 -fu prometheus`
```plaintext
etc
  └── prometheus
      ├── apps.json
      ├── password_file.txt
      ├── prometheus.yml
      ├── rules
      │   ├── general.yml
      └── web-prometheus-config.yml
```

API

# triton-lang API

## base

```
import triton
import triton.language as tl

@triton.jit
def kernel(...):
  ...
  
def execute(...):
  kernel[(x, y, z)](...)
```

## 1

```
pid = tl.program_id(axis=0)
```

captcha block rgpd

const cookieAxeptio = () => {
	const checkCapatcha = (vendorChoice) => {
		// Vérifie si le service reCAPTCHA a été accepté

		if (vendorChoice) {
			console.log("rend");

			//Si le consentement pour reCAPTCHA est donné, charger dynamiquement le script Google reCAPTCHA
			script = document.getElementById("gform_recaptcha-js");
			if (!script) {
				console.log("scrip loaded");
				var recaptchaScript = document.createElement("script");
				recaptchaScript.src =
					"https://www.google.com/reca

Poetry cheatsheet

Manual y listado de comandos para operara con *poetry*.
# Comandos básicos

Poetry es una herramienta de gestión de dependencias y empaquetado en Python que simplifica la gestión de proyectos. Aquí tienes algunos comandos básicos para manejar dependencias con Poetry:

## 1. **Inicializar un proyecto nuevo**:
   ```sh
   poetry init
   ```
   Este comando te guiará a través de una serie de preguntas para configurar un nuevo proyecto de Poetry. Básicamente crea el archivo pyproject.toml. Este archivo es utilizado para definir las dependencias d

ScrollFixed

スクロール制御&制御の解除をコントロールするユーチャリティークラス
// --------------------------
// ES Utils / ScrollFixed
// --------------------------

export class ScrollFixed {
    /**
     * スクロール制御&スクロール制御の解除をコントロール
     * @class
     */
    constructor() {
        /** body要素を取得 */
        this._bodyElement = document.body;

        /** スクロール量を保存するための変数 */
        this._scrollY = 0;

        /** style属性を保存するための変数 */
        this._previousStyle = "";

        /** 重複して発火しないようにするフラグ変数 */
        this._isScrollFixed = false;
    }

    /**
     * スクロールを制御する
 

MediaQuery

`matchMedia`を汎用的に使用できるユーチャリティークラス
// -------------------------
// ES Utils / MediaQuery
// -------------------------

export class MediaQuery {
    /**
     * ブレイクポイントによってコールバックを呼び出す
     * @class
     * @param {object} options 設定
     * @see https://developer.mozilla.org/ja/docs/Web/API/MediaQueryList ドキュメント
     * @see https://zenn.dev/no4_dev/articles/878f4afbff6668d4e28a-2 参考記事
     */
    constructor(options = {}) {
        this._options = {
            breakpoint: options.breakpoint || null,
            onEnter: options.on

ScrollObserver

`IntersectionObserver API`を汎用的に使用出来るユーチャリティークラス
// -----------------------------
// ES Utils / ScrollObserver
// -----------------------------

export class ScrollObserver {
    /**
     * 要素を監視し、画面内に入る/出るによってコールバックを呼び出す
     * @class
     * @param {HTMLElement} element 監視するDOM要素
     * @param {object} [options] オプション設定
     * @param {Function} [options.onEnter] 要素が画面に入ったときのコールバック
     * @param {Function} [options.onLeave] 要素が画面から出たときのコールバック
     * @param {HTMLElement|null} [options.root] ビューポートとして使う要素
     * @param {string} [options.rootMarg

Automated code style and linting (ruff, mypy)

# Automated Code Style

## black (ESSENTIAL and alternative to ruff)
Code style formatting automatically.
Possible in pre-commit.
https://black.readthedocs.io/en/stable/
`> black main.py`

## ruff (ESSENTIAL and alternative to black allthough more complete)
Code style linting for checking and formatting automatically.
It is more completed than black because not only include formatting, checking as well.
Possible in pre-commit and poetry.
https://pypi.org/project/ruff/
```
ruff check