Posts

Showing posts from July, 2015

create a transperant layout on top of activity except some particular view -

i trying create user guide. in application having button in fragment move user next important activity. want guide user regarding same per image given below. tried showcase view unable acheive same becase of "ok" button don't want. please me how can create transperant layout text , image on same click here see image want overlay screen same screen how there in image

javascript - AngularJS error handler is not working for radio button coupled with input -

i'm trying add radio button 2 field all , number(this input field) (pls refer image attached) in i'm trying add error handler input field. have patter numbers "/^[0-9]{1,5}$/" (from 1 5) , if there mismatch in pattern want display error. <div id="_work"> <md-input-container class="md-input-has-value"> <label>work funnnnn</label> <md-radio-group layout="row" ng-model="data.group" ng-change='changecolor(data.group)'> <md-radio-button value="all color" class="md-primary"> </md-radio-button> <md-radio-button value="number" class="md-primary"><left empty></md-radio-button> </md-radio-group> <md-input-container md-no-float style="float: right; margin: 0px;"> <input name="num" ng-model="number" placeholde

module - Prestashop displayPaymentReturn hook url -

i new prestashop developer , trying create paymentmodule. have got show payment method can not proceed purchase because not know hot works. does know should redirect run hooddisplaypaymentreturn method? i happy if explain me complete navigation map make purchase. anyway, can find relation between hooks , pages? when have new module payment rely on simplest provided prestashop: bankwire. inside can find 3 hooks. hookpayment: public function hookpayment($params) { if (!$this->active) return; if (!$this->checkcurrency($params['cart'])) return; $this->smarty->assign(array( 'this_path' => $this->_path, 'this_path_bw' => $this->_path, 'this_path_ssl' => tools::getshopdomainssl(true, true).__ps_base_uri__.'modules/'.$this->name.'/' )); return $this->display(__file__, 'payment.tpl'); } hookdisplaypaymenteu: public fun

sql - COUNT(DISTINCT) in subquery -

i trying retrieve each loan number, count of how many times loan number appears in each month. in cases loan number appears twice in month, want counted once in each month. test , rd columns not giving me need. here have: select [month], one, loannumber, two, three, four, ... count(distinct loannumber) test, count(loannumber) on () rd tablename lc [month] ='12-2016' group [month], one, loannumber, two, three, four, ... please help! i think need add partition by clause windowing count() expression, , remove group by , this: select [month], one, loannumber, two, three, four, ... count(*) on (partition month, loannumber) numberofoccurences tablename lc [month] ='12-2016'

what connection is taken at runtime in SSIS -

1) have ssis package , using package parameter configure connections point dev. db . if use environment variables pass different connection value pointing test, after deploy ssis catalog , further schedule using sql agent job. connection info. taken @ runtime , when job scheduled run. dev or test conn?? 2) have ssis package , using project parameter configure connections point dev. db . if use environment variables pass different connection value pointing test, after deploy ssis catalog , further schedule using sql agent job. connection info. taken @ runtime , when job scheduled run. dev or test conn?? answer on first question depends on whether using ssis package configurations or not. possibly not, since talking environment variables, if still , use environment variables - see microsoft article on that, , note behavior changes ssis 2008 version. if using ssis catalog , package/project variables, mind simple rule - more specific wins. in case, following precedence tak

instagram api - subscript out of bounds - R -

i want connect instagram api , getting data r. got subscript out of bounds error @ end. please me sort out. thanks app_name<-"hamidtt" client_id<-"xxx" client_secret<-"xxx" scope="public_content" instagram <- oauth_endpoint(authorize = "https://api.instagram.com/oauth/authorize",access = "https://api.instagram.com/oauth/access_token") myapp <- oauth_app(app_name, client_id, client_secret) ig_oauth <- oauth2.0_token(instagram, myapp,scope="public_content", type = "application/x-www-form-urlencoded",cache=false) # waiting authentication in browser... # press esc/ctrl + c abort # authentication complete. tmp <- strsplit(tostring(names(ig_oauth$credentials)), '"') token <- tmp[[1]][4] username<-"hrouhani" user_info <- fromjson(geturl(paste('https://api.instagram.com/v1/users/search?q=',username,'&access_token=',token,sep="

