cursor

ContentProvider和Uri详解

不打扰是莪最后的温柔 提交于 2019-12-04 04:33:14
问题引出: "/getScrollData" 的使用, public static final Uri INBOX_CONTENT_URI_SCROLLDATA = Uri .parse("content://" + SMS_CONFIG_AUTHORITY + "/" + SMS_INBOX_TABLE_NAME + "/getScrollData"); Cursor cursor = cr.query( SystemSMSInboxConfig.INBOX_CONTENT_URI_SCROLLDATA, null, null, new String[] { String.valueOf(start), String.valueOf(end) }, SystemSMSInboxConfig._ID + " desc "); 这个查询是查询整张表, 还是只查询剩余ID的一张表。 看provider实现, case TYPE_SYSTEM_EVENT_LOG_LIMIT: return db.rawQuery("select * from " + SystemSMSInboxConfig.SMS_INBOX_TABLE_NAME + " order by " + sortOrder + " limit ?,? ", selectionArgs); 结论是: 使用了ID,

DataReader cursor rewind

ぃ、小莉子 提交于 2019-12-04 04:10:10
问题 How do I can rewind a cursor of a DataReader to the beginning? With one DataReader result I need to run two while loop, but those have to be from beginning. They are two iterations in one result set running a query once. Example: dr = command.ExecuteReader(cmd); while (dr.Read()) { // do some... } // rewind cursor here while (dr.Read()) { // do another things... } I've looked into the DataReader docs and I've found nothing, so if it can't be possible with DataReader, I may change the class

CSS Cursors are not working in WebKit browsers

久未见 提交于 2019-12-04 04:07:56
问题 I am having trouble with cursors not being pulled through in WebKit browsers. Surprsingly IE and Opera work as I expect them to. Here's the CSS .olControlDrawFeatureActive { cursor: url(<DOMAIN>/common/images/cursors/draw.png), crosshair, default; } It quite simply changes the cursor to either the Draw png or, if it doesn't accept custom cursors or PNGs (like IE or Opera) then it should default to the crosshair. Works fine in IE and Opera, it goes to the crosshair as I want it to, FireFox,

How to make a T-SQL Cursor faster?

拥有回忆 提交于 2019-12-04 03:34:23
Hey, I Have a cursor in stored procedure under SQL Server 2000 (not possible to update right now) that updates all of table but it usually takes few minutes to complete. I need to make it faster. Here's example table filtered by an arbitrary product id; Example table http://img231.imageshack.us/img231/9464/75187992.jpg Whereas GDEPO:Entry depot, CDEPO:Exit depot,Adet: quantity,E_CIKAN quantity that's used. Record explainations: 1: 20 unit enters depot 01, 2: 10 unit leaves 01. 3: 5 Unit leaves 01 (E_CIKAN for 1st record will be 15 now) 4: 10 more unit enters depot 01. 5: 3 unit leaves 01 from

STF框架之minicap工具

天大地大妈咪最大 提交于 2019-12-04 03:04:33
stf minicap minicap介绍 从 WEB 端批量移动设备管理控制工具 STF 的环境搭建和运行 文章了解到STF这个工具,然后试用了一下。最近在做一个测试工具,发现Android原生的截图工具截图非常缓慢,然后想起了stf工具中截图非常快,甚至连执行monkey的动作都能在web端查看,这就很爽了,所以在github上提了一个 Issue ,询问这个是如何实现的,很快得到答复,stf自己写了一个工具叫minicap用来替代原生的screencap,这个工具是stf框架的依赖工具。 minicap使用 minicap工具是用NDK开发的,属于Android的底层开发,该工具分为两个部分,一个是动态连接库.so文件,一个是minicap可执行文件。但不是通用的,因为CPU架构的不同分为不同的版本文件,STF提供的minicap文件根据CPU 的ABI分为如下4种: . ├── bin │ ├── arm64-v8a │ │ ├── minicap │ │ └── minicap-nopie │ ├── armeabi-v7a │ │ ├── minicap │ │ └── minicap-nopie │ ├── x86 │ │ ├── minicap │ │ └── minicap-nopie │ └── x86_64 │ ├── minicap │ └──

JavaScript Cursor Change (and change back again)

时光毁灭记忆、已成空白 提交于 2019-12-04 02:47:15
问题 I have this page that does some funky database stuff that takes a couple seconds to process, and in the meantime I'd like to set a "wait" cursor so the user doesn't flip out and keep clicking the button. I've looked at the document.body.style.cursor = "wait" thing, the problem with this is that it only works when the mouse is over the body of the page (i.e. still shows normal pointer if it's over a button). How can I set it so that no matter where the mouse is on the page, it shows a wait

SQL: compare two table record by record

爷,独闯天下 提交于 2019-12-04 02:39:01
问题 I want to compare two tables recordby record. I have two cursor for each table. The code looks like this Declare Cursor c1 for SELECT * from Table1 OPEN c1 While @@Fetch_status=0 Begin Declare Cursor c2 for SELECT * from Table2 OPEN c2 WHILE @@Fetch_Status=0 Begin /*Comparison happens here*/ END END When fecthing, must I specify which cursor I am fetching and how do I do that? EDIT For each record in Table1 I want to Search Table2 for that record based on the primary key. When it is found, I

startManagingCursor() in a service?

假装没事ソ 提交于 2019-12-04 02:31:30
问题 Is there a way to use the startManagingCursor() within a service instead of an activity, with the same results (as shown here)? More specifically, i would like to manage a given Cursor's lifecycle based on a service's lifecycle. For example, when the service is destroyed, it will automatically call deactivate() on the given Cursor. Also, when the service is created/starts again, it will call requery() method. Is it feasible by using an other appropriate method implemented in the Service.class

HTML5 Drag and Drop (DnD): changing cursor

跟風遠走 提交于 2019-12-04 01:51:58
While dragging an element over the browser client area in HTML5, how can I change the cursor to any cursor that I want? So far, I've only been able to display the default cursor while dragging (except for the none cursor wherever dropping is not supported). I'm not talking about any of the following: using event.dataTransfer.setDragImage() to display an image besides the cursor using event.dataTransfer.dropEffect to display a copy or a link symbol besides the cursor, or to change the cursor to the none symbol in Firefox, using event.dataTransfer.mozCursor , since that can only perform the

How to use server side cursors with psycopg2

梦想的初衷 提交于 2019-12-04 01:17:10
I have a table with 4million rows and I use psycopg2 to execture a: SELECT * FROM ..WHERE query I haven't heard before of the server side cursor and I am reading its a good practice when you expect lots of results. I find the documentation a bit limited and I have some basic questions. First I declare the server-side cursor as: cur = conn.cursor('cursor-name') then I execute the query as: cur.itersize = 10000 sqlstr = "SELECT clmn1, clmn2 FROM public.table WHERE clmn1 LIKE 'At%'" cur.execute(sqlstr) My question is: What do I do now? How do I get the results? Do I iterate through the rows as: