Posts

How to move mongoDB database from from one server to another server using Ubuntu -

i need 1 help. need move mongodb database 1 server in ubuntu. suppose have database named video in 10.*.*.* , need move db lets 100.*.*.* . found below command. db.copydatabase(fromdb, todb, fromhost, username, password, mechanism) is above command able task. here can not understand should value assign mechanism . please me. that command should accomplish task. mechanism value optional. method copydatabase defaults scram-sha-1 if wire protocol version maxwireversion greater or equal 3 (i.e. mongodb versions 3.0 or greater). should need specify mechanism mongodb-cr if need authenticate version 2.6.x fromhost version 3.0 instance or greater. reference: https://docs.mongodb.com/manual/reference/method/db.copydatabase/#definition

html - header redirect on php form not working -

i'm new php , needed form. had working earlier it's deciding not work. appreciated. php section header going page in same directory <!-- php form e-mailer --> <?php if (isset($_post["submit"])) { $name = $_post['name']; $phone = $_post['phone']; $message = $_post['message']; $from = 'very local'; $to = 'myemail@gmail.com'; // business email address $subject = 'message local'; $body ="from: $name\n number: $phone\n message:\n $message"; // check if name has been entered if (!$_post['name']) { $errname = 'please enter name'; } // check if email has been entered , valid if (!$_post['phone'] || !filter_var($_post['phone'])) { $errphone = 'please enter valid phone number'; } //check if message has been entered ...

windows - Using Sendkeys to press a space in Jscript -

i have line in batch file: kbd(['{right}','{right}', '{tab}', '{enter}','{space}', '%s']); it runs fine until end. not press space button. need press space button uncheck checkbox. i found answer. if using kbd command want press space not use {space} use ' '. this: kbd(['{right}','{right}', '{tab}', '{enter}','{space}', '%s']); to kbd(['{right}','{right}', '{tab}', '{enter}',' ', '%s']);

c++ - Halide optimal scheduling -

i'm trying work out best schedule benchmark halide code , might missing because timing results don't make sense me. i'm using aot compilation, , here's algorithm part of code: imageparam input1(type_of<float>(), 3); imageparam input2(type_of<float>(), 3); func in1 = boundaryconditions::constant_exterior(input1, 0.0f); func in2 = boundaryconditions::constant_exterior(input2, 0.0f); f1(x, y, z) = (in1(x + 1, y, z) + in1(x, y, z) + in1(x - 1, y,z)); f2(x, y, z) = (in2(x + 2, y, z) + in2(x + 1, y, z) + in2(x, y, z) +in2(x - 1, y, z) + in2(x - 2, y, z)); res(x, y, z) = f1(x, y, z) + f1(x - 1, y, z) + f2(x - 1, y, z) + f2(x, y, z); for schedule have: f1.store_at(res, y).compute_at(res, yi).vectorize(x, 8); f2.store_at(res, y).compute_at(res, yi).vectorize(x, 8); res.split(y, y, yi, 8).vectorize(x, 8).parallel(y); res.print_loop_nest(); i use current_time function time execution of code. when use mentioned schedule both f1 , f2 execution time more...

algorithm - C - freeing memory of a binary tree using post-order traversal -

i want remove binary tree using post-order traversal . meaning left part of tree should removed first right 1 then remove whole tree , free memory in second function follows after. i'm not allowed changed arguments of function , can play inside of it: #include <stdio.h> #include <stdlib.h> #include <string.h> #include "telefonbuch.h" static inline bstree * create_node(unsigned long phone, char * name) { bstree * newnode = (bstree *) malloc(sizeof(bstree)); newnode->key.phone = phone; strcpy(newnode->key.name, name); newnode->left = null; newnode->right = null; return newnode; } void bst_insert_node(bstree * bst, unsigned long phone, char * name) { if (bst == null) { return; } if (bst->key.phone > phone) { if (bst->left == null) { bst->left = create_node(phone, name); return; } bst_insert_node(bst->left, phone, name); ...

android studio - Ionic framework/Could not reserve enough space for 2097152KB object heap -

ionic build android. when try above command i'm getting: this problem might caused incorrect configuration of daemon. example, unrecognized jvmoption used. error occurred during initialization of vm: could not reserve enough space 2097152kb object heap

node.js - how to form an object and push it into an array using http/https from the resultant of response -

i new nodejs , trying form array of products having invalid imageurls using "http.get", querying products mongodb collection, though used "promise" array printing first, not getting result form "hh.get" here code in server side var promise = require('bluebird'), hh = require('http-https') mongoose = require('mongoose'), collection = mongoose.model('collection'); function getinvalidimgurl(prodobj){ return hh.get(prodobj.imageurl,function(res){ if(res.statuscode == 404){ return { name:prodobj.name, imgurl:prodobj.imageurl } } }) } exports.samplefunc=function(){ collection.find({category:"electronics"}).exec(function(err,products){ if(err){ console.log(err) }else{ var imgarr=[]; //eg:products=[{name:"mobile",imageurl:"ht...