From 025c8c1a20e870a5324197e480907a8ac15e0ee6 Mon Sep 17 00:00:00 2001 From: Cai Date: Wed, 17 Sep 2025 07:46:38 +0000 Subject: [PATCH] code-server-liek --- Html/.log | 1694 ++++------------- Html/apps/services/backboard_service.py | 6 +- .../算法效率-效率的重要性与实践验证.html | 121 ++ Html/apps/utils/sudoUtil.py | 2 +- Html/apps/views/vscode.py | 25 + .../app/sockets/terminal_service.py | 282 +-- code-server-like/app/views/file.py | 24 +- code-server-like/app/views/routes.py | 42 +- code-server-like/static/js/file.js | 6 +- code-server-like/static/js/terminal.js | 86 +- code-server-like/templates/index.html | 17 +- requirements.txt | 3 +- 12 files changed, 797 insertions(+), 1511 deletions(-) create mode 100644 Html/apps/static/算法效率-效率的重要性与实践验证.html diff --git a/Html/.log b/Html/.log index dc7ca69..cbfebb2 100644 --- a/Html/.log +++ b/Html/.log @@ -1,1315 +1,397 @@ -2025-09-06 14:16:13.956 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Serving Flask app 'apps' - * Debug mode: off -WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. - * Running on all addresses (0.0.0.0) - * Running on http://127.0.0.1:5551 - * Running on http://172.31.34.185:5551 -Press CTRL+C to quit -127.0.0.1 - - [06/Sep/2025 14:16:23] "GET /socket.io/?user_uuid=user_b21f2049-8655-4e6e-89ac-ccbb88b45b51&folder=/home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法&EIO=4&transport=polling&t=PaVOgFv HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:16:36] "GET / HTTP/1.1" 302 - -101.87.252.115 - - [06/Sep/2025 14:16:36] "GET /login HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:16:42] "GET / HTTP/1.1" 302 - -101.87.252.115 - - [06/Sep/2025 14:16:42] "GET /login HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:16:42] "GET /static/css/login.css HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:16:42] "GET /static/js/login.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:16:42] "GET /favicon.ico HTTP/1.1" 404 - -101.87.252.115 - - [06/Sep/2025 14:16:50] "GET /register HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:16:50] "GET /static/css/login.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:16:50] "GET /static/js/register.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:11] "POST /register_post HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:13] "GET /login HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:13] "GET /static/css/login.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:14] "GET /static/js/login.js HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:20] "POST /login_post HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:20] "GET /dashboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:20] "GET /static/css/dashboard.css HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:20] "GET /static/js/dashboard.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:21] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:35] "GET /dashboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:35] "GET /static/css/dashboard.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:35] "GET /static/js/dashboard.js HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:35] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 206 - -101.87.252.115 - - [06/Sep/2025 14:20:35] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 206 - -101.87.252.115 - - [06/Sep/2025 14:20:51] "GET / HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:51] "GET /static/css/index.css HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:51] "GET /static/js/index.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:51] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:53] "GET /course/68bacdfadf5aeae0912f7f18 HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:53] "GET /static/css/course.css HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:53] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:56] "GET /dashboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:56] "GET /static/css/dashboard.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:56] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:57] "GET /static/js/dashboard.js HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:06] "GET /switch-role/student HTTP/1.1" 302 - -101.87.252.115 - - [06/Sep/2025 14:21:06] "GET /teacherboard HTTP/1.1" 302 - -101.87.252.115 - - [06/Sep/2025 14:21:06] "GET /login HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:07] "GET /static/css/login.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:07] "GET /static/js/login.js HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:14] "POST /login_teacher_post HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:17] "GET /register_teacher HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:17] "GET /static/css/login.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:17] "GET /static/js/register_teacher.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:36] "POST /register_teacher_post HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:38] "GET /login HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:38] "GET /static/css/login.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:39] "GET /static/js/login.js HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:43] "POST /login_post HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:43] "GET /dashboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:44] "GET /static/css/dashboard.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:44] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:44] "GET /static/js/dashboard.js HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:48] "GET /switch-role/student HTTP/1.1" 302 - -101.87.252.115 - - [06/Sep/2025 14:21:48] "GET /teacherboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:48] "GET /static/css/teacherboard.css HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:48] "GET /static/css/teacher_course_setting.css HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:48] "GET /static/js/course_current.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:48] "GET /static/css/dashboard.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:48] "GET /static/js/teacherboard.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:49] "GET /static/js/teacher_course_setting.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:49] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -[2025-09-06 14:21:54,310] ERROR in app: Exception on /materials/algorithm [GET] +59.78.194.184,127.0.0.1 - - [16/Sep/2025 05:47:23] "GET / HTTP/1.1" 302 351 0.001580 +disconnect handler error Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'algorithm' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:21:54] "GET /materials/algorithm HTTP/1.1" 500 - -[2025-09-06 14:22:07,077] ERROR in app: Exception on /materials/data-structures [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/engineio/server.py", line 450, in run_handler + return self.handlers[event](*args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 671, in _handle_eio_disconnect + self._handle_disconnect(eio_sid, n, reason) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 568, in _handle_disconnect + self._trigger_event('disconnect', namespace, sid, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 150, in on_disconnect + user_uuid2chatmanager[uuid].disconnect(uuid) +KeyError: 'user_dd993856-c5a2-46bf-9b31-238a14de6a9f' +59.78.194.184,127.0.0.1 - - [16/Sep/2025 05:47:23] "GET /socket.io/?user_uuid=user_dd993856-c5a2-46bf-9b31-238a14de6a9f&folder=%2Fhome%2FTCake%2F68bacdfadf5aeae0912f7f18%2F%E7%AE%97%E6%B3%95%E6%95%88%E7%8E%87%2F%E6%95%88%E7%8E%87%E7%9A%84%E9%87%8D%E8%A6%81%E6%80%A7%E4%B8%8E%E5%AE%9E%E8%B7%B5%E9%AA%8C%E8%AF%81&EIO=4&transport=websocket&sid=PYEYzcDw6_8AFakHAAAA HTTP/1.1" 200 0 17.090087 +59.78.194.184,127.0.0.1 - - [16/Sep/2025 05:47:23] "GET /login HTTP/1.1" 200 1835 0.003839 +59.78.194.184,127.0.0.1 - - [16/Sep/2025 05:47:23] "GET /static/js/login.js HTTP/1.1" 304 183 0.007688 +59.78.194.184,127.0.0.1 - - [16/Sep/2025 05:47:23] "GET /static/css/login.css HTTP/1.1" 304 184 0.001261 +(185715) accepted ('127.0.0.1', 43808) +49.52.5.54,127.0.0.1 - - [16/Sep/2025 06:24:01] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbHCSHV HTTP/1.1" 200 275 0.000398 +49.52.5.54,127.0.0.1 - - [16/Sep/2025 06:24:01] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbHCSWg&sid=B1ccqcz1y9dPlAE1AAAC HTTP/1.1" 200 192 0.000805 +49.52.5.54,127.0.0.1 - - [16/Sep/2025 06:24:01] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbHCSWj&sid=B1ccqcz1y9dPlAE1AAAC HTTP/1.1" 200 196 0.000499 +49.52.5.54,127.0.0.1 - - [16/Sep/2025 06:24:01] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbHCSaR&sid=B1ccqcz1y9dPlAE1AAAC HTTP/1.1" 200 192 0.000360 Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'data-structures' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:22:07] "GET /materials/data-structures HTTP/1.1" 500 - -[2025-09-06 14:22:08,886] ERROR in app: Exception on /materials/algorithm [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/hub.py", line 471, in fire_timers + timer() + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/timer.py", line 59, in __call__ + cb(*args, **kw) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/greenthread.py", line 272, in main + result = function(*args, **kwargs) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 591, in _handle_event_internal + r = server._trigger_event(data[0], namespace, sid, *data[1:]) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 53, in on_login + user_id = uuid2username[user_uuid] +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +(185715) accepted ('127.0.0.1', 43816) +49.52.5.54,127.0.0.1 - - [16/Sep/2025 06:24:01] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbHCSaT&sid=B1ccqcz1y9dPlAE1AAAC HTTP/1.1" 200 157 0.000484 +49.52.5.54,127.0.0.1 - - [16/Sep/2025 06:24:01] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbHCScl&sid=B1ccqcz1y9dPlAE1AAAC HTTP/1.1" 200 157 0.000671 +disconnect handler error Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'algorithm' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:22:08] "GET /materials/algorithm HTTP/1.1" 500 - -101.87.252.115 - - [06/Sep/2025 14:22:12] "GET /teacherdashboard HTTP/1.1" 404 - -[2025-09-06 14:22:17,150] ERROR in app: Exception on /materials/algorithm [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/engineio/server.py", line 450, in run_handler + return self.handlers[event](*args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 671, in _handle_eio_disconnect + self._handle_disconnect(eio_sid, n, reason) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 568, in _handle_disconnect + self._trigger_event('disconnect', namespace, sid, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 150, in on_disconnect + user_uuid2chatmanager[uuid].disconnect(uuid) +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +49.52.5.54,127.0.0.1 - - [16/Sep/2025 06:44:49] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=websocket&sid=B1ccqcz1y9dPlAE1AAAC HTTP/1.1" 200 0 1247.995297 +(185715) accepted ('127.0.0.1', 35642) +117.136.120.147,127.0.0.1 - - [16/Sep/2025 06:49:11] "GET /favicon.ico HTTP/1.1" 404 331 0.004418 +(185715) accepted ('127.0.0.1', 41232) +149.57.180.156,127.0.0.1 - - [16/Sep/2025 07:00:34] "GET / HTTP/1.1" 302 351 0.001683 +149.57.180.156,127.0.0.1 - - [16/Sep/2025 07:00:34] "GET /login HTTP/1.1" 200 1835 0.001421 +(185715) accepted ('127.0.0.1', 34508) +59.78.194.184,127.0.0.1 - - [16/Sep/2025 09:01:23] "GET /favicon.ico HTTP/1.1" 404 331 0.004694 +59.78.194.184,127.0.0.1 - - [16/Sep/2025 09:01:23] "GET /favicon.ico HTTP/1.1" 404 331 0.001007 +59.78.194.184,127.0.0.1 - - [16/Sep/2025 09:01:24] "GET /favicon.ico HTTP/1.1" 404 331 0.001088 +59.78.194.184,127.0.0.1 - - [16/Sep/2025 09:01:55] "GET /favicon.ico HTTP/1.1" 404 331 0.001698 +59.78.194.184,127.0.0.1 - - [16/Sep/2025 09:01:55] "GET /favicon.ico HTTP/1.1" 404 331 0.002036 +(185715) accepted ('127.0.0.1', 53386) +34.150.219.96,127.0.0.1 - - [16/Sep/2025 09:42:11] "GET / HTTP/1.1" 302 351 0.000875 +34.150.219.96,127.0.0.1 - - [16/Sep/2025 09:42:11] "GET /login HTTP/1.1" 200 1835 0.000756 +(185715) accepted ('127.0.0.1', 53620) +34.172.229.236,127.0.0.1 - - [16/Sep/2025 10:14:08] "GET / HTTP/1.1" 302 351 0.000800 +34.172.229.236,127.0.0.1 - - [16/Sep/2025 10:14:09] "GET /login HTTP/1.1" 200 1835 0.000896 +(185715) accepted ('127.0.0.1', 34444) +58.198.188.146,127.0.0.1 - - [16/Sep/2025 10:44:08] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbI7-sC HTTP/1.1" 200 275 0.000352 +58.198.188.146,127.0.0.1 - - [16/Sep/2025 10:44:09] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbI7_14&sid=LR2BfasKvxPRxnsNAAAE HTTP/1.1" 200 192 0.000732 +58.198.188.146,127.0.0.1 - - [16/Sep/2025 10:44:09] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbI7_18&sid=LR2BfasKvxPRxnsNAAAE HTTP/1.1" 200 196 0.000242 +58.198.188.146,127.0.0.1 - - [16/Sep/2025 10:44:09] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbI7_36&sid=LR2BfasKvxPRxnsNAAAE HTTP/1.1" 200 192 0.000796 Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'algorithm' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:22:17] "GET /materials/algorithm HTTP/1.1" 500 - -101.87.252.115 - - [06/Sep/2025 14:22:22] "GET /teachergrades HTTP/1.1" 404 - -[2025-09-06 14:22:29,722] ERROR in app: Exception on /materials/data-structures [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/hub.py", line 471, in fire_timers + timer() + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/timer.py", line 59, in __call__ + cb(*args, **kw) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/greenthread.py", line 272, in main + result = function(*args, **kwargs) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 591, in _handle_event_internal + r = server._trigger_event(data[0], namespace, sid, *data[1:]) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 53, in on_login + user_id = uuid2username[user_uuid] +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +(185715) accepted ('127.0.0.1', 34458) +(185715) accepted ('127.0.0.1', 34474) +58.198.188.146,127.0.0.1 - - [16/Sep/2025 10:44:09] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbI7_37&sid=LR2BfasKvxPRxnsNAAAE HTTP/1.1" 200 157 0.247947 +(185715) accepted ('127.0.0.1', 42806) +59.78.194.184,127.0.0.1 - - [16/Sep/2025 11:47:28] "GET /favicon.ico HTTP/1.1" 404 331 0.001352 +disconnect handler error Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'data-structures' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:22:29] "GET /materials/data-structures HTTP/1.1" 500 - -101.87.252.115 - - [06/Sep/2025 14:22:35] "GET /switch-role/teacher HTTP/1.1" 302 - -101.87.252.115 - - [06/Sep/2025 14:22:35] "GET /dashboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:22:35] "GET /static/css/dashboard.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:35] "GET /static/js/dashboard.js HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:35] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:43] "GET /switch-role/student HTTP/1.1" 302 - -101.87.252.115 - - [06/Sep/2025 14:22:44] "GET /teacherboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:22:44] "GET /static/css/teacher_course_setting.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:44] "GET /static/css/teacherboard.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:44] "GET /static/css/dashboard.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:44] "GET /static/js/course_current.js HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:44] "GET /static/js/teacherboard.js HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:45] "GET /static/js/teacher_course_setting.js HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:45] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -[2025-09-06 14:23:04,686] ERROR in app: Exception on /materials/algorithm [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/engineio/server.py", line 450, in run_handler + return self.handlers[event](*args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 671, in _handle_eio_disconnect + self._handle_disconnect(eio_sid, n, reason) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 568, in _handle_disconnect + self._trigger_event('disconnect', namespace, sid, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 150, in on_disconnect + user_uuid2chatmanager[uuid].disconnect(uuid) +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +58.198.188.146,127.0.0.1 - - [16/Sep/2025 11:56:46] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=websocket&sid=LR2BfasKvxPRxnsNAAAE HTTP/1.1" 200 0 4356.802767 +(185715) accepted ('127.0.0.1', 55390) +101.87.252.115,127.0.0.1 - - [16/Sep/2025 12:57:20] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbIcTKy HTTP/1.1" 200 275 0.000364 +101.87.252.115,127.0.0.1 - - [16/Sep/2025 12:57:41] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbIcZ74 HTTP/1.1" 200 275 0.000343 +101.87.252.115,127.0.0.1 - - [16/Sep/2025 12:57:41] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbIcZAk&sid=cekXcN6msgjITGbfAAAH HTTP/1.1" 200 192 0.000776 +(185715) accepted ('127.0.0.1', 44178) +101.87.252.115,127.0.0.1 - - [16/Sep/2025 12:57:41] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbIcZAk.0&sid=cekXcN6msgjITGbfAAAH HTTP/1.1" 200 196 0.000196 +101.87.252.115,127.0.0.1 - - [16/Sep/2025 12:57:41] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbIcZBl&sid=cekXcN6msgjITGbfAAAH HTTP/1.1" 200 192 0.000442 Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'algorithm' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:23:04] "GET /materials/algorithm HTTP/1.1" 500 - -[2025-09-06 14:23:06,148] ERROR in app: Exception on /materials/algorithm [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/hub.py", line 471, in fire_timers + timer() + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/timer.py", line 59, in __call__ + cb(*args, **kw) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/greenthread.py", line 272, in main + result = function(*args, **kwargs) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 591, in _handle_event_internal + r = server._trigger_event(data[0], namespace, sid, *data[1:]) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 53, in on_login + user_id = uuid2username[user_uuid] +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +(185715) accepted ('127.0.0.1', 44180) +101.87.252.115,127.0.0.1 - - [16/Sep/2025 12:57:41] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbIcZBl.0&sid=cekXcN6msgjITGbfAAAH HTTP/1.1" 200 157 0.144302 +(185715) accepted ('127.0.0.1', 55902) +23.27.145.218,127.0.0.1 - - [16/Sep/2025 13:12:03] "GET / HTTP/1.1" 302 351 0.001001 +23.27.145.218,127.0.0.1 - - [16/Sep/2025 13:12:03] "GET /login HTTP/1.1" 200 1835 0.000801 +23.27.145.218,127.0.0.1 - - [16/Sep/2025 13:12:04] "GET /static/css/login.css HTTP/1.1" 200 3791 0.002872 +(185715) accepted ('127.0.0.1', 55906) +23.27.145.218,127.0.0.1 - - [16/Sep/2025 13:12:04] "GET /static/js/login.js HTTP/1.1" 200 3557 0.001569 +162.142.125.195,127.0.0.1 - - [16/Sep/2025 13:12:05] "GET / HTTP/1.1" 302 351 0.000814 +162.142.125.195,127.0.0.1 - - [16/Sep/2025 13:12:24] "GET /login HTTP/1.1" 200 1835 0.000830 +162.142.125.195,127.0.0.1 - - [16/Sep/2025 13:12:28] "GET /favicon.ico HTTP/1.1" 404 331 0.000829 +(185715) accepted ('127.0.0.1', 43834) +34.82.34.164,127.0.0.1 - - [16/Sep/2025 13:22:35] "GET / HTTP/1.1" 302 351 0.001168 +34.82.34.164,127.0.0.1 - - [16/Sep/2025 13:22:35] "GET /login HTTP/1.1" 200 1835 0.001068 +(185715) accepted ('127.0.0.1', 49640) +54.200.206.157,127.0.0.1 - - [16/Sep/2025 14:38:32] "GET / HTTP/1.1" 302 351 0.001285 +(185715) accepted ('127.0.0.1', 53358) +68.183.91.167,127.0.0.1 - - [16/Sep/2025 15:47:18] "GET / HTTP/1.1" 302 351 0.001115 +68.183.91.167,127.0.0.1 - - [16/Sep/2025 15:47:21] "GET /login HTTP/1.1" 200 1835 0.001974 +68.183.91.167,127.0.0.1 - - [16/Sep/2025 15:47:22] "GET /favicon.ico HTTP/1.1" 404 331 0.000847 +disconnect handler error Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'algorithm' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:23:06] "GET /materials/algorithm HTTP/1.1" 500 - -[2025-09-06 14:23:07,421] ERROR in app: Exception on /materials/algorithm [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/engineio/server.py", line 450, in run_handler + return self.handlers[event](*args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 671, in _handle_eio_disconnect + self._handle_disconnect(eio_sid, n, reason) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 568, in _handle_disconnect + self._trigger_event('disconnect', namespace, sid, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 150, in on_disconnect + user_uuid2chatmanager[uuid].disconnect(uuid) +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:51] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=websocket&sid=cekXcN6msgjITGbfAAAH HTTP/1.1" 200 0 11049.633881 +(185715) accepted ('127.0.0.1', 45882) +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:53] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbJGjMh HTTP/1.1" 200 275 0.000827 +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:54] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbJGjcT&sid=SmogL1S86UeH8buqAAAJ HTTP/1.1" 200 192 0.000960 +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:54] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbJGjcX&sid=SmogL1S86UeH8buqAAAJ HTTP/1.1" 200 196 0.000708 +(185715) accepted ('127.0.0.1', 45890) +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:55] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbJGjt8&sid=SmogL1S86UeH8buqAAAJ HTTP/1.1" 200 192 0.000617 Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'algorithm' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:23:07] "GET /materials/algorithm HTTP/1.1" 500 - -101.87.252.115 - - [06/Sep/2025 14:23:10] "GET /switch-role/teacher HTTP/1.1" 302 - -101.87.252.115 - - [06/Sep/2025 14:23:10] "GET /dashboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:23:10] "GET /static/css/dashboard.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:23:10] "GET /static/js/dashboard.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:23:11] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "GET /switch-role/student HTTP/1.1" 302 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "GET /teacherboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "GET /static/css/teacherboard.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "GET /static/css/dashboard.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "GET /static/css/teacher_course_setting.css HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "GET /static/js/course_current.js HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "GET /static/js/teacherboard.js HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "GET /static/js/teacher_course_setting.js HTTP/1.1" 304 - -101.87.252.115 - - [06/Sep/2025 14:24:02] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -[2025-09-06 14:24:02,837] ERROR in app: Exception on /materials/algorithm [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/hub.py", line 471, in fire_timers + timer() + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/timer.py", line 59, in __call__ + cb(*args, **kw) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/greenthread.py", line 272, in main + result = function(*args, **kwargs) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 591, in _handle_event_internal + r = server._trigger_event(data[0], namespace, sid, *data[1:]) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 53, in on_login + user_id = uuid2username[user_uuid] +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +(185715) accepted ('127.0.0.1', 45900) +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:55] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbJGjt9&sid=SmogL1S86UeH8buqAAAJ HTTP/1.1" 200 157 0.000618 +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:55] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbJGk04&sid=SmogL1S86UeH8buqAAAJ HTTP/1.1" 200 157 0.000268 +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:56] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbJGk9U&sid=SmogL1S86UeH8buqAAAJ HTTP/1.1" 200 157 0.000240 +disconnect handler error Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'algorithm' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:24:02] "GET /materials/algorithm HTTP/1.1" 500 - -219.228.146.148 - - [08/Sep/2025 07:48:34] "GET /teacherboard HTTP/1.1" 302 - -219.228.146.148 - - [08/Sep/2025 07:48:34] "GET /login HTTP/1.1" 200 - -219.228.146.148 - - [08/Sep/2025 07:48:34] "GET /static/css/login.css HTTP/1.1" 200 - -219.228.146.148 - - [08/Sep/2025 07:48:34] "GET /static/js/login.js HTTP/1.1" 200 - -219.228.146.148 - - [08/Sep/2025 07:48:35] "GET /favicon.ico HTTP/1.1" 404 - -2025-09-08 14:47:28.122 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Serving Flask app 'apps' - * Debug mode: off -WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. - * Running on all addresses (0.0.0.0) - * Running on http://127.0.0.1:5551 - * Running on http://172.31.34.185:5551 -Press CTRL+C to quit -2025-09-08 14:50:17.500 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Serving Flask app 'apps' - * Debug mode: off -WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. - * Running on all addresses (0.0.0.0) - * Running on http://127.0.0.1:5551 - * Running on http://172.31.34.185:5551 -Press CTRL+C to quit -156.229.165.237 - - [08/Sep/2025 14:50:27] "GET / HTTP/1.1" 302 - -156.229.165.237 - - [08/Sep/2025 14:50:28] "GET /login HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:28] "GET /static/css/login.css HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:29] "GET /static/js/login.js HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:30] "GET /favicon.ico HTTP/1.1" 404 - -156.229.165.237 - - [08/Sep/2025 14:50:36] "POST /login_post HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:38] "POST /login_post HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:39] "GET /dashboard HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:40] "GET /static/css/dashboard.css HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:40] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:40] "GET /static/js/dashboard.js HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:41] "POST /dashboard/get_course_progress HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:42] "GET /desktop_nouser/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1" 302 - -[2025-09-08 14:50:43,444] DEBUG in vscode: config file path: /home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法/.config -156.229.165.237 - - [08/Sep/2025 14:50:43] "GET /desktop/user_c363ada4-69ca-44f8-82e9-9ce8805d33a0/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:44] "GET /static/css/desktop.css HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:44] "GET /static/js/chatbox.js HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:44] "GET /get_session HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:45] "GET /68bacdfadf5aeae0912f7f18-基础算法-二分-markdown HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:45] "GET /static/基础算法-二分.html HTTP/1.1" 200 - -2025-09-11 03:37:39.548 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Serving Flask app 'apps' - * Debug mode: on -WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. - * Running on all addresses (0.0.0.0) - * Running on http://127.0.0.1:5551 - * Running on http://172.31.34.185:5551 -Press CTRL+C to quit - * Restarting with stat -2025-09-11 03:37:43.308 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Debugger is active! - * Debugger PIN: 105-227-715 -156.229.165.237 - - [11/Sep/2025 04:18:19] "GET / HTTP/1.1" 302 - -156.229.165.237 - - [11/Sep/2025 04:18:19] "GET /login HTTP/1.1" 200 - -156.229.165.237 - - [11/Sep/2025 04:18:20] "GET /static/js/login.js HTTP/1.1" 200 - -156.229.165.237 - - [11/Sep/2025 04:18:20] "GET /static/css/login.css HTTP/1.1" 200 - -156.229.165.237 - - [11/Sep/2025 04:18:20] "GET /favicon.ico HTTP/1.1" 404 - -59.78.194.184 - - [11/Sep/2025 04:18:49] "GET /login HTTP/1.1" 200 - -59.78.194.184 - - [11/Sep/2025 04:18:49] "GET /static/js/login.js HTTP/1.1" 200 - -59.78.194.184 - - [11/Sep/2025 04:18:49] "GET /static/css/login.css HTTP/1.1" 200 - -59.78.194.184 - - [11/Sep/2025 04:18:49] "GET /favicon.ico HTTP/1.1" 404 - -59.78.194.184 - - [11/Sep/2025 04:18:49] "GET /favicon.ico HTTP/1.1" 404 - -59.78.194.184 - - [11/Sep/2025 04:18:50] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 04:21:41] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 04:21:41] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:41] "GET /static/js/login.js HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:41] "GET /static/css/login.css HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:41] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 04:21:41] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 04:21:42] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 04:21:47] "POST /login_post HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:49] "POST /login_post HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:50] "GET /dashboard HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:50] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:50] "GET /static/css/dashboard.css HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:50] "GET /static/js/dashboard.js HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:51] "POST /dashboard/get_course_progress HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:53] "GET /desktop_nouser/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1" 302 - -[2025-09-11 04:21:53,385] DEBUG in vscode: config file path: /home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法/.config -127.0.0.1 - - [11/Sep/2025 04:21:53] "GET /desktop/user_f300a0e5-d63a-4101-a2c6-1015d960e06f/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:53] "GET /static/css/desktop.css HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:53] "GET /static/js/chatbox.js HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:54] "GET /get_session HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:54] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 04:21:54] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 04:21:55] code 400, message Bad request version ('Ü\x8e÷j?d!¹Á\x9có5=µ7í»´b\x86q\x05\x14Ê\\0F¬\x8ep\x08Ï^\x03¥\x00\x05\x00\x05\x01\x00\x00\x00\x00\x00-\x00\x02\x01\x01\x00\x1b\x00\x03\x02\x00\x02\x00') -127.0.0.1 - - [11/Sep/2025 04:21:55] "\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03qàât¿¡T½\x13ä©?ÆÃ=qIÍ\x8dºÀ\x1f½%´L\x81\x13Ùä\x13p e\x9cL´Ò;7ëË\x04¡\x82¿÷×w/këM¿\x86\x1dögÿ(:Ïn\x91m\x00 jj\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06\x85**\x00\x00ÿ\x01\x00\x01\x00\x00\x0d\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01\x00\x10\x00\x0e\x00\x0c\x02h2\x08http/1.1þ\x0d\x00ú\x00\x00\x01\x00\x01?\x00 ý\x99\x0e±\x9d¿ÛH\x9d±õlVSó§Ú\x08R\x12øºíÏB¬\x1dk,ØÝo\x00Ð\x83´>Úß\x83oä|\x98\x08Ø\x9014ËCò \x97\x1d*l\x90ø»EÿPË\x82Ì®NÉ=û\x18éu#Vþ¯³B\x95µ.\x9fÉ\x8cWö²Nu³\x10Dnw\x1fR\x8eÒ\x9eO§Ê\x11Ïr±ÂÕ^ÏÖù¿\x17&÷\x97öËQ]W\x12àãʹ\x99Ð0¦áº*Ô×\x92(Ú¯H!\x03%hJê³ònÝÜ£\x8d\x06ϵãjz\x04äMæ§\x97\x1fE¹Ã1\x09lvÑXJuëñrò»ò?Kì\x0cU>{¶\x96]~®}b\x10eÂnæ\x04\x1dÜ\x8e÷j?d!¹Á\x9có5=µ7í»´b\x86q\x05\x14Ê\\0F¬\x8ep\x08Ï^\x03¥\x00\x05\x00\x05\x01\x00\x00\x00\x00\x00-\x00\x02\x01\x01\x00\x1b\x00\x03\x02\x00\x02\x00" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:21:55] "GET /68bacdfadf5aeae0912f7f18-基础算法-二分-markdown HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:55] "GET /static/基础算法-二分.html HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:55] code 400, message Bad request version ('\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01\x00') -127.0.0.1 - - [11/Sep/2025 04:21:55] "\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x03]NìÙů÷~\x88í]^é\x15Ì\x93`\x06§è %¡BDÍP\x8eh°\x9d\x84 ÓW$6{ÓÊ\x82ª\x8a\x9c¤òÃLâó¿\x88\x97ßÓ,g7ïí]ªÉÆ\x00 ªª\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06e**\x00\x00\x00\x05\x00\x05\x01\x00\x00\x00\x00\x00\x0d\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01\x00" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:21:56] code 400, message Bad request version ('·0ø[£pU©äÊ÷QÂbg\x18\x19\x87Föv§') -127.0.0.1 - - [11/Sep/2025 04:21:56] "\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x03¸Òå\x976}\x96Êu\x08z{ÎÏ7.#\x82ºÏ8ie\x88P\x0cî\x1fx¢+g \x08å\x87¨ü9×O(´â©üÈ3¥\x96gIî\x07/pªÛ\x15®\x91~mbÙ\x00 zz\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06eúú\x00\x00\x003\x04ï\x04íÊÊ\x00\x01\x00\x11ì\x04Àv\x08\x8cÄ&\x0c)\x0bL\x12X\x1aP\x1aAi\x11\x80¦sdØA\x92Ã\x1c\x03뱤hà\x1eÉ\x0c·0ø[£pU©äÊ÷QÂbg\x18\x19\x87Föv§" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:21:56] code 400, message Bad request version ('\x02h2\x08http/1.1\x00\x17\x00\x00\x00\x12\x00\x00\x00') -127.0.0.1 - - [11/Sep/2025 04:21:56] "\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03¥\x14ÅOÓ÷¯Åúâññ¡'öC»Ù}0Ìפ6'Î\x9b_î~\x01ä F¤,\x97g"\x03ÛuF0\x0c¥¬UܤµFÀÁ\x13d¹ß\x86/ÿ\x8fz\x9bS\x00 \x9a\x9a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06¥ºº\x00\x00\x00\x1b\x00\x03\x02\x00\x02ÿ\x01\x00\x01\x00DÍ\x00\x05\x00\x03\x02h2\x00\x10\x00\x0e\x00\x0c\x02h2\x08http/1.1\x00\x17\x00\x00\x00\x12\x00\x00\x00" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:21:57] code 400, message Bad request version ('**\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06¥ºº\x00\x00DÍ\x00\x05\x00\x03\x02h2\x00') -127.0.0.1 - - [11/Sep/2025 04:21:57] "\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03ä°Áí ¡¢þcÁd@'ô\x08%8\x00ê\x8c´\x1cAÒ\x9f\x01e]ÃÉ\x83Ç­¦\x99x\x80\x00 **\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06¥ºº\x00\x00DÍ\x00\x05\x00\x03\x02h2\x00" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:21:57] code 400, message Bad request version ('&À!ð¢´îÆÌm\x00+·') -127.0.0.1 - - [11/Sep/2025 04:21:57] "\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03\x93NÍÔ\x09\x82\x80Ë\x10Q\x1a\x9a\x18\x18!7\x82Mhê7¬\x96^´Nfl0k\x8e¼ ÑG"a_¹s\x1a0Ó]bµ\x89\x85&À!ð¢´îÆÌm\x00+·" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:21:58] code 400, message Bad request version ('\x00\x02\x01\x00\x00\x1b\x00\x03\x02\x00\x02\x00') -127.0.0.1 - - [11/Sep/2025 04:21:58] "\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03\x1cÿÞËÌ2ûß´¶m\x1e5\x0b\x8d\x07f¯ta\x9cvÿCÖa#¡fPÔw ¾´¬ÂÆ*\x84²±\x99ÂãmN\x151¾Q\x01x¾\x81`\x90\x87È«"¼\x10äj\x00 JJ\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06\x85\x8a\x8a\x00\x00\x00\x12\x00\x00\x00\x17\x00\x00\x00#\x00\x00\x00\x00\x00\x0e\x00\x0c\x00\x00\x09localhost\x00\x0d\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01\x00\x0b\x00\x02\x01\x00\x00\x1b\x00\x03\x02\x00\x02\x00" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:21:58] code 400, message Bad request version ('\x00\x02\x01\x00ÿ\x01\x00\x01\x00\x00\x17\x00\x00\x00\x12\x00\x00\x00') -127.0.0.1 - - [11/Sep/2025 04:21:58] "\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x03Ûª\x8eùOÚ¸KÞ\x80Õ\x83Ì\x8al\x87²\x8d¶ÚC\x83µ^´Ã\x07ç\x9c_\x05ô p\x08}¤y\x02a¾\x80é<\x9d¾\x81g\x91=¨\x0d¶¾9}C1\x8bÑsꮽ9\x00 \x1a\x1a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06eêê\x00\x00\x00-\x00\x02\x01\x01\x00\x00\x00\x0e\x00\x0c\x00\x00\x09localhost\x00#\x00\x00DÍ\x00\x05\x00\x03\x02h2\x00\x0b\x00\x02\x01\x00ÿ\x01\x00\x01\x00\x00\x17\x00\x00\x00\x12\x00\x00\x00" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:01] code 400, message Bad request version ('\x02h2\x08http/1.1\x00') -127.0.0.1 - - [11/Sep/2025 04:22:01] "\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x03;´\x96Ù:6çv#*b3åF7\x93¤#hÐ\x98ÈÌv\x926J\x83GU\x02Ö ·\x0d+\x83~¢èãªA¹\x98+\x1dæÊ\x07=¯\x06\x02c¿\x90\x91æÔàȼê,\x00 ªª\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06e\x8a\x8a\x00\x00\x00\x17\x00\x00ÿ\x01\x00\x01\x00\x00\x10\x00\x0e\x00\x0c\x02h2\x08http/1.1\x00" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:01] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03\x9d`àÜ\x8e¡©<Û\x10y$zl¶"%') -127.0.0.1 - - [11/Sep/2025 04:22:01] "\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03\x9d`àÜ\x8e¡©<Û\x10y$zl¶"%\x0c\x1a\x08Ò\x89Ð\x1a\x9f\x93ð\x05¦\x0f\x96" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:02] code 400, message Bad request version ('{m\x93\x0e') -127.0.0.1 - - [11/Sep/2025 04:22:02] "\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03\x18¤\x1erB\x0c\x0d3\x86½¨ÊA\x80\x14\x0b\x1a¸ç;¥f)'Ã\x00ÊÉ\x07\x89\x02ë {m\x93\x0e" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:02] code 400, message Bad request version ('ó') -127.0.0.1 - - [11/Sep/2025 04:22:02] "\x16\x03\x01\x06²\x01\x00\x06®\x03\x03\x1c¹¾³Õ\x01æý\x9d¦*óz:ľRÔ0ÔJ\x01\x9a²}\x14\x91^¹V c |\x99È \x80à\x87^\x1cbná\x87küÅÅÖrþ]é`#ɪsI\x04ªJ¡\x00 \x8a\x8a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06Eºº\x00\x00\x00\x0b\x00\x02\x01\x00ÿ\x01\x00\x01\x00\x00\x00\x00\x0e\x00\x0c\x00\x00\x09localhostþ\x0d\x00º\x00\x00\x01\x00\x01K\x00 \x9f\x10ê\x8c\x16Ì\x02w\x89\x08Fïþ¼X&7\x84\x83yR\x1fó" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:03] "GET /static/css/desktop.css HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:22:07] code 400, message Bad request version ('\x00\x02\x01\x00\x00\x1b\x00\x03\x02\x00\x02\x00') -127.0.0.1 - - [11/Sep/2025 04:22:07] "\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03©Ú»#\x17¡\x9a#¡±¸\x18óßÊ5\x8f\x85\x1c99¯\x966V®0\x19Ër/\x0c \x9fÔÔ4Þs;yöj\x8a:\x96æF=\x1eû«±eîC}¢©\x95WìH\\\x9e\x00 ªª\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06\x85**\x00\x00DÍ\x00\x05\x00\x03\x02h2\x00\x0b\x00\x02\x01\x00\x00\x1b\x00\x03\x02\x00\x02\x00" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:07] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03Ôþ,\x08ÛFñ0ù÷Ý©\x08à\x0e\x7fpD0\x05¤24áD2Ë%/2³È') -127.0.0.1 - - [11/Sep/2025 04:22:07] "\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03Ôþ,\x08ÛFñ0ù÷Ý©\x08à\x0e\x7fpD0\x05¤24áD2Ë%/2³È °ãH=\x10mx¢ttZN\x028§ú$``?Û-1UÉ\x81&¿y:\x86\x86\x00 " HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:07] code 400, message Bad request version ('\x1a\x1a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06eÊÊ\x00\x00ÿ\x01\x00\x01\x00\x003\x04ï\x04í') -127.0.0.1 - - [11/Sep/2025 04:22:07] "\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x03=0?D-NB°ß\x81ú¥÷³½\x02\x92Ð\x1ej2É?ê\x9c2\x01ï?hoö ò(D\x91(¢\x8cÕÐè:ø!\x95|¥\x96~¦\x82fËj\x87ç\x05ýú¹\x19\x9aÆ\x00 \x1a\x1a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06eÊÊ\x00\x00ÿ\x01\x00\x01\x00\x003\x04ï\x04í" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:08] code 400, message Bad request version ('\x1a\x1a\x00\x00\x00') -127.0.0.1 - - [11/Sep/2025 04:22:08] "\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03\x1e8ó~ot¶\x90ë±gÖ¹ÉcÞÏöÖ\x13D\x8cû\x94¡½[UkÖyÒ \x80\x1cDU×}3>ëóg{Ó2¸\x7fkáû\x9b\x96\x06]¬´)U¨\x09\x93@\x97\x00 ZZ\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06\x85\x1a\x1a\x00\x00\x00" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:13] code 400, message Bad request version ('ãWf$al·') -127.0.0.1 - - [11/Sep/2025 04:22:13] "\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03îóåKT\x9f\x91\x89s«:°FÍ\x04ñ)\x16ý­\x9f¦¨Obù&ÿç¡2¾ ar2\x19o\x9e:Í6H¼\x89Òó¤\x9f\x0eSÀ+7/4\x85ÃGK\x9fU\x93\x96¸\x00 êê\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06\x85\x1a\x1a\x00\x00\x00\x0d\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01\x003\x04ï\x04í**\x00\x01\x00\x11ì\x04ÀhIo\x000\x0cäë\x86±õ¡\x1f)\x95è9¼^Ñ\x7f²¶­\x92èm\x86\x0ba<\x14\x84ñZÉ_$ÎìôÁä\x11Åç\x92t\x0dãWf$al·" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:13] code 400, message Bad request version ('localhost\x00#\x00\x00\x003\x04ï\x04ízz\x00\x01\x00\x11ì\x04ÀtQ\x8f\x02\x9cQ\x8b\x00]sºrÖ\x91\x9e\x80\x03OÊ') -127.0.0.1 - - [11/Sep/2025 04:22:13] "\x16\x03\x01\x06²\x01\x00\x06®\x03\x03\x1c¾2|´áÚÊ+Eé¤Û$Çè£0Í-¸u\x937\x85\x11ÛqÙ\x85¯Ð µã\x14|kg¹\x9d;\x01õ28DzïaI{Ì1SÀ,\x07L\x80\x92ö±Â©\x00 ªª\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06E\x9a\x9a\x00\x00\x00\x1b\x00\x03\x02\x00\x02\x00\x00\x00\x0e\x00\x0c\x00\x00\x09localhost\x00#\x00\x00\x003\x04ï\x04ízz\x00\x01\x00\x11ì\x04ÀtQ\x8f\x02\x9cQ\x8b\x00]sºrÖ\x91\x9e\x80\x03OÊ" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:14] code 400, message Bad request syntax ('\x16\x03\x01\x06²\x01\x00\x06®\x03\x03ëHw\x9fC') -127.0.0.1 - - [11/Sep/2025 04:22:14] "\x16\x03\x01\x06²\x01\x00\x06®\x03\x03ëHw\x9fC" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:14] code 400, message Bad request version ('å@Ì#Â\x9a4_ë') -127.0.0.1 - - [11/Sep/2025 04:22:14] "\x16\x03\x01\x06²\x01\x00\x06®\x03\x03ÝN4E\x8azL\x82\x0e\x09\x84k:*Ø\x97³òÉpXýë'\x82ÎÐ\x07ñ¥T \x864¢;\x9ft\x92ù®-øø]Ö:\x81.À\x1dÔÉx\x05\x94XÈ\x98á¼¹ïê\x00 úú\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06E**\x00\x00\x00+\x00\x07\x06**\x03\x04\x03\x03DÍ\x00\x05\x00\x03\x02h2þ\x0d\x00º\x00\x00\x01\x00\x01\x12\x00 C\x88D\x88È:=9¿\x11\x04G\x85\x09À.ñ¢HèÆNÛ\x84\x12ôP>ötu\x05\x00\x90o\\47g}\x1då@Ì#Â\x9a4_ë" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:20] code 400, message Bad request syntax ('\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03í\x14Iþ\x05ÅÒv/\x8dAµ¡H+') -127.0.0.1 - - [11/Sep/2025 04:22:20] "\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03í\x14Iþ\x05ÅÒv/\x8dAµ¡H+" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:20] code 400, message Bad request version ('\x8a\x8a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06e') -127.0.0.1 - - [11/Sep/2025 04:22:20] "\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x037øÂì$èsêe\x1a«\x12\x11\x8c\x93Ú\x18\x0f\x13ÀÖ8\x05¤U\x94[µÁ»Þ. ß°_0Çå\x9c\x01\x1cdÝm\x80¹(\x81\x02Ê\x02zDàí\x10Ñ4\x8b\x0b\x06\x92C¡\x00 \x8a\x8a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06e" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:21] code 400, message Bad request version ('ø\x86¹vO\x00°ÑWìú8\x92S7D\x8d¦\x9e^S\x16\x9c±©)Á\x95¼N\x84²D;\x18/ÏȪ±') -127.0.0.1 - - [11/Sep/2025 04:22:21] "\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x03®{«ãPUÃ.,®á"Z Ì\x15\x1cx\x8eÑ}\x87sº\x82\x00\x93T\x9bzuÕ \x9fñmK}\x81LtªúÞ¦è6\x17Ú\x08´5ãgÏ·«\x19ú\x09ê\x92\x1fâz\x00 ªª\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06ezz\x00\x00\x00\x0b\x00\x02\x01\x00\x00\x10\x00\x0e\x00\x0c\x02h2\x08http/1.1\x00+\x00\x07\x06ZZ\x03\x04\x03\x03\x00-\x00\x02\x01\x01\x00#\x00\x00\x00\x1b\x00\x03\x02\x00\x02\x00\x12\x00\x00ÿ\x01\x00\x01\x00\x00\x0d\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01þ\x0d\x00Ú\x00\x00\x01\x00\x01õ\x00 7\x1fAó\x07KÔÛ`äÁ}^®\x8f£A\x01×'ÒO\x1eH\x1dï\x1fø\x86¹vO\x00°ÑWìú8\x92S7D\x8d¦\x9e^S\x16\x9c±©)Á\x95¼N\x84²D;\x18/ÏȪ±" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:21] code 400, message Bad request version ('\x91Ç\x0e\x82Û]\x07c%H\x08»ÙûµÞÊ\x9a\x93ÛÂÊÝ£ÝJW|åâín') -127.0.0.1 - - [11/Sep/2025 04:22:21] "\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03\x9eÎtÑ\x99ôÞùX\x0d\x10\x8aËæ\x84­­8A\x10±,:Kù\x0cò\x9c4w\x8f® \x07ë?\x0cé\x9cIî\x9d- ¨h,W¾êÔ»\x99áÝ5\x08s¢V1¹\x00 JJ\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06¥jj\x00\x00\x00\x17\x00\x00\x00\x10\x00\x0e\x00\x0c\x02h2\x08http/1.1\x00\x0b\x00\x02\x01\x00\x00\x00\x00\x0e\x00\x0c\x00\x00\x09localhost\x00+\x00\x07\x06ºº\x03\x04\x03\x03\x00#\x00\x00ÿ\x01\x00\x01\x00\x00-\x00\x02\x01\x01\x00\x1b\x00\x03\x02\x00\x02\x00\x05\x00\x05\x01\x00\x00\x00\x00þ\x0d\x01\x1a\x00\x00\x01\x00\x01Ê\x00 %\x14d\x9c[§\\núºÞ§\x87ßùevW¶\x90ïT\x7fö\x01%«\x84a\x89ª\x0f\x00ð×\x19\x82**Ç\x8f;W\x05knj]L³\x9eßÅ\x0cs¿õ\x0fM.G\x95\x0dè»\x00\x836<¹¬FE[*\x9a\x8d\x85®\x18ó\x82!\x8ayâ=L0ó-ÌÐKRè»r I\x8fÛ\x0e½ß&d\x95\x8eÿ<ü!$C\x8bð\x06/\x0bÕ\x18\x89$\x1b\x13è5·\x02ñð\x1dà\x1bIX\x87ü*ä\x0e\x110\x9f\x8d¦`UYÏuKåËÑñ+úÑf âÐ\x8c\x0c¥Ú\x14¤ÚË`Ös\x8b¼\x1fÞ¦\x89)á\x8fw\x11\x82\x8a\x80ÿ\x10p\x9eËpXÉÆG¾k_©#\x81\x1d\x094ù$\x04ó\x14#-t\x7f±\x85¬ö\x06}h\x06»Ï\x9aI\x84n1tì\x1c\x91Ç\x0e\x82Û]\x07c%H\x08»ÙûµÞÊ\x9a\x93ÛÂÊÝ£ÝJW|åâín" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:27] code 400, message Bad request version ('\x14') -127.0.0.1 - - [11/Sep/2025 04:22:27] "\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x03\x8aJ5\x1b©Ü\x8f\x1c\x08ïrÁÕ%´g®¶\x1c\x99¢Ö\x89ò\\h8þ\x7fÏã\x16 .~±ÂO÷\x8cH_\x10b.\x84°\x88\x03O\x9cIê\x8cÿ\x0fGã\x1c\x14" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:22:27] code 400, message Bad request version ('\x8a\x8a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06Eªª\x00\x00\x00\x17\x00\x00\x00') -127.0.0.1 - - [11/Sep/2025 04:22:27] "\x16\x03\x01\x06²\x01\x00\x06®\x03\x03\x82\x93=\x9f?w\x96Ã/^\x1e\x1bú¡\x8c\x8dZ\x97Úc\x8a\x09r^®\x80FÃ\x9a\x92N; ù\x97ë2<\x07ÜìÉ\x7f\x01xo«Â\x8c\x80Ê.û\x13\x0d§ù\x938ñN\x1fA5Ú\x1bðµ\x03\x96Ù\x06Ý<ãbÜn~\x97Ó»=\x91¦Æ\x9cU]ñ9^z\x97\x1fJu®C^U\x83\x05\x1aá\x86%ðK\x91\x09ÄT\x94\x93WÛ\x00\x0b\x00\x02\x01\x00\x00\x12\x00\x00\x00\x1b\x00\x03\x02\x00\x02\x00+\x00\x07\x06ÚÚ\x03\x04\x03\x03\x00\x00\x00\x0e\x00\x0c\x00\x00\x09localhost\x00\x10\x00\x0e\x00\x0c\x02h2\x08http/1.1\x003\x04ï\x04íÊÊ\x00\x01\x00\x11ì\x04À\x94\x03µÖ6\x1b+X¶2h©õè\x17ºº8\x8e3\x82$ì2u·Zù³5µú\x94\\;/q¬\x9aÍ÷¥\x0d\x90r@;Zæ|Æ\x8e(H\x015+_\x8b©\x1c0`­0³\x96\x89¼" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:23:29] code 400, message Bad request version ('ú\x8b¼g\x8b©f\x94Bò+\x9fÉ\x02\x0eÀ§ÆÚj%ì') -127.0.0.1 - - [11/Sep/2025 04:23:29] "\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03\x8aiñ\x9cvî ²*Â{^Øþ¨\x91'Ú\x0cUMS©þÙI^a\x0c}JH 0C®\x8aiE\x9c\x8db\x8aµ\x09º¶]õ?²9öðlüOp\x9ai[.®j\x86\x00 \x8a\x8a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06¥\x1a\x1a\x00\x00\x00\x00\x00\x0e\x00\x0c\x00\x00\x09localhost\x003\x04ï\x04íªª\x00\x01\x00\x11ì\x04À\x90讵¡t\x97\x89\x1c\x80!.\x9aÛ(¸×\x03AÁ\x960×7\x9f \x89tVZIسv\x09[0°\x87 *ONÁ\x1dMö/ÓöÆ!%^ìÅmlªÁÛ\\S\x88æ\x8e ¡p\x1af\x1dRzVÝ*\x94­\x16{rè¦1g~~\x83OÔ¥H\x00½´5\x8a¤ÆË\x84\x8e\x8cWÖXÇÙ,#\x16\x9a\x16ð¸¥',~\x13t\x91m|\x19^É?¾\x02\x15ál\x96Å\x0c4g÷.YåE\x16k^\x1a\x949Dõj\x92°\x85÷ÅH.aÄgj~z¬\x0dú\x8b¼g\x8b©f\x94Bò+\x9fÉ\x02\x0eÀ§ÆÚj%ì" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:23:30] code 400, message Bad request version ('æ\x9a\x00') -127.0.0.1 - - [11/Sep/2025 04:23:30] "\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03\x13ª \x16ò½Hã: ö¸h6_d\x92o\x89_\x9fZ\x8cÔ\x10\x8a9£_\x9f¿Z \x8c7Wí| \x12\x89¸ßãV)\x01FóuÖû\x85X3WðXË¡\x86w\x1dæ\x9a\x00 " HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:23:33] code 400, message Bad request version ("ê3=ItìøÄùóûF\x82MÓ´³¤\x98C:¾<¶êÝíRPÑb}\x9d1'D:U;\x8fP\x14ïö\x18ì[xnf·\x91^5l\x97èªjªq\x00") -127.0.0.1 - - [11/Sep/2025 04:23:33] "\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03©[E9Ü\x12ö1Þu÷\x9cÆÜ±Í\x1dر®\x0by!î\x9c°\x86¸ v;\x87 çÛ`·aSÝ\x00˨Ës1 S1]ż^s.J>õ\x8aﳸ~\x1e±\x00 \x8a\x8a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06¥JJ\x00\x00\x00\x0b\x00\x02\x01\x00\x00#\x00\x00\x00\x0d\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01\x00-\x00\x02\x01\x01ÿ\x01\x00\x01\x00þ\x0d\x01\x1a\x00\x00\x01\x00\x015\x00 0öúÀÍ)½Vßü¡\x1eÅ]n³Ùl>Ù\x1fÐ\x8cð%J®»\x945\x16\x19\x00ð\x15꯳i\x89Ø\x00ý\x08©GÔò©Y@\x96KÆÌ}\x8f[úW\x0fºÉQ\x8f³\x94¯úVÁؾ\x9f\x13\x10\x8dÞ+ém\x9f\x9cì|þ$\x98\x89ó$C(¥\x15\x1ao\x1dÎ_OpË\x9fshÙ\x1fþMÚ\x04Ýbu\x10\x01Î×qÞZ0#J¯\x8a\x80>¸\x86\x94Þ£ÒÏÎ42\x7fÜr{3A3\x10Zé{\x0eA­.\x94©\x12/N$\x98,È9O°n:ÁªhPé½\x95+\x8bÄ»¶æÇ\x1eÃäsvw\x04ºÇ÷\x8eØ<`l\x1b¸\x1dU?I\x14\x1f\x02\x10\x8c2\x03¤\x1fê3=ItìøÄùóûF\x82MÓ´³¤\x98C:¾<¶êÝíRPÑb}\x9d1'D:U;\x8fP\x14ïö\x18ì[xnf·\x91^5l\x97èªjªq\x00" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:23:34] code 400, message Bad request version ('\x11') -127.0.0.1 - - [11/Sep/2025 04:23:34] "\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03õ\x99±\x10\x11ÃG\x97r !6wU\x12i\x8f\x11\x19\x19\x9fÃ=áO_Köß\x1f­9 -;ÜtçñcÌ\x1eB\x10S¡Ò\\ÝvmMÓ§Ä\x9c5wq(_\x92Î.v\x00 zz\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06¥ºº\x00\x00\x003\x04ï\x04íÚÚ\x00\x01\x00\x11ì\x04À*±S\x81Su\x1f¹\x18\x07\x89\x1fÙÚ ¸÷\x11hö!\x9ct\x1e\x11" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:23:34] code 400, message Bad request version ('\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01\x00#\x00\x00\x00\x12\x00\x00\x00\x17\x00\x00\x00\x05\x00\x05\x01\x00\x00\x00\x00\x00') -127.0.0.1 - - [11/Sep/2025 04:23:34] "\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03\x17 I\x10\x0d¹\x0f\x8cอöÃÅ\x0d\x95\x17÷¸\x18\x00NÞñ\x8dAñÄ\x16&V| Û3@è7Êüõ~%MI÷\x81\x09äæQ¶=\x17-Ñ\x87 g\x05ÒÕà&â\x00 ::\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06\x85zz\x00\x00\x00+\x00\x07\x06ZZ\x03\x04\x03\x03þ\x0d\x00ú\x00\x00\x01\x00\x01\x99\x00 ý]Ð\x8c\x9fZ\\þªc÷~õ+éÛ¬F¢u\x02]ȵYk\x0fó»]ã\x0e\x00Ð\x96\x19Wd \x8fk¦ÆÒÊWË\x03\x1a%b\x19\x09Ü\x92,*Â\x908\x0cÈÿ\x0f\x8aX'r¶\x14\x83R'Z\x0b XNCÈÆýV\x0bí\x9c=ÐäÇûM\x1a\x13\x9d\x95?\x07¦%y§\x9bGßüç \x9a¿ÜA<¶Åc£öH\x15n{QTàC÷C¥\x1d\x95Ý+ö®ÝÑE\x8bÝc\x19ä"u£W°Éë¥\x8a¯Y\x05GÄR¡äJÚªt¹B0´\x8dÀ¢«Ôç\x08OÁ9¯\x06~\x80,²\x94HÎà\x15×»æâêh"Ôá\x95&\x9a,ì\x8c\x83\x17IòcO\x135¾1´ÿ°³_ª\x1f\x9ez\x0cþ\x95¡7Uq\x9e\x9dm\x1fµ\x85I\x9b°+ý\x00\x0d\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01\x00#\x00\x00\x00\x12\x00\x00\x00\x17\x00\x00\x00\x05\x00\x05\x01\x00\x00\x00\x00\x00" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:23:35] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x06²\x01\x00\x06®\x03\x031Ü') -127.0.0.1 - - [11/Sep/2025 04:23:35] "\x16\x03\x01\x06²\x01\x00\x06®\x03\x031Ü\x85îà\x95Û4}/Ýë­\x9e\x03KQ\x188¿V~-«" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:23:38] code 400, message Bad request version ('娷\x17ñ9æ-ü×a\x00') -127.0.0.1 - - [11/Sep/2025 04:23:38] "\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x033\x00-j\x80è\x18\x8e\x10\x93¼z\\h¤}\x1e\x86²\x7fjÕc4\x88x\x8a\x1aK¡\x86± _²¤C'\x1by\x88¡¯\x97\x8f\x0e,= ^ã\x81·\x1e娷\x17ñ9æ-ü×a\x00 " HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:23:38] code 400, message Bad request version ('localhost\x003\x04ï\x04í\x9a\x9a\x00\x01\x00\x11ì\x04À\x9ckED£¶ÁH£úG$éð&6;U6\x16\x8c^\x95\x82ª«ÌÊc5&Â;fÁ­\x86vô\x14Ö\x1a!\x83\x04£Pwû³È\x0bÕiÕ\x0f¥ÖsÊ!¾òæ\x9cê\x90Ò7ùÞFèC\x09\x93\x16\x80«\x07ÓB¯¢ærä_xºYƦ+§ûü\x04ö0=?E\x89C:»\x9f\x86i\x91ã^í[F28ÿ'Òö{¡AÁ6äzù*Iöa½Ü¥h©ÇH\x01Î<Ý}s\x03\x96\x8b»\x80ºZ\x09Ë+ÑDÍ\x00\x05\x00\x03\x02h2\x00+\x00\x07\x06úú\x03\x04\x03\x03\x00\x17\x00\x00\x00#\x00\x00\x00\x0d\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01\x00\x0b\x00\x02\x01\x00\x00\x05\x00\x05\x01\x00\x00\x00\x00\x00" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:23:51] code 400, message Bad request syntax ('\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03\x97©Q\x88aKã{\x99ÑÞ') -127.0.0.1 - - [11/Sep/2025 04:23:51] "\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03\x97©Q\x88aKã{\x99ÑÞ" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:23:51] code 400, message Bad request version ('\x96è\x01\x9a¾N§ÿ1·\\x\x07mÓ©\x94}y') -127.0.0.1 - - [11/Sep/2025 04:23:51] "\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03#\x1b\x86\x90<[?[\x85ê\x9d/ã4ÆË\x0d\x1bÏ$~òHúg \x02м\x96g{ \x9cØÀËao0\x1d§\x8dXà\x1e5B¨5P_\x94ämèµUU\x86\x151\x89ÛÁ\x00 ªª\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06¥\x9a\x9a\x00\x00ÿ\x01\x00\x01\x00\x00\x12\x00\x00\x00\x17\x00\x00\x00-\x00\x02\x01\x01\x00\x05\x00\x05\x01\x00\x00\x00\x00þ\x0d\x01\x1a\x00\x00\x01\x00\x01\x01\x00 Êr\x9fm\x844ÈÄ\x1bz\x8dv`Ò\x15\x07\x83ËùUN¦Ê2º÷\x15Y­®\x04g\x00ðu$8\x8e\x88Ä_\x12ÂÖîF\x1b¡¹)\x0f·\x96²2\x9a(OÂ\x00\x03g¼£\x1f\x86rR²\x8d\x1bÚ\\°ã©¤\x0b\x96è\x01\x9a¾N§ÿ1·\\x\x07mÓ©\x94}y" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:23:51] "GET / HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:23:52] "GET /static/css/index.css HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:23:52] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:23:52] "GET /static/js/index.js HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:23:52] code 400, message Bad request version ("\x9cNO¬Ýß\x00}«Øe\x81\x81\x04Ó'Æ0¼A\x11ܽ¶S\x00") -127.0.0.1 - - [11/Sep/2025 04:23:52] "\x16\x03\x01\x06²\x01\x00\x06®\x03\x03ɍĸxQ¸\x93\x09·\x0c%{E\x02Õ\x88-[ô[ʯ:·\x0c.\x8fÐN`Ð Ü\x893ßös\x0c\x9cNO¬Ýß\x00}«Øe\x81\x81\x04Ó'Æ0¼A\x11ܽ¶S\x00 " HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:23:52] code 400, message Bad request version ('\x02h2\x08http/1.1DÍ\x00\x05\x00\x03\x02h2\x00') -127.0.0.1 - - [11/Sep/2025 04:23:52] "\x16\x03\x01\x06²\x01\x00\x06®\x03\x03Ñ\x17r%Ë\x0dÆt \x1fÆ&\x03^ÂèlZ[H\x93F\x09k\x91å>\x0eJêÐ\x91 J÷¥¥Ì\x82#Ã\x0d¸\x19Á\x8f©°~¤LV>t\x025Öl~\x8du±Ë¥|\x00 jj\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06Eêê\x00\x00\x00-\x00\x02\x01\x01ÿ\x01\x00\x01\x00\x00\x00\x00\x0e\x00\x0c\x00\x00\x09localhost\x00\x05\x00\x05\x01\x00\x00\x00\x00\x00#\x00\x00\x00+\x00\x07\x06**\x03\x04\x03\x03\x00\x1b\x00\x03\x02\x00\x02\x00\x10\x00\x0e\x00\x0c\x02h2\x08http/1.1DÍ\x00\x05\x00\x03\x02h2\x00" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:23:56] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 04:23:56] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:23:56] "GET /static/css/login.css HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:23:56] "GET /static/js/login.js HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:23:57] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 04:23:58] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 04:23:58] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:23:58] "GET /static/css/login.css HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:23:58] "GET /static/js/login.js HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:25:41] "GET /68bacdfadf5aeae0912f7f18-基础算法-二分-markdown HTTP/1.1" 200 - -2025-09-11 04:25:48.003 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Serving Flask app 'apps' - * Debug mode: on -Address already in use -Port 5551 is in use by another program. Either identify and stop that program, or start the server with a different port. -127.0.0.1 - - [11/Sep/2025 04:27:48] "GET /vsc HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 04:28:29] "GET / HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:28:29] "GET /static/css/index.css HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:28:29] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:28:29] "GET /static/js/index.js HTTP/1.1" 304 - -2025-09-11 04:28:30.929 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Serving Flask app 'apps' - * Debug mode: on -Address already in use -Port 5551 is in use by another program. Either identify and stop that program, or start the server with a different port. -127.0.0.1 - - [11/Sep/2025 04:28:32] "GET / HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:28:33] "GET /static/css/index.css HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:28:33] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:28:33] "GET /static/js/index.js HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:33:45] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 04:33:45] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:33:46] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 04:33:46] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:37:50] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 04:37:51] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:38:05] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 04:38:05] "GET /favicon.png HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 04:45:44] "GET /course/68bacdfadf5aeae0912f7f18 HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:45:44] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:45:44] "GET /static/css/course.css HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:45:44] "GET /dashboard HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:45:44] "GET /static/css/dashboard.css HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:45:44] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:45:44] "GET /static/js/dashboard.js HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:45:46] "POST /dashboard/get_course_progress HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:45:46] "GET /desktop_nouser/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1" 302 - -[2025-09-11 04:45:47,085] DEBUG in vscode: config file path: /home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法/.config -127.0.0.1 - - [11/Sep/2025 04:45:47] "GET /desktop/user_9a1cbf0a-e9f1-458f-9461-cdaea91b4aa0/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:45:47] "GET /static/css/desktop.css HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:45:47] "GET /static/js/chatbox.js HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:45:48] "GET /get_session HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:45:48] "GET /socket.io/?user_uuid=user_9a1cbf0a-e9f1-458f-9461-cdaea91b4aa0&folder=/home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法&EIO=4&transport=polling&t=Pat60-Y HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:45:48] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 04:45:48] "POST /socket.io/?user_uuid=user_9a1cbf0a-e9f1-458f-9461-cdaea91b4aa0&folder=/home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法&EIO=4&transport=polling&t=Pat610a&sid=4tXY_h-X9sCgOxu3AAAA HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:45:48] "GET /socket.io/?user_uuid=user_9a1cbf0a-e9f1-458f-9461-cdaea91b4aa0&folder=/home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法&EIO=4&transport=polling&t=Pat610b&sid=4tXY_h-X9sCgOxu3AAAA HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:45:48] "POST /socket.io/?user_uuid=user_9a1cbf0a-e9f1-458f-9461-cdaea91b4aa0&folder=/home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法&EIO=4&transport=polling&t=Pat6137&sid=4tXY_h-X9sCgOxu3AAAA HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:45:48] "GET /socket.io/?user_uuid=user_9a1cbf0a-e9f1-458f-9461-cdaea91b4aa0&folder=/home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法&EIO=4&transport=polling&t=Pat6138&sid=4tXY_h-X9sCgOxu3AAAA HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:45:48] "GET /68bacdfadf5aeae0912f7f18-基础算法-二分-markdown HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:45:48] "GET /static/基础算法-二分.html HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:45:49] "GET /favicon.ico HTTP/1.1" 404 - -websocket-client package not installed, only polling transport is available -convert_md: 68bacdfadf5aeae0912f7f18, 基础算法, 二分 -load_markdown_file: https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md -[Material(name='算法分析与设计', description='测试:算法分析与设计课程', teacher_id='TCake', created_at=datetime.datetime(2025, 9, 5, 19, 48, 10, 16000), updated_at=datetime.datetime(2025, 9, 5, 19, 54, 36, 964000), image_url='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/TCake_book_cover.png', chapters=[Chapter(chapter_name='基础算法', lessons=[Lesson(lesson_name='二分', markdown_lesson_file_link='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md', markdown_prompt_file_name='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_prompt.md', markdown_score_prompt_file_link='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_score_prompt.md')])])] -https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md -[Material(name='算法分析与设计', description='测试:算法分析与设计课程', teacher_id='TCake', created_at=datetime.datetime(2025, 9, 5, 19, 48, 10, 16000), updated_at=datetime.datetime(2025, 9, 5, 19, 54, 36, 964000), image_url='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/TCake_book_cover.png', chapters=[Chapter(chapter_name='基础算法', lessons=[Lesson(lesson_name='二分', markdown_lesson_file_link='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md', markdown_prompt_file_name='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_prompt.md', markdown_score_prompt_file_link='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_score_prompt.md')])])] -[Material(name='算法分析与设计', description='测试:算法分析与设计课程', teacher_id='TCake', created_at=datetime.datetime(2025, 9, 5, 19, 48, 10, 16000), updated_at=datetime.datetime(2025, 9, 5, 19, 54, 36, 964000), image_url='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/TCake_book_cover.png', chapters=[Chapter(chapter_name='基础算法', lessons=[Lesson(lesson_name='二分', markdown_lesson_file_link='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md', markdown_prompt_file_name='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_prompt.md', markdown_score_prompt_file_link='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_score_prompt.md')])])] -convert_md: 68bacdfadf5aeae0912f7f18, 基础算法, 二分 -load_markdown_file: https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md -User connected with session user_uuid: user_9a1cbf0a-e9f1-458f-9461-cdaea91b4aa0 -https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md -Received response: {'data': 'Connected to WebSocket!'} -Connected to server. SID: chnWs-_CWbwegXAJAAAH -https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md -https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_prompt.md -https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_score_prompt.md -{'引入': {'markdown': '\n二分是一个很简单基础,但很重要的知识点,为以后许多高级的数据结构与算法铺垫。\n\n下面是一个用二分的简单场景:\n\n假设小明从0到1000之间选择了一个数字但不告诉你,你可以不断猜测这个数,每次猜测小明会告知你的猜测得过大还是过小,问最多几次就一定能猜中?\n\n答案是利用二分查找的原理,猜测11次即可。\n\n1. 对于0到1000的答案备选区,猜测中位数500,假设过小,\n2. 则对于501到1000的答案备选区,猜测750,假设过大\n3. 则对于501到749的答案备选区,猜测625,假设过小,\n4. 则对于626到749区间......\n5. (688-749)\n6. (718-749)\n7. (734-749)\n8. (742-749)\n9. (746-749)\n10. (748-749)\n11. (749-749)\n\n在最差的情况下,第11次的答案备选区就一定长度为1了,也就是必然是答案。\n\n因此如果序列是有序的,就可以通过二分查找快速定位所需要的数据。\n\n#### 思考题(询问Agent以学习计算方法,或验证你的答案)\n\n对于上面那个题目,如果问题区间是1到4000,最差情况下需要猜测几次?\n\n', 'markdown_prompt': '\n本小节进行二分查找的引入,首先帮助学生理解教案引入章节的故事。\n\n确保学生理解了引入后,在进行思考题。\n\n如果不进行思考题,则询问一下是否不进行思考题,确认后进入下一节。\n\n如果进行思考题,告知学生计算方法并验证答案(答案是13次)\n\n计算方法:\n\n4000是初始答案区间长度,每次询问能够排除一半的区间,当区间长度小于等于1时,再进行一次猜测就一定是答案。\n\n4000不断除以2,除12次就小于等于1了,再加一次就一定是答案。最后是12+1=13次。\n\n(比4000大的最小2的次方数,4096就是2的12次方,这里的12就是答案中的12,或者写作"上取整(log2(4000))")\n\n询问学生,当学生告知理解后,进入下一节。\n\n', 'require_tools': [], 'score_prompt': '\n1. 学生独立给出了思考题的答案:10分 或者 学生在Agent指导下学会思考题:10分\n\n'}, '练习:二分查找': {'markdown': '\n试试对于下面的题目,用代码实现一下二分查找。\n\n#### 题目:有序数组寻址\n\n给出一个长度为n的有序数组(从小到大),有q次询问,对于每次询问,输出指定数在数组中的下标。如果不存在则输出-1。\n\n##### 输入\n\n第一行一个整数n。(1<=n<=10^5)\n\n第二行n个用空格分开的整数ai。(0<=ai<=10^8)\n\n第三行一个整数q,表示询问的次数。(1<=q<=10^4)\n\n后q行,每行一个整数b,表示询问的数。(0<=b<=10^8)\n\n##### 输出\n\nq行,每行一个整数,对应每次询问的返回结果。\n\n##### 提示:\n\n完成代码后,通知Agent进行评测。\n\n如果你还不完全会这个算法,询问Agent获取提示并进行学习。\n\n', 'markdown_prompt': '\n如果学生在实现的过程中遇到问题,不要直接告知完整代码如何编写,询问其当前遇到的是什么问题,并帮助学生一步步完成题目。\n\n实现代码后,全部通过测试数据后才可以进入下一节。\n\n本体测试点文件夹名 `twice_split。`\n\n\n', 'require_tools': [(, {'name': 'algorithm'})], 'score_prompt': '\n1. 学生最终代码通过所有测试点:30分\n2. 学生独立在10分钟内完成题目:10分 或者 学生在Agent指导下10分钟内完成题目:5分\n\n'}} -127.0.0.1 - - [11/Sep/2025 04:46:34] "GET /socket.io/?user_uuid=user_9a1cbf0a-e9f1-458f-9461-cdaea91b4aa0&folder=/home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法&EIO=4&transport=websocket&sid=4tXY_h-X9sCgOxu3AAAA HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:46:34] "GET / HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:46:34] "GET /static/css/index.css HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:46:34] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:46:34] "GET /static/js/index.js HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:49:51] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 04:50:06] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:50:06] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 04:50:06] "GET /favicon.png HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 04:50:17] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 04:50:17] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:51:32] "GET /dashboard HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:51:32] "GET /static/css/dashboard.css HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:51:32] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:51:32] "GET /static/js/dashboard.js HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:51:33] "POST /dashboard/get_course_progress HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:58:42] "GET /desktop_nouser/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 04:58:42] "POST /dashboard/get_course_progress HTTP/1.1" 200 - -[2025-09-11 04:58:42,760] DEBUG in vscode: config file path: /home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法/.config -127.0.0.1 - - [11/Sep/2025 04:58:42] "GET /desktop/user_9a1cbf0a-e9f1-458f-9461-cdaea91b4aa0/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:58:42] "GET /static/css/desktop.css HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:58:42] "GET /static/js/chatbox.js HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 04:58:43] "GET /get_session HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:58:43] "GET /socket.io/?user_uuid=user_9a1cbf0a-e9f1-458f-9461-cdaea91b4aa0&folder=/home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法&EIO=4&transport=polling&t=Pat8-I1 HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:58:43] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 04:58:43] "POST /socket.io/?user_uuid=user_9a1cbf0a-e9f1-458f-9461-cdaea91b4aa0&folder=/home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法&EIO=4&transport=polling&t=Pat8-K8&sid=9IkPeFiqgHNxi_DoAAAC HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:58:43] "GET /socket.io/?user_uuid=user_9a1cbf0a-e9f1-458f-9461-cdaea91b4aa0&folder=/home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法&EIO=4&transport=polling&t=Pat8-K9&sid=9IkPeFiqgHNxi_DoAAAC HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:58:43] "POST /socket.io/?user_uuid=user_9a1cbf0a-e9f1-458f-9461-cdaea91b4aa0&folder=/home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法&EIO=4&transport=polling&t=Pat8-Nt&sid=9IkPeFiqgHNxi_DoAAAC HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:58:44] "GET /68bacdfadf5aeae0912f7f18-基础算法-二分-markdown HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:58:44] "GET /socket.io/?user_uuid=user_9a1cbf0a-e9f1-458f-9461-cdaea91b4aa0&folder=/home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法&EIO=4&transport=polling&t=Pat8-Nt.0&sid=9IkPeFiqgHNxi_DoAAAC HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:58:44] "GET /favicon.ico HTTP/1.1" 404 - -websocket-client package not installed, only polling transport is available -127.0.0.1 - - [11/Sep/2025 04:58:44] "GET /static/基础算法-二分.html HTTP/1.1" 200 - - * Detected change in '/home/ubuntu/hsamooc/code-agent/Html/apps/views/vscode.py', reloading -Sent text to route 'markdown-in': # 二分 -> Auto-generated at 2025-09-05 19:48 - -## 阶段一:示例阶段 -### 引入 - -二分是一个很简单基础,但很重要的知识点,为以后许多高级的数据结构与算法铺垫。 - -下面是一个用二分的简单场景: - -假设小明从0到1000之间选择了一个数字但不告诉你,你可以不断猜测这个数,每次猜测小明会告知你的猜测得过大还是过小,问最多几次就一定能猜中? - -答案是利用二分查找的原理,猜测11次即可。 - -1. 对于0到1000的答案备选区,猜测中位数500,假设过小, -2. 则对于501到1000的答案备选区,猜测750,假设过大 -3. 则对于501到749的答案备选区,猜测625,假设过小, -4. 则对于626到749区间...... -5. (688-749) -6. (718-749) -7. (734-749) -8. (742-749) -9. (746-749) -10. (748-749) -11. (749-749) - -在最差的情况下,第11次的答案备选区就一定长度为1了,也就是必然是答案。 - -因此如果序列是有序的,就可以通过二分查找快速定位所需要的数据。 - -#### 思考题(询问Agent以学习计算方法,或验证你的答案) - -对于上面那个题目,如果问题区间是1到4000,最差情况下需要猜测几次? - -### 练习:二分查找 - -试试对于下面的题目,用代码实现一下二分查找。 - -#### 题目:有序数组寻址 - -给出一个长度为n的有序数组(从小到大),有q次询问,对于每次询问,输出指定数在数组中的下标。如果不存在则输出-1。 - -##### 输入 - -第一行一个整数n。(1<=n<=10^5) - -第二行n个用空格分开的整数ai。(0<=ai<=10^8) - -第三行一个整数q,表示询问的次数。(1<=q<=10^4) - -后q行,每行一个整数b,表示询问的数。(0<=b<=10^8) - -##### 输出 - -q行,每行一个整数,对应每次询问的返回结果。 - -##### 提示: - -完成代码后,通知Agent进行评测。 - -如果你还不完全会这个算法,询问Agent获取提示并进行学习。 - -Sent text to route 'markdown-prompt-in': # 二分查找与二分答案 - -## 二分查找 - -### 引入 - -本小节进行二分查找的引入,首先帮助学生理解教案引入章节的故事。 - -确保学生理解了引入后,在进行思考题。 - -如果不进行思考题,则询问一下是否不进行思考题,确认后进入下一节。 - -如果进行思考题,告知学生计算方法并验证答案(答案是13次) - -计算方法: - -4000是初始答案区间长度,每次询问能够排除一半的区间,当区间长度小于等于1时,再进行一次猜测就一定是答案。 - -4000不断除以2,除12次就小于等于1了,再加一次就一定是答案。最后是12+1=13次。 - -(比4000大的最小2的次方数,4096就是2的12次方,这里的12就是答案中的12,或者写作"上取整(log2(4000))") - -询问学生,当学生告知理解后,进入下一节。 - -### 练习:二分查找 - -如果学生在实现的过程中遇到问题,不要直接告知完整代码如何编写,询问其当前遇到的是什么问题,并帮助学生一步步完成题目。 - -实现代码后,全部通过测试数据后才可以进入下一节。 - -本体测试点文件夹名 `twice_split。` - -_require_tools=judge,algorithm,binary_search,binary_search - -Sent text to route 'score-prompt-in': # 二分查找与二分答案 - -## 二分查找 - -### 引入 - -1. 学生独立给出了思考题的答案:10分 或者 学生在Agent指导下学会思考题:10分 - -### 练习:二分查找 - -1. 学生最终代码通过所有测试点:30分 -2. 学生独立在10分钟内完成题目:10分 或者 学生在Agent指导下10分钟内完成题目:5分 - -Sent text to route 'markdown-in': -二分是一个很简单基础,但很重要的知识点,为以后许多高级的数据结构与算法铺垫。 - -下面是一个用二分的简单场景: - -假设小明从0到1000之间选择了一个数字但不告诉你,你可以不断猜测这个数,每次猜测小明会告知你的猜测得过大还是过小,问最多几次就一定能猜中? - -答案是利用二分查找的原理,猜测11次即可。 - -1. 对于0到1000的答案备选区,猜测中位数500,假设过小, -2. 则对于501到1000的答案备选区,猜测750,假设过大 -3. 则对于501到749的答案备选区,猜测625,假设过小, -4. 则对于626到749区间...... -5. (688-749) -6. (718-749) -7. (734-749) -8. (742-749) -9. (746-749) -10. (748-749) -11. (749-749) - -在最差的情况下,第11次的答案备选区就一定长度为1了,也就是必然是答案。 - -因此如果序列是有序的,就可以通过二分查找快速定位所需要的数据。 - -#### 思考题(询问Agent以学习计算方法,或验证你的答案) - -对于上面那个题目,如果问题区间是1到4000,最差情况下需要猜测几次? - - -Sent text to route 'markdown-prompt-in': -本小节进行二分查找的引入,首先帮助学生理解教案引入章节的故事。 - -确保学生理解了引入后,在进行思考题。 - -如果不进行思考题,则询问一下是否不进行思考题,确认后进入下一节。 - -如果进行思考题,告知学生计算方法并验证答案(答案是13次) - -计算方法: - -4000是初始答案区间长度,每次询问能够排除一半的区间,当区间长度小于等于1时,再进行一次猜测就一定是答案。 - -4000不断除以2,除12次就小于等于1了,再加一次就一定是答案。最后是12+1=13次。 - -(比4000大的最小2的次方数,4096就是2的12次方,这里的12就是答案中的12,或者写作"上取整(log2(4000))") - -询问学生,当学生告知理解后,进入下一节。 - - -Sent text to route 'score-prompt-in': -1. 学生独立给出了思考题的答案:10分 或者 学生在Agent指导下学会思考题:10分 - - -VSCode client disconnected -Disconnect reason:transport close -[Material(name='算法分析与设计', description='测试:算法分析与设计课程', teacher_id='TCake', created_at=datetime.datetime(2025, 9, 5, 19, 48, 10, 16000), updated_at=datetime.datetime(2025, 9, 5, 19, 54, 36, 964000), image_url='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/TCake_book_cover.png', chapters=[Chapter(chapter_name='基础算法', lessons=[Lesson(lesson_name='二分', markdown_lesson_file_link='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md', markdown_prompt_file_name='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_prompt.md', markdown_score_prompt_file_link='https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_score_prompt.md')])])] -convert_md: 68bacdfadf5aeae0912f7f18, 基础算法, 二分 -load_markdown_file: https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md -User connected with session user_uuid: user_9a1cbf0a-e9f1-458f-9461-cdaea91b4aa0 -https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md -Received response: {'data': 'Connected to WebSocket!'} -Connected to server. SID: DNSrRvXifD3ovKufAAAJ -https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md -2025-09-11 09:03:21.559 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Serving Flask app 'apps' - * Debug mode: on -WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. - * Running on all addresses (0.0.0.0) - * Running on http://127.0.0.1:5551 - * Running on http://172.31.34.185:5551 -Press CTRL+C to quit - * Restarting with stat -2025-09-11 09:03:25.219 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Debugger is active! - * Debugger PIN: 103-941-075 -127.0.0.1 - - [11/Sep/2025 09:03:46] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 09:03:47] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:03:47] "GET /static/css/login.css HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:03:47] "GET /static/js/login.js HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:03:47] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 09:03:48] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 09:03:48] "POST /login_post HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:03:49] "GET /dashboard HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:03:49] "GET /static/css/dashboard.css HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:03:49] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:03:49] "GET /static/js/dashboard.js HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:03:50] "POST /dashboard/get_course_progress HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:03:53] "GET /logout HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 09:03:53] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:03:53] "GET /static/js/login.js HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:03:53] "GET /static/css/login.css HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:03:53] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 09:03:54] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 09:04:05] "POST /login_post HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:04:06] "GET /dashboard HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:04:06] "GET /static/css/dashboard.css HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:04:06] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:04:06] "GET /static/js/dashboard.js HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:04:07] "POST /dashboard/get_course_progress HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:04:09] "GET /desktop_nouser/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1" 302 - -{"level":"info","ts":1757581450.301167,"msg":"using config from file","file":"/etc/caddy/Caddyfile"} -{"level":"info","ts":1757581450.3029435,"msg":"adapted config to JSON","adapter":"caddyfile"} -{"level":"warn","ts":1757581450.3029773,"msg":"Caddyfile input is not formatted; run 'caddy fmt --overwrite' to fix inconsistencies","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":17} -127.0.0.1 - - [11/Sep/2025 09:04:10] "GET /desktop/user_837d62ef-e520-4e36-b824-286d053158dd/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:04:10] "GET /static/js/chatbox.js HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:04:10] "GET /static/css/desktop.css HTTP/1.1" 304 - -[2025-09-11T09:04:10.814Z] info Wrote default config file to /home/cake/.config/code-server/config.yaml -127.0.0.1 - - [11/Sep/2025 09:04:11] "GET /get_session HTTP/1.1" 200 - -[2025-09-11T09:04:11.114Z] info code-server 4.103.2 54b33a75e0b4593b77f9a217323c4b27a42f4073 -[2025-09-11T09:04:11.115Z] info Using user-data-dir /home/cake/.local/share/code-server -127.0.0.1 - - [11/Sep/2025 09:04:11] "GET /socket.io/?user_uuid=user_837d62ef-e520-4e36-b824-286d053158dd&folder=/home/cake/68bacdfadf5aeae0912f7f18/基础算法/二分&EIO=4&transport=polling&t=Pau19zh HTTP/1.1" 200 - -[2025-09-11T09:04:11.141Z] info Using config file /home/cake/.config/code-server/config.yaml -[2025-09-11T09:04:11.141Z] info HTTP server listening on http://0.0.0.0:17411/ -[2025-09-11T09:04:11.141Z] info - Authentication is disabled -[2025-09-11T09:04:11.141Z] info - Not serving HTTPS -[2025-09-11T09:04:11.141Z] info Session server listening on /home/cake/.local/share/code-server/code-server-ipc.sock -127.0.0.1 - - [11/Sep/2025 09:04:11] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 09:04:11] "POST /socket.io/?user_uuid=user_837d62ef-e520-4e36-b824-286d053158dd&folder=/home/cake/68bacdfadf5aeae0912f7f18/基础算法/二分&EIO=4&transport=polling&t=Pau19_s&sid=8I4nYRr53DfLTu0HAAAA HTTP/1.1" 200 - -[09:04:11] - - - - -127.0.0.1 - - [11/Sep/2025 09:04:11] "GET /socket.io/?user_uuid=user_837d62ef-e520-4e36-b824-286d053158dd&folder=/home/cake/68bacdfadf5aeae0912f7f18/基础算法/二分&EIO=4&transport=polling&t=Pau19_t&sid=8I4nYRr53DfLTu0HAAAA HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:04:11] "GET /socket.io/?user_uuid=user_837d62ef-e520-4e36-b824-286d053158dd&folder=/home/cake/68bacdfadf5aeae0912f7f18/基础算法/二分&EIO=4&transport=polling&t=Pau1A4F.0&sid=8I4nYRr53DfLTu0HAAAA HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:04:11] "POST /socket.io/?user_uuid=user_837d62ef-e520-4e36-b824-286d053158dd&folder=/home/cake/68bacdfadf5aeae0912f7f18/基础算法/二分&EIO=4&transport=polling&t=Pau1A4F&sid=8I4nYRr53DfLTu0HAAAA HTTP/1.1" 200 - -[09:04:11] Extension host agent started. -[09:04:11] Started initializing default profile extensions in extensions installation folder. file:///home/cake/.local/share/code-server/extensions -[09:04:11] Completed initializing default profile extensions in extensions installation folder. file:///home/cake/.local/share/code-server/extensions -127.0.0.1 - - [11/Sep/2025 09:04:11] "GET /socket.io/?user_uuid=user_837d62ef-e520-4e36-b824-286d053158dd&folder=/home/cake/68bacdfadf5aeae0912f7f18/基础算法/二分&EIO=4&transport=polling&t=Pau1A6C&sid=8I4nYRr53DfLTu0HAAAA HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:04:11] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 09:04:11] "GET /68bacdfadf5aeae0912f7f18-基础算法-二分-markdown HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:04:12] "GET /static/基础算法-二分.html HTTP/1.1" 200 - -websocket-client package not installed, only polling transport is available -File not found: /usr/lib/code-server/lib/vscode/node_modules/vsda/rust/web/vsda_bg.wasm -File not found: /usr/lib/code-server/lib/vscode/node_modules/vsda/rust/web/vsda.js -Directory /home/cake/68bacdfadf5aeae0912f7f18/基础算法/二分 created successfully for user cake -convert_md: 68bacdfadf5aeae0912f7f18, 基础算法, 二分 -load_markdown_file: https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md -User connected with session user_uuid: user_837d62ef-e520-4e36-b824-286d053158dd -https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md -Received response: {'data': 'Connected to WebSocket!'} -Connected to server. SID: SRiP1tLlq6zEXs6VAAAR -https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md -https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_prompt.md -https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_score_prompt.md -{'引入': {'markdown': '\n二分是一个很简单基础,但很重要的知识点,为以后许多高级的数据结构与算法铺垫。\n\n下面是一个用二分的简单场景:\n\n假设小明从0到1000之间选择了一个数字但不告诉你,你可以不断猜测这个数,每次猜测小明会告知你的猜测得过大还是过小,问最多几次就一定能猜中?\n\n答案是利用二分查找的原理,猜测11次即可。\n\n1. 对于0到1000的答案备选区,猜测中位数500,假设过小,\n2. 则对于501到1000的答案备选区,猜测750,假设过大\n3. 则对于501到749的答案备选区,猜测625,假设过小,\n4. 则对于626到749区间......\n5. (688-749)\n6. (718-749)\n7. (734-749)\n8. (742-749)\n9. (746-749)\n10. (748-749)\n11. (749-749)\n\n在最差的情况下,第11次的答案备选区就一定长度为1了,也就是必然是答案。\n\n因此如果序列是有序的,就可以通过二分查找快速定位所需要的数据。\n\n#### 思考题(询问Agent以学习计算方法,或验证你的答案)\n\n对于上面那个题目,如果问题区间是1到4000,最差情况下需要猜测几次?\n\n', 'markdown_prompt': '\n本小节进行二分查找的引入,首先帮助学生理解教案引入章节的故事。\n\n确保学生理解了引入后,在进行思考题。\n\n如果不进行思考题,则询问一下是否不进行思考题,确认后进入下一节。\n\n如果进行思考题,告知学生计算方法并验证答案(答案是13次)\n\n计算方法:\n\n4000是初始答案区间长度,每次询问能够排除一半的区间,当区间长度小于等于1时,再进行一次猜测就一定是答案。\n\n4000不断除以2,除12次就小于等于1了,再加一次就一定是答案。最后是12+1=13次。\n\n(比4000大的最小2的次方数,4096就是2的12次方,这里的12就是答案中的12,或者写作"上取整(log2(4000))")\n\n询问学生,当学生告知理解后,进入下一节。\n\n', 'require_tools': [], 'score_prompt': '\n1. 学生独立给出了思考题的答案:10分 或者 学生在Agent指导下学会思考题:10分\n\n'}, '练习:二分查找': {'markdown': '\n试试对于下面的题目,用代码实现一下二分查找。\n\n#### 题目:有序数组寻址\n\n给出一个长度为n的有序数组(从小到大),有q次询问,对于每次询问,输出指定数在数组中的下标。如果不存在则输出-1。\n\n##### 输入\n\n第一行一个整数n。(1<=n<=10^5)\n\n第二行n个用空格分开的整数ai。(0<=ai<=10^8)\n\n第三行一个整数q,表示询问的次数。(1<=q<=10^4)\n\n后q行,每行一个整数b,表示询问的数。(0<=b<=10^8)\n\n##### 输出\n\nq行,每行一个整数,对应每次询问的返回结果。\n\n##### 提示:\n\n完成代码后,通知Agent进行评测。\n\n如果你还不完全会这个算法,询问Agent获取提示并进行学习。\n\n', 'markdown_prompt': '\n如果学生在实现的过程中遇到问题,不要直接告知完整代码如何编写,询问其当前遇到的是什么问题,并帮助学生一步步完成题目。\n\n实现代码后,全部通过测试数据后才可以进入下一节。\n\n本体测试点文件夹名 `twice_split。`\n\n\n', 'require_tools': [(, {'name': 'algorithm'})], 'score_prompt': '\n1. 学生最终代码通过所有测试点:30分\n2. 学生独立在10分钟内完成题目:10分 或者 学生在Agent指导下10分钟内完成题目:5分\n\n'}} -Sent text to route 'markdown-in': # 二分 -> Auto-generated at 2025-09-05 19:48 - -## 阶段一:示例阶段 -### 引入 - -二分是一个很简单基础,但很重要的知识点,为以后许多高级的数据结构与算法铺垫。 - -下面是一个用二分的简单场景: - -假设小明从0到1000之间选择了一个数字但不告诉你,你可以不断猜测这个数,每次猜测小明会告知你的猜测得过大还是过小,问最多几次就一定能猜中? - -答案是利用二分查找的原理,猜测11次即可。 - -1. 对于0到1000的答案备选区,猜测中位数500,假设过小, -2. 则对于501到1000的答案备选区,猜测750,假设过大 -3. 则对于501到749的答案备选区,猜测625,假设过小, -4. 则对于626到749区间...... -5. (688-749) -6. (718-749) -7. (734-749) -8. (742-749) -9. (746-749) -10. (748-749) -11. (749-749) - -在最差的情况下,第11次的答案备选区就一定长度为1了,也就是必然是答案。 - -因此如果序列是有序的,就可以通过二分查找快速定位所需要的数据。 - -#### 思考题(询问Agent以学习计算方法,或验证你的答案) - -对于上面那个题目,如果问题区间是1到4000,最差情况下需要猜测几次? - -### 练习:二分查找 - -试试对于下面的题目,用代码实现一下二分查找。 - -#### 题目:有序数组寻址 - -给出一个长度为n的有序数组(从小到大),有q次询问,对于每次询问,输出指定数在数组中的下标。如果不存在则输出-1。 - -##### 输入 - -第一行一个整数n。(1<=n<=10^5) - -第二行n个用空格分开的整数ai。(0<=ai<=10^8) - -第三行一个整数q,表示询问的次数。(1<=q<=10^4) - -后q行,每行一个整数b,表示询问的数。(0<=b<=10^8) - -##### 输出 - -q行,每行一个整数,对应每次询问的返回结果。 - -##### 提示: - -完成代码后,通知Agent进行评测。 - -如果你还不完全会这个算法,询问Agent获取提示并进行学习。 - -Sent text to route 'markdown-prompt-in': # 二分查找与二分答案 - -## 二分查找 - -### 引入 - -本小节进行二分查找的引入,首先帮助学生理解教案引入章节的故事。 - -确保学生理解了引入后,在进行思考题。 - -如果不进行思考题,则询问一下是否不进行思考题,确认后进入下一节。 - -如果进行思考题,告知学生计算方法并验证答案(答案是13次) - -计算方法: - -4000是初始答案区间长度,每次询问能够排除一半的区间,当区间长度小于等于1时,再进行一次猜测就一定是答案。 - -4000不断除以2,除12次就小于等于1了,再加一次就一定是答案。最后是12+1=13次。 - -(比4000大的最小2的次方数,4096就是2的12次方,这里的12就是答案中的12,或者写作"上取整(log2(4000))") - -询问学生,当学生告知理解后,进入下一节。 - -### 练习:二分查找 - -如果学生在实现的过程中遇到问题,不要直接告知完整代码如何编写,询问其当前遇到的是什么问题,并帮助学生一步步完成题目。 - -实现代码后,全部通过测试数据后才可以进入下一节。 - -本体测试点文件夹名 `twice_split。` - -_require_tools=judge,algorithm,binary_search,binary_search - -[09:04:14] [127.0.0.1][0efa9dde][ManagementConnection] New connection established. -[09:04:16] [127.0.0.1][94c7cf5a][ExtensionHostConnection] New connection established. -[09:04:16] [127.0.0.1][94c7cf5a][ExtensionHostConnection] <12087> Launched Extension Host Process. -[09:04:41] [127.0.0.1][0efa9dde][ManagementConnection] The client has disconnected gracefully, so the connection will be disposed. -127.0.0.1 - - [11/Sep/2025 09:04:41] "GET /socket.io/?user_uuid=user_837d62ef-e520-4e36-b824-286d053158dd&folder=/home/cake/68bacdfadf5aeae0912f7f18/基础算法/二分&EIO=4&transport=websocket&sid=8I4nYRr53DfLTu0HAAAA HTTP/1.1" 200 - -[09:04:41] [127.0.0.1][94c7cf5a][ExtensionHostConnection] <12087> Extension Host Process exited with code: 0, signal: null. -2025-09-11 09:09:13.797 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Serving Flask app 'apps' - * Debug mode: on -WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. - * Running on all addresses (0.0.0.0) - * Running on http://127.0.0.1:5551 - * Running on http://172.31.34.185:5551 -Press CTRL+C to quit - * Restarting with stat -2025-09-11 09:09:17.446 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Debugger is active! - * Debugger PIN: 103-941-075 -127.0.0.1 - - [11/Sep/2025 09:09:39] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 09:09:39] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:09:40] "GET /static/css/login.css HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:09:40] "GET /static/js/login.js HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:09:40] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 09:09:40] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 09:09:41] "POST /login_post HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:09:42] "GET /dashboard HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:09:42] "GET /static/css/dashboard.css HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:09:42] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:09:42] "GET /static/js/dashboard.js HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:09:43] "POST /dashboard/get_course_progress HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:09:45] "GET /desktop_nouser/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1" 302 - -useradd: user 'cake' already exists -{"level":"info","ts":1757581785.3689358,"msg":"using config from file","file":"/etc/caddy/Caddyfile"} -{"level":"info","ts":1757581785.3740196,"msg":"adapted config to JSON","adapter":"caddyfile"} -{"level":"warn","ts":1757581785.37406,"msg":"Caddyfile input is not formatted; run 'caddy fmt --overwrite' to fix inconsistencies","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":17} -127.0.0.1 - - [11/Sep/2025 09:09:45] "GET /desktop/user_e511b990-0b8a-401d-9ae4-90bf1c6f47f9/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:09:45] "GET /static/js/chatbox.js HTTP/1.1" 304 - -127.0.0.1 - - [11/Sep/2025 09:09:45] "GET /static/css/desktop.css HTTP/1.1" 304 - -[2025-09-11T09:09:45.826Z] info code-server 4.103.2 54b33a75e0b4593b77f9a217323c4b27a42f4073 -[2025-09-11T09:09:45.827Z] info Using user-data-dir /home/cake/.local/share/code-server -[2025-09-11T09:09:45.844Z] info Using config file /home/cake/.config/code-server/config.yaml -[2025-09-11T09:09:45.844Z] info HTTP server listening on http://0.0.0.0:10316/ -[2025-09-11T09:09:45.844Z] info - Authentication is disabled -[2025-09-11T09:09:45.844Z] info - Not serving HTTPS -[2025-09-11T09:09:45.844Z] info Session server listening on /home/cake/.local/share/code-server/code-server-ipc.sock -127.0.0.1 - - [11/Sep/2025 09:09:46] "GET /get_session HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:09:46] "GET /socket.io/?user_uuid=user_e511b990-0b8a-401d-9ae4-90bf1c6f47f9&folder=/home/cake/68bacdfadf5aeae0912f7f18/基础算法/二分&EIO=4&transport=polling&t=Pau2RrV HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:09:46] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 09:09:46] "POST /socket.io/?user_uuid=user_e511b990-0b8a-401d-9ae4-90bf1c6f47f9&folder=/home/cake/68bacdfadf5aeae0912f7f18/基础算法/二分&EIO=4&transport=polling&t=Pau2RtN&sid=QaUbT4SaHkK8X4yVAAAA HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:09:46] "GET /socket.io/?user_uuid=user_e511b990-0b8a-401d-9ae4-90bf1c6f47f9&folder=/home/cake/68bacdfadf5aeae0912f7f18/基础算法/二分&EIO=4&transport=polling&t=Pau2RtO&sid=QaUbT4SaHkK8X4yVAAAA HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:09:46] "POST /socket.io/?user_uuid=user_e511b990-0b8a-401d-9ae4-90bf1c6f47f9&folder=/home/cake/68bacdfadf5aeae0912f7f18/基础算法/二分&EIO=4&transport=polling&t=Pau2RvJ&sid=QaUbT4SaHkK8X4yVAAAA HTTP/1.1" 200 - -[09:09:46] - - - - -[09:09:46] Extension host agent started. -127.0.0.1 - - [11/Sep/2025 09:09:46] "GET /socket.io/?user_uuid=user_e511b990-0b8a-401d-9ae4-90bf1c6f47f9&folder=/home/cake/68bacdfadf5aeae0912f7f18/基础算法/二分&EIO=4&transport=polling&t=Pau2RvK&sid=QaUbT4SaHkK8X4yVAAAA HTTP/1.1" 200 - -websocket-client package not installed, only polling transport is available -127.0.0.1 - - [11/Sep/2025 09:09:47] "GET /favicon.ico HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 09:09:47] "GET /68bacdfadf5aeae0912f7f18-基础算法-二分-markdown HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 09:09:47] "GET /static/基础算法-二分.html HTTP/1.1" 200 - -Directory /home/cake/68bacdfadf5aeae0912f7f18/基础算法/二分 created successfully for user cake -convert_md: 68bacdfadf5aeae0912f7f18, 基础算法, 二分 -load_markdown_file: https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md -User connected with session user_uuid: user_e511b990-0b8a-401d-9ae4-90bf1c6f47f9 -https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md -Received response: {'data': 'Connected to WebSocket!'} -Connected to server. SID: WOSOW4LHcPIRCWHbAAAT -https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_lesson.md -https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_prompt.md -https://hsamooc-cdn-1374354408.cos.ap-guangzhou.myqcloud.com/materials_68bacdfadf5aeae0912f7f18_untitled_untitled_20250905T194845Z_score_prompt.md -{'引入': {'markdown': '\n二分是一个很简单基础,但很重要的知识点,为以后许多高级的数据结构与算法铺垫。\n\n下面是一个用二分的简单场景:\n\n假设小明从0到1000之间选择了一个数字但不告诉你,你可以不断猜测这个数,每次猜测小明会告知你的猜测得过大还是过小,问最多几次就一定能猜中?\n\n答案是利用二分查找的原理,猜测11次即可。\n\n1. 对于0到1000的答案备选区,猜测中位数500,假设过小,\n2. 则对于501到1000的答案备选区,猜测750,假设过大\n3. 则对于501到749的答案备选区,猜测625,假设过小,\n4. 则对于626到749区间......\n5. (688-749)\n6. (718-749)\n7. (734-749)\n8. (742-749)\n9. (746-749)\n10. (748-749)\n11. (749-749)\n\n在最差的情况下,第11次的答案备选区就一定长度为1了,也就是必然是答案。\n\n因此如果序列是有序的,就可以通过二分查找快速定位所需要的数据。\n\n#### 思考题(询问Agent以学习计算方法,或验证你的答案)\n\n对于上面那个题目,如果问题区间是1到4000,最差情况下需要猜测几次?\n\n', 'markdown_prompt': '\n本小节进行二分查找的引入,首先帮助学生理解教案引入章节的故事。\n\n确保学生理解了引入后,在进行思考题。\n\n如果不进行思考题,则询问一下是否不进行思考题,确认后进入下一节。\n\n如果进行思考题,告知学生计算方法并验证答案(答案是13次)\n\n计算方法:\n\n4000是初始答案区间长度,每次询问能够排除一半的区间,当区间长度小于等于1时,再进行一次猜测就一定是答案。\n\n4000不断除以2,除12次就小于等于1了,再加一次就一定是答案。最后是12+1=13次。\n\n(比4000大的最小2的次方数,4096就是2的12次方,这里的12就是答案中的12,或者写作"上取整(log2(4000))")\n\n询问学生,当学生告知理解后,进入下一节。\n\n', 'require_tools': [], 'score_prompt': '\n1. 学生独立给出了思考题的答案:10分 或者 学生在Agent指导下学会思考题:10分\n\n'}, '练习:二分查找': {'markdown': '\n试试对于下面的题目,用代码实现一下二分查找。\n\n#### 题目:有序数组寻址\n\n给出一个长度为n的有序数组(从小到大),有q次询问,对于每次询问,输出指定数在数组中的下标。如果不存在则输出-1。\n\n##### 输入\n\n第一行一个整数n。(1<=n<=10^5)\n\n第二行n个用空格分开的整数ai。(0<=ai<=10^8)\n\n第三行一个整数q,表示询问的次数。(1<=q<=10^4)\n\n后q行,每行一个整数b,表示询问的数。(0<=b<=10^8)\n\n##### 输出\n\nq行,每行一个整数,对应每次询问的返回结果。\n\n##### 提示:\n\n完成代码后,通知Agent进行评测。\n\n如果你还不完全会这个算法,询问Agent获取提示并进行学习。\n\n', 'markdown_prompt': '\n如果学生在实现的过程中遇到问题,不要直接告知完整代码如何编写,询问其当前遇到的是什么问题,并帮助学生一步步完成题目。\n\n实现代码后,全部通过测试数据后才可以进入下一节。\n\n本体测试点文件夹名 `twice_split。`\n\n\n', 'require_tools': [(, {'name': 'algorithm'})], 'score_prompt': '\n1. 学生最终代码通过所有测试点:30分\n2. 学生独立在10分钟内完成题目:10分 或者 学生在Agent指导下10分钟内完成题目:5分\n\n'}} -Sent text to route 'markdown-in': # 二分 -> Auto-generated at 2025-09-05 19:48 - -## 阶段一:示例阶段 -### 引入 - -二分是一个很简单基础,但很重要的知识点,为以后许多高级的数据结构与算法铺垫。 - -下面是一个用二分的简单场景: - -假设小明从0到1000之间选择了一个数字但不告诉你,你可以不断猜测这个数,每次猜测小明会告知你的猜测得过大还是过小,问最多几次就一定能猜中? - -答案是利用二分查找的原理,猜测11次即可。 - -1. 对于0到1000的答案备选区,猜测中位数500,假设过小, -2. 则对于501到1000的答案备选区,猜测750,假设过大 -3. 则对于501到749的答案备选区,猜测625,假设过小, -4. 则对于626到749区间...... -5. (688-749) -6. (718-749) -7. (734-749) -8. (742-749) -9. (746-749) -10. (748-749) -11. (749-749) - -在最差的情况下,第11次的答案备选区就一定长度为1了,也就是必然是答案。 - -因此如果序列是有序的,就可以通过二分查找快速定位所需要的数据。 - -#### 思考题(询问Agent以学习计算方法,或验证你的答案) - -对于上面那个题目,如果问题区间是1到4000,最差情况下需要猜测几次? - -### 练习:二分查找 - -试试对于下面的题目,用代码实现一下二分查找。 - -#### 题目:有序数组寻址 - -给出一个长度为n的有序数组(从小到大),有q次询问,对于每次询问,输出指定数在数组中的下标。如果不存在则输出-1。 - -##### 输入 - -第一行一个整数n。(1<=n<=10^5) - -第二行n个用空格分开的整数ai。(0<=ai<=10^8) - -第三行一个整数q,表示询问的次数。(1<=q<=10^4) - -后q行,每行一个整数b,表示询问的数。(0<=b<=10^8) - -##### 输出 - -q行,每行一个整数,对应每次询问的返回结果。 - -##### 提示: - -完成代码后,通知Agent进行评测。 - -如果你还不完全会这个算法,询问Agent获取提示并进行学习。 - -Sent text to route 'markdown-prompt-in': # 二分查找与二分答案 - -## 二分查找 - -### 引入 - -本小节进行二分查找的引入,首先帮助学生理解教案引入章节的故事。 - -确保学生理解了引入后,在进行思考题。 - -如果不进行思考题,则询问一下是否不进行思考题,确认后进入下一节。 - -如果进行思考题,告知学生计算方法并验证答案(答案是13次) - -计算方法: - -4000是初始答案区间长度,每次询问能够排除一半的区间,当区间长度小于等于1时,再进行一次猜测就一定是答案。 - -4000不断除以2,除12次就小于等于1了,再加一次就一定是答案。最后是12+1=13次。 - -(比4000大的最小2的次方数,4096就是2的12次方,这里的12就是答案中的12,或者写作"上取整(log2(4000))") - -询问学生,当学生告知理解后,进入下一节。 - -### 练习:二分查找 - -如果学生在实现的过程中遇到问题,不要直接告知完整代码如何编写,询问其当前遇到的是什么问题,并帮助学生一步步完成题目。 - -实现代码后,全部通过测试数据后才可以进入下一节。 - -本体测试点文件夹名 `twice_split。` - -_require_tools=judge,algorithm,binary_search,binary_search - -File not found: /usr/lib/code-server/lib/vscode/node_modules/vsda/rust/web/vsda_bg.wasm -File not found: /usr/lib/code-server/lib/vscode/node_modules/vsda/rust/web/vsda.js -[09:09:49] [127.0.0.1][6780739d][ManagementConnection] New connection established. -[09:09:51] [127.0.0.1][47a78222][ExtensionHostConnection] New connection established. -[09:09:51] [127.0.0.1][47a78222][ExtensionHostConnection] <12628> Launched Extension Host Process. -[09:10:07] [127.0.0.1][6780739d][ManagementConnection] The client has disconnected gracefully, so the connection will be disposed. -127.0.0.1 - - [11/Sep/2025 09:10:07] "GET /socket.io/?user_uuid=user_e511b990-0b8a-401d-9ae4-90bf1c6f47f9&folder=/home/cake/68bacdfadf5aeae0912f7f18/基础算法/二分&EIO=4&transport=websocket&sid=QaUbT4SaHkK8X4yVAAAA HTTP/1.1" 200 - -[09:10:07] [127.0.0.1][47a78222][ExtensionHostConnection] <12628> Extension Host Process exited with code: 0, signal: null. - * Detected change in '/home/ubuntu/hsamooc/code-agent/Html/apps/views/vscode.py', reloading -Sent text to route 'score-prompt-in': # 二分查找与二分答案 - -## 二分查找 - -### 引入 - -1. 学生独立给出了思考题的答案:10分 或者 学生在Agent指导下学会思考题:10分 - -### 练习:二分查找 - -1. 学生最终代码通过所有测试点:30分 -2. 学生独立在10分钟内完成题目:10分 或者 学生在Agent指导下10分钟内完成题目:5分 - -Sent text to route 'markdown-in': -二分是一个很简单基础,但很重要的知识点,为以后许多高级的数据结构与算法铺垫。 - -下面是一个用二分的简单场景: - -假设小明从0到1000之间选择了一个数字但不告诉你,你可以不断猜测这个数,每次猜测小明会告知你的猜测得过大还是过小,问最多几次就一定能猜中? - -答案是利用二分查找的原理,猜测11次即可。 - -1. 对于0到1000的答案备选区,猜测中位数500,假设过小, -2. 则对于501到1000的答案备选区,猜测750,假设过大 -3. 则对于501到749的答案备选区,猜测625,假设过小, -4. 则对于626到749区间...... -5. (688-749) -6. (718-749) -7. (734-749) -8. (742-749) -9. (746-749) -10. (748-749) -11. (749-749) - -在最差的情况下,第11次的答案备选区就一定长度为1了,也就是必然是答案。 - -因此如果序列是有序的,就可以通过二分查找快速定位所需要的数据。 - -#### 思考题(询问Agent以学习计算方法,或验证你的答案) - -对于上面那个题目,如果问题区间是1到4000,最差情况下需要猜测几次? - - -Sent text to route 'markdown-prompt-in': -本小节进行二分查找的引入,首先帮助学生理解教案引入章节的故事。 - -确保学生理解了引入后,在进行思考题。 - -如果不进行思考题,则询问一下是否不进行思考题,确认后进入下一节。 - -如果进行思考题,告知学生计算方法并验证答案(答案是13次) - -计算方法: - -4000是初始答案区间长度,每次询问能够排除一半的区间,当区间长度小于等于1时,再进行一次猜测就一定是答案。 - -4000不断除以2,除12次就小于等于1了,再加一次就一定是答案。最后是12+1=13次。 - -(比4000大的最小2的次方数,4096就是2的12次方,这里的12就是答案中的12,或者写作"上取整(log2(4000))") - -询问学生,当学生告知理解后,进入下一节。 - - -Sent text to route 'score-prompt-in': -1. 学生独立给出了思考题的答案:10分 或者 学生在Agent指导下学会思考题:10分 - - -VSCode client disconnected -Disconnect reason:transport close -2025-09-11 10:41:34.396 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Serving Flask app 'apps' - * Debug mode: on -WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. - * Running on all addresses (0.0.0.0) - * Running on http://127.0.0.1:5551 - * Running on http://172.31.34.185:5551 -Press CTRL+C to quit - * Restarting with stat -2025-09-11 10:41:37.858 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Debugger is active! - * Debugger PIN: 103-941-075 -127.0.0.1 - - [11/Sep/2025 10:42:48] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 11:09:11] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 11:09:12] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 11:30:59] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 11:30:59] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 11:31:01] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 11:31:01] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 11:31:37] "GET /login/static/js/login.js HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 11:31:37] "GET /login/static/css/login.css HTTP/1.1" 404 - -127.0.0.1 - - [11/Sep/2025 13:02:26] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 13:02:27] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 13:02:27] "GET /static/js/login.js HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 13:02:27] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 13:02:28] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 13:02:28] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 13:02:28] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 13:02:29] "GET /static/js/login.js HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 13:02:29] "GET /static/css/login.css HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 13:02:29] "GET /static/js/login.js HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 13:02:30] "GET / HTTP/1.1" 302 - -127.0.0.1 - - [11/Sep/2025 13:02:31] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 13:02:31] "GET /static/css/login.css HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 13:02:31] "GET /static/js/login.js HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 13:11:04] "GET / HTTP/1.1" 302 - + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/engineio/server.py", line 450, in run_handler + return self.handlers[event](*args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 671, in _handle_eio_disconnect + self._handle_disconnect(eio_sid, n, reason) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 568, in _handle_disconnect + self._trigger_event('disconnect', namespace, sid, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 150, in on_disconnect + user_uuid2chatmanager[uuid].disconnect(uuid) +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:17:55] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=websocket&sid=SmogL1S86UeH8buqAAAJ HTTP/1.1" 200 0 960.067428 +(185715) accepted ('127.0.0.1', 53912) +180.101.244.13,127.0.0.1 - - [16/Sep/2025 16:59:16] "GET / HTTP/1.1" 302 351 0.006999 +220.196.160.83,127.0.0.1 - - [16/Sep/2025 16:59:16] "GET / HTTP/1.1" 302 351 0.000767 +180.101.245.252,127.0.0.1 - - [16/Sep/2025 16:59:16] "GET /login HTTP/1.1" 200 1835 0.004592 +42.193.132.157,127.0.0.1 - - [16/Sep/2025 16:59:17] "GET /static/js/login.js HTTP/1.1" 200 3557 0.002909 +220.196.160.144,127.0.0.1 - - [16/Sep/2025 16:59:17] "GET /login HTTP/1.1" 200 1835 0.000856 +106.52.65.240,127.0.0.1 - - [16/Sep/2025 16:59:17] "GET /static/js/login.js HTTP/1.1" 200 3557 0.001178 +220.196.160.83,127.0.0.1 - - [16/Sep/2025 16:59:37] "GET / HTTP/1.1" 302 351 0.000812 +220.196.160.83,127.0.0.1 - - [16/Sep/2025 16:59:37] "GET /login HTTP/1.1" 200 1835 0.000806 +220.196.160.83,127.0.0.1 - - [16/Sep/2025 16:59:37] "GET /static/css/login.css HTTP/1.1" 200 3791 0.001815 +(185715) accepted ('127.0.0.1', 56936) +220.196.160.83,127.0.0.1 - - [16/Sep/2025 16:59:37] "GET /static/js/login.js HTTP/1.1" 200 3557 0.000926 +180.101.244.16,127.0.0.1 - - [16/Sep/2025 16:59:40] "GET / HTTP/1.1" 302 351 0.003076 +180.101.244.16,127.0.0.1 - - [16/Sep/2025 16:59:41] "GET /login HTTP/1.1" 200 1835 0.000797 +180.101.244.16,127.0.0.1 - - [16/Sep/2025 16:59:41] "GET /static/css/login.css HTTP/1.1" 200 3791 0.001276 +180.101.244.16,127.0.0.1 - - [16/Sep/2025 16:59:41] "GET /static/js/login.js HTTP/1.1" 200 3557 0.000882 +(185715) accepted ('127.0.0.1', 59638) +123.6.49.50,127.0.0.1 - - [16/Sep/2025 17:45:04] "GET / HTTP/1.1" 302 351 0.004425 +123.6.49.50,127.0.0.1 - - [16/Sep/2025 17:45:04] "GET /login HTTP/1.1" 200 1835 0.002219 +123.6.49.50,127.0.0.1 - - [16/Sep/2025 17:45:04] "GET /static/js/login.js HTTP/1.1" 200 3557 0.001412 +(185715) accepted ('127.0.0.1', 59652) +123.6.49.50,127.0.0.1 - - [16/Sep/2025 17:45:04] "GET /static/css/login.css HTTP/1.1" 200 3791 0.003105 +123.6.49.44,127.0.0.1 - - [16/Sep/2025 17:45:10] "GET /favicon.ico HTTP/1.1" 404 331 0.002778 +27.115.124.112,127.0.0.1 - - [16/Sep/2025 17:45:11] "GET /favicon.ico HTTP/1.1" 404 331 0.001624 +123.6.49.47,127.0.0.1 - - [16/Sep/2025 17:45:12] "GET / HTTP/1.1" 302 351 0.000800 +123.6.49.47,127.0.0.1 - - [16/Sep/2025 17:45:12] "GET /login HTTP/1.1" 200 1835 0.000786 +27.115.124.70,127.0.0.1 - - [16/Sep/2025 17:45:12] "GET /register HTTP/1.1" 200 1689 0.002584 +27.115.124.70,127.0.0.1 - - [16/Sep/2025 17:45:12] "GET /static/css/login.css HTTP/1.1" 200 3791 0.001273 +27.115.124.70,127.0.0.1 - - [16/Sep/2025 17:45:12] "GET /static/js/register.js HTTP/1.1" 200 1720 0.001667 +123.6.49.47,127.0.0.1 - - [16/Sep/2025 17:45:12] "GET /static/css/login.css HTTP/1.1" 200 3791 0.001219 +123.6.49.47,127.0.0.1 - - [16/Sep/2025 17:45:12] "GET /static/js/login.js HTTP/1.1" 200 3557 0.001201 +123.6.49.50,127.0.0.1 - - [16/Sep/2025 17:45:17] "GET /favicon.ico HTTP/1.1" 404 331 0.000770 +(185715) accepted ('127.0.0.1', 53172) +27.115.124.5,127.0.0.1 - - [16/Sep/2025 17:51:56] "GET / HTTP/1.1" 302 351 0.001029 +27.115.124.3,127.0.0.1 - - [16/Sep/2025 17:51:56] "GET /login HTTP/1.1" 200 1835 0.000818 +27.115.124.5,127.0.0.1 - - [16/Sep/2025 17:51:57] "GET /favicon.ico HTTP/1.1" 404 331 0.000834 +27.115.124.41,127.0.0.1 - - [16/Sep/2025 17:51:57] "GET /robots.txt HTTP/1.1" 404 331 0.000888 +27.115.124.69,127.0.0.1 - - [16/Sep/2025 17:51:58] "GET /sitemap.xml HTTP/1.1" 404 331 0.000799 +27.115.124.112,127.0.0.1 - - [16/Sep/2025 17:53:14] "GET / HTTP/1.1" 302 351 0.000926 +27.115.124.67,127.0.0.1 - - [16/Sep/2025 17:53:34] "GET /login HTTP/1.1" 200 1835 0.000883 +27.115.124.33,127.0.0.1 - - [16/Sep/2025 17:53:38] "GET /favicon.ico HTTP/1.1" 404 331 0.001163 +(185715) accepted ('127.0.0.1', 55860) +167.99.77.32,127.0.0.1 - - [16/Sep/2025 18:11:35] "GET / HTTP/1.1" 302 351 0.001348 +167.99.77.32,127.0.0.1 - - [16/Sep/2025 18:11:35] "GET /login HTTP/1.1" 200 1835 0.001791 +167.99.77.32,127.0.0.1 - - [16/Sep/2025 18:11:35] "GET /static/js/login.js HTTP/1.1" 200 3557 0.002767 +(185715) accepted ('127.0.0.1', 36792) +196.251.70.47,127.0.0.1 - - [16/Sep/2025 21:26:55] "GET /.env HTTP/1.1" 404 331 0.000775 +(185715) accepted ('127.0.0.1', 37080) +185.177.72.45,127.0.0.1 - - [16/Sep/2025 22:39:16] "GET / HTTP/1.1" 302 351 0.001164 +185.177.72.45,127.0.0.1 - - [16/Sep/2025 22:39:16] "GET /login HTTP/1.1" 200 1835 0.000922 +185.177.72.45,127.0.0.1 - - [16/Sep/2025 22:39:22] "GET /static/js/login.js HTTP/1.1" 200 3557 0.001013 +185.177.72.45,127.0.0.1 - - [16/Sep/2025 22:39:24] "GET /static/js/login.js HTTP/1.1" 200 3557 0.001304 +185.177.72.45,127.0.0.1 - - [16/Sep/2025 22:39:24] "GET /.git/config HTTP/1.1" 404 331 0.000836 +(185715) accepted ('127.0.0.1', 58636) +54.237.85.94,127.0.0.1 - - [16/Sep/2025 23:03:57] "GET / HTTP/1.1" 302 351 0.000804 +54.237.85.94,127.0.0.1 - - [16/Sep/2025 23:03:57] "GET /login HTTP/1.1" 200 1835 0.000753 +(185715) accepted ('127.0.0.1', 57070) +58.198.188.146,127.0.0.1 - - [16/Sep/2025 23:45:45] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbKwuKo HTTP/1.1" 200 275 0.000340 +58.198.188.146,127.0.0.1 - - [16/Sep/2025 23:45:45] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbKwuRo&sid=5YLu2hNGUKkeftJPAAAL HTTP/1.1" 200 192 0.000700 +58.198.188.146,127.0.0.1 - - [16/Sep/2025 23:45:45] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbKwuRq&sid=5YLu2hNGUKkeftJPAAAL HTTP/1.1" 200 196 0.000223 +58.198.188.146,127.0.0.1 - - [16/Sep/2025 23:45:46] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbKwuTi&sid=5YLu2hNGUKkeftJPAAAL HTTP/1.1" 200 192 0.000372 +Traceback (most recent call last): + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/hub.py", line 471, in fire_timers + timer() + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/timer.py", line 59, in __call__ + cb(*args, **kw) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/greenthread.py", line 272, in main + result = function(*args, **kwargs) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 591, in _handle_event_internal + r = server._trigger_event(data[0], namespace, sid, *data[1:]) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 53, in on_login + user_id = uuid2username[user_uuid] +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +(185715) accepted ('127.0.0.1', 57072) +58.198.188.146,127.0.0.1 - - [16/Sep/2025 23:45:46] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbKwuTi.0&sid=5YLu2hNGUKkeftJPAAAL HTTP/1.1" 200 157 0.241678 +58.198.188.146,127.0.0.1 - - [16/Sep/2025 23:45:46] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbKwuZN&sid=5YLu2hNGUKkeftJPAAAL HTTP/1.1" 200 157 0.000381 +disconnect handler error +Traceback (most recent call last): + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/engineio/server.py", line 450, in run_handler + return self.handlers[event](*args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 671, in _handle_eio_disconnect + self._handle_disconnect(eio_sid, n, reason) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 568, in _handle_disconnect + self._trigger_event('disconnect', namespace, sid, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 150, in on_disconnect + user_uuid2chatmanager[uuid].disconnect(uuid) +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +58.198.188.146,127.0.0.1 - - [17/Sep/2025 03:39:10] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=websocket&sid=5YLu2hNGUKkeftJPAAAL HTTP/1.1" 200 0 14004.575564 +(185715) accepted ('127.0.0.1', 41646) +219.228.146.148,127.0.0.1 - - [17/Sep/2025 03:45:49] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbLnpKT HTTP/1.1" 200 275 0.000355 +219.228.146.148,127.0.0.1 - - [17/Sep/2025 03:45:49] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbLnqu8&sid=gVzDTgTtIF0OYTTiAAAN HTTP/1.1" 200 192 0.000543 +219.228.146.148,127.0.0.1 - - [17/Sep/2025 03:45:49] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbLnquK&sid=gVzDTgTtIF0OYTTiAAAN HTTP/1.1" 200 196 0.000240 +219.228.146.148,127.0.0.1 - - [17/Sep/2025 03:45:49] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbLnqwQ&sid=gVzDTgTtIF0OYTTiAAAN HTTP/1.1" 200 192 0.000422 +Traceback (most recent call last): + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/hub.py", line 471, in fire_timers + timer() + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/timer.py", line 59, in __call__ + cb(*args, **kw) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/greenthread.py", line 272, in main + result = function(*args, **kwargs) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 591, in _handle_event_internal + r = server._trigger_event(data[0], namespace, sid, *data[1:]) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 53, in on_login + user_id = uuid2username[user_uuid] +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +(185715) accepted ('127.0.0.1', 41652) +219.228.146.148,127.0.0.1 - - [17/Sep/2025 03:45:49] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbLnqwU&sid=gVzDTgTtIF0OYTTiAAAN HTTP/1.1" 200 157 0.285216 +disconnect handler error +Traceback (most recent call last): + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/engineio/server.py", line 450, in run_handler + return self.handlers[event](*args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 671, in _handle_eio_disconnect + self._handle_disconnect(eio_sid, n, reason) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 568, in _handle_disconnect + self._trigger_event('disconnect', namespace, sid, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 150, in on_disconnect + user_uuid2chatmanager[uuid].disconnect(uuid) +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +219.228.146.148,127.0.0.1 - - [17/Sep/2025 03:46:44] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=websocket&sid=gVzDTgTtIF0OYTTiAAAN HTTP/1.1" 200 0 55.351826 +(185715) accepted ('127.0.0.1', 35708) +59.78.194.184,127.0.0.1 - - [17/Sep/2025 04:40:08] "GET /favicon.ico HTTP/1.1" 404 331 0.001202 +59.78.194.184,127.0.0.1 - - [17/Sep/2025 04:40:09] "GET /favicon.ico HTTP/1.1" 404 331 0.001042 +59.78.194.184,127.0.0.1 - - [17/Sep/2025 04:40:15] "GET /favicon.ico HTTP/1.1" 404 331 0.001459 +59.78.194.184,127.0.0.1 - - [17/Sep/2025 04:40:40] "GET /favicon.ico HTTP/1.1" 404 331 0.001429 +59.78.194.184,127.0.0.1 - - [17/Sep/2025 04:40:40] "GET /favicon.ico HTTP/1.1" 404 331 0.001089 +(185715) accepted ('127.0.0.1', 47806) +59.78.194.184,127.0.0.1 - - [17/Sep/2025 04:42:45] "GET /?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 162 0.000592 +59.78.194.184,127.0.0.1 - - [17/Sep/2025 04:43:07] "GET /favicon.ico HTTP/1.1" 404 331 0.001448 +59.78.194.184,127.0.0.1 - - [17/Sep/2025 04:43:07] "GET /favicon.ico HTTP/1.1" 404 331 0.000793 +59.78.194.184,127.0.0.1 - - [17/Sep/2025 04:44:50] "GET /favicon.ico HTTP/1.1" 404 331 0.001238 +59.78.194.184,127.0.0.1 - - [17/Sep/2025 04:44:50] "GET /favicon.ico HTTP/1.1" 404 331 0.000915 +59.78.194.184,127.0.0.1 - - [17/Sep/2025 04:45:19] "GET /favicon.ico HTTP/1.1" 404 331 0.002353 +59.78.194.184,127.0.0.1 - - [17/Sep/2025 04:45:20] "GET /favicon.ico HTTP/1.1" 404 331 0.001941 +59.78.194.184,127.0.0.1 - - [17/Sep/2025 04:47:09] "GET /favicon.ico HTTP/1.1" 404 331 0.001026 +59.78.194.184,127.0.0.1 - - [17/Sep/2025 04:47:10] "GET /favicon.ico HTTP/1.1" 404 331 0.000903 diff --git a/Html/apps/services/backboard_service.py b/Html/apps/services/backboard_service.py index 6a458da..0ef29a8 100644 --- a/Html/apps/services/backboard_service.py +++ b/Html/apps/services/backboard_service.py @@ -34,7 +34,7 @@ def realtime_response(config: dict, realtime_action: dict) -> None: file_path = realtime_action.get("filePath") assert isinstance(file_path, str) with sudo_open(file_path, "r", encoding="utf-8") as f: - bb.active_file_content = f.read() + bb.active_file_content = f bb.active_file_path = file_path elif rtype == "paste": @@ -44,14 +44,14 @@ def realtime_response(config: dict, realtime_action: dict) -> None: bb.pasted_content = realtime_action.get("content") bb.active_file_path = file_path with sudo_open(file_path, "r", encoding="utf-8") as f: - bb.active_file_content = f.read() + bb.active_file_content = f elif rtype == "fileEdit": file_path = realtime_action.get("filePath") assert isinstance(file_path, str) bb.active_file_path = file_path with sudo_open(file_path, "r", encoding="utf-8") as f: - bb.active_file_content = f.read() + bb.active_file_content = f chatmanager.upload_bb() \ No newline at end of file diff --git a/Html/apps/static/算法效率-效率的重要性与实践验证.html b/Html/apps/static/算法效率-效率的重要性与实践验证.html new file mode 100644 index 0000000..e6a18f9 --- /dev/null +++ b/Html/apps/static/算法效率-效率的重要性与实践验证.html @@ -0,0 +1,121 @@ + + + + + + + +

