Posts

javascript - complex startkey/endkey query concerning PouchDB not returning expected result -

i have created index called session_indexes/by_lastmodifieddate_status in pouchdb emit both timestamp string, indicates status. here array keys emitted when map function run 6 documents in database: [1404446400000, 'suspended'] [1409630400000, 'open'] [1413777600000, 'open'] [1423976400000, 'closed'] [1425704400000, 'open'] [1430193600000, 'open'] now, want query index using startkey , endkey . providing following: startkey: [1422766800000, 'closed'] endkey: [1427688000000, 'closed'] this means want find of documents have date between these 2 timestamps , have closed status. however, pouchdb seems return results match dates - it's returning 2 results (the other 1 being [1425704400000, 'open'] ). the map function using follows. know looks strange - being generated code. not written human. still emits correct keys fine: function(document) { if(document._id.startswith('session')) {...

javascript - Disappearing data, what's going on? Pebble newbie -

brand new , naive pebble sdk , c lots of experience in other languages. means i'm going embarrassed when solves me but... have 2 files in watchface project based on tutorials... i'm pulling in different data works getting started tutorial until point code updates 1 of text layers with... nothing. it's got me puzzled becuase data it's supposed putting in there appears fine in console log it's getting passed over. anyways, here's c include #define key_monthmiles 0 #define key_monthelevation 1 #define key_totalmiles 2 #define key_totalelevation 3 static window *s_main_window; static textlayer *s_time_layer; static bitmaplayer *s_background_layer; static gbitmap *s_background_bitmap; static textlayer *s_weather_layer; static void update_time() { // tm structure time_t temp = time(null); struct tm *tick_time = localtime(&temp); // create long-lived buffer static char buffer[] = "00:00"; // write current hours , minute...

single sign on - Yii2 with SSO + kerberos -

i want configure sso on yii cannot find docs anywhere. on yii 1.x have cwebuser , cuseridentity class under protected/components folder. on yii2.x not know how create similar setup. now built-in components of framework. should extend them use wish. model can user model long implement identityinterface , if have app-advanced setup find under common/models/user.php or in app-basic setup under models/user.php . here guide follow. however check controllers behaviors access authentication control actions defined. if need different cerberos need create component implements authinterface .

javascript - webkitTransition , what does this mean to CSS-3 , using Jquery? -

please have @ below code : $(document).ready(function () { var defaults = { duration: 4000, easing: '' }; $.fn.transition = function (properties, options) { options = $.extend({}, defaults, options); properties['webkittransition'] = 'all ' + options.duration + 'ms ' + options.easing; console.log(properties); $(this).css(properties); }; $('.element').transition({ background: 'red' }); }); i reading through famious article online , if go section says "programmatic transitions" , u'll see talking , when coding animations in css-3 used below syntex : -webkit-transform: .3s; -moz-transform: .3s; -ms-transform: .3s; -o-transform: .3s; but when creating css-3 transitions , see alot of stuff below : var transendeventnames = { webkittransition : 'webkittransitionend', moztransition : 'transitionend', otransition ...

c++ - How can I define a structure of physical constants? -

i define sort of structure (struct? namespace? class?) of physical constants known globally program. purpose of doing allow me give constants simple, intuitive names while protecting values elsewhere. example, define q within structure fundamental charge without having worry accidentally using q loop variable somewhere else in program. thought define struct (in main.h): struct constants { float q=1.6022e-19; } _c; but gives me error main.h:79: error: iso c++ forbids initialization of member 'q' main.h:79: error: making 'q' static main.h:79: error: iso c++ forbids in-class initialization of non-const static member 'q' i searched both here , internet @ large didn't find answer. if know of one, please redirect me. i'm new both stack overflow , c/c++ appreciate patience. one solution set of static variables in "constants" namespace: namespace constants { static double constexpr q = 1.3; } to refer variable, do: co...

Why wont java let me have this else if statement? -

i dont seem understand why java not allow me have else if statement in solve method under while loop, tells me syntax error. thought condition after else if statement correct syntax not working me. //class solve simple n queens problem backtracking, without using recursion in 1-d array. public class nqueens { private int n; private int board[]; public nqueens(int n) { this.n = n; this.board = new int[n]; for(int = 0; i<n; i++) { this.board[i]=-1; } } //checks place attack queens in same column, or diagnol public boolean safeplace(int row, int col, int [] board) { (int = 0; i<row; i++) { if((board[i] == col)|| (i-row)==(board[i]-col)|| (i-row)==(col-board[i])) return false; } return true; } //solves n queens problem using backtrac...

javascript - Google maps being loaded multiple times? -

in page: http://sitesdemo.mghospedagem.com/ivam-entregas/3/33209.html i tried disabling few javascript related google maps, chrome console still pointing me same errors, saying have multiple instances of google maps loaded. i'm getting errors not calculating shipping, or not being able use map, blah blah blah. can me find part of javascript have edit fix this? here log: failed load resource: server responded status of 404 (not found) main.js:61 uncaught typeerror: undefined not function main.js:60 have included google maps api multiple times on page. may cause unexpected errors.main.js:60 yl 33209.html:9 uncaught referenceerror: j not defined vm603:10 uncaught typeerror: cannot set property 'geometry' of undefined 33209.html:1 uncaught referenceerror: j not defined 33209.html:9 uncaught referenceerror: j not defined 33209.html:3 uncaught referenceerror: j not defined 33209.html:6 uncaught referenceerror: j not defined http://sitesdemo.mghospedagem.com/ivam-e...