Wednesday, December 4, 2024

 Mesh networking and UAV (Unmanned Aerial Vehicle) swarm flight communication share several commonalities, particularly in how they handle connectivity and data transfer: 

 

Dynamic Topology: Both systems often operate in environments where the network topology can change dynamically. In mesh networks, nodes can join or leave the network, and in UAV swarms, drones can move in and out of range. 

 

Self-Healing: Mesh networks are designed to automatically reroute data if a node fails or a connection is lost. Similarly, UAV swarms use mesh networking to maintain communication even if some drones drop out or move out of range. 

 

Redundancy: Both systems use redundancy to ensure reliable communication. In mesh networks, multiple paths can be used to send data, while in UAV swarms, multiple drones can relay information to ensure it reaches its destination. 

 

Decentralization: Mesh networks are decentralized, meaning there is no single point of failure. UAV swarms also benefit from decentralized communication, allowing them to operate independently and collaboratively without relying on a central control point. 

 

Scalability: Both mesh networks and UAV swarms can scale to accommodate more nodes or drones, respectively, without significant degradation in performance. 

 

These commonalities make mesh networking an ideal solution for UAV swarm communication, ensuring robust and reliable connectivity even in challenging environments. 

Similarly, distributed hash tables, cachepoints arranged in a ring and consensus algorithms also play part in the communications between drones. 

Cachepoints are used with consistent hashing. They are arranged along the circle depicting the key range and cache objects corresponding to the range. Virtual nodes can join and leave the network without impacting the operation of the ring. 

Data is partitioned and replicated using consistent hashing to achieve scale and availability. Consistency is facilitated by object versioning. Replicas are maintained during updates based on a quorum like technique. 

In a distributed environment, the best way to detect failures and determine memberships is with the help of gossip protocol. When an existing node leaves the network, it may not respond to the gossip protocol so the neighbors become aware.  The neighbors update the membership changes and copy data asynchronously. 

Some systems utilize a state machine replication such as Paxos that combines transaction logging  for consensus with write-ahead logging for data recovery. If the state machines are replicated, they are fully Byzantine tolerant. 

Monday, December 2, 2024

 This is a summary of the book titled “Technology’s Child: Digital Media’s Role in the Ages and Stages of growing up” written by Katie Davis and published by MIT Press in 2023. This book is about the impact of digital technology on a child’s development. She examines how technology influences social connections, mental health, and identity formation revealing both the upsides and downsides. She highlights the need for thoughtful design, policy changes, and parental guidance to create healthier digital experiences. Parental guidance and control can determine the right use of an interactive technology and the development of the executive functions of the child but that said, self-paced learning and social interaction are also important. Balancing digital and real-world play is equally important. Social media and smartphones create both challenges and opportunities and play up to teens vulnerabilities but can also foster creativity and community. A lot of stakeholders must come together to design developmentally supportive technology.

Interactive technology can support the development of executive functions in children if children control their engagement with it and parents’ guide its use. The rise of interactive digital media, such as games on tablets and smartphones, can both support and hinder child development. However, apps that do not allow children to control the pace and steps of the game or activity can undermine these skills. Parents should be mindful of their children's technology use, opting for age-appropriate content and setting rules that limit screen time. Balancing screen time with active play and being conscious of how technology integrates into daily life is essential for healthy child development.

Digital tools play a crucial role in children's development by allowing self-paced learning and social interaction. Picture books and educational apps can help children explore themed objects, actions, and letters, while educational apps can encourage play and reward learning. Parents can provide personalized support for early literacy development by joining in with their children's tech experiences. The design of digital technology also plays a role in its effectiveness, with fast-paced or overly stimulating features hindering learning. Balancing digital and analog play is essential for fostering creativity, self-direction, and social skills. Open-ended and child-directed play is generally best, especially in early childhood. However, digital play may limit creativity compared to analog play, which encourages self-directed exploration. Parents should balance analog and digital play by allowing children to explore the natural world, ensuring that digital play doesn't dominate or detract from hands-on, creative experiences.

Digital technology has the potential to transform middle childhood learning by offering interactive and interest-driven opportunities. However, many schools fail to harness this potential, often using technology to replicate existing classroom practices. To overcome this, schools and educators should gradually change their learning and teaching processes and be open to new technologies. Collaboration with teachers, peers, and family members is crucial for promoting constructive digital learning. Social media and smartphones have transformed the relationship between tweens and parents, creating both challenges and opportunities. Parents view smartphones as safety tools, while tweens see them as symbols of freedom and autonomy. Social media can also introduce risks, such as connection overload and cyberbullying. Open dialogue between parents, teachers, and tweens is essential to improve these dynamics. Supportive interventions, such as teaching tweens how to manage digital stress, mute notifications, and reframe their online experiences, can help reduce the adverse effects of social media while promoting healthier peer interactions.

