Setting:
The sea levels rose significantly (30-50m'), so the HCMC authority built a wall enclosing urban districts. However, the water levels kept rising, so the construction continued indefinitely, requiring an enormous volume of materials. Due to logistical challenges, the city was running low on construction materials, so they decided to use rocks and other underground materials right below the enclosed city. The AI-automated system was designed to control mining and construction procedures. Different robots controlled by the SYSTEM perform various tasks: study and evaluate mining sites, mining and extract materials, logistics robots, builder robots, and guard robots. The guard robots will eliminate anyone who poses threat to other robots, building processes, or crucial structures managed by the SYSTEM.
The city's citizens lived peacefully and were protected from rising sea levels by constantly rising walls. The Department of Climate Change had total control over the SYSTEM when needed, but it had been years since they had to perform any manual control. However, a tremendous solar storm struck Earth and disturbed most automated systems on the day-side of the planet, which included HCMC. The Department of Climate Change managed to take control of the SYSTEM and reboot it, but they failed to realize that many geological study data was corrupted.
When the SYSTEM returned to normal, the mining robots used corrupted data to find new mining sites, and they mined into Hydrogen Sulfide and Carbon Monoxides wells at many locations that should have been avoided. The gas was leaked all over the mines on the 7th level, killing any supervising humans there and slowly rising to the surface. It would naturally take a long time for gases to rise up to the city at dangerous concentrations, but the gases were partially sucked up through ventilation systems (the protocol was corrupted or due to human incompetence) and began infecting, killing humans at various locations (factories, infrastructure facilities). To stop the gas spread, the city activated valve closure that hadn't been used a single time since the SYSTEM was automated. One valve was jammed and sparked, burning the flammable gas. This entirely burned the 7th floor and sped up gas leakage. The city lost control over valves on that floor, and gases began rising to the city level through ventilation wells that cannot be closed. Normal citizens began getting sick, many elderly passed away, and fires were sparked in communities that were slightly lower than the others.
The city released an evacuation order and citizens were directed to leave the city within the walls to the floating city outside. The department of Climate Change was struck by fire, killing most of the leadership during their management meeting. Since the SYSTEM was controlled by biometric markers and digital keys that only the mayor and leadership of the SYSTEM had, their death meant no one could access the control room of the system anymore. The SYSTEM kept on mining, exposing more toxic wells, and building the wall.
The city was now covered in toxic air, burning and exploding at various locations. However, the SYSTEM maintained and rebuilt infrastructure that was under its control. The Federal Crisis Management arrived to analyze the issue, but only automated expeditions were executed without any prevention measures. The Federals concluded that the cost to stop the SYSTEM and make the city habitable again significantly outweighs any benefits the city would ever bring back to the state. However, they also noted that the city became a great quarry to mine rare minerals that were present in gas wells, so a conglomerate - VinCorp - obtained a license to mine those minerals in the city.
Most of the evacuated citizens settled down in the Outer City and built slums on the wall. They were soon employed by VinCorp, establishing the new main industry in the city: mining.
For the next decades, the SYSTEM continued mining and expanding the wall while the VinCorp profited from exposed mineral mines. Besides VinCorp, small illegal mining groups were trying to profit as well. Soon both VinCorp and mining groups were armed and had occasional clashes.
But soon things became complicated. The SYSTEM was approaching a magma body underground. It was unclear what the consequence would be if the magma body gets exposed, but the most possible scenario was an explosion or melting of the main pillars that keep the wall against water pressure. Either way, it would collapse the city wall and destroy the floating city. What would citizens of the floating city do to save their city?
from sdtk import com_sdtk_api_GitAPI def printer(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_GitAPI.reposAPI().retrieveData({"owner": "Vis-LLC"}, printer)To retrieve all branches a repo has using Simple Data Toolkit, we can do the following:
from sdtk import com_sdtk_api_GitAPI def printer(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_GitAPI.branchesAPI().retrieveData({"owner": "Vis-LLC", "repo": "Simple-Data-Toolkit"}, printer)To retrieve all the files in a branch using Simple Data Toolkit, we can do the following:
from sdtk import com_sdtk_api_GitAPI def printer(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_GitAPI.filesAPI().retrieveData({"owner": "Vis-LLC", "repo": "Simple-Data-Toolkit", "branch": "main"}, printer)To retrieve the data in a file using Simple Data Toolkit, we can do the following:
from sdtk import com_sdtk_api_GitAPI def printerData(data, reader): print(data) com_sdtk_api_GitAPI.retrieveAPI().retrieveData({"owner": "Vis-LLC", "repo": "Simple-Data-Toolkit-UI", "branch": "main", "path": "index.html"}, printerData)We can also login using a personal access token (https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
from sdtk import com_sdtk_api_GitAPI def printerData(data, reader): print(data) com_sdtk_api_GitAPI.instance().setKey("Personal Access Token Here").retrieveAPI().retrieveData({"owner": "Vis-LLC", "repo": "Simple-Data-Toolkit-UI", "branch": "main", "path": "index.html"}, printerData)Simple Data Toolkit - Tutorial - Windows - Scheduled TaskLet's suppose you want to create a task that loads a Pipe Delimited File into a database on a daily basis. The task is to run on Windows and you are using Snowflake for the database. You can do it with SDTK as follows: 1) Download SDTK. For this tutorial, we're going to use the latest version of the Windows Shell Script version as of this writing (0.1.2) which is here: https://sourceforge.net/projects/simple-data-toolkit/files/0.1.3/stc-wsh.js/download 2) Create a new text file called ConvertPSV.cmd 3) Open the file with a text editor (like Notepad or Visual Studio Code) Enter the following text: cscript stc-wsh.js clients.psv clients.sql createorreplace clients (For more info on STC and SDTK see the following URL: https://www.vis-software.com/#sdtk) (For more info on cscript see the following URL: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cscript) SET SNOWSQL_PWD=password snowsql -a myorganization-myaccount -u jsmith -f clients.sql -d database -s public -o quiet=true -o friendly=false (For more info on snowsql see the following URL: https://docs.snowflake.com/en/user-guide/snowsql-use.html) 4) Go to the Start Menu. 5) Search for Task Scheduler. (For more info on Task Scheduler see the following URL: https://docs.microsoft.com/en-us/windows/win32/taskschd/about-the-task-scheduler) 6) Open Task Scheduler. 7) Click Create Task. 8) For name enter: Convert PSV to SQL 9) Click Triggers Tab 10) Click New button 11) Select Daily 12) Start start time to 8:00 AM. 13) Click the OK button. 14) Click Actions tab. 15) Click New button 16) For Program/script click Browse. 17) Find the ConvertPSV.cmd script. 18) Click Open. 19) Set Start in to the directory that the ConvertPSV.cmd script is in. 20) Click the OK button. 21) Click the OK button. 22) To test, right click Convert PSV to SQL. 23) Select Run.Simple Data Toolkit - Python - Loading Data and Text Through ChatGPTSimple Data Toolkit provides an API for passing data and text to ChatGPT and extracting related data or text. (At the time of this writing, the release of this is pending for complete support, but it is coming soon) Below is an example which uses an embedded data of users and orders, plus text loaded in from a file.
from sdtk import com_sdtk_api_ChatGPTAPI, com_sdtk_table_ArrayOfMapsReader #Set def callbackData(reader): print(reader.toArrayOfNativeMaps(None)) def callbackText(data): print(data) users = [ {"user_id": 1, "first_name": "Sally", "last_name": "Franklin"}, {"user_id": 2, "first_name": "Lucas", "last_name": "Franklin"}, {"user_id": 3, "first_name": "Joe", "last_name": "Romeo"}, {"user_id": 4, "first_name": "Julie", "last_name": "Romeo"}, {"user_id": 5, "first_name": "Lucia", "last_name": "Templeton"}, ] orders = [ {"order_id": 1, "user_id": 3, "item_desc": "Book 1", "item_quantity": 2, "date": "2024-01-01"}, {"order_id": 2, "user_id": 3, "item_desc": "Book 2", "item_quantity": 1, "date": "2024-02-01"}, {"order_id": 3, "user_id": 3, "item_desc": "Book 3", "item_quantity": 3, "date": "2024-03-01"}, {"order_id": 4, "user_id": 3, "item_desc": "Book 4", "item_quantity": 0, "date": "2024-04-01"}, {"order_id": 5, "user_id": 3, "item_desc": "Book 5", "item_quantity": 4, "date": "2024-05-01"} ] com_sdtk_api_ChatGPTAPI.queryAsReaderWithDataAPI().execute("What can we determine about the buying habits of all of our users?", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackData) com_sdtk_api_ChatGPTAPI.queryWithDataAPI().execute("What can we determine about the buying habits of all of our users? As a narrative.", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackText) content = "" with open('sample.html', 'r') as content_file: content = content_file.read() com_sdtk_api_ChatGPTAPI.queryWithDataAPI().execute("We also have this document in HTML format on recent trends.\n" + content + "\n\nWhat can we determine about the buying habits of all of our users? As a narrative.", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackText)Below is an example which queries data from ChatGPT in a table format using a DataTableReader from SDTK.
from sdtk import com_sdtk_api_ChatGPTAPI def callback(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_ChatGPTAPI.queryAsReaderAPI().retrieveData({ "query": "List all cities in the USA with known population." }, callback)Simple Data Toolkit - Python - Loading Data and Text Through ChatGPTSimple Data Toolkit provides an API for passing data and text to ChatGPT and extracting related data or text. (At the time of this writing, the release of this is pending for complete support, but it is coming soon) Below is an example which uses an embedded data of users and orders, plus text loaded in from a file.
from sdtk import com_sdtk_api_ChatGPTAPI, com_sdtk_table_ArrayOfMapsReader #Set def callbackData(reader): print(reader.toArrayOfNativeMaps(None)) def callbackText(data): print(data) users = [ {"user_id": 1, "first_name": "Sally", "last_name": "Franklin"}, {"user_id": 2, "first_name": "Lucas", "last_name": "Franklin"}, {"user_id": 3, "first_name": "Joe", "last_name": "Romeo"}, {"user_id": 4, "first_name": "Julie", "last_name": "Romeo"}, {"user_id": 5, "first_name": "Lucia", "last_name": "Templeton"}, ] orders = [ {"order_id": 1, "user_id": 3, "item_desc": "Book 1", "item_quantity": 2, "date": "2024-01-01"}, {"order_id": 2, "user_id": 3, "item_desc": "Book 2", "item_quantity": 1, "date": "2024-02-01"}, {"order_id": 3, "user_id": 3, "item_desc": "Book 3", "item_quantity": 3, "date": "2024-03-01"}, {"order_id": 4, "user_id": 3, "item_desc": "Book 4", "item_quantity": 0, "date": "2024-04-01"}, {"order_id": 5, "user_id": 3, "item_desc": "Book 5", "item_quantity": 4, "date": "2024-05-01"} ] com_sdtk_api_ChatGPTAPI.queryAsReaderWithDataAPI().execute("What can we determine about the buying habits of all of our users?", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackData) com_sdtk_api_ChatGPTAPI.queryWithDataAPI().execute("What can we determine about the buying habits of all of our users? As a narrative.", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackText) content = "" with open('sample.html', 'r') as content_file: content = content_file.read() com_sdtk_api_ChatGPTAPI.queryWithDataAPI().execute("We also have this document in HTML format on recent trends.\n" + content + "\n\nWhat can we determine about the buying habits of all of our users? As a narrative.", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackText)Below is an example which queries data from ChatGPT in a table format using a DataTableReader from SDTK.
from sdtk import com_sdtk_api_ChatGPTAPI def callback(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_ChatGPTAPI.queryAsReaderAPI().retrieveData({ "query": "List all cities in the USA with known population." }, callback)Simple Data Toolkit - Python - Loading Data and Text Through ChatGPTSimple Data Toolkit provides an API for passing data and text to ChatGPT and extracting related data or text. (At the time of this writing, the release of this is pending for complete support, but it is coming soon) Below is an example which uses an embedded data of users and orders, plus text loaded in from a file.
from sdtk import com_sdtk_api_ChatGPTAPI, com_sdtk_table_ArrayOfMapsReader #Set def callbackData(reader): print(reader.toArrayOfNativeMaps(None)) def callbackText(data): print(data) users = [ {"user_id": 1, "first_name": "Sally", "last_name": "Franklin"}, {"user_id": 2, "first_name": "Lucas", "last_name": "Franklin"}, {"user_id": 3, "first_name": "Joe", "last_name": "Romeo"}, {"user_id": 4, "first_name": "Julie", "last_name": "Romeo"}, {"user_id": 5, "first_name": "Lucia", "last_name": "Templeton"}, ] orders = [ {"order_id": 1, "user_id": 3, "item_desc": "Book 1", "item_quantity": 2, "date": "2024-01-01"}, {"order_id": 2, "user_id": 3, "item_desc": "Book 2", "item_quantity": 1, "date": "2024-02-01"}, {"order_id": 3, "user_id": 3, "item_desc": "Book 3", "item_quantity": 3, "date": "2024-03-01"}, {"order_id": 4, "user_id": 3, "item_desc": "Book 4", "item_quantity": 0, "date": "2024-04-01"}, {"order_id": 5, "user_id": 3, "item_desc": "Book 5", "item_quantity": 4, "date": "2024-05-01"} ] com_sdtk_api_ChatGPTAPI.queryAsReaderWithDataAPI().execute("What can we determine about the buying habits of all of our users?", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackData) com_sdtk_api_ChatGPTAPI.queryWithDataAPI().execute("What can we determine about the buying habits of all of our users? As a narrative.", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackText) content = "" with open('sample.html', 'r') as content_file: content = content_file.read() com_sdtk_api_ChatGPTAPI.queryWithDataAPI().execute("We also have this document in HTML format on recent trends.\n" + content + "\n\nWhat can we determine about the buying habits of all of our users? As a narrative.", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackText)Below is an example which queries data from ChatGPT in a table format using a DataTableReader from SDTK.
from sdtk import com_sdtk_api_ChatGPTAPI def callback(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_ChatGPTAPI.queryAsReaderAPI().retrieveData({ "query": "List all cities in the USA with known population." }, callback)Simple Data Toolkit - Python - Loading Data and Text Through ChatGPTSimple Data Toolkit provides an API for passing data and text to ChatGPT and extracting related data or text. (At the time of this writing, the release of this is pending for complete support, but it is coming soon) Below is an example which uses an embedded data of users and orders, plus text loaded in from a file.
from sdtk import com_sdtk_api_ChatGPTAPI, com_sdtk_table_ArrayOfMapsReader #Set def callbackData(reader): print(reader.toArrayOfNativeMaps(None)) def callbackText(data): print(data) users = [ {"user_id": 1, "first_name": "Sally", "last_name": "Franklin"}, {"user_id": 2, "first_name": "Lucas", "last_name": "Franklin"}, {"user_id": 3, "first_name": "Joe", "last_name": "Romeo"}, {"user_id": 4, "first_name": "Julie", "last_name": "Romeo"}, {"user_id": 5, "first_name": "Lucia", "last_name": "Templeton"}, ] orders = [ {"order_id": 1, "user_id": 3, "item_desc": "Book 1", "item_quantity": 2, "date": "2024-01-01"}, {"order_id": 2, "user_id": 3, "item_desc": "Book 2", "item_quantity": 1, "date": "2024-02-01"}, {"order_id": 3, "user_id": 3, "item_desc": "Book 3", "item_quantity": 3, "date": "2024-03-01"}, {"order_id": 4, "user_id": 3, "item_desc": "Book 4", "item_quantity": 0, "date": "2024-04-01"}, {"order_id": 5, "user_id": 3, "item_desc": "Book 5", "item_quantity": 4, "date": "2024-05-01"} ] com_sdtk_api_ChatGPTAPI.queryAsReaderWithDataAPI().execute("What can we determine about the buying habits of all of our users?", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackData) com_sdtk_api_ChatGPTAPI.queryWithDataAPI().execute("What can we determine about the buying habits of all of our users? As a narrative.", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackText) content = "" with open('sample.html', 'r') as content_file: content = content_file.read() com_sdtk_api_ChatGPTAPI.queryWithDataAPI().execute("We also have this document in HTML format on recent trends.\n" + content + "\n\nWhat can we determine about the buying habits of all of our users? As a narrative.", None, {"Users": com_sdtk_table_ArrayOfMapsReader.readWholeArray(users), "Orders": com_sdtk_table_ArrayOfMapsReader.readWholeArray(orders)}, callbackText)Below is an example which queries data from ChatGPT in a table format using a DataTableReader from SDTK.
from sdtk import com_sdtk_api_ChatGPTAPI def callback(data, reader): print(reader.toArrayOfNativeMaps(None)) com_sdtk_api_ChatGPTAPI.queryAsReaderAPI().retrieveData({ "query": "List all cities in the USA with known population." }, callback)Simple Data Toolkit - Tutorial - Mac OS - Scheduled TaskLet's suppose you want to create a task that loads a Pipe Delimited File into a database on a daily basis. The task is to run on Mac OS and you are using Snowflake for the database. You can do it with SDTK as follows: 1) Download SDTK. For this tutorial, we're going to use the latest version of the Python version as of this writing (0.1.2) which is here: https://sourceforge.net/projects/simple-data-toolkit/files/0.1.3/stc.py/download 2) Create a new text file called ConvertPSV.sh 3) Open the file with a text editor (like Text Edit) Enter the following text: #!/bin/sh python stc.py clients.psv clients.sql createorreplace clients (For more info on STC and SDTK see the following URL: https://www.vis-software.com/#sdtk) export SNOWSQL_PWD=password snowsql -a myorganization-myaccount -u jsmith -f clients.sql -d database -s public -o quiet=true -o friendly=false (For more info on snowsql see the following URL: https://docs.snowflake.com/en/user-guide/snowsql-use.html) 4) Go to the Terminal. 5) Edit the list of cron jobs with the following command: nano crontab -e 6) Add the following to a new line: 0 8 * * * cd ~ && ConvertPSV.sh 7) Press CTRL+O and CTRL+X to save and exit nano.Simple Data Toolkit - Tutorial - Linux - Scheduled TaskLet's suppose you want to create a task that loads a Pipe Delimited File into a database on a daily basis. The task is to run on Linux and you are using Snowflake for the database. You can do it with SDTK as follows: 1) Download SDTK. For this tutorial, we're going to use the latest version of the Python version as of this writing (0.1.2) which is here: https://sourceforge.net/projects/simple-data-toolkit/files/0.1.3/stc.py/download 2) Create a new text file called ConvertPSV.sh 3) Open the file with a text editor (like Text Edit) Enter the following text: #!/bin/sh python stc.py clients.psv clients.sql createorreplace clients (For more info on STC and SDTK see the following URL: https://www.vis-software.com/#sdtk) export SNOWSQL_PWD=password snowsql -a myorganization-myaccount -u jsmith -f clients.sql -d database -s public -o quiet=true -o friendly=false (For more info on snowsql see the following URL: https://docs.snowflake.com/en/user-guide/snowsql-use.html) 4) Go to the Terminal. 5) Edit the list of cron jobs with the following command: nano crontab -e 6) Add the following to a new line: 0 8 * * * cd ~ && ConvertPSV.sh 7) Press CTRL+O and CTRL+X to save and exit nano.Simple Data Toolkit - Tutorial - PHP - Convert FileLet's suppose you want to create a task that loads a CSV file into an HTML file on a daily basis. This task is meant to be part of a PHP script, but you are unfamiliar with PHP and are unsure of how to write the code. Good news, you can use the Sample Data Toolkit UI to figure out this code for you as follows: 1) Go to the app page for the Simple Data Toolkit UI, at the time of this writing it is here: https://www.vis-software.com/#sdtk 2) Click Choose Files. 3) Find the file you want to convert. 4) Click Open. 5) Select the output type you want, for this tutorial we will select HTMLTable. 6) Then for script, select PHP. 7) Then click Download Script. You will now have a PHP script that uses SDTK to convert the file you selected to an HTML. You can now either run this script or integrate it with another one. If you need to install SDTK for PHP, you can do it by downloading the latest version from SourceForge, unzipping it, and placing it in your include path. At the time of this writing, this can be found here: https://sourceforge.net/projects/simple-data-toolkit/files/0.1.3/sdtk-php.zip/download The script will look something like this: readFile("ga_sample.csv")->csv()->textOnly()->output()->writeFile("ga_sample.htmltable")->htmlTable()->execute(); readfile("ga_sample.htmltable"); ?>
Connect differently.
Ortingo is a platform that makes journalism easier and information more accessible. Publish from a wide spectrum of various topics and connect with your audience with new ways of writing articles. Be part of a wealth of new information, through Ortingo.
Ready to connect differently?
Learn more about Ortingo
Any thoughts on Long's post?
To comment or reply, you need an Ortingo account.
Sign in or sign upHere's what Ortingoers think of Long's post.
1 comment
January 16, 2021 at 4:09 AM UTC
Hey guys, leave a comment