Posts

Showing posts from January, 2010

What is the relationship of HTTP headers and directory with destructors in php? -

i know destructor in php oop 1 thing want know relationship of http headers , directory destructor in php ? can tell mean ? destructors called during script shutdown have http headers sent. working directory in script shutdown phase can different sapis (e.g. apache). this documented in destructor in reference link below. http://php.net/manual/en/language.oop5.decon.php that attempts explain when destructor called headers_sent() return true , gives heads working directory might different when destructor called(it may not same how during constructor or when other methods called)(typically working directory script lives). work around use absolute path or use chdir(); so need careful when doing actions following: class files{ function __destruct() { unlink($this->logfile); // may wrong if relative path } } going first part, when destructors called, headers sent. won't able things depend on "header sent". example, redirect

java - MATLAB 2016b Doc Set Throwable on Startup -

recently on start of matlab 2016b, began receiving following message in command window: "caught throwable while adding doc set item doc set builder: null" looks same throwable message stackoverflow user experiencing: error on opening matlab related null tried restoring defaults on paths, preferences, ect... i've been digging around in javaclasspaths , matlab log files haven't been able find information on problem. any appreciated!

FormArray without FormControls and just strings Angular 2 -

i have 2 string arrays on backend have fill either single string or multiple strings. not key value pairs. trying push string 1 of arrays running fact not , cannot specify control: value pair. my formarray looks collections: new formarray([]), my html select strings <md-select placeholder="collection"> <md-option (click)="addcollectionid('one')" value="local">local</md-option> <md-option (click)="addcollectionid('two')" value="music">music</md-option> <md-option (click)="addcollectionid('three')" value="performing arts">performing arts</md-option> <md-option (click)="addcollectionid('four')" value="sports">sports</md-option> <md-option (click)="addcollectionid('five')" value="restaurants">restau

python - Extract text from webpage with Selenium -

i attempting extract ip addresses webpage using following code (snippet). ips = driver.find_elements_by_xpath("//span[contains(text(), '10.')]") print(ips) the html element(s) this: <span style="padding: 1px 4px;float:left;">10.20.20.20</span> inspect >> copy xpath returns: //*[@id="t1700010887"]/tbody/tr[2]/td[1]/nobr/span but code prints looks generic selenium code: [<selenium.webdriver.remote.webelement.webelement (session="7885f3a61de714f2cb33 b23d03112ff2", element="0.5496921740104628-2")>, <selenium.webdriver.remote.webe lement.webelement (session="7885f3a61de714f2cb33b23d03112ff2", element="0.549692 1740104628-3")>, <selenium.webdriver.remote.webelement.webelement (session="7885 f3a61de714f2cb33b23d03112ff2", element="0.5496921740104628-4")>] how can print actual ip of 10.20.20.20? when using selenium's element fin

html - Confusion with using translate when centering an element in CSS -

.center{ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } i using center element class name center, not quite sure how transform , translate work in css , how make element centered.

serialization - Reading AVRO or JSON records in redshift -

i serializing , deserializing data using avro. save serialized data s3. trying read data in s3 redshift, unable read it. tried avro format s3 records - {"breachid":"0eb3130c-241a-461b-99ab-4910301fa012","metricname":"sic_fast_track","regionid":"1","marketplace":"1","glproductgroup":"14","snapshotdate":"2017-09-11","breachdate":"2017-08-14","year":2017,"baseweeknumber":29,"weeknumber":29} command @ redshift end - copy test 's3://test/test.avro' credentials 'aws_iam_role=arn:aws:iam::355548666665:role/my_iam_role' format avro 'auto'; error @ redshift - [ amazon](500310) invalid operation: invalid avro file details: ----------------------------------------------- error: invalid avro file code: 8001 context: cannot init avro reader s3 file incorrect avro container

Python folder copying issue -

i'm trying copy directory portable drive main disk using following lines: temp_command = "xcopy " + new_dir + " " + basedir + "/libraries/installed" #this isn't working. raises error. if subprocess.check_output(temp_command) == true: # copy file local directory on c: and error: invalid number of parameters traceback (most recent call last): file "e:/jason core/boot.py", line 103, in <module> control() file "e:/jason core/boot.py", line 96, in control install_libs() file "e:/jason core/boot.py", line 45, in install_libs if subprocess.check_output(temp_command) == true: # copy file local directory on c: file "c:\python27\lib\subprocess.py", line 574, in check_output raise calledprocesserror(retcode, cmd, output=output) subprocess.calledprocesserror: command 'xcopy c:/downloads/python_libraries e:/libraries/installed' returned non-zero exit status 4 any sugge

javascript - changing props in react_component when using react_rails -

i using helper display datepicker component <%= react_component "mydatepicker", startdate: '', enddate: ''%> i want pass javascript values startdate , enddate props. possible way this? i don't know you're trying here if want values of props component rails controller, following. can set state of props in react component , send ajax request whenever user selects date.

sql - Retrieve upcoming birthdays in Postgres -

