Posts

Showing posts from January, 2013

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

sql - Query Result(NULL value/Datetime format) -

i have query use put rows in 1 column, dynamic because need @ least 8 tables: declare @tblname varchar(20) = 'location' declare @columns nvarchar(max), @sql nvarchar(max) select @columns = coalesce(@columns, '') + '+[' + column_name + '],+'''''',''''''' information_schema.columns table_name = @tblname , table_schema='les' select @columns set @sql = 'select concat(''''''''' + stuff(@columns, 103,9, '') + '+'''''') ' + @tblname select @sql -------------------------------------------------------------------------- r1: select concat(''''+[location],+''','''+[location type],+''','''+[region],+''','''+[world region],+''','''+[refresh date]+''') location if execute query (without datetime column

nullpointerexception - UCanAccess driver throws Exception when trying to connect with Access database while Jackcess connection works fine -

1) ucanaccess sample code works database (access 2000) class.forname("net.ucanaccess.jdbc.ucanaccessdriver"); connection conn = drivermanager.getconnection(database_url); system.out.println(conn); 2) same ucanaccess sample code not work database b (access 2000) , leads exception stack trace: net.ucanaccess.jdbc.ucanaccesssqlexception @ net.ucanaccess.jdbc.ucanaccessdriver.connect(ucanaccessdriver.java:247) @ java.sql.drivermanager.getconnection(drivermanager.java:571) @ java.sql.drivermanager.getconnection(drivermanager.java:233) @ xxxxxxxxxx.jdbcaccessconnection.main(jdbcaccessconnection.java:23) caused by: java.lang.nullpointerexception @ net.ucanaccess.converters.ucanaccesstable.getindexes(ucanaccesstable.java:74) @ net.ucanaccess.converters.loadjet$tablesloader.loadtableindexesuk(loadjet.java:794) @ net.ucanaccess.converters.loadjet$tablesloader.createindexesuk(loadjet.java:835) @ net.ucanaccess.converters

Magento - get product count by attribute -

