Tuesday, July 30, 2024

How do you work with image files in PyCharm - Part 1?

 Exploring image properties with PyCharm IDE

The image properties of a test image will be the target of our image exploration. In this part we create a project and bring in an image to the project.

Part 1: We create a PyCharm project and bring in an image into the project.

At first we create a new project in the PyCharm IDE. Here are some screenshots of creating a project.
File -> New Project brings up the next screen.


Change the name of the project to exploreImage.


Click create to create your project. You may get this screen. Choose New Window. Note that each project is usually window based. If you choose This Window, you will be adding the newly created project to another projects window.


Now imageExplore is the only project in the window that is open.


This is the default structure of a PyCharm project. It has a .venv directory and the main.py python program. This is the main entry point of the project. This has the initial logic and execution flow. It can be renamed and do not remove it. The .venv isolates your project and its dependencies from the other projects. The Scripts folder in .venv has many executable programs in addition to the python executable and other packages. You will learn a lot more about the project folder as we go through in due course.

Now we would like to create a new folder called Images wherein we place our images. It can be called in any way you choose to name.

Highlighting the exploreImage project a left click of the mouse brings up the following. Choose New -> Directory.


This should add a New Directory you can provide a custom name as shown.


However, the program does not create a new directory which it should. Even after exiting the PyCharm and reopening did not create the new directory.
Note: There  is some problem with PyCharm. However, we can create a directory using the file system in the Windows Explorer.







Monday, July 22, 2024

How do AI Chatbots fare with image creation?

We have seen that some of the chatGPT based chats (CoPilot,DALL-E 2, MidJourney, NightCafe  Creator, etc.) seem to work with both textual /image information. However, AI's interaction with text is lot more advanced than with the images. 

The difference between text, and image is analogous to structured data and unstructured data. Most of the textual information is highly ordered and structured, but that of the image is unstructured. Text may give a more intimate view into what it represents and it may even generate human-like text, but image gives only a give few of its attributes like shape, color, size and it may not be able to give the full context, like emotions. We can say at this point that text gives a higher contextual understanding than an image.

Image analysis using AI commonly known as computer vision has also made great advances but challenges are many. The probing of images by AI with research in deep learning and neural networks is narrowing this gap. Presently AI models are getting better at object detection, image recognition and generate images from text descriptions.

Here are some examples of images created from text:

Create a detailed picture of Ayodhya temple in India.

Co_Pilot tried to create an image. I am not showing all its attempts as they did not remotely resemble a Hindu temple but something from the fairy tales.

Here is what I finally got after goading:


This is one of the four images that are created automatically.

Well, Gemini tried as well but these are the results. I did not try repeated refinements of my text to get them.







Meta AI also tried its hand at creating the Ayodhya temple using it Emu, Meta Ai's proprietary engine.




The temple in India looks like this.


Presently, this is the best th ChatBots can do.

I do have an image from NightCafe and I will paste it here when I find it.

Monday, July 15, 2024

