Read Xml into a Dataframe in R - r

I have tried with xml2 and XML packages in R. None giving the desired output. I want to import the below xml into a dataframe in R
XML file contents :
<?xml version="1.0" encoding="UTF-8"?>
<ODM xmlns:data="xxxxxx"
xmlns="some_link"
data:DatasetXMLVersion="0.0.0"
ODMVersion="xxxx"
FileType="yyyy"
FileOID="jkjkj"
CreationDateTime="2023-02-01T14:13:52.892Z">
<ClinicalData StudyOID="9aa2b541-7547-4980-b0b3-0df913e10e19" MetaDataVersionOID="CDISC.SDTM.3.1.0">
<ItemGroupData data:ItemGroupDataSeq="1" ItemGroupOID="GH" LastModified="2023-01-29T23:47:03.921Z" ProtocolVersion="1.0">
<ItemData ItemOID="STUDYID" Value="xxxxxx"/>
<ItemData ItemOID="DOMAIN" Value="GH"/>
<ItemData ItemOID="USUBJID" Value="yyyyyyy"/>
<ItemData ItemOID="SUBJID" Value="nnnnnn"/>
<ItemData ItemOID="SITEID" Value="llllllll"/>
<ItemData ItemOID="INVID" Value="123"/>
<ItemData ItemOID="INVNAM" Value="Harry Potter"/>
</ItemGroupData>
<ItemGroupData data:ItemGroupDataSeq="1" ItemGroupOID="GH" LastModified="2023-01-29T23:47:03.921Z" ProtocolVersion="1.0">
<ItemData ItemOID="STUDYID" Value="xxxxxx1"/>
<ItemData ItemOID="DOMAIN" Value="GH1"/>
<ItemData ItemOID="USUBJID" Value="yyyyyyy1"/>
<ItemData ItemOID="SUBJID" Value="nnnnnn1"/>
<ItemData ItemOID="SITEID" Value="llllllll1"/>
<ItemData ItemOID="INVID" Value="1231"/>
<ItemData ItemOID="INVNAM" Value="Ronald Weasley"/>
</ItemGroupData>
</ClinicalData>
</ODM>

Related

Error while try to add splash screen to Xamarin forms -Xamarin Android

