text:
GLONASS

GLONASS (ГЛОНАСС, ; Глобальная навигационная спутниковая система) is a Russian satellite navigation system operating as part of a radionavigation-satellite service. It provides an alternative to Global Positioning System (GPS) and is the second navigational system in operation with global coverage and of comparable precision.

Satellite navigation devices supporting both GPS and GLONASS have more satellites available, meaning positions can be fixed more quickly and accurately, especially in built-up areas where buildings may obscure the view to some satellites. GLONASS supplementation of GPS systems also improves positioning in high latitudes (north or south).

Development of GLONASS began in the Soviet Union in 1976. Beginning on 12 October 1982, numerous rocket launches added satellites to the system until the completion of the constellation in 1995. In 2001, after a decline in capacity during the late 1990s, the restoration of the system was made a government priority, and funding increased substantially. GLONASS is the most expensive program of the Roscosmos, consuming a third of its budget in 2010.

By 2010, GLONASS had achieved full coverage of Russia's territory. In October 2011, the full orbital constellation of 24 satellites was restored, enabling full global coverage. The GLONASS satellites' designs have undergone several upgrades, with the latest version, GLONASS-K2, launched in 2023.

In 2020, Glonass-BDD LLC checked the information system for analyzing and preventing traffic accidents and published a digital safety rating for 3,000 km of Russian roads.

System description
GLONASS is a global navigation satellite system, providing real time position and velocity determination for military and civilian users. The satellites are located in middle circular orbit at 19100 km altitude with a 64.8° inclination and an orbital period of 11 hours and 16 minutes (every 17 revolutions, done in 8 sidereal days, a satellite passes over the same location ). GLONASS's orbit makes it especially suited for usage in high latitudes (north or south), where getting a GPS signal can be problematic.

The constellation operates in three orbital planes, with eight evenly spaced satellites on each. A fully operational constellation with global coverage consists of 24 satellites, while 18 satellites are necessary for covering the territory of Russia. To get a position fix the receiver must be in the range of at least four satellites.

FDMA

GLONASS satellites transmit two types of signals: open standard-precision signal L1OF/L2OF, and obfuscated high-precision signal L1SF/L2SF.

The signals use similar DSSS encoding and binary phase-shift keying (BPSK) modulation as in GPS signals. All GLONASS satellites transmit the same code as their standard-precision signal; however each transmits on a different frequency using a 15-channel frequency-division multiple access (FDMA) technique spanning either side from 1602.0 MHz, known as the L1 band. The center frequency is 1602 MHz + n × 0.5625 MHz, where n is a satellite's frequency channel number (n=−6,...,0,...,6, previously n=0,...,13). Signals are transmitted in a 38° cone, using right-hand circular polarization, at an EIRP between 25 and 27 dBW (316 to 500 watts). Note that the 24-satellite constellation is accommodated with only 15 channels by using identical frequency channels to support antipodal (opposite side of planet in orbit) satellite pairs, as these satellites are never both in view of an Earth-based user at the same time.

The L2 band signals use the same FDMA as the L1 band signals, but transmit straddling 1246 MHz with the center frequency 1246 MHz + n × 0.4375 MHz, where n spans the same range as for L1. In the original GLONASS design, only obfuscated high-precision signal was broadcast in the L2 band, but starting with GLONASS-M, an additional civil reference signal L2OF is broadcast with an identical standard-precision code to the L1OF signal.

The open standard-precision signal is generated with modulo-2 addition (XOR) of 511 kbit/s pseudo-random ranging code, 50 bit/s navigation message, and an auxiliary 100 Hz meander sequence (Manchester code), all generated using a single time/frequency oscillator. The pseudo-random code is generated with a 9-stage shift register operating with a period of 1 milliseconds.

The navigational message is modulated at 50 bits per second. The superframe of the open signal is 7500 bits long and consists of 5 frames of 30 seconds, taking 150 seconds (2.5 minutes) to transmit the continuous message. Each frame is 1500 bits long and consists of 15 strings of 100 bits (2 seconds for each string), with 85 bits (1.7 seconds) for data and check-sum bits, and 15 bits (0.3 seconds) for time mark. Strings 1-4 provide immediate data for the transmitting satellite, and are repeated every frame; the data include ephemeris, clock and frequency offsets, and satellite status. Strings 5-15 provide non-immediate data (i.e. almanac) for each satellite in the constellation, with frames I-IV each describing five satellites, and frame V describing remaining four satellites.

The ephemerides are updated every 30 minutes using data from the Ground Control segment; they use Earth Centred Earth Fixed (ECEF) Cartesian coordinates in position and velocity, and include lunisolar acceleration parameters. The almanac uses modified orbital elements (Keplerian elements) and is updated daily.

The more accurate high-precision signal is available for authorized users, such as the Russian military, yet unlike the United States P(Y) code, which is modulated by an encrypting W code, the GLONASS restricted-use codes are broadcast in the clear using only security through obscurity. The details of the high-precision signal have not been disclosed. The modulation (and therefore the tracking strategy) of the data bits on the L2SF code has recently changed from unmodulated to 250 bit/s burst at random intervals. The L1SF code is modulated by the navigation data at 50 bit/s without a Manchester meander code.

The high-precision signal is broadcast in phase quadrature with the standard-precision signal, effectively sharing the same carrier wave, but with a ten-times-higher bandwidth than the open signal. The message format of the high-precision signal remains unpublished, although attempts at reverse-engineering indicate that the superframe is composed of 72 frames, each containing 5 strings of 100 bits and taking 10 seconds to transmit, with total length of 36 000 bits or 720 seconds (12 minutes) for the whole navigational message. The additional data are seemingly allocated to critical Lunisolar acceleration parameters and clock correction terms.

Accuracy
At peak efficiency, the standard-precision signal offers horizontal positioning accuracy within 5–10 metres, vertical positioning within 15 m, a velocity vector measuring within 100 mm/s, and timing within 200 nanoseconds, all based on measurements from four first-generation satellites simultaneously; newer satellites such as GLONASS-M improve on this.

GLONASS uses a coordinate datum named "PZ-90" (Earth Parameters 1990 – Parametry Zemli 1990), in which the precise location of the North Pole is given as an average of its position from 1990 to 1995. This is in contrast to the GPS's coordinate datum, WGS 84, which uses the location of the North Pole in 1984. As of 17 September 2007, the PZ-90 datum has been updated to version PZ-90.02 which differ from WGS 84 by less than 400 mm in any given direction. Since 31 December 2013, version PZ-90.11 is being broadcast, which is aligned to the International Terrestrial Reference System and Frame 2008 at epoch 2011.0 at the centimetre level, but ideally a conversion to ITRF2008 should be done.

CDMA
Since 2008, new CDMA signals are being researched for use with GLONASS.

The interface control documents for GLONASS CDMA signals was published in August 2016.

According to GLONASS developers, there will be three open and two restricted CDMA signals. The open signal L3OC is centered at 1202.025 MHz and uses BPSK(10) modulation for both data and pilot channels; the ranging code transmits at 10.23 million chips per second, modulated onto the carrier frequency using QPSK with in-phase data and quadrature pilot. The data is error-coded with 5-bit Barker code and the pilot with 10-bit Neuman-Hoffman code.

Open L1OC and restricted L1SC signals are centered at 1600.995 MHz, and open L2OC and restricted L2SC signals are centered at 1248.06 MHz, overlapping with GLONASS FDMA signals. Open signals L1OC and L2OC use time-division multiplexing to transmit pilot and data signals, with BPSK(1) modulation for data and BOC(1,1) modulation for pilot; wide-band restricted signals L1SC and L2SC use BOC (5, 2.5) modulation for both data and pilot, transmitted in quadrature phase to the open signals; this places peak signal strength away from the center frequency of narrow-band open signals.

