position

Android canvas drawText y-position of text

こ雲淡風輕ζ 提交于 2019-12-03 04:25:48
I'm using a Canvas to create a Drawable with some background and some text. The drawable is used as a compound drawable inside an EditText. The text is drawn via drawText() on the canvas, but I do have an issue with the y-position of the drawn text in some cases. In those cases parts of some characters are cut off (see image links). Characters without positioning issue: http://i50.tinypic.com/zkpu1l.jpg Characters with positioning issue, text contains 'g', 'j', 'q', etc.: http://i45.tinypic.com/vrqxja.jpg You can find a code snippet to reproduce the issue below. Does any expert know how to

jQuery UI dialog positioning : adjust position top by 20px -

独自空忆成欢 提交于 2019-12-03 04:24:08
I have a dialog that gets filled by an ajax call. I want to limit the max-height of dialog and also allow it to be scroll-able if this max-height is exceeded. The code below does exactly what I want. The catch is I can not move the top of the dialog from the top position . I can move it left and right. I can't use center either as the dialog is displayed in a large scroll-able window. If I use firebug I can adjust the top property but cannot find where it is being set to zero. $("#your-dialog-id").dialog({ open: function(event, ui) { $(this).css({'max-height': 500, 'overflow-y': 'auto'}); },

Fixed Position div Vertical Only

放肆的年华 提交于 2019-12-03 04:04:14
I have a current web build with a right sidebar that is a fixed position. I have tried to positioning from the right but don't want it overlapping other divs content. What I am looking for is to have the content scrollable horizontally to the right when it is out of the viewport window. Any help would be greatly appreciated. similarly to this: http://demo.rickyh.co.uk/css-position-x-and-position-y/ however I can not get this working. This has been solved by alternative method. Thanks for those who actually considered helping. Keep the fixed div. And have the following javascript code which

无法解析的Ajax,selenium+chromedriver实战爬取

大憨熊 提交于 2019-12-03 03:55:04
对于有规律的Ajax请求,我们可以分析它的特点,从而抓取一个又一个的Ajax去获取请求,但,有些网站为了反爬,它的Ajax是没有规律的,我们举个例子,拉勾网 我们进入拉勾网,搜索python,检查,切换到network,过滤请求,这里只要Ajax请求,下滑到底部,点击下一页: 图中标有1,2的两个请求,就是包含职位信息的Ajax请求,分别是第一页的和第二页的,我们可以发现,两个Request URL是一样的,也就是说,这里并没有参数让我们区分不同的Ajax请求有什么区别,而且,如果你访问这个Ajax,即使是浏览器也会这样: 更不用说爬虫了。 那针对这样的网站,我们怎么能获取大量数据呢。 我们这次的目的是,爬取详细信息,多页。我们需要,selenium,chromedriver,lxml,MongoDB 先上代码 from selenium import webdriver from lxml import etree import time from pymongo import MongoClient client = MongoClient() db = client['LaGou'] collection = db['lagou_position'] #写入chromedriver路径 driver_path = r"D:\pythontools\chromedriver

Mouse position within HTML 5 Canvas

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am writing a simple drawing app to get an understanding of the HTML 5 canvas. The problem is that I simply can't seem to get the correct mouse position within the canvas element.I've looked at the other questions on stackoverflow like the one here getting mouse position with javascript within canvas that address this issue but their solutions don't seem to help me. Here is my code: <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <script src="https:/

spring security oauth2 disable jsessionid based session

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I dont have reputation to comment, otherwise this post describes exactly the same issue. I have successfully implemented spring security oauth2 2.0.5 in a spring 4 application. All works fine, i can generate tokens and api requests are properly authenticated. But the problem is that once an api is authenticated with an access token inside a browser based application, the subsequent calls dont need the access token because -it seems spring security relies on the sessionid instead to identify and authenticate the user. - the calls seem to

Storyboard - Position is ambiguous for “Round Style Text Field” Warning

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: https://stackoverflow.com/a/16251810/2589276 I solved the problem above but got a new problem when I did the steps I was instructed to. Now I get a warning saying: Position is ambiguous for "Round Style Text Field" I tried setting fixed constraint for width also, but did not fix this warning. Any ideas? Are there any other information I should give for this problem? This screen shot when I do add constraint to x, leading space constraint (for x) and vertical space constraint from the bottom. I just want to set constraint for the Y and not

Android Adapter “java.lang.IndexOutOfBoundsException: Invalid index 4, size is 4”

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have problem with deleting item's from ArrayList and synchronising Adapter . I have my RecyclerView adapter with some ArrayList inside it called items . I download some list from the server and dispaly inside it. Whenever I click on some of list items I would like to delete it from server, from local ArrayList and notify the adapter about it. The problem is that when I delete everything from down to up from the list everything is ok, but when f.e. I delete 1st element from the list and then randomly some of the elements it deletes element

how I can get current time when use playbackRate.value in Web Audio API

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to know the current time of a source that is playing, but I can't use context.currentTime because when I change the source.playbackRate.value the speed rate of the context don't change too, so I can't determinate where is the current position of sound. There isn't another way? Edit, some code: I use this functions to load and play an mp3 from the network function loadSoundFile(url) { source = null; var request = new XMLHttpRequest(); request.open('GET', url, true); request.responseType = 'arraybuffer'; request.onload = function(e) {

Cube Flip animation for Fragments on Android

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to implement a basic 3d cube and rotate it by 90degrees either horizontally or vertically on Touch. What i want to implement is something similar to what is shown in the image below. I've achieved this using ViewPager 's ViewTransformer But I am not happy with the result. The animation is not very smooth, and i cannot flip it, i have to drag my finger across the entire widht of the screen to rotate the cube. I want to just flip it, but am not able to achieve it. I've used BTGridPager-Android to achieve the above. But as mentioned, its