效率的重要性与实践验证

+
+

Auto-generated at 2025-09-16 05:03

+
+

理论热身:算法选择的智慧

+

任务:分析与决策

+

项目组目前有两套备选的交通信号灯同步算法,它们将在不同性能的服务器上运行:

+
    +
  • +

    方案A:部署在超级服务器上(10^9 次运算/秒),采用的是一种较为简单的算法,处理n个路口需要 $2n^2$ 次计算。

    +
  • +
  • +

    方案B:部署在普通服务器上(10^7 次运算/秒),但采用的是一种更优化的算法,处理n个路口需要 $50nlog_2n$ 次计算。

    +
  • +
+

你的项目经理(右侧的Agent)希望你通过分析,来判断哪个方案更具前景。请与TA对话,逐一回答以下问题。

+

思考题

+

与右侧的Agent对话,回答以下问题:

+
    +
  1. +

    概念回顾:首先,请向你的“经理”解释,根据课程所学,一个合格的“算法”应具备哪些基本特征?

    +
  2. +
  3. +

    小规模测试:对于一个包含100个路口的小型城区(n=100),计算并说明方案A和方案B分别需要多长时间完成计算?在这种情况下,你会推荐哪个方案?

    +
  4. +
  5. +

    大规模应用:现在,我们需要为一座拥有100万个路口的大都市(n=1,000,000)进行规划。再次计算并说明两个方案的耗时。你的推荐会改变吗?为什么?

    +
  6. +
  7. +

    总结陈词:综合以上分析,向你的“经理”总结:为什么一个更优的算法设计,其重要性远超硬件性能的提升? 这验证了课程中提到的哪个核心观点?

    +
  8. +