Binary phase-shift keying (BPSK) is used by standard GPS and GLONASS signals. Binary offset carrier (BOC) is the modulation used by Galileo, modernized GPS, and BeiDou-2.

The navigational message of CDMA signals is transmitted as a sequence of text strings. The message has variable size - each pseudo-frame usually includes six strings and contains ephemerides for the current satellite (string types 10, 11, and 12 in a sequence) and part of the almanac for three satellites (three strings of type 20). To transmit the full almanac for all current 24 satellites, a superframe of 8 pseudo-frames is required. In the future, the superframe will be expanded to 10 pseudo-frames of data to cover full 30 satellites.

The message can also contain Earth's rotation parameters, ionosphere models, long-term orbit parameters for GLONASS satellites, and COSPAS-SARSAT messages. The system time marker is transmitted with each string; UTC leap second correction is achieved by shortening or lengthening (zero-padding) the final string of the day by one second, with abnormal strings being discarded by the receiver.

The strings have a version tag to facilitate forward compatibility: future upgrades to the message format will not break older equipment, which will continue to work by ignoring new data (as long as the constellation still transmits old string types), but up-to-date equipment will be able to use additional information from newer satellites.

The navigational message of the L3OC signal is transmitted at 100 bit/s, with each string of symbols taking 3 seconds (300 bits). A pseudo-frame of 6 strings takes 18 seconds (1800 bits) to transmit. A superframe of 8 pseudo-frames is 14,400 bits long and takes 144 seconds (2 minutes 24 seconds) to transmit the full almanac.

The navigational message of the L1OC signal is transmitted at 100 bit/s. The string is 250 bits long and takes 2.5 seconds to transmit. A pseudo-frame is 1500 bits (15 seconds) long, and a superframe is 12,000 bits or 120 seconds (2 minutes).

L2OC signal does not transmit any navigational message, only the pseudo-range codes:

Glonass-K1 test satellite launched in 2011 introduced L3OC signal. Glonass-M satellites produced since 2014 (s/n 755+) will also transmit L3OC signal for testing purposes.

Enhanced Glonass-K1 and Glonass-K2 satellites, to be launched from 2023, will feature a full suite of modernized CDMA signals in the existing L1 and L2 bands, which includes L1SC, L1OC, L2SC, and L2OC, as well as the L3OC signal. Glonass-K2 series should gradually replace existing satellites starting from 2023, when Glonass-M launches will cease.

Glonass-KM satellites will be launched by 2025. Additional open signals are being studied for these satellites, based on frequencies and formats used by existing GPS, Galileo, and Beidou/COMPASS signals:

Such an arrangement will allow easier and cheaper implementation of multi-standard GNSS receivers.
 * open signal L1OCM using BOC(1,1) modulation centered at 1575.42 MHz, similar to modernized GPS signal L1C, Galileo signal E1, and Beidou/COMPASS signal B1C;
 * open signal L5OCM using BPSK(10) modulation centered at 1176.45 MHz, similar to the GPS "Safety of Life" (L5), Galileo signal E5a, and Beidou/COMPASS signal B2a;
 * open signal L3OCM using BPSK(10) modulation centered at 1207.14 MHz, similar to Galileo signal E5b and Beidou/COMPASS signal B2b.

With the introduction of CDMA signals, the constellation will be expanded to 30 active satellites by 2025; this may require eventual deprecation of FDMA signals. The new satellites will be deployed into three additional planes, bringing the total to six planes from the current three—aided by System for Differential Correction and Monitoring (SDCM), which is a GNSS augmentation system based on a network of ground-based control stations and communication satellites Luch 5A and Luch 5B.

Six additional Glonass-V satellites, using Tundra orbit in three orbital planes, will be launched starting in 2025; this regional high-orbit segment will offer increased regional availability and 25% improvement in precision over Eastern Hemisphere, similar to Japanese QZSS system and Beidou-1. The new satellites will form two ground traces with inclination of 64.8°, eccentricity of 0.072, period of 23.9 hours, and ascending node longitude of 60° and 120°. Glonass-V vehicles are based on Glonass-K platform and will broadcast new CDMA signals only. Previously Molniya orbit, geosynchronous orbit, or inclined orbit were also under consideration for the regional segment.

Satellites
The main contractor of the GLONASS program is Joint Stock Company Information Satellite Systems Reshetnev (ISS Reshetnev, formerly called NPO-PM). The company, located in Zheleznogorsk, is the designer of all GLONASS satellites, in cooperation with the Institute for Space Device Engineering (ru:РНИИ КП) and the Russian Institute of Radio Navigation and Time. Serial production of the satellites is accomplished by the company Production Corporation Polyot in Omsk.

Over the three decades of development, the satellite designs have gone through numerous improvements, and can be divided into three generations: the original GLONASS (since 1982), GLONASS-M (since 2003) and GLONASS-K (since 2011). Each GLONASS satellite has a GRAU designation 11F654, and each of them also has the military "Cosmos-NNNN" designation.

First generation
The true first generation of GLONASS (also called Uragan) satellites were all three-axis stabilized vehicles, generally weighing 1250 kg and were equipped with a modest propulsion system to permit relocation within the constellation. Over time they were upgraded to Block IIa, IIb, and IIv vehicles, with each block containing evolutionary improvements.

Six Block IIa satellites were launched in 1985–1986 with improved time and frequency standards over the prototypes, and increased frequency stability. These spacecraft also demonstrated a 16-month average operational lifetime. Block IIb spacecraft, with a two-year design lifetimes, appeared in 1987, of which a total of 12 were launched, but half were lost in launch vehicle accidents. The six spacecraft that made it to orbit worked well, operating for an average of nearly 22 months.

Block IIv was the most prolific of the first generation. Used exclusively from 1988 to 2000, and continued to be included in launches through 2005, a total of 56 satellites were launched. The design life was three years, however numerous spacecraft exceeded this, with one late model lasting 68 months, nearly double.

Block II satellites were typically launched three at a time from the Baikonur Cosmodrome using Proton-K Blok-DM2 or Proton-K Briz-M boosters. The only exception was when, on two launches, an Etalon geodetic reflector satellite was substituted for a GLONASS satellite.

Second generation
The second generation of satellites, known as Glonass-M, were developed beginning in 1990 and first launched in 2003. These satellites possess a substantially increased lifetime of seven years and weigh slightly more at 1480 kg. They are approximately 2.4 m in diameter and 3.7 m high, with a solar array span of 7.2 m for an electrical power generation capability of 1600 watts at launch. The aft payload structure houses 12 primary antennas for L-band transmissions. Laser corner-cube reflectors are also carried to aid in precise orbit determination and geodetic research. On-board cesium clocks provide the local clock source. 52 Glonass-M have been produced and launched.

A total of 41 second generation satellites were launched through the end of 2013. As with the previous generation, the second generation spacecraft were launched three at a time using Proton-K Blok-DM2 or Proton-K Briz-M boosters. Some were launched alone with Soyuz-2-1b/Fregat.

In July 2015, ISS Reshetnev announced that it had completed the last GLONASS-M (No. 61) spacecraft and it was putting it in storage waiting for launch, along with eight previously built satellites.

As on 22 September 2017, GLONASS-M No.52 satellite went into operation and the orbital grouping has again increased to 24 space vehicles.

Third generation
GLONASS-K is a substantial improvement of the previous generation: it is the first unpressurised GLONASS satellite with a much reduced mass of 750 kg versus the 1450 kg of GLONASS-M. It has an operational lifetime of 10 years, compared to the 7-year lifetime of the second generation GLONASS-M. It will transmit more navigation signals to improve the system's accuracy — including new CDMA signals in the L3 and L5 bands, which will use modulation similar to modernized GPS, Galileo, and BeiDou. Glonass-K consist of 26 satellites having satellite index 65-98 and widely used in Russian Military space.

