Posts

javascript - Empty and broken pdf file downloaded from UI using spring mvc and apache pdf box -

the following code works fine no error able download file name specified in code issue there no content printed , when open file error saying file damaged. while save file somewhere proper file contents. from ui: var jsonstrtosend = json.stringify( jsonobjtosend ); jsonstrtosend = jsonstrtosend.replace(/"/g, "&quot;"); var url = '/'+apppath+'/reportgeneration' ; var $form = $('<form enctype=\'application/json\' action="' + url + '" method="post">').append($('<input type="hidden" name="data" id="data" value="' + jsonstrtosend + '" />')); $form.appendto("body").submit(); in controller: @requestmapping(value = "/reportgeneration", method = requestmethod.post) public @responsebody void reportgeneration(httpservletrequest request, httpservletresponse response){ map returnmapm...

ios - Perform action button in uitableview cell to perform delete functionality -

i have 1 table view, , in each cell have x button delete particular cell . have done iboutlet of button custom table view cell. , in cell row @ index path have done add target button. when press button in table view cell. app crash. if put braekpoint. showing in target added code line. here code : func followbutton(sender: anyobject) { if let button = sender as? uibutton { print("button clicked: \(button.tag)") let item = addtocartdata[button.tag] print("name: \(item.cartid!)") let headers = [ "cache-control": "no-cache", "postman-token": "4c933910-0da0-b199-257b-28fb0b5a89ec" ] let jsonobj:dictionary<string, any> = [ "cartid" : "\(item.cartid!)", "carttype" : "3" ] if (!jsonserialization.isvalidjsonob...

jquery - Input mask should accept five digits also -

i using jquery input mask plugin like: var s = jquery.noconflict(); s(document).ready(function () { s(".zipmask").mask('99999-9999'); }); it accepts numbers 12345-1111 , works fine. want should support 5 digits if enter "12345" only, should accept it. you must use way: after '?' optional. s(function(){ s(".zipmask").mask("99999?-9999"); });

Translate relative layout and get the changed height in Android Animation -

i want translate relative layout bottom , want continuously changed height of layout. what's right way of doing? animation animation = animationutils.loadanimation(getactivity(), r.anim.slide_up); animation.setduration(333); view.startanimation(animation); right now, using above code don't know how listen changed height. thanks, colin use library : androidviewanimations it has listeners , nice animations, highly reccommended example : refer using android own implemntaion fadeinanimation.setanimationlistener(new animation.animationlistener() { @override public void onanimationstart(animation animation) { } @override public void onanimationend(animation animation) { } @override public void onanimationrepeat(animation animation) { } });

datomic join query execution and metadata -

in java (through jdbc driver) when execute sql join query t1(a, b) , t2(x, y) output contains joined record j(a, b, x, y). along metadata tells me in joined record j fields "a" , "b" came table t1 , fields "x" , "y" came table t2. my question is, when run datomic join query in java, kind of metadata information tells me field in joined record belongs input table? datomic not have tables. triple store. time axis built in. the triple entity-attribute-value. so, can include matched entities in output, along attributes , values. for example, in database triples: [joe :likes :pizza] [joe :favorite-color :gray] [joe :name "joe"] [jane :likes :pizza] [jane :favorite-color :blue] [jane :name "jane"] joe , jane entities (which things having unique identifier , attach attributes), :likes, :name , :favorite-color attributes , :pizza, :grey , :blue values. a query find likes pizza , has favorite-color gray (d/q ...

amazon web services - Policy to block s3 upload based on ec2 instance tag -

is there way apply restriction in s3 buckets using ec2 instance tag. we have couple of ec2 instances. want allow upload s3 ec2 instances have specific tag. no, not possible write policy restricts upload amazon s3 come amazon ec2 instances have specific tag. the reason request amazon s3 comes user or role identified access key. amazon s3 check permissions against user or role. cannot check details of amazon ec2 instance 'sent'. one option assign amazon ec2 instances specific role includes permissions amazon s3, while other instances have different role.

php - WooCommerce Normal Product -> Subscription Product -

i working on , coming website, , interested in allowing consumers - @ checkout - choose if wish subscribe products (and sent them each month). but cannot figure out how can transform normal product subscription product programmatically. have ideas of snippets of code, can me out?