Posts

Showing posts from September, 2015

java - Unable to make sub reports with Jasper -

i using jaspersoft studio create reports. having sub report in jasper main report. problem unable make work, because if add sub report detail band of main report, sub report generated number of times, row row, entire sub report repeated in number of pages. can't put in summery band due same reason. i unable put in column footer band or other footers because displays below error net.sf.jasperreports.engine.jrexception: net.sf.jasperreports.engine.jrruntimeexception: subreport overflowed on band not support overflow. @ com.jaspersoft.studio.editor.preview.view.control.reportcontroler.fillreport(reportcontroler.java:467) @ com.jaspersoft.studio.editor.preview.view.control.reportcontroler.access$18(reportcontroler.java:442) @ com.jaspersoft.studio.editor.preview.view.control.reportcontroler$4.run(reportcontroler.java:334) @ org.eclipse.core.internal.jobs.worker.run(worker.java:54) caused by: net.sf.jasperreports.engine.jrruntimeexception: subreport overflowe

APEX - Parsing a recursive JSON -

i programming salesforce (apex). input complex , recursive json. { "id":"0", "children":[ { "id":"1", "children":[...] }, { "id":"2", "children":[...] } ] } i need way iterate complex , recursive json (in apex). anyone can help? thanks, hagai if know names of attributes in json object, can create classes represent them , deserialize. instance: public class myobject { public string id; public list<myobject> children; } then write method returns children static list<myobject> getchildren(myobject parent){ list<myobject> children = new list<myobject>(); ( myobject c : parent.children ){ children.addall( getchildren(c) ); children.add(c); } return children; } and put 2 together: myobject parent = (myobject)json.deseria

mysql - What is the correct syntax for a Regex find-and-replace using REGEXP_REPLACE in MariaDB? -

