Posts

android - Text Editor keyboard overlaps with the recyclerview list -

Image
the layout has recyclerview , text editor @ bottom of view. when click editor, keyboard popup , overlaps recycerview. want recyclerview resized when keyboard brought up. in manifest file have : <activity android:name=".commentactivity" android:label="yourtime" android:windowsoftinputmode="adjustresize"> </activity> my layout looks : <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.recyclerview android:id="@+id/rv" android:layout_width="match_parent" android:layout_height="wrap_content" /> <linearlayout android:orientation="horizonta...

android - Can I not use SharedPreference inside a constructor? -

i'm using simple class perform actions (calculations) , want write value in sharedpreferences may later used. however, not working. extended class activity can use getsharedpreferences() method. incorrect , not allowed? i'm getting null pointer exception trying initialize sharedpreference editor code below: public class jsonparser extends activity { // store our preferences json route info public static final string my_prefs_json = "jsonprefs"; // construct object json values public jsonparser(string jsonstring){ try { jsonobject jsonobject = new jsonobject(jsonstring); jsonarray routesarray = jsonobject.getjsonarray("routes"); // fails nullpointer sharedpreferences.editor editor = getsharedpreferences(my_prefs_json, mode_private).edit(); // store in sharedpreferences our json value editor.putstring("json", routesarray.tost...

java - Usage of @Transactional with Spring Data custom methods -

i using spring data (via spring boot 1.3.3). repositories have custom method primary key. example: @transactional(readonly=true) @repository public interface userrepository extends crudrepository<user, userid>, userrepositorycustom { user findbyusername(string username); } public interface userrepositorycustom { userid nextid(); } public class userrepositoryimpl implements userrepositorycustom { public userid nextid() { return new userid( uuid.randomuuid() ); } } is use of @transactional correct here? or need add @transactional userrepositoryimpl (possibly readonly set or not)? the reason asking because unexplainable objectoptimisticlockingfailureexception org.springframework.orm.objectoptimisticlockingfailureexception: object of class [com.company.project.domain.game] identifier [gameid{id=7968c30b-838f-424c-bfef-838de7028def}]: optimistic locking failed; nested exception org.hibernate.staleobjectstateexception: row updated or deleted transaction ...

excel vba - VBA Dependent Combobox -

i have 3 combo boxes dependent each other. list on cmb2 depends on value on cmb1. cmb3 list depends on cmb2 value. my problem is, when remove/delete values on combo boxes, when click cmb2, still shows list of last value chosen on cmb1 & same goes cmb3. what's code show empty if combo box it's dependent doesn't have value? edit: think based on added information in comment should encapsulate logic in sub procedures , functions. best so, there should logic between named ranges , values in combobox. in below example, created function handle conversions value in independent combobox , named ranges. can supply own connector, assumed space changed underscore (so, 'account information' replaced 'account_information'). next subprocedure checks confirm named range exists in workbook matches converted value in independent combobox. if so, dependent box takes on named range list property. if not, dependent combobox cleared. the benefit using ...

integer - Java toString method difference -

this question has answer here: java int string - integer.tostring(i) vs new integer(i).tostring() 11 answers i enjoy codefights @ moment , @ end of last fight found interesting. code in 2 cases (mine , opponent) said correct. there difference between source code: return integer.tostring(character.getnumericvalue(ch1) + character.getnumericvalue(ch2)); and one: return new integer(character.getnumericvalue(ch1)+ character.getnumericvalue(ch2)).tostring(); what key missing? from javadoc https://docs.oracle.com/javase/7/docs/api/java/lang/integer.html string tostring() returns string object representing integer's value. static string tostring(int i) returns string object representing specified integer.

winforms - C# Calculate Employee Salary in a Class or via button click? -

i'm developing payroll software major project. tax information (jamaican income tax) should calculated, added , subtracted base pay secretary enter via textbox. the tax percentage , calculations each type of tax contained in checkboxes. result of calculations of taxes incorrect. if base pay less threshold tax (22800) income tax becomes negative value. if 1 checkbox checked before other result checkbox becomes incorrect. i know if easier perform calculations employee salary in class or within button click event. thanks in advance help. first of all, mixing few thing sup here. checkboxes should never used data storage - ui elements , job display results, or take inputs. ideally, should have class represents object - in case payroll guess. payroll class should know it's own tax calculations, amount of salary , related payroll. if have checkboxes correspond tax amounts deducted, use sort of resolver class return tax amount based on state of checkboxes sele...

Apache Nifi GetTwitter -

Image
i have simple question, new nifi. i have gettwitter processor set , configured (assuming correctly). have twitter endpoint set sample endpoint. run processor , runs, nothing happens. no input/output how troubleshoot doing (or in case not doing)? a couple things might at: what activity processor show? can @ metrics see if has been attempted (tasks/time) if succeeded (out) stop downstream processor temporarily make output flowfiles visible in connection queue. are there errors? typically these appear in top-left corner yellow icon are there related messages in logs/nifi-app.log file? it might if describe gettwitter property settings bit more. can share screenshot (minus keys)?