谦卑的程序员






         静水流深

June 20, 2008

开源DOS模拟器 - DOSBox

Filed under: 1.9 操作系统 — Eric Tou @ 5:57 pm
Tags: , , , , , , , ,

    As a relatively early computer user, I start my adventure from MS-DOS. About DOS, there is a kind of feeling mixed with love and hate, I love the command line, but remember the Config.sys and Autoexec.bat? remember the Emm386.exe? remember ‘DOS = High, Umb’? remember everything we did for one more kb additional memory to run a … Turbo C compiler?
    OK, that’s not true, I seldom run it now, that was what I usually do when I was in university. Currently I only use DOS to run the old games only support DOS. You may say i am going farther from the programming things. But the command line, the config files (and Quick Basic) could be the beginning of a programmer.

    How about you? Still have a old DOS installation on your disk? Or, have a virtual machine of DOS? As a programmer, you did better. But may I ask a question? Do you still have a floppy driver and How can you find the damn installation floppy? You use image files and floppy simulator? Yes you do it better and better.
    If you want to go through this way, you can get FreeDOS, a open source, free DOS-compatible operating system for IBM-PC compatible systems.
    You can install in on you hard disk, or use a PC emulator (Virtual Machine software) to install FreeDOS. You can find PC emulators for all computer platforms (Windows, Linux, Mac.) You can even run FreeDOS using a PC emulator written in Java : JPC, right in your web browser! Cool, we will talk about it later.

    Now let’s get back to the point. Don’t you think it’s troublesome? Try DOSBox, It support Windows, Linux, Mac. You can easily install it as a programe on you desktop, get a command line window after ran it, and then run the game in the window, don’t need to care about the memory things any more.
    You can get a portable release at PortableApps.com.

    I even have DOSBox installed on my PSP Slim (PSP 2000), It means I can play old DOS game on my PSP. Someone even installed the Win 3 and Win9x on the DOSBox hosted at PSP Slim. I guess I used too many EVEN. Do some search work you can find the informations.

May 7, 2008

案例 - (批处理)以日期为文件名创建文件

Filed under: 未分类 — Eric Tou @ 4:04 pm
Tags: ,

  一个同事问我:“怎样以日期为文件名创建文件,用任何编程语言,然后每天自动运行(在Windows上)”
  我不认为我们需要Java,C#之类的语言,一个批处理文件加上计划任务就能解决问题。

  制定路线后,需要做的就是Google查询。问题是你如何选择你的关键字,我的关键字是”dos create file name by date”,得到的结果在.

  最终的代码如下:

    set yymmdd_hhmmss=%date:~12,2%%date:~4,2%%date:~7,2%_%hh% %time:~3,2% %time:~6,2%
    copy nul %yymmdd_hhmmss%.txt

  以上代码会在当前目录下创建一个以当天日期命名的文本文件,再加上计划任务,就能每天创建该文件。看上去很简单不是么?

  但是你在中文的Windows上测试过么?得到什么样的结果?

  好吧,本文的重点不是怎么写这个批处理文件。重点在于当你在不同的语言平台上工作时,语言确实是有关系的因素,你必须对此加以关注。

WPMU Theme pack by WPMU-DEV.