transformation

Perspective transformation with GD

我是研究僧i 提交于 2019-12-12 08:48:54
问题 How can I apply a perspective transformation on an image using only the PHP GD library? I don't want to use a function someone else made I want to UNDERSTAND what's going on 回答1: I honestly don't know how to describe mathematically a perspective distortion. You could try searching the literature for that (e.g. Google Scholar). See also in the OpenGL documentation, glFrustum. EDIT : Interestingly, starting with version 8, Mathematica has a ImagePerspectiveTransformation. In the relevant part,

NullPointerException - Drawable.setBounds - probably due to fragment transitions

雨燕双飞 提交于 2019-12-12 08:47:19
问题 I'm getting following error and I don't know why (this error is VERY RARE and not reproducable for me): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.setBounds(int, int, int, int)' on a null object reference at android.widget.ImageView.animateTransform(ImageView.java:1126) at android.transition.ChangeImageTransform$2.set(ChangeImageTransform.java:64) at android.transition.ChangeImageTransform$2.set(ChangeImageTransform.java:61) at

How to parse nested tags using XSLT in sequence?

血红的双手。 提交于 2019-12-12 07:22:52
问题 I have below scenario for my XML. <content> <para>text-1 <emphasis type="bold">text-2</emphasis> text-3</para> </content> I want to parse it like below <content> <p>text-1 <b>text-2</b> text-3</p> </content> I have created my XSLT as below <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" encoding="ISO-8859-1" indent="no"/> <xsl:template name="para"> <p> <xsl:value-of select="text()" disable-output-escaping="yes"/> <xsl:for-each select=

How to add element to XML via XSL

坚强是说给别人听的谎言 提交于 2019-12-12 06:52:46
问题 I have created a simple XSL file which performs transformation on XML file. Now the transformation returns True or False (depending on the result of the test) if passed = true, fail = false. Now i want to add extra tag into my XML with this values I have seen this post and tried to adapt this into my problem however it didn't quite work. My xml file initially looks like this <?xml version="1.0" encoding="iso-8859-1"?> <message> <unique-id>unique-id</unique-id> <payload> <Envelope xmlns:xsi=

Groovy Script to read and transform xml

末鹿安然 提交于 2019-12-12 04:25:36
问题 Need help on Groovy Script. I have the following input xml where this xml will be dynamically populated and we do not have any clues on how many nodes will be populated under RecordDetails Node. Input: <?xml version="1.0" encoding="UTF-8"?> <Record> <XYZ> <Header> <Code>12345</Code> </Header> <Details> <RecID>1</RecID> <RecordDetail> <Name>ABC</Name> <Email>abc@in.com</Email> <Address>123,acdf</Address> </RecordDetail> </Details> <Details> <RecID>2</RecID> <RecordDetail> <Name>ABC</Name>

XSL for each for different nodes in XML file

徘徊边缘 提交于 2019-12-12 04:21:58
问题 This is my XML: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="coursestyle.xsl"?> <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <ns0:FindCoursesForOffenderResponse xmlns:ns0="http://H.FindCoursesForOffenderResponse"> <ns0:SiteList> <ns0:SiteEntity> <ns0:SiteId>10</ns0:SiteId> <ns0:SiteName>Ramada Watford</ns0:SiteName> </ns0:SiteEntity> <ns0:SiteEntity> <ns0:SiteId>20</ns0:SiteId> <ns0:SiteName>Ramada Jarvis (Comet) Hotel</ns0

How would one do two day data binding in React, having an input value A update when B is and vice versa, while keeping history of previous transforms?

浪子不回头ぞ 提交于 2019-12-12 03:24:34
问题 The following code for data binding: var Text = React.createClass({ getInitialState: function(){ return { pageName: this.props.pageName, url: this.props.pageName, } }, handleChange: function(event){ var pageName = event.target.value; var url = event.target.value.toLowerCase(); this.setState({ pageName: pageName, url: url, }); }, render: function() { return ( <div> pageName: <input ref="pageName" onChange={this.handleChange} value={this.state.pageName}/><br/> url: <input ref="url" onChange=

Scale, Position & Rotate Parent object to make child object take up entire stage

北战南征 提交于 2019-12-12 02:48:37
问题 Using the first photo below, let's say: The red outline is the stage bounds The gray box is a Sprite on the stage. The green box is a child of the gray box and has a rotation set. both display object are anchored at the top-left corner (0,0). I'd like to rotate, scale, and position the gray box, so the green box fills the stage bounds (the green box and stage have the same aspect ratio). I can negate the rotation easily enough parent.rotation = -child.rotation But the scale and position are

Transformation XSL/XML in Android

帅比萌擦擦* 提交于 2019-12-12 02:46:02
问题 The XSLTProcessor doesn't work in WebKit (Android): the include element in XSL are not managed. So, I use Saxon to make a transformation XSL/XML. The problem is it so slow: the transformation last about one minute. Have you an idea to make the transformation faster? Thank you 回答1: Large stylesheets can be a bit of a performance problem with Saxon-CE because of the need to fetch all the modules from the server and compile them before anything can be executed. Also it's much harder to get good

Optimize box-cox transform, function cannot be evaluated at initial parameters

吃可爱长大的小学妹 提交于 2019-12-11 18:14:04
问题 I'm trying to make an automatic box-cox transform (which should be generally useful to folks norming data), but having trouble phrasing my optimization in a way that R's optim is OK with. It generally works, but I'm unclear on what's causing it to fail on variables with extreme skew. The idea is to choose the parameter of Lambda in the box-cox transform that minimizes the absolute value of the skewness of the dataset. library(car) library(moments) xskew <- function(data,par){ abs(skewness