sqlite database

from sqlalchemy import create_engine, Column, Integer, String, DateTime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

# SQLite Database (local file - no configuration needed)
DATABASE_URL = "sqlite:///./complaints.db"

engine = create_engine(DATABASE_URL, connect_args={"check_same_thread": False})
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()

class Complaint(Base):
    __tablen

1411. Number of Ways to Paint N × 3 Grid

You have a grid of size n x 3 and you want to paint each cell of the grid with exactly one of the three colors: Red, Yellow, or Green while making sure that no two adjacent cells have the same color (i.e., no two cells that share vertical or horizontal sides have the same color). Given n the number of rows of the grid, return the number of ways you can paint this grid. As the answer may grow large, the answer must be computed modulo 109 + 7.
/**
 * @param {number} n
 * @return {number}
 */
var numOfWays = function(n) {
    const MOD = 1_000_000_007;

    // a = number of ABC patterns for the current row
    // b = number of ABA patterns for the current row
    let a = 6;  // ABC has 6 permutations
    let b = 6;  // ABA also 6 valid patterns

    // Build row by row using the recurrence
    for (let i = 2; i <= n; i++) {
        // Compute next row counts based on transitions
        let nextA = (2 * a + 2 * b) % MOD;  // ABC -> ABC

how to know what shell is using a system?

echo $SHELL

pandas filter

# Filter only >90Days and >180Days
filtered_df = open_aging_df[open_aging_df['Age_Bucket'].isin(['>90Days', '>180Days'])]

# Pivot table with complaint type + age bucket
pi_data_df = pd.pivot_table(
    filtered_df,
    values='CLOSED/OPEN',        
    index=['COMPLAINT TYPE'],       
    columns=['Age_Bucket','DEPT'], 
    aggfunc='count',
    fill_value=0
)

# ➡️ Add Grand Total column (row-wise sum)
pi_data_df['Grand_Total'] = pi_data_df.sum(axis=1)

# ➡️ Add Grand Total row 

961. N-Repeated Element in Size 2N Array

You are given an integer array nums with the following properties: nums.length == 2 * n. nums contains n + 1 unique elements. Exactly one element of nums is repeated n times. Return the element that is repeated n times.
/**
 * @param {number[]} nums
 * @return {number}
 */
var repeatedNTimes = function(nums) {
    // We'll use a Set to track which numbers we've seen.
    const seen = new Set();
    
    // Walk through each number in the array
    for (let num of nums) {
        // If we've seen this number before, it must be the one
        // that is repeated n times (because only one element repeats).
        if (seen.has(num)) {
            return num;
        }
        
        // Otherwise, record it as s

how to remove packages using dnf

sudo dnf remove nginx

how to install packages using dnf

dnf install nginx

how to update all packages using dnf?

dnf upgrade or dnf update

tech documentation

### Install OpenAI SDK across Multiple Languages

Source: https://platform.openai.com/docs/quickstart_api-mode=chat

This section provides instructions for installing the official OpenAI SDK or client libraries for various programming languages. These installations are prerequisites for making API calls to the OpenAI service.

```JavaScript
npm install openai
```

```Python
pip install openai
```

```C#
dotnet add package OpenAI
```

```Java
<dependency>
  <groupId>com.openai</groupId>
  <artifa

TestSnippet

# Notes

row code

import sys
import pandas as pd
import numpy as np
from flask import Flask, jsonify, request
from src.logging.logger import get_logger
from src.exceptions.exception import CustomException

logger = get_logger(__name__)

# flask_app.py

# -----------------------------------------------------------------------------
# Try to import custom modules
# -----------------------------------------------------------------------------
try:
    from src.constants.paths import dataset_path
    

dev-knolwlege-sa

import React, { useState, useEffect } from 'react';
import { useQuery, useQueryClient } from '@tanstack/react-query';
import { base44 } from '@/api/base44Client';
import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";
import { Skeleton } from "@/components/ui/skeleton";
import { 
    ArrowLeft, Hash, Eye, Clock, User, Pencil, Trash2,
    ChevronRight, BookOpen
} from 'lucide-react';
import { motion } from 'framer-motion';
import { Link, useNavigate } from

66. Plus One

You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to-right order. The large integer does not contain any leading 0's. Increment the large integer by one and return the resulting array of digits.
/**
 * @param {number[]} digits
 * @return {number[]}
 */
var plusOne = function(digits) {
    // Start from the last digit and move left
    for (let i = digits.length - 1; i >= 0; i--) {

        // If the current digit is less than 9, we can safely increment it
        // and return immediately because no carry is needed.
        if (digits[i] < 9) {
            digits[i]++;        // simple increment
            return digits;      // done - no ripple effect
        }

        // If the digi

How to remove packages in apt

## `apt remove`

### What it does

`apt remove` **uninstalls a package** from your system, but **keeps its configuration files**.

### In practice

* The program itself is removed
* System-wide config files (usually in `/etc`) are **left behind**
* This is useful if you think you might reinstall the package later and want to keep its settings

### Example

```bash
sudo apt remove nginx
```

➡️ Removes `nginx`, but keeps its configuration files.

---

## `apt autoremove`

### What it does

`apt a

1970. Last Day Where You Can Still Cross

There is a 1-based binary matrix where 0 represents land and 1 represents water. You are given integers row and col representing the number of rows and columns in the matrix, respectively. Initially on day 0, the entire matrix is land. However, each day a new cell becomes flooded with water. You are given a 1-based 2D array cells, where cells[i] = [ri, ci] represents that on the ith day, the cell on the rith row and cith column (1-based coordinates) will be covered with water (i.e., changed to 1). You want to find the last day that it is possible to walk from the top to the bottom by only walking on land cells. You can start from any cell in the top row and end at any cell in the bottom row. You can only travel in the four cardinal directions (left, right, up, and down). Return the last day where it is possible to walk from the top to the bottom by only walking on land cells.
/**
 * @param {number} row
 * @param {number} col
 * @param {number[][]} cells
 * @return {number}
 */
var latestDayToCross = function(row, col, cells) {
    // Helper: check if it's possible to cross on a given day
    function canCross(day) {
        // Build a grid where 1 = water, 0 = land
        const grid = Array.from({ length: row }, () => Array(col).fill(0));

        // Flood the first `day` cells
        for (let i = 0; i < day; i++) {
            const r = cells[i][0] - 1; // convert

how to refresh list of available packages in apt?

apt update