Posts

java - select and highlight custom listview item -

i want position custom listview item listview.setselection(itemindex); selected item positioning on top of visible part of listview. not highlighted. how can set default highlight of listview item (then disable highlight , select one) without listview re-create thanks! p.s. know asked many times before did not understand how works update not work on android 2.2 (adt emulator , smartphone android 2.2 froyo) drawable/listselector.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/red" android:state_focused="true"/> <item android:drawable="@color/yellow" android:state_selected="true"/> <item android:drawable="@color/red" android:state_pressed="true"/> </selector> values/colors.xml <?xml version="1.0" encoding="utf-8"?> ...

How to download from Nexus a folder of artifacts (mass download)? -

i want move set of artifacts 1 nexus other (download , later upload). can download artifacts 1 one, ¿is there way download entire folder? ¿is there other kind of operation export/import? thanks! edit: i have access nexus repository (sonatype-work\nexus\storage) in user folder. have got there artifacts. didn't find way web client. nexus stores artifacts on disk in standard maven 2/3 repository layout, can directly copy artifacts 1 storage directory other using whatever means like. after you're finished, schedule repair index task against destination repository searching artifacts web ui work. note builds work after copy artifacts, indexes not used maven builds.

php - Yii dropDownList default value -

i have code: echo $form->dropdownlist($model, 'defaultprinterid', chtml::listdata(printer::model()->findall(), 'id', 'name'), array('prompt' => '-- none--')); which gives me dropdown list this: <select id="labeltype_defaultprinterid" name="labeltype[defaultprinterid]"> <option value="">-- none --</option> </select> however, when form posts, adds value table defaultprinterid 0. instead of that, how make null, since it's nullable field? in controller, after load attributes $_post $model->defaultprinterid = $model->defaultprinterid ? $model->defaultprinterid : null; this changes 0 null otherwise leaves unmodified.

neo4j - Neo4jClient Get All Referenced Nodes -

in application have classes/nodes like: -person -activity -company can create relationships between: - person , company - company , activity - activity , person - person , person - company , company so. possible, specific activity related person , company. company root. there no real hierarchy. it's more mesh structure. (i know how create relationships etc. saw tutorials. :) ) now. want directly related relationships nodes of specific node. don't want fetch related data relationship type. want (when possible) 1 query, reads relationships , according nodes. , second requirement: when have retrieved related relationships , nodes, want relationships (if exists) between these nodes! cool solve 2 queries! ideas? thanks! how like start company = node(2) match company-[?:employs]-> person return company, person see docs.neo4j.org/chunked/snapshot/cypher-query-lang.html details. otherwise, can companies, persons etc in index, e.g. start comp=n...

c# - MySQL insert if not exists/ignore -

so here's table layout: type_of agreement ipad heyo! i'm agreement! ipod touch i'm agreement! basically, i'm building admin interface administrator can add new types. i'd make he/she can't enter new type exists. basically, in above example, if enter 'ipad' in new type box , press submit, ignored or error thrown or something. here's existing mysql statement: insert ignore agreements (type_of, agreement) values (?, ?) com.parameters.addwithvalue("", request.form["pies"]); com.parameters.addwithvalue("", "wahey! sample license!"); ( upgrading answer ) you need define unique index on type_of . explained in the manual : a unique index creates constraint such values in index must distinct. error occurs if try add new row key value matches existing row. engines, unique index permits multiple null values columns can contain null . if specify prefix value column in unique in...

c++ - Why a C-style typecasting is mandatory while initializing a POD data in initializer list? -

struct pod { int i, j; }; class { pod m_pod; public: a() : m_pod({1,2}) {} // error a() : m_pod(static_cast<pod>({1,2})) {} // error a() : m_pod((pod) {1,2}) {} // ok! }; i see in old production code compiled g++34 , until din't know feature. g++ specific feature ? if not then, why typecasting needed , that's c-style cast allowed ? the syntax you're using isn't initializer lists, it's initialization of class types outside of declarations. example: pod p; p = (pod) {1, 2}; these called compound literals ; added c in c99. aren't supported in c++; gcc allows them in c++ (and c89) extension . c++11 adds syntax : p = pod({1, 2}); or in case: a() : m_pod(pod({1,2})) {}

Tomcat Web Application Manager - is it possible to limit what each user role can see? -

i couldn't find regarding on internet, expert here answer question. i have set tomcat web application manager on test server, created roles/users in tomcat-users.xml follows: <role rolename="manager"/> <user username="admin" password="admin" roles="manager"/> <user username="user1" password="password" roles="manager"/> admin supposed have full rights on webapp manager, while user1 (and perhaps subsequent users) users have been granted permission upload/deploy war files. right have same roles, see same ui upon logging in, want user1 see deploy/upload option - limited access webapp manager. is possible achieve this? if yes, how? if no, acceptable compromise? you didn't hard if couldn't find this. it's under "manager" section of tomcat users' guide: http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#configuring_manager_application_acces...