Programming Challenge: Array and Loop Manipulation (Intermediate)

This image is an illustration featuring a stylized scene with a central magnifying glass focused on a number 5 on a cube. The magnifying glass has a classic design with a blue tinted glass and a beige handle. Surrounding the magnifying glass are multiple cubes with numbers and mathematical symbols on their faces. The cubes have different numerical values such as 3, 4, 5, 6, 7, and 8, with mathematical operations next to them like "+4," "-2," "x4," and "?". Arrows around the cubes suggest movement or rearrangement, implying a dynamic or interactive aspect to the puzzle-like setting. The overall color scheme is warm with a monochromatic tan background that complements the blue and white of the cubes. The image could be interpreted as a metaphor for problem-solving, analysis, or mathematics, as it appears to represent a numerical puzzle or game being examined or solved.

Challenge Description:

You are provided with a list of n non-negative integers. Your task is to write a program that performs the following operations:

  1. Query Mode:
    • The program should first ask the user if they want to perform queries or updates: Enter 'Q' for query and 'U' for update.
    • If the user enters Q, prompt them to enter a range [l, r] (1-based index) and then output the sum of elements from index l to r inclusive.
  2. Update Mode:
    • If the user enters U, prompt them to enter an index i (1-based index) and a value v. Update the element at index i by adding v to it (this is an increment operation, not set).
    • After each update, print the new full array.

The challenge is designed to teach basic array manipulations and looping constructs, with a focus on handling user inputs and performing range queries and updates efficiently.

Continue reading “Programming Challenge: Array and Loop Manipulation (Intermediate)”

Toronto’s Lane Filtering Proposal: Where Do We Stand?

A dynamic daytime traffic scene on a multi-lane highway, viewed from behind a motorcyclist engaged in lane splitting. The motorcyclist, in clear focus, wears a black helmet, black jacket, white gloves, and light-colored pants, navigating skillfully between lanes. Surrounding vehicles include a mix of cars and a pickup truck, with urban buildings and a clear blue sky in the background, capturing the essence of rush-hour congestion.

In 2018, Toronto toyed with a concept that sparked interest among motorcyclists and raised eyebrows among the city’s drivers: lane filtering. This maneuver, which allows motorcyclists to weave between lanes of stopped or slow-moving traffic, promised a smoother ride for two-wheelers and posed questions about road safety and traffic flow. Fast forward to today, and many are left wondering, what ever happened to that proposal? Let’s revisit the facts and ponder the current state of lane filtering in Toronto.

Continue reading “Toronto’s Lane Filtering Proposal: Where Do We Stand?”

🌿 Ethical Wildlife Photography: A Guide 📸

This is a vibrant and fantastical illustration showing a photographer, kneeling with their camera on a tripod, capturing the serene beauty of an enchanted forest. The scene is drenched in sunlight filtering through the canopy, illuminating an array of flora and fauna. Several species of animals are depicted in harmony, including deer, rabbits, foxes, hedgehogs, and various birds, some in flight and others perched by the water. The flowing creek adds a sense of tranquility, with fish visible beneath the surface. This magical setting is bursting with color, from the lush green trees to the richly colored flowers and moss-covered stones. Butterflies flit in the air, adding to the fairytale ambiance. The composition invokes a sense of wonder and the richness of untouched nature through ethical photography.

The Ontario Parks blog post discusses the importance of ethical wildlife photography, highlighting seven common issues photographers should avoid, such as baiting wildlife, trampling off-trail, damaging habitats, introducing non-native species, unsafe roadside manners, following wildlife too closely, and using recordings to attract animals. It emphasizes respect for nature and the need to minimize impact while capturing the beauty of wildlife and landscapes, encouraging photographers to practice responsible behavior to protect the environment and its inhabitants.

Read more here.

US Sues Apple in Landmark iPhone Monopoly Lawsuit

The Department of Justice (DOJ), supported by 15 states and the District of Columbia, has filed a lawsuit against Apple in the U.S. District Court for the District of New Jersey, accusing the tech giant of monopolistic practices in violation of Section 2 of the Sherman Antitrust Act. The lawsuit highlights Apple’s dominance in the U.S. smartphone market, where it holds over 65% of the total market and more than 70% of the performance smartphone segment. It attributes Apple’s significant net income, which surpasses the GDP of over 100 countries, largely to the success of its iPhone product line.

Continue reading “US Sues Apple in Landmark iPhone Monopoly Lawsuit”

OTF Rejects Request from Ontario to Let Retired Teachers Work More

Key Takeaway

Ontario’s teachers unions have rejected a request from the Ministry of Education to extend the working period for retired teachers, emphasizing the need for the government to address staffing shortages more effectively.

Continue reading “OTF Rejects Request from Ontario to Let Retired Teachers Work More”

