Posts

Showing posts from January, 2015

powershell - "Error displaying advert - Access is denied" while using CVS in command prompt -

i inexperienced cvs , indeed coding in general. please bear in mind! i trying access logs cvs repositories on sourceforge. in order inputting command powershell looks this: cvs -d:pserver:anonymous@<programname>.cvs.sourceforge.net:/cvsroot/<programname> login i able log in anonymous user , access repository, every time enter command pop-up saying "error displaying advert - access denied". after clicking "okay" on message, command runs normally. this error occurs when accessing cvs repositories. does have idea means, , how prevent happening? the command prompt using windows powershell on windows 10 os. cvs client tortoise cvs.

ssl certificate - Indy POP3 with invalid cert -

i have pop3 client uses indy, connects need abort connection when certificate invalid. have ideas? procedure tpop3client.connectpop3; var status : boolean; i, msgtotal : integer; begin if edssl begin pop3.iohandler := ssl; pop3.usetls := utuseexplicittls; end; status := false; try pop3.username := edusername; pop3.password := edpassword; pop3.connect(edtargethost,edtargetport); if pop3.connected begin msgtotal := pop3.checkmessages; if msgtotal >=1 := 1 msgtotal begin if getmessage(i) begin getheaders; delmessage(i) end; end end; pop3.disconnect end; end; in tidssliohandlersocketopenssl component, enable sslvrfpeer flag in ssloptions.verifymode property, , optionally assign handler onverifypeer event if want validate particular details of server's certificate beyond openssl's default validations. if validation fails, ssl/tls handshake terminated error alert, connection c

spring mvc - org.hibernate.validator.constraints not picking reloaded messages -

i trying use spring's reloadableresourcebundlemessagesource localvalidatorfactorybean when update error message should reflect without requiring server restarted. using spring 4.1.4, hibernate-validator 4.3.2.final. below code details - context.xml - <mvc:annotation-driven validator="validator" /> <bean id="messagesource" class="org.springframework.context.support.reloadableresourcebundlemessagesource"> <property name="basenames"> <list> <value>file:../conf/fileapplication</value> <!-- messages here override below properties file--> <value>/web-inf/application</value> </list> </property> <property name="cacheseconds" value="10"></property> <!-- check refresh every 10 seconds --> </bean> <bean name="validator" class="org.springframework.validati

Eloquent query not working Laravel 5.4 -

i have following query , not working expected. $students = studentstatus::with(['user.studentprogramme' => function ($query) { $query->where('department_course_id', request('studycourse')); }], 'level', 'user.studentprogramme.course') ->where('level_id', request('level')) ->where('status', 0) ->get(); the inner where , $query->where('department_course_id', request('studycourse')) ignored , don't know why. is there missing out? this may scope issue try: $studycourse = ; $students = studentstatus::with(['user' => function($query) { $query->with(['studentprogramme' => function ($query) { $query->where('department_course_id', reque

laravel - Unable to extract bxslider in webpack.mix.js -

here webpack.mix.js : mix.js('resources/assets/js/app.js', 'public/js') .extract(['vue', 'jquery', 'nprogress', 'bxslider']); mix.sass('resources/assets/sass/app.scss', 'public/css') .options({ processcssurls: false }); error: undefinederror: can't resolve 'bxslider' in /path/to/folder/ i have installed bxslider using npm install --save bxslider and can see package.json "dependencies": { "bxslider": "^4.2.11", "nprogress": "^0.2.0" }

r - How to sort tweets returned by batch status ID in order as submitted by twitteR -

i have list of on 16k tweet id's of obtain text. using twitter , 2 functions from reply reproducing here: library(twitter) library(roauth) library(httr) lookupstatus <- function (ids, ...){ lapply(ids, twitter:::check_id) batches <- split(ids, ceiling(seq_along(ids)/100)) results <- lapply(batches, function(batch) { params <- parseids(batch) statuses <- twitter:::twinterfaceobj$doapicall(paste("statuses", "lookup", sep = "/"), params = params, ...) twitter:::import_statuses(statuses) }) return(unlist(results)) # not return tweets in order submitted } parseids <- function(ids){ id_list <- list() if (length(ids) > 0) { id_list$id <- paste(ids, collapse = ",") } return(id_list) } api_key <- consumer_key api_secret <- consumer_secret access_token <- oauth_token access_token_secret <- oauth_token_secret setup_twitter_oauth(api_key, api_secret, access_token, acce

rx java - How do I re-start my observer if onError is called for my subscription? -

i using: publishsubject<pubnubobserverdata> = publishsubject.create() i wondering how can restart subscription when onerror(throwable e) is called by? currently subscription stops when there error. you can use retry() operator automatically re-subscribe immediately. alternatively, can use retrywhen() operator resubscribe after delay or conditionally. observable .retrywhen( error -> error.flatmap( e -> observable.timer(1, seconds)) will retry subscription after 1 second. using flatmap() test kind of error , retry on particular error. observable .retrywhen( error -> error.flatmap( e -> { if (e instanceof ioexception) {return observable.timer(1, seconds);} return observable.just( e ); } ) will retry if error ioexception , not other type of error.

Javascript works but jQuery doesn't and I have loaded the libraries -

for reason jquery functions not being called. if window.alert out of jquery function, works. don't know doing wrong. <!doctype html> <html> <head> <title>bubble sort</title> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css" type="text/css" media="all" /> <script type="text/javascript" src="script.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script> </head> <body> <h1>bubble sort</h1> <h2>author: hugo l. villalobos</h2> <div></div> </body> </html> $(document).ready(function() { window.alert("

c# - How to prevent the encrypted (AES) data from being tampered with? -

i want encrypt data (aes) after saving database , decrypt when reading. how can prevent data being tampered in database? algorithm improved https://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged(v=vs.110).aspx . i have tested, in encrypted ciphertext casually add "a", decryption throw exception(the padding invalid , not removed), add charactor,will throw exception?there no such possibility: not throw exception, can decrypt, result not original data string original = "getabedkk"; string password = "123456kfjseyr+*j"; string ciphertext = encrypt(original, password); messagebox.show("after encrypt:"+ciphertext); string plaintext = decrypt("a"+ciphertext, password); messagebox.show("after decrypt:" + plaintext); add checksum or validation field. add layer encryption decrypts data, checks validation , throws exception if validation field not correct.

asp.net mvc - Converting an @Html.Textbox button to submit button -

i trying convert @html.textbox image button submit button onclick calling javascript function can't seem figure out validation part. believe need submit button. i trying rid of image keep functionality. here's what's working today. @html.textbox("next", null, new {type = "image", src = @url.content("../app_themes/icons/button_next.png"), @class = "imgbottom", onclick = "javascript: validateselection ($(\"[name$='selecteditems']:checked\"))"}) function validateselection(item) { if (item == null || item.length == 0) { var validationsummary = $('.validation-summary-errors ul'); if (validationsummary.length > 0 && $('.validation-summary-errors ul li').length == 0) { validationsummary.append('<li>' + "please select @ least 1 item" + '</li>'); } var errors = $("[name='errormessage']"); i

javascript - Is there any way to fire 'touchmove' and 'click' at the same time? -

var paper = raphael(10,10,600,500); var background = paper.rect(200,10,300,200); background.attr("fill", "#ffffcc"); var background1 = paper.rect(10,220,300,200); background1.attr("fill", "#ffffcc"); background1.touchstart(function () { console.log('b1 start'); }); background1.touchmove(function () { }); background1.touchend(function () { console.log('b1 touch end') }); background1.click(function () { console.log('b1 clicked'); }); background.touchstart(function () { console.log('b touch start'); }); background.touchmove(function () { }); background.touchend(function () { console.log('b touch end'); }); background.click(function () { console.log('b click'); }); i'm working on designing drawing tool touch screen.i'm using multi touch events there.so 2 people can draw @ same time.but when 1 using 'touchmove' event other 1 can't use 'click&#

node.js - Mailgun - Corrupted pdf attachment -

i sending file using mailgun-js module in nodejs. original file fine, 1 receive corrupted. i using code below send file. array infos.attachements contains path , name of files want send. var file = fs.readfilesync(infos.attachments[0].path), attch = new mailgun.attachment({data: file, filename:infos.attachments[0].name , contenttype: 'application/pdf'}), mailoptions = { from: 'sender address' to: 'receiver address', attachment:[attch], subject: 'some subject', // subject line text: 'text content' }; mailgun.messages().send(mailoptions, function(error, body){... any idea doing wrong?

docusignapi - Docusign Stamp/Print file name to uploaded document -

is there anyway can stamp or print file name documents uploaded envelope through rest api? went trough envelopedocuments parameters no luck. what i'd is, when uploading documents existing envelope, i'd docusign print or stamp file name onto document docusign did envelope id on document. eg. print "agreement.pdf" somewhere on document signee can tell separation of documents. the listenvelopedocuments api should provide name of document supplied during creation of envelope. here sample response { "envelopeid": "13116d4e-xxxx-xxxx-xxxx-48cd64fece76", "envelopedocuments": [ { "documentid": "1", "name": "agreement.pdf", "type": "content", "order": "1", "pages": "1" }, { "documentid": "certificate", "name": "summary"

Wordpress PHP variable to Vue Component -

i building wordpress theme , incorporate vue.js (2.0) it. need able pass variables wordpress vue, such page or post content. attempting return page content. i attempted method didn't seem work either: pass php variable vue component instance in page template have following: <content inline-template :content="{{ $content }}"> <div id="content" class=""> </div> </content> the component: vue.component('content', { props: ['content'] }); new vue({ el: "#app" });

How to deploy a middleman blog inside a rails app? -

i have rails app. want make blog middleman , in subdirectory. example www.myapp.com/blog . how can that? middleman's output static html/js/css website. place output of middleman project in public/blog directory within rails app.

Check if bean is managed by spring or JSF -

does possible check programatically if bean managed spring or jsf? i have class: public class contexthelper { // method print managed beans spring container public static void printmanagedbeans(applicationcontext ctx) { string[] beannames = ctx.getbeandefinitionnames(); (string beanname : beannames) { colorconsolehelper.getgreenlog("bean managed spring " + beanname); } } } after used class have result: info: [ok] bean managed spring org.springframework.context.annotation.internalconfigurationannotationprocessor info: [ok] bean managed spring org.springframework.context.annotation.internalautowiredannotationprocessor info: [ok] bean managed spring org.springframework.context.annotation.internalrequiredannotationprocessor info: [ok] bean managed spring org.springframework.context.annotation.internalcommonannotationprocessor info: [ok] bean managed spring org.springframework.context.annotation.internalpersistenceannotation

Apiman Gateway Prometheus Metrics -

i use apiman 1.3.0.final on wildfly 10 + keycloak , + want configure prometheus metrics. have found solution here, how can configure 'metrics' 'prometheus': http://lists.jboss.org/pipermail/apiman-user/2015-september/000254.html looks not complete answer. cause, have created own apiman-gateway.war , apiman-gateway-api.war , have added library in these wars apiman-gateway-engine-prometheus-1.3.+.final.jar . also, have changed configuration in apiman.properties file following: ``` apiman-gateway.metrics=io.apiman.gateway.engine.prometheus.prometheusscrapemetrics apiman-gateway.metrics.port=8083 ``` so, result of start apiman, can see there no errors imetrics, cannot understand how can retrieve metrics? http://localhost:8083/metrics or http://localhost:8083/prometheus or http://localhost:8083/ ? also in article have found, following configuration vert.x config: ``` "metrics": { "class": "io.apiman.gateway.engine.prometh

php - error in model laravel 5.3 -

i'm doing update blog data data has been updated except flag print data of request but data of flag is'nt updated here code public function update(request $request, $id) { $data=$request->all(); //dd($request->flag); $data = $request->except(['_token']); $blog=blog::findorfail($id); $blog->update($data); // $blog->update($request->flag); dd($data); if(request()->hasfile('url_image')) { $file=$request['url_image']; $name =md5(uniqid(rand(), true)). $file->getclientoriginalname(); $request->file('url_image')->move('dezique/images/blog/', $name); $blog->url_image=('dezique/images/blog/'.$name); $blog->update(); } else { $blog->url_image=('dezique/images/blog/cafe.jpeg');

Swift - JSON array values -

i getting following json values in output: [["category_title": shelly], ["category_title": thaddeus], ["category_title": chantale], ["category_title": adara], ["category_title": mariko], ["category_title": felicia]] but want below: ["shelly","thaddeus","chantale", "adara","mariko","felicia"] i have following swift code. please me above output. func successgettermsdata(response: any){ var userrole : string = "" var arrayofdetails = response as? [[string: any]] ?? [] userrole = arrayofdetails as? string ?? "" print(arrayofdetails) } you have map array of dictionary arrayofdetails array of string . flatmap ignores missing key. if let arrayofdetails = response as? [[string: string]] { let userrole = arrayofdetails.flatmap { $0["category_title"] } print(userrole) }

ios - How to resume core animation when the app back to foreground -

Image
i have imageview , want rotate 360° time, found issue when app enters background , foreground , rotate animation stopped. , don't want re-call function rotate360degree() when app foreground, reason want rotate-animation start @ position left when entering background, instead of rotating 0 again. when call function resumerotate() , doesn't work. the extension follow: extension uiimageview { // 360度旋转图片 func rotate360degree() { let rotationanimation = cabasicanimation(keypath: "transform.rotation.z") // 让其在z轴旋转 rotationanimation.tovalue = nsnumber(value: .pi * 2.0) // 旋转角度 rotationanimation.duration = 20 // 旋转周期 rotationanimation.iscumulative = true // 旋转累加角度 rotationanimation.repeatcount = maxfloat // 旋转次数 rotationanimation.autoreverses = false layer.add(rotationanimation, forkey: "rotationanimation") } // 暂停旋转 func pauserotate() { layer.pauseanimation() }

java - Hibernate Composite Key Join -

i'm trying use spring data perform joined queries 1 of tables has composite key , i'm not sure how map entities. here analogy of data model: table: device pk=model_id pk=serial_id ... table: device_settings pk=device_settings_id fk=model_id fk=serial_id ... here analogy of code, doesn't compile due "mappedby" attribute isn't present. @entity @table(name = "device_settings") public class devicesettings { @id @generatedvalue(strategy = generationtype.auto) @column(name = "device_settings_id") private long id; // pretty sure problem @onetomany(targetentity = device.class, mappedby = "devicekey", cascade = {cascadetype.merge}, fetch = fetchtype.eager) @joincolumns({ @joincolumn(name = "model_id", referencedcolumnname = "model_id"), @joincolumn(name = "serial_id", referencedcolumnname = "serial_id")}) private list<device> device

javascript - ES6 export extended class and then import it -

i have basic class (mobile.js) class mobile { constructor() { ... } method(msg){ ... } } module.exports = mobile; then import (mobileextended.js); import mobile './mobile'; class mobilephone extends mobile { method(){ super.method('hello world!'); } } module.exports = mobilephone; and in end want import mobilephone.js: import mobilephone './mobileextended.js'; mobilephone.method(); how can make work in es6 style? because i'm getting cannot read property 'open' of undefined error. if want name things in palce import them, such as import mobile './mobile' you should use default export, such as export default mobile from place mobile defined. compare having named export export class mobile { ... } and importing specific name in separate module. import {mobile} mobile however, pointed out loganfsmyth in comments, not source of error. use n

contextmenu - How to add those tiny underlines for keyboard shortcuts when making right click menus from registry? -

Image
this picture of mean, there no underline in entry created, can't access keyboard shortcut directly: here's picture of how made it: this key did job windows registry editor version 5.00 [hkey_classes_root\systemfileassociations\.ico\shell\setthisicon] @="set icon current &folder" [hkey_classes_root\systemfileassociations\.ico\shell\setthisicon\command] @="cmd /c del folder.ico /f /a s & copy /y \"%1\" folder.ico & \"seti[enter image description here][1]con.bat\"" just ignore "command" key ampersand before letter want shortcut: @="set icon current &folder" i.e. &f the solution the result

css - <p>-tag does not stay in div on smaller screen -

i have centered div css: .questions { display: block; position: relative; margin: 30px auto 0px; height: 500px; width: 650px; background: #fff; border: 1px dashed #cbd0d8; padding: 0px 5px; } and .questions-div wrapped in regular bootstrap container, style-tag of width: 100% . inside .questions div have few paragraphs text css of: .partner > p { padding: 0px 5px 0px; } and yes... on screen looks good, when open laptop (a smaller window size) <p> tags break , start new lines halfway each <p> , creating double amount of rows of text. these <p> tags aren't centered @ all, nor stay in div go through , outside .questions div @ bottom. how make text stay same size , width no matter how big screen is? div follows well, text doesn't! stupid of me not include html markup: <div class="container question-container"> <div class="my-logo"> <h3>title</h3> </div>

php - checking if an string array raw is last one -

do know how check if string raw last 1 tried using end(...) i'm stuck how check if string array raw last 1 on array example $array = array('raw1' => 'value1', 'raw2' => 'value2', 'raw3' => 'value3'); for($array $key => $value) { if(strcmp(end($array), $key) == false) { // code excuted when check returns true } } iamn't sure if example correct please me checking if array raw last 1 ?? please you can use end() $array = array('raw1' => 'value1', 'raw2' => 'value2', 'raw3' => 'value3'); $lastelement = end($array); foreach($array $k => $v) { if($v == $lastelement) { // code executed last element of array } }

Mongodb/GridFS - Am using reactjs for file upload/download having issue -

am trying upload files , getting error "unable process parts no multi-part configuration has been provided". using reactjs , servlet connect mongodb. please find code below. upload(data) { ajax({ url: 'api/uploaddocservlet', method: 'post', data: data }, (data) => { console.log("print data::::"+data); if (data.error == null) { this.search({}); } else { alert(data.error); } }); } api servlet code : try { system.out.println("uploaddocservlet:::"+request.getpart("data")); (part part : request.getparts()) { string filename = extractfilename(part); object result = service.uploaddoc(filename); response.put("result", result != null ? result : jsonobject.null); } } catch (exception e) { logger.log(level.warning, null, e); response.put("error", e.getmessage()); } resp.setcontenttype("application/json"); resp.setcharacterencoding("utf-8"); resp.adddateheader("expires", 0); prin

javascript - Extract from JS to url -

but interested in how can send result js get <form method="get" action="order2.php"> <input type="checkbox" name="obj" price="5" value="1" >5 <input type="checkbox" name="obj" price="15" value="2">15 <input type="checkbox" name="obj" price="20" value="3">20 <input type="submit" value="send"> <div id="test"></div> <script type="text/javascript"> $(":input").change(function() { var values = $('input:checked').map(function () { return $(this).attr('price');; }).get(); var total = 0; $.each(values,function() { total += parsefloat(this); }); $("#test").text(total); }); </script> </form> when select inputs 1 , 2 result in url order2.php?price=20 $(":input").change(function() { var value

Bootstrap modal in ASP.NET MVC opening the modal only for the first id -

i have created simple crud operation testing bootstrap modal. trying open other views in bootstrap modal. first row details opening edit operation. mean edit form opening first id. modal not working anymore. here index page- @model ienumerable<amstest.models.tbl_category> .... <a id="btncreate" data-toggle="modal" href="#mymodal" class="btn btn-primary">create</a> <table class="table table-hover"> <tr> <th>@html.displaynamefor(model => model.category_name)</th> <th>@html.displaynamefor(model => model.category_image)</th> <th></th> </tr> @foreach (var item in model) { <tr> <td>@html.displayfor(modelitem => item.category_name)</td> <td>@html.displayfor(modelitem => item.category_image)</td> <td> <a id="btnedit" data-id="@i

Grafana throws 'Templating init failed' error after upgrade when using graphite backend -

i'm trying upgrade grafana setup version v4.0.2 (commit: v4.0.2) version v4.4.3 (commit: 54c79c5) on centos 7. both old , new versions of grafana installed official rpm packages. when i'm trying open dashboard have i'm getting following error message: templating init failed maximum call stack size exceeded also in browser console log see following messages: rangeerror: maximum call stack size exceeded @ regexp.exec (<anonymous>) @ regexp.[symbol.replace] (<anonymous>) @ string.replace (<anonymous>) @ object.replace (http://<my_grafana_host>/public/app/boot.07485e0c.js:10:23129) @ object.get (http://<my_grafana_host>/public/app/boot.07485e0c.js:45:5205) @ object.get (http://<my_grafana_host>/public/app/boot.07485e0c.js:45:5235) @ object.get (http://<my_grafana_host>/public/app/boot.07485e0c.js:45:5235) @ object.get (http://<my_grafana_host>/public/app/boot.07485e0c.js:45:5235) @ object.get (http://<my_grafana_h

python - Can't move on to the next page -

i've written script in python selenium traverse different pages staring first page through pagination. however, there no options next page button except numbers. when click on number takes me next page. anyways, when try script, click on second page , goes there doesn't slide anymore, meant instead of going on third page breaks throwing following error. line 192, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.staleelementreferenceexception: message: stale element reference: element not attached page document script i'm trying with: from selenium import webdriver selenium.webdriver.common.by import selenium.webdriver.support.ui import webdriverwait selenium.webdriver.support import expected_conditions ec driver = webdriver.chrome() driver.get("http://www.cptu.gov.bd/awardnotices.aspx") wait = webdriverwait(driver, 10) driver.find_element_by_id("imgbtnsearch").click() item in wait.until(ec.pre

php - Datatables server-side error when I click to access 5th page -

i'm using datatables 1.10.15. it's working when click on button 5th page received error message: datatables warning: table id=tabela1 - invalid json response. more information error, please see http://datatables.net/tn/1 html: <table id="tabela1"> <thead> <tr> <th>cpf/cnpj</th> <th>nome</th> <th>telefone</th> <th>celular</th> <th>e-mail</th> <th><a rel="nofollow" href="inscliente.php"><span title="inserir"></span></a></th> <th>&nbsp;</th> </tr> </thead> <tfoot> <tr> <th>cpf/cnpj</th> <th>cliente</th> <th>telefone</th> <th>celular</th> <th>e-mail</th> <th>&nbsp;</th> <th>&nbsp;</th> </tr> </tfoot> </table> js: $(document).ready(function() { $('#tabela1').da

C++ Create Object Array without default constructor -

i error when dynamically creating array of (transaction) object. error output says:"no matching function call 'transaction::transaction()' part of assignment , not allowed use default constructor. gather array automatically assigns values each of indexed address when it's created , no default constructor made transaction, cannot without values. please me see fix error. class transaction { private: int id; float amount; string fromaddress, toaddress, signature; bool confirmed, removefrompool; static int numtransactions; public: transaction(string in_fa, string in_ta,string in_sign,float in_amount); transaction(transaction &obj); int getid() const; } //--------------------- class block { private: int id, txcount; const int max_tx=5; transaction** txlist; string blockhash, prevblockhash, minername; bool confirmed; public: block(int id,string prevh,string name); } //------------------ // block.cpp block::block(int i, string prevh

design patterns - Observer or Pub/Sub for dashboard (Springboot) -

we have manufacturing plant , there single sql table regularly updated every resource's running job , status. want have clients subscribe changes (by dept) in web app. (we building new microservice architecture , other functions). dept supervisors want see "real-time" status of department's resources , jobs. total of 20-30 users which pattern best: pub/sub or observable publisher / subscriber each time status change publish message , subcriber update information ,you can filter out message based on department , decide whether update infor or not. observable notify linked members only. suggested way go pub/sub any new addition or deletion of services easy.

orchestration - How to put your Cloud on Auto-Pilot mode? -

here 3 ways in can place cloud on auto-pilot: - self-service portal build environments self-service portal dispense applications great way allow developers pick resources need, gain approval , started. cuts through bureaucratic processes otherwise cause project delays. managing cloud resources through such portals gives incisive insights on number of vms in use , being used for. helps reduce avoidable costs underutilized resources terminated. event-driven automation alerts , triggered healing event-driven automation works on principles of observe, orient, decide, act. cloud can automated send alerts in occurrence of events, such low disk drive in vm. system has observed , oriented problem. solution carried out decide , act parts workflow rules preset such events triggered , actions carried out tackle event , heal system. self-healing predictive modeling self-healing solving short-term issues arise in cloud. long-term perspective, necessary automate cloud observe user cloud

python - Refresh Div elements withoud reload Page using Ajax and DJango -

i read many posts in site refresh elements without reload page, can't fix problem. have view called 'operation' , need refresh these page each 5 seconds. then, created other view called 'refresh' update data. but returns error 404 when open page. how can fix problem? 'post /operation/refresh http/1.1 404 2317' views.py def main(request): dp_col = datadisplay.objects.all() #print(dp_col[0].name) reg = registers.objects.latest('pk') context = { 'dp_col': dp_col, 'reg':reg } return render(request,'operation.html',context) def refresh(request): if request.is_ajax(): reg = registers.objects.latest('pk') print(reg) #return render(request,'operation.html',{'reg':reg}) return httpresponse({'reg':reg}) operation.js function refresh_function(){ $.ajax({ type: 'post', url: 'refresh

bokeh - how to add legend in the .circle call with the use of ColumnDataSource -

i trying add legend in .circle glyph using bokeh. following code total_ss defined columndatasource, admin, mean, n_size existing variables in total_ss. code ran fine without error msg , displayed graph correctly without legend. anyone has ideas can overcome , add legend plot? thanks much! f.circle(x='admin',y='mean', size = 'n_size', fill_alpha = .2, line_dash=[5,3], legend = "total score", source=total_ss)

I am unable to set my wordpress menu for mobile version -

i have 2 menus, 1 mobile view, , other desktop view. changing wordpress dynamic menu. mobile menu not working properly, not showing toggle button , proper styles of menu. have following codes in html: <!-- header --> <header> <div id="search-bar"> <div class="container"> <div class="row"> <form action="#" name="search" class="col-xs-12"> <input type="text" name="search" placeholder="type , hit enter"><i id="search-close" class="fa fa-close"></i> </form> </div> </div> </div> <nav class="navigation"> <div class="container"> <div class="row"> <div class="logo-wrap col-md-3 col-xs-6"> <a href="index.html">workhub</a> </div> <div class="menu-wrap col-md-8 ">

pandas - Python: Merging many dataframes in most efficient way possible -

right have many different statistics names attached in separate dataframes. in order merge have keep rewriting new dataframe? there more efficient way this? does pd.merge make easier if names of columns same when merging? do have recursively write pd.merge(left=something, right=somethingelse, left_on='name', right_on='site') you can first creating list of dataframes , rsult using reduce function # create data columns = ['v1','v2','v3'] df1 = pd.dataframe(np.random.randint(10, size=(3,3)),columns=columns) df2 = pd.dataframe(np.random.randint(10, size=(3,3)),columns=columns) df3 = pd.dataframe(np.random.randint(10, size=(3,3)),columns=columns) dfs = [df1,df2,df3] # store in 1 list df_merge = reduce(lambda left,right: pd.merge(left,right,on=['v1'], how='outer'), dfs)

jquery - Keep datatable search results displayed -

i keep previous datatable searches displayed after new search performed. using code below datatable filtered display current search. $('#filterbox').keyup(function() { if (this.value.length > 7) { equipmenttable.search(this.value).draw(); $('#equipment').show(); } }); basically want stack datatable searches, there way this? i thought creating new datatable hold searched items, populating each time search performed. var searchedrow = equipmenttable.search(this.value).row( { filter : 'applied' } ).data(); not sure if best way go however.

osx - Syncing Calendar w/ Apple Calendar -

Image
this sort of specific question, know if it's possible fix i'm seeing here on apple calendar: it nice if make each event automatically expand given time allotted (in parentheses). i realize super niche question, know there super knowledgable people on here thought i'd give shot.

mysql - Efficiency of query using NOT IN()? -

i have query runs on server: delete pairing id not in (select f.id info f) it takes 2 different tables, pairing , info , says delete entries pairing whenever id of pairing not in info . i've run issue on server beginning take long execute, , believe has efficiency (or lack of constraints in select statement). however, took @ mysql slow_log , number of compared entries lower should be. understanding, should o(mn) time m number of entries in pairing , n number of entries in info . number of entries in pairing 26,868 , in info 34,976. this should add 939,735,168 comparisons. slow_log saying there 543,916,401: half amount. i wondering if please explain me how efficiency of specific query works. realize fact it's performing quicker think should blessing in case, still need understand optimization comes can further improve upon it. i haven't used slow query log (at all) isn't possible difference can chalked simple... can't think of wo

html - AngularJS / Javascript Links & Buttons Unresponsive on IOS -

Image
been stuck on nasty bug way long. hoping out there has experienced already. issue prevalent on ios 12+ (iphones sure, iphone 5 & 7 - haven't tested ipad) - chrome or safari. androids work fine, desktop browsers work fine. our app using angular core angular material & ui router. how reproduce issue: 1) click item seen in picture 2) arriving @ item detail page, click on results or browser button : 3) following end result (a page none of links or buttons work, including ui-sref, regular links, ng-clicks): note double checked if elements in way - there not. also, manually triggering click via js in console allows work intended. super strange... also note refreshing page once breaks allows function again. refreshing once in details , pressing allows function normally. there no console warnings or errors. ideas?

shell - Why have nvm related commands —nvm, node, npm— stopped working? -

os: macos sierra 10.12.6 (16g29) terminal app: hyper 1.3.3.1754 nvm: 0.33.2 i installed nvm , according instruction, sometime ago without issue. recently, , commands it's responsible — node , npm — stopped working. nvm/npm/node command not found i realized occurred because switched system default shell bash zsh — chsh -s /bin/zsh — without addressing contents of ~/.bash_profile sourced bash not zsh . the nvm install script curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash places following in appropriate config file —one of: ~/.bash_profile , ~/.zshrc , ~/.profile , or ~/.bashrc . export nvm_dir="$home/.nvm" [ -s "$nvm_dir/nvm.sh" ] && \. "$nvm_dir/nvm.sh" # loads nvm [ -s "$nvm_dir/bash_completion" ] && \. "$nvm_dir/bash_completion" # loads nvm bash_completion at time of install used bash , bit placed in ~/.bash_profile . coping content on ~/.zshrc go

python 3.x - How to compare columns in a pandas dataframe -

Image
i have pandas dataframe looks "word" column header columns: word word word word 0 nap nap nap cat 1 cat cat cat flower 2 peace kick kick go 3 phone fin fin nap how can return words appear in 4 columns? expected output: word 0 nap 1 cat use apply(set) turn each column set of words use set.intersection find words in each column's set turn list , series pd.series(list(set.intersection(*df.apply(set)))) 0 cat 1 nap dtype: object we can accomplish same task python functional magic performance benefit. pd.series(list( set.intersection(*map(set, map(lambda c: df[c].values.tolist(), df))) )) 0 cat 1 nap dtype: object timing code below pir1 = lambda d: pd.series(list(set.intersection(*d.apply(set)))) pir2 = lambda d: pd.series(list(set.intersection(*map(set, map(lambda c: d[c].values.tolist(), d))))) # took liberties @anton vbr's solution. vbr = lambda

smtpclient - C# receive error sending a email -

error: service not available, closing transmission channel. server response was: resources temporarily unavailable - please try again later private void button1_click(object sender, eventargs e) { string smtpaddress = "smtp.mail.yahoo.com"; int portnumber = 587; bool enablessl = true; string emailfrom = "mail@yahoo.com"; string password = "mailpass"; string emailto = "sendemail@yahoo.com"; string subject = "hello"; string body = "hello, i'm writing hi!"; using (mailmessage mail = new mailmessage()) { mail.from = new mailaddress(emailfrom); mail.to.add(emailto); mail.subject = subject; mail.body = body; //mail.isbodyhtml = true; // can set false, if sending pure text. // mail.attachments.add(new attachment("c:\\somefile.txt")); //mail.attachments.add(new attachment("c:\\somezip.zip"));

apache - URL Rewriting with Wordpress -

i have wordpress running on apache, have url 1 : https://www.mywebsite.com/fr/?type=manger and want : https://www.mywebsite.com/fr/manger/ i tried different things such : rewriterule ^?type=manger$ manger/ but it's not working, 1 example i'm getting 500 error , , nothing. don't know if it's htaccess config , or because it's wordpress, or because i'm stupid ! :/ thanks ! use rule in .htaccess instead: rewriterule ^fr/([^/]*)$ /fr/?type=$1 [l] make sure clear cache before testing this.

node.js - Chrome's node inspector tool blocking TCP access with the CLI? -

if run node application via normal way (just running node --inspect foo.js ), able connect running application using chrome dev tools fine. if, on other hand, node --inspect, , in resultant repl require('foo.js'); server start doesn't have access appropriate tcp ports. in particular in former case can curl http://localhost:3000/ , stuff, in latter econnrefused. this annoyance, since can write script , run instead of getting inspector started in repl, i'd know is: known setting should toggle somewhere? it's annoying if want fiddle initialization parameters - easier type them in rebuild project each time run script right.

php - Using PHPWORD on shared hosting server without a local linux server -

a project needs create word doc files database content (wordpress), embedded pictures. research has indicated phpword library best use. the problem don't have command line access shared hosting server, cannot install "composer" install needed parts of phpword. , not have local linux install work with. have local php/mysql development system can use (easyphp) if needed. use windows 10 laptop code development. what recommendations tools can use develop php application uses phpword. php application run on private area of shared hosting system, since wordpress site is. i 'clone' wp site local system, if needed. the ultimate objective create word document wp blog, including pictures stored in doc, not referenced externally. word doc manipulated ebook/printed book. thanks.

angular - Can't get basic Observables to work -

i've been learning angular, , far i've got basic foundations down. want dive deeper rxjs , observables every time try follow tutorials online, there these trivials errors, feel stupid can't solve them, , stuck on first step of these tutorials. example, i'm following rangle.io's tutorial on observables, .next(42) .next(43) , , .push(value) returns error saying argument of type '42' not assignable paramter of type 'number[]' . in tutorials , rxjs official github, use import rx 'rxjs/rx' or import * rx 'rxjs'rx , doesn't work in project. can't figure out why have use import { observable } 'rxjs/observable' instead of importing everything. anyway, missing causing error in operator? import { component } '@angular/core'; import { observable } 'rxjs/observable'; import 'rxjs/observable/from'; @component({ selector: 'app-root', templateurl: './app.component.html', s

Typescript types on rest params from argument -

is possible tell typescript types of rest params based on signature of function passed? function myfunc(a: string, b: number) { /* ... */ } function callfn(passedfn: (args...: any[]), ...args: any[]) { passedfn(...args) } callfn(myfunc, 1, 2) // should warning following code shows compile error, because lose type control under args. interface icallback { (a: string, b: number): void } class test { public callfn(passedfn: icallback, ...args: any[]): void { passedfn(args); // error passedfn("1", 2); } } class callback { public myfunction = (a: string, b: number) => { alert("it's working"); } } let testintance = new test(); let callbackintance = new callback(); testintance.callfn(callbackintance.myfunction, 1, 2); you have handle exceptions , try parse typed variables. class test { public callfn(passedfn: icallback, ...args: any[]): void { //passe

how to recover couchDB documents -

i see has been discussed (here: retrieve deleted document ) having trouble understanding. given have database named "test" running on ip address 127.0.0.1:5984, , document id "xyz123": get revisions of deleted document following request: $db/$id?revs=true&open_revs=all where $db couchdb database name , $id deleted document id. does mean: get http://127.0.0.1:5984/test/"xyz123"?revs=true&open_revs=all ?? i not sure of correct syntax submitting " $id ". the id becomes part of url, no quoting necessary. example call get http://127.0.0.1:5984/test/xyz123?revs=true&open_revs=all . for reference, documents api area has basic id examples.

c# - Saving a DateTime value to Local Settings [UWP] -

in uwp app i'm trying save datetime value local settings code: localsettings.values["date"] = mydate; the problem when try retrieve value cast error. i'm using code retrieve value: datetime daterecovered = (datetime)localsettings.values["date"]; you can refer official documentation here the supported type date system.datetimeoffset , not system.datetime . so, can modify code this: applicationdata.current.localsettings.values["date"] = datetimeoffset.utcnow;

javascript - Closing a type of dropdown when one of the same type is clicked -

i'm new jquery , javascript, , need something... $(document).ready(function () { $('.dropdown-submenu .active-dropdown').on("click", function (e) { $(this).next('ul').toggle(); e.stoppropagation(); e.preventdefault(); }); }); body { padding-bottom: 40px; color: #5a5a5a; } .navbar-wrapper { position: fixed; top: 0; right: 0; left: 0; z-index: 20; } .navbar-wrapper > .container { padding-right: 0; padding-left: 0; } .navbar-wrapper .navbar { padding-right: 15px; padding-left: 15px; } .navbar-wrapper .navbar .container { width: auto; } .carousel { height: 500px; margin-bottom: 60px; } .carousel-caption { z-index: 10; } .carousel .item { height: 500px; background-color: #777; } .carousel-inner > .item > img { position: absolute; top: 0; left: 0; min-width: 100%; height: 500px; } .marketing .col-lg-4 { margin-