28 October 2023

Could not start Dart VM service HTTP server

Environment:

Visual Studio Code v1.83.1


Symtomps:

1). When you try to debug your Flutter project, you see this error message at the Terminal "Could not start Dart VM service HTTP server"


2). You will also notice that the Hot Reload, Hot Restart are all gone!


Solution:

a). Please go to <Your_Project_Path>\android\app\src\debug folder, confirm if you have AndroidManifest.xml in that debug folder.

b). Go to <Your_Project_Path>android\app\src\profile folder, copy AndroidManifest.xml and paste it to the debug folder at Step [a].

c). Type 'flutter run' at Terminal and Hot Reload, Hot Restart should work now.



Explanation at Flutter Docs did mention how Dart VM service work with that Hot Reload and Hot Restart features. Refer https://docs.flutter.dev/tools/vs-code#hot-reload-vs-hot-restart


Happy coding!

19 December 2022

10 steps to setup your Python Luno trading bots on Microsoft Azure

10 steps to setup your Python Luno trading bots on Microsoft Azure.

Step 1: Create a Virtual Machine for Ubuntu with size = B1s. You may choose the cheapest region, which is East US 2 - refer https://azureprice.net/You do not need any graphical user interface for this Ubuntu.


Step 2: Now, configure the SSH to only allows the public IP address from your computer.

Step 3: Log into that Virtual Machine to remove Python 2.7 and upgrade it to version 3.10 - refer https://www.itsupportwale.com/blog/how-to-upgrade-to-python-3-10-on-ubuntu-18-04-and-20-04-lts/. Remember to install pip too.

Step 4: Now, install MySQL on your Virtual Machine using sudo command - refer https://linuxize.com/post/how-to-install-mysql-on-ubuntu-18-04/.

Step 5: After that, install MySQL Client, MySQL Connector and Luno Python SDK on Python 3.10 inside your Virtual Machine. You might need setuptools as pre-requisites.

Step 6. Deploy the Python scripts for your bots.

Step 7. Check the configurations file.

Step 8. Build the database for your bots, which will be used to store trading information.

Step 9. Use nohup command to execute your Python bots at background.

Step 10. Use ps aux command to check whether your Step 9 has been done correctly or not.

Thanks.

25 October 2022

"Character set 'utf8' unsupported" when you run Python script with MySQL database?

When you run Python script with MySQL database, system gives you this error message:

Character set 'utf8' unsupported


What Do You Need To Do?

pip uninstall mysql-connector-python

15 October 2022

Unable to find resource t64.exe in package pip._vendor.distlib

 Hitting this error message "Unable to find resource t64.exe in package pip._vendor.distlib" when trying to upgrade your PIP to latest version?


Try to run the commands below:

  • python -m pip uninstall pip setuptools
  • pip install --upgrade setuptools


Source: https://www.cnblogs.com/poloyy/p/12966270.html

18 September 2022

Supplied javaHome is not a valid folder. You supplied:

You hit this error message on Visual Studio Code (or Android Studio) for your IonicFramework project after you upgraded Java in your computer:

Supplied javaHome is not a valid folder. You supplied: <folder_name_with_path>


What Is The Solution?

a). Make sure Android Studio > Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JDK is pointing to the correct JDK version. Save all for changes.

b). For Windows, go to this folder "C:\Users\<your_Windows_user_name>\.gradle", delete all of the files and folders.

c). Go to "<your_project_folder>\android\.gradle" folder, delete all of the files and folders.

d). Run the commands below as usual:

ionic build 

npx cap copy

npx cap sync

npx cap open android

19 March 2022

How to open an URL in Chrome incognito mode using Python?

You may refer to the sample codes below from us. We use Windows platform as an example:


import webbrowser

def main():
    fUrl: str = 'https://prgexp.blogspot.com/'

    chrome_path = 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'
    webbrowser.register('chrome', None, webbrowser.BackgroundBrowser(chrome_path))
    webbrowser.get('chrome').args.append('--incognito')
    webbrowser.get('chrome').open_new_tab(fUrl)

if __name__ == '__main__':
    main()

Do I need public IP for Azure VM?

 If you need to connect to your Azure VM from internet (means your home or your office), then yes, you will need to assign a public IP to your Azure VM.

If you prefer to access your Azure VM from Azure Portal, then you may not need any public IP.

More details at this article from Microsoft: https://docs.microsoft.com/en-us/azure/virtual-network/ip-services/associate-public-ip-address-vm


Tips: You can save money if you do not assign any public IP on your Azure VM.

29 October 2020

使用 EVPAD 电视盒但却有很多问题,并且不时会弹出很多广告?

 我从2018年开始使用 EVPAD,最近我发现这个电视盒设备似乎有很多问题,例如视频加载滞后,电视频道有时在中间停止,甚至更糟的是那些广告在短时间内不断出现(而我就被逼重新启动视频)!


如何解决?


a)。在电视盒主屏幕,选择 “设置”,然后选择重置 (reset) 电视盒。不用担心,这很安全。

b)。接下来,等待电视盒重启并自行返回主屏幕。它将要求您使用您的Google帐户登录。请选择登录。

c)。您会发现所有的 app 都已消失。不用担心,请立即返回主屏幕。

d)。在主屏幕上,按 EVPAD 遥控器上的6868。您应该能够看到安装一些默认 app 的选项。

e)。请不要安装EVPAD App Store,因为我怀疑这是广告弹出的根本原因。

f)。安装 Saturn Live 和 Saturn Video 的 app,之后您的电视盒应该会焕然一新了。


注意:这篇文章是在我完成电视盒重置 7天后发布的。目前为止都没有广告弹出,现在视频速度也比之前流畅。

Using EVPAD but it's lagging and many advertisement popup?

I start using EVPAD since 2018 and recently that TV BOX device seems having a lot of problems, such as, video loading is lag, TV channel sometimes stopped in the middle, even worst is those advertisements keep on appearing within short time (and I have to restart the video)!

How to Fix it?

a). Go to Settings screen, and then proceed to Reset the TV Box. Don't worry, it's safe.

b). Next, wait until the TV BOX restart and back to Home screen by itself. It will ask you to sign in using your Google account. Yes, please sign in.

c). You will notice that all apps are gone. Don't worry, please go back to Home screen now.

d). At Home screen, press 6868 on your EVPAD remote control. You should be able to see the option to install some default apps.

e). Please DO NOT install EVPAD App Store as I suspect that is the root cause of advertisement popping up.

f). Install the Saturn Live and Saturn Video apps, enjoy your TV BOX like a brand new one.


Note: This article is posted after 7 days I've done the reset on my TV BOX, there is no advertisement popping up and the video speed now is smooth.

25 October 2020

"The wheel package is not available" when you try to install matplotlib in Python

 Hit into "The wheel package is not available" when you try to install matplotlib in Python?

python -m pip install matplotlib


Think you should try to run the following command first:

pip install wheel

 



14 July 2020

Crystal Report: First page is always blank with sub-report

Steps to resolve the issue:

a). Right-click and choose "Format Object".



b). In "Format Editor" > "Common" > Un-tick "Keep Object Together". Click "OK" to save the changes.



c). Repeat step [a] and step [b] on all sub-reports.

d). Preview the report now, first page should not be blank anymore.