Posts

Showing posts from June, 2012

eclipse - How to disable nodes in JFace CheckboxTreeViewer? -

how can disable tree node in checkboxtreeviewer ? want whenever parent selected in check box tree children should disabled , should not possible select. children should unselected if of them selected before disabling them. ways?? this isn't supported viewer. the best can use addcheckstatelistener method add icheckstatelistener reverses unwanted check actions.

google app engine - GAE Flexible Environment Service error in memcache -

i use jetty9-compat + java8 configuration , receive following exception. because of not able store objects in session, in end cannot log in service. [info] cze 28, 2016 11:17:56 com.google.apphosting.vmruntime.vmmetadatacache getmetadata [info] [info] info: meta-data 'attributes/gae_affinity' path retrieval error: metadata [info] [info] cze 28, 2016 11:17:56 com.google.apphosting.vmruntime.vmapiproxydelegate runsynccall [info] [info] info: http apiproxy i/o error memcache.get: target server failed respond [info] [info] cze 28, 2016 11:17:56 com.google.appengine.api.memcache.logandcontinueerrorhandler handleserviceerror [info] [info] info: service error in memcache [info] [info] com.google.appengine.api.memcache.memcacheserviceexception: rcp failure api call: memcache [info] [info] @ com.google.apphosting.vmruntime.vmapiproxydelegate.constructapiexception(vmapiproxydelegate.java:232) [info] [info] @ com.google.apphosting.vmruntime.vmapiproxydelegate.runsynccall(v...

c# - How can versioning be done in ASP.NET Core Web Api -

Image
in previous asp.net web api , implement defaulthttpcontrollerselector specify how want request locate controller. have different controllers different names intended same processes. difference 1 of higher version other. for example, have controller named bookingv1controller , meant handle version 1 of service. have bookingv2controller , designed handle version 2 of service. client application make request service url http://myservice.com/api/v2/booking/someaction?id=12 . handle request, provide custom implementation of defaulthttpcontrollerselector select appropriate version of controller required based on requested version. however, seems not have way in asp.net core . have searched everywhere no avail. no documentation either. i appreciate if can of me here. thanks. update know if version specified in custom header. e.g x-version:v1 update 2 the requirement version of service should not exposed in url. if no version present, service returns instruction on how add v...

Docker different digest when push same images with different tags -

i built 1 docker image 1 tag , tag new tag (both tags include registry url). i push first tag, second tag, push digest 2 tags different: 16:10:47 + docker build -t 10.88.102.47:8443/my-project/foo:jenkins-305 . ... 16:11:26 + docker tag 10.88.102.47:8443/my-project/foo:jenkins-305 10.88.102.47:8443/my-project/foo:latest 16:11:26 + docker push 10.88.102.47:8443/my-project/foo:jenkins-305 ... 16:11:34 jenkins-280: digest: sha256:22a4cd54bf43f03530c475832ca4432adfcf02c796e9c1cdafea72cf07ce7bf4 size: 3654 16:11:35 + docker push 10.88.102.47:8443/my-project/foo:latest ... 16:11:36 latest: digest: sha256:ccb4e8c41339b1a5d780cc5d28064cabf839657617a9c1e1d14eaee507405b20 size: 3632 pushing tag jenkins-305 - digest 22a4cd54bf43f03530c475832ca4432adfcf02c796e9c1cdafea72cf07ce7bf4 pushing tag latest - digest ccb4e8c41339b1a5d780cc5d28064cabf839657617a9c1e1d14eaee507405b20 shouldn't 2 digests of 2 tags same image identical? update i downloaded both tags on different machin...

c++ - std::enable_shared_from_this<> - missing is_shared()? -

shared_from_this() has undefined behavior if object not shared. but if shared, know relevant "control block" (effective modern c++, item 19). why std::enable_shared_from_this<> not add is_shared() function returns true or false, object shared or not? std::enable_shared_from_this<> seems introduce kind of dependency inversion. object depends on way used. is_shared() function @ least "adapt" mixed mode usage.

java - Issues in onBackpressed() -

actually issue when press button shows dialog , @ same time application finished without operation on key? can 1 solve this? @override public void onbackpressed() { super.onbackpressed(); alertdialog.builder ab = new alertdialog.builder(this); ab.setmessage("really want exit"); ab.setpositivebutton("yes", new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { finish(); } }); ab.setnegativebutton("no", new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { main.super.onbackpressed(); } }); ab.create(); ab.show(); } remove super.onbackpressed(); method, keep in onclick() only @override public void onbackpressed() { super.onbackpressed(); //remove } seems performing same operation in both buttons, should remove main.super.o...

sqlite - Is it possible to import more than one sqlite3 files from terminal? -

i have 2 databases use in sqlite. both in same folder in terminal. can import 1 command below. $sqlite3 first.sqlite3 and jumps sqlite> can see table 'first' , content. however, import second database sqlite. try sqlite> .import second.sqlite3 second sqlite> pragma table_info(second); it shows 0|sqlite format 3|text|0||0 , not give me table. when use sqlite> select * second; , shows col1 text, col2 text, col3 text, col4 text ) does know how solve this? appreciate help. thank much! i think need attach database : sqlite3 first.sqlite3 attach 'second.sqlite3' second;

python - A variable assigned to all rows of a column, enters a loop with only the value of the last row -

edit in code analysis.py have written, variable entropy column of data. when pass rows loop, last value considered: to run code, necessary 2 files in folder: pressure_enthalpy_all_points.dat : # pressure enthalpy 2 3 5 4 3.5 2 entropies_parsed.dat : # entropies 0.5 0.2 0.47 code analysis.py included nested loop comments: import numpy np pressure_gibbs = open('pressure_gibbs_all_points.dat', 'w') pressure_gibbs.write('#pressure gibbs\n') ## function: def g(h,s): # g = h - ts # then: gibbs = h - 298.15 * s/4.0 return gibbs open('entropies_parsed.dat') entropies_parsed, open('pressure_enthalpy_all_points.dat') enthalpy_pressure: # open file entropies_parsed.next() # skip first line enthalpy_pressure.next() line in entropies_parsed: # iterate on remaining lines entropy = float(line) line in enthalpy_pressure: pressure, enthalpy = [fl...

javascript - Align svg text inline with d3.js legend -

Image
i'm trying use susie lu's legend plugin . here plnk of work far; http://plnkr.co/edit/wrowpyu4paqwr8f5oojw?p=preview image below achieve (just layout, content/colour doesn't matter) i've tried standard float:left + display: inline on classes attached text/rectangles didn't work me. maybe making mistake. i'm not sure if should doing inside d3 script or in css file anyway? hope simple fix - appreciated! thanks those attributes ( float:left + display: inline ) work on html elements, legend library here produces svg it's possible, needs little bit of work http://plnkr.co/edit/yrfrwetmfdmje06mg5ky?p=preview var cells= d3.selectall(".cell"); var cellgap = legendlinear.shapewidth()+(legendlinear.shapepadding()/4); cells.select("text") .attr ("transform", "translate("+cellgap+" 13)") .style ("text-anchor", "start") ; var offset = 0; ...

javascript - handle collapsing html table by click on button and not by click to row -

i new javascript , set collapsing table below jquery. works. can expand or collapse complete table or expand , collapse columns clicking on row. but changes view setting options brs or set (see html). what want control button "+" in first column (see html). maybe it's simple maybe not. can me? thanks <!doctype html><html> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="/js/jquery.js"></script><script type="text/javascript"> $(document).ready(function() { $('.expandable').nextall('tr').each( function() { // hide @ start if(!($(this).is('.expandable'))) $(this).hide(); }); $('.expandable').click(function () { // toggle single click $(this).nextall('tr').each( function() { if($(this).is(...

hudson - How to set common workspace dir for multiple jobs in Jenkins? -

i'm trying migrate hudson jenkins , faced problem. of test jobs (huge number) using build -> invoke ant parameter build file relative path , same of them. should use same workspace directory. i've set in workspace root directory in jenkins configure system . example: real run.xml file location: c:\var\lib\jenkins\workspace\trunk\eb\run.xml workspace root directory: c:\var\lib\jenkins\workspace\trunk\ build file parameter (in job): eb\run.xml build fails with: error: unable find build script @ c:/var/lib/jenkins/workspace/trunk/workspace/run bd completedpath (firefox) ~regression/eb/run.xml as see jenkins adds job name anyway, path incorrect , build fails. if set absolute paths works fine, it's illogically , large number of copy-paste work. please sort out without modifying jobs, thanks! see shared workspace plugin : this plugin allows share workspaces jenkins jobs same scm repos.

ruby on rails - RuntimeError in Home#index -

Image
i new ruby on rails. have configured rails in system(windows 7). after creating new project in rails ( localhost:3000 ) working fine. try import bootstrap in rails project . kindly advise me how resolve case. c:\row\dev\mybootstrap>rails g controller home index c:\row\dev\mybootstrap>rails s its showing below error. go http://nodejs.org/download/ , install nodejs note: don't forget restart machine once nodejs installed.

Android: context.startActivity not start the intented activity after reboot, it just open the app -

