Posts

Featured post

How to resolve Nattable conflicts between DefaultRowSelectionLayerConfiguration and ButtonCellPainter on left mouse keydown event? -

i developing rcp application, , using nebula's nattable that. configer row selection (use defaultrowselectionlayerconfiguration) , , configer cell button (use buttoncellpainter) . both ui bing left mouse down event. what want is: when click left mouse button, button responds event while button of whole row selected. below part code: selectionlayer = new selectionlayer(columnhideshowlayer,false); selectionlayer.setselectionmodel(new rowselectionmodel<row>(selectionlayer, bodydataprovider, new irowidaccessor<row>() { @override public serializable getrowid(row rowobject) { return rowobject.getstatus(); } })); selectionlayer.addconfiguration(new defaultrowselectionlayerconfiguration()); class buttonclickconfiguration<t> extends abstractuibindingconfiguration { private final buttoncellpainter buttoncellpainter; public buttonclickco

Java jTextPane one line with regular and bold Text missplaced -

Image
i have textpane using styleddocument. if message typed first adds current time , other users ip document after custom message entered user added right behind in bold. apparently problem bold takes more space , makes misplaced resulting in this: <- code used process following: public void addtext(string msg) { long timems = system.currenttimemillis(); date instant = new date(timems); simpledateformat sdf = new simpledateformat("hh:mm"); string time = sdf.format(instant); simpleattributeset bold = new simpleattributeset(); styleconstants.setbold(bold, true); try { styleddocument doc = getchat().getstyleddocument(); doc.insertstring(doc.getlength(), time + ": " + client.getclient().getpartnerip() + " >>", null); doc.insertstring(doc.getlength(), msg + "", bold); jscrollbar sb = getchatscroller().getverticalscrollbar(); sb.setvalue(sb.getmaximum()); } catch (badlocationexception

spring - Integration test: test the Autowired annotation -

i want test injection dependencies in spring. i have class: public someclass { @autowired somebean bean ; public somebean getbean(){ return this.bean ; } } i want test this: public someclasstest { someclass someclass ; @before public void setup(){ someclass = new someclass() ; } @test public testbeanwired(){ assertnotnull(someclass.getbean()) ; } } i have tried contextconfiguration test configuration file, test fails, don't want use @autowired in test, want create instance of class , bean autowired automatically. that possible if bean annotated @configuration , if byte-code instrumented. otherwise, beans created spring autowired. not beans created using new . because spring has no way know created object , must inject dependency in it. that's fundamental principle of dependency injection: objects instantiated ,

MongoDb document size is too large PhP.How to increase limit -

i want save documents gives me size large error. can not break data multiple collection not me while searching , joining, is there way can save array using gridfs , still searchable or increase document size limit. store data .txt files , shifting mongodb.txt files not searchable , hence need parsed , have search. please help.

c# - Handle multiple threads, one out one in, in a timed loop -

i need process large number of files overnight, defined start , end time avoid disrupting users. i've been investigating there many ways of handling threading i'm not sure way go. files come exchange inbox attachments. my current attempt, based on examples here , bit of experimentation, is: while (datetime.now < dtendtime.value) { var finished = new countdownevent(1); (int = 0; < numthreads; i++) { object state = offset; finished.addcount(); threadpool.queueuserworkitem(delegate { try { startprocessing(state); } { finished.signal(); } }); offset += numberoffilesperpoll; } finished.signal(); finished.wait(); } it

Mysql Update and Replace Syntax in PHP -

i need eliminate character (") column in database. can in mysql command line following command: mysql> update tname set colname=replace(colname, '"',''); and works perfectly. since need run in php, have used following syntax in php dosent work : $sql0 = "update tname set colname=replace(colname,'"','')"; if (mysqli_query($conn, $sql0)) { $result0 = "unwanted character removed "; } else { $result0 = "error filtering failed: " . $sql . "<br>" . mysqli_error($conn); } any idea?? you have escape double quotes inside double-quoted strings. $sql0 = "update tname set colname=replace(colname,'\"','')"; if (mysqli_query($conn, $sql0)) { $result0 = "unwanted character removed "; } else { $result0 = "error filtering failed: " . $sql . "<br>" . mysqli_error($conn); }

java - Which use for non-inherited abstract classes? -

what practice tells non-inherited abstract classes ? is there reason them exist in program not aiming @ providing api ? make sense systematically turn such classes non-abstract classes? if in cases ? well, abstract keyword forbids inctances creation (in order create instance 1 has inherit abstract class), however, abstract classes can have static methods e.g. // abstract: there's no sence in creating instance of class abstract class mathlibrary { // private: there's no sence in inheriting class private mathlibrary() {} // gamma function public static double gamma(double value) { ... } ... } please note, when in java abstract final class not allowed, in c# abstract sealed class static class : // c# static == abstract sealed public static class mathlibrary { // gamma function public static double gamma(double value) { ... } ... }