Posts

uitableview - IOS: use custom cell in some classes -

when crate custom cell create class uitableviewcell , add nib tablecell; it's clear. want understand how manage situation when should use custom cell in classes use tableview. for example have view controller called "firstviewcontroller" , inside view controller have tableview, import class of tableview cell , create iboutlet reference #import "mycell.h" iboutlet mycell *mycell; in file's owner of mycell class in identity inspector set class of firstviewcontroller, in way can link iboutlet of custom cell easily. in way can use mycell firstviewcontroller, there way share mycell other classes secondviewcontroller? thanks you can create subclass of uitableviewcell, customcell . create xib file,add uitableviewcell root of xib. change identity of uitableviewcell customcell . connect outlets elements of customcell. don't give ownership viewcontroller. instantiate following code in tableview:cellforrowatindexpath: in viewcontroller ...

delphi - Is it possible to 'clip' the lower part of TAreaSeries? -

Image
i hints on working teechart tareaseries, , on creating not overlapping series. when create 2 area series on same plot, related same bottomaxis , leftaxis this: https://skydrive.live.com/redir?resid=9966bbbe2447aa89!116&authkey=!akm6dmvrxlex5ps and if scroll plot vertically see these 2 series expanding downwards endlessly negative infinity (y coordinate). but wonder if possible 'cut' lower part of series @ y point? retrieve this: https://skydrive.live.com/redir?resid=9966bbbe2447aa89!115&authkey=!agaejdrepknpymy (excuse me links instead of images, don't have permission post them due reputation restrictions) yes, can in all features\welcome!\axes\opaque zones example @ new features demo, available @ teechart's program group, example: unit unit1; interface uses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, teegdiplus, teengine, series, extctrls, teeprocs, chart; type tform1 = class(tform) ...

c++ - Memberspaces may access private members of parent class -

i've been reading this article , , playing around memberspace idiom while when noticed surprised me within snippet (which compiles without problems: http://ideone.com/hriv5b ): class hugeclass { public: struct memberspace { int f() const { return parent.f; } private: friend hugeclass; explicit memberspace(hugeclass & parent) : parent(parent) {} hugeclass & parent; } memberspace; hugeclass() : memberspace(*this), f(42) {} private: int f; }; i have expected compiler error access of hugeclass::f not allowed because f private in context. hugeclass friend of memberspace , hugeclass may call private constructor of memberspace , why work other way around without explicitly declaring memberspace friend of hugeclass ? by language rules in c++11. nested class member , such has same access rights other member. example: ...

Reading multiple XML files from an input stream Java -

how read multiple xml files input stream in java , write them xml files? i have this: inputstream = new gzipinputstream(new fileinputstream(file)); edit: have tar.gz file say, xmls.tar.gz "file" contains multiple xml files. when convert string using: public static string convertstreamtostring(java.io.inputstream is) { java.util.scanner s = new java.util.scanner(is).usedelimiter("\\a"); return s.hasnext() ? s.next() : ""; } i of xml files chained together, file information well. on system.out.println get(this beginning of 1 file): blah.xml 60 0 0 2300 12077203627 10436 0ustar 0 0 <?xml version="1.0"... answer: this worked great me, following on keith's suggestion use apache compress , io: http://thinktibits.blogspot.com/2013/01/read-extract-tar-file-java-example.html import java.io.*; import org.apache.commons.compress.archivers.tar.tararchiveentry; import org.apache...

ServiceStack OrmLite for Oracle hangs during select -

i trying servicestack ormlite (with oracle database). hangs @ db.select .. not throwing exception either.. hangs there if there many data load. i have installed latest oracle instant client ver 12.1 in pc. this ormlite code: namespace consoleapplication1 { class program { static void main(string[] args) { string dbconnection = "server=(description=(address=(protocol=tcp)(host=xxx.xxx.xxx.xxx)(port=9530))(connect_data=(service_name=mysid)));uid=myusername;pwd=mypassword"; var dbfactory = new ormliteconnectionfactory( dbconnection, false, oracledialect.provider); using (var db = dbfactory.open()) { var res = db.select<einduk>().take(10); //<-- hangs here, no stacktrace whatsoever foreach (var einduk in res) { console.writeline(einduk.tostring()); } } console.readline(); ...

java - How to use DispatcherListener in Struts 2 -

there interface dispatcherlistener in struts2. docs says "a interface tag want execute code on init , destroy of dispatcher ." but how use interface. if create class implements interface, how should configure struts2? when dispatcher instantiated, send listener notification when it's initialized or destroyed. reference , code samples here . the simple usage instantiate bean container via bean tag , add in init method , remove when destroyed did classpathconfigurationprovider . the code raw show idea struts.xml : <bean type="com.opensymphony.xwork2.config.packageprovider" name="mybean" class="jspbean.struts.mybean" /> mybean.java : public class mybean implements configurationprovider, dispatcherlistener { public mybean() { system.out.println("!!! mybean !!!"); } @override public void dispatcherinitialized(dispatcher du) { system.out.println("!!! dispatcherinitialize...

java - Blurry Text after setting StyleConstants.setFirstLineIndent as negative in Swing -

im newbie swing applications. need add firstlineindent text , after setting value negative paragraph's first line seems little blurry. unable recognize behavior of styleconstants.setfirstlineindent(attr,-50) method. how rectify error. below link of code using reference: http://java-sl.com/tip_hanging_first_line.html thanks... not sure why example extends jeditorpane. editor pane html. prefer use jtextpane styled text. don't know why custom editor kit used. the following code works me: import javax.swing.*; import javax.swing.text.*; import java.awt.*; //public class hangingindent extends jeditorpane { public class hangingindent extends jtextpane { public static void main(string[] args) { jframe frame = new jframe("negative (hanging) first line indent"); frame.setdefaultcloseoperation(jframe.exit_on_close); final hangingindent app = new hangingindent(); // app.seteditorkit(new myeditorkit()); app.sett...