i using 3rd-party library receive push notifications. successful make push service auto-start , receive messages after phone reboot. after reboot, click notification cannot open intented activity, open app. if have ever opened app before clicking notification, work well. here code start activity when click notification: intent = new intent(context, msgdetailactivity.class); i.putextra("msg_id", msgid); i.setflags(intent.flag_activity_new_task | intent.flag_activity_clear_top); context.startactivity(i); anyone can me? lot. edit when clicking notification, lib send broadcast. have registered receiver receive broadcast this: if (jpushinterface.action_notification_opened.equals(intent.getaction())){ //use code above open acticity } here test result: 1. reboot phone -> open app -> (exit app, or not) -> receive notification -> click notification -> open intented acticity (expected) 2. reboot phone -> receive notification -...

excel - Run time error 1004 when deleting a selected row -

i have below code deletes 3 lines within designated worksheet (finding ranges etc). code have used atleast year without issues. have transferred code new work book , set worksheet same previous workbook. the code errors highlighted below error message run-time error '1004' delete method of range class failed can suggest why error occur? sub deleterowpic() application.screenupdating = false application.calculation = xlmanual activesheet.unprotect password:="projects123" activesheet.range("total").select if selection.row = 12 else activesheet.range("total").select selection.offset(-2, 0).select activecell.entirerow.delete activesheet.range("total_1").select selection.offset(-2, 0).select activecell.entirerow.delete **error occurs here** activesheet.range("total_2").select selection.offset(-2, 0).select activecell.entirerow.delete end if range("k2").select application.calculation = xlautomatic activeshee...

c# - How to call an event from other page Windows Phone? -

i making upload app windows phone, function in class b (secondpage), have upload task, when task completed, call event , notice class (mainpage) task done , things, looking around site, found solutions don't (just think that). notify when event class triggered raise event of class different class in c# understanding events , event handlers in c# c# event handling (compared java) c#: need 1 of classes trigger event in class update text box here code in secondpage public sealed partial class secondpage : page { public event eventhandler clearhandler = delegate { }; public secondpage() { this.initializecomponent(); } protected override void onnavigatedto(navigationeventargs e) { } private void btnclear_tapped(object sender, tappedroutedeventargs e) { //some works if (clearhandler != null) clearhandler(this, null); } } in mainclass public sealed partial class mainpage : page { pu...

javascript throw and catch errors not displaying the expected result -

i have problem try , catch , throw errors. result getting way of mark. code. when type number greater 5 form field, instead of throwing high nothing displayed. , when typed in numbers less 5, shows high, instead of low. in fact of other if conditions does'nt display. except. empty , high. can explain such anomally? function myfunction() { var x, message; message = document.getelementbyid('para'); message.innerhtml = ''; x = document.getelementbyid('formfield').value; try { if (x == "") throw 'empty'; if (x == nan) throw 'not number'; x = number(x); if (x < 5) throw 'too low'; if (x > 5) throw 'too high'; } catch(err){ message.innerhtml = 'input ' + err; } } many of guys don't seem understand problem here code direct copy , paste w3schools. not working normally. various if statements supposed throw errors when value input match if statment. ...

php - How to implement 'rolling sessions' for an internal API? -

i have php cms internal rest api. user authenticates against api , gets both session id (via cookie) page views , jwt access token hitting api via ajax. the session can extended whilst user uses site. however, api, jwt token has fixed expiry, not 'rolled' session. is there simple secure way implement similar 'rolling' access token api, session id? i implement full blown oauth server, , issue refresh tokens well, ui of cms , private command line tool use api feels on kill @ moment....

office365 - How to add task in plan through Microsoft Graph API -

i want know how create task in planner plan using microsoft graph api. i'm trying crate task in planner plan using " create task " api, got unknownerror. { "error": { "code": "unknownerror", "message": "", "innererror": { "request-id": "2303b87d-fb0c-431c-9336-c93908758d25", "date": "2016-06-28t10:16:56" } } } as document described posted api this. post https://graph.microsoft.com/beta/tasks content-type: application/json content-length: 192 { "assignedto": "<i set uuid>", "planid": "<i set planid created>", "bucketid": "<i set bucketid included plan>", "title": "test4", "orderhint": "a" } any ideas i'm going wrong? if know how add task in planner plan, please share ide...

linker - C++ undefined symbol error with ForceFit -

trying launch software written in c++ (forcefit, https://aclark.chem.wsu.edu/software/ ) gives me following error: ./forcefit ./forcefit: symbol lookup error: ./forcefit: undefined symbol: _zn5gnome5glade3xml6createerkssrkn4glib7ustringes7_ i not have access raw code files, have searched several q/a forums giving me leads. understand it, error linked libraries. here have obtained far: ldd -d -r forcefit linux-vdso.so.1 (0x00007fff05fdf000) libgtkmm-2.4.so.1 => /lib64/libgtkmm-2.4.so.1 (0x00007f1081919000) libgdkmm-2.4.so.1 => /lib64/libgdkmm-2.4.so.1 (0x00007f10816c9000) libatkmm-1.6.so.1 => /lib64/libatkmm-1.6.so.1 (0x00007f108147b000) libgtk-x11-2.0.so.0 => /lib64/libgtk-x11-2.0.so.0 (0x00007f1080df0000) libpangomm-1.4.so.1 => /lib64/libpangomm-1.4.so.1 (0x00007f1080bc1000) libcairomm-1.0.so.1 => /lib64/libcairomm-1.0.so.1 (0x00007f108099a000) libglibmm-2.4.so.1 => /lib64/libglibmm-2.4.so.1 (0x00007f108071c000) libsigc-2.0.so.0 => /lib64/libsigc-2.0....

java - Adding jar files to codenameone in NetBeans -

i have android pos device that's equipped fingerprint scanner. have .jar library meant develop android apps access fingerprint component in device. included jar file in lib folder of netbeans codenameone project , in native/android directory. but when run application on device after building on build server, application throws noclassdeffounderror. class in jar file. you may need treat native interface, pretty easy. create interface of method signatures need, right click on it, , select generate native. in native sub folder there android directory. can drop jar file in there , in stub file ends "impl", implement interface methods call methods in jar. the downside of auto-code completion won't work. since you're using netbeans, if above should able compile cn1lib. can placed in libraries , code completion work. check developers guide in advanced topics under hood section, , there's tutorial video also.

javascript - Jquery: How to show date with textbox value? -

i newbie in jquery , wrote below code <h1>type comment below </h1> <h2>textbox value : <label id="msg"></label>-<label id="date"></label></h2> <div style="padding:16px;"> textbox : <input type="text" value="" placeholder="type comment"></input> </div> <button id="get">get textbox value</button> var fulldate = new date(); $("button").click(function(){ $('#msg').html($('input:text').val()); }); how display date when submit button press label have id="date" ? when user press submit button want display "user entered textbox value - date time" just use proper css selectors add messages , date. refer code below : $("button").click(function() { var msg = $('input:text').val(); var fulldate = new date(); $('#msg').ht...

javascript - MVC 5 JQ grid not loading the data -

i written below piece of code loading jq grid controller grid not loading value <script type="text/javascript"> $(this.document).ready(function () { debugger; $("#loadlogfile").jqgrid({ url: '/home/getresult', datatype: 'json', contenttype: "application/json; charset-utf-8", mtype: 'get', colname: ['log', 'name'], colmodel: [ { name: 'log', index: 'log', width: 20, stype: 'text' }, { name: 'name', index: 'name', width: 20, stype: 'text' } ], gridview: true, loadonce: true, viewrecords: true, rownum: 10, rowlist: [10, 20, 30], viewrecords: true, pager: '#pager', height: 'auto', width: '100%', autowidth: true, caption: "log file grid" }); ...

r - How do I pass raw JSON strings to the DeployR WebAPI? -

scenario: i have set of inputs need pass through deployr server. parameters simple strings others json strings converted r script calling fromjson. problem when pass simple string values server fine when try pass json formatted string server, script execution fails. script has been tested locally , using via r.net library works. unfortunately r.net not suite our use case need multi threading. example: var jsonstring = rdatafactory.createstring("jsondata", file.readalltext("data/jsondata.txt")); taskoptions.rinputs.add(jsonstring); //execute request .... where json data looks this //jsondata.txt {"id":77674,"name":"my company","currencysymbol":"r"} and r call failing is deployrinput('{ "name": "jsondata", "default": "", "render": "character" } ') mydata <- fromjson(jsondata) #everything disintegrates question: how pass r...

xslt - Created nested xml from flat xml -

okay , stuck. i'm trying recreate hierarchy flat xml file , don't know how proceed. xml file i'm working looks bit this: <table name="ecatalogue"> <tuple> <atom name="irn">2470</atom> <atom name="eadunitid"></atom> <atom name="eadunittitle"></atom> <atom name="eadlevelattribute"></atom> <tuple name="assparentobjectref"> </tuple> </tuple> <tuple> <atom name="irn">5416</atom> <atom name="eadunitid"></atom> <atom name="eadunittitle"></atom> <tuple name="assparentobjectref"> <atom name="irn">2470</atom> <atom name="eadunittitle"></atom> </tuple> </tuple> <tuple> <atom name="irn">7</atom> ...

BigQuery query doesn't work inside a view -

when select view i've created receive following error time time, not always: query: timestamp evaluation: connection error. (error code: invalidquery) job id vex-custom:bquijob_59705b02_155966ddc5f start time jun 28, 2016, 11:53:50 end time jun 28, 2016, 11:53:50 running query works well. there's 2 two special things query: it uses table_date_range it references tables project view resides. we've done lot of times without issues can google perhaps check job id? i checked internal details query. view failed query references makes few problematic calls timestamp functions. here's 1 example: select * table_date_range([...], timestamp(date_add(utc_usec_to_day(current_date()), -15, "day")), current_timestamp()) specifically, call timestamp(date_add(utc_usec_to_day(current_date()), -15, "day")) erroring because: utc_usec_to_day returns integer, not timestamp. date_add expects argument of type timestamp. you c...

configuration - LDAP federated users - automatic set Email Verified to true -

i got following problem keycloak: i have 2 user federation modules enabled : one default ldap federation (internal users) one custom written federation module database users (external users) i have "authentication" -> "required actions" -> "email validate" option enabled (i need email validation enabled newly registered users). the problem i need existing users obtained ldap (internal users) to skip email-validation step , couldn't find way work around. any ideas?

Rails assets, client requesting expired assets -

i have rails (4.1.5) app deployed on heroku , monitored newrelic. in last 24 hours site has gone having < 3% errors on newrelic having ~30% errors , errors requests expired javascript , css assets. have not deployed site in on month assets shouldn't have changed. my question two-fold; first, why getting load of requests expired asset? second, rails way handle request expired asset , redirect current asset?

java - Tomcat post special characters -

this question has answer here: java tomcat utf-8 encoding issue 2 answers how pass unicode characters jsp/servlet request.getparameter? 4 answers in maven project have html form post data httpservlet. on moment post special characters in html form (e.g. "jänsen", httpservlet receives "jänsen". i think need change settings utf-8 don't know have that... you can try configure org.apache.catalina.filters.setcharacterencodingfilter in web.xml next: <filter> <filter-name>set character encoding</filter-name> <filter-class>org.apache.catalina.filters.setcharacterencodingfilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>utf-8</param...

winforms - How can I prevent VS2013 catching COM Exceptions with Dragon Naturally Speaking running -

i have rsi, , when flares up, use dragon naturally speaking 12 home save me lot of typing. find accurate , rsi subsides when i'm not typing much. however, i'm using on windows 10 , developing winforms applications in visual studio 2013 . when running debugger attached, i'm getting lot of com exceptions. these occur in various places, when when toolstripmenu shown (when running nothing @ accesses com component), , have tracked down dragon. if dragon running, microphone switched off, exceptions occur, if switch dragon off, not . i used same combination of software on windows 7 last year , had none of these problems. rebooting makes no difference; nor starting visual studio either before or after starting dragon. i want avoid expense of moving later version of visual studio or dragon unless know problem solved @ later version. how can vs2013 prevented catching these exceptions? edit provide stack trace: system.runtime.interopservices.comexception cr...

c# - NuGet has problems with missing packages, how to restore? -

when try compile program following error: this project references nuget package(s) missing on computer. enable nuget package restore download them. more information, see http://go.microsoft.com/fwlink/?linkid=317567. now when right click on solution , press all packages installed , there nothing restore. i tried manually reinstalling every package didn't solve problem, tried reinstalling nuget didn't either , tried reinstalling visual studio. i tried moving package folder tfs folder overwrite package folder didn't solve anything. tried redownloading them package missing, didn' t solve problem either. anybody know how restore nuget packages? use package manager console in visual studio run command. 1.this restore packages solution nuget restore yoursolution.sln 2.if want reinstall packages same versions installed update-package -reinstall

html - Python selenium webdriver not consistently selecting element even though it's there -

i'm developing web scraper collect src link source tag in html file , add list. the site has video nested under load of divs, of pages come to: <video type="video/mp4" poster="someimagelink" preload="metadata" crossorigin="anonymous"> <source type="video/mp4" src="somemp4link"> </video> my current method logging site, going page links video pages, going each video page 1 one , trying find source tag , adding list. import time import requests bs4 import beautifulsoup selenium import webdriver browser = webdriver.firefox() # bunch of log in , list of video page links, works fine soup = beautifulsoup(browser.page_source) in range(3): browser.get(soup('a', {'class', 'subject__item'})[i]['href']) vsoup = beautifulsoup(browser.page_source) print(vsoup('source')) browser.get('pagewithvideopages') # doen't add list, goes v...

data structures - BST Insertion issue -

my code bst insertion getting passed 3 test cases , failing other 3 test cases, test case hidden can't figure out i'm going wrong logic. please check , advise me other different test case logic not pass. here's code: /* node defined typedef struct node { int data; node * left; node * right; }node; */ node * insert(node * root, int value) { node* n; n=root; if(n!=null) {while (true ) { if(n->data > value && n->left!=null){n=n->left;} else if(n->data < value && n->right!=null){n=root->right;} else { node* a=new node(); a->data=value; if(n->data > value ){ n->left=a;break; } else{ n->right=a;break; } } } } else {node* a=new node(); a->data=value; root=a; } return root; } i write node* insert(node * root, int value) { node* n= root; node* a=new node(); if( == null ) { c...

sql - UPLOAD statement with "dynamic" table and column names? (ORACLE/JDE) -

i know possible select statements ( in jdedwards have business function [c language] can select statements ), need make new function can make "dynamic upload". in case, i not have name of table nor columns , come external aplication, i'm not figuring out how it. i think may have problems type of columns. maybe fields too, seeing should pass fields in c code - other functions updates in tables have fields in main code, never coming external aplication. is possible? can me? thanks! in other words, third-party system defines (tables, data formats, data itself) update in jde? in case why need middleman, can update data in jde third-party system? trying create kind of integration platform jde?

version control - Importing a classic asp site into TFS -

how import legacy website team foundation server (2015)? a few websites classic asp , other websites static websites , documents. within collection admin there option add files... these listed in code window existing folder structure no longer maintained.... i want import exact copy of existing folder structure each website. even though import window shows list of files, imported structure in tact.

javascript - Voting system similar to SO in ASP.NET MVC -

i'm using asp.net mvc, , i'm trying build voting system, similar stackoverflow. i want when click on voteup button, make post on action, make checks there, remain on initial page, , increment vote (with js), if checks passed (just so). the items want vote populated index action view @using (html.beginform()) { @html.antiforgerytoken() <div><input type="submit" name="vote" value="&#xf106;" class="fa fa-angle-up"/> </div> <div>@html.displayfor(modelitem => item.votes)</div> <div><input type="submit" name="vote" value="&#xf107;" class="fa fa-angle-down" /></div> } action public actionresult sendvote(string vote) { var config = new mapperconfiguration(cfg => cfg.createmap<votelogviewmodel, votelog>()); var mapper = config.createmapper(); switch (vote) { case ...

ios - UIActivityViewController open list of navigation apps -

i want open list of navigation apps, if want post facebook,twitter etc, want open navigation apps install in phone google maps, ios map i searching hours same didn't find anything. my question is possible ? if yes please suggest me way thanks in advance unfortunately can't ask ios provide list of apps specific purpose. can create own custom activities specific app , show them if installed. for example jbwhatsappactivity ( https://github.com/jberlana/jbwhatsappactivity ). you can share custom content.

javascript - Ionic add tap/click event dynamically -

i have div added dynamically javascript framework. after done, want add ionic click/tap handler specific div. how can achieve this? <ul ng-click=function(){}> <my_generated_div></my_generated_div> </ul> you can add event listener using id or class: document.getelementbyid("yourdivid").addeventlistener("click", function(){ //your code }); or if have reference of object: yourobjectreference.addeventlistener("click", function(){ //your code });

android - How to fix Firebase storage error? -

so trying use firebase storage, , when copied , pasted these lines of code in dependencies: compile 'com.google.firebase:firebase-storage:9.2.0' compile 'com.google.firebase:firebase-auth:9.2.0' i build error states: error:(33, 13) failed resolve: com.google.firebase:firebase-storage:9.2.0 show in file show in project structure dialog and error:failed resolve: com.google.firebase:firebase-core:9.2.0 open file show in project structure dialog and error:(34, 13) failed resolve: com.google.firebase:firebase-auth:9.2.0 show in file show in project structure dialog here dependencies like. dependencies { compile filetree(dir: 'libs', include: ['*.jar']) testcompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:24.0.0-beta1' compile 'com.android.support:design:24.0.0-beta1' compile 'com.firebase:firebase-client-android:2.3.1' compile 'com.firebaseui:firebase-ui:0.3....

gcc - Not getting debugging symbols to be generated -

i using make , debugging symbols not getting generated. here makefile: program: ui.o data.o string.o c99 -ggdb -o program2 ui.o data.o string.o clean : rm -f program2 ui.o : ui.c data.h c99 -ggdb -c ui.c data.o : data.c data.h c99 -ggdb -c data.c string.o : string.c string.h c99 -ggdb -c string.c how can generate debugging symbols? when run gdb using gdb program2 gives warning "no debugging symbols found". your makefile builds program2 , pretends build program (i.e. target on first line wrong). your clean target should clean *.o , otherwise make clean; make relink program , not recompile objects in it. one of above factors explanation missing debug symbols you've observed.

python - Can't do migrations - ... has no field named 'questions' -

i'm trying figure out why django return's error when trying migrate after makemigrations . tried change related names , delete last migrations nothing works. maybe see what's problem? error after migrate: django.core.exceptions.fielddoesnotexist: languagequizsitting has no field named 'questions' models.py from django.db import models solutionsforlanguagesapp import models sfl_models jsonfield import jsonfield import random class languagequiz(models.model): name = models.charfield(max_length=40) language = models.onetoonefield(sfl_models.language) class question(models.model): language_quiz = models.foreignkey(languagequiz,related_name='questions') text = models.textfield() class answer(models.model): question = models.foreignkey(question,related_name='answers') text = models.textfield() correct = models.booleanfield() class languagequizsitting(models.model): user = models.onetoonefield(sfl_models.use...

gradle - Jacoco coverage doesn't work with latest android plugin -

im getting below error after updating gradle android plugin. execution failed task ':app:jacocotestreport'. unable read execution data file app/build/outputs/code-coverage/connected/coverage.ec jacoco version = "0.7.6.201602180812" android plugin version: 'com.android.tools.build:gradle:2.1.0' is there problem latest plugin? try changing version toolversion = "0.7.4+". worked me.

python - How to calculate distance between 2D matrices -

hello community, i'm new (as member) site, if think might better post on http://datascience.stackexchange.com , let me know. i tackling machine learning problem requires calculate distance between nxm-dimensional elements, in order implement classification algorithms. the element's attribute 2d matrix ( matr ), i'm searching best algorithm calculate distance between 2d matrices. see bellow "easy" solution convert 2d 1d (vector) , implement distance algorithm, i'm searching more convenient (if exists). so far have used following approaches: euclidean distance between each element. import numpy np def dist_euclidean(elem1, elem2): t_sum=0 in range(len(elem1.matr)): j in range(len(elem1.matr[0])): t_sum+= np.square(elem1.matr[i][j]-elem2.matr[i][j]) return np.sqrt(t_sum) cosine similarity, in had convert (nxm) 2d matrix (1xnm) vector. from scipy.spatial import distance def dist_cosine(elem1, elem2): te...

typescript - Angular2 sidenav with collapsible list: keeping only one sublist open -

i have working sidenav demo here using angular 2, typescript, , material design components. on sidenav there ul, , sites , users anchors in ul expand show own sub-list. plunker here here's html of sidenav: <md-sidenav #start mode="over" class="sidedrawer"> <ul class="sidenav"> <li><a>dashboard</a></li> <li> <a (click)="sidenavclick()">sites</a> <div> <ul *ngif="clickedsites" class="sublist"> <li><a (click)='sidenavalert()'>all sites</a></li> <li><a>site groups</a></li> </ul> </div> </li> <li> <a (click)="sidenavclickuser()">users</a> <div> <ul *ngif="clickedusers" class="sublist"...