Posts

Showing posts from July, 2013

OpsWorks Ruby returning nil for valid regex test -

Image
in opsworks, i'm trying test number suffix on hostname of given node, , extract number if isn't 1. if number isn't 1, have regex match number: /([\d]+)$­/ which run against node naming scheme follows pattern: node1 node2 node3 node(n...) i've verified works using rubular: http://rubular.com/r/ei0kqjaxqn however, when run against instance opsworks, match returns nil, no matter number hostname has @ end. opsworks agent version latest @ time of writing (4023), using chef 12.13.37. this code in cookbook trying use matched number: short_app_name.to_s + node['hostname'][/([\d]+)$­/, 1].to_s + '.' + app['domains'].first the run fails type error no implicit conversion of nil string . however, regex searches against property work earlier in recipe, when checking node's number suffix. there different method should using extract node's suffix? edit: app['domains'].first populated. line still fails same type erro

angularjs - Chrome Driver suspend Angular, Javascript, or Websocket to prevent DOM destruction -

in app testing, there websocket events cause dom destroyed , recreated several times per second. wondering if can use chrome driver temporarily stop these updates happening. options stop websocket events, stop javascript or stop angular doing constant refreshing nonsense. need re-start whatever able stop. suggestions?

Why is MySQL matching strings and integers in a way I don't expect? -

i have mysql database following column: +-----+ | vpn | +-----+ | 11a | when use query: select vpn vpn_map vpn=11; it returns: +-----+ | vpn | +-----+ | 11a | but if query: select vpn vpn_map vpn=lla; i get: error 1054 (42s22): unknown column '11a' in 'where clause' why doesn't previous query match? match if do: select vpn vpn_map vpn='lla'; but vpn='11' won't match anything. missing here? 11a not integer , have use " around them otherwise error. select vpn vpn_map vpn="lla";

javascript - Are these methods to send JSON using Ajax equivalent? -