php - Echoing results of a SELECT COUNT(*) query -

with website showing different products in lots of different settings ensure number of results correct want echo them php. far have tried echoing them way know , hasn't worked. the code on page want echo on contains require function files @ top. have tried: <?php //call count_stock() function $result_count = count_stock(); ?> <p>showing 1-9 of <?php echo $result_count['count(*)']; ?> results.</p> <p>showing 1-9 of <?php echo $result_count[0]; ?> results.</p> <p>showing 1-9 of <?php print_r($result_count[0]); ?> results.</p> my function execute query is: //create function count get_stock function count_stock() { global $conn; //query database count data entries in stock table $sql = 'select count(*) stock'; //use prepared statement enhance security $statement = $conn->prepare($sql); $statement->execute(); $result_count = $statement->fetchall(); $statement-

mysql - join 2 tables to bring multiple column's using one single join -

i have table table1 pid_x pid_y count b 5 c 10 b 20 c e 3 d g 7 e f 10 e b 20 and on (more 1 million rows) also have master_table consists details pid rating_pid price_pid 2 10 b 4 20 c 1 30 d 3.5 40 e 2.4 50 f 1.5 60 g 3.8 70 (and on, huge table master_table ) also have score_table . pid score_p_id 7 b 1 c 4 d 3.5 e 4 f 5 g 3 what looking is, final_table has columns pid_x pid_y final_score price_pid_y rating_pid_y price_diff_pidy/x explanation. create final table has column's pid_x , pid_y , final_score pid_y (score +count) score table pid=pid_y , join price , rating of pid_y master

node.js - Mongoose not inserting data -

i'm sending post request api made. post request sends data stored in local database. var loc = require('../models/locationschema'); module.exports.locationscreate = function(req, res){ console.log(req.body.name); console.log(req.body.address); loc.create({ name: req.body.name, address: req.body.address, }, function(err, data){ console.log('inside callback!'); if (err){ res.send('error'); } else { res.send('success'); } }); console.log('reached end of function'); }; here schema, var locationschema = new mongoose.schema({ name: {type: string, required: true}, address: {type: string, required: true}, }); module.exports = mongoose.model('location', locationschema); mongoose connecting properly. , router correctly handling post request. i'm sending post request using postman name , address. nothing happens, , after few seconds, 'could not response'. nothing gets a

python - Registering with Django not working -

i have create website project , encountered problem registering simple user django : seems data register form not saved in database. it nice if knew did wrong (i beginner django) because can't seem find problem from. here files : models.py : from django.db import models # create models here. class utilisateur(models.model): pseudo = models.charfield(primary_key=true, max_length=100) password = models.charfield(max_length=50) nom = models.charfield(max_length=200) prenom = models.charfield(max_length=200) account_choices = ( ("u", "utilisateur"), ("h", "historien"), ("f", "famille"), ) compte = models.charfield( max_length=1, choices=account_choices, default="u" ) datenaissance = models.datefield(null=true, blank=true) sexe_choices = ( ("m", "masculin"), ("f", "féminin"),

spring - HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: DataSource must not be null -

sou novo com spring, ao fazer uma consulta em uma classe dao, aparece o seguinte erro: meu spring-context.xml é: <mvc:interceptors> <bean class="br.com.softwarescomerciais.os.interceptor.autorizadorinterceptor"></bean> </mvc:interceptors> <mvc:default-servlet-handler/> <bean id="datasource" class="org.springframework.jdbc.datasource.drivermanagerdatasource"> <property name="driverclassname" value="com.mysql.jdbc.driver"/> <property name="url" value="jdbc:mysql://192.168.101.178/sc"/> <property name="username" value="sfilho"/> <property name="password" value="123"/> </bean> http status 500 - request processing failed; nested exception java.lang.illegalargumentexception: datasource must not null type: exception report message: request processing failed; nested exception java.lang.ill

bash - assign a variable with spaces in shell -