i've been searching quite few hours , can't seem come answer. i have bunch of different products, , bunch of different attributes , attribute sets. i'm looking count number of products have valid attribute value entire list of attributes. so, want loop through each attribute, count number of products have attribute, , have value attribute. all of our attributes sources third party. so, either leave value blank, or put "n/a". the problem facing right fact can't products have specific attribute available them. 'notnull' filter isn't working me. i've tried many different ways. current code isn't working, looks promising. i'll give error getting one, if has solution love share me. $productattrs = mage::getresourcemodel('catalog/product_attribute_collection'); $x = 0; foreach ($productattrs $productattr) { $collection_size = mage::getmodel('catalog/product')->getcollection()

ruby on rails - Eager load associations in nested set model -

i'm using nested set represent nested comments (1 discussion has many comments, comments can replied to) , (if possible) eager load answers comments. at moment load root nodes , iterate on them, if have descendants render them. however, if there lot of root nodes answers, triggers lot of db requests. a comment has these columns: rgt, lft, parent_id i tried create relationship this: class comment < activerecord::base has_many :answers, -> (node) { where("lft > ? , rgt < ?", node.lft, node.rgt) }, class_name: "comment", foreign_key: :parent_id end this fetches answers comment when called on comment instance. however, if try eager_load ( discussion.comments.includes(:answers) ) blows since node nil. is possible eager load this? i think, i've found solution. if see right, data model looks this: discussion ---------- ... comment ---------- discussion_id:int parent_id:int lft:int rgt:int then ar model classes be: cla

python - Deploying Django to AWS - WSGIPath refers to a file that does not exist -

i've been struggling getting django , aws work together. i'm following tutorial here: https://realpython.com/blog/python/deploying-a-django-app-to-aws-elastic-beanstalk/ i've been following tutorial steps, including using "eb option" command change wsgipath, keep getting error: "error: wsgipath refers file not exist." as far can tell i've been doing according tutorial. the relevant part of config file looks this: numprocesses: '1' numthreads: '15' staticfiles: /static/=static/ wsgipath: iotd/iotd/wsgi.py what doing wrong? i have read realpython blog post referred to. refer aws tutorial. written deployment of bare bones django project , can found at: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html#python-django-configure-for-eb i found useful work through, , learned great deal fixing error have identified. of course fix related own implementation of tutorial, followe

Programmatic subsetting of a data.table in R -

this feels simple question solution has eluded me 90 minutes of trying, searching , reading manuals , online. say i've got data.table: dt<-data.table(a=runif(n = 10),b=runif(n = 10),c=runif(n = 10)) clearly works: dt[a > 0.5] and gives me subset of dt values in column "a" greater 0.5. if want bit more flexible (because subset embedded in larger routine). what i'd make proto-function work: flexsubset<-function(scolumntosubset,dmin){ subs<-dt[scolumntosubset>dmin] return(subs) } i've tried without success, among many others... with=false any suggestions? many time in advance! if want pass string, this: flexsubset = function(scolumntosubset, dmin) dt[get(scolumntosubset) > dmin] flexsubset("a", 0.5) if want pass unevaluated expression, then: flexsubset = function(scolumntosubset, dmin) { lhs = substitute(scolumntosubset) dt[eval(lhs) > dmin]

vim winminwidth "E36 Not enough room" error -

i'm having problems setting 'dynamic' window width in .vimrc. doing winheight works fine. here's code: " dynamic current window sizing tbot art of vim set winheight=9 set winminheight=9 let &winheight = &lines - 9 set winwidth=40 set winminwidth=40 " e36 not enough room here let &winwidth = &columns - 40 the winheight settings work great; winwidth settings error. however, works once i'm in vim; have 3-7 related windows open in single tab , dynamic resizing means have lots of space horizontally , vertically work in. i can reproduce this, , tried work around via :autocmd vimenter , other such tricks, failed. if works out in end, can suppress error prepending :silent! command.

javascript - add click event to auto complete -

this autocomplete code : <link href="jostejufile/css/jquery.autocomplete.css" rel="stylesheet" type="text/css" /> <script src="jostejufile/scripts/jquery-1.4.1.min.js"></script> <script src="jostejufile/scripts/jquery.autocomplete.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $("#<%=txtsearch.clientid%>").autocomplete("handler/search_cs.ashx", { width: 200, formatitem: function (data, i, n, value) { return "<img style = 'width:50px;height:50px' src='prupload/" + value.split("-")[1] + "'/>" + value.split("-")[0]; }, formatresult: function (data, value) { return value.split("-")[0]; } }); }); </script> <asp:textbox id="txtsear

javascript - Sorting issue with plain text and html in the same column using Handsontable -

i'm having problem sorting column contains plain text html anchor tag. sorting seems occurring on value stored in data source array rather displayed value. cells containing anchor tag sorted above plain text cells. below jsfiddle example. third column sort alphabetically names regardless of whether cell contains anchor tag or plain text. example: http://jsfiddle.net/5sl2jkqt/ { data: 2, renderer: "html" } i tried applying custom cell renderer on third column did not help. suggestions on how around appreciated! what did around add following function handsontable.full.js // strip out tags not in allowed parameter function striptags(input, allowed) { if (!input) { return ""; } else if (!isnan(input)) { return input; } // making sure allowed arg string containing tags in lowercase (<a><c>) allowed = (((allowed || "") + "").tolowercase().match(/<[a-z

python - Automate clicking of menu item and opening file - Windows XP -

i have windows xp computer, running lasercut 5.3. i automate process of importing dxf file, going file > import > [selecting dxf] > clicking import. the dxf file in same location. (c:\autocut\receivedfile.dxf) is there way can automate clicking through of importing file? the computer runs windows xp professional , has python 2.7 installed. school computer, rather not install programs, can if way. thanks take @ pywinauto: http://pywinauto.github.io/ there's swapy project, might useful getting head start on generating pywinauto code: https://code.google.com/p/swapy/

sql server 2012 - How to pivot data -

i use pivot function in following query display dateadded, accountname, campaign, campaigngroup on left side , summation of values across top summed across top select convert(varchar(10) , ct.dtadded , 120)dateadded , upper(szaccountname)dealer , upper(c.szcampaign)campaign , upper(cg.szcampaigngroup)campaigngroup , case when d.dialid not null 1 else 0 end namesreceived , attempts callattempts , case when callflag = 1 , attempts < c.nmaxattempts , d.agentid != -1 1 else 0 end eligibleremaining , case when szfaxtype '%appointment%' 1 else 0 end apptfaxes , case when szfaxtype '%hot%' 1 else 0 end hotfaxes , case when szfaxtype '%service opportunity%' 1 else 0 end serviceopfaxes , case when szfaxtype '%basic%' 1 else 0 end basicfaxes , case when szq25 in('now' , '30 days' , '90 days')

ios - Animation for help overlay in iPhone Application -

Image
how create animations implement layout in iphone applications in below image: desired effect : when hand image moves , point icon, ripple effect shown. how implement ? you can implement using core animation. use uibezierpath make circle layer , animate radius. open source zfripplebutton provides similar effect, , starting point.

authentication - How does SSL affect .NET Web Api security? -

i've read authentication , authorization inside of asp.net web api , i've understood must use ssl in order not letting people hold of authentication tokens. , if i'm not misstaken theese authenticantokens sent inside of header? , ssl hides theese headers public not to catch if use tools internet listening? if thats case guess create "custom" authentication not allowing api run unless specific header sent api call? people shouldn't able catch if use ssl? i realized i've used alot of questionmarks illustrate unclear thoughts are, or input highly appreciated, thanks! authentication, authorization , securing connection on ssl 3 different parts of web application. authentication basically authentication handles who are. example login provide user , password. application knows now, are. authorization authorization manages access rights user. says, on what have access. example if you've provided correct credentials, authenticated , ma

android - How to use java classes within one activity? -

how can use java class within 1 activity, mean having different components of activity spread out in bunch of java classes. i'm little new android , have tried far: mainactivity.java package com.example.alex.myapplication; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.view.menu; import android.view.menuitem; public class mainactivity extends actionbaractivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); new something(this); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.menu_main, menu); return true; } @override public boolean onoptionsitemselected(menuitem item) { // handle action bar item clicks here. action bar // automatically handle clicks on home/up button, long // specify parent

Can PHP PDO Statements accept the table or column name as parameter? -

why can't pass table name prepared pdo statement? $stmt = $dbh->prepare('select * :table 1'); if ($stmt->execute(array(':table' => 'users'))) { var_dump($stmt->fetchall()); } is there safe way insert table name sql query? safe mean don't want do $sql = "select * $table 1" please see following: http://us3.php.net/manual/en/book.pdo.php#69304 table , column names cannot replaced parameters in pdo. in case want filter , sanitize data manually. 1 way pass in shorthand parameters function execute query dynamically , use switch() statement create white list of valid values used table name or column name. way no user input ever goes directly query. example: function buildquery( $get_var ) { switch($get_var) { case 1: $tbl = 'users'; break; } $sql = "select * $tbl"; } by leaving no default case or using default case returns error message ens

android - Using StrictMode in app production phase -

i know strictmode designed used in application development phase, according app needs, it's not acceptable anr while it's quite acceptable crash, , strictmode provides way prevent anr dialogs: strictmode.setvmpolicy(new strictmode.vmpolicy.builder().detectall() .penaltylog().penaltydeath().build()); what if used inside app production phase? , happen when app getting anr while strictmode used? freeze, crash, or wait until getting responded again? strictmode disabled default, , users needs enter "developer's mode" in android enable it. makes solution of using strictmode irrelevant. anr's occur in rare occasions out of control, due conditions such low memory or other app choking cpu. however, can minimize likelihood of getting anr's moving every single operation access storage or network asynchronous task. in software add line of code dangerous places: assert !util.ismainthread():"woh! doing on main thread??"

java - Android service is not starting -

i need start background service on click of android app icon. below activity oncreate() method. protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_executable_runner); startservice(new intent(this, exerunnerservice.class)); } and overridden service class rest default. public class exerunnerservice extends service{ public int onstartcommand(intent intent, int flags, int startid) { return start_sticky; } @override public void oncreate() { thread th = new thread(new runnable() { public void run() { log.d(tag, "service running"); } }); th.start(); } } i don't have initialization code same. when start application not getting service logs. i put , override on onstartcommand, , call super.oncreate() in overridden oncreate method; like this: public class myservice extends service { private static boolean isrunning = false; p

