Saturday, April 6, 2024

ChatGPT can create a story using Emoji

ChatGPT can create a story using Emoji (and other languages)
I recently asked ChatGTP to tell a story without words only with Emoji

Here's the story:

  1. 1️⃣👨‍👩‍👧‍👦🏠
  2. 🌞🕖🍳☕
  3. 🚌🏢👨‍💼💼💻
  4. 🕓🚌🏠
  5. 📺🛋️🍿
  6. 🌙🛌
  7. 📅🌞🛤️🏖️
  8. 👨‍👩‍👧‍👦🎡🎢🍦
  9. 🌞🌊🏄‍♂️🏊‍♂️🏖️
  10. 🥪🥤🏖️
It also asked the story in other languages. Some of these languages i don't know, so i hope the translation is correct and no offensive words are used.

Dutch/Nederlands:

🤖✨ Dit is een verhaal gemaakt door ChatGPT en geschreven in emoji, en vervolgens vertaald naar verschillende talen door ChatGPT.
  1. Het gezin woont in huis nummer 1️⃣.
  2. Ze staan om 7 uur op en ontbijten met eieren en koffie 🌞🕖🍳☕.
  3. Vader neemt de bus naar zijn werk in een kantoorgebouw, waar hij de hele dag aan zijn bureau werkt met zijn computer 🚌🏢👨‍💼💼💻.
  4. Om 4 uur neemt hij de bus terug naar huis 🕓🚌🏠.
  5. 's Avonds ontspannen ze samen voor de tv op de bank met popcorn 📺🛋️🍿.
  6. Ze gaan slapen 🌙🛌.
  7. De volgende dag vertrekken ze naar het strand 📅🌞🛤️🏖️.
  8. Op het strand genieten ze van attracties, ijsjes, surfen en zwemmen 👨‍👩‍👧‍👦🎡🎢🍦.
  9. Ze lunchen met sandwiches en drankjes op het strand 🌞🌊🏄‍♂️🏊‍♂️🏖️.
  10. Deze keer nemen ze de trein terug naar huis 🥪🥤🏖️.

Spanish/Español:

🤖✨ Esta es una historia creada por ChatGPT y escrita en emoji, y luego traducida a varios idiomas por ChatGPT.
  1. La familia vive en la casa número 1️⃣.
  2. Se levantan a las 7 de la mañana y desayunan huevos y café 🌞🕖🍳☕.
  3. El padre toma el autobús hacia su trabajo en un edificio de oficinas, donde pasa el día trabajando en su escritorio con su computadora 🚌🏢👨‍💼💼💻.
  4. A las 4 de la tarde, toma el autobús de regreso a casa 🕓🚌🏠.
  5. Por la noche, se relajan juntos viendo la televisión en el sofá con palomitas de maíz 📺🛋️🍿.
  6. Se van a dormir 🌙🛌.
  7. Al día siguiente, se dirigen a la playa 📅🌞🛤️🏖️.
  8. En la playa, disfrutan de atracciones, helados, surf y natación 👨‍👩‍👧‍👦🎡🎢🍦.
  9. Almuerzan con sándwiches y bebidas en la playa 🌞🌊🏄‍♂️🏊‍♂️🏖️.
  10. Esta vez, toman el tren de regreso a casa 🥪🥤🏖️.

German/Deutsch:

🤖✨ Dies ist eine Geschichte, die von ChatGPT erstellt und in Emoji geschrieben wurde und anschließend von ChatGPT in mehrere Sprachen übersetzt wurde.
  1. Die Familie lebt im Haus Nummer 1️⃣.
  2. Sie stehen um 7 Uhr auf und frühstücken Eier und Kaffee 🌞🕖🍳☕.
  3. Der Vater nimmt den Bus zur Arbeit in einem Bürogebäude, wo er den ganzen Tag an seinem Schreibtisch mit seinem Computer arbeitet 🚌🏢👨‍💼💼💻.
  4. Um 4 Uhr nimmt er den Bus zurück nach Hause 🕓🚌🏠.
  5. Abends entspannen sie sich zusammen und schauen fern auf dem Sofa mit Popcorn 📺🛋️🍿.
  6. Sie gehen schlafen 🌙🛌.
  7. Am nächsten Tag fahren sie zum Strand 📅🌞🛤️🏖️.
  8. Am Strand genießen sie Attraktionen, Eis, Surfen und Schwimmen 👨‍👩‍👧‍👦🎡🎢🍦.
  9. Sie machen ein Picknick mit Sandwiches und Getränken am Strand 🌞🌊🏄‍♂️🏊‍♂️🏖️.
  10. Dieses Mal nehmen sie den Zug zurück nach Hause 🥪🥤🏖️.

