Posts

Showing posts from June, 2014

wordpress - Applying second discount in Woocommerce - after bulk discount -

in online store have applied bulk discount (i.e. percentage reduction based on quantity purchased). works great. want apply second discount mechanism customer can select criteria dropdown box , discount applied again. second category schedule i.e. daily, weekly, monthly service - ie how service purchased delivered. reduce unit price i.e. 1 product. i not using subscription method customer invoiced once month - i.e. not based on drop down (daily, weekly) select. any suggestions appreciated.

Triangle number pattern in python -

i'm doing patterns in python can't seem pattern change. print("\npattern c") c in range(1, 7 + 1): cc in reversed(range(1, c)): print(cc, end = '') print('') this outputs: pattern c 1 21 321 4321 54321 654321 but want output: 1 21 321 4321 54321 654321 can please? you have add spaces in way. 1 way subtract current counter fixed value , print many spaces. for c in range(1, 7 + 1): print(' '*(7-c), end='') cc in reversed(range(1, c)): print(cc, end = '') print('') as aaron hall mentions in comments, there other ways produce output. example, single print() (and num representing 7+1 value above, , reversed() replaced different range() object): for c in range(1, num): print(' '*(num-1-c), *range(c-1, 0, -1), sep='')

c++ - Insertion comparison #'s seem too big -

i confused if these comparison numbers supposed large in value vector 100 random two-digit numbers. full program --> safe link: https://ideone.com/oybdbd program output @ bottom page of link. appreciate input. int insertionsort (vector<int> &v) { int j, temp, counter = 0; (int = 1; < v.size(); i++) { j = i; while (++counter && j > 0 && v[j] < v[j-1]){ temp = v[j]; v[j] = v[j-1]; v[j-1] = temp; j--; } } return counter; } the average case performance of insertion sort o(n^2) (see wiki entry ). vector of 100 elements, expected number of comparisons therefore o(10000) . coming out 2656 or, in second run, 4995, comparisons therefore lower might otherwise expect.

wso2is - Using Username and email as login in wso2 -

i followed document http://xacmlinfo.org/2014/10/07/email-username-with-identity-server/ allow users login email id.but is mentioned if enable <enableemailusername>true</enableemailusername> then users cannot login username or attribute other email. our use case ldap secondary user store , in time provisioning.so need allow users login either email or username. there way achieve this. you have follow this guide achieve this. following steps need follow. step 1 configure ldap user store related configurations using user-mgt.xml file found in /repository/conf directory. configure usernamesearchfilter helps search user object in ldap using both mail , uid attributes. <property name="usernamesearchfilter">(&amp;(objectclass=person)(|(mail=?)(uid=?)))</property> disable userdnpattern property, if enabled. <!--property name="userdnpattern">uid={0},ou=users,dc=wso2,dc=org</property--> the mail

Android Studio 2.0 Cannot launch AVD in emulator -

i can launch avds targets android 5.1 (google apis) , android 6.0 (google apis), both using cpu=x86. avd create android 4.1 (google apis) using cpu=arm cannot launched. when try launch see dialog: cannot launch avd in emulator. output: emulator: error: avd's configuration missing kernel file!! emulator: error: android_sdk_root undefined since 2 avds work i'm sure android_sdk_root defined. i've verified file -> project structure -> sdk location correct. i have run android sdk manager, uninstalled api 16 items , reinstalled these api 16 items: sdk platform intel x86 atom system images arm eabi v7a system image google apis sources android sdk within android sdk manager other libraries , packages date. , have restarted windows 7 computer. also note forced create api 16 avd cpu=arm rather using cpu=x86 android virtual device manager, when showing available system images, not show x86 image target=android 4.1 google apis). does know problem is? or suggest

C-Style i++ for is deprecated in swift issue -