css - Font Awesome's fa-spin spinning around wrong center -

i'm using toggle menu template: http://bootsnipp.com/snippets/featured/navigation-sidebar-with-toggle . i have replaced bootstraps glyphicon font awesome's fa fa-cog fa-spin but cog spinning out of boundaries if center not on same line text. can see there issue thesizing, cannot figure out where, idea doing wrong? jsfiffle: https://jsfiddle.net/vidriduch/mpw2r8h2/1/ you have problem in text indent .sidebar-nav li { line-height: 40px; text-indent: 20px; //remove rule , use margin } and change class rules .sub_icon { float: right; margin-right: 10px; margin-top: 10px; padding-right: 65px; // remove padding-top: 10px;// remove }

html - Modifying a XSLT XPATH code for a different output -

Image
i need modify xslt code different output result. need output table sigle, number of students , average. here's xml code : <?xml version="1.0" encoding="iso-8859-1" ?> <?xml-stylesheet href="class.xsl" type="text/xsl" ?> <university> <student><sname>charlie parker</name> <course sigle="inf8430" note="69" /> <course sigle="inf1030" note="65" /> <course sigle="inf1230" note="73" /></student> <student><name>miles davis</name> <course sigle="inf8430" note="65" /> <course sigle="inf1030" note="77" /> <course sigle="inf1230" note="83" /></student> <student><name>john coltrane</name> <course sigle="inf9430" note="24" /> <course sigle="inf1030" note="64" />