+

编程实践:验证算法的真实性能

+

任务:编码与分析

+

理论分析让你认识到了算法效率的重要性。现在,你需要通过编程来亲身感受不同交通状况对同一算法性能的巨大影响。我们将以“插入排序”为例,来处理三种典型的交通流量数据,这分别对应算法分析中的最好最坏平均情况。

+
题目:模拟交通流量排序
+

实现插入排序算法,并验证其在处理“畅通无阻”(数据有序)、“交通大堵塞”(数据逆序)和“随机车流”(数据随机)三种模式时的效率差异。

+
代码框架
+

在代码编辑区,完成 insertion_sort(arr) 函数的实现后,运行完整代码,并与Agent讨论结果。 +请创建任意文件,将下面代码写入到编辑器中 +```python +import random +import time

+

def insertion_sort(arr): + """ + 实现插入排序算法 + 参数arr: 待排序的交通数据数组(整数代表车辆通行次序) + 返回: 排序后的数组 + """ + # TODO: 请在此处实现你的插入排序逻辑

+

def generate_traffic_data(n): + """ + 生成模拟交通数据 + 参数n: 数据规模(路口数量或监控点数量) + 返回: 三种不同交通状况的数据 + """ + random_data = [random.randint(0, 10**6) for _ in range(n)] + # 模拟“畅通无阻”:交通流按次序进入,数据基本有序 (Best Case) + best_case_data = sorted(random_data) + # 模拟“交通大堵塞”:疏散时情况完全反转,数据逆序 (Worst Case) + worst_case_data = sorted(random_data, reverse=True) + # 模拟“随机车流”:正常但无规律的交通状况 (Average Case) + average_case_data = random_data + return best_case_data, worst_case_data, average_case_data

+

def measure_performance(func, data): + """ + 测量算法性能 + 参数func: 排序函数 + 参数data: 交通数据 + 返回: 执行时间(毫秒) + """ + start_time = time.perf_counter_ns() + func(data.copy()) # 使用副本避免影响其他测试 + end_time = time.perf_counter_ns() + return (end_time - start_time) / 10**6 # 转换为毫秒

+

测试不同规模的路口网络

+

network_sizes = [1000, 5000, 10000] +print("交通数据处理算法性能测试:") +for size in network_sizes: + best, worst, avg = generate_traffic_data(size)

+
time_best = measure_performance(insertion_sort, best)
+time_worst = measure_performance(insertion_sort, worst)
+time_avg = measure_performance(insertion_sort, avg)
+
+print(f"网络规模 n={size}:")
+print(f"  - 畅通无阻 (Best Case): {time_best:.2f} ms")
+print(f"  - 交通大堵塞 (Worst Case): {time_worst:.2f} ms")
+print(f"  - 随机车流 (Average Case): {time_avg:.2f} ms")
+
+

```

