tag manager - google

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-589RVRQD');</script>
<!-- End Google Tag Manager -->

693. Binary Number with Alternating Bits

Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values.
/**
 * @param {number} n
 * @return {boolean}
 */
var hasAlternatingBits = function(n) {
    // Step 1: Shift n right by 1 to align each bit with its neighbor.
    // Example: n = 10 (1010), n >> 1 = 5 (0101)
    let shifted = n >> 1;

    // Step 2: XOR n with its shifted version.
    // If n has alternating bits, XOR will produce a sequence of all 1s.
    // Example: 1010 ^ 0101 = 1111
    let x = n ^ shifted;

    // Step 3: Check if x is all 1s.
    // A number with all 1s has the property x

01_spec1_planner

import OpenAI from "openai";

const openai = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY,
});

const response = await openai.responses.create({
  prompt: {
    "id": "pmpt_685a3f76760481908057d26c5239b8c301b5a57ddfd41687",
    "version": "8",
    "variables": {
      "insert_request_here": "example insert_request_here",
      "insert_rules_here": "example insert_rules_here",
      "insert_template_here": "example insert_template_here"
    }
  }
});

magic-userscript-show-site-all-userjs

Saved from https://greasyfork.org/en/scripts/421603-magic-userscript-show-site-all-userjs
javascript:(function(){['https://cdn.jsdelivr.net/gh/magicoflolis/Userscript-Plus@master/userscript/dist/magic-userjs.user.js'].map(s=>document.body.appendChild(document.createElement('script')).src=s)})();

mastra memory

# Agent memory

Agents use memory to maintain context across interactions. LLMs are stateless and don't retain information between calls, so agents need memory to track message history and recall relevant information.

