Posts

c - Taglib for Android -

i trying compile taglib android. have downloaded latest version taglib here . after compiling arm-linux build have imported in application, when try call function tag_c.h getting following error: sharedlibrary : taglibwav.so /home/test/workspacenew/androidtaglibexample/obj/local/armeabi/ objs/squared/taglibwav.o: in function `java_com_android_androidtag_wavfiledetails_taglibwav': /home/test/workspacenew/androidtaglibexample/jni/taglibwav.c:30: undefined reference `taglib_set_strings_unicode' collect2: ld returned 1 exit status make: *** [/home/test/workspacenew/androidtaglibexample/obj/ local/armeabi/taglibwav.so] error 1 application configuration information is: taglib ./configure :- ./configure cc="/home/hcl/taglib/taglib/toolchain/bin/arm-linux-androideabi-gcc"\ --host="arm-linux" \ --build="arm" \ --enable-static="no" \ --enable-shared="yes" \ --prefix="/home/test/workspacenew/androidtaglibexample/j...

marshalling - Grails JSON marshaller for FieldErrors -

i'm trying create custom marshaller org.springframework.validation.fielderror can avoid putting extraneous , possibly sensitive data in json response, includes mycommandobject.errors . however fielderror marshaller isn't working @ all, have in bootstrap.groovy under init method. def fielderrormarshaller = { log.info("field error marshaller $it") def returnarray = [:] returnarray['field'] = it.field returnarray['message'] = it.message return returnarray } json.registerobjectmarshaller(fielderror, fielderrormarshaller) i not seeing explicit errors or marshaller logging. idea might going wrong here? grails register instance of validationerrorsmarshaller handle errors, fielderror marshaller never called. //convertanother not called each error. that's reason of custom marshalled not been called. (object o : errors.getallerrors()) { if (o instanceof fielderror) { fi...

c++ - delete via a pointer to Derived, not Base -

i implemented basic smart pointer class. works following type of code. (considering base1 has public constructor) sptr<base1> b(new base1); b->myfunc(); { sptr<base1> c = b; sptr<base1> d(b); sptr<base1> e; e = b; } but in test code has protected constructor(i need way). , code sptr<base1> sp(new derived); produces following error (notice derived): sptr.cpp: in instantiation of ‘my::sptr<t>::~sptr() [with t = base1]’: sptr.cpp:254:39: required here sptr.cpp:205:9: error: ‘base1::~base1()’ protected sptr.cpp:97:17: error: within context the problem have make sure delete via pointer derived, not base1. how can that? here class code (clipped show constructor , distructor , class members) template <class t> class sptr { private: t* obj; // actual object pointed rc* ref;// reference object keep track of count public: //declarations template <typename t> sptr<t>::sptr():obj(null),ref(...

php - Using preg_match or regx to replace a lot of words inside a html -

is there solution me convert html of following format <span xmlns:v="http://rdf.data-vocabulary.org/#"> <span typeof="v:breadcrumb"> <a href="http://link1.com/" rel="v:url" property="v:title">home</a> </span> / <span typeof="v:breadcrumb"> <a href="http://link2.com/" rel="v:url" property="v:title">child 2</a> </span> / <span typeof="v:breadcrumb"> <a href="http://link3.com/" rel="v:url" property="v:title">child 3</a> </span> / <span typeof="v:breadcrumb"> <span class="breadcrumb_last" property=...

perl - Process two space delimited text files into one by common column -

this question has answer here: merge 2 files key if exists in first file / bash script [duplicate] 2 answers i have 2 text files like: col1 primary col3 col4 blah 1 blah 4 1 2 5 6 ... and cola primary colc cold 1 1 7 27 foo 2 11 13 i want merge them single wider table, such as: primary col1 col3 col4 cola colc cold 1 blah blah 4 7 27 2 1 5 6 foo 11 13 i'm pretty new perl, i'm not sure best way this. note column order not matter, , there a couple million rows. files unfortunately not sorted. my current plan unless there's alternative: given line in 1 of files, scan other file matching row , append them both necessary new file. sounds slow , cumbersome though. thanks! solution 1. read smaller of 2 files line line, using standard cpan delimited-file pa...

html5 - Assigning value of 'this' in JavaScript constructor -

i'm learning javascript , i'm playing html5 canvas api. since first have create canvas element, , 2d/3d context (which 2 unconnected variables) seemed logical create merge 2 one. idea have graphics ( gfx ) object (which context object) , graphics.canvas reference canvas element can gfx.fillrect(0,0,150,75); , maybe re size canvas gfx.canvas.width = x; etc... when try create constructor function, doesn't work out, have come solution return context object canvas property i'm not sure if right way. what best approach problem? here's code: function canvas (context, width, height) { var canvas = document.createelement('canvas'), contex = canvas.getcontext(context); = contex; // <<-- getting error here this.canvas = canvas; this.canvas.width = width; this.canvas.height = height; this.append = function () { document.body.appendchild(this.canvas); }; } function canvas2 (context, width, height) { ...

php - class variable functions -

say $this->varname equal string is_callable() returns true. call i'd have $temp = $this->varname; $temp(); or... there way call without having create 2 lines? the problem doing $temp = $this->varname() that'll try call method within class called varname() - won't call function @ $this->varname. thanks! you have or use call_user_func(_array) . or anthony has suggested me on internals ( http://www.mail-archive.com/internals@lists.php.net/msg64647.html ) can ${'_'.!$_=$this->varname}(); . there exists pull request php being discussed on internals: https://github.com/php/php-src/pull/301 (and rfc https://wiki.php.net/rfc/fcallfcall )