The new satellite's advanced equipment—made solely from Russian components — will allow the doubling of GLONASS' accuracy. As with the previous satellites, these are 3-axis stabilized, nadir pointing with dual solar arrays. The first GLONASS-K satellite was successfully launched on 26 February 2011.

Due to their weight reduction, GLONASS-K spacecraft can be launched in pairs from the Plesetsk Cosmodrome launch site using the substantially lower cost Soyuz-2.1b boosters or in six-at-once from the Baikonur Cosmodrome using Proton-K Briz-M launch vehicles.

Ground control

The ground control segment of GLONASS is almost entirely located within former Soviet Union territory, except for several in Brazil and one in Nicaragua.

The GLONASS ground segment consists of:
 * a system control centre;
 * five Telemetry, Tracking and Command centers;
 * two Laser Ranging Stations; and
 * ten Monitoring and Measuring Stations.

Receivers

Companies producing GNSS receivers making use of GLONASS: NPO Progress describes a receiver called GALS-A1, which combines GPS and GLONASS reception.
 * Furuno
 * JAVAD GNSS, Inc
 * Septentrio
 * Topcon
 * C-Nav
 * Magellan Navigation
 * Novatel
 * ComNav technology Ltd.
 * Leica Geosystems
 * Hemisphere GNSS
 * Trimble Inc
 * u-blox

SkyWave Mobile Communications manufactures an Inmarsat-based satellite communications terminal that uses both GLONASS and GPS.

, some of the latest receivers in the Garmin eTrex line also support GLONASS (along with GPS). Garmin also produce a standalone Bluetooth receiver, the GLO for Aviation, which combines GPS, WAAS and GLONASS.

Various smartphones from 2011 onwards have integrated GLONASS capability in addition to their pre-existing GPS receivers, with the intention of reducing signal acquisition periods by allowing the device to pick up more satellites than with a single-network receiver, including devices from:
 * Xiaomi
 * Sony Ericsson
 * ZTE
 * Huawei
 * Samsung
 * Apple (since iPhone 4S, concurrently with GPS)
 * HTC
 * LG
 * Motorola
 * Nokia

Availability
, the GLONASS constellation status is:

The system requires 18 satellites for continuous navigation services covering all of Russia, and 24 satellites to provide services worldwide. The GLONASS system covers 100% of worldwide territory.

On 2 April 2014, the system experienced a technical failure that resulted in practical unavailability of the navigation signal for around 12 hours.

On 14–15 April 2014, nine GLONASS satellites experienced a technical failure due to software problems.

On 19 February 2016, three GLONASS satellites experienced a technical failure: the batteries of GLONASS-738 exploded, the batteries of GLONASS-737 were depleted, and GLONASS-736 experienced a stationkeeping failure due to human error during maneuvering. GLONASS-737 and GLONASS-736 were expected to be operational again after maintenance, and one new satellite (GLONASS-751) to replace GLONASS-738 was expected to complete commissioning in early March 2016. The full capacity of the satellite group was expected to be restored in the middle of March 2016.

After the launching of two new satellites and maintenance of two others, the full capacity of the satellite group was restored.

Accuracy
According to Russian System of Differentional Correction and Monitoring's data,, precision of GLONASS navigation definitions (for p=0.95) for latitude and longitude were 4.46 – with mean number of navigation space vehicles (NSV) equals 7—8 (depending on station). In comparison, the same time precision of GPS navigation definitions were 2.00 – with mean number of NSV equals 6—11 (depending on station).

Some modern receivers are able to use both GLONASS and GPS satellites together, providing greatly improved coverage in urban canyons and giving a very fast time to fix due to over 50 satellites being available. In indoor, urban canyon or mountainous areas, accuracy can be greatly improved over using GPS alone. For using both navigation systems simultaneously, precision of GLONASS/GPS navigation definitions were 2.37 – with mean number of NSV equals 14—19 (depends on station).

In May 2009, Anatoly Perminov, then director of the Roscosmos, stated that actions were undertaken to expand GLONASS's constellation and to improve the ground segment to increase the navigation definition of GLONASS to an accuracy of 2.8 m by 2011. In particular, the latest satellite design, GLONASS-K has the ability to double the system's accuracy once introduced. The system's ground segment is also to undergo improvements. As of early 2012, sixteen positioning ground stations are under construction in Russia and in the Antarctic at the Bellingshausen and Novolazarevskaya bases. New stations will be built around the southern hemisphere from Brazil to Indonesia. Together, these improvements are expected to bring GLONASS' accuracy to 0.6 m or better by 2020. The setup of a GLONASS receiving station in the Philippines is also now under negotiation.

title: GLONASS


text:
Lua (programming language)

Lua is a lightweight, high-level, multi-paradigm programming language designed primarily for embedded use in applications. Lua is cross-platform, since the interpreter of compiled bytecode is written in ANSI C, and Lua has a relatively simple C API to embed it into applications.

Lua originated in 1993 as a language for extending software applications to meet the increasing demand for customization at the time. It provided the basic facilities of most procedural programming languages, but more complicated or domain-specific features were not included; rather, it included mechanisms for extending the language, allowing programmers to implement such features. As Lua was intended to be a general embeddable extension language, the designers of Lua focused on improving its speed, portability, extensibility and ease-of-use in development.

History
Lua was created in 1993 by Roberto Ierusalimschy, Luiz Henrique de Figueiredo and Waldemar Celes, members of the Computer Graphics Technology Group (Tecgraf) at the Pontifical Catholic University of Rio de Janeiro, in Brazil.

From 1977 until 1992, Brazil had a policy of strong trade barriers (called a market reserve) for computer hardware and software, believing that Brazil could and should produce its own hardware and software. In that atmosphere, Tecgraf's clients could not afford, either politically or financially, to buy customized software from abroad; under the market reserve, clients would have to go through a complicated bureaucratic process to prove their needs couldn't be met by Brazilian companies. Those reasons led Tecgraf to implement the basic tools it needed from scratch.

Lua's predecessors were the data-description/configuration languages SOL (Simple Object Language) and DEL (data-entry language). They had been independently developed at Tecgraf in 1992–1993 to add some flexibility into two different projects (both were interactive graphical programs for engineering applications at Petrobras company). There was a lack of any flow-control structures in SOL and DEL, and Petrobras felt a growing need to add full programming power to them.

In The Evolution of Lua, the language's authors wrote:

"In 1993, the only real contender was Tcl, which had been explicitly designed to be embedded into applications. However, Tcl had unfamiliar syntax, did not offer good support for data description, and ran only on Unix platforms. We did not consider LISP or Scheme because of their unfriendly syntax. Python was still in its infancy. In the free, do-it-yourself atmosphere that then reigned in Tecgraf, it was quite natural that we should try to develop our own scripting language ... Because many potential users of the language were not professional programmers, the language should avoid cryptic syntax and semantics. The implementation of the new language should be highly portable, because Tecgraf's clients had a very diverse collection of computer platforms. Finally, since we expected that other Tecgraf products would also need to embed a scripting language, the new language should follow the example of SOL and be provided as a library with a C API."

Lua 1.0 was designed in such a way that its object constructors, being then slightly different from the current light and flexible style, incorporated the data-description syntax of SOL (hence the name Lua: Sol meaning "Sun" in Portuguese, and Lua meaning "Moon"). Lua syntax for control structures was mostly borrowed from Modula (, ,  / ), but also had taken influence from CLU (multiple assignments and multiple returns from function calls, as a simpler alternative to reference parameters or explicit pointers), C++ ("neat idea of allowing a local variable to be declared only where we need it" ), SNOBOL and AWK (associative arrays). In an article published in Dr. Dobb's Journal, Lua's creators also state that LISP and Scheme with their single, ubiquitous data-structure mechanism (the list) were a major influence on their decision to develop the table as the primary data structure of Lua.