i have file has following text written - hello h.i. b-y-e i want read value variable. have defined function - function read() { p=`cat $1`; echo "$p"; $2=`echo "$p"`; } i following error - hello h.i. b-y-e -bash: v=hello: command not found however, when - p=`cat $filename` text=`echo "$p"` i have desired string text. can please explain difference in behaviour way acheive want do. see wordsplitting means in shell context all need store in variable is, filecontent="$(<input-file)" printf "%s\n" "$filecontent" hello h.i. b-y-e (or) if think not deserve 2 lines, use single-line as printf "%s\n" "$(<input-file)" (or) using function as function getfilecontents() { local input=$1 printf "%s" "$(<input)" } newvariable="$(getfilecontents input-file)" printf "%s\n" "$newvariable" hello h.i. b-y-e (and)

c++ - Is there a way to set thread stack size using GCD? -

i have multiplatform code has recursive calls (running in thread, not main one), , in cases default stack size not enough recursivity depth. solve in windows using /stack compiler flag: /stack:2097152 (2mb, default: 1mb) but in osx use gcd. readed implemented on pthreads, not able find way set threads' stack size pthreads (using pthread_attr_setstacksize). i tried using linker flag -wl,-stack_size -wl,1000000, doesn't matter amount set here, application crashes @ same recursivity depth level. seems affects main thread, not ones created after gcd. i tried setting system stack size throught ulimit -s 32768 (default: 8192), not affect recursivity depth level can achieve either.

javascript - How to push only the elements not found in my array -

so question asking me remove punctuation word , know how cross-reference tho arrays check if element exists in array checked how push values not in punctuation array? function removepunctuation(word){ var punctuation = [";", "!", ".", "?", ",", "-"]; var chars = word.split(""); var puncremoved = []; for(var = 0; < chars.length;i++){ for(var j = 0; j < punctuation.length;j++) { if(punctuation[j].indexof(chars[i]) !== 0) { puncremoved.push(i) } } } return puncremoved; } word.replace(/[;\!\.\?\,-]/g, ''); you might find this interesting :d

signals - VHDL: why is NOT 'Z' = 'X' -

in vhdl, why is: not 'z' = 'x' where z high impedence , x unknown (see std_logic signal types below). context: applicable vhdl. given exam question 'z' signal sent through inverter , yielded 'x'. not understand why occurs , why answer not 'z'. 'u': uninitialized. (signal hasn't been set yet) 'x': unknown (impossible determine value/result) '0': logic 0 '1': logic 1 'z': high impedance (signal source when source makes no effective contribution resolved value of signal) 'w': weak unknown signal (can't tell if should 0 or 1) 'l': weak signal should go 0 'h': weak signal should go 1 '-': don't care (i have made comment can't) in context of have said, if input inverter (or component matter) 'z' (driving high impedence), expect output be? result must fall within set of defined values std_logic signal. if no value being driven on inpu

Running distributed tensorflow on machines with different versions of Tensorflow -

in particular i'm interested in happens if tensorflow installed on parameter server different tensorflow installed on worker. (e.g: different versions of tensorflow). how distributed tensorflow reconcile potential differences in execution code between workers , parameter servers? i'd it's highly discouraged. depending on how many versions differ, in cases, errors. in base cases, things seemingly run e.g. nothing trains , you'll have hard time figuring out why....

javascript - Get the row index of bootstrap table in click without using jquery -

i have bootstrap table in react project. want index of row click on. want onclick = {this.handleclick} , in handleclick function want index of row. possible it. of solutions available shows using jquery , don't want use jquery. want using javascript only. table <table classname='flags-table' responsive hover> <thead> <tr> <th> </th> <th> time in </th> <th> time out </th> <th> type </th> <th> category </th> </tr> </thead> <tbody> {

Cannot make Connection to SQLite database Swift 3 -

