Posts

mysql - Error querying database using Diesel, r2d2, and r2d2-diesel -

i've set system using connection pooling system utilizing diesel , r2d2 , , r2d2-diesel serve api host web application. i've been following blog post basis has helped me set things up. however, i've made modification of switching mysql database backend; i've added necessary diesel features , assumed wouldn't issue. here's code use set connection pool (very same blog post): use diesel::prelude::*; use diesel::mysql::mysqlconnection; use r2d2::{ gettimeout, pool, pooledconnection, config }; use r2d2_diesel::connectionmanager; pub struct db(pooledconnection<connectionmanager<mysqlconnection>>); impl db { pub fn conn(&self) -> &mysqlconnection { &*self.0 } } pub fn create_db_pool() -> pool<connectionmanager<mysqlconnection>> { let config = config::default(); let manager = connectionmanager::<mysqlconnection>::new(format!("{}", db_credentials)); pool::new(config, mana...

material design - Close programmatically an overlay MUI CSS -

how close overlay created mui css ? for now, see : mui.overlay('off', modalel); but looks ugly since modalel has global reachable in function that'll trigger closing of overlay had same issue, yes way go declare modal global in view, using hide modal mui.overlay('off', modalel) using display modal mui.overlay('on', modalel);

docker odoo 9 install pika error -

i have simple docker build want achieve. pull base image odoo:9 , install pika library from odoo:9 run pip install pika but can't proceed i'm getting error. enter image description here btw, using docker in windows environment. my solution that, pull dockerfile official docker odoo. add line "&& pip install pika" shown in attached image. enter image description here build again , have customize docker image pika library installed.

java - Retrofit - Multipart Form with image upload and string array -

i creating android app using retrofit 2.0 send post request server. request allow user create group has name, array of users, , image. using multipart form in request because app uploads image server in form of file. this presenter, given fields needed request. public void submitgroup(@nonnull final string accesstoken, @nonnull final string userid, @nonnull final string groupname, @nonnull final string groupiconuri, @nullable final string[] members) { file file = new file(groupiconuri); requestbody requestowner = requestbody.create( mediatype.parse("multipart/form-data"), userid); requestbody requestgroupname = requestbody.create( mediatype.parse("multipart/form-data"), groupname); /** * requestmembers string[] containing member * id. field having trouble * making re...

recursion - what is the base case here in this recursive function?? How its working actually? -

what base case here ?? functional how it's working? int ispali(char *s, int l, int r) { return ((l == r) || (s[l] == s[r] && ispali(s, l+1, r-1))); } int main() { char str[100]; scanf("%s", str); if(ispali(str, 0, strlen(str)-1)) printf("palindrome\n"); else printf("not palindrome\n"); } it's in line of function. remember short-circuit logic in evaluating expressions. or can changed to if (l == r) return true; else return (s[l] == s[r] && ispali(s, l+1, r-1)); of course, can apply short-circuit else part: else if s[l] == s[r] return ispali(s, l+1, r-1); else return false;

soap client - How to create wsse header with python-suds and adding attributes to it -

i trying add wsse header xml envelope interact webservice. the xml should below <?xml version="1.0" encoding="utf-8"?> <soap-env:envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.testingsite.com/------something" xmlns:ns2="http://www.testingsite.com/-----something" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:header> <wsse:security mustunderstand = "true"></wsse:security> </soap-env:header> <ns0:body> <mainrequest></mainrequest> xmlns="http://www.everythingisosm.com/something"> <block1> xmlns="http://www.everythingisosm.com"> </block1> <requestparameters/> </mainrequest...

Not able to launch DynamoDB Storage Backend for Titan with Gremlin Server on Amazon EC2 by using a AWS CloudFormation template -

i trying configure dynamodb storage backend titan gremlin server on amazon ec2 using aws cloudformation template, following link here under prerequisites mentioned need gremlin-server , dynamodb.properties files. q1. have got files github link . these correct files , can use or need modify contents of these files ? q2. on using these files is, able create cloudformation stack creates ec2 instance not able ssh ec2 instance . not creating gremlin server , no tables in dynamodb, per documentation should. not getting doing wrong? any highly appreciated. please try new cloudformation template available on janusgraph branch . tested yesterday , appears work.