
ChatGPT has generated an application per prompt, the prompt is part of the previous post. ChatGPT has instructed me to run a batch file.

ChatGPT has generated an application per prompt, the prompt is part of the previous post. ChatGPT has instructed me to run a batch file.

I think, today, it was the time, to stop making small prompts to edit images and it was the time, to generate a full blow tool, using a prompt. I use ChatGPT. So, I wrote up a complete prompt to generate an application for Windows, to publish WordPress posts. The prompt covers UI, authentication, publishing. It needs to be seen whether ChatGPT will generate a functioning application.
Prompt
Design an application for Windows. It is to be used for publishing posts to WordPress blog. The application must have a UI and a window. The application will have a toolbar with buttons for selecting a blog, which would be one of the following: amol9.blog, code9.blog, game9.blog and amol9.io. The buttons should be on top, in the toolbar, the buttons should be on left. On right hand side of the toolbar, there must be a button for publishing the post, the button should change color upon publishing successfully.
The necessary permissions, or login, or tokens should be obtained by the application to post on the WordPress blog. If it is WordPress password, then it should be stored in a file in “user\documents\wpapp” folder. If it is a token, it should be stored in the same location. The application should obtain the necessary permissions when it runs. If permissions have been already obtained, it should not ask again.
The application UI must have two text boxes, one, on the top, for post title, which would be one line and, second, below it, for editing the post text. Inside the post edit section, facility to add code should be there. To the left of the publish button, there must be an image button, to add an image to the post, this image must come before the post text. The width of the image should be minimum of 1000 px in width, if the image has less width than that, then, it should be padded on both sides. The image should be center aligned in the post.
The categories and tags should be fetched from the WordPress blog site. Two buttons, below the image and publish buttons, should provide a facility to select/add new categories and tags. These should be 2 different pop up windows.
All the content created should be stored locally, and upon successful publishing, it should be deleted. A button to the left of image button, named view blog should open a default browser window with the current blog url, to view the post.

It is needed to pad images for the blog, so installed it via the ‘choco’ package manager for Windows.

Virtual machines are an interesting area to investigate in the field of computer technology. It is a pursuit worthy of doing, to understand how VM’s work and how they are built.
I have started with this particular YouTube video: https://youtu.be/BNXP0w4Ppto?si=imnVqQVmkuttVmhj
A lot of ideas have come to my mind as I watch this video. First, the answer to a basic question, how does one make an OS virtual? I think, that, we can load the devices, like, CD drive, HDD, etc., as a file and execute their content as instructions for the CPU. There may be some processing required here, that would form a lesson in VM making. Next, the question of a display comes in, how does one show the OS in a window? The answer, I think, might be to somehow trap an interrupt or more than one of them to grab the screen data, then, render it in a buffer and then resize it before showing it in a window. The video gave a start to an idea of how one manages the RAM for a VM, it may be a vector of 32 bit data items.

I had a chance to use the ‘imagemagick’ utility today, it has been some time. I downloaded an image and wanted to pad it on both the.sides in order to use it on my blog.
First, I needed to check its width in order to see if it has been changed, after the padding operation.
magick identify gravity-force-experiment-example_1308-105498.jpg.png
Then, I issued the command to pad the image on both the sides.
magick gravity-force-experiment-example_1308-105498.jpg.png -gravity center -background white -extent 1000 out.png
Finally, I checked the image width again.
magick identify out.png

It is part of my ‘storage/view design’, to have multiple ‘copies’ and multiple views of my blog data. Blog data includes post text, title and media in the post. OneDrive provides a storage backup facility as well as a public view, so it fits the purpose of this design. I have put the blog post data on OneDrive at a path, it can be viewed In the public view provided by OneDrive.

In my last operation of cleaning up my system, I must have removed Microsoft OneDrive. So, it was time today, to reinstall it. It is actually a part of the ‘storage/view design’ that I am working on, in order to have a good backup of my blog data, as well as, a publicly available multiple views for it.

In continuation from the last post, the backup download was taking some time, so, I checked the home directory. And, it has some old unneeded data. I tried deleting it, in order to make the backup process fast. But, there is an error in deleting the directories. There is an access related problem.

I ran into some troubles with my hosting of amol9.com, it is a shared hosting space. I wanted a wiki there, so I installed one using a software installer available via the hosting control panel. The software got installed. But, it did not work. I examined the error logs and I think that the wiki software has installed an entry in the Apache configuration. It might be redirecting all the requests to the wiki start page script, this is the page that errors refer to.
One solution that came to my mind was to examine the Apache configuration file(s) and edit the entry there, if it is there. Then, I would remove the files related to the software installed and then I would install some working software, likely in a subdirectory, installing the software on the main directory of the site must have caused this problem, making other software unavailable. But, the Apache configuration file(s) are not directly available, what is available is access to some entries via browser interface, entries which are not useful for the purpose of solution of this issue.
The only way forward seems to be to remove all the installed software and reinstall a working software. This may not be straight forward. I might have to contact the technical support for the hosting and they might even move the hosting space. Considering this, I am moving a copy of the site to my laptop, I am downloading an archive of the home directory.

I am going through some old code that I have written. This particular package, published on PyPI uses the ‘scrapy’ Python package to scrape a website for images.
The setup configuration can be viewed inside the ‘setup.py’ file. This file is generally added to a Python project to make it a package easily available for installation via some tool like, ‘pip’ and via some website like, ‘pipy.org’. The ‘setup.py’ file makes it.easy to mention the dependencies, which can be automatically installed by the package installer. This ‘imagebot’ package depends on a few external Python packages, like, ‘scrapy’, a Python scraping package, ‘PIL/Pillow’, a Python image processing library and ‘mutils’, a Python library written by me to include commonly used Python code. I think, that, this ‘setup.py’ is the file executed first by a package installer. One can mentioned metadata, like, author, version, categories, email, description, etc. in this file. One can also include additional code execution in this file, the code necessary to be executed at the installation time fits this kind of inclusion.
import ez_setupez_setup.use_setuptools()from setuptools import setup, find_packagesimport platformimport impfrom imagebot.version import versionwith open('imagebot/env.py', 'w') as f: f.write('env = \'release\'\n')install_requires = ['scrapy>=1.0.1', 'mutils>=1.0.4']try: imp.find_module('PIL')except ImportError: install_requires.append('Pillow')entry_points = {}entry_points['console_scripts'] = ['imagebot=imagebot.main:main']setup( name = 'imagebot', description = 'A web bot to crawl websites and scrape images.', version = version, author = 'Amol Umrale', author_email = 'babaiscool@gmail.com', url = 'http://pypi.python.org/pypi/imagebot/', packages = find_packages(), package_data = {'imagebot': ['tables.sql']}, scripts = ['ez_setup.py'], entry_points = entry_points, install_requires = install_requires, classifiers = [ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Framework :: Scrapy', 'Framework :: Twisted', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: POSIX :: Linux', 'Operating System :: Microsoft :: Windows', 'Programming Language :: Python :: 2.7', 'Topic :: Internet :: WWW/HTTP :: Indexing/Search' ] )with open('imagebot/env.py', 'w') as f: f.write('env = \'dev\'\n')