Posts

xml - How to access an attribute with a computed name -

i want read value of attribute using variable compute name: <xsl:variable name="topman"> <xsl:for-each select="//all_resources/*/*/*"> <xsl:if test="contains(@name,'chan' )"> <xsl:variable name="element_name" select="name(..)"/> <xsl:variable name="fchansub" select="(//all_resources/*/*[$element_name = name()]/@usedele)"/> <xsl:value-of select="(//all_resources/*[(substring-before($element_name, '_')) = name()]/@[(concat('neibr_', $fchansub)) = name()])"/> </xsl:if> </xsl:for-each> </xsl:variable> there problem line 6. reading value correct. basically, having structure neibr_hm1, neibr_nr, etc.. want read value in neibr_(hm1 or nr). without seeing input or expected output can't 100% sure, think you're pretty close: change @[(concat('nei...

open in WebView instead of deep link on iOS -

my iphone app has webview may show url registered 1 of installed applications (e.g. yelp). want page open in app. actually, don't care if further links switch app, first view should remain within our app. i can find app-specific workarounds, https://stackoverflow.com/questions/29587313 pinterest, looking fo generic solution. you can use same solution suggested in link posted app-specific workarounds, block links not http or https: nsurl *url = [request url]; if (![url.scheme isequal:@"http"] && ![url.scheme isequal:@"https"]) { return no; } if there other schemes support, add them statement.

How can I modify part of a url when using Python Requests? -

how can automatically increment day in url? reportdate = "https://secure.logmeinrescue.com/api/setreportdate.aspx?bdate=06/25/2015&edate=06/23/2015&authcode=secretauthcode" setreportdate = requests.get(reportdate) requests doesn't have url editing functionality. parse url manually urlparse , splitting query params, getting date , incrementing datetime , rebuild string pass requests.

swift - How to add a notification? -

i want add local notification in project. in detailviewcontroller , have 2 labels date , hour . is possible add notification based on date , hour ? if yes, can explain how set it? code: detailviewcontroller : import uikit class detailviewcontroller: uiviewcontroller, uitableviewdatasource, uitableviewdelegate { // mark: - outlet @iboutlet var imageprofilo: uiimageview! @iboutlet var labelnome: uilabel! @iboutlet var pillstable: uitableview! // mark: - variabili var profilo: profilomodel! // mark: - metodi standard del controller override func viewdidload() { super.viewdidload() pillstable.datasource = self pillstable.delegate = self imageprofilo.layer.cornerradius = 30 datamanager.sharedinstance.detail = self if let test = profilo { //title = profilo!.nome labelnome.text = profilo!.nome imageprofilo.image = profilo!.immagine if profilo!.immagine.size.width > profilo!.immagine.size.height { imagepr...

How to setup cloud9-ide to reference other Javascript files? -

i can't cloud9 reference functions/variables in other files. example set simple html5-app: <!doctype html> <html> <head> <title>testapp</title> </head> <body> <div id="menucontainer"></div> <script type="text/javascript" src="js/lib.js"></script> <script type="text/javascript" src="js/main.js"></script> </body> </html> see, reference objects in lib.js within main.js: var menu=new lib.menu('menucontainer',{'file','edit','about'}); but cloud9 editor warns me, lib unknown variable (and of course code completion out of question). under visualstudio try enforce reference like: /// <reference path="js/lib.js" /> is similiar possible in cloud9? how set up? there isn't way cloud9 linter (cloud9 uses eslint lint javascript) know...

sql - Cannot create row of size greater than 8060 (a wierd case for this error message) -

i getting error "cannot create row of size 8766 greater allowable maximum row size of 8060." this happens in query has lot of columns, 300, of type "int" or "float". query calculates hrm report has 31 columns (one each day). posting query here take space, if insist, could. sure 300 columns of float (4 or 8 bytes) , varchars should never exceed 8060 bytes. still, error happens. problem is, happens in wierd way. in first level of query, looks this: select title, k0present, k1present, k2present, ht,k0_t, case when bla bla bla bla when bla bla bla bla end y01, case when bla bla bla bla when bla bla bla bla end y02 ... case when bla bla bla bla when bla bla bla bla end y31 (_inner_query_) order title now, inner query has 300 columns. here in outer query have 37 columns. causes error message. however, if change this: select *, case when bla bla bla bla when bla bla bla bla end y01, case when bla bla bla bla when bla bla bla bla end y02 ... ca...

angularjs - Parse $routeParams in the config object -

i trying dynamically set title each page of angular app. setting title of page in $routeprovider configuration so: angular.module('app.assets').config(['$routeprovider', function($routeprovider) { $routeprovider. when('/assets/:id', { templateurl: 'app/components/assets/views/view.tpl.html', controller: 'assetviewctrl', data : { pagetitle: 'assets:id' } }); }]); the problem page title 'assets:id' verbatim. possible parse value of 'id' similar first parameter of when ? i.e /assets/:id -> assets/1991 . instead of using data, might want resolve variables: when('/assets/:id', { templateurl: 'app/components/assets/views/view.tpl.html', controller: 'assetviewctrl', resolve: { data: ['$route', function($route){ ...