Posts

Showing posts from May, 2013

c# - SimpleJSON Unity Exception: Error deserializing JSON. Unknown tag: 123 -

i'm getting error when accessing data json file. i'm trying follow following tutorial: http://wiki.unity3d.com/index.php/simplejson and created test.json file, want extract data containing: { "version": "1.0", "data": { "samplearray": [ "string value", 5, { "name": "sub object" } ] } } using following code in unity: void loadfiles() { fileinfo f = m_info[0]; //array of files in folder // had foreach loop here, wanted specify file testing before tried parse through 1 of own print("i found : " + f); var n = jsonnode.loadfromfile(f.fullname); var versionstring = n["version"].value; // versionstring string containing "1.0" var versionnumber = n["version"].asfloat; // versionnumber float containing 1.0 var name = n["data&quo

swift - SIGABRT when selecting rows in TableViewController -

i have problem: when select 2nd cell of tableview, sigabrt. when select first one, works fine. must have tableviewcontroller class, because "set rows in section" (from print statement) printed 3 times, when select 2nd cell, 3 * 4 = 12 times, when select first one... oh... , error: gonna set rows in section 2 set section 2 1 gonna set rows in section 0 set section 0 1 gonna set rows in section 1 set section 1 3 2016-07-04 12:43:14.407 sessions[1229:629535] *** terminating app due uncaught exception 'nsrangeexception', reason: '*** -[__nsarrayi objectatindex:]: index 2 beyond bounds [0 .. 1]' *** first throw call stack: (0x1822e6db0 0x18194bf80 0x1821c7098 0x187b7d5ac 0x187933f1c 0x18756d444 0x18752aff8 0x1878e4b88 0x187529fc4 0x187529d5c 0x187529b68 0x187794a20 0x18752fac8 0x18743fac8 0x187465350 0x18743ed40 0x182c18cc0 0x18743ebc4 0x18744c678 0x18763edbc 0x18743fac8 0x18743f7ac 0x18743ed40 0x182c18cc0 0x18743ebc4 0x18744c678 0x1876df8c0 0x1874535b4 0x1

java - Fraction to Recurring Decimal -

working on problem, , did few reference similar solutions. 1 thing confuse is, why break loop long there 1 repetitive number? possible number repeat 2-3 times , changed different number? thanks. i mean part specifically, if (map.containskey(num)) { int index = map.get(num); res.insert(index, "("); res.append(")"); break; } the problem, given 2 integers representing numerator , denominator of fraction, return fraction in string format. if fractional part repeating, enclose repeating part in parentheses. for example, given numerator = 1, denominator = 2, return "0.5". given numerator = 2, denominator = 1, return "2". given numerator = 2, denominator = 3, return "0.(6)". public class solution { public string fractiontodecimal(int numerator, int denominator) { if (numerator == 0) { return "0"; } stringbuilder

javascript - Spectrum not loading when adding my own settings -

i'm using spectrum color picker plugin . have 2 color pickers showing. want majority of settings same. setting differences color , localstoragekey , , move: function (color) . rest of settings should same. i have 1 class - "full" , , 2 id's - "first", "second" . settings want both of them in full , , others in id . the problem is, when add settings first , second , color picker plugin disappears. doing wrong, , how can fix it? jsfiddle $(".full").spectrum({ color: false, flat: false, showinput: true, allowempty: false, showinitial: false, showpalette: true, showpaletteonly: false, hideafterpaletteselect: false, showselectionpalette: true, localstoragekey: false, showalpha: true, palette: [ ["#000","#444","#666","#999","#ccc","#eee","#f3f3f3&q

sql - Join two query results where one is created from column values -

i have table tables table1: name|starttime|endtime|project_number frank| 12:00| 16:00|project1 frank| 08:00| 16:00|project2 andre| 09:00| 16:00|project4 andre| 11:00| 16:00|project5 i try accomplish table shows time worked , each project this: table2: name |all|project1|project2|project3|project4 andre|12 |4 |8 |null |null frank|12 |null |null |7 |5 i can result all select name, sum(datediff(minute, starttime, endtime)) table1 group name, sum(datediff(minute, starttime, endtime)) and can accomplish table2 (with group on project well) not result want. tried union maps tables. anyone can me done? do datediff calculation in derived table. (to keep code pretty!) then use case expressions conditional aggregation: select name, sum(ts), sum(case when project_number = 'project1' ts end) project1, sum(case when project_number = 'project2' ts end) project2, sum(case when proj

c# - Hangfire RecurringJob with dependency injection -

is possible have hangfire instantiate objects configure jobactivator when they're scheduled run recurringjob? the signature of method seems force static usages: public static void addorupdate<t>( string recurringjobid, expression<action<t>> methodcall, i have several ideas on how "abuse" statics channel things around, feel might missing something. there design decision hangfire supports statics in chron jobs? quick answer no, default job activator works on parameter-less constructors or static methods. did (in vb.net) quick , dirty see if working , have shown below. by using "addorupdate", telling hangfire create instance of t , access method of t, signature works on instance members, not statics. if use 1 of other "addorupdate" method signatures without generic parameter, require static. now fun part: if type t doesn't have parameter-less default constructor fail using default jobactivator said. t

Is there such a thing as Unit Test Plan in Java -

i worked on java/java ee project , have deliver unit test plan , i've worked on many integration tests plans, describes integration tests scenarios, i've never heard of unit test plan. this unit test plan have describe unit tests i've done, , related rule in specifications. is there such thing in java project life cycle ? if yes, can have example , or how make one . unit tests should self explanatory. they used programmers sure code correct , doesn't affect existing code. any programmer should free add new tests if necessary, maintain document define plan of unit tests strange approach. from point of view, test plan should used define acceptance tests or integration tests, not unit tests. note unit tests useful during programming phase , during programming phase not possible know tests written. possible imagine unit test plan written @ end of work when plan not needed.

javascript - Display block after fadeout or fadein after fadeto -

when click on image want div fadein , fadeout. div should occupy same space ( display: block ). if click again, want div reappear. can't achieve this. if use fadeout() , inline style display:none added. if use fadeto() , div hidden without occupying space. how have it? code: function edit(oneid) { avisedit(oneid); } function avisedit(oneid) { var nom = $('#x'+oneid+' .nom').text(); showalerts("ara pots editar el valor dels camps de '"+nom+"'", 2); } function showalerts(sms, code) { switch(code) { case 0: actions(sms, "success"); break; case 1: actions(sms, "error"); break; case 2: actions(sms, "info"); break; } } function actions(sms, tipus) { $("#warningboxes").toggleclass(tipus); // add class $('#warningboxes').css('visibility','visible').hide(); // start hidden fadein $("#war

recursion - Find text path through character matrix with recursive algorithm -

i'm trying solve question: http://www.spoj.com/problems/allizwel/ find whether there path in given matrix makes sentence “all izz well”. there path cell neighbouring cells. neighbour may share edge or corner. input specification: first line consists of integer t representing number of test cases. first line of each test case consists of 2 integers r , c representing number of rows , number of columns in matrix. output specification: each test case print “yes” if there path makes sentence “allizzwell”. else print “no”. for sample test cases, open link. my code: #include <iostream> #include <map> #include <vector> #include <string> #include <utility> #include <algorithm> #include <stack> #include <queue> #include <climits> #include <set> using namespace std; char matrix[101][101]; bool var; int r,c; bool check (string str,int pos, bool visited[101][101],int i, int j)

jquery - convert to string to array in ruby or javascript to be in used in an SQL query -

i trying convert string array either in ruby on rails or in javascript or jquery. in code, values of strings select option. on option selected, capture value returns string var lenders = $(this).val(); this string returns. line of id numbers separated commas "15,16,17" , want convert array [15, 16, 17] either in ruby or in javascript. how achieve this? i have tried doing "15,16,17".split(',') i have tried doing "15,16,17".to_a but no avail "15,16,17".split(',').map(&:to_i) trick

javascript - Prestashop Ajax Call Not Processing -

the code utilizing require_once , wasn't executing, removing these , debugging problem solved changed required include_once so include_once(dirname(__file__).'../../../../config/config.inc.php'); include_once(dirname(__file__).'../../../../init.php'); are working, still cannot access database files old edit ok so `if (!defined('_ps_version_')) echo('no ps ');` is echoing "no" return call of ajax call, have tried require_once(dirname( file ).'../mymodule.php'); , gave me internal server error 500 in console. every type of require_once call i've tried has given same error, including direct hardcoded directories, url links, different files, files in same directory, files in c , i've had no luck. older edit ok, $_get showing data correctly passed ajax, require_once not working, ajax.php not executing @ all. however, tools::getvalue not working, have not tried edit db don't think work since tools::

Spring Security allow all requests -

i need develop rest application base auth. use java-base configuration , have security class @configuration @enablewebsecurity public class securityconfig extends websecurityconfigureradapter { @autowired public void configureglobal(authenticationmanagerbuilder auth) throws exception { auth.inmemoryauthentication().withuser("admin").password("123456").roles("admin"); } @override protected void configure(httpsecurity http) throws exception { http.authorizerequests().anyrequest().denyall(); } } also see security filter added [org.springframework.security.web.defaultsecurityfilterchain] (serverservice thread pool -- 59) creating filter chain: org.springframework.security.web.util.matcher.anyrequestmatcher@1, [org.springframework.security.web.context.request.async.webasyncmanagerintegrationfilter@5601cb02, org.springframework.security.web.context.securitycontextpersistencefilter@3be5386f, org.springframework.

c# - SignalR - Decryption key specified has invalid hex characters -

i using signalr 2.2.0 , mvc 4. when load page in chrome, receive error in console: http://localhost:8180/signalr/negotiate?clientprotocol=1.5&connectiondata=%5b%7b%22name%22%3a%22chathub%22%7d%5d&_=1467627883530 500 (internal server error) upon further inspection using fiddler can view stacktrace: [configurationerrorsexception]: decryption key specified has invalid hex characters. (c:\users\foo\web.config line 66) @ system.web.security.cryptography.machinekeymasterkeyprovider.generatecryptographickey(string configattributename, string configattributevalue, int32 autogenkeyoffset, int32 autogenkeycount, string errorresourcestring) @ system.web.security.cryptography.machinekeymasterkeyprovider.getencryptionkey() @ system.web.security.cryptography.purpose.getderivedencryptionkey(imasterkeyprovider masterkeyprovider, keyderivationfunction keyderivationfunction) @ system.web.security.cryptography.aspnetcryptoserviceprovider.getnetfxcryptoservice(purpose purpos

Raspberry PI wifi dongle not recognised -

i use the original raspberry wifi dongle on raspberry pi 2. changed interface file in etc/network , wpa_supplicant.conf file, addding ssid , psk password wifi connection. , yet, not able connect wifi network. stranger in gui seems rasberry doesn't recognise wifi dongle. when left-click on network icon, says no wireless interfaces found . have suggestions may me solve issue? here last lines of dmesg command [20108.919617] usb 1-1.2: product: remote download wireless adapter [20108.919633] usb 1-1.2: manufacturer: broadcom [20108.919650] usb 1-1.2: serialnumber: 000000000001 [20109.170317] brcmfmac: brcmf_c_preinit_dcmds: firmware version = wl0: apr 3 2014 04:43:32 version 6.10.198.66 (r467479) fwid 01-32bd010e [20109.190470] brcmfmac: brcmf_cfg80211_reg_notifier: not iso3166 code [20109.278344] brcmfmac: brcmf_add_if: error: netdev:wlan0 exists [20109.278371] brcmfmac: brcmf_add_if: ignore if event here ifconfig wlan0 command gives: wlan0 link encap:ethernet h

sql - Select Products/Events in Multiple Categories using MySQL -

as example, need query find events categorised : either category id 1, 2 or 3 (let's these running, swimming, cycling) , category id 15 (let's 5km distance) it equally extended 15 or 16 perhaps (5km or 10km) i have 3 tables : event, event_event_categories , event_categories event_event_catgories designed you'd expect primary key each related table: event_id, category_id --------------------- 2345 1 2456 2 7893 3 2345 15 event_categories designed follows parent category category_id, category_name, parent_category_name ------------------------------------------------ 1 running sport 2 swimming sport 3 cycling sport ... 15 5km distance 16 10km distance what need events in plain english: (running or swimming or cycling) , (5km) the distinction , made parent category different , can handle outside of mysql if necessary. in example above, eve

javascript - Stopping the use of a URL to get to the site -

so have website redirects part of site ie, when pressing button on "www.test.com" reditects "www.test.com/anotherpage". problem want users able access second page when using button , not typing in "www.test.com/anotherpage" search bar. so, there way setup page such cannot accessed url redirected part of website? document.referrer the value empty string if user navigated page directly (not through link, but, example, via bookmark). since property returns string, not give dom access referring page.

setuptools - How to create a nested package space for python packages? -

i'm restructuring python libraries our company developing various groups. avoid polluting top level module namespace i'd group under top level 'companyname' package, we'll have 'coname.utils', 'coname.qa', 'coname.api', , on. several of these expected distributed our product, or publicly installable. 'qa' purely internal. google similar. e.g., protobuf library available "google.protobuf" in module path. however, it's not particularly clean: .pth file installed protobuf package looks this: import sys, types, os;p = os.path.join(sys._getframe(1).f_locals['sitedir'], *('google',));ie = os.path.exists(os.path.join(p,'__init__.py'));m = not ie , sys.modules.setdefault('google', types.moduletype('google'));mp = (m or []) , m.__dict__.setdefault('__path__',[]);(p not in mp) , mp.append(p) i think fool import engine because there's no __init__.py in "google"

How Does R read nodatavalue tags from a geotiff - R Raster package -

i running unusual outcome raster no data values in r. code below -- have raster has no data value import (-9999). qgis reads nodatavalue, arcgis too. r, when reads in geotiff, assigned nodata value -inf. i don't know why. decided try make 1 scratch - , same result. wrong process? how can ensure r reads in nodatavalues properly? note: example below created raster / geotiff. i'm importing geotiffs quite large produced organization. don't have control on how written ask them adjust tags if need be. library(raster) #create raster matrix myraster1 <- raster(nrow=4, ncol=4) #assign random data raster myraster1[]<- 1:ncell(myraster1) myraster1[5] <- -9999 #ensure data have decimals myraster1[2] <- 34.5 #assign no data value raster myraster1@file@nodatavalue <- -9999 #make sure worked navalue(myraster1) myraster1@file@nodatavalue #view attributes of raster myraster1 #write out raster #write geotiff - change overwrite=true overwrite=false if want mak

Kurento : Custom module change version number -

i have been trying change version number of kurento custom module, successful change version of jar snapshot not of .deb file generated. can point out how change version number of output .deb file appreciated. you need add new entry con debian/changelog version on entry version of package. to make easier creation of entry can use command dch : dch -i this open editor of field completed. complete missing ones correct information.

how to use If to compare a number with an interval in python? -

when compile python code below, not have output! .csv file include numbers. (80,100,50,40,250,300). import csv open("duration.csv") f: d1 = [row[0] row in csv.reader(f)] x in d1: if 0<= x <200: print("0<=x<200") any solution?? the values rows read strings csv module. should convert x integer , apply formatting: if 0 <= int(x) < 200: print("0<={}<200".format(x))

r - Split a string in each row and duplicate that row -

this question has answer here: splitting string new rows in r [duplicate] 3 answers in data frame working on, there 1 column of strings might contains ";". want find them , split string delimited ";" , copy row , put separated string different rows. here sample of data frame: name value 10 b;c 20 d 30 e 40 f;g;h 50 and want be: name value 10 b 20 c 20 d 30 e 40 f 50 g 50 h 50 here trying write: df$name <- sapply(df$name,function(x) { if (grepl(";",df$name)){ unlist(strsplit(df$name,"[;]"))}}) the error msg says: condition has length > 1 , first element used and don't know how put split string different rows library(dplyr) library(tidyr) df%>%mutate(name=strsplit(as.character(name),&#

python - Using groupby ("1d") and first_valid_index together -

this post shows how use first_valid_index find first occurrence of value in dataframe column. how use first_valid_index along daily groupby in order find first occurrence each day same example dataframe shown in linked post? this groupby code need use: grouper = pd.timegrouper("1d") edit: when use lambda , apply approach gives correct output. unable send output new column ['test_output'] though shows nat: df['test_output'] = df.groupby(grouper)['test_1'].apply(lambda x: x.first_valid_index()) df out[9]: test_1 test_output 2014-03-04 09:00:00 nan nat 2014-03-04 10:00:00 nan nat 2014-03-04 11:00:00 nan nat 2014-03-04 12:00:00 nan nat 2014-03-04 13:00:00 nan nat 2014-03-04 14:00:00 1.0 nat 2014-03-04 15:00:00 1.0 nat 2014-03-04 16:00:00 1.0 nat 2014-03-05 09:00:00 1.0 nat iiuc can use first on groupby object: in [95]: df.groupby(grouper).first() out[95]: test_1 2014-03-04 1.0 2014-03-05 1.0 should

android - npm WARN addRemoteGit Error: not found: git -

i followed react native official docs step step, executed command react-native init medfirstrn windows cmd, received following error: d:\projects>react-native init medfirstrn walk through creating new react native project in d:\projects\medfirstrn installing react-native package npm... npm warn addremotegit error: not found: git npm warn addremotegit @ f (c:\android\nodejs\node_modules\npm\node_modules\which\which.js:73:28) npm warn addremotegit @ e (c:\android\nodejs\node_modules\npm\node_modules\which\which.js:76:29) npm warn addremotegit @ c:\android\nodejs\node_modules\npm\node_modules\which\which.js:84:16 npm warn addremotegit @ fsreqwrap.oncomplete (fs.js:82:15) npm warn addremotegit git://github.com/facebook/react.git#b4e74e38e43ac53af8acd62c78c9213be0194245 resetting remote c:\users\moughaoui\appdata\roaming\npm-cache\_git-r emotes\git-github-com-facebook-react-git-b4e74e38e43ac53af8acd62c78c9213be0194245-c92d21d2e268ee43029cdd9b3cd02392 because of

programmatically scroll instagram followers window using javascript -

i'm trying scroll followers/following div programmatically on instagram. thought same or similar standard way of scrolling using javascript. what have tried far: var x = document.getelementsbyclassname("_4gt3b"); x.scrolltop += 100; i've tried: x.scrollby(0,100); the followers window not scroll. scrolltop variable returns nan, , scrollby function returns x.scrollby not function(…). guidance scroll followers/following window appreciated. try this? x[ 0 ].scrolltop += 100 good luck!

activerecord - Ruby on Rails query not working properly -

i have several listings, , define number of filters. in particular, listing has_many :spaces, through: :designations , has_many :amenities, through: :offerings . i use filters restrict listings shown. the 2 main ones are: # filter space type if params[:search][:space_ids].present? && params[:search][:space_ids].reject(&:blank?).size > 0 @listings = @listings.joins(:spaces).where('space_id in (?)', params[:search][:space_ids].reject(&:blank?)).uniq end # filter amenities if params[:search][:amenity_ids].present? && params[:search][:amenity_ids].reject(&:blank?).size > 0 @listings = @listings.joins(:amenities).where(amenities: { id: params[:search][:amenity_ids].reject(&:blank?) }).group('listings.id').having('count(*) = ?', params[:search][:amenity_ids].reject(&:blank?).size) end the first filter says: of listings match of selected space types. the second filter says: of listings have of selected ameni

android - Why is the client list empty when I connect as a client? -

i'm using android wi-fi direct service discovery. when connection info available, request group info if group formed. reason, when connect client, can group owner group, client list empty. when connect group owner, i'm able group owner , client list. when chat fragment, i'm trying display group owner , clients are. issue group owner device name seems blank, rest of info correct, address (i removed address lines). i've tried requesting group info in few different places, , i'm never able client list when connected client. switch chat fragment when receive service_connected intent. connecting client: i/wfd_: wi-fi p2p connection changed i/wfd_: connected p2p network. requesting connection info i/wfd_: connection info available i/wfd_: wifip2pinfo: i/wfd_: group formed: true group owner: false group owner address: /192.168.49.1 i/wfd_: stopping service discovery i/wfd_: service discovery stopped i/wfd_: connected client i/wfd_: requesting grou

reactjs - fbBatchedBridge is undefined -

the application compilable before started experimenting babel compiler , adding/removing node modules. can't connect development server. the error: unable execute js call: _fbbatchedbridge undefined the strange thing react packager line (only 1 dependency, 14ms) suggests may not crawl dependencies @ all: <start> find dependencies transformed 1/1 (100%) <end> find dependencies (14ms) similar error on both ios , android devices. both in simulator , on device. the url accessible. wiping lines in package.json , .babelrc , index.js didn't help, suggests else may wrong. editing appdelegate.m , react-native-xcode.sh didn't help, other answers suggested. package.json: { "name": "reactproject", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start" }, "dependencies": {

c# - How to find the center of a expanding expander -

ok has me puzzled , should simple i have code private void expander_expanded(object sender, routedeventargs e) { var expand = e.originalsource expander; if (expand != null) { var layer = sender layerbase; var middle = expand.translatepoint(new point(), layer) + new vector(expand.actualwidth/2,expand.actualheight/2); location.centre = layer.screentogeopoint(middle); e.handled = true; } } this code supposed do, locate screen point in centre of control locate geographic point relates screen point recentre map coordinates this ensure expander in centre of displayed map, out moving expander relative map (ie top left corner still in correct geographic location) the code functioning however, actualheight , actualwidth returning size of collapsed expander, throwing off centre point large margin, i'm assuming because expanded event firing before control redraws. how capture expanded has changed after visual tree redraws?

javascript - How to combine ReactJs Router Link and material-ui components (like a button)? -

i need find solution able combine functionality of react router material ui components. for instance, i've scenario: router , button. tried mix them together, , restyle them. so simple link <link classname={this.getclass(this.props.type)} to={`${url}`} title={name}>{name}</link> i tried create material ui button following <link classname={this.getclass(this.props.type)} to={`${url}`} title={name}> <flatbutton label={name} /> </link> but have following error , javascript breaks invariant.js?4599:38uncaught invariant violation: addcomponentasrefto(...): reactowner can have refs. might adding ref component not created inside component's render method, or have multiple copies of react loaded (details: https://gist.github.com/jimfb/4faa6cbfb1ef476bd105 ). do have idea how manage situation? thank in advance , if need more information let me know this works me: <flatbutton label="details"

Facebook OAuth issue Dreamfactory -

i getting error while trying implement facebook oauth in ionic app. this how post request url looks like: https://df-apiurl.com/api/v2/user/session?oauth_callback=true&service=facebook&code=**********&state=******** here error response. relevant part might be: "message":"client error: post https://graph.facebook.com/oauth/access_token resulted in 400 bad request response:\n{"error":{"message":"error validating verification code. please make sure redirect_uri identical 1 (truncated...)\n" but here full error message in case. {"error":{"context":null,"message":"client error: post https://graph.facebook.com/oauth/access_token resulted in 400 bad request response:\n{"error":{"message":"error validating verification code. please make sure redirect_uri identical 1 (truncated...)\n","code":400,"trace":["0 /opt/bitnami/a

android - ubuntu14.04 build android4.4 modem error -

when build modem file said: make: [build/elink82_tb_kk_hspa/default/bin/dep/codegen_dep/nvram_auto_gen.det] error 2 i user gcc 4.4 , g++ 4.4 build android 4.4 modem, if can me, thanks! i had solved problem myself: @ first reinstall ubuntu 10.04,and install software below sudo apt-get install openssh-server //安装ssh sudo apt-get install git-core gawk sudo apt-get install libxau-dev libxdmcp-dev x11proto-core-dev x11proto-input-dev x11proto-kb-dev xtrans-dev libxcb1-dev sudo apt-get install git-core gnupg zip curl libc6-dev libx11-dev libxml2-utils xsltproc sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-jdk sudo aptitude install -y bison g++-4.4 g++-4.4-multilib gcc-4.1-multilib gcc-4.4-multilib gcc-multilib m4 vim vim-runtime system-config-kickstart nmon ethtool tofrodos sudo apt-get -y install libxml-simple-perl perl-doc libwww-perl libfile-spec-perl

python - sklearn's PLSRegression: "ValueError: array must not contain infs or NaNs" -

when using sklearn.cross_decomposition.plsregression : import numpy np import sklearn.cross_decomposition pls2 = sklearn.cross_decomposition.plsregression() xx = np.random.random((5,5)) yy = np.zeros((5,5) ) yy[0,:] = [0,1,0,0,0] yy[1,:] = [0,0,0,1,0] yy[2,:] = [0,0,0,0,1] #yy[3,:] = [1,0,0,0,0] # uncommenting line solves issue pls2.fit(xx, yy) i get: c:\anaconda\lib\site-packages\sklearn\cross_decomposition\pls_.py:44: runtimewarning: invalid value encountered in divide x_weights = np.dot(x.t, y_score) / np.dot(y_score.t, y_score) c:\anaconda\lib\site-packages\sklearn\cross_decomposition\pls_.py:64: runtimewarning: invalid value encountered in less if np.dot(x_weights_diff.t, x_weights_diff) < tol or y.shape[1] == 1: c:\anaconda\lib\site-packages\sklearn\cross_decomposition\pls_.py:67: userwarning: maximum number of iterations reached warnings.warn('maximum number of iterations reached') c:\anaconda\lib\site-packages\sklearn\cross_decomposition\pls_.py:2