transformation

How to reformat XML with group-adjacent (XSLT)

懵懂的女人 提交于 2020-01-01 19:35:13
问题 I'm new in this XSLT-thing and I can't figure out how to this: This is a snippet from the xml i start with: <Article> <Bullettext>10,00 </Bullettext> <Bullettext>8,00 </Bullettext> </Article> <Article> <something>some text</something> </Article> <Article> <Corpsdetexte>Bulgaria</Corpsdetexte> <Bullettext>15,0 </Bullettext> <Bullettext>10,0 </Bullettext> </Article> ` This is what i want the output to be: <LIST> <ITEM>12,00 </ITEM> <ITEM>10,00 </ITEM> <ITEM>8,00 </ITEM> </LIST> <P> <something

how to use the Box-Cox power transformation in R

旧时模样 提交于 2019-12-31 08:24:53
问题 I need to transform some data into a 'normal shape' and I read that Box-Cox can identify the exponent to use to transform the data. For what I understood car::boxCoxVariable(y) is used for response variables in linear models, and MASS::boxcox(object) for a formula or fitted model object. So, because my data are the variable of a dataframe, the only function I found I could use is: car::powerTransform(dataframe$variable, family="bcPower") Is that correct? Or am I missing something? The second

Pass parameter to XSLT stylesheet

你。 提交于 2019-12-30 17:23:57
问题 I'm trying to pass a couple of parameters to an XSLT style sheet. I have followed the example: Passing parameters to XSLT Stylesheet via .NET. But my transformed page is not correctly displaying the value. Here is my C# code. I had to add a custom function to perform some arithmetic because Visual Studio 2010 doesn't use XSLT 2.0. var args = new XsltArgumentList(); args.AddExtensionObject("urn:XslFunctionExtensions", new XslFunctionExtensions()); args.AddParam("processingId", string.Empty,

Comparing images using SIFT

戏子无情 提交于 2019-12-30 13:25:09
问题 I'm trying to compare 2 images that are taken from a digital camera. Since there may be movement on the camera, I want to first make the pictures "match" and then compare (using some distant function). To match them, I'm thinking about cropping the second picture and using SIFT to find it inside the first picture... it will probably have a small difference on scale/translation/rotation so then I'd need to find the transformation matrix that converts image 1 to image 2 (based on points found

Create transform to map from one rectangle to another?

回眸只為那壹抹淺笑 提交于 2019-12-30 04:33:30
问题 What is the simplest way to create AffineTransform which maps coordinates from one rectangle to another (float/double rectangles are given)? UPDATE 1 Rectangles can be absolutely different. For example [(0,0)-(1,1)] and [(150,-14)-(-1000,-14.1)]. And transformation should transform uniformly. For example, rectangle corners should be transformed one to one. For example coordinates (0,0) should turn to (150,-14). UPDATE 2 I need AffineTransform object, not just calculation. Because I want to

Matrix / coordinate transformation order

一笑奈何 提交于 2019-12-29 09:08:11
问题 I have two array of points: Point [] original; AND Point [] transformed; These transformed array is simply a copy of the original with transformations applied. Example: matrix.Rotate(5f); matrix.Scale(.8f, 1.1f); matrix.Translate(30f, 18f); matrix.TransformPoints(transformed); The original points ARE known. The transformation values ARE known. The order in which the transformations were applied is NOT known. How can I calculate / infer the order of transformations? EDIT There is only ONE

Transform from Wide to Long without sorting columns

给你一囗甜甜゛ 提交于 2019-12-29 09:05:57
问题 I want to convert a dataframe from wide format to long format. Here it is a toy example: mydata <- data.frame(ID=1:5, ZA_1=1:5, ZA_2=5:1,BB_1=rep(3,5),BB_2=rep(6,5),CC_7=6:2) ID ZA_1 ZA_2 BB_1 BB_2 CC_7 1 1 5 3 6 6 2 2 4 3 6 5 3 3 3 3 6 4 4 4 2 3 6 3 5 5 1 3 6 2 There are some variables that will remain as is (here only ID) and some that will be transformed to long format (here all other variables, all ending with _1, _2 or _7) In order to transform it to long format I'm using data.table melt

Transform from Wide to Long without sorting columns

半城伤御伤魂 提交于 2019-12-29 09:05:06
问题 I want to convert a dataframe from wide format to long format. Here it is a toy example: mydata <- data.frame(ID=1:5, ZA_1=1:5, ZA_2=5:1,BB_1=rep(3,5),BB_2=rep(6,5),CC_7=6:2) ID ZA_1 ZA_2 BB_1 BB_2 CC_7 1 1 5 3 6 6 2 2 4 3 6 5 3 3 3 3 6 4 4 4 2 3 6 3 5 5 1 3 6 2 There are some variables that will remain as is (here only ID) and some that will be transformed to long format (here all other variables, all ending with _1, _2 or _7) In order to transform it to long format I'm using data.table melt

SVG Transformations in JavaScript

不羁岁月 提交于 2019-12-29 06:20:32
问题 SVG Transformations can be done through JavaScript by settings their corresponding attributes setAttribute("transform", "translate(x,y)") but should also be possible through pure JavaScript. elem.transform.baseVal.getItem(0).setTranslate(x, y); elem.transform.baseVal.getItem(0).setRotate(x, y); These two should work for translation and rotation, but how about skewing, scaling and matrix? elem.transform.baseVal.getItem(0).setMatrix() exists, but as far as I can tell, it doesn't excepts any

XSLT, XML: How to disentangle grouped blocks into a flat hierarchy?

亡梦爱人 提交于 2019-12-25 12:02:12
问题 I have the following XML with some Nested elements. I need please help for converting this XML to a flat hierarchy. You may would like to take a look at this question as well: XSLT, XML: Grouping by attribute value Thanks in advance for your support. Thomas Original XML: <transaction> <records type="1" > <record type="1" > <field number="1" > <item >223</item> </field> </record> </records> <records type="14" > <record type="14" > <field number="1" > <item >777</item> </field> </record>