Wednesday, May 17, 2006

VFP: Inserting Nodes with XML Object

This was not a fun experiment. The key here is that we are using Visual Foxpro
to insert into a XML document. We do this by selecting the parent node, then insert
into the child nodes at a specific location. I dont see any other way to optimize this but I'm open for suggestions.





* OPEN MSXML Object
xmlDoc=CREATEOBJECT("Msxml2.DOMDocument.6.0")
xmlDoc.ASYNC="false"
xmlDoc.LOAD("xmltest.xml")
x=xmlDoc.documentElement

* INit document fragment
docFrag = xmlDoc.CreateDocumentFragment()

* Set the XML
docFrag.appendChild(xmlDoc.CreateElement("REF_J"))

* Obtain Original Node where children Exist
oNode=xmlDoc.selectnodes("/recordset/L.2000B/L.2300")
i=0
* Object Creation Of children nodes to iterate
objChildNodes = oNode.ITEM(0).childNodes
* Iterate through children, identify the node you want to insert before
FOR EACH strNode IN objChildNodes
** NODE IDENTIFIED, DO INSERT
IF strNode.nodename="REF_K"
* Inserting at the location of the node with children, insert before the location of the child node.
oNode.ITEM(0).insertBefore(docFrag, oNode.ITEM(0).childNodes.ITEM(i))
EXIT FOR
ENDIF
i=i+1
NEXT

* Save XML
xmlDoc.SAVE("xmltest-output.xml")


Monday, May 15, 2006

Linux: Dell Latitude LM, XWindows, Neomagic Magicgraph

I have to be the first to say that it's always a challenge working with older hardware. I recently received a Dell Latitude LM Laptop which is only a P133 with an 800x600x256 display adapter (Neomagic 2070 (NM2070)). The only thing magical about this was it's ability to not run X on it properly. I had serious display issues from the start. I was able to get VGA to run on it, but who can surf the web at 640x480. It looked terrible.


I was able to get it working through some serious troubleshooting over several hours. The DEFAULT Debain package configuration WILL NOT get you to a working mode with this hardware.


I added 2 options to my XF86Config which did make it work. Now I dont know which one for sure did the trick, but it seems to be running great now.


All Debian Packages in "stable"



Option "NoAccel" "True"


This turns off the acceleration on the card. I think this is probably the option that fixed the problem.