I am trying to create a splash screen to my app.
I am using Xamarin forms, and I currently testing only in Android
However I am receiving this 2 errors
1)Failed to generate resource table for split '' "Failed to generate resource table for split ''".
Severity Cod'android:windowBackground' with value '#drawble/splashscreen'.
will appreciate any help to solve this issue
thanks.
here is my styles.xml:
<resources>
<style name="Theme.splash" parent="android:Theme">
<item name="android:windowBackground">#drawble/splashscreen</item>
<item name="android:windowNoTitle">true</item>
</style>
<style name="MainTheme" parent="MainTheme.Base">
</style>
<!-- Base theme applied no matter what API -->
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<!--If you are using revision 22.1 please use just windowNoTitle. Without
android:-->
<item name="windowNoTitle">true</item>
<!--We will be using the toolbar so no need to show ActionBar-->
<item name="windowActionBar">false</item>
<!-- Set theme colors from
http://www.google.com/design/spec/style/color.html#color-color-palette -->
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">#2196F3</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">#1976D2</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">#FF4081</item>
<!-- You can also set colorControlNormal, colorControlActivated
colorControlHighlight and colorSwitchThumbNormal. -->
<item name="windowActionModeOverlay">true</item>
<item name="android:datePickerDialogTheme">#style/AppCompatDialogStyle</item>
</style>
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">#FF4081</item>
</style>
</resources>
and here is the code I added to Activity:
[Activity(Label = "SplashScreen", MainLauncher=true, NoHistory=true, Theme = "#style/Theme.splash")]
public class SplashScreen : Activity
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
StartActivity(typeof(MainActivity));
}
}
and this is the main acitivity:
[Activity(Label = "RegestrationAppComp", Icon = "#drawable/icon", Theme = "#style/MainTheme", MainLauncher = false, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle bundle)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
base.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(this, bundle);
LoadApplication(new App());
}
}
When you create your splashscreen.xml file, you must change its properties. I've followed these steps:
Right click the splashscreen.xml file and select Properties, a window will show up at the bottom.
On the field Build Action, change the value to AndroidResource
On the field Custom Tool, write MSBuild:UpdateGeneratedFiles (or copy what's written on other files above in the same folder or from the values/styles.xml file.
Please add your image(in your case image file name is "splashscreen") in drawable folder using visual studio. For this, you have to right click on "Drawable" folder -> click on "Add Existing Item" -> select your image from your laptop/PC drive location and click on "Add".. Thats it !!! Now you can build and deploy solution again..

Aikau and cssRequirements

I am trying to use a custom Aikau widget to load some css and javascripts:
/**
*
* #module /JQueryPlugins
* #extends dijit/_WidgetBase
* #mixes module:alfresco/core/Core
* #mixes module:alfresco/core/CoreWidgetProcessing
*/
define(["dojo/_base/declare",
"dijit/_WidgetBase",
"alfresco/core/Core",
"alfresco/core/CoreWidgetProcessing",
"jquery",
"jqueryui",
"jquery-chosen",
"custom-namespace",
"custom-global",
],
function(declare, _WidgetBase, AlfCore, CoreWidgetProcessing, $) {
console.log("initialising");
return declare([_WidgetBase, AlfCore, CoreWidgetProcessing, $], {
cssRequirements: [
{ cssFile: "./css/chosen.css" }
]
});
});
The packages jquery-chosen, custom-namespace and custom-global are defined in a share extension module:
<module>
<id>jQuery Plugins</id>
<version>1.0</version>
<auto-deploy>true</auto-deploy>
<configurations>
<config evaluator="string-compare" condition="WebFramework" replace="false">
<web-framework>
<dojo-pages>
<packages>
<package name="jquery-chosen" location="js/aikau/custom/jquery/chosen" main="chosen.jquery"/>
<package name="custom-namespace" location="js" main="custom-namespace"/>
<package name="custom-global" location="js" main="custom-global"/>
</packages>
</dojo-pages>
</web-framework>
</config>
</configurations>
</module>
The javascripts are loaded as expected and the jquery plugin "chosen" works, but its css is not loaded.
Given that this cssRequeriments import is used often in the aikau code, I am sure that it works, but I cannot see what is wrong in my code.
Do you see anything wrong ?
I was also trying to investigate why the css requirements is ignored looking the aikau source code, but I do not find there where the inclusion of the cssRequirements is implemented. Can someone tell me where to look?
Aikau widget file structure should be same as defined in image

Qt Quick does not translate components loaded via Loader

Situation:
Writing a Qt Quick application for embedded Linux system, want to use Qt translation mechnanism. Application shall select language on command coming in via RS232, currently hardcoded to "de" on a system set up for english language. Application loads various masks on command from RS232.
Problem:
Qt Quick translates only the main page (main.qml), but not the pages loaded via the Qt Loader (DEMO.ui.qml). Texts from main.qml are displayed in german, texts from DEMO.ui.qml are displayed untranslated.
I've added a "XX" prefix to all english translations (qml.en.ts), that also does not appear on the screen. So neither english nor german translations are loaded for pages loaded via the Qt Loader.
Clean build after lupdate, lrelease does not help. rm -rf build-$appname-*, build does not help.
Code:
application.cpp:
xlat=new QTranslator();
if (xlat->load(QLocale("de"), "qml", ".", ":/qml/i18n/", ".qm")) {
qDebug()<<"load translator ok";
bool ok=installTranslator(xlat);
//...
} // else error message
// ...
viewer->setSource(QUrl("qrc:/qml/main.qml"));
viewer->showFullScreen();
// ...
main.qml:
import QtQuick 2.0
Rectangle {
Text {
id: loadingMsg
text: qsTr("Loading ...")
// ...
}
Loader {
// ...
source: ""
function loadMask(aMaskId) {
// ...
setSource(gui.urlForMask(aMaskId));
}
}
// ...
}
components/SimpleButton.qml:
import QtQuick 2.0
// ...
Rectangle {
Text {
id: label
text: ""
// ...
}
property alias text: label.text
}
masks/DEMO.ui.qml:
import QtQuick 2.0
import "../components"
//...
SimpleButton {
//...
text: qsTr("Vent.")
}
//...
qml.de.ts:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de_DE">
<!-- ... -->
<context>
<name>DEMO</name>
<!-- ... --->
<message>
<source>Vent.</source>
<translation>Belüften</translation>
</message>
</context>
<context>
<name>main</name>
<message>
<source>Loading ...</source>
<translation>Lade ...</translation>
</message>
<!-- ... -->
</context>
Renaming DEMO.ui.qml to DEMO.qml did the trick. I guess that the Linguist tools (lupdate, lrelease) and the Qt runtime environment have different ideas of how to convert a filename to a context name.

getting swf version info

In FlashBuilder's compiler options (Properties->Flex Compiler), under "Adobe Flash Player options" there is an option for "Use a specific version", where you can tell it what Flash Player to link against:
How do I get this value at runtime? Note that I am not talking about the Flash Player version, but the version that the swf was linked against.
We were facing the same problem at my company, and we've found the following mappings:
"SWF Version" | "Flash Player Version"
========================================
9 | 9
10 | 10.0, 10.1
11 | 10.2
12 | 10.3
13 | 11.0
14 | 11.1
15 | 11.2
16 | 11.3
17 | 11.4
18 | 11.5
19 | 11.6
20 | 11.7
21 | 11.8
22 | 11.9
23 | 12.0
24 | 13.0
25 | 14.0
Sources:
blogs.adobe.com
sleepydesign.blogspot.com
You can't get that exact target version. You can get the SWF file version, but that is not the same. When you edit the target version in that panel, Flex compiles against a different playerglobal.swc, but doesn't necessarily change the SWF file version.
This may or may not apply to your specific use case, you might need to explain what exactly you're doing. At any rate:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/LoaderInfo.html#swfVersion
Are you doing this with a project that you can modify or are you trying to find the version of a swf file after the build, if it's the former you can modify the index.template.html to include flash vars using the build variables as parameters then retrieve these at runtime.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="application1_creationCompleteHandler(event)">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
protected function application1_creationCompleteHandler(event:FlexEvent):void
{
// TODO Auto-generated method stub
Alert.show(Application.application.parameters.fpVersion);
}
]]>
</mx:Script>
</mx:Application>
my index.template.html
<html lang="en">
<!--
Smart developers always View Source.
This application was built using Adobe Flex, an open source framework
for building rich Internet applications that get delivered via the
Flash Player or to desktops via Adobe AIR.
Learn more about Flex at http://flex.org
// -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- BEGIN Browser History required section -->
<link rel="stylesheet" type="text/css" href="history/history.css" />
<!-- END Browser History required section -->
<title>${title}</title>
<script src="AC_OETags.js" language="javascript"></script>
<!-- BEGIN Browser History required section -->
<script src="history/history.js" language="javascript"></script>
<!-- END Browser History required section -->
<style>
body { margin: 0px; overflow:hidden }
</style>
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = ${version_major};
// Minor version of Flash required
var requiredMinorVersion = ${version_minor};
// Minor version of Flash required
var requiredRevision = ${version_revision};
// -----------------------------------------------------------------------------
// -->
</script>
</head>
<body scroll="no">
<script language="JavaScript" type="text/javascript">
<!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);
// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if ( hasProductInstall && !hasRequestedVersion ) {
// DO NOT MODIFY THE FOLLOWING FOUR LINES
// Location visited after installation is complete if installation is required
var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
var MMredirectURL = window.location;
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
var MMdoctitle = document.title;
AC_FL_RunContent(
"src", "playerProductInstall",
"FlashVars", "MMredirectURL="+MMredirectURL+"&MMplayerType="+MMPlayerType+"&MMdoctitle="+MMdoctitle+"&fpVersion="+requiredMajorVersion+requiredMinorVersion+requiredRevision+"",
"width", "${width}",
"height", "${height}",
"align", "middle",
"id", "${application}",
"quality", "high",
"bgcolor", "${bgcolor}",
"name", "${application}",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else if (hasRequestedVersion) {
// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
"src", "${swf}",
"width", "${width}",
"height", "${height}",
"align", "middle",
"id", "${application}",
"quality", "high",
"bgcolor", "${bgcolor}",
"name", "${application}",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"flashVars", "&fpVersion="+requiredMajorVersion+requiredMinorVersion+requiredRevision,
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be placed here. '
+ 'This content requires the Adobe Flash Player. '
+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
document.write(alternateContent); // insert non-flash content
}
// -->
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="${application}" width="${width}" height="${height}"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="${swf}.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="${bgcolor}" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="${swf}.swf" quality="high" bgcolor="${bgcolor}"
width="${width}" height="${height}" name="${application}" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</noscript>
</body>
</html>
If this is what you want to do you'll probably want to fill in the variables in the noscript block as well and add some delimiters for the version but I just wanted to see if this worked as I expected and if it's what you're going for in the first place.
This was answered in December here: How can I determine what flash player version a swf was published for?

Flex Import Class from a Module within a sub directory

I put some modules in a module folder. How do I import classes with the import statement when I'm in a sub folder?
This won't work, not like classes which are in packages.
modules/SomeModule.mxml
<?xml version="1.0"?>
<mx:Module>
<mx:Script>
<![CDATA[
import Fruit.Apple;
]]>
</mx:Script>
</mx:Module>
Directory:
.
|-- Fruit
|-- Apple.as
|-- Modules
|-- SomeModule.mxml
`-- application.mxml
This should work as long as the src folder is set to the above directory and the Apple class has the correct package declaration (package Fruit { ... })

Resources