Lua semantics have been increasingly influenced by Scheme over time, especially with the introduction of anonymous functions and full lexical scoping. Several features were added in new Lua versions.

Versions of Lua prior to version 5.0 were released under a license similar to the BSD license. From version 5.0 onwards, Lua has been licensed under the MIT License. Both are permissive free software licences and are almost identical.

Features
Lua is commonly described as a "multi-paradigm" language, providing a small set of general features that can be extended to fit different problem types. Lua does not contain explicit support for inheritance, but allows it to be implemented with metatables. Similarly, Lua allows programmers to implement namespaces, classes and other related features using its single table implementation; first-class functions allow the employment of many techniques from functional programming and full lexical scoping allows fine-grained information hiding to enforce the principle of least privilege.

In general, Lua strives to provide simple, flexible meta-features that can be extended as needed, rather than supply a feature-set specific to one programming paradigm. As a result, the base language is light; the full reference interpreter is only about 247 kB compiled and easily adaptable to a broad range of applications.

As a dynamically typed language intended for use as an extension language or scripting language, Lua is compact enough to fit on a variety of host platforms. It supports only a small number of atomic data structures such as Boolean values, numbers (double-precision floating point and 64-bit integers by default) and strings. Typical data structures such as arrays, sets, lists and records can be represented using Lua's single native data structure, the table, which is essentially a heterogeneous associative array.

Lua implements a small set of advanced features such as first-class functions, garbage collection, closures, proper tail calls, coercion (automatic conversion between string and number values at run time), coroutines (cooperative multitasking) and dynamic module loading.

Syntax
The classic "Hello, World!" program can be written as follows, with or without parentheses:

A comment in Lua starts with a double-hyphen and runs to the end of the line, similar to Ada, Eiffel, Haskell, SQL and VHDL. Multi-line strings and comments are adorned with double square brackets.

The factorial function is implemented as a function in this example:

Control flow
Lua has one type of conditional test:  with optional   and   execution control constructs.

The generic  statement requires all three keywords:

The  keyword may be added with an accompanying statement block to control execution when the   condition evaluates to  :

Execution may also be controlled according to multiple conditions using the  keywords:

Lua has four types of conditional loops: the  loop, the   loop (similar to a   loop), the numeric   loop and the generic   loop.

This generic  loop would iterate over the table   using the standard iterator function , until it returns  :

Loops can also be nested (put inside of another loop).

Functions
Lua's treatment of functions as first-class values is shown in the following example, where the print function's behavior is modified: Any future calls to  will now be routed through the new function, and because of Lua's lexical scoping, the old print function will only be accessible by the new, modified print.

Lua also supports closures, as demonstrated below: A new closure for the variable  is created every time   is called, so that each new anonymous function returned will always access its own   parameter. The closure is managed by Lua's garbage collector, just like any other object.

Tables
Tables are the most important data structures (and, by design, the only built-in composite data type) in Lua and are the foundation of all user-created types. They are associative arrays with addition of automatic numeric key and special syntax.

A table is a collection of key and data pairs, where the data is referenced by key; in other words, it is a hashed heterogeneous associative array.

Tables are created using the  constructor syntax.

Tables are always passed by reference (see Call by sharing).

A key (index) can be any value except  and NaN, including functions.

A table is often used as structure (or record) by using strings as keys. Because such use is very common, Lua features a special syntax for accessing such fields.

By using a table to store related functions, it can act as a namespace.

Tables are automatically assigned a numerical key, enabling them to be used as an array data type. The first automatic index is 1 rather than 0 as it is for many other programming languages (though an explicit index of 0 is allowed).

A numeric key  is distinct from a string key.

The length of a table  is defined to be any integer index   such that   is not   and   is  ; moreover, if   is ,   can be zero. For a regular array, with non-nil values from 1 to a given, its length is exactly that  , the index of its last value. If the array has "holes" (that is, nil values between other non-nil values), then  can be any of the indices that directly precedes a   value (that is, it may consider any such nil value as the end of the array).

A table can be an array of objects.

Using a hash map to emulate an array is normally slower than using an actual array; however, Lua tables are optimized for use as arrays to help avoid this issue.

Metatables
Extensible semantics is a key feature of Lua, and the metatable concept allows powerful customization of tables. The following example demonstrates an "infinite" table. For any,   will give the  -th Fibonacci number using dynamic programming and memoization.

Object-oriented programming
Although Lua does not have a built-in concept of classes, object-oriented programming can be emulated using functions and tables. An object is formed by putting methods and fields in a table. Inheritance (both single and multiple) can be implemented with metatables, delegating nonexistent methods and fields to a parent object.

There is no such concept as "class" with these techniques; rather, prototypes are used, similar to Self or JavaScript. New objects are created either with a factory method (that constructs new objects from scratch) or by cloning an existing object.

Creating a basic vector object:

Here, setmetatable tells Lua to look for an element in the Vector table if it is not present in the vec table. vec.magnitude, which is equivalent to vec["magnitude"], first looks in the vec table for the magnitude element. The vec table does not have a magnitude element, but its metatable delegates to the Vector table for the magnitude element when it's not found in the vec table.

Lua provides some syntactic sugar to facilitate object orientation. To declare member functions inside a prototype table, one can use function table:func(args), which is equivalent to function table.func(self, args). Calling class methods also makes use of the colon: object:func(args) is equivalent to object.func(object, args).

That in mind, here is a corresponding class with : syntactic sugar:

Inheritance
Lua supports using metatables to give Lua class inheritance. In this example, we allow vectors to have their values multiplied by a constant in a derived class.

Lua also supports multiple inheritance; __index can either be a function or a table. Operator overloading can also be done; Lua metatables can have elements such as __add, __sub and so on.

Implementation
Lua programs are not interpreted directly from the textual Lua file, but are compiled into bytecode, which is then run on the Lua virtual machine. The compilation process is typically invisible to the user and is performed during run-time, especially when a JIT compiler is used, but it can be done offline in order to increase loading performance or reduce the memory footprint of the host environment by leaving out the compiler. Lua bytecode can also be produced and executed from within Lua, using the  function from the string library and the   functions. Lua version 5.3.4 is implemented in approximately 24,000 lines of C code.

Like most CPUs, and unlike most virtual machines (which are stack-based), the Lua VM is register-based, and therefore more closely resembles an actual hardware design. The register architecture both avoids excessive copying of values and reduces the total number of instructions per function. The virtual machine of Lua 5 is one of the first register-based pure VMs to have a wide use. Parrot and Android's Dalvik are two other well-known register-based VMs. PCScheme's VM was also register-based.

This example is the bytecode listing of the factorial function defined above (as shown by the  5.1 compiler):

function  (9 instructions, 36 bytes at 0x8063c60) 1 param, 6 slots, 0 upvalues, 6 locals, 2 constants, 0 functions 1	[2]	LOADK   	1 -1	; 1 2	[3]	LOADK   	2 -2	; 2 3	[3]	MOVE    	3 0 4	[3]	LOADK   	4 -1	; 1 5	[3]	FORPREP 	2 1	; to 7 6	[4]	MUL     	1 1 5 7	[3]	FORLOOP 	2 -2	; to 6 8	[6]	RETURN  	1 2 9	[7]	RETURN  	0 1

C API
Lua is intended to be embedded into other applications, and provides a C API for this purpose. The API is divided into two parts: the Lua core and the Lua auxiliary library. The Lua API's design eliminates the need for manual reference management in C code, unlike Python's API. The API, like the language, is minimalistic. Advanced functionality is provided by the auxiliary library, which consists largely of preprocessor macros which assist with complex table operations.

