Posts

java - error in apply method in Background subtraction in opencv android -

i want background subtraction on inputframe, , want return foreground mask. facing error bellow can 1 me fix in advance my code: package org.opencv.samples.tutorial1; import org.opencv.android.baseloadercallback; import org.opencv.android.camerabridgeviewbase.cvcameraviewframe; import org.opencv.android.loadercallbackinterface; import org.opencv.android.opencvloader; import org.opencv.core.mat; import org.opencv.core.point; import org.opencv.core.scalar; import org.opencv.video.backgroundsubtractormog; import org.opencv.android.camerabridgeviewbase; import org.opencv.android.camerabridgeviewbase.cvcameraviewlistener2; import android.app.activity; import android.os.bundle; import android.util.log; import android.view.menu; import android.view.menuitem; import android.view.surfaceview; import android.view.windowmanager; import android.widget.toast; public class tutorial1activity extends activity implements cvcameraviewlistener2 { private static final string tag = "di...

android - .gif Image as source runs nicely in Windows kivy program . Running via kivy Launcher shows background of gif image -

Image
i running program showing .gif image in widget , works when run app using kivy launcher .gif image comes square box when image without backgrund . any 1 ideas , why behaving differently on android , windows . please see below .kv code example of how used .gif image . using .gif image button . <butimage@buttonbehavior+asyncimage> canvas.before: color: rgb: (0, 0, 1) pushmatrix rotate: axis: 0,0,1 angle: 20 origin: self.center source: "images/butterflybluex.gif" canvas.after: popmatrix ... first make sure package pil/pillow [just add 1 of requirements while building apk] gif loading, otherwise pure python loader slow android used, second please elaborate mean square box? update: updated example shows using asyncimage local source, async image ment used remote url local sources can use image class. second: if getting white background instead of image gave...

node.js - How to add production mode to sailsjs app when started using PM2 -

to start sailsjs in production mode append --prod . run: node app.js --prod i'm using pm2 , simple json file settings, contains name of process , scriptname, kick off node process. how pass production argument using pm2? read pm2 json app declaration . e.g. (not tested) [{ "name" : "sails", "script" : "./app.js", "args" : "['--prod']" }]

android - Make editable EditText on LongClick in ListView -

i'm trying make edittext field in listview editable on longclick on item. i've searched same topics on stackoverflow, haven't found best case. here edittext xml listview item: <edittext android:id="@+id/list_title_parent_item" style="@style/list_parent_title_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_alignparenttop="true" android:inputtype="textpersonname" android:focusable="false" android:background="@android:color/transparent" android:lines="1" /> firstly disabled editing , shows text. longclick on item, must editable. i've tried did setting onitemlonglistener listview: private class listviewonlongclicklistener implements onitemlongclicklistener { @override public boolean onitemlongclick(adapterview<?>...

R: relisting a flat list -

this question has nice solution of flattening lists while preserving data types (which unlist not): flatten = function(x, unlist.vectors=f) { while(any(vapply(x, is.list, logical(1)))) { if (! unlist.vectors) x = lapply(x, function(x) if(is.list(x)) x else list(x)) x = unlist(x, recursive=f) } x } if give following list, behaves expected: > = list(c(1,2,3), list(52, 561), "a") > flatten(a) [[1]] [1] 1 2 3 [[2]] [1] 52 [[3]] [1] 561 [[4]] [1] "a" now i'd restructure flat list a . relist fails miserably: > relist(flatten(a), skeleton=a) [[1]] [[1]][[1]] [1] 1 2 3 [[1]][[2]] [1] 52 [[1]][[3]] [1] 561 [[2]] [[2]][[1]] [[2]][[1]][[1]] [1] "a" [[2]][[2]] [[2]][[2]][[1]] null [[3]] [[3]][[1]] null now, of course relist(unlist(b), a) loses data types again. way restructure flat list? bonus points if handles analogous attribute unlist.vectors correctly. one way is: relist...

version control - Why "src/core" is ignored automatically in IntelliJ VCS -

i use intellij idea 13.1.1. it's source folder structure. module1/src/api module1/src/core and use cvs version control system. "api" source folder managed intellij vcs, "core" sorce foloder not managed. files marked olive color , vcs sub menus deactivated, except "check out". why "src/core" ignored automatically in intellij vcs? i checked "file"->"settings"->"version control"->"ignored files" "core" not exists.

Split row into multiple rows in SQL Server for insert -

i trying create sql query insert single row 2 rows in table. my data looks this: size | indemnity_factor | monitoring_factor -------------------------------------------- 0 | 1.00 | 1.5 the end data looks this: id | claim_component_type_code | size | adjustment_factor | valid_from_date ------------------------------------------------------------------------------ 1 | indemnity | 0 | 2.5000000 | 2014-01-01 1 | monitoring | 1 | 1.5000000 | 2014-01-01 i want add entry of indemnity , monitoring every row in first data source. haven't got idea how go it, appreciative if help. sorry rough data can't post images reputation apparently. thanks in advance. use unpivot select * (select size, indemnity_factor indemnity, monitoring_factor monitoring yourtable) src unpivot (adjustment_factor claim_component_type_code in (indemnity, monitoring) ) u