i'm using sqlite library , in usage says let db = try connection("path/to/db.sqlite3") have sqlite database located in documents. when try make connection throw error call can throw errors cannot thrown out of property initializer here's code : import uikit import sqlite class searchviewcontroller: uiviewcontroller, uitextfielddelegate { let db = try connection("/users/macbookpro/documents/db.sqlite") //error let categoryvc = categoryviewcontroller() let usefullvc = usefullviewcontroller() let mapvc = mapviewcontroller() let eventvc = searchresultonlinevc() @iboutlet weak var searchtextfield: uitextfield! override func viewdidload() { super.viewdidload() self.title = "search" searchtextfield.delegate = self } override func didreceivememorywarning() { super.didreceivememorywarning() } } i try put connection in viewdidload still doesn't work what's wrong? since connection initializer can throw ex

How to create view's in meteor using mongoDb -

i new meteor , requirement create views create document in mongo , share multiple parents . so, how create view share same document 2 or more parents logically not physically. thanks in advance help meteor not have view concept on database level. you define data in mongo collection , make them available client side using publications. by default, publication return results 1 collection. if want return data based on 'joins' between collection , can use package : reywood:publish-composite when data change in collection, whole publication recomputed , have new version of data.

javascript - How to link page using href in PHP MVC -

i want know, how linkup page in php mvc. link page, it's not working. it's shows nothing on webpage. in href link add controller/model/view page link, stuck overit how solve this, please help! link id wrong... <a href='../../database/databaseconnection.php/model/model.php/controller/controller.php?controller=show_data&action=usercreationview.php'></a> ofc won't show anything. syntax looks this: <a href="{your link}">{your visible part}</a> in case visible part missing

javascript - How can I have a responsive graph with highcharts? -

Image
basically, have container divided col-xs-3, col-xs-7(which holds graph), , col-xs-2 , , 3 tables underneath same bootstrap classes(col-xs-3,...). on container have graph created highcharts, , want aligned table underneath(as shown purple arrows),this want result, , responsive when window width changes: right have this: i tried approches moving graph left, scale graph on different media queries, these work on specific width. highcharts.chart('container', { chart: { renderto: '' }, title: { text: '' }, credits: { enabled: false }, xaxis: { linewidth: 0, minorticklength: 0, ticklength: 0, labels: { rotation: -45, enabled: false

azure sqldw - LOGINs on new MASTER for restored database -

i have new logical server on restoring existing azure sql data warehouse database different logical server. i've reviewed https://docs.microsoft.com/en-us/azure/sql-data-warehouse/sql-data-warehouse-restore-database-portal need understand how logins handled on new master database. users exist on database restored , relate logins on old master database. do logins have manually created on new master before restore occurs? the logins have created on master of new logical server. can happen anytime before re-create users in dw. after have logins created, need drop , re-create users in dw restored new logical server. associate users in dw logins in master. if have aad integration on-premises ad in place , enabled dw, these steps not needed.

angular - How to implement a flip effect using Anuglar 2 animations? -

i have been using pure css flip of cards in project solution not proper one. can present flip in angular 2 on click of button? have found 1 in angularjs https://codepen.io/zbeyer/pen/oxqrzg <div ng-app="cardflipper" ng-controller="appcontroller"> <h1>card flipping angularjs</h1> <div class="flip-container"> <div class="flipper" ng-click="flipcard()" ng-class="{'fliptofront':iscardrevealed, 'fliptoback':!iscardrevealed}"> <div class="back" ng-class="{'face-hidden':hidebackface}"> </div> <div class="front" ng-class="{'face-hidden':!hidebackface}"> <h1>{{currentcard.title | uppercase}}</h1> <p ng-if="currentcard.icon">{{currentcard.icon}}</p> <br ng-if="curre

arrays - Notice: Undefined index - PHP Error -

i'm trying follow lynda's php tutorial , i'm stuck validations pages crud. i've been trying figure out went wrong can't seem find error coming though it's stated in error. i'm confused because i'm using same validation creating subject , executes fine creating page, i'm getting error - notice: undefined index: visible in d:\wd-stuff\ampps\www\cms.widgetcorp\includes\validation.php on line 14 . below full code i'm working on. ps: have radio input named visible. ps2: i've read link tackled undefined index didn't answer question. same validation works fine form (new_subject.php) same new_page.php. new_page.php require_once '../includes/session.php'; require_once '../includes/functions.php'; require_once '../includes/connection.php'; require_once '../includes/validation.php'; getselectedcontent(); if (!$is_subject) { redirect_to("manage_content.php");

node.js - Find object inside of a big document -

this question has answer here: retrieve queried element in object array in mongodb collection 10 answers being new nosql / mongodb wonder how can specific object potentially big document. a document inside of project collection looks this: { "_id" : objectid("5935a41f12f3fac949a5f925"), "project_id" : 13, "updated_at" : isodate("2017-06-28t01:43:50.994z"), "created_at" : isodate("2017-06-05t18:34:07.150z"), "owner" : objectid("591eea4439e1ce33b47e73c3"), "name" : "my demo project 1", "visibility" : 0, "uploaded_files" : [ { "fieldname" : "sourcestrings", "originalname" : "log_20-6-2017_19-03-24-626.txt", "encoding&q

r - Aggregate info by quarters in data.table, setting a new name to column used in by -

i have data.table result aggregating bigger one: data.table(period = c('2018.01', '2018.02'), sales = c(8850, 7950), qty = c(650, 650)) period sales qty 1: 2018.01 8850 650 2: 2018.02 7950 650 what need achieve , can't way it, aggregate info quarters, result be: data.table(period = c('2018.01', '2018.02', '2018q1', '2018'), sales = c(8850, 7950, 16800, 16800), qty = c(650, 650, 1300, 1300)) period sales qty 1: 2018.01 8850 650 2: 2018.02 7950 650 3: 2018q1 16800 1300 4: 2018 16800 1300 i've tried with: dt = rbind(dt, dt[, lapply(.sd, sum), = .(period), .sdcols = c('sales', 'qty')]) but duplicated columns: period ums men 1: 2018.01 8850 650 2: 2018.02 7950 650 3: 2018.01 8850 650 4: 2018.02 7950 650 besides, i'd need rename period cell q1 (q2, q3, q4) quarters , year total. how done? edit although accepted answer correct, i've reworked didn't need add column

sql server - How to delete multiple rows having same value in one column? -

i have table income want delete all, one, rows have same value in column "date", 2016-05-08. can help? tia. i using row number: with todelete ( select i.*, row_number() on (partition date order date) seqnum income ) delete todelete todelete seqnum > 1; you can control which row kept adjusting order by clause.

xamarin.android - Xamarin Android Player stuck on acquiring IP -

trying launch xap , it's stuck loading, checked settings , it's stuck on 'acquiring ip'. i've tried repair in control panel& programs, same thing. worked fine yesterday, didn't change anything. using api 19, , windows 7. any appreciated. xamarin android player discontinued, recommended use android simulators visual studio or google x86 emulators

angular - Continuous flashing/blinking of text line -

i'm trying apply fade-in, fade-out animation on line of text. want keep doing on regular interval (something text flashing). using observable state triggering. this animations array: animations: [ trigger('showhide', [ state('invisible', style({opacity: '0', visibility: 'hidden'})), state('visible', style({opacity: '1', visibility: 'visible'})), transition('invisible <=> visible', animate('2s linear')) ]) ] variables i'm using: heading = 'invisible'; index: number = 0; headingarray = [ "heading 1", "heading 2", "heading 3" ] observable: observable.interval(2000) .subscribe(x => { console.log(x); this.heading = (this.heading == 'visible') ? 'invisible' : 'visible'; this.index = (x / 2) % 3 }) and here's html: <h2 [@sh

mapping - How to add global resource to specify output XML xsd format in MapForce? -

i started learn mapforce couple of days , able create simple mapping generate xml file csv file. problem how can use mapforce global resources specify xml xsd format? this sample xml generated but saw couple of resources show can loaded mapforce global resources. please can have experience on adding global resources in specify xsd file in mapforce mapping (in xml output), can share way can implemented. i try add resource mentioned in below reference http://manual.altova.com/mapforce/mapforcebasic/index.html?mffdefining__adding_a_global_reso.htm this global resource try add in map but when try preview mapping gives following error .

sql - Is there any performance penalty with using INSERT OR REPLACE followed by a SELECT? -

i have 2 tables phraseid primary key in both , modified number of seconds since 1970. modified part of data load not required unless makes updating easier. if can without use insert or replace phrasesource columns phraseid, text, modified phrase columns phraseid, text, modified the phrasesource table contains 5010 rows (some new , changed rows) phrase table contains 5000 rows. update phrase table new , changed rows phrasesource. note application doesn't need show modified data added in case make easier inserting or updating. here's came with. can let me know if way update , insert. insert or replace phrase(phraseid, text) select ps.phraseid, ps.text phrasesource ps if there's better way (perhaps using modifed column contains number of seconds since 1970 when row last modified @ source) appreciate suggestions. 5000 rows nothing; delete , copy entire table. if want minimize amount of changes written, can done modified column: first delete row

php - Laravel with two different lifetime sessions -

i'm trying implement 'remember me' login using laravel framework. when user checks 'remember me' box, laravel keeps session data month. if user unchecked it, want keep session until user closes browser. i know how control session when 'remember me' checked. configured sessions in config/session.php below: 'lifetime' => 43200, 'expire_on_close' => false, and i'm using sessions global session helper session(['accesstoken' => some_access_token]); session::flush(); and on. but don't know how work when user logging in 'remember me' unchecked. tried find way control configuration 'expire_on_close' => true, on fly, based on user input, failed. please tell me how keep 2 different session lifetime configuration within 1 laravel framework. or if i'm trying 'remember me' feature in wrong way, please guide me. basically, stated above, i'd keep session in month 'remember

html - Image not shown in table in PHP from mysql -

i'm doing small site product descriptions users, pictures essential making choice of product. it's run xamm-server, php , mysql. database running smoothly , php gets data database. in database, there paths images. have 3 different paths in database, 1 image, 1 root , 1 linking image on web. end getting blank instead of image. , if @ sourcecode page looks fine. going wrong? php code: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <?php $con=mysqli_connect("localhost","root","","headsets"); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } ?> <head> <link rel="stylesheet" href="styles.css"> <meta http-equiv="content-type" content="text/html; charset=u

forms - TYPO3 Indexed Search Url on submit -

i use typo3 7.6.10 use indexed_search 7.6.0 when submit form go target page , results. url of target page is: search.html?tx_indexedsearch_pi2%5baction%5d=search&tx_indexedsearch_pi2%5bcontroller%5d=search i want remove action , controller variable form url get: search.html i can adding configuration real url this: 'searchconfiguration' => array( array( 'getvar' => 'tx_indexedsearch_pi2[action]', 'valuemap' => array(), 'nomatch' => 'bypass' ), array( 'getvar' => 'tx_indexedsearch_pi2[controller]', 'valuemap' => array(), 'nomatch' => 'bypass' )),'135' => 'searchc

php - optimisation of curl request -

i'm developing task report wrike , know if it's possible make faster. i'm not confortable curl, i'm not use use it. welcome :). $ch = curl_init(); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_customrequest, "get"); $headers = array(); $headers[] = "authorization: bearer ".$_cookie["wrike_token"]; curl_setopt($ch, curlopt_httpheader, $headers); foreach($folderarray $currentfolder){ curl_setopt($ch, curlopt_url, "https://www.wrike.com/api/v3/folders/".$currentfolder->id."/tasks?completeddate={'start':'2016-10-11t00:01:00z','end':'2016-10-11t23:59:00z'}"); $result = curl_exec($ch); $result = json_decode($result); if(!empty($result->data)){ foreach($result->data $currenttask){ echo $currentfolder->title." : ".$currenttask->title."<br>&quo

javascript - How to install font locally from web page -

is there way install font webpage display button , if user click on font install on local system. don't know possible or not through javascript or other client side. not way describe it, no. can hook button trigger download font (or file, matter), user still have install font after has been downloaded computer. the browser not initiate action in operating system: incredibly insecure if allowed to, because fonts complicated bits of software, , might able take advantage of bug in 1 of many font parsers. if make browser "force" font installed user, able sorts of bad stuff depending on how bad bug was, remote code execution crashing computer silently taking on computer entirely.

ocaml - Expression of different type expected -

i have following code: type point = { x : float; y : float; z : float } type dpoint = { dx : float; dy : float; dz : float } type physical_object = { position : point; velocity : dpoint } let move p dp = {x = p.x + dp.x; y = p.y + dp.y; z = p.z + dp.z} i getting error: file "code.ml", line 4, characters 21-24: error: expression has type float expression expected of type int p.x highlighted why this? not referencing record's fields correctly? operator + has type int -> int -> int , applicable values of type int . use +. operator floats, (and *. , /. correspondingly other operations). ocaml doesn't have operator overloading (aka ad hoc polymorphism ), doesn't play type inference. however, makes code more explicit, can considered benefit.

java - Is it possible to use @AutoConfigureRestDocs with restassured instead of mockmvc? -

spring boot 1.4 introduces @autoconfigurerestdocs (see http://docs.spring.io/spring-boot/docs/current-snapshot/reference/htmlsingle/#boot-features-testing-spring-boot-applications-testing-autoconfigured-rest-docs ). docs state: it automatically configure mockmvc use spring rest docs , remove need spring rest docs' junit rule. i use restassured support of spring rest docs instead of mockmvc. can @autoconfigurerestdocs ? no, not @ moment. @autoconfigurerestdocs builds on top of spring boot's testing support being able auto-configure mockmvc . there's no support auto-configuring rest assured rest docs auto-configuration build upon. if it's you'd see in spring boot, please open enhancement request .

go - Create variable of type Map[string]interface{} in gRPC protoc buffer golang -

i'm using grpc golang communicate between client , server application. below code protoc buffer. syntax = "proto3"; package trail; service trailfunc { rpc helloworld (request) returns (reply) {} } // request message containing user's name. message request { map<string,string> inputvar = 1; } // response message containing greetings message reply { string outputvar = 1; } i need create field inputvar of type map[string]interface{} inside message data structure instead of map[string]string. how can achieve it? in advance. proto3 has type any import "google/protobuf/any.proto"; message errorstatus { string message = 1; repeated google.protobuf.any details = 2; } but if @ implementation, as message { string type_url = 1; bytes value = 2; } you have define such message possibly using reflection , intermediate type. see example application https://github.com/golang/protobuf/issues/60

r - filter points in dataframe -

i have dataframe, in group_by , each group have different number of rows. example write group: my data: x y 323 50 324 86 325 97 326 315 327 76 328 63 329 15 330 13 331 19 332 75 333 102 334 130 335 111 336 200 337 58 338 83 339 43 i want filter rows have rows match min(x), max(x), min(y), mydata%>%filter(x==min(x)|x==max(x)|, y==min(y)) but want filter 2 rows indicated ( <- ), @ half between min(x) , min(y), , @ half between min(y) , max(x). my data: x y 323 50 <- min(x) 324 86 325 97 326 315 <- or next 1 have point in dataframe 327 76 328 63 329 15 330 13 <- min(y) 331 19 332 75 333 102 334 130 335 111 <- 336 200 337 58 338 83 339 43 <-max(x) is there condition include in filter have 5 points?

android - Implementing Tinder like Tab bar with ViewPageIndicator Library -

i using android viewpageindicator library achieve tinder tab bar. i need implement animation provided in titlepageindicator class , made class support text title on tab bar. how can add icons on tab bar titlepageindicator class animation using viewpageindicator libray?

Incrementing enum values by a fixed number in C -

is possible increment values of fields of enum fixed number? say if have enum typedef enum { val_a, val_b, val_c }enum_x; i want define enum in such way values may increment fixed number (other 1 default). result in me having (let's number 4) val_a = 4; val_b = 8; val_c = 12; also if above answer true, , there such mechanism, possible make values increment sequentially? say i've same enum redefined typedef enum { #ifdef val_a, #endif #ifdef b val_b, #endif #ifdef c val_c, #endif val_end }enum_x; and if above enum define , c, should get val_a = 4; val_c = 8; but if define b , c, should get val_b = 4; val_c = 8; and if define a, b , c, should get val_a = 4; val_b = 8; val_c = 12; no, there's no such support in language. you might able more or less horrible using macros of course. think whole "automatically" part troublesome, people can come troublesome preprocessor const

uvm - uvm_port_base class derivation correct hierarchy -

Image
the above 2 diagrams contradicting. can please clarify correct class inheritence class? below mentioned link both in sequential order https://www.dvteclipse.com/uvm-1.2_public_api/uvm_pkg-uvm_port_base.html it little sneaky because both true. looking @ source, first line declare uvm_port_base virtual class uvm_port_base #(type if=uvm_void) extends if; uvm_port_base inherits if , parameter. default value of if uvm_void . for example, many tlm classes override parameter class extend from. example: class uvm_blocking_put_export #(type t=int) extends uvm_port_base #(uvm_tlm_if_base #(t,t)); uvm_tlm_if_base extends form uvm_if_base_abstract , extends uvm_report_object , extends uvm_object , extends uvm_void . uvm_blocking_put_export still has uvm_void parent got added functionality added other parents. redirected inheritance work around multiple inheritance challenge language can support single inheritance * . * as of 2012 release, systemverilog added

ios - invalid data bytes/row:CGBitmapContextCreate: CGContextDrawImage: invalid context 0x0 -

i'm trying convert array of images video file. in process have fill pixel buffer selected images. here code snippet: cvpixelbufferlockbaseaddress(pixelbuffer, 0) let pixeldata = cvpixelbuffergetbaseaddress(pixelbuffer) let bitmapinfo:cgbitmapinfo = cgbitmapinfo(rawvalue: cgimagealphainfo.premultipliedfirst.rawvalue) let rgbcolorspace = cgcolorspacecreatedevicergb() print("\npixel buffer width: \(cvpixelbuffergetwidth(pixelbuffer))\n") print("\nbytes per row: \(cvpixelbuffergetbytesperrow(pixelbuffer))\n") let context = cgbitmapcontextcreate( pixeldata, int(image.size.width), int(image.size.height), cgimagegetbitspercomponent(image.cgimage), cvpixelbuffergetbytesperrow(pixelbuffer), rgbcolorspace, bitmapinfo.rawvalue ) cgcontextdrawimage(context, cgrectmake(0, 0, image.size.width, image.size.height), image.cgimage) cvpixelbufferunlockbaseaddress(pixelbuffer, 0) after executing these lines following message in xcode: cgbitmap

filesystems - how can i back again to main thread after finish saving images and videos in swift? -

please have save image , videos in document directory saving on background thread images , videos problem how can know saving finish image , videos or image , video ? because don't know how can detect the operation finish? the following code : dispatchqueue.global(qos: .background).async { (_,asset) in self.dictionaryofassets.enumerated() { if asset.value.mediatype == .image { let getnumberofphotosinthumbfolder = dealwithfilesystem.fetchnumberoffilesinfolder(foldername: foldername) let imagethumbpath = dealwithfilesystem.fetchfoldername(foldername: foldername)?.appendingpathcomponent("image \(getnumberofphotosinthumbfolder!).png") let fetchoption = phimagerequestoptions() fetchoption.issynchronous = true fetchoption.deliverymode = .highqualityformat fetchoption.resizemode = .exact phimagemanager

java - error is class,interface or enum expected? import relational.compare -

i have following code: package relational; public class compare { public int getmax(int x,int y) { if(x>y){ return x; } else{ return y; } } } import relational.compare; public class pack { public static void main(string a[]) { int a=7,b=9; compare ob=new compare(); int max=ob.getmax(a,b); } } this won't compile reason. please me solve error. error class-related, interface or enum-related? problem seems in import relational.compare . there several issue code. if whole code in 1 java file there cab 1 public class. change name of class "compare" "compare" (c in upper case), because object making have 'c' in upper case. you have 2 variables same name 'a', change 1 of them. after these changes code work fine.

javascript - ajax php post not sending email -

im unsure why isnt working when visit php script , manually send post data works when send via js gets correct response(success) email doesnt send form: <div name="submited" id="submitted" class="col-md-6 col-sm-6 contact_form"> <div class="con-fm"> <div class="col-sm-12"> <p class="contact-success" id="contact-success">thank you, have emailed scottish enterprise</p> <p class="contact-error">error! please contact site administrators</p> <p class="contact-error-1">error! please fill in form fields</p> <p class="contact-error-2">error! need enter name</p> <p class="contact-error-3">error! need enter em