Posts

xml - Error: Invalid content was found starting with element -

i having trouble getting files validate. here errors getting. 4: 14 cvc-complex-type.2.4.a: invalid content found starting element 'airportlist'. 1 of '{"":airport}' expected. 47: 15 xml document structures must start , end within same entity. i post both xml document code , xsd schema below. i'm new this, i'm not sure i'm doing wrong. have changed formatting of files around still same errors. <?xml version="1.0"?> <airportlist xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nonamespaceschemalocation="simple_apoole33.xsd"> <airportlist> <airport> <name>abbotsford international airport</name> <community>abbotsford</community> <province>british columbia</province> <passengers>15</passengers> </airport> <airport> <name>atlin airport...

javascript - Render cherrypy's template with id/hash -

how render page , go specific id? right have following function code: @cherrypy.expose @require def page(): tmpl = lookup.get_template('page.html') return tmpl.render() however, page.html have several subpages, can access through url mydomain.com/page#someid . is there way render template go directly id? i think mixing ideas, # part of url client duty focus in specific element id. nevertheless, suppose want dynamically embed chunks of particular part of page trough javascript, can think on 2 possibilities: one, compose full page template different ids different sub-templates, easy if using template module, mako , , make cherrypy handler return indivudual parts, of course supposing in control of content of page , ids not dynamic (generated db or something) , main site bunch of includes . @cherrypy.expose def page_part(section): tpl_name = 'page_%s.html' % section # validate template exists, then: tmpl = lookup.get_template(t...

sql - Use the foreign key that a query selects to get data within the same query -

i have issue query trying build. idea have 3 tables 2 have foreign keys. want make query selects foreign key table , uses same key data key b. so this: select id, foreignkey1 tablea (select id tableb id = foreignkey1); but somehow not able or find documentation it. this simple inner join : select * tablea inner join tableb b on a.foreignkey1 = b.id

jquery - How to test notification implemented using signal r -

i have used signal r implement face book kind of notification in mvc 4 application. referring http://www.codeguru.com/csharp/.net/sending-notifications-using-asp.net-signalr.htm with generated proxy code. have notification count bubble (span) in lay out page , there add notification page have text box , button . on click of button calling hub method broadcast message.there sending notification client using client.all.briadcastnotification() i have 2 pages opened. 1 home page , add notification page have typed message broadcast.when clicked on send button notification count bubble(span) got updated on add notification page. in other page ((home page) notification count bubble(span) not getting updated. need update pages ?? also please me how can test whether notification message sending clients .i new signal r , mvc , stackoverflow well.

python 3: lists dont change their values -

so trying change bunch of list items random percentage using loop. import random rdm list = [1000, 100, 50, 25] def change(): item in list: item = item + item*rdm.uniform(-10, 10) change() print(list) (also dont how paste multiple lines of code did them 1 one, appreciate too) , when prints list consists of numbers started with. your item = .... line, stands, associates new object name item in function's namespace. there no reason why operation change content of list object previous value of item extracted. here listing changes list in-place: import random lyst = [1000,100,50,25] def change(lyst): i, item in enumerate(lyst): item = item + item * random.uniform(-10, 10) lyst[i] = item print(lyst) change(lyst) print(lyst) the lyst[i] = ... assignment key line changes list's content. of course can collapse 2 assignments 1 line if want: lyst[i] = item = ..... or can omit reassignment item if you're not going use aga...

sql - Missing keyword from SELECT CASE -

i unsure wrong sequence of case statements. have looked online , syntax seems correct getting error missing keyword. appreciated! case when = '1' when sequence_number = 5 9 when sequence_number = 6 9 end when = '2' when sequence_number = 5 9 when sequence_number = 6 9 end when = '3' when sequence_number =7 9 when sequence_number =8 9 end else t.number end number the simplest option seem be: case when (a in (1,2) , sequence_number in (5,6)) or (a in (3 ) , sequence_number in (7,8)) 9 else t.number end

c# - How to deserialize JSON to a object with type Interface -

i using asp.net mvc. have model property type interface. public class testmodel : basemodel { public(testmodel) {} public int status {get;set;} public itestinterface testinterface {get;set;} } i not able desterilize object in controller when passing view json. javascriptserializer jsserializer = new javascriptserializer(); list<testmodel> lstmodel = jsserializer.deserialize<list<testmodel>>(strjsondata.tostring()); thanks, kron