Posts

javascript - Maintain five section in DOM at a time -

i creating ebook reader, want fetch sections of ebook link : http://tmaserv.scem.uws.edu.au/chapters/?n=0 fetch section number 0 http://tmaserv.scem.uws.edu.au/chapters/?n=1 fetch section number 1 .. on number of sections can obtained url http://tmaserv.scem.uws.edu.au/chapters now, able fetch section, want reader should maintain 5 sections of document in dom @ time.also can fetch 1 section @ time. first 5 fetched document loads,then additional sections fetched on request. code: <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>ebook</title> <script> var requestnum = 0; // assume had fetched number of sections in varibale sectioncount function do_exercise () { var x = new xmlhttprequest(); // adjust url reflect new n value , request before x.open('get', 'http://tmaserv.scem.uws.edu.au/chapters/?n=' + requestnum, true); x.onreadystatechan...

uinavigationcontroller - UISearchController always display scope bar -

i adding search controller in app part of tab bar controller. trying scope show, not when search bar active. have tried subclassing , overriding method show it, , have tried using uisearchbar , uisegmentedcontrol separate seem scope showing. issue navigation bar height won't change. best/easiest way of doing this? (also, people have used uisearchcontroller, how can background extend under status bar when uisearchbar active, in mail app)

php - Array to string conversion error when indexing array -

this question has answer here: reference - error mean in php? 29 answers it says i'm getting these errors: notice: array string conversion in c:\xampp\htdocs\team_aveera_website\inc\user_functions.php on line 19 array notice: array string conversion in c:\xampp\htdocs\team_aveera_website\inc\user_functions.php on line 22 when try index array. i'm doing getting rows database , adding value row array. random object array: <?php function getrandomadminstream($db) { try { $twitchnames[] = array(); $sql = $db->prepare('select * users'); $sql->setfetchmode(pdo::fetch_assoc); $sql->execute(); $i = 0; while($row = $sql->fetch() !== false) { if($row['rank'] == 1) { $twitchnames[$i] = $row['twitchus...

javascript - Loop through IDs with jQuery and make them droppable -

i've got container #itemgrid , few children-divs. unique. code far: $('#grid-top').droppable({ drop: drophandler, accept: ".top" }); $('#grid-assc').droppable({ drop: drophandler, accept: ".assc" }); as may see, accepting class in id of element. have more divs want make droppable, work. how can loop through these elements? $("#itemgrid div[id^=grid-]").each(function() { var accept = $(this).attr("id").split("-")[1]; $(this).droppable({ drop: drophandler, accept: "." + accept }); });

artificial intelligence - When is one heuristic better than another? -

i answered question in 2 heuristics given a* conducted find path start state goal state. one of heuristics found path expanding 1 node less - reason, heuristic better other? thanks! we cannot 1 heuristic "better" because expands fewer nodes on 1 example of problem. on next example, "better" heuristic might expand many more nodes other. we know heuristic estimate can't go on actual distance if admissible. in other words, heuristic function must constructed in such way never overestimate distance goal under circumstances. it make sense, then, if 1 heuristic gets closer actual distance without going over, can considered "better". if used heuristic said distance between 2 nodes 1 (or value less shortest edge length) end expanding lot of nodes. estimate gets closer actual distance make more can eliminate paths earlier. there are, of course, other ways of defining "better", such being easier calculate.

No Project Shown - Google Developers Console -

i have been assigned project in google developers console. have logged in before, seen project, made changes , saved several times. now, project no longer listed. others on project can see it, etc. you not logging in right console. there 1 google play , regular developer console .

java - Changing interface method arguments -

let's have interface myinterface has method do() . have classes implement interface. interface called throughout code , calls specific implementation via factory. later on decide change do() method adding argument it, let's - do(numberoftimes) . clients broken when call myinterfaceold.do() implementation do() method not found. can add do() method argument, breaks clients well. straightforward way change do() method in myinterface , update clients, there way without needing update clients?