Posts

Showing posts from August, 2011

How to see what mapping for a particular key in vim? -

i know <leader>a mapped in vim. there command know this? use :map <leader>a list of mappings having specific prefix. from :h :map list key mappings modes map command applies. note ":map" , ":map!" used often, because include other modes.

java - ArrayList sent to server: Data retrieval -

in android application have arraylist is: [1, 2, 8] i sending array list in job backed django view, need process further. so calling tostring() method convert string , send server. inside view on getting parameter request , on trying print have received get: [1, 2, 8] . but on trying 1st element, calling varialble[0] getting: [ , on calling variable[1] getting 1 . i want extract numbers variable , use them further processing. going wrong? when convert arraylist values string, '[' treated string in convesrsion. u may use json kind of object using javascript , append request parameters. in django, can use dictionaries parse json data key-value pairs.

java - Transactional error while commiting -

i trying solve error in payara41 server java ee 7, sample works on wildfly-9 java 7 ee , on glassfish-3.1 java ee 6 (without @transactional , @transactionalmanagement ) @stateful @transactional //default txtype.required @transactionmanagement(transactionmanagementtype.bean) public class improvementdaoimpl extends abstractbasedaoclass implements improvementdao { /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @persistencecontext(unitname = "pu", type = persistencecontexttype.extended) private entitymanager em; @resource private usertransaction tx; ... } here's stacktrace, apperas after executing tx.flush(); : javax.transaction.transactionalexception: managed bean transactional annotation , txtype of required encountered exception during commit javax.transaction.rollbackexception: transaction marked rollback. (...) caused by: javax.transaction.rollbackexception: transaction mar

php - How to add multiple limits in mysql query? -

i want select sum of last 200,100 , 50 rows of close price table in single query. given below query 200 rows. select sum(close_price) tot200 cash_data order date_added limit 0,200 can me this. you can use sub queries - select (select sum(close_price) cash_data order date_added limit 0,200) tot200, (select sum(close_price) cash_data order date_added limit 0,100) tot100, (select sum(close_price) cash_data order date_added limit 0,50) tot50

In R, how do I use stub to create names (of data frames, variables & plots) in a loop? -

i'm working set of results of inla package in r. these results stored in objects meaningful names can have, instance, model_a , model_b ... in current environment. each of these models i'd several processing tasks including extracting of data separate data frame, can used merge spatial data create map, etc. turning simpler, reproducible example let's assume 2 results ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group <- gl(2, 10, 20, labels = c("ctl","trt")) weight <- c(ctl, trt) model_a <- lm(weight ~ group) model_b <- lm(weight ~ group - 1) i can handle steps individual model, instance: model_a_sum <- data.frame(var = character(1), model_a_value = numeric(1)) model_a_sum$var <- "intercept" model_a_sum$model_a_value <- model_a$coefficients[1] png("model_a_plot.png") plot(model_a, las = 1) dev.off() now, i'd reuse

javascript - typed.js doesn't work for the second attempt -

the first attempt hover div.logo finish , typed.js types sentence. after that, when hover again on div.logo doesn't work , doesn't type anything. <script type="text/javascript"> $( ".logo" ).hover(function() { $(this).toggleclass("clicked"); if ($('.logo').hasclass('clicked')){ $(function(){ $('.logo').css('background-position','-20vmin center'); console.log("n"); $(".logo h3").typed({ strings: ["phoenix ^250 programming ^250 team"], typespeed: 75 }); }); } else{ $('.logo').find( "h3" ).text(""); $('.logo span').remove(); $('.logo').css('background-position','center left+1.5vmin'); } })

c# - How to use session in apicontroller in asp.net mvc 4 -

i working on application using asp.net mvc 4 . here want use autocomplete extender using jquery want populate location of cityid stored in session. here function creating session: public string create(string city) { try { //httpsessionstatebase session["c"]=city; //httpcontext.current.session["city"] = city; system.web.httpcontext.current.session["city"] = city; long cityid = convert.toint64(system.web.httpcontext.current.session["city"].tostring()); return city; } catch (exception ex) { throw (ex); } } this function called when user select city city dropdownlist . my jquery calling autocomplete extender is: <script type="text/javascript"> var url = '@url.routeurl("defaultapi", new { httproute = "", controller = "productapi" })'; $('#txtlocation').autocomplete({ source: function (request, resp

r - Input ID not initialized when defined within conditionalPanel -

in sidebar of shiny app, looking offer filtering values of variable when checkbox activating filter has been checked before. trying implement follows: checkboxinput("filterbydistrict", "activate filtering district", false), conditionalpanel( condition = "input.filterbydistrict == true", checkboxgroupinput( "districts", label = "choose district:", choices = choiceslist, selected = choiceslist ) ) what found districts input variable never gets initiated. using on server side, check existence fails: ... if(exists(input$districts)) { ... what missing/doing wrong? your input defined, exists doesn't work list elements, try : "districts" %in% names(input) # or !is.null(input$districts)

php - Updating Database And Query Based On Location -

for last few days i've been trying fix code in android can onlocationchanged () send new latitude , longitude database , when it's updated want query based on location. i'm having trouble doing android , wondering if there way "combine" 2 php codes use updating , querying database. both codes work separately, can combined? need database updated new data , query or vice versa. update.php $latitude1 = $_post["latitude"]; $longitude1 = $_post["longitude"]; $username = $_post["username"]; $updatequery = mysqli_prepare($con , "update users set latitude = ?, longitude = ? username = ?"); mysqli_stmt_bind_param($updatequery ,"dds",$latitude1,$longitude1,$username); mysqli_stmt_execute($updatequery); mysqli_stmt_close($updatequery); mysqli_close($con); querybylocation.php $origlat = $_post["latitude"]; $origlon = $_post["longitude"]; $dist = 30; $id = $_post["id"]; if(mysqli_con

java - Perspective not loading in RCP when tried more than one -

i creating rcp application. have view class newview. public class newview extends viewpart { private databindingcontext m_bindingcontext; public static final string id = "com.app.editor.newview"; savenewfilebean bean = new savenewfilebean(); private styledtext text; public newview() { } @override public void createpartcontrol(composite parent) { text = new styledtext(parent, swt.border); m_bindingcontext = initdatabindings(); } public string returntext(){ string textdata = bean.gettext(); return textdata; } @override public void setfocus() { } protected databindingcontext initdatabindings() { databindingcontext bindingcontext = new databindingcontext(); // iobservablevalue observetexttextobservewidget = widgetproperties.text(swt.modify).observe(text); iobservablevalue textbeanobservevalue = pojoproperties.value("text").observe(bean

c++ - Member Variable vs. Function Argument -

i´ve tried figure out if faster give function argument or use member variables. have following code. class variable { private: public: variable() {} ~variable() {} struct { static const int test = 3; }testvar; }; class variabletransmit { private: variable var; public: variabletransmit() {} ~variabletransmit() {} void testfunc1(int test) { int foo = 2; foo = test; } void testfunc2() { int foo = 2; foo = var.testvar.test; } }; struct { static const int test = 3; }extvar; int main(void) { variabletransmit transmit; clock_t prgstart, prgend; prgstart = clock(); for(int = 0; <= 10000000; i++) { transmit.testfunc1(extvar.test); } prgend = clock(); printf("delivered: %.5f seconds\n\n", (float)(prgend - prgstart) / clocks_per_sec);

apache - How post file to android HttpUrlConnection internal server 500 -

i trying upload image server via httpurlconnection it's not working. return internal server 500 anyone can me? thats postman captures 1: http://i62.tinypic.com/6e279j.png 2: http://oi62.tinypic.com/6e279j.jpg and code block url = new url(urls[0]); // post header file image = new file(outfile); httpurlconnection con = (httpurlconnection) url.openconnection(); con.setdoinput(true); con.setdooutput(true); con.setrequestmethod("post"); con.setrequestproperty("connection", "keep-alive"); con.setrequestproperty("apikey", apikey); con.setrequestproperty("authkey", authkey); con.setrequestproperty("content-disposition","form-data; name=\"fileupload\"filename="+image.getname()); con.setrequestproperty(&qu

mongoc: Do not get $unwind to work with mongoDB c driver -

i have documents using array of subdocuments "c". { "_id" : 1, "c" : [ { "p" : { "name" : "simplegroup" } }, { "p" : { "name" : "simplegroup2" } } ] } running db.collection.aggregate([ { "$unwind" : "$c" }, { "$project" : { "name" : "$c.p.name" } } ]) works fine in command line. if build same pipeline using mongoc driver looks $unwind entry ignored. #include <bson.h> #include <mongoc.h> bson_t pipeline; bson_init(&pipeline); bson_t pipearr, pipeelem1, pipeelem2; bson_append_array_begin(&pipeline, "pipeline", -1, &pipearr); bson_append_document_begin(&pipearr, "0", -1, &pipeelem1); bson_append_utf8(&pipeelem1, "$unwind", -1, "$c", -1); bson

javascript - Stick 20% image at the Top while scrolling -

Image
i have bootstrap modal window, consisting of: an image , list down comments on image.(scrollable overflow:auto ) the modal window has add comment textarea @ bottom. i want acheive following functionality: when comment section scrolled up, wanted stick bottom 20% of image on top , scroll comments below please refer fiddle: http://jsfiddle.net/9u9mztqs/1/ images reference so, created fiddle doing job, not beautiful yet...this job ;) http://jsfiddle.net/9u9mztqs/2/ i hope solve problem. if (windowpos == 0) { s.removeclass('stick_in'); s.addclass('stick_out');} } the image resized scrolling top. of course can insert value want here.

kendo bar chart ordering issue -

i have kendo barchart , data model , bind char. problem here unable sort order. pasting code below. todat certification time coming in between.any on highly appreciated. var certdata = [{"ironcount":1.65,"typewisedata":"adapter","testtype":"magnetic particle test"},{"ironcount":2.76,"typewisedata":"adapter","testtype":"ut thickness test"},{"ironcount":140.37,"typewisedata":"adapter","testtype":"totalcertificationtime"},{"ironcount":2.02,"typewisedata":"swivel","testtype":"ut thickness test"},{"ironcount":2.06,"typewisedata":"swivel","testtype":"magnetic particle test"},{"ironcount":142.67,"typewisedata":"swivel","testtype":"totalcertificationtime"}]; var dscertpdata = new kendo.data.

cuda - Caffe using GPU with NVidia Quadro 2200 -

i'm using deep learning framework caffe on ubuntu 14.04 machine. compiled cafe cpu_only option, i.e. disabled gpu , cuda usage. have nvidia quadro k2200 graphics card , cuda version 5.5. i know if possible use caffe cuda enabled gpu. on nvidia page, written quadro k2200 has compute capability of 5.0. mean can use cuda versions release 5.0? when possible use caffe gpu-enabled quadro k2200, how can choose appropriate cuda version that? cuda version not same thing compute capability. one, cuda current (7.5 prerelease), while cc @ 5.2. k2200 supports cc 5.0. the difference: cuda version means library/toolkit/sdk/etc version. should use highest 1 available. compute capability gpu's capability perform instructions, etc. every cuda function has minimum cc requirement. when write cuda program, it's cc requirement maximum of requirements of features used. that said, i've no idea caffe is, quick search shows require cc of 2.0, should go. cc 5.0 pretty

java - Mapstruct: mapping of Generics -

@mapper public interface mymapper<x extends base_1, y extends base_2>{ public x mapbase_2tobase_1(y obj); } i want map object of generic type y object of generic type x . possible mapstruct? or have write custom mappers generic mapping? when compile code above, compilation errors. caused by: java.lang.nullpointerexception @ org.mapstruct.ap.util.specificcompilerworkarounds.replacetypeelementifnecessary(specificcompilerworkarounds.java:90) @ org.mapstruct.ap.util.executables.getallenclosedexecutableelements(executables.java:189) @ org.mapstruct.ap.model.common.type.getallexecutables(type.java:395) @ org.mapstruct.ap.model.common.type.getsetters(type.java:464) @ org.mapstruct.ap.model.common.type.getpropertywriteaccessors(type.java:353) @ org.mapstruct.ap.model.beanmappingmethod$builder.soucemethod(beanmappingmethod.java:93) @ org.mapstruct.ap.processor.mappercreationprocessor.getmappingmethods(mappercreationprocessor.java:345) @ org.map

otp - implementation of TOTP using C and Gcrypt -

i'm trying implement simple totp client using c , libgcrypt. i've read both rfc 6238 , rfc 4226 still have problems result. #include <stdio.h> #include <time.h> #include <string.h> #include <gcrypt.h> int digits_power[] = {1,10,100,1000,10000,100000,1000000,10000000,100000000}; int truncate (unsigned char *hmac, int n) { // uint64_t o = least_four_significant_bits_hmac; int o = (hmac[19] & 0x0f); int bin_code = ((hmac[o] & 0x7f) << 24) | ((hmac[o+1] & 0xff) << 16) | ((hmac[o+2] & 0xff) << 8) | ((hmac[o+3] & 0xff)); printf("%d\n", bin_code); int token = bin_code % digits_power[n]; return token; } unsigned char *hmac (char *k, long c) { // k key, c message unsigned char *buffer = (unsigned char *)&c; gcry_md_hd_t hd; gcry_md_open (&hd, gcry_md_sha1, gcry_md_flag_hmac); gcry_md_setkey (hd, k, strlen(k)); gcry_md_write (hd, buffer, 4); // 4 bec

javascript - A "like" button similar to one in INSTAGRAM -

so thing working on sort of e-commerce website , here users "like" or "unlike" items have bought. looking button 1 in instagram - heart shape when clicked turns red , shows slight animation during transition. i using glyphicon in bootstrap, smiley one, , using background-color:yellow; glyphicon changes color of square inside icon resides. i not great @ jquery , stuff hoping achieve in css if possible. or should go 2 different images. in plane css, persistens changes - means click somethin, changes apperance , never changes - not possible. in css effect on hover, disappear when mouse stops hovering "heart". recommend using jquery, simple use , makes first step sometimes, wont regret having bit of experience it. in jquery apply .click() event button , if gets triggered, use .animate() enlarge , change background-color in lets 200ms transition , enlargement in reverse, animate() . thats prettiest , easiest way it, if want create e-co

c# - Programmatically enable (install) IIS -

Image
sometimes there pc doesn't have iis. either disabled or either not installed. in case need enable myself according steps . i'm trying create application check if iis enabled (installed), , if not enable (install) it. i tried install iis using .msi files here , asking me follow those stpes before installation. i tried use advanced installer apparently installing iis 8.0 express still keeps iis disabled. what need enable iis programmatically? acceptable if i'll need run iis installation file make done (i didn't find right one). you can install iis via command line. following command install iis on windows 8 (you can edit add/remove features. it's command i've used in past): pkgmgr: start /w pkgmgr /iu:iis-webserverrole;iis-webserver;iis-commonhttpfeatures;iis-staticcontent;iis-defaultdocument;iis-directorybrowsing;iis-httperrors;iis-applicationdevelopment;iis-isapiextensions;iis-isapifilter;iis-netfxextensibility45;iis-aspnet45;iis-net

ios - Adding two shadows to a UILabel -

Image
i have uilabel want add 2 shadows. a black colored shadow, , white colored one. one has -1 y-offset, , other has 1 y-offset. - (void)layoutsubviews{ [super layoutsubviews]; self.sectiontitlelabel.layer.shadowcolor = [[uicolor whitecolor] cgcolor]; self.sectiontitlelabel.layer.shadowradius = 0.0f; self.sectiontitlelabel.layer.shadowopacity = .2; self.sectiontitlelabel.layer.shadowoffset = cgsizemake(0.f, -1.f); calayer *blackshadow = [[calayer alloc] initwithlayer:self.sectiontitlelabel.layer]; blackshadow.shadowcolor = [[uicolor blackcolor] cgcolor]; blackshadow.shadowradius = 0.0f; blackshadow.shadowopacity = .4; blackshadow.shadowoffset = cgsizemake(0.f, 1.f); [self.sectiontitlelabel.layer addsublayer:blackshadow]; self.sectiontitlelabel.layer.maskstobounds = no; } with white shadow appears, black 1 not. i don't understand mean "two shadows uilabel" hope can help. if on picture can see want, happy

A utility library with primitive types tryParse methods in java? -

in java when parsing date or int or primitive type string, needs done in try catch because parseexception occur. nice if there method tryparse did not throw exception rather returns true or false if string or not parsed. there few examples online describe writing utility function parsing int. believe necessary few more types: int, long, date, etc...because such common problem wondering there utility library has these tryparse methods primitive types? apache commons lang has classes tasks. numberutils has methods: isnumber - checks whether string valid java number. isparsable - checks whether given string parsable number. dateutils contains method parsedate can used implement isparsable method dates, according needs. you can use these classes implement own simple framework avoid parseexceptions in code.

vba - How to make a ScrollBar visible on a chart in Visual Basic forms -

i have chart needs scrollbar. funny thing scrollbar there, not visible. can interact on bottom of chart , functions ok. isn't visible. anyhow here code... 'ch chart ch.chartareas(0) .axisx .minimum = chartmin .maximum = chartmax .interval = 1 .scaleview.size = chartrows .scaleview.position = chartmax .scrollbar .size = 20 .buttonstyle = scrollbarbuttonstyles.smallscroll .ispositionedinside = true .enabled = true .backcolor = color.lightgray .buttoncolor = color.gray end end .recalculateaxesscale() end in code not shown x axes disabled. still doesn't explain why interact invisible scroll bar working now.

google app engine - Connecting AppEngine Module to a custom DNS -

i've been having troubles trying connect module custom domain. i works on appspot domain not on custom domain. e.g. http://m.myappname.appspot.com calls dispatch.yaml file routes request mobile frontend but http://m.myappcustomdomain.com serves default module (app.yaml) any highly appreciated. thanks you entry in dispatch.yaml file: - url: "m.myappcustomdomain.com/*" module: your_mobile_module

Is there a function in OpenCV that does same function as Matlab Vision.blobAnalysis()? -

our target linux on embedded system cannot run matlab. have computer vision matlab script prototypes, , want functionality (vision.blobanalysis) ported embedded. two options: use matlab coder port matlab computer vision functionality embedded, or reproduce functionality using opencv on embedded system. try simple blob detector: using namespace cv; // read image mat im = imread( "blob.jpg", imread_grayscale ); // set detector default parameters. simpleblobdetector detector; // detect blobs. std::vector<keypoint> keypoints; detector.detect( im, keypoints); // draw detected blobs red circles. // drawmatchesflags::draw_rich_keypoints flag ensures size of circle corresponds size of blob mat im_with_keypoints; drawkeypoints( im, keypoints, im_with_keypoints, scalar(0,0,255), drawmatchesflags::draw_rich_keypoints ); // show blobs imshow("keypoints", im_with_keypoints ); waitkey(0);

c# - How to run Firebird embedded database with ASP.NET 5? -

Image
i trying run firebird embedded database mvc 6 application. using fluent nhibernate. configuration shown below: var firebird = new firebirdconfiguration(); var cs = @"user=sysdba;password=masterkey;database=sampledatabase.fdb;datasource=localhost; port = 3050; dialect = 3; charset = none; role =; connection lifetime = 15; pooling = true; minpoolsize = 0; maxpoolsize = 50; packet size = 8192; servertype = 1; "; sessionfactory = fluently.configure() .mappings(m => m.fluentmappings.addfromassembly(assembly.getexecutingassembly())) .database(firebird.connectionstring(cs)).buildconfiguration() .buildsessionfactory(); i have installed nuget package firebirdsql.data.firebirdclient however getting error: unable load dll 'fbembed': specified module not found. i trying include dll in reference getting build error saying reference cannot restored. what need running ? p.s : have failed use sqlit

Cannot unregister functions from atexit in python 2.7 -

first, wrote recording class flush method: class recorder def __init__(self, buffer_size, path): self._big_buffer = np.array(*buffer_size) self._path = path def push(self, data): # insert in self._big_buffer # if self._big_buffer full: # self._flush() def flush(self): # write buffer disk (self._path) then, wanted flush @ exit: when manually stopped, crashed or whatever reason. so used: def __init__(self): (...) atexit.register(self.flush) and worked pretty well. but now, want record, stop recording, record again, multiple times, different buffer size , different path. have discard, instanciate several recorder . kind of works, older recorder 's memory (containing fat self._big_buffer̀ ) not freed since it's retained atexit . when explicitly call del . can't atexit.unregister(self._flush) since it's python 3 only. i prefer not reuse existing instances, discarding older instances ,

excel - IF and AND statement #value error -

i have spreadsheet list of dates this: date1 date2 date3 date4 date5 score 1/1/15 1/2/15 1/3/15 1/4/15 1/5/15 14 i want make column binary (1,0) if of dates 1-5 more 6 months today , if score less 15. i tried use if/and statement: =if(and(c2:c7>today()-180, v2<15),1,0) where c2:c7 range of dates, , v2 score. this pulling #value error. any help/pointers appreciated! lrk889, took formula , test , worked fine. value error when not press ctrl+shift+enter on array commands.

uwsgi - Override nginx request headers with uwsgi_pass -

is there way can nginx not forward specific request header uwsgi? i want enable nginx basic auth, if authorization header gets forwarded app breaks things (for reasons, won't go into). if simple proxy_pass able proxy_set_header authorization ""; don't think works uwsgi_pass , there's no equivalent uwsgi_set_header far can see. thanks. try hide header , ignore header directives: uwsgi_hide_header syntax: uwsgi_hide_header field; default: — context: http, server, location by default, nginx not pass header fields “status” , “x-accel-...” response of uwsgi server client. uwsgi_hide_header directive sets additional fields not passed. if, on contrary, passing of fields needs permitted, uwsgi_pass_header directive can used. uwsgi_ignore_headers syntax: uwsgi_ignore_headers field ...; default: — context: http, server, location disables processing of response header fields uwsgi server. following fie

visual studio 2012 - VS2012 SSRS Cannot See Data Fields -

Image
i have vs2012 ssrs report project shared data set. data set being created sql stored proc. used use vs2008, , of available data fields show below data set, however, in vs2012 cannot figure out how them show. i've removed data set, , added back, i've removed datasource , added back, nothing works. the original report file built in vs2008, , converted vs2012 project. not sure if contributing problem. thank you. your screen shot shows solution explorer pane. data fields never appeared in pane, in version of ssrs. i suspect looking report data pane, should find on view menu https://msdn.microsoft.com/en-us/library/cc627528(v=sql.120).aspx

regex - Java Reg accepts * which is not in [0-9]*[ -/]{0,1}[0-9]* - is it a bug? -

this question has answer here: how match hyphens regular expression? 6 answers the following regex [0-9]*[ -/]{0,1}[0-9]* matches e.g. 1*2 . the * not defined in regex , not intended; space before - needs not escaped (as far found out) if use 2 character of [ -/] , 1*2 not match. when change order e.g. [0-9]*[-/ ]{0,1}[0-9]* , 1*2 not matching (like expected). do miss or bug? i have behaviour java 7 , on http://www.regexplanet.com/advanced/java/index.html update regex used in bean validation @pattern(regexp = "[0-9] [ -/]{0,1}[0-9] "). [ -/] character class, , in character class, - range operator. "any character in range of characters 'space' 'slash', inclusive". that means uses ascii table (basically) match characters [space] , ! , " , # , $ etc... / . however, ranges work in postive directi

com - Cannot create VB6 ActiveX dll -

i trying create simple vb6 activex exe , call excel. in vb6 create activex dll project called bigtrev, using default settings. i create multiuse class called trev single method containing no code public sub helloworld() end sub i make dll , register command line (vb6 registers me did using cmd anyway). then excel create reference dll in new workbook. has been registered because intellisense knows trev , helloworld. sub cats() dim derek bigtrev.trev set derek = new bigtrev.trev derek.helloworld end sub it compiles in excel, when step through it fails in second line, set one. error message "activex component can't create object". why? have done or similar loads of times many years ago when vb6 used widely, using windows 7 , admin on box. i suggest registering dll (or exe if that's direction you've chosen) relevant regsvr32.exe. in case, you're registering 32bit dll use in 64bit environment, use 1 hiding out in c:\windo

cmake - How can I make a CMakeList.txt belong to certain target or a folder? -

i give following example illustrate question. projects have following structure: cmakelists.txt dir1 dir2 dir3 in cmakelists.txt, have following definitions: macro(obtain_sublist result _curdir) set(curdir ${${_curdir}}) file(glob children relative ${curdir} ${curdir}/*) set(dirlist "") foreach(child ${children}) if(is_directory ${curdir}/${child}) list(append dirlist ${child}) endif() endforeach() set(${result} ${dirlist}) endmacro() set(curdir ${cmake_current_source_dir}) obtain_sublist(subdir curdir) foreach(var ${subdir}) add_subdirectory(${var}) endforeach() within each subdirectories ( dir1, dir2 , dir3 ) targets built. when project built visual studio, can observe each target corresponding cmakelists.txt, used create target. however, top cmakelists.txt in example unseen in project not create target. there way include cmakelists.txt in project? if possible, can put in folder? thanks. it should appear in all_build

asp.net mvc - Exporting Umbraco Controllers -

i'm sure i'm missing obvious, can't locate answer anywhere online. i'm building webapi controller extending umbracoapicontroller. application works fine on local machine, want move our hosted uat platform. i've built solution locally can't see in bin folder dll has same name controller. so need copy controller , models folders uat platform, or dll contains (the controller lives in umbraco_dev.controllers namespace, umbraco_dev.dll need move) thanks is part of umbraco website? if so, it'll built main webite dll. the controllers won't built separate dll unless they're in own project.

c# - MEF plugin calling another plugin with same interface -

i trying make (my first mef) system in plugins can recursive, i.e. main system calls mef plugin standard interface, on own can call (or several) plugin(s), , on. when testing though, plugin not call underlying plugin, starts processing (creating loop). any idea how can prevent this? interface: public interface iconnector { xdocument run(object servicecredentials, object connectorids, object connectorkeys); } my main plugin inherits interface, , defines import next (the subplugin has same definition): [export(typeof(iconnector))] public class connector : iconnector { [import(typeof(iconnector))] private iconnector connector; .... the called plugin initiated (in run method of main plugin): public xdocument run(object servicecredentials, object connectorids, object connectorkeys) { string calledconnector = path.combine(assemblydirectory, "subplugin.dll"); assemblycatalog assembycatalog = new assemblycatalog(assembly.loadfrom(calledconn

vba - Command button in Excel to make a copy of a row of data and move that row to a different tab in the same workbook -

i trying command button placed on worksheet in excel transfer line of data different sheet based on field in field. example have data in row has 6 different fields , 1 names type. have worksheets have same names type options. want happen user press , update button , type each row located , row placed in worksheet corresponds type. dont know if possible. thanks in advance! bri brianna! try macro (copy , paste new module in vb editor), see if fits need; if it's good, create button, right-click it, "assign macro" select 'copyrow'. >sub copyrow() > > >dim originalsheet string >dim typecolumn integer >dim startingline integer >dim mytype string > >originalsheet = activesheet.name > >'edit number match column "type" information >typecolumn = 1 >'edit part match starting point of records >startingline = 3 > >cells(startingline, typecolumn).select > >counter = 0 > >do while ac

SWITCH function doesn't work in access sql -

with code below, i'm trying update table k_tables . column columntype doesn't have 0 or null values in it, after run script lot of null valued rows, , number of rows values (such bigint ) larger expected. update k_tables set columntype = switch( columntype = 'i8' , 'bigint', columntype = 'i' , 'integer', columntype = 'cf' , 'character', columntype = 'd' , 'decimal', columntype = 'i1' , 'byteint', columntype = 'i2' , 'smallint', columntype = 'da' , 'date', columntype = 'ts' , 'timestamp', columntype = 'cv' , 'varchar' ); is there wrong query? what results of this? select columntype, count(*) k_tables group columntype my guess there values in there not mentioned in switch

vim: get buffer number for unloaded buffer -

suppose have file c:/users/pedro/desktop/foo.txt . if open gvim , run :echo bufnr('c:/users/pedro/desktop/foo.txt') returns -1 since buffer not loaded. know can edit file (i.e run execute "edit " 'c:/users/pedro/desktop/foo.txt' ) , obtain buffer number bufnr() . however, editing file, become visible. question is: how can (or assign) buffer number buffer not loaded in vim without making visible? equivalently: there way load vim buffer without making visible? edit: know :hide problem not work on last window on screen. you can use :badd somefile add somefile buffer list without leaving current buffer. :argadd same argument list. see :help :badd , :help :argadd .

c++ - Cannot read image -

i'm trying read image using opencv , did following: input_image = imread(argv[1], imread_unchanged); if(input_image.empty()) { cout<<"image cannot read"; return -1; } i'm using xcode 6.4 , , pass two arguments, 1 input image , output image. so, did following in order pass argument: product --> scheme --> edit scheme... and, under arguments , added 2 arguments: image1.png , image2.png . i had image1.png , added directory containing main.cpp . but, when try run program, input image seems not read, since above if-statement evaluates true, , error message. why that? doing wrong? thanks.

c# - Sorting multiple collections of objects by looking at each object's own path -

Image
this code problem , it's killing me. can't figure out how ... find myself creating temp arrays hold references, loops in loops.. it's mess. the setup look @ image. have 3 collections (layers) cross-references between collections. the goal order somethings indicated arrows. however, c more important b more important (it's bottom-up importance). can change natural order following in different "layer". so desired order is: +----+----+----+---+---+---+---+---+----+----+----+---+---+---+---+ | 14 | 15 | 17 | 7 | 8 | 1 | 2 | 9 | 18 | 19 | 12 | 3 | 4 | 5 | 6 | +----+----+----+---+---+---+---+---+----+----+----+---+---+---+---+ you have few times before arrive @ same conclusion. let me break down you. we start in layer c (c outranks b , a, remember?) ... first column on left start column. have 14, 15 , 17. don't want 18, because 18 not have reference 17. move layer , start @ beginning again 7 , 8. ends there, since 9 not reference 8. we mov

ruby - Updating the attributes in the rails errors -

i looking update model errors hash rails sent humanized attributes name. example model called foo . have attribute called foo_nm . want translated foo_name when @foo.errors assuming @foo object of class foo. {"foo_nm"=>["can't blank"]} so far tried extend human_attribute_name following way humanized_attributes = { :foo_nm => "foo_name" } def self.human_attribute_name(attr, options={}) humanized_attributes[attr.to_sym] || super end but doesnt seem modify errors hash. ideas around on how can update errors hash appreciated can't inside locale files? # config/locales/en.yml en: hello: "hello world" activerecord: models: foo: "foo" attributes: foo_nm: "foo_name"

c# - Webgrid paging through generic controller method. -

i have generic method data grids in application, method gets data api , returns predefined grid populated said data. problem paging won't work - i.e. nothing happens - when have used method. i thought might down url paging link calling - i.e. generic method - without knowing other data needs sent. how can webgrid's pagination work generic method? generic method /// <summary>generic grid request method. used render grid data defined location.</summary> /// <param name="obj">the data required complete operation.</param> /// <param name="obj[dataurl]">the url used data grid.</param> /// <param name="obj[data]">any data needs sent data source when getting data grid.</param> /// <param name="obj[gridurl]">the url grid rendered.</param> /// <returns>the grid populated data in html format.</returns> [handleerror] [httppost] pub

gruntjs - Folder naming: src & dist vs. src & build, dev & dist -

question what preferred labelling method folders distinguish between raw assets , have been minified, concatenated etc. using task runner? i've seen bunch of combinations, popular ones being src , dist , src , build , dev , dist it's subjective, can want. tell mine "src : _build". of dev files contained within "src" directory, , else copies/builds "_build" directory. there no set standards. you can name concatenated files... reference them in layout file. example concat lib js files file named lib.min.js, used constructor function in app.js there nothing concatenate there, it's 1 file. same minified css files... lib.min.css, , app.min.css. i run htmlmin on _build directory. not sure question here, hope helps.

python - Strptime Weeks Error -

i'm writing scripts require manipulating week of year is. inputs in form yyyyww , such '201435' . during attempts use strptime it, reason, defaults first of year. example: import datetime test = '201435' test = datetime.datetime.strptime(test,'%y%u') print(test) outputs 2014-01-01 00:00:00 i'm not sure why it's doing so. using time module or replacing %u %w has exact same result. read note 6 in the documentation : when used strptime() method, %u , %w used in calculations when day of week , year specified. therefore, don't specify day in week, week number ignored , first of year. fix that, add day: >>> datetime.datetime.strptime('2014350', '%y%u%w') # ^ here ^ , here datetime.datetime(2014, 8, 31, 0, 0)

ssh - After the upgrade to TortoiseGit v1.8.15.0 and Git v2.5.0 hosts cannot be found -

Image
i've updated tortoisegit v1.7.* v1.8.15.0 , git 1.* v2.5.0.windows.1 . trying perform remote operation pull i'm getting errors: git.exe pull -v --progress "origin" unable open connection: host not existfatal: not read remote repository. please make sure have correct access rights , repository exists. git did not exit cleanly (exit code 1) (1747 ms @ 19.08.2015 18:43:33) i changed ssh client setting tortoisegitplink putty . didn't work well, putty error provided following information: unuble open connection github.com-foo host not exist i work aliases , ~/.ssh/config looks this: #github.com-foo account host github.com-foo hostname github.com user git identityfile ~/.ssh/id_rsa_foo #github.com-bar account host github.com-bar hostname github.com user git identityfile ~/.ssh/id_rsa_bar that worked before upgrade , still working in msys . tortoisegit seems ignore config . how make t

java - Spring MockMvc UnsupportedOperationException after upgrading to new spring version -

i'm working on migration spring 3.2.3.release spring 4.2.0.release. got stuck because existing tests start failing. code looks (simplified): @webappconfiguration @contextconfiguration(classes = [testconfig.class]) class mvctest extends specification { @autowired webapplicationcontext context mockmvc mockmvc @subject mycontroller controller def setup() { controller = new mycontroller() mockmvc = mockmvcbuilders.standalonesetup(controller).build() } def "should not allow save invalid entity"() { when: def result = mockmvc.perform(post("/people") .content('''{ "name": "", "age": 21, "sex": 1 }''')