Computer Science (intelligence Central)

Discussion in 'Taylor's Tittle-Tattle - General Banter' started by SkylaRose, Apr 25, 2023.

  1. SkylaRose

    SkylaRose Administrator Staff Member

    History of Computer Science

    Charles Babbage draws up plans for the first "computer" (made of cogwork, iron and steam. It is named the Difference Engine.
    Plans for the Difference Engine are scrapped due to cost and time, so Babbage begins to work on the Analytical Engine, which would be "programmable". Lots of designs are mocked.
    Babbage shows of a small prototype of the Analytical Engine at a small science fair. Ada Byron attends along side her mother to continue her passion for science and mathematics.
    Ada Byron is enthralled by the machine and spends many hours speaking to Babbage about his ideas, she lends her own ideas and he is very impressed.
    Ada Byron takes the detailed notes (written in Itallian) and translates them to English, adding a massive amount of her own notes and correcting a lot of Babbages.
    Babbage works with Byron to perfect the design. Byron uses her skills in advanced Mathematics to produce an algorithm written on punch cards to calculate Bernoulli Numbers using a process that Looms used.
    Byron's algortithm contained variables and a loop and is considered the world's first computer program.
    Babbage continues to work with Byron, adding more notes and perfecting her algorithm. They keep in touch via letters as Byron marries later on to Noel King of Lovelace, making her the Countess of Lovelace.
    She has four children, but still continues to work on mathematics and science. She never see's the Analytical Engine prove her theory correct, passing at the age of 38 of Cancer.
    Babbage also passes before the Engine is created.

    To be continued...
     
    hornmeister likes this.
  2. SkylaRose

    SkylaRose Administrator Staff Member

    I will begin a short series of how a video game is created from the ground up. Since Warewolf is a popular game on this forum, this would be a good one to use. I will post completed source code files as they are developled. Purpose of this being for anyone who wants to know what goes into making even a basic game a bit harder than tic-tac-toe. Probably start this next week sometime, but for now here are the prerequisites for the game, which list the software used to create it, and the hardware it will be able to run on.

    Warewolf Video Game - Part One.

    Prerequisites

    Main Language Used: Ada 2021
    IDE Used: GNAT Studio Pro Edition 2021
    Debugger Used: GDB (basic version)
    Compiler Used: GCC (nightly build)
    Other Languages Used: None
    Build: 1.0
    Target(s): x86 Win
    Programmer: Skyla Rose
    Game Control: Mouse/Keyboard
     
  3. SkylaRose

    SkylaRose Administrator Staff Member

    Each source file (file that contains executable code) needs to be defined to a specification document. This is generally made by the creator or a customer. In the case of Warewolf, all source files are unique and bound to one file - the executable. Ada (and almost all modern languages) begin execution with the Main function. This is the only file the Operating System will read and execute when the program is running.

    Code:
    with Villager;
    with Wolf;
    
    procedure Warewolf_Game is
    
    begin
       --  Insert code here.
       null;
    end Warewolf_Game;
    In this file, two packages are called. "Villager" and "Wolf". These packages act as blue prints for what each 'object' will look like, how it will behave and if and when it can be removed. In Ada, a package contains two primary files. Spec File and Implement File. A spec file (.ads) holds no execuatable code (apart from major things such as access types) and holds the blue print for the object. The implement file holds the executable code that makes the object work, using the blue print file. For example, here is the start of the Villager.ads file:

    Code:
    package Villager is
    
        type Village_Human is record
         
          Villager_Name : String(1 .. 15);
          Villager_Gend : String(1 .. 2);
          Villager_Role : String(1 .. 51);
         
          Hunger_Lvl : Float range 0.0 .. 100.00;
          Sanity_Lvl : Float range 0.0 .. 100.00;
         
       end record;
       
       villagehuman : Village_Human;
       
       -- specifications
       procedure Setup_Villager(villagehuman : Village_Human);
    
    end Villager;
    I will not go into detail of what every line does, but the main point is the Villager pacakge is contained within a Record. A Record is very similar to a Class in Java/C++ and a Struct in C. It has a defined name and an ending statement.
     
  4. SkylaRose

    SkylaRose Administrator Staff Member

    Continued...

    • Nothing is really done with anything for another 100 or so years, seems like their work ethos has been lost to time.
    • The "idea" of a computer could advance from clockwork and looms did not happen until 1936 when Alan Turing wrote several papers on how computers could one day be a modern marvel.
    • Turing continued his research into what a computer could possibly do, and happened to stumble on Lovelace's notes (several are in the National Science Museum) which explained the concept of an algorithm. At first, the notes only had the initials AAL which back then, nobody knew who that was. It was later discovered that AAL stood for Augusta Ada Lovelace, and she was given the title of world's first programmer through the discovery of her notes on Babbage's Analytical Engine.
    • He created a theory known as the Turing Test, which meant if a human could not tell if they were against a machine or a human, the machine had past the test. Turing was a master at mathematics and science and even aided in cutting the length of World War Two down by two years. Turing continued publishing papers on the theory of a computer and how it related to science and maths.
    • In 1941, Konrad Zuse created the first mechanical computer and program that could produce a result, it was called the Z3, and continued the thought process of Babbages's machine by using punch cards to output a result onto fibre film.
    • ENIAC was formed shortly after, and the first "paid" programmers came into existence. Working with Zuse's algorithm, and Turings findings, they developed a way to manipulate how a computer could operate by giving it basic instructions.
    To be continued...
     
  5. Bwood_Horn

    Bwood_Horn Squad Player

    Very thought provoking ad - I have always been amazed with the sheer amount of 'stuff' that people post about their kids.

     
  6. GarbeliaHornet

    GarbeliaHornet Academy Graduate

    A decent rule to remember using the internet is that absolutely everything you share, even in private messages that haven't been end-to-end encrypted will be in the public domain, so can and most likely will be used for advertising profiles, LLM and generative AI datasets and is available for use by any random person or company, for any purpose.

    If you are happy to make that tradeoff, then each to their own, but don't make that decision for your children before they can understand the dangers of it.
     
    SkylaRose likes this.
  7. SkylaRose

    SkylaRose Administrator Staff Member

    Good points. I think this is another reason why VPN's are getting a lot of interest nowadays more than they did before. Any legal and well secured way to protect your data is more important now and just as important as safety online. A lot of people use some very secure browsers (in my line of work we have to) and even top Ad blockers like Total AV are well worth the investment. I used to use IE6 years ago until I found out what a total load of malware crap it was. To be fair to Microsoft though, Edge is a lot better but still has it's issues. Chrome is just a mess with Google refusing tio patch the issues, and Firefox while pretty stable still has breaches. Nobody can ever make software 100% jailbreak proof, but the more safeguards we put in place, and the more we take the risks seriously, we will have a less paranoid mindset of the technology we use.
     
    GarbeliaHornet likes this.
  8. SkylaRose

    SkylaRose Administrator Staff Member

    Have you ever tried to play an old game on a high-end PC? For example, Lemmings which was released in the mid 1990's will in fact run on current modern hardware. However, due to Microsoft's lack of complete backwards compatability software (after all, why retain such old outdated drivers and backends) playing the game for a prolonged period will almost certainly result in one of the two possible situations.

    1. CTD
    2. Error Message

    CTD which is geek speak for "Crash to Desktop" will occur if the software illegally attempts to access memory that is not pooled to that area of the game engine. Older computer games back in the day used a lot of very bug-heavy functions such as malloc(), realloc() and free(). Such functions when used correctly, pull memory from available sources and uses them in registers to set a varaible value. However, even when properly coded modern hardware just overrides these requests and gives the calling function a bad return value. This in turn crashes the software (actually Windows terminates the software execution by default as a safety precaution).

    Error Messages, while vaige and somwhat cryptic, the most common one you might see is:

    [16bit Subsystem]
    Cannot free memory

    The reason may seem obvious, but it goes a bit deeper than this. Modern systems use a standard x86bit system. These are massively improved versions of the 32bit kernals. Even still, WIndows 7, 10 and 11 still use a file system known as "System 32". This contains a lot of older legacy DLLs and spools that control the main functions of the Windows Operating System. Since Windows has been around since the late 1980's, Microsoft have never really needed to change the most vital software written that far back. It works, therefore why change it. When a older software system that is smaller than System 32 needs access, it will refuse it point blank, even though some of the Kernal code does have commands for a lower system layout. If it is denied access, it will return a fail state and show the message to the user, followed by closing the application.

    What does tend to confuse a lot of people, is the fact that modern hardware have an average of 8-16 GB of RAM. So, why not just pull some of that into the game when it needs it? Answer being is a process known as FCFS (First Come First Served). Windows boots with a number of memory hungry applications, and most are vital for the life cycle of the computer being turned on. Even if there is a lot of RAM left over after allocating a lot of memory to these applications it is extemely rare that developers of older games thought ahead to ask to borrow such memory from a system that was ahead of it's time (although it does exist). If there is no safe way to retrieve and more importantly, return the pooled memory the request will always fail.
     
    GarbeliaHornet likes this.
  9. SkylaRose

    SkylaRose Administrator Staff Member

    Ok this a bit of an SOS to any fellow programmers who code in Ada or any other language.

    I am currently writing a Ada text book and one of my sample programs does not work properly. It compiles but shows a warning I have literally never seen before in all my years of coding. It's a very simple program that handles a basic Exception.

    Code:
    ----------------------------------------------------
    -- Ada Computer Programming 202X
    -- ============================================
    -- Module: 3 Control and Program Flow
    -- Program: 13 Input Check Algorithm
    -- Author: Rose, Skyla
    -- Date: September 2024
    -- File: Input_Check_Alg.adb
    ----------------------------------------------------
    
    
    with Ada.Text_IO;
    with Ada.Integer_Text_IO;
    with Ada.IO_Exceptions; -- package for I/O exception handling
    
    --
    -- procedure to begin program execution
    --
    procedure Input_Check_Alg is
    
       -- a simple input check algorithm using a basic exception within a base loop
     
       Num : Natural range 0 .. Natural'Last;
      
    begin
       loop
          begin
             Ada.Text_IO.Put(Item => "Enter an integer: ");
             Ada.Integer_Text_IO.Get(Item => Num);
             exit when Num > 0;
      
          exception
             when Ada.IO_Exceptions.Data_Error =>
                Ada.Text_IO.New_Line;
                Ada.Text_IO.Put(Item => "Error: Not an Integer");
                Ada.Text_IO.Skip_Line;
                Ada.Text_IO.New_Line;
          end;
       end loop;
    
       Ada.Text_IO.Put(Item => "Process ended");
    end Input_Check_Alg;
    Basically correct sample runs of the program should do this:

    Code:
    Enter an integer: 15
    Process ended
    
    Enter an integer k
    Error: Not an Integer
    Here is the warning from my compiler:

    Code:
    Build Output ::
    gcc 3.0 Input_Check_Alg.adb
    [ada] Errors: 0
    Warnings: 1
    [-wall]left of object 'exception' cannot be evalutaed
    Other: 0
    Building...
    Build Successful
    Binding...
    Binding Sucessful
    Linking...
    Link Successful
    Compilation Process Completed (c)AdaCore GNAT 2021 Pro Version all rights reserved.
    I know this a shot in the dark, but some of you are fellow coders and just wondering if you have encountered such an error before and what is causing it. I've contacted GNAT and they haven't got back to me as of yet and doubt they will. None of the books I have even mention it.

    I would love any help or advice!

    Thanks guys!
     
  10. UEA_Hornet

    UEA_Hornet First Team Captain

    I don't know the first thing about coding but I asked ChatGPT and it said:

    The warning message you're seeing, "[ada]left of object 'exception' cannot be evaluated", suggests that there might be an issue with the way the exception is being used in your code.

    Upon reviewing your code, it seems there might be a typo. Instead of `Ada.IO_Exceptions.Data_Error`, it should be `Ada.Exceptions.Exception_Name`. In this case, it should be `Ada.Exceptions.Data_Error`.

    You should update the exception handling part like this:

    exception
    when Ada.Exceptions.Data_Error =>
    Ada.Text_IO.New_Line;
    Ada.Text_IO.Put(Item => "Error: Not an Integer");
    Ada.Text_IO.Skip_Line;
    Ada.Text_IO.New_Line;


    This should resolve the warning message you're encountering. If you encounter any further issues, please let me know.


    Curious to know if it knows anything!
     
  11. SkylaRose

    SkylaRose Administrator Staff Member

    Thanks UEA for the advice, but that suggestion from ChatGPT does nothing because it's wrong in suggesting a typo, as the package it suggested is just a short cut way of the same thing I did originally. I'll keep tying things and hope AdaCore get back to me. :)
     
  12. Diamond

    Diamond First Team

    Does this help?

    A get property should never change the state of an object.
     
  13. SkylaRose

    SkylaRose Administrator Staff Member

    That would make perfect sense in a language such as C# as get properties are used to return the value of a given object's function. Get in Ada is bounded to the Text_IO package hence it never directly interacts with objects outside of it's pre-defined scope.

    Thank you for suggesting Diamond, I do appreciate it. No answer from AdaCore as of yet either. I'm thinking it could be a bug in the compiler script.
     
    Diamond likes this.
  14. SkylaRose

    SkylaRose Administrator Staff Member

    Finally got back to me this morning. Seems I was sort of right with the error out of my control. Would again like to thank anyone who has offered advise on this.

    upload_2023-10-14_10-41-22.png
     
  15. SkylaRose

    SkylaRose Administrator Staff Member

    Lol I spot a typo in that! Fire their proof readers!
     
  16. Diamond

    Diamond First Team

    Well I'm up to 5 errors in that. Are you surprised their code is iffy?
     
  17. SkylaRose

    SkylaRose Administrator Staff Member

    Good point. I will say it's the first time I have had a major issue with any of their software so hopefully this is a one off. For what I pay for the license I would expect a flawless product, but having said I work in the same sort of industry and know how easily things can go wrong, as are you no doubt. :)
     
  18. GarbeliaHornet

    GarbeliaHornet Academy Graduate

    Are they selling GCC? I thought the gpl license didn't allow that.
     
  19. SkylaRose

    SkylaRose Administrator Staff Member

    No GCC is freeware, as you said it's under public license. GNAT do two versions of their development suite, one is the CE (Community Edition) which is completely free for hobby programmers and the Pro version which has a yearly cost. Main differences between the two are that the pro version enables you to release software under a distribution copyright and has a few more advanced features such as integrated tooling and internal embedded programming support.
     
  20. SkylaRose

    SkylaRose Administrator Staff Member

    We've just started using a new code editor at SpaceX called "Kate". It's an advanced text editor designed for programming projects and be easily configured to support other languages such as C, C++, Python, R, Rust, Ada, C#, COBOL and Fortran. Colourful interface. For any fellow coders it's worth a look.

    https://kate-editor.org/en-gb/
     
  21. SkylaRose

    SkylaRose Administrator Staff Member

    Got sent this by a fellow C++ developer today. Ha Ha Ha whoever it was. :p

    upload_2023-11-24_19-42-56.png
     
  22. BigRossLittleRoss

    BigRossLittleRoss First Team

    My Dad used to fix the computers at teh Northwood Naval base in the eighties .

    His work brief case comprised of spanners and pliers . Probably won’t be much use with modern day computers.

    As a kid in the 80s we genuinely thought we might get nuked and were made to watch videos of what to do if a bomb hit London or Northwood as it was a major target . The general gist of the video was we had to hide underneath our desk to protect us from the 800 mph winds and secondary heat wave .

    When I asked my Dad what would happen if HMS Northwood got nuked his quote was “ well son , I’ll be alright as they have a nuclear bunker at Northwood . However you and your sister and brother will fry to a crisp “

    Sounds cruel I know but he was a beautiful man , and was very funny at the time .
     
    SkylaRose likes this.
  23. SkylaRose

    SkylaRose Administrator Staff Member

    He's probably not wrong about being protected back then. Computer casings (which I gather the spanners and pliers were for) were meaty beasts made of very tough plastic. Hunker down under them bad boys and you would probably be safe as houses. :) Looking back at the chucky monitors and Amstrad/Acorn computers of the early 1990s late 1980s, it seemed impossible back then to get away from the "Green Screen" of console's version of "comic sans script" font.

    [​IMG]

    However, this version of an Acorn I always wanted to have. Yellow is very rare.

    [​IMG]
     
  24. BigRossLittleRoss

    BigRossLittleRoss First Team

    I remember him saying the mainframe computer was a size of a room .
     
  25. SkylaRose

    SkylaRose Administrator Staff Member

    Sounds about right as well. Back then processors were very large as well as hard drives. Servers had to be connected via large cables which conducted a lot of heat, especially very large machines. Today you can probably get the same mainframe on an average sized micro, although "Super Computers" still require huge amounts of processing, hence they still scale to size even today. Seen one in action once, amazing piece of hardware.
     
  26. SkylaRose

    SkylaRose Administrator Staff Member

    Warewolf Game Alpha Test.

    Not a lot to show so far as I am still working on the Graphics Engine. But this was my first successful pre Alpha build without the Engine. The space between the === will be where the game world is displayed, as well as action task lists, command input and user interface. Music is a PITA as FMOD and Ada don't play nice but I could sort that towards the end. I'll post updates on the progress of the game when there is more to show.


    Warewolf v1.0 Alpha test run console output
    ===============================

    Please Enter Either Wolf or Villager: Villager
    Please Enter Character Name: Burnsy

    You have chosen to be a Villager. Please specify the total number of people within the village excluding yourself: 10

    Hello Burnsy. Which role do you wish to play?

    a) Seer
    b) Guardian
    c) Mason
    d) Traitor
    e) Standard Villager

    :> S

    You have chosen to be standard villager. In this role, you can assign yourself a daily task. Please enter your preferred task.

    :> Blacksmith

    Connecting to Warewolf_Engine.ads...failed. Cannot open or find defined directory
    Setting Up Scene....done
    Generating World Space...done
    Setting Up Day One...done
    Assigning Wolves to CPU...done
    Reading Wolves and NPC A.I and Writing to file...done
    Assigning Other 10 Villagers Roles to NPC's...done


    DAY ONE SCENE ONE
    ==========================================================================





    ==========================================================================
     
    wfc78 likes this.
  27. SkylaRose

    SkylaRose Administrator Staff Member

    Bit sad I still use Windows Vista in 2024....

    upload_2024-1-11_0-45-0.png
     
    hornmeister likes this.
  28. hornmeister

    hornmeister Tired

    She doesn't look very impresed with you.
     
    SkylaRose likes this.
  29. SkylaRose

    SkylaRose Administrator Staff Member

    I know. She keeps asking me to switch to Windows 11. But the screen shot is from my work rig not my gaming one. I would love to upgrade it but the problem is (like so many companies of the past) we rely on software running that uses older kernals. Some of the applications I write need to execute even on 32bit systems. Technology may move quickly, but the rush to upgrade to the new thing is painfully slow.
     
  30. hornmeister

    hornmeister Tired

    I have an old Windows XP computer tha tis saved exclusively to run "TopDraw" a super simple little shareware vector based drawing package that for the life of me I can't get to run on anything later. You know the type that insists on filenames of no longer than 8 characters a dot and 3 characters. It's piss easy to use and does everything I need for diagrams etc. I've never found anything that comes close.
    https://www.pcorner.com/list/DPGRAPH/TOPDRAW.ZIP/INFO/

    Oh the PC is also is able to rip CDs with anti ripping technology (mainly Sony/Columbia). I assume the technology is too advanced for it to work on the out of date kit.
     
    Last edited: Jan 11, 2024
    SkylaRose likes this.
  31. SkylaRose

    SkylaRose Administrator Staff Member

    Considering TopDraw was written in 1993 I applaud you for getting it to run on Windows XP (2001) almost a decade old software built for Windows 3.1 and probably DOS. I know what you mean about the filenames, some of the restrictions are/were very tight and whereas nowdays it's possible to turn a .txt file into a .pdf file by mearly chaging the extension shows just how far even that feature has come (however doing so is mainly pointless unless the file can be read by a PDF Viewer and a text editor, but the option is there all the same).

    Have you tried messing with the "program compatable" features on newer versions of Windows to see if it runs? I am sure you are aware it's possible to make even a Windows 10 PC act like a Windows XP machine. Problem being, the changes it makes are very marginal and software that old (I still use AdaGide which was relelased in 1995) will never run a full spec even on the lowest settings. Not sure why they never brought out a more up=to-date version of it.
     
  32. hornmeister

    hornmeister Tired

    Yep had a frustrating day once trying to get it going. Gave up when virtual machines were the only remaining option.
     
    SkylaRose likes this.
  33. SkylaRose

    SkylaRose Administrator Staff Member

    So I've been working on a programming text book in spare time. I've designed the front cover art and wanted to know what you guys thought? It's not final yet and might be changed but for an initial idea I really like it. White lines are intentional, part of the "look".

    I'm hoping to have it finished, proof read (including sample programs tested and debugged) by the end of 2025, As the new Ada Standard is due for release in early 2027.

    upload_2024-3-21_18-56-6.png
     
  34. Keighley

    Keighley First Team

    At the risk of stating the obvious, do you use ‘have’ instead of ‘of’?

    The cover is good! Don’t think the title actually needs a full stop, though.
     
  35. SkylaRose

    SkylaRose Administrator Staff Member

    Not sure page by page, but I am sure that is something the proof readers can get around to closer to the end product. As I typed each chapter I used Microsoft Word's spelling and grammar checker, so if there is an issue, it's possibly down to American English and Standard English translations, But I did explicitly make sure "Colour" was not spelt "Color" (although this is unavoidable in language syntax :)

    Thank you for your feedback - appreciated.
     

Share This Page