What do BlueStacks, Genymotion, Nox and LDPlayer have in common?

 Bluestacks 10 (https://www.bluestacks.com/download.html)app player allows you to play mobile apps, both Cloud Gaming and Android Emulator) from the Google Play Store on your Windows or Mac computer. 

Genymotion (https://www.genymotion.com/product-desktop/download/)is a cross platform Android emulator for testing apps. It can do scalable testing that are done on virtual devices.It is available for windows (x64), Linux(x64) and macOS(x86-64, arm64) platforms as well as Genymotion SaaS and Genymotion Device Image.


Nox (https://www.bignox.com/) is yet another Android Emulator for playing mobile games.


 LDPlayer (https://www.ldplayer.net/) featured as the fastest Emulator for Android games PC.' 





Motivation:

Actually, I wanted the raw data on a commercial, low cost, smartwatch from a Chinese company that called upon an Android app called HBand. H Band is available on Google Play, but if you want to run it on your windows PC (Windows 11) you need an Android Emulator. All of the above apps are indicated for the use of H Band.

The Mobile app, H Band on a Android Phone works OK. But, what if you want to look at raw data of  (body temperature, step counts, blood pressure, blood glucose, blood oxygen, Heart rate,and body temperature) collected by the app.It is supposed to be a safe app as far as data safety is considered including transit time encryption). 


BlueStack:


I contacted BlueStack to find that it does not yet support Bluetooth.


I tried Nox to connect to the watch. It works sometimes and sometimes it does not open. All these apps run very slow, intolerable in this 5G era.

GenyMotion requires a virtualBox. I wanted something that would work with no additional software.

LDPlayer is another option and it takes a lot of memory. It's Bluetooth connection is also not good.





I looked up the space requirements for some of these and they do take up a lot of space and send non-stop notifications.

This is what one of the ChatGPT came up with:

1. **BlueStacks 5**:

   - RAM: Requires at least 4GB of RAM¹.

   - Storage: Approximately 5GB of free disk space².

   - CPU Consumption: Consumes about 10% CPU, making it efficient¹.

   - RAM Usage: Consumes the least amount of RAM compared to other emulators¹.


2. **LDPlayer**:

   - CPU Consumption: Registered a massive 145% higher CPU usage compared to BlueStacks¹.

   - RAM Usage: Consumes more RAM than BlueStacks¹.


3. **Nox**:

   - CPU Consumption: Consumes 37% more CPU resources with noticeable lag in-app performance¹.

   - Storage: Unfortunately, I couldn't find specific storage requirements for Nox, but it seems to take up significant space³.


4. **Genymotion**:

   - Genymotion is another popular emulator, but its resource usage can vary based on the specific configuration and usage.


I DECIDED TO DUMP THEM ALL AND USE THE ANDROID EMULATOR IN ANDROID STUDIO. WHAT IS MORE, I HAD USED IT YEARS AGO.

NOT BEING A GAMER, I DO NOT NEED THE PROGRAMS. WHen I FIND SOME TIME, I WILL GET RID OF THEM





 







Sunday, July 14, 2024

What is a UTM in relation to Uniform Resource Locators?

UTMs  are a subset of URL parameters that are key-value pairs. The key-value pairs adds information and instructions to the URL.

UTM parameters are a specific format appended to a URL that track marketing campaign data in media sites like eCommerce sites or promotional media sites. They typically consist of five parts and all may not be present and even if present are not easily identified:

utm_source: Identifies the source of the traffic (e.g., google, email)

utm_medium: Identifies the advertising medium (e.g., cpc, organic)

utm_campaign: Identifies the specific marketing campaign

utm_term: Identifies the paid search term used (if applicable)

utm_content: Identifies the specific ad creative used (if applicable)

About URLs and UTMs

Hodentek.blogspot.com is my blog which brings up this:


One of the links at the bottom takes me, or directs me to

https://hodentekmobile.blogspot.com/2021/09/installing-android-studio-arctic-fox.html#google_vignette

So far we have had no URL parameters. The link just took us to another post in the blog.

In the following, the webpage brings https://www.amazon.com 

Searching for an author (myself) brings this page:


https://www.amazon.com/s?k=Jayaram+Krishnaswamy&crid=2BWW0UDS2F3NK&sprefix=jayaram+krishnaswamy%2Caps%2C195&ref=nb_sb_noss

There are URL parameters but are not UTMs. There are no UTM related key/value pairs. It is just a search page.

Here is an example of looking for a UTM page. Google places ads on the web pages and when it is clicked, the page author gets a click credit.

This is a blog page of mine with a coupon:


Click the Coupon code on this page to bring this one up:


Hitting CONTINUE will bring up this page with its URL shown below the image.


https://capitaloneshopping.com/lp/shoppingsavingscouponsm?utm_source=Unicorn&atnid=EAIaIQobChMIlaGV3P-nhwMVPlwIBB32wAB1EAEYASAAEgI3uPD_BwE

As shown in the highlighted key-value pairs you can recognize the UTM. The source 'UNICORN' is perhaps custom marketing campaign internal to the company. Media sites like Google, Facebook, etc are some examples of sources.

Another example:

https://topsearchesgo.net/1149?utm_source=zemanta&campaign_id=45129994&adset_id=60051870&ad_id=164414688&mediasource_id=b1_googleadx&publisher_id=hodentekhelp%2Eblogspot%2Ecom&placement=2161889362&click_id=63224_dde31108-431b-11ef-8da6-453632a452f2&zpbid=63224_dde31108-431b-11ef-8da6-453632a452f2

One more example from a Gold site:

https://topsearchesgo.net/1149?utm_source=zemanta&campaign_id=45129994&adset_id=60051870&ad_id=164415377&mediasource_id=b1_googleadx&publisher_id=hodentekhelp%2Eblogspot%2Ecom&placement=1812271808&click_id=63224_caa131d1-44ce-11ef-894b-844a229bc158&zpbid=63224_caa131d1-44ce-11ef-894b-844a229bc158

Benefits of UTMs:

  • Tracking campaign effectiveness, effectiveness of advertising spend and improving user experience

  • Drawbacks of UTMs; Hard to manage and needs steep learning to put them effectively which result in miss-implementation.

  • Other forms of tracking also possible like referal codes, coupons and analytics.


Monday, June 24, 2024

What is the latest version of Android Studio and how do you install it?

The latest version of Android Studio is called Koalas(2024.1.1)

Please visit this site for details: https://bit.ly/4eAwThe

For Windows download go here: https://bit.ly/3VToH4h

I had problems installing an older version named Arctic Fox here;

https://hodentekmobile.blogspot.com/2021/09/installing-android-studio-arctic-fox.html#google_vignette

Instructions:

If you downloaded an .exe file (recommended), double-click to launch it.

If you downloaded a .zip file:

Unpack the .zip.

Copy the android-studio folder into your Program Files folder.

Open the android-studio > bin folder.

Launch studio64.exe (for 64-bit machines) or studio.exe (for 32-bit machines).

Follow the Setup Wizard in Android Studio and install any recommended SDK packages.

Herein I describe the installation of Android Studio Koalas on a Windows x64 laptop Surface Pro 5. I downloaded this file:  android-studio-2024.1.1.11-windows.exe

The installation screens are shown here:










Although all the screens have successfully traversed, you do not see the Finish button enabled. The trick is go to each item in the list and accept the license terms. If all of them are accepted the Finish button gets enabled.


It will start downloading all the components and the program successfully ends.


This problem has been faced by any and even made it to the StackOverflow forum.


https://stackoverflow.com/questions/67062999/unable-to-install-the-sdk-tools-finish-button-is-disabled

Sunday, June 23, 2024

What is the latest version of Android Studio and what are its features?

 The latest version of Android Studio (2024.1.1) is called Koalas.

Android Studio is used for building high-quality, modern Android Applications. The following features make it extremely well suited for building modern Android applications. These are in no way new but essential in all modern design environments:

  •  Develop Native Android Apps:  The basic function is used to build Android applications using KOTLIN, or Java. KOTLIN is Google's preferred language for Android app development. It provides an development environment with all the necessary tools for writing, editing, testing, debugging, and deploying your application. It's Android device monitor can explore various aspects of a connected Android app.

  • Build app's UI with Jetpack Compose :  Without UI you can not think of an application and Android can do UIs. It uses 'Jetpack Compose' to create UIs. Jetpack Compose is a declarative UI framework that allows you to build modern, customizable, and efficient user interfaces with a more composable and reactive approach.

  •  Utilize Robust Development Tools: Android Studio has a rich set of tools to do almost anything such as:

  1.  Code editing: Syntax highlighting, code completion, refactoring tools, and code navigation for efficient coding.
  2.  Debugging: Step through your code, set breakpoints, inspect variables, and identify and fix bugs effectively. Debugging can also be used look at data flows in the app.
  3. Testing: Write unit tests, integration tests, and UI tests to ensure code quality and prevent regressions.
  • Emulation and Testing on Different Devices:  Every app developer wants to see how is app works on a physical device and the look and feel on other device sizes. Without needing a physical device for every configuration, you can use the built-in Android Emulator to test your app on virtual devices simulating various screen sizes, operating systems, and device capabilities. Additionally, you can connect real Android devices for testing and development. You can test on external devices using WiFi or USB. 
  • Integrate with Firebase and Other Services:  You can use Google Firebase for authentication, databases, cloud storage, analytics, and more. Android Studio also supports integrating with other third-party libraries and services to enhance app features such as Networking, Image loading, UI animations, databases, etc.

Here is a link to installing Android Studio on Windows 10: 

Also, couple of more articles on the same HodentekMobile blog.

Friday, June 21, 2024

Are there AI models that can help deal with diabetes?

There are pretrained AI models for diabetes.

GlucoNet Model: Deep learning model that can predict Glucose levels based on carbohydrate intake.

Deep Gluco Model: Not only takes carbo intake into consideration but also insulin dosage, physical activity, etc.

GlucoNet is adequate for diabetes type II. I will be homing in on type II.

These are used to improve the MIT control loop for adjusting optimal carbo intake.

There is company (Alertgy) in Melbourne, Australia involved in the development of diabetes monitored by a wearable device.

Right now, I have one with questionable activity, but qualitatively measuring (Zero, when not connected and 3 peaks to coincide in time with break fast, lunch and dinner).