Posts

c++ - Template matrix with char* consol stop responding when using operator= -

i need help. first hugh program in c++ (pointers nightmare). tried , can't find did wrong. class aghmatrix { private: t ** matrix; int n; int m; public: aghmatrix() : n(0), m(0) {}; aghmatrix(int _n, int _m); aghmatrix(const aghmatrix& other); ~aghmatrix(); void setitem(int n, int m, t item); void setitems (t * wsk); void setitems(int r, int c ...); void setall(); void getall(); bool couldbeadded(char * word, char sign); bool equals (t first, t second); t operator()(int a, int b); aghmatrix<t> & operator+(const aghmatrix<t> & other); aghmatrix<t> & operator*(const aghmatrix<t> & other); aghmatrix<t> & operator= ( const aghmatrix<t> & other); bool operator== (const aghmatrix<t> & other); bool operator!= (const aghmatrix<t> & other); }; test : char* cpt[] = {"to", "jest...

sapui5 - How to overwrite or change OpenUI5 Panel section id? -

i doing adding/delete of panel section container in openui5. while deleting selected panel container can able it. after deletion of container , again adding new container getting error of "adding element duplicate id txn_1". how fix issue? i using below code: var iconadd = new sap.ui.commons.button({ //add container code text : "add", width:"65px", icon : "sap-icon://add", press : function() { var len=$('#panelcontainer .sapuipanel').length; //alert("len"+len); createnewtransaction(len+1); //alert(""+len); //var content=$("#panelcontainer").html(); //$("#panelcontainer").append(content); //var length=$('#panelcontainer').length; // alert(""+length); } }); createnewtransaction(1);//onload defaultly 1 conatiner should show...

jsf - How to handle bootstrap modal in Java Server Faces? -

i principle composite-components , bootstraps modal wont work together. whats best practice manage multiple custom composite components dialogs , use example in jsf-table. pass managed bean value selected row dialog. this works me if wrote in 1 page file. see last one. bootstrapmodal.xhtml modal wrapped in composite component <?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:cc="http://xmlns.jcp.org/jsf/composite"> <cc:interface> <cc:attribute name="title" /> <cc:attribute name="linknamelable" /> <cc:attribute name="linknamevalue" /> <cc:attribute name="urlnamelable" /> <cc:attribute name="urlnamevalue" /> <cc:attrib...

how to set record by update query sql vb.net -

i have table , want set value if cell=null set record textbox . here table -------------------- col1| col2| note 1 2 aaa 5 5 (*) set record here if cell null 42 14 47 55 ------------------ here code , problem query write every cell null , want write next cell before not null con.open() query = " update firealarm set note=@note note null" dim command sqlcommand = new sqlcommand(query, con) command.parameters.add(new sqlparameter("@note", sqldbtype.nvarchar)) command.parameters("@note").value = notebox.text.tostring command.executenonquery() con.close() first, let's fix immediate problem: in sql null not equal anything, including other null s, note<>null true rows. address problem, sql has special operators is null , is not null . using where note not null fix problem. a bigger problem remains, though: program vulnerable sql injection attack. fix problem in visual basic see this q&a . edi...

java - JavaFX ScrollPane memory leak software pipeline -

i have simple code , run -dprism.order=sw using jdk8_45: @override public void start(stage primarystage) throws exception { stackpane root = new stackpane(); root.getchildren().add(new scrollpane()); scene scene = new scene(root, 300, 250); primarystage.settitle("test fx scrollpane"); primarystage.setscene(scene); primarystage.show(); } run visualvm , have following: greates object int[] - 9-10mb than resizing window many times , @ visualvm out calling gc: greates object int[] - 400-500mb after calling gc: greates object int[] - 140-150mb if heap dump , @ int[] - it's images, , on time become more , more. if run -dprism.order=es2 it's right. any solutions this? thanks

regex - C# Regular Expression Nested Paraenthisis Recursive -

need find regular expression. text = @"{'the quick' | 'the lazy'}{{{'before'} 'fox' } | {{'before'} 'lion'}}" result string array should - [0] = 'the quick' | 'the lazy', [1] = before/1 fox | before/2 lion unless 2 or more strings split |, need them side side. thanks help. after thinking bit, able find simple solution. string sampletext = "{'what is' | 'when is'}{before/2 }{doing | 'to do'}{ near/3 }{'to ensure our' | 'to ensure that' | 'to make sure our' | 'to make sure our' | 'so our' | 'so our'}{ before/4 }{doesn*t | 'does not' | 'will not' | won*t}"; list<list<string>> list = new list<list<string>>(); match mt = regex.match(sampletext, @"\}([^{]*)\{"); string value = sampletext.replace(mt.value, "},{"); ...

ios - Interactive transition similar to scroll view -

Image
i have implemented interactive transition between 2 view controllers, using gesture recognizer , uipercentdriveninteractivetransition . doing custom swipe transition. i improve 2 things in order have similar scrollview animation: responsiveness. when pan super fast , short, next vc not showed, plus bug comes in ( animationended not called, story) there way preload next view controller, have child view controller may be? seems doing work in viewdidload. in implementation when gesture recognizer ends, call finishinteractivetransition . works ok, if start new pan gesture before transition completed ui jumps instead of smoothly scrolling. may should call finishinteractivetransition after delay, , calling manually updateinteractivetransition in mean time? may can use api sets have interactive animation (but scrollview not option)? just fyi: here view hierarchy during interactive swipe, gesture attached navigation view: try subclassing uipercentdriveninteractive...