Posts

Showing posts from June, 2010

html - Jquery windows.width(height) with overflow -

Image
i have problem size of window. taking size of window var boxwidth = $(window).width(); var boxheight = $(window).height(); and create canvas var canvas: document.createelement("canvas"), start: function() { this.canvas.width = boxwidth; this.canvas.height = boxheight; this.context = this.canvas.getcontext("2d"); document.body.insertbefore(this.canvas, document.body.childnodes[0]); } but got overflow width , height. i want create canvas fit window size. now, got lot of overflow i add margin:0 , padding:0 body well, tried find "normal" solution didn't found, here "tricky" solution. idea assome need customize fit project. the logic create div take full width , height of document , set canvas dimensions according it. final step restore states of elements (html, body etc.) so: $('html, body').css({position: 'relative', height: '100%', overflow:'hidden'});

c# - asp.net mvc core The call is ambiguous between the following methods or properties: -

i working on application, , got error in startup.cs partial classes, , cant find why error shows up: the call ambiguous between following methods or properties: microsoft.extensions.dependencyinjection.optionsservicecollectionextensions.configure(microsoft.extensions.dependencyinjection.iservicecollection, system.action) microsoft.extensions.dependencyinjection.optionsservicecollectionextensions.configure(microsoft.extensions.dependencyinjection.iservicecollection, system.action) my 2 partial startup.cs classes are using microsoft.extensions.dependencyinjection; using system.security.claims; using microsoft.aspnetcore.http; using microsoft.extensions.configuration; namespace giftuwish.webapi { public partial class startup { private void setservices(iservicecollection services) { //profile service , repository services.addscoped<iprofileservice, profileservice>(); services.addscoped<iprofilerepository, pro

opencv - Detect approximately objects on depth map -

Image
i find approximately object on depth map. process following : 1. normalization of depth 2. threshold closest object 3. gaussian blur 4. canny edge detection 5. contour detection however, i'm not able find box around object. actually, don't know if it's possible kind of depth map... i have 3 object on table : box of food , 2 mugs. i find approximately box around object. is there way image processing ? appreciated. thank in advance. you can using opencv. have @ following solution. i used depth map provided in question input image. performed binary threshold of gray scale image of depth map ret,th = cv2.threshold(gray,127,255, 1) and obtained following: now in order fill gaps in image, performed morphological close operation kernel = np.ones((15,15),np.uint8) dilate = cv2.morphologyex(th, cv2.morph_close, kernel, 3) then found contours using: contours,hierarchy = cv2.findcontours(dilate,2,1) and drew them using: cv2.drawcontour

php - WooCommerce 2.6 Custom Endpoint 404 Not Found Error -

it seems version 2.6 woocommerce have changed way endpoints , custom profile tabs made. more infor here https://woocommerce.wordpress.com/2016/04/21/tabbed-my-account-pages-in-2-6/ , and https://github.com/woothemes/woocommerce/wiki/2.6-tabbed-my-account-page my code bellow similar 1 in these links clicking on new profile tab keeps showing 404 not found error. tried permalinks refresh , flush_rewrite_rules() othing seems work.... if ( !class_exists('my_wc_user_company') ) { class my_wc_user_company { /** * custom endpoint name. * * @var string */ public static $endpoint = 'my-company'; /** * plugin actions. */ public function __construct() { // actions used insert new endpoint in wordpress. add_action( 'init', array( $this, 'add_endpoints' ) ); add_filter( 'query_vars', array( $this, 'add_query_vars' ),

How to Call MVC web Controller from Xamarin Android App -

string apiurl1 = string.format(@"http://xxx.xxx.x.xxx/test/home/getdata?id=1"); public static string getdata(string url) { string result = ""; try { using (webclient client = new webclient()) { result = client.downloadstring(string.format(@"" + url + "")); } } catch (exception e) { string msg = e.message; result = ""; } return result; } i trying data published .net mvc web project getting server error " the remote server returned error: (500) internal server error. " my mvc controller code here public jsonresult getdata(int? id) { list<items> dbitems = items.getitemsdata(id); return json(dbitems, jsonrequestbehavior.allowget); } besides fact better suited using asp.net web api (you wouldn't have convert response json on con

python - Getting information about function execution time/billing and if the function call was successful -

i'm using sns trigger lambda functions in aws. works fine , expected, i'm wondering if there way feedback execution times , if exception raised within function. obviously there exception handling code in lambda functions of business logic, i'm thinking cases external program (like ghostscript) might end in endless loop , terminated 10 minute lambda limit. as far know can if invoke method in synchronous fashion, can't seem find way information how long execution lasted , if bad happened. is there way subscribe execution errors or similar, or have callback aws (not code) when exception or timeout occurs? exceptions of lambda functions in logs, streamed aws cloudwatch logs. execution time stored lambda duration metric in cloudwatch. need setup cloudwatch alerts on items notified.

jestjs - Integration testing of Relay containers with Jest against a working GraphQL backend not working -

i'd implement integration testing of relay containers against running graphql backend server. i'm going use jest this. i'd unit testing of react components works expected jest setup. here's have in package.json jest: "jest": { "modulefileextensions": [ "js", "jsx" ], "moduledirectories": [ "node_modules", "src" ], "modulenamemapper": { "^.+\\.(css|less)$": "<rootdir>/src/stylemock.js", "^.+\\.(gif|ttf|eot|svg|png)$": "<rootdir>/src/filemock.js" }, "unmockedmodulepathpatterns": [ "<rootdir>/node_modules/react/", "<rootdir>/node_modules/react-dom/", "<rootdir>/node_modules/react-addons-test-utils/", "<rootdir>/node_modules/react-relay/" ] } here's .babelrc i'm u

get current date in yyyyMMdd format in spring batch configuration XML -

i have spring batch configuration spring outbound sftp has <property name="remotedirectory" value="/sftp/books_file_20160629"></property> i want _20160629 today's date in same yyyymmdd format rather hard coding. please tell me there way ? thanks, aiden are looking this <property name="resources" value="/sftp/books_file_*#{currentdate}"/> below beans should added in context.xml <bean id="fastdateformat" class="org.apache.commons.lang.time.fastdateformat" factory-method="getinstance"> <constructor-arg value="yyyymmdd" /> </bean> <bean id="currentdate" class="java.util.date" factory-bean="fastdateformat" factory-method="format"> <constructor-arg> <bean class="java.util.date" /> </constructor-arg> </bean>

javascript - Cant find the Gmaps API in CodeIgniter Environment -

Image
good day you, i have difficulty in finding google maps api key. had change base_url in config file , since gives me error: google maps api error: missingkeymaperror https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error_.ab @ js?v=3.exp&signed_in=false&sensor=false&libraries=places&language=en-usa:32 util.js:211 google maps api warning: noapikeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys util.js:211 google maps api warning: sensornotrequired https://developers.google.com/maps/documentation/javascript/error-messages#sensor-not-required if add tag api key <head> of page: <script src="https://maps.googleapis.com/maps/api/js?key=your_api_key" type="text/javascript"></script> i error: unfortunately have img of error right now. first missing duplicated. , why missing if change config?i know have new api key new dom

php - PayPal API - CURRENCY_NOT_ALLOWED -

i using php paypal rest api credit card payments , sandbox account , error: paypal\core\paypalhttpconnection : error: got http response code 400 when accessing https://api.sandbox.paypal.com/v1/payments/payment. { "name":"currency_not_allowed", "message":"currency not supported", "information_link":"https://developer.paypal.com/webapps/developer/docs/api/#currency_not_allowed", "debug_id":"308d4b24ea4b5" } the "information_link" provide not provide information whatsoever currency_not_allowed , found on page of theirs "more helpful": currency not supported using currency not supported. the problematic currency nok, while eur seems work fine. any idea on how fix this? please check paypal sendbox account address zone. may it's not valid nok. more details can check here :- https://developer.paypal.com/docs/classic/api/currency_codes/

python - Jupyter Notebook: How to re-run notebook with different parameters (e.g. input data file)? -

i have notebook, can complex data analysis one dataset . @ end, saves notebook , converts html , can view result later without running notebook again. 1 example this: https://cdn.rawgit.com/cqcn1991/wind-speed-analysis/master/output_html/marham.html now, want run notebook on many, different datasets . how can it? maybe like files = [ './data/ncdc/cn/binhai/dat.txt', './data/ncdc/cn/luogang/dat.txt', "./data/ncdc/cn/tianjing/dat.txt", "./data/ncdc/cn/gushi/dat.txt", "./data/ncdc/cn/yueyang/dat.txt", ] input_file_path in files: run_notebook('gmm.ipynb', input_file_path) my thougths: i find run parts of ipython notebook in loop / different input parameter , it's run part of cells within notebook. scientific computing & ipython notebook: how organize code? provides solution run notebook within host notebook. however, it's not target notebook gets runned, target notebook's code run within host

python - Create a matrix made of matrices with different sizes -

i want create matrix elements matrices (with different sizes), vectors , numbers. example, have next 2 matrices, 1 vector , 1 number: a = [1 2 3 4 5 6 7 8 9] b = [10 11 12 13] c = [14 15 16] d = 17 and obtain matrix 2x2, k, whith elements: k_11 = a, k_12 = b, k_21 = c, k_22 = d . the idea have possibility choose matrices, vectors or numbers of big matrix, k, "simple" elements of matrix. i.e.: k[0,0] = a, k[0,1] = b , on. firstly, thougth obtain list of matrices, vectors , numbers k.append(a) ..., figured out not able transform list matrix. , secondly, tried create block matrix numpy.bmat . problem bmat dimensions of inputs elements must match exactly. idea? thanks. first, store 4 objects in 2d list, make list numpy.matrix . k = matrix([[a, b], [c, d])

jquery - How to change content of a given paragraph based on the width of viewport (i.e dynamic content replacement) -

how can change content of given paragraph when browser width resized? example, on mobile version of website paragraph class '.main-lead' have following content: <p class="main-lead">some content goes here.</br>and content goes here</p> now, when views page tablet or laptop, content of paragraph changed so: <p class="main-lead">previous content has been replaced.</p> i sort of understand need using jquery, , have attempted write script task: jquery(window).resize(function () { if ($(window).width() > 768) { // if screen width more 768px $(".main-lead").html('previous content has been replaced.'); } }); it seems work, if user decides resize screen mobile view, content remain same on tablet , desktop version instead of mobile version. thus, content of paragraph dynamically change when browser window being resized , forth. any suggestions highly appreciated. thanks.

amazon web services - Remove Route53 Entry after Instance Termination -

we using aws , add ip of instance @ it's launch weighted route53 record set. remove record set on event of instance's termination. i know executing script @ run-levels in linux enable me this, know lifecycle hooks can applied on autoscaling groups. wondering if there simple instance-specific way using aws. you can register lambda function triggered via cloudwatch when instance terminated

r - non-numeric argument to binary in geom_errorbar -

Image
i'm trying add error bars histograms (only in bars), i'm having problems , couldn't fix this. sample of dataset: dput(subdat) structure(list(mod = c("mme_rcp85", "mme_picontrol", "mme_rcp85", "mme_picontrol", "mme_rcp85", "mme_picontrol", "mme_rcp85", "mme_picontrol", "mme_rcp85", "mme_picontrol", "mme_rcp85", "mme_picontrol", "mme_rcp85", "mme_picontrol", "mme_rcp85", "mme_picontrol", "mme_rcp85", "mme_picontrol", "mme_rcp85", "mme_picontrol", "mme_rcp85", "mme_picontrol"), id = c(4l, 5l, 4l, 5l, 4l, 5l, 4l, 5l, 4l, 5l, 4l, 5l, 4l, 5l, 4l, 5l, 4l, 5l, 4l, 5l, 4l, 5l), variable = structure(c(1l, 1l, 2l, 2l, 3l, 3l, 4l, 4l, 5l, 5l, 6l, 6l, 7l, 7l, 8l, 8l, 9l, 9l, 10l, 10l, 11l, 11l),

String to date milliseconds with javascript? -

<script type="text/javascript"> var decodeentities = (function() { // prevents overhead creating object each time var element = document.createelement('div'); function decodehtmlentities (str) { if(str && typeof str === 'string') { // strip script/html tags str = str.replace(/<script[^>]*>([\s\s]*?)<\/script>/gmi, ''); str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, ''); element.innerhtml = str; str = element.textcontent; element.textcontent = ''; } return str; } return decodehtmlentities; })(); var points_data = json.parse(decodeentities("<%= (data) %>")); var points = []; for(var in points_data){ var p = {"type":"line","showinlegend":"true"}; p.name = i

concurrentmodification - Android: ConcurrentModificationException persisting -

i have 2 lists suggestedfriends , allsuggestedfriends . i use iterator run through first list , remove items list. on way, items should removed second list if still has items in it. use second iterator (in saferemove method) removing items second list. problem: concurrentmodificationexception in line if (allsuggestedfriends.size() > 0) { though use iterators propose of removing items. should use iterator ask size? don't think it's possible(?!) synchronized (suggestedfriends) { (final iterator<user> suggestedfriendsiterator = suggestedfriends.iterator(); suggestedfriendsiterator.hasnext();) { user friend = suggestedfriendsiterator.next(); if (friend.userid == request.getuserid()) { final int index = suggestedfriends.indexof(friend); if (status) { ((fragmentactivityext) context).runonuithread(new runnable() { @override public void run() {

read the docs - ReadTheDocs activation email not deliverd -

i tried install readthedocs on linux server following documentation: http://read-the-docs.readthedocs.io/en/latest/install.html however not receive activation email. able see output of email on server hello example.com! you're receiving e-mail because or else has requested password user account @ example.com. can safely ignored if did not request password reset. click link below reset password. http://xxxxx:8080/accounts/password/reset/key/xxxxxxxxxx/ in case forgot, username xxxxxxxxxxxx. thank using example.com! example.com note: email password reset email, has same problem activation email. (i didn't receive email readthedocs installation) there 2 things got attention. 1. read docs configure website name, change example.com th real website name. 2. sending adres no-reply@readthedocs.org, can change it? think part of issue. here other headers of email mime-version: 1.0 content-type: text/plain; charset="utf-8" content-transfer-encoding: 7bit

r - Confidence Interval and Standard error of Skewness and Kurtosis -

please tell me how calculate skewness , kurtosis along respective standard error , confidence interval associated it(i.e. se of skewness , s.e of kurtosis) found 2 packages 1) package: 'measure' can calculate skewness , kurtosis 2) package: 'rela' can calcuate both skewness , kurtosis uses bootstrap default , no command turn off during calculation. try package psych: > <- data.frame(cola=rep(c('a','b','c'),100),colb=sample(1:1000,300),colc=rnorm(300)) > describe(a) vars n mean sd median trimmed mad min max range skew kurtosis se cola* 1 300 2.00 0.82 2.00 2.00 1.48 1.00 3.00 2.00 0.00 -1.51 0.05 colb 2 300 511.76 285.59 506.50 514.21 362.50 1.00 999.00 998.00 -0.04 -1.17 16.49 colc 3 300 0.12 1.04 0.05 0.10 1.07 -2.54 2.91 5.45 0.12 -0.24 0.06 > describe(a)$skew [1] 0.00000000 -0.04418551 0.11857609

Error: "Value cannot be null. Parameter name: Smallicon" while creating Coded UI Test Project (UWA) -

Image
i'm getting error dialog box " value cannot null. parameter name: smallicon " while trying create ' coded ui test project (universal windows) ' project using updated yesterday (june 28, 2016) ms visual studio professional 2015 version 14.0.25421.03 update 3. please see enclosed screenshot. any hints how solve subject issue? i confirm after testing on same environment pro version displays error message while enterprise 1 succedeed in project's creation. (i guess complicated display "feature available in enterprise edition, please upgrade." instead of "hello i'm non related message tells nothing current problem.")

c# - Only start Project if File Exists -

i have 2 different executables, 1 login , other main application. now, want make possible open login, not main program. right can open main app clicking on it. the login app creates small txt file information, , main program starts , deletes file. is there way make main program start if 1 file exists? nobody can start main app without login first. so, when login, app checks mysql database if account exists. runs: string übergabeparameter = convert.tostring(typ); string filename = (@"c:\users\viuser\desktop\test\dat.exe"); var proc = system.diagnostics.process.start(filename, übergabeparameter); using (system.io.streamwriter sw = system.io.file.createtext("fluff.txt")) { sw.write(benutzername + system.environment.newline + typ); } close(); then dat.exe starts, , runs this: bürgerlichername = file.readlines("fluff.txt").first(); string line = file.readlines("

batch file - Multiple Image conversion using ImageMagick -

problem: want able convert multiple images @ time dragging multiple images onto batch file. here's programming code because resizing each image: convert "%1" -thumbnail 50x -unsharp 1.5x1.2+1.0+0.10 "%~p1%~n1" convert "%1" -thumbnail 80x -unsharp 1.5x1.2+1.0+0.10 "%~p1%~n1" convert "%1" -thumbnail 120x -unsharp 1.5x1.2+1.0+0.10 "%~p1%~n1" each of these lines above in separate file, made file call each of these files. (educational purposes) all lines below in 1 file: call imageconvert120x.bat %* call imageconvert80x.bat %* call imageconvert50x.bat %* now, when highlight on multiple images, , drop onto file it's calling each of them, converts top one. able convert multiple images @ time after highlighting them , dropping onto batch file. this should able work file types. edit: i've added: for %%i in (%*) ( call imageconvert120x.bat %* call imageconvert80x.bat %* call imageconvert50x.bat %* )

xcode - iOS - simulate keyboard animation on Notes application -

Image
i went through lot of posts change position of keyboard in iphone programmatically. but, there seems no chance. noticed cello feature in iphone 5s ios 9.3.2 that, after typing in note, when scrolling top bottom , finger crosses on top of keyboard keyboard starts moving down , when dragging finger on keyboard. is there anyway kind of animation programmatically. it seems trying achieve default behavior in ios, though need tell system want it. there property keyboarddismissmode on uiscrollview (so available subclasses, uitableview or uicollectionview ). you can set either in code : self.scrollingview.keyboarddismissmode = uiscrollviewkeyboarddismissmodeinteractive; or in ib :

Android RecyclerView item foreground/background swipe issue -

i've tried use recyclerview in android project, , works fine instead of swipe touch handling. approach custom view (mainly buttons), under list items. see screenshot below: swipeable item background expectation i find way how perform animation, can't click on button on background view. guess problem touchlistener still wants perform swipe effect instead of click event, because "swipeable area" still complete width of view (foreground , background). there known workaround or best practice handle click events under main item? or can make foreground swipeable? here code snippets. touch listener: public class traininglistonswipeanddraglistener extends itemtouchhelper.simplecallback { private final mainactivity activity; private trainingroutinelistadapter adapter; public traininglistonswipeanddraglistener(mainactivity activity, trainingroutinelistadapter adapter, int dragdirs, int swipedirs) { super(dragdirs, swipedirs); this.activity = activity;

c++ - QT : How to store all running processes full path of windows in QStringList? -

i need scan running processes of windows 1 one using qt. want store full path of running processes in qstringlist. i tried code got error crt0_c.c:-1: error: undefined reference `winmain@16' collect2.exe:-1: error: error: ld returned 1 exit status unsigned long aprocesses[1024], cbneeded, cprocesses; if (!enumprocesses(aprocesses, sizeof(aprocesses), &cbneeded)) { } qstringlist lprocess; cprocesses = cbneeded / sizeof(unsigned long); (unsigned int = 0; < cprocesses; i++) { if (aprocesses[i] == 0) continue; handle hprocess = openprocess(process_query_information | process_vm_read, 0, aprocesses[i]); wchar_t buffer[50]; getmodulebasename(hprocess, 0, buffer, 50); closehandle(hprocess); lprocess << qstring::fromwchararray(buffer); } ui->listwidget->additems(lprocess); you using name main function. aside that, missing lot of other functions. need add library getmodulefilenameex . needs windows lib

playframework - Integration test using both WithServer and Server.forRouter -

i'm writing integration test extending class "play.test.withserver" . testing api in play service. api sends request different external service retrieving data. don't want send request during integration tests, i'm trying create mock external service using "server.forrouter()" . when mock service running, actual testserver started withserver class not run. there no errors or exceptions. connectexception while connecting testserver . this issue occurs when i'm creating mock service using server.forrouter() along withserver . reference: https://www.playframework.com/documentation/2.5.x/javafunctionaltest https://www.playframework.com/documentation/2.5.x/javatestingwebserviceclients sample code reproduction: public class homecontrollerintegrationtest extends withserver { private server server; @test public void test() throws exception { logger.error("mock server"); wsclient ws = ws.newclient(-1); completionstage

bash - enviroment variable is in ~/bash_profile but wont show up in printenv -

i trying add enviroment variable android_home so: nano ~/.bash_profile then add new line content: android_home="~/library/android/sdk" then proceed save file , check printenv list enviroment variables , android_home doesn't show up. why's that?

meteor - Some MongoDB questions -

i'm new mongodb , meteor. have checked official docs seems didn't job. here have couple of questions. the structure follows. { _id:"127467812649871246", "name":"disha", "last_name":"shukla", "members": [ { name:"xyz" }, { name:"abc" } ], "user":"premium" } 1] how insert data in particular field when data exists referring record id ? in case, insert new member in "members" 2] in cases there wont "user":"premium" field. because wont insert @ first time. how check if field exists if have inserted document ? any appreciated :) thank you! the $push command used insert data existing array in mongodb. , $exists used check whether field exists in collection. go links find more.

javascript - Not able to select the values of jQuery Autocomplete? -

i trying , experimenting create customized jquery ui autocomplete failing in first step itself. when click on values populate there no response. not able select values of autocomplete. can please let me know why? below code: html: <!doctype html> <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <script src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script> <title>test</title> <body> <div>select:</div> <input id="project" style="width:380px;"> </body> javascript: (function($){ var $project = $('#project'); var projects = [ { value: "test1", label: "test1", desc: "test1", icon: "jquery_32x32.png" }, { value: "test2", label: "test2", desc: "test2", icon: "jqueryui_32x32.png"

php - Geo My WP - Create Dropdown Menu Search Input -

i have learned lot forum , in need of specific help. if can me solve this, have eternal gratitude. framework : wordpress site has buddypress(bp) , geo wp installed. each user has set of bp profile fields geo wp uses search through , return results. goal : on geo wp search form, wish have dropdown list user can select 1 item; example "hockey". selected item used search through 2 (2) different bp xprofile fields (eg: "main sports" & "casual sports"). these 2 bp xprofile fields populated admin , both text line single terms separated comma; example "basketball, football, soccer, hockey" etc. if user selected term matches term in either of 2 bp xprofile fields, geo wp return bp profile in search results. problem : can't figure out how this. if both bp xprofile fields selected search through in geo wp settings, both show on search form. need 1 input in search field. i have run out of ideas on manipulating code , appreciate fresh e

sql - Unique statements and FK -

i have answer question unique statements. in particolar, question ask me indicate maximum number of unique statements can define on relation of 5 columns. suppose number should 5^5. right? , question foreign keys ask me whether attribute relation r can foreign key referencing b in relation s, if not primary key r. think because fk constraint can include null values, attribute specified fk referencing pk on table shouldn't primary key itself. right? thank in advance! the maximum number of distinct unique relationships can define 2^n - 1. basically, given column can in or out of relationship. "- 1" because cannot define unique relationship no columns. for instance, 3 columns, can have: a b c a, b a, c b, c a, b, c if think of these binary numbers, see pattern: 100 010 001 110 101 011 111

jsdoc3 - How to use jsdoc options in jsdoc-grunt task -

i want add -p flag in order generate documentation private methods using grunt-jsdoc . how can that? according documentation @ grunt-jsdoc state can use of options specified in usejsdoccli , not know how should specified in grunt task. here current grunt task: jsdoc : { dist : { src: ['app/scripts/directives/*.js','readme.md'], options: { destination: 'doc' } } } how can specify want task run -p flag (or other flags)? there's example in documentation under template section https://github.com/krampstudio/grunt-jsdoc#templates just use flag name without dash, example: dist : { src: ['app/scripts/directives/*.js','readme.md'], options: { destination: 'doc', private: true } } }

java - How to adjust the page height to the content height? -

Image
i'm using itextpdf + freemarker project. load , fill html template freemarker , render pdf itextpdf's xmlworker . the template is: <html> <body style="font-family; ${fontname}"> <table> <tr> <td style="text-align: right">${timestamplabel}&nbsp;</td> <td><b>${timestampvalue}</b></td> </tr> <tr> <td style="text-align: right">${erroridlabel}&nbsp;</td> <td><b>${erroridvalue}</b></td> </tr> <tr> <td style="text-align: right">${systemidlabel}&nbsp;</td> <td><b>${systemidvalue}</b></td> </tr> <tr> <td style="text-align: right">${description

javascript - Inserting text at Current Cursor position in Textarea Using AngularJs Ng-Click -

we trying implement below requirement. click of button text generated , added textarea. button using ng-onclick. button code below. <input type="submit" value="add form" class="btn btn-primary" ng-click="addtoformid($index)" /> but many buttons there if adding 4 components 4 buttons there generate formula. and here textarea code: <textarea id="summarformula" ng-model=".summarisation" ng-change="setsummarisationformuladynamic()" cols="100" rows="4"></textarea> and here script. $scope.addtoformid = function(index){ if( $scope.vm.summarisationform==null) { $scope.vm.summarisationform ="["+ $scope.vm.dependencies[index].nename+":{"+$scope.vm.dependencies[index].dbid+","+$scope.vm.dependencies[index].versionid+"}]"; }else $scope.vm.summarisation+="["+ $scope.vm.dep

Creating Indexname Dynamically using Spring-Data Elasticsearch with @Document -

i trying indexname dynamically in @document(indexname="something",type="type") i have tried using below code: @document(indexname="#{systemproperties['databasename'] }", type = "dbtype") but @ runtime when sending 2 request ui data es different indexes,it not working properly. what should solve issue? a workaround is, work nativesearchquerries. there can set index whatever like: nativesearchquery query = new nativesearchquerybuilder().withindices(indexname) .withquery(querybuilders.matchphrasequery("_all", request.getsearchterm().getsearchstring())) .withpageable(new pagerequest(request.getpaging(), request.getmaxresults())) .... .build(); result =elastic.query(query, query->query2result(query));

Understanding php static code analysis results -

i need advice. cant found information static code analysis results. example, use phploc, , generate report. it's results or bad dont know. understand utility wouldn't have enjoyed report must same. after seeing results, can solve bad code or not. where can see info lines in results? thanks help! all found is: maximum method complexity must not greater 10. cyclomaticcomplexity - 1-4 low - 5-7 indicates moderate complexity - 8-10 high complexity - 11+ high complexity. directories 1 files 3 size lines of code (loc) 296 comment lines of code (cloc) 116 (39.19%) non-comment lines of code (ncloc) 180 (60.81%) logical lines of code (lloc) 50 (16.89%) classes 43 (86.00%) average class length 14 minimum class l