Interesting Factoid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amtrak115
    Senior Member

    • Oct 2005
    • 289
    • Parker, TX
    • General

    #1

    Interesting Factoid

    Hey Folks,

    Interesting Factoid.....

    While working on Activity Editor, I was looking at the STFReader Code. Since the STFReader is format Agnostic, you have to look at where the calls for the reader is....so more code mining....
    I then decided to look at the file it was trying to read and in this case it's a Route's .TRK file. so I wrote a little code to basically parse the .trk file. after several hours trying to figure out why what I was seeing in the code (that I wrote) vs what was literally in the .trk file. I came across a interesting factoid.....Windows 10/11 and maybe an earlier version, but I know it's true for 10 and 11 are 64bit OS's. and because they are are 64 bit code the size of a word doubled in size. so to store a character from a text file it uses 16 bits vs 8 bits. All asci chars can be store in 8 bits....so what's in the other 8 bits ....0's.... essentially there is a null char. in every work that used to store a character, Now I'm using a tool called Visual Foxpro to do some prototyping. VFP is long out of date, and it's really a 32 bit software package that Microsoft dumped many years ago. but I'm pretty efficient in writing VFP code, and it's a object oriented language so I have to define classes similar to what's in C#. So I wrote a piece of code to parse the .trk files...The first thing I did was stripped out all the null characters in the file. then I wrote the file out as a .txt file and compared the two in notepad++. What's displayed is exactly the same. however the attached picture shows what happens when you strip out the nulls.....the file size drops in half. so I copied one of my .txt files into the route director backup the original .trk and renamed my .txt to .trk and started OR....no issues

    just a little factoid.... ztrack.jpg
    Attached Files
  • pwillard
    3000 Post Veteran



    • Nov 1999
    • 3070
    • Cumming Ga
    • ORTS

    #2

    The year is 2005...

    Marketing Guy #1: "How can we get them to buy more hard drives and RAM?"

    Marketing Guy #2: "I have an idea..."
    http://www.railsimstuff.com
    Just Blender now, 3DCrafter only when I have to.
    Formerly The Keystone Works (All Permissions Granted)
    Things I work on: https://github.com/pwillard

    Comment

    • c44d9w
      Member
      • May 2010
      • 58

      #3
      This is about character encoding to support many languages, and specifically about unicode. It has little to do with the memory architecture (8, 16, 32 or 64 bit words).

      Microsoft chose UCS2 when adding support for more languages. Later unicode defined UTF16LE, which is compatible with UCS2. Here is a bit of history.

      Today's choice is UTF-8, which uses 8 bits for ASCII characters, 16 or 32 bits of international characters. It is efficient for coding (mostly in English), but supports any language.

      Comment

      • amtrak115
        Senior Member

        • Oct 2005
        • 289
        • Parker, TX
        • General

        #4
        I think that Pete hit that nail right on the head. When I started programing, efficient use of memory or disk space was an objective. today's with prices of hard drives (the spinning things not the Solid State thingies..) falling, file space is cheap. I just bought 8 Terrabytes of hard drive space for less than $100. SSD prices are going (in my opinion) to start going up. mainly because memory prices are rising faster and faster because Major Tech companies are building AI data centers.

        another thought. I help develop an AI system back in the mid-80's. this system was written in ....wait for it........BASIC. It was an application for the military to predict when adversaries were doing exerrcises, base on observations of activities. The concern at the time was that a lot of "old" analyst were about to retire, and they wanted to "capture" their knowledge....Basically if you see this...and this...and this....something is happening here. a machine that could assist future analyst by assisting them with the old analyst thought processes...AI....

        think about that. that was almost 50 years ago.....

        Comment

        Working...