The Lua C API is stack based. Lua provides functions to push and pop most simple C data types (integers, floats, etc.) to and from the stack, as well as functions for manipulating tables through the stack. The Lua stack is somewhat different from a traditional stack; the stack can be indexed directly, for example. Negative indices indicate offsets from the top of the stack. For example, −1 is the top (most recently pushed value), while positive indices indicate offsets from the bottom (oldest value). Marshalling data between C and Lua functions is also done using the stack. To call a Lua function, arguments are pushed onto the stack, and then the  is used to call the actual function. When writing a C function to be directly called from Lua, the arguments are read from the stack.

Here is an example of calling a Lua function from C:

Running this example gives:

The C API also provides some special tables, located at various "pseudo-indices" in the Lua stack. At  prior to Lua 5.2 is the globals table,   from within Lua, which is the main namespace. There is also a registry located at  where C programs can store Lua values for later retrieval.

Modules
Besides standard library (core) modules it is possible to write extensions using the Lua API. Extension modules are shared objects which can be used to extend the functionality of the interpreter by providing native facilities to Lua scripts. Lua scripts may load extension modules using, just like modules written in Lua itself, or with. When a C library is loaded via Lua will look for the function   and call it, which acts as any C function callable from Lua and generally returns a table filled with methods. A growing collection of modules known as rocks are available through a package management system called LuaRocks, in the spirit of CPAN, RubyGems and Python eggs. Prewritten Lua bindings exist for most popular programming languages, including other scripting languages. For C++, there are a number of template-based approaches and some automatic binding generators.

Applications
In video game development, Lua is widely used as a scripting language, mainly due to its perceived easiness to embed, fast execution, and short learning curve. Notable games which use Lua include Roblox, Garry's Mod,  World of Warcraft, Payday 2, Phantasy Star Online 2, Dota 2, Crysis, and many others. Some games that do not natively support Lua programming or scripting, have this functionality added by mods, such as ComputerCraft does for Minecraft. In addition, Lua is also used in non-video game software, such as Adobe Lightroom, Moho, iClone, Aerospike and certain system software in FreeBSD and NetBSD, and is used as a template scripting language on MediaWiki using the Scribunto extension.

In 2003, a poll conducted by GameDev.net showed Lua was the most popular scripting language for game programming. On 12 January 2012, Lua was announced as a winner of the Front Line Award 2011 from the magazine Game Developer in the category Programming Tools.

A large number of non-game applications also use Lua for extensibility, such as LuaTeX, an implementation of the TeX type-setting language, Redis, a key-value database, ScyllaDB, a Wide-column store, Neovim, a text editor, Nginx, a web server, and Wireshark, a network packet analyzer.

Through the Scribunto extension, Lua is available as a server-side scripting language in the MediaWiki software that powers Wikipedia and other wikis. Among its uses are allowing the integration of data from Wikidata into articles, and powering the.

Languages that compile to Lua

 * MoonScript is a dynamic, whitespace-sensitive scripting language inspired by CoffeeScript, which is compiled into Lua. This means that instead of using  and   (or   and  ) to delimit sections of code it uses line breaks and indentation style.  A notable usage of MoonScript is the video game distribution website Itch.io.
 * Haxe supports compilation to a Lua target, supporting Lua 5.1-5.3 as well as LuaJIT 2.0 and 2.1.
 * Fennel, a Lisp dialect that targets Lua.
 * Urn, a Lisp dialect that is built on Lua.
 * Amulet, an ML-like functional language, whose compiler outputs Lua files.

Dialects
In addition, the Lua users community provides some power patches on top of the reference C implementation.
 * LuaJIT, a just-in-time compiler of Lua 5.1.
 * Luau from Roblox, a Lua 5.1 language with gradual typing and ergonomic additions.
 * Ravi, a JIT-enabled Lua 5.3 language with optional static typing. JIT is guided by type information.
 * Shine, a fork of LuaJIT with many extensions, including a module system and a macro system.
 * Glua, a modified version embedded into the game Garry's Mod as its scripting language.
 * Teal, a statically typed Lua dialect written in Lua.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Lua (programming language)


text:
1480s BC

The 1480s BC was a decade lasting from January 1, 1489 BC to December 31, 1480 BC.

Events and trends

 * 1487 BC—Amphictyon, son of Deucalion and Pyrrha, legendary King of Athens, dies after a reign of 10 years and is succeeded by Erichthonius I of Athens, a grandson of Cranaus.
 * 1481 BC—August 27—Lunar Saros 43 begins.

title: 1480s BC


text:
User:Dlloader~enwiki

This person is just a rumor :P

title: User:Dlloader~enwiki


text:
Garrett County, Maryland

Garrett County is the westernmost county of the U.S. state of Maryland completely within the Appalachian Mountains. As of the 2020 census, the population was 28,806, making it the third-least populous county in Maryland. Its county seat is Oakland. The county was named for John Work Garrett (1820–1884), president of the Baltimore and Ohio Railroad. Created from Allegany County in 1872, it was the last county to be formed in the state.

Garrett County is bordered by four West Virginia counties and to the north the Maryland–Pennsylvania boundary known as the Mason–Dixon line. The eastern border with Allegany County was defined by the Bauer Report, submitted to Governor Lloyd Lowndes, Jr. on November 9, 1898. The Potomac River and State of West Virginia lie to the south and west.

Garrett County lies in the Allegheny Mountains, which here form the western flank of the Appalachian Mountain Range. Hoye-Crest, a summit along Backbone Mountain, is the highest point in Maryland at an elevation of 3360 ft.

The Eastern Continental Divide runs along portions of Backbone Mountain. The western part of the county, drained by the Youghiogheny River, is the only part of Maryland within the Mississippi River drainage basin. All other parts of the county are in the Chesapeake Bay basin.

The National Register of Historic Places listings in Garrett County, Maryland has 20 National Register of Historic Places properties and districts, including Casselman Bridge, National Road a National Historic Landmark. Garrett County is part of Maryland's 6th congressional district. The extreme south of the county lies within the United States National Radio Quiet Zone.

History
In the early 20th century, the railroad and tourism started to decline. Coal mining and timber production continued at a much slower pace. Today, tourism has made a dramatic rebound in the county with logging and farming making up the greatest part of the economic base. Due to a cool climate and lack of any large city, Garrett County has remained a sparsely populated rural area.

Geography
According to the U.S. Census Bureau, the county has a total area of 656 sqmi, of which 647 sqmi is land and 8.6 sqmi (1.3%) is water. It is the second-largest county in Maryland by land area.

Garrett County is located entirely within the highland zone of the Appalachian Mountains known variously as the Allegheny Mountains, the Allegheny Plateau, and the Appalachian Plateau. The county's highest elevations are located along four flat-topped ridges and range to a height of 3360 ft at Hoye-Crest along Backbone Mountain, the highest point in the state of Maryland. As is typical in the Allegheny region, broad flats generally lie below the ridge crests at elevations of approximately 500 ft. River valleys are generally narrow and deep, with ravines typically 1,000 to 1800 ft below surrounding peaks.

The county contains over 76000 acre of parks, lakes, and publicly accessible forestland. It is drained by two river systems, the Potomac and the Youghiogheny. The Savage River, a tributary of the Potomac, drains about a third of the county. The Casselman River, a tributary of the Youghiogheny, flows north from the county's central section into Pennsylvania. The Youghiogheny itself drains the westernmost area of the county and flows north into Pennsylvania, where it empties into the Monongahela River at McKeesport, just south of Pittsburgh.

The Glades
The Glades' 601 acre is of great scientific interest because it is an ombrotrophic system (fed solely by rainwater) with peat layers up to 9 ft thick, and is one of the oldest examples of mountain peatland in the Appalachians.

On the western edge of the Savage River State Forest along Maryland Route 495 lies Bittinger, Maryland, which is named after Henry Bittinger, who first settled in the area and who was joined by other German settlers moving in and taking up the fertile farmland. On the eastern edge of Bittinger is one of the largest glades area of Garrett County. Geographically, this is an area that seems to have been affected by the last great ice sheet of North America. Two miles southeast of Bittinger, there is a large deposit of peat moss.

