is using ( condition or condition b , condition c ) the same as ( condition , condition c) or (condition b , condition c) no. first condition is: (condition a) or (condition b , condition c) and second is: (condition , condition c) or (condition b , condition c) you can see difference between them.
i trying find intersection points between elipse , line, seem unable so. have tried 2 approaches, 1 shapely trying find intersection between linestring , linearring in code bellow, did not usable values out of it. 1 of problems, elipse off center , @ small or high angle # -*- coding: utf-8 -*- """ created on mon aug 19 17:38:55 2013 @author: adudchenko """ pylab import * import numpy np shapely.geometry.polygon import linearring shapely.geometry import linestring def ellipse_polyline(ellipses, n=100): t = np.linspace(0, 2*np.pi, n, endpoint=false) st = np.sin(t) ct = np.cos(t) result = [] x0, y0, a, b, angle in ellipses: angle = np.deg2rad(angle) sa = np.sin(angle) ca = np.cos(angle) p = np.empty((n, 2)) p[:, 0] = x0 + * ca * ct - b * sa * st p[:, 1] = y0 + * sa * ct + b * ca * st result.append(p) return result def intersections(a, line): ea = linearring(a) eb...
i trying create pre handler sanitizes data before written mongodb see: http://mongoosejs.com/docs/middleware.html i've tried following each property able sanitize it: blogschema.pre('save', function (next) { var obj = this; console.log(obj)//-> https://gist.github.com/daslicht/70e0501acd6c345df8c2 // i've tried following single items : object.keys(obj).foreach(function (key) { console.log('keys: ',obj[key]); }); //and: for(var key in obj) { console.log(obj[key]) } //and: _.each( self , function(value, key, list){ console.log('value:',key); }) next(); }) any of above approaches results following: thats output of: for(var key in obj) { console.log(obj[key]) } https://gist.github.com/daslicht/cb855f53d86062570a96 any know how each single property can sanitize it, please? ~marc [ed...
Comments
Post a Comment