使用由WorkMail事件调用的AWS Lambda调用外部Web Api REST端点(Call an external Web Api REST endpoint using AWS Lambda invoked by a WorkMail event)
我们正在使用许多AWS服务,并希望实施WorkMail来管理电子邮件帐户并调用各种Web Api端点。 我的高级要求如下。 这可能吗?
创建电子邮件地址(用户帐户)*完成
收到电子邮件地址(或别名)的电子邮件时,将带有附件的电子邮件复制到与该用户帐户/电子邮件地址关联的S3 Bucket文件夹(将通过外部休息端点检索S3文件夹名称)ex : https://54.166 。 。 /api/accounts/getS3Folder/test@test.com
触发Lambda操作,该操作调用将处理已保存电子邮件的外部Web Api REST端点
We are using a number of AWS services and would like to implement WorkMail to manage email accounts and invoke various Web Api endpoints. My high-level requirements are below. Is this possible?
Create email addresses (user accounts) * Done
When email is received for an email address (or alias), copy the email, with attachments, to a S3 Bucket folder that is associated with that user account / email address (the S3 folder name will be retrieved via an external rest endpoint) ex: https://54.166../api/accounts/getS3Folder/test@test.com
Trigger a Lambda action that calls an external Web Api REST endpoint that will process the saved email message
原文:https://stackoverflow.com/questions/41808530
最满意答案
这取决于您的角度是指定顺时针还是逆时针方向的旋转。 如果您正朝着坦克炮塔的方向看,如果您需要顺时针旋转炮塔以尽快指向它,则在右侧有一个物体,如果您需要逆时针旋转,则在左侧。
显然,你可以在相反的方向旋转以“走很远”:如果一个物体向右10度,那么你可以顺时针旋转10度或逆时针旋转350度指向它。 但是,假设沿顺时针方向指定角度,我们只考虑短路:
// returns 1 if otherAngle is to the right of sourceAngle, // 0 if the angles are identical // -1 if otherAngle is to the left of sourceAngle int compareAngles(float sourceAngle, float otherAngle) { // sourceAngle and otherAngle should be in the range -180 to 180 float difference = otherAngle - sourceAngle; if(difference < -180.0f) difference += 360.0f; if(difference > 180.0f) difference -= 360.0f; if(difference > 0.0f) return 1; if(difference < 0.0f) return -1; return 0; }
减去角度后,结果可以在-360(-180减180)到360(180减-180)的范围内。 您可以通过加或减360度将它们带到-180到180的范围内,然后比较为零并返回结果。
绝对值在180和360之间的角度对应于“长途”旋转,并且加或减360将它们转换为“短路”。 例如顺时针-350度,长距离(即逆时针350度)加360等于顺时针方向10度。
如果以逆时针方向指定角度,则返回值的含义相反(1表示左,-1表示右)
It depends on whether your angles specify a rotation in the clockwise or anti-clockwise direction. If you are looking in the direction of the tank turret, then an object is on the right if you need to rotate the turret clockwise to point at it as quickly as possible, and on the left if you need to rotate anti-clockwise.
Obviously, you can rotate in the opposite direction to go "the long way around": if an object is 10 degrees to the right then you can either rotate 10 degrees clockwise or 350 degrees anti-clockwise to point at it. But let's consider only the short way around, assuming that angles are specified in a clockwise direction:
// returns 1 if otherAngle is to the right of sourceAngle, // 0 if the angles are identical // -1 if otherAngle is to the left of sourceAngle int compareAngles(float sourceAngle, float otherAngle) { // sourceAngle and otherAngle should be in the range -180 to 180 float difference = otherAngle - sourceAngle; if(difference < -180.0f) difference += 360.0f; if(difference > 180.0f) difference -= 360.0f; if(difference > 0.0f) return 1; if(difference < 0.0f) return -1; return 0; }
After subtracting the angles, the result can be in the range of -360 (-180 minus 180) to 360 (180 minus -180). You can bring them into the range of -180 to 180 by adding or subtracting 360 degrees, then compare to zero and return the result.
Angles with an absolute value between 180 and 360 correspond to the "long way around" rotations, and adding or subtracting 360 converts them to the "short way around". For example -350 degrees clockwise the long way around (i.e. 350 degrees anti-clockwise) plus 360 equates to 10 degrees clockwise the short way around.
If the angles are specified in an anti-clockwise direction, then the meaning of the return value is reversed (1 means left, -1 means right)
相关问答
更多-
不知何故,DrawArc根据具有规则半径的弧计算角度/绘图,因此需要较长的一侧。 我无法找到解释为什么它以这种方式工作,但也许这个链接有帮助。 var radiusX = rect.Width/2; var radiusY = rect.Height/2; // Mid point var mid = new Point(rect.Left + (rect.Width/2), rect.Top + (rect.Height/2)); ...
-
private void FixedUpdate() { RaycastHit hit; Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit, 3000)) { Vector3 mousePos = hit.point; Debug.DrawLine(transform.position, hit.p ...
-
测试点内角度(Test if point inside angle)[2021-08-11]
以下讨论旨在检测阴影区域内的点。 有两种情况需要考虑: 角度AOB小于平面,那么点P必须在AO的右边和OB的右边(两个半平面的交点 ), 角度AOB大于平面,则点P必须位于AO的右侧或 OB的右侧(两个半平面的连接)。 完整的布尔表达式是 AO | B. (AO | P.OB | P)+¬AO| B. (AO | P + OB | P), 其中XY | Z表示Z位于XY的右侧,相当于“XYZ是顺时针”并且由三角形区域的符号确定。 我不认为可以使表达式更简单,除非你有几个P用于相同的AOB。 The disc ... -
划分一个角度(Div at an angle)[2022-03-26]
你可以用一个简单的linear-gradient()来做到这一点,它比clip-path有更大的支持: .top-div { width: 310px; height: 25px; background: linear-gradient(45deg, transparent 10%, #A52432 10.01%); } You can do it with a simple linear-gradient() which has ... -
矢量的角度(Angle from vector)[2022-11-03]
我不确定你的角度是什么意思,因为你只在你的例子中给出了一个向量。 但是,给定两个向量,您可以找到它们之间的角度,如下所示: 给定向量a和b ,对它们进行归一化。 然后,点( a , b )= cos(θ),其中θ是两个矢量之间的角度。 使用arccos找到θ。 I'm not sure what you mean by angle, since you only give one vector in your example. But, given two vectors, you can find the ... -
角度范围的问题(Problem with bounds of an angle)[2021-09-28]
你可以...... lowerLimit = (targetAngle % 360) + 359; //360 - 1; upperLimit = (targetAngle % 360) + 361; //360 + 1; if (((transform.eulerAngles.z + 360) % 360) > lowerLimit && ((transform.eulerAngles.z + 360) % 360) < upperLimit) 这会使支票从零开始移动,您不必处理正/负检查。 编辑 ... -
FFmpeg - 以角度旋转(FFmpeg - Rotating at angle)[2022-01-04]
在表达中, rotate=A*sin(2*PI/T*t) A和T不是文字。 用户应该用数字代替它们,以弧度表示幅度,以秒为单位表示周期。 例如 rotate=2*sin(2*PI/3*t) In the expression, rotate=A*sin(2*PI/T*t) A and T aren't literals. The user is meant to replace them with numerals, representing the amplitude in radians and ... -
这取决于您的角度是指定顺时针还是逆时针方向的旋转。 如果您正朝着坦克炮塔的方向看,如果您需要顺时针旋转炮塔以尽快指向它,则在右侧有一个物体,如果您需要逆时针旋转,则在左侧。 显然,你可以在相反的方向旋转以“走很远”:如果一个物体向右10度,那么你可以顺时针旋转10度或逆时针旋转350度指向它。 但是,假设沿顺时针方向指定角度,我们只考虑短路: // returns 1 if otherAngle is to the right of sourceAngle, // 0 if the angl ...
-
如何根据角度确定绝对顶部和左侧位置?(How to determine the absolute top and left position according to an angle? Javascript)[2022-06-23]
如果我正确理解你的问题,我认为你最好使用css“transform”属性,它允许你旋转或翻译(也就是移动)一个元素。 这个的语法是 .box { transform: rotate(50deg); } 但为了兼容性,您还应该总是添加 -moz-transform: rotate(50deg); transform属性按指示移动元素,而不会影响其周围的任何其他元素。 转换将从元素已经由“顶部”和“左”属性定位的任何位置生效。 您还可以使用此属性来翻译或移动元素 transform: translate ... -
我认为scrollViewDidScroll对于你想要实现的目标来说太迟了。 也许尝试将UIScrollView的directionalLockEnabled属性设置为YES 。 (不确定这是否有帮助...但是玩它) 并且/或者实现UIScrollViewDelegate方法- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView并且在这个方法实现中获取一个指向传入的UIScrollView的panGestureRecognizer (只读 ...