Loess Dunes
In the Casselman River valley, 1 mi south of Grantsville, Maryland and beside Maryland Route 495, one can see remains of geological evidence about the last great ice sheet over North America. A series of low mounds can be seen in the fields on the west side of Maryland Route 495 that are "loess" (wind-blown) material. Apparently, these are the only ones still visible in the northern part of Garrett County.

The mounds were formed when a glacier lake existed in the Casselman valley, and the ice around the edges of the frozen lake melted. Wind blew fine grains of earth into the water around the edges where it sank to the bottom, and the mounds were the result of the deposit of this wind-blown material.

{| style="width:80%; margin:0 50px 0 0; background:none;"

 * - style="vertical-align:top; text-align:left;"
 * style="width:45%;"|

Mountains

 * style="width:10%;"|
 * style="width:45%;"|

{| width="100%"  style="background:transparent"

Creeks

 * Bear Creek
 * Beaver Creek
 * Cherry Creek
 * Church Creek
 * Crabtree Creek
 * Deep Creek (formerly Green Glades Creek)
 * Fork Creek
 * Georges Creek
 * Herrington Creek
 * Middle Fork Creek
 * Muddy Creek
 * North Fork Creek
 * Rhine Creek
 * Snowy Creek
 * South Fork Crabtree Creek
 * South Fork Creek

Lakes

 * Deep Creek Lake (largest freshwater body of water in Maryland, 11.6 mi in length)

Waterfalls

 * Gap Falls
 * Muddy Creek Falls (highest free-falling waterfall in State at 54 feet)
 * Swallow Falls
 * Tolliver Falls
 * }
 * }

Forests, rivers, caves
See these articles for information on the forests, rivers, and caves of Garrett County:
 * List of Maryland state forests
 * List of rivers of Maryland
 * Caves of Maryland (Crabtree - largest cave in Maryland)

Parks and recreation

Garrett County contains over 76000 acre of parks, lakes, and publicly accessible forestland. Popular activities in the county include camping, hiking, backpacking, rock climbing, alpine and cross-country skiing, snowmobiling, hunting, ice fishing, fly fishing, whitewater canoeing, kayaking, rafting, boating, swimming, sailing, horseback riding, and water skiing.

State parks
There are seven state parks in Garrett County. All offer picnic and fishing areas; all but Casselman River State Park have hiking paths. Mountain bike paths, swimming areas, and boat launches and rentals are available at Deep Creek, Herrington Manor, and New Germany state parks. Rental cabins are available at Herrington Manor and New Germany state parks. Big Run, Deep Creek, Herrington Manor, and New Germany state parks all offer canoeing, while campsites may be found at Big Run, Deep Creek, New Germany, and Swallow Falls state parks.
 * Big Run State Park
 * Casselman River Bridge State Park (Grantsville)
 * Deep Creek Lake State Park (Swanton)
 * Herrington Manor State Park (Oakland)
 * New Germany State Park (Grantsville)
 * Sang Run State Park
 * Swallow Falls State Park

County parks
Garrett County owns four park sites and fifteen recreation facilities. The parks are maintained in cooperation with local associations and civic groups. The recreation areas are attached to public schools and colleges and maintained by the Garrett County Board of Education.

Municipal parks
The municipal parks of Garrett County provide sport facilities, hiking, bike and walk paths, playgrounds, picnic areas, boat ramps, and fishing.
 * Kitzmiller Parks & Recreation Dept.
 * Oakland Broadford Park includes swimming, picnic tables, fishing, boat ramp, playgrounds, sports fields.

Libraries and museums
The Ruth Enlow Library was founded in 1915 as the Oakland Free Public Library. Since then, an additional four branches have been added to the library system in Accident, Friendsville, Grantsville, and Kitzmiller. The present director of the library is Thomas Vose.

The Garrett County Historical Society and Museums include a Historical Museum, a Transportation Museum, the Grantsville Museum and the Leo Beachley Photographic Archives.

Adjacent counties

 * Fayette County, Pennsylvania (northwest)
 * Somerset County, Pennsylvania (north)
 * Allegany County, Maryland, (east)
 * Grant County, West Virginia (south)
 * Mineral County, West Virginia (southeast)
 * Preston County, West Virginia (west)

2020 census
''Note: the US Census treats Hispanic/Latino as an ethnic category. This table excludes Latinos from the racial categories and assigns them to a separate category. Hispanics/Latinos can be of any race.''

2010 census
As of the 2010 United States Census, there were 30,097 people, 12,057 households, and 8,437 families residing in the county. The population density was 46.5 PD/sqmi. There were 18,854 housing units at an average density of 29.1 /sqmi. The racial makeup of the county was 97.8% white, 1.0% black or African American, 0.3% Asian, 0.1% American Indian, 0.1% from other races, and 0.7% from two or more races. Those of Hispanic or Latino origin made up 0.7% of the population. In terms of ancestry, 35.4% were German, 13.6% identified as American, 11.3% were Irish, and 11.3% were English.

Of the 12,057 households, 30.0% had children under the age of 18 living with them, 56.4% were married couples living together, 9.3% had a female householder with no husband present, 30.0% were non-families, and 25.5% of all households were made up of individuals. The average household size was 2.45 and the average family size was 2.92. The median age was 42.7 years.

The median income for a household in the county was $45,760 and the median income for a family was $56,545. Males had a median income of $40,035 versus $27,325 for females. The per capita income for the county was $23,888. About 8.9% of families and 12.5% of the population were below the poverty line, including 19.2% of those under age 18 and 12.1% of those aged 65 or over.

2000 census
As of the census of 2000, there were 29,846 people, 11,476 households, and 8,354 families residing in the county. The population density was 18/km2 (46/sq mi). There were 16,761 housing units at an average density of 10/km2 (26/sq mi). The racial makeup of the county was 98.83% White, 0.43% Black or African American, 0.07% Native American, 0.19% Asian, 0.02% Pacific Islander, 0.09% from other races, and 0.37% from two or more races. 0.44% of the population were Hispanic or Latino of any race. 36.1% were of German, 22.9% identified as American, 9.6% English and 8.8% Irish ancestry.

There were 11,476 households, out of which 32.60% had children under the age of 18 living with them, 60.70% were married couples living together, 8.40% had a female householder with no husband present, and 27.20% were non-families. 23.50% of all households were made up of individuals, and 10.60% had someone living alone who was 65 years of age or older. The average household size was 2.55 and the average family size was 3.00.

In the county, the population was spread out, with 25.10% under the age of 18, 7.80% from 18 to 24, 27.60% from 25 to 44, 24.60% from 45 to 64, and 14.90% who were 65 years of age or older. The median age was 38 years. For every 100 females, there were 97.20 males. For every 100 females age 18 and over, there were 93.80 males.

The median income for a household in the county was $32,238, and the median income for a family was $37,811. Males had a median income of $29,469 versus $20,673 for females. The per capita income for the county was $16,219. 13.30% of the population and 9.80% of families were below the poverty line. Out of the total people living in poverty, 16.60% are under the age of 18 and 13.90% are 65 or older.

Garrett County is home to an Amish community in the Oakland area that consists of a church district of about 70 homes. The Amish community dates back to 1850 and became associated with the New Order Amish, with electricity permitted inside of homes.

Government
The county is governed by an elected three-member Board of County Commissioners, whose members serve four-year terms and must live in the district they represent. The Board is the traditional form of county government in Maryland. It may exercise only those powers conferred by the General Assembly of Maryland, and even those powers are narrowly construed.

Garrett County is administered under a line organizational method, with the County Administrator responsible for the general administration of County Government. The administration of the county is centralized with the County Administrator responsible for overseeing the financial planning, annual budget process, personnel management, and direction and management of operations within the organization.

County seal
On December 15, 1977, the seal of Garrett County went into effect by virtue of Resolution #7. The seal is elliptical, with the name "Garrett County" inscribed above the upper fourth of the ellipse, and "Maryland 1872" inscribed below the lower fourth of the ellipse. The date "1872" depicts the year of the formation of Garrett County. The seal illustrates a large snowflake to depict winter; water to represent sailing; and oaks and conifer to represent the county's mountains. The colors are peacock blue for the sky and water. The blue and white background is divided by kelly green.

County flag
The official flag for Garrett County is elliptical. The flag illustrates a large snowflake to depict winter; water to represent sailing; and oaks and conifer to represent the county's mountains. The colors are peacock blue for the sky and water. The blue and white background is divided by kelly green.

Politics
Although since the Civil War Maryland has been a Democratic-leaning state, Garrett County, owing to its history of German settlement from north of the Mason–Dixon line, plus strong pre-war Unionism resulting from virtual absence of slaves, has always been strongly Republican. Since it was created in 1872, Garrett is one of forty counties across the nation (chiefly Unionist strongholds in antebellum slave states) to have never voted for a Democratic presidential candidate. Compared with neighbouring and closely allied Grant County, West Virginia, Garrett has not shown quite the same levels of Republican support – Lyndon Johnson did get within 109 votes of Barry Goldwater in 1964 – but as with Grant County, the only occasion Garrett County has not been carried by the official Republican nominee occurred in 1912 when a major split in the Republican Party allowed "Bull Moose Party" nominee and former President Theodore Roosevelt to claim the county. Since 1996, no Democratic presidential nominee has won even 30% of the county's vote, and not since 2010 has Garrett County voted Democratic in any statewide election.

Owing to its strong Republican lean, Garrett County sometimes votes against ballot measures that the rest of the state approves by large margins. In 2022, for example, Garrett County was the only county in the state to vote against legalizing recreational cannabis via Question 4.

Garrett County is represented in the U.S. House of Representatives by the 6th congressional district, which includes part of northwestern metro DC. The district is currently represented by Democrat David Trone.

Voter registration

 * }

Law enforcement
The county is policed by the Garrett County Sheriff's Office and the Maryland State Police.

The state parks are policed by the Department of Natural Resources Police.

The county established an Office of the Fire Marshal in 2022, working in collaboration with the Maryland State Office established in 1894.

Economy
Garrett County produces natural gas, the only county in the state to do so. Much of the economic activity in the area centers around tourism. In the winter, the Wisp ski resort in Oakland and New Germany State Park's cross-country skiing trail are frequent destinations, and Deep Creek Lake sees much activity in the summer. The state parks in the county are frequented year-round. During the Covid-19 Pandemic, tourism boomed as many people from Washington, DC, Baltimore, and Pittsburgh wanted to get away from the city. The average sale price for a home in the county jumped $250,000 from July 2020 to July 2021. As of July 2021, the average price for a home in the county ($642,805) is the second-most expensive in Maryland, behind only Montgomery County.

Major highways

Airport
Garrett County Airport (2G4) is a general aviation airport surrounded by the mountains of Western Maryland. The airport enhances the region's tourist industry and provides emergency air service evacuation and landing facilities for general aviation.

Media
Garrett County is part of the Pittsburgh, Pennsylvania television market. KDKA-TV and WTAE-TV in Pittsburgh, Pennsylvania, and WJAC-TV in Johnstown, Pennsylvania serves Oakland, the county seat. Oakland also has an educational television station (by way of PBS member station WGPT, part of state-wide Maryland Public Television; it also serves Pittsburgh-based member station WQED).

It has a weekly newspaper, the Garrett County Republican, which was purchased by NCWV Media in 2017.

Events
Annual events include the Autumn Glory Festival, the Scottish Highland Festival, and the Garrett County Agricultural Fair.

Towns

 * Accident
 * Deer Park
 * Friendsville
 * Grantsville
 * Kitzmiller
 * Loch Lynn Heights
 * Mountain Lake Park
 * Oakland (county seat)

Census-designated places
The United States Census Bureau recognizes seven census-designated places (CDPs) in Garrett County.
 * Bloomington
 * Crellin
 * Finzel
 * Gorman
 * Hutton
 * Jennings
 * Swanton

Unincorporated communities
The following communities are classified as populated places or locales by the Geographic Names Information System.
 * Altamont (39.4275°N, -79.28194°W) is where CSX's Mountain Subdivision rail line crosses the Eastern Continental Divide just west of the railroad's underpass of MD 135 east of Deer Park.
 * Asher Glade (39.70389°N, -79.44722°W) is at the intersection of MD 42 and Asher Glade Road northwest of Friendsville and a short distance south of the Pennsylvania state line near Markleysburg, Pennsylvania.
 * Avilton (39.65028°N, -79.04222°W) is at the intersection of Avilton Lonaconing Road and Green Lantern Road southwest of Finzel.
 * Bethel (39.445°N, -79.11861°W) is at the intersection of Walnut Bottom Road and Chestnut Grove Road near Jennings Randolph Lake southwest of Bloomington.
 * Bevansville (39.65417°N, -79.19278°W) is at the intersection of MD 495 and Durst Road west of Jennings.
 * Bittinger (39.60222°N, -79.22333°W) is at the intersection of MD 495 and Orendorf Road north of Swanton and south of Grantsville.
 * Blooming Rose (39.65667°N, -79.43917°W) is at the intersection of MD 42 and Blooming Rose Road west of Friendsville.
 * Casselman (39.67528°N, -79.17167°W) is at the intersection of MD 495 and Maple Grove Road along the Casselman River south of Grantsville.
 * Cove (39.68028°N, -79.3°W) is at the intersection of Cove Road and Cove Run north of Accident.
 * East Vindex (39.41778°N, -79.18722°W) is on Vindex Road north of Kitzmiller.
 * Elder Hill (39.62444°N, -79.39111°W) is at the intersection of MD 42 and Kisner Road south of Friendsville.
 * Engle Mill (39.64694°N, -79.28639°W) is at the intersection of Fish Hatchery Road and Bowman Hill Road northeast of Accident.
 * Fairview (39.59333°N, -79.14611°W) is at the intersection of Fairview Road and Peapatch Lane south of Grantsville.
 * Floyd (39.50417°N, -79.15556°W) is at the intersection of Savage River Road and Spring Lick Road west of Bloomington.
 * Fort Pendleton (39.29528°N, -79.37417°W) is on US 50 west of Gorman and east of Backbone Mountain.
 * Foxtown (39.6325°N, -79.23833°W) is at the intersection of Dung Hill Road and Amish Road west of Jennings.
 * Fricks Crossing (39.41139°N, -79.33333°W) is where Fricks Crossing Road intersects CSX's Mountain Subdivision rail line and crosses the Little Youghiogheny River southwest of Deer Park.
 * Gortner (39.355°N, -79.4275°W) is at the intersection of US 219 and Mason School Road south of Oakland.
 * Gravel Hill (39.66389°N, -79.39306°W) is on Friendsville Addison Road east of Friendsville.
 * Green Glade (39.47389°N, -79.26472°W) is on Green Glade Road along the south side of Green Glade Cove, a branch of Deep Creek Lake.
 * Hazelhurst (39.47028°N, -79.27139°W) is on Hazelhurst Road along the south side of Green Glade Cove, a branch of Deep Creek Lake.
 * Herrington Manor (39.45278°N, -79.45306°W) is the location of Herrington Manor State Park northwest of Oakland.
 * Hi-Point (39.70583°N, -79.21056°W) is where US 40 Alternate crosses the top of Negro Mountain west of Grantsville. This location was the highest point on the National Road.
 * High Point (39.69472°N, -79.10417°W) is at the intersection of US 40 Alternate and US 219 east of Grantsville.
 * Hoyes (39.59028°N, -79.36944°W) is at the intersection of MD 42 and Hoyes Sang Run Road southwest of Accident.
 * Hoyes Run (39.52806°N, -79.41056°W) is at the intersection of Oakland Sang Run Road and Hoyes Run Road along the Youghiogheny River west of Deep Creek Lake.
 * Kaese Mill (39.65028°N, -79.29611°W) is at the intersection of Collier Road and Fish Hatchery Road east of US 219's junction with Fish Hatchery Road and northeast of Accident.
 * Kearney (39.34306°N, -79.32222°W) is at the intersection of White Church Steyer Road and Le Moyne King Road southeast of Loch Lynn Heights.
 * Keeler Glade (39.62944°N, -79.47778°W) is along Blooming Rose Road just east of the Maryland–West Virginia state line.
 * Kempton (39.20667°N, -79.48528°W) is on Kempton Road next to the Potomac River in the southwestern corner of Garrett County where the Maryland–West Virginia state line changes from the river to a north–south line.
 * Kendall (39.63333°N, -79.4175°W) is on the Youghiogheny River south of Friendsville and north of Sang Run.
 * Keysers Ridge (39.69361°N, -79.24806°W) is at the junctions of I-68, US 40, US 219, and US 40 Alternate west of Grantsville.
 * Lake Ford (39.52667°N, -79.48°W) is at the intersection of Cranesville Road and Lake Ford Road south of the Cranesville Swamp Preserve just east of the Maryland–West Virginia state line.
 * Locust Grove (39.65333°N, -79.45944°W) is at the intersection of Noah Frazee Road and Sand Spring Road west of Friendsville.
 * McComas Beach (39.50167°N, -79.37306°W) is on Mayhew Inn Road along Red Run Cove near the west end of Deep Creek Lake.
 * McHenry (39.55833°N, -79.35278°W) is at the intersection of US 219 and Mosser Road on March Run Cove at the north end of Deep Creek Lake.
 * Merrill (39.59889°N, -79.08306°W) is where Westernport Road crosses the Savage River within Savage River State Forest west of Lonaconing.
 * Mineral Spring (39.70806°N, -79.35028°W) is at the confluence of Mill Run and Cove Run east of Youghiogheny River Lake northeast of Friendsville.
 * Mitchell Manor (39.41861°N, -79.39611°W) is a neighborhood east of Cherry Glade Run just north of the town of Oakland.
 * New Germany (39.6325°N, -79.12222°W) is along New Germany Road adjacent to New Germany State Park south of Grantsville.
 * North Glade (39.50083°N, -79.23667°W) is at the intersection of MD 495 and North Glade Road east of Deep Creek Lake.
 * Piney Grove (39.68472°N, -79.07306°W) is at the intersection of US 40 Alternate and Avilton Lonaconing Road.
 * Redhouse (39.30861°N, -79.45389°W) is at the intersection of US 50 and US 219 south of Oakland and west of Backbone Mountain.
 * Ryan's Glade stretches along the common border with Grant County, West Virginia from about midway between Mountain Lake Park and Gormania to the southwestern corner of the county near Wilsonia.
 * Sand Spring (39.6725°N, -79.45944°W) is at the intersection of Sand Spring Road and Fearer Road west of Friendsville.
 * Sang Run (39.56806°N, -79.4225°W) is at the intersection of Sang Run Road and Oakland Sang Run Road west of McHenry
 * Schell (39.34194°N, -79.25972°W) is at the confluence of Laurel Run and the Potomac River northeast of Gorman.
 * Selbysport (39.68639°N, -79.38028°W) is at the intersection of Friendsville Addison Road and Old Morgantown Road north of Friendsville.
 * Shallmar (39.37944°N, -79.20472°W) is along Shallmar Road along the Potomac River west of Kitzmiller.
 * Standard (39.415°N, -79.17528°W) is at the confluence of Three Forks Run and the Potomac River north of Kitzmiller.
 * Stanton Mill (39.70111°N, -79.13694°W) is where River Road crosses the Casselman River east of Grantsville.
 * Steyer (39.30556°N, -79.31083°W) is at the intersection of White Church Steyer Road and Steyer Gorman Road near the Potomac River east of Gorman.
 * Strawn (39.72111°N, -79.29667°W) is along US 40 just south of the Maryland–Pennsylvania state line west of Keysers Ridge. Formerly known as Oakton.
 * Strecker (39.475°N, -79.19083°W) is along Crabtree Creek and CSX's Mountain Subdivision between Swanton and Savage River Reservoir.
 * Sunnyside (39.34028°N, -79.44694°W) is at the intersection of US 219 and Ben Dewitt Road north of Redhouse.
 * Table Rock (39.30139°N, -79.41722°W) is at the intersection of US 50 and Table Rock Road on top of Backbone Mountain.
 * Tasker Corners (39.36222°N, -79.29417°W) is at the junctions of Bethlehem Road, Steyer Mine Road, Schell Road, and Potomac Camp Road southeast of Loch Lynn Heights and southwest of Kitzmiller.
 * Thayerville (39.50167°N, -79.32667°W) is at the intersection of US 219 and Glendale Road next to Deep Creek Lake.
 * Wallman (39.31694°N, -79.28389°W) is along Wallman Road along the Potomac River northeast of Gorman.
 * West Vindex (39.4175°N, -79.20556°W) is along Vindex Road north of Kitzmiller.
 * There are two locations named Wilson:
 * One Wilson (39.43222°N, -79.27028°W) is along Old Wilson Road at the source of the South Fork of Crabtree Creek east of Altamont.
 * The other Wilson (39.25417°N, -79.39778°W) is in both Maryland and West Virginia on either side of the Wilson Bridge across the Potomac River southwest of Gorman.
 * Winding Ridge (39.68806°N, -79.32556°W) is at the intersection of Cove Road and Old Morgantown Road north of Accident.

Education
Garrett College is a public community college in McHenry, Maryland. The college had three outreach centers in Accident, Grantsville, and Oakland.

Garrett County Public Schools operates public schools. There are two public high schools in the county, Southern Garrett High School and Northern Garrett High School, two public middle schools, Southern Garrett Middle School and Northern Garrett Middle School, and seven public elementary schools, Accident Elementary School, Broad Ford Elementary School, Crellin Elementary School, Friendsville Elementary School, Grantsville Elementary School, Route 40 Elementary School, and Yough Glades Elementary School. There is also one K-8 public school in the county, which is Swan Meadow School.

County, State and Federal government

 * Garrett County Online
 * Maryland State Archives - Maryland Manual, Garrett County
 * Garrett County Economic Development Online
 * U.S. Census Bureau State & County QuickFacts - Garrett County, Maryland
 * Maryland Geological Survey Online
 * U.S. Geological Survey - Geographic Names Information System (GNIS)
 * State of Maryland Department of Natural Resources - Western Maryland Public Lands
 * Maryland Land Conservation Center
 * Garrett County Health Department
 * Garrett County Community Planning Tool

Historical and academic

 * Garrett County Historical Society Museum - History of Garrett County
 * Western Maryland's Historical Library
 * Ruth Enlow Library of Garrett County
 * Garrett College Weather Underground Data Exchange
 * Multimedia Learning Center

Business and tourism

 * Deep Creek Lake Events, Business Listings and More
 * The Official Website of Garrett County's Chamber of Commerce
 * The Official Website of Garrett County's Deep Creek Lake Area
 * The Official site of the Maryland Office of Tourism
 * AirNav.com - Garrett County Airport (2G4)
 * Garrett County Arts Council
 * Deep Creek Times, Deep Creek Lake and Garrett County area information
 * News - Oakland, The Republican
 * News - Cumberland, Times-News

title: Garrett County, Maryland