i have users table dob (date of birth) field, in postgres database. i want write query retrieve next 5 upcoming birthdays. think following needs considered - sorting date of birth won't work because years can different. you want result sorted date/month, starting today. so, example, yesterday's date last row. ideally, without functions. not deal breaker though. similar questions have been asked on so, most don't have accepted answer. thank you. you can @ day of year of dob , compare against current date's doy: select doy , extract(doy dob) - extract(doy current_date) upcoming_bday users extract(doy dob) - extract(doy current_date) >= 0 order 2 limit 5

routing - Angular router always redirecting to the same module -

this driving me crazy. have 3 simple routes in app module: routes: routes = [ { path: '', redirectto: '/customers', pathmatch: 'full' }, { path: 'customers', loadchildren: './components/customer#customermodule' }, { path: 'promotions', loadchildren: './components/promotion#promotionmodule'} ]; in customer module have defined theses routes: routes: routes = [ { path: '', component: customercomponent, children: [ { path: '', component: customersearchcomponent }, { path: ':id', component: customerdetailcomponent } ]} ]; and in promotion modules: routes: routes = [ { path: '', component: promotioncomponent }, { path: 'new', component: promotionnewcomponent } ]; i have <router-outlet></router-outlet> in appcomponent , customercomponent. thing is, when going route /promotions, still getting redirected customer

python - Mapping methods across multiple columns in a Pandas DataFrame -

i have pandas dataframe values lists: import pandas pd df = pd.dataframe({'x':[[1, 5], [1, 2]], 'y':[[1, 2, 5], [1, 3, 5]]}) df x y 0 [1, 5] [1, 2, 5] 1 [1, 2] [1, 3, 5] i want check if lists in x subsets of lists in y. individual lists, can using set(x).issubset(set(y)) . how across pandas data columns? so far, thing i've come use individual lists workaround, convert result pandas. seems bit complicated task: foo = [set(df['x'][i]).issubset(set(df['y'][i])) in range(len(df['x']))] foo = pd.dataframe(foo) foo.columns = ['x_sub_y'] pd.merge(df, foo, how = 'inner', left_index = true, right_index = true) x y x_sub_y 0 [1, 5] [1, 2, 5] true 1 [1, 2] [1, 3, 5] false is there easier way achieve this? possibly using .map or .apply ? use set , issubset : df.assign(x_sub_y = df.apply(lambda x: set(x.x).issubset(set(x.y)), axis=1)) output: x

xml parsing using minidom and python -

i have xml below. <?xml version="1.0" encoding="utf-8"?> <samplexml>" <customproperty> <name>test1</name> <value>testvalue1</value> </customproperty> </samplexml>` i trying values test1 , testvalue1. trying multiple ways not able values. how values not using "getelementsbytagname"name"/"value"" child nodes names keep on changing. so assume not using name , value find text because changing. can use below should solve issue.also assume tag named same import xml.etree.elementtree et tree = et.parse('sample.xml') child in tree.find('customproperty'): print(child.text) for example code output below: test1 testvalue1 your xml file seems have character @ ending, please change below. <?xml version="1.0" encoding="utf-8"?> <samplexml> <customproperty> <na

amazon web services - Equivalent for Kafka / AWS Kinesis Stream on Google Cloud Platform -

i'm building app appending buffer while many readers consume buffer independently (write-once-read-many / worm). @ first thought of using apache kafka, prefer as-a-service option started investigating aws kinesis streams + kcl , seems can accomplish task them. basically need 2 features: ordering (the events must read in same order readers) , ability choose offset in buffer reader starts consuming onwards. now i'm evaluating google cloud platform. reading documentation seems google pub/sub suggested equivalent aws kinesis stream, @ more detailed level these products seem lot different: kinesis guarantees ordering inside shard, while on pub/sub ordering on best-effort basis; kinesis has buffer (limited max 7 days) available readers, can use offset select starting reading position, while on pubsub messages after subscription available consuption. if got right, pubsub cannot considered kinesis equivalent. perhaps if used google dataflow? must confess still can't

python - Flask Web App: (psycopg2.OperationalError) server closed the connection unexpectedly -

Image
i have small application on azure runs web app following traits: python (flask sqlalchemy) postgresql i'm trying create table python code through sqlalchemy. here's folder structure: here's __init__.py file: from flask import flask flask_sqlalchemy import sqlalchemy postgres = { 'user': 'admin_user@pracap', 'pw': 'password_goes_here', 'db': 'apitest', 'host': 'pracap.postgres.database.azure.com', 'port': '5432', } url = 'postgresql://%(user)s:\%(pw)s@%(host)s:%(port)s/%(db)s' % postgres app = flask(__name__) app.config['sqlalchemy_database_uri'] = url app.config['sqlalchemy_track_modifications'] = false db = sqlalchemy(app) import apitestproject.index then have index.py file: from flask import flask flask_restful import api apitestproject import app, db @app.before_first_request def create_tables(): db.create_all() @app.

php - Need help on using React with json data -

