jzGradeChecker - 优雅查成绩 Graceful Grade-Checking Experience

链接 Links

  • 网站 Website (包含导出数据查看网页 Includes a webpage for reading the exported file)
  • 演示 Demo (这是扩展的欢迎界面,显示效果与实际扩展工作情况无异 This is the introduction page of the extension, which reuses the same core scripts of the parsing code, working identically to the extension)
  • Chrome Web Store

重要提示 Notice

由于原网站在今年改版,成绩查询服务器已经下线,该扩展的读取成绩功能已经无法工作。但因为扩展自定义了一套 JSON 数据结构,即便服务器不可用,仍可通过离线数据实现信息显示,因此在线演示、导出成绩查看器等仍可查看。

Due to the original website upgrade, this Chrome extension cannot fetch grade data any more (the grade check server is down). However, the demo and the exported data reader still work, because I have implemented a customized JSON data structure, which make the code functional by reading the JSON data even if the remote server is unavailable. 继续阅读“jzGradeChecker - 优雅查成绩 Graceful Grade-Checking Experience”

从头开始摘树莓 - Day 2

等待树莓派 IP 的那一刻

昨天配置的 WiFi 热点,按我一直以来的操作,是用电脑开一个热点来凑合。我的电脑是 Windows 8.1,很方便,先打开一个有管理员权限的命令行,然后:

netsh wlan set hostednetwork mode=allow ssid=SSID key=PASSWORD
netsh wlan start hostednetwork
arp -a | findstr -i 192.168. | findstr /V 255

这时候是中午,我接着给树莓派上电,等了好久都没看到 IP,这就很气了。重复了几次,我开始怀疑是系统没正常启动,就查了查网上对树莓派指示灯的介绍。再仔细一看树莓派,居然红的电源灯会闪,这就不大对头了。于是我拿来手机充电器接上 USB 线,没过一会树莓派的 IP 就出现在电脑的 ARP 表里了。

哎,谜团终于揭开,但我已经把卡重做了,也只能硬着头皮从头来过。赶紧先用默认密码(pi:raspberry)连上树莓派的 SSH 再说(我用的是 Bitvise SSH Client,没遇到坑很好用),果然能上,全新的系统哈哈哈。

继续阅读“从头开始摘树莓 - Day 2”

从头开始摘树莓 - Day 1

这是个什么鬼?

还记得许多月前的春天,为了一个项目买了树莓派,折腾 Linux。当时隔壁宿舍的项目也是折腾 Linux 装 ROS,因为校园网下系统太慢,土豪们居然买了手机流量日租包用来没日没夜地下载,每天在机电科协早出晚归的。而我在 headless 的模式下折腾了一两周,也总算是把环境搭起来了。

这几天为了参加比赛,在改代码。改着改着,随手 apt-get upgrade 升级了下系统,结果第二次重启的时候就连不上树莓派了。下午拿到玉神实验室的显示器上看,一切似乎都正常,我正准备看 WiFi 连接情况,突然显示就花了,完全不知道是哪里故障了。

于是,只能从头开始摘树莓了。我先把树莓派上的 Micro SD 卡的内容借着 Paragon extFS 全拷了出来(提示,不要用 ext2fs,我试着在 Windows 8.1 上加载的时候程序永远会崩溃),然后开始重装系统。虽然第二天发现是电源的问题,但因为我备份的时候 Windows 把太长路径的文件丢了一些,拷回去文件权限还不一定对,所以还是只能乖乖重新做一次系统了。

突发奇想,觉得还是记录一下这个操作过程比较好,否则要是后人再重新配置一次,真是太痛苦了。 继续阅读“从头开始摘树莓 - Day 1”

魔方机器人(网页与 Python 控制程序) Rubik's Cube Solving Robot

介绍 Introduction

本作品为本科专业必修课《科研项目指导与训练》的课程项目。我们选择实现一台魔方机器人,可对打乱的三阶魔方在进行表面颜色识别后,恢复至六面同色状态。

This is a course project for "Scientific Research Project Guidance and Training" course of my major. We chose to build a Rubik's cube solving robot, which can identify a third-order cube's pattern and solve it.

该机器人拥有六个自由度,对六个面进行旋转,并有四个摄像头从四个角进行颜色的识别。此外,机器人采用树莓派作为上位机进行总体控制,采用 Arduino 作为下位机进行步进电机的控制。

The robot has six degrees of freedom, rotating the six sides. It identifies the cube by four cameras from the four corners. A Raspberry Pi is used as an upper controller for the general control, and an Arduino board as a lower controller for the motor control.

项目在最终结题答辩时获得非常高的评价,同一课程中共有 9 组项目。

The project gets an excellent feedback at the final presentation among 9 projects of the course.

继续阅读“魔方机器人(网页与 Python 控制程序) Rubik's Cube Solving Robot”

瞬移吧,时光(飞逝金中 2017 年创意网页)

介绍 Introduction

这是一个利用 canvas 技术的互动相册,其中共有 12 组照片。用手涂抹旧照片会显示出新照片,此外还有可能触发一些“信息点”提示。

You can see this as an interactive album with canvas technology, in which the scene in a same place changes over time by wiping it with your finger, and stories hid behind specific positions in the photo may pop up.

该页面上线后,通过校友的微信朋友圈自发传播,截至 2017 年 5 月已获得近 5000 次点击,完整体验次数达 1000 余次,留言 72 条。

I put 12 couples of photos in the album. After sharing the webpage on the social media, ~5000 page views and 1000+ full journeys have been made to date (May 2017), while 72 comments with thoughts about the high school in the album are left.