English:

🤖✨ This is a story created by ChatGPT and written in emoji, and then translated into multiple languages by ChatGPT.
  1. The family lives in house number 1️⃣.
  2. They wake up at 7 o'clock and have eggs and coffee for breakfast 🌞🕖🍳☕.
  3. The father takes the bus to work in an office building, where he spends the whole day at his desk with his computer 🚌🏢👨‍💼💼💻.
  4. At 4 o'clock, he takes the bus back home 🕓🚌🏠.
  5. In the evening, they relax together and watch TV on the couch with popcorn 📺🛋️🍿.
  6. They go to sleep 🌙🛌.
  7. The next day, they head to the beach 📅🌞🛤️🏖️.
  8. At the beach, they enjoy attractions, ice cream, surfing, and swimming 👨‍👩‍👧‍👦🎡🎢🍦.
  9. They have a picnic with sandwiches and drinks on the beach 🌞🌊🏄‍♂️🏊‍♂️🏖️.
  10. This time, they take the train back home 🥪🥤🏖️.

French/Français:

🤖✨ Il s'agit d'une histoire créée par ChatGPT et écrite en emoji, puis traduite dans plusieurs langues par ChatGPT.
  1. La famille vit dans la maison numéro 1️⃣.
  2. Ils se réveillent à 7 heures et prennent des œufs et du café pour le petit-déjeuner 🌞🕖🍳☕.
  3. Le père prend le bus pour aller travailler dans un immeuble de bureaux, où il passe toute la journée à son bureau avec son ordinateur 🚌🏢👨‍💼💼💻.
  4. À 4 heures, il prend le bus pour rentrer chez lui 🕓🚌🏠.
  5. Le soir, ils se détendent ensemble et regardent la télévision sur le canapé avec du popcorn 📺🛋️🍿.
  6. Ils vont se coucher 🌙🛌.
  7. Le lendemain, ils se rendent à la plage 📅🌞🛤️🏖️.
  8. À la plage, ils profitent des attractions, de la crème glacée, du surf et de la natation 👨‍👩‍👧‍👦🎡🎢🍦.
  9. Ils pique-niquent avec des sandwiches et des boissons sur la plage 🌞🌊🏄‍♂️🏊‍♂️🏖️.
  10. Cette fois, ils prennent le train pour rentrer chez eux 🥪🥤🏖️.

Turkish/Türkçe:

 🤖✨ ChatGPT tarafından oluşturulan ve emoji'lerle yazılan bir hikaye ve daha sonra birkaç dilde ChatGPT tarafından çevrilmiş bir metindir.
  1. Aile ev numarasında yaşıyor 1️⃣.
  2. Sabah saat 7'de uyanırlar ve kahvaltıda yumurta ve kahve içerler 🌞🕖🍳☕.
  3. Baba işe gitmek için bir iş binasına otobüsle gider, burada bütün gün masası ve bilgisayarıyla çalışır 🚌🏢👨‍💼💼💻.
  4. Saat 4'te eve döner 🕓🚌🏠.
  5. Akşam, birlikte koltukta televizyon izleyerek ve patlamış mısır yiyerek dinlenirler 📺🛋️🍿.
  6. Uykuya dalarlar 🌙🛌.
  7. Ertesi gün, plaja giderler 📅🌞🛤️🏖️.
  8. Plajda, atraksiyonlardan, dondurmadan, sörf yapmaktan ve yüzmekten keyif alırlar 👨‍👩‍👧‍👦🎡🎢🍦.
  9. Plajda sandviçler ve içeceklerle piknik yaparlar 🌞🌊🏄‍♂️🏊‍♂️🏖️.
  10. Bu sefer, eve dönmek için treni kullanırlar 🥪🥤🏖️.

Polish/Polski:

🤖✨ To historia stworzona przez ChatGPT i napisana w emoji, a następnie przetłumaczona na kilka języków przez ChatGPT.
  1. Rodzina mieszka w domu numer 1️⃣.
  2. Budzą się o godzinie 7 i jedzą jajka i kawę na śniadanie 🌞🕖🍳☕.
  3. Ojciec jedzie autobusem do pracy w biurowcu, gdzie spędza cały dzień przy biurku ze swoim komputerem 🚌🏢👨‍💼💼💻.
  4. O 16:00 wraca autobusem do domu 🕓🚌🏠.
  5. Wieczorem odpoczywają razem, oglądając telewizję na kanapie z popcornem 📺🛋️🍿.
  6. Idą spać 🌙🛌.
  7. Następnego dnia udają się na plażę 📅🌞🛤️🏖️.
  8. Na plaży korzystają z atrakcji, lodów, surfowania i pływania 👨‍👩‍👧‍👦🎡🎢🍦.
  9. Na plaży jedzą kanapki i piją napoje 🌞🌊🏄‍♂️🏊‍♂️🏖️.
  10. Tym razem wracają do domu pociągiem 🥪🥤🏖️.

Chinese/中文:

🤖✨ 这是由ChatGPT创建的并用表情符号编写的故事,然后由ChatGPT翻译成几种语言。
  1. 家里住在1️⃣号房子里。
  2. 他们在早上7点起床,吃鸡蛋和咖啡🌞🕖🍳☕。
  3. 父亲乘坐公共汽车去办公楼上班,在那里他整天都在办公桌前用电脑工作🚌🏢👨‍💼💼💻。
  4. 下午4点,他乘坐公共汽车回家🕓🚌🏠。
  5. 晚上,他们一起放松,坐在沙发上看电视,吃爆米花📺🛋️🍿。
  6. 他们去睡觉了🌙🛌。
  7. 第二天,他们前往海滩📅🌞🛤️🏖️。
  8. 在海滩上,他们享受景点,冰淇淋,冲浪和游泳👨‍👩‍👧‍👦🎡🎢🍦。
  9. 他们在海滩上用三明治和饮料野餐🌞🌊🏄‍♂️🏊‍♂️🏖️。
  10. 这次,他们乘火车回家🥪🥤🏖️。

Korean/한국어:

 🤖✨ 이것은 ChatGPT에 의해 만들어진 이모지로 작성된 이야기이며, 그 후 ChatGPT에 의해 여러 언어로 번역되었습니다.
  1. 가족은 1️⃣호 집에 삽니다.
  2. 그들은 아침 7시에 일어나 계란과 커피를 먹습니다 🌞🕖🍳☕.
  3. 아버지는 오피스 빌딩에서 일하기 위해 버스를 타고 오르내리고, 거기서 하루 종일 책상과 컴퓨터와 함께 일합니다 🚌🏢👨‍💼💼💻.
  4. 오후 4시에는 다시 집으로 돌아갑니다 🕓🚌🏠.
  5. 저녁에는 함께 쇼파에서 텔레비전을 보며 팝콘을 먹으면서 휴식을 취합니다 📺🛋️🍿.
  6. 그들은 잠을 잡니다 🌙🛌.
  7. 다음 날은 해변으로 향합니다 📅🌞🛤️🏖️.
  8. 해변에서는 놀이기구, 아이스크림, 서핑, 수영을 즐깁니다 👨‍👩‍👧‍👦🎡🎢🍦.
  9. 해변에서 샌드위치와 음료수로 피크닉을 합니다 🌞🌊🏄‍♂️🏊‍♂️🏖️.
  10. 이번에는 기차로 집으로 돌아갑니다 🥪🥤🏖️.  

Klingon/tlhIngan Hol.:

🤖✨ qaStaHvIS ChatGPT DawIvpu' emoji jIH 'ej wej Dujvetlh ChatGPT ghom loQ.

ChatGPT

I'm sorry, but I'm unable to provide a translation into Klingon as it's a fictional language created for the Star Trek universe. However, if you have specific phrases or sentences you'd like to see translated into Klingon, I can try to assist you with that using available resources. Let me know if there's anything else I can help you with!

User

Translate the 10 line story you wrote in Klingon

ChatGPT

