Posts

algorithm - Union-Find: retrieve all members of a set efficiently -

i'm working union-find algorithm. in first part of program, algorithm computes partition of big set e . after that, want retrieve members of set s , contains given node x . until now, naively, testing membership of elements of e set s . yesterday reading "introduction algorithms" (by clrs, 3rd edition, ex. 21.3-4), and, in exercises, found that: suppose wish add operation print-set(x) , given node x , prints members of x 's set, in order. show how can add single attribute each node in disjoint-set forest print-set(x) takes time linear in number of members of x 's set, , asymptotic running times of other operations unchanged. "linear in number of members of x 's set" great improvement problem! so, i'm trying solve exersice... , after unsuccessful tries, i'm asking on stack overflow! recall union-find implemented upside-down tree, each set s = {v 1 , v 2 , ..., v n }, have v n - 1 edges, have same root (o...

How do I include unordered list in jquery serialize array -

i'm using: $.ajax({ url: "processform.php", type: "post", data: $(this).serialize(), success: function(d) { alert(d); } }); to collect form input array. part of form unordered list: <ul class="sortable list" id="section_order"> <li>diet</li> <li>complementary treatments</li> <li>herbal medicine , dietary supplements</li> <li>self practices</li> <li> other activities</li> </ul> which serialize function ignoring. how include order of list items in serialized array. thanks help

doctrine2 - DQL Perform a union in query -

i know there several post relatives question still can't mine ! i have 2 tables (studios , models). want perform union datatable. currently, have : $cnn = $this->doctrine->getconnection(); $inscr = $cnn->fetchall("(select s.thedate mydate, s.name designation, \'studio\' mytype studios s order mydate limit 2) union (select m.thedate mydate, m.nickname designation, \'hotesse\' mytype models m order mydate limit 2 )"); return $inscr; but nothing appears in datatable , can't perform var_dump or other. i test in rdbms , waited results. so, ? i found solution perform query , result $sql = "(select s.thedate mydate, s.name designation, 'studio' mytype studios s order mydate limit 2) union (select m.thedate mydate, m.nickname designation, 'hotesse' mytype models m order mydate limit 2 )"; $stmt = $this->e...

css stretching background image sprite technique -

i have div styling, , width dynamic. <style> #mydiv { background-image: url('http://icons.iconarchive.com/icons/manda-pie/chocolate/icons-390.jpg'); background-repeat: no-repeat; border: 1px solid red; width: 50%; height: 200px; background-position: -0px -0px; -moz-background-size: 448px 368px; background-size: 448px 368px; } </style> <div id="mydiv"></div> you see div stretches if stretch browser window. how make background image stretched right same way div does? fiddle http://jsfiddle.net/3dsgn/106/ use -moz-background-size:100% 100%; background-size: 100% 100%;

visual studio 2010 - When using GoTo Statment in if else blocks the expected result is not obtained in C# -

i have below program. using system; using system.collections.generic; using system.linq; using system.text; namespace mylabeledstatement { class program { static void main(string[] args) { int x = 100, y = 4; int count = 0; string[,] myarray = new string[x, y]; (int = 0; < x; i++) { (int j = 0; j < y; j++) { myarray[i, j] = (++count).tostring(); //console.writeline(myarray[i, j]); } } console.writeline("enter number find:"); int mynumber = int.parse(console.readline()); (int = 0; < x; i++) { (int j = 0; j < y; j++) { if (myarray[i, j].equals(mynumber)) { goto found; } else { ...

javascript - How can i prevent LastPass (chrome extension) from filling out my input field - make LastPass ignore my input field -

i want ignore last pass fill out input field, i'm using angularjs , html5 extention auto fill ofllowing input field. <input id="search-publishers-box" type="text" placeholder="search publishers" data-ng-model="publisherssearchquery.name" class="search-field-text" autocomplete="off"/> what should in order prevent last pass doing it, tried change place holder, model, adding autocomplete="off" change id of input field non of them worked me. any suggestions? here's take on this, , solve autofill problems (yes, they're obscure happen) – watch fields changes. since you're using angularjs , pretty easy $watch , or if you're using jquery , use .change and then, whenever there's change of more 1 character @ 1 time, can assume autofill , not typing. note breaks if decides paste field. another workaround allow change on field when there's keypress . edit here's...

jquery - How to set a inline form to occupy 100% width under the navbar brand in "navbar" -

Image
i pretty new bootstrap. trying have inline form in navbar beside navbar-brand. while re-sizing(responsiveness) window, form coming below navbar-brand link, not coming 100% , hence looking awkward. tell me going wrong. here's full html code, bootstrap 101 template <!-- bootstrap --> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"> </head> <body> <div class = "navbar navbar-inverse navbar-fixed-top"><!--style = "background-image: url('images/logo.png'); background-size: contain; background-repeat: repeat;"--> <div class = "row"> <div class = "navbar-header col-lg-4 col-sm-12 col-xs-12 pull-left" style = "background-color: red; height: 100%;"> <a class = "navbar-brand" href = "#">janasena party</a> ...