Posts

Showing posts from 2015

visual studio - Clear VS 2017 cache -

i'm using system.runtime.caching.memorycache in application. i'm trying delete cache because i'm making unit test data come cache @ 8:54am, , it's not refreshing. so, i've tried delete visual studio's appdata folder without success. i've downloaded tool clear mef component cache, without success. i've tried run test through visual studio 15, it's same cache. anyone can me on how delete cache ? thanks ! just call memorycache.remove before unit test

javascript - pass values from mssql to views in node -

being new node js , javascript . have been trying find solution problem . this app.js file var express=require ('express'); var bodyparser = require('body-parser'); var path = require ('path'); var sql = require('mssql'); var app = express(); const config = { user: 'sa', password: 'password', server: 'localhost\\sqlexpress', // can use 'localhost\\instance' connect named instance database: 'pcgdb', options: { encrypt: false // use if you're on windows azure } }; const request = new sql.request() //view engine app.set('view engine', 'ejs'); app.set('views', path.join(__dirname, 'views')) app.use(bodyparser.json()); app.use(bodyparser.urlencoded({extended: false})); app.get('/',function(req,res){ res.render('index') }); app.get('/new_project', function(req, res) { function(data,err){ ...

javascript - Understanding ExtJS Framework Syntax -

i have been given project uses sencha's extjs framework, no handover or documentation. trying come grips hoping people can pls assist me following syntax possibly point me specific site might explain code newcomer framework. i have been going through code , unsure doing, i.e.: if(val==1) { ext.getcmp('status').settext('awaiting approv'); } switch(flag) { case 1: if(val==0) { ext.getcmp('complex_first').el.replacecls('x-form-complex', 'x-form-simplex'); } else { ext.getcmp('complex_first').el.replacecls('x-form-simplex', 'x-form-complex'); } break; case 2: if(val==0) { ext.getcmp('complex_second').el.replacecls('x-form-complex', 'x-form-simplex'); } else { ext.getcmp('complex_second').el.replacecls('x-fo...

tsql - sp_execute_external_script @language = N'R' -

how can - create 2 input data set referenced in @script example exec sp_execute_external_script @language = n'r' , @script = n' outputdataset <- inputdataset' , @input_data_1 = n'' , @input_data_2 = n'' -- line. , @input_data_1_name = n'inputdataset' , @output_data_1_name = n'outputdataset' result sets ((plot nvarchar(max))); you have use @params if want more 1 input/output. assign data parameter of exact same name right after it. exec sp_execute_external_script @language = n'r' , @script = n' notusedagain <- seconddataset; outputdataset <- inputdataset ' , @input_data_1 = n'' , @params = n'@seconddataset int' , @seconddataset = 1 result sets ((plot nvarchar(max)));

python - Access specific element of array from list django -

i have queryset in view.py: somevalue = list(a.objects.filter(x=x_number, timestamp__gte=a_time, timestamp__lte=b_time) \ .order_by('timestamp').values_list('timestamp', 'some_index').annotate( some1=dosomething('some_index'), some2=dosomething('some_index_2'), combined_some=(f('some1') + f('some2')) )) so somevalue looks this: somevalue = [(datetime.datetime(2017, 7, 20, 23, 53, 51, tzinfo=<utc>), 2l, 10.1, 2.4, 12.5), (datetime.datetime(2017, 7, 20, 23, 54, 51, tzinfo=<utc>), 8l, 5.5, 6.4, 11.9), (datetime.datetime(2017, 7, 20, 23, 55, 51, tzinfo=<utc>), 4l, 7.2, 2.0, 9.2),...] my goal access somevalue , combined_some this: combined_some = [(datetime.datetime(2017, 7, 20, 23, 53, 51, tzinfo=<utc>), 12.5), (datetime.datetime(2017, 7, 20, 23, 54, 51, tzinfo=<utc>), 11.9), (datetime.datetime(2017, 7, 20, 23, 55, 51, tzinfo=<utc...

image - python get coordinates (pixels) of corresponding points from clicks -

this question has answer here: store mouse click event coordinates matplotlib 2 answers detecting mouse event in image matplotlib 2 answers determine button clicked subplot in matplotlib 2 answers i have 2 images want following using python 3.6 1- plot both images side side 2- click on 1 image , output corresponding pixel coordinates 3- click on second image , corresponding pixel coordinates note: question different because has work on 2 images finding axis click event happening. i think best way have function identifies axis clicking on , gets clicked coordinates. couldn't find of resources 2 images, found on 1 image.

asynchronous - force exit of an ocaml async program -

i'd implement following behavior: let x = try do_some_computation () | some_error -> exit_my_program () in ... of course, raise exception such as: let exit_my_program () = failwith "...." but, i'd like: let exit_my_program () = print.printf "some error message\n"; exit 1 the issue i'm having exit 1 has type 'a deferred.t , it's not going typecheck. i'm wondering if there's exit function type 'a use in context, or maybe more generally, function force deferred. the function pervasives.exit of type int -> 'a . don't know async, don't know if it's plan use function. it's easy believe might not such plan if want things wind down carefully.

Using EPPlus without excel installed -

i using epplus excel report generation automation using visual studio.i faced issue that, difficult used excel range row , column count. when tried worksheet.dimension.end.row , worksheet.dimension.end.column showing around million rows , 16k columns. is there other way find out used range using epplus openxml? there package supports excel report generation?

Python / Pandas - Merge columns with the same index in a single cell -

i have dataframe: dude group_id 820125 armando 820125 luis oswaldo 64907 bernardo 64907 sandro 64907 veronica i want this: dudes group_id 820125 armando | luis oswaldo 64907 bernardo | sandro | veronica already tried variations of merge, join , concat wasn't successful. idea? you can group index , join column: df.groupby(level=0).agg(' | '.join) # dude #group_id #64907 bernardo | sandro | veronica #820125 armando | luis oswaldo to join specific column only, use dictionary in agg function: df.groupby(level=0).agg({"dude": ' | '.join}) sam...

javascript - HighChart Line Graph not Showing -

Image
i using data csv file generate line graph using highchart. here code: /* define initial , basic options */ var options = { chart: { type: 'line', renderto: 'graph_container' }, title: { text: 'fanniemaeacquisition cash flow' }, yaxis: { title: { text: 'amount($)' } }, series: [] }; /* parse csv file */ $.get('{% static "data/fanniemaeacquisitions.csv" %}', function(csv) { var lines = csv.split('\n'); var series = { name: '', data: [] }; $.each(lines, function (lineno, line) { var items = line.split(...

javascript - Replicate keyboard event with html button -

i have tried few ways make happen. have javascript pinball game uses keyboard keys controls. converting application touch screen display. workaround, hoping overlay buttons when clicked simulate keyboard strokes. have done research , sounds should work. using jquery v3.2.1 here things have tried far... html element: <input type="button" class="coil"></input> $('.coil').trigger({type: 'keydown', which: 40, keycode: 40}); with this, not errors, nothing happens. var coilkey = $('body').keydown(function(e) { switch (e.keycode) { case 40: break;} }) $('.coil').click(coilkey); this 1 returns error in console... ((jquery.event.special[handleobj.origtype] || (intermediate value)).handle || handleobj.handler).apply not function below javascript game engine handles key listeners... addkeylistener: function (keyandlistener) { this.keylisteners.push(keyandlistener); }, // gi...

python - SciKit-Learn: Grid Search CV Recording Times? -

i'm doing basic machine learning , want grid search xgboost (to find best hyperparameters). here's i'm doing: from sklearn.metrics import classification_report sklearn.pipeline import pipeline sklearn.grid_search import gridsearchcv import xgboost xgb pipeline = pipeline([('clf', xgb.xgbregressor(silent=false))]) parameters = { 'clf__n_estimators': (500, 1000), 'clf__learning_rate': (0.01, 0.05, 0.1), 'clf__max_depth': (10, 20, 30) } grid_search = gridsearchcv(pipeline, parameters, n_jobs=-1,verbose=2, scoring='neg_mean_absolute_error') grid_search.fit(x, y) so start getting output in jupyter notebook follows: fitting 3 folds each of 18 candidates, totalling 54 fits [cv] clf__max_depth=10, clf__learning_rate=0.01, clf__n_estimators=500 all seems goes through of combinations , doesn't terminate. instead, starts printing following: [cv] clf__max_depth=10, clf__learning_rate=0.01, clf__n_estimators=500 -1...

vba - Apply (complex, preset) filter of one excel sheet to another -

i have question : i need filter excel sheet based on (preset) filter excel sheet. e.g. thought, might possible read out shown line numbers or data names in column a. , take these results make other sheet filter same rows. background : i need work on "public" excel sheet, several people use different tasks. the sheet contains >8000 rows of data of need edit hundred. we made copy of sheet , applied several complex sets of filters on different columns (to different sets of data concerning us). don't want put these different filters new time. therefore added column in copy sheet, contains numbers each set of data (e.g. rows of filter-set 1 contain "1" in column, etc.). easy access our data. however, need work in public sheet, here can't add column our filters (for different reasons). therefore question above: can filter excel table based on (preset) filter excel table. what tried : search internet --> no hits special case search ...

java - RPC CertIOException "malformed data: sequence wrong size for a certificate" -

i’m trying use rpc connect m12 cordaapp , call nodeidentity() method, i'm getting org.bouncycastle.cert.certioexception . think java client code works, can see rpc connection , when try call getprotocolversion() instead see correct protocol version. here stack trace when calling nodeidentity() : 10:50:25.848 [thread-0 (activemq-client-global-threads-1076641925)] error org.apache.activemq.artemis.core.client - amq214000: failed call onmessage org.bouncycastle.cert.certioexception: malformed data: sequence wrong size certificate @ org.bouncycastle.cert.x509certificateholder.parsebytes(unknown source) ~[bcpkix-jdk15on-1.56.jar:1.56.0.0] @ org.bouncycastle.cert.x509certificateholder.(unknown source) ~[bcpkix-jdk15on-1.56.jar:1.56.0.0] @ net.corda.core.serialization.x509certificateserializer.read(kryo.kt:641) ~[core-0.12.1.jar:?] @ net.corda.core.serialization.x509certificateserializer.read(kryo.kt:639) ~[core-0.12.1.jar:?] @ com.esotericsoftware.kryo.kry...

jquery - How to load json array -

im trying load person data api : www.swapi.co . dont know how can load movies titles instead of api adress. $(function(){ var list = $('.list'); var submit = $('.submit-people'); var people = '1'; submit.on('click',function(){ people++; list.empty(); $.ajax({ type: 'get', url: 'https://swapi.co/api/people/' + people + '/', success: function(data) { list.append('<li>name:' + data.name + '</li>'); list.append('<li>height:' + data.height + '</li>'); list.append('<li>mass:' + data.mass + '</li>'); list.append('<li>gender:' + data.gender + '</li>'); list.append('<li>movies:' + data.films + '</li>'); } }) }) my current code here : https://jsfiddle.net/wtpy71d7/2/ really or ...

rust - Borrow checker issue in `zip`-like function with a callback -

i'm trying implement function steps though 2 iterators @ same time, calling function each pair. callback can control of iterators advanced in each step returning (bool, bool) tuple. since iterators take reference buffer in use case, can't implement iterator trait stdlib, instead used though next_ref function, identical iterator::next , takes additional lifetime parameter. // iterator-like type, returns references // in next_ref struct refiter { value: u64 } impl refiter { fn next_ref<'a>(&'a mut self) -> option<&'a u64> { self.value += 1; some(&self.value) } } // iterate on 2 refiter simultaneously , call callback // each pair. callback returns tuple of bools // indicate iterators should advanced. fn each_zipped<f>(mut iter1: refiter, mut iter2: refiter, callback: f) f: fn(&option<&u64>, &option<&u64>) -> (bool, bool) { let mut current1 = iter1.next_ref(); ...

sql - File "oracle-xe-11.2.0-1.0.x86_64.rpm" not found -

i installing oracle 11g xe on ubuntu 16.04, trying convert red-hat ( rpm ) package ubuntu-package : using link http://sysadminnotebook.blogspot.de/2012/10/installing-oracle-11g-r2-express.html #sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm am getting err below file "oracle-xe-11.2.0-1.0.x86_64.rpm" not found. how overcome ?? in advance

entity framework - There is already an openEntityframework DataReader associated with this Connection which must be closed first -

i got error @ nummedidas = nummedidas + anal.medidas.count(); , cannot figure out how solve it: innerexception: {"there open datareader associated connection must closed first."} source: entityframework this code: pitelodatacontext contexto = new pitelodatacontext(); var resultados = analisis in contexto.analises select analisis; if (hospitales != null) { list<string> listahospitales = new list<string>(); listahospitales = hospitales.tostring().split(';').tolist(); resultados = resultados.where(b => listahospitales.contains(b.incidente.hospital.denominacion)); } numanalisisaspxlabel.text = resultados.count().tostring(); foreach (pitelo.entityclasses.analisis anal in resultados ) { **nummedidas = nummedidas + anal.medidas.count();** if ((anal.fechahora != null) && (anal.incidente.fec...

html - How to custom Bootstrap grid height? -

why bootstrap grid has height 591.067 ? did height came ? .main-post { padding: 20px; background-color: #fff; border: 1px solid #d8d8d8; margin-bottom: 100px; } .main-post .post-categories { margin-bottom: 10px } .main-post h3 { margin: 0 0 10px; color: #777; letter-spacing: -1px; font-weight: bold } .main-post .post-author, .main-post .post-date, .main-post .post-comments { font-size: 12px } .main-post img { display: block; margin: 10px 0; } .main-post .post-summary { line-height: 1.7; color: #888 } .main-post { color: #999 } <div class="col-sm-6"> <div class="main-post"> <h3 class="post-title"> <a href="#"> post title </a> </...

Angular (4.x): Cannot use same name attribute for radio buttons -

i'm trying make radio buttons work, angular complains "name" attribute. <form> <div> <h3>select building</h3> <h4>building search</h4> <label for="criteria">search criteria:</label> <input class="radio-input" type="radio" name="building-search-criteria" [(ngmodel)]="build_search_criteria" [value]="id" id="id"> <label class="radio-label" for="id">id</label> <input class="radio-input" type="radio" name="building-search-criteria" [(ngmodel)]="build_search_criteria" [value]="name" id="name"> <label class="radio-label" for="nombre">name</label> </div> </form> in order make radio buttons work, have share same name attribute, seemingly angular doesn't th...

powershell - Passing Variables to Start-Job -

i have missing incredibly simple here. here's basic script illustrate i'm trying: $computers = @('comp1', 'comp2') $scriptblock = { new-item "c:\temp\$c.txt" -force } foreach ($c in $computers) { start-job -scriptblock $scriptblock -argumentlist $c } the script runs, $c not passed, ".txt" file in folder. simple thing overlooking here? replace this: $scriptblock = { new-item "c:\temp\$c.txt" -force } with this: $scriptblock = { param($c) new-item "c:\temp\$c.txt" -force } note: when passing arguments in argumentlist , make sure same number of arguments have accepted inside scriptblock using param.

javascript - React.js - When authorizing on the site, if the data is incorrect, how can I get a response with a text error? -

i send data api email , password. api ruby on rails library devise-token-auth signinform.js ...................................................... onsubmit(e){ e.preventdefault(); this.setstate({errors: {}, isloading: true}); this.props.usersigninrequest(this.state).then( () => {console.log('ok!')}, ({resp}) => { console.log(resp.errors); } ); } ......................................................... actions/signinactions.js import axios 'axios'; export function usersigninrequest(userdata){ return dispatch => { return axios.post('/auth/sign_in', userdata); } } if email or password incorrect response: {"errors":["invalid login credentials. please try again."]} but console.log(resp.errors); display undefined. if put (resp) => { console.log(resp); } in console: error: request failed status code 401 @ createerror (createerror.js?16d0:16) @ settle (settle.js?db52:18) @ xmlhttprequest.handleload...

swift3 - 'CGAffineTransformMake' is unavailable in swift 3 -

this code doesn't compile in swift 3: let flipvertical = cgaffinetransformmake(1, 0, 0, -1, 0, newsize.height) context.concatenate(flipvertical) how convert over? in swift 3, these free-standing functions have been replaced init syntax: let flipvertical = cgaffinetransform(a: 1, b: 0, c: 0, d: -1, tx: 0, ty: newsize.height)

php - Bootstrap multiple models in same page give same for all models -

i have made 5 models in single page using bootstrap username,password,email,mobile , student different models buttons give same model of of username button change id in each element code <div class="container"> <h2>account settings</h2> <label class="control-label col-sm-10">username : <?php $name = $_session['username']; echo $name;?></label> <div class="col-sm-offset-4 col-sm-2"> <button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#mymodal">change username</button> </div> <div class="modal fade" id="mymodal" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&time...

list - Executing two commands into one command in R -

i have 12 files in directory folder, type of files csv , sas7dbat. used command upload them: filelist1 = list.files(path=".", pattern=".csv") filelist2 = list.files(path=".", pattern=".sas") i tried write command, didn't go well: filelist = list.files(path=".", pattern= c(".csv", ".sas") in addition, need 2 make them 1 command: list2env( lapply(setnames(filelist1, make.names(paste(2008:2016, "_kvish_1_10t", sep= ""))), read.csv), envir = .globalenv) list2env( lapply(setnames(filelist2, make.names(paste0(2005:2007, "_kvish_1_10t", sep= ""))), haven::read_sas), envir = .globalenv) pattern takes 1 argument. if want find several elements, should try regex : filelist <- list.files(path=".", pattern= "\\.csv|\\.sas") best, colin

hash - Perl: Type of argument to keys on reference must be unblessed hashref or arrayref -

i have perl hash (from legacy code) unable print out keys. if (ref $val eq ref {}) { print "keys: " . keys $val . "\n"; e.g. here's output get: val: hash(0x7ff0898eda70) type of argument keys on reference must unblessed hashref or arrayref i've read type of argument keys on reference must unblessed hashref or arrayref not sure how apply in case. is there way of fixing this? ==== update i've tried: print "keys: " . keys %$val . "\n"; but still type of argument keys on reference must unblessed hashref or arrayref update 2 i can see have key a_key i'm unable print out values. e.g. debugging carp::repl get: $ print $val; 1$ hash(0x7fb1e0828f00) $ print %$val; 1$ a_keyarray(0x7fb1e0828e28) $ print %$val{'a_key'} compile error: syntax error @ (eval 412) line 63, near "$val{" begin not safe after errors--compilation aborted @ (eval 412) line 63, <fin> line 6. $ prin...

ios - How to delete tableview items after they are deleted in Firebase -

my tableview updates table , adds new items in real-time when added firebase database. problem cannot delete in real-time. storing data firebase in local array, , loading array tableview. i tried condense code bit. tried put firebase code inside removedeleteditems() function inside populatearrays() function, , put after .childadded listener, did not have luck deleting data in real-time. override func viewdidload() { super.viewdidload() populatearrays() } func removedeleteditems() { let databaseref = firdatabase.database().reference() databaseref.child("users").observe(firdataeventtype.childremoved, with: { (firdatasnapshot) in guard let emailtofind = firdatasnapshot.value as? string else { return } (index, email) in self.usernames.enumerated() { if email == emailtofind { let indexpath = indexpath(row: index, section: 0) self.usernames.r...

Twilio status_callback_event setting, not working for me, Python 2.7 -

running code below. calls number , sends completed status callback url, not sent status updates before that. checked logs , there 1 call api made, completed status. any idea why wouldn't work? documentation says these valid status values: https://www.twilio.com/docs/api/twiml/twilio_request#request-parameters-call-status also on possibly related note, setting status_callback_method "get" doesn't seem work either. relevant code: client.calls.create(to=phone_number, from_=twilio_phone_number, url=url, method="get", status_callback=status_callback_url + call_uid, status_callback_method="post", status_callback_event=["queued", "ringing", "in-progress", "completed", "busy", "failed", "no-answer", "canceled"] ) i used these ...

excel - Using .Find() to find specific text in column -

Image
i'm having trouble making sure code uses end user inputs find set of data pertaining value , continues code there. example, if user input "v-" prefix tag number, in theory cell a7 should selected after code complete. however, code proceeds run line "msgbox "no blank cell found below tag number prefix " & str & ".", vbexclamation" , select cell a3 due fact contains "v-" in cell. tried changing matchcase true did not help. not want entered value case sensitive. code being used: private sub worksheet_activate() dim msg string dim cell range dim str string, firstcell string msg = "would find next available tag number?" result = msgbox(msg, vbyesno) if result = vbyes str = application.inputbox("enter tag number prefix ", "prefix tag number") if str = "" exit sub if right(str, 1) <> "-" str = str & "-" range("a:a") set cell = .find(str, look...

java - Why does System.out.println print a new line while System.out.print prints nothing? -

Image
i having trouble split function. not know how works. here source code: // using println print out result string str = " welcome java tutorial "; str = str.trim(); string[] arr = str.split(" "); (string c : arr) { system.out.println(c); } //using print print out result string str = " welcome java tutorial "; str = str.trim(); string[] arr = str.split(" "); (string c : arr) { system.out.print(c); } and results are: the first result when using println , second result when using print , i not understand why space appears in println , while not appear in print . can explain me? since have many spaces in string, if @ output of split function, resulted array looks [welcome, , , , , , , to, , , , java, , , , , tutorial] so if close empty string's "" . when println("") printing line no string. however when print("") , no more vis...

java - I need the right Pixel Per Meter Ratio implementation using JBox2D - Not Using LibGDX -

i'm building game engine , i've added jbox2d. i'm struggling implement correct way of using ppm. i have 3 important classes magic happens. please review code , show me change. this i'd see working: http://imgur.com/a/effwv however though see that, doesn't behave accordingly. playstate.java package enginex.jbox2dtestbed; import java.awt.graphics2d; import java.awt.point; import java.awt.event.mouseevent; import java.util.arraylist; import org.jbox2d.common.vec2; import org.jbox2d.dynamics.world; import enginex.core.state; public class playstate extends state { testgame game; boolean initialized = false; vec2 gravity = new vec2(0.0f, 0.8f); boolean dosleep = true; world world = new world(gravity, dosleep); arraylist<ball> balls = new arraylist<ball>(); box ...

sql - Find highest in a group and update a column based n that -

Image
simplified example: table has 4 columns: id, name, amount , parent. see image. the parent column, in actual table, empty , needs populated entries column "name". id non unique column multiple entries in column 'name' having same id. the goal find maximum value entry in column "amount" id , populate column "parent" entry in column "name". post picture of example table in comments the technique rank names within each id amount in subquery , join source table update: update my_table set "parent"="name" ( select id,"name",row_number() on (partition id order "amount" desc) my_table ) t my_table.id=t.id , t.row_number=1

javascript - Select2 multi-select with no closeOnSelect overlaps results on top of selected tags -

Image
problem: when have select2() closeonselect =false, results list overlaps selected values when no of selected values cause values wrap around. html: <select multiple id="e1" style="width:300px"> <option value="al">alabama</option> <option value="ak">alaska</option> <option value="az">arizona</option> <option value="ar">arkansas</option>... </select> javascript: $("#e1").select2({ closeonselect: false }) screenshot: fiddle: http://jsfiddle.net/sajjansarkar/dsg2t7y2/ while not cleaner sajjan's answer. call close , open in change event of select. causes box redrawn on every selection without need of knowing class names select2 happens using version (in case changes). var select = $("#e1").select2({ closeonselect: false }).on("change", function(e){ select.select2("close"); select...

How can microservice can talk to other microservice in JHipster -

i planning create microservice aplication dedicated service dealing data (mostly mongodb based service). wondering if there way using other microservices able communicate service make use of shared data. possible jhipster api gateway ? if not how can achieve this. dont want keep multiple copies of same data within each microservice. you can make microservices registred same registry , can call each other. update : here how make works. in microservice consuming data one, use resttemplate current user jwt token authorization in header make api calls : @component public class authenticateclienthttprequestinterceptor implements clienthttprequestinterceptor { @override public clienthttpresponse intercept(httprequest httprequest, byte[] bytes, clienthttprequestexecution clienthttprequestexecution) throws ioexception { string token = securityutils.getcurrentuserjwt(); httprequest.getheaders().add("authorization","bearer "+token)...

php - Contact Form Fields Are Displaying On The Site, But Data Not Being Pulled Through To Email -

so needed 2 new fields contact form, went contact.php in shortcodes folder of wordpress theme, , edited display on website. looks on site, when fill out form , submit it, default fields sent email address. here website, , below code: http://sellhouseforcashorlando.com/contact/ // contact form add_shortcode('contact_form', 'theme_shortcode_contact_form'); function theme_shortcode_contact_form($atts, $content = null, $code) { extract(shortcode_atts(array( 'mail_to' => '', 'form_id' => false, 'button_color' => 'black' ), $atts)); $id = mt_rand(0, 1000); $template_directory = get_template_directory_uri(); $ajax_url = admin_url('admin-ajax.php'); $mail_to = str_replace('@','[at]',$mail_to); $name_text = __('name', 'theme_front'); $email_text = __('email', 't...

php - Laravel and vue pass array to prop -

i've got multiselect component looks this: <multi-select prp-selected="<?php old('organisations_working_at') ?>" prp-name="organisations_working_at" :prp-options="{{ json_encode($organisations) }}" prp-placeholder="kies organisatie(s)"> </multi-select> as can see pass old('organisations_working_at') value laravel. my component looks (i made wrapper around multi-select): <template> <div> <input type="hidden" v-for="select in selected" :name="prpname + '[]'" :value="select.id"> <multiselect v-model="selected" :multiple="true" :options="prpoptions" :custom-label="prpcustomlabel" :placeholder="prpplaceholder" track-by="id...

UnusedFormalParameter vs. AvoidDuplicateLiterals in maven-pmd-plugin -

i'm using built-in rulesets strings.xml , unusedcode.xml with <?xml version="1.0"?> <ruleset name="custom ruleset" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> <description> default ruleset </description> <rule ref="rulesets/java/strings.xml"/> <rule ref="rulesets/java/unusedcode.xml"/> </ruleset> in maven-pmd-plugin follows: <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-pmd-plugin</artifactid> <version>3.8</version> <executions> <execution> <id>pmd-check</id> <phase>validate</phase> <g...

java - How to get and compare the value results of a map<Integer, Integer> -

by calling method ,at case countinnumbers, returning results array. system.out.println(countintinnumbers(array)); result: {1=17, 2=10, 3=16, 4=17, 5=13, 6=22, 7=10, 8=15, 9=16, 10=19, 11=11, 12=15, 13=16, 14=13, 15=19, 16=17, 17=13, 18=21, 19=19, 20=15,} i try separate numbers on different table depending total value. example... want display numbers total between 3 , 4 separate table other numbers. facing problem cause results may notice map since new in java , confused @ point. anyone can suggest start of? updated::: countintinnumbers method follows public static map<integer, integer> countintinnumbers(int[][] mat) { map<integer, integer> intoccurences = new hashmap<>(); (int[] row : mat) { (int intinrow : row) { integer occurences = intoccurences.get(intinrow); if (occurences == null) { // first occurrence intoccurences.put(intinrow, 1); } else { // increment int...

python - I am trying to import a models.py method, but get error no module named -

i have 2 apps: friends/apps/loginreg/models.py/user friends/apps/friends/views.py i trying import user method views.py file. these imports: from __future__ import unicode_literals .models import friend loginreg.models import user django.shortcuts import render, redirect it continues give error no module named loginreg.models the 'from' path wrong, think. try from ..loginreg.models import user you're trying import folder above current one. can read more here .

swift - How to change the SFSafariViewController reader mode font? -

i have researched sfsafariviewcontroller class , seems mutable properties properties tintcolor , etc. in viewcontroller app, have presented sfsafariviewcontroller defaults reader mode. however, having difficult time programmatically changing font color , family sfsafariviewcontroller in image below: https://i.stack.imgur.com/aru2k.jpg i understand apple may intentionally not make these properties accessible, workarounds or general help, appreciated.

spring websocket - Stomp clients stop receiving messages -

i using artemis 1.5.3 , after random time, varied 5hrs - 10 hrs, clients stop receiving messages, have stomp heartbeat set 10 seconds. once restart artemis, works fine again. memory , cpu on servers good. thoughts may cause of behavior? cannot upgrade artemis 2.1.0 because multicast (topic) works queue (it load balances vs broadcast subscribers)

arrays - TypeError: 'numpy.ndarray' object is not callable -

i have seen other people asking similar can not figure out problem anyway. trying translate matlab code python , have problem after following line in loop: dx = abs(np.diff(g_coord(num))) below have code loop. appreciated. tried fix myself unsuccessfully. sorry if stupid mistake. matlab lines kept python comments in case helps. import numpy np scipy.sparse import lil_matrix # physical parameters seconds_per_yr = 60*60*24*365; # number of seconds in 1 year lx = 10000 ; #length of spatial domain (m) cp = 1e3 ; # rock heat capacity (j/kg/k) rho = 2700 ; # rock density (kg/mˆ3) k = 3.3 ; # bulk thermal conductivity (w/m/k) kappa = k/(cp*rho); # thermal diffusivity (mˆ2/s) tb = 0 ; # temperatures @ boundaries (o c) = 2.6e-6 ; # heat production (w/mˆ3) h = a/(rho*cp); # heat source term (o k/s) % numerical parameters dt = 1000*seconds_per_yr ; # time step (s) ntime = 5000 ; # number of time steps nels = 40 ; # total number of elements nod = 2 ; # number of nodes per element nn = ...

regex python find dollar amount and few words at the same time -

i need find dollar amount , few(3 or 4) words surrounding amount @ same time in 1 paragraph. in-process research , development of $184.3 million , charges $120 of million impairment of long-lived assets. see notes 2, 16 and21 consolidated financial statements. income continuingoperations fiscal year ended september 30, 2001 includes netgain on sale of businesses , investments of $276.6 million , net gainon sale of common shares of subsidiary of $64.1 million. what want below, [amount, amount+ digit words, 3-4 words after before amount]. [$184.3 $184.3 million, research , development of $184.3 million],[$120, $120 of million,charges $120 of million impairment of long-lived assets ], [$276.6, $276.6 million, investments of $276.6 million] ,[ $64.1, $64.1 million, subsidiary of $64.1 million.] what tried , found dollar amount. [\$]{1}\d+\.?\d{0,2} thanks! so let's name pattern have: amount_patt = r"[\$]{1}[\d,]+\.?\d{0,2}" digit wor...

oop - Can anyone broadly explain abstract class and interface? -

can broadly explain abstract class , interface? know theoretically think it's not enough implementation. saw lot of tutorials on seems me without abstract class can job, why need use abstract class. actually, want know use of abstract , interface , how it'll helpful. understanding these 2 mechanisms in programming tough 1 teach because on paper share lot of similarities, , in code more depending on language. question have asked throw many duplicate references because question gets asked lot. focus in on premise asking i'll see if can add bit more context. interfaces a way of declaring common related properties , methods between classes. class definitions can inherit many of these, , down each class declares inheritance of said interface implement members , methods. abstract classes similar interfaces, abstract classes declare common related properties , methods, class may inherit 1 abstract class, 1 of main defining characteristic (and obvious) differen...