cursor

Proper implementation of changing ListView data with CursorAdapter

I have a ListView populated via a CursorAdapter. I give my user the ability to alter the data in the list. For example, the user can mark a row as being unread (the data are messages). Suppose my user marked a row unread. Would a proper implementation mark the row in the database as read and then requery the Cursor? ...

JQuery A-Tools inserts at the end of a textarea when it doesn't have focus

I'm trying to use A-Tools to insert something at the caret position in a TEXTAREA. However, when the TEXTAREA doesn't have focus, the stuff gets thrown at the end (I'd like it to be at the beginning). However, I don't seem to be able to figure out when that focus isn't there to insert at the beginning, as the caret position returned when...

c++ win32 set cursor position

i know wat function to use but i can't get it to workd right. i use SetCursorPos() the only problem is that it sets the cursor not to the windows coordinates but to the screen coordinates. i also tried the ScreenToClient() but it didn't work ethier. here is my code pt.x=113; pt.y=280; ScreenToClient(hWnd, &pt); SetCursorPos(pt.x, pt.y);...

Android: EditText listener for cursor position change

I'm looking for a way to detect a cursor position changed in an EditText. I couldn't find anything in the documentation so far. Has anyone solved this already? ...

Problem with "Finalizing Cursor" error in custom CursorAdapter

I have a cursor adapter and the logcat is filled with above errors, as soon as I click on a view. I am already releasing the CursorAdapter's cursor in onDestroy(). Is there any way to get information about when the cursor was opened? ...

How to set the area/rectangle in which the cursor is allowed to move?

E.g. when you hit the side of your monitor your cursor can't go any further, and more of an example is when in microsoft paint, and your choosing a colour from the RGB table, it won't allow your mouse to go outside of the rectangle while your mouse is down.. my question is how would you implement that in c++ with win32 api? ...

Create a table from CSV columns in SQL Server without using a cursor

Given a table: |Name | Hobbies | ----------------------------------- |Joe | Eating,Running,Golf | |Dafydd | Swimming,Coding,Gaming | I would like to split these rows out to get: |Name | Hobby | ---------------------- |Joe | Eating | |Joe | Running | |Joe | Golf | |Dafydd | Swimm...

Position cursor to end of text in uitextview and scroll to position

Using the code below, I put text from a plist into a textView. The textView is not yet firstresponder; the text is initially for reading only. In iOS4 the goToEndOfNote code positions the cursor at the end of the text AND scrolls to that position. In 3.1.3 it doesn't scroll to the end until the screen is touched (which isn't required ...

Android Beginner: Adapter for simple view or direct DB query?

First off I'm really new to android (< 4 days). I'm trying to wrap my head around how database data is linked to Views and widgets. I've done a few tutorials and I've noticed that Adapters are used to link AdapterViews which are (as I understand it) Views which contain a bunch of identical subviews (eg lists, gallery, etc). So the A...

Cursor type in Emacs

What do I put in my .emacs file to change the cursor type for all frames to box? ...

Will inserting half a million entries with the same date value be slowed by a non-unique index on that date column?

I have a cursor that selects all rows in a table, a little over 500,000 rows. Read a row from cursor, INSERT into other table, which has two indexes, neither unique, one numeric, one 'DATE' type. COMMIT. Read next row from Cursor, INSERT...until Cursor is empty. All my DATE column's values are the same, from a timestamp initialized at t...

Android ContentResolver: Pass the data with cursor without requery or get the exact executed cursor when querying from activity

Say, I'm having a ContentProvider (which in fact do not performs database call) and I want to pass some additional data (for example, call statistics) with the cursor to the caller: public class SomeProvider extends ContentProvider { . . . public Cursor query(....) { // I can not set extras for cursor here ...

How to save cursor in activity?

Hi everyone, I'm population my listView using Cursor, but when I navigate away from my activity and then return back my listview is empty. Here is my code: @Override public void onCreate(Bundle savedInstanceState) { ... DBAdapter db = new DBAdapter(context); db.open(); Cursor c = db.getAll(); db.close(); startManagingCursor(c); Stri...

Vim start with cursor where last went off

Is it possible to have Vim always start at whatever line i was in last time i was working in that given file? And if so, how do i do that? ...

Unix write() function (libc)

Hello, I am making a C application in Unix that uses raw tty input. I am calling write() to characters on the display, but I want to manipulate the cursor: ssize_t write(int d, const void *buf, size_t nbytes); I've noticed that if buf has the value 8 (I mean char tmp = 8, then passing &tmp), it will move the cursor/pointer backward ...

Duplicating records efficiently in tsql

Hey guys, I've a scenario where I have a parent table which has '1 to many' relationships with two or three tables. These child tables again have '1 to many' relationships with more tables and so on. This goes up to 5 to 6 levels of hierarchy. Now, based on single primary key value of the parent table, I want to duplicate all informati...

Keeping Open a Sqlite Cursor

In an Android app I developed, I open a cursor to a query with a fairly large result set (~1k rows) and I keep it open indefinitely. Is this an ok practice? If not, should I close the cursor in the onClose() handler and then re-open it in the onStart() handler? The app seems to run fine, however it sometimes randomly crashes after havin...

How can I do this 'for each' code in Sql Server 2008 without using cursors?

Hi folks, I wish to do the following pseduo code in Sql without the use of a CURSOR, if possible. for each zipcode { -- What city is this zipcode in? A zipcode can be in multiple cities, -- but one city area is always way greater that the others. -- Eg. 90210 is 96% in the city of Beverly Hills. -- The remaining 4% is...

counting rows before processing with a cursor tsql

hi there I have a SQL Server sp using a cursor thus: DECLARE TestCursor CURSOR FOR SELECT tblHSOutcomes.strOutcomeName, tblHSData.fkHSTest FROM tblHSData INNER JOIN tblHSOutcomes ON tblHSData.fkOutcome = tblHSOutcomes.uidOutcome INNER JOIN tblHSTests ON tblHSData.fkHSTest = tblHSTests....

Unhide cursor in Cocoa screensaver

Hello! I’m developing a Mac OS X screensaver that uses WebView. WebView loads flash with a map. I want to let a user move the map and resize it (flash map has appropriate controls). I’ve redefine mouseMoved: method so the screensaver does not exit on mouse move. But the mouse cursor is still hidden. It’s visible only on mouse drag. I’ve...