Go is a general-purpose programming language designed with systems programming in mind. It provides garbage collection, concurrency support, and a simple syntax similar to C. A Go program consists of packages that can be compiled to a binary. The main function acts as the entry point. Print statements and comments are used to output text and add notes to the code.
This document provides an overview of the Go programming language. It describes how Go was developed by Google in 2007 and provides garbage collection, type safety, and dynamic typing capabilities. It also includes a rich standard library. The document outlines the prerequisites needed to understand Go and provides a table of contents that structures the rest of the tutorial into topics like data types, variables, operators, and decision making.
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements and expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
This document provides an overview and tutorial for the C programming language. It discusses that C was created in 1972 by Dennis Ritchie to develop the UNIX operating system. C is still widely used today and is one of the most popular programming languages. The tutorial is designed for programmers who want to learn C from the basics. It provides information on installing a C compiler, basic C syntax like data types and operators, and how to structure a basic C program.
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements and expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements and expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
Eclipse is an integrated development environment used primarily for Java development. It contains perspectives that arrange views and editors. Views display metadata and editors are used for editing files. The default perspective is Java. Menus provide commands for common development tasks. Views can be organized into folders and moved around. Perspectives control which menus and tools are shown.
The document provides an introduction and overview of JavaScript. It is intended for JavaScript beginners to help them understand the basic functionality of JavaScript to build dynamic web pages and applications. The document covers JavaScript basics like syntax, enabling JavaScript, variable types, operators, control flow structures like if/else and loops. It also includes topics like placing JavaScript in HTML documents, external files and variable scoping.
This document provides an overview of Objective-C, including its use of Smalltalk-style messaging in C programming. It describes Objective-C as the main programming language used by Apple for OS X and iOS operating systems. The document also outlines the structure of an Objective-C program, basic syntax elements like variables and constants, and different operator types. It is intended to help beginners learn the fundamentals of the Objective-C programming language.
This document provides an overview and introduction to C++, including:
- C++ is an object-oriented programming language that is a superset of C and supports features like classes, inheritance, and polymorphism.
- It has standard libraries for common tasks like file input/output and string manipulation.
- C++ code is compiled ahead of time to ensure portability across different platforms.
- The document discusses getting started with C++, including using an online compiler or setting up a local environment with a text editor and C++ compiler.
This document provides an introduction and overview of the Perl programming language. Perl was developed by Larry Wall for text processing and runs on various platforms including Windows, Mac OS, and Unix. It covers basic Perl concepts such as variables, scalars, arrays, hashes, conditional and loop statements. The tutorial is intended for beginners and assumes some familiarity with C and Unix shell programming. All content in the tutorial is copyrighted by Tutorials Point (I) Pvt. Ltd.
This document provides an overview of the Tcl programming language and its environment setup. Some key points:
- Tcl is a scripting language used for building GUI applications using its widget toolkit Tk. It aims to enable programs to communicate with each other.
- The basic requirements for Tcl development include a text editor to write code and the Tcl interpreter to execute it.
- Tcl code is platform independent and can run on Windows, Linux, MacOS and other platforms. Installation instructions are provided for different operating systems.
- The document covers Tcl basics like variables, data types, operators, control flow statements, arrays, strings, lists, procedures and more.
- Tk is introduced as the widget toolkit
Design patterns provide best practices for object-oriented software development. The Factory pattern abstracts object creation by defining a common interface for creating objects without specifying the concrete classes. The implementation creates shapes (Circle, Rectangle, Square) without exposing creation logic by using a ShapeFactory class that returns the appropriate object based on a string parameter. This allows the client code to change implementation without modifying code.
The Spring Framework is an open-source Java platform that provides comprehensive infrastructure support for developing robust Java applications easily and rapidly. It was initially created by Rod Johnson in 2002 and released under the Apache 2.0 license. Spring simplifies development through features like dependency injection and aspect-oriented programming. It includes modules for core functions, data access, web applications, and other services.
BDD focuses on providing a shared process and tools to promote communication between software developers and business analysts. It uses examples written in a readable language to illustrate desired system behaviors. BDD emerged from test-driven development, which uses automated tests to drive development. A key BDD practice is specification by example, which involves collaboratively writing examples to illustrate requirements and then automating these examples as tests.
This document provides an introduction and overview of PHP 7. It discusses new features of PHP 7 such as improved performance (being twice as fast as PHP 5), lower memory consumption, scalar type declarations, consistent 64-bit support, improved exception hierarchy, addition of new secure random number generator API, and removal of deprecated extensions and SAPIs. It also provides information on setting up the PHP 7 environment on Linux/Unix, Mac OS X, and Windows platforms. It includes steps to install PHP, Apache web server, and configure the php.ini file. Code examples are provided to demonstrate new features like scalar type declarations and return type declarations.
This document provides an overview of object-oriented programming concepts and Java programming. It introduces topics like classes, objects, inheritance, polymorphism, exception handling, input/output streams, events, applets, serialization, databases, networking, threading and more. The document is intended to teach OOP concepts independently of a specific language using examples in Java and C++. It emphasizes that learning to use the Java class libraries and object-oriented design are the main challenges for Java programmers.
R is a programming language and software environment for statistical analysis, graphics representation and reporting. It was created by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand, and is currently developed by the R Development Core Team. R is freely available under the GNU General Public License, and pre-compiled binary versions are provided for various operating systems like Linux, Windows and Mac. R provides a suite of tools for data analysis, graphical facilities for data display, and an effective data handling and storage facility.
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements, expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements and expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
This document provides an overview and tutorial for the C programming language. It discusses that C was created in 1972 by Dennis Ritchie to develop the UNIX operating system. C is still widely used today and is one of the most popular programming languages. The tutorial is designed for programmers who want to learn C from the basics. It provides information on installing a C compiler, basic C syntax like data types and operators, and how to structure a basic C program.
C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system. C is the most widely used computer language. It keeps fluctuating at number one scale of popularity along with Java programming language, which is also
equally popular and most widely used among modern software programmers.
c programming tutorial...................rtambade13
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements, expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements and expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
This document provides an overview and tutorial for the C programming language. It discusses that C was created in 1972 by Dennis Ritchie to develop the UNIX operating system. C is still widely used today and is one of the most popular programming languages. The tutorial is designed for programmers who want to learn C from the basics. It provides information on installing a C compiler, basic C syntax like data types and operators, and how to structure a basic C program.
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements and expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements and expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
The document provides an introduction and overview of JavaScript. It is intended for JavaScript beginners to help them understand the basic functionality of JavaScript to build dynamic web pages and applications. The document covers JavaScript basics like syntax, enabling JavaScript, variable types, operators, control flow structures like if/else and loops. It also includes topics like placing JavaScript in HTML documents, external files and variable scoping.
This document provides an overview of Objective-C, including its use of Smalltalk-style messaging in C programming. It describes Objective-C as the main programming language used by Apple for OS X and iOS operating systems. The document also outlines the structure of an Objective-C program, basic syntax elements like variables and constants, and different operator types. It is intended to help beginners learn the fundamentals of the Objective-C programming language.
This document provides an overview and introduction to C++, including:
- C++ is an object-oriented programming language that is a superset of C and supports features like classes, inheritance, and polymorphism.
- It has standard libraries for common tasks like file input/output and string manipulation.
- C++ code is compiled ahead of time to ensure portability across different platforms.
- The document discusses getting started with C++, including using an online compiler or setting up a local environment with a text editor and C++ compiler.
This document provides an introduction and overview of the Perl programming language. Perl was developed by Larry Wall for text processing and runs on various platforms including Windows, Mac OS, and Unix. It covers basic Perl concepts such as variables, scalars, arrays, hashes, conditional and loop statements. The tutorial is intended for beginners and assumes some familiarity with C and Unix shell programming. All content in the tutorial is copyrighted by Tutorials Point (I) Pvt. Ltd.
This document provides an overview of the Tcl programming language and its environment setup. Some key points:
- Tcl is a scripting language used for building GUI applications using its widget toolkit Tk. It aims to enable programs to communicate with each other.
- The basic requirements for Tcl development include a text editor to write code and the Tcl interpreter to execute it.
- Tcl code is platform independent and can run on Windows, Linux, MacOS and other platforms. Installation instructions are provided for different operating systems.
- The document covers Tcl basics like variables, data types, operators, control flow statements, arrays, strings, lists, procedures and more.
- Tk is introduced as the widget toolkit
Design patterns provide best practices for object-oriented software development. The Factory pattern abstracts object creation by defining a common interface for creating objects without specifying the concrete classes. The implementation creates shapes (Circle, Rectangle, Square) without exposing creation logic by using a ShapeFactory class that returns the appropriate object based on a string parameter. This allows the client code to change implementation without modifying code.
The Spring Framework is an open-source Java platform that provides comprehensive infrastructure support for developing robust Java applications easily and rapidly. It was initially created by Rod Johnson in 2002 and released under the Apache 2.0 license. Spring simplifies development through features like dependency injection and aspect-oriented programming. It includes modules for core functions, data access, web applications, and other services.
BDD focuses on providing a shared process and tools to promote communication between software developers and business analysts. It uses examples written in a readable language to illustrate desired system behaviors. BDD emerged from test-driven development, which uses automated tests to drive development. A key BDD practice is specification by example, which involves collaboratively writing examples to illustrate requirements and then automating these examples as tests.
This document provides an introduction and overview of PHP 7. It discusses new features of PHP 7 such as improved performance (being twice as fast as PHP 5), lower memory consumption, scalar type declarations, consistent 64-bit support, improved exception hierarchy, addition of new secure random number generator API, and removal of deprecated extensions and SAPIs. It also provides information on setting up the PHP 7 environment on Linux/Unix, Mac OS X, and Windows platforms. It includes steps to install PHP, Apache web server, and configure the php.ini file. Code examples are provided to demonstrate new features like scalar type declarations and return type declarations.
This document provides an overview of object-oriented programming concepts and Java programming. It introduces topics like classes, objects, inheritance, polymorphism, exception handling, input/output streams, events, applets, serialization, databases, networking, threading and more. The document is intended to teach OOP concepts independently of a specific language using examples in Java and C++. It emphasizes that learning to use the Java class libraries and object-oriented design are the main challenges for Java programmers.
R is a programming language and software environment for statistical analysis, graphics representation and reporting. It was created by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand, and is currently developed by the R Development Core Team. R is freely available under the GNU General Public License, and pre-compiled binary versions are provided for various operating systems like Linux, Windows and Mac. R provides a suite of tools for data analysis, graphical facilities for data display, and an effective data handling and storage facility.
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements, expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements and expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
This document provides an overview and tutorial for the C programming language. It discusses that C was created in 1972 by Dennis Ritchie to develop the UNIX operating system. C is still widely used today and is one of the most popular programming languages. The tutorial is designed for programmers who want to learn C from the basics. It provides information on installing a C compiler, basic C syntax like data types and operators, and how to structure a basic C program.
C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system. C is the most widely used computer language. It keeps fluctuating at number one scale of popularity along with Java programming language, which is also
equally popular and most widely used among modern software programmers.
c programming tutorial...................rtambade13
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements, expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements and expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
This document provides an overview and tutorial for the C programming language. It discusses that C was created in 1972 by Dennis Ritchie to develop the UNIX operating system. C is still widely used today and is one of the most popular programming languages. The tutorial is designed for programmers who want to learn C from the basics. It provides information on installing a C compiler, basic C syntax like data types and operators, and how to structure a basic C program.
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements and expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements and expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
C language programming (description in simple words)mujeeb memon
The document discusses the basic structure of a C program. It provides a simple "Hello World" program as an example. The program includes preprocessor commands, functions, variables, statements and expressions, and comments. It also describes how to save the code in a file, compile it using gcc, and execute the resulting program.
This document provides an introduction and overview of C# programming. It discusses that C# is an object-oriented language developed by Microsoft as part of its .NET framework. The document outlines some key features of C# and provides information on setting up an integrated development environment to write and run C# programs. It also gives an overview of basic C# program structure, syntax, data types, variables, operators, and decision-making statements.
The document provides an overview and introduction to the C# programming language. It discusses that C# is an object-oriented language developed by Microsoft as part of its .NET initiative. The document then covers some key topics about C# including its environment and tools, basic program structure, data types, variables, operators, and decision making statements. It provides code examples and explanations for many common C# concepts.
Design patterns provide best practices for object-oriented software development. The Factory pattern abstracts object creation by defining a common interface for creating objects without specifying the actual class. The implementation shown creates a Shape interface with Circle, Rectangle and Square classes, a ShapeFactory class that returns the appropriate shape object based on a string, and a demo class that uses the factory to get different shape objects and call their draw methods. This allows changing the object creation logic independently of the client.
IntelliJ IDEA is a powerful and popular integrated development environment for Java. This tutorial provides an introduction to IntelliJ IDEA, including how to install and configure it, get familiar with its visual elements and settings, and create a first Java project. It also discusses deeper features like projects, modules, libraries, and build tools integration.
This document provides an overview of the Dart programming language. It discusses Dart's environment setup, syntax, data types, variables, operators, loops, decision making, numbers, strings, booleans, lists, maps, symbols, runes, functions, classes, objects, collections, generics, packages, exceptions, debugging, typedefs, libraries, async programming, concurrency, and unit testing in Dart. It also compares key features of Dart and JavaScript.
This document provides an overview of database management systems (DBMS). It discusses DBMS architecture, data models including entity-relationship and relational models, data schemas, data independence, and the entity-relationship model. It also covers relational data modeling, Codd's 12 rules for relational databases, and mapping from entity-relationship diagrams to relational schemas. The intended audience is computer science graduates and prerequisites include basic computer concepts.
This document provides an introduction to data structures and algorithms. It discusses how data structures store data efficiently and how they are used in enterprise applications. The target audience is computer science graduates and software professionals looking to learn about data structures and algorithms. Basic prerequisites include understanding C programming, text editors, and executing programs. The document outlines different sections to be covered, including basics of data structures and algorithms, asymptotic analysis, common algorithms like greedy, divide and conquer, and dynamic programming, and specific data structures like arrays.
This document provides an overview of wireless communication. It discusses key topics such as features of wireless communication including transmission distance and applications. It also outlines some advantages of wireless communication such as mobility and lack of need for wires. Finally, it introduces various terms used in mobile telephony and multiple access techniques including FDMA, TDMA, CDMA and more that allow multiple users to access the network simultaneously.
This document provides an overview of cryptography. It begins by explaining the origins of cryptography in ancient civilizations and how it has evolved over time. It then discusses the components of a cryptosystem, including plaintext, encryption/decryption algorithms and keys. Finally, it outlines different types of cryptosystems and their basic functions in encrypting and decrypting data to provide confidentiality during transmission.
This document provides an overview of cosmology and summarizes some of the major discoveries in the field. It introduces concepts like the expanding universe, Hubble's law, and the Big Bang theory. It also explains cosmological phenomena such as the cosmic microwave background radiation and discusses evidence that has helped scientists understand dark matter and dark energy. The tutorial is intended for students and early-career astronomers who want to learn more about cosmological observations and theories.
This document provides an overview of control systems and their analysis. It introduces various modeling methods for control systems including mathematical models using differential equations and transfer functions. It also discusses modeling of mechanical systems, block diagrams, time response analysis, stability analysis and other fundamental control systems concepts. The document contains 17 chapters and is intended to teach readers about analyzing and improving the performance of control systems.
This document provides an overview of computer logical organization. It discusses key concepts such as analog versus digital signals, different number systems including binary, and binary codes. It also covers topics like number system conversions, error detection/correction, and complement arithmetic which are important aspects of computer logical organization. The intended audience is students pursuing computer science degrees. Basic computer knowledge is assumed as a prerequisite.
This document provides an overview of computer fundamentals. It explains that a computer accepts raw data as input, processes it under a set of instructions, and produces output which is saved for future use. It is intended for beginners and advanced learners, covering topics such as hardware, software, operating systems, and how to get the most value from computers. The document also provides information on computer components, memory types, number systems, and how to purchase a computer.
This document provides an overview of compiler design. It describes the different phases of a compiler including lexical analysis, syntax analysis, and code generation. It also outlines the overall architecture of a compiler, discussing the analysis and synthesis phases. The document is intended for students interested in learning the basic principles of compilers.
This document provides an overview of communication technologies and networking. It begins by discussing the history of communication from early speech to the development of the telephone and telecommunication networks. It then outlines how computer networks have revolutionized modern communication. The document will cover the evolution of networks from ARPANET to the Internet, networking hardware and software components, and concepts of global communication. It is designed for readers interested in learning the basic concepts of how networks function.
This document provides an overview of biometrics and biometric systems. It discusses the basic components of a biometric system, including sensors to capture biometric data, a processing unit, a database to store templates, and an output interface. It also outlines the general process a biometric system uses for identification and verification. The document introduces key biometrics concepts and terminology. It describes the evolution of biometrics and some common applications of biometric systems.
This document provides an introduction to basic computer concepts. It discusses that a computer receives input, processes it based on instructions, and provides output. It also notes that computers can perform repetitive tasks without error. The document then outlines that it will discuss the parts of a computer and microprocessors that enable efficient and correct task completion. It provides information on intended audience and prerequisites. Finally, it includes copyright information and a table of contents to guide the reader.
This document provides an overview of basic computer science concepts. It discusses the major components of a computer system including hardware, software, input/output devices. It also describes common operating systems like Windows and Unix, as well as network types including local area networks, metropolitan area networks, and wide area networks. The document is designed for students preparing for competitive exams to provide foundational computer science knowledge with no prerequisites.
This document provides an introduction to basic electronic components. It begins by discussing semiconductor physics concepts like quantum numbers, energy bands, and the Pauli exclusion principle. It then covers components like resistors, capacitors, inductors, and transistors. Resistors are discussed in terms of symbols, color coding, circuit connections in series and parallel, and types of resistors. Capacitors are similarly covered regarding symbols, how they work, color coding, capacitive reactance, temperature coefficients, and circuit connections. The document is intended for readers who want preliminary knowledge of basic electronic components.
The document discusses the objectives and fundamentals of auditing. It explains that the main objective of auditing is to ensure the financial reliability of an organization and provide an independent opinion on whether the books of accounts show a true and fair view. It also discusses the three main types of fraud that can be detected through auditing - misappropriation of cash, goods, and manipulation of accounts.
This document provides an overview of artificial neural networks (ANN). It describes ANN as parallel computing devices modeled after the human brain, with the objective of performing computational tasks faster than traditional systems. The document outlines some key concepts of ANN including its basic components like neurons and connections between neurons. It also discusses different types of ANN models and learning methods, including supervised and unsupervised learning. Finally, it notes that ANN can be useful for tasks like pattern recognition, classification, approximation, and data clustering.
This document provides an introduction to the topic of artificial intelligence. It discusses the goals and history of AI, as well as key areas of research like intelligent systems, search algorithms, fuzzy logic systems, natural language processing, and expert systems. The intended audience is students beginning their study of AI who want a broad overview of the field.
This document provides an overview of antennas used in communication systems. It begins by describing the intended audience, which are readers looking to learn about antenna fundamentals, parameters, types, and design considerations. The document then outlines topics that will be covered, including basic antenna terms, parameters, near and far field patterns, radiation patterns, beam width, polarization, and more. It also lists prerequisites of basic electromagnetic wave and communication system concepts. The document aims to explain how to calculate antenna parameters and select an appropriate antenna type for different applications.
This document provides an overview of analog communication techniques. It discusses various modulation techniques used in analog communication systems, including amplitude modulation (AM), double sideband suppressed carrier (DSBSC), single sideband suppressed carrier (SSBSC), and vestigial sideband (VSBSC) modulation. It also covers angle modulation techniques such as frequency modulation (FM) and phase modulation. The document provides mathematical expressions to describe the different modulation techniques and discusses modulators and demodulators used for each type of modulation.
The document discusses transistors and amplifiers. It begins by providing an overview of transistors, including their construction with emitter, base and collector terminals. It describes the operation of PNP and NPN transistors and their biasing. Transistors can be used as amplifiers by configuring them in common base, common emitter or common collector modes. Proper biasing and operating point selection are required for faithful amplification. Later sections cover various types of single-stage and multi-stage transistor amplifiers, including classifications, coupling methods, and considerations for power amplifiers.
A measles outbreak originating in West Texas has been linked to confirmed cases in New Mexico, with additional cases reported in Oklahoma and Kansas. The current case count is 817 from Texas, New Mexico, Oklahoma, and Kansas. 97 individuals have required hospitalization, and 3 deaths, 2 children in Texas and one adult in New Mexico. These fatalities mark the first measles-related deaths in the United States since 2015 and the first pediatric measles death since 2003.
The YSPH Virtual Medical Operations Center Briefs (VMOC) were created as a service-learning project by faculty and graduate students at the Yale School of Public Health in response to the 2010 Haiti Earthquake. Each year, the VMOC Briefs are produced by students enrolled in Environmental Health Science Course 581 - Public Health Emergencies: Disaster Planning and Response. These briefs compile diverse information sources – including status reports, maps, news articles, and web content– into a single, easily digestible document that can be widely shared and used interactively. Key features of this report include:
- Comprehensive Overview: Provides situation updates, maps, relevant news, and web resources.
- Accessibility: Designed for easy reading, wide distribution, and interactive use.
- Collaboration: The “unlocked" format enables other responders to share, copy, and adapt seamlessly. The students learn by doing, quickly discovering how and where to find critical information and presenting it in an easily understood manner.
CURRENT CASE COUNT: 817 (As of 05/3/2025)
• Texas: 688 (+20)(62% of these cases are in Gaines County).
• New Mexico: 67 (+1 )(92.4% of the cases are from Eddy County)
• Oklahoma: 16 (+1)
• Kansas: 46 (32% of the cases are from Gray County)
HOSPITALIZATIONS: 97 (+2)
• Texas: 89 (+2) - This is 13.02% of all TX cases.
• New Mexico: 7 - This is 10.6% of all NM cases.
• Kansas: 1 - This is 2.7% of all KS cases.
DEATHS: 3
• Texas: 2 – This is 0.31% of all cases
• New Mexico: 1 – This is 1.54% of all cases
US NATIONAL CASE COUNT: 967 (Confirmed and suspected):
INTERNATIONAL SPREAD (As of 4/2/2025)
• Mexico – 865 (+58)
‒Chihuahua, Mexico: 844 (+58) cases, 3 hospitalizations, 1 fatality
• Canada: 1531 (+270) (This reflects Ontario's Outbreak, which began 11/24)
‒Ontario, Canada – 1243 (+223) cases, 84 hospitalizations.
• Europe: 6,814
APM event hosted by the Midlands Network on 30 April 2025.
Speaker: Sacha Hind, Senior Programme Manager, Network Rail
With fierce competition in today’s job market, candidates need a lot more than a good CV and interview skills to stand out from the crowd.
Based on her own experience of progressing to a senior project role and leading a team of 35 project professionals, Sacha shared not just how to land that dream role, but how to be successful in it and most importantly, how to enjoy it!
Sacha included her top tips for aspiring leaders – the things you really need to know but people rarely tell you!
We also celebrated our Midlands Regional Network Awards 2025, and presenting the award for Midlands Student of the Year 2025.
This session provided the opportunity for personal reflection on areas attendees are currently focussing on in order to be successful versus what really makes a difference.
Sacha answered some common questions about what it takes to thrive at a senior level in a fast-paced project environment: Do I need a degree? How do I balance work with family and life outside of work? How do I get leadership experience before I become a line manager?
The session was full of practical takeaways and the audience also had the opportunity to get their questions answered on the evening with a live Q&A session.
Attendees hopefully came away feeling more confident, motivated and empowered to progress their careers
How to Set warnings for invoicing specific customers in odooCeline George
Odoo 16 offers a powerful platform for managing sales documents and invoicing efficiently. One of its standout features is the ability to set warnings and block messages for specific customers during the invoicing process.
*Metamorphosis* is a biological process where an animal undergoes a dramatic transformation from a juvenile or larval stage to a adult stage, often involving significant changes in form and structure. This process is commonly seen in insects, amphibians, and some other animals.
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...Celine George
Analytic accounts are used to track and manage financial transactions related to specific projects, departments, or business units. They provide detailed insights into costs and revenues at a granular level, independent of the main accounting system. This helps to better understand profitability, performance, and resource allocation, making it easier to make informed financial decisions and strategic planning.
Understanding P–N Junction Semiconductors: A Beginner’s GuideGS Virdi
Dive into the fundamentals of P–N junctions, the heart of every diode and semiconductor device. In this concise presentation, Dr. G.S. Virdi (Former Chief Scientist, CSIR-CEERI Pilani) covers:
What Is a P–N Junction? Learn how P-type and N-type materials join to create a diode.
Depletion Region & Biasing: See how forward and reverse bias shape the voltage–current behavior.
V–I Characteristics: Understand the curve that defines diode operation.
Real-World Uses: Discover common applications in rectifiers, signal clipping, and more.
Ideal for electronics students, hobbyists, and engineers seeking a clear, practical introduction to P–N junction semiconductors.
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...larencebapu132
This is short and accurate description of World war-1 (1914-18)
It can give you the perfect factual conceptual clarity on the great war
Regards Simanchala Sarab
Student of BABed(ITEP, Secondary stage)in History at Guru Nanak Dev University Amritsar Punjab 🙏🙏
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetSritoma Majumder
Introduction
All the materials around us are made up of elements. These elements can be broadly divided into two major groups:
Metals
Non-Metals
Each group has its own unique physical and chemical properties. Let's understand them one by one.
Physical Properties
1. Appearance
Metals: Shiny (lustrous). Example: gold, silver, copper.
Non-metals: Dull appearance (except iodine, which is shiny).
2. Hardness
Metals: Generally hard. Example: iron.
Non-metals: Usually soft (except diamond, a form of carbon, which is very hard).
3. State
Metals: Mostly solids at room temperature (except mercury, which is a liquid).
Non-metals: Can be solids, liquids, or gases. Example: oxygen (gas), bromine (liquid), sulphur (solid).
4. Malleability
Metals: Can be hammered into thin sheets (malleable).
Non-metals: Not malleable. They break when hammered (brittle).
5. Ductility
Metals: Can be drawn into wires (ductile).
Non-metals: Not ductile.
6. Conductivity
Metals: Good conductors of heat and electricity.
Non-metals: Poor conductors (except graphite, which is a good conductor).
7. Sonorous Nature
Metals: Produce a ringing sound when struck.
Non-metals: Do not produce sound.
Chemical Properties
1. Reaction with Oxygen
Metals react with oxygen to form metal oxides.
These metal oxides are usually basic.
Non-metals react with oxygen to form non-metallic oxides.
These oxides are usually acidic.
2. Reaction with Water
Metals:
Some react vigorously (e.g., sodium).
Some react slowly (e.g., iron).
Some do not react at all (e.g., gold, silver).
Non-metals: Generally do not react with water.
3. Reaction with Acids
Metals react with acids to produce salt and hydrogen gas.
Non-metals: Do not react with acids.
4. Reaction with Bases
Some non-metals react with bases to form salts, but this is rare.
Metals generally do not react with bases directly (except amphoteric metals like aluminum and zinc).
Displacement Reaction
More reactive metals can displace less reactive metals from their salt solutions.
Uses of Metals
Iron: Making machines, tools, and buildings.
Aluminum: Used in aircraft, utensils.
Copper: Electrical wires.
Gold and Silver: Jewelry.
Zinc: Coating iron to prevent rusting (galvanization).
Uses of Non-Metals
Oxygen: Breathing.
Nitrogen: Fertilizers.
Chlorine: Water purification.
Carbon: Fuel (coal), steel-making (coke).
Iodine: Medicines.
Alloys
An alloy is a mixture of metals or a metal with a non-metal.
Alloys have improved properties like strength, resistance to rusting.
The Pala kings were people-protectors. In fact, Gopal was elected to the throne only to end Matsya Nyaya. Bhagalpur Abhiledh states that Dharmapala imposed only fair taxes on the people. Rampala abolished the unjust taxes imposed by Bhima. The Pala rulers were lovers of learning. Vikramshila University was established by Dharmapala. He opened 50 other learning centers. A famous Buddhist scholar named Haribhadra was to be present in his court. Devpala appointed another Buddhist scholar named Veerdeva as the vice president of Nalanda Vihar. Among other scholars of this period, Sandhyakar Nandi, Chakrapani Dutta and Vajradatta are especially famous. Sandhyakar Nandi wrote the famous poem of this period 'Ramcharit'.
What makes space feel generous, and how architecture address this generosity in terms of atmosphere, metrics, and the implications of its scale? This edition of #Untagged explores these and other questions in its presentation of the 2024 edition of the Master in Collective Housing. The Master of Architecture in Collective Housing, MCH, is a postgraduate full-time international professional program of advanced architecture design in collective housing presented by Universidad Politécnica of Madrid (UPM) and Swiss Federal Institute of Technology (ETH).
Yearbook MCH 2024. Master in Advanced Studies in Collective Housing UPM - ETH
How to Manage Opening & Closing Controls in Odoo 17 POSCeline George
In Odoo 17 Point of Sale, the opening and closing controls are key for cash management. At the start of a shift, cashiers log in and enter the starting cash amount, marking the beginning of financial tracking. Throughout the shift, every transaction is recorded, creating an audit trail.
2. D Programming
i
AbouttheTutorial
D programming language is an object-oriented multi-paradigm system programming
language. D programming is actually developed by re-engineering C++ programming
language, but it is distinct programming language that not only takes in some features of
C++ but also some features of other programming languages such as Java, C#, Python,
and Ruby.
This tutorial covers various topics ranging from the basics of the D programming language
to advanced OOP concepts along with the supplementary examples.
Audience
This tutorial is designed for all those individuals who are looking for a starting point of
learning D Language. Both beginners and advanced users can refer this tutorial as their
learning material. Enthusiastic learners can refer it as their on-the-go reading reference.
Any individual with a logical mindset can enjoy learning D through this tutorial.
Prerequisites
Before proceeding with this tutorial, it is advisable for you to understand the basics
concepts of computer programming. You just need to have a basic understanding of
working with a simple text editor and command line.
Disclaimer&Copyright
Copyright 2017 by Tutorials Point (I) Pvt. Ltd.
All the content and graphics published in this e-book are the property of Tutorials Point (I)
Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish
any contents or a part of contents of this e-book in any manner without written consent
of the publisher.
We strive to update the contents of our website and tutorials as timely and as precisely as
possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt.
Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our
website or its contents including this tutorial. If you discover any errors on our website or
in this tutorial, please notify us at [email protected].
3. D Programming
ii
TableofContents
About the Tutorial .......................................................................................................................................... i
Audience......................................................................................................................................................... i
Prerequisites................................................................................................................................................... i
Disclaimer & Copyright................................................................................................................................... i
Table of Contents........................................................................................................................................... ii
PART I - D PROGRAMMING BASICS .............................................................................................1
1. D ─ Overview...........................................................................................................................................2
Multiple Paradigms........................................................................................................................................ 2
Learning D...................................................................................................................................................... 3
Scope of D...................................................................................................................................................... 3
2. D ─ Environment .....................................................................................................................................4
Try it Option Online ....................................................................................................................................... 4
Local Environment Setup for D...................................................................................................................... 4
Text Editor for D Programming...................................................................................................................... 4
The D Compiler .............................................................................................................................................. 5
Installation of D on Windows ........................................................................................................................ 5
Installation of D on Ubuntu/Debian .............................................................................................................. 6
Installation of D on Mac OS X ........................................................................................................................ 6
Installation of D on Fedora ............................................................................................................................ 6
Installation of D on OpenSUSE....................................................................................................................... 7
D IDE .............................................................................................................................................................. 7
3. D ─ Basic Syntax ......................................................................................................................................8
First D Program.............................................................................................................................................. 8
Import in D..................................................................................................................................................... 8
Main Function................................................................................................................................................ 8
Tokens in D .................................................................................................................................................... 9
Comments...................................................................................................................................................... 9
Identifiers....................................................................................................................................................... 9
Keywords ..................................................................................................................................................... 10
Whitespace in D........................................................................................................................................... 11
4. D ─ Variables .........................................................................................................................................12
Variable Definition in D................................................................................................................................ 12
Variable Declaration in D............................................................................................................................. 13
Lvalues and Rvalues in D.............................................................................................................................. 14
5. D ─ Datatypes........................................................................................................................................16
Integer Types ............................................................................................................................................... 16
Floating-Point Types .................................................................................................................................... 18
Character Types........................................................................................................................................... 19
The void Type............................................................................................................................................... 20
4. D Programming
iii
6. D ─ Enums .............................................................................................................................................21
The enum Syntax ......................................................................................................................................... 21
Named Enums Properties............................................................................................................................ 22
Anonymous Enum........................................................................................................................................ 23
Enum with Base Type Syntax....................................................................................................................... 23
More Features ............................................................................................................................................. 24
7. D ─ Literals ............................................................................................................................................26
Integer Literals............................................................................................................................................. 26
Floating Point Literals .................................................................................................................................. 27
Boolean Literals ........................................................................................................................................... 27
Character Literals......................................................................................................................................... 28
String Literals ............................................................................................................................................... 29
8. D ─ Operators........................................................................................................................................30
Arithmetic Operators................................................................................................................................... 30
Relational Operators.................................................................................................................................... 32
Logical Operators......................................................................................................................................... 34
Bitwise Operators ........................................................................................................................................ 36
Assignment Operators................................................................................................................................. 38
Miscillaneous Operators - Sizeof and Ternary............................................................................................. 41
Operators Precedence in D.......................................................................................................................... 42
9. D ─ Loops ..............................................................................................................................................45
While Loop................................................................................................................................................... 46
for Loop........................................................................................................................................................ 48
Do…While Loop............................................................................................................................................ 50
Nested Loops ............................................................................................................................................... 52
Loop Control Statements............................................................................................................................. 54
Break Statement.......................................................................................................................................... 55
Continue Statement..................................................................................................................................... 56
The Infinite Loop.......................................................................................................................................... 58
10. D ─ Decisions.........................................................................................................................................59
if Statement in D.......................................................................................................................................... 60
if… else Statement ....................................................................................................................................... 61
The if...else if...else Statement..................................................................................................................... 63
Nested if Statements ................................................................................................................................... 65
Switch Statement......................................................................................................................................... 66
Nested Switch Statement ............................................................................................................................ 68
The ? : Operator in D ................................................................................................................................... 70
11. D ─ Functions ........................................................................................................................................71
Function Definition in D............................................................................................................................... 71
Calling a Function......................................................................................................................................... 71
Function Types in D ..................................................................................................................................... 71
Pure Functions............................................................................................................................................. 72
Nothrow Functions...................................................................................................................................... 73
Ref Functions ............................................................................................................................................... 73
Auto Functions............................................................................................................................................. 74
5. D Programming
iv
Variadic Functions ....................................................................................................................................... 75
Inout Functions............................................................................................................................................ 76
Property Functions ...................................................................................................................................... 77
12. D ─ Characters.......................................................................................................................................79
Reading Characters in D............................................................................................................................... 80
13. D ─ Strings.............................................................................................................................................82
Character Array............................................................................................................................................ 82
Core Language String................................................................................................................................... 82
String Concatenation ................................................................................................................................... 83
Length of String ........................................................................................................................................... 84
String Comparison ....................................................................................................................................... 84
Replacing Strings.......................................................................................................................................... 85
Index Methods............................................................................................................................................. 86
Handling Cases............................................................................................................................................. 86
Restricting Characters.................................................................................................................................. 87
14. D ─ Arrays..............................................................................................................................................88
Declaring Arrays........................................................................................................................................... 88
Initializing Arrays ......................................................................................................................................... 88
Accessing Array Elements............................................................................................................................ 89
Static Arrays Versus Dynamic Arrays........................................................................................................... 90
Array Properties........................................................................................................................................... 90
Multi Dimensional Arrays in D..................................................................................................................... 92
Two-Dimensional Arrays in D ...................................................................................................................... 92
Initializing Two-Dimensional Arrays ............................................................................................................ 93
Accessing Two-Dimensional Array Elements............................................................................................... 93
Common Array Operations in D................................................................................................................... 94
15. D ─ Associative Arrays...........................................................................................................................97
Initializing Associative Array ........................................................................................................................ 98
Properties of Associative Array.................................................................................................................... 98
16. D ─ Pointers.........................................................................................................................................101
What Are Pointers? ................................................................................................................................... 101
Using Pointers in D programming.............................................................................................................. 102
Null Pointers .............................................................................................................................................. 103
Pointer Arithmetic ..................................................................................................................................... 103
Incrementing a Pointer.............................................................................................................................. 104
Pointers vs Array........................................................................................................................................ 105
Pointer to Pointer ...................................................................................................................................... 106
Passing Pointer to Functions ..................................................................................................................... 107
Return Pointer from Functions.................................................................................................................. 108
Pointer to an Array .................................................................................................................................... 109
6. D Programming
v
17. D ─ Tuples ...........................................................................................................................................111
Tuple Using tuple() .................................................................................................................................... 111
Tuple using Tuple Template....................................................................................................................... 111
Expanding Property and Function Params................................................................................................. 112
TypeTuple .................................................................................................................................................. 113
18. D ─ Structures......................................................................................................................................115
Defining a Structure................................................................................................................................... 115
Accessing Structure Members................................................................................................................... 116
Structures as Function Arguments ............................................................................................................ 117
Structs Initialization ................................................................................................................................... 119
Static Members.......................................................................................................................................... 120
19. D ─ Unions...........................................................................................................................................122
Defining a Union in D................................................................................................................................. 122
Accessing Union Members ........................................................................................................................ 123
20. D ─ Ranges ..........................................................................................................................................126
Number ranges .......................................................................................................................................... 126
Phobos Ranges........................................................................................................................................... 126
InputRange ................................................................................................................................................ 126
ForwardRange............................................................................................................................................ 129
BidirectionalRange..................................................................................................................................... 130
Infinite RandomAccessRange .................................................................................................................... 132
Finite RandomAccessRange....................................................................................................................... 134
OutputRange ............................................................................................................................................. 139
21. D ─ Aliases...........................................................................................................................................141
Alias for a Tuple ......................................................................................................................................... 142
Alias for Data Types ................................................................................................................................... 142
Alias for Class Variables ............................................................................................................................. 143
Alias This.................................................................................................................................................... 144
22. D ─ Mixins ...........................................................................................................................................146
String Mixins .............................................................................................................................................. 146
Template Mixins ........................................................................................................................................ 147
Mixin Name Spaces.................................................................................................................................... 148
23. D ─ Modules........................................................................................................................................150
File and Module Names............................................................................................................................. 150
D Packages................................................................................................................................................. 151
Using Modules in Programs....................................................................................................................... 151
Locations of Modules ................................................................................................................................ 152
Long and Short Module Names ................................................................................................................. 152
7. D Programming
vi
24. D ─ Templates .....................................................................................................................................155
Function Template..................................................................................................................................... 155
Function Template with Multiple Type Parameters.................................................................................. 156
Class Templates ......................................................................................................................................... 156
25. D ─ Immutables...................................................................................................................................159
Types of Immutable Variables in D............................................................................................................ 159
enum Constants in D.................................................................................................................................. 159
Immutable Variables in D .......................................................................................................................... 160
Const Variables in D................................................................................................................................... 161
Immutable Parameters in D....................................................................................................................... 162
26. D ─ File I/O ..........................................................................................................................................163
Opening Files in D ...................................................................................................................................... 163
Closing a File in D....................................................................................................................................... 164
Writing a File in D ...................................................................................................................................... 164
Reading a File in D ..................................................................................................................................... 164
27. D ─ Concurrency..................................................................................................................................167
Initiating Threads in D................................................................................................................................ 167
Thread Identifiers in D ............................................................................................................................... 168
Message Passing in D................................................................................................................................. 169
Message Passing with Wait in D ................................................................................................................ 171
28. D ─ Exception Handling .......................................................................................................................173
Throwing Exceptions in D .......................................................................................................................... 174
Catching Exceptions in D............................................................................................................................ 174
29. D ─ Contract Programming..................................................................................................................177
Body Block in D .......................................................................................................................................... 177
In Block for Pre Conditions in D ................................................................................................................. 177
Out Blocks for Post Conditions in D........................................................................................................... 178
30. D ─ Conditional Compilation................................................................................................................180
Debug Statement in D ............................................................................................................................... 180
Debug (tag) Statement in D ....................................................................................................................... 181
Debug (level) Statement in D..................................................................................................................... 181
Version (tag) and Version (level) Statements in D..................................................................................... 182
Static if....................................................................................................................................................... 182
PART II – OBJECT ORIENTED D.................................................................................................184
31. D ─ Classes and Objects.......................................................................................................................185
D Class Definitions ..................................................................................................................................... 185
Defining D Objects ..................................................................................................................................... 185
Accessing the Data Members .................................................................................................................... 186
Classes and Objects in D ............................................................................................................................ 187
Class Member Functions in D .................................................................................................................... 188
Class Access Modifiers in D........................................................................................................................ 189
The Public Members in D........................................................................................................................... 190
8. D Programming
vii
The Private Members ................................................................................................................................ 191
The Protected Members............................................................................................................................ 193
The Class Constructor................................................................................................................................ 194
Parameterized Constructor ....................................................................................................................... 195
The Class Destructor.................................................................................................................................. 196
this Pointer in D ......................................................................................................................................... 198
Pointer to D Classes................................................................................................................................... 199
Static Members of a Class.......................................................................................................................... 201
Static Function Members........................................................................................................................... 202
32. D ─ Inheritance....................................................................................................................................205
Base Classes and Derived Classes in D....................................................................................................... 205
Access Control and Inheritance ................................................................................................................. 206
Multi Level Inheritance.............................................................................................................................. 207
33. D ─ Overloading ..................................................................................................................................209
Function Overloading ................................................................................................................................ 209
Operator Overloading................................................................................................................................ 210
Operator Overloading Types ..................................................................................................................... 213
Unary Operators........................................................................................................................................ 213
Binary Operators........................................................................................................................................ 216
Comparison of Operator Overloading ....................................................................................................... 219
34. D ─ Encapsulation................................................................................................................................222
Data Encapsulation in D............................................................................................................................. 223
Class Designing Strategy in D..................................................................................................................... 224
35. D ─ Interfaces......................................................................................................................................225
Interface with Final and Static Functions in D ........................................................................................... 226
36. D ─ Abstract Classes ............................................................................................................................229
Using Abstract Class in D ........................................................................................................................... 229
Abstract Functions..................................................................................................................................... 230
10. D Programming
9
D programming language is an object-oriented multi-paradigm system programming
language developed by Walter Bright of Digital Mars. Its development started in 1999 and
was first released in 2001. The major version of D(1.0) was released in 2007. Currently, we
have D2 version of D.
D is language with syntax being C style and uses static typing. There are many features of C
and C++ in D but also there are some features from these language not included part of D.
Some of the notable additions to D includes,
Unit testing
True modules
Garbage collection
First class arrays
Free and open
Associative arrays
Dynamic arrays
Inner classes
Closures
Anonymous functions
Lazy evaluation
Closures
MultipleParadigms
D is a multiple paradigm programming language. The multiple paradigms includes,
Imperative
Object Oriented
Meta programming
Functional
Concurrent
1. D ─ OVERVIEW
11. D Programming
10
Example
import std.stdio;
void main(string[] args)
{
writeln("Hello World!");
}
LearningD
The most important thing to do when learning D is to focus on concepts and not get lost in
language technical details.
The purpose of learning a programming language is to become a better programmer; that is,
to become more effective at designing and implementing new systems and at maintaining old
ones.
ScopeofD
D programming has some interesting features and the official D programming site claims that
D is convenient, powerful and efficient. D programming adds many features in the core
language which C language has provided in the form of Standard libraries such as resizable
array and string function. D makes an excellent second language for intermediate to advanced
programmers. D is better in handling memory and managing the pointers that often causes
trouble in C++.
D programming is intended mainly on new programs that conversion of existing programs. It
provides built in testing and verification an ideal for large new project that will be written with
millions of lines of code by large teams.
12. D Programming
11
TryitOptionOnline
You really do not need to set up your own environment to start learning D programming
language. Reason is very simple, we already have set up D Programming environment online
under “Try it” option. Using this option, you can build and execute all the given examples
online at the same time when you are learning theory. This gives you confidence in what you
are reading and checking the result with different options. Feel free to modify any example
and execute it online.
Try following example using Try it option available at the top right corner of the below sample
code box:
import std.stdio;
void main(string[] args)
{
writeln("Hello World!");
}
For most of the examples given in this tutorial, you will find Try it option, so just make use
of it and enjoy learning.
LocalEnvironmentSetupforD
If you are still willing to set up your environment for D programming language, you need the
following two softwares available on your computer, (a) Text Editor,(b)D Compiler.
TextEditorforDProgramming
This will be used to type your program. Examples of few editors include Windows Notepad,
OS Edit command, Brief, Epsilon, EMACS, and vim or vi.
Name and version of text editor can vary on different operating systems. For example,
Notepad will be used on Windows, and vim or vi can be used on windows as well as Linux or
UNIX.
The files you create with your editor are called source files and contain program source code.
The source files for D programs are named with the extension ".d".
2. D ─ ENVIRONMENT
13. D Programming
12
Before starting your programming, make sure you have one text editor in place and you have
enough experience to write a computer program, save it in a file, build it and finally execute
it.
TheDCompiler
Most current D implementations compile directly into machine code for efficient execution.
We have multiple D compilers available and it includes the following.
DMD - The Digital Mars D compiler is the official D compiler by Walter Bright.
GDC - A front-end for the GCC back-end, built using the open DMD compiler source
code.
LDC - A compiler based on the DMD front-end that uses LLVM as its compiler back-
end.
The above different compilers can be downloaded from D downloads
We will be using D version 2 and we recommend not to download D1.
Let’s have a helloWorld.d program as follows. We will use this as first program we run on
platform you choose.
import std.stdio;
void main(string[] args)
{
writeln("Hello World!");
}
InstallationofDonWindows
Download the windows installer.
Run the downloaded executable to install the D which can be done by following the on screen
instructions.
Now we can build and run a d file say helloWorld.d by switching to folder containing the file
using cd and then using the following steps:
C:DProgramming> DMD helloWorld.d
C:DProgramming> helloWorld
We can see the following output.
hello world
14. D Programming
13
C:DProgramming is the folder, I am using to save my samples. You can change it to the
folder that you have saved D programs.
InstallationofDonUbuntu/Debian
Download the debian installer.
Run the downloaded executable to install the D which can be done by following the on screen
instructions.
Now we can build and run a d file say helloWorld.d by switching to folder containing the file
using cd and then using the following steps
$ dmd helloWorld.d
$ ./helloWorld
We can see the following output.
$ hello world
InstallationofDonMacOSX
Download the Mac installer.
Run the downloaded executable to install the D which can be done by following the on screen
instructions.
Now we can build and run a d file say helloWorld.d by switching to folder containing the file
using cd and then using the following steps
$ dmd helloWorld.d
$ ./helloWorld
We can see the following output.
$ hello world
InstallationofDonFedora
Download the fedora installer.
Run the downloaded executable to install the D which can be done by following the on screen
instructions.
Now we can build and run a d file say helloWorld.d by switching to folder containing the file
using cd and then using the following steps:
15. D Programming
14
$ dmd helloWorld.d
$ ./helloWorld
We can see the following output.
$ hello world
InstallationofDonOpenSUSE
Download the OpenSUSE installer.
Run the downloaded executable to install the D which can be done by following the on screen
instructions.
Now we can build and run a d file say helloWorld.d by switching to folder containing the file
using cd and then using the following steps
$ dmd helloWorld.d
$ ./helloWorld
We can see the following output.
$ hello world
DIDE
We have IDE support for D in the form of plugins in most cases. This includes,
Visual D plugin is a plugin for Visual Studio 2005-13
DDT is a eclipse plugin that provides code completion, debugging with GDB.
Mono-D code completion, refactoring with dmd/ldc/gdc support. It has been part of
GSoC 2012.
Code Blocks is a multi-platform IDE that supports D project creation, highlighting and
debugging.
16. D Programming
15
D is quite simple to learn and let’s start creating our first D program!
FirstDProgram
Let us write a simple D program. All D files will have extension ".d". So put the following
source code in a test.d file.
import std.stdio;
/* My first program in D */
void main(string[] args)
{
writeln("test!");
}
Assuming D environment is setup correctly, lets run the programming using:
$ dmd test.d
$ ./test
We will get the following output.
test
Let us now see the basic structure of D program, so that it will be easy for you to understand
basic building blocks of the D programming language.
ImportinD
Libraries which are collections of reusable program parts can be made available to our project
with the help of import. Here we import the standard io library which provides the basic I/O
operations. writeln which is used in above program is a function in D's standard library. It is
used for printing a line of text. Library contents in D are grouped into modules which is based
on the types of tasks that they intend perform. The only module that this program uses is
std.stdio, which handles data input and output.
MainFunction
Main function is the starting of the program and it determines the order of execution and how
other sections of the program should be executed.
3. D ─ BASIC SYNTAX
17. D Programming
16
TokensinD
A D program consists of various tokens and a token is either a keyword, an identifier, a
constant, a string literal, or a symbol. For example, the following D statement consists of four
tokens:
writeln("test!");
The individual tokens are:
writeln
(
"test!"
)
;
Comments
Comments are like supporting text in your D program and they are ignored by the compiler.
Multi line comment starts with /* and terminates with the characters */ as shown below:
/* My first program in D */
Single comment is written using // in the beginning of the comment.
// my first program in D
Identifiers
A D identifier is a name used to identify a variable, function, or any other user-defined item.
An identifier starts with a letter A to Z or a to z or an underscore _ followed by zero or more
letters, underscores, and digits (0 to 9).
D does not allow punctuation characters such as @, $, and % within identifiers. D is a case
sensitive programming language. Thus Manpower and manpower are two different
identifiers in D. Here are some examples of acceptable identifiers:
mohd zara abc move_name a_123
myname50 _temp j a23b9 retVal
18. D Programming
17
Keywords
The following list shows few of the reserved words in D. These reserved words may not be
used as constant or variable or any other identifier names.
abstract alias align asm
assert auto body bool
byte case cast catch
char class const continue
dchar debug default delegate
deprecated do double else
enum export extern false
final finally float for
foreach function goto if
import in inout int
interface invariant is long
macro mixin module new
null out override package
pragma private protected public
real ref return scope
short static struct super
switch synchronized template this
19. D Programming
18
throw true try typeid
typeof ubyte uint ulong
union unittest ushort version
void wchar while with
WhitespaceinD
A line containing only whitespace, possibly with a comment, is known as a blank line, and a
D compiler totally ignores it.
Whitespace is the term used in D to describe blanks, tabs, newline characters and comments.
Whitespace separates one part of a statement from another and enables the interpreter to
identify where one element in a statement, such as int, ends and the next element begins.
Therefore, in the following statement:
local age
There must be at least one whitespace character (usually a space) between local and age for
the interpreter to be able to distinguish them. On the other hand, in the following statement
int fruit = apples + oranges //get the total fruits
No whitespace characters are necessary between fruit and =, or between = and apples,
although you are free to include some if you wish for readability purpose.
20. D Programming
19
A variable is nothing but a name given to a storage area that our programs can manipulate.
Each variable in D has a specific type, which determines the size and layout of the variable's
memory; the range of values that can be stored within that memory; and the set of operations
that can be applied to the variable.
The name of a variable can be composed of letters, digits, and the underscore character. It
must begin with either a letter or an underscore. Upper and lowercase letters are distinct
because D is case-sensitive. Based on the basic types explained in the previous chapter, there
will be the following basic variable types:
Type Description
char Typically a single octet (one byte). This is an integer type.
int The most natural size of integer for the machine.
float A single-precision floating point value.
double A double-precision floating point value.
void Represents the absence of type.
D programming language also allows to define various other types of variables such as
Enumeration, Pointer, Array, Structure, Union, etc., which we will cover in subsequent
chapters. For this chapter, let us study only basic variable types.
VariableDefinitioninD
A variable definition tells the compiler where and how much space to create for the variable.
A variable definition specifies a data type and contains a list of one or more variables of that
type as follows:
type variable_list;
Here, type must be a valid D data type including char, wchar, int, float, double, bool, or any
user-defined object, etc., and variable_list may consist of one or more identifier names
separated by commas. Some valid declarations are shown here:
4. D ─ VARIABLES
21. D Programming
20
int i, j, k;
char c, ch;
float f, salary;
double d;
The line int i, j, k; both declares and defines the variables i, j and k; which instructs the
compiler to create variables named i, j, and k of type int.
Variables can be initialized (assigned an initial value) in their declaration. The initializer
consists of an equal sign followed by a constant expression as follows:
type variable_name = value;
Example
extern int d = 3, f = 5; // declaration of d and f.
int d = 3, f = 5; // definition and initializing d and f.
byte z = 22; // definition and initializes z.
char x = 'x'; // the variable x has the value 'x'.
When a variable is declared in D, it is always set to its 'default initializer', which can be
manually accessed as T.init where T is the type (ex. int.init). The default initializer for integer
types is 0, for Booleans false, and for floating-point numbers NaN.
VariableDeclarationinD
A variable declaration provides assurance to the compiler that there is one variable existing
with the given type and name so that compiler proceed for further compilation without
needing complete detail about the variable. A variable declaration has its meaning at the time
of compilation only, compiler needs actual variable declaration at the time of linking of the
program.
Example
Try the following example, where variables have been declared at the start of the program,
but are defined and initialized inside the main function:
import std.stdio;
int a = 10, b =10;
int c;
float f;
22. D Programming
21
int main ()
{
writeln("Value of a is : ", a);
/* variable re definition: */
int a, b;
int c;
float f;
/* Initialization */
a = 30;
b = 40;
writeln("Value of a is : ", a);
c = a + b;
writeln("Value of c is : ", c);
f = 70.0/3.0;
writeln("Value of f is : ", f);
return 0;
}
When the above code is compiled and executed, it produces the following result:
Value of a is : 10
Value of a is : 30
Value of c is : 70
Value of f is : 23.3333
LvaluesandRvaluesinD
There are two kinds of expressions in D:
lvalue : An expression that is an lvalue may appear as either the left-hand or right-
hand side of an assignment.
rvalue : An expression that is an rvalue may appear on the right- but not left-hand
side of an assignment.
Variables are lvalues and so may appear on the left-hand side of an assignment. Numeric
literals are rvalues and so may not be assigned and cannot appear on the left-hand side.
23. D Programming
22
The following statement is valid:
int g = 20;
But the following is not a valid statement and would generate a compile-time error:
10 = 20;
24. D Programming
23
In the D programming language, data types refer to an extensive system used for declaring
variables or functions of different types. The type of a variable determines how much space
it occupies in storage and how the stored bit pattern is interpreted.
The types in D can be classified as follows:
Sr. No. Types and Description
1 Basic Types:
They are arithmetic types and consist of the three types: (a) integer, (b)
floating-point, and (c) character.
2 Enumerated types:
They are again arithmetic types. They are used to define variables that can
only be assigned certain discrete integer values throughout the program.
3 The type void:
The type specifier void indicates that no value is available.
4 Derived types:
They include (a) Pointer types, (b) Array types, (c) Structure types, (d)
Union types, and (e) Function types.
The array types and structure types are referred to collectively as the aggregate types. The
type of a function specifies the type of the function's return value. We will see basic types in
the following section whereas other types will be covered in the upcoming chapters.
IntegerTypes
The following table gives lists standard integer types with their storage sizes and value
ranges:
Type Storage size Value range
bool 1 byte false or true
5. D ─ DATATYPES
25. D Programming
24
byte 1 byte -128 to 127
ubyte 1 byte 0 to 255
int 4 bytes -2,147,483,648 to 2,147,483,647
uint 4 bytes 0 to 4,294,967,295
short 2 bytes -32,768 to 32,767
ushort 2 bytes 0 to 65,535
long 8 bytes -9223372036854775808 to 9223372036854775807
ulong 8 bytes 0 to 18446744073709551615
To get the exact size of a type or a variable, you can use the sizeof operator. The expression
type.(sizeof) yields the storage size of the object or type in bytes. The following example gets
the size of int type on any machine:
import std.stdio;
int main()
{
writeln("Length in bytes: ", ulong.sizeof);
return 0;
}
When you compile and execute the above program, it produces the following result:
Length in bytes: 8
26. D Programming
25
Floating-PointTypes
The following table mentions standard float-point types with storage sizes, value ranges, and
their purpose:
Type
Storage
size
Value range Purpose
float 4 bytes 1.17549e-38 to 3.40282e+38 6 decimal places
double 8 bytes 2.22507e-308 to 1.79769e+308 15 decimal places
real 10 bytes 3.3621e-4932 to 1.18973e+4932
either the largest
floating point type
that the hardware
supports, or double;
whichever is larger
ifloat 4 bytes 1.17549e-38i to 3.40282e+38i
imaginary value type
of float
idouble 8 bytes 2.22507e-308i to 1.79769e+308i
imaginary value type
of double
ireal 10 bytes 3.3621e-4932 to 1.18973e+4932
imaginary value type
of real
cfloat 8 bytes
1.17549e-38+1.17549e-38i to
3.40282e+38+3.40282e+38i
complex number
type made of two
floats
cdouble 16 bytes
2.22507e-308+2.22507e-308i to
1.79769e+308+1.79769e+308i
complex number
type made of two
doubles
creal 20 bytes
3.3621e-4932+3.3621e-4932i to
1.18973e+4932+1.18973e+4932i
complex number
type made of two
reals
27. D Programming
26
The following example prints storage space taken by a float type and its range values:
import std.stdio;
int main()
{
writeln("Length in bytes: ", float.sizeof);
return 0;
}
When you compile and execute the above program, it produces the following result on Linux:
Storage size for float : 4
CharacterTypes
The following table lists standard character types with storage sizes and its purpose.
Type Storage size Purpose
char 1 byte UTF-8 code unit
wchar 2 bytes UTF-16 code unit
dchar 4 bytes UTF-32 code unit and Unicode code point
The following example prints storage space taken by a char type.
import std.stdio;
int main()
{
writeln("Length in bytes: ", char.sizeof);
return 0;
}
When you compile and execute the above program, it produces the following result:
Storage size for float : 1
28. D Programming
27
ThevoidType
The void type specifies that no value is available. It is used in two kinds of situations:
Sr. No. Types and Description
1
Function returns as void
There are various functions in D which do not return value or you can say
they return void. A function with no return value has the return type as void.
For example, void exit (int status);
2
Function arguments as void
There are various functions in D which do not accept any parameter. A
function with no parameter can accept as a void. For example, int
rand(void);
The void type may not be understood to you at this point, so let us proceed and we will cover
these concepts in upcoming chapters.
29. D Programming
28
End of ebook preview
If you liked what you saw…
Buy it from our store @ https://store.tutorialspoint.com