cursor

MongoDB: cannot use a cursor to iterate through all the data

我的未来我决定 提交于 2019-12-05 16:23:01
Update on update: Solved ! See this: MongoDB: cannot iterate through all data with cursor (because data is corrupted) It's caused by corrupted data set. Not MongoDB or the driver. ========================================================================= I'm using the latest Java driver(2.11.3) of MongoDB(2.4.6). I've got a collection with ~250M records and I want to use a cursor to iterate through all of them. However, after 10 minutes or so I got either a false cursor.hasNext(), or an exception saying that the cursor does not exist on server. After that I learned about cursor timeout and

Background activity cursor in Swing

↘锁芯ラ 提交于 2019-12-05 16:09:11
how can I set the Cursor on a Component to a "background activity" cursor. Like the one in Windows with the arrow and the small hourglass. All I find ist the Cursor.WAIT_CURSOR , which is only an hour glass. I found the file which contains the cursor: appstart.ani in C:\WINDOWS\Cursors can I use that somehow? As this is an animated cursor, it's not trivial to display. But the good news is that there is a tutorial for it: Introduce Animated Cursors to Java GUIs 来源: https://stackoverflow.com/questions/4042678/background-activity-cursor-in-swing

Android OnClickListener not firing in GridView (2.2 only)

两盒软妹~` 提交于 2019-12-05 16:05:11
I have a grid view of buttons that is generated by a CursorAdapter. When the CursorAdapter is passed to the Gridview the view renders correctly however the first item in the grid does not fire the OnClickListener event. If I select another button in the grid, the event fires correctly however if I selected the first button then another button, it loads the first button action then the section button action. When testing this, it only seems to be an issue in Android 2.2 on my emulator, my 1.5 phone works as expected. I've wiped the emulator but that doesn't seem to have made a difference.

Drag cursor in javascript?

好久不见. 提交于 2019-12-05 15:59:17
I need to set the drag cursor in some places but i can' see listened here http://www.w3schools.com/cssref/pr_class_cursor.asp In my case it apears when i drag some image : http://s2.subirimagenes.com/otros/previo/thump_8236773bgform29.jpg Is there a code to use like body{cursor: drag} ? You can use the move cursor paramater: .target {cursor:move} That cursor you are asking for is unique, if you want to use one with pure CSS then the best for this case is the move cursor. Edit: For a custom cursor like the one you see, you can use the URL property value .target{ cursor: url(mycursor.gif), auto;

Application did not close the cursor or database object that was opened here :

℡╲_俬逩灬. 提交于 2019-12-05 15:37:32
问题 My code is : public class EventDataSQLHelper extends SQLiteOpenHelper { private static final String DATABASE_NAME = "my.db"; } public class Test extends Activity { EventDataSQLHelper eventsData; @Override protected void onDestroy() { System.out.println("onDestroy"); close(); if (db!=null){ db.close(); } super.onDestroy(); } public void close() { eventsData.close(); } I have closed the db here.. In all my activities except this its working(no exception is shown).. Here when i press back button

IE8, IE9, IE10 Blinking Cursor Issue

我的梦境 提交于 2019-12-05 15:06:53
I am making an editor which shows a toolbar on some text selection. The issue that I am facing in IE is that the blinking cursor still shows above the toolbar. This is specifically happening in IE. The blinking cursor comes on top. Here is the sample for this issue: $('.content').mouseup(function(e) { $('.shy').css({ top: e.pageY - 30 + 'px', left: e.pageX - 30 + 'px' }); $('.shy').show(); }); .content { height: 300px; width: 300px; border: 1px solid black; overflow: hidden; word-wrap: break-word; z-index: 1; } .shy { height: 100px; width: 100px; background-color: orange; z-index: 2; overflow:

Unable to resume Activity error

Deadly 提交于 2019-12-05 14:51:47
问题 My Activity contains this code to get all images on the SD card: String[] projection = {MediaStore.Images.Media._ID, MediaStore.Images.Media.DATA, MediaStore.Images.ImageColumns.DATA}; Cursor cursor = managedQuery(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, null, null, MediaStore.Images.Media._ID); int count = cursor.getCount(); int image_path_index = cursor.getColumnIndex(MediaStore.Images.Media.DATA); int i; for(i = 0; i < count; i++) { cursor.moveToPosition(i); String p =

Shadow for custom mouse cursor

ⅰ亾dé卋堺 提交于 2019-12-05 14:41:18
On "newer" Windows systems there is an option to make the OS draw a shadow beneath the mouse cursor: However the custom cursors in my Delphi app don't show a shadow even if this setting is enabled. Do you have any idea how to arrange it so that Windows adds the shadow automagically? Or do I really have to check the user's preferences and conditionally draw the shadow myself like Mike Lischke did ? (This is a question that has been bugging me and others for some time: Custom mouse cursor shadow Custom cursor shadow Custom cursor with shadow ) No, you don't need to check the user's global

Modify Cursor columns value in android

≡放荡痞女 提交于 2019-12-05 13:42:27
I have a Cursor returned From a SQLiteDataBase object , i can use getXXX() to get the content of columns from the cursor , in my case i want to modify "update" data in the cursor using setXXX() method , i know there is no setXXX() methods , but there is CursorWindow object that have this feature , but i can't use it Barak You can't change the cursor. What you can do is update your database and then use the reQuery() method. // code to update your db cursor.requery(); EDIT Further research show that apparently I am incorrect. You CAN do what you want, but it's quite a bit of work (and no, I

7. SOFAJRaft源码分析—如何实现一个轻量级的对象池?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 13:37:37
摘自: https://www.cnblogs.com/luozhiyun/p/11924850.html 7. SOFAJRaft源码分析—如何实现一个轻量级的对象池? 分类: SOFAJRaft 标签: SOFAJRaft 前言 # 我在看SOFAJRaft的源码的时候看到了使用了对象池的技术,看了一下感觉要吃透的话还是要新开一篇文章来讲,内容也比较充实,大家也可以学到之后运用到实际的项目中去。 这里我使用RecyclableByteBufferList来作为讲解的例子: RecyclableByteBufferList Copy public final class RecyclableByteBufferList extends ArrayList<ByteBuffer> implements Recyclable { private transient final Recyclers.Handle handle; private static final Recyclers<RecyclableByteBufferList> recyclers = new Recyclers<RecyclableByteBufferList>(512) { @Override protected RecyclableByteBufferList newObject(final