cursor

Nullpointerexcepiton on cursor while selecting photo from gallery on dialog fragment

↘锁芯ラ 提交于 2019-12-06 07:28:45
问题 I'm trying to select photo from gallery through DialogFragment . But I'm getting nullpointerexception while initializing cursor . Any ideas why getting this error? Below is my code : if (resultCode == Activity.RESULT_OK) { Uri selectedImage = imageReturnedIntent.getData(); String[] filePathColumn = {MediaStore.Images.Media.DATA}; // Nullpointerexcepiton on this line Cursor cursor = getActivity().getContentResolver().query(selectedImage, filePathColumn, null, null, null); cursor.moveToFirst();

HoloLens - UI/Slider and Cursor do not intersect during gaze

◇◆丶佛笑我妖孽 提交于 2019-12-06 07:20:27
I'm trying to use UI/Slider in Unity app for HoloLens. I used the steps described here - Unity UI on the HoloLens So as a result I have following structure: MainCamera properties: SliderCanvas is using MainCamera : Slider properties: InteractiveMeshCursor is taken from HoloToolkit. As a result I'm getting this picture: When I move the head the Cursor behaves correctly - it stays in the middle of the scene. If I add other 3D objects on the Scene it also correctly changes its states so GazeManager looks like is working correctly. However I cannot gaze at Slider because it moves with the Camera

How can I get the position of a row in a dataset in order to set the selected item in an Android Spinner?

坚强是说给别人听的谎言 提交于 2019-12-06 06:25:48
I have a Spinner that's populated using a cursor containing data from a database. It appears that it's impossible to set the selected item in the spinner using the value of the ID column of a row. And that the only way to set the selected item is by using the position of the row within the dataset. Is this correct? If so, is there a more efficient way of determining the row's position than by iterating through the dataset using the cursor? The inefficient (to my mind) way is outlined here . Thanks much! First step, create view for your data set, with joins etc.: CREATE VIEW my_view AS SELECT

Unable to return Cursor object - close() was never explicity called error

笑着哭i 提交于 2019-12-06 06:06:31
Hey. I'm trying to return a cursor object to my activity where its gonna be used in a SimpleCursorAdapter, but Im having a close() was never explicity called error. I cant find any solution for this error, and I'm about to think that its a non-solution error , LOL. Think with me. The error says: close() was never explicitly called on database '/data/data/com.example.myapp/databases/myDB.db' And has a warning too: Releasing statement in a finalizer. Please ensure that you explicitly call close() on your cursor: SELECT * FROM contact_data ORDER BY duration desc android.database.sqlite

Change cursor for all buttons on Swing app

醉酒当歌 提交于 2019-12-06 05:43:42
问题 I have a Swing app with a main frame and some other forms loaded inside it. I Need to implement a general method to set the hand cursor for all buttons on any form. This is similar of what we do with css on web pages ( input[type=button] { cursor:pointer; } ) 回答1: Walking the tree like @Madprogrammer suggested is the method if you want to change the cursor dynamically and/or on a particular form. Just for fun (and to show-off SwingX again :) - if you want to install that cursor globally and

Mongodb cxx + Unreal Engine 4 - Crash while iterating over Cursor

微笑、不失礼 提交于 2019-12-06 05:30:28
I got an error while or after iterating over a mongocxx::cursor after finding some documents in my database. I am using Windows 10, Unreal Engine 4.16.1 and mongodb cxx 3.1.1. The database connection is set up correctly, the find function finds my documents and returns a valid cursor. It ends up in this Exception: Exception thrown at 0x00007FFDED56B698 (UE4Editor-Core.dll) in UE4Editor.exe: 0xC0000005: Access violation writing location 0x0000000000000010. with this output: 2598:0a50 @ 01781390 - LdrpCallTlsInitializers - INFO: Calling TLS callback 00007FFDDC66C154 for DLL "C:\WINDOWS\System32

MySQLdb.cursors.Cursor.execute returns different values in case of different cursors why?

送分小仙女□ 提交于 2019-12-06 05:06:25
See these two python code snippets, conn = MySQLdb.connect(c['host'], c['user'], c['password'], c['db']) cur = conn.cursor() cur.execute("select * from geo_weathers;) -> **1147L** and conn = MySQLdb.connect(c['host'], c['user'], c['password'], c['db'], cursorclass=MySQLdb.cursors.SSCursor) cur = conn.cursor() cur.execute("select * from geo_weathers") -> **18446744073709551615L** Why the returned number of rows are different in above two cases ? And just FYI there are 1147 rows in a table. SSCursor is used for saving result at servers side. Is it the reason ? What all rows are affected by this

meteor merging cursors of same collection

佐手、 提交于 2019-12-06 04:47:13
问题 In my social app(like as FB) I have a strange need to merge two cursors of the same collection users in one publish! Meteor server print this error: "Publish function returned multiple cursors for collection users". Maybe this can not be done in Meteor 0.7.2, perhaps I'm mistaken approach. But I have seen the structure of a cursor is pretty simple as I could make a simple array merge and return back a Cursor? CLIENT Meteor.subscribe('friendById', friend._id, function() { //here show my friend

Delphi How to get cursor position on a control?

自古美人都是妖i 提交于 2019-12-06 04:20:02
问题 I want to know the position of the cursor on a TCustomControl. How does one go about finding the coordinates? 回答1: You can use MouseMove event: procedure TCustomControl.MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin Label1.Caption := IntToStr(x) + ' ' + IntToStr(y); end; 回答2: GetCursorPos can be helpful if you can't handle a mouse event: function GetCursorPosForControl(AControl: TWinControl): TPoint; var P: TPoint; begin Windows.GetCursorPos(P); Windows.ScreenToClient

Open and Close Cursors Inside or Outside a Transaction and How to Close a Cursor if a Transaction Fails

こ雲淡風輕ζ 提交于 2019-12-06 03:55:51
问题 I am writing a stored procedure in SQL Server 2012 that uses a cursor for reading and a transaction inside a TRY CATCH block. Basically, my questions are as follows: Should I declare my cursor inside the TRY CATCH block? If yes, should I declare the cursor before or after the BEGIN TRANSACTION statement? Should I open the cursor before or after the BEGIN TRANSACTION statement? Should I close and deallocate the cursor before or after the COMMIT TRANSACTION statement? Should I close and