What does Spring Arrive? (According to ChatGPT)

A vivid landscape depicting the transition from winter to spring in Canada. The left side of the image shows a snowy environment with lingering snowflakes and the Rocky Mountains, representing winter. The right side bursts with the colors of spring, featuring blooming flowers, budding trees, and Niagara Falls, under a clear, sunny sky. At the center, the Earth is symbolically positioned relative to the Sun to indicate the vernal equinox, illustrating the astronomical perspective of spring's arrival. This composition harmoniously integrates meteorological, astronomical, and geographical perspectives on the onset of spring in Canada.

I love ChatGPT. I pretty much use it all the time now instead of Google. So when I turned to it to ask the simple question “When does spring arrive?”, I was met with this overly complex response:

Continue reading “What does Spring Arrive? (According to ChatGPT)”

My Custom GPTs

This is a highly detailed and stylized digital artwork featuring a workspace scene. The scene is dominated by a central, large monitor displaying a complex and intricate design, which includes various gears, circuits, and a prominent letter 'A' in a futuristic style. Surrounding the monitor are floating objects that seem to defy gravity, including a light bulb emitting a soft glow, sheets of paper, electronic components, and household objects like a magnifying glass and a pair of glasses. The desk below is cluttered with an open book directly in front of the screen, a wizard's hat with stars and a moon pattern to the left, and stacks of hardcover books to the right. Various items like pencils, a notebook, a coffee cup, and other office supplies are scattered across the desk. The background features a bookshelf filled with books and a wall-mounted clock, adding to the ambiance of an intellectual and creative space. The lighting is warm and comes from the left, casting soft shadows and giving depth to the objects. The overall impression is one of magical innovation and intellectual pursuit, as if the space belongs to a wizard in the modern age of technology.

For those of you with a ChatGPT Plus account, here are the public custom GPTs I have created. Some were created primarily for my own personal productivity, while others were designed to benefit educators.

Continue reading “My Custom GPTs”

New Custom GPT: Find Keywords – A Powerful Tool for Content Analysis

New Custom GPT: Find Keywords

I’ve created a new Custom GPT that will reduce text to just the keywords. The GPT is named Find Keywords and can be found at https://chat.openai.com/g/g-mL985wIE7-find-keywords.

Note that it requires a subscription to ChatGPT Plus. Unfortunately, OpenAI does not offer trial subscriptions, and subscriptions cost $20 USD per month. Personally, I find the subscription well worth it for both personal programming projects and for personal productivity.

Continue reading “New Custom GPT: Find Keywords – A Powerful Tool for Content Analysis”

ICS Assessment GPT

This image shows a user interface for an "Ontario ICS Assessment" tool, presumably an online platform for submitting and grading assignments or projects. The top of the interface has a dropdown menu labeled "Ontario ICS Assessment." Below this is a large title "Ontario ICS Assessment" followed by the subtitle "By Peter Beens" with a printer icon next to the name. Underneath, there is a brief description stating, "Submit anything and have it graded according to the Ontario ICS achievement chart." At the bottom of the interface, there is a search bar with the placeholder text "What can this GPT do?" suggesting the interface includes a chat or search function related to the assessment tool. To the bottom left, there is a message button labeled "Message Ontario ICS Assessment…" indicating a feature to send messages. The overall color scheme is simple, with dark text on a light background. There is no additional contextual information outside of the interface elements.

Introduction

Just for fun I wanted to see if I could create a custom GPT (Generative Pre-trained Transformer) that could use The Achievement Chart for the Grade 10 Computer Studies Course to assess assignments from any of the ICS Computer Studies courses.

The instructions I gave it were:

Continue reading “ICS Assessment GPT”

Google Gemini vs ChatGPT: Generating Alt-Text. Who Wins?

An illustrative comparison between Google Gemini and ChatGPT for generating alt-text, depicted through a split design. On the left, Google Gemini is symbolized by futuristic, abstract shapes in blues and greens, embodying innovation and digital intelligence. On the right, ChatGPT is represented through a network of interconnected nodes and lines in warm orange and red tones, highlighting advanced AI technology and communication. A bold 'VS' symbol in the center accentuates the competitive analysis between the two technologies, against a backdrop that merges both designs, suggesting a blend of competition and collaboration in the field of alt-text generation.

Introduction

I’m currently subscribing to ChatGPT and Google Gemini to test them both out. One of the tasks I often use chatbots for is creating alt-text for my images.

For the importance of using alt-text in your images, see this post.

The prompt given to Gemini and ChatGPT was: ‘Alt text for this image‘.

Here is the image I used. Note that it includes text instructions and images.

Continue reading “Google Gemini vs ChatGPT: Generating Alt-Text. Who Wins?”