Posts

How to write a list of tuple in python with header mapping -

Image
i have process python list of tuples each tuple contains header name below- want tuple mapped respectives header in tuple. [[(u'index', u' broad market indices :')], [(u'index', u'cnx nifty'), (u'current', u'7,950.90'), (u'% change', u'0.03'), (u'open', u'7,992.05'), (u'high', u'8,008.25'), (u'low', u'7,930.65'), (u'prev. close', u'7,948.90'), (u'today', u''), (u'52w high', u'9,119.20'), (u'52w low', u'7,539.50')], [(u'index', u'cnx nifty junior'), (u'current', u'19,752.40'), (u'% change', u'0.73'), (u'open', u'19,765.10'), (u'high', u'19,808.25'), (u'low', u'19,629.50'), (u'prev. close', u'19,609.75'), (u'today', u''), (u'52w high', u'21,730.80'), (u...

opticalflow - How to use the extended kalman filter for IMU and Optical Flow sensor fusion? -

i building quadcopter , using pixhawk autopilot system px4flow sensor attached optical flow data. px4flow high speed smart camera (arm processor) integrated gyro , height sensor, , outputs linear velocities internal optical flow algorithm. now, improve on position , velocity estimates using extended kalman filter fuse imu , optical flow data. have derived state model function , state transition matrix prediction step. by problem lies within deriving measurement model/function optical flow velocities, used in update phase of extended kalman filter. believe have derive optical flow algorithm how, far have gotten. *edit: here article describing px4flow unit , how calculates velocities. (forgot add link, it's there) https://pixhawk.org/_media/modules/px4flow_paper.pdf i'll assume (since don't give details) state vector contains speed , position in world coordinates. optical flow returns xy speed in body coordinates, have rotate according yaw angle speed in ...

javascript - Error getting the index of a TR with jQuery -

i have problem index of table. index jquery index() method, returns 1. html table: <table id="tabla_materia" cellspacing="0" cellpadding="0" style="width:500px; margin-top:50px;"> <tbody> <tr> <th colspan="6"> lista de materia prima </th> </tr> <tr> <th class="pk"></th> <th>codigo</th> <th>codigo secundario</th> <th>producto</th> <th>cantidad requerida</th> <th>cantidad segun formula</th> <th>cantidad total</th> <th>costo unitario</th> <th>costo total</th> </tr> <tr class="ptype"> <td colspan="10"><strong>3.1.01.1 carnes - vacuna...

javascript - three.js r72 no longer supports THREE.LinePieces, how to merge multiple disconnected lines with THREE.LineSegments? -

i updated three.js r72 , getting following warning in console concerning three.linepieces ... three.line: parameter three.linepieces no longer supported. created three.linesegments instead. the lines appear disconnected dispite warnings, however, following example, if update three.linepieces three.linesegments disconnected lines become connected. var linematerial = new three.linebasicmaterial({color: 0x000000, linewidth: 1}); var linegeom = new three.geometry(); var xstrt = 0; (nn=0; nn<numlines; nn++) { linegeom.vertices.push(new three.vector3(xstrt, -5, 0)); linegeom.vertices.push(new three.vector3(xstrt, 5, 0)); xstrt += 5; } var line = new three.line(linegeom, linematerial, three.linepieces); // seperate lines, warnings //var line = new three.line(linegeom, linematerial, three.linesegments); // connected 1 line :( am expected create separate geometries (containing 2 vertices) each line segment or possible merge multiple line segments 1 geometry had lin...

objective c - Type "SwiftClass" cannot conform to protocol "ObjcProtocol" because it has requirements that cannot be satisfied -

i have objective-c protocol i'm trying implement in swift class. example: @class anobjcclass; @protocol objcprotocol <nsobject> - (void)somethingwithanargument:(anobjcclass *)arg; @end when try conform in swift class this: @objc class swiftclass: nsobject, objcprotocol { // ... } i following scary compiler error: type "swiftclass" cannot conform protocol "objcprotocol" because has requirements cannot satisfied. how resolve this? ensure classes referenced protocol included in bridging header. this error happens when 1 of types used in protocol (the protocol itself, return type, argument type) not included in swift bridging header. objective-c classes can happily implement protocol because of @class anobjcclass forward declaration, appears swift classes can't implement protocols use classes forward-declared.

html - Convert Fading Black Separator From "-webkit-gradient" To "linear-gradient" -

i have gradient using converted -webkit default linear-gradient. have tried using of css generating tools online import code in order see other browser specific variants, reason when import code gradient in results section becomes white. background: -webkit-gradient(linear, 0 0, 100% 0, from(white), to(white), color-stop(50%, black)); jsfiddle sample use .sexy_line { background: linear-gradient(to right, white, black, white); } see mdn article more info on linear gradients. demo .sexy_line { margin: 25px 0; height: 1px; background: black; background: linear-gradient(to right, white, black, white); } <div class="sexy_line"></div>

ios - To close NSStream objects before resigning active -

i have nsinputstream , nsoutputstream scheduled in non-main-thread run loop. i'm using cfstreamcreatepairwithsockettohost. remote endpoint external device communicates app tcp on wifi. when applicationwillresignactive called, want close these. want guaranteed close, because app may want communicate same device, , device accepts 1 tcp connection. additional information: it frequent occurrence in context of device multiple apps may need communicate device. i have tried using performselector:onthread:withobject:waituntildone: (with waituntildone:yes) in applicationwillresignactive. doesn't work, , in cases seems selector not called. my understanding can't close nsstream objects or destroy task queue main thread. i can not change how device receives connections. listens on 1 address/port tcp connections, , allows 1 connection (it doesn't multiplex connections source port). use dispatch_sync() background queue.