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

TotalCMD替代资源管理器

;date:2014-07-06
;用TC替换资源管理器及恢复资源管理器
;主要来自http://blog.xiazhiri.com/tags/totalcmd/的文章,
;又根据http://qing.blog.sina.com.cn/2002017477/77545cc533002ie4.html的文章加了右键用explorer打开
;另外参考了http://blog.csdn.net/lord_is_layuping/article/details/7435989的文章
RegRead, IsExp, HKEY_LOCAL_MACHINE, SOFTWARE\Classes\Folder\shell\open\command, DelegateExecute
If(IsExp="{11dbb47c-a525-400b-9e80-a54615a090c0}")
{
    RegDelete HKEY_LOCAL_MACHINE, SOFTWARE\Classes\Folder\shell\open\command, DelegateExecute
;Direct

ShortCuts快捷方式同步

' 修正后的脚本(重点调整字符串连接格式)
Set WshShell = CreateObject("WScript.Shell")

' 重构命令构建方式(移除行尾注释干扰)
RoboCommand = "robocopy " & _
  Chr(34) & "D:\Settings\ShortCuts" & Chr(34) & " " & _
  Chr(34) & "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ShortCuts" & Chr(34) & " " & _
  "/purge /e /copy:DAT /mt /z /xc /xn /xo /mot:1"  ' 参数统一在行尾注释

' 验证命令完整性(调试时可取消注释查看)
 'MsgBox RoboCommand

' 执行命令
ReturnCode = WshShell.Run(RoboCommand, 0, True)
Set WshShell = Nothing

修改文件夹显示名称

@echo off
set /p var=请输入需要显示的名称:
if exist 1%\desktop.ini (
del /a /f 1%\desktop.ini
)
(echo [.ShellClassInfo]
		echo LocalizedResourceName=%var%
		)>"%1\desktop.ini"
attrib +s +h %1\desktop.ini
attrib +r /s /d "%1"
taskkill /f /im explorer.exe
start explorer