Posts

turning nightwatch.js test (using jquery function) into custom assertion or command -

i running jquery function many times through test suite in order validate whether elements visible in viewport (nightwatch's current commands visible, present, etc not factor in). seems valuable have reusable command or assertion, fighting uphill battle understand how translate current code new reusable code, , have spent many hours trying different things. i have other custom commands work well, not work on validating result of function, perform repeatable commands. leads me believe should custom assertion? documentation on custom assertions sparse, , has not helped me in piecing own custom assertion. this run in test files: browser.execute(function () { $.fn.isonscreen = function(){ var win = $(window); var viewport = { top : win.scrolltop(), left : win.scrollleft() }; viewport.right = viewport.left + win.width(); viewport.bottom = viewport.top + win.height(); var bounds = this.offset(); ...

neo4j - How to write a Cypher query to check commutativity between nodes -

Image
i need check commutativity between nodes. there 3 relationships across node tracked following: aabbca, aabcba, aacbba. seen every b , c node placed commute. below use query on how generate graph. here graph: create (x1:node {title:'a'}) create (x2:node {title:'a'}) create (x3:node {title:'b'}) create (x4:node {title:'b'}) create (x5:node {title:'c'}) create (x6:node {title:'a'}) create (x1) - [:transition {id:[1]}] -> (x2) create (x2) - [:transition {id:[1]}] -> (x3) create (x3) - [:transition {id:[1]}] -> (x4) create (x4) - [:transition {id:[1]}] -> (x5) create (x5) - [:transition {id:[1]}] -> (x6) create (x1) - [:transition {id:[2]}] -> (x2) create (x2) - [:transition {id:[2]}] -> (x3) create (x3) - [:transition {id:[2]}] -> (x5) create (x5) - [:transition {id:[2]}] -> (x4) create (x4) - [:transition {id:[2]}] -> (x6) create (x1) - [:transition {id:[3]}] -> (x2) create (x2) - [:...

MySQL: To exclude some results based on specified conditions -

i stuck @ problem. problem has 2 tables, namely hackers , challenges. here schema: hackers(hacker_id: int, name string) challenges(challenge_id: int, hacker_id int) i trying write query print hacker_id, name, , total number of challenges created each student. sort results total number of challenges in descending order. if more 1 student created same number of challenges, sort result hacker_id. if more 1 student created same number of challenges , count less maximum number of challenges created, exclude students result. here query: select hackers.hacker_id , hackers.name , count(challenges.challenge_id) challenges_created hackers left join challenges on hackers.hacker_id = challenges.hacker_id having count(challenges_created) >= max(challenges_created) order challenges_created desc, hackers.hacker_id asc i getting wrong output! please tell me getting wrong! sample input : hackers table: imag...

javascript - Gulp not creating CSS folder on production build -

i have static site uses 2 gulpfiles compile. 1 gulpfile.dev.js compiles files correctly , uses static server served browsersync. gulpfile.prod.js the exact same dev file, without browsersync server. when compile file using deployhq move files on server doesn't compile necessary css folder. my gulpfile.prod.js file: //dh var gulp = require('gulp'), //task runner uglify = require('gulp-uglify'), //minimizies js sass = require('gulp-ruby-sass'), //compiles css imagemin = require('gulp-imagemin'), // minimize images concat = require('gulp-concat'), concatcss = require('gulp-concat-css'), gutil = require('gulp-util'), autoprefixer = require('gulp-autoprefixer'), cssnano = require('gulp-cssnano'), pug = require('gulp-pug'), htmlmin = require('gulp-htmlmin'); /...

c# - Why does my FormLoad event handler call the custom class' default constructor instead of the one with arguments? -

i making basic multiclass gui program assignment have created 3 custom classes inherit form abstract class (readingmaterial) , interface. problem running when run information should passed each class's constructor (i've included class online example) not being passed , classes calling default constructor instead, gui components showing zeros , blank spaces instead of populating other information passed constructors. why isn't calling correct constructor instead of default? (gui form partial class) public partial class presentationgui : form { private book book; private magazine magazine; private online online; public presentationgui() { initializecomponent(); } private void rdbtnonline_checkedchanged(object sender, eventargs e) { txtbxpagecount.text = online.pagecount.tostring(); txtbxtitle.text = online.title; txtbxauthor.text = online.author; txtbxurl.text = online.websiteurl; txtbxp...

css - Dropdown Menu get cut off -

i have drop down menu , seems cut of due parent div i.e if increase height of parent div, drop down menu seems come visible. please help. , below code: markup <div id="main-navigation" class="container"> <div class="menu rounded"> <ul id="navigation" class="l_tinynav1"> <select id="tinynav1" class="tinynav tinynav1"> </div> </div> css #main-navigation .menu ul { background: none repeat scroll 0 0 #ffffff; border-bottom: 1px solid #d51386; border-left: 1px solid #d51386; border-radius: 0 0 5px 5px; border-right: 1px solid #d51386; margin: 0 auto; min-height: 38px; overflow: visible; width: 98%; } #main-navigation .menu li { border-left: 1px solid #e1e1e1; border-right: 1px solid #c1c1c1; float: left; height: 38px; position: relative; top: 0; } it may have overflow...

node.js - Undefine globals in particular files -

i working on plugin system sails.js application. security reasons need rid of sails global variable, holds data config files' content, etc. don't want undefine globally, since break application. plugin's entry point following: module.exports = function (pluginmanager) { return { ... } } where pluginmanager allowed reference application's code. is possible execute plugin's code in sandbox-like isolated environment? considered using child_process api, don't know how affect performance , stability of application. in globals.js set sails instance false, like: sails: true still, still access globals via req._sails.