cursor

'Too many open files' error

久未见 提交于 2019-12-08 05:31:55
问题 In my app, there is an insert operation on a form submission. Most of the cases the insert operation is successful. Sometimes the insertion operation is not happening and then , it is giving java.lang.RuntimeException . Here is the logcat details: 03-28 10:52:09.260: ERROR/IMemory(1501): cannot dup fd=1023, size=1048576, err=0 (Too many open files) 03-28 10:52:09.260: ERROR/IMemory(1501): cannot map BpMemoryHeap (binder=0x5919b0), size=1048576, fd=-1 (Bad file number) 03-28 10:52:09.260:

SimpleCursorAdapter won't work because of missing _id

孤者浪人 提交于 2019-12-08 04:26:14
问题 i'm having a problem with a Cursor and a SimpleCursorAdapter. What i want to accomplish: I have a database with 3 fields _id | nickName | somethingelse I want to select all nickNames distinctly and provide them in an AutoCompleteTextView. Problem: When doing the query (see below) i don't select the _id-field. That's why i get an error when trying to create the SimpleCursorAdapter because in the cursor there is no field "_id". But if i select the "_id" in the query, the nickNames in the cursor

Dynamically generated CURSOR in Postgresql

陌路散爱 提交于 2019-12-08 04:17:56
问题 I have got a cursor, it is pointing to a SELECT, but this select is generated dynamically. I want to assign the statement after the declarement. I have done an example working and another example NOT working. This is a simple example to print some data only. This is the table: CREATE TABLE public.my_columns ( id serial NOT NULL, "name" varchar(30) NOT NULL, /* Keys */ CONSTRAINT my_columns_pkey PRIMARY KEY (id) ) WITH ( OIDS = FALSE ); CREATE INDEX my_columns_index01 ON public.my_columns (

Resizing CSS custom mouse cursor

痴心易碎 提交于 2019-12-08 03:18:47
问题 Is it possible to resize a CSS mouse cursor that uses a custom image URL? For example: cursor: 'url(resources/images/custom-cursor.png), auto'; The image is too big, and I haven't been able to find a way to style it past setting the image URL. I know I can just save the image with a new size, but I'd rather set the size on the client if possible. 回答1: Checked it, I guess it is not possible to natively change the cursor's size. One thing you can do is to hide the cursor using the following

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-08 01:32:35
问题 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.

Cursor Implementation in Iterator in Java collections

▼魔方 西西 提交于 2019-12-08 00:32:58
问题 All, Just a beginner to Programming. I was exploring on the java Collections and Iterator and I would like to know how the cursor is used for iterating the collections. public class Collections { public void myFun() { int i=0; List<String> listObj = new ArrayList<String>(); listObj.add("Hello"); Iterator<String> itr = listObj.iterator(); while(itr.hasNext()) { String s=(String)itr.next(); System.out.println(" List Elements are : " +s); } } public static void main(String[] args) { Collections

Trying to change Windows mouse cursor icon from java through jni call

假如想象 提交于 2019-12-08 00:04:50
问题 In my java application, i m trying to change the mouse cursor with an argb 32bit bmp file with transparency. I want to make a jni call to change it from Windows because changing the cursor in java gives me a really bad mouse cursor (all the transparency is either 0x00 or 0xFF) At the moment i'm trying to use the function SetClassLong with as parameters: the hWnd from java (i got it following that method http://download.oracle.com/javase/1.3/docs/guide/awt/AWT_Native_Interface.html ) GCL

Android get song from Media Store if you have the song ID?

删除回忆录丶 提交于 2019-12-07 23:52:39
问题 I got a song id from a playlist in MediaStore, using long id = cursor.getLong(cursor.getColumnIndex(MediaStore.Audio.Playlists.Members.AUDIO_ID)); and the id is correct, but as the only other data available is CONTENT_DIRECTORY, DEFAULT_SORT_ORDER, PLAYLIST_ID, PLAY_ORDER, and _ID, I am not sure how to get the important parts of the song. I need the title, album, artist, etc., as if I was going through MediaStore.Audio.Media to get Song info. I found an answer that I tried to modify to fit my

How can I get the character at the cursor in a C# console application?

杀马特。学长 韩版系。学妹 提交于 2019-12-07 21:17:23
问题 I know how to set the cursor to a specific point in the console with SetCursorPosition or CursorLeft and CursorTop together. That's not a problem. But , how can I get the value of that point? Isn't there a thing like Console.Cursor ? So I can get the character at that position? Maybe something like: char c = Console.GetCharAtCursor(); No luck? 回答1: AFAIK, you have to read the entire console buffer as a two dimensional buffer, and use the cursor's X and Y coordinates as an index into that

How to change the textfield cursor colour in Cordova iOS project

我们两清 提交于 2019-12-07 19:43:03
问题 I have a blue background in my Cordova based iOS project due to which my cursor is not properly visible in iPhone device.So if anyone faced this please tell me How to change the textfield cursor color in Cordova iOS project or if any HTML attribute to change this tint color textfield code in index.html: <input type="text" placeholder="First Name" id='regFName' /> 回答1: Sujania - you just need to add the class "cursor" to your input type. <input class="cursor" type="text" placeholder="First