Social media platforms can exploit teen vulnerabilities and enhance their social interactions, causing negative self-comparison and depression. However, technology can also enrich adolescents' lives by providing avenues for self-expression and community. Teens use platforms like TikTok, Instagram, and Snapchat to explore and share creative content, form meaningful social bonds, and resist pressures of social comparison. Emerging adults can use networked technologies to engage in public discourse but can also cause participation anxiety. Social media activism can lead to emotional strain, harassment, and content exploitation, leading to burnout.

To support children's development, designers must focus on creating tools that allow flexibility, self-direction, and meaningful engagement. Collaboration with experts in child development and diverse communities is crucial to ensure equitable experiences for children of all social, cultural, and economic backgrounds. Policymakers should introduce regulations that incentivize tech companies to prioritize child well-being, such as the UK's Age-Appropriate Design Code.


Sunday, December 1, 2024

 The following implementation follows up on an article about contextual embeddings for UAV swarm camera image analytics.

import the

from azure.ai.vision import VisionClient, AzureKeyCredential, AnalyzeImageOptions

from azure.ai.textanalytics import TextAnalyticsClient

from langchain.embeddings import OpenAIEmbeddings

from langchain.text_splitter import RecursiveCharacterTextSplitter

from langchain.vectorstores import FAISS

# Replace with your Azure credentials and endpoints

vision_key = "YOUR_VISION_API_KEY"

vision_endpoint = "YOUR_VISION_API_ENDPOINT"

text_analytics_key = "YOUR_TEXT_ANALYTICS_API_KEY"

text_analytics_endpoint = "YOUR_TEXT_ANALYTICS_API_ENDPOINT"

# Initialize Azure Vision and Text Analytics clients

vision_client = VisionClient(credential=AzureKeyCredential(vision_key), endpoint=vision_endpoint)

text_analytics_client = TextAnalyticsClient(endpoint=text_analytics_endpoint, credential=AzureKeyCredential(text_analytics_key))

# Function to analyze image and extract tags and metadata

def extract_tags_and_metadata(image_url):

    analyze_options = AnalyzeImageOptions(features=["objects", "tags", "description"])

    analysis_result = vision_client.analyze_image(image_url, analyze_options)

    tags = [tag.name for tag in analysis_result.tags]

    metadata = {

        "description": analysis_result.description.captions[0].text if analysis_result.description.captions else "",

        "tags": tags

    }

    return metadata

# Function to generate a description using tags and metadata

def generate_description(tags, metadata):

    description = metadata["description"]

    if not description:

        description = f"This image contains {', '.join(tags)}."

    return description

# Example image collection

image_collection = [

    "URL_OF_IMAGE_1",

    "URL_OF_IMAGE_2",

    "URL_OF_IMAGE_3"

]

# Extract tags, metadata, and generate descriptions

image_data = []

for image_url in image_collection:

    metadata = extract_tags_and_metadata(image_url)

    description = generate_description(metadata["tags"], metadata)

    image_data.append({

        "url": image_url,

        "description": description

    })

# Function to match a query to the best description using text embeddings

def match_query_to_best_description(query, image_data):

    texts = [item["description"] for item in image_data]

    embedding = OpenAIEmbeddings()

    text_splitter = RecursiveCharacterTextSplitter()

    vectorstore = FAISS.from_texts(texts, embedding, text_splitter)

    query_embedding = embedding.embed_query(query)

    best_match = vectorstore.similarity_search(query_embedding, 1)

    return best_match[0]["page_content"] if best_match else None

# Example query

query = "A scenic view of mountains with a lake in the foreground"

# Find the best matching description for the query

best_description = match_query_to_best_description(query, image_data)

print("Best Matching Description:")

print(best_description)

#codingexercise: CodingExercise-12-01-2024.docx

Saturday, November 30, 2024

CodingExercise: Rotate List

Medium

Topics

Companies

Given the head of a linked list, rotate the list to the right by k places.

Example 1:

Input: head = [1,2,3,4,5], k = 2

Output: [4,5,1,2,3]

Example 2:

Input: head = [0,1,2], k = 4

Output: [2,0,1]

Constraints:

The number of nodes in the list is in the range [0, 500].

-100 <= Node.val <= 100

0 <= k <= 2 * 109

/**

 * Definition for singly-linked list.

 * public class ListNode {

 *     int val;

 *     ListNode next;

 *     ListNode() {}

 *     ListNode(int val) { this.val = val; }

 *     ListNode(int val, ListNode next) { this.val = val; this.next = next; }

 * }

 */

class Solution {

