Posts

How do I store HTML/XHTML in an XML file and then use XSLT to retrieve it? -

i have xml file containing documentation project of mine. i'm using xslt transform xml file html output in browser. now thing have entities contain html code. nothing complicated, <br/> tags. don't seem able make work. have tried "disable-output-escape" works in internet explorer. now i'm trying namespaces. have wrote in root tag. xmlns:h="http://www.w3.org/1999/xhtml" and changed tags <h:br/>, tags don't appear , still don't have line break. i assume i'm missing something. it's first time i'm working xslt. found mistake. had use copy-of instead of value-of.

visual studio 2008 - How to close tab in CMFCTabCtrl -

i have used cmfctabctrl in mfc application , have enabled active tab close button. m_tabcontrol.enableactivetabclosebutton(); but when click close button, tab not closed. how close tab properly??.. thanks. when click close button, wm_close message sent window used in addtab during initialisation. so, in child window, add wm_close message handler , this: void cmytabwindow::onclose() { // nb - must created tab ctrl parent cmfctabctrl *ptab = static_cast<cmfctabctrl*>(getparent()); ptab->removetab(ptab->getactivetab()); }

sql server - Nested Case statement in sql query -

my query declare @from datetime='01 feb 2013' declare @to datetime='28 feb 2013 23:59:59' select case when ( select top 1 f1.updatedon tickettypefollowup f1 with(nolock) f1.updatedon<t.updatedon , f1.ticket=t.ticket order f1.updatedon desc )is null ticket.ticketraisedon else ( select top 1 f1.updatedon tickettypefollowup f1 with(nolock) f1.updatedon<t.updatedon , f1.ticket=t.ticket order f1.updatedon desc ) end [start date] dbo.tickettypefollowup t with(nolock) --some tables omitted cast(ticketraisedon date)between ''+convert(varchar(19), @from, 100)+'' , '...

android - How to stop setOnItemSelectedListener from running in onCreate -

this question has answer here: load data setonitemselectedlistener 1 answer i set values in setonitemselectedlistener depending on selected in spinner. how can stop method being called oncreate? thanks in advance set setonitemselectedlistener spinner not onitemclicklistener take boolean field this boolean onload=false; and in oncreate set onload=true; and in onitemselectedlistener, this spinner.setonitemselectedlistener(new adapterview.onitemselectedlistener() { public void onitemselected(adapterview<?> parent, view view, int position, long id) { if(!onload) { } onload=false; } public void onnothingselected(adapterview<?> parent) { } });

Abort file upload with Javascript/Jquery -

how possible cancel pending post request using javascript/jquery? i have upload form large files , want offer possibility abort upload after submit button triggered without reloading whole page. var xhr = $.ajax({ //stuff}); //to canel call abort(). xhr.abort(); however, think requires further investigation. looked if jquery calls onaboort dom's event "stop waiting"/abort response.

java - JDBC Template - One-To-Many -

i have class looks this. need populate 2 database tables, shown below. there preferred way this? my thought have service class select list<> via resultsetextractor dao. foreach on list, , select list<> of emails individual person via resultsetextractor , , attach foreach loop. is there better way, or gets? public class person { private string personid; private string name; private arraylist<string> emails; } create table person ( person_id varchar2(10), name varchar2(30) ); create table email ( person_id varchar2(10), email varchar2(30) ); this best solved orm. jdbc, have hand orm you. executing n + 1 queries inefficient. should execute single query, , build objects manually. cumbersome, not hard: select person.id, person.name, email.email person person left join email on person.id = email.person_id ... map<long, person> personsbyid = new hashmap<>(); while (rs.next()) { long id =...

java - How to do Custom Serialization using GSON? -

i have case use gson custom serialization feature. class student{ public string name; public int rollnumber; public student(string name, int rollnumber){ this.name = name; this.rollnumber = rollnumber; } public int getrollnumber(){ return this.rollnumber; } public string getname(){ return this.name; } } class school{ public student[] students; public school(student[] students){ this.students = students; } public students[] getstudents(){ return this.students; } } now when do private static final gson gson = new gsonbuilder().disablehtmlescaping().create(); student[] students = new student[2]; students[0] = new student("sam", 1); students[1] = new student("tom", 2); school school = new school(students); gson.tojson(school); i output this: [{"name":"sam","rollnumer":1},{"name":"tom","rollnumer...