Posts

java - No empty constructor: android class -

my problem is, transferring 2 arrays between activities. return 1 activity. there getting these 2 activities constructor( think ). correct? why getting error: no empty constructor? here class activites coming from: public planoutputactivity fetchallroutes(string startstop, string endstop, string time) { . . . return new planoutputactivity(convertarray(),routenarray); here activity wanna these 2 arrays: public class planoutputactivity extends activity { intent intent; object[][] routenarray; string[][] itemsarray; databasehelperactivity mdbh; public int result_ok = 123; public int request_ok = 456; public planoutputactivity(string[][] itemsarray, string[][] routenarray){ setcontentview(r.layout.planoutputlayout); this.routenarray = routenarray; this.itemsarray = itemsarray; } @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated constructor stub super.oncreate(s...

ejb - Firing CDI event from interceptor class -

is possible fire cdi events within interceptor ? (using jboss 7.1.1) for example, if have interceptor performanceloginterceptor @interceptors({performanceloginterceptor.class}) public class processhandler extends handlerbase { . . . could fire event such: public class performanceloginterceptor { private logger log = loggerfactory.getlogger("performancelog"); @ejb performancemonitor performancemonitor; @inject event<exceptionevent> exceptionevent; @aroundinvoke @aroundtimeout public object performancelog( invocationcontext invocationcontext ) throws exception { string methodname = invocationcontext.getmethod().tostring(); long start = system.currenttimemillis(); try { return invocationcontext.proceed(); } catch( exception e ) { log.warn( "during invocation of: {} exception occured: {}", methodname, throwables.getrootcause(e).getmessage() ); per...

ios - Create perpendicular line to CGPathRef -

i using skshapenodes dynamically draw lines updating path property user touches screen. once line complete, append new fixed length perpendicular line end of path. i have looked cgaffinetransform rotate new line based on end point of path, far haven't had luck. tips or insight appreciated. some of current code reference looks like: - (void)touchesmoved:(nsset *)touches withevent:(uievent *)event { uitouch* touch = [touches anyobject]; cgpoint positioninscene = [touch locationinnode:self]; //add line new coordinates user moved cgpathaddlinetopoint(pathtodraw, null, positioninscene.x, positioninscene.y); } -(void)touchesended:(nsset *)touches withevent:(uievent *)event { //create local copy of path cgpathref mypath_ = pathtodraw; cgpoint mypoint = cgpathgetcurrentpoint(pathtodraw); //create rectangle append end of line cgrect newrect = cgrectmake(mypoint.x, mypoint.y, 25, 3); cgpathref newpath = cgpathcreatewith...

z3 - Why the unstable branch is not able to prove a theorem but the master branch is able? -

i trying prove theorem in group theory using following z3 smt-lib code (declare-sort s) (declare-fun identity () s) (declare-fun product (s s s) bool) (declare-fun inverse (s) s) (declare-fun multiply (s s) s) (assert (forall ((x s)) (product identity x x) )) (assert (forall ((x s)) (product x identity x) )) (assert (forall ((x s)) (product (inverse x) x identity) )) (assert (forall ((x s)) (product x (inverse x) identity) )) (assert (forall ((x s) (y s)) (product x y (multiply x y)) )) ;;(assert (forall ((x s) (y s) (z s) (w s)) (or (not (product x y z)) ;; (not (product x y w)) ;; (= z w)))) (assert (forall ((x s) (y s) (z s) (u s) (v s) (w s)) (or (not (product x y u)) (not (product y z v)) (not (product u z w) ) (product x v w)))) (assert (foral...

ruby open pathname with specified encoding -

i trying open files telling ruby 1.9.3 treat them utf-8 encoding. require 'pathname' pathname.glob("/users/wes/desktop/uf2/*.ics").each { |f| puts f.read(["encoding:utf-8"]) } the class documentation goes through several levels of indirection, not sure specifying encoding properly. when try it, however, error message ics_scanner_strucdoc.rb:4:in read': can't convert array integer (typeerror) ics_scanner_strucdoc.rb:4:in read' ics_scanner_strucdoc.rb:4:in block in <main>' ics_scanner_strucdoc.rb:3:in each' ics_scanner_strucdoc.rb:3:in `' this error message leads me believe read trying interpret open_args optional leading argument, length of read. if put optional parameters in, in puts f.read(100000, 0, ["encoding:utf-8"]) error message says there many arguments. what appropriate way specify encoding? correct inconsistency between documentation , behavior of class? mac ...

c# - Reference shell32.dll in a programmatically compiled program? -

i need shell32 in program create shortcut. this code: var compiler = new csharpcodeprovider(); var params = new system.codedom.compiler.compilerparameters { generateexecutable = true, outputassembly = outputname, referencedassemblies = { "system.dll", "system.core.dll", "system.windows.forms.dll", "system.drawing.dll", @"c:\windows\system32\shell32.dll" } }; doing this, error: metadata file c:\windows\system32\shell32.dll not opened. attempt made load program incorrect format. found nothing while searching.. wasn't sure search :/ how go doing this? shell32.dll (windows file systems don't care case, "s" or "s" shouldn't matter) not .net assembly , can't treated such. if want call functions exported non-.net libraries, should use dllimportattribute . ...

html - Responsive diamond grid -

Image
i have selection of squares (squares turned 45° diamonds) want use make big diamond shape central red diamond. i having issues organising diamonds , href seems fail. how position responsive diamonds in regular grid ? her my code : body { background: black; color: #000000; font: 13px georgia, serif; line-height: 1.4; font-weight: lighter; text-rendering: optimizelegibility; } #diamond { width: 0; height: 0; border: 50px solid transparent; border-bottom-color: white; position: relative; top: -50px; } #diamond:after { content: ''; position: absolute; left: -50px; top: 50px; width: 0; height: 0; border: 50px solid transparent; border-top-color: white; } #diamond_red { width: 0; height: 0; border: 50px solid transparent; border-bottom-color: #aa1c08; position: relative; top: -50px; } #diamond_red:after { content: ''; position: absolute; left: -50px; top: 50px...