Posts

html - If all elements don't have a particular class, then apply styles -

i have list of elements class name of .box . sometimes, element have class, not know element has it. is there way check if elements of .box don't have .extraclass , apply styles .box , if elements of .box has class .extraclass , don't apply css style? i want using css only. jsfiddle var toggleclass = document.getelementbyid('toggleclass'), box = document.getelementsbyclassname('box'), randomnumber = -1; toggleclass.addeventlistener('click', function() { if (randomnumber !== -1) box[randomnumber].classlist.remove('extraclass'); randomnumber = math.floor(math.random() * 9); box[randomnumber].classlist.toggle('extraclass'); }); removeclass.addeventlistener('click', function() { if (randomnumber !== -1) box[randomnumber].classlist.remove('extraclass'); }); #wrapper { padding: 0; margin: 0; display: flex; justify-content: center; flex-wrap: wrap; } .box { backgroun...

appcompat - Divider lines are not correct on Android 5 and Android 4 phones -

in android application, migrating app "com.android.support:preference-v14:23.4.0" settings screen. using theme.appcompat theme. works fine on android 6 phones. but on android 5 , android 4 phones, noticed divider lines "black" in color. used dark theme, should white (with alpha). case android 6 phones, not android 5 , android 4. i tried lot change divider color unable so. loooked solutions on internet nothin seem work. can me this you can use setdivider method provided preferencefragmentcompat class. change style of divider. use method need sure view created otherwise nullpointer error. best place change style in onviewcreated. example: @override public void onviewcreated(view view, @nullable bundle savedinstancestate) { super.onviewcreated(view, savedinstancestate); setdividerstyle(); } private void setdividerstyle() { colordrawable test = new colordrawable(getactivity().getresources().getcolor(r.color.your color)); setdivide...

ios - iPad app should not install/usable in iPhone -

i want restrict way iphones not use app intended ipad only. are there ways not allowing user install ipad apps on iphones? second case if installed should usable in iphones. let me know how achieve this in navigator (the left bar), select "show projet navigator"(int top bar, it's icon left) . in deployment info you're able chose devices. https://gyazo.com/47d1bb85b9e72a274ecba072ea676c4e

java - Jackson Databinding -

we using api communicate between our services. bind data use following dependencies: <dependency> <groupid>com.fasterxml.jackson.core</groupid> <artifactid>jackson-core</artifactid> <version>2.6.5</version> </dependency> <dependency> <groupid>com.fasterxml.jackson.core</groupid> <artifactid>jackson-databind</artifactid> <version>2.6.0</version> </dependency> <dependency> <groupid>com.fasterxml</groupid> <artifactid>jackson-xml-databind</artifactid> <version>0.6.2</version> </dependency> the old way api offered list me : country: [ "nl", "be", "es", "gb", ], normally bind pojos followed: e.g. @jsonproperty("country") private list<string> countries; which...

java - Css class is not loaded for imageView javafx -

i have css file: .-fx-attribute-label { -fx-min-width: 50; -fx-font-weight: bold; } ... .img-view { -fx-stroke-width: 2.0; } .img-view:hover { -fx-stroke: #70c0e7; } .img-view:selected { -fx-stroke: #26a0da; } and try add img-view class imageview: pairstream.foreach(id -> { final imageview imgview = new imageview(id.getvalue()); imgview.getstyleclass().add("img-view"); facesview.getchildren().add(imgview); //facesview hbox contains imageviews children ... }); i need highlight on hover , when selected doesn't work. know css file loaded because other class -fx-attribute-label works. why it's not working img-view class? imageview not subclass of shape hence not have eg stroke attribute - refer http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html see attributes can set on imageview. your use case has solved wrapping image stackpane , handling hover there.

c++ - Holding reference types in value typed list? -

in discussion what , stack , heap? learned value types kept @ stack , pointers @ heap.in application have qlist<t*> , qmap<qstring,qlist<qstring>> holding pointers of objects. now know, reference types holding @ heap (application). lists, holding references, value types , @ stack. available in thread in created. how know, when thread dead, or if function/method, call in thread? need lists in whole application. bit stupid question fill lists , mere chance if objects available. edit: @coyotte508 the things in stack member pointers pointing memory. , is, if created in stack, if they're local variables of function or of class declared on stack. in main class have list: qlist<fachbereich *> lfbs; in constructor of main class create list: lfbs=qlist<fachbereich *> (); ..- call method readconfig(); one of subroutines : void appconfig::readfachbereiche(qxmlstreamreader &reader) { fachbereich* fb(0); while(!r...

android - How to update SQL database from within an onClick event of button inside a ListView -

how handle onclick events of button within listview item. fetching data of content provider in app. implemented custom simplecursoradapter not update database within onclick event. find below customsimplecursoradapter code. i warming android. might missing simple. appreciated public class customsimplecursoradapter extends simplecursoradapter { private context mcontext; private context appcontext; private int layout; private cursor cr; private final layoutinflater inflater; public customsimplecursoradapter(context context, int layout, cursor c, string[] from, int[] to,int flag) { super(context, layout, c, from, to,flag); this.layout = layout; this.mcontext = context; this.inflater = layoutinflater.from(context); this.cr = c; } @override public view newview(context context, cursor cursor, viewgroup parent) { return inflater.inflate...