Posts

angularjs - Angular 2 delete a file from uploaded list of files -

i new angular 2. uploading files , displaying them in template. on checking checkbox when press delete, not deleting required file list. below code template <form #f="ngform" (ngsubmit)="onsubmit(f.value)"> <table cellpadding="4" class="grid" > <thead><tr><th></th><th>document name</th><th>document id</th><th>document type</th><th>source</th> <th>document date</th><th>trip id</th><th>notes</th><th>action</th></tr></thead> <tbody *ngfor="let file of files"> <tr > <td class="form-group"><input type="checkbox" [checked]="checked"></td> <td class="form-group"><input type="text" class="form-control" ngcontrol="file.name">{{file.name}}</td> <td class="fo...

sql - Partition by using multiple case statements -

i attempting dedupe records in database using partition clause query run in order dedupe. ranks records populated , keeps highest ranked record. ctedupes ( -- -- partition based on contact.owner , email select row_number() over(partition contactowner, email order -- ranking populated field case when otherstreet not null 1 else 0 end + case when othercity not null 1 else 0 end ) rnd, * scontact (contact_owner_name__c not null , contact_owner_name__c<>'') , (email not null , email<>'') ) --rank data , place new table created select * contact_case1 ctedupes rnd=1; i wanted know if possible partition using case. example partitioning contactowner , email. when contactowner null want partition contactofficer instead. can create case statements or not possible since ranking altered in someway. you can use case , think coalesce() simpler in case: select row_number() on (partition coalesce(contactowner, contactof...

python 2.7 - pylab install error gcc windows 10 -

so installed theano on python 2.7 environment within anaconda 3, on windows 10. theano passed theano.test() @ least. using example code deeplearning.net . heva sucessfully run first block on linked page defines theano function. when go install pylab via pip install pylab can use skimage second block, installer quits while doing gcc call portion looks says "shared geometry". 1 thing noticed right away -debug flag misspelled -ddebug . cause? have msvcr90.dll , if , need it? also, important, i'm using (6 months or so) outdated tdm-gcc 4.9 something. here line in question, few others might interesting: `copying skimage\_shared\tests\__init__.py -> build\lib.win-amd64-2.7\skimage\_shared\tests running build_ext looking python27.dll cannot build msvcr library: "msvcr90d.dll" not found customize mingw32ccompiler customize mingw32ccompiler using build_ext building 'skimage._shared.geometry' extension compiling c sources c compiler: gcc -g -ddebug -d...

Opencv - polynomial function fitting -

in opencv (or other c++ lib), there similar function matlab fit can 3d polynomial surface fitting (i.e. f(x,y)= p00 + p10*x + p01*y + p20*x^2 + p11*x*y + p02*y^2 ). thanks i don't think there lib in opencv can : int main( int argc, char** argv ) { mat z = imread("1449862093156643.jpg",cv_load_image_grayscale); mat m = mat_<double>(z.rows*z.cols,6); mat i=mat_<double>(z.rows*z.cols,1); (int i=0;i<z.rows;i++) (int j = 0; j < z.cols; j++) { double x=(j - z.cols / 2) / double(z.cols),y= (i - z.rows / 2) / double(z.rows); m.at<double>(i*z.cols+j, 0) = x*x; m.at<double>(i*z.cols+j, 1) = y*y; m.at<double>(i*z.cols+j, 2) = x*y; m.at<double>(i*z.cols+j, 3) = x; m.at<double>(i*z.cols+j, 4) = y; m.at<double>(i*z.cols+j, 5) = 1; i.at<double>(i*z.cols+j, 0) = z.at<uchar>(i,j); } svd s(m); mat q; s.backsubst(i,q); cout<<...

Append string in the middle of a query in python -

i'm trying build query in python, i'm looking elegant way append condition in middle of string: def get_raw_queryset(frequency=none, where_condition=none): qs = "select id, count(*) count user_transaction_log " \ # want append if not none if where_condition: "where .... = 1" \ "group type , strftime('{0}', datetime) order id" \ .format(frequency) return qs this work long can safely evaluate string if where_condition not string: "select ..." + bool(where_condition) * ("where ...") + "group ..." i hope you're being extremely careful avoid sql injection.

street address - Android Linkify for UK adresses -

regarding use of linkify on textbox / label know how enable uk address work? using or canadian address works fine, changing international address not same link-to-map treatment. i avoid building pattern matching library compensate this. any or pointers documentation related issue?

autocomplete - Enable returning multiple arguments as completion reply at once in fish shell -

i working on porting google cloud sdk command line auto completion feature fish shell. when have unambiguous reply multiple arguments: a) either command completed arguments spaces gets escaped (\ ) when specify function call in complete command inside ''s or ""s, like: > complete ... -a '(__fun)' b) or if don't (just: -a (__fun)), first argument of reply gets completion , other arguments "get lost" is possible reply multiple arguments @ once in fish completion? could done in number of ways. have hack bit, though, since ridiculous_fish says it's not designed this. easiest ship own wrapper function can take escaped output , pass on in way works. not pretty, though, , screw autosuggestions unless go , modify history lines. here's semi-hacky/semi-elegant propose: if have looked "sequence" of args you'd want complete @ once, @ first invocation put trailing args description first one. once 1 has been locke...