i want increment index @ point loop prints 1,3,5 want to. warning c-style statement deprecated , ... i know means. for var index=0; index<5; index++ { //if condition == true index++ //else without index++ print(index) // print 1, 3, 5 } so changed to: for var index in 0..<5 { //if condition == true index += 1 //else without index++ print(index) // print 1,2,3,4,5 should 1,3,5 side } i wondering why index not mutable? though have set var or solutions issue. the index not mutable because for var x in y { ... } is equivalent to for temp in y { var x = temp ... } where var makes x copy of temp . when modify x , won't modify real index temp (this reason why se-0003 introduced) the c-style for loop can reduced while loop: var index = 0 while index < 5 { if conditiona { index += 1 } print(index) index += 1 }

linux - Making bash profile visible for non login shell -

i have .bash_profile , have several commands in shell. have logged in user1. in terminal, su - user2. when i'm user2, i'm not able call these commands have created in .bash_profile. how make path elements , environment variables visible user2 well? when echo $path when using user2, this: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/usr/local/go/bin when echo $path using user1, lot more. how make additional path elements visible user1? su <user> (without - ) not read < user > 's shell initialization files. leaving previous users' settings.

c# - Modify only part of object properties -

i have class structure this: [xmlroot(elementname = "details")] public class details { [xmlelement(elementname = "size")] public string size { get; set; } [xmlelement(elementname = "length")] public string length { get; set; } } [xmlroot(elementname = "notes")] public class notes { [xmlelement(elementname = "text")] public string text { get; set; } } [xmlroot(elementname = "data")] public class data { [xmlelement(elementname = "id")] public string id { get; set; } [xmlelement(elementname = "name")] public string name { get; set; } [xmlelement(elementname = "filename")] public string filename { get; set; } [xmlelement(elementname = "status")] public string status { get; set; } [xmlelement(elementname = "date")] public string date { get; set; } [xmlelement(elementname = "details")] public de

php - laravel 5.2 ajax controller switch language internal server error -

i'm trying create ajax controller switch locate, here code: frontend jquery : <script language="javascript"> $( "#lang" ) .change(function () { $.ajax({ method: "post", url: "{{ url('/lang') }}", headers: { 'x-csrf-token': $('meta[name="csrf-token"]').attr('content') }, data: { name: "john", location: "boston" } }) .done(function( msg ) { alert( "data saved: " + msg ); }); }) </script> controller: namespace app\http\controllers; use illuminate\http\request; use app\http\requests; use app\http\controllers\controller; class langcontroller extends controller { // public function lang () { /*$rules = [ 'language' => 'in:en,zh-tw' //list of supported languages of application. ];*

Ways to automate SSIS packages -

Image
i have ssis package needs run daily. needs excel execute active tasks in package. cannot install excel in sql server have, cannot create sql job run ssis package. there other options automate ssis packages? you don't need install excel on sql server in order use excel source or destination. do, however, need box clever. i'd recommend project deployment ssisdb. use sql agent schedule. within sql agent job step --> configuration --> advanced , click on 32-bit runtime.

html - Dashed border around an element with the top part of left border being skewed/angled -

Image
i want create border in below image: i had written code <p>some text</p> p{ -webkit-transform: perspective(158px) rotatex(338deg); -webkit-transform-origin: right; border: 2px dashed red; } but code doesn't return output expect , different image. want skew top part of left border in image. border corner. how can create border attached image style? thank's using css: you can single element using couple of pseudos , dashed borders. the shape formed follows: the borders on bottom , left side (apart skewed part) of element created using dashed borders on parent element. the border on top of element created using :after pseudo-element. pseudo element 40px less in width compared parent because top border starts after skewed border area. element 40px in height , positioned above container using absolute positioning. the border on right side created partially parent element , partially :after pseudo-element. the skewed area of border

c - Is the new connected socket returned by accept() always bound to the same port as the listening socket? -

i tested on machine creating new connections until failure. on machine new connect() / accept() requests fail* @ near 700 socket connections (sock_stream); @ client/server respectively, on loopback ip address. socket file descriptor returned accept(), far, bound same port listening socket. my question - if behaviour true machines why accept() limiting connections creating connected sockets bound same port listening socket? couldn't number of connections server can make increased if new sockets bound random ports (like connect() does)? also, why accept(sock_fd, null, null) failing "efault - addr argument not in writable part of user address space." after 700 successful iterations of same call? similarly, why does, connect() fail "efault - socket structure address outside user's address space." after 700 successful iterations of same call? * efault - bad address (after both accept()/connect()). when listening, connections have same

android - how to update list after deleting an item? -

i want delete item arraylist , update after delete. query performing delete operation list not getting updated. below onitemlongclicklistener code. listview.setonitemlongclicklistener(new adapterview.onitemlongclicklistener() { @override public boolean onitemlongclick(adapterview<?> parent, view view, int position, long id) { help.deleteentry(position); adapter.remove(adapter.getitem(position)); adapter.notifydatasetchanged(); toast.maketext(search.this, "delete..", toast.length_short).show(); return true; } }); delete code of databasehelper. public void deleteentry(long id) { // delete row in user table based on id sqlitedatabase db = this.getreadabledatabase(); db.delete(table_name,key_id + " = " + id,null); } i notice 2 things here first don't pass position delete row database id auto increment , secondly delete should getwriteabl

WGET Download specific folders under an apache directory -

i want download folders under same directories using wget , here structure of apache directory. example.com/main/eschool/photoalbum/album/2008-10-13-citieneducationcenter/ example.com/main/eschool/photoalbum/album/2009-11-12-snfkdgjndfk/ example.com/main/eschool/photoalbum/album/2012-10-9-dsngosdgndfk/ ... it found there pattern: example.com/main/eschool/photoalbum/album/20* , possible download folders? if want download under example.com/main/eschool/photoalbum/album/ , not above it, can use --recursive , --no-parent options: wget --no-parent --recursive http://example.com/main/eschool/photoalbum/album/ that download below album directory. if want limit how deep wget dives subdirectories, can specify --level option: wget --no-parent --recursive --level=3 http://example.com/main/eschool/photoalbum/album/ that drill down 3 subdirectories below album . however, neither of these methods filter name – blindly download everything in directory, , subdir

jquery - How to change the route value of a action link and keep the id value we need in mvc c# -

here problem.i have html action link have given id .(because when user clicks on want id value controller.it works fine) this html action link. <div class="col-md-6 btn btn-default"> @html.actionlink("more details", "details", new { @did = @items.cruise_id }) </div> this controller,where id value. public actionresult details(string did) { debug.writeline(did); return view(); } then, when user clicks on link `path/url' in browser address bar looks this http://localhost:3199/home/details?did=ma20160821bribri what i'm asking , is possible change url or path need, should have id (in case did ),to value in controller using c# or jquery. if possible, when user copy,paste , run url, should work fine line same. the main idea ,i want did ,but should not show in url(path), , when copy/paste should work fine. hope this.

javascript - Autofocus In Horizontal Scroll -

Image
i have horizontal scroll-able div list items.which looks below. want list autofocused when user clicks on list items. presently, list item sits @ position. there way in javascript or jquery autofocus list item ? following css used making horizontal scroll div on ul white-space: nowrap; overflow-x: auto; on li display: inline-block !important; float: none; you can try this, $(yourelement).trigger("focus").

When using mandrill do i need to verify domain in mailchimp as well -

Image
since mailchimp taking on billing , management of mandrill accounts, mean sending domain wish send via mandrill needs verified sending domain in mailchimp? i cannot find clear answer on happen come 27th when legacy mandrill accounts suspended. you won't need verify in both mandrill , mailchimp @ time. depending on when account created, may need perform additional verification step. in mandrill, go sending domains page in account. sure there three checkmarks each of sending domains want continue using (like second 1 shown below). if don't see third checkmark (like first line), click button (top right of table) says "verify domain" generate verification email.

encryption - Android: Store SecretKey in KeyStore -

i use secretkey encrypt sensitive data in application. storing secretkey in base64 encoded format in db or sharedprefs not safe place store secret on rooted phone. hence, want move secretkey android keystore . problem facing when try this sample code google, expects privatekey instead of secretkey. couldn't figure out way store secretkey in keystore , fetch later use. tried this: private static void writesecretkeytokeystore(secretkey secretkey, context context) { keystore keystore = null; try { keystore = keystore.getinstance("androidkeystore"); keystore.load(null); keystore.secretkeyentry secretkeyentry = new keystore.secretkeyentry(secretkey); keystore.setkeyentry("key", secretkeyentry.getsecretkey().getencoded(), null); } catch (keystoreexception e) { e.printstacktrace(); } catch (certificateexception e) { e.printstacktrace(); } catch (nosuchalgorithmexception e) { e.printstacktrace(); } catch (ioexception e) { e.printstacktrace(); }

Build SOA composties with Ant -

i have build automation setup in ant soa projects. recompiles code if there no change in code. can please suggest me way out can compile changed soa composites? use uptodate ant.apache.org/manual/tasks/uptodate.html <target name="anythingchanged"> <uptodate property="xmlbuild.notrequired" targetfile="${deploy}\xmlclasses.jar"> <srcfiles dir= "${src}/xml" includes="**/*.dtd"/> </uptodate> </target> <target name="xmlbuild" depends="anythingchanged" unless="xmlbuild.notrequired"> ... </target>

asp.net core - dnx-watch stopped working and throwing ArgumentException because directory was not found -

i have asp.net core (rc1 final) solution multiple projects. have web project in c:\projects\mysolution\src\web , multiple class lib projects in c:\projects\mysolution\src. class libs added project references in web app. i've been running web app using dnx-watch web long time without problems, it's crashing following exception: c:\projects\mysolution\src\web > dnx-watch web [dnxwatcher] info: running dnx following arguments: --project c:\projects\mysolution\src\web\project.json web [dnxwatcher] info: dnx process id: 40668 system.argumentexception: directory name c:\projects\mysolution\src\multitenancy\project.json invalid. @ system.io.filesystemwatcher..ctor(string path, string filter) @ system.io.filesystemwatcher..ctor(string path) @ microsoft.dnx.watcher.core.filewatcher.addwatcher(string path) @ microsoft.dnx.watcher.core.filewatcher.watchproject(string projectpath) @ microsoft.dnx.watcher.core.dnxwatcher.addprojectanddependeciestowatcher(iproject

azure - Not able to load Microsoft.WindowsAzure.ServiceRuntime, Version=1.8.0.0, ............. Local works fine -

after publishing cloud based application (web role) visual studio, application gives following error on accessing landing page. could not load file or assembly 'microsoft.windowsazure.serviceruntime, version=1.8.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' or 1 of dependencies. system cannot find file specified. locally same application works fine. have kept reference of microsoft.windowsazure.serviceruntime copy local attribute true in property while publishing site. i using azuresdk 2.0 , have reference of storage services of version 2.0 in reference folder. i have following in web.config file. still getting above error. please suggest how solve issue. expand references section in visual studio , mark azure dlls copy local = "true" - azure sdk dlls need included in bin directory not gaced. if fails, add assembly binding redirect web.config... <dependentassembly> <assemblyidentity name=&quo

c# - Inserting date into database when we insert data to database every time display inserting date in asp.net -

when inserting data database need insert date pass insert query in query inserted data took date column default sql database date format want display when user enter data insert data base date want display tried query is: string s = "insert batchpermissons(batchid,subjectid,auditoname,audioid,createdby,createddate) values(" + batchno + ", " + subjectid + " , '" + audiotoname + "', " + audioid + ",'" + cby + "'," + datetime.now.tostring() + ")"; sqlcommand cmd = new sqlcommand(s, con); cmd.commandtype = commandtype.text; cmd.connection = con; con.open(); cmd.executenonquery(); con.close(); but above query inserting default date in database.i need insert when insert data particular date store can 1 me out. you can replace datetime.now.tostring() "getdate()" . take date sql server. or add format tostring datetime.now.tostring("yyyy-mm-dd hh:mm:ss");

excel vba - Store whole format of a cell in a variable -

background i want write simple function swaps contents of 2 selected (not adjacent) cells. do not want copy cell temporary cell first. thus, want swap cells in place. challenge while swaping content rather easy using variant temporary variable holding content of cell 1, overwriting content of cell 1 content of cell 2 , writing content of variant variable cell 2, struggle how copy format related stuff. there plenty of slots need consideration ( .numberformat, .interior name two). need copy each of them seperately or there easier way swap format without using temporary cell? code public sub swapcells(optional bolwithformat boolean = true) 'purpose: switch content of 2 cells on error goto errhandler dim rngsel range dim varcontent variant set rngsel = selection if (rngsel.count = 2) rngsel.cells(1) varcontent = .value .value = rngsel.cells(2).value rngsel.cells(2).value = varcontent end

Send a post login from java code and get cookie authentication -

i need login iis web-server. after login, need send http post lot of data. however, don't know how save cookies login , reuse them subsequent http calls. my code private final static logger logger = logger.getlogger(httpurlconnectionexample.class); private static final string certificate_client = "/src/main/resources/clientcert.jks"; private static final string javax_net_ssl_key_store_password = "javax.net.ssl.keystorepassword"; private static final string javax_net_ssl_key_store = "javax.net.ssl.keystore"; private static propertiesmanagement management; private static final string login_page = "https://alloggiatiweb.poliziadistato.it/alloggiatiweb/login.aspx"; private static final string cookies_header = "set-cookie"; private static cookiemanager mscookiemanager = new cookiemanager(); private static final string internal_page = "https://alloggiatiweb.poliziadistato.it/alloggiatiweb/analisi.aspx"; private http

Javascript function as parameter - Browser compatibility -

i know the ability pass function names parameters handled modern browsers, i'm wondering older browsers compatibility: what first version of javascript/ecmascript supported it? supported since first days of javascript? (that surprise me) what versions of each of major browsers (google chrome, firefox, ie, safari, opera, etc.) first supported it? as far i'm aware, functions have been objects, , objects have been passable arguments.

Sim900 only echos back the commands- No response -

i'm using atmega32 , sim900 project. keep sending "at" command , wait "ok" response, getting at\r\n. i've checked , rechecked wiring , baud rate, still getting no where. whatever send sim900 echoed of same transmitted string. can me please? i'd appreciate it. i'm posting code here: int sim900_init(void) { while(1) { sim_command("at"); _delay_ms(2000); } return 0; } void usart_init(void) { /************enable usart***************/ ubrrh=(uint8_t)(myubrr>>8); ubrrl=(uint8_t)(myubrr); //set baud rate ucsrb=(1<<txen)|(1<<rxen); //enable receiver , transmitter ucsrc=(1<<ucsz0)|(1<<ucsz1)|(1<<ursel); // 8bit data format ucsrb |= (1 << rxcie); // enable usart recieve complete interrupt (usart_rxc) /***************flush privious activities********************/ flush_usart(); /*********appoint pointers arrays**

javascript - Print Var in JsFiddle -

Image
how print result screen in jsfiddle javascript. can't use document.write() , doesn't allow it, neither print . what should use? to able see output console.log() in jsfiddle, go external resources on left-side panel , add following link firebug: https://getfirebug.com/firebug-lite-debug.js

.net - C#: Variable changes value while processing -

this question has answer here: what kind of memory semantics govern array assignment in c#? 7 answers my variable changes value while processing. here's code. private string[] rawlayer; private string[] lastrawlayer; public bool getdisplaymessage(string message) { lastrawlayer = rawlayer; rawlayer[0] = "1"; console.writeline(lastrawlayer[0]); //output = "1" return true; } why output "1"? when calling lastrawlayer = rawlayer; add new reference array rawlayer instead of creating new array. every change done rawlayer reflected within lastrawlayer , vice versa. if want make deep copy of array have re-create it: lastrawlayer = rawlayer.toarray(); alternativly use array.copyto : rawlayer.copyto(lastrawlayer, 0); which copy every element of rawlayer second array. if have custom objects stored wi

html - opening code behind for input element? -

everytime try open code behind <input id="submit1" type="submit" value="upload" runat="server"> i <script language="javascript" type="text/javascript"> // <![cdata[ function submit1_onclick() { } // ]]> </script> can please me can go code behind after double clicking ?

android - ExoPlayer doesn work on some devices -

i want implement video player (exoplayer) in android app. player must play video (not big, ~2-3 minutes) url. on nexus 5 works well, on phone "samsung gt-i8552 galaxy win" unfortunately doesnt work. there exception logs after compiling , starting app: internal runtime error. java.lang.illegalstateexception at android.media.mediacodec.dequeueoutputbuffer(native method) and code: private surfaceview surfaceview; private exoplayer player; private mediacodecvideotrackrenderer videorenderer; private mediacodecaudiotrackrenderer audiorenderer; private custommediacontroller mediacontroller; private string useragent; private final int renderer_count = 8; private static final int buffer_segment_size = 64 * 1024; private static fin

Select the first log in Time using from Table using SQL Server 2008 R2 -

i have table of employees describe last , first name, card id , times log in enterprise. want select first time logs in. thise example of table thise example of table and result want this result want you group last name, first name , truncated date , return minimal date per group. in modern sql server versions truncation pretty simple - cast field_time date : select last_name, first_name, cast(field_time date) log_day, min(field_time) first_log mytable group last_name, first_name, cast(field_time date)

multithreading - what will happen if I miss shutdown clause after declaring ExecutorService in java -

currently working on threading jobs using executorservice class , newfixedthreadpool command in java. when forgot execute shutdown() command after declaring executerservice instance, program never turned off. guessed executerservice may have internal command shutting down threads, since implements executor interface doesn't have explicit shutdown() commands. wondering happens inside executorservice class , related threads, such when threads dead, , happen shutdown() command forgotten. thank you. executors.newfixedthreadpool creates thread pool given number of "core" threads, never shut down until shutdown() method called on thread pool. look @ finalize method of threadpoolexecutor (the concrete class returned call executors.newfixedthreadpool ): protected void finalize() { shutdown(); } so, if executorservice instance becomes eligible garbage collection, shutdown when finalize() called. however, things related finalize() method,

Create Java Command Console in JPanel -

i want create "command console" similar windows command prompt, command history, etc in jpanel can added jframe. what want present user prompt allow them execute commands. what have in mind similar beanshell console, haven't able find source code console. to include beanshell application, add .jar-files beanshell download page java project , see beanshell doc section " calling beanshell application " examples how call beanshell direct calls or evaluating commands shell. see quickstart guide other ways , examples how use beanshell.

oracle - parse a XML and store into a table -

i have xml below <?xml version="1.0" encoding="utf-8"?> <cus:request xsi:schemalocation="http://www.bt.com/btgs/solutions/message/customerrequest c:\salesschema_latest\requestmanagementv1.xsd" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:sortarg="http://www.bt.com/btgs/solutions/library/sourceandtarget" xmlns:sitetype="http://www.bt.com/btgs/solutions/library/sitetype" xmlns:reqtype="http://www.bt.com/btgs/solutions/library/requesttype" <sourcesystem name="resign tool" type="lqtwebsite" /> <targetsystem name="messia" type="sales tools" /> <changerequest customerrequestref="" btprojectmanagementref=""> <customerorganisation orgid="id000001" orginternalid="29823" resigninstancetype="source"> <organisationname>bt plc</org

c++ - How do I declare a class template that is placed after the main? -

i trying implement template class stack. want declare before main. can that? know compile if put main after template possible put main first template? #include <iostream> //start declaration of template template <class t> class stack<t>; //end declaration of template int main() { stack<char> s(5); s.push('a'); s.push('b'); cout <<s.pop()<<endl; stack<double> s1(10); s1.push(3.2); s1.push(0.5); cout << s1.pop()<<endl; return 0; } template <class t> class stack { t *s; int size; //how many elements can stole. int top; //where index available. public: stack(int sz) { size = sz; s = new t[sz]; top=-1; } void push(t e); t pop() { return s[top--]; } }; template <class t> void stack<t>::push(t e) { s[++top] = e; } error given: 1>.\classtemplpers.cpp(6) : error c2143: s

php - I want to create a dynamic dropdown in loop -

my requirement display csv headers first element, each header, want map element elements appearing in drop-down. when first drop-down element selected, should dynamically populate second drop-down. example csv has headers: first, second, third first drop-down has values: 1, 2, 3 based on 1: should second drop-down a, b based on 2: should second drop-down i, j based on 3: should second drop-down p, q i.e. first: (drop-down if 1 selected) (drop-down a, b) appears. problem getting done when not run on loop. when give loop populating csv header, automatically, send drop-down not appear. any appreciated!

Get color of arc in libgdx -

Image
i have drawn many colourful arcs , revolving around ball. when user touches screen ball shoots in direction of pointer. want color of arc colliding when collision occurs. please help.. sample image this: i want output in rgb format or hash format or in known format can use comparison. please suggestions helpful...thanks in advance.. is there reason why can't treat each arc separate instance color stored in field? public class arc { //color stored in arc easy retrieval public color mycolor = new color(...); public void update() { //make arc original arc supposed //such rotate, drawn screen, etc } //one of many ways retrieve color during collision public color testcollision(ball b) { if (/* ball colliding arc */) return mycolor; else return null; } }

c# - How to recognize if a rectangle contains a Text block within in -

i'm creating program in user drags/drops text block rectangle, , store contents of specific textblock when he/she drops rectangle. i figured out how drag/drop, can't figure out how check if rectangle contains textblock. here's code far: bool captured = false; double x_shape, x_canvas, y_shape, y_canvas; uielement source = null; private void shape_mouseleftbuttondown(object sender, mousebuttoneventargs e) { source = (uielement)sender; mouse.capture(source); captured = true; x_shape = canvas.getleft(source); x_canvas = e.getposition(layoutroot).x; y_shape = canvas.gettop(source); y_canvas = e.getposition(layoutroot).y; } private void shape_mousemove(object sender, mouseeventargs e) { if (captured) { double x = e.getposition(layoutroot).x; double y = e.getposition(layoutroot).y; x_shape += x - x_canvas; canvas.setleft(source, x_shape); x_canvas = x; y_shape += y - y_canvas; canvas.settop(source, y_shape); y_canvas

java - Use 'spring boot + mybatis' projects created using 'spring Application' can start, if you use an external tomcat, dao error injection -

"spring boot + mybatis" projects created , “springapplication.run” can start, if use external tomcat, dao error injection app @configuration @componentscan(basepackages = "com.grass.module", excludefilters = {@componentscan.filter(type = filtertype.annotation, value = {controller.class})}) @enableaspectjautoproxy(proxytargetclass = true) public class appconfig { @bean public localvalidatorfactorybean validator() { return new localvalidatorfactorybean(); } } application.java @configuration @enableautoconfiguration @componentscan public class application { public static void main(string[] args) { springapplication.run(application.class, args); } } datasourceconfig.java @configuration @enabletransactionmanagement @mapperscan("com.grass.module") public class datasourceconfig implements environmentaware { private relaxedpropertyresolver propertyresolver; private static logger logger = loggerfactory.getlogge