<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/scripts/pretty-feed-v3.xsl" type="text/xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:h="http://www.w3.org/TR/html4/"><channel><title>Coderdiao&apos;s Homepage</title><description>Homepage of Coderdiao</description><link>https://cdd-2333.github.io</link><item><title>北京大学高等数学 A/B (I) 往年题汇编</title><link>https://cdd-2333.github.io/blog/advanced-mathematics-i</link><guid isPermaLink="true">https://cdd-2333.github.io/blog/advanced-mathematics-i</guid><description>北京大学高等数学 A/B (I) 历年考试真题汇编，涵盖期中、期末试题，共 46 页。提供 PDF 下载与在线预览。</description><pubDate>Fri, 24 Jul 2026 08:49:00 GMT</pubDate><content:encoded>&lt;p&gt;本份汇编整理了北京大学高等数学 A/B (I) 的历年考试真题，包含期中与期末试题，共 46 页。题目来源包括高数 A 和高数 B 两类课程，可供期末复习参考。&lt;/p&gt;
&lt;p&gt;下载链接：&lt;a href=&quot;/images/advanced-math/Advanced-Mathematics-I-past-exams.pdf&quot;&gt;Advanced-Mathematics-I-past-exams.pdf&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;预览 (前 3 页)&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://cdd-2333.github.io/images/advanced-math/preview-page-1.png&quot; alt=&quot;第 1 页&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdd-2333.github.io/images/advanced-math/preview-page-2.png&quot; alt=&quot;第 2 页&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdd-2333.github.io/images/advanced-math/preview-page-3.png&quot; alt=&quot;第 3 页&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;完整 PDF 共 46 页，请点击上方链接下载。&lt;/p&gt;
&lt;/blockquote&gt;</content:encoded><h:img src="undefined"/><enclosure url="undefined"/></item><item><title>Small Tool 1</title><link>https://cdd-2333.github.io/blog/small-tool-1</link><guid isPermaLink="true">https://cdd-2333.github.io/blog/small-tool-1</guid><description>A small tool to check if your waitlist has been redeemed, currently supporting qq/netease emails.</description><pubDate>Sat, 02 May 2026 08:13:33 GMT</pubDate><content:encoded>&lt;p&gt;12306 waitlist check tool v1.1.0&lt;br&gt;
A small tool to check if your waitlist has been redeemed, currently supporting qq/netease emails.&lt;br&gt;
Last edited on 2026/02/08, coded in python 3.14.2&lt;br&gt;
&lt;a href=&quot;https://github.com/CDD-2333/CDD-2333.github.io/releases/download/v1.1.0/query.exe&quot;&gt;Click here to download&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Source Code&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;import imaplib
import email
from email.header import decode_header
import time
import os
import winsound
import json
import keyboard
from ctypes import cast,POINTER
from comtypes import CLSCTX_ALL
from pycaw.pycaw import AudioUtilities,IAudioEndpointVolume

IMAP_SERVER = &quot;&quot;
EMAIL_USER=&quot;&quot;
EMAIL_PASS=&quot;&quot;
CHECK_INTERVAL=60
CONFIG_FILE=&quot;config.json&quot;

def exit_program():
    print(&quot;[系统] 正在退出程序，欢迎下次使用！&quot;)
    time.sleep(3)
    os._exit(0)

def set_system_volume(level):
    try:
        devices=AudioUtilities.GetSpeakers()
        interface=devices.Activate(IAudioEndpointVolume._iid_,CLSCTX_ALL,None)
        volume=cast(interface,POINTER(IAudioEndpointVolume))
        volume.SetMasterVolumeLevelScalar(level,None)
    except Exception as e:
        print(f&quot;[Error] 音量调节失败: {e}&quot;)

def validate_login(user,password,server):
    try:
        mail=imaplib.IMAP4_SSL(server)
        mail.login(user,password)
        mail.logout()
        return True
    except Exception:
        return False

def get_config():
    if os.path.exists(CONFIG_FILE):
        with open(CONFIG_FILE,&quot;r&quot;) as f:
            return json.load(f)
        
    print(&quot;12306候补邮件检查 v1.1.0 by Coderdiao\n&quot;)
    print(&quot;欢迎！这是您的首次使用，请配置您的邮箱信息：&quot;)
    while(1):
        email=input(&quot;请输入邮箱地址：&quot;).strip()
        pass_code=input(&quot;请输入邮箱授权码：&quot;).strip()
        server=&quot;imap.163.com&quot;
        if &quot;qq.com&quot; in email.lower():
            server=&quot;imap.qq.com&quot;
        print(f&quot;[系统] 正在尝试登录...&quot;)
        if validate_login(email,pass_code,server):
            print(&quot;[系统] 登录成功！已保存您的用户信息至本地&quot;)
            config={&quot;email&quot;:email,&quot;pass&quot;:pass_code,&quot;server&quot;:server}
            with open(CONFIG_FILE,&quot;w&quot;) as f:
                json.dump(config,f)
            return config
        else:
            print(&quot;\a[Error] 登录失败！请检查您的账号或授权码，确认邮箱是否已开启IMAP服务！\n&quot;)