Eclipse StatET for R can't find installed libaries (windows) -

i have working eclipse workspace r development using statet plugin. can install libraries normal way, example: install.packages("rgdal") but when attempt use library: library(rgdal) r says: error in library(rgdal) : there no package called 'rgdal' using r gui on same computer works fine. also, in case relevent - using installed.packages() doesn't show newly installed rgdal package when use eclipse. in r gui does. it turns out, having eclipse , r gui open @ same time causing conflict, closing down r gui solved issue

css - How to make an image responsive in HTML email regardless of image size -

i creating email template container has max-width: 600px. want able upload images in excess of 800px wide, , images scale down maintain intended aspect ratio. if uploaded 800px wide image, scale 600px. in outlook, don't think supports max-width images therefore caused stretch. are there solutions this? yes , no. outlook tends force image actual size, regardless of css , html sizings. using images bigger want displayed on desktop version break on outlook. your best bet responsive images have images 100% width inside table has max-width set. around table, make conditional code mso contains set width table @ max-width size. example below: <!--[if gte mso 9]> <table width="640"><tr><td> <![endif]--> <table width="100%" style="max-width:640px;"><tr><td><img src="image.jpg" width="100%" /></td</tr></table> <!--[if gte mso 9]> </td><

parsing - How do you parse and process HTML/XML in PHP? -

how can 1 parse html/xml , extract information it? native xml extensions i prefer using 1 of native xml extensions since come bundled php, faster 3rd party libs , give me control need on markup. dom the dom extension allows operate on xml documents through dom api php 5. implementation of w3c's document object model core level 3, platform- , language-neutral interface allows programs , scripts dynamically access , update content, structure , style of documents. dom capable of parsing , modifying real world (broken) html , can xpath queries . based on libxml . it takes time productive dom, time worth imo. since dom language-agnostic interface, you'll find implementations in many languages, if need change programming language, chances know how use language's dom api then. a basic usage example can found in grabbing href attribute of element , general conceptual overview can found @ domdocument in php how use dom extension has been covered exte

wpf - windowsformhost cant load a usercontrol from another dll -

so have dll project contains many useful classes , controls me (lets call foo.dll). i'm making wpf app. need use of them in app. created usercontrol windows forms , referenced usercontrolforme foo.dll. it's shown, good. want insert usercontrol wpf form. looks this: <usercontrol x:class="flatrectangular_profile.usercontrol1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:ignorable="d" xmlns:uc="clr-namespace:flatrectangular_profile.uc" height="2093" width="717"> <grid name="grid"> <windowsformshost> <uc:windowsformsprofmanual ></uc:wi

