Posts

opencv - How to store cv::Scalar objects in a Map in c++ -

i want store randomly generated scalar values in map. following attempt gives me compile error. rng rng(0xffffffff); std::map<scalar, int> segmentcolors; scalar randomcolortemp1 = randomcolor(rng); scalar randomcolortemp2 = randomcolor(rng); segmentcolors.insert(pair<scalar, int>(randomcolortemp1, 1)); segmentcolors.insert(pair<scalar, int>(randomcolortemp1, 1)); error report follows. 1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\xstddef(193): error c2678: binary '<' : no operator found takes left-hand operand of type 'const cv::scalar' (or there no acceptable conversion) 1> e:\opencv\build\include\opencv2\core\operations.hpp(3193): 'bool cv::operator <(const cv::filenodeiterator &,const cv::filenodeiterator &)' [found using argument-dependent lookup] 1> e:\opencv\build\include\opencv2\core\mat.hpp(1303): or 'cv::matexpr cv::operator <(const cv::mat ...

jquery - Select2 Display Different Value after selection -

i trying find updated answer question here seems formatselection option select2 no longer work, or not working me. basically, have multi-select select2 menu , have option's value displayed after being selected rather being text description. instance, have list of provinces each 1 has shorthand value on option (ab alberta, bc british columbia, etc.) those ones have displayed after being selected. there simple way of doing in select2 4.0.0? markup: <select id="provselect" multiple data-role="none" > </select> for js: $("#provselect").select2({ width:"100%", formatselection: formatselection}); with appropriate function: function formatselection(item){ return item.id; } select2 still has formatting api, it's called templating now. example: function formatstate (state) { if (!state.id) { return state.text; } var $state = $( '<span><img src=...

c# - MS Word Interop, Keeping Paragraphs and tables with headers together keeping them from splitting to the next page -

i'm using code below working merge queued list of html files , saving them in either pdf or docx using ms word interop. i've run issues page breaks. cannot figure out how keep both paragraphs , tables page breaking in middle of them. goal keep text in paragraphs , tables together. tables have heading text direct above them. nice keep if possible. there way programatically keep these items together? document being used done not have static verbiage or format. dynamically created , can different depending on circumstances. code being developed in .net 2.0 environment. public static void mergea(string[] filestomerge, string outputfilename, bool insertpagebreaks, bool pdf) { //object defaulttemplate = documenttemplate; object missing = system.type.missing; object pagebreak = microsoft.office.interop.word.wdbreaktype.wdpagebreak; object outputfile = outputfilename; object ofileformat = microsoft.office.interop.word.wdsavefor...

android - How to add an item to a scrollview from another activity? -

i want add item scrollview present in different activity second activity. have button in second activity , when button clicked want add item scrollview present in different activity. scrollview row consists of 2 textviews , button. problem each button in scrollview used different url. how can add these urls these buttons @ runtime. can suggest work around this? thank you. the scrollview activity created after click additem button few times. save "added data" class both activities can access. when scrollview activity launches, load current data. if you're keeping scrollview open in background, onresume still called, , can load current data there.

javascript - Undefined Returns on JSON Strings -

i wondering if able explain why of json returning undefined.. json question this {"273746":[{"name":"darius's wizards","tier":"gold","queue":"ranked_solo_5x5","entries":[{"playerorteamid":"273746","playerorteamname":"magnanimous","division":"v","leaguepoints":0,"wins":19,"losses":15,"ishotstreak":false,"isveteran":false,"isfreshblood":false,"isinactive":false}]}]} and javascript i've got run through is: note: in code provided /sumid 273746 , s 'oce' due riot api guidelines can't give direct link api had paste in above. function statslookup(i,s) { $.ajax({ url: 'https://oce.api.pvp.net/api/lol/' + s + '/v2.5/league/by-summoner/' + + '/entry?api_key=', type: 'get', datatype: 'json', ...

R: split data based on a factor, add a ranking column and extract -

i still haven't been able know how can access different elements of split data. here problem: have data set, want split based on column (state). want have ranking column added data each subset. part of function i'm writing. data set has 2 columns, hospital, state, outcome. each state, want add 'rank' column ranks data based on outcome; lowest outcome ranked 1 , highest outcome ranked last. how can use split, sapply/lapply this? there better way, using "arrange"? main problem when use either of these methods, not know how access each element of split or arranged data. here's how data set looks like: hospital state outcome. row lines not important here. hospital state outcome 1 southeast alabama medical center al 14.3 2 marshall medical center south al 18.5 3 eliza coffee memorial hospital tx 18.1 7 st vincent's east tx 17.7 8 dekalb regional medical center al ...

php - cannot install sample data with the installation of opensis -

currently i'm trying install opensis installation failed in step 3 after choosing **install sample data** the installation continue if choose not install sample data "other configuration" should done. working on xampp, mysql, php 5.5.24, windows 7 thanks