def play_alert():
    set_system_volume(0.6)

    print(&quot;\a&quot;)
    for i in range(10):
        winsound.MessageBeep(winsound.MB_ICONHAND)
        time.sleep(0.5)
    #winsound.PlaySound(&quot;alert.wav&quot;,winsound.SND_FILENAME)

def check_tickets():
    mail=None
    try:
        mail=imaplib.IMAP4_SSL(IMAP_SERVER)
        mail.login(EMAIL_USER,EMAIL_PASS)

        try:
            imaplib.Commands[&apos;ID&apos;]=(&apos;AUTH&apos;)
            mail._simple_command(&apos;ID&apos;,&apos;(&quot;name&quot; &quot;Monitor by Coderdiao&quot; &quot;version&quot; &quot;1.1.0&quot; &quot;vendor&quot; &quot;local&quot;)&apos;)
        except:pass

        mail.select(&quot;INBOX&quot;)
        search_query=&apos;(UNSEEN FROM &quot;12306@rails.com.cn&quot;)&apos;
        status,messages=mail.search(None, search_query)

        if status==&quot;OK&quot; and messages[0]:
            mail_ids=messages[0].split()
            for mail_id in reversed(mail_ids):
                res,msg_data=mail.fetch(mail_id,&quot;(RFC822)&quot;)
                for response_part in msg_data:
                    if isinstance(response_part,tuple):
                        msg=email.message_from_bytes(response_part[1])

                        from_address=email.utils.parseaddr(msg.get(&quot;From&quot;))[1]
                        if from_address.lower()!=&quot;12306@rails.com.cn&quot;:
                            continue

                        subject_raw=msg.get(&quot;Subject&quot;)
                        if subject_raw:
                            decoded=decode_header(subject_raw)[0]
                            subject=decoded[0]
                            if isinstance(subject,bytes):
                                subject=subject.decode(decoded[1] if decoded[1] else &quot;utf-8&quot;)

                            print(f&quot;[{time.strftime(&apos;%H:%M:%S&apos;)}] 扫描到邮件: {subject}&quot;)

                            if &quot;成功&quot; in subject and (&quot;候补&quot; in subject or &quot;兑现&quot; in subject):
                                return True
                        
    except Exception as e:
        print(f&quot;[Error] 发生错误，请检查网络连接！若错误持续，请联系开发者: {e}&quot;)
    finally:
        if mail:
            try:mail.logout()
            except:pass
    return False

if __name__==&quot;__main__&quot;:
    config=get_config()
    EMAIL_USER=config[&quot;email&quot;]
    EMAIL_PASS=config[&quot;pass&quot;]
    IMAP_SERVER=config[&quot;server&quot;]

    keyboard.add_hotkey(&apos;ctrl+alt+p&apos;,exit_program)

    print(&quot;=&quot;*40)
    print(&quot;   12306候补邮件检查程序 v1.0.0 by Coderdiao&quot;)
    print(&quot;=&quot;*40)
    print(f&quot;检查账号:{EMAIL_USER}&quot;)
    print(f&quot;若退出程序，可使用快捷键：Ctrl+Alt+P&quot;)
    print(&quot;状态：运行中...&quot;)

    try:
        while(1):
            if check_tickets():
                print(&quot;\n&quot;+&quot;!&quot;*20)
                print(&quot;!!!候补成功兑现!!!&quot;)
                print(&quot;!&quot;*20+&quot;\n&quot;)
                play_alert()
                break
            else:
                print(f&quot;[{time.strftime(&apos;%H:%M:%S&apos;)}] 持续检查中...&quot;)
            time.sleep(CHECK_INTERVAL)
    except KeyboardInterrupt:
        print(&quot;[系统] 正在退出程序，欢迎下次使用！&quot;)
        time.sleep(2)
        os._exit(0)

    os.system(&quot;pause&quot;)
&lt;/code&gt;&lt;/pre&gt;</content:encoded><h:img src="undefined"/><enclosure url="undefined"/></item></channel></rss>