Posts

Showing posts from January, 2015

Unable to detect face and eye with OpenCV in Python -

this code detect face , eyes using webcam getting error traceback (most recent call last): file "d:/acads/7.1 sem/btp/facedetect-master/6.py", line 28, in <module> eyes = eyecascade.detectmultiscale(roi) nameerror: name 'roi' not defined but when use code detect faces , eyes in image working without error import matplotlib import matplotlib.pyplot plt import cv2 import sys import numpy np import os facecascade = cv2.cascadeclassifier('haarcascade_frontalface_default.xml') eyecascade= cv2.cascadeclassifier('haarcascade_eye.xml') video_capture = cv2.videocapture(0) while true: # capture frame-by-frame ret, frame = video_capture.read() faces = facecascade.detectmultiscale(frame) (x, y, w, h) in faces: cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0), 2) roi = frame[y:y+h, x:x+w] eyes = eyecascade.detectmultiscale(roi) (ex,ey,ew,eh) in eyes: cv2.rectangle(roi,(ex,ey),(ex+...

Java socket server only displays messages received after the connection closes -

i trying write code simple server, receives messages client. connection succesful once server connects client messages not displayed on screen. after close connection client side, server receives messages in 1 go. i need receive messages line line because each line needs de processed individually , in real time (i using hmm driver's actions recognition). could tell me doing wrong? thanko much. public static void main(string args[]) { serversocket my_server = null; string received_message; dataoutputstream output = null; socket socket_connected = null; try { my_server = new serversocket(9090); } catch (ioexception excepcion) { system.out.println(excepcion); } try { socket_connected = my_server.accept(); bufferedreader entrada = null; while (socket_connected.isconnected() == true){ entrada = new bufferedreader(new inputstreamreader(socket_connected.getinputstream())); ...

javascript - Stubbing functions used by other functions within es6 modules -

i've been thinking how test particular functions used other functions within same file. for example, have 2 functions within 1 file: // validators.js export const required = ...; export const containsuppercase = ...; export const containsnumber = ...; export const password = (val) => [required, containsuppercase, containsnumber].every(f => f(val)); so clearly, password validator depends on required , containsuppercase , containsnumber functions. if wanted stub out, tests didn't have care functions or how validate. this simple, silly example, i've ran same problem more complex scenarios. for example, if try sinon, might try doing this: import * validators './validators'; sinon.stub(validators, 'required').returns(false); sinon.stub(validators, 'containsuppercase').returns(true); sinon.stub(validators, 'containsnumber').returns(true); // test expect(validators.password('notimportant')).tobe(false); i tried d...

ios - In Firebase, retrieved data doesn't get out from the .observeEventType method -

i defined class in project, manage database set in firebase. following i've done class far. import foundation import firebase class db{ class func getprim() -> [string]{ var ret = [string]() let ref = firdatabase.database().reference() ref.child("bunya1").observeeventtype(firdataeventtype.value, withblock: { s in ret = s.value! as! [string] }) print("ret: \(ret)") return ret } } and method called in print() method, print(db.getprim()) . console(or terminal? anyway screen on bottom of xcode..) says empty array. embraced statement above print("-----------------------") . ----------------------- ret: [] [] ----------------------- 2016-09-07 20:23:08.808 이모저모[36962:] <firanalytics/info> created firebase analytics app delegate proxy automatically. disable proxy, set flag firebaseappdelegateproxyenabled no in info.plist 2016-09-07 20:23:08.815 이모저...

accountmanager - Android custom account manager -

i want create custom account manager don't know way best this. create new app contain custom account manager , others app ask tokken? (in case how sure app install when other app need tokken?) or maybe integrate custom account manager in each app? thanks in advance advices. i found exact need follow link find need https://www.fussylogic.co.uk/blog/?p=1031

vb.net - Collection with sub- collection -

lets suppose have forum 1 thread 3 posts. i want final result: dim myfourm new fourm myfourm.thread.add(545)''for ex 545 mean thread id. myforum.thread(0).post(1).username thread should collection of integer(=thread id) post should collection of post type so in case, code "chose first thread, , second post , retrieve username of write post" public class fourm 'thread should inside class , background code end class public class post public property username string public property postcontent string end class just clear: goal organize collections. each thread should have own posts. i chose forum @ example, else .. if not clear please me .. not native language(but not worry - can read. ;)) in correct project iam using dictionary. want explore more.. anyway, tried "you have use collection of thread each thread instance has collection of post" , result: public class mainfrm private sub form1_load(sender object, e eventargs)...

triangulation - How to calculate the super-triangular surround the set of points in Bowyer-Watson algorithm? -

first, sorry bad english. follow question, in bowyer-watson algorithm, must find super-triangular surround points. how can calculate coordinator (x,y) of 3 verticles of super-triangular ? have fomular ? much. i don't have proof first comes mind doing getting convex hull of set of points 1. convex hull of group of points. 2. initialize variable smallest = infinity. 3. each point p in convex hull following: find point farthest away p call q. set n1 = point left of p (counter-clockwise along convex hull). n2 = point right of p (clockwise along convex hull). l1 = line intersects q , perpendicular line pq. l2 = line intersects p , n1. l3 = line intersects p , n2. = area of triangle thats formed intersections of l1,l2,l3. if < smallest, set smallest = a. 4. return smallest this, of course, returns number isn't helpful instead create triangle class class triangle{ point p1; po...

javascript - Using props to toggle nav list, with nested array/object -

i have 2 components loading data. want links output this: group1 linka linkb but it's doing this group1 linka group1 linkb i can understand use of maps , how returning data cant figure out how fix , keep click handler working groups. const navlist = [ { "groupname": "group1", "links": [ {"name": "link0a","id": "434"}, {"name": "link0b","id": "342"} ] }, { "groupname": "group2", "links": [ {"name": "link1a","id": "345"}, {"name": "link1b","id": "908"} ] } ] class nav extends component { constructor(props) { super(props); this.state = { openitem: null } this.toggleclick = this.toggleclick.bind(this); } toggleclick(item, index, event) { event.preventde...

javascript - Over-shadowing label when pre-populating value to form -

Image
i m using materialized css , works me. when added more dynamic behaviour app, ex when m pre-populating form values , appending them layout, here photo of that: that happens when preset value form on/prior page load (because form html generated server side). however if click quantity field quantity go it's place , stay there. how make stays when pre-populate form value? there class need add (label or input) or javascript or can put out there. if want pre-fill text inputs, use materialize.updatetextfield(); docs says

javascript - NodeJS when to use promises? -

this might little opinion based, important question. should use promises async operations? if have api, likely, full stack of functions in there should use promises. if make business logic functions, should return promise. wonder if good, make return promise. mean, i'm calling functions inside while loop, each of them returns promise (the functions chained). slower use promises inside function? idea in stack combine promises , regular return values? need learn this, please don't close if function (sometimes) asynchronous, needs return promise. if function never asynchronous, there's no reason return promise, , should avoid it. keep simple , synchronous.

var initalization at the time of declaration in scala -

i confused following initialization var in = none: option[fileinputstream] however know that var varname : type = _ // default value initialization var varname : type = somevalue // other default intitalization but var in = none: option[fileinputstream] please thanks // [name] = [value] : [type] var in = none : option[fileinputstream] // can equivalently written as: var in: option[fileinputstream] = none this creates variable of type option[fileinputstream] , initial value none . learn more scala's option type, see http://www.scala-lang.org/api/current/#scala.option

java - Store csv file data to MS Access Database with specific fields -

Image
i have many files huge data. want store data ms access database based on fields mentioned in csv file. same fields data stored in database (i have 4 fields in database , same in csv field data going store in database using java). in above image have 4 fields huge data. have created 4 fields in ms access database. in created fields want insert data according fields in ms access database. i need java programming code achieve this. like parfait said in comment "so not code-writing service" because novice in reading csv file using opencsv lib ( use version 3.8 of lib java 8) storage in acces data base must googling import java.io.filereader; import java.io.ioexception; import com.opencsv.csvreader; public class readcsv { public static void main(string[] args) throws ioexception { // separator ; csvreader reader = new csvreader(new filereader("test.csv"),';'); string [] nextline; while ((nextline = r...

javascript - How to solve TypeError: d3.time is undefined? -

i want parse data/time using d3.js. purpose created 1 javascript file , use var d3 = require('d3') . install d3 using npm install d3 , , tried npm install d3 --save saves in package.json file : { "name": "school", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"error: no test specified\" && exit 1" }, "author": "", "license": "isc", "dependencies": { "browserify": "^13.1.0", "bufferutil": "^1.2.1", "d3": "^4.2.2", "express": "^4.14.0", "guid": "0.0.12", "gulp": "^3.9.1", "react": "^15.3.1", "react-dom": "^15.3.1", "reactify": "...

jpa - Eclipselink disable cache for stored procedure -

i have 2 stored procedure calls return user entity. 1 looks see if user registered 2 parameters not included in user entity. if procedure not return users, second stored procedure called register user. the behavior i'm seeing when called in order, second stored procedure returns user entity cache has fields null. when disable caching returns user object appropriately. seem first call caching user object. in normal operation user logging in, want cache, not want disable caching first call. want second stored procedure call not use cache. after doing research , testing few options, i've found few options. this doesn't work on stored procedure: proc.sethint("javax.persistence.cache.retrievemode", cacheretrievemode.bypass); java.lang.illegalargumentexception: query linkuser, query hint javax.persistence.cache.retrievemode not valid type of query. this looks evicts cache users. em.getentitymanagerfactory().getcache().evict(user.class); and these ...

YouTrack instance totally private -

does know how configure youtrack it's totally private (only invited users , no visibility guests except login-form)? thanks if commercial plan, projects private. can learn pricing here: https://www.jetbrains.com/youtrack/buy

javascript - Defined variable results in null -

i've been trying code something, isn't working: <html> <head> <style> .borderaroundnumber{ border-style: inset; margin-left: 40%; margin-right: 40%; text-align: center;} </style> </head> <body> <h1>testing thing</h1> <button onclick="whatistheword()">click here</button> <button onclick="checktranslations()">check</button> </br> </br> <div class="borderaroundnumber"> <p1 id="aos" class="numberofsentencesstyle"></p1> </div> </br> <p1 id="word1"></p1> <p1 id="spacing1"></p1> <p1 id="answer1"></p1> <p1 id="iscorrectornot1"></p1> </br> <p1 id="word2"></p1> <p1 id="spacing2"></p1> <p1 id="answer2"></p1> <p1 id="iscorrectornot2"></p1...

angularjs - Test directive attribute without template -

i'm trying run few unit tests on angular directive restricted attribute. i'm trying ascertain directive exists. does know how test directive attribute only? here bare bones version of directive function resetcustomer() { return { restrict: 'a', link: (scope, elem) => { elem.bind('click', function() { //do stuff }); } }; } export default { name: 'resetcustomer', fn: resetcustomer }; ... html <a class="brand" reset-customer> <img src="path/to/image.jpg"/> </a> ...and test describe('unit: resetcustomer', () => { let element, scope, compile; beforeeach(() => { angular.mock.module('app'); angular.mock.inject(($compile, $rootscope) => { scope = $rootscope.$new(); compile = $compile; element = angular.element('<a reset-customer></a>'); compile(element)(scope); scope.$d...

javascript - Dependency injection in angular 1 typescript project -

i trying use angular-jwt typescript in angular1 project. installed angular-jwt using typings install dt~angular-jwt --global i have in typings>globals>angular-jwt there no angular-jwt in typings.json file. problem? also , error: module ngjwtauth not available! while try use dependency. import * angular 'angular'; import 'angular-jwt'; angular.module('app', ['ngjwtauth']); any idea how fix this? this happens because ngjwtauth module wasn't defined. module's name angular-jwt , not ngjwtauth . the absence of package in typings.json problem because won't installed cloned repo. save package in typings.json it should be typings install dt~angular-jwt --global --save

python - get() returned more than one AccessToken -

i facing 2 issues here. 1) if user has not old token, new 1 should generated , logged in not happening so. 2)a newly created user when logs in gets 'you have multiple authentication backends configured , therefore must provide backend argument or set backend attribute on user.' 3)old user when trying login gets error of get() returned more 1 accesstoken -- returned 8! expert might understand code class userloginapi(apiview): permission_classes = [allowany] serializer_class = userloginserializer def post(self, request, *args, **kwargs): access_token = request.get.get('access_token') data = request.data print('data',data) serializer = userloginserializer(data=data) if serializer.is_valid(raise_exception=true): new_data = serializer.data if new_data: app = application.objects.get(name="foodie") try: user = user.o...

javascript - How to build a responsive thermometer panel using highcharts -

hey trying build thermometer panel using highcharts. way build it: build several thermometers , single thermometer(which actual column graph circle drawing in end of chart). the thermometer factory service, called function generate chart of service in order generate thermometer graph. so far have succeeded in above task,but component isn't responsive in laptops or tablets. i using bootstrap , considering moving flexbox instead, need guidance responsive problem come , how solved it. edit: i think best way handle problem unit thermometer panel 1 graph instead of 4 separated graphs, question is: how can it? here code: a codepen of code: http://codepen.io/barak/pen/jrdrxv var app = angular.module("app",[]); app.controller("mainctrl", ["$scope","thermometer",function($scope,thermometer){ $scope.title = "hello world"; var chartthermo1 = thermometer.generatechart("thermometer1","a00...

Is running puppet possible on any particular port? -

is possible configure puppet run on particular port? if need agent run under port 40000 - possible? well, it's master listens on port (by default, 8140), whereas agents open connections master. if wanted change master's port, run on master: # puppet config set masterport 40000 this command edit puppet.conf file, lives in $confdir .

groovy - 404 while trying to use a JIRA Scriptrunner custom REST endpoint -

i trying add custom jira rest endpoint script runner. the rest endpoint needs set user properties: list of users provided, , each user list of user properties. this script have cobbled far: import com.atlassian.jira.component.componentaccessor import com.atlassian.jira.bc.user.search.usersearchservice import com.atlassian.sal.api.user.usermanager import com.onresolve.scriptrunner.runner.rest.common.customendpointdelegate import groovy.json.jsonbuilder import groovy.json.jsonslurper import groovy.transform.basescript import javax.servlet.http.httpservletrequest import javax.ws.rs.core.multivaluedmap import javax.ws.rs.core.response @basescript customendpointdelegate delegate setuserproperties(httpmethod: "post", groups: ["jira-administrators"]) { multivaluedmap queryparams, string body, httpservletrequest request -> def userpropertymanager = componentaccessor.getuserpropertymanager() def usermanager = componentaccessor.getusermanager() def use...

clojure - Compojure - how can I get the servers own IP? -

my elastic beanstalk app written in clojure using compojure framework dispatches html document java-script regular timed refreshes of element within document, has query server. only don't idea of putting url anywhere in code, bit of hassle change. make config parameter set in elastic beanstalk configuration, figure there should way public ip code. only, can't seem find that. is there way own public ip within ring server? elastic beanstalk should set x-forwarded-host header in request should contain host hostname can use in application. excerpt example request: {:headers {"x-forwarded-host" "default-environment.adfadsbxczvdf.us-east-1.elasticbeanstalk.com"}}

git - HEAD~ for a merge commit -

in git, can refer commit before head using shorthand head~, , 2 before using head~2, etc. i have repository has merge commit following: a----b-------------f \ / c----d----e head = f, head~ points b, , head~2 points a. merge commit this, there shorthand point e? yes; ~ specifies generation, but can use ^ specify parent number , in case of merge. git show head^2 will show 2nd parent. (the distinction subtle since without numeric argument both ~ , ^ show same thing, first parent of head . because both ~ , ^ default 1 without numeric parameter. show first parent (by depth) , first parent (by breadth) of course same.)

javascript - Calling the Web API with jQuery -

Image
i have following errors: i able search .json file name search same time id well. went through jquery traversing methods w3schools not find answer looking for. my second problem have used jquery autocomplete plugin, not seems working on content. missing? , should focus on? here code: <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>kunde</title> <script src="autocomplete/jquery.easy-autocomplete.min.js"></script> <link href="autocomplete/easy-autocomplete.min.css" rel="stylesheet" /> <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-2.0.3.min.js"></script> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <link href="custom.css" rel="stylesheet" /> </head> <body> <div class="contain...

javascript - How to check shortcode with variables using has_shortcode() in WordPress -

i'm trying following approach enqueue css/js files within plugin when shortcode being used: add_action( 'wp_enqueue_scripts', function() { global $post; if( is_a( $post, 'wp_post' ) && has_shortcode( $post->post_content, 'shortcode') ) { //add css/js here } } ); now problem i'm having code if use shortcode [shortcode] works fine when pass variable within shortcode [shortcode id="1" class="something"] cannot detect , hence doesn't add css/js files. can bit? you can try code, add_action( 'wp_enqueue_scripts', function( $id, $class) { global $post; if( is_a( $post, 'wp_post' ) && has_shortcode( $post->post_content, 'shortcode') ) { //enqueue css/js files here } } then use shortcode: [shortcode id="1" class="something"]

plugins - Uploading custom Drupal module to drupal.org or marketplace -

i developed custom drupal module organisation. want know if can upload drupal module in drupal marketplace or on drupal.org . if possible, how ? if uploading not possible, how can contribute module? this document how create full project on drupal.org doc_page after need upload code on drupal repository. use this document apply approval project approve project become approved project , should available download on project page url drupal.org/project/yourmodulename you find many more information on drupal.org hoop thanks!

javascript - Reduce the Spacing between vertically aligned input ranges -

i want create simple equalizer gui using html , css , maybe js. problem how can edit spacing between before , after vertical input range? can see when aligning multiple sliders take space. how deal this?? html part put each individual input element in div can align them next each other using 'inline-block' , in code pasted below input.vertical { -webkit-appearance: slider-vertical; writing-mode: bt-lr; } .aligned { display: inline-block; } .block{ display: block; } input[type=range]{ padding-left: 0px; padding-right: 0px; } <div class="aligned"> <p>gain</p> <input type="range" id="fader" min="0" value="100" max="100" step="5" oninput="outputupdate(value)...

Racket - Match Function -

i'm learning how use "match" function in racket i'm not sure how can work in contexts. for example, problem have use match replace every occurrence of lambda in program word "lumbda". > (lambda->lumbda '(lambda (lambda) lambda)) (lumbda (lambda) lambda) it should change function "lambda" "lumbda", not variables. have no clue how go this. try this: (define (lambda->lumbda exp) (match exp [(list 'lambda args body) (list 'lumbda args body)] [_ (error "unknown expression")])) for example: (lambda->lumbda '(lambda (lambda) lambda)) => (lumbda (lambda) lambda)

android - Save App Preferences from PreferenceScreen when pressing back button -

i'm trying learn how develop android apps. followed video tutorial on youtube, , ended adding simple app settings screen application. however, there's 1 point bothers me: when press button on phone's navigation bar, changed settings aren't applied. i have tried searching on google, none of solutions found have worked. fact don't yet understand 100% of what's happening on proposed solutions may contribute difficulty on solving 1 problem. the behavior expect app when press button on navigation bar, changed settings should applied. for instance, have setting dark background, controlled checkbox. current behavior is: check setting dark background. when press button on navigation bar, setting isn't applied (i have method loads preferences on mainactivity). want happen when press button, dark background applied in case. from understand, believe overriding onbackpressed should trick, don't know should executed in order apply settings. here clas...

computer science - An example of Dijkstra's algorithm to fail with one negative edge -

Image
i'm trying think of graph edges have positive weights, except of 1 edge such dijkstra's algorithm fails produce correct output. i'd glad idea. edit: i've seen graph counter-example don't understand why. vertex a last pop-out queue , relax() edge a->e . path s->a->e chosen, correct path (and not s->b->e claimed) thanks dijkstra terminates upon expanding goal node. use priority queue in dijkstra (not queue) expand node has least cost. in example never expanded. open list = [ s cost:0 ] // priortiy queue pop s out of open list closed list = [ s cost:0 ] open list = [ b cost:1 ; cost:5 ] pop b out of open list closed list = [ s cost:0 ; b cost:1 ] open list = [ e cost:2 ; cost:5 ] pop e out of open list // it's better terminate when reach goal if don't // doesn't make difference going find shortest path // other nodes closed list = [ s cost:0 ; b cost:1 ; e cost:2 ] open list = [ cost:5 ] pop out of...

perl - string comparison in foreach -

the below test check software information on list of ip addresses. program prints version of software running on ips expected. now, test whether software running on ips identical? how do that? sub test_check_software_info_on_all_the_ips { ($self) = @_; $self->{'machine_ip'} = $self->{'queryobj'}->get_machine_ip(); foreach $ip ( @{ $self->{'machine_ip'} } ) { $self->{'install_info'} = $self->{'queryobj'}->get_install_info($ip); info( 'software info of ' . $ip . ' ' . $self->{'install_info'} ); } } sample output 20160907t141846 info software info of 1.1.1.1 r-2016-08-27-03 20160907t141846 info software info of 2.2.2.2 r-2016-08-27-03 20160907t141847 info software info of 3.3.3.3 r-2016-08-27-03 20160907t141847 info software info of 4.4.4.4 r-2016-08-27-03 this ask sub check_matching_info { ($self) = @_; $ips =...

acumatica - Add extra note field to grid line -

i have client add note field grid. if not possible, there way have large text field in grid uses pop window editing large amount of text in field? priority: 1.) add note field grid, if possible. 2.) failing #1, there way add popup window edit large standard user text field. i believe answer number 1 question no. if grid has note cannot have another. had question come before. for #2, should able smart panel displays field. use pxtextedit , setup new view panel point based on selected/current row. to add smart panel (pop panel) need handful of things in place. prefer using aef graph , table extensions. there documentation in t200/t300 training material these topics. in example add note ability sales order page. copied of logic existing "po link" button , panel posupplyok pxaction , currentposupply view (page so301000). first need new field add sales line extension table/field: [pxtable(typeof(soline.ordertype), typeof(soline.ordernbr), typeof(soline.lin...

How to make CircleCI call npm install on two places? -

i have started working circleci don't know whether obvious. problem is, have react website , react native project in 1 folder. react website uses project/package.json , project/node_modules , while react native project uses project/nativeapp/package.json , project/nativeapp/node_modules . to make both run , test correctly, need npm install in both locations. how tell circleci that?

html - What do I need to do to get these bootstrap colunms to align left? -

i have web template using top , left nav , want have 3 column elements left aligned. in simple example , columns want center aligned. can tell me how columns snuggle left margin? *disclaimer - learning bootstrap ability answer myself limited bootstrap vocabulary. i tried searching bunch of different ways , settle don relevant search query: bootstrap left align columns -nav -navbar that search produced this answer, didn't seem solve problem, or didn't right. i have created bootply simulates problem if wants try out, can. you can left align container described in question , or use full-width container-fluid , , use portion of 12 bootstrap columns, example 8 columns.. <div class="container-fluid"> <div class="row"> <div class="col-md-8"> .. page layout here </div> </div> </div> http://www.bootply.com/srnhm22tpr on smaller screens you'd want layout ...

cygwin - What is mean by "Rnobody" in R script installation -

i working java based jetty server setup involves servlet , html. objective call r script java in 1 of custom configuration properties file inside web-inf/classes , have encountered statement follows. rscriptlocation=/usr/local/bin/rnobody this property file not related jetty server, developer created properties file storing constants. i have installed r cygwin setup, not locate particular executable, see /usr/bin/r what rnobody , how install it

python - Increment attributes of two class without modules? -

how make class operate without importing other modules? >>date(2014,2,2) + delta(month=3) >>(2014, 5, 2) >> >>date(2014, 2, 2) + delta(day=3) >>(2014, 2, 5) >>date(2014, 2, 2) + delta(year=1, month=2) >>(2015, 4, 2) this code: # class delta(date): # year = date(year) # def __init__(self,y,m,d): # self.y = y + year # self.m = m # self.d = d # def __call__(self): # return self.y, self.m, self.d class date(object): def __init__(self,year,month,day): self.year = year self.month = month self.day = day def __call__(self): return self.year, self.month, self.day override __add__ method. in delta class give __init__ default parameters can call 1 or 2 arguments. class delta(): def __init__(self,year=0,month=0,day=0): self.y = year self.m = month self.d = day def __call__(self): return self.y, self.m, self.d c...

javascript - Hightcharts Avoid "jump effect" on tooltip with "shared:true" -

i avoid call "jump effect" tooltip when cursor hover stacked column. here example of problem encounter : http://jsfiddle.net/ewget3wd/ -> have stacked column, want 1 unique tooltip stacked column, can see on example, tooltip jumps 1 bar others. i avoid "jump effect" , have 1 shared tooltip. tried parameter shared:true can see on following example, small arrow of tooltip disapeared : http://jsfiddle.net/5rktjo4g/ to sum up, have 1 tooltip point (with arrow) on top of stacked column. so here question, possible ? :-) thanks. you can used shared property of tooltip , use positioner positioning tooltip. here can find code may you: positioner: function(labelwidth, labelheight, point) { return { x: point.plotx + labelwidth / 2, y: point.ploty - labelheight / 2 } }, you can add connector wrapping function responsible drawing tooltip shape: (function(highcharts) { highcharts.renderer.prototype.symbols.callout = fu...

Read binary file into struct, handle char [8], using C -

i have following code, prints out binary (prints first 4 characters (i'm guessing 2 bits per character, 8 chars in total? void mychunks(){ struct chunkstorage { long sxid; char chunk[8]; // ‘chunk of data’ }; file *p; struct chunkstorage d; p=fopen("myfile.txt","rb"); while(1){ fread(&d.chunk,sizeof(d.chunk),1,p); if(feof(p)!=0) break; printf(“%s”, d.chunk); } fclose(p); } mychunks(); so way me able @ data, seems using while loop in way. i'm wondering how can concatenate this, , hex encode it? what char chunk[8] do? why have loop on each 8 bytes? why cant forget "while" loops , read full chunk after fopen statement , convert full data hex? is right concatenate, full file, or erroneous? i not sure of history of file, or other parts of structure defined, strict c standpoint, file large quant...

python - pandas apply individual logic to group -

Image
if have pandas data frame looks like: day id val 1-jan -5 2-jan -4 3-jan 3 1-jan b 2 2-jan b 1 3-jan b -5 how can add new column where, rows same id, if val negative on 1-jan, rows "y" , "n" if not? this: day id val neg_on_jan_1 1-jan -5 y 2-jan -4 y 3-jan 3 y 1-jan b 2 n 2-jan b 1 n 3-jan b -5 n i've looked @ group , apply-lambda functions still feel i'm missing something. i'm starting out pandas, coming background in sql, please forgive me if brain still thinks in rows , oracle analytic functions :) included map per @ami tavory's suggestion gb = df.set_index(['day', 'id']).groupby(level='id') s = gb.val.transform(lambda s: s.loc['1-jan'].lt(0)).map({1: 'y', 0:'n'}) s day id 1-jan y 2-jan y 3-jan y 1-jan b n 2-jan b n 3-jan b n name: val, dtype: object df.merge(s.to_frame('neg_on...

android - Unable to place images in the desired way in grid view -

Image
i want know how can make layout attached one. through grid layout able achieve want images not getting placed in manner, please suggest done in case. shall use other view or what?

javascript - $provide more than 1 value to test in a describe -

i have karma/jasmine test angular directive: describe('placeholder directive', function() { // bindable members var element; // load module beforeeach(angular.mock.module('app')); // mock service response beforeeach(module(function($provide) { $provide.value('placeholdersupportservice', function() { return false; }); })); // bind references global variables beforeeach(inject(function($compile, $rootscope) { element = $compile('<input name="test" placeholder="test" />')($rootscope); $rootscope.$digest(); })); // check correct html rendered it('renders placeholder input value when placeholder not supported', inject(function($timeout) { $timeout.flush(); expect(element[0].value).tobe('test'); })); }); it works want. however, have forced value of placeholdersupportservice() false . want run second test have value true . can't seem access $prov...

c# - Can I use WPF without disabling FIPS compliance? -

i've seen lots of complaints build issues (specifically wpf) error: this implementation not part of windows platform fips validated cryptographic algorithms. unfortunately, cannot work-around or disable fips compliance on machine. how can use wpf without disabling fips compliance? ok figured out. right before </runtime> , add line: <enforcefipspolicy enabled=“false” /> in file c:/program files (x86)/microsoft visual studio/2017/professional/msbuild/15.0/bin/msbuild.exe.config adding other places not assist, wpf project’s msbuild configurations live. has moved around on each version of microsoft visual studio

wpf - Get TextBox Value in ViewModel -

Image
anyone 1 please tell me example ,how textbox value in view model, model property binding textbox mode 2 way this view model functions, want add new record observable collection. c# public void addperson() { // add new record } private model.person _persondata; public model.person persondata { { if(_persondata==null) { _persondata = new person(); } return _persondata; } set { setproperty(ref this._persondata, value); } } xaml <controls:metrowindow xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:mahapps.metro.controls;assembly=mahapps.metro" xmlns:vm="clr-namespace:demo.viewmodel" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x...