Full Transcript

Moore’s Law CPUs - Moore’s Law - Gordon Moore (Intel co-founder) observed that the number of transistors in a circuit doubles about every two years. This became known as “Moore’s Law” - A colleague at Intel estimated computing “power” increased even more rapidly, approximately doubl...

Moore’s Law CPUs - Moore’s Law - Gordon Moore (Intel co-founder) observed that the number of transistors in a circuit doubles about every two years. This became known as “Moore’s Law” - A colleague at Intel estimated computing “power” increased even more rapidly, approximately doubling every 18 months - So… - In 3 years, CPUs will be 4 times more powerful - In 15 years, CPUs will be 1000 times more powerful Email Email - Electronic mail; a system for sending and receiving messages over the internet - An asynchronous means of communication - Necessary to know the address of the recipient in order to send an email message Email - history - 1960s: initially, people would leave messages for each other on a mainframe - However, there was no way to send people messages to people using other mainframes - 1969: ARPANET connected mainframes together, providing the foundation for email - 1972: Ray Tomlinson sends the first email, with addresses using the @ symbol - 1976: email makes up 75% of ARPANET’s traffic Email - addresses - [email protected] - Tracy.maniapoto is the local part of the address, often a username - @auckland.ac.nz is the domain name of the email server Email - protocols - Protocol: a standard for communicating - These email protocols are used by email clients (eg. Outlook, Apple Mail) to send and receive email - Webmail services such as Gmail and Hotmail use the same protocols SMTP - Simple Mail Transfer Protocol: - Used to send emails from an email client via the email server POP3 - Post Office Protocol v3: - Emails downloaded from the server to the email client. Emails are then deleted from the server - No internet connection needed to read downloaded messages - Disadvantages: - If messages are deleted in the email client, then they are lost forever - Difficult to access your email from different devices IMAP - Internet Message Access Protocol: - Downloads a copy of emails to the email client and keeps emails on the server - Emails can only be read when online, although most email clients can store a copy for offline access - Provides other helpful features such as folders - Designed to allow users to access their emails from multiple devices Email - composing Email - Privacy - Email is not a very secure means of communication - Can be read in transit - Can be read by the mail server administrator or stolen from the mail server - Email in employment - Generally, employers reserve the right to read your emails on the company’s email system - Making email more secure - Email encryption tools such as PGP - Some email clients have encryption functionality - Keep your account details secure and use 2FA Email - Spam - Unsolicited, bulk email containing promises of money, fame, free prizes etc. - Name comes from the Monty Python Spam - A major problem; in 2010, approx. 80% of emails were spam - Some spam emails contain attachments or links that can infect a computer with malware - Most email providers have spam filters that divert spam emails to the junk folder - Unsolicited Electronic Messages Act 2007 - Aim: reduce the harm caused by spam, require an unsubscribe feature and deter people from sending spam - The Act regulates commercial electronic messages; any message that promotes a good or server - Electronic message is any message sent using a telecommunications service (eg. email, fax, txt) - The Act applies to anyone who lives or does business in NZ - The Act prohibits: - Sending an unsolicited commercial electronic message with a NZ link - Sending a commercial electronic message without sender information - Sending a commercial electronic message without an unsubscribe function - Penalties include: - Fines of up to $20000 - Payment of compensation to people affected by the spam - Inbox Zero - A smart way of managing your email - More productive - Reduces stress Email - Etiquette - Managing expectations with sending and receiving email communications - Consider the communication preferences of the email recipient - Use “Delay Delivery” function to schedule sending emails at different times Wikis Wikis - A set of public web pages that can be edited by anyone, which encourages collaboration - Can also have private wikis that can only be edited by authorised people - Created by Ward Cunningham in 1995. Named after the “wiki-wiki” shuttle buses in Hawaii (‘wiki’ means ‘quick’ in Hawaiian) - Wiki pages are written in plain text, with wiki markup used to add formatting (italicise text, add links etc.) Wikipedia - Wikipedia is the best known wiki. Launched in 2001 by Jimmy Wales and Larry Sanger - Today, it has over 6.2 million English articles with around 20000 articles added each month - Funded by grants and public donations - Wikipedia runs on the MediaWiki software platform and is hosted on around 350 servers - Advantages: - Everyone can access and contribute to Wikipedia - Easy to use - Quick to develop material - Enormous amount of topics and information available - Disadvantages: - No direct quality control - Bias in some articles - Information changes rapidly - Vandalism is a real problem Wikipedia - vandalism - Wikipedia has a number of automated and manual systems for addressing vandalism - Bots: vandalism is automatically detected and reverted by a bot called ClueBot NG - Recent change patrol: a group of people monitor the Recent Changes page to modify or remove vandalism - Can also modify or remove edits that don’t meet Wikipedia’s standards - Watchlists: registered users can watch a page that they have created/edited or are interested in, allowing them to watch for vandalism - Reader-reported vandalism: readers can address vandalism by: - Reverting to an older version of the page - Warning the vandal that their actions have been noted - Report the vandal to Wikipedia administration Wikipedia’s Reliability - 2005 study in Nature: experts analysed 42 articles, found the articles had the same error rate as Encyclopedia Britannica - Generally, Wikipedia articles on academic topics are more accurate than articles on pop culture and politics - Wikipedia should be a starting point for research rather than a definitive source of information Encyclopedia Britannica - This popular printed encyclopaedia now only exists online - Articles have generally been checked for accuracy and correctness - Users can’t directly edit the articles but can suggest changes - Britannica runs a Publishing Program, which allows people with expertise in their field to publish articles on Britannica Other wikis - WikiVoyage - Travel guide with entries for countries, cities, areas, sights - Fandom (Wikia) - Collection of Wikis, anybody can create wiki on any topic - Focus on gaming and entertainment topics - ~10 million entries altogether - WikiMapia - Combination of Google Maps and an extra layer of polygons that mark interesting areas, buildings etc. - ~13 million entries - WikiHow - Extensive collection of how-to guides - Article often include media such as photos and videos Wiki markup - headings - Four levels of headings: - =Main heading= - ==Section heading== - ===Subsection heading== - ====Sub-subsection heading== Wiki markup - formatting - Emphasis - ‘’Emphasised Text’’ - Strong - ‘’’Strong text’’’ - Very Strong - ‘’’’’Emphasised and Strong’’’’’ Wiki markup - links - Two kinds of links: - Internal links: used to link to other pages in the wiki - External links: used to link to other webpages - Internal link: - [[name of page]] - [[User:Eye298]] - External link: - URL - http://www.auckland.ac.nz - You can add labels to links so that they’re easier for readers to understand - Internal links: - [[name of page | label]] - [[User:Eye298 | Ewen]] - External links - [URL label] - [http://www.auckland.ac.nz UoA] Wiki markup - lists - Two kinds of lists - Unordered lists: - Use the * character in front of each list item - Use multiple * to create sub-lists - Ordered lists: - Use the # character in front of each list item - Use multiple # to create sub-lists Cloud Computing Cloud Computing: Definition - Cloud computing is a model for enabling ubiquitous, convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications, and services) that can be rapidly provisioned and released with minimal management effort or service Cloud Computing: Characteristics - Resource pooling - Rapid elasticity - Reduced costs - Measured service - Reliability Cloud Computing: Deployment Models - Public cloud → Private cloud → Hybrid cloud Cloud Computing: Service Models - IaaS - Infrastructure as a Service - PaaS - Platform as a Service - SaaS - Software as a Service Virtualisation - Partitioning the resources of a physical system - Key enabling technology of cloud computing - Allows multiple virtual machines to run on the same physical system File Sharing File Sharing - One of the web’s main aims was to help people easily share information - Today, cloud storage (eg. Dropbox, Google Drive is an easy way of storing and sharing files - Peer-to-peer (P2P) networks provide another way of sharing files - P2P networks use the BitTorrent protocol to enable computers to connect to each other and share data - Unfortunately file sharing on P2P networks often used for copyright infringement - Copyright protects an author’s work from being copied without their permission - One of the most famous P2P networks is The Pirate Bay - The Copyright Act 1994, sections 122A to 122U, provides a way for copyright holders to complain about file sharing on P2P networks - Up to three notices are given to the infringer by their ISP in a nine month period - Detection notice - First warning for infringement - Warning notice - Second warning for infringement - Issued at least 28 days after detection notice - Enforcement notice - Final notice for infringement - Issued at least 28 days after warning notice - When an enforcement notice is issued, the infringer can be penalised: - Copyright Tribunal can impose a penalty of up to $15000 - District Court can suspend the infringer’s Internet connection for up to 6 months ASCII ASCII - ASCII = American Standard Code for Information Interchange - Associates English characters with numbers meaning text in documents can be stored as strings of binary - Each ASCII code is 7 bits long, meaning ASCII can represent 128 characters - There are other encoding schemes such as UTF-8 and Unicode - A starts at 65 - a starts at 97 Number Systems Numbers and Computing - Numbers are used to represent all information manipulated by a computer - Computers use the binary number system: - Binary values are either 0 or 1 - We use the decimal number system - 0 to 9 are decimal values How do we represent data in a computer? - At the lowest level, a computer is an electronic machine - Works by controlling the flow of electrons - Easy to recognise two conditions 1. Presence of a voltage - we’ll call this state “1” 2. Absence of a voltage - we’ll call this state “0” - Could base state on value of voltage, but control and detection circuits much more complex - Compare turning on a light switch to measuring or regulating voltage Storing Decimal Numbers in a Computer - Series of dials - Each dial goes from 0 to 9 - Information is stored digitally - Finite number of states - 10 per dial - No in-between states - Decimal number system - 1st dial from right: 10^0 - 2nd dial from right: 10^1 - 3rd dial from right: 10^2 - Etc… Exercises - The following two questions relate to dials that have 10 different states - Given a machine that uses 4 dials, how many different numbers can we represent? - 10000 - If we want to represent 256 different values, how many dials do we need? - 3 dials Health and Technology Health and Technology - Technology has a large impact on our lives, not all of it positive Psychological (Hinengaro) Issues - Distraction - Digital devices are highly pervasive and are demanding of our attention - Cognitively penetrating - Checking - repeatedly accessing your digital device interrupting your current activity - A 2012 study of 777 students at 6 U.S. universities found that - On average a student used a digital device for non-class purposes 11 times during a typical school day - 80% indicated that such behaviour caused them to pay less attention in class and miss introduction - Mood Disorders - Extensive evidence documenting a relationship between depression and technology - Excessive texting, viewing video clips, video gaming, chatting etc - Depression may be transmittable through technological interaction - Consumption of depressing media, particularly movies and music can induce a negative affect - Emotional contagion - Instant gratification - The desire to experience pleasure or fulfilment without delay or deferment - You want it, and you want it now - Always online digital devices have raised the expectation for immediate gratification - E.g. expecting immediate responses to social media posts or texts - Has resulted in - Increased impatience - Unrealistic expectations - “Checking” Social Relationship (Whanau) Issues - Narcissism - Personality trait characterised by a grandiose sense of self-importance - Engage in self-promotion, vanity and superficial relationships - Younger people show a stronger urge to report their activities and believe their social media audience care about them - A 2009 study of 16000 college students in the US found that they scored substantially higher on the Narcissism Personality Inventory than their cohort 20 years ago - Studies have suggested social media exacerbates and even encourages narcissism - Users may tailor their profile pictures, status updates, biographies and even lists of friends in order to appear more attractive - Deficits in Social Skills - Increased interaction with technology as led to a reduction in human interaction - Face-to-face communication skills are negatively affected - Visual cues are an important part of face-to-face communication - Includes facial expression, eye contact, tone of voice, posture, and spatial distance - Need to be able to modify one’s own behaviour in response to the reactions of others - A 2014 study of 105 U.S. children was carried out - 51 children in the test group did not use digital devices for 5 days - only face-to-face communication - 54 children in the control group continued to use their digital devices - Test group recognition of nonverbal competition cues was significantly better than that of the control group Spiritual (Wairau) Issues - Social Comparison - In 2019, a survey of studies found a negative correlation between high social media use and self-esteem - Social comparison was offered as one reason this might occur - Social comparison is a form of self-esteem where our sense of self is influenced by comparing ourselves with other people - Social comparison can boost self-esteem if they are validated online (likes, positive comments, etc) - Social comparison can erode self-esteem for some people if they are not validated - In 2019, Instagram removed ‘like’ counts on posts to remove pressure related to how many likes a post receives Physical (Tinana) Issues - Computer Vision Syndrome - Results from focusing eyes on a computer or other display device for long, uninterrupted periods of time - Symptoms of CVS include - Dry eyes - Blurred/double vision - Eyestrain - Red/irritated eyes - Treatment/Prevention - Proper lighting within computer workstation area - Appropriated screen distance and position - Work breaks - Lubricating eye drops - Hearing Loss - Listening to media through headphones or earbuds for prolonged periods of time at high volume can cause permanent hearing loss - A 2005-2006 study reported that 19.5% American adolescents aged 12 to 19 suffered from hearing loss - An increase of 33% from that reported in 1988-1994 - Some of this increase may be attributable to headphone/earbud usage - Prevention - Lower volume. If other people can hear the music you are listening to it is too loud - Limit exposure. Moderate noise on a regular basis can lead to hearing loss - Occupational Overuse Syndrome - Also referred to as Repetitive Strain Injury (RSI) - Umbrella term for range of conditions characterised by - Muscle discomfort - Aches and pains - Muscle tightness and spasms - Numbness and tingling - Pain may eventually become constant and associated with loss of muscle strength and sleep disturbances - Factors that can lead to OOS developing include - Repetitive movement - e.g. typing - Awkward postures - e.g. sitting at a desk - Poor ergonomics - Psychosocial factors - excessive workload, impending deadlines - Poor work practices - e..g poor time management - There are a number of steps that can be taken to prevent OOS - From a workplace perspective - Design equipment and tasks with people in mind e.g. ergonomic workstations - Pay attention to work environment - e.g. lighting - Train and educate all staff - From a personal perspective - Stop activity when discomfort felt - Maintain correct posture - Take regular breaks - Avoid prolonged, repetitive movement or activity - Manage stress levels - Educate yourself about OOS prevention General Solutions for Healthy Use of Technology - Take breaks both large and small - Moderate your social media presence - Try cutting down the number of posts or status updates you make each day - Are you posting for narcissistic reasons or with communication as a goal? - Give your work or entertainment space an ergonomic makeover - Pay attention to lighting chair, display position etc - Maintain a healthy lifestyle - Make time to maintain real-world relationships Decimal to Binary Conversion Exercises - How many different values can we represent with a byte? - 2^8 = 256 - If we want to represent 30 different values, how many bits would we need? - 2^5 = 32, we need 5 bits Converting binary to decimal - 110 - 1 x 2^2 + 1 x 2^1 + 0 x 2^0 - (1 x 4) + (1 x 2) + (0 x 1) = 6 Exercises - What is the decimal equivalent of 101111? - 1 x 2^5 + 0 x 2^4 + 1 x 2^3 + 1 x 2^2 + 1 x 2^1 + 1 x 2^0 - (1 x 32) + (0 x 16) + (1 x 8) + (1 x 4) + (1 x 2) + (1 x 1) - 47 - What is the binary equivalent of 123? - (1 x 64) + (1 x 32) + (1 x 16) + (1 x 8) + (0 x 4) + (1 x 2) + (1 x 1) - 123 Prefixes Prefixes - A group of 8 bits is a byte - A group of 4 bits is a nibble - Bytes are the common unit of measurement for memory capacity - There are two sets of prefixes - Decimal - Binary Decimal prefixes Binary prefixes Prefixes in Computer Science - Both decimal and binary prefixes are used in Computer Science - Decimal prefixes are preferred because they are easier to calculate, however binary prefixes are more accurate Example - USB drive size - A 247.4 GB hard disk is equivalent to 230 GiB - 247.4 GB = 247.4 x 10^9 - 230 GiB = (247.4 x 10^9) / 2^30 Exercises - Which has more bytes, 1KB or 1KiB? - 1KB = 1000 bytes while 1KiB = 1024 bytes - How many bytes are in 128 MB? - 128 * 10^6 = 128000000 bytes History of Computing Why? - Computers are essential to modern life - Many of the discoveries and decisions made by the pioneers till underpin modern computers - As a CS student you should be familiar with CS history - There are a lot of myths and misinformation about CS history The need for computation - Prior to the industrial revolution there was little need for computation - Celestial navigation tables - Artillery firing tables - Engineering, architecture, insurance, science, manufacturing… Preparing a table - 2 computers perform the calculations - A comparator checks their results - If they agree the table is given to a printer - The printer typesets the table and prints it - The comparator checks the printed tale against the hand made table Charles Babbage - Victorian mathematician and inventor - “By God, I wish these tables could be made by steam” - Decide to build a calculating engine that would use the method of finite differences to solve polynomial equations The Analytical Engine - Architecture similar to modern computer - Could solve any problem, not just polynomials - Could be programmed - Supported branches, conditionals and loops - Never built Ada Lovelace - Lady Ada Lovelace hypothesised in 1842 that charles Babbage’s Analytical Engine could manipulate symbols other than numbers and hence perhaps could compose music or poems - The programming language ADA is named after her - But she did not believe the Engine could think for itself The Universal Machine - Not much happened until WWII - BIGGER need for computation - Artillery firing tables - Aerospace design - Cryptography Alan Turing - In 1930s Alan turing showed that a very simple computer (a Turing machine) could solve any problem that could be described by symbols - During WWII he worked cracking German codes - He worked on the development of the 1st computer that could store a program at Manchester University - Turing was convicted & died by suicide in the 1950s - Turing was pardoned in 2013 The Turing Machine - Alan Turing, 1936 - A simple (hypothetical) computing machine - Could solve any problem for which a program could be written - The basis of all modern computers The Universal Machine - An algorithm describes how to solve an individual decision problem - At this time computers were people - Turning imagined a hypothetical factory filled with floor on floor, rows upon rows of hundred upon hundreds of computers - Each using an algorithm to solve a particular decision problem - Such a factory could in theory solve the decision problem for all conceivable problems - This was the universal machine A Turing Machine - A Turing Machine consists of - An infinite input/output tape divided into cells containing symbols - A read/write head - An internal state - A set of rules Colossus - 1943 First programmable digital computer - Colossus - 10 machines built for Bletchley Park, England to crack German High Command’s Lorenz code - Designed by Tommy Flowers - 1500 valves (vacuum tubes) - TOP SECRET until 1970s - ENIAC in 1945 was publicised as the “first computer” The Stored Program Computer - 1945: John von Neumann - Wrote a report called, First Draft of a Report on EDVAC, on the stored program concept - The basic structure proposed in the draft became known as the “von Neumann machine” (or model) - A memory, containing instructions and data - A processing unit, for performing arithmetic and logical operations - A control unit, for interpreting instructions - input/output (I/O) devices Assembly Languages - Kathleen Booth is recognised as the creator of the first assembly language (1947) - Assembly languages are low-level, human readable programming languages that are turned into machine code by an assembler - As assembly languages are tied to specific computer architectures. And so assembler code is not portable High-Level Programming Languages - Grace Hopper obtained a PhD in mathematics from Yale University - Joined the US Navy in 1943, programming the Mark I at Havard - Hopper created the first compiler in 1952: A compiler - Created first high-level programming language called “Flow-matic” High-Level and Low-Level Programming Language Comparison - High-Level Language - A high-level of abstraction - Relatively easier to understand and maintain code. (Similarities with English) - Easier to learn and so wider range of programmers - A compiler or interpreter is required to execute the program - Portable - Low-Level Language - A low-level of abstraction from machine learning - Relatively more difficult to understand and maintain code. (Similarities with machine code) - More difficult to learn and so smaller range or programmers - An assembler is required to execute the program - Not portable across different architectures Artificial Intelligence What is Artificial Intelligence? - Artificial intelligence is the computational study of structures and processes that support intelligent behaviour - Term first coined in 1956: - Dartmouth Summer Research Project on Artificial Intelligence - Areas of research include - Computer vision - Natural language processing - Robotics - Knowledge-based systems - Machine learning Aims of Artificial Intelligence - Three interrelated aims - Engineering aim - Psychological aim - General/Philosophical aim Engineering Aim - To engineer, or provide computational principles and engineering techniques for, “useful” artefacts that are arguable intelligent - Mechanistics similarity to human or animal minds/brains is not necessary - The artefact may be useful in one of a variety of domains - Industry - Mathematics - Art - Everyday life Psychological Aim - To create computational principles, theories or systems that provide a greater insight on cognition in human or animal minds/brains General/Philosophical Aim - To create computational principles, theories or systems that provide a greater insight on cognition in general - Human made artefacts - Naturally occurring organism - Cognizant entities yet to be discovered - Includes looking at philosophical issues like the nature of intelligence, thought, consciousness, etc What is Intelligence? - When we say that humans are intelligent, we mena they exhibit certain high-level cognitive abilities, including - Carrying out complex reasoning - E.g., solving physics problems, proving mathematical theorems - Drawing plausible inferences - E.g., diagnosing automobile faults, solving murder cases - Using natural language - E.g., reading stories, carrying out extended conversations - Solving novel, complex problems - E.g., completing puzzles, generating plans, designing artefacts - Does not include - Executing motor skills or autonomic activity (breathing, reflexes etc) Philosophical View of Intelligence - Behaviourist/Functionalist approach - External behaviour matters - If it behaves intelligently, then it is intelligent - Turing test - Cognitive approach - What happens internally matters - We must consider how it thinks, not just look at the behaviour - Chinese room Strong AI versus Weak AI - Strong AI - The view that a computer could become self-aware and exhibit intelligent behaviour - Weak AI - The view that computers could not become self-aware and reason - Can be used to solve specific problems in a well-defined domain Examples of Weak AI - IBM Deep Blue - Chess playing computer - Won a game against reigning world champion Garry - Won the match against Kasparov in 1997; first computer to do so in am acth under standard chess tournament time controls - Deep Blue was programmed with history of Kasparov’s previous games - Programming was modified between games to avoid traps - Kasparov was not permitted to study Deep Blue’s previous games - Agents - Autonomous entity that works in a defined environment - Agent achieves goals within environment using - Percepts - observations of the environment obtained through sensors - Actions - made on the environment using actuators Computing Education Experts VS Novices - 1970s - chunking (and related theories) might explain differences between experts and novices - 1973 - perception in chess - 1979 - electronics diagrams - 1981 - recalling lines of computer programs - 1981 - representation of physics problems (influential paper) Knowledge in Programming - What does it mean to learn programming? - Plans, Patterns, and Templates explain one aspect of programming knowledge - 1981-1986 - experts have “plans” for different types of programming problems - ~1992 - experts have “templates” for different types of programming problems - 1995 - “patterns” describe differences in problems Programming “Plans” (1980s) - “Plans” describe learned solutions to common problems - Experts have tacit (unspoken) knowledge about different types of programming problems - Novices (i.e. students) are very bad at recognising this - Doesn’t it sound like a good idea to create a big list of all the plans and teach them to students? Templates and Case Studies (early 1990s) - “Templates” describe not only “learned” solutions but the process of design - Experts know more than just “learned solutions” (as plans claims) - Experts know - About the common types of problems (like with plans) - Decomposing problems - Debugging and antibugging - Testing code - Understanding the meaning of code Patterns (1970s through to present day) - Less interested in expert-novice differences, more interested in identifying types of problems. Generally seen as a very useful concept for expert programmers - A “Pattern” represents a particular type of problem that is useful - Got its start in architecture and urban planning (1970s) - Was popularised in programming around 1995 - Language was a key feature - If we can name a problem, we can easily learn about it and talk about it Experts have knowledge of all these different types of problems so surely we should teach them to beginner students? - No - Doesn’t mean people haven’t reid (and continue to try) - Pattern oriented instruction - Plans -> making tacit knowledge explicit - Despite their allure, there is little actual evidence that teaching patterns help students develop general expertise But, don’t experiments that show patterns make students better at problem solving? - Group A solved the problem better than Group B - Hat must mena teaching plans works and students who are taught plans are better programmers - Synthetic tasks don’t always align with “general ability” - Many studies are based on recall - People have found different groups of students can perform differently on recall tasks but the same on programming tasks - Synthetic exercises might be influenced by other factors. For example, the study instructions can change how students perform a task - “Group these problems in a way a programmer would find useful” - “Group these problems based on how you would solve them” But, surely teaching patterns can’t harm students? - Teaching patterns leads to fragile knowledge - A student taught only how to solve problems A, B, and C will have a challenging time solving problem D - A student taught generally how to program will probably be able to fumble their way to a solution Ok, so how do we teach patterns? - Language used in classrooms - Taught much later after covering the basics - Maybe we don’t even need to explicitly teach them at all - As shocking as it sounds - maybe we can just teach plain ol’ programming - (although, there is now an expectation people should know about patterns) What are LLMs? - Large Language Models - Originally used for language classification or translation tasks - People found they were useful at generating text if the models were adjusted Why are LLMs used in programming? - The people making these models discovered they were quite good at generating code - Even though they weren’t specifically trained to do so - So they wondered what would happen if a model was trained on code - This led to the development of Codex (an early GPT model) - And later CoPilot (a tool that creates code in your IDE) Performance is not the whole picture - Code quality in code bases has been shown to decrease over time with the adoption of tools like Copilot - Code generated by ChatGPT has been found to have security vulnerabilities - Original authors worried these tools would learn to create bugs programmers don’t spot Human Factors and Automation - More complex automations require humans to pay more attention - Active problem solvers become passive evaluators - The “ironies of automation” - When people actually solve problems, there is little evidence these tools make them more productive A Silver Bullet for teaching programming? - Weak students tend to stay weak - Metacognition doesn’t improve - Test scores don’t improve - Self-efficacy declines using tools like ChatGPT - Does not improve time to solve problems - Writing code solutions - Understanding error messages/debugging code Digital Games What are Games? - Structured form of play governed by rules - Play is done for its own sake - Participants are referred to as players - Gameplay characterises what players do - Tools and rules that define the overall context of the game What are Digital Games? - Commonly referred to a video games - People who play video games are called gamers What do you need to play a digital game? - An input device - An output, typically video, device Input Devices - Commonly used input devices - Keyboard and mouse - Gamepad - Touchscreen - Motion controllers - Other input devices include steering wheels, joysticks, light guns, and rhythm game controllers Output Devices - Screens - Speakers - Controllers Platforms - Personal computers - Consoles - Home and handheld - Mobile devices - Arcade machines Media - Cartridges - Optical discs - CD, DVD, Blu-Ray, Proprietary - User-writable media - Floppy discs, cassettes, memory cards - Digital downloads - Steam, GOG, XBL, PSN 1948 - Alan Turing - Wrote a program to play chess - The algorithm looked 2 moves ahead - Doesn’t play chess very well Genres - Platform Games - Primarily involve navigation through enviornments - 2D or 3D - Traversal from one platform to the next - Shooters - Combat oriented using ranged weapons - First-person - Third-person - Light gun - Shoot ‘em ups - Fighting Games - Focus on close combat - 2D or 3D - Usually involves 2 combatants - Player vs. player - Player vs. AI - Ai vs. AI - Role Playing Games - Play the role of the one or more characters immersed in a well-defined world - Detailed lore - Focus on narrative, exploration, and quest completion - Sports games - Emulate real-world sports - Degree of realism varies widely - Realistic titles are referred to as sims - Usually competitive - against AI or other gamers - Strategy - Outcome of combat determined by skilful thinking and planning - Real-time vs. turn-based - Strategy vs. tactics Other Notable Gamers - Massively multi-player online games - Casual games - Party games - Rhythm/music games - Puzzle games - Exergames - Educational games - Adventure games - Many games incorporate elements of more than one genre The Game Industry - Developer - Company specialising in video game development - Multi-disciplinary - programming, art, testing etc - E.g. Crystal Dynamics, Rockstar Games, Rare, Naughty Dog - Publisher - Company responsible for funding, marketing, and distribution - May also develop video games - internal tame of developers referred to as a studio - E.g. Electronic Arts, Activision Blizzard, Ubisoft, Take-Two Interactive Business Models - “Packaged” games - Purchased game for full access to its features - Further monetary outlay unnecessary - Subscription games - Playing the game requires paying a subscription fee - May require initial purchase as well - “Play-to-play” - Free-to-play games - Core game is free - Certain game content locked behind in-game currency that is difficult to obtain - In-game currency can be purchased directly with real world money Business Models - Microtransactions - Ability to purchase in-game goods using real world money - Often used in conjunction with free to play games - “Play-to-win” - Downloadable content - Additional content released for a game post-release - Can include new modes, levels or aesthetic content Gamers Demographics - Based on a study by the Entertainment Software Association (ESA) in the US in 2020 - 59% of gamers are men. 41% are women - The average age of a gamer is between 35 to 44 - 50% of gamers have been playing for 15 years or more - 75% of households have at least one gamer eSports - Organised video game competition - Competitors typically professional - Competitions are broadcast - Prize money for winners - Genres associated with eSports - Real-time strategy games - Fighting games - First-person shooters - Multiplayer online battle arenas - First established in south korea - Since 2000 - Now a global phenomenon with an audience of 532 million people in 2022 Controversies - Negative behavioural effects - Heightened aggression, lowered empathy - Various studies performed - no consensus - Censorship and regulation - Portrayal of women and minorities - Online harassment - Gamergate Future - Virtual reality - Immerses user in a virtual environment - User can look around, move and interact with environment - Headsets for VR gaming recently released - Oculus Rift, HTC Vive - Augmented reality - Real-world environment augmented with computer generated input - imagery, sound etc Software Licences What is software? - AKA ‘programs’ or ‘apps’. Instructions and other data used by the computer - User can perform tasks and interact with the hardware through software - Loaded from secondary memory into primary memory, where it is executed by the CPU Kinds of software - System software - Operating system (eg. Windows, Mac OS X) - Device drivers - Diagnostic and maintenance tools (eg. Disk Cleanup) - Application software - Used by users to perform tasks on the computer File formats - All data on a computer is stored in binary - However, a program encodes files in its own way; this is the file format - A program will be unable to open a file if it does not understand the file format Standards - File formats sometimes follow a standard; an agreed way of encoding data (eg. webpages use the HTML5 standard) - Standards can be - Open - Published openly - Free to use - Eg. HTML, PDF - Proprietary - Owned by a company - Others can use the standard if they pay for a licence - Eg. MP3 File extension - Used by the operating system to determine a file’s format - Eg. the.docx file format opens by default with Microsoft Word Copyright - Software is protected by a range of IP rights - Copyright - Protects the expression of an idea - Copyright Act 1994: literary works (includes software) is protected by copyright Kinds of software - Proprietary software - Owned by an individual or company - Types - Commercial - Shareware - Freeware - Semi-free (for non-profits) - Open source software - Generally - Freely available - Anyone can use or edit the software’s source code - Affirmative action open source: Kaitiakitanga licence Proprietary software - Commercial - Software that a user must purchase to use - Examples: Microsoft Office, Adobe Acrobat, SPSS - Shareware - User has a trial period in which to evaluate the software, and purchase it if they want - Nagware: software keeps reminding the user to purchase the full version - Crippleware: software that works with limited functionality until the user purchases it - Freemium: software with a free tier and paid tier - Freeware - Software is free to use but source code is not publicly available - Freeware can be a loss leader or adware - Some freeware is known as abandonware; software no longer maintained but still available Open source software - Software that is free to use and whose source code is public - Anyone can use or modify the source code - Anyone can create a derivative work from the source code - Open source movement started in the late 1980’s and outlined in the Open Source Definition - Open source software licences (eg. Apache, GNU) are not as restrictive as commercial software licences Affirmative Action Open Source Kaitiakitanga licence - Created by Te Hiku Media. Ensures that Maori-led organisations have priority access to Maori coding projects - Provides Maori organisations with equal opportunity to create tech products - May specify that benefits go back to Maori communities whose data was a basis for the application (e.g., te reo Maori speech recognition) User interfaces - Two kinds of user interface - Command line interface (CLI) - Graphical user interface (GUI) - Key difference is that a CLI is text-based while a GUI graphically-based Command line interface - User enters text commands to perform tasks - Can complete tasks very quickly by combining commands - Can be difficult to use the text commands if you don’t know or understand them Graphical user interface - User performs tasks using the software’s graphical elements (eg. windows, printers, icons, menus) - Generally easy to use, especially for new users - Can be inefficient for experienced users, but keyboard shortcuts help to make GUIs more efficient Application software - Two kinds of software: system and application - Very wide range of application software - Web browsers - Email clients - Office software - Graphics software - Music software - Security software - Software development tools Digital Images Bitmap Graphics - Storing pictures digitally - Sample the image (divide into dots) - Image resolution (number of dots) Black and White pictures - Digital Pictures consist of small dots - Each dot is called a picture element (pixel) - Storing information - Black and White are only two states - Use bits to represent pixels (0 = OFF, 1 = ON) - One to one mapping, so known as Bitmap Displaying images - Images are displayed on an output device - Screen/Printer - Physical devices have limitations Printing Bitmaps - Printer and Screen have different sized dots - Scale (resample) the bitmap to ensure it looks good on both Exercises - Imagine you have taken a picture with a 4 megapixel digital camera. For ease of calculation, assume that the picture is square, not rectangular and is 4 million pixels - Assume that you are printing this picture out on a printer that has approximately 4000 dots per inch. How many inches across would the picture be when it was printed? - 4000000 = 2000 * 2000 - Therefore the picture would take up 0.5 by 0.5 inches - If you viewed this image on a screen that had 1000 dots across, what portion of the screen would be visible? - You would see ½ the width and ½ the heigh - There you would see: ½ * ½ = ¼ of the image Colour Bitmaps - Colours - Use more than 1 bit per pixel - Map the binary number to a colour How much memory is required? - One binary number used for each pixel - 1 bit 2 colours - 2 bits 4 colours - 4 bits 16 colours - 8 bits 256 colours - 16 bits 65536 colours - 24 bits 16777216 colours - How many bits are required for a 16 colour image 100 pixels wide x 8 pixels high? - 100x8x4 (4 bits is 16 colours) = 3200 bits = 400 bytes - An image using 24 bit colour, 1000 wide x 1000 high (1 Megapixel)? - 3 MB Exercises - How many colours can be represented by 3 bits? - 2^3 = 8 colours - How many bits are required to represent 128 different colours? - 128 = 2^7. Therefore 7 bits is required - How much memory would be required to store a black and white image that is 10 pixels high and 5 pixels wide? Show your working - Number of colours = 2^1. Therefore 1 bit is required per pixel - Number of pixels = h * w = 10 * 5 = 50 - Memory needed = 50 * 1 = 50 bits - How much memory (in bytes) would be required to store an image that has 256 different colours and is 3 pixels high and 5 pixels wide? Show your working - Number of colours = 256 = 2^8. Therefore 8 bits is required - Number of pixels = h * w = 3 * 5 = 15 - Memory needed = 15 * 8 = 120 bits - 1 byte = 8 bits so 120 / 8 = 15 bytes Displays - Screens use a combination of Red, Green, and Blue lights - RGB colour - Use one byte (8 bits) for each colour - 256 different levels of red brightness - 256 different levels of green brightness - 256 different levels of blue brightness Compressing Images - Simply reducing number of colours Compression Algorithms - Graphics Interchange Format (GIF) - Lossless method - 256 colours - Good for graphics, poor for photos - Uses an algorithm that was patented - Portable Network Graphics (PNG) - Replacement to GIF - Lossless method - 16 million colours (24 bit) - Good for graphics, poor for photos - JPEG - Joint Photographic Experts Group (JPEG) - Lossy method - 16 million colours (24 bit) - Averages nearby colours - Different degrees of compression - Good for photos, poor for graphics

Use Quizgecko on...
Browser
Browser