Posts

php - mongoDB index strategy -

i have collection called post. have mapping system ensures each document has these fields: id (int) target (string) type (string) user_id client_id updated (string, 11 int timestamp) created (string, 11 int timestamp) enabled (bool) this collection accessed output in api schema. so typical requests might be: /post?type=image&user_id=2 /post?updated=35234423&order_by=client_id /post?enabled=true&order_by=id there no 100% guarantee fields make find or sort field. recently when table reached 8gb of data, started getting error: "localhost:27017: data sort() no index. add index or specify smaller limit" i have looked @ documentation mongo index , found difficult understand whether works in same way mysql index. some threads found on indexing: mongodb - data sort() no index error seem suggest using specific sort fields ensure index hit. cannot when alot of filtering , sorting optional. could suggest firm solution in terms of whether sho...

java - How to return from an AlertDialog to the AlertDialog before -

how can return alertdialog called , offers more buttons , user clicks on 1 of buttons, new alertdialog pops input field. if check if user input e.g. numeric, how can return alertdialog offered before? i'd suggest using dialogfragment support library each of these dialogs. add onclicklisteners each of buttons of first dialogfragment , show second dialogfragment in onclick . there should not necessity checking if input number if set appropriate input type first. when user taps button on second dialogfragment , call dismiss() .

Does Qt Webkit with pyside and QML work with angularjs -

i trying use angularjs in qt-webkit application pyside bindings. doesn't seem work. basic templates {{2+3}} also not work. saw this. saw post on github https://github.com/angular/angular.js/issues/2985 but didn't understand further implications of limitations mentioned. mean separately loaded js not work because pre-compiled.

php - How to add many files with silverstripe uploadfield -

hello everyone , i'm trying add more 1 file uploadfield code -> class filedo extends file { static $has_one = array( 'documentsfile' => 'documentsfile', ); } class documentsfile extends dataobject { static $has_one = array( 'documentpageacces1' => 'documentpageacces1' ); static $has_many = array( 'files' => 'filedo' ); public function getcmsfields() { $fields = parent::getcmsfields(); $fields->removebyname('documentpageacces1id'); return $fields; } public function onbeforewrite() { parent::onbeforewrite(); $page = dataobject::get_one('documentpageacces1'); if($page) { $this->documentpageacces1id = $page->id; } } } class documentpageacces1 extends page { static $has_many = array( 'documentsfiles' => 'documentsfile...

variables - PHP For loop required for storing data in MySQL -

mysqli_stmt_bind_param($proc, "iss$is", $respondent_id, $ip, $browser, $qstr1); it's causing problem, though $qstr1 contains text $q1, $q2 etc. things stand think $qstr1 being treated single variable within code, guess need extract text , use no sure how? using answer provided below, have modified , added to: $qstr = ''; $markstr = ''; for($i=1; $i<11; $i++) { $qstr .= 'q'.$i.''; $qstr1 .= '$q'.$i.''; $markstr .= '?'; $is .= 'i'; if($i < 10) { $qstr .= ', '; $qstr1 .= ', '; $markstr .= ', '; } } $proc = mysqli_prepare($link, "insert tresults (respondent_id, ip, browser, $qstr) values (?, ?, ?, $markstr);"); mysqli_stmt_bind_param($proc, "iss$is", $respondent_id, $ip, $browser, $qstr1); now, i'm having problem $qstr1 - though looping t...

vba conditional find & replace -

today stuck code while trying replace dot (.) if in list sheet1 not match 1 of values list of sheet (same workbook). " argument not optional " error not give me other hint. sub filter(wss worksheet, wsn worksheet, integer, j integer, k integer, l integer, integer) ' ' substitute macro ' application.screenupdating = false range("a1").formular1c1 = "sorted" set wss = sheets("sheet1") set wsn = sheets("non_confid") col1 = "a" col2 = "e" col3 = "c" for = 1 200 if wss.range(col1 & a) = wsn.range("ab2:ab600") = + 1 else: range(col1 & a).replace what:=".", replacement:="", lookat:=xlpart, searchorder:=xlbyrows, matchcase:=false, searchformat:=false, replaceformat:=false = + 1 end if next range("a1").autofilter activeworkbook.worksheets("sheet1").autofilter.sort.sortfields.cle...

xampp - How Do I run Localhost? -

hi figure out how can run local host. keep getting error of port 480. page unable load. check browser compatibility already.cheers. perhaps programmes such skype have blocked off port.