+

分析与讨论

+

完成编程并得到输出后,请与右侧Agent讨论以下问题,以检验你的理解:

+
    +
  1. +

    结果分析:当网络规模从1000增加到10000时,“交通大堵塞”(最坏情况)的处理时间增长了大约多少倍?这更符合O(n)(线性)还是O(n2)(二次)的增长模式?

    +
  2. +
  3. +

    原因探究:为什么“畅通无阻”(最好情况)的处理速度如此之快?它的时间复杂度是什么?请结合你的代码逻辑来解释。

    +
  4. +
  5. +

    实践应用:根据你的实验结果,你认为插入排序是否适合用于需要快速响应大规模交通拥堵的实时预警系统?为什么?

    +
  6. +
  7. +

    融会贯通:结合第一关的理论分析和第二关的编程实验,你对“算法是解决问题的核心”这句话有了怎样更深的理解?

    +
  8. +
+ + + \ No newline at end of file diff --git a/Html/apps/utils/sudoUtil.py b/Html/apps/utils/sudoUtil.py index 92002d4..0b8a73e 100644 --- a/Html/apps/utils/sudoUtil.py +++ b/Html/apps/utils/sudoUtil.py @@ -16,7 +16,7 @@ def sudo_open(file_path, mode='r', encoding='utf-8'): if result.returncode != 0: raise PermissionError(f"无法读取文件: {file_path}") content = result.stdout - yield content + return content elif mode == 'w': raise PermissionError(f"不允许以sudo权限写入文件: {file_path}") else: diff --git a/Html/apps/views/vscode.py b/Html/apps/views/vscode.py index 680a9ef..99df8ea 100644 --- a/Html/apps/views/vscode.py +++ b/Html/apps/views/vscode.py @@ -33,6 +33,29 @@ def desktop(user_uuid, course_id, chapter_name, lesson_name): except subprocess.CalledProcessError as e: print(f"Error creating directory {path_dir} details {str(e)}") + try:#使用sudo创建shared_group + subprocess.run(["sudo", "groupadd", f"shared_group_{user_id}"], check=True) + except subprocess.CalledProcessError as e: + print(f"Error creating shared_group: {e}") + + try:#使用sudo将user_id加入shared_group + subprocess.run(["sudo", "usermod", "-a", "-G", f"shared_group_{user_id}", user_id], check=True) + # 自己也加入 + subprocess.run(["sudo", "usermod", "-a", "-G", f"shared_group_{user_id}", 'flask'], check=True) + except subprocess.CalledProcessError as e: + print(f"Error adding user {user_id} to shared_group: {e}") + try:#将文件 + subprocess.run(["sudo", "chown", "-R", f"flask:shared_group_{user_id}", user_home], check=True) + subprocess.run(["sudo", "chmod", "-R", "770", path_dir], check=True) + except subprocess.CalledProcessError as e: + print(f"Error changing directory {path_dir} to shared_group_{user_id}: {e}") + try:#继承目录 + subprocess.run(["sudo", "chmod", "g+s", path_dir], check=True) + except subprocess.CalledProcessError as e: + print(f"Error changing directory {path_dir} to shared_group_{user_id}: {e}") + + + chatmanager = ChatManager() current_app.extensions["user_uuid2chatmanager"][user_uuid] = chatmanager code_server_port = 10000 + int(uuid.uuid4().int % 10000) @@ -52,6 +75,8 @@ def desktop(user_uuid, course_id, chapter_name, lesson_name): r'handle_path\s+/vsc' + re.escape(user_id) + r'/\* {.*?reverse_proxy.*?}', re.DOTALL ) + for i in range(len(lines)): + if (lines[i].strip()==''): lines[i]='' content = "".join(lines) if pattern.search(content): new_content = pattern.sub('', content) diff --git a/code-server-like/app/sockets/terminal_service.py b/code-server-like/app/sockets/terminal_service.py index 626223d..96d9b2b 100644 --- a/code-server-like/app/sockets/terminal_service.py +++ b/code-server-like/app/sockets/terminal_service.py @@ -5,154 +5,166 @@ import uuid import subprocess import threading from flask import Blueprint, request, current_app, session -from flask_socketio import Namespace, join_room, leave_room, emit, SocketIO +from flask_socketio import Namespace, join_room, leave_room, emit, SocketIO, rooms, disconnect from threading import Thread import sys from ..extensions import socketio - +import pty +import termios +import struct +import fcntl +import psutil +TERM_INIT_CONFIG = { + # instead of local server runnning this web terminal service + # "domain" is the target that you want to access through local server (with this web terminal) + # and before doing so - make sure you have username and port (on the "domain") to implement remote access + 'domain': '127.0.0.1', # or ip address like 192.168.10.11 + 'client_path': { + 'telnet': '/usr/bin/telnet', # confirmed location of your client binary (with cmd like 'which telnet') + 'ssh': '/usr/bin/ssh' + } +} terminal_bp = Blueprint('terminal', __name__, url_prefix='/vsc-like') -# 存储终端进程 -command_dict = {} -terminal_busy = {} -terminals = {} -terminal_locks = {} - -def check_process_running(command_name): - try: - # 使用 pgrep 查找与给定命令相关的进程 - result = subprocess.run( - ["pgrep", "-f", command_name], - stdout=subprocess.PIPE, stderr=subprocess.PIPE - ) - return result.returncode == 0 # 如果返回值为 0,说明命令仍在运行 - except Exception as e: - print(f"Error checking process: {e}") - return False - -def monitor_process(socket_id, command_name, namespace): - while True: - is_running = check_process_running(command_name) - if is_running: - print(f"Process '{command_name}' is still running.") - else: - print(f"Process '{command_name}' is not running.") - break # 停止检查,如果进程不再运行 - - time.sleep(0.1) # 每 0.1 秒检查一次 - command_dict[socket_id] = '' - terminal_busy[socket_id] = False - namespace.emit('terminal_output',{'data': '>'}) -def start_terminal_process(socket_id, namespace): +def set_winsize(fd, row, col, xpix=0, ypix=0): + winsize = struct.pack("HHHH", row, col, xpix, ypix) + fcntl.ioctl(fd, termios.TIOCSWINSZ, winsize) + + +def read_and_forward_pty_output(fd=None, pid=None, room_id=None,namespace=None): """ - 监听多个子进程的输出,并通过 WebSocket 发给前端 - 使用 select 进行非阻塞的 I/O 操作,并实现动态流量控制 + read data on pty master from the pty slave, and emit to the web terminal visitor """ - process = terminals[socket_id] - - # 获取子进程的 stdout 和 stderr - stdout = process.stdout - stdin = process.stdin - # 将 stdout 和 stderr 添加到 select 监听的文件描述符列表中 - - # 初始等待时间 - timeout = 0.1 - max_timeout = 2 # 设置最大超时时间为 2 秒 - + max_read_bytes = 1024 * 20 + timeout=0.1 while True: - while True: - output = stdout.readline() - if not output: - break - timeout = 0.1 - namespace.emit('terminal_output', {'data': output+'\r'}, room=socket_id) - timeout = min(timeout * 2, max_timeout) - time.sleep(timeout) - if process.poll() is not None: - break - + socketio.sleep(timeout) + timeout=min(timeout*2, 0.4) + # using flask default web server, or uwsgi production web server + # when the child process is terminated, it will not disappear from linux process list + # and keep staying as a zombie process until the parent exits. + try: + child_process = psutil.Process(pid) + except psutil.NoSuchProcess as err: + return + if child_process.status() not in ('running', 'sleeping'): + return + if fd: + timeout_sec = 0 + (data_ready, _, _) = select.select([fd], [], [], timeout_sec) + if data_ready: + # output = os.read(fd, max_read_bytes).decode('ascii') + timeout=0.1 + try: + output = os.read(fd, max_read_bytes).decode() + except Exception as err: + output = """ + ***AQUI WEB TERM ERR*** + {} + *********************** + """.format(err) + # the key for different visitor to get different terminal (instead of mixing up) + # is to let the background task push pty response to each one's own (default) ROOM! + namespace.emit("pty_output", {"output": output}, room=room_id) class VSCLikeNameSpace(Namespace): - def on_connect(self, data): - """ - 处理 WebSocket 连接 - - 验证会话 - - 使用指定的用户启动 bash 终端 - - 启动监听子进程输出的线程 - """ - socket_id = session.get('uuid') - user_id = session.get('user_id') # 从 session 获取用户 ID - path = session.get('path') + def on_connect(self): + """new client connected""" + if session.get('terminal_config', {}).get('child_pid', None): + print(session['terminal_config']['child_pid']) + # already started child process, don't start another + return - if not path or not user_id: - emit('error', {'message': 'Authentication failed, no path or user found for this session'}) - return False # 拒绝连接 - # 使用 sudo 启动终端进程,以指定的 user_id 用户身份执行 - try: - process = subprocess.Popen( - ['sudo', '-u', user_id, 'bash', '-il'], # 使用指定的 user_id 启动 bash - stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - text=True, # 确保输出是文本格式 - ) - terminals[socket_id] = process - terminal_busy[socket_id] = False - emit('connected', {'message': 'OK'}) - join_room(socket_id, namespace='/vsc-like') + # create child process attached to a pty we can read from and write to + (child_pid, fd) = pty.fork() + lesson_path = session.get('path') + if child_pid == 0: + # this is the child process fork. + # anything printed here will show up in the pty, including the output + # of this subprocess + # subprocess.run('bash') + term_type = session.get('terminal_config').get('term_type') + path = TERM_INIT_CONFIG.get('client_path', {}).get(term_type, None) + if not path: + print("Can't locate {} binary, exit".format(term_type)) + disconnect() + if term_type == 'telnet': + # switch to the right location of your telnet binary (example comes from OSX which got telnet from brew) + # or you can also make work like auto-detection, or manually but configurable + os.execl(path, 'telnet', '-l', session['terminal_config']['username'], + session['terminal_config']['domain'], '{}'.format(session['terminal_config']['port'])) + elif term_type == 'ssh': + os.execl(path,'ssh', '-p','22', + #'{}'.format(session['terminal_config']['port']), + '{}@{}'.format(session['terminal_config']['username'], session['terminal_config']['domain'])) + - socketio.start_background_task(target=start_terminal_process, socket_id=socket_id, namespace=self) - - except Exception as e: - emit('error', {'message': f'Error starting terminal process: {str(e)}'}) - return False - - def on_send_input(self, data): - socket_id = session.get('uuid') - input_data = data.get('input') - if socket_id not in command_dict:command_dict[socket_id]='' - # 检查当前 socket_id 是否有对应的终端 - if socket_id in terminals: - # 获取该终端的锁进行线程同步 - lock = terminal_locks.get(socket_id) - if not lock: - lock = threading.Lock() - terminal_locks[socket_id] = lock - - with lock: # 在锁的保护下操作终端 - try: - terminals[socket_id].stdin.write(input_data) - command_dict[socket_id]+=input_data - if input_data=='\r': - terminals[socket_id].stdin.flush() - emit('terminal_output', {'data': f'\r\n'}, room=socket_id) - if terminal_busy[socket_id]==False: - terminal_busy[socket_id] = True - socketio.start_background_task(monitor_process, socket_id, command_dict[socket_id], namespace=self) - elif input_data=='\x03': - terminals[socket_id].stdin.flush() - emit('terminal_output', {'data': f'^C\x03\r\n'}, room=socket_id) - else: - emit('terminal_output', {'data': input_data}, room=socket_id) - except Exception as e: - emit('error', {'message': f'Error sending input: {str(e)}'}, room=socket_id) + else: + current_app.logger.debug("wrong term type {}".format(term_type)) + disconnect() + session['terminal_config'] = TERM_INIT_CONFIG else: - emit('error', {'message': 'No terminal found for this session'}, room=socket_id) + session['terminal_config']['fd'] = fd + session['terminal_config']['child_pid'] = child_pid + session['terminal_config']['room_id'] = rooms()[0] + session.modified = True + set_winsize(fd, 50, 50) + current_app.logger.debug("child pid = {}".format(child_pid)) + current_app.logger.debug("rooms of this session = {}".format(rooms())) + socketio.start_background_task(read_and_forward_pty_output, fd, child_pid, rooms()[0],self) + current_app.logger.debug("background task running") + # print(session) - def on_disconnect(): - socket_id = session.get('uuid') - - # 检查是否有终端进程需要终止 - if socket_id in terminals: - try: - # 终止终端进程 - terminals[socket_id].terminate() - del terminals[socket_id] - # 删除锁 - if socket_id in terminal_locks: - del terminal_locks[socket_id] - emit('terminal_output', {'data': 'Terminal disconnected and terminated'}, room=socket_id) - except Exception as e: - emit('error', {'message': f'Error disconnecting terminal: {str(e)}'}, room=socket_id) + def on_pty_input(self, data): + """write to the child pty, which now is the ssh process from this machine to the 'domain' configured + """ + print(f"get data {data}") + try: + child_process = psutil.Process(session.get('terminal_config').get('child_pid')) + except psutil.NoSuchProcess as err: + disconnect() + session['terminal_config'] = TERM_INIT_CONFIG + return + if child_process.status() not in ('running', 'sleeping'): + disconnect() + session['terminal_config'] = TERM_INIT_CONFIG + return + # print(session) + # print(data, 'from input') + fd = session.get('terminal_config').get('fd') + if fd: + # print("writing to ptd: %s" % data["input"]) + # os.write(fd, data["input"].encode('ascii')) + os.write(fd, data["input"].encode()) + + + def on_resize(self, data): + try: + child_process = psutil.Process(session.get('terminal_config').get('child_pid')) + except psutil.NoSuchProcess as err: + disconnect() + session['terminal_config'] = TERM_INIT_CONFIG + return + if child_process.status() not in ('running', 'sleeping'): + disconnect() + session['terminal_config'] = TERM_INIT_CONFIG + return + fd = session.get('terminal_config').get('fd') + if fd: + set_winsize(fd, data["rows"], data["cols"]) + + def on_disconnect(self): + try: + child_process = psutil.Process(session.get('terminal_config', {}).get('child_pid')) + except psutil.NoSuchProcess as err: + disconnect() + session['terminal_config'] = TERM_INIT_CONFIG + return + if child_process.status() in ('running', 'sleeping'): + # if visitor just close the browser tab then left alone the pty here + # it should be terminated by the parent process after + child_process.terminate() + current_app.logger.debug('user left the pty alone, terminated') + current_app.logger.debug('Client disconnected') \ No newline at end of file diff --git a/code-server-like/app/views/file.py b/code-server-like/app/views/file.py index 03b5729..b1ad3a4 100644 --- a/code-server-like/app/views/file.py +++ b/code-server-like/app/views/file.py @@ -12,8 +12,7 @@ def create_folder(): filepath = request.json.get('path', '') path = session.get('path') parent = request.json.get('parent', '') - root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH'] - base_path = f'{root_workspace_path}/{path}' + base_path = f'{path}' filepath = f'{base_path}/{parent}/{filepath}' try: os.makedirs(filepath) @@ -27,8 +26,7 @@ def create_file(): filepath = request.json.get('path', '') path = session.get('path') parent = request.json.get('parent', '') - root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH'] - base_path = f'{root_workspace_path}/{path}' + base_path = f'{path}' filepath = f'{base_path}/{parent}/{filepath}' try: open(filepath, 'w').close() @@ -41,8 +39,7 @@ def rename_file(): user_root = session.get('path') path = request.json.get('path', '') new_name = request.json.get('newName', '') - root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH'] - base_path = f'{root_workspace_path}/{user_root}' + base_path = f'{user_root}' filepath = f'{base_path}/{path}' try: path_list = filepath.split('/') @@ -58,8 +55,7 @@ def rename_folder(): user_root = session.get('path') path = request.json.get('path', '') new_name = request.json.get('newName', '') - root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH'] - base_path = f'{root_workspace_path}/{user_root}' + base_path = f'{user_root}' folderpath = f'{base_path}/{path}' try: path_list = folderpath.split('/') @@ -74,9 +70,8 @@ def rename_folder(): def copy_files(): old_path = request.json.get('oldPath', '') new_path = request.json.get('newPath', '') - root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH'] user_root = session.get('path') - base_path = f'{root_workspace_path}/{user_root}' + base_path = f'{user_root}' old_path = f'{base_path}/{old_path}' new_path = f'{base_path}/{new_path}' # oldpath的父目录就是newpath的话,对oldpath进行重命名 @@ -106,9 +101,8 @@ def copy_files(): @file_bp.route('/delete-file', methods=['POST']) def delete_file(): path = request.json.get('path', '') - root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH'] user_root = session.get('path') - base_path = f'{root_workspace_path}/{user_root}' + base_path = f'{user_root}' filepath = f'{base_path}/{path}' if os.path.isdir(filepath): shutil.rmtree(filepath) @@ -119,8 +113,7 @@ def delete_file(): @file_bp.route('/file-content', methods=['POST']) def file_content(): path = session.get('path') - root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH'] - base_path = f'{root_workspace_path}/{path}' + base_path = f'{path}' filepath = request.json.get('path', '') filepath = f'{base_path}/{filepath}' if not os.path.exists(filepath): @@ -135,8 +128,7 @@ def file_content(): @file_bp.route('/save-file', methods=['POST']) def save_file(): path = session.get('path') - root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH'] - base_path = f'{root_workspace_path}/{path}' + base_path = f'{path}' filepath = request.json.get('path', '') filepath = f'{base_path}/{filepath}' content = request.json.get('content', '') diff --git a/code-server-like/app/views/routes.py b/code-server-like/app/views/routes.py index 691eb18..8ae074f 100644 --- a/code-server-like/app/views/routes.py +++ b/code-server-like/app/views/routes.py @@ -4,9 +4,18 @@ from flask import Blueprint, request, jsonify, current_app, render_template, ses from ..services.file_service import get_file_tree, load_config main_bp = Blueprint('main', __name__, url_prefix='/vsc-like') - -@main_bp.route('/////', methods=['GET']) -def vsc_like(user_uuid, user_id, course_id, chapter_name, lesson_name): +TERM_INIT_CONFIG = { + # instead of local server runnning this web terminal service + # "domain" is the target that you want to access through local server (with this web terminal) + # and before doing so - make sure you have username and port (on the "domain") to implement remote access + 'domain': '15.168.14.27', # or ip address like 192.168.10.11 + 'client_path': { + 'telnet': '/usr/bin/telnet', # confirmed location of your client binary (with cmd like 'which telnet') + 'ssh': '/usr/bin/ssh' + } +} +@main_bp.route('//////', methods=['GET']) +def vsc_like(user_uuid, user_id, course_id, chapter_name, lesson_name, port): uuid = user_uuid base_path = current_app.config['ROOT_WORKSPACE_PATH'] path = os.path.join(base_path, user_id, course_id, chapter_name, lesson_name) @@ -16,6 +25,11 @@ def vsc_like(user_uuid, user_id, course_id, chapter_name, lesson_name): session['course_id'] = course_id session['chapter_name'] = chapter_name session['lesson_name'] = lesson_name + session['terminal_config'] = TERM_INIT_CONFIG + session['terminal_config']['term_type'] = 'ssh' + session['terminal_config']['username'] = user_id + session['terminal_config']['port'] = port + session.modified = True config = load_config(path) # if not config: # return jsonify({"error": "Configuration file not found or invalid"}), 404 @@ -26,11 +40,17 @@ def vsc_like(user_uuid, user_id, course_id, chapter_name, lesson_name): try: subprocess.run(["sudo", "useradd", "-m", "-d", user_root, user_id]) # 创建用户 subprocess.run(["sudo", "chown", "-R", user_id, user_root]) # 设置目录权限为新用户 + except subprocess.CalledProcessError as e: print(f"Error creating user {user_id}: {e}") try: # 使用 sudo 执行 mkdir 命令来创建目录 subprocess.run(["sudo", "-u", user_id, "mkdir", "-p", path], check=True) + subprocess.run(["sudo", "-u", user_id, "mkdir", "-p", f'{user_root}/.ssh'], check=True) + flask_pub_key = "/home/flask/.ssh/id_ed25519.pub" + subprocess.run(["sudo", "cp", flask_pub_key, f"{user_root}/.ssh/authorized_keys"], check=True) + subprocess.run(["sudo", "chmod", "700", f"{user_root}/.ssh"], check=True) + subprocess.run(["sudo", "chmod", "600", f"{user_root}/.ssh/authorized_keys"], check=True) print(f"Directory {path} created successfully for user {user_id}") except subprocess.CalledProcessError as e: print(f"Error creating directory {path} details {str(e)}") @@ -44,17 +64,15 @@ def vsc_like(user_uuid, user_id, course_id, chapter_name, lesson_name): subprocess.run(["sudo", "usermod", "-a", "-G", f"shared_group_{user_id}", 'flask'], check=True) except subprocess.CalledProcessError as e: print(f"Error adding user {user_id} to shared_group: {e}") - try:#将文件 - subprocess.run(["sudo", "chown", "-R", f"flask:shared_group_{user_id}", user_root], check=True) + try: + subprocess.run(["sudo", "chown", "-R", f"flask:shared_group_{user_id}", path], check=True) + subprocess.run(["sudo", "chmod", "-R", "750", user_root], check=True) subprocess.run(["sudo", "chmod", "-R", "770", path], check=True) except subprocess.CalledProcessError as e: print(f"Error changing directory {path} to shared_group_{user_id}: {e}") - try:#继承目录 - subprocess.run(["sudo", "chmod", "g+s", path], check=True) - except subprocess.CalledProcessError as e: - print(f"Error changing directory {path} to shared_group_{user_id}: {e}") - - - return render_template('index.html') + + + + return render_template('index.html', course_id=course_id, chapter_name=chapter_name, lesson_name=lesson_name) diff --git a/code-server-like/static/js/file.js b/code-server-like/static/js/file.js index 09dccc0..aeeabe0 100644 --- a/code-server-like/static/js/file.js +++ b/code-server-like/static/js/file.js @@ -296,7 +296,11 @@ function createNewFolder(event) { function saveFile(event) { event.stopPropagation(); const content = editor.getValue(); - fetch(`/vsc-like/save-file`, { method: 'POST', body: JSON.stringify({ path: item.path+'/'+item.name, content: content }) , headers: { 'Content-Type': 'application/json' } }) + console.log(selectItem) + if (selectedItem.path==undefined){ + selectedItem.path='.'; + } + fetch(`/vsc-like/save-file`, { method: 'POST', body: JSON.stringify({ path: selectedItem.path+'/'+selectedItem.name, content: content }) , headers: { 'Content-Type': 'application/json' } }) .then(() => loadFileTree()); } diff --git a/code-server-like/static/js/terminal.js b/code-server-like/static/js/terminal.js index 8510969..6a91190 100644 --- a/code-server-like/static/js/terminal.js +++ b/code-server-like/static/js/terminal.js @@ -1,43 +1,63 @@ -const socket = io('https://hsamooc.cn/vsc-like',{path:'/vsc-like-ws'}); - let term; document.addEventListener('DOMContentLoaded', () => { - // 创建一个新的 xterm 实例 - term = new Terminal({ - cursorBlink: true, - cols: 80, - rows: 24, - }); - - // 打开终端到 #terminal 元素 + Terminal.applyAddon(fullscreen) + Terminal.applyAddon(fit) + Terminal.applyAddon(webLinks) + Terminal.applyAddon(search) + const term = new Terminal({ + col:80, + row:20, + cursorBlink: 5, + macOptionIsMeta: true, + }); term.open(document.getElementById('terminal')); - - // 启动连接并监听数据 - socket.on('connected', function (data) { - term.write('>'); + term.fit() + term.resize(term.cols, term.rows-5) + console.log(`size: ${term.cols} columns, ${term.rows} rows`) + // term.toggleFullScreen(true) + term.fit() + term.write("Welcome to AQ web remote-only terminal!\r\n") + term.on('key', (key, ev) => { + socket.emit("pty_input", {"input": key}, function(response) { + }); }); - // 监听后端返回的终端输出并显示 - socket.on('terminal_output', function (data) { - if (data.data=='\x7f'){ - term.write('\b \b') - return + const socket = io('https://hsamooc.cn/vsc-like',{path:'/vsc-like-ws'}); + const status = document.getElementById("status") + + socket.on("pty_output", function(data){ + console.log("new output", data) + term.write(data.output) + }) + + socket.on("connect", () => { + // fitToscreen() + status.innerHTML = 'connected' + + socket.emit("pty_input",{"input":"cd "+window.lesson_data.course_id+"/"+window.lesson_data.chapter_name+'/'+window.lesson_data.lesson_name+"\r"}) } - term.write(data.data); // 输出来自后端的数据 - console.log("get",data.data) - }); + ) - // 监听用户在终端中输入的命令 - term.onData(function (data) { - socket.emit('send_input', { input: data }); // 将用户输入通过 WebSocket 发送给后端 - }); + socket.on("disconnect", () => { + status.innerHTML = 'disconnected' + }) + + function fitToscreen(){ + term.fit() + socket.emit("resize", {"cols": term.cols, "rows": term.rows}) + } + + function debounce(func, wait_ms) { + let timeout + return function(...args) { + const context = this + clearTimeout(timeout) + timeout = setTimeout(() => func.apply(context, args), wait_ms) + } + } + + const wait_ms = 500; + window.onresize = debounce(fitToscreen, wait_ms) - // 如果终端被断开,显示消息 - socket.on('error', function (error) { - term.write(`\nError: ${error.message}`); - }); - socket.on('disconnect', function () { - term.write('\nDisconnected from terminal'); - }); }); \ No newline at end of file diff --git a/code-server-like/templates/index.html b/code-server-like/templates/index.html index 34be608..d0c250e 100644 --- a/code-server-like/templates/index.html +++ b/code-server-like/templates/index.html @@ -7,11 +7,15 @@ - - + + + + + + + - @@ -48,6 +52,7 @@ + status: connecting...
@@ -58,6 +63,12 @@