    public ListNode rotateRight(ListNode head, int k) {

        if (head == null || k == 0) return head;

        Listhead current = head;

        int n = 0;

        while (current){

             n++;

             current = current.next;

        }

        if (k > n) { k = k % n;}

        int offset = n - k;

        current = head;

        if (offset > 0) {

            while (offset > 1) {

                current = current.next;

                offset--;

            }

            ListNode remaining = current.next;

            current.next = null;

            ListHead end = remaning;

            while (end && end.next) {

                end = end.next;

            }

            end.next = head;

            return remaining;

        }

        return head;

    }

}

 


Friday, November 29, 2024

 Mesh networking and UAV (Unmanned Aerial Vehicle) swarm flight communication share several commonalities, particularly in how they handle connectivity and data transfer:

Dynamic Topology: Both systems often operate in environments where the network topology can change dynamically. In mesh networks, nodes can join or leave the network, and in UAV swarms, drones can move in and out of range.

Self-Healing: Mesh networks are designed to automatically reroute data if a node fails or a connection is lost. Similarly, UAV swarms use mesh networking to maintain communication even if some drones drop out or move out of range.

Redundancy: Both systems use redundancy to ensure reliable communication. In mesh networks, multiple paths can be used to send data, while in UAV swarms, multiple drones can relay information to ensure it reaches its destination.

Decentralization: Mesh networks are decentralized, meaning there is no single point of failure. UAV swarms also benefit from decentralized communication, allowing them to operate independently and collaboratively without relying on a central control point.

Scalability: Both mesh networks and UAV swarms can scale to accommodate more nodes or drones, respectively, without significant degradation in performance.

These commonalities make mesh networking an ideal solution for UAV swarm communication, ensuring robust and reliable connectivity even in challenging environments.

Similarly, distributed hash tables, cachepoints arranged in a ring and consensus algorithms also play a part in the communications between drones.

Cachepoints are used with consistent hashing. They are arranged along the circle depicting the key range and cache objects corresponding to the range. Virtual nodes can join and leave the network without impacting the operation of the ring.

Data is partitioned and replicated using consistent hashing to achieve scale and availability. Consistency is facilitated by object versioning. Replicas are maintained during updates based on a quorum like technique.

In a distributed environment, the best way to detect failures and determine memberships is with the help of gossip protocol. When an existing node leaves the network, it may not respond to the gossip protocol so the neighbors become aware. The neighbors update the membership changes and copy data asynchronously.

Some systems utilize a state machine replication such as Paxos that combines transaction logging for consensus with write-ahead logging for data recovery. If the state machines are replicated, they are fully Byzantine tolerant.


Thursday, November 28, 2024

 This is a summary of the book titled “The Circular Business Revolution – a practical framework for sustainable business models” written by Manuel Braun and Julia Binder and published by FT Publishing in 2024. The authors encourage business to shift from the linear “take-make-waste” model of business to a sustainable circular, “net positive” model that aims at both business success and environmental and social good. They assert that the shift is both possible and necessary. Sometimes the shift might require redesigning the business model. That can be done by focusing on resource use, ecosystems, uses of waste, and product life for sustainability and by focusing on the value chain and operating environment for the business’ future. It’s also important to set the goals high in how the company can create a net positive impact. Both business and environmental aims must align with the company’s vision. Execution can be complex, but it focuses on integrating sustainability

The shift from a linear economy to a circular one is both possible and necessary. The current linear model, which starts with the extraction of natural resources and ends with waste, is inefficient and has negative environmental effects. A circular economy, which focuses on value creation through continuous use and reuse, is becoming more prevalent. This transformation is inevitable and can be achieved through three horizons: near, far, and mid-term. To transition, businesses should assess signs for change, create a vision for a circular, regenerative future, investigate business models that achieve good business outcomes and low environmental impact, and strengthen their readiness for change. The circular economy aims at "eco-effectiveness" and focuses on meeting human needs rather than just profit. Participants in a circular economy use nine strategies, called "R-strategies," to achieve circularity and reduce pressure on resources.

Circular business models are a type of business strategy that focuses on resource use, ecosystems, waste, product life, or servitization. They fall into five categories: optimizing resource use, restoring ecosystems, capturing waste value, extending product life, and bundling services and products. These models aim to make existing operations more environmentally sustainable, reducing waste and pollution, and promoting sustainable practices. They also focus on restoring ecosystems, such as the cultivation of the illipe nut in Borneo, which combats deforestation and supports local communities. They also recognize the economic value of waste materials, such as by-products, and create value by recovering them. They also focus on providing integrated solutions tailored to specific needs, often through sharing and pooling platforms.

To understand your business's future, consider your value chain and operating environment from two perspectives: inside out and outside in. The inside-out view helps identify inefficiencies in the linear system, such as overuse of resources, negative externalities, waste generation, underutilized capacities, and product losses. The outside-in view considers the business's operating environment, which will face disruption due to increasing resources scarcity, power dynamics, and other drivers. Maintaining your "license to operate" and "license to innovate" is crucial for gaining a competitive advantage.