i need run regex find-and-replace against column named message in mysql table named post . my database running mariadb 10. according docs , mariadb 10 has new regexp_replace function designed this, can't seem figure out actual syntax. it affect 280,000 rows, ideally there's way limit changing 1 specific row @ time while i'm testing it, or doing select rather update until i'm sure want. the regex want run: \[quote\sauthor=(.+)\slink=[^\]]+] the replacement string: [quote="$1"] the following tried, throws sql error: update post set message = regexp_replace(message, '\[quote\sauthor=(.+)\slink=[^\]]+]', '[quote="$1"]') post_id = 12 in case, original message was: [quote author=jon_doe link=board=2;threadid=125;start=40#msg1206 date=1065088] , end result should [quote="jon_doe"] what proper syntax make regexp_replace work? you have lot of escaping here: regexp_replace(message, "\\[qu

php - Converting my web app to SSL -

i have server host web app requires log in. log in very insecure. has prompted me want switch on https. if switch on ssl android app, uses http posting website,not allowed work? your android app work ssl. update android app use new https api address on webserver should forward every request going http://example.com/login https://example.com/login this way, current android version continue work, , new android version use https default.

ember.js - ember-cli / ember-data model unit tests using http-mocks -

i using ember-cli / ember-cli-mocha testing. have generated http-mock work when run app via ember serve . however, when run tests -- (e.g. see below...), error: sheet calculates exported fields ✘ assertion failed: unable find fixtures model type (subclass of ds.model). if you're defining fixtures using `model.fixtures = ...`, please change `model.reopenclass({ fixtures: ... })`. i presume unit test setup must set store use fixtures. there configuration somewhere use http-mocks instead? start of test ... 'calculates exported fields', -> # now, exported fields fields , variables expected = `new set()` sheet = null store = @store() ember.run -> store.find('sheet', '1').then( (sheet_)-> sheet = sheet_ promise.all([ sheet.get('fields'), sheet.get('formulas')]) ).then((args)-> [fields, formulas] = args fields.foreach (f)->expected.add(f) ...

java - Submitting a form using html unit -

i want login https://pacer.login.uscourts.gov/csologin/login.jsf . have used html unit submitting login form. here code: public void submittingform() throws exception { final webclient webclient = new webclient(); // first page final htmlpage page1 = webclient.getpage("https://pacer.login.uscourts.gov/csologin/login.jsf"); // form dealing , within form, // find submit button , field want change. final htmlform form = page1.getformbyname("login"); // final htmlsubmitbutton button = form.getbuttonbyname("login:j_idt184"); final htmltextinput textfield = form.getinputbyname("login:loginname"); final htmltextinput textfield1 = form.getinputbyname("login:password"); // change value of text field textfield.setvalueattribute("xxx"); textfield1.setvalueattribute("xxx"); // submit form clicking button , second page. final htmlpage page2 = form.getbuttonbyname("

java - How to retrieve field values by passing field name using JPOS ISO8583 message format -

i want retrieve field values passing filed name .in order achieve have implemented method loop through isomsg object , if found match passed filed name returns .my requirement read .xml file once , have static map using on next time retrieve corresponding value passing field name in order achieve there way retrieve field in config xml. protected static void getiso8583valuebyfieldname(isomsg isomsg, string fieldname) { (int = 1; <= isomsg.getmaxfield(); i++) { if (isomsg.hasfield(i)) { if (isomsg.getpackager().getfielddescription(isomsg, i).equalsignorecase(fieldname)) { system.out.println( " found field -" + + " : " + isomsg.getstring(i) + " " + isomsg.getpackager() .getfielddescription(isomsg, i)); break; } } } } you can define enum field names, mapped field numbers. please note field names may vary packager packager, solution kind of brittle, it's better use enum, or const

jquery - Saxon-CE progressbar while processing, rendering blocked? -

Image
i'm using saxon-ce transform xml file. want set progressbar while xslt processor running. somehow seems view blocked. can't set button's value "transforming...". console.log tells me html value of button changed, somehow it's not rendering. here have far: function xslt(selected){ $('#transform-button').html('transforming ...'); console.log($('#transform-button').html()); var xsltdata = saxon.requestxml("xslt.xsl"); var xmldata = saxon.parsexml("xml.xml"); var xsltprocessor = saxon.newxslt20processor(xsltdata); (i = 0; < selected.length; i++) { var percentage = 100 / selected.length * i; xsltprocessor.setparameter(null, "selected", selected[i]); var result = xsltprocessor.transformtodocument(xmlfile); var resdoc = xsltprocessor.getresultdocuments(); progress(math.round(percentage)); } } i'm using bootstrap's "progre

Unable to invoke method in mocked service from mocked controller using mockito with spring web mvc -

i trying create junit test case spring mvc rest controller , service accessed controller. using mockito doing above. i'm able invoke mock injected controller test case , when debug see mocked userservice available in mocked contoller, method within service object not getting invoked. while debugging observe steps on service method call. i not see kind of exception too. i using maven 3 spring 4.1.1 release version junit 4.11 java version 1.6 i have pasted code below: 1. test class package controller; import java.io.ioexception; import org.junit.before; import org.junit.test; import org.junit.runner.runwith; import org.mockito.injectmocks; import org.mockito.mock; import org.mockito.mockitoannotations; import org.springframework.http.mediatype; import org.springframework.test.context.contextconfiguration; import org.springframework.test.context.junit4.springjunit4classrunner; import org.springframework.test.web.se

How to get node id in drupal 7 -

i developing drupal 7 module. , have added 2 field "teaser" , "doc" custom content type. when user create node using content type, he/she adds doc , save node. after saving node image created first page of doc(creating teaser doc) , saved folder using imagemagick lib. and want node ids link images node. how can node id. please help! you should have used node_save($node) method save node. can node id $node object doing this: $nid = $node->nid;

java - How can i format a decimal value into hours and minutes? -

for example if user input 1.71 (1 hour , 71 minutes), want convert 2.11 (2 hours , 11 minutes) decimalformat time = new decimalformat("##.## p.m"); int userinput = 1.71; system.out.print(time.format(userinput)); parse input date , format date output format: scanner sc = new scanner(system.in); dateformat df = new simpledateformat("hh.mm"); dateformat dfout = new simpledateformat("h.mm a"); date date = df.parse(sc.next()); system.out.println(dfout.format(date));

html - Update bootstrap wysiHTML5 editor textarea in cursor position? -

i using bootstrap wysiwyg editor text area should updated in cursor position when ever adding data pop up. i have done getting old value editor , append new value set in editor. but not right since new values appended in end of old value. should updated cursor located in editor. any suggestions appreciated.

class - How do you import files into the Python shell? -

i made sample file uses class called names . has initialization function , few methods. when create instance of class retrieves instance's first name , last name. other methods greet instance , departure message. question is: how import file python shell without having run module itself? the name of file classnames.py , location c:\users\darian\desktop\python_programs\experimenting here code looks like: class names(object): #first function called when creating instance of class def __init__(self, first_name, last_name): self.first_name = first_name self.last_name = last_name #class method greets instance of class. def intro(self): print "hello {} {}!".format(self.first_name, self.last_name) def departure(self): print "goodbye {} {}!".format(self.first_name, self.last_name) but error: traceback (most recent call last): file "<pyshell#0>", line 1, in <module>

xml - Pass namespace to an included xslt -

i work 2 file transformations. main file contains import statement in second transformation file. second transform file contains several templates generic transformations. problem transformations not same data namespace. wish namespace use in second transform. xslt1 : <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:fo="http://www.w3.org/1999/xsl/format" xmlns:n="http://novamap.fr/xml/data/v1/xmlmodelbondecommande" version="1.0"> <xsl:include href="common.xslt"/> <xsl:template match="/n:xmlmodelbondecommande"> ...... </xsl:template> </xsl:stylesheet> xslt2 : <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:fo="http://www.w3.org/1999/xsl/format" xmlns:n="http://novamap.fr/xml/data/v1/xmlmodeletatdeslieux" version="1.0"> <xsl:include href="common.xslt"/> <xsl:templ

javafx - Calling Fxml file using Start Method which extends Application Class -

i want make new fxml file has few controls label. when run application times not showing , sometime when form showing label not showing. i have written following code: dashboard.fxml: <?xml version="1.0" encoding="utf-8"?> <?import javafx.scene.text.*?> <?import java.lang.*?> <?import java.net.*?> <?import java.util.*?> <?import javafx.scene.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <anchorpane id="anchorpane" prefheight="603.0" prefwidth="1063.0" styleclass="mainfxmlclass" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.dashboard.dashboardcontroller"> <stylesheets> <url value="@dashboard.css" /> </stylesheets> <children> <label fx:id="welcome" layoutx="403.0" layouty="52.0&qu

Show system bar(title bar) in AppCompat Theme Android -

i using appcompat them support v7. trying make 1 screen full screen notification bar visible(solid color or transparent). in styles.xml have this: <style name="theme.myapptheme" parent="@style/theme.appcompat"> <item name="android:windowactionbaroverlay">false</item> <item name="android:windowfullscreen">false</item> <item name="android:windownotitle">false</item> </style> and in class, in oncreate() have this: super.oncreate(bundle); getwindow().addflags( windowmanager.layoutparams.flag_force_not_fullscreen); getwindow().clearflags(windowmanager.layoutparams.flag_fullscreen); still, curious enough, nativation bar still not appear on it's own. there property should using in styles make correct? thank you. style.xml <resources> <style name="appbasetheme" parent="theme.appcompat.light"> </

c++ - Invalid use of template-name 'BigNumber' without an argument list -

hi keep having error message part "bignumber b1,b2,res;" @ button, can any1 me out please, here code. tried adding class, none of them worked, know t might simple alot of guys here,but starting c++, still trying hang of it, please help, many thanks. template <class t> class bignumber { public: bignumber(); ~bignumber(); }; template <class t> bignumber<t>::bignumber(){ front = null; current = null; } template <class t> bignumber<t>::~bignumber(){ } bignumber b1,b2,res; } bignumber template class. so, have provide arguments substitute template parameters. bignumber<int> b1; here int template argument replace template parameter t .

