需求分析

emm… 怎么说呢,日常使用电脑你肯定不需要自动登录校园网,但是在某些特殊情况下,如果你的主机与互联网断开了连接,而你又无法在现场操作主机登录校园网,那通常意味着生产力的下降,科研进度的延误等等后果…

前两周由于疫情原因学校关闭了实验室,志成哥在寝室用笔记本登录了一下校园网,就挤掉了实验室的服务器网络,导致无法使用向日葵进行远程连接。只能选择挨门卫大爷一顿骂然后去实验室重新登录校园网。如果当时志成哥的服务器上运行了自动登录校园网的定时任务,就可以免于这一顿挨骂了😂。

试想一下,如果寒假在家期间想要使用实验室的主机进行工作,但是却因为学校的网络中心抽风进行升级维护,导致主机与互联网断开连接,那可就不是挨一顿骂就能解决的了。

寒假即将到来,为了避免上述尴尬局面的发生,故提前完成这一需求。

Requirements Analysis

Emm… how to put it? For everyday computer use, you certainly don’t need auto-login to the campus network. But in certain special situations, if your host loses its connection to the Internet and you can’t be physically present to log the host in to the campus network, it usually means a drop in productivity, delays in research progress, and other such consequences…

Two weeks ago, the school closed the lab because of the pandemic. Brother Zhicheng logged in to the campus network with his laptop in the dorm, which kicked the lab server off the network and made it impossible to remote-connect via Sunflower (向日葵). The only option was to take a scolding from the security guard and go to the lab to log the campus network back in. If Brother Zhicheng’s server had been running a scheduled auto-login task at the time, he would have been spared that scolding😂.

Imagine that during the winter break you want to use the lab’s host to work from home, but the school’s network center has a glitch during an upgrade or maintenance, cutting the host off from the Internet. That would not be solved by just getting scolded.

Winter break is coming. To avoid the embarrassing situation above, I’m completing this requirement in advance.

Wiki教程Python分享GitHub校园网

前言

室友:校园网的收费标准是每月免费使用 8GB 流量,超出 8GB 起每 GB 流量 1 块钱,超过 38GB 后免费使用。

我:那就是…一个月 30 块钱呗。

室友:对,可以这么理解。

Roommate: The campus network gives you 8GB of free traffic per month. Beyond 8GB, each GB costs 1 yuan, and it becomes free again after 38GB.

Me: So… that’s 30 yuan a month then.

Roommate: Yes, you can think of it that way.

image-20211120161352699

这是我研一刚来时和室友的对话,因为我本人很喜欢玩电脑,网络质量就是我的生活质量,所以研一刚来当天就咨询了这个问题。听完之后对比一下家里的收费标准,结论就是一个字:贵!

奈何当时的我还小,知识面太窄,只能任其剥削压迫。

现在可不一样了😏

image-20211120161352699

This was the conversation I had with my roommate when I first arrived as a first-year graduate student. Since I really enjoy playing with computers, network quality is my quality of life, so I asked about this on my very first day. After hearing it and comparing it with the pricing at home, the conclusion was one word: expensive!

But I back then was still young and knew too little, so I could only let it exploit and oppress me.

Now it’s a different story😏

阅读更多
Wiki教程分享VPS免流校园网

ding_shi_qiao

游戏目标

制作定时桥,当人物未在规定时间内过桥将会失败。

大体需要以下几个步骤:

  1. 制作地形,建造一座桥 Bridge
  2. 制作按键 ButtonBridge
  3. 制作计时器 TimerDisplay

PS:这是少儿编程

Game Goal

Make a timed bridge: if the character fails to cross the bridge within the set time, the game fails.

Roughly the following steps are needed:

  1. Create the terrain and build a bridge — Bridge
  2. Make the button — BridgeButton
  3. Make the timer — TimerDisplay

PS: this is kids’ programming

WikiRobloxLua


        
结绳记事

求助

剑指 Offer 15. 二进制中1的个数

编写一个函数,输入是一个无符号整数(以二进制串的形式),返回其二进制表达式中数字位数为 ‘1’ 的个数

我的第一版代码:

Help Wanted

Number of 1 Bits

Write a function that takes an unsigned integer (in binary string form) and returns the number of ‘1’ bits in its binary representation.

My first version of the code:

1
2
3
4
5
6
7
8
class Solution {
public:
int hammingWeight(uint32_t n) {
if(n == 1) return 1;
if(n == 0) return 0;
return n&1 + hammingWeight(n>>1);
}
};

这个我看起来问题不大啊,边界条件设置好,n&1 计算最低位是不是 1 ,再加上递归调用 n 的右移1 位。

This looks fine to me. The base cases are set up, n&1 checks whether the lowest bit is 1, plus the recursive call on n shifted right by 1 bit.

C/C++WikiLeetCode

前言

在闲暇时间浏览 GitHub 时,在推荐页面发现了这样一个项目,项目的简介里写着:

An index & manager of Onedrive based on serverless. Can be deployed to Heroku/Glitch/Vercel/SCF/FG/FC/CFC/PHP web hosting/VPS.

凭借我长期的白嫖经验,以及大学英语 5.8 级的水平,迅速捕捉到几个熟悉的关键词:manager of OnedriveHerokuVercel。关于 Heroku 我曾经写过一篇 Heroku 搭建 V2ray 教程Bing 的搜索权重相当之高,高到我自己都属实没想到啊!

Preface

While browsing GitHub in my spare time, I came across this project on the recommendations page. Its description read:

An index & manager of Onedrive based on serverless. Can be deployed to Heroku/Glitch/Vercel/SCF/FG/FC/CFC/PHP web hosting/VPS.

Relying on my long experience with freeloading and my college English level of 5.8, I quickly caught a few familiar keywords: manager of Onedrive, Heroku, Vercel. I once wrote a post about Heroku — Heroku 搭建 V2ray 教程 (Heroku V2ray Tutorial) — which ranks remarkably high on Bing, so high that even I didn’t expect it!

分享VPS