继续阅读“瞬移吧,时光(飞逝金中 2017 年创意网页)”

小探网页支付网关的架构设计与体验优化

开题

现在网络支付方式越来越发达,已经不可避免地开始与各类 IT 系统集成。在财务制度比较规范的地方,这类入账自然需要统一管理,资金不能随意流动。如果由各个业务系统自己去申请对接网络支付接口,自然是很难实现统一管理的,而且也麻烦。

因此,就需要一个统一的企业级支付平台作为中间层,来负责各业务系统与网络支付的对接。这样,不仅方便了财务数据的统一提取、账户对账,也使企业支付平台可以代表所有的业务系统与网络支付接口进行交互,业务系统不会接触到企业的网络支付总密钥,较为安全可控。

这样的例子其实我们天天见。例如 12306 的车票支付教育部考试中心的考试费支付,都采用了中间层,来接入多个网络支付平台。

此时,企业级支付平台的角色可以认为是一个代理,协助业务系统完成支付流,并保存相关数据。目前这类“代理”的架构并没有标准,所以实现起来会各有小差别。如何去定义企业级支付平台(下称企业层)和业务系统各自的角色,就会决定架构的实现方式,相应就会影响到支付业务的实现情况。 继续阅读“小探网页支付网关的架构设计与体验优化”

Make Service Fault Transparent

This article is an English one, because I really need to work on the language. Sorry if it is not easy to understand.

A Summary to What's Happening Recently

Recently in my campus, IT service is very unstable.

  • In March, many people posted on forums that they tried to top up campus Internet account by WeChat, but more money (maybe 100x) than they paid were topped up.
    • Later WeChat top-up service were disabled. Because most people were not aware of the existing offline top-up-by-card service, many of them became arrearage.
    • Several days later, campus Internet's charging system was disabled, which means you can use it for free. Later the charging system was resumed, but only charging at the monthly fee (not counting flux fee).
    • An unnoticeable statement was published then, indicating that it was caused by a bug from the software company.
  • On March 20th, campus card users who used their cards to drink hot water or eat breakfast, found their card locked. (Those lazy guys were not affected at all)
    • In the morning nobody knows whether the issue was being solved, until at around 11 (lunchtime) my school's instructor sent an announcement that "there will be unlock service in canteens, please keep order and don't panic at the scene". At canteens announcements by canteens' administrator is put up. Unlocking was quick and easy, but most people still went to canteens where Alipay is accepted.
    • Later that afternoon public statement by card administrator was out: It was a service fault (on BITUnion some said that it's a bug hidden for 14 years). IT staffs explained on BITUnion that they tried to work out solutions and mitigate the issue before they drafted public statements.
  • In these months campus Internet is unstable: During peak hours it became very slow or even unavailable. Maybe it's around 2%'s downtime (in a 24-hour aspect), looking not that much, but users surely could experience that.
    • The causes seem very complex. In my view, new DNS servers, old cache servers, new firewall systems, new upstream link providers and upstream link issue all can cause problems. And of course those new facilities all need to be fine-tuned, which takes time.
    • Currently no authentic statement is published. But in the IT service monthly report (which most people are not aware of), it said "Issue fully fixed, during peak hours upstream links can work in full bandwidth now". One of the reasons they mentioned was "DDoS attack causing network core server CPU instant usage up to 99% (usually ~20%)".
    • However, as student representatives meeting will be held, many representatives will raise the heated Internet issue onto the meeting. But I believe most of they will never get the point why this is happening.

继续阅读“Make Service Fault Transparent”

又是夏天,盲空梦别

前阵子做了个梦,其中一个片段大概是这个样子的:全班正在教室里晚自习,我坐在窗边,窗外看得到校门和海。

突然窗外头的海上风浪大作,教室里有点烦躁了起来,毕竟“台风”来了,也差不多该回家了。终于开始有人往校门外走了,过了一会教室里的老师终于宣布,各回各家吧。

我慢慢在教室里收完东西,居然最后往宿舍走去,没有回家。一看表差不多要 11 点,宿舍要锁门了。最后一个镜头是我回宿舍的路上吧,路一边的海面风平浪静,天空晴朗无云。

也不知道为啥,到这里戛然而止的剧情,我的理解是:台风真的要来了,我看着似乎大好的局面,觉得没啥事情,淡定地继续着自己的生活(回宿舍,不回家),没去做好该做的准备。 继续阅读“又是夏天,盲空梦别”

系统设计者的自我修养 / 一课一练

这学期选了专业选修课“机电系统综合设计”,从第一节课就开始面对不同:王老师提前把全班的名单导进了“出题优”应用,上课要用手机进行课堂互动。虽然已经听说过类似的教学方式,但亲身体验还是第一次。一开始老师介绍的课程内容,以前自己似乎都“学过”,但我觉得在这种教学方式下,或许会有些惊喜,于是就继续上了这门课。

听课程的名字是“综合设计”,最后还有考试,当时的我不是很懂既然是“设计”,考试能考什么呢?后来,课上除了讲“正题”,每节课前还有“每课一问”,问的多是些分析估算的题目,需要熟悉各种物理常量和物理常识。比如“一个人怎样能拉动一架飞机?”、“旋转木马的电机功率是多少?”等等。做了几个星期的题目,感觉自己对这类问题从最开始的毫无头绪,开始慢慢变得有思路起来。 继续阅读“系统设计者的自我修养 / 一课一练”