<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AI &#8211; WLGfx</title>
	<atom:link href="https://csnorwood.com/category/ai/feed/" rel="self" type="application/rss+xml" />
	<link>https://csnorwood.com</link>
	<description>Programmers Website and Blog</description>
	<lastBuildDate>Mon, 27 May 2024 08:22:58 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://csnorwood.com/wp-content/uploads/2024/01/cropped-wlgfx-favicon-white-32x32.png</url>
	<title>AI &#8211; WLGfx</title>
	<link>https://csnorwood.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>2024 Updates</title>
		<link>https://csnorwood.com/2024/01/04/2024-updates/</link>
					<comments>https://csnorwood.com/2024/01/04/2024-updates/#respond</comments>
		
		<dc:creator><![CDATA[csnorwood]]></dc:creator>
		<pubDate>Thu, 04 Jan 2024 23:13:27 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[web]]></category>
		<guid isPermaLink="false">https://csnorwood.com/?p=694</guid>

					<description><![CDATA[So it is time for me to setup a new development folder. This time around, unlike the many years in the past, all the test projects will be dumped into a testing folder before they are allowed to join any main stream projects that I am working on. Now with a PC upgrade I am [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>So it is time for me to setup a new development folder. This time around, unlike the many years in the past, all the test projects will be dumped into a testing folder before they are allowed to join any main stream projects that I am working on.</p>



<p>Now with a PC upgrade I am capable of working a lot faster (8 cores/16 threads helps here), especially with running local AI&#8217;s and also working in Linux and MacOS. Most of this will be all on the same machine.</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="940" height="269" src="https://csnorwood.com/wp-content/uploads/2024/01/cropped-cropped-cropped-wlgfx-high-resolution-logo-transparent.png" alt="" class="wp-image-716" srcset="https://csnorwood.com/wp-content/uploads/2024/01/cropped-cropped-cropped-wlgfx-high-resolution-logo-transparent.png 940w, https://csnorwood.com/wp-content/uploads/2024/01/cropped-cropped-cropped-wlgfx-high-resolution-logo-transparent-300x86.png 300w, https://csnorwood.com/wp-content/uploads/2024/01/cropped-cropped-cropped-wlgfx-high-resolution-logo-transparent-768x220.png 768w" sizes="(max-width: 940px) 100vw, 940px" /></figure>



<p>Current projects:</p>



<ol class="wp-block-list">
<li>Media server and device management software/server.
<ul class="wp-block-list">
<li>Video playback</li>



<li>Image viewer</li>



<li>Devices manual updates by client</li>



<li>plus many other features&#8230;</li>
</ul>
</li>



<li>Godot Game
<ul class="wp-block-list">
<li>Terrain generator and texture painting</li>



<li>Fauna splatting</li>



<li>Various generators to add objects in a scene</li>



<li>Miscellaneous player controls (ie. sliding down slopes and climbing walls)</li>
</ul>
</li>



<li>Home AI chat on the go.
<ul class="wp-block-list">
<li>Home AI that runs on a server that allows me to chat over the internet using my phone</li>



<li>Text or speech input.</li>



<li>Optional text to speech output</li>



<li>Selection of local LLM&#8217;s (ie Llama chat, or Mistral Instruct)</li>
</ul>
</li>
</ol>



<p>With WSL in windows it does make it easier to develop and test Linux software, however it is not that good because it doesn&#8217;t give raw access to hardware. This is not a problem for development and testing.</p>



<p>There will be a lot more to come over the months as things start to get organised and time is given to these projects.</p>



<p>Catch you all soon&#8230;</p>



<p>Carl</p>
]]></content:encoded>
					
					<wfw:commentRss>https://csnorwood.com/2024/01/04/2024-updates/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ChatGPT vs Google Bard: AI programming in C++</title>
		<link>https://csnorwood.com/2023/05/18/chatgpt-vs-google-bard-ai-programming-in-c/</link>
					<comments>https://csnorwood.com/2023/05/18/chatgpt-vs-google-bard-ai-programming-in-c/#respond</comments>
		
		<dc:creator><![CDATA[csnorwood]]></dc:creator>
		<pubDate>Thu, 18 May 2023 10:08:51 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://csnorwood.com/?p=673</guid>

					<description><![CDATA[Bard fails miserably at recursive programming where ChatGPT gave an almost finished result. I asked both to write a C++ program given a folder to monitor its contents and recurs down through all sub folders and monitor those files too. At the moment, Bard hasn&#8217;t got a grip on recursive programming. ChatGPT came out the [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-full"><img decoding="async" width="1000" height="470" src="https://csnorwood.com/wp-content/uploads/2023/05/image.png" alt="" class="wp-image-684" srcset="https://csnorwood.com/wp-content/uploads/2023/05/image.png 1000w, https://csnorwood.com/wp-content/uploads/2023/05/image-300x141.png 300w, https://csnorwood.com/wp-content/uploads/2023/05/image-768x361.png 768w" sizes="(max-width: 1000px) 100vw, 1000px" /></figure>



<p>Bard fails miserably at recursive programming where ChatGPT gave an almost finished result.</p>



<p>I asked both to write a C++ program given a folder to monitor its contents and recurs down through all sub folders and monitor those files too.</p>



<p>At the moment, Bard hasn&#8217;t got a grip on recursive programming. ChatGPT came out the clear winner. Although I did have to coax it to get it to include the right header files.</p>



<p>The final result definitely wouldn&#8217;t be production worthy but a good start to show how to work on this particular task type.</p>



<pre class="wp-block-preformatted has-small-font-size">#include &lt;iostream>
#include &lt;sys/inotify.h>
#include &lt;unistd.h>
#include &lt;cstring>
#include &lt;vector>
#include &lt;dirent.h>

#define EVENT_SIZE (sizeof(struct inotify_event))
#define EVENT_BUF_LEN (1024 * (EVENT_SIZE + 16))

void monitorDirectory(const char* directory, int fd, std::vector&lt;int>&amp; watchDescriptors) {
    // Add a watch for the specified directory
    int wd = inotify_add_watch(fd, directory, IN_MODIFY | IN_CREATE | IN_DELETE | IN_MOVED_FROM | IN_MOVED_TO);
    if (wd &lt; 0) {
        std::cerr &lt;&lt; "Failed to add watch for directory: " &lt;&lt; directory &lt;&lt; std::endl;
        return;
    }

    watchDescriptors.push_back(wd);

    // Scan subdirectories
    DIR* dir = opendir(directory);
    if (!dir) {
        std::cerr &lt;&lt; "Failed to open directory: " &lt;&lt; directory &lt;&lt; std::endl;
        return;
    }

    struct dirent* entry;
    while ((entry = readdir(dir)) != nullptr) {
        if (entry->d_type == DT_DIR) {
            if (std::strcmp(entry->d_name, ".") != 0 &amp;&amp; std::strcmp(entry->d_name, "..") != 0) {
                std::string subdirectory = std::string(directory) + "/" + entry->d_name;
                monitorDirectory(subdirectory.c_str(), fd, watchDescriptors);
            }
        }
    }

    closedir(dir);
}

int main() {
    int fd = inotify_init();
    if (fd &lt; 0) {
        std::cerr &lt;&lt; "Failed to initialize inotify" &lt;&lt; std::endl;
        return 1;
    }

    const char* directory = "/home/wlgfx/Downloads";
    std::vector&lt;int> watchDescriptors;
    monitorDirectory(directory, fd, watchDescriptors);

    std::cout &lt;&lt; "Monitoring changes in directory: " &lt;&lt; directory &lt;&lt; std::endl;

    char buffer[EVENT_BUF_LEN];
    while (true) {
        int length = read(fd, buffer, EVENT_BUF_LEN);
        if (length &lt; 0) {
            std::cerr &lt;&lt; "Failed to read events" &lt;&lt; std::endl;
            break;
        }

        int i = 0;
        while (i &lt; length) {
            struct inotify_event* event = (struct inotify_event*)&amp;buffer[i];
            if (event->len) {
                if (event->mask &amp; IN_CREATE)
                    std::cout &lt;&lt; "File created: " &lt;&lt; event->name &lt;&lt; std::endl;
                else if (event->mask &amp; IN_DELETE)
                    std::cout &lt;&lt; "File deleted: " &lt;&lt; event->name &lt;&lt; std::endl;
                else if (event->mask &amp; IN_MODIFY)
                    std::cout &lt;&lt; "File modified: " &lt;&lt; event->name &lt;&lt; std::endl;
                else if (event->mask &amp; IN_MOVED_FROM)
                    std::cout &lt;&lt; "File/Folder moved from: " &lt;&lt; event->name &lt;&lt; std::endl;
                else if (event->mask &amp; IN_MOVED_TO)
                    std::cout &lt;&lt; "File/Folder moved to: " &lt;&lt; event->name &lt;&lt; std::endl;
            }
            i += EVENT_SIZE + event->len;
        }
    }

    // Cleanup
    for (int wd : watchDescriptors)
        inotify_rm_watch(fd, wd);

    close(fd);

    return 0;
}
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://csnorwood.com/2023/05/18/chatgpt-vs-google-bard-ai-programming-in-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
