cursor

Android SQLite CursorWindowAllocationException crash

こ雲淡風輕ζ 提交于 2019-12-10 17:17:40
问题 I have a situation where my program crashes when I make a number of cursor.moveToNext() requests. The error message reads: android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed. # Open Cursors=773 (# cursors opened by this proc=773) at android.database.CursorWindow.<init>(CursorWindow.java:112) at android.database.CursorWindow.<init>(CursorWindow.java:100) at android.database.AbstractWindowedCursor.clearOrCreateWindow(AbstractWindowedCursor.java:198) at

Get size of mouse cursor in javascript

て烟熏妆下的殇ゞ 提交于 2019-12-10 17:00:40
问题 I need to determine the width and height of the current mouse cursor used on our webpage. I need to show a div right under the cursor, and possibly to the right of it. So I need to determine the offsets of my div from the exact pointer location, so the cursor do not cover up the div. The mechanism will be used in intranet system, so it can be firefox-only solution. Unfortunatelly some people here use weird cursors, anyway, big ones, so I cannot just hardcode eg, 16px right, 16px top offsets.

What cursors are available through Cursor.getSystemCustomCursor?

拟墨画扇 提交于 2019-12-10 16:56:35
问题 java.awt.Cursor has a method getSystemCustomCursor(String name). The documentation there gives only one example of a name: "Invalid.16x16". That doesn't seem to work, but "Invalid.32x32" does. Through googling, I've found one other example of a useful working name: "MoveDrop.32x32". This method seems like it could be useful. For example, there is no predefined "working in background" (mixed arrow/hourglass) cursor but perhaps it's available through this method. Does anyone know what cursor

Way to obtain the word cursor is on, in WPF RichTextBox Control

一笑奈何 提交于 2019-12-10 16:13:32
问题 I would like to know how I can get the word that current cursor is on, in WPF RichTextBox. I am aware that RichTextBox has Selection Property. However, this only gives me the text that is highlighted in the RichTextBox. Instead I would like to know the word the cursor is on even if the whole word is not highlighted. Any tips are appreciated. Thank you very much. 回答1: Attach this function to an arbitrary RichTextBox, now called testRTB, and see Output window for results: private void testRTB

Printing Oracle Sys_refcursor in Oracle SQL Developer 1.5

a 夏天 提交于 2019-12-10 15:57:50
问题 I am trying to execute the procedure which returns a sys_refcursor as output. The procedure is PROCEDURE GET_EMPLOYEEs(P_ID in NUMBER, P_OUT_CURSOR OUT SYS_REFCURSOR); I wrote the below anonymous block in SQL Developer 1.5 and its executing fine,but when I try to print the cursor, I am getting an error. The cursor returns emp_name,salary and other columns. set serveroutput on; declare result sys_refcursor; begin emp.emp360_utils.GET_EMPLOYEEs(222334,result); dbms_output.put_line(result); //

A cursor with the name 'cursor_name' does not exist

走远了吗. 提交于 2019-12-10 14:54:39
问题 I have a code the uses nested cursors. When I parse it, SQL studio tells me "Command(s) completed successfully," but whenever I execute, I get a bunch of repeated "A cursor with the name 'cursor_stats' does not exist." The error message displays for every line cursor_stats is mentioned in, then repeats many times. Any idea what my problem is? DECLARE @dc_grp AS VARCHAR(50) DECLARE @reqt_id AS INT DECLARE cursor_pairs CURSOR FOR SELECT DISTINCT dc.dc_grp, dcx.reqt_id FROM DC_GRP dc INNER JOIN

How to get current type of mouse cursor in Mac OS X?

狂风中的少年 提交于 2019-12-10 14:45:00
问题 How can I get the current type of mouse cursor on screen? (Not only on my app window, globally.) Or is it at least possible to detect whether the default cursor is currently displayed? Either Carbon or Cocoa is OK – or even other working APIs, preferably the official ones. This is what I have tried: NSCursor *sysCursor = [NSCursor currentSystemCursor]; if (sysCursor == nil) { NSLog(@"nil"); } if ([sysCursor isEqual: [NSCursor arrowCursor]] || [sysCursor isEqual: [NSCursor contextualMenuCursor

Select all text in editable JComboBox and set cursor position

心不动则不痛 提交于 2019-12-10 14:35:42
问题 public class CursorAtStartFocusListener extends FocusAdapter { @Override public void focusGained(java.awt.event.FocusEvent evt) { Object source = evt.getSource(); if (source instanceof JTextComponent) { JTextComponent comp = (JTextComponent) source; comp.setCaretPosition(0); comp.selectAll(); } } } jComboBox.getEditor().getEditorComponent().addFocusListener(new CursorAtStartFocusListener()); As you see from code above I want to select all text in editable JComboBox and set cursor position to

How to close cursor in MongoKit

大城市里の小女人 提交于 2019-12-10 13:34:53
问题 I'm using MongoKit to perform iteration over a huge amount of data. During this process my cursor becomes invalid, and I'm getting OperationFailure: cursor id '369397057360964334' not valid at server I've read in mailing lists that I can pass parameter timeout=False to .find() method, but PyMongo FAQ says that I vave to take care of closing cursor myself. But I didn't find methods in MongoKit for that. Do I need to close cursor by hand, and if yes - how can I do it? 回答1: You'll have to close

Error: Cursor' object has no attribute '_last_executed

寵の児 提交于 2019-12-10 12:36:48
问题 I have this cursor cursor.execute("SELECT price FROM Items WHERE itemID = ( SELECT item_id FROM Purchases WHERE purchaseID = %d AND customer_id = %d)", [self.purchaseID, self.customer]) I get this error 'Cursor' object has no attribute '_last_executed' But when I try this: cursor.execute("SELECT price FROM Items WHERE itemID = ( SELECT item_id FROM Purchases WHERE purchaseID = 1 AND customer_id = 1)", ) there is no error. How do I fix this? 回答1: I encountered this problem too. I changed the