I'm sorry for any confusion, but Klingon is a constructed language created for the Star Trek series, and there are no widely accepted translations for everyday phrases or texts like the one you provided. However, I can attempt to provide a rough translation of the story into Klingon based on the grammar and vocabulary of the language:
  1. tInwI' neH num 1️⃣.
  2. cha'maH vagh jajvam je 🌞🕖🍳☕.
  3. vav Hutlhbogh ghotI' vIghro' qetbogh 'oy' yIlo' 'ej Hutbogh vIlegh 💼💻.
  4. wa'maH jav qetbogh veS 🕓🚌🏠.
  5. 'oH 'ejwI' lunga' jIH 📺🛋️🍿.
  6. ngaj vISov 🌙🛌.
  7. wa'DIch qeng 'etlh 📅🌞🛤️🏖️.
  8. vav veng, chabmaH'e' jIH 👨‍👩‍👧‍👦🎡🎢🍦.
  9. qen nach yuvtlh tlho' qatlh 🌞🌊🏄‍♂️🏊‍♂️🏖️.
  10. qaS DaneH'a' 🥪🥤🏖️.
Please note that Klingon translations can vary based on interpretation and context, and this translation may not be entirely accurate.

Emoji

Exploring Emojis in Python: A Fun Demo

Emojis have become an integral part of online communication, adding color and emotion to our text-based conversations. Did you know that you can also use emojis as variables in your Python code? In this post, we'll explore how to do just that with a simple Python script.

Using Emojis as Variables

I recently stumbled upon a fascinating aspect of Python: you can use emojis as variable names and also print out the variable name along with its value. This opens up a world of possibilities for adding a touch of fun to your code. 

Let's take a look at a Python script I created to demonstrate this concept. The script contains various emoji variables along with their Unicode representations. It also includes a function called show_line() that prints each emoji variable, its Unicode representation, and its description.

Here's a snippet of the script: .

# Emoticons
emoji_smile = '\U0001F600'               # 😀
emoji_scissors = '\u2702'                # ✂
emoji_check = '\u2714'                   # ✔
# More emoji variables ...


def show_line(var_name) -> None:
    if not isinstance(var_name, str):
        print("Error: var_name must be a string.")
        return
    global_vars = globals()
    if var_name in global_vars:
        var_value = global_vars[var_name]
        var_suffix = var_name.replace("emoji_", "")
        print(f"{var_name.ljust(40)} = '", end="")
        var_unicode_hex = ''.join([f"\\U{hex(ord(char))[2:].upper().zfill(8)}" for char in var_value])
        print(var_unicode_hex, end="'\t# ")
        print(f"{var_value}, '{var_suffix}'")
    else:
        print(f"Error: {var_name} not found in global variables.")

# Demo usage of the script
print("\n# Emoticons:")
show_line('emoji_smile')
show_line('emoji_scissors')
# More calls to show_line() ...

How to Use the Script

To run the script and see the emojis in action, simply execute the main() function of the full script in my GitHub. You'll see each emoji variable printed along with its Unicode representation and description.

Additional Information

This script is intended for simple use cases when only a few emojis are used. For more advanced emoji usage, you might want to consider using the python-emoji library.

Feel free to explore my GitHub repository for the complete script and contribute if you'd like to  improve the script further.



Friday, April 5, 2024

Exploring my Image Viewer Repository: A Python Tkinter Project

Introduction:

Welcome to my Image Viewer Repository! This GitHub repository hosts a collection of image viewer applications developed in Python using the Tkinter library for GUI and the PIL module for image handling. Each version of the image viewer offers unique functionalities and enhancements, catering to different user preferences and needs.

Repository Overview:

  • image_viewer_basic.py: This version of the image viewer provides a basic interface with buttons to load predefined images.
  • image_viewer_dropdown.py: An enhanced version featuring a dropdown menu to select images, offering a more intuitive user experience.
  • image_viewer_with_menu.py: This version introduces a menu-based interface for selecting images, adding another layer of usability to the application.
  • image_viewer_img_objects.py: An advanced iteration of the image viewer where images are treated as objects, allowing for more flexibility and scalability in managing and displaying images.

Usage:

To run any of the provided Python scripts, follow these simple steps:

  1. Clone or download the repository to your local machine.
  2. Open a terminal or command prompt.
  3. Navigate to the directory containing the desired Python script.
  4. Run the following command: python script_name.py, replacing script_name.py with the name of the script you wish to execute.

License:

This project is licensed under the MIT License, granting users the freedom to utilize, modify, and distribute the code as they see fit. For more details, refer to the LICENSE file in the repository.

Explore the Repository:

Ready to dive into the world of image viewers? Visit my Image Viewer Repository on GitHub to access the code and explore the different versions of the image viewer: Image Viewer Repository

Conclusion:

Thank you for exploring my Image Viewer Repository! Whether you're a Python enthusiast, a Tkinter aficionado, or simply looking for an intuitive way to view images, this repository has something for everyone. Feel free to experiment with the different versions and make the image viewer your own. Happy coding!

Friday, March 29, 2024

AI ChatGTP and music

One idea for this year is to make more use of AI in my projects. On my last blogpost about Python pandas i added an AI generated picture. The picture below is a result of quick experiments with 'NightCafe AI Art Creator' to make an illustration about 'AI generated music', the topic of this blogpost. My first attempts only gave a paper with music notes or some orchestra. so it was a bit of a challenge to get something nice.

AI generated music picture
AI generated music (NightCafe AI Art Creator)

My post about Python pandas also triggered me to take a look at other blogposts i have done to look if more pictures added something. For example a blogpost about Mysteries in ChatGPT had almost no illustrations and could need something extra. To go over older blogposts and add make changes did not give a good feeling. I like to limit changes in posts, however i also like to experiment with AI.

To try something complete different i did let another AI  (Sono) generate a song about Mysteries in ChatGPT :


The video (on my YouTube channel.) is complete generated with Suno . I hope you will play it to hear the result.
Python pandas
Python pandas
(NightCafe AI Art Creator)

I did not play a lot with Suno, and you only get a limited amount of 'virtual credits'to experiment. The interface (on my phone) did give me some problems and by accident i created multiple songs with the same input that where not much different from each other. 
I also created songs as mp3 audio files about 'Python pandas' . Unfortunately it is not easy possible to post audiofiles on this google blog. Therefore i created a video using the 'NightCafe AI Art Creator' picture as background and did put two (almost similar) the songs about 'Python pandas" in it. (I did this using a free version of ApowerEdit so it has a watermark.) By investing more time the video part could be improved a lot with multiple pictures and movement. I also tried Google subtitling to automatic generate a subtitle (containing the lyrics) however the result with (this) music seems poor.



I hope you enjoy hearing the audio on these two recently published videos.


Thursday, March 28, 2024

Python pandas *.csv import and export differences

As i am working on a project involving *.csv data files using the Python programming language and pandas a march 2024 blogpost about this topic. The data gets imported in Python pandas dataframes and later also saved to *.csv files. I hope to post later more details about the resulting program (I also have plans to post the final project on my GitHub)  
When checking details i noticed differences between the imported and exported data. When reading files and writing them back i immediately noticed the difference in file length. Recognizing the problem (more about them later) was not extreme difficult.

Python pandas
Python pandas

Illustration made with help of  NightCafe AI Art Creator

Solving the issue did cost more time. I wasted a lot of time with trying the solutions provided by ChatGTP, giving feedback about the problems however it did not solve my problem. By searching on internet i learned i was not the only one with the problem. However finding a solution was more difficult. In fact there where two problems in the *.csv

Missing double quotes ""

All data in the *.csv file where strings surrounded by double quotes " . When writing the *.csv file back the double quotes where gone.

Solution: When writing using the to_csv() use the option    quoting=csv.QUOTE_ALL 

NaN (or Null) values

The *.csv file contained items as "" and "None" . During reading of the data all both these values are converted to NaN in the Python panda dataframes. NaN ( in databases known as Null ) values are missing or not assigned values. 
For my project i needed to keep "" and "None" when writing back the data. Solutions provided mostly changed both values to "" or "None".  ChatGPT could not help me, however it (or he?) knew the answer.  When entered the solution that i found the response was the explanation of my solution. 

Solution: When reading using read_csv() use the option     keep_default_na=False

From the documentation on  https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html  :
By default the following values are interpreted as NaN: “ “, “#N/A”, “#N/A N/A”, “#NA”, “-1.#IND”, “-1.#QNAN”, “-NaN”, “-nan”, “1.#IND”, “1.#QNAN”, “<NA>”, “N/A”, “NA”, “NULL”, “NaN”, “None”, “n/a”, “nan”, “null “.