angularjs - Angular Web API $http post exclude list -

i have web api (2) project has departments , employees. employee has department, , department has list of employees. now in frontend, when creating or editing employee, user must select department. when posting api, department contains list of employees (which causes invalid modelstate), how can prevent this? this relevant setup: models: public class employee : ientity, icreatedon, imodifiedon, imappable { [key] public virtual int id { get; set; } public virtual department department { get; set; } // .. other properties } public class department : ientity, imappable { [key] public virtual int id { get; set; } public virtual icollection<employee> employees { get; set; } // .. other properties } web api controller: public class employeescontroller : apicontroller { private readonly iemployeeservice _employeeservice; public employeescontroller(iemployeeservice employeeservice) { this._employeeservice = employe

html - What is wrong with my CSS code? -

i'm new html / css. want build web site stumbled across problem. my divs inside "content div" have blank space @ top line div, , can't seem figure out causing problem. can please help? apreciate it. thank you! <head> <meta charset="utf-8"> <title>vlad olar</title> <style type="text/css"> body { padding:0; margin:0; font-family:lato, segoe, "segoe ui", "dejavu sans", "trebuchet ms", verdana, sans-serif; background-color:#d8dce1; } .clear { clear:both; } .fixedwidth { width:960px; margin:0 auto; padding:0 0; } #topbar { background-color:#4c7585; height: 40px; width: 100%; } #front { height: 360px; width: 100%; background-color:#d8dce1; } #line { height:10px; width:100%; background-color:#4c4c4c; } #foto { height:120px; wid

Complete word-database for Java-App to check if a word is actually a legit word, is SQL appropriate in this case? -

i going write game in have have check if string of letters word or not. question how fastest least computation-able power possible (for instance old smart-phone). if possible not start-up time make quick , responsive app. i once did look-up first reading in word-file words appropriate sized hash-map of around 650,000 words*. (* might more, not sure if exhausted list yet). would sql database appropriate here? thinking of buying book can learn , implement one. have no idea how create hash-map, save later , load one. of hacker solution or technique used more often? make sense me learn sql or saving hashmap , later restoring it. a database sql appropriate if plan query every time need check word, not fastest solution; querying every single word slows down response time should use less memory if words number high (you must measure memory consumed db vs memory consumed map). checking if word inside map not computationally expensive, must calculate hash , iterate on array of

python - NER Tools for academic use -

i have research project needs best ner results . can please me best ner tools have python library. talking java, stanford ner seems best ceteris paribus. there lingpipe , illinois , others, take @ acl list . also consider this paper experimental comparison of several nercs.

zend framework2 - How to call on view on dyanmic actions in zf2 -

hello friends new in zf2. stuck @ 1 place. in project want to call 1 view on many action. url "baseurl/g/any-thing-from-from-database" want call view on "any-thing-from-from-database" action module or same. my g module have code on module.config.php return array( 'controllers' => array( 'invokables' => array( 'g\controller\g' => 'g\controller\gcontroller', ), ), 'router' => array( 'routes' => array( 'g' => array( 'type' => 'segment', 'options' => array( 'route' => '/g[/:action][/:id]', 'constraints' => array( 'action' => '[a-za-z][a-za-z0-9_-]*', 'id' => '[0-9]+', ), 'defaults' => array(

mongodb - Optimizing for random reads -

first of all, using mongodb 3.0 new wiredtiger storage engine. using snappy compression. the use case trying understand , optimize technical point of view following; i have large collection, 500 million documents takes 180 gb including indexes. example document: { _id: 123234, type: "car", color: "blue", description: "bla bla" } queries consist of finding documents specific field value. so; thing.find( { type: "car" } ) in example type field should indexed. far good. access pattern data random. @ given time have no idea range of documents accessed. know queried on indexed fields, returning @ 100000 documents @ time. what means in mind caching in mongodb/wiredtiger pretty useless. thing needs fit in cache indexes. estimation of working set hard if not impossible? what looking tips on kinds of indexes use , how configure mongodb kind of use case. other databases work better? currently find mongodb work quite on lim