<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by John Unwin on Medium]]></title>
        <description><![CDATA[Stories by John Unwin on Medium]]></description>
        <link>https://medium.com/@johnunwin?source=rss-1155c0f0227d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*aJfwR9gvv5CSD7uz.</url>
            <title>Stories by John Unwin on Medium</title>
            <link>https://medium.com/@johnunwin?source=rss-1155c0f0227d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 07:13:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@johnunwin/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Joan of Arc in Rouen — A Reflection]]></title>
            <link>https://johnunwin.medium.com/joan-of-arc-in-rouen-a-reflection-a953dffe3d43?source=rss-1155c0f0227d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a953dffe3d43</guid>
            <dc:creator><![CDATA[John Unwin]]></dc:creator>
            <pubDate>Mon, 12 May 2025 21:06:37 GMT</pubDate>
            <atom:updated>2025-05-12T21:09:55.222Z</atom:updated>
            <content:encoded><![CDATA[<h3>Joan of Arc in Rouen — A Reflection</h3><p><em>Rouen, Normandy — May 2025</em></p><p>In the heart of <strong>Place du Vieux-Marché</strong> in Rouen, where <strong>Joan of Arc</strong> was burned at the stake in 1431, stands a memorial that speaks less of death and more of <strong>enduring presence</strong>.</p><blockquote><em>“Ô Jeanne, sans sépulcre et sans portrait,<br> toi qui savais que le tombeau des héros<br> est le cœur des vivants.”</em></blockquote><blockquote>O Joan, without a tomb and without a portrait,<em><br> </em>you who knew that the tomb of heroes<em><br> </em>is the heart of the living.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KUK0jEkivxvNB90n392drA.jpeg" /></figure><p>Joan has no grave, no authentic portrait. Yet she remains vividly alive in history — not only as a saint and symbol, but as a challenge. Standing in that square today, it’s clear that her story doesn’t end in 1431. It <strong>summons</strong> us.</p><p>In my lifetime, we have seen the tools of war, greed, violence, and injustice indiscriminately applied to the weakest — women, children, and the vulnerable, too often caught in the fire across the globe.</p><p>Perhaps that’s where Joan matters now. Not simply as a martyred teenager, but as a figure who might urge the living to <strong>reclaim the courage of the past</strong>. To animate, not glorify, the memory of those who stood for something. To act — not in her name, but in her spirit.</p><p>The young woman walking across the frame of our photograph may not have noticed the inscription. But her presence mirrors Joan’s youth. It reminds us that the <strong>task of remembering is not passive</strong>, and that the <strong>hearts of the living</strong> are still the only true tombs for the fallen — and perhaps the only hope for what comes next.</p><figure><img alt="Statue of Joan of Arc, Rouen Cathedral" src="https://cdn-images-1.medium.com/max/1024/1*69YzPZemjLkVRC_zOnzR4Q.jpeg" /></figure><p>Written after a visit to Rouen, May 2025.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a953dffe3d43" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Wonder of the Present Moment: Unpacking Thich Nhat Hanh’s Mindfulness Meditation]]></title>
            <link>https://johnunwin.medium.com/the-wonder-of-the-present-moment-unpacking-thich-nhat-hanhs-mindfulness-meditation-26aabe82468a?source=rss-1155c0f0227d------2</link>
            <guid isPermaLink="false">https://medium.com/p/26aabe82468a</guid>
            <category><![CDATA[zen]]></category>
            <category><![CDATA[meditation]]></category>
            <category><![CDATA[present-moment]]></category>
            <category><![CDATA[mindfulness]]></category>
            <category><![CDATA[thich-nhat-hanh]]></category>
            <dc:creator><![CDATA[John Unwin]]></dc:creator>
            <pubDate>Sat, 08 Jul 2023 16:45:39 GMT</pubDate>
            <atom:updated>2023-07-08T16:58:59.019Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*npHkmh_F_BpZy-0K" /></figure><p>Thich Nhat Hanh, a revered Zen Buddhist monk, teaches the practice of mindful breathing, encouraging us to dwell in the present moment and recognize its innate wonder. His meditative phrase “Dwelling in the present moment, I know it is a wonderful moment,” encapsulates the essence of mindfulness and the joy of being present. Let’s explore the depth of this powerful phrase.</p><p><strong>Arriving at the Present</strong></p><p>At the heart of Thich Nhat Hanh’s practice, we follow our breath, letting it guide us into the now. As we release our preoccupations with the past and future, we find ourselves truly arriving in the present. This arrival is not a destination but an ongoing, ever-unfolding journey. The simple act of observing-be it the sunlight streaming through a window, the ambient noise of our surroundings, or the tactile experience of rainfall-immerses us in the richness of the present moment. Here, we find peace, untethered by the need to struggle or chase after anything.</p><p><strong>The Wonder of Interconnection</strong></p><p>The sense of wonder in mindfulness arises when we perceive the interconnectedness of all things. This interconnectedness renders the present moment a culmination of everything that has come before it. An insight that continues to resonate is the realization that every thought, every action of ours or our ancestors, has in some way shaped the reality of our present moment. Similarly, our current thoughts and actions are shaping the future. This intricate web of interconnections makes every moment uniquely wonderful and full of potential.</p><p><strong>The Freedom of Release</strong></p><p>By dwelling fully in the present moment, we release ourselves from the burdens of the past and the demands of the future. Each moment is ever-changing, mirroring the impermanent nature of life. By understanding the non-self components of the present, we realize that everything around us has come together to create this singular moment. This realization brings with it a profound sense of peace and liberation.</p><p><strong>Embracing the Aimless</strong></p><p>In the heart of Thich Nhat Hanh’s teachings, we find a concept that may seem counterintuitive-the idea of aimlessness. We are often conditioned to strive, to chase after goals and accomplishments. However, in this meditation, there is no need for striving. Thich Nhat Hanh encourages us to realize that we already embody enlightenment; mindfulness and meditation are merely tools that help us recognize this. He famously said, “We do not sit in order to struggle to get enlightenment. No. Sitting first of all is for the pleasure of sitting.” If we feel tension or pressure, we are encouraged to gently return to our breath, to find rest and ease in simply being.</p><p><strong>The Present Moment: A Gift of Life</strong></p><p>Thich Nhat Hanh’s teachings invite us to perceive every moment as a gift, a culmination of the past and a seed for the future. Through mindful breathing, we are encouraged to dwell in the present moment and to recognize its innate beauty and wonder. Life unfolds in the here and now, in each breath we take, in each beat of our heart. By embracing the present, we open ourselves to the fullness of life, finding joy, peace, and a deep sense of connection with all of existence.</p><p>To delve deeper into these teachings, Plum Village has an app available at <a href="https://plumvillage.app/">https://plumvillage.app/</a>. Here, you can enjoy guided meditations and learn more about the richness of Thich Nhat Hanh’s teachings.</p><p><em>Originally published at </em><a href="https://johnunwinphotography.blog/2023/07/08/the-wonder-of-the-present-moment-unpacking-thich-nhat-hanhs-mindfulness-meditation/"><em>http://johnunwinphotography.blog</em></a><em> on July 8, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26aabe82468a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing New Capabilities: Function Calling with OpenAI API]]></title>
            <link>https://pub.aimind.so/unleashing-new-capabilities-function-calling-with-openai-api-e6928d101f20?source=rss-1155c0f0227d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6928d101f20</guid>
            <category><![CDATA[ai-applications]]></category>
            <category><![CDATA[calling-function]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[John Unwin]]></dc:creator>
            <pubDate>Wed, 28 Jun 2023 17:09:40 GMT</pubDate>
            <atom:updated>2023-07-02T12:46:30.785Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Wp__85u1vKTl8PE0.png" /></figure><p>OpenAI has recently introduced an exciting addition to the OpenAI Completions API — Function Calling. This feature allows developers to define functions in JSON, which the model can call upon when additional external operations are necessary to fulfill a request.</p><p>This capability unlocks a plethora of functionalities, including:</p><ul><li>Accessing real-time information such as weather forecasts, financial data, and news</li><li>Storing and executing code</li><li>Accessing data through SQL queries or REST services</li><li>Managing IoT devices</li></ul><h3>High-level workflow of the function calling feature in the Completions API is as follows:</h3><ol><li>A user makes a request.</li><li>The message processor (application code) converts this request into a message prompt. It also appends a list of supportable functions (such as ‘web search’ or ‘execute os command’) to the prompt.</li><li>This message prompt is then sent to the Completions API. If the AI model determines that it needs additional information to fulfill the request, it checks the list of supportable functions provided. If it finds a relevant function, it returns a request to execute that function along with the necessary parameters.</li><li>Upon receiving this function request, the message processor uses appropriate handlers to execute the function.</li><li>The results of the function execution and the original request are then sent back to the Completions API.</li><li>The Completions API then uses this information to formulate a response to the original user’s request.</li><li>Finally, this response is sent back to the user.”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nIhjBY-jHdql-kF-.png" /></figure><p>While some of these functions are available through ChatGPT and plugins, the real game-changer is the potential to create standalone apps that harness these powerful capabilities.</p><h3>Defining Functions</h3><pre><br>funcDef = {<br>    &quot;name&quot;: &quot;file_save&quot;,<br>    &quot;description&quot;: &quot;save code or text into a file&quot;,<br>    &quot;parameters&quot;: {<br>        &quot;type&quot;: &quot;object&quot;,<br>        &quot;properties&quot;: {<br>            &quot;directory_path&quot;: {<br>                &quot;type&quot;: &quot;string&quot;,<br>                &quot;description&quot;: &quot;the location of the file to be saved&quot;,<br>            },<br>            &quot;file_name&quot;: {<br>                &quot;type&quot;: &quot;string&quot;,<br>                &quot;description&quot;: &quot;the name of the file to be saved&quot;,<br>            },<br>            &quot;file_content&quot;: {<br>                &quot;type&quot;: &quot;string&quot;,<br>                &quot;description&quot;: &quot;the content of the file to be saved&quot;,<br>            },<br>        },<br>        &quot;required&quot;: [&quot;directory_path&quot;, &quot;file_name&quot;, &quot;file_content&quot;],<br>    },<br>}</pre><p>Let’s look at an example of function definition for saving text to a file:</p><p>The definition describes the function, the model uses this when matching functions with some need for information it has.</p><p>The definition lists and describes the parameters needed to execute the function.</p><p>A set of function definitions can then be passed to the API when making a request, enabling the model to store text and code to the local file system.</p><h3>Calling the Completions API</h3><p>Besides selecting model versions that support function calling, the main difference is that the set of function definitions is sent to the API via the functions parameter, as shown below:</p><pre><br>def get_completionWithFunctions(messages ,functions:str, temperature:int=0, model:str=&quot;gpt-3.5-turbo-0613&quot;, max_retries:int=3, retry_wait:int=1):<br>    logging.info(f&#39;get_completionWithFunctions start: model {model} functions {functions} messages {messages}&#39;)<br><br>    retries = 0<br>    while retries &lt;= max_retries:<br>        try:<br>            response = openai.ChatCompletion.create(<br>                model=model,<br>                messages=messages,<br>                functions=functions,<br>                function_call = &quot;auto&quot;, <br>                temperature=temperature, <br>            )<br>            logging.info(f&#39;get_completion end: {model}&#39;)<br>            response_message = response[&quot;choices&quot;][0][&quot;message&quot;]<br>            return response_message<br>            <br>        except RateLimitError as e:<br>            if retries == max_retries:<br>                raise e<br>            retries += 1<br>            print(f&quot;RateLimitError encountered, retrying... (attempt {retries})&quot;)<br>            time.sleep(retry_wait)</pre><h3>Processing a user request</h3><p>When the model processes a user request requiring additional information, it uses the provided list of functions.</p><p>If the user request is ‘please write python code to compute the first N primes and save the code in primes.py,’ the model can generate the code and, being aware of the ‘file_save’ function, respond with a request to save the file.</p><p>The code that calls the get_completionWithFunctions() method then checks the response for a function call request:</p><pre>function_calling_definition = self.handler.get_function_calling_definition()<br><br>        max_iterations = 5<br>        itr = 0<br>        for i in range(max_iterations):<br><br>            #completion_messages = [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: message}]<br>            #default is gpt-3.5-turbo-0613  you can alos use gpt-4-0613<br>            response_message = get_completionWithFunctions(completion_messages, function_calling_definition, 0, model)<br><br>            #check if a function call is requested<br>            if response_message.get(&quot;function_call&quot;):<br>                action = []<br>                function_name = response_message[&quot;function_call&quot;][&quot;name&quot;]<br>                function_args_text = response_message[&quot;function_call&quot;][&quot;arguments&quot;]<br>                function_args = json.loads(function_args_text)<br><br>                #extract the paramters and nane of the function reqested<br>                action_dict = dict()<br>                action_dict[&quot;action_name&quot;] = function_name<br>                for key, value in function_args.items():<br>                    action_dict[key] = value<br><br>                #execute the function if available<br>                response = self.handler.process_action_dict(action_dict, account_name)<br>                response_message_text = QuokkaLoki.handler_repsonse_formated_text(response)<br><br>                completion_messages.append(response_message)<br>                completion_messages.append(<br>                    {<br>                        &quot;role&quot;: &quot;function&quot;,<br>                        &quot;name&quot;: function_name,<br>                        &quot;content&quot;: response_message_text,<br>                    }<br>                )<br>            else:<br>                break<br><br></pre><p>In the above example, the whimsically named QuokkaLoki() has different handlers to support various requests such as file load, file save, execute command, web scraping, and web search. Each handler self-describes the function it provides, thus extending the flexibility and utility of your AI-powered applications.</p><p>In the project I am working on we use function calling in a loop because a single user request can result in multiple calls. Consider the example “please code review HelloWorld.vue in src/sandbox/ off the home directory, and then save the code review in review.txt” in this case the single request results in two function requests.</p><h3>Example</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L1yQ4muVCvHVz90K.png" /></figure><p>In the above example, the user initially asks the assistant for the top five ETFs for retirement. The assistant responds with a list of ETFs, providing brief descriptions for each. This interaction demonstrates the assistant’s ability to generate information from its pre-existing knowledge base.</p><p>The conversation evolves as the user asks for more information on a specific ETF, the Vanguard Dividend Appreciation ETF (VIG). The assistant responds by fetching additional information about VIG and also provides the user with a list of web sources for further exploration. This represents the “web search” functionality of the assistant, showing its ability to find and present useful, relevant online resources.</p><p>Lastly, the user requests the assistant to fetch text from one of the provided links. The assistant retrieves and presents a text excerpt from the specified MarketWatch link about the VIG ETF. This action demonstrates the “web scraping” capability of the assistant, showcasing its ability to extract information directly from webpages.</p><p>Overall, this example highlights two key capabilities made possible by function calling: real-time web search and web text scraping. These functions enable the AI to not only generate responses based on its training data but also fetch and present real-time, up-to-date information from the web, making it a highly dynamic and powerful tool for users.</p><p>Remember, function calling allows you to expand the capabilities of your AI-powered applications beyond the model’s training data. With function calling, your assistant can interact with a variety of external systems and services, providing users with real-time, dynamic responses.</p><p>To demonstrate these possibilities and provide a practical reference for developers eager to leverage this powerful feature, let’s take a look at an innovative project called “Lucy.”</p><h3>Lucy</h3><p>“Lucy” is an innovative project designed to experiment and leverage the capabilities of OpenAI’s completion API. The project aims to manage conversational behavior and automate processes using this technology.</p><h3>Features</h3><ol><li><strong>Agents</strong>: These manage the behavior of the project, allowing for simple chats, guided conversations, automation, and function calling.</li><li><strong>Prompt Builder</strong>: This feature enriches the prompts based on user requests. It factors in long-term relevance, recent trends, or a blend of both to construct a set of messages that can be utilized with the completion API.</li><li><strong>Completions</strong>: This component stores and retrieves completions and messages from chats based on agent and user accounts. It also stores system roles for an agent based on the agent name.</li><li><strong>Message Processors</strong>: They handle incoming messages and support prompt building, presets, guided conversations, function calling, and automation.</li><li><strong>Handlers</strong>: These are used by automation and function calling to support requests made by the model or agents. They handle file loading, file saving, web search, and web page loading.</li><li><strong>Chunkers</strong>: These are tools to chunk text when loading a large text file from a webpage, it processes the file in chunks.</li><li><strong>Context</strong>: This is an information storage that can be shared with different agents. It is used where multiple agents help process a user request, for example, in a guided conversation or automation.</li></ol><h3>Workflow</h3><p>In “Lucy”, the above-mentioned features collaborate effectively to manage and automate conversational behavior. The prompt builder enriches the user request, which the completion stores and recalls as needed. Message processors handle incoming messages, and handlers enhance these capabilities further. The chunkers handle large data, and context serves as shared storage for information.</p><h3>Project Link</h3><p>The code examples shared in this blog post are based on the “Lucy” project, and you can explore the full codebase in the provided GitHub link. This will give you a hands-on understanding of how to implement and use the function calling feature in OpenAI’s completion API to build powerful, interactive, and dynamic AI applications.</p><p>More about the project can be found at: <a href="https://github.com/junwin/lucy">https://github.com/junwin/lucy</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6928d101f20" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/unleashing-new-capabilities-function-calling-with-openai-api-e6928d101f20">Unleashing New Capabilities: Function Calling with OpenAI API</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breathing in, my breath grows deep — breathing out, my breath goes slow]]></title>
            <link>https://johnunwin.medium.com/breathing-in-my-breath-grows-deep-breathing-out-my-breath-goes-slow-efad819b1686?source=rss-1155c0f0227d------2</link>
            <guid isPermaLink="false">https://medium.com/p/efad819b1686</guid>
            <category><![CDATA[meditation]]></category>
            <category><![CDATA[thich-nhat-hanh]]></category>
            <category><![CDATA[mindfulness]]></category>
            <category><![CDATA[presence]]></category>
            <category><![CDATA[zen]]></category>
            <dc:creator><![CDATA[John Unwin]]></dc:creator>
            <pubDate>Fri, 23 Jun 2023 18:58:11 GMT</pubDate>
            <atom:updated>2023-06-23T19:15:09.534Z</atom:updated>
            <content:encoded><![CDATA[<h3>Breathing in, my breath grows deep — breathing out, my breath goes slow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EtrqKPZONLUXyZ1w" /></figure><p>The mindfulness exercise, “Breathing in, my breath grows deep; breathing out, my breath goes slow,” is a simple yet profound practice inspired by the teachings of Zen master Thich Nhat Hanh and the Plum Village tradition. It taps into the natural rhythm of our bodies and minds, serving as a gateway to deeper understanding and presence.</p><p>As you breathe in, you consciously invite your breath to become deeper, filling not just your lungs but your whole body with life-sustaining oxygen. As you exhale, focus on the sensation of the breath leaving your body, flowing out slowly and completely. This practice is a direct and tactile exploration of the present moment.</p><p>This practice, shared with us by Thich Nhat Hanh and his community in Plum Village, emphasizes gentle observation and attunement. It’s about being present with your breath as it is, without judgement. If you find yourself trying to control or lead your breath, gently shift your focus back to simply watching and experiencing the act of breathing.</p><p>Thich Nhat Hanh’s teachings encourage us to acknowledge wandering thoughts, smile to them, and gently guide our focus back to the breath. It’s not about suppressing thoughts, but simply seeing, observing, and releasing them, returning our focus to the breath.</p><p>Observing the constant change in our breath underscores the Buddhist concept of impermanence. No two breaths are exactly the same. Like watching the waves on a lake or sea, observing the breath can provide a peaceful and restful space in our minds.</p><p>Moreover, our breath serves as a poignant reminder of our interconnection with all things. As we breathe in the oxygen provided by plants and trees, and breathe out the carbon dioxide they require, we directly experience our symbiotic relationship with the Earth.</p><p>This practice has the power to influence our mental state. By shifting our focus to the breath, we can soothe mental stress and turmoil, allowing our breath to naturally become deeper and slower. This creates a feedback loop, where a calm mind promotes a calm body and vice versa.</p><p>“Breathing in, my breath grows deep; breathing out, my breath goes slow” is more than a relaxation technique-it’s a pathway to experiencing impermanence, interconnectedness, and the richness of the present moment. It’s a reminder that our breath, an act so natural and automatic, can become a powerful tool for insight and peace.</p><p>To delve deeper into these teachings, Plum Village has an app available at <a href="https://plumvillage.app/">https://plumvillage.app/</a>. Here, you can enjoy guided meditations and learn more about the richness of Thich Nhat Hanh’s teachings.</p><p><em>Originally published at </em><a href="https://johnunwinphotography.blog/2023/06/23/breathing-in-my-breath-grows-deep-breathing-out-my-breath-goes-slow/"><em>http://johnunwinphotography.blog</em></a><em> on June 23, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efad819b1686" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breathing in, I know I am breathing in; breathing out, I know I am breathing out]]></title>
            <link>https://johnunwin.medium.com/breathing-in-i-know-i-am-breathing-in-breathing-out-i-know-i-am-breathing-out-d141e651b0b8?source=rss-1155c0f0227d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d141e651b0b8</guid>
            <category><![CDATA[zen]]></category>
            <category><![CDATA[meditation]]></category>
            <category><![CDATA[presence]]></category>
            <category><![CDATA[thich-nhat-hanh]]></category>
            <category><![CDATA[mindfulness]]></category>
            <dc:creator><![CDATA[John Unwin]]></dc:creator>
            <pubDate>Tue, 13 Jun 2023 03:00:27 GMT</pubDate>
            <atom:updated>2023-06-13T03:08:29.445Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q9zKh9rlnekl64BiH7Y3YA.png" /></figure><p>This mindful breathing practice, “Breathing in, I know I am breathing in; breathing out, I know I am breathing out,” holds a profound depth. It occupies a liminal space between the conscious and unconscious, where one can explore the dynamic balance between the autonomous functioning of the body and the influence of the mind.</p><p>When you breathe in, you may notice the cool air entering your body, filling your lungs. This active awareness underscores the physical aspect of the practice. On the exhale, you might perceive a sense of relaxation as you let go of the breath. Your breathing becomes an exploration of the present moment, a tangible connection to the here and now.</p><p>Bringing attention to this simple yet essential act fosters a unity between the body and mind, nourishing both. Conveniently, it’s a practice that doesn’t require a particular setting or time; it can be performed anytime, anywhere.</p><p>In moments of stress, shifting the focus to the belly can help calm the turbulent mind. Placing a hand on your stomach to feel the rise and fall of your breath anchors your awareness in the physical world. Thich Nhat Hanh uses the analogy of a tree: while the wind may buffet its crown, causing the branches to sway to and fro, the trunk remains steady and calm. Similarly, even amidst the turmoil of life, this practice can serve as your steady trunk, grounding you in the midst of chaos.</p><p>Finally, mindful breathing can deepen our understanding of our interconnectedness with the Earth. As we breathe in oxygen produced by plants and trees, and exhale the carbon dioxide they take in, we become more attuned to the cyclical nature of life and our place within these cycles. The ever-changing rhythm of our breath serves as a gentle reminder of the impermanence inherent in our existence.</p><p>This mindful breathing exercise is not just a technique for relaxation or stress reduction, but a pathway to experiencing interconnectedness, impermanence, and the richness of the present moment.</p><p><em>Originally published at </em><a href="https://johnunwinphotography.blog/2023/06/13/breathing-in-i-know-i-am-breathing-in-breathing-out-i-know-i-am-breathing-out/"><em>http://johnunwinphotography.blog</em></a><em> on June 13, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d141e651b0b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Smile and Release]]></title>
            <link>https://johnunwin.medium.com/smile-and-release-c162b4576bd9?source=rss-1155c0f0227d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c162b4576bd9</guid>
            <category><![CDATA[self-care]]></category>
            <category><![CDATA[meditation]]></category>
            <category><![CDATA[thich-nhat-hanh]]></category>
            <category><![CDATA[presence]]></category>
            <category><![CDATA[mindfulness]]></category>
            <dc:creator><![CDATA[John Unwin]]></dc:creator>
            <pubDate>Sun, 23 Apr 2023 22:13:58 GMT</pubDate>
            <atom:updated>2023-04-23T22:31:40.802Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ETHfNQWK0GuURMam" /></figure><p>In Thich Nhat Hanh’s mindful breathing exercise “Breathing in, I smile; breathing out, I release,” the concepts of smiling and releasing are combined to create a powerful tool for cultivating emotional balance, inner peace, and well-being.</p><p>The act of smiling is not necessarily directed at a specific object or person. Instead, it serves as a gentle reminder to cultivate feelings of joy, happiness, and gratitude within oneself. Smiling has been scientifically shown to release endorphins, which are natural chemicals in the brain that can help improve mood and reduce stress. By consciously choosing to smile as you breathe in, you are fostering a sense of inner happiness and contentment that is not reliant on external circumstances. The smile in this context is an expression of self-compassion, loving-kindness, and gratitude for the present moment.</p><p>On the other hand, the concept of “release” refers to the act of consciously letting go of any negative emotions, tensions, or stress that may have built up in your mind and body. When practicing this breathing exercise, the focus is on using the exhale as a means to release and let go of any feelings of anxiety, stress, anger, or emotional pain that you may be experiencing. This can help create space for positive emotions and thoughts to arise, fostering a sense of mental and emotional well-being.</p><p>By combining the act of smiling during the inhale with the release during the exhale, Thich Nhat Hanh aims to teach individuals how to cultivate emotional balance and inner peace. This practice encourages individuals to be aware of their emotions, acknowledge them without judgment, and then consciously release them, promoting a greater sense of mental clarity and emotional stability. In this way, the mindful breathing exercise of “smile and release” can have a profound impact on your mental and emotional well-being, as well as on your interactions with others.</p><p><em>Originally published at </em><a href="http://johnunwinphotography.blog/2023/04/23/smile-and-release/"><em>http://johnunwinphotography.blog</em></a><em> on April 23, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c162b4576bd9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Round Trip Journey: From Image to Keywords and Back with AI]]></title>
            <link>https://johnunwin.medium.com/a-round-trip-journey-from-image-to-keywords-and-back-with-ai-6d39a0e1f0c9?source=rss-1155c0f0227d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d39a0e1f0c9</guid>
            <dc:creator><![CDATA[John Unwin]]></dc:creator>
            <pubDate>Wed, 22 Mar 2023 19:26:05 GMT</pubDate>
            <atom:updated>2023-03-22T19:26:05.762Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FFxv5fW1JBZyejMGdZ7s3Q.png" /></figure><h3>Introduction:</h3><p>In this post, we’ll explore an exciting round trip journey using advanced AI technologies. We’ll start with an original picture, extract keywords using Google Vision, then re-imagine the image with DALL-E, and finally generate a visual description using GPT-4.0.</p><p>The Original Picture:</p><ul><li>The initial picture is chosen randomly.</li><li>Most of my black-and-white photography focuses on light, shadow, and chiaroscuro.</li><li>This specific image was captured in Aberystwyth in early 2023.</li><li>It’s an excellent image to use due to its many recognizable elements, such as the sea and sky.</li></ul><h3>Extracting Keywords with Google Vision:</h3><ul><li>One time-consuming activity in the photographic process is extracting keywords that describe the image in terms of content and the impulse that led me to capture it.</li><li>I was familiar with using ML for object recognition in images, but I wanted a cost-effective cloud-based solution.</li><li>I knew that the Google Vision API could annotate objects in an image, providing different types of information like text, objects, known people, and annotations.</li><li>Having used GPT-3.5 for development, I realized I could set up a solution quickly and easily, bypassing the learning process of working with a new API.</li></ul><p>Here’s a glance at the code produced by GPT-3.5:</p><pre><br>os.environ[&#39;GOOGLE_APPLICATION_CREDENTIALS&#39;] = &#39;G:\..\your_credentials.json&#39;<br>work_dir = &#39;C:/temp/2023Mar/Output/web&#39;<br><br>from google.cloud import vision<br><br>def anotate_image(file_name):<br>    client = vision.ImageAnnotatorClient()<br>    with io.open(file_name, &#39;rb&#39;) as image_file:<br>        content = image_file.read() <br>        image = vision.Image(content=content)<br><br>        # Perform label detection on the image file<br>        response = client.label_detection(image=image)<br>        labels = response.label_annotations<br>        return labels<br><br><br><br>def anotate_folder(work_dir):<br>    # Set the minimum topicality score<br>    min_topicality = 0.55<br>    # outputDelimiter = &#39;#&#39;<br>    outputDelimiter = &#39;&#39;<br><br>    # Iterate over each file in the directory<br>    for file_name in os.listdir(work_dir):<br>        # Check if the file is an image file<br>        if file_name.endswith(&#39;.jpg&#39;) or file_name.endswith(&#39;.jpeg&#39;) or file_name.endswith(&#39;.png&#39;):<br>            full_path_name = os.path.join(work_dir, file_name)<br>            labels = anotate_image(full_path_name)<br>            # Format the labels as a comma-separated list with hash tags, remove hyphens and spaces, and filter based on topicality score<br>            label_list = [label.description.replace(&#39;-&#39;, &#39;&#39;).replace(&#39; &#39;, &#39;&#39;).lower() for label in labels if label.topicality &gt;= min_topicality]<br>            label_string = &#39;,&#39;.join([outputDelimiter + label for label in label_list])<br><br>            # Print the formatted labels for each image file<br>            print(file_name, label_string)</pre><p>Running the code on the image gave me the following keywords: cloud, sky, water, atmosphere, black and white, flash photography, sunlight, style, rectangle, fence.</p><p>The results can be adjusted based on topicality, but in this case, I accepted all the labels with a topicality threshold of 0.55. This led to accepting “flash photography,” which is clearly incorrect.</p><p>In general, I would add location and film type attributes to the image, such as photography, bnw, black and white, monochrome, places, Wales, Aberystwyth, and Cymru, resulting in a combined list of keywords.</p><h3>Using DALL-E to Reimagine the Pictures</h3><p>To test the effectiveness of the chosen keywords, I used DALL-E to generate images based on these keywords. DALL-E suggested four images that bore a striking resemblance in content and style to the original.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8eodN6IEQHH-87PK6xQvbA.png" /></figure><h3>Using GPT Chat 4.0 to Describe the Image Based on the Keywords</h3><p>When I asked GPT-4.0 to produce a description based on the keywords, it returned:</p><p><strong><em>“The photo is a black and white image of a scenic spot in Aberystwyth, Wales. It captures the calm water, a cloudy sky, and a road with a fence alongside it. The monochrome tones create a peaceful atmosphere, and sunlight subtly illuminates the scene.”</em></strong></p><p>The AI-generated description is reasonable and could be used to provide a visual description for visually challenged individuals.</p><h3>Summary:</h3><p>In this post, we explored a fascinating journey of using advanced AI technologies to extract and re-imagine an original image. The process started with a black-and-white picture taken in Aberystwyth, Wales. Keywords were extracted using Google Vision, which provided annotations for objects in the image. DALL-E was then used to generate new images based on the keywords, demonstrating the effectiveness of the chosen keywords. Lastly, GPT-4.0 was utilized to create a visual description of the original image based on the keywords. This exploration showcases the power and potential of AI technologies in the field of image processing and analysis.</p><h3>References and Links:</h3><ol><li>Google Vision API: <a href="https://cloud.google.com/vision">https://cloud.google.com/vision</a></li><li>OpenAI GPT-3.5: <a href="https://beta.openai.com/docs/models/gpt-3.5-turbo">https://beta.openai.com/docs/models/gpt-3.5-turbo</a></li><li>DALL-E: <a href="https://openai.com/research/dall-e/">https://openai.com/research/dall-e/</a></li><li>OpenAI GPT-4.0: <a href="https://openai.com/research">https://openai.com/research</a></li></ol><p>Feel free to explore these resources to learn more about the AI technologies used in this post and experiment with your own image processing and analysis projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d39a0e1f0c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Power of AI in Code Development]]></title>
            <link>https://johnunwin.medium.com/the-power-of-ai-in-code-development-1f3b54e272cc?source=rss-1155c0f0227d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f3b54e272cc</guid>
            <dc:creator><![CDATA[John Unwin]]></dc:creator>
            <pubDate>Tue, 27 Dec 2022 16:56:47 GMT</pubDate>
            <atom:updated>2022-12-27T16:59:27.070Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zOsgz_Gv9_Wt7uPBs0ghRQ.png" /></figure><p>In recent years, the ability to develop code with the support of artificial intelligence (AI) has greatly improved.</p><p>Over the holiday season The Guardian newspaper has come up with a new word puzzle called Wordiply — (<a href="https://www.wordiply.com/">https://www.wordiply.com/</a>)</p><p>This provides a fun way to show how we can use AI to write a helper program to solve this puzzle.</p><p>One useful resource for this task is Mieliestronk’s list of more than English words (<a href="http://www.mieliestronk.com/wordlist.html">http://www.mieliestronk.com/wordlist.html</a>). With this list, we can easily program a helper to solve the Wordiply puzzle.</p><p>To do this, we can use some simple Python code to pick out the longest words containing a given string. But how can we write this code efficiently?</p><p>Given a rough specification of what is needed:</p><p><em>“can you write python code to read a list of words from </em><a href="http://www.mieliestronk.com/corncob_lowercase.txt"><em>http://www.mieliestronk.com/corncob_lowercase.txt</em></a><em> into a list of words and then search the list of words to extract those containing a given string then order the resulting list of words by size starting with the longest word, then write the top 10 most significant as the word, a comma and the length in the console?”</em></p><p>One solution is to use a natural language processing model like ChatGPT (Wen et al., 2020) to generate code from a plain English definition. For example, we can use ChatGPT to produce the following code:</p><pre>import requests<br><br># Read the list of words from the URL<br>url = &quot;http://www.mieliestronk.com/corncob_lowercase.txt&quot;<br>response = requests.get(url)<br>text = response.text<br>words = text.split()<br><br># Extract the words containing the given string<br>search_string = &quot;cat&quot;<br>search_results = [word for word in words if search_string in word]<br><br># Order the resulting list of words by size<br>search_results.sort(key=len, reverse=True)<br><br># Write the top 10 most significant words to the console<br>print(&quot;Top 10 words containing &#39;{}&#39;:&quot;.format(search_string))<br>for i, word in enumerate(search_results[:10]):<br>    print(&quot;{}, {}&quot;.format(word, len(word)))</pre><p>This code reads a list of words from a provided URL, searches for words containing a given string, and then orders the resulting list by size (with the longest words first). Finally, it prints the top 10 most significant words (along with their length) to the console.</p><p>You can run the code here:</p><p><a href="https://colab.research.google.com/drive/1xgEX2U_SUfrsZH57jgXDoLZ247bicIay?usp=sharing">https://colab.research.google.com/drive/1xgEX2U_SUfrsZH57jgXDoLZ247bicIay?usp=sharing</a></p><p>Overall, the ability to use AI models like ChatGPT to generate code from plain English definitions can greatly improve our efficiency as developers.</p><h3>References</h3><p>Wen, T., Dai, A. M., &amp; Le, Q. V. (2020). ChatGPT: Generative Pre-training for Conversational Response Generation. arXiv preprint arXiv:2005.00606.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f3b54e272cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using TensorFlow and Keras to predict house prices]]></title>
            <link>https://johnunwin.medium.com/using-tensorflow-and-keras-to-predict-house-prices-696bc7902ef0?source=rss-1155c0f0227d------2</link>
            <guid isPermaLink="false">https://medium.com/p/696bc7902ef0</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[keras]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[John Unwin]]></dc:creator>
            <pubDate>Fri, 29 Jan 2021 20:36:17 GMT</pubDate>
            <atom:updated>2021-01-29T20:36:17.771Z</atom:updated>
            <content:encoded><![CDATA[<figure><a href="https://colab.research.google.com/github/junwin/colab/blob/main/housepPricePrediction2.ipynb"><img alt="" src="https://cdn-images-1.medium.com/max/225/0*-tSBeDITRomZPWxZ.png" /></a></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*gSWgxxWtzDod0whF.jpeg" /></figure><p>This walk through shows the process of using deep learning to predict house prices using TensorFlow, Keras and a .csv file of sales data.</p><p>The topics covered are:</p><ul><li>Loading data from a .csv</li><li>splitting data into training, validation and test sets</li><li>Handling mixed types of data</li><li>Normalizing data</li><li>Handling categorical features</li><li>Creating a deep learning model</li><li>Analyzing the results</li><li>Storing and reloading models</li></ul><p>You can view the full article <a href="https://junwin.github.io/posts/2021-01-28-housepPricePrediction2.html">here</a></p><p>You can use Google’s Colaboratory to run and play with the code <a href="https://colab.research.google.com/github/junwin/colab/blob/main/housepPricePrediction2.ipynb">here</a> it is free and allows you to write and execute Python in your browser, with</p><ul><li>Zero configuration required</li><li>Free access to GPUs</li><li>Easy sharing</li></ul><h3>Acknowledgement</h3><p>This short walk through borrows from the excellent tutorial on loading .csv files using Keras.<br> <a href="https://www.tensorflow.org/tutorials/load_data/csv">https://www.tensorflow.org/tutorials/load_data/csv</a></p><h3>Setup</h3><p>The size of the sales data is relatively small, so we can process it in memory. We will use a Pandas dataframe to do any manipulation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mlruQUBYOCC9BIPtV1eh7g.png" /></figure><p>A benefit of using Pandas is that it is easy to experiment with the data, for example, to select some subset while to help understand what affects the accuracy of the model.</p><p>In our processing, we will treat strings as categories. Although Zip code is numeric, we cannot treat it as a number in the model, so let’s convert it to a string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*dMakD586KmizSmyMrKhN9g.png" /></figure><p>We now split the data loaded from the .csv into three sets ( training data, validation data and test data).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*m7JzGfp74rzgU3xjb0B36A.png" /></figure><p>Next, we will separate the training and validation dataframes into features and targets and do a rough normalization of price.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*d_Zb5bmeT9ZZ3vWxqC29lw.png" /></figure><p>It is difficult to use the data we have to train a model “as is” because the feature data contains different types and numeric ranges. It is possible to write code to transform the original dataset; however, we would need to consider deploying the extra code. Second, when using the model to predict a price, we will need to use the same transformations on the data input.</p><p>A reasonable solution is to embed any transformations into the model, so it is simple to deploy and use.Here we will build a model using the Keras functional API the functional API uses symbolic tensors so we will first create a set of these tensors matching the names and types of the feature data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*iIZcGj4cggIlqo5lpxupbA.png" /></figure><p>We will use Tensorflow’s normalization preprocessing for each numeric field. Notice that we call the adapt method with the training data to set up the normalizer before use and collect all the symbolic preprocessing results, to concatenate them later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*xa5rRDI7dbv4ggpcNM6FsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*JgFPl1x8aNmXmrIxM4ZO4g.png" /></figure><p>String fields will first use a StringLookup function to map the strings to their corresponding index in a vocabulary based on the different data strings. Second, using the index and default settings, the TensorFlow’s preprocessing category encoding will generate a one-hot vector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*IdCL91ojlkgPsL_8TjmnWg.png" /></figure><p>Together with the numeric field handling, we then transform the input data. Given the preprocessed inputs (for normalization and categorization) and the corresponding input fields we can build a model the preprocesses the input data. We can visualize the model, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*KzFscrACxOIwDt3cZse5Rw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p-ap1Ji5o0-D2PTJ.png" /></figure><p>This model just contains the input preprocessing. You can run it to see what it does to your data. Keras models don&#39;t automatically convert Pandas DataFrames because it&#39;s not clear if it should be converted to one tensor or to a dictionary of tensors. So convert it to a dictionary of tensors:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*KpOjMffirrYAbp9SpNNZtg.png" /></figure><p>We can run some sample data through the preprocessing, to validate we are getting the expected results — you should be able to see the normalized data and one-hot vectors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*2ZKtvSjb1M6mR0GGnmKBEA.png" /></figure><p>Now build the model based on the Keras functional API on top of this. We will typically make changes to the layers defined in the housePrices_model function. In this case, a pipeline is built that takes the inputs, preprocesses them and then uses the main model to make predictions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*ZxGfCQ8JAQubmzimtVHXIg.png" /></figure><p>When you train the model, pass the dictionary of features as x, and the label as y.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*yzRxyPU8iwOcZrlkOCP9hQ.png" /></figure><p>It is crucial to visualize the metrics produced during training; this will quickly indicate how quickly the model converges, potential issues of under and over-fitting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*ybHj1ckRNa19O2ZM5tCVtQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/0*JpuMfAwgaSpXO95_.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/0*IvH4ANAxrh2LSWCv.png" /></figure><p>By implementing preprocessing as part of the model, we can now save the model and deploy it elsewhere as a simple package.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*i0Ah6Oy_N4DHslkhs2KmPA.png" /></figure><p>Finally, we can run predictions on our own data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*P0ieoXws4Uqhna4cXO-4PA.png" /></figure><pre>Here are the results.<br>[[16.131]<br> [ 3.849]<br> [ 3.732]<br> [ 1.724]<br> [ 3.364]]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=696bc7902ef0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pets, Cattle and the Chaos Monkey — why your pets need to stay away from the datacenter]]></title>
            <link>https://johnunwin.medium.com/pets-cattle-and-the-chaos-monkey-why-your-pets-need-to-stay-away-from-the-datacenter-40fb255aa339?source=rss-1155c0f0227d------2</link>
            <guid isPermaLink="false">https://medium.com/p/40fb255aa339</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[scaling]]></category>
            <category><![CDATA[data-center]]></category>
            <dc:creator><![CDATA[John Unwin]]></dc:creator>
            <pubDate>Fri, 22 Feb 2019 02:12:37 GMT</pubDate>
            <atom:updated>2019-02-22T02:12:37.608Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pets, Cattle and the Chaos Monkey — why your pets need to stay away from the datacenter</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dieVwNM6F6y6d49swMt87g.png" /></figure><p>Take any of your useful software and systems and think about the hardware and IT infrastructure used to run them. First, ask yourself if you know any servers by name, if there are special groups that have specific software components (database servers, middle tier servers/app servers, message brokers etc.) or other special hardware needs.</p><p>Second, ask yourself if any one of these has some issue; do you need it repaired?</p><p>If you answer yes to either, then you have found your pets, you know them by name, look after their needs and if they are sick you take them to the vet.</p><p>On the other hand, some of the hardware has no name, it is generic — if it fails or dies, you just replace it with more generic boxes; these are the cattle. You really don’t care if they go wrong, and if you have demand, you simply increase the herd with more nameless members.</p><p>Modern architecture (public or private clouds) demands cattle; it does not want to care about an individual server’s reliability. If a machine fails or becomes overloaded, another generic server can be added to the farm. It is thanks to the cattle machines that you get resilience and the ability to scale on demand.</p><p>That said, you need to work with your system and software so they work well with cattle, with no hidden pets that demand special attention, this can be a tough challenge, and that’s where the Chaos Monkey comes in.</p><p>Despite its name, the Chaos Monkey is your friend. You turn him loose in your test environments and he constantly jumps around randomly switching machines off in a most ungraceful — but necessary — way.</p><p>If you only have cattle in the data centre, then all is well. Other boxes simply come on stream to replace the ones that the monkey has stopped. But, he is also designed to sniff out any hidden pets. If the Chaos Monkey switches off a pet, the system goes down until the pet can get its special attention. This way you know you have problems — give that monkey a banana, for he has done his job well.</p><p>So the moral of our story, if you want to scale and have high resilience find your pets and take them home, love your cattle and get the Chaos Monkey to make sure all is well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40fb255aa339" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>