transform

c#: transform a string targeted for the unix shell use for the windows command prompt

谁都会走 提交于 2019-12-24 08:22:45
问题 Here is a sample string I got off a socket stream. \033[H\033[J\033[1;30HSUPERVISOR MAIN MENU\033[6;5H 0. Exit Exit\033[7;5H 1. Help Display help\033[8;5H 2. Control Calling lists and users\033[9;5H 3. Campaign Campaigns\033[10;5H 4. Manage If you want to see the output I expect open a unix/linux shell, type echo -e followed by a space followed by the above string in single quotes and hit Enter key. The output appears something like: SUPERVISOR MAIN MENU 0. Exit Exit 1. Help Display help 2.

antlr3 remove treenode with subtree

怎甘沉沦 提交于 2019-12-24 07:47:28
问题 i try to do some tree to tree transform with antlr3.4 It's (for this question) about boolean expressions were "AND" and "OR" are allowed to bind to n expressions. The parser stage creates something like this (OR (AND (expr1) (expr2) (expr3) (OR (AND (expr4)) (AND (expr5)) (AND (expr6)) ) ) ) Unfortunately there are AST nodes for "AND" and "OR" that bind just to one expression. (Which is useless, but hey - rules andExpr and orExpr are invoked) I tried to kick them out (mean, replace them by

Make new column which adds 30 days to date on every row R

Deadly 提交于 2019-12-24 07:36:06
问题 I have a df with two variables, names and dates. I would like to create a new column (new_dates) which takes the first date belonging to each person (each person should have just one repeated date in this column) and add 30 days to each date as the rows descend. Desired output is below. So row1 for each person holds the original date, row2 holds row1+30, row3 holds row2+30 and so on. dff names dates new_dates 1 john 2010-06-01 2010-06-01 2 john 2010-06-01 2010-07-01 3 john 2010-06-01 2010-07

get canvas mouse coordinates after transformation using ctx.getTransformation()

不打扰是莪最后的温柔 提交于 2019-12-24 06:40:32
问题 I am using the following function to get mouse coordinates on canvas after performing rotations. function getWindowToCanvas(canvas, x, y) { const ctx = canvas.getContext("2d"); var transform = ctx.getTransform(); var rect = canvas.getBoundingClientRect(); var screenX = (x - rect.left) * (canvas.width / rect.width); var screenY = (y - rect.top) * (canvas.height / rect.height); if (transform.isIdentity) { return { x: screenX, y: screenY }; } else { console.log(transform.invertSelf()); const

picture with border-radius 50% and transform(scale)

拈花ヽ惹草 提交于 2019-12-24 05:50:34
问题 I have a sqare image wich is turned into a circle by using border-radius: 50%; That works quite well so far. ;) But the next step is difficult to do: I want the image to zoom "nearer" by using transform: scale. I mean: I dont want to change the same size of the image, it should stay with the same diameter. But I want to show a small section of the image. The zooming should be activated on :hover and it should be processed during a period of 0.8s My code works perfectly in Firefox, but in

WPF: Can I get the size of a UIElement AFTER a transform is applied?

被刻印的时光 ゝ 提交于 2019-12-24 04:54:26
问题 In WPF/Silverlight, can I get the calculated value of a UIElement after a transformation is applied? (Per the comment below): I've got a stack panel and I've applied a TranformGroup to it. There are two translate and one scale transforms in this group. (warning, psuedo code ahead) groupTransform.children.add(new TranslateTransform()); groupTransform.children.add(new ScaleTransform()); groupTransform.children.add(new TranslateTransform()); containerToScale.RenderTransform = groupTransform; ...

Did -webkit-backface-visibility break today in Chrome?

孤街醉人 提交于 2019-12-24 04:02:13
问题 I'm a bit confused because my project worked yesterday but seems to no longer work correctly today. (Yes, I've checked previous versions from git.) The problem: Some divs previously hidden with -webkit-backface-visibility: hidden; magically appeared. I have isolated this issue into a fiddle: http://jsfiddle.net/Js6cg/1/ The div is visible in Chrome at 23.0.1271.64 m (wrong) but hidden in 25.0.1326.0 canary (as I expected). Can you confirm that this is indeed a bug in Chrome or am I using the

get XY of object in wpf for this situation?

巧了我就是萌 提交于 2019-12-24 03:01:28
问题 I have a Canvas with two or more objects. Now, I put these objects in a new Canvas placed in the previous Canvas . Then, I rotate it. Now, I want to know how to get the positions of the objects in the new Canvas , as though there were no new canvas. 回答1: You can use the following extension method to get the location of one UIElement with respect to another: public static class ExtensionMethods { public static Point GetRelativePosition(this UIElement element, UIElement other) { return element

get XY of object in wpf for this situation?

ⅰ亾dé卋堺 提交于 2019-12-24 03:01:09
问题 I have a Canvas with two or more objects. Now, I put these objects in a new Canvas placed in the previous Canvas . Then, I rotate it. Now, I want to know how to get the positions of the objects in the new Canvas , as though there were no new canvas. 回答1: You can use the following extension method to get the location of one UIElement with respect to another: public static class ExtensionMethods { public static Point GetRelativePosition(this UIElement element, UIElement other) { return element

Using Step function in animate to transform-rotate an element

家住魔仙堡 提交于 2019-12-24 02:32:52
问题 All, I am trying create a 'to & fro' animation using jquery animate & css transform property. I referred to this SO post on using step function in animate, however, Im not having much success. Please review & advice. Jsfiddle.net demo HTML: <ul id="a"> <li class="cAccessories" id="AccButtons"><span>blah blah..</span></li> <li class="cAccessories" id="AccRibbons"><span>blah blah..</span></li> <li class="cAccessories" id="AccLaces"><span>blah blah..</span></li> <li class="cAccessories" id=