Mastra agents can be configured to store message history, with optional [working memory](https://mastra.ai/docs/memory/working-memory) to maintain recent context, [semantic recall](https://mastra.ai/docs/memory/semantic-recall) to retrieve past messages based on meaning, or [o

cc direct

5332480061872406

SoilMoistureCapacitiveSensorV2_setup

#include <Arduino.h>

#define SOIL_MOISTURE_SENSOR_PIN 5

// Add this to .ini file: monitor_speed = 115200

// config personaly
int airValue = 2603;   // sensor in dry air
int waterValue = 1300; // sensor fully inserted in water

void setup() 
{
  Serial.begin(115200);
  delay(1000);
  Serial.println("Starting Soil Moisture Capacitive Sensor V2 initialization...");
}

void loop() 
{
  int soilMoistureRaw = analogRead(SOIL_MOISTURE_SENSOR_PIN);

  // errors check
  if (soilM

useState vs useReducer vs mySolution

import { useState } from "react";

function Cart() {
  const [cart, setCart] = useState({
    items: [],
    total: 0,
    discount: null,
    isLoading: false,
  });

  const addItem = (item) =>
    setCart(prev => ({
      ...prev,
      items: [...prev.items, item],
      total: prev.total + item.price,
    }));

  const removeItem = (id) =>
    setCart(prev => {
      const item = prev.items.find(i => i.id === id);
      return {
        ...prev,
        items: prev.ite

lexonomy

@charset "UTF-8";
/*!
 * Materialize v1.0.0 (http://materializecss.com)
 * Copyright 2014-2017 Materialize
 * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
 */
.materialize-red {
  background-color: #e51c23 !important;
}

.materialize-red-text {
  color: #e51c23 !important;
}

.materialize-red.lighten-5 {
  background-color: #fdeaeb !important;
}

.materialize-red-text.text-lighten-5 {
  color: #fdeaeb !important;
}

.materialize-red.lighten-4 {
  background-

401. Binary Watch

A binary watch has 4 LEDs on the top to represent the hours (0-11), and 6 LEDs on the bottom to represent the minutes (0-59). Each LED represents a zero or one, with the least significant bit on the right. For example, the below binary watch reads "4:51". Given an integer turnedOn which represents the number of LEDs that are currently on (ignoring the PM), return all possible times the watch could represent. You may return the answer in any order. The hour must not contain a leading zero. For example, "01:00" is not valid. It should be "1:00". The minute must consist of two digits and may contain a leading zero. For example, "10:2" is not valid. It should be "10:02".
/**
 * @param {number} turnedOn
 * @return {string[]}
 */
var readBinaryWatch = function(turnedOn) {
    const results = [];

    // Helper function to count how many 1-bits are in a number
    const bitCount = (num) => {
        // Convert to binary string, count the '1' characters
        return num.toString(2).split('').filter(bit => bit === '1').length;
    };

    // Hours range from 0 to 11 (4 LEDs)
    for (let hour = 0; hour <= 11; hour++) {

        // Pre-calc hour bitcount so we don't

how to check a radio button or checkbox in Playwright?

// https://playwright.dev/docs/api/class-locator#locator-check
// await radioButton.check();
  test("Radio button actions", async ({ page }) => {
    await page.goto("https://testautomationpractice.blogspot.com/");
    const radioButton = page.getByRole("radio").and(page.locator("#male"));
    await radioButton.check();
    await expect(radioButton).toBeChecked();
  });

How to check if a radio button or checkbox is checked in Playright?

// https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-be-checked
// expect(radioButton).toBeChecked();
  test("Radio button actions", async ({ page }) => {
    await page.goto("https://testautomationpractice.blogspot.com/");
    const radioButton = page.getByRole("radio").and(page.locator("#male"));
    await radioButton.check();
    await expect(radioButton).toBeChecked();
  });

BH1750_setup

#include <Arduino.h>
#include <hp_BH1750.h>
#include <Wire.h>

//I2C communcation
#define SDA 8
#define SCL 9

// Add this to .ini file: monitor_speed = 115200

hp_BH1750 bh1750;
//BH1750Quality bh1759_q = BH1750_QUALITY_HIGH; // I don't think is used anywhere

void setup() {
  Serial.begin(115200);
  Wire.begin(SDA, SCL); // Initialize I2C with defined pins
  delay(1000);
  Serial.println("Starting BH1750 sensor initialization...");

  bh1750.begin(BH1750_TO_GROUND); // 0x23

1

Install the opencode-antigravity-auth plugin and add the Antigravity model definitions to ~/.config/opencode/opencode.json by following: https://raw.githubusercontent.com/NoeFabris/opencode-antigravity-auth/dev/README.md

Use CTE (Common Table Expression)


ALTER PROCEDURE [dbo].[GetPOBasicParentDataByParamsForAdvanceBill_SP]
@FromDate date,
@ToDate date,
@POId int = 2011,
@SupplierId int=0,
@CompanyId int=0,
@userId int = 3
AS
	;WITH AlreadyBilledAmount AS (
	SELECT 
		bic.Po_Id,
		SUM(ISNULL(bigc.billAmount,0.00)) - SUM(ISNULL(bigc.Discount,0.00)) as TotalBilledAmount
		FROM dbo.BillInvoice_Parent bip
		INNER JOIN dbo.BillInvoice_Child bic ON bip.ID = bic.Bill_ParentId
		INNER JOIN dbo.BillInvoice_GrandChild bigc ON bigc.Bill_Pare

Python Packaging - One Big Question

# Pourquoi les imports nécessitent une install éditable avec un src layout

## Le problème

Quand tu lances `pytest` depuis la racine du projet, Python cherche les modules dans son `sys.path`. Par défaut, `sys.path` contient le répertoire courant (`.`) et les packages installés. Avec ta structure :

```text
.
├── src/
│   └── mini_etl/
│       ├── __init__.py
│       └── models.py
├── tests/
│   └── test_models.py
```

Python ne trouve pas `mini_etl` parce qu'il n'est **ni à la racine** (il est