Wednesday, July 18, 2018

How do you parse an XML document using Python 3.70b2?

Let us start with an XML Document. Here is my XML Document saved to my computer as MyStudents.xml.


Launch Python 3.7.0b5(x64bit) and do an import using the xml.etree.ElementTree module by importing it like,


>>> import xml.etree.ElementTree as ET

Now you can use ET as shown here:


Now you can get the 'root' of XML Document as in:


You use the tag attribute of the root to get the tag.

The 'root' has children which are the four students with their ID's.

You can get all of the children as shown in the code shown below.

How is XML Documents parsed in R?
Read here.

Also here.

Parsing using JSON:

Tuesday, July 17, 2018

Is there an easy to use XML validator on the web, on-line?

There may be many. I some tiems use this one (look at the URL address).


I submitted this document that I know is well formed without errors.


When I click 'validate', I get this response.


Monday, July 16, 2018

how do you fix: Validation error. error C00CE169: App manifest validation error

This error may show up if one chooses an image file that does not comply with the enumeration.

Here is the description of the error:

Severity Code Description Project File Line Suppression State
Error  Validation error. error C00CE169: App manifest validation error: The app manifest must be valid as per schema: Line 26, Column 25, Reason: '' violates enumeration constraint of 'badge badgeAndTileText'. The attribute 'Notification' with value '' failed to parse. XXXXXX C:\Users\Owner\source\repos\xxxxxx\bin\ARM\Debug\AppxManifest.xml  

I chose a resource for Badge in the Assets and Visual Studio spawned this error.

The only way to get out of this was to comment out (or better remove) the following line in the AppManifest .xml

Make sure you save the file after the removal as every time you Build, the AppManifest.xml gets recreated.

How to convert from a LIST to a string in Python?

Methods of conversion are needed in every language.

You can convert a list to string as shown here for a simple list:


Here is an example of conversion of a more complicated list from an earlier post:


Saturday, July 14, 2018

How do you convert from Python to JSON in Python 3.70b2?

You should import json and use dumps() as shown.

Here data is a python list and it will be converted to json.


If you want to print it pretty you could do  like this here.


We started with a sorted list what if we did not, as in data2


How did you fix the Lumia 950 recognition?

In my previous post I had difficulty in accessing my Lumia 950 Smart Phone (Windows Mobile) although I could use the USB ports otherwise.

The trouble shooting and updating the USB drivers did not help. I dawned upon me that perhaps it is to do with something else.

I opened up the Device Manager with the phone connected to an USB Port and voila! there indeed was an item for the Lumia 950 as shown with a question mark.

This shows the properties of the Lumia 950(RM-1105) device.

I updated the driver for this device and that seems to have fixed the problem. under Portable devices I do find the ZrEWindows phone.


Friday, July 13, 2018

How come my Microsoft Lumia 950 not recognized by the File Explorer?

It has been quite strange the way Windows 10 works.

Few days ago Windows 10 was updated to Insider Preview Build 17692.rs_prerelease-flt.180625-1624 and now I cannot see my Microsoft Lumia 950 connected to the USB (there are three on this laptop) in the file explorer.

It is strange that I can connect to Flash Drives and WD's My Passport 1 TB drive connected to the USB drives.

Even stranger is, the fact that I can deploy UWP (Universal Windows Platform) projects from Visual Studio Community 2017 to the Microsoft Lumia 950 connected to the USB Drive.

I have done a hardware troubleshooting and restarted the laptop.

Still no good.

If I find a fix I will psot here for those who may hit the same wall.