spring - Build url with 'sec:authentication="name"' -

i know if there possibility build url. what use: spring boot + spring security thymeleaf with following expression, username sec:authentication="name" if following, current username display <span id="username" sec:authentication="name">testuser</span> but build url following: <a th:href="@{'~/' + __${{sec.authentication='name'}}__ + '/edit'}" class="text-left">settings</a> with following error: org.springframework.expression.spel.spelevaluationexception: el1009e:(pos 4): property or field 'authentication' cannot set on null any suggestions? thanks in advance. as it's described in docs here: https://github.com/thymeleaf/thymeleaf-extras-springsecurity3 your url should be: <a th:href="@{|~/${#authentication.name}/edit|}" class="text-left">settings</a>

java - Performance issue in Hibernate while using session.merge -

i have method : // method session session = context.gethibernatesession(); transaction tx = session.begintransaction(); private void method(tablealist alist) { for(a : alist) { session.merge(a); } tx.commit(); } when alist contains more 40 50 objects of table a, it's becoming slow , taking lots of time complete. how resolve issue? entity a: /** * persistent class database table. * */ @entity @table(name="a") public class implements serializable { private static final long serialversionuid = 1l; @embeddedid private apk id; @column(name="action_cd") private string actioncd; @column(name="ad_lmt") private bigdecimal adlmt; @temporal( temporaltype.date) @column(name="beg_dt") private date begdt; @column(name="beg_time") private string begtime; @column(name="cst_rma") private bigdecimal cstrma; private string deal; @temporal( temporaltype.date) @column(name="end_dt") private date enddt; @colum

