Navigation breakpoints for WP Block Theme

From Jakson's Youtube video - https://youtu.be/1M2g4e9vq4w?si=pV5ESugkGk0QrMN_
/* -- Navigation breakpoints -- */
/* 1. Global / Mobile State: Force the hamburger menu by default */
body .wp-block-navigation__responsive-container-open:not(.always-shown) {
	display: flex !important;
}
body .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
	display: none !important;
}

/* 2. Desktop State: Restore normal row layout & click-dropdown behavior at 960px */
@media (min-width: 961px) {
	body .wp-block-navigation__responsive-container-open:not(

1111. Maximum Nesting Depth of Two Valid Parentheses Strings

A string is a valid parentheses string (denoted VPS) if and only if it consists of "(" and ")" characters only, and: It is the empty string, or It can be written as AB (A concatenated with B), where A and B are VPS's, or It can be written as (A), where A is a VPS. We can similarly define the nesting depth depth(S) of any VPS S as follows: depth("") = 0 depth(A + B) = max(depth(A), depth(B)), where A and B are VPS's depth("(" + A + ")") = 1 + depth(A), where A is a VPS. For example, "", "()()", and "()(()())" are VPS's (with nesting depths 0, 1, and 2), and ")(" and "(()" are not VPS's. Given a VPS seq, split it into two disjoint subsequences A and B, such that A and B are VPS's (and A.length + B.length = seq.length). The subsequences may not necessarily be contiguous. For example, for the sequence 123456789, one possible split is: A = {1, 3, 5, 7, 9}, B = {2, 4, 6, 8}. This corresponds to the output [0, 1, 0, 1, 0, 1, 0, 1, 0] where 0 indicates membership in A and 1 indicates membership in B. Now choose any such A and B such that max(depth(A), depth(B)) is the minimum possible value. Return an answer array (of length seq.length) that encodes such a choice of A and B: answer[i] = 0 if seq[i] is part of A, else answer[i] = 1. Note that even though multiple answers may exist, you may return any of them.
/**
 * @param {string} seq
 * @return {number[]}
 */
var maxDepthAfterSplit = function(seq) {
    const ans = [];
    let depth = 0;

    for (const ch of seq) {
        if (ch === '(') {
            // Enter the next nesting level.
            depth++;

            // Alternate levels between A (0) and B (1).
            ans.push(depth % 2);
        } else {
            // Matching ')' belongs to the same group
            // as its corresponding '('.
            ans.push(depth % 2);

         

Bankstatements Knowledge


What are the steps:


Parser formats:
  gts rejections: 
    Leasing: 
      camt 053.001.08
      camt 054.001.02 file is just archived! So the "process" method just returns mono.empty.
    Financing:
      camt 053.001.08
      NO camt54!
  
  gts self-payer:
    Leasing and Financing: camt 053.001.08
  
  gps rejections:
    Leasing:
      pain00200103
    Financing no gps feature

Returns boolean True/False of an environment variable (to be used in settings.py)

def env_to_bool(name, default=False):
    # returns boolean True/False of an environment variable
    # usage examples:
    #   env_to_bool("DEBUG")
    #   env_to_bool("DEBUG", default=True)
    # consider adding more options, like "on", "enabled", "y" etc.
    return os.environ.get(name, str(default)).strip().lower() in (
        "true", "yes", "1"
    )

2267. Check if There Is a Valid Parentheses String Path

A parentheses string is a non-empty string consisting only of '(' and ')'. It is valid if any of the following conditions is true: It is (). It can be written as AB (A concatenated with B), where A and B are valid parentheses strings. It can be written as (A), where A is a valid parentheses string. You are given an m x n matrix of parentheses grid. A valid parentheses string path in the grid is a path satisfying all of the following conditions: The path starts from the upper left cell (0, 0). The path ends at the bottom-right cell (m - 1, n - 1). The path only ever moves down or right. The resulting parentheses string formed by the path is valid. Return true if there exists a valid parentheses string path in the grid. Otherwise, return false.
/**
 * @param {character[][]} grid
 * @return {boolean}
 */
var hasValidPath = function(grid) {
    const m = grid.length;
    const n = grid[0].length;
    
    // 1. Quick initial checks
    if ((m + n - 1) % 2 !== 0) return false;
    if (grid[0][0] === ')' || grid[m - 1][n - 1] === '(') return false;
    
    // Max possible balance k cannot exceed (m + n) / 2
    const maxK = Math.floor((m + n) / 2) + 1;
    
    // Memoization table: memo[i][j][k] initialized to -1
    const memo = Array.f

RTL admin helpers for list display & forms

# /common/admin_helpers.py
# RTL admin helpers for list display & forms

"""
# Example usage in admin.py

from common.admin_helpers import rtl_list_field, rtl_form_field


class NotificationTypeAdminForm(forms.ModelForm):
    class Meta:
        model = NotificationType
        fields = "__all__"

        widgets = {
            "field1": rtl_form_field(), # default is text input
            "field2": rtl_form_field(forms.Textarea, rows=5), # change to textarea
            "fiel

1614. Maximum Nesting Depth of the Parentheses

Given a valid parentheses string s, return the nesting depth of s. The nesting depth is the maximum number of nested parentheses.
/**
 * @param {string} s
 * @return {number}
 */
var maxDepth = function(s) {
    let currentDepth = 0;
    let maxDepth = 0;

    for (const char of s) {
        if (char === '(') {
            // Entering a deeper level of nesting
            currentDepth++;

            // Record the maximum depth seen so far
            maxDepth = Math.max(maxDepth, currentDepth);
        } else if (char === ')') {
            // Leaving the current nesting level
            currentDepth--;
        }
    }

# ContrastiveGradientLow

# ContrastiveGradientLow An attention-based predictive framework for respondent-level health-information-seeking prediction from heterogeneous population-health survey data. ## Overview ContrastiveGradientLow is a structured tabular learning framework designed to predict whether an individual reports seeking health or medical information. The framework is developed for population-health survey data containing heterogeneous numerical, ordinal, categorical, and missing-value features. The model combines: - **Feature-Level Attention** to construct respondent-specific representations from heterogeneous predictors. - **Supervised Contrastive Learning** to organize latent representations according to the observed behavioral outcome. - **Gradient Stabilization** to control unstable parameter updates during joint optimization. - **Low-Rank Structure Mapping** to reduce redundant latent dimensions while retaining prediction-relevant information. - **Constraint-Driven Regularization** to preserve ordinal measurement structure, encourage coverage of theoretically relevant health-information features, and improve robustness to alternative representations of missing responses. The framework is intended for predictive modeling and does **not** estimate causal effects of education, language proficiency, health literacy, or communication interventions. ## Prediction Task Given respondent-level characteristics, the model estimates the probability that a respondent reports having looked for health or medical information. The predictors include harmonized variables related to: - Health communication - Health literacy and information comprehension - Education and language-related characteristics - Demographic and socioeconomic characteristics - Contextual health-information variables The prediction target is binary health-information-seeking behavior. ## Dataset Experiments use four independent public-use cohorts from the **Health Information National Trends Survey (HINTS 5)** administered by the U.S. National Cancer Institute: | Cohort | Year | Respondents | | --- | ---: | ---: | | HINTS 5 Cycle 1 | 2017 | 3,285 | | HINTS 5 Cycle 2 | 2018 | 3,504 | | HINTS 5 Cycle 3 | 2019 | 5,438 | | HINTS 5 Cycle 4 | 2020 | 3,865 | Each survey cycle is modeled independently rather than concatenated or treated as longitudinal observations. Official HINTS public-use data, questionnaires, codebooks, and methodology documentation are available from the National Cancer Institute HINTS website. ## Architecture The main modeling pipeline is: ```text Structured HINTS Survey Data | v Feature Encoding | v Feature-Level Attention | v Respondent Representation / \ v v Supervised Low-Rank Contrastive Mapping Learning \ / v v Binary Classifier | v Probability of Health-Information-Seeking ``` Three survey-oriented soft constraints are incorporated during training: 1. **Ordinal-Scale Preservation** — encourages learned representations of ordinal response categories to preserve their known ordering. 2. **Theory-Guided Attention Coverage** — discourages the model from systematically ignoring prespecified health-information-related feature groups. 3. **Missing-Response Consistency** — reduces prediction sensitivity to alternative representations of non-substantive missing survey responses. ## Training Objective The complete objective combines classification, supervised contrastive learning, low-rank reconstruction, and domain-constraint regularization: ```text L_total = L_cls + beta * L_con + mu * L_lr + eta * L_c ``` where: - `L_cls` is the binary classification loss. - `L_con` is the supervised contrastive loss. - `L_lr` is the low-rank reconstruction loss. - `L_c` is the survey-oriented constraint penalty. Gradient stabilization is applied separately through global gradient-norm clipping. ## Experimental Setup The reported experimental configuration uses: | Setting | Value | | --- | --- | | Train / Validation / Test | 70% / 15% / 15% | | Repeated Runs | 5 | | Feature Latent Dimension | 64 | | Contrastive Projection Dimension | 32 | | Low-Rank Dimension | 16 | | Contrastive Temperature | 0.10 | | Optimizer | AdamW | | Initial Learning Rate | 1e-3 | | Weight Decay | 1e-4 | | Learning-Rate Schedule | Cosine decay | | Batch Size | 128 | | Maximum Epochs | 100 | | Early-Stopping Patience | 15 epochs | | Gradient Clipping Threshold | 1.0 | | Model-Selection Metric | Validation ROC-AUC | All preprocessing and model-selection operations are fitted using training or validation data only. Test labels are not used for preprocessing, hyperparameter selection, early stopping, or threshold determination. ## Benchmarks ContrastiveGradientLow is evaluated against six tabular classification baselines: - Logistic Regression - Random Forest - XGBoost - Multilayer Perceptron - TabNet - FT-Transformer All methods use the same respondent-level partitions and a common evaluation protocol. ## Results Across the four HINTS 5 cohorts, ContrastiveGradientLow achieved mean ROC-AUC values between **81.57 and 82.21**. | Cohort | ContrastiveGradientLow ROC-AUC | FT-Transformer ROC-AUC | | --- | ---: | ---: | | Cycle 1 (2017) | 81.86 | 80.17 | | Cycle 2 (2018) | 82.03 | 80.36 | | Cycle 3 (2019) | 81.57 | 80.02 | | Cycle 4 (2020) | 82.21 | 80.48 | Component-wise ablation experiments showed reduced mean predictive performance when feature-level attention, contrastive structure matching, gradient stabilization, low-rank mapping, or constraint-driven learning was removed. ## Evaluation Metrics The project evaluates predictive performance using: - Accuracy - Precision - Recall - F1-score - ROC-AUC ROC-AUC is used as the primary model-selection metric. Pairwise ROC-AUC differences are evaluated with paired bootstrap resampling and Holm adjustment for multiple comparisons. ## Installation Repository code and dependency files will be added here. A typical setup will look like: ```bash git clone <repository-url> cd ContrastiveGradientLow python -m venv .venv source .venv/bin/activate pip install -r requirements.txt ``` On Windows: ```bash .venv\Scripts\activate ``` ## Usage Training and evaluation scripts will be documented once the implementation is added to the repository. A future command-line workflow may follow this structure: ```bash python train.py --config configs/default.yaml python evaluate.py --checkpoint <checkpoint-path> ``` The exact commands should be updated to match the final repository structure. ## Reproducibility The experimental design uses five predefined random seeds. For each seed, the proposed model and all comparison methods use the same stratified train, validation, and test partitions. To reproduce the reported experiments, the repository should include: - Data preparation and harmonization scripts - Model implementation - Baseline implementations or wrappers - Training configuration files - Fixed random seeds - Evaluation scripts - Ablation configurations - Hyperparameter sensitivity configurations ## Data Availability The study uses publicly available, de-identified HINTS data from the U.S. National Cancer Institute. Users should obtain the original public-use datasets and accompanying documentation directly from the official HINTS repository and comply with the applicable HINTS data-use and confidentiality provisions. This repository should not redistribute source data unless redistribution is explicitly permitted by the corresponding data license and terms of use. ## Important Scope Note ContrastiveGradientLow learns predictive associations from observational, cross-sectional survey data. Model outputs and attention weights must not be interpreted as causal effects or evidence that changing a predictor will change health-information-seeking behavior. Before operational public-health use, additional external validation, calibration analysis, subgroup performance assessment, and evaluation in prospective or intervention-specific datasets are required. ## Citation If you use this project in academic work, please cite the associated paper: ```bibtex @article{hu_contrastivegradientlow, title = {Predicting Health-Information-Seeking Behavior from Population Health Survey Data Using Attention-Based Contrastive Representation Learning}, author = {Hu, Chunyan}, note = {Citation details to be updated upon publication} } ``` ## License A license has not yet been specified. Before publishing the repository, add an appropriate `LICENSE` file and update this section accordingly. ## Acknowledgments This project uses data from the Health Information National Trends Survey (HINTS), administered by the U.S. National Cancer Institute.
"""
ContrastiveGradientLow
======================

PyTorch implementation of the model described in:

"Predicting Health-Information-Seeking Behavior from Population Health Survey
Data Using Attention-Based Contrastive Representation Learning"

This implementation follows the paper's model structure:
- Feature-specific encoding for numerical, ordinal, and categorical variables
- Feature-level attention
- Supervised contrastive learning
- Low-rank structure mapping
- Binary classification
- Ordin

Organizational Deep Learning Capability and Manufacturing Quality Intelligence — Questionnaire and Analysis Specification

# Questionnaire and analysis specification

Associated manuscript: Organizational Deep Learning Capability and Manufacturing Quality Intelligence in Integrated Circuit Manufacturing

This document describes the measurement items and analysis plan reported in the manuscript. It does not contain individual-level survey responses, simulated responses, or executable analysis code.

## Study design

The study used a cross-sectional electronic questionnaire of professionals working in integrat

unique patient count

WITH
date_range AS (
    SELECT
        DATE '2026-09-01' AS start_date,
        DATE '2026-09-30' AS end_date
),

anc_dedup AS (
    SELECT base_entity_id, MIN(date_created) AS anc_date
    FROM report.anc_register
    GROUP BY base_entity_id
),

ncd_regi_dedup AS (
    SELECT base_entity_id, MIN(date_created) AS ncd_regi_date
    FROM report.ncd_package
    GROUP BY base_entity_id
),

ncd_service_dedup AS (
    SELECT
        po.base_entity_id,
        MIN(po.date_created

merged script MPR July_Anc_Money Receipt

WITH date_range AS (
    SELECT
        DATE '2026-07-01' AS start_date,
        DATE '2026-07-31' AS end_date
),
 
-- 1. Pregnant Mothers
pregnant_mothers AS (
    SELECT
        b.id AS branch_id,
        b.name AS branch_name,
        COALESCE(COUNT(DISTINCT poa.base_entity_id), 0) AS pregnant_mothers
    FROM core.branch b
    LEFT JOIN report.anc_register poa
        ON poa.branch_id::int = b.id
       AND poa.date_created BETWEEN (SELECT start_date FROM date_range)
                        

refered patient

WITH date_range AS (
    SELECT DATE '2026-08-01' AS start_date,
           DATE '2026-08-31' AS end_date
),

base AS (
    SELECT
        rl.id AS refer_id,
        rl.base_entity_id,
        m.first_name AS patient_name,
        m.patient_phone_number AS mobile_number,
        TRIM(TO_CHAR(rl.date_created, 'Month')) AS month,
        DATE(rl.date_created) AS refer_date,
        rl.date_created,

        CASE
            WHEN rl.provider_id = 'FA_Threads_Palashbari_3' THEN 'Sham

Threads Calculated with refund amonut

WITH
-- ============================================================
-- CHANGE THE REPORT DATE RANGE HERE ONLY -- everything below
-- (Part A and Part B) reads from this single place.
-- ============================================================
date_range AS (
    SELECT
        DATE '2026-06-01' AS start_date,
        DATE '2026-08-31' AS end_date
),

anc_dedup AS (
    SELECT base_entity_id, MIN(date_created) AS anc_date
    FROM report.anc_register
    GROUP BY base_entity_id

Refered and Service Patient Details

WITH
-- ============================================================
-- CHANGE THE REPORT DATE RANGE HERE ONLY -- applies to BOTH
-- the referral side and the service side.
-- ============================================================
date_range AS (
    SELECT DATE '2026-08-01' AS start_date,
           DATE '2026-08-31' AS end_date
),

-- ============================================================
-- REFERRAL SIDE
-- ============================================================

Refered and Service query for email

WITH
date_range AS (
    SELECT DATE '2026-09-01' AS start_date,
           DATE '2026-09-30' AS end_date
),

referral_events AS (
    SELECT
        rl.base_entity_id,
        DATE(rl.date_created) AS refer_date
    FROM report.refer_list rl
    WHERE rl.provider_id IN (
            'FA_Threads_Palashbari_3','FA_Threads_Palashbari_4','FA_Threads_Palashbari_5',
            'FA_Threads_Ashulia_1','FA_Threads_Ashulia_3','FA_Threads_Ashulia_4',
            'FA_Threads_Ashulia_5','FA_Threads_Palashb

1807. Evaluate the Bracket Pairs of a String

You are given a string s that contains some bracket pairs, with each pair containing a non-empty key. For example, in the string "(name)is(age)yearsold", there are two bracket pairs that contain the keys "name" and "age". You know the values of a wide range of keys. This is represented by a 2D string array knowledge where each knowledge[i] = [keyi, valuei] indicates that key keyi has a value of valuei. You are tasked to evaluate all of the bracket pairs. When you evaluate a bracket pair that contains some key keyi, you will: Replace keyi and the bracket pair with the key's corresponding valuei. If you do not know the value of the key, you will replace keyi and the bracket pair with a question mark "?" (without the quotation marks). Each key will appear at most once in your knowledge. There will not be any nested brackets in s. Return the resulting string after evaluating all of the bracket pairs.
/**
 * @param {string} s
 * @param {string[][]} knowledge
 * @return {string}
 */
var evaluate = function(s, knowledge) {
    // Convert knowledge into a Map:
    // [["name", "bob"], ["age", "two"]]
    // becomes:
    // name -> bob
    // age  -> two
    const map = new Map(knowledge);

    const result = [];
    let i = 0;

    while (i < s.length) {

        // If we find an opening bracket,
        // we need to extract the key inside it.
        if (s[i] === "(") {
            let j = i +