Edge Case: Leap Year

Loading
loading...

Edge Case: Leap Year

February 29, 2024
mike@standardsmichigan.com
,
No Comments

Date & Time: Representations For Information Interchange

Programming languages face several challenges when dealing with leap years, primarily because leap years don’t follow a simple pattern and can vary depending on the calendar system being used.  Some of the challenges include:

Algorithm Complexity: Writing algorithms to accurately determine leap years can be complex due to the various rules governing leap years in different calendar systems. For instance, the Gregorian calendar, which is the most widely used calendar system, has different rules than other systems like the Julian calendar.

Handling Calendar Systems: Some programming languages have built-in libraries or functions to handle leap years, but they may not support all calendar systems. Developers need to ensure that the language’s built-in functions or libraries accurately handle leap years according to the desired calendar system.

Cross-Platform Consistency: Different platforms and programming languages may implement leap year calculations differently, leading to inconsistencies when working with date and time data across different systems.

Localization: Some calendar systems used in various regions have different rules for leap years. Programming languages may need to support localization to handle these differences accurately.

Performance: Implementing leap year calculations efficiently can be challenging, especially when dealing with large datasets or frequent date/time manipulations. Optimizing leap year calculations for performance without sacrificing accuracy is important in high-performance applications.

To address these challenges, programmers often rely on built-in date and time libraries provided by programming languages or use third-party libraries specifically designed to handle calendar-related calculations accurately and efficiently. Additionally, thorough testing and validation of date-related logic are essential to ensure correctness, especially in critical applications.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

In Python, leap years can be accounted for using the calendar module or by writing custom logic. The calendar module provides a function called isleap() to check if a given year is a leap year.

Here’s an example of how you can use the calendar module to check if a year is a leap year:

python

import calendar

year = 2024

if calendar.isleap(year):
print(f”{year} is a leap year.”)
else:
print(f”{year} is not a leap year.”)

Alternatively, you can write custom logic to determine if a year is a leap year. The logic for determining leap years is as follows:

    1. If a year is evenly divisible by 4, it is a leap year.
    2. However, if the year is evenly divisible by 100, it is not a leap year, unless:
    3. The year is also evenly divisible by 400, in which case it is a leap year.

Here’s an example of how you can implement this logic in Python without using the calendar module:

python
def is_leap_year(year):
if year % 4 == 0:
if year % 100 == 0:
if year % 400 == 0:
return True
else:
return False
else:
return True
else:
return False
year = 2024if is_leap_year(year):
print(f”{year} is a leap year.”)
else:
print(f”{year} is not a leap year.”)
Both approaches will correctly determine whether a given year is a leap year or not.

 

What is time?

February 29, 2024
mike@standardsmichigan.com
,
No Comments

“What then is time? If no one asks me, I know what it is.

If I wish to explain it to him who asks, I do not know.”

Saint Augustine (“Confessions” Book XI)

When did time zones become a thing?

Readings / Radio Controlled Clocks

“Time flies like an arrow; fruit flies like a banana.” — Groucho Marx

“Time is a great healer, but a terrible beautician.” — Unknown

“Time and tide wait for no man, but time always stands still for a woman of 30.” — Robert Frost

“Time is what we want most, but what we use worst.” — William Penn

“Time is the best teacher; unfortunately, it kills all its students.” — Robin Williams

“Inside every older person is a younger person wondering what happened.” — Jennifer Yane

“Age is an issue of mind over matter. If you don’t mind, it doesn’t matter.” — Mark Twain

“They say time is a great teacher, but unfortunately it kills all its pupils.” — Louis Hector Berlioz

“Middle age is when you’re sitting at home on a Saturday night and the telephone rings, and you hope it isn’t for you.” — Ogden Nash

“The trouble with jogging is that by the time you realize you’re not in shape for it, it’s too far to walk back.” — Franklin P. Jones

“Time is a dressmaker specializing in alterations.” — Faith Baldwin

Standards February: Discovery & Invention

February 29, 2024
mike@standardsmichigan.com

No Comments

“Science advances one funeral at a time”
— Max Planck

you shall above all things be glad and young For if you're young,whatever life you wear it will become you;and if you are glad whatever's living will yourself become. - e. e. cummingsPhilosophiæ Naturalis Principia Mathematica | 1686 Sir Issaac Newton

A Mathematical Theory of Communication | 1948 Claude E. Shannon (University of Michigan)

Image: Christopher Newport University

1955 Polio Vaccine: Jonas Salk (University of Michigan)

Reflections / John Nash

The Future of Cosmology | Roger Penrose

A Structure for Deoxyribose Nucleic Acid | James Watson & Francis Crick

Quantum Information Science


Sir Isaac Newton’s Principia: Mathematical Principles of Natural Philosophy

“One teacher even failed me in Chemistry” Tomas Lindahl

Discovery of Receptors for Temperature and Touch

Speculative Prices, Inflation & Behavioral Economics


The fundamental concept in social science is Power, in the same sense in which Energy is the fundamental concept in physics. - Bertrand Russell

Time Series Analysis, Cointegration and Applications


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The Steam Engine: The invention of the steam engine in the 18th century by pioneers like James Watt revolutionized industry, transportation, and agriculture, powering factories, locomotives, and ships and driving the Industrial Revolution.

The Internal Combustion Engine: The development of the internal combustion engine in the 19th century revolutionized transportation and manufacturing, leading to the proliferation of automobiles, airplanes, and machinery that powered economic growth and globalization.

The Internet: Originating from research projects in the late 20th century, the internet has become a fundamental infrastructure for communication, commerce, education, and entertainment, connecting billions of people worldwide and enabling unprecedented access to information and resources.

Semiconductors and Integrated Circuits: The invention of semiconductors and integrated circuits in the mid-20th century paved the way for the digital revolution, enabling the miniaturization and mass production of electronic devices such as computers, smartphones, and microprocessors.

Agriculture: The transition from a hunter-gatherer lifestyle to settled agriculture marked the beginning of civilization and allowed for the development of permanent settlements, leading to population growth, specialization of labor, and the emergence of complex societies.

The Wheel: Invented around 3500 BCE, the wheel revolutionized transportation, enabling the movement of goods and people over long distances and laying the foundation for subsequent advancements in engineering and machinery.

Writing: The development of writing systems, such as cuneiform in Mesopotamia and hieroglyphs in Egypt, facilitated the recording and dissemination of information, contributing to the preservation of knowledge, governance, and cultural expression.

Martingale Representation Theorem

Time Synchronization of Medium Voltage Substations

February 29, 2024
jia
, , ,
No Comments

 

Time Synchronization of Medium Voltage Substation IEDs Using Modbus and Python

Joseph Owusu, et. al

 

Abstract:  Energy demand and supply all over the world is increasing in size and complexity. Anomalous conditions caused by failures in electrical components, human errors and environmental conditions result in electrical faults that can interrupt electricity flow. Substation automation requires precise time synchronization for a variety of Intelligent Electronic Devices for fault diagnosis. The quest for accurate and sequential time stamping of events compels power utility companies to adopt various techniques of time synchronization with an accuracy of a millisecond or a microsecond. Some works adopt the use of time synchronization techniques using protocols such as Network Time Protocol, Precision Time protocol, Simple Network Time Protocol and many more. This work presents time synchronization of IEDs using Modbus protocol and python programming language for a local substation. The system records the output data into a database and displays it on an application software. The time synchronization system was successful alternative for off network systems.

 

Related:

Time Synchronization in the Electric Power System

Security 200

February 28, 2024
mike@standardsmichigan.com
,
No Comments

 

“We worry about what a child will become tomorrow,

yet we forget that he is someone today.”

– Stacia Tauscher

 

Today we run a status check on the stream of technical and management standards evolving to assure the highest possible level of security in education communities.  The literature expands significantly from an assortment of national standards-setting bodies, trade associations, ad hoc consortia and open source standards developers.  CLICK HERE for a sample of our work in this domain.

School security is big business in the United States.   According to a report by Markets and Markets, the global school and campus security market size was valued at USD 14.0 billion in 2019 and is projected to reach USD 21.7 billion by 2025, at a combined annual growth rate of 7.2% during the forecast period.  Another report by Research And Markets estimates that the US school security market will grow at a compound annual growth rate of around 8% between 2020 and 2025, driven by factors such as increasing incidents of school violence, rising demand for access control and surveillance systems, and increasing government funding for school safety initiatives.

Because the pace of the combined annual growth rate of the school and campus security market is greater than the growth rate of the education “industry” itself, we’ve necessarily had to break down our approach to this topic into modules:

Security 100.   A survey of all the technical and management codes and standards for all educational settings — day care, K-12, higher education and university affiliated healthcare occupancies.

Security 200.   Queries into the most recent public consultations on the components and interoperability* of supporting technologies

Video surveillance: indoor and outdoor cameras, cameras with night vision and motion detection capabilities and cameras that can be integrated with other security systems for enhanced monitoring and control.

Access control: doors, remote locking, privacy and considerations for persons with disabilities.

Panic alarms: These devices allow staff and students to quickly and discreetly alert authorities in case of an emergency.

Metal detectors: These devices scan for weapons and other prohibited items as people enter the school.

Mass notification systems: These systems allow school administrators to quickly send emergency alerts and notifications to students, staff, and parents.

Intrusion detection systems: These systems use sensors to detect unauthorized entry and trigger an alarm.

GPS tracking systems: These systems allow school officials to monitor the location of school buses and track the movements of students during field trips and other off-campus activities.

Security 300.  Regulatory and management codes and standards; a great deal of which are self-referencing.

Security 400.  Advanced Topics.

As always, we reckon first cost and long-term maintenance cost, including software maintenance for the information and communication technologies (i.e. anything with wires) installed in the United States.  Cybersecurity is outside our wheelhouse and beyond our expertise.  In order to do any of the foregoing reasonably well, we have to leave cybersecurity standards to others.

Bob Hope Primary School Kadena Air Base

 


Education Community Safety catalog is one of the fast-growing catalogs of best practice literature.  In developing district security plans, K-12 school leaders stress that school safety is a cross-functional responsibility and every individual’s participation drives the success of overall safety protocols.  We link a small sample below and update ahead of every Security colloquium.

Artificial Intelligence Tries (and Fails) to Detect Weapons in School

Could AI be the future of preventing school shootings?

Executive Order 13929 of June 16, 2020 Safe Policing for Safe Communities

Clery Act

National Center for Education Statistics: School Safety and Security Measures

International Code Council

2021 International Building Code

Section 1010.1.9.4 Locks and latches

Section 1010.2.13 Delayed egress.

Section 1010.2.14 Controlled egress doors in Groups I-1 and I-2.

Free Access: NFPA 72 National Fire Alarm and Signaling Code

Free Access: NFPA 731 Standard for the Installation of Premises Security Systems

IEEE: Design and Implementation of Campus Security System Based on Internet of Things

APCO/NENA 2.105 Emergency Incident Data Document 

C-TECC Tactical Emergency Casualty Care Guidelines

Department of Transportation Emergency Response Guidebook 2016

NENA-STA-004.1-2014 Next Generation United States Civic Location Data Exchange Format

Example Emergency Management and Disaster Preparedness Plan (Tougaloo College,  Jackson, Mississippi)

Partner Alliance for Safer Schools

Federal Bureau of Investigation Academia Program

Most Dangerous Universities in America

Federal Bureau of Investigation: Uniform Crime Reporting Program

ICYMI: Guide to Campus Security


* Interoperability refers to the ability of different technologies or systems to communicate and work together seamlessly. In the context of school security technologies, interoperability can help improve the effectiveness of security systems and make it easier for school personnel to manage and respond to potential security threats.  Here’s what we look for:

  1. Standardization: By standardizing communication protocols and data formats, school security technologies can be made more compatible with each other, making it easier for different systems to communicate and share information.
  2. Integration: School security technologies can be integrated with each other to provide a more comprehensive security solution. For example, access control systems can be integrated with video surveillance systems to automatically trigger alerts when an unauthorized person enters a restricted area.
  3. Open Architecture: Open architecture solutions enable different security systems to be connected and communicate with each other regardless of their manufacturer or supplier. This approach makes it easier to integrate different technologies and avoid vendor lock-in.
  4. Cloud-based Solutions: Cloud-based security solutions can enable interoperability by providing a centralized platform for managing and monitoring different security systems. This approach can also simplify the deployment of security technologies across multiple locations.
  5. Collaboration: School security technology providers can work together to develop interoperability standards and best practices that can be adopted across the industry. Collaboration can help drive innovation and improve the effectiveness of security systems.

 

 

 

Ingress

February 28, 2024
mike@standardsmichigan.com
No Comments

We have shouted from the mountaintops — beginning in the 2002 National Electrical Code and later in the International Building Code — that “ingress” concepts (the opposite of the canonical term “egress”; meaning the way INTO a building during an emergency) should become part of the vocabulary when exploring best practice concepts for security in education settlements.

Alas, so far without success.  Evidently, the term “ingress” has been appropriated by a variant — accessibility — which re-directs the discussion toward the American with Disabilities Act?

What about people who are not disabled who seek to enter a building?

We cite a 1981 study, sponsored by what is now the National Institute of Standards and Technology — Crowd ingress to Places of Assembly: Summary and Proceedings of an Experts’ Workshop –– to enlighten understanding how ingress is different from the term access.

We maintain this topic on all of our Security related colloquia; hosted on days that appear on our CALENDAR.  Use the login credentials at the upper right of our home page.

Entrance door to Standards Michigan Ann Arbor office

Means of Egress

 

 

Wires

February 27, 2024
mike@standardsmichigan.com

No Comments

Ampere current flows through copper or aluminum conductor due to the movement of free electrons in response to an applied electric field of varying voltages.   Each copper or aluminum contributes one free electron to the electron sea, creating a vast reservoir of mobile charge carriers. When a potential difference (voltage) is applied across the ends of the conductor, an electric field is established within the conductor. This field exerts a force on the free electrons, causing them to move in the direction of the electric field.  The resulting current flow can be transformed into different forms depending on the nature of the device.

Heating: When current flows through a resistor, it encounters resistance, which causes the resistor to heat up. This is the principle behind electric heaters, toasters, and incandescent light bulbs.

Mechanical Work: Current flowing through an electric motor creates a magnetic field, which interacts with the magnetic field of the motor’s permanent magnets or electromagnets. This interaction generates a mechanical force, causing the motor to rotate. Thus, electrical energy is converted into mechanical energy; including sound.

Light: In an incandescent light bulb, a filament heats up ( a quantum phenomena) due to the current passing through it. This is an example of electrical energy being converted into light energy; including the chemical energy through light emitting diodes

Today we dwell on how conductors are specified and installed in building premise wiring systems primarily; with some attention to paths designed to carry current flowing through unwanted paths (ground faults, phase imbalance, etc).   In the time we have we will review the present state of the best practice literature developed by the organizations listed below:

International Electrotechnical Commission

60304 Low voltage installations: Protection against electric shock

Institute of Electrical and Electronic Engineers

National Electrical Safety Code

Insulated Cable Engineers Association

International Association of Electrical Inspectors

National Fire Protection Association

National Electrical Code

Code Making Panel 6

Transcript of CMP-6 Proposals for 2026 NEC

Other organizations such as the National Electrical Manufacturers Association, ASTM International, Underwriter Laboratories, also set product and installation standards.  Data center wiring; fiber-optic and low-voltage control wiring is covered in other colloquia (e.g. Infotech and Security) and coordinated with the IEEE Education & Healthcare Facilities Committee.

Use the login credentials at the upper right of our home page.


Related:

2017 National Electrical Code § 110.5

Neher-McGrath Calculation: Cable Calculation ampacity and Thermal Analysis

ETAP: Cabling Sizing – Cable Thermal Analysis

 

System Aspects of Electrical Energy

Impedance Grounding for Electric Grid Surviability

Electric Power Availability: Cold Weather Preparedness

Architecture of power systems: Special cases

Outdoor Deicing & Snow Melting

Campus Outdoor Lighting

High Voltage Electric Service

Campus Bulk Electrical Distribution

Electric Power Availability: Cold Weather Preparedness

February 27, 2024
mike@standardsmichigan.com
No Comments

PUBLIC LAW 109–58—AUG. 8, 2005 | ENERGY POLICY ACT OF 2005

Reliability v. Availability

January 25th Joint Meeting of the Nuclear Regulatory Commission and FERC: Docket No. AD06-6-000.  Given the close coupling of electric and natural gas supply with respect to power reliability, the mind boggles at the hostility of the Biden Administration to natural gas anywhere on earth.  Natural gas is critical to generation plant black start capabilities and hospitals, among others.

A selection of the presentations:

“Long Term Reliability Assessment” – Presented by Mark Lauby, Senior Vice President and Chief Engineer, NERC

“Grid Reliability Overview & Updates” – Presented by David Ortiz, Director of the Office of Electric Reliability

“Status of Standards and Implementation for Cold Weather Preparedness and Applicability to Nuclear Plants” – Presented by David Huff, Electrical Engineer, Office of Electric Reliability

“Gas-Electric Coordination Since Winter Storm Uri” – Presented by Heather Polzin, Reliability Enforcement Counsel, Office of Enforcement

“Overview of Power Reactor Activities” – Presented by Andrea Kock, Deputy Office Director for Engineering, NRR

“Grid Reliability Updates” – Presented by Jason Paige, Chief, Long-Term Operations and Modernization Branch, Division of Engineering and External Hazards, NRR

Electrical Resource Adequacy

Related:

Utah State University: History of Probability

Sample Probability and Statistics Problem from Professional Electrical Engineer’s Examination

Loss-of-load-based reliability indices

Chicken and Dumplings

February 26, 2024
mike@standardsmichigan.com

No Comments

Standards Wyoming

Appetite for Knowledge

Cozy Chicken and Dumplings

Layout mode
Predefined Skins
Custom Colors
Choose your skin color
Patterns Background
Images Background
Skip to content