To transition from linear to circular, start with a clear vision for achieving business success and environmental goals. Develop this vision from both an environmental and business perspective, building on existing values and mission. Backcasting helps determine what needs to be done to make the vision a reality. Companies like FREITAG are promoting circularity by focusing on intelligent design and employee development.

A successful strategy for implementing a circular business model should address both business and environmental aims and align with the organization's vision. This involves a pathway to implementing a chosen business model and direction for the organization. The transition to servitization often faces the balance sheet dilemma, but it requires careful cash-flow management. Active stakeholder involvement is crucial, and the business model pathway should align with the organization's future vision. The implementation of a circular business model has six major dimensions: customer-centricity, design, ecosystem, data and technology, organizational structures and processes, and tools, systems, and KPIs. Leaders must communicate authentically, avoid greenwashing and greenhushing, and maintain transparency to demonstrate commitment to the transformation.


Wednesday, November 27, 2024

 

This is a summary of the book titled “Strong Supply Chains Through Resilient Operations” written by Suketu Gandhi, Marc Lakner, Sherri He, Tiffany Hickerson, and Michael F. Strohmer and published by Wiley in 2023. The authors make a case against the cost trimming  and lean-and-mean making of supply chains because the world is becoming more volatile, with geopolitical tensions, social unrest, and extreme weather. Instead, they ask that the supply chains be more resilient and flexible and propose a comprehensive program to do so. Case in point is the early 2020s when COVID struck, and operations needed to tackle a range of threats. By encouraging suppliers to be partners, positioning customer value as the key driver, cultivating a resilient workforce, revolutionizing with innovative technology, and a sustainability strategy, businesses can make their supply chain resilient to anything the world throws at them.

Supply-chain resilience is crucial in today's volatile, uncertain, complex, and ambiguous (VUCA) environment. Companies must prepare their operations for potential threats by restructuring their brittle supply chains to bend instead of breaking. In today's VUCA environment, businesses must adapt their strategies to new circumstances. To build resilient operations, businesses should prioritize a holistic view of their operations, including product planning, consumer research, manufacturing, and logistics.

To establish a relationship with suppliers, work together to establish a mutually beneficial relationship. Share goals and discuss how their work aligns with those goals. Encourage suppliers to cultivate similar relationships to build a network capable of providing early warnings about supply interruptions.

Reduce dependence on a single source and seek quality alternative suppliers as backups. Maximize value from suppliers and ensure everyone in the company understands the entire value chain.

Fast-fashion companies like Zara and H&M disrupted the traditional fashion industry by focusing on customer value and releasing new products continually. This approach allows them to adapt to changing customer attitudes and tackles issues like cost, sustainability, and shifting supply-demand profiles. To cultivate resilience, simplify your product portfolio, gather feedback, and use data analytics to understand customer preferences. The growth of e-commerce offers new opportunities for delivering products, but companies should be aware that customers may not be concerned about quick delivery for every product.

During the COVID pandemic, companies experimented with multichannel operations, such as online sales and home delivery. To set up an omnichannel operation, gather and analyze relevant data, consider last-mile options, and consider last-mile options like delivery or customer pickups.

Cultivate a resilient workforce by valuing diversity, promoting open communication, and offering a vision that aligns with personal values. This approach helps teams work harder, thrive in a fast-changing environment, and contribute to a positive culture.

Companies today recognize the importance of a diverse workforce for producing original ideas. However, this requires more than just hiring people from diverse backgrounds. Companies should focus on building resilience through "economies of skill" by implementing strategies such as outcome-based work, leveraging global expertise, promoting perennial learning, planning for future skills, and revolutionizing the supply chain with innovative technology. This includes using the Internet of Things, advanced robotics, wearable tech, and 3D printers to monitor operations and predict problems. A culture of continual learning is essential for employees to handle crises, adapt to customer preferences, and make the most of innovations. A sustainability strategy is also crucial for resilience, as stakeholders are increasingly aware of environmental, social, and governance (ESG) issues. Customers are willing to pay more for sustainable products, and employees worry about the environmental consequences of unsustainable practices. Sustainability is now a strategic advantage, as it can be framed as a way of minimizing waste.

Resilience is crucial in any future scenario, as it allows businesses to withstand risks and maintain a stable state. Key elements of resilience include transparency, data analysis, customer value, a proactive attitude, and the right people. These elements help businesses understand their operations, make informed decisions, and adapt to changes in the market. By empowering their employees with purpose, businesses can ensure a smooth transition and thrive in the future.

#Codingexercise: CodingExercise-11-27-2024.docx