Posts

ios - AV Player observer in Swift - message was received but not handled -

i'm trying implement observer av player in pure swift. i'm getting error: message received not handled. because object argument in constructor of observer i'm using nil? i've placed example code below. thanks player.addobserver(self, forkeypath: "status", options:nskeyvalueobservingoptions(), context: nil) player.addobserver(self, forkeypath: "playbackbufferempty", options:nskeyvalueobservingoptions(), context: nil) player.addobserver(self, forkeypath: "playbacklikelytokeepup", options:nskeyvalueobservingoptions(), context: nil) player.addobserver(self, forkeypath: "loadedtimeranges", options: nskeyvalueobservingoptions(), context: nil) private func deallocobservers(player: avplayer) { player.removeobserver(self, forkeypath: "status") player.removeobserver(self, forkeypath: "playbackbufferempty") player.removeobserver(self, forkeypath: "playbacklikelytokeepup"...

Changing variable names within a loop in MATLAB -

what doing wrong here (matlab)? i want obtain lines ones below: syms b d m l expr11 = -m-b*l*(b-m-d); jqdfe11 = simplify(expr11); with following loop: for k=1:8 lhs=['jqdfe1',num2str(k)]; rhs=['expr1',num2str(k)]; eval('lhs = simplify(rhs)'); end but getting error: error using eval: undefined function 'simplify' input arguments of type 'char' if want working. both lhs , rhs strings whereas in code, interpreted variables. want: eval([lhs ' = simplify(' rhs ')']); lhs , rhs names variables stored strings, , want use actual strings when building string eval . btw, don't know why doing you're doing, consider not using eval . it's bad practice. see post loren shure mathworks on why shouldn't use it: http://blogs.mathworks.com/loren/2005/12/28/evading-eval/

javascript - IE 11 iframe redirect without history (back button) -

i have iframe use display pdf files. ui application on dev.domain.com location, while pdf files hosted on devapi.domain.com. main issue want able change pdf file being viewed, don't want browser button influence content of iframe. in google chrome, works wonderfully: $('#preview-frame')[0].contentwindow.location.replace(url); i when need change pdf, , , good. in ie11, however, access denied errors when running above change pdfs. suggestions on how change content of iframe without influencing button behavior on major browsers?

java - Maven resource filtering not working from 'resources' folder -

i having trouble maven's resource filtering. directory structure is: src |-main |-filters |-java |-resources |-webapp the pom contains following: <build> <filters> <filter>src/main/filters/${environment}/filter.properties</filter> </filters> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-war-plugin</artifactid> <version>2.6</version> <configuration> <filteringdeploymentdescriptors>true</filteringdeploymentdescriptors> <failonmissingwebxml>false</failonmissingwebxml> </configuration> </plugin> ... </build...

java - providing granular data for data intensive web service -

i developing webservice data intensive. unfortunately of data returned not needed calls, might needed call. an overly simplified response might below: response : { a, b, c, d : { x : { } y, z } } i want provide flexibility callers such can request specific data big object. thought of achieving exposing enums, , taking list of enum input. each enum map field in response. example if caller needs , d, can specify passing list of enums immutablelist.of(get_enum_a, get_enum_d) , @ web service end can compute , d. questions: there better way of taking input (other enum) of data needed caller? i give control user on more fine grained data, eg. can specify part of d needed. get_enum_d_x. at server end, thinking of implementing using command pattern, having command each enum , executing if corresponding enum present in list. here d facade. if granular data requested don't use facade instead use command x. issue c...

opencv - Segment character of complicate background -

Image
in optical character recognition (ocr), facing problem of segmenting characters on noisy/complicated background image. have tried 1 easiest image among 3 (as think) attached here. also, have tried contrast enhancement (histogram equalization) since images low contrast. however, segmented characters still have poor quality: connected character, unfilled regions , can not work other images due fixed thresholds. scalar m = mean(src); ( y = 0; y < src.rows; y++ ) { ( x = 0; x < src.cols; x ++ ) { if ( filtered_image.at<uchar>(y,x) > 160 ) { filtered_image.at<uchar>(y, x) = (uchar) m(0); } } } gaussianblur(filtered_image, filtered_image, size(5, 5), 1, 1, 4); imshow("filtered", filtered_image); hardthresholding(filtered_image, filtered_image, 70); imshow("threshold", filtered_image); remove bright spots assigning image average value p...

how to put some text on image on particular area in php using GD -

i want generate online certificates using gd in php, certificate image format ready me. want put candidate name , other details on image text in particular area. have image file in jpg, gif , png format how create watermark on existing image.. //------------------------------------------------------------------------- $wwidth = 280; // set watermark image width $wheight = 50; // set watermark image height // create watermark image $watermark = imagecreate( $wwidth, $wheight ); $black = imagecolorallocate( $watermark, 0, 0, 0 ); // define colour use $white = imagecolorallocate( $watermark, 255, 255, 255 ); // define colour use // create rectangle , fill white imagefilledrectangle( $watermark, 0, 0, $wwidth, $wheight, $white ); // make white transparent #imagecolortransparent ( $watermark, $white ); $font = 'fonts/arial.ttf'; // store path font file $wtext = "(c) chris maggs ".date('y'); // set watermark text $wsize = ...