Posts

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...