Posts

mongoose - Find all subdocuments that match with node.js mongodb -

Image
i have schema looks like: var user = new schema({ id: string, firstname: string, lastname: string, password: string, username: string, position: [{ title: string, location: string, start: string, term:number, description:string, date: {type: date, default: date.now} }] }); i have 2 users, each 2 embedded position documents. user1: "position" : [ { "title" : "business analyst", "location" : "dublin", "start" : "may 2017", "term" : 6, "description" : " lorem ipsum dolor sit amet, consectetur adipiscing elit. vivamus quis erat vitae dsit amet, consectetur adipiscing elit. vivamus quis erat vitae dolor tempus euismod non in mi", "_id" : objectid("58d6b7e11e793c9a506ffe0f") }, { "description...

Which version of Jsp is the lastest? -

i downloaded jsp-api https://repo.maven.apache.org/ , found versions weird. maven dependecies: <dependency> <groupid>javax.servlet.jsp</groupid> <artifactid>jsp-api</artifactid> <version>2.1</version> </dependency> <dependency> <groupid>javax.servlet.jsp</groupid> <artifactid>jsp-api</artifactid> <version>2.2</version> </dependency> version2.2 has 3 packages: javax.servlet.jsp javax.servlet.jsp.el javax.servlet.jsp.tagext version2.1 has 4 packages: javax.el javax.servlet.jsp javax.servlet.jsp.el javax.servlet.jsp.tagext some classes deprecated in javax.servlet.jsp package, javax.servlet.jsp.el.elexception replaced javax.el.elexception . however, in version2.2, there isn't javax.el package. why javax.el package disappear in version2.2? in addition, searched jsp-api in http://mvnrepository.com , found version2.3.1. after downloading it,...

Social Media sharing Buttons in Ruby on Rails -

i'm trying add custom social media sharing buttons in blog app in ruby on rails. important me pop-up window show sharing "post" meaning want include javascript. unfortunately code not work: <!-- twitter --> <a oneclick="javascript:window.open('http://twitter.com/share?text=<%= @post.title %> martin bortowski - &amp;url=<%= url_for([@post, {only_path: false}]) %>', '_blank', 'width=800, height=500, top=200, left=300');void(0);"><i class="fa fa-twitter"></i></a> <!-- facebook --> <a oneclick="javascript:window.open('http://facebook.com/sharer.php?u=<%= url_for([@post, {only_path: false}]) %>', '_blank', 'width=800, height=500, top=200, left=300');void(0);"><i class="fa fa-facebook"></i></a> <!-- google plus --> <a oneclick="javascript:window.open('https://plus....

r - How to export syntax highlighted RMarkdown code to PDF? -

for thesis, attach code (not output) of .rmd document, ideally pretty syntax highlighting rstudio does. is there way export highlighted rmarkdown code file, ideally pdf? i check out. http://rmarkdown.rstudio.com/pdf_document_format.html#appearance_and_style i think should simple --- title: "habits" output: pdf_document: highlight: tango ---

scala - Time to live on host-level akka-http client connection -

i have service running on production, calls dependency service using : http().newhostconnectionpoolhttps[promise[httpresponse]] each time new stack of dependency service deployed, service dns cache updated setting : java.security.security.setproperty("networkaddress.cache.ttl" , "60") problem connections inside pool lives on forever , resolves dns once @ initiation time. keeps calling old dependency stack . i searching away set max connection's time live. akka-http has functionality build in, can settings in reference config in short have put following key config (application.conf likely): akka { io { dns { inet-address { # set time cache name resolutions # possible values: # default: sun.net.inetaddresscachepolicy.get() , getnegative() # forever: cache forever # never: no caching # n [time unit]: positive timeout unit, example "30 s" positive-ttl =...

linux - Can sar display date and time? -

on centos, can sar command display both date , time? found sar can display time : 17:42:40 cpu %user %nice %system %iowait %steal %idle 17:42:42 0.31 0.00 0.69 0.06 0.00 98.93 i expect this: 2017-03-28 17:42:40 cpu %user %nice %system %iowait %steal %idle anyone knows how format? in sar output first displays date below =============== linux 2.6.32-642.12.1.e16.x86_64 (ap.pm.pk) 2017-05-03 . _x86_64 . (24 cpu) 12:00:01 cpu %usr %nice %sys %iowait %steal %irq %soft %guest %idle 12:10:01 30.70 0.00 2.2 2.95 0.00 0.00 0.21 0.00 63.88 =============== to check older/previous date sar report need run sar command on var/log/sysstat/sa* file sar -f /var/log/sysstat/sa13 here 13 date

unity3d - Unity Multiple displays not working -

i using unity 5.4.1f1 personal edition , working on windows standalone build. want use multiple displays in game. have 2 cameras , set target display of 1 camera display 1 , target display of second camera display 2. also, have activated display display.displays.length one on editor on build. so not display on second screen. should display on second screen? you need activate each additional display in code display.activate . see the docs says: the best time activate additional displays upon creating new scene. way attach script component default camera. make sure call display.activate once during startup. may find helpful create small initial scene test it. and example, in start() method: if (display.displays.length > 1) display.displays[1].activate(); if (display.displays.length > 2) display.displays[2].activate(); note: once monitor has been activated, cannot deactivate it.