i continue see 2 different approach send json data through http request using jquery ajax can't understand correct , have drawbacks. are equivalent? 1 of these correct less drawbacks? first approach (implicit serialization) $.ajax({ url: 'test.php', type : "post", datatype : 'json', data : javascriptobject, success : function(result) { ... }, error: function() { ... } }) data sent server. converted query string, if not string...object must key/value pairs in case seems me if have javascript object like var = { name: 'a', age: 10 } i don't need serialize before send because jquery me giving output string check=check2&radio=radio1 . possibly can json_encode query string on server-side have json data again. second approach (serialize(); json.stringify(); serializearray()) 1.serialize() $.ajax({

vba - How to break a loop when it is done? -

i've created scraper in vba in combination selenium parse different firm names webpage. page has traversed 56 more pages can reached using forward button. scraper able scrape data available in 57 pages of loop. however, issue i'm facing here script not able break out of loop when done collecting data. because used "do while true" condition in loop. should in condition script able break loop , quit browser when done? in advance. here i've written far: sub jscriptinjected_data() dim driver new chromedriver dim posts object, post object driver .get "http://registers.centralbank.ie/fundsearchresultspage.aspx?searchentity=fundserviceprovider&searchtype=name&searchtext=&registers=6%2c29%2c44%2c45&aspxautodetectcookiesupport=1" while true set posts = .findelementsbyclass("entitynamecolumn") each post in posts x = x + 1: cells(x, 1) = post.findelementbytag(

Output 3D points change everytime in triangulatePoints using in Python 2.7 with OpenCV 3.3 -

i want know 3d points stereo cameras using triangulatepoints in python 2.7 , opencv 3.3. that, calibrated stereo cameras , stored matrices in folder. rectified images using cv2.stereorectify , using cv2.initundistortrectifymap undistort images. saved images projection matrices p1 , p2 , find corresponding point in both images. point in left image ptl = np.array([304,277]) , corresponding point in right image ptr = np.array([255,277]) . after tried points = cv2.triangulatepoints(p1,p2,ptl,ptr) . code is: import cv2 import numpy np import matplotlib.pyplot plt cameramatrixl = np.load('mtx_left.npy') distcoeffsl = np.load('dist_left.npy') cameramatrixr = np.load('mtx_right.npy') distcoeffsr = np.load('dist_right.npy') r = np.load('r.npy') t = np.load('t.npy') # following matrices saved got stereorectify r1 = np.load('r1.npy') r2 = np.l

c# - Visual Studio 2017 and MySQL EntityFramework -

Image
when adding new ado.net entity data model > ef designer database > new connection > change connection not see mysql option; i have installed nuget package mysql.data.entity (as required mysql.data , google.protobuf). also when add package mysql.data.entity, existing ms sql entities returns error message; system.typeloadexception: 'inheritance security rules violated type: 'mysql.data.mysqlclient.mysqlproviderservices'. derived types must either match security accessibility of base type or less accessible.' yet in app.config still pointing ms sql; <add name="mydbentities" connectionstring="metadata=res://*/myentity.csdl|res://*/myentity.ssdl|res://*/myentity.msl;provider=system.data.sqlclient;provider connection string=&quot;data source=mssqlserver;initial catalog=mydb;persist security info=true;user id=sa;password=mypassword;multipleactiveresultsets=true;app=entityframework&quot;" providername="s

reactjs - Making multiple react saga requests -

working saga load page have to: dispatch event parameter save parameter reducer , set loading true in saga select parameter , request it's simple 1 request , without multiple parameters. but if have table delete/update action , table has ~20 rows, possible handle nicely using saga? only solution can think of, store each row array , request's according array, save 'loading' state same array. thank in advance thoughts on this.

.htaccess - Apache Mod-Rewrite to remove port number -

i clean uri application is: http://app.example.com:8081/app/welcome ideally, become: http://app.example.com/welcome i have enable rewrite module in conf file. in site root created .htaccess file following: rewriteengine on rewritecond %{http_host} ^(app.example.com):8081$ [nc] rewriterule ^(.*)$ http://%1/$1 [l,r=301] nothing happens when dereference uri. ideas on how can work?

aframe - Does Z point up or does Y point up? -

the documentation on rotation tag says z vertical (yaw rotation around vertical) https://aframe.io/docs/0.6.0/components/rotation.html example https://codepen.io/bryik/pen/gzloqv <!-- y-roll or "yaw" --> <a-plane id="yaw" material="color: #4cc3d9; side: double" position="0 2 0" rotation="0 45 0" width="2" height="2"></a-plane> shows y points up, not z. there bug in documentation? the docs bugged, depends on orientation. (z yaw) <script src="https://aframe.io/releases/0.6.1/aframe.min.js"></script> <a-scene> <a-text value="pitch (x)" color="#333" position="-0.5 5.5 -5"></a-text> <a-plane position="0 4 -5" rotation="0 0 0" width="2" height="2" color="blue"><a-animation attribute="rotation" dur="800"

hadoop - python dependencies install according machine host? -

there way in python, install dependencies according libs in host machine? "issue" have package shall work in machine , without lib e.q: hadoop. but, pydoop falling when not installed in host. possible make wheel intelligent enough not installs pydoop in machines not have hadoop installed? it possible, don't recommend that. instead, make 'extra' option in distribution using setuptools : extras_require: dictionary mapping names of “extras” (optional features of project) strings or lists of strings specifying other distributions must installed support features. see section below on declaring dependencies details , examples of format of argument. so setup.py have this: setup( name="pyagus", ... extras_require={ 'hadoop': ["pydoop"], } ) leave user decide whether install optional hadoop support or not. note "user" in case might orchestration repo, e.g. salt / ansible / pupp

javascript - How to seperate objects with commas when writing them to a json file using nodejs? -

i sending right click coordinates client side server side , there writing them down in json file, having coordinates of different points stored different objects. how json file looks: {"x":344,"y":158}{"x":367,"y":152}{"x":641,"y":129} now problem have put comma between first 2 objects in order make valid json. how can that? here request handler function: .post(function(request, response){ console.log("request received"); var util = require('util'); var coordinates = request.body; var imagecoordinates = json.stringify(coordinates, null, 2); fs.appendfile('coords.json', imagecoordinates, finished); function finished(err){ console.log('all set.'); response.send("all ok"); } console.log('coords are:', coordinates); }); ok, 1 idea. if alter appendfile add newline.. after each append, not make easier

python - zipkin tracing openstack and osprofiler example -

everyone i trying use zipkin trace services in openstack. know huge project me. wonder if there open source library zipkin tracing openstack. i think searched before , if mind not cheat me, there 1 presentation (only slices) this. however, can not find it. can it? i know there library, osprofiler, tracing openstack, while example of api seems unclear me. please give me more detailed or complete example, maybe zipkin https://github.com/openzipkin/pyramid_zipkin-example i not mean not helpful. seems still have find restful request point in openstack, example creating instance may trigger 1 service request neutron networking, , may have locate front end code , add tracing code. if using py_zipkin, can add decorator @zipkin_span(some params) before it. problem is tough me find front end of these services nova, neutron, cinder , on. it seems osprofiler same thing. understanding highly wrong, , appreciate can it. by way, not intend trace big project openstack. intend trace r

c# - ASP.Net MVC Api Controller - Custom Route -

i know clone of post asp.net web api 2 route-attribute not working , having issue this. i can use standard api routes if configure this: // works fine config.routes.maphttproute( name: "defaultapi", routetemplate: "api/{controller}/{id}", defaults: new { id = routeparameter.optional } ); // absolutley nothing but config.maphttpattributeroutes(); seems doing absolutely nothing. no matter have tried far helps. has had issue? i have tried listed routes using [route()] attribute. nothing works. it turned out using wrong namespace. must use : system.web.http.routeattribute used : system.web.mvc.routeattribute answer posted on thread referenced above - ed frenchkevin777

javascript - TypeError: xxx is not a constructor -

var fishbowl = require('node-fishbowl'); var fb = new fishbowl.fishbowl({ host: 'x.x.x.x', iadescription: 'reporting dashboard', iaid: 2286, ianame: 'node-dashboard', password: 'x', port: '28192', username: 'x', bunyanlevel: 'debug' }); the above code returns "typeerror: fishbowl.fishbowl not constructor". i've tried can think of around have been unsuccessful. running node.js v8.2.1 any appreciated. that error in documentation, export fishbowl default . try this: var fishbowl = require('node-fishbowl'); var fb = new fishbowl({ host: 'x.x.x.x', iadescription: 'reporting dashboard', iaid: 2286, ianame: 'node-dashboard', password: 'x', port: '28192', username: 'x', bunyanlevel: 'debug' }); look @ source changed in cc3a400 .

swift - Best way to "eat" something in SpriteKit -

by "eat" mean: when sprite (mario) collides sprite b (a coin) collision detected , coin removed scene; however, mario's movement not altered collision coin. at moment i'm using skphysicscontactdelegate register when mario , coin collide, seems require acknowledging coin physical body - therefore means mario's movement stopped it. should coin not have physics body, , instead should use different method see if contact? according apple ... var categorybitmask: uint32 mask defines categories physics body belongs to. var collisionbitmask: uint32 mask defines categories of physics bodies can collide physics body. var contacttestbitmask: uint32 mask defines categories of bodies cause intersection notifications physics body. so if set contacttestbitmask on "mario" coin categorybitmask, , set collisionbitmask on "mario" 0 (or not coin categorybitmask) should able tell when 2 collide in didbegin(_ contact: skph

d3.js - How can I group data to be filtered without losing crossfilter functionality using dc.js? -

Image
i'm trying learn d3 via dc.js , i'm quite stuck trying figure out how group line chart w15sec, w30sec,...,w1hr, names , values. when filter applied, i'd show max value workouts within filter parameters. here jsfiddle . i've got flat cycling data looks this: var data = [{"timestamp":"2017-09-06t12:32:04.183","duration":3459.518,"distance":10261,"activityid":175508086,"avgpower":305.5419317525,"w15sec":499.2666666667,"w30sec":479.3333333333,"w1min":470.2666666667,"w2min":441.9416666667,"w5min":417.5166666667,"w10min":410.5616666667,"w20min":342.3141666667,"w40min":306.2033333333,"w1hr":0.0},{"timestamp":"2017-09-08t12:07:27.033","duration":2106.755,"distance":3152,"activityid":175647595,"avgpower":168.8485158649,"w15sec":375.8666666667,"w30sec

Error running a Python script on the web via PHP -

i'm facing not understandable error when i'm launching python script on ftp server via php, following: traceback (most recent call last): file "./data.py", line 9, in import urllib.request file "/home/www/urllib/request.py", line 88, in import http.client file "/home/www/http/client.py", line 1063 chunk = f'{len(chunk):x}\r\n'.encode('ascii') + chunk \ ^ syntaxerror: invalid syntax syntaxerror: invalid syntax would have idea? have no clue this. i've checked out "http.client.py" can't find issue part of code. many thanks

angular - SPA, Web API Bearer Token security issues -

bearer: means person or thing carries or holds something. it means login once, say, angular app, , can used anywhere postman or fiddle or other website using same token. in angular 4, can store token either in cookie/localstorage/sessionstorage can accessed , used. so how protect our token , web api use token created. if token in cookie, try putting httponly on cookie. try setting samesite=strict or similar property on cookie. way available website. note: samesite supported in latest webkit or blink based browsers.

wso2-am Simple pass through endpoint -

how create simple pass-thru endpoint in wso2 apim 2.1 allow requests access files given directory on backend host. e.g.: files on backend server @ https://192.168.10.10/javascripts/api/ when create wso2 api requires api context , version. i can create api definition with: context: /javascripts version: api production url: https://192.168.10.10/ verb: resource=path: /javascripts/api/ x-auth-type: none but when curl https://mywso2host/javascripts/api/debug.js 404 - no matching resource found given api request a curl https://192.168.10.10/javascripts/api/debug.js (from mywso2host) works fine.

javascript - How can I reference the ID of a separate html file using JQuery? -

<div id="container"> <nav> <ul class="clearfix" id="cfix"> <li class="icon" id="icon"> <a href="javascript:void(0);" onclick="mymenu()">&#9776; menu</a> </li> <div id="drop"> <li><a href="index.html#about">about me</a></li> <li><a href="index.html#resume">resume</a></li> <li><a href="index.html#music">music</a></li> <li><a href="index.html#contact">contact</a></li> <li><a href="blog.html">blog</a></li> </div> </ul> </nav> </div> <script> $(function() { $(

c++ - ld: symbol(s) not found for architecture x86_64 Row::AddColumn -

building target: lab1 invoking: macos x c++ linker g++ -o "lab1" ./src/eclipser.o ./src/eclipser_test.o ./src/row.o ./src/rows.o undefined symbols architecture x86_64: "row::addcolumn(int, std::__1::basic_string, std::__1::allocator >)", referenced from: _main in eclipser.o row.h #fndef row_h_ #define row_h_ #include <iostream> using namespace std; class row { public: row(); row(std::string id); string id; string columns[24] void addcolumn(int index, std::string value); }; #endif row.cpp #include "row.h" #include <iostream> #include <string> using namespace std; string columns[24]; row::row(){ // todo } row::row(string id) { this->id = id; cout << "id: " << this->id; } row::~row() { //deconstructor } void addcolumn(int index, std::string value) { columns[index] = value; } i figured out issue. in row.cpp class need change following

c++ - Global function definition -

i'm missing basic. i want function foo() visible in subroutine in different file. a\b\c\d\one.cpp #if xyz void foo() { ... a\two.cpp void foo(); #if abc uint8_t top(uint8_ val) { foo(); i not defined errors foo() when two.cpp linked. a\three.cpp #if jkl foo(); foo() works fine in three.cpp there no namespaces. where going wrong? i'm missing basic. for combination of .o files link together, definition of foo() can exists once. (odr) can declared many times needed. however, choose have single .hh file 'declaration' line: perhaps "foo.hh" contain extern void foo(); // declares foo function any .cc file use 'foo' #include .hh file. and 1 .cc file must implement function body, , should include .hh file. perhaps "foo.cc" might contain #include "foo.hh" void foo() { // implement } finally, link .o's (from compiling .cc files) main.o.

angular - How do I use the content of the angular2/4 translate dialog? -

this.confirmationservice.confirm({ message: '您确定要删除该记录吗?', header: '确认提示', icon: 'fa fa-info', accept: () => { this.userservice.getroledelect(this.delectselecteduseridjson).then(users => { ..... }, reject: () => { this.loading = false; return false; } }); translatetext(text: string) { this.translate.get(text).subscribe((res: string) => { console.log(res); });} how translate message , header translate? message: ${this.translatetext('message')} error: undefined

rotation - Calculating the new position of a parented controller after rotating the parent in Maya using Python -

Image
i'm creating code create motion path of controller based on it's keyframed positions in maya. i've run problem when trying use code create motion path of parented controller. if rotate , translate parent generated motion path not reflect actual path of motion. instead creates motion path if not affected parent. i've looked around , found information applying rotation using matrix transformations current position seems rotating way much. i've included function creating motion path, it's little long part isn't working within else statement when dealing upper torso controller. updated code based on progress # # function creates animation curve within scene follows path of motion # of selected controller. requires keyframe information in order genereate curve # , uses range of frames given user. # def createanimcurve( bodyfield, startfield, endfield, firstcolor ): # takes value of text field select controller obj = cmds.textfield(bodyfield, query

c# - How to set style checkbox/radiobutton when checkbox/radiobutton is focused? -

i want set border checkbox/radiobutton when focused. here code! thanks uielement element = container; dependencyobject obj2 = focusmanager.getisfocusscope(element) ? element : focusmanager.getfocusscope(element); iinputelement focusedelement = focusmanager.getfocusedelement(obj2); object obj = focusedelement; if (obj != null && (obj.gettype() == typeof(checkbox) || obj.gettype() == typeof(radiobutton))) { //set style when focus checkbox, radiobutton. } here code if (obj != null && (obj.gettype() == typeof(checkbox) || obj.gettype() == typeof(radiobutton))) { var element = obj frameworkelement; // element.style = resources["resourcename"] style; // or // element.style = (style) findresource("yourresourcekey"); } i commented out line these ways set style if defined in resources.

java - Gradle Build path -

Image
i'm trying remove build path folder (src/main/resources) can see en number 1 , 2, , result correct in number 3, when try (refresh gradle project) show again in number 1. i don know if there problems .classpath or reloading last comfiguration. i'm using gradle, java 1.7, , sts, etc... please help. :-) assuming have java plugin applied in build.gradle try set resources folders empty list: sourcesets.main.resources.srcdirs = [] and refresh project in sts. and highly recommend use buildship plugin eclipse. offers best gradle integration in eclipse. gradle support in sts not maintained anymore think.

javascript - Using jquery to slide automatically depending on different ids -

i have 2 dots different ids. each id associated images. if click dot, images changed. now, want add slide within 5 minutes change dot dot using auto click function of jquery. tried creating many times couldn't it. please me kindly. $(document).ready(function(){ $('#dot1,#dot2').click(function(){ var id = this.id; console.log("id is->",id); if(id=="#dot1"){ $("#dot1").hasclass('current'); settimeout(function() { $('#dot2').trigger('click'); }, 4e3); } if(id=="#dot2"){ $("#dot2").hasclass('current'); settimeout(function() { $('#dot1').trigger('click'); }, 4e3); } }); });

jquery - Set the value of an input field? -

i have this: <body> <header></header> <h1>request group rate</h1> <form> <input type="hidden" id="referrer"> //... </form> <script> $(document).ready(function(){ $('input[id="referrer"]').val(document.referrer); }); </script> how set value attribute of <input> id="referrer" ? $(document).ready(function() { $("input[id=referrer]").attr('value', document.referrer); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <body> <h1>request group rate</h1> <form> <input type="text" id="referrer" value="" style="width:100%"> </form> </body>

Proxy setting for powershell connecting to outlook.office365 -

i'm working on powershell script connect outlook office365(exchange online) follows: $session = new-pssession -configurationname microsoft.exchange -connectionuri "https://outlook.office365.com/powershell-liveid/" -credential $credential -authentication basic -allowredirection now problem want connect via proxy server authentication, did following $proxy = new-object system.net.webproxy "http://myproxy:80" $proxy.credentials = $cred [system.net.webrequest]::defaultwebproxy = $proxy $session = new-pssession -configurationname microsoft.exchange -connectionuri "https://outlook.office365.com/powershell-liveid/" -credential $credential -authentication basic -allowredirection but doesn't connect via proxy set. did following: $proxy = new-object system.net.webproxy "http://myproxy:80" $proxy.credentials = $cred [system.net.webrequest]::defaultwebproxy = $proxy $sessionoption = new-pssessionoption -proxyaccesstype ieconfig $sessio

python - Scraping box ccores with BeautifulSoup and using pandas to export to Excel -

i've been trying figure out how scrape baseball box scores fangraphs python 3.6 , beautifulsoup , pandas modules. final goal save different sections of webpage different sheets in excel. in order this, think have pull each table separately respective id tags. code 4 tables (below graph on page) make first excel sheet. running code results in error: traceback (most recent call last): file "fangraphs box score scraper.py", line 14, in <module> df1 = pd.read_html(soup,attrs={'id': ['winsbox1_dghb','winsbox1_dghp','winsbox1_dgab','winsbox1_dgap']}) file "c:\python36\lib\site-packages\pandas\io\html.py", line 906, in read_html keep_default_na=keep_default_na) file "c:\python36\lib\site-packages\pandas\io\html.py", line 743, in _parse raise_with_traceback(retained) file "c:\python36\lib\site-packages\pandas\compat\__init__.py", line 344, in raise_with_traceback raise exc.with_traceback(trac

r - How to convert decimal time to time format -

this question has answer here: outputting difftime hh:mm:ss:mm in r 1 answer i calculate difference between 2 time-sets. can this, difference in decimals , know how convert them format in "minutes:second". so, have minutes , seconds characters: video_begin <- c("8:14", "4:47", "8:27", "4:59", "4:57", "7:51", "6:11", "5:30") video_end <- c("39:08", "47:10", "49:51", "44:31", "39:41", "47:12", "40:13", "46:52") i convert them time values as.posixct, make df , add difference third column, easy peasy... video_begin <- as.posixct(video_begin, format = "%m:%s") video_end <- as.posixct(video_end, format = "%m:%s") video <- data.frame(video_begin, video_end) video$v

apache - httpd is not getting started Redhat 7 Linux -

i working in redhat linux version 7. have installed apache (httpd) , set dispatcher on it. but, getting below error- [root@123 httpd]# service httpd start redirecting /bin/systemctl start httpd.service job httpd.service failed because control process exited error code. see "systemctl status httpd.service" , "journalctl -xe" details. [root@123 httpd]# systemctl status httpd.service ● httpd.service - apache http server loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled) active: failed (result: exit-code) since tue 2017-09-12 00:16:55 edt; 1min 17s ago docs: man:httpd(8) man:apachectl(8) process: 2578 execstop=/bin/kill -winch ${mainpid} (code=exited, status=1/failure) process: 2576 execstart=/usr/sbin/httpd $options -dforeground (code=exited, status=1/failure) main pid: 2576 (code=exited, status=1/failure) sep 12 00:16:55 123 httpd[2576]: [tue sep 12 00:16:55.642899 2017] [so:warn] [pid 2576] ah0

ios - In table view cell data was not loading in screen during it's launch? -

in having 3 sections in table view in first section have addresses , radio buttons if click on radio button active , particular address posting depending on address selection third section needs call api , load data in second table view present in third section here problem during loading first time when app launched in simulator not loading third section cell data can 1 me how reduce error ? here code table view class func numberofsections(in tableview: uitableview) -> int { if ((addressselected == true || checkispaymentradioselect == true) && selected == false) { return 3 }else { return 2 } } func tableview(_ tableview: uitableview, titleforheaderinsection section: int) -> string? { if ((addressselected == true || checkispaymentradioselect == true) && selected == false) { if (section == 0) { return "shipping address" } el

android - How to implement custom spinner -

i want implement 1 custom spinner app items countries name come server. name comes ascending order want want india come @ first row of item. // country spinner stringrequest sr = new stringrequest(request.method.get, country_url, new response.listener<string>() { @override public void onresponse(string response) { arraylist<string> arr = new arraylist<string>(arrays.aslist(response.trim().split(","))); arr.add(0, "select country"); arrayadapter<string> adapter = new arrayadapter<string>(editdetails6.this, android.r.layout.simple_list_item_1, arr); spinpcountryname.setadapter(adapter); remove india list, add first position, write following logic this: arraylist<string> arr = new arraylist<string>(arrays.aslist(response.trim().split(","))); (int = 0; < arr.si

vb.net - Restriciton in combobox should not delete text in combox -

combobox should not accept inputs , backspace. code accepts backspace. private sub combobox5_keypress(byval sender object, byval e system.windows.forms.keypresseventargs) handles combobox5.keypress if asc(e.keychar) <> 13 , asc(e.keychar) <> 8 , not isnumeric(e.keychar) or isnumeric(e.keychar) e.handled = true end if end sub your description , code posted don't match well. going assume left words out, , want allow cr, bksp, , numeric. looks want numbers combobox. as vincent said, if statement confusing. "not isnumeric(e.keychar) or isnumeric(e.keychar)" evaluates true, it's or not a. for numbers in comboboxes, method, though there lots of ways skin cat: private sub combobox5_keypress(sender object, e keypresseventargs) handles combobox5.keypress select case ascw(e.keychar) case 13 'do whatever need cr here case 8, 3, 22, 24, 26 'backsp copy paste cut undo

css - LESS animation keyframes mixin combined with transform -

i have this: @-webkit-keyframes anim1{ 0%, 100% { -webkit-transform: rotatez(0) } 30% { -webkit-transform: rotatez(20deg) } } @-moz-keyframes anim1{ 0%, 100% { -moz-transform: rotatez(0) } 30% { -moz-transform: rotatez(20deg) } } @keyframes anim1{ 0%, 100% { transform: rotatez(0) } 30% { transform: rotatez(20deg) } } and use this: .icon { -webkit-animation: anim1 1s forwards; -moz-animation: anim1 1s forwards; animation: anim1 1s forwards; } is there way create mixin out of ? found examples not including transform (which has 3 states default, moz, webkit), using simple css opacity , easy that. you can try using cross browser animation mixin, like: @mixin keyframes($animation-name) { @-webkit-keyframes #{$animation-name} { @content; } @-moz-keyframes #{$animation-name} { @content; } @-ms-keyframes

Pipeline editor unable to open Jenkinsfile in Jenkins BlueOcean -

Image
i extremely new blueocean & getting below error when trying open pipeline editor: there error loading pipeline jenkinsfile in repository. correct error editing jenkinsfile using declarative syntax commit repository. cannot read property 'indexof' of undefined jenkinsfile : pipeline { agent stages { stage('build') { steps { echo 'building..' } } stage('test') { steps { echo 'testing..' } } stage('deploy') { steps { echo 'deploying....' } } } } error screenshot -

PHP display date as month name and date -

this question has answer here: convert 1 date format in php 12 answers i getting current date using function date("y-m-d") . want display date 2017-09-12 sep 12 you can present ("m j"). here test version.

Flutter: Copy image file from url to firebase -

i'm trying copy user profile picture external service onto firebase server. far have: final file file = await new file.fromuri(uri.parse(auth.currentuser.photourl)).create(); final storagereference ref = firebasestorage.instance.ref().child("profile_image_${auth.currentuser.uid}.jpg"); final storageuploadtask uploadtask = ref.put(file); final uri downloadurl = (await uploadtask.future).downloadurl; // add user profile picture url user object final userreference = firebasedatabase.instance .reference() .child('users/' + auth.currentuser.uid); userreference.set({'photourl': downloadurl}); the top line gives me error: unsupported operation: cannot extract file path https uri what correct way this? should done client-side? (should passing url firebase , use function download server-side?) file supports files on file system. load content using http use http package. see https://flutter.io/networking/ var httpclient = createhttpcl

php - Laravel log write permission denied -

i facing permission issue log writing in laravel app. have daily logs new log file gets created every day. project folder ownership set www-data . , logs generated www-data permission. logs created root user , if somewhere try write in log permission denied , application crashes. -rw-r--r-- 1 www-data www-data 77016 sep 12 05:00 laravel-2017-09-11.log -rw-r--r-- 1 root root 1240 sep 12 10:30 laravel-2017-09-12.log for example, yesterday's log created www-data today it's under root . getting crashes everytime. if delete log or change permission 777 solves while until pops again. cannot replicate issue , don't know why logs being created under root user. appriciated. thank you. you can run cron www-data user. ex: * * * * * www-data php /path/to/artisan schedule:run >> /dev/null 2>&1

javascript - AngularJS ng serve error failed to compile error in node modules/css-loader -

i didn't encounter before when developing angular project. used angular 2 project. here error below when run command ng serve in project dir. chunk {chartjs.module} chartjs.module.chunk.js, chartjs.module.chunk.js.map () 13.6 kb {main} [rendered] chunk {components.module} components.module.chunk.js, components.module.chunk.js.map () 268 kb {main} [rendered] chunk {dashboard.module} dashboard.module.chunk.js, dashboard.module.chunk.js.map () 64.5 kb {main} [rendered] chunk {icons.module} icons.module.chunk.js, icons.module.chunk.js.map () 184 kb {main} [rendered] chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kb [entry] [rendered] chunk {main} main.bundle.js, main.bundle.js.map (main) 82 kb {vendor} [initial] [rendered] chunk {pages.module} pages.module.chunk.js, pages.module.chunk.js.map () 18.5 kb {main} [rendered] chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 328 kb {inline} [initial] [rende

Error: Graph returned an error: Invalid appsecret_proof provided in the API argument (SDK PHP FACEBOOK) -

i tried follow example: https://github.com/facebook/php-graph-sdk when run in browser: http://192.168.33.10/fb_api/firstapp.php/ , error: graph returned error: invalid appsecret_proof provided in api argument . checked app_id , app_scret. source code: <!doctype html> <html> <head> <title>first app</title> <meta charset="utf-8"> </head> <body> <?php $access_token = 'eaacedeose0cbabaxt3vjdmuig8h5dq8dhju....'; $app_secret = '98680d3e6a251b52d87d...'; $appsecret_proof= hash_hmac('sha256', $access_token, $app_secret); require "phpsdk/src/facebook/autoload.php"; $fb = new facebook\facebook([ "app_id" => '11651982...', "app_secret" => '98680d3e6a251b52d87...', 'default_graph_version' => 'v2.10', ]); try { // \facebook\graphnodes\graphuser object current user. // if provided 'default_access_token',

How to get all my listet Items and item details as a Seller with the EBay API? -

i archive goal partly allready. using getsellerlist call, archive listet items details need (epid, title, ebaycategory1, ebaycategory2, shopcategory1, shopcategory2). the problem timerange , getsellerlist can set timerange of 3 month, therefore 2000 items 3000 listed. anyone knows if can amplify timerange ore maybe use call gives me data described above? you can use getsellerlist list of items selling . latest items need include starttimefrom , starttimeto elements in xml. exmaple -- <?xml version="1.0" encoding="utf-8"?> <getsellerlistrequest xmlns="urn:ebay:apis:eblbasecomponents"> <requestercredentials> <ebayauthtoken>abc...123</ebayauthtoken> </requestercredentials <errorlanguage>en_us</errorlanguage> <warninglevel>high</warninglevel> <granularitylevel>coarse</granularitylevel> <starttimefrom>2016-02-12t21:59:59.005z</starttimefrom> <sta

Configuring openCV with Qt in windows -

i have project uses opencv. trying set opencv library use in qt application. for qt installation installed visual studio , using compiler , cds debugger. after doing when going through documentation seeing mingw used configure opencv , qt ( https://wiki.qt.io/how_to_setup_qt_and_opencv_on_windows ) but in cases using vs, how can configure opencv qt if using visual studio compilers. first need install visual studio plugin - http://doc.qt.io/qtvstools/index.html you need make sure have built both opencv & qt whatever compiler using. vs2017 example, don't think default binaries come qt option. there installation guide here - https://wiki.qt.io/opencv_with_qt

excel - Sorting column with more than one decimal -

i trying sort column values in excel sheet. ex: 1.2 2.1 3.1 1.1.1 1.2.3 when click sort button should re-arrange. 1.2 1.1.1 1.2.3 2.1 3.1 i have written sort code code sort single decimal values because integer when add more 1 dot excel converts has string. can please suggest wrong. private sub sort_click() dim xlsorta xlsortorder dim lastrow long activesheet lastrow = .cells(.rows.count, "a").end(xlup).row if (cint(.range("a2").value) > cint(.range("a" & cstr(lastrow)))) xlsorta = xlascending end if .range("a2:d10" & lastrow).sort key1:=.range("a2:d10"), order1:=xlsort, header:=xlno, _ ordercustom:=1, matchcase:=false, orientation:=xltoptobottom, _ dataoption1:=xlsortnormal end activeworkbook.save end sub note: based on sort has re-arrange remaining columns working. after split data of '1.2.3' &qu

java - Ensure replication between data centres with Hazelcast -

i have application incorporating stretched hazelcast cluster deployed on 2 data centres simultaneously. 2 data centres both functional, but, @ times, 1 of them taken out of network sdn upgrades. what intend achieve configure cluster in such way each main partition dc have @ least 2 backups - 1 in other cluster , 1 in current one. for purpose, checking documentation pointed me toward direction of partition groups ( http://docs.hazelcast.org/docs/2.3/manual/html/ch12s03.html ). enterprise wan replication seemed thing wanted, but, unfortunately, feature not available free version of hazelcast. my configuration follows: networkconfig network = config.getnetworkconfig(); network.setport(hzclusterconfigs.getport()); joinconfig join = network.getjoin(); join.getmulticastconfig().setenabled(hzclusterconfigs.ismulticastenabled()); join.gettcpipconfig() .setmembers(hzclusterconfigs.getclustermembers()) .setenabled(hzclusterconfigs.istcp

java - Retrieve OWL class restrictions using OWL API -

i'm working on research regarding ontology population.i want extract restrictions each , every class in ontology such somevaluefrom, alvaluefrom, cardinality restrictions on data properties , object properties.i'm using owl api.now i'm using owlclassexpression class data property restrictions particular class.this code. private static jsonobject getclassaxioms(owlclass cls,owlontology ontology){ set<owlclassaxiom> tempax=ontology.getaxioms(cls); jsonobject datapropertyrestrictions = new jsonobject(); jsonarray data_has_value = new jsonarray(); jsonarray data_max_cardinality = new jsonarray(); jsonarray data_all_values_from = new jsonarray(); jsonarray data_exact_cardinality = new jsonarray(); jsonarray data_min_cardinality = new jsonarray(); jsonarray data_some_values_from = new jsonarray(); for(owlclassaxiom ax: tempax){ for(owlclassexpression nce:ax.getnestedclassexpressions()) { if(nce.getclassexpre