Posts

angularjs - Why my build project Angular2 don't work in any apache server? -

i turn build angular project (ejected webpack) in server apache local in mac os sierra, , found problem resource file in index.html when turn same build in ubuntu project run correctly no error. i run build project in default server apache on mac os sierra 10.12.4 : result in mac os sierra 10.12.4 default apache (when used mamp pro in macos status of loading files 404) when run same build project in ubuntu 16.04 lts : result in ubuntu 16.04 lts default apache version used : angular: 2.4.8 angular cli: 1.0.0-rc.0 webpack: 2.2.1 its missing valid base href, make sure index.html contains <base href=".">

node.js - Individual nested subdocument Mongoose -

i'm trying embed subdocument main document,like this: this main document.js var mongoose = require('../../db/mongodb.connector'), schema = mongoose.schema; require('./document.model'); var document= mongoose.model('document'); require('./alert.model'); var alert = mongoose.model('alert'); var userschema = new schema({ name: { type: string } created: { type: date, default: date.now()}, alerts: {type: schema.objectid,ref: 'alert'}, documents: [{type: schema.objectid,ref: 'document'}], }); module.exports = mongoose.model('user', userschema); this embed document.js var mongoose = require('../../db/mongodb.connector'), schema = mongoose.schema; var alertsschema = new schema({ push: {type: string, default: "true"}, email: {type: string, default: "false"}, sms: ...

Extract the selected zone on a picture with opencv python -

Image
i'm using opencv detect face in picture , want ot extract it, have photo man , expected result jpg image seleted face i have detect face if can me extract face , save it! thank all you have add single line program. consider variable detected_face , , following: detected_face = img[y:y+h, x:x+w] cv2.imwrite('face.jpg', detected_face) you have .jpg file of face stored in directory

java - Split String with Spring EL -

i needs split string value $$ in spring context xml file, have tried below things, no luck :( can please? in java it's working this, public static void main(string[] args) { system.err.println("localhost$$8080".split("\\$\\$")[1]); } my tries <constructor-arg name="port" value="#{'#{config.getnode()}'.split('\\$\\$')[1]}" /> <constructor-arg name="port" value="#{'#{config.getnode()}'.split('$$')[1]}" /> <constructor-arg name="port" value="#{'#{config.getnode()}'.split('\$\$')[1]}" /> <constructor-arg name="port" value="#{'#{config.getnode()}'.split('\\u0024\\u0024')[1]}" /> note : please assume config.getnode() give value "localhost$$8080". it should below: <constructor-arg name="port" value="#{config.getnode().split(...

Issue running Octave on Linux cluster: cannot load libpcre.so.1 -

i'm new linux cluster , have compiled octave 3.8.0 on off-line sge server without root access. runs in interactive session on terminal, when use qsub submit batch job, received error message: /home/share/my_account/bin/octave-cli-3.8.0: error while loading shared libraries: libpcre.so.1: cannot open shared object file: no such file or directory found libpcre.so.1 in /usr/local/lib , , added echo $ld_library_path in batch job script, result turned out be: /opt/gridengine/lib/linux-x64:/opt/openmpi/lib:/lib:/usr/lib:/usr/local/lib:/opt/python/lib can fix problem?

Tpl direct print html in prestashop? -

Image
i craete custom module add textarea in product backoffice . when print textarea in tpl file in print direct html link i use print in tpl {if isset($belvg_textarea)} <div> {$belvg_textarea|unescape:'html'} {$belvg_textarea|escape:'html'} </div> {/if} and in module php file display public function hookdisplayfooterproduct($params) { $id_product = tools::getvalue('id_product'); $sampleobj = belvg_sample::loadbyidproduct($id_product); if(!empty($sampleobj) && isset($sampleobj->id)){ $this->context->smarty->assign(array( 'belvg_textarea' => $sampleobj->textarea, )); } return $this->display(__file__, 'views/frontend/sample.tpl'); } you should use nofilter beacause prestashop 1.7 escape html default html tags displayed in tpl file : {if isset($belvg_textarea)} <div> {$belvg_textarea nofilter} </...

html - Length of <p> element changing position of parent? -

i have set of 'product' divs inside wrapping containers. these product divs contain image, header , p text. reason, length of p text changing position of parent product div. here screenshot: https://gyazo.com/9504729541e6bee17a27e4121af3a1c9 the p , h2 elements both have 0 padding , margins. try keep code minimal possible. html: <div id="content" class="wrapper"> <div id="content-container"> <div id="product-container"> <div class="product-wrapper"> <div id="product" class="unhidden"> <div class="image-container"> <img src="assets/home-bg.jpg" class="thumbnail"> </div> <div class="product-text"> ...