ChatGPT provided only solutions with the na_values options, However if keep_default_na is True, and na_values are specified, na_values is appended to the default NaN values used for parsing.

The final code

Important parts of Python ( pandas ) code used

import pandas as pd

my_import_df = pd.read_csv(csv_import_file, encoding='latin-1', keep_default_na=False, dtype=object)

my_export_df.to_csv( csv_export_file, quoting=csv.QUOTE_ALL, index=False)

Hoping to post something about my first pre-release version with some first functionalities of my project soon.

Sunday, March 17, 2024

HamVoIP via FritzBox

(This post is a dutch about HamVoIP as it is mainly of interest for Dutch Ham Radio users.)

Sinds september 2022 is het mogelijk gemaakt dat gelicenseerde radiozendamateurs elkaar contact kunnen onderhouden middels VoIP telefonie.
Dit syteem is operationeel onder de naam "HamVoIP". Ook zijn er conference bridges en een aantal radiostations die via HamVoIP beluisterd kunnen worden.
Op https://hamvoip.nl/ is hier meer info over te vinden, onder andere hoe een aanvraag voor een HamVoIP nummer gedaan kan worden. Ook staat hier info hoe dit op een aantal telefoontoestellen geconfigureerd kan worden.
Zelf het ik (PD1LAB) ook een nummer aangevraagd en gebruik dit via mijn FritzBox en hierbij mijn instellingen. (Een aantal gegevens zoals mijn wachtwoord en wat telefoonnummer cijfers heb ik onzichtbaar gemaakt.)

Ik had zelf al eerder met voip geexperimenteerd en ik heb daardoor al meerdere voip verbindingen op mijn Fritzbox.
Mijn HamVoIP verbinding was terecht gekomen op   *121#  (waarschijnlijk omdat een nummer had verwijderd en dit weer beschikbaar werd.

[ *124# is mijn normale vaste verbinding (en dit heb ik ook als default verbinding ingesteld) ]

Het invoerscherm bij aanmaken van nieuw telefoonnummer:

In eerste instantie had ik bij de gebruikersnaam mijn roepnaam ingevuld. Het bleek echter dat ook hier het telefoonnummer moest worden ingevoerd.
HamVoIP blokkeerd trouwens na 3 foute inlogpogingen gedurende 60 minuten de toegang. Daarom duurde het iets meer dan een uurtje voor mijn toegang echt werkte.  

Onderstaand de gegevens zoals zichtbaar in de FritzBox bij controle:

Bij klikken op het pennetje bij het telefoonnummer worden deze gegevens zichtbaar


 


'73 PD1LAB

Wednesday, January 31, 2024

Mailbag 2024 January

New mailbag with items from AliExpress
Items received end December 2023 and January 2024
In this mailbag some different USB Wifi devices as i want to experiment with them.

Some battery clamps


HDMI and Ethernet Wall socket


Tube type terminal set

USB Wifi connector with antenna




USB Wifi Connector




USB Wifi connector



You can never have enough memory cards.


Memory card reader / writer




Another Memory card reader and writer. This version is for USB C
Not only for memory cards, you can also connect a 'classic' USB device.


A set with 5 male and  female 3.5mm connectors



Some wired 2.5 mm 3 pin female audio connectors  

As i found this one meter RF cable for only € 0.01 and some Aliexpress point i could nor resist buying it.
("Normal price € 7.42 including 45% discount and additional 5% with points)



Shielded wire 3 core 10 meter. 




A 'Kenwood type' extension cable.







This cable is sold as "speaker mic headset earpiece",
NOT all the pins are connected! 

Small BNC extension cable.









I want to use this for a non RF application where i want to put a PCB with BNC connection in an enclosure and want the BNC output on the enclosure.
SMA antenna extension cable.




5pcs 3.5mm 3 Pole Mono Audio Connectors Jack Plug Headphone Male Adapter Jack Plug Male Jack Plug Wire Terminals Speaker


Cable to split a 4 wire connector in a the audio input and audio output part. 

Y Splitter Cable 3.5mm 2 in 1 Male To Female AUX Audio Cable MP3 MP4 Stereo Plug Adapter Jack For Headset Headphone computer