Category Archives: Software

Loading
loading...

Engineering a Fair Future: Why we need to train unbiased AI

OpenAI was founded in 2015 by a group of technology luminaries, including Elon Musk, Sam Altman, Greg Brockman, Ilya Sutskever, John Schulman, and Wojciech Zaremba. The organization was created with the goal of developing advanced artificial intelligence technologies in a way that is safe and beneficial for humanity.  It is written in multiple programming languages, but the primary language used to build the model is Python but relies on a range of other software tools and frameworks, including TensorFlow and PyTorch for training and deploying the deep learning models, and various libraries for data preprocessing and postprocessing, such as spaCy, NLTK, and Transformers.

Since its founding, OpenAI has grown to become one of the world’s leading AI research organizations, with a team of hundreds of researchers and engineers working on a wide range of projects in areas such as natural language processing, robotics, computer vision, and more.  Much like humans, ChatGPT will likely struggle negotiating “bias”.  As of this posting it seems clear that the algorithm produces answers that are biased toward large central government; most likely the result of not having enough historical input about how a smaller central government is largely responsible for inventing it.

Software Engineering Ethics Education

print(“Python”)

Manifesto for Software Development

Application Programming Interface

This content is accessible to paid subscribers. To view it please enter your password below or send mike@standardsmichigan.com a request for subscription details.

Edge Case: Leap Year

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.

 

Layout mode
Predefined Skins
Custom Colors
Choose your skin color
Patterns Background
Images Background
Standards Michigan
error: Content is protected !!
Skip to content