Image
i want work backend system can pull data use react put on screen updating virtual dom. using form , setting state form variable, made string passing php page var datastring = 'name='+ this.state.name +'&email='+ this.state.email +'&dob='+ this.state.dob +'&mobile= '+this.state.number; $.ajax({ url: "http://localhost/reactjs/api/readformdata.php", type : "post", data : datastring, cache: false, success: function(html){ alert(html); this.setstate({serverresponce: html}); }, });` `<?php if(count($_post)>0){ $email = $_post['email']; $name = $_post['name']; $dob = $_post['dob']; $mobile = $_post['mobile']; $value = [ "name" => "{$name}", "email" => "{$email}", "dob"=> "{$dob}", "mobile"=>"{$mobile}" ]; echo json_encode((

ruby on rails - How do I get a constant recongized in my mailer file? -

with rails 5, how constant recognized in mailer file? have file, app/mailers/user_notifier.rb, class usernotifier < actionmailer::base ... # send notification email user price def send_confirmation_email(user_id) @user = user.find(user_id) mail( :to => @user.email, :subject => constants::email_confirmation_subject ) end end but when gets line, ":subject => constants::email_confirmation_subject )" dies error uninitialized constant constants::email_confirmation_subject despite fact have constant defined in config/initializers/global.rb file module constants # subject email confirmations email_confirmation_subject = "please confirm email." end how fix this? you don't need prefix constant module name. constant available in global scope. email: def send_confirmation_email(user_id) @user = user.find(user_id) mail( :to => @user.email, :subject => email_confirmation_subject ) end co

visual studio 2017 - Compile to simple .exe -

i have simple c# project in visual studio 2017. it console application (.net framework). i want compile .exe , copy .exe server run. when do: build -> publish myapp setup.exe file bunch of other files presume setup.exe use install on target machine. when do: build -> build myapp vs comes instantly without popup. can see .exe here: myapp\bin\debug\myapp.exe has timestamp indicates built build -> build myapp i want control .exe deployed on server because have scheme adds version numbers .exes controlled backing them out , know changing on server (this in contrast running setup.exe). should use myapp\obj\debug\myapp.exe? [seems strange use .exe debug folder]. what other build options should try?

database - Mysql return count for last 7 days -

i having trouble run code below count rows grouped date returns wrong count each days select date(date) days ,coalesce(count(credits),0) credits offer_process qa left join ( select date(now())-interval 30 day day_series from(select 0 union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 ) ) qb on date(date) = date(date) date > date_sub(curdate(), interval 7 day) group date(date) order date(date) asc; insted of returning 1 each rows example, returns 7, not true what one. return count of credits selected id each of last 7 days. select (date(now()) - interval `day` day) `daydate`, count(`credits`) `credits` ( select 0 `day` union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 ) `week` left join `offer_process` on date(`date`) = (date(now()) - interval `day` day) ,

bash - need help utilizing find command and xargs command -

i'm trying write simple scripts can mv every file within folder folder generated current date. initiatives. #!/bin/bash storage_folder=`date +%f` # date generated name folder mkdir "$storage_folder" #createing folder store data find "$pwd" | xargs -e mv "$storage_folder" # mv everyfile folder xargs not needed. try: find . -exec mv -t "$storage_folder" {} + notes: find's -exec feature eliminates needs xargs . because . refers current working directoy, find "$pwd" same simpler find . . the -t target option mv tells mv move files target directory. handy here because allows fit mv command natural format find -exec command. posix if not have gnu tools, mv may not have -t option. in case: find . -exec sh -c 'mv -- "$1" "$storage_folder"' move {} \; the above creates 1 shell process each move. more efficient approach, suggested charles duffy in comments, p

Ext.Net button not working correctly after chrome update -

when working ext.net, after disabling button disappears dom. seems css or javascript issue because button there , after playing css properties height , width button show again. if iterate through collection of buttons , change css display property block, fix problem. findbuttonbytextcontent("text find"); function findbuttonbytextcontent(text) { var buttons = document.queryselectorall('button'); (var i=0, l=buttons.length; i<l; i++) { if (buttons[i].firstchild.nodevalue == text){ buttons[i].style.display = "block"; } } }

Gulp - How to change a destination folders permissions? -

i'm copying file , creating new destination folder file. return gulp.src('path/to/file/file.jpg') .pipe( gulp.dest('path/to/destination'); the problem folder created has wrong permissions. i've looked on , can't seem find information on how change destination folder's permissions gulp. i've looked gulp-chmod, far can change permissions of file.jpg within new folder. gulp.src('path/to/file/file.jpg') .pipe(chmod(0o777, true)) .pipe( gulp.dest('path/to/destination/')); you might try adding "mode" option gulp.dest since state creating new folder. see gulp.dest(path[, options]) options.mode type: string default: 0777 octal permission string specifying mode folders need created output folder. so, .pipe( gulp.dest('path/to/destination', {mode: 0777}); although default think shouldn't need it. try using 0777 instead of 0o777 in chmod call easy try.

swift - Stop NSComboBox from expanding to content size in a constraint based layout -

Image
i have little view can resized has constraint based layout: unfortunately when value picked nscombobox, length of string pushing around layout. hard tell here because images scaled if had string width of entire screen push way. how stop this? you need set combo box's compression resistance priority less 490 ( nslayoutprioritydragthatcannotresizewindow ). makes autolayout system prefer make combo box smaller intrinsic size rather make window bigger.

apache - What is involved in PHP's startup sequence? -

regarding display_startup_errors php manual says when display_errors on, errors occur during php's startup sequence not displayed. meant php's startup sequence? involve, , kind of errors can occur there? common examples help. the common types of errors you'll see suppressed display_startup_errors going related php failing load modules or modules emitting error messages various reasons. for example: php warning: php startup: unable load dynamic library '/path/to/module.so' - /path/to/module.so: cannot open shared object file: no such file or directory in unknown on line 0 this means php configured load module.so it's not found cannot loaded. a module might emit warning due bad ini configuration values: php warning: php startup: session.name cannot numeric or empty '' in unknown on line 0 this 1 of several warnings session extension emits, in case because configuration value session.name numeric or empty. most of ph

MySql Trigger on Insert, Update -

i have been using mysql time totally new mysql triggers. i have database : jours ( jour (date, primary key), ventes (int), soldeinitial( int)) ; achatscharges ( id (int, primary key), libelle (varchar), prix (int), #jour (date, forein key). after each insert or update on table (' achatscharges ') trigger should check if ' soldeinitial ' value in table ' jours ' null update formula : 'something like( value of ' jours.soldeinitial ' of last row in ' jours ' - sum(achatscharges.prix) + jours.ventes ' this have tried : create trigger updatesolde after insert, update on achatscharges each row begin if((select jours.soldeinitial jours jours.jour=new.jour) null) update jours set jours.soldeinitial=((select jours.soldeinitial jours jours.soldeinitial not null order jours.jour desc limit 1)-sum(new.prix)+jours.ventes) jours.jour=new.jour); end if; end this example : +------------+-------- +---------------------+ |

curl - Some options not populated in php's curl_getinfo -

i'm seeing options not populated in return value of curl_getinfo, notably curlinfo_local_ip. here's code runs curl: $ch = curl_init("http://www.example.com/"); curl_setopt($ch, curlopt_header, 0); $m = fopen('php://memory', 'w+'); curl_setopt($ch, curlopt_stderr, $m); curl_setopt($ch, curlopt_returntransfer, true); curl_exec($ch); print_r(curl_getinfo($ch)); var_dump(curl_error($ch)); $p = ftell($m); $p += 1 << 20; rewind($m); $stderr = fread($m, $p); //var_dump($stderr); fclose($m); curl_close($ch); (there nothing of note in curl_error or stderr output) here's curl_getinfo dump: array ( [url] => http://www.example.com/ [content_type] => text/html [http_code] => 200 [header_size] => 322 [request_size] => 54 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.007369 [namelookup_time] => 0.004603 [connect_time] => 0.005864

mysql - While starting Hive I am getting SSL error. Its working but I cant perform bucketing until I resolve the error -

below error: tue sep 12 03:21:00 ist 2017 warn: establishing ssl connection without server's identity verification not recommended. according mysql 5.5.45+, 5.6.26+ , 5.7.6+ requirements ssl connection must established default if explicit option isn't set. compliance existing applications not using ssl verifyservercertificate property set 'false'. need either explicitly disable ssl setting usessl=false, or set usessl=true , provide truststore server certificate verification. how can resolve issue.any idea this ssl warning can fixed putting "?usessl=false" in jdbc connection string present @ hive-site.xml. ie <property> <name>javax.jdo.option.connectionurl</name> <value>jdbc:mysql://localhost/metastore?usessl=false</value> <description>metadata stored in mysql server</description>

Excel: SUMIF an Undefined Range set by Blank Cells -

i'm trying sum range of cells changing range. a 0 0 5 0 b 1 c 2 4 as in "a" should return 5, "b" 1, , "c" 6. research tells offset formula may work i've got no luck. how this: insert column between data columns , paste formula: (assuming col has a,b,c , col c has numbers , paste in col b): =if(and(a2="",a1<>""),b1,if(and(a2="",a1=""),b1,a2)) please add header row avoid error on first column... this fill values , data like: cola colb colc 0 0 5 0 b b 1 c c 2 c 4 now can use sumif or array entered formula sum values: formula in col f =sum(if($b:$b=e2,$c:$c,0)) (use ctrl+shift+enter instead of normal enter make array formula) cole colf c 6 b 1 5 hope helps.

weblogic deployment issue Caused By: java.lang.ClassNotFoundException: com.bea.p13n.servlets.AnonymousProfileListener -

hi guys getting below issue when publishing project weblogic server 10.3.6. can see class part of p13n-app-lib jar deployed on adminserver. tried add p13_ejb classpath , still no luck. weblogic.application.moduleexception: [http:101163]could not load user defined listener: com.bea.p13n.servlets.anonymousprofilelistener java.lang.classnotfoundexception: com.bea.p13n.servlets.anonymousprofilelistener @ weblogic.utils.classloaders.genericclassloader.findlocalclass(genericclassloader.java:297) @ weblogic.utils.classloaders.genericclassloader.findclass(genericclassloader.java:270) @ weblogic.utils.classloaders.changeawareclassloader.findclass(changeawareclassloader.java:64) @ java.lang.classloader.loadclass(classloader.java:306) @ java.lang.classloader.loadclass(classloader.java:247) @ weblogic.utils.classloaders.genericclassloader.loadclass(genericclassloader.java:179) @ weblogic.utils.classloaders.changeawareclassloader.loadclass(changeawareclassloader.

Compiler error when comparing two typeid expressions for equality -

on code comes training video: #include <iostream> template<typename t> struct mystruct { t data; }; int main(void) { mystruct<int> s; s.data = 2; assert(typeid(s.data) == typeid(int)); } i compiler error: class_templates.cpp:12:26: error: invalid operands binary expression ('const std::type_info' , 'const std::type_info') assert(typeid(s.data) == typeid(int)); ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~ compiled with: clang++ -std=c++14 class_templates.cpp edit: had compiled g++ have gotten better error: class_templates.cpp:14:20: error: must #include <typeinfo> before using typeid assert(typeid(s.data) == typeid(int)); you must use #include <typeinfo> in order use typeid() , otherwise program ill-formed. also see: why need #include <typeinfo> when using typeid operator?

ios - Understanding subviews frame in UIScrollView -

Image
i have following code i'm trying dynamically add subviews uiscrollview.. however, result not i've expected. here is: let red = uiview(frame: cgrect(x: 0, y: 0, width: 20, height: 20)) red.backgroundcolor = uicolor.red let blue = uiscrollview(frame: cgrect(x: 0, y: 100, width: uiscreen.main.bounds.width, height: 200)) blue.backgroundcolor = uicolor.blue blue.addsubview(red) view.addsubview(blue) why on earth red square not @ top left corner of scroll view expected...? how can make happen?

Calling a Python Script from Jenkins Pipeline DSL causing import error -

code: sh 'python ./selenium/xy_python/run_tests.py' error: traceback (most recent call last): file "./selenium/xy_python/run_tests.py", line 6, in import nose importerror: no module named nose does run if start manually? if yes, might have problems pythonpath. can use withenv set it. withenv(['pythonpath=/your/pythonpath') { sh 'python ./selenium/xy_python/run_tests.py' }

asp.net - How secure is storing JWT Token in the browser? -

i implementing token based authentication using jwt , have read far, way store throughout session through localstorage / cookie. since value in clear text can use dev toolbar see cookies, what's stop using token , sending on endpoints publicly exposed? in normal cases, user able token via dev toolbar same user able aquire token in regular way. should not security problem. each jwt token should contain audience (aud) claim, checked every resource. token can't used access endpoints wasn't issued.

javascript - How to close calendar popup after clicking on date -

how can hide calendar after date selected? using date-time-picker danyelykpan . is there specific function can use? code below <div class="col-3"> <div class="form-group calenderform calenderform1"> <label for="templatename">repair date (from)</label> <owl-date-time name="repairdatefrom" [(ngmodel)]="repairdatefrom" [max]="max" [type]="'calendar'" [dateformat]="'yyyy-mm-dd'" [placeholder]="'yyyy-mm-dd'" ></owl-date-time> <div class="error-message-block"></div> <input type="hidden" name="repairdatefrom" id = "repairdatefrom" value=" {{repairdatefrom | date: 'yyyy-mm-dd'}}" (click)="closedatepopup()"/> </div> </div> from top of code through picker plugin component call goes below funct

koa2 - How to redirect some URL conditionally in the koa 2 -

this i'm thinking, pseudo code. const myredirect = (routepath) => { newurl = routepath; if (matches condition) newurl = do_some_modification(routepath); return next(newurl); } const myfunc = (routepath, myredirect) => (newurl, middleware) => { return (ctx, newurl, next) => { return middleware(ctx, newurl, next); } }; how modify make work please ? const route = async function(ctx, next){ if(shouldredirect){ ctx.redirect('/redirect-url') // redirect page } else{ ctx.somedata = getsomedata() // ctx.somedata available in next middleware await next() // go next middleware } }

javascript - Vue: Component :prop="object[key]" aren't reactive -

i'm trying bind value object prop of component, isn't reactive. i'm using $this.set , doesn't work @ all. here's template: <div class="grid"> <emoji-card v-for="name in shuffledemoji" :name="name" :ticked="tickedemoji[name]" :key="name" @click="tickemoji(name)" /> </div> shuffledemoji : array<string> here, tickedemoji object keys being strings, , values being boolean s. tickemoji sets tickedemoji[name] name true : methods: { tickemoji (name) { this.$set(this.tickedemoji, name, true) } }, that method gets called fine, component doesn't notice changes. child component: <template> <div class="card" @click="$emit('click')"> <img draggable="false" :src="`/static/blobs/${name}.png`"> <img v-show="ticked" class="green-tick" dragga

INET_E_DOWNLOAD_FAILURE in wordpress admin plugin page -

i'm experiencing unusual problem wordpress dashboard. i created wordpress website in local using xampp. after that, uploaded web hosting. the website runs without problems. however when entered plugin in dashboard, following message shown , can't seen installed plugins. the message can’t reach page , more information says the connection website reset. error code: inet_e_download_failure . also, general settings page not shown correctly. thanks!

javascript - Unable to reach a function inside SignalR connection function -

i trying access function inside signalr connection function. better illustrate code whole script. $(function() { var chat = $.connection.chathub; chat.client.informofstatusrequest = function(persontonotify, message) { var sysuserid = @convert.toint32(httpcontext.current.request.cookies["sys_user_id"].value); if (sysuserid === persontonotify) { $.notify({ icon: 'glyphicon glyphicon-star', message: message }, { animate: { enter: 'animated fadeinright', exit: 'animated fadeoutright' } }); } } $.connection.hub.start().done(function() { function disapproveticket(ticketid, createdbyid) { bootbox.confirm({ title: 'confirm', message: 'disapprove ticket id ' +ticketid +'?', buttons: {

r - how to print unit of the feature on plot using function? -

Image
i have function creating plots in r. wish print unit along feature name. below code. library(ggplot2) plotfunction <- function(feature, featur_name, feature_unit){ ggplot(aes(x = feature), data = mtcars) + geom_histogram(binwidth = 0.5) + labs(x = paste(featur_name, feature_unit), y = "count, #") } plotfunction(mtcars$wt, "displacement, ", expression({g}/{dm}^{3})) the function produces plot as shown below. not graceful solution, here goes: plotfunction2 <- function(feature_name, feature_unit){ x.lab = paste0("expression(paste('", feature_name, "', ", feature_unit, "))") ggplot(data = mtcars, aes(wt)) + geom_histogram(binwidth = 0.5) + labs(x = eval(parse(text = x.lab))) } plotfunction2("displacement, ", "{g}/{dm}^{3}") (i left first argument out because data input isn't part of real question here... though shouldn't define aesthetic mapping $

machine learning - a perceptron algorithm with standard gradient descent in python -

i designed perceptron standard gradient descent, has errors non-descent number of errors, shown below. could def predict(row, weights, bias): activation = 0 in xrange(len(row) - 1): activation += row[i] * weights[i] activation += bias return activation def data_train(dataset, weights, bias, rolling_time): sum_loss_w = [0, 0, 0, 0] loss_b = 0 time in xrange(rolling_time): sum_loss = 0 row in dataset: prediction = predict(row, weights, bias) prediction_m = row[-1] * prediction if prediction_m <= 0: sum_loss += 1 in xrange(len(single_error_w)): single_error_w[i] = row[i] * row[-1] sum_loss_w[i] += single_error_w[i] loss_b += row[-1] element in xrange(len(weights)): weights[element] = weights[element] + step_size * sum_loss_w[element] bias = bias + step_size * loss_b print'>>time = %d, step_size = %d, err

java - paint() can't draw gif but png works fine? -

i'm using jlabel in attempt draw animated gif image onto it. can use constructor new jlabel(new imageicon(fml.class.getresource("giphy.gif"))); , work fine when go override paint method doesn't seem want draw it, @ all. image isn't still, it's not there! should mention both methods shown below work fine png not gif. missing or java bug? (using java 1.8) edit: i've been looking around , seems i'm not off point on need doing i'm missing something. i've seen many posts like one doesn't seem working in case. i should note there's literally nothing else going on in class, it's simple jpanel. import java.awt.eventqueue; import java.awt.flowlayout; import java.awt.graphics; import java.awt.gridbaglayout; import java.awt.image; import java.awt.event.mouseadapter; import java.awt.event.mouseevent; import javax.swing.icon; import javax.swing.imageicon; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.

wordpress - Status of the Woocommerce order change from processing to complete after the order is placed with COD? -

i have online store customers place order , done payment cod. integrated our warehouse management export orders @ end of day system site. status of orders places processing. trying make php cron job order status of these order set completed when list of orders exported. i have looked @ various solutions , change order status @ time of placing order while want later, once data exported. if can me php function sets order in woocommerce "complete" @ trigger, grateful. in cron function may have loop order id needs exported, pass order id given function it'll update order status wc-complete , can pass order note if need. function wh_mark_order_as_omplete($order_id, $note = '') { //this check option if not need can remove it. //for cod order if ('cod' != get_post_meta($order_id, '_payment_method', true)) return; $order = wc_get_order($order_id); if (empty($note)): $order->update_status('comp

node.js - Javascript date parse error? -

this question has answer here: javascript creating date wrong month 2 answers let date = new date("2017-09-12t12:00:00"); console.log(date.getutcmonth()); here expecting log 09 month it's logging 08 . year, day , hour , minute gets parsed correctly though. what's going on here? how can extract 09 above date string? the getutcmonth() zero-based value — 0 january. for more info: https://developer.mozilla.org/en-us/docs/web/javascript/reference/global_objects/date/getutcmonth

ios - IQKeyboardManagerSwift pod install : How to implement Done button action in swift -

i'm using following library (which helps manage multiple textfields) pod 'iqkeyboardmanagerswift', '~> 4.0' my question how got implement done button action in our viewcontroller ? refer link . in iquiview+iqkeyboardtoolbar.swift file method available. public func adddoneonkeyboardwithtarget(_ target : anyobject?, action : selector) { adddoneonkeyboardwithtarget(target, action: action, titletext: nil) } but don't understand how implement in swift code. please me.. you can call on textfield object. example [textfield1 adddoneonkeyboardwithtarget:@selector(doneaction:)]; /*! doneaction. */ -(void)doneaction:(uibarbuttonitem*)barbutton { //doneaction } swift version: textfield1.adddoneonkeyboardwithtarget(self, action: #selector(self.doneaction(_:)), shouldshowplaceholder: true) func doneaction(_ sender : uitextfield!) { self.view.endediting(true) }

kubernetes - Nginx not reflecting the proxy server -

trying nginx on kubernetes access services running @ different ports. intially when services deployed , nginx deployed @ last see working fine. if of services updated/restarted , nginx unable access particular service. server { location / { proxy_pass http://backends.example.com:8080; } } and able access service if restart nginx through nginx -s reload anyway make nginx detect/poll reflect services restarts (service discovery dns) service never "restarts", , it's clusterip never changes (well, unless delete , recreate service), don't need watch changes in backing endpoints @ in way kube-proxy you.

ios - Disable UITextview selection text and copy/paste Menu -

Image
this question has answer here: how disable copy paste option uitextfield programmatically 14 answers i want disable copy/paste menu , i'm using html tag in uitextview in multiple hyperlinks , want disable menu. my texview image just try create subclass of uitextview overrides canperformaction:withsender: method - (bool)canperformaction:(sel)action withsender:(id)sender { if (action == @selector(paste:)) return no; return [super canperformaction:action withsender:sender]; }

Jupyter markdown not working -

i trying display bold words, equations , italic notes on jupyter notebook. however, can write comments '#' symbol , other attempts create indentation, bold words , equations not working. i need able display math notations such as: $^1/_2$ ${3 \over 4}$ could missing library import or similar ? i'm using jupyter version 5.0 , anaconda python 3.5 you need convert cell markdown-type cell. can in command mode selecting cell , pressing m (if cell in edit mode green border, press esc first), or choosing "markdown" type dropdown in center of menu bar.

extract json data in livecode -

i apologies, new in livecode , have no coding experience. trying extract wunderground hourly json data in livecode, can't json data: "response": { "version":"0.1", "termsofservice":"http://www.wunderground.com/weather/api/d/terms.html", "features": { "hourly": 1 } } , "hourly_forecast": [ { "fcttime": { "hour": "12","hour_padded": "12","min": "00","min_unpadded": "0","sec": "0","year": "2017","mon": "9","mon_padded": "09","mon_abbrev": "sep","mday": "12","mday_padded": "12","yday": "254","isdst": "0","epoch": "1505196000","pretty": "12:00 pm +06 on september 12,

Error when configuring TeamCity's Artifactory plugin -

i have installed teamcity artifactory plugin on teamcity 10 when configure artifactory providing server url , doing test connection gives below error: error occurred while requesting version information: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target (javax.net.ssl.sslhandshakeexception) it seems teamcity instance unable reach artifactory instance. can ping call teamcity artifactory? better run artifactory rest api call system ping , using defined url of artifactory in teamcity. the rest should that: curl -u user:password "https://{artifactoryurl}:{port}/artifactory/api/system/ping" after running teamcity instance see if able reach artifactory instance. also, have proxy server between teamcity artifactory? error seems there proxy server in middle, if please follow instructions on how configure teamcity artifactory plu

scala - cannot assign instance of java.lang.invoke.SerializedLambda -

i have tried 2 ways make jar file. first way make jar idea throws exception "java.lang.noclassdeffounderror: not initialize class org.elasticsearch.common.network.networkservice" so tried second way mvn-shade-plugin , throws exception "java.lang.classcastexception: cannot assign instance of java.lang.invoke.serializedlambda field org.apache.spark.api.java.javapairrdd$$anonfun$toscalafunction$1.fun$1 of type org.apache.spark.api.java.function.function in instance of org.apache.spark.api.java.javapairrdd$$anonfun$toscalafunction$1". i have check spark cluster use same java version 1.8.0_144 idea , use setjars,but throws exception.anyone can me suggestion? sparksession.builder() // .config(new sparkconf().setjars(list[string]("target\\spark-searcher-1.0-snapshot.jar"))) .config(new sparkconf().setjars(list[string]("out\\artifacts\\spark_searcher_jar\\spark-searcher.jar"))) .appname(appname) .master(master) .con

(ASK) Keras Sliding Window Python Image Classification -

i've problem.. how connect keras , sliding window? i've trained model called 'model1' want use in sliding window detect objects. any suggestion? thanks img = cv2.imread('frame.jpg', cv2.imread_grayscale) window_sizes = [150,150] json_file = open('motordewa.json', 'r') loaded_model_from_json = json_file.read() json_file.close() loaded_model = model_from_json(loaded_model_from_json) loaded_model.load_weights("motordewa.h5") def find_obj(img, predict_function, step=150, window_sizes=window_sizes): boxonezero = 0 win_size in window_sizes: top in range(0,img.shape[0] - win_size + 1, step): left in range(0, img.shape[1] - win_size + 1, step): box = (top, left, top + win_size, left + win_size) cropped_img = img[box[0]:box[2], box[1]:box[3]] cropped_img = np.array(cropped_img).reshape((1,1,150,150)) print('predicting %r' % (box, )) bo

unity3d - Alpha channel not working correctly on vertex shader -

Image
i seem tobe having issues order drawning or that. im using vertex colors. if set alpha of bottom vertices 1 again still draw issue on top of pillars. if set queue opaque renders correctly, alpha renders white (which expected no transparencies in opaque queue) shader "custom/vertexcolors2" { properties { _color ("color", color) = (0,0,0,0) _maintex ("albedo (rgb)", 2d) = "white" {} _gridtex ("grid texture", 2d) = "white" {} _glossiness ("smoothness", range(0,1)) = 0.5 _metallic ("metallic", range(0,1)) = 0.0 } subshader { tags {"queue"="transparent" "ignoreprojector"="true" "rendertype"="transparent"} cgprogram #pragma surface surf standard alpha #pragma target 3.5 sampler2d _maintex; sampler2d _gridtex; struct input {

python - Writing functional expression using numpy -

Image
i trying write function using numpy, can take derivative. i trying this, not able working x = symbol('x') y = (np.e ** (x ** 2)) * np.sin(x - np.pi) y.diff(x) i following error on this 'add' object has no attribute 'sin' you should use functions sympy , not numpy : import sympy x = sympy.symbol('x') y = (sympy.exp(x ** 2)) * sympy.sin(x - sympy.pi) sympy.pprint(sympy.diff(y)) yields ⎛ 2⎞ ⎛ 2⎞ ⎝x ⎠ ⎝x ⎠ - 2⋅x⋅ℯ ⋅sin(x) - ℯ ⋅cos(x)

postgresql - to write a SQL query which select rows where column value changed from previous row -

create table status( id serial not null, site_id integer, sigplan smallint, server_time timestamp without time zone constraint status_data_pkey primary key (id)) (oids=false); alter table traffview.status_data owner postgres; index: traffview.status_data_idx create index status_data_idx on traffview.status_data using btree (server_time, site_id); i have table this id siteid sigplan server_time 1 8300 1 2011-01-01 2 8300 1 2011-01-02 3 8300 2 2011-01-03 4 9600 1 2011-01-04 5 9600 2 2011-01-05 how select rows sigplan changed previous row siteid? in example above, query should return rows 2011-01-03 (sigplan changed 1 2 between 2011-01-01 , 2011-01-03 8300), 2011-01-05(sigplan changed 1 2 between 2011-01-04 , 2011-01-05 9600). the table contains lot of data query should optimized. select siteid, sigplan, max(server_time) traffview

javascript - How to add edit and delete button in only one column using php? -

i have code got on site , works on pagination , search. want add icon or button column link edit , delete function specific data selected in datatable. <?php /* database connection start */ $servername = "localhost"; $username = "root"; $password = ""; $dbname = "sample"; $conn = mysqli_connect($servername, $username, $password, $dbname) or die("connection failed: " . mysqli_connect_error()); /* database connection end */ // storing request (ie, get/post) global array variable $requestdata= $_request; $columns = array( // datatable column index => database column name 0 =>'id', 1 => 'facility', 2=> 'price', 3=> 'action' ); // getting total number records without search $sql = "select id, facility, price "; $sql.=" facilities"; $query=mysqli_query($conn, $sql); $totaldata = mysqli_num_rows($query); $totalfilt

python - Multiple issues with axes while implementing a Seq2Seq with attention in CNTK -

i'm trying implement seq2seq model attention in cntk, similar cntk tutorial 204 . however, several small differences lead various issues , error messages, don't understand. there many questions here, interconnected , stem single thing don't understand. note (in case it's important). input data comes minibatchsourcefromdata , created numpy arrays fit in ram, don't store in ctf. ins = c.sequence.input_variable(input_dim, name="in", sequence_axis=inaxis) y = c.sequence.input_variable(label_dim, name="y", sequence_axis=outaxis) thus, shapes [#, *](input_dim) , [#, *](label_dim) . question 1: when run cntk 204 tutorial , dump graph .dot file using cntk.logging.plot , see input shapes [#](-2,) . how possible? where did sequence axis ( * ) disappear? how can dimension negative? question 2: in same tutorial, have attention_axis = -3 . don't understand this. in model there 2 dynamic axis , 1 static, "third last" axis