OpenWISP2 [ problems & solutions ]

# Problem

OpenWISP custom commands remained **in-progress** because **Celery workers** were stale/hung (lost broker connection or stuck tasks), so jobs were never processed.

# Solution

Restart Celery services (and Daphne optionally) to restore task processing:

```bash
supervisorctl restart celery celery_network celery_monitoring celery_firmware_upgrader celerybeat
supervisorctl restart daphne:asgi0
```

Report Gympass Subscriptions

[HttpGet("report")]
public async Task<string> GenerateReport()
{
    string report = "DATA;NOME;VALOR;RENOVACAO;FUNCIONARIO\n";

    IList<WellhubSubscription> subscriptions = await _wellhubRepository
        .FilterSubscriptions(x => x.DateCreated > new DateTime(2025, 9, 1) && x.Status == SubscriptionStatus.Active);

    List<Guid> saleIds = subscriptions.Select(x => x.SaleId).ToList();
    IList<Sale> sales = await _saleRepository.FilterSales(x => saleIds.Contains(x.Id));

    forea

backend v4

// backend/b2bCheckout.jsw

import { currentMember } from 'wix-members-backend';
import { contacts }      from 'wix-crm-backend';
import wixData           from 'wix-data';
import wixStores         from 'wix-stores-backend';

// --------------------------- Helper: UUID + Country ---------------------------
function pseudoUuid() {
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
    const r = (Math.random() * 16) | 0;
    const v = c === 'x' ? r : (r & 0x3) | 0x8;

2011. Final Value of Variable After Performing Operations

There is a programming language with only four operations and one variable X: ++X and X++ increments the value of the variable X by 1. --X and X-- decrements the value of the variable X by 1. Initially, the value of X is 0. Given an array of strings operations containing a list of operations, return the final value of X after performing all the operations.
/**
 * @param {string[]} operations
 * @return {number}
 */
var finalValueAfterOperations = function(operations) {
    // Step 1: Initialize the variable X to 0
    let X = 0;

    // Step 2: Loop through each operation in the array
    for (let i = 0; i < operations.length; i++) {
        let op = operations[i];

        // Step 3: Check if the operation is an increment
        if (op === "++X" || op === "X++") {
            X += 1; // Increase X by 1
        }
        // Step 4: Check if the o

checkout v3

// /b2b‑checkout.js

import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import { session } from 'wix-storage-frontend';
import { getMemberCheckoutProfile, createOrderFromProfile } from 'backend/b2bCheckout.jsw';

$w.onReady(function () {
  const logs = [];
  resetFields();
  if ($w('#paymentMethodRadio')) {
    $w('#paymentMethodRadio').value = 'invoice';
  }
  if ($w('#submitOrderButton')) {
    $w('#submitOrderButton').disable();
  }
  waitUntilLoggedIn(l

backend v3

// backend/b2bCheckout.jsw

import { currentMember } from 'wix-members-backend';
import { contacts } from 'wix-crm-backend';
import wixData from 'wix-data';
import wixStores from 'wix-stores-backend';

/* --------------------------- Helper: UUID + Country --------------------------- */
function pseudoUuid() {
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
    const r = (Math.random() * 16) | 0;
    const v = c === 'x' ? r : (r & 0x3) | 0x8;
    return v.toStr

How to check if the new architecture is enabled on react native (Hermes/Fabric)

https://stackoverflow.com/questions/57350008/react-native-hermes-is-not-enabled/72530085#72530085 https://stackoverflow.com/questions/72463820/how-to-check-if-the-new-architecture-is-enabled-on-react-native-0-68/76888613#76888613
const isHermes = global?.HermesInternal ? 'Hermes' : 'JSC';
const isFabric = global?.nativeFabricUIManager ? 'Fabric' : 'Paper';

console.log(`Engine: ${isHermes}`);
console.log(`Renderer: ${isFabric}`);

Exploring the Impact of Emotional States on Teamwork Effectiveness in Interprofessional Education Using EEG Data

# Exploring the Impact of Emotional States on Teamwork Effectiveness in Interprofessional Education Using EEG Data ## Description This repository contains the official implementation and supplementary materials of the paper: **“Exploring the Impact of Emotional States on Teamwork Effectiveness in Interprofessional Education Using EEG Data”** by *Chongye Wang (Ningbo University of Finance and Economics)* and *Wei Liu (Sichuan Provincial Maternity and Child Health Care Hospital)*, 2024. This work proposes a novel **EEG-driven collaborative learning framework** that integrates emotional state modeling with interprofessional teamwork analysis. The approach introduces two major components: a **Collaborative Interprofessional Learning Network (CILN)** and a **Dynamic Interaction Strategy (DIS)**. Together, these enhance both the interpretability and robustness of emotion-aware team collaboration models in interprofessional education (IPE). --- ## Framework Overview ### Collaborative Interprofessional Learning Network (CILN) The **CILN** module aims to model knowledge sharing and complementarity among members from different disciplines. It includes three major layers: - **Learner Embedding Module:** Encodes each participant’s cognitive and emotional features from EEG signals. - **Knowledge Fusion Network:** Performs cross-disciplinary information alignment using a convolution–Transformer hybrid backbone. - **Collaborative Optimization Layer:** Adjusts interaction weights based on team diversity and learning compatibility. *Figure 1 (Page 8)* in the paper illustrates the architecture combining CNN, Transformer, and a pre-trained BART encoder to achieve hierarchical EEG feature extraction and semantic fusion. --- ### Dynamic Interaction Strategy (DIS) The **DIS** module models evolving interactions within teams over time. It contains: - **Adaptive Interaction Modeling:** A Graph Convolutional Network (GCN) integrated with temporal attention to capture relationship dynamics. - **Feedback-Driven Collaboration Refinement:** Adjusts team interactions according to real-time feedback signals. *Figure 2 (Page 10)* visualizes the temporal structure of DIS, showing how EEG-based emotional variation influences collaboration flow. --- ## Theoretical Foundations This study is grounded in: - **Social Constructivism Theory** - **Affective Events Theory (AET)** - **Multimodal Learning Theory** The framework combines emotional and cognitive features through a joint optimization function that balances: - **Diversity Regularization (Ldiv)** – promoting heterogeneous team perspectives. - **Compatibility Loss (Lcompat)** – ensuring effective task-oriented cooperation. A dynamic update rule adjusts the interaction matrix over time, enabling continuous adaptation to team feedback. --- ## Experimental Setup ### Datasets The model is trained and evaluated on four benchmark EEG-based emotion datasets: - **DEAP** - **AMIGOS** - **DREAMER** - **ASCERTAIN** These datasets collectively represent a wide range of emotional and cognitive patterns relevant to teamwork and collaborative learning. ### Baseline Models For comparison, several mainstream models were tested: - CNN - BiLSTM - GRU - Transformer - BERT - RoBERTa --- ## Experimental Results | Dataset | Accuracy | F1 Score | AUC | Improvement over RoBERTa | |--------------|-----------|-----------|-------|---------------------------| | DEAP | 93.45% | 92.12% | 93.80% | +2.6% | | AMIGOS | 92.33% | 91.45% | 93.05% | +1.7% | | DREAMER | 92.67% | 91.34% | 93.01% | +2.2% | | ASCERTAIN | 90.89% | 89.78% | 92.34% | +3.4% | *Tables 1 and 2 (Page 19)* of the paper report detailed performance metrics. The proposed **CILN + DIS** combination consistently surpasses baseline methods in all datasets. --- ## Ablation Study An ablation analysis (Page 20) demonstrates that removing any core component (embedding, fusion, or interaction) causes a 4–5% accuracy drop. This confirms the synergistic effect of all three modules in improving team emotion recognition and collaboration modeling. --- ## Key Findings - **Innovation:** First framework integrating EEG-based emotional modeling with interprofessional team learning. - **Performance:** Achieves significant improvements in classification accuracy and robustness across multiple EEG benchmarks. - **Interpretability:** Visual attention maps explain how emotional cues influence teamwork effectiveness. - **Future Directions:** Lightweight deployment using wearable EEG devices and real-time feedback integration. --- ## Mathematical Formulation The learning process is formalized as a multi-objective optimization problem: - Utility Function **U(K, C)** captures team learning gain based on knowledge matrix *K* and collaboration matrix *C*. - Interaction matrix *C* evolves over time using adaptive feedback coefficient *ρt*. - Final objective: maximize *U(K, C)* while minimizing regularization terms *(Ldiv + Lcompat)*. --- ## Requirements - Python ≥ 3.9 - PyTorch ≥ 2.1 - NumPy, Pandas, Matplotlib, tqdm, TensorBoard - GPU: NVIDIA A100 or equivalent for full-scale EEG model training --- ## Project Structure The core implementation consists of five main Python scripts: - **`train.py`** – Entry point for model training. Handles training loops, optimization, checkpoint saving, and logging (≈100 lines). - **`model.py`** – Defines the neural network architecture. Includes feature extraction layers, attention mechanisms, and forward computation (≈100 lines). - **`dataset.py`** – Manages dataset loading and preprocessing. Implements custom `Dataset` and `DataLoader` classes for EEG and image inputs (≈100 lines). - **`utils.py`** – Contains helper utilities and evaluation metrics. Provides functions for accuracy, F1 computation, checkpoint management, and visualization (≈100 lines). - **`inference.py`** – Performs inference using trained models. Loads saved weights, processes test data, and outputs prediction results (≈100 lines). --- ## Results Visualization *Figure 4 (Page 15)* demonstrates the evolving team collaboration graph under the DIS mechanism. It shows stronger node connectivity when team emotion alignment increases, indicating that emotional coherence directly enhances collaborative performance. --- ## Citation If you use this work or build upon it, please cite the following: **Wang, C., & Liu, W. (2024).** *Exploring the Impact of Emotional States on Teamwork Effectiveness in Interprofessional Education Using EEG Data.* *PLOS ONE (under revision).* --- ## License This project is released under the **MIT License**. Please see the LICENSE file for details. --- ## Authors - **Chongye Wang** – Methodology, Implementation, and Experiments - **Wei Liu** – Validation, Writing, and Supervision --- ## Acknowledgments This study was supported by *Ningbo University of Finance and Economics* and *Sichuan Provincial Maternity and Child Health Care Hospital*. The authors declare no conflict of interest.
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from model import HRAN_CGUR_Network
from dataset import EEGDataset
from utils import AverageMeter, accuracy, save_checkpoint, set_seed
import yaml
import os
from tqdm import tqdm


def train_one_epoch(model, loader, criterion, optimizer, device):
    model.train()
    loss_meter, acc_meter = AverageMeter(), AverageMeter()

    for batch in tqdm(loader, desc="Training", ncols=100

backend v2

// backend/b2bCheckout.jsw

import { currentMember } from 'wix-members-backend';
import { contacts } from 'wix-crm-backend';
import wixData from 'wix-data';

function contactToHeader(contact) {
  const firstName = contact?.firstName || contact?.info?.name?.first || '';
  const lastName  = contact?.lastName  || contact?.info?.name?.last  || '';
  const email     = contact?.info?.emails?.[0]?.email || '';
  const company   = contact?.company || contact?.info?.company || '';
  const addr

color-mixでopacity適用後の背景色カラーコードを描画する

<div class="box opacity"></div>
<div class="box opacity-mix"></div>
<div class="box color-mix"></div>

Mob Control

[[mob]]
name = ["exoticbirds:*", "minecraft:pig", "minecraft:cow", "minecraft:chicken"]

[[mob.rule]]
type = "natural"
run = 125

[[mob]]
name = ["epichunt:*"]

[[mob.rule]]
type = "natural"
run = 250

[[mob]]
name = ["treasure2:bound_soul"]

[[mob.rule]]
type = "all"
set.sunburn= 0

[[mob]]
name = ["mocreatures:rat"]

[[mob.rule]]
type = "all"
set.attack=["mincreaft:skeleton"]

[[mob]]
name = ["cave_stuff:purplespringtail", "cave_stuff:grottosculpin"]

[[mob.rule]

1625. Lexicographically Smallest String After Applying Operations

You are given a string s of even length consisting of digits from 0 to 9, and two integers a and b. You can apply either of the following two operations any number of times and in any order on s: Add a to all odd indices of s (0-indexed). Digits post 9 are cycled back to 0. For example, if s = "3456" and a = 5, s becomes "3951". Rotate s to the right by b positions. For example, if s = "3456" and b = 1, s becomes "6345". Return the lexicographically smallest string you can obtain by applying the above operations any number of times on s. A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b. For example, "0158" is lexicographically smaller than "0190" because the first position they differ is at the third letter, and '5' comes before '9'.
/**
 * @param {string} s
 * @param {number} a
 * @param {number} b
 * @return {string}
 */
var findLexSmallestString = function(s, a, b) {
    // Set to keep track of visited strings to avoid revisiting the same state
    const visited = new Set();

    // Queue for BFS traversal, starting with the original string
    const queue = [s];

    // Initialize result with the original string
    let result = s;

    // BFS loop: explore all reachable strings
    while (queue.length > 0) {
        // 

Starting Items

Whirlispring Broom = For Balanced early game flight/travel
Back Slot Curios

reliquified_ars_nouveau:whirling_broom

Eats 66 Mana from Ars Nouveau (Try to buff to 25)

3397. Maximum Number of Distinct Elements After Operations

You are given an integer array nums and an integer k. You are allowed to perform the following operation on each element of the array at most once: Add an integer in the range [-k, k] to the element. Return the maximum possible number of distinct elements in nums after performing the operations.
/**
 * Calculates the maximum number of distinct elements that can be formed
 * by modifying each number within a range of ±k.
 *
 * @param {number[]} nums - Array of integers.
 * @param {number} k - Maximum allowed change per element.
 * @return {number} - Maximum number of distinct elements achievable.
 */
var maxDistinctElements = function(nums, k) {
    // Sort the array to group duplicates and process in ascending order
    nums.sort((a, b) => a - b);

    let prevValue = -Infinity; // Trac

gridの要素同士にborderを表示する

<div class="grid">
  <p class="_item">Item 1</p>
  <p class="_item">Item 2</p>
  <p class="_item">Item 3</p>
  <p class="_item">Item 4</p>
  <p class="_item">Item 5</p>
  <p class="_item">Item 6</p>
  <p class="_item">Item 7</p>
  <p class="_item">Item 8</p>
  <p class="_item">Item 9</p>
  <p class="_item">Item 10</p>
</div>

Exp Fluid Types

casting:molten_experience
justdirethings:xp_fluid_source
pneumaticcraft:memory_essence