Posts

Showing posts from March, 2014

angular - Angular4 enums in templates -

interesting question. need use angualar4 templating enums. aka. <div class="small-12 columns compliance-freq__item" [ngclass]="getcompliancefrequencyclasses( compliancefrequency, licencecompliancefrequency.quarterly)"</div> notice the licencecompliancefrequency.quarterly enum declaration follows export enum licencecompliancefrequency { quarterly = "quarterly", monthly = "monthly" } this gives me template error, cannot read property quarterly of undefined. i have tried intergrating template in many ways, modifiying component itself. 1) still quarterly of undefined error in template get licencecompliancefrequency() { return licencecompliancefrequency; } 2) (screams licencecompliancefrequency not exportable element of file *.ts) import {licencecompliancefrequency} '....'; public licencecompliancefrequency = licencecompliancefrequency; any advice?

javascript - API request open method not a function error in Chrome console -

Image
my weather app on code pen code(sorry if it's much): var button=document.getelementbyid('submit'); var zipcode; var lat; var lng; var weather; var iconid; var temp; /*takes user enters*/ button.addeventlistener('click',getvalue); function getvalue(event){ event.preventdefault(); zipcode=document.getelementbyid('zipcode').value; getcity(); } //api request google geocode function getcity(){ var req=new xmlhttprequest; req.onreadystatechange=function(){ if(this.readystate==4&&this.status==200){ var mydata=json.parse(this.responsetext); var mycity=mydata.results[0].address_components[1].short_name; lat=mydata.results[0].geometry.location.lat; lng=mydata.results[0].geometry.location.lng; document.getelementbyid('lat').innerhtml=lat; document.getelementbyid('lng').innerhtml=lng; document.getelementbyid('city').innerhtml=mycity; }//if

javascript - Add a class to my element with respect to my textarea height (or rows) -

i have textarea element not have specify height or row.. want add simple class name 1 of elements when textarea element has example 137px height (or example 5 rows). , when returned default height, class name removed. you'll ned use javascript/jquery height of element , add or remove class accordingly. example: if($('textarea').height() == 137) { $('textarea').addclass('classname'); }else{ $('textarea').removeclass('classname'); }

classification - Indexing with KDB-tree for dimension reduction in Big data stream -

i'm trying find a way reduce dimensions of big data set accurate classification. recently have came across new structure in computer science called "kdb-tree". ( here complete information of kdb-tree) briefly, kdb-tree structure subdividing k-dimensional search space provide search efficiency of balanced kd-tree. this topic important me, because of master thesis's proposal, , i'm not sure using structure kdb-tree (or that) indexing, can me doing big data stream dimension reduction or even may kdb-tree structure helpful in preprocessing of data stream classification? i'm new in data science , i'm not sure idea implementable or not.

oauth - Azure AD: Mixing SPA with delegated user identity scenario -

i intend develop single-page-application has web api backend call other web apis on user's behalf. struggle how this. i looked @ list of azure ad scenarios ms none of seems fit case.i think scenario mixture of spa , "web application web api" scenario link. from understand must accomplish spa-client retrieves authorisation code , id token azure ad auth endpoint first, send them backend. backend request azure ad token endpoint needed access tokens. is correct? how can (with adal.js)? find examples client using implicit flow, getting authorisation code skipped , end directly access token. possible @ all? you're understanding pretty close. after configuring scenario in azure portal (see code sample on configuring scenario), you'll log in user , request access token web api. when web api receives access token, can perform on-behalf-of request azure ad requesting access downstream web api. on success, azure ad issue web api new access token can

Get day of year from python arrow -

_date = '2017-03-17t00:00:00' import arrow arrow.get(_date) how can day of year above code? you asking arrow solution, here alternative datetime library. as explained by: converting python time stamp day of year answer seeking: import datetime _date = '2017-03-17t00:00:00' dt = datetime.datetime.strptime(_date, '%y-%m-%dt%h:%m:%s') print(dt.timetuple().tm_yday) # prints 76

python - How do I create the counts of the column values, grouped by values in the other column in Pandas? -

i have dataframe df has values: id status 1 2 b 5 1 3 b 4 b 5 b i need group column id column status. issue id can have duplicates, can have same or different codes. the code have is: df_new = df.groupby('id').status.nunique() however, getting ids grouped, without showing status column , values. need create dataset looks this: status count 3 b 4 you need groupby , count : df.groupby('status')['status'].count() output: status 3 b 4 name: status, dtype: int64

arrays - How to split string without defined delimeter -

i have string looks this: bar = "bar 01/12/15" foo = "foo02/15/87" how can split variables resulting array contains: bar_array = ["bar", "01/12/15"] foo_array = ["foo","02/15/87"] r = /(?<=[[:alpha:]]) ?(?=\d)/ "bar 01/12/15".split(r) #=> ["bar", "01/12/15"] "foo02/15/87".split(r) #=> ["foo", "02/15/87"] the regular expression reads match letter in positive lookbehind match 0 or 1 spaces match digit in positive lookahead

data annotations - ASP.NET MVC Core date only format is not working using DataAnnotation -

following viewmodel used in view supposed display startdate as, 9/30/2015 . displaying 9/30/2015 12:00:00 am . how can make display without time while using dataannotaion ? know can use @model.startdate.tostring("mm/dd/yyy") inside view display date only. mean have in every view using following viewmodel : viewmodel : ... [displayformat(dataformatstring = "{0:mm/dd/yyyy}")] public datetime startdate { get; set; } ... update the corresponding model class of above viewmodel has following dataannotation correctly creates data type in sql server table date ; , when run query on corresponding table in ssms correctly displays startdate column's data dates only, say, 9/30/2015 etc.) model ... [datatype(datatype.date)] public datetime startdate { get; set; } ... startdate in sql db in fact date only. moreover, if run query on ssms correctly returns date only. there 2 solutions problem. per comments, using @model.startdate display dat

php - Unwanted code in Wordpress -

i have strange message in header in wordpress. belows on navigation bar in wordpress. not know how fix code. people, please.. have installed plugins nothing new. problem has occurred today. at first thought had syntax error tested code , ok. for example: enter image description here whether problem in other file? how can remove this? may have error in header.php...i dont know. header.php file: <!doctype html> <!--[if ie 7 ]> <html <?php language_attributes(); ?> class="isie ie7 oldie no-js"> <![endif]--> <!--[if ie 8 ]> <html <?php language_attributes(); ?> class="isie ie8 oldie no-js"> <![endif]--> <!--[if ie 9 ]> <html <?php language_attributes(); ?> class="isie ie9 no-js"> <![endif]--> <!--[if (gt ie 9)|!(ie)]><!--> <html <?php language_attributes(); ?> class="no-js"> <!--<![endif]--> <head> <!

node.js - var not getting value and I dont know why -

i trying assign value input box var when pass function blank object? var newuser = {'username': $('#finduser fieldset input#inputsearchuser').val()} populatetablefind(newuser); but result blank? if do: populatetablefind($('#finduser fieldset input#inputsearchuser').val()); then works... don't know why? know doing wrong here, thanks. in first case try var newuser = $('#finduser fieldset input#inputsearchuser').val(); you should same result.

pentaho - Metadata Business Layer as Searchable List of Datapoints -

Image
in pentaho user console, when creates new interactive report, list of datapoints on left side this: how can query pentaho metadata can structure , set searchable list in it's own page? i'm hoping there useful class somewhere me getting jsp...

vba - Delete charts from range -

i have 2 charts in range of cells trying delete vba. rather deleting charts, iterates through bunch of times without doing @ all. have tried far. for each chartobjects in range(cells(i + 3, 12), cells(i + 19, 50)) chartobjects.delete next chartobjects you can use topleftcell property of chartobject check whether cell under top left corner of chart falls within range... dim ochrtobj chartobject each ochrtobj in activesheet.chartobjects if not application.intersect(ochrtobj.topleftcell, _ range(cells(i + 3, 12), cells(i + 19, 50))) nothing ochrtobj.delete end if next ochrtobj note, though, can delete charts using single line... activesheet.chartobjects.delete hope helps!

ios - Why are my UI elements not resetting correctly after being animated/scaled off screen? -

Image
so i'll give information project can right front. here image of section of storyboard relevant issue: and here flow of code: 1) user plays game. scrambles emoji displayed , hide of emoji on right side. 2) when wins game, calls performsegue(withidentifier: "showwinscreensegue", sender: self) which perform segue red arrow pointing to. segue modal segue, on current content, cross dissolve. 3) stuff goes on here, , try game screen user can play game. here current code that // self.delegate gamecontroller called segue // it's set somewhere else in code can call these reset functions gamecontroller.gs = gamestate() guard let d = self.delegate else { return } d.resetgametomatchstate() dismiss(animated: true, completion: { print("modal dismiss completed") gamecontroller.gs = gamestate() self.delegate?.resetgametomatchstate() }) so here's issue is. can see have call delegate?.resetgametomatchstate() twice happen. if rem

c# - IsAuthenticated Staying false when cookie has been set -

i using asp.net identity core. no working ok cause can create user through registration page , appears in tables fine. issue having on login. i including startup.cs main methods see if knows have missed when check isauthenticated attribute returning false. // method gets called runtime. use method add services container. public void configureservices(iservicecollection services) { // add framework services. services.addmvc(); services.adddbcontext<identitydbcontext>(options => options.usesqlserver(configuration.getconnectionstring("defaultconnection"),b=>b.migrationsassembly("solitudeeccore"))); services.addidentity<identityuser, identityrole>() .addentityframeworkstores<identitydbcontext>() .adddefaulttokenproviders(); services.addtransient<imessageservice, filemessageservice>(); services.addauthentication( options =>

javascript - Firebase not found cloud function? -

Image
i wanted bit testing cloud function achieve bigger goal. android developer, knowledge bit limited in case of javascript. i trying access database firebase using cloud function. my code access database json response in browser. const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeapp(functions.config().firebase); const cors = require('cors')({origin: true}); // take text parameter passed http endpoint , insert // realtime database under path /messages/:pushid/original exports.addmessage = functions.https.onrequest((req, res) => { // grab text parameter. const original = req.query.text; // push new message realtime database using firebase admin sdk. admin.database().ref('/messages').push({original: original}).then(snapshot => { // redirect 303 see other url of pushed object in firebase console. re

angularjs - Angular.js - Include markup in an expression -

i have following piece of code - <div class="appreviewquestions"> {{aboutyou.radioselectsq}} </div> the expression {{aboutyou.radioselectsq}} represented string application updated , same expression represents string + markup(html). currently piece of code shows markup string. want angular should read markup , not display string. how achieve this? ng-bind-html should trick! <div class="appreviewquestions"> <p ng-bind-html="aboutyou.radioselectsq"></p> </div> read more @ angular docs

python - Sometimes "PermissionError: [Errno 13]" in same code -

i'm using windows os. made function collects stock market data every second. it works has error. open(output_file, "at") fp: permissionerror: [errno 13] permission denied: 'output.csv' the argument 'output_file' not folder name , file not open in window. although error, 'data_bat' contents intact. after error, next writing works well. (sometimes has error) weird thing if has error, frequency of error increased. what think problem? def output_batch(output_file, data, data_bat, bat_size): data_seq = [58, 52, 46, 40, 34, 28, 22, 16, 10, 4, 1, 7, 13, 19, 25, 31, 37, 43, 49, 55] data_bat.append(data) if len(data_bat) >= bat_size: open(output_file, "at") fp: in range(0, bat_size): fp.write((data_bat[i][0] + ",")) k in data_seq: fp.write((data_bat[i][k] + ",")) fp.write("\n,")

Open Active Directory User in powershell -

the question simple in head make sense of it: i'm making powershell form gives ad properties of each user type in, such displayname, description, first & last names, etc... i going give option open last searched user in dsa.msc if user wishes: #start buttonad: open user in active directory $buttonad.add_click({ start-process dsa.msc }) i don't know of switches can pass through, or in active directory module allow me open user in ad. yes, aduc open command, user properties window open well. any appreciated.

Adding a row and copying the information from the original row for every day in a date range in Google Sheets -

Image
i have google sheet information google form dumped. 2 of columns create date range , sheet automatically create new row of information every date of range , copy other information original row every row created. in end, every date in range has it's own row regardless of being 2 days or 25 , the information gathered through form present each day here example here's function trick you. spreadsheet below after running. append bottom of starting data. function convertdaterangetorows() { var ss=spreadsheetapp.getactive(); var sht=ss.getactivesheet(); var rng=sht.getdatarange(); var rnga=rng.getvalues(); var rngb=[]; var day=86400000; rngb.push(rnga[0]); for(var i=1;i<rnga.length;i++) { rngb.push(rnga[i]); if(rnga[i][0] && rnga[i][1] && rnga[i][0]!=rnga[i][1]) { var dt0=new date(rnga[i][0]); var dt1=new date(rnga[i][1]); var days=(dt1.valueof()-dt0.valueof())/day; var dt=dt0.valueof();

reactjs - React re render array whereas item key has not changed -

very basic code sample of list: class list extends react.component { render() { const listcomponent = this.props.numbers.map((number) => <item key={ number.tostring() } value={ number } />, ); return ( <div> <button onclick={ () => this.setstate({ test: 1 })}>re-render list</button> { listcomponent } </div> ); } } an here item: class item extends react.component { render() { return ( <div>{ this.props.value + ', rendered time:' + new date().gettime() }</div> ); } } when click button, state updated list component re-rendered. however, if understanding correct, items should not re-rendered since key item has not changed. re-render since timestamp updated. can explain me why? your understanding wrong the whole purpose of key , ordering rather rendering . image hav

css - Mozilla Firefox adding gap while printing -

Image
i try print using window.print() , , works fine on google chrome. however, don't know why on mozilla firefox has gap on left side. print using google chrome: print using mozilla firefox: is there css have add mozilla? mozilla sets page size a2 default evident link . can fix setting page size a4 mozilla. looks mozilla treats a2 default size.

jquery - how to disable button when it's clicked and enable another button using ajax -

i want disable button when it's clicked, , enable button using ajax. this script , dislike buttons: function like(id,type,target){ $.ajax({ //condition , unlike button $('button').click(function like() { var classname = $(this).attr('id'); if(classname == 'positive') { $('button.positive').attr('disabled', 'disabled'); $('button.negative').attr('disabled', false); } else { $('button.negative').attr('disabled', 'disabled'); $('button.positive').attr('disabled', false); } } //like unlike mysql database type:'post', url:'ratinglike.php', data:'id='+id+'&type='+type, success:function(msg){ if(msg == 'err')

python - Move back to running instance of browser -

i'm working on robot framework (selenium2library). in test case, i've perform functionality on browser instance ( web application) , functionality on desktop application (here i'm using uft). i'm executing vbs script execute uft (automation tool). i'm doing , handling flow browser desktop application. once task of desktop application ended, should move current instance of browser (focus on web application). tried select window keyword. no luck. there way move instance of browser? note: browser instance executing test case in background. want on foreground. inject javascript alert , handle it, browser active on desktop. something javascriptexecutor js = (javascriptexecutor) driver; js.executescript("alert('ok')") and handle it.

jquery - Datetimepicker did not work on element that append form javascript -

i have 1 input date, input append js this var inputdate = '<input type="text" name="date[]" class="form-control date" placeholder="input date"'; $("form").append(inputdate); and html code : <form method="post"> ... </form> initialize datetimepicker $('.date').datetimepicker({ format: 'yyyy-mm-dd' }); the input element append succesfully , other form have input date work datetimepicker. element append js not showing datetimepicker, there mistakes? i think missed 1 thing here. var inputdate = '<input type="text" name="date[]" class="form-control date" placeholder="input date"'; it should have > @ end of string. the initialization code should re executed after append inputdate $('form') . so code should be: var inputdate = '<input type="text" name=

sql - Oracle forms12c Runtime setting-Aplication server URL -

i have oracle 12c client-server enviroment & running 12c ias. for aplication developement using oracle forms 12c builder. in forms builder under view->preferences there runtime tab. under runtime tab there option aplication server url. basically can run (f5) aplications forms builder long said . fmx on ias well. my problem constructing proper url link forms server. right have made this: http://[server]/forms/frmservlet?config=development link works browser/ias fails find application "can not run .fmx c:\....". if not specify exacty form want run this: http://[server]/forms/frmservlet?config=development&form=module2.fmx and make this: http://[server]/forms/frmservlet?config=development default form value passed local path .fmx. question is: how pass form name parameter?

csv - neo4j - Get all connections where a condition is matched -

Image
i trying nodes particular condition matches. csv looks, diagnosis drug_name total_cost average_cost arthritis rimadyl 38.87 38.87 ear infection rimadyl 15.67 7.835 massinmammarygland rimadyl 32.49 16.245 so when give following command, match (d:diagnosis)-[r:medicine]->(dn:drug_name)-[r1:costs]->(tc:total_cost)-[r2:avg_costs]->(ac:average_cost) d.id = 'arthritis' return distinct dn,r, d,r1,tc,r2,ac i getting below graph. however want 1 connection i.e., row 1 csv.

java - Unit test for Spring controller have RequestPart String param -

i must write unit test using junit spring web project. controller have parameter like @requestmapping(value = "/tasks/{id}/", method = requestmethod.put) public responseentity<string> unlock( @pathvariable string id, @requestpart string param) i dont know param receive. use @requestpart multipartfile. in test, inject class. add mockmvc (is part of spring test let call ws). prepare mock, ie: when(myclassinjected.mymethod()).thenreturn(the_result); perform call mockmvc. (you can follow tutorial @ end of post) verify call, ie: verify(myclassinjected, times(1)).mymethod(); check this tutorial more information.

sql server - Group and count by 16 hours time interval not working -

i trying number of records 16 hour time interval. below code using now. ;with cte_hours ( --hours generation select top(6) hr = (row_number() on (order (select null))-1)*4 master..spt_values ), cte2 ( --getting range select dateadd(hh, c.hr, convert(datetime,d.dts) ) dts_start, dateadd(ms, -2, dateadd(hh, c.hr+ 4, convert(datetime,d.dts) ) ) dts_end (select distinct convert(date, dt) dts test2 ) d cross apply cte_hours c ) --actual query select c2.dts_start dt, sum(case when t.dt not null 1 else 0 end) no_of_records,ld_voy_n,ld_vsl_m cte2 c2 left join test2 t on t.dt between c2.dts_start , c2.dts_end group c2.dts_start,ld_voy_n,ld_vsl_m order ld_voy_n, ld_vsl_m, dts_start asc this code able count number of records have based on 4,6, , 12 hour interval. however, if try count based on 16 hour interval, somehow not work. below code , output used 16 hour interval. ;with cte_hours ( --hours generation select top(6) hr = (row_number() on (order (select null))-1

reactjs - Webpack: Is package.json 'devDependencies' needed anymore? -

i playing create-react-app , found out put packages under normal "dependencies". built app , found out 'build' folder size 2.66 mb. then manually moved packages not needed in production "devdependencies" , built again, 'build' folder size still 2.66 mb. is there logic in webpack.prod.js file, knows needed if packages listed under "dependencies"? if so, there still benefits using "devdependencies" in package.json? when webpack builds project determines project depends on, starting @ entry file, , combines, uglifies , on, , disregards else. for example, if index.js entry file , depends on moment.js , moment.js included in build regardless if it's dependency or devdependency. the reason npm distinguishes between dependencies , devdependencies, while webpack distinguishes between needed , not. if so, there still benefits using "devdependencies" in package.json? i still use devdependencie

android - React-Native call a function on default animation end? -

in app screen, calling several api's on componentdidmount() shown below componentdidmount(){ approvername = i18n.t('setapprover',{locale:locale}); asyncstorage.getitem("authkey").then((ak) => { authkey = ak; settimeout(() => {currentcontext.props.getleavetypes(ak)}, 10000); settimeout(() => {currentcontext.props.getcategory(ak)}, 10000); settimeout(() => {currentcontext.props.getprojects(ak)}, 10000); }).done(); } since api calls occur parallelly animation there delay during screen loading(animation slow), tried calling api after timeout not helping. please tell me how call below functions currentcontext.props.getleavetypes(ak) currentcontext.props.getcategory(ak) currentcontext.props.getprojects(ak) on animation end.i have imported nothing related animation , there no code related it.its default animation in react-native.

java - Apache Camel SFTP download is not working -

i trying download file sftp server location log looks nothing downloaded server local.no errors coming.please give inputs in advance. sftp files available: [root@rsysftp test1]# ls /tmp/files/test1 test1.txt test2.txt test3.txt test4.txt router: @component public class samplecamelrouter extends routebuilder { @override public void configure() throws exception { getcontext().getshutdownstrategy().settimeout(10); from("sftp://ftpuser1@some.ip.value.here/tmp/files/test1?password=pass") .to("file:c:/out") .log("downloaded file ${file:name} complete."); } } log: o.a.camel.spring.springcamelcontext : route: route1 started , consuming from: sftp://ftpuser1@some.ip.value.here/tmp/files/test1/test1.txt?password=xxxxxx o.a.camel.spring.springcamelcontext : total 1 routes, of 1 started. o.a.camel.spring.springcamelcontext : apache camel 2.18.1 (camelcontext: samplecamel)

c++ - Returning a C string in a constexpr function: why no warning from the compiler? -

consider following code: constexpr auto f() { auto str = "hello world!"; return str; } int main(int argc, char* argv[]) { static constexpr auto str = f(); std::cout << str << std::endl; return 0; } is normal compiler not display warning? defined behavior? have guarantee program display "hello world!" ? expect "hello world!" not live beyond scope of function... in c++ string literals have static storage duration , live long program runs. so, pointer string literal returned f valid. no allocation or deallocation involved. note string literals have type const char[n] , in case decays const char * due auto type deduction. if intent use std::string , can directly construct it auto str = std::string("hello world!"); or use operator""s : using std::string_literals; auto str = "hello world!"s; however, since std::string not literal type, values cannot constexpr anymor

javascript - i have textbox in which i want the user to enter only 5000 or 5000+ number -

this question has answer here: javascript - validate numeric , within range 3 answers $gramweight = $ary['packagingweightgram']; $qtyunit = $ary['packagingunit']; $weight = $weight + ((ceil($qty/$qtyunit) * $gramweight)/1000); $freightprice = calculateshipfreight($pricemode,$weight,$countryid); break; case 1: //was earlier postal method, never got programmed because discontinued break; case 2: //first need find weight of cards shipped... //then need find corresponding value per zone $sql = "select * sizespecification sizespecificationid=$sizespecificationid"; //print $sql;

python - AWS Jupyter Notebook EC3 Instance: Getting error while reading pandas csv from S3 -

while reading csv s3 kernel restarting below pop : kernel restarting kernel appears have died. restart automatically below code snippet: import boto3 import pandas pd boto.s3.connection import s3connection your_access_key='******' your_secret_key='******' your_bucket='******' client = boto3.client('s3',aws_access_key_id=your_access_key, aws_secret_access_key=your_secret_key) client.download_file(your_bucket, 'test.csv','test.csv') error thrown below line : test_df = pd.read_csv('test.csv') but can access other files such sample text file: client.download_file(your_bucket, 'sample.txt','sample.txt') print(open('sample.txt').read()) before assumed error because of huge size of csv file reading 5mb csv file resulting same error. would appreciate !

relativelayout - How set android:layout_marginBottom programm? -

to drag image on screen created own class: private class customimageview extends appcompatimageview in constructor want set params: public customimageview(context context) { super(context); params = new relativelayout.layoutparams(relativelayout.layoutparams.match_parent, relativelayout.layoutparams.match_parent); params.bottommargin = 50; this.setscaletype(imageview.scaletype.center_crop); this.setlayoutparams(params); this.setwillnotdraw(false); } my activity_main.xml: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.eleizo.firstapplication.mainactivity"> </relativelayout> i want have : <relativelayout xmlns:android

centos - What's rabbitmqctl password? -

i have install rabbitmq 3.6.10 on centos7. when want rabbitmqctl ,it ask me password. have tried su password or guest raddbitmq default password,but appeard su: cannot make/remove entry specified session .is there anyway fix it? rabbitmqctl has not password, asks sudo password. the problem: cannot make/remove entry specified session not related rabbitmq have kind of problem. there several posts, check example this: https://unix.stackexchange.com/questions/152098/what-does-cannot-make-remove-an-entry-for-the-specified-session-mean

asp.net - catch ispostback event javascript -

i need catch ispostback event using javascript purpose. found many example in google none of them has worked me. 1 example used below: $(document).ready(function () { var chkpostback = '<%= page.ispostback ? "true" : "false" %>'; if (chkpostback == 'true') { alert("ispostback alert"); } }); but not working.

javascript - How WordPress Plugin Handles Form Submission -

i'm building wordpress plugin first time , ask how wordpress plugin handles typical form submission. so example if creating search plugin url @ http://wordpress/plugin-name/search , how display user result page @ http://wordpress/plugin-name/result ? have create result page , send user page programatically within plugin itself? any resources or example appreciated! thanks. it depends on thing plugin have yes, have create result page , send user there. what trying build, may suggest more specific if know more details?

go - What does piece of code do in golang? -

this question has answer here: is casting in golang? 1 answer i tried search , figure out how work i'm having trouble finding explanation. if have variable data of type interface{} ( data interface{} ) what eventdata := data.(map[string]interface{}) doing? know interface can represent number of things, high level overview of happening here? it type assertion: a type assertion provides access interface value's underlying concrete value. t := i.(t) https://tour.golang.org/methods/15 if asserion not hold trigger panic. test if value of specific type t can use this: t, ok := i.(t) ok boolean true if assertion holds , false otherwise.

Camel FTP, Move issue -

i'm having sftp consumer route like: <from uri="sftp://ip:port/mydirectory?username=myuser&amp;password=mypasswd&amp;move=${date:now:yyyymmdd}/${file:onlyname}"/> the user has read/write permission. when component tries move file "move" directory (that directory not created) once complete fails on: org.apache.camel.component.file.genericfileoperationfailedexception: cannot create directory: mydirectory/20170727 (could because of denied permissions) but if connect sftp filezilla same user/passwd can create directory , camel move done files there. any ideas?

Square V1 api request not working as per API docs -

we experiencing errors few of square apis, working week back, not working per documentation, changed related square, not able find out in news : https://docs.connect.squareup.com/api/connect/v1/?q=employee#navsection-roles & https://docs.connect.squareup.com/api/connect/v1/?q=employee#navsection-employees . request/response in question. ex 1: valid role_ids it's failing, used work 3-4 days back. post https://connect.squareup.com/v1/me/employees http/1.1 host: connect.squareup.com accept: */* authorization: bearer ***************************** content-type: application/json content-length: 120 { "first_name": "first_name_test_sp", "last_name": "last_name_test_sp", "role_ids": ["t6u3cmjnh7ezbalvpfql"] } -- http/1.1 400 bad request x-frame-options: deny x-xss-protection: 1; mode=block x-download-options: noopen x-content-type-options: nosniff x-request-id: v6fctnekqb2p9lspswcs access-control-allow-origi

azure web sites - DNN upgrade failed from 7.3.2 to 8.0.3 failed but after rollback menu does not show -

we did upgrade 7.3.2 8.0.3 , menu not show after did roll back. content , functionality works properly. when looking log find following exception in it. site hosted in azure. 2017-07-27 12:09:30,915 [rd00155d825c0a][thread:14][error] dotnetnuke.services.exceptions.exceptions - system.invalidoperationexception: not locate razor host factory type: system.web.mvc.mvcwebrazorhostfactory, system.web.mvc @ system.web.webpages.razor.webrazorhostfactory.createfactory(string typename) @ system.collections.concurrent.concurrentdictionary`2.getoradd(tkey key, func`2 valuefactory) @ system.web.webpages.razor.webrazorhostfactory.createhostfromconfigcore(razorwebsectiongroup config, string virtualpath, string physicalpath) @ system.web.webpages.razor.webrazorhostfactory.createhostfromconfig(string virtualpath, string physicalpath) @ system.web.webpages.razor.razorbuildprovider.gethostfromconfig() @ system.web.webpages.razor.razorbuildprovider.createhost() @ system.web.webp

How do you performance test JavaScript code? -

cpu cycles, memory usage, execution time, etc.? added: there quantitative way of testing performance in javascript besides perception of how fast code runs? profilers way numbers, in experience, perceived performance matters user/client. example, had project ext accordion expanded show data , few nested ext grids. rendering pretty fast, no single operation took long time, there lot of information being rendered @ once, felt slow user. we 'fixed' this, not switching faster component, or optimizing method, rendering data first, rendering grids settimeout. so, information appeared first, grids pop place second later. overall, took more processing time way, user, perceived performance improved. edit: answer 7 years old. these days, chrome profiler , other tools universally available , easy use, console.time() , console.profile() , , performance.now() . chrome gives timeline view can show killing frame rate, user might waiting, etc. finding documentation the

c# - Cannot define a class or member that utilizes 'dynamic' compiler required type 'System.Runtime.CompilerServices.DynamicAttribute' not found -

i'm facing issue asp.net core targeting framework 4.6.1. cannot define class or member utilizes 'dynamic' because compiler required type 'system.runtime.compilerservices.dynamicattribute' cannot found. missing reference? + public class _views_home_index_cshtml : microsoft.aspnetcore.mvc.razor.razorpage predefined type 'system.boolean' not defined or imported + public class _views_home_index_cshtml : microsoft.aspnetcore.mvc.razor.razorpage type 'object' defined in assembly not referenced. must add reference assembly 'mscorlib, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089'. + public class _views_home_index_cshtml : microsoft.aspnetcore.mvc.razor.razorpage type 'object' defined in assembly not referenced. must add reference assembly 'mscorlib, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089'. + public microsoft.aspnetcore.mvc.viewfeatures.i

javascript - Socket.io in express receives undefined data from the client -

Image
i'm working on simple tic-tac-toe app , whenever player hits button trigger function markthecell(button) passing button's id. function emits player string value , button id server. put console log in client page see whether valid value being passed , is. when tried log in server value of player become object object , button id undefined. don't know if failed how put , use parameters correctly. hope lend because i'm stuck this. index.html <body> <div class="col-lg-4"></div> <div class="col-lg-4 jumbotron"> <h4>you player <span id="name"></span></h4> <button id="one" onclick="markthecell(this.id)" class="btn btn-default"></button> <button class="btn btn-default"></button> <button class="btn btn-default"></button></br> <