cursor

Picking image from gallery and set to imageview

倾然丶 夕夏残阳落幕 提交于 2019-12-23 01:29:17
问题 I'm trying to pick image from gallery and set it to imageview. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); try { // When an Image is picked if (requestCode == RESULT_LOAD_IMG && resultCode == RESULT_OK && null != data) { Log.e("1","1"); // Get the Image from data Uri selectedImage = data.getData(); Log.e("2","2"); String[] filePathColumn = { MediaStore.Images.Media.DATA }; Log.e("3","3"); //

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

梦想的初衷 提交于 2019-12-22 18:20:33
问题 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.

oracle解析相关的等待事件(Shared Pool latch/library cache: mutex X/cursor: pin S)

那年仲夏 提交于 2019-12-22 15:09:18
Shared Pool/Library Cache Latch Contention 可能的原因 sql语句不能被重用,语句没有使用绑定变量,不合适的应用游标缓存大小,频繁的登入或登出,数据库对象上做过ddl操作,共享池太小等 在会话级别 V$SESSTAT parse time CPU parse time elapsed Ratio of parse count (hard) / execute count Ratio of parse count (total) / execute count 在游标缓存(V$SQLAREA/V$SQLSTATS) 高的PARSE_CALLS / EXECUTIONS EXECUTIONS = 1 differing only in literals in the WHERE clause (that is, no bind variables used) High RELOADS(高的重载次数) High INVALIDATIONS(高的失效次数,ddl等操作造成对象失败需要重新解析) Large (> 1mb) SHARABLE_MEM 共享池或库缓存latch 争用的主要原因是由于解析,有很多技术可以避免没必要的解析。 1.手工检查只执行次数很少的sql语句是不是相似的。 SELECT SQL_TEXT FROM V$SQLSTATS

How to use a nested table in a cursor

拈花ヽ惹草 提交于 2019-12-22 13:56:19
问题 CREATE PROCEDURE( p_cur OUT a_cur) IS type rec is record( a varchar2(2), b number, c number); type tab is table of rec; tab1 tab:=tab(); begin tab1.extend; tab1(tab1.last).a:='as'; tab1(tab1.last).b:=2; tab1(tab1.last).c:=3; tab1.extend; tab1(tab1.last).a:='jj'; tab1(tab1.last).b:=2; tab1(tab1.last).c:=3; --??--- end; I have created a nested table here tab1 ,but my issue is that i want to use this nested table in a cursor and want to return whole records using this nested table ,limitation is

jQuery move Cursor Back “X” amount of Spaces

时光毁灭记忆、已成空白 提交于 2019-12-22 12:48:12
问题 I need it so that when a button is pressed, the cursor will: 1) Locate the end of the sentence 2) Move the cursor back from the end of the sentence "x" many spaces (x is a variable); Here's a fiddle -----> jsFiddle <------ HTML <span>From the end, move the cursor back this many spaces: </span> <input type='text' id='num' size='5'/> <button>Submit</button> <br/><br/> <textarea>The cursor will move in here</textarea> jQuery $(document).ready(function() { $('button').click(function() { var myval

xplan-打印执行顺序

♀尐吖头ヾ 提交于 2019-12-22 11:36:00
-- ---------------------------------------------------------------------------------------------- -- -- Script: xplan.sql -- -- Author: Adrian Billington -- -- -- Description: Creates a package named XPLAN as a wrapper over DBMS_XPLAN. Provides access to -- the following DBMS_XPLAN pipelined functions: -- -- 1. DISPLAY; -- 2. DISPLAY_CURSOR; -- 3. DISPLAY_AWR (optional - see Notes section for licence implications). -- -- The XPLAN wrapper package has one purpose: to include an "order" column in the -- plan output to show the order in which plan operations are performed. See the -- following

cursor index out of bounds exception

爷,独闯天下 提交于 2019-12-22 11:33:40
问题 I am getting a Cursor Index out of bounds error after opening a database . Please can any one tell me how to open an existing database in sqllite - Android . I want to fire a select query on the database and retrieve some information ? public void getPatient(SQLiteDatabase db, String name) { // TODO Auto-generated method stub db=this.getReadableDatabase(); //db.open(); System.out.println("in cursooooooooorrrrrrrrr"); Cursor c = db.rawQuery("SELECT * from table_patient WHERE COL_Name"+"=?",

Android database connections and cursors oh my

和自甴很熟 提交于 2019-12-22 10:12:58
问题 I have read plenty of blogs and tutorials on how to create and use database connections when working with android. Although I have plenty of working examples, different implementations result in different issues. Example, I use a datasource class, Datasource and a database helper class, DBManagement . DataSource public class DataSource { // Database fields private SQLiteDatabase database; private DBManagement dbHelper; public SMSDataSource(Context context) { dbHelper = new DBManagement

Get word from EditText on current cursor position

自古美人都是妖i 提交于 2019-12-22 09:17:05
问题 I am new to android programing. I added a context menu to edittext. I wish I can get word under cursor on long press. Help Please. I can get selected text by following code. @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { EditText edittext = (EditText)findViewById(R.id.editText1); menu.setHeaderTitle(edittext.getText().toString().substring(edittext.getSelectionStart(), edittext.getSelectionEnd())); menu.add("Copy"); } edittext have some text e.g

Background activity cursor in Swing

点点圈 提交于 2019-12-22 08:51:51
问题 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? 回答1: 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