ios - Adobe AppMeasurement Library Changed -

i using appmesurement library adobe tracking application. when tring convert application 64bit architecture found appmeasurement library outdated. tried searching adobe site catalyst download library instead found adbmobile . has adobe changed appmeasurement class , instead have implement adbmobile classes or there still repo can find appmeasurement file , libappmeasurement.a file support 64 bit architecture. any appreciated i've been looking in anticipation of having same upgrade you're working on. i'm afraid don't have practical solution haven't started upgrade yet, i've been looking @ guide starting point estimate effort involved: https://marketing.adobe.com/resources/help/en_us/mobile/ios/migration_v3.html taking @ source code on github looks though have indeed changed namespace of files. as painful it's going both of perform upgrade, it's better commit time , code latest version, try find older version reduces effort. edit

Parse push notification not appearing as System Tray notification on Android (Cordova app) -

i have cordova based android app. have added pushplugin ( https://github.com/phonegap-build/pushplugin ) register device gcm , notified when push notification comes in. i not using parse android sdk. sending push notification using parse.com service. when app running in foreground callback registered in code called data in push. when app suspended or stopped no notification appears in system tray , there no beep or vibration either. see log lines incoming push in adb logcat . instead if send push notification using gcm directly, when app suspended/stopped, proper system tray notification app icon, specified title. there audio alert , vibration. what's different push sent parse.com makes not appear in system tray? , how can make adb logcat print more information push payload itself?

java - Evaluate Postfix Using Stack -

i trying create program evaluates postfix expression.for example "3500 43 12 * 47 2 / + -" .here code public static int evaluatepostfixexpression(string postfixexpr){ stack s = new stack(); int result = 0; string operand = null; for(int = 0; i<postfixexpr.length();i++){ if(character.isdigit(postfixexpr.charat(i)) == true){ operand = operand + postfixexpr.charat(i); if(character.isdigit(postfixexpr.charat(i+1)) == false){ s.push(operand); operand = null; } } if(postfixexpr.charat(i) == '+'){ result = result + integer.parseint((string) s.pop()) + integer.parseint((string) s.pop()) ; } if(postfixexpr.charat(i) == '-'){ result = result + integer.parseint((string) s.pop()) - integer.parseint((string) s.pop()) ; } if(postfixexpr.charat(i) == '*'){

mysql - SQL: select unique substrings from the table by mask -

there sql table mytable has column mycolumn . column has text inside each cell. each cell may contain "this.text/31/" or "this.text/72/" substrings (numbers in substrings can any) part of string. what sql query should executed display list of unique such substrings? p.s. of course, cells may contain several such substrings. and here answers questions comments: query supposed work on sql server. prefered output should contain whole substring, not numeric part only. not number between first "/" , second "/". and varchar type (probably) example: mycolumn contains such values: abcd/eftthis.text/31/sadflh adslkjh abcd/eftthis.text/44/khjgb ljgnkhj this.text/447/lhkjgnkjh ljgkhjgadsvlkgnl uygouyg/this.text/31/luinluinlugnthis.text/31/ouygnouyg khjgbkjyghbk the query should display: this.text/31/ this.text/44/ this.text/447/ how using recursive cte: create table #mytable ( mycolumn varchar(100) ) insert #mytable values

playframework - play! deployment: netty good enough for 5k unique visitors? -

i'm trying figure out deployment process when comes play! apps. i've read resources topic, sources netty enough production apps on other hand friend of mine told me it's not production apps. i'm talking let's 5k unique users day, can handled out of box solution play framework? netty 1 of fastest io library out there. can handle 200k responses / second on ec2 regarding this benchmark . netty library power finagle, twitter's open source rpc system. it can handle 5k user per day.

database - Data in regions of HBase could manually be arranged on basis of family:column's value -

Image
i've been working on hbase couple of week, still in design state project ongoing poc. before ask query let me give brief description of i've inferenced. the basic unit of horizontal scalability in hbase called region. regions subset of table’s data , contiguous, sorted range of rows stored together. when regions become large after adding more rows, region split 2 @ middle key, creating 2 equal halves. the multi-map structure of hbase table can summarized key -> family -> column -> timestamp -> value. hbase, internally, keeps special catalog tables named -root- , .meta. within maintains current list, state, , location of regions afloat on cluster. -root- table holds list of .meta. table regions. .meta. table holds list of user-space regions. entries in these tables keyed region name, region name made of table name region belongs to, region’s start row, time of creation, , finally, md5 hash of of former numbers of rows can stored in region depends upon thr

javascript - Wait for function to finish -

i have function called opslaanmelding() in function insert div text , want let display none after 3 secs. think other function refreshing page time out doens't work any idea wait function finish , let him continue? this code : innerdiv.innerhtml = term; innerdiv.classname = 'classname'; innerdiv.id = 'myid'; console.log(innerdiv.getwidth()); innerdiv.style.marginleft = width- 80 + "px"; innerdiv.style.margintop = "7px"; $('header').insert({after: innerdiv}) settimeout(function() { // display none after 3 secs window.document.getelementbyid('myid').style.display = 'none'; },3000); any idea wait function finish , let him continue you can't prevent function returning 3 seconds without locking ui of browser (and/or getting "slow script" error), of course prevent content appearing , not want. instead, have function accept callback calls when 3 seconds up, , put whatever follo

xml - Cannot scale sitecore with solr search -

i using solr 4.3.0 , referring this document generating schema.xml clicking generate solr schema.xml file in control panel not able figure out should 2 schema.xml files , supposed place it. not proceed until find way. stuck @ page 31 on pdf. open location of solr core configuration, e.g. c:\solr-4.3.0\example\solr\itembuckets\conf copy schema.xml file original-schema.xml login sitecore desktop open control panel -> indexing application select generate solr schema.xml file for source file select original-schema.xml point 2. for target file select schema.xml point 2. click generate > sitecore use original-schema.xml file base , override schema.xml solr configuration configuration containing required changes.

pug - adding attribute in input field of Jade with javascript variable -

i want add attribute in input field local javascript variable as: -var requiredfield = ('agent' == user.account_type.tolowercase()) ? 'required' : ''; input(type='text', name="name", placeholder="name", "#{requiredfield}") but attribute #{requiredfield} in html. how can achieved? i using jade. in advance jade smart enough render required attribute based off of boolean value: required=true or required=false . input(type='text',required=true) input(type='text',required=false) will render out as: <input type='text' required /> <input type='text' /> so code sample, try instead: -var isrequired = 'agent' == user.account_type.tolowercase(); input(type='text', name="name", placeholder="name", required=isrequired)

ios - Capture UIImage from UIView not working -

im trying capture uiimage uiview using imagecontext func captureimage() -> uiimage { uigraphicsbeginimagecontextwithoptions(self.bounds.size, true, 0.0) self.drawviewhierarchyinrect(self.bounds, afterscreenupdates: false) let img = uigraphicsgetimagefromcurrentimagecontext() uigraphicsendimagecontext() return img } i have tried using renderincontext() i have in extension of uiview i use image mapboxview subclass uiview if let viewimage = self.mapview?.resizablesnapshotviewfromrect(frame, afterscreenupdates: false, withcapinsets: uiedgeinsetszero) { let img = viewimage.captureimage() self.view.addsubview(uiimageview(image: img)) } the img getting returned captureimage() function black... viewimage has right contents when add view instead, there wrong capture method. resizablesnapshotviewfromrect return uiview object, don't add object view hierarchy, , don't display view. in case self.drawviewhierarchyinrect draw

c# - Heirarchical nested generic interfaces -

i have chain of hierarchically nested generic interfaces, examples sake this: icar<twheels, tbolts> twheels : iwheels<tbolts> tbolts : ibolts { ienumerable<twheels> wheels { get; set; } } iwheels<tbolts> tbolts : ibolts { ienumerable<tbolts> wheels { get; set; } } ibolts { } is sensible way of handling these generic interfaces? it makes defining methods this: public tcar getcar<twheels, tbolts>(int id) tcar : icar<twheels, tbolts> twheels : iwheels<tbolts> tbolts : ibolts { ... } is there way reduce code signature? generics in c# should used avoid problems you've faced. i'd recommend revise interfaces hierarchy , throw generics away: interface icar { ienumerable<iwheel> wheels { get; set; } } interface iwheel { ienumerable<ibolt> bolts { get; set; } } interface ibolt { } then great @ use-cases, interfaces participate. may be, there rare cases, when you'll need ir

jquery - Open image in same page as lightbox in php -

Image
i have created form in there png image watermark , main image. have open in light-box . code shown below: if(isset($_post['submit'])) { // load watermark , photo apply watermark $stamp = imagecreatefrompng('store/left.png'); $im = imagecreatefromjpeg('store/lighthouse.jpg'); // set margins stamp , height/width of stamp image $marge_right = 500; $marge_bottom = 500; $sx = imagesx($stamp); $sy = imagesy($stamp); // copy stamp image onto our photo using margin offsets , photo // width calculate positioning of stamp. imagecopy($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp)); // output , free memory header('content-type: image/png'); imagepng($im); imagedestroy($im); } and preview of code is: i want while i'm in light-box. how can this? <head> <link rel="stylesheet" href="engine/css/vlightbox1.css" type="text/css" /&

gmail - IMAP search for non-ascii characters -

what command used search non ascii or japanese characters in imap gmail server? the correct way use charset utf-8 search literal. example (each line ends \r\n): > tag uid search charset utf-8 text {4} < + go ahead > term < * search 700 701 702 < tag ok search done term should utf-8 encoded, , 4 should length of search therm, in bytes after encoding. for example, search term 日本 \xe6\x97\xa5\xe6\x9c\xac in utf-8 encoding (6 bytes) > tag uid search charset utf-8 text {6} < + go ahead > <6 bytes of binary data> < * search 700 701 702 < tag ok search done you can use different search keys besides text , such body or to . searching in utf-8 should work on reasonable imap server. other character sets less supported.

Parsing data for xml file in python -

i have following xml file: <address addr="x.x.x.x" addrtype="ipv4"/> <hostnames> </hostnames> <ports><port protocol="tcp" portid="1"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="tcpmux" method="table" conf="3"/></port> <port protocol="tcp" portid="64623"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="unknown" method="table" conf="3"/></port> </ports> <times srtt="621179" rttvar="35357" to="762607"/> </host> <host starttime="1418707433" endtime="1418707742"><status state="up" reason="syn-ack" reason_ttl="0"/> <address addr="y.y.y.y" addrtype="ipv4"/> <ho

java - Code Performance -

in both code single instance used i'm wondering approach better for e.g.: an interface interface a{ void someoperation(); } implementation of interface class aimpl implements a{ private object a; public aimpl(object a){ this.a = a; } void someopearion(){ // ...... // } } factory interface interface factory{ geta(); } factory implementation class factoryimpl implement factory{ a; geta(){ if(a == null){ a=new aimpl(); } return a; } } now there 2 approaches 1 basic difference use factory approach 1: class view{ view(){ somemethod(); } void somemethod(){ factory.geta().someoperation(); } } approach 2: class view{ a; view(){ this.a = factory.geta(); somemethod(); } void somemethod(){ a.someoperation(); } } in approach 1 every operation need access view using factory while in appro

spring - How to change the header element -

i have following code snippet: <int-file:inbound-channel-adapter id="filteredfiles" directory="#{controllerconfig['cycle'].params['semaphore_dir']}" channel="semaphorechannel" filename-pattern="*.xml" prevent-duplicates="false"> <int:poller max-messages-per-poll="1" cron ="#{controllerconfig['cycle'].controllertimer}"/> </int-file:inbound-channel-adapter> ... later in flow in have header enricher: <int:header-enricher id="channel name setter"> <int:header name="channel.id" value="cycle"/> <int:header name="flow.id" overwrite="true" value="#{t(hu.telekom.fdl.util.timebaseduuidgenerator).generateid()}"/> </int:header-enricher> the problem although used overwrite="true" property flow.id seems unchanged when inbound-channel-adapter reads second file.

php - the sum of entered number with old number in the database -

i have 3 fields , table in database called "support" name:<input type="text" name="name" id="name" value=""/> <br><br> serial:<input type="text" name="badge" id="badge" value=""/> <br><br> quantity:<input type="text" name="address" id="address" value=""/> <br><br> if name , serial exists in database (the quantity field) can sum of entered number old number in database. example, quantity 5 insert value 6 quantity 5+6= 11. how can ? you can use simple sql query after parameters $_post : update support set quantity = quantity + ? serial = ? , name = ? # passing escaped parameters form first parameter $_post['address'] , second $_post['badge'] , third $_post['name']

How to make every variable in Matlab workspace accessible to every function? -

when running matlab script command window, running correctly. script uses functions, had make variables global. now, when running script callback function of toggle button in gui, getting errors. errors seem coming variables being in accessible. am missing ? whats solution kind of problem ? when running script callback function, script has access workspace of "caller" function, i.e. callback function workspace, not base workspace. need make sure each function has access variables needs, either making them global, or preferentially passing them arguments functions. way, code more portable, , doesn't rely on variables may or may not exist in base workspace. in gui, can use handles structure store data necessary callback functions execute.

php - List products that almost matches the search query even when there is spelling mistake -

am trying code simple php mysql website. list simple products. site wide search, wanted fetch results if there's small typo in search terms. example, if user searches "nkia" instead of "nokia", should list out "nokia" products in search results. something search functionality in flipkart.com have in mind. so, how that?

java - How to use rabbitMQ? -

i have downloaded rabbitmq , seeking tutorial . i'm not in java @ , don't know how solve problem. problem error error: package com.rabbitmq.client not exist import com.rabbitmq.client.connectionfactory; error: package com.rabbitmq.client not exist import com.rabbitmq.client.connection; error: package com.rabbitmq.client not exist import com.rabbitmq.client.channel;` i have downloaded server , client jars from website , don't know how include stuff in java project. also i'm using netbeans 8.0.2 that class on amqp-client jar, sure have jar in classpath. if using maven, can add: <dependency> <groupid>com.rabbitmq</groupid> <artifactid>amqp-client</artifactid> <version>${amqp.client.version}</version> </dependency> or donwload jar maven central: http://search.maven.org/#artifactdetails%7ccom.rabbitmq%7camqp-client%7c3.4.2%7cjar

ios - Navigation Styling throughout app -

is there way implement below code styling of navigation bar in viewdidload or globally somehow, instead of pasting in every vc? thanks. // navagation styling viewcontroller.title = @"nav title"; [viewcontroller.navigationcontroller.navigationbar settitletextattributes:[nsdictionary dictionarywithobjectsandkeys:[uifont fontwithname:@"gibson-light" size:20.0], nsfontattributename, nil]]; uibarbuttonitem *rightbarbutton = [[uibarbuttonitem alloc] initwithtitle:nil style:uibarbuttonitemstyleplain target:viewcontroller action:nil]; rightbarbutton.image = [uiimage imagenamed:@"settings_cog"]; rightbarbutton.tintcolor = [uicolor graycolor]; viewcontroller.navigationitem.rightbarbuttonitem = rightbarbutton; you can

Prolog beginner, member/2 builtin predicate -

i have this: someuserdef(a,[b,c,d]). when try ?- someuserdef(a,l),member(b,l). i don't true or false answer list l=[b,c,d] ; false. how true or false answer? you're asking prolog give value of l matches both rules. if can tell there's 1 answer, return yes - otherwise give first answer, return no , , prompt before checking more answers. when you're providing variables (capital letters) prolog queries, return matches - it's when ask check rules (with no variables) e.g. someuserdef(b, [b, c, d]) return yes or no indicate whether assertion true or false.

Where to specify key and IV value when doing AES encryption/decryption in Android? -

i working on aes encryption , decryption in android. have audio file encrypted using aes/cbc. have key , iv (initialization vector). i have read links. this secretkeyspec skeyspec = new secretkeyspec(raw, "aes"); the secretkeyspec class used. should use key , iv values? and need decrypt first 256 bytes data only. how can achieve this? in code snippet, raw key (as byte array): secretkeyspec skeyspec = new secretkeyspec(raw, "aes"); // ^^^ key of course, if have key hex string, you'll need convert bytes . when encrypting, can either specify iv or let random 1 generated. if want specify yourself, use: cipher cipher = cipher.getinstance("aes/cbc/pkcs5padding"); // adjust padding cipher.init(cipher.encrypt_mode, skeyspec, new ivparameterspec(...)); if want use automatic one, sure record 1 chosen calling cipher.getiv(); for decryption, must specify iv , using ivparameterspec , encryp

Convert a list of strings into individual string in Python -

a newbie question apologize if it's basic. have set, myset, filled reading csv file see below printed representation. set(['value1', 'value2']) the number of elements on set arbitrary, depending upon read file. want add entries on csv file using individual elements of set. i've tried: file_row = ['#entry','time', str(myset), 'cpu usage'] print file_row filewriter.writerow(file_row) however output is: #entry,time,"set(['value1', 'value2'])",cpu usage where wanted #entry,time,value1,value2,cpu usage. can suggest how desired result ? you approach follows: file_row = ['#entry','time'] # start pre-myset elements file_row.extend(myset) # add on myset file_row.append('cpu usage') # add final item note using set means order of elements arbitrary.

html - How to continue CSS animation on :hover after mouse leave the element? -

there example of animation: .b-ball_bounce {transform-origin: top;} @-webkit-keyframes ball_animation { 20% {transform: rotate(-9deg);} 40% {transform: rotate(6deg);} 60% {transform: rotate(-3deg);} 80% {transform: rotate(1.5deg);} 100% {transform: rotate(0deg);} } .b-ball_bounce:hover { -webkit-animation: ball_animation 1.5s; animation-iteration-count: 1; } when mouse hover element animation start. when mouse leave, animation stops immediately. want finish animation after mouse leave. this example of javascript: http://codepen.io/profesor08/pen/pvbzjx , want same pure css3, there how looks now: http://codepen.io/profesor08/pen/wbxeow you can lot of stuff transition: #some-div { background-color: rgba(100,100,0,0.2); transition: background-color 0.5s ease; } #some-div:hover { background-color: rgba(100,0,0,0.7); } look @ jsfiddle or here more

css - How to fix issue with Internet Explorer 11 rendering text before applying @font-face which lead to text overflow -

Image
at company website use custom web font using @font-face named helveticaneue . works except in internet explorer 11 here referring ie11. in request, first time visitors or on hard refresh, internet explorer first render text (wrapping text soft line breaks) , apply web font. since helveticaneue lot wider browsers default web font text needs re-rendered fit container. other browsers have tested dose fine not ie11. remember, not happen every time tested on multiple computers same result. i have attached image explain issue. as shown in image above text breaks layout , run out of it´s container or cropped due css overflow: hidden; . is there way force ie11 either load font before rendering text or force re-render after font loaded... or other idea solution? the page issue. and here css used include font in external stylesheet. @font-face{ font-family: 'helveticaneue'; src: url('../../typo3conf/ext/site/resources/public/fonts/helveticaneuebold-we

javascript - Submit payload data as a non json format with Ext.ajax.Request -

i want submit data using ext.ajax.request , payload being sent in json format: {name: 'john gold', id:1, company:'abcde'} but, want submit payload in simple format: name=john+gold&id=1&company=abcde how can achieve ? my method looks like: ext.ajax.request({ url: url, method: 'post', params: payload, success: function(response) { var data = ext.decode(response.responsetext).data; console.log("search data : *** \n" + data); this.fireevent("aftersubmit", params, data); }, scope: }); use method: 'get' if want params in url. update you'll got convert payload then... ext.ajax#request accepts string params option, , "url encode" data object ext.object.toquerystring . that: ext.ajax.request({ // ... method: 'post', params: ext.object.toquerystring(payload) });