direction

Phonegap:After build transform and perspective CSS properties are not working?

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am making an app using JQuery mobile. For swipe events i included one library.By using that i am able to use swipeleft,swiperight,swipeup and swipedown events. I have tested my app in android 4.0,4.1,4.2 and chrome browser of android 4.4.It works . CSS #joy_div { perspective: 500px; } button { margin: 10px 0 0 0; } .left, .right, .down, .up, .reset { transition: transform 0.5s ease; transform-origin: 50% 50%; } .left { transform: rotateY(-40deg); } .right { transform: rotateY(40deg); } .up { transform: rotateX(-40deg); } .down { transform:

XNA 2D vector angles - what's the correct way to calculate?

有些话、适合烂在心里 提交于 2019-12-03 06:05:02
问题 what is in XNA in 2D the standard way vector angles work ? 0 degrees points right, 90 points up, 180 left, 270 down ? What are the 'standard' implementations of float VectortoAngle(Vector2 vec) and Vector2 AngleToVector(float angle) so that VectortoAngle(AngleToVector(PI)) == PI ? 回答1: To answer your first question, 0 degrees points up, 90 degrees points right, 180 degrees points down, and 270 degrees points left. Here is a simple 2D XNA rotation tutorial to give you more information. As for

Rotate marker based on driving direction

ぃ、小莉子 提交于 2019-12-03 05:56:48
I have a marker in my Google Maps map that looks like this: When the user is driving, I want to rotate it based on his driving direction. How can I achieve this? I should probably use previous location and current location coords for calculation, but I have no idea how. If you use GPS for locating the user then the Location object you get in onLocationChanged contains the bearing . If you only have the two coordinates (e.g. you only have coordinates from network location provider), you can use Location.bearingTo() to calculate the bearing of two coordinates: Location prevLoc = ... ; Location

Why words are shuffled when I insert English words in any Arabic/Urdu/Persian text on Notepad or MS Word?

别等时光非礼了梦想. 提交于 2019-12-03 05:39:25
问题 I can write Arabic/Urdu/Persian on MS Word or Notepad just fine, but whenever I insert any English word or number, the sequence is just disturbed and seems like the all the words have been shuffled in the sentence. Look at the example below: یہ ایک مثال ہے اردو کی ... Now I inserted an English word and it became: یہ ایک مثال ہےword اردو کی ... So you can see almost all of the words have been jumbled ... what is the solution for that ? 回答1: For example: باللغة العربية “keyboard” انا أريد أن

SceneKit – Get direction of camera

好久不见. 提交于 2019-12-03 00:44:53
I need to find out which direction a camera is looking at, e.g. if it is looking towards Z+ , Z- , X+ , or X- . I've tried using eulerAngles , but the range for yaw goes 0 -> 90 -> 0 -> -90 -> 0 which means I can only detect if the camera is looking towards Z or X , not if it's looking towards the positive or negative directions of those axes. You can create an SCNNode that place it in worldFront property to get a vector with the x, y, and z direction. Another way you could do it is like how this project did it: // Credit to https://github.com/farice/ARShooter func getUserVector() ->

iPhone compass showing to a specific location

依然范特西╮ 提交于 2019-12-03 00:43:49
I am new to objective-c so I want to apologize if my question is too rubbish. I am programming a compass and yet, it is working (thanks to a tutorial). Actual position (Longitude and Lattitude) is given. Is it possible that my arrow within the compass can show me the direction to a specific location (longitude2 and lattitude2)? I have read that I have to consider the magnetic and the true heading of the iphone. Flori - (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading { double heading = newHeading.trueHeading; //in degree relative to true north double

Redis 集群 lua 实现

匿名 (未验证) 提交于 2019-12-03 00:43:02
二话不说,直接上货.多多交流哈,谢谢各路大神. . 重点就是下面这段: Object object = redisTemplate.execute(redisUpdateOrderScript, //这里有key 要像官网说的那样加个"{}",不然就报错了,这里3个key都要前缀一致 Arrays.asList(hkey, amountKey, key), //值无要求 amount.longValueExact(),price.doubleValue(),price.doubleValue()); 我自己的理解是,执行脚本和执行hget 是一样的,只是lua脚本内容由Redis执行,但发送命令的要求是一样的.所以上面3个key 都得加一样的前缀. . . . 业务逻辑是这样子的: 把20档盘口放到Redis里面 1.用有序集合(sorted set)进行自动价格排序 ZADD key 0.0354 "0.0354" 2.然后再根据价格到hash里去取值,取的val 就是这个价格的下单量 HGET key 0.0354 java 代码 加盘口 public void addOrderForLua(BeforeMatchDTO model) { //缓存失效 redisService.remove(RedisService.getPositionKey(model

2018阿里笔试机器人寻路问题

匿名 (未验证) 提交于 2019-12-03 00:38:01
1 在自动化仓库中有若干障碍物,机器人需要从起点出发绕过这些障碍物到终点搬取货柜,现试求机器人从起点运动到终点用时最短的路径。 已知机器人只能沿着东西方向或南北方向移动,移动的速度为1m/s,机器人每转向90度需要花费1s。 输入: 第一行:起点位置坐标及机器人朝向,如: 1 0 EAST 代表机器人初始坐标为 x = 1,y=0,机器人面朝东方 第二行:终点位置坐标及机器人朝向,如: 0 2 WEST 代表机器人需要移动至点 x = 0,y=2,且面朝西方 接下来输入的是地图: 首先是两个数字 r , c ,代表有地图数据有多少行与多少列,如: 2 3 0 1 0 0 0 0 其中,左上角为坐标原点,从左向右为 x 轴增大的方向是东方,从上到下为 y 轴增大的方向是南方。 地图中 1 代表有障碍物,机器人不能前往, 0 代表无障碍物机器人可以前往 地图中相邻的每两个点之间的距离为 1m 。 0 <= l , w <= 128 输出: 机器人从起点移动到终点所需要的最短秒数,当不可达时输出 65535 思路: bfs+优先队列 // author : L // 以下代码为:bfs+前缀数组记录路径+优先队列记录当前最优。只需要更改部分即可达到题目要求。 // 如果有读者不会改的,可以在评论留言。 // bfs编写并没有考虑,走不到的情况,record记录了当前所经过的路径。

图像边界扩展及去除(普通方法)

匿名 (未验证) 提交于 2019-12-03 00:27:02
padarray 功能:填充图像或填充数组。 用法:B = padarray(A,padsize,padval,direction) A为输入图像,B为填充后的图像,padsize给出了给出了填充的行数和列数,通常用[r c]来表示。padval和direction分别表示填充方法和方向。它们的具体值和描述如下:   padval:’symmetric’表示图像大小通过围绕边界进行镜像反射来扩展; ‘replicate’表示图像大小通过复制外边界中的值来扩展; ‘circular’图像大小通过将图像看成是一个二维周期函数的一个周期来进行扩展。 direction:’pre’表示在每一维的第一个元素前填充; ‘post’表示在每一维的最后一个元素后填充; ‘both’表示在每一维的第一个元素前和最后一个元素后填充,此项为默认值。 若参量中不包括direction,则默认值为’both’。若参量中不包含padval,则默认用零来填充。若参量中不包括任何参数,则默认填充为零且方向为’both’。在计算结束时,图像会被修剪成原始大小。 举例: A = [1 2; 3 4]; B = padarray(A,[3 2],’replicate’,’post’) 方法一: 直接取中间的行和列,去除别界来取。 公式如下: a=imgn(w+1:m-w,w+1:n-w) m和n分别表示扩展之后行和列。

20行代码实现2048

匿名 (未验证) 提交于 2019-12-03 00:22:01
Python 二十行代码 实现2048小游戏,代码如下: from random import choice def combline (ls) : ls = [i for i in ls if i > 0 ] for i in range(len(ls)- 1 ): if ls[i] == ls[i+ 1 ]: ls[i], ls[i+ 1 ] = ls[i]* 2 , 0 break else : return ls + [ 0 ] * ( 4 - len(ls)) return combline(ls) left = lambda matric:[combline(matric[i]) for i in range( 4 )] matric=[[ 0 for j in range( 4 )] for i in range( 4 )] directions = { 'a' : left, 'd' : lambda matric:[list(reversed(i)) for i in left([list(reversed(i)) for i in matric])], 'w' : lambda matric:[[left([[matric[j][i] for j in range( 4 )] for i in range( 4 )])[j][i] for j in range(