Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I push my refactored code here? #63

Open
Wangsutan opened this issue Nov 26, 2024 · 2 comments
Open

How can I push my refactored code here? #63

Wangsutan opened this issue Nov 26, 2024 · 2 comments

Comments

@Wangsutan
Copy link

How can I push my refactored code here?

Hello everyone, my name is Wang Sutan, a programming enthusiast from China. I have refactored this ASCII art project.

Recently, the inappropriate use of this project by a well-known Chinese blogger, He Tongxue, has made this library known to many Chinese people. I believe that the actions of He Tongxue's team have damaged the image of Chinese programmers. I took this opportunity to refactor the project, with the first goal being to understand the project and learn the related technologies, and the second goal is to try to showcase a good image of Chinese programmers.

The basic logic of the original project is largely correct, but the code has a low degree of modularity and lacks readability. I mainly did the following work (you can also refer to this article):

  • Unified the management of core data related to characters.
  • The function get_args() for reading command line arguments has been decoupled in terms of parameter passing.
  • Completely refactored the algorithms related to ASCII art into several functions. In this process, I even discovered a significant flaw in the original code, which is that the original project had serious size issues when dividing a string of characters on a long strip of images. When I tried to divide Chinese characters, the result was chaotic. Now it has been fixed.
  • Added and improved type annotations.

I also have a certain understanding of Chinese character culture, and I took this opportunity to select some interesting Chinese characters and put them into the dictionary.

I obtained the code and resources by directly downloading the .zip file. The new code has been placed in my own repository. I don't know how to push my modifications to the original project, can anyone tell me?

My refactoring may introduce some new issues, and I welcome everyone to provide more opinions and suggestions.

如何将我重构的代码推送过来?

大家好,我是来自中国的编程爱好者王苏谈,重构了这个字符画项目。

近期,中国知名博主何同学对这个项目的不当使用,使得这个库被很多中国人知道。本人认为,何同学团队的做法损害了中国程序员的形象。我趁此机会,将该项目进行了重构,目的一是了解该项目,学习相关技术,二是尝试展现我们中国程序员的一种良好形象。

原项目的基本逻辑大体上是正确的,但是代码的模块化程度较低,缺乏可读性。我主要做了这些工作(还可以参考这篇文章):

  • 将与字符相关的核心数据统一起来管理。
  • 读取命令行参数的函数get_args()传递参数的方式实现了解耦。
  • 彻底重构了字符画相关的算法,做成了若干函数。在这个过程中,甚至发现了原代码的重大缺陷,就是原项目在划分一长条的图片上的一串字符时,尺寸是有严重问题的。我尝试划分汉字的时候,结果是混乱的。现在也改好了。
  • 添加和完善了类型注解。

我还对中国汉字文化有一定的了解,借此机会,挑选了一些好玩的汉字,放到字典中。

我是通过直接下载.zip的方式获取代码和资源的,新的代码放到了自己的仓库中。不知道怎么将我的修改推送到原项目,大家能告诉我吗?

我的重构也许会引入一些新的问题,欢迎大家多提意见建议。

@xingwangzhe
Copy link

xingwangzhe commented Nov 26, 2024

倒数第二段话还是很幽默的:)

既然都上github了,想必还是有网络检索能力。我想你这些话正常应该在推送的时候写上,而不是在这里写

通常的做法是git fork生成自己的仓库,然后git clone到本地进行具体代码操作,之后就是git add xxx,git commit -m "description", git push origin main,最后再在github上新建pull request

如果你下载并使用GitHub Desktop,那么流程上,敲命令的步骤会被简单的可视化操作所代替。

最后

欢迎阅览github官方文档,我想这是最好的帮助

https://docs.github.com/zh/pull-requests

@ghost
Copy link

ghost commented Nov 27, 2024

Since the HTX debate several PRs and code-related issues have been created, all without any response from @vietnh1009, which is the same case for other ones created during the past 6 years. I suspect he is not willing to take time maintaining the code anymore. The repo is de facto dead, albeit with the soaring stars thanks to the hot topic (congrats).

Star History Chart

Instead of trying to get your changes merged, I suggest publish your work to PyPI as a continuation of this original repo, like I do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants