|
bat-zw
金牌会员
      永远的学习者
积分 3105
发帖 1276
注册 2008-3-8
状态 离线
|
『第 31 楼』:
使用 LLM 解释/回答一下
Originally posted by quya at 2008-7-9 23:16:
仔细看了下, 还是有问题.
这里全部一样了.
这是因为没及时删除解压后的文件,造成下一次解压不成功,因此每次都是crc32 同一个文件。
ps:25楼代码的问题还是出在expand上面。
Last edited by zw19750516 on 2008-7-9 at 11:28 PM ]
Originally posted by quya at 2008-7-9 23:16:
After taking a close look, there are still issues.
Everything is the same here.
This is because the files after decompression were not deleted in time, resulting in the next decompression failing. Therefore, each time it is the same CRC32 for the file.
ps: The problem with the code on floor 25 is still with expand.
Last edited by zw19750516 on 2008-7-9 at 11:28 PM ]
|

批处理之家新域名:www.bathome.net |
|
2008-7-9 23:19 |
|
|
bat-zw
金牌会员
      永远的学习者
积分 3105
发帖 1276
注册 2008-3-8
状态 离线
|
『第 32 楼』:
使用 LLM 解释/回答一下
请测试我28楼的代码以及修改后的25楼代码。
Last edited by zw19750516 on 2008-7-9 at 11:25 PM ]
Please test my code on floor 28 and the modified code on floor 25.
Last edited by zw19750516 on 2008-7-9 at 11:25 PM ]
|

批处理之家新域名:www.bathome.net |
|
2008-7-9 23:24 |
|
|
quya
高级用户
    五星老土
积分 558
发帖 172
注册 2003-2-9 来自 江苏
状态 离线
|
『第 33 楼』:
使用 LLM 解释/回答一下
又经过多次测试.
发现如下规律:
在代码页 936下 运行正确, 运行一遍之后代码页变成 437, 之后结果就不正确, 有很多地方都不正确包括我上面提到的.
有人分析下原因并提高兼容性吗? 这个问题我自己都觉得太变态了.
After multiple tests again.
The following pattern is found:
Under code page 936, it runs correctly. After running once, the code page becomes 437, and then the result is incorrect. There are many places that are incorrect, including those I mentioned above.
Can someone analyze the reason and improve compatibility? I myself think this problem is too weird.
|

我怎么找不到一个比我注册日期早的人? 难道我是传说中的超级管理员? 其实我只是个潜水冠军而已. |
|
2008-7-9 23:31 |
|
|
quya
高级用户
    五星老土
积分 558
发帖 172
注册 2003-2-9 来自 江苏
状态 离线
|
『第 34 楼』:
使用 LLM 解释/回答一下
Originally posted by zw19750516 at 2008-7-9 11:19 PM:
这是因为没及时删除解压后的文件,造成下一次解压不成功,因此每次都是crc32 同一个文件。
ps:25楼代码的问题还是出在expand上面。
Last edited by zw19750516 on 2008-7-9 at 11:28 PM ]
不是, expand 会覆盖原文件. 是代码页的问题.
Originally posted by zw19750516 at 2008-7-9 11:19 PM:
This is because the uncompressed files were not deleted in time, resulting in the next decompression failing. Therefore, the CRC32 of the same file occurs each time.
ps: The problem with the code on floor 25 is still with expand.
Last edited by zw19750516 on 2008-7-9 at 11:28 PM ]
No, expand overwrites the original file. It's a code page issue.
|

我怎么找不到一个比我注册日期早的人? 难道我是传说中的超级管理员? 其实我只是个潜水冠军而已. |
|
2008-7-9 23:32 |
|
|
bat-zw
金牌会员
      永远的学习者
积分 3105
发帖 1276
注册 2008-3-8
状态 离线
|
『第 35 楼』:
使用 LLM 解释/回答一下
老土测试了我修改后25和28楼的代码吗,有个还是刚修改的,真的是人老了,好粗心的,总写错。
Lao Tu tested the code in floors 25 and 28 that I modified? There's one that was just modified. Really, as one gets old, one is so careless and always makes mistakes.
|

批处理之家新域名:www.bathome.net |
|
2008-7-9 23:35 |
|
|
quya
高级用户
    五星老土
积分 558
发帖 172
注册 2003-2-9 来自 江苏
状态 离线
|
『第 36 楼』:
使用 LLM 解释/回答一下
Originally posted by zw19750516 at 2008-7-9 11:35 PM:
老土测试了我修改后25和28楼的代码吗,有个还是刚修改的,真的是人老了,好粗心的,总写错。
28楼刚才测试错误
25楼现在和7楼结果一样, 就是不知道那个效率高.
但只能在代码页 936 下正确, 以前不成功是在 代码页 437下.
所以在批处理行首只能暂时加 CHCP 936 来确保正确运行, 因为用过一次之后就是 437.
这个crc32.com 其他都好, 最欣赏它的就是不到1KB, 可惜会改变代码页. 鱼和熊掌不可兼得啊.
Originally posted by zw19750516 at 2008-7-9 11:35 PM:
Old Tu tested the code I modified on floors 25 and 28, there is still one that was just modified. Really, as one gets old, one is so careless, always making mistakes.
The test on floor 28 was wrong just now.
Now floor 25 is the same as floor 7, just don't know which one is more efficient.
But it can only be correct under code page 936. It didn't work before under code page 437.
So at the beginning of the batch line, we can only temporarily add CHCP 936 to ensure correct operation, because after using it once, it becomes 437.
This crc32.com is good in other aspects, the most admired thing is that it is less than 1KB, but it will change the code page. You can't have both fish and bear's paws.
|

我怎么找不到一个比我注册日期早的人? 难道我是传说中的超级管理员? 其实我只是个潜水冠军而已. |
|
2008-7-9 23:42 |
|
|
bat-zw
金牌会员
      永远的学习者
积分 3105
发帖 1276
注册 2008-3-8
状态 离线
|
『第 37 楼』:
使用 LLM 解释/回答一下
如25楼现在结果完全正确,那么开始就是expand的问题,开始我是照抄你的expand %%~fsi,现在改成了expand "%%i",28楼我再看看,至于效率和7楼根本没法比,因为7楼是直接利用的已生成的crc.txt。
If the result at floor 25 is completely correct now, then it starts with the issue of expand. Initially, I copied your expand %%~fsi exactly, and now I have changed it to expand "%%i". I'll take a look at floor 28 again. As for efficiency, it's completely incomparable with floor 7 because floor 7 directly uses the generated crc.txt.
|

批处理之家新域名:www.bathome.net |
|
2008-7-9 23:47 |
|
|
quya
高级用户
    五星老土
积分 558
发帖 172
注册 2003-2-9 来自 江苏
状态 离线
|
『第 38 楼』:
使用 LLM 解释/回答一下
Originally posted by zw19750516 at 2008-7-9 11:47 PM:
如25楼现在结果完全正确,那么开始就是expand的问题,开始我是照抄你的expand %%~fsi,现在改成了expand "%%i",28楼我再看看,至于效率和7楼根本没法比,因为7楼是直接利用的已生成的crc.txt。
25楼以前我在代码页437下运行了, 后来我发现代码页的问题再重新去运行的. %%~fsi 兼容性绝对比 %%i 好, 这应该不容怀疑.
7楼的改进代码在24楼, 我觉得24楼的代码效率要高, 因为用了很多变量来代替FOR 和FINDSTR 语句.
Originally posted by zw19750516 at 2008-7-9 11:47 PM:
If the result in floor 25 is completely correct now, then it starts with the issue of expand. Originally, I copied your expand %%~fsi, and now I have changed it to expand "%%i". I'll take a look at floor 28 again. As for efficiency, it can't compare with floor 7 at all because floor 7 directly uses the generated crc.txt.
Floor 25, I ran it under code page 437 before. Later, I found the issue with the code page and re-run it. %%~fsi has absolutely better compatibility than %%i, which should not be doubted.
The improved code in floor 7 is in floor 24. I think the code in floor 24 is more efficient because many variables are used to replace FOR and FINDSTR statements.
|

我怎么找不到一个比我注册日期早的人? 难道我是传说中的超级管理员? 其实我只是个潜水冠军而已. |
|
2008-7-9 23:52 |
|
|
bat-zw
金牌会员
      永远的学习者
积分 3105
发帖 1276
注册 2008-3-8
状态 离线
|
『第 39 楼』:
使用 LLM 解释/回答一下
再来:
@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%a in (2.txt) do (
if /i "%%~xa" equ ".cat" (
for /f "tokens=2" %%b in ('crc32 %%~fsa') do set str=%%b
) else (
expand "%%a" %temp%\oembios.cat
for /f "tokens=2" %%b in ('crc32 %%temp%\oembios.cat') do set str=%%b
)
for /f "tokens=1,2" %%c in (1.txt) do if "!str!" equ "%%d" echo %%c %%a %%d
if exist %temp%\oembios.cat del /q /f %temp%\oembios.cat
)
pause>nul
Again:
@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%a in (2.txt) do (
if /i "%%~xa" equ ".cat" (
for /f "tokens=2" %%b in ('crc32 %%~fsa') do set str=%%b
) else (
expand "%%a" %temp%\oembios.cat
for /f "tokens=2" %%b in ('crc32 %%temp%\oembios.cat') do set str=%%b
)
for /f "tokens=1,2" %%c in (1.txt) do if "!str!" equ "%%d" echo %%c %%a %%d
if exist %temp%\oembios.cat del /q /f %temp%\oembios.cat
)
pause>nul
|

批处理之家新域名:www.bathome.net |
|
2008-7-9 23:55 |
|
|
bat-zw
金牌会员
      永远的学习者
积分 3105
发帖 1276
注册 2008-3-8
状态 离线
|
『第 40 楼』:
使用 LLM 解释/回答一下
Originally posted by quya at 2008-7-9 23:52:
25楼以前我在代码页437下运行了, 后来我发现代码页的问题再重新去运行的. %%~fsi 兼容性绝对比 %%i 好, 这应该不容怀疑.
7楼的改进代码在24楼, 我觉 ...
老土你有没仔细看下24楼的代码,整体就只是个生成crc.txt的代码啊,根本没涉及到比较!
Originally posted by quya at 2008-7-9 23:52:
I ran it under code page 437 before floor 25. Later I found the problem with the code page and ran it again. %%~fsi is definitely more compatible than %%i, which should not be doubted.
The improved code on floor 7 is on floor 24. I think... Old man, did you carefully look at the code on floor 24? The whole thing is just a code to generate crc.txt, and it doesn't involve comparison at all!
|

批处理之家新域名:www.bathome.net |
|
2008-7-9 23:58 |
|
|
quya
高级用户
    五星老土
积分 558
发帖 172
注册 2003-2-9 来自 江苏
状态 离线
|
『第 41 楼』:
使用 LLM 解释/回答一下
我有5个命令行下的CRC检测软件, 2个40多K, 1个19K, 1个 15K. 一个 1K.
因为1K的这个程序是用在纯DOS下的, 在32环境下支持不好, 会改变代码页等, 所以只好用 %%~fsi 来获取路径.
开始我不想用它的, 我想用15k那个, 但是 15K那个程序奇怪得不得了.
我 CRC32 >result.txt 无法得到结果, 依然显示在屏幕上, 用 1>result.txt 也不行, 不知道大家之前碰到过这样的命令行程序吗? 我反正是第一次遇到.
I have 5 command-line CRC check software, 2 are over 40K, 1 is 19K, 1 is 15K, and 1 is 1K.
Because the 1K program is used in pure DOS and has poor support in 32-bit environments, changing the code page, etc., so I have to use %%~fsi to get the path.
At first I didn't want to use it, I wanted to use the 15K one, but the 15K program is extremely strange.
I can't get the result when I do CRC32 >result.txt, it still displays on the screen, and using 1>result.txt doesn't work either. I wonder if you guys have encountered such a command-line program before? I'm just encountering it for the first time.
|

我怎么找不到一个比我注册日期早的人? 难道我是传说中的超级管理员? 其实我只是个潜水冠军而已. |
|
2008-7-9 23:59 |
|
|
quya
高级用户
    五星老土
积分 558
发帖 172
注册 2003-2-9 来自 江苏
状态 离线
|
『第 42 楼』:
使用 LLM 解释/回答一下
Originally posted by zw19750516 at 2008-7-9 11:58 PM:
老土你有没仔细看下24楼的代码,整体就只是个生成crc.txt的代码啊,根本没涉及到比较!
这就是他的高明之处, 你再看看, 绝对运行准确.
他用 not defined 来检测变量的. 也就是变相的比较.
39楼代码还是不行, 和28楼一样, 提示命令语法不准确.
Last edited by quya on 2008-7-10 at 12:04 AM ]
Originally posted by zw19750516 at 2008-7-9 11:58 PM:
Lao Tu, have you carefully looked at the code on floor 24? The entire thing is just a code to generate crc.txt, and it doesn't involve comparison at all!
This is his cleverness. Take another look, it's definitely running accurately.
He uses not defined to detect variables. That is, a disguised comparison.
The code on floor 39 still doesn't work, the same as floor 28, prompting that the command syntax is incorrect.
Last edited by quya on 2008-7-10 at 12:04 AM ]
|

我怎么找不到一个比我注册日期早的人? 难道我是传说中的超级管理员? 其实我只是个潜水冠军而已. |
|
2008-7-10 00:01 |
|
|
bat-zw
金牌会员
      永远的学习者
积分 3105
发帖 1276
注册 2008-3-8
状态 离线
|
|
2008-7-10 00:03 |
|
|
quya
高级用户
    五星老土
积分 558
发帖 172
注册 2003-2-9 来自 江苏
状态 离线
|
『第 44 楼』:
使用 LLM 解释/回答一下
Originally posted by zw19750516 at 2008-7-10 12:03 AM:
试试crc32>result.txt看,要不就>result.txt crc32
都试过了, 绝对是世间少有的怪程序.
你不信到我 FTP://quya.2mydns.com/crc32.exe 下载试试看.
注意我电脑关了, 我的FTP也没有了.
Last edited by quya on 2008-7-10 at 12:09 AM ]
Originally posted by zw19750516 at 2008-7-10 12:03 AM:
Try crc32>result.txt, or >result.txt crc32
Tried both, it's definitely an extremely strange program.
If you don't believe it, go download it from my FTP://quya.2mydns.com/crc32.exe .
Note that my computer is off and my FTP is also gone.
Last edited by quya on 2008-7-10 at 12:09 AM ]
|

我怎么找不到一个比我注册日期早的人? 难道我是传说中的超级管理员? 其实我只是个潜水冠军而已. |
|
2008-7-10 00:08 |
|
|
bat-zw
金牌会员
      永远的学习者
积分 3105
发帖 1276
注册 2008-3-8
状态 离线
|
『第 45 楼』:
使用 LLM 解释/回答一下
Originally posted by quya at 2008-7-10 00:01:
这就是他的高明之处, 你再看看, 绝对运行准确.
他用 not defined 来检测变量的. 也就是变相的比较.
39楼代码还是不行, 和28楼一样, 提示命令语法 ...
是不是我的眼睛出了问题,我把24楼的代码看了n次,就是没看到一个defined,老土,你是不是再看一下啊。
Originally posted by quya at 2008-7-12:
This is his clever place, take a look again, it will definitely run accurately.
He uses not defined to detect variables. That is, a disguised comparison.
The code on floor 39 still doesn't work, the same as floor 28, prompting command syntax...
Is there something wrong with my eyes? I've looked at the code on floor 24 many times, but I didn't see a single defined. Old-timer, can you take a look again?
|

批处理之家新域名:www.bathome.net |
|
2008-7-10 00:09 |
|