我也被這個Smart Remove Selection震驚了

还是吐槽下编程吧:fortune cookie 以及中文 rot13

λ posted @ 2016年8月20日 14:45 in Whispers , 3413 阅读

看完命令行的 fortune 程序源代码后真是毁童年

已经把 strfile 除了排序之外的功能重新用 C 语言实现得七七八八了,然而看到原实现那乱糟槽的代码,以及 strfile 的一个出于逻辑混乱的 bug,我已经不想完全复制功能了。按首字排序后的索引文件对 fortune 几乎一点用都没有,只对 unstr 有点意思,还要花时间读一大堆臭得要命的代码。unstr 仅仅是按索引顺序提取出索引文件的内容,简单过头,干嘛不将该功能合并到 strfile 呢。

还是自己重新设计 fortune 工具包吧。有 fortune cookie 数据就够了。
 


 

嗯,已经把实现放到 GitHub 上了,有什么编译问题希望能提出(最近很少來博客),毕竟我没在多个系统编译过。

其中稍微有点新意的是对中文,不,是对所有 Unicode 文本进行类似 rot13、剀撒变换的循环可逆文本混淆加密。

详细实现请看:https://github.com/jakwings/fortune.c/blob/v2/src/rotate.c

大概就是忽略空白和特殊字符,針對 UTF-8 code unit 進行分段式 rot13 加密,用简单工具测试过所有 Unicode 文本皆可顺利转换,且符合 UTF-8 编码。依然不排除在复杂情况下出现非法字符。


嗢9工绂抗宫玣攸刣 TvgUho 丗亓9朖仍乕缉评闡颋帙木胷揃凴5服迄徕射侓卧宯69毈竬戄沮圛大丝糵绬缉评返』

兼丠稀御朖炿斣愂皑昢寿丠斔9一9昢寿才朖 Havpbqr 斔期迨衙籵伶 ebg13『前撅友捯皑徝玢叢逓斔期淽淓劭寓』

诳结宫玣诽眘-uggcf://tvguho.pbz/wnxjvatf/sbeghar.p/oybo/i2/fep/ebgngr.p

多榏尤昢忷畲穴癷咙牿殗孊笳9釪尀 HGS-8 pbqr havg 逥衙刓殻异 ebg13 劭寓9甛箍午已兽浘诈返才朖 Havpbqr 斔期皓叢顴刜轟捯9万笳吕 HGS-8 缉砎』侪焼一掅陱圛夀杏惒冻丘凴玣靫泈孊笳』


:wq


本網站無註明「轉載」的著作均由Jak Wings製作 CC BY-NC-SA 2.5
Creative Commons 保持署名-相同方式分享 2.5

  • 无匹配
  • 无匹配
HOW TO CHECK SHUTTER 说:
Mar 15, 2022 05:38:26 PM

I am definitely enjoying your website. You definitely have some great insight and great stories. a law that restricts plant closings will

GHMC Property Tax Pa 说:
Aug 06, 2022 11:06:08 PM

Living in Hyderabad and the surrounding areas has become a blessing for the citizens with developments on the rise and the government providing great benefits through their GHMC sector. As you already know GHMC has started its online portal which allows you to make payments for different services, payments, invoices, and dues, on the same platform, even property owners can now make payments for GHMC property tax easily with a simple process. GHMC Property Tax Payment Online If you have received your GHMC property tax papers for the year then you might be wondering how I would make the payment, and obviously, with the digitization that has happened, it would be much much easier to make your property tax payment from their online portal, and that’s why 25penny.com have shown the steps below you need to follow to complete the process.

check CIBIL score 说:
Aug 07, 2022 11:29:49 PM

Before we show you how you can check CIBIL score, first know that TransUnion CIBIL is an organization and an entity gathers all the consumer’s loan, credit, payment and money related transaction, and this gives a general behavior example and statics allowing to generate a score for each customer also calls as CIBIL score. In simple words, every individual based on their payment choices, credit decisions and money pertains may rank and given CIBIL score points which range up to 900 points. check CIBIL score In the sense, if the customer receives anything above 750 – 900, then they have high credit affinity. With this the banks and loan facilities may happy to lend credit to them.

Telangana 1st Inter 说:
Aug 18, 2022 04:32:05 PM

The Telangana Inter First Year Important Model Question Paper 2023 is happy to be made available for download to all candidates who will be taking the examinations. Please check the Important Model Question Paper 2023 from the sections below. So, in order to achieve the highest possible score on the test, prepare for it. Telangana 1st Inter Question Paper 2023 Additionally, we advise the candidates to download the Subject-specific TS Inter First Year Important Model Question Paper 2023 from the attached direct links at the bottom of the page. For further information, see the sections below. Based on this the Telangana Intermediate I Year Board Important Model Question Paper 2023 is created by the Education Board.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter