Posts

Showing posts from May, 2015

c# - Creating an isosceles triangle in C3 -

the code below makes right angle triangle, how make isosceles triangle? int height = 4; string star = ""; (int = 0; int < height; i++) { star += "*"; console.writeline(star); } console.readline(); this displays right angle triangle. attempted make pyramid. here have cleaner code: int numberoflayer = 4; int empty; int number; (int = 1; <= numberoflayer; i++) { (empty = 1; empty <= (numberoflayer - i); empty++) console.write(" "); (number = 1; number <= i; number++) console.write('*'); (number = (i - 1); number >= 1; number--) console.write('*'); console.writeline(); }

c# - Could not find Microsoft.Data.Tools.Components in VS2017 -

i used vs 2015 (including c++ / c#) in past , downloaded new vs 2017. building project, got several warnings such as: (1) severity code description project file line suppression state warning referenced component 'microsoft.data.tools.components' not found. (2) severity code description project file line suppression state warning not resolve reference. not locate assembly "microsoft.data.tools.components, version=15.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil". check make sure assembly exists on disk. if reference required code, may compilation errors. (3) severity code description project file line suppression state warning not resolve reference. not locate assembly "microsoft.data.tools.schema.sql.unittesting, version=15.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil". check make sure asse

android - Update Initial Props on Reload in React Native -

i have react native application (android) returns initial props activity delegate: public class mainreactactivitydelegate extends reactactivitydelegate { private integer count = 1; ... @android.support.annotation.nullable @override protected bundle getlaunchoptions() { bundle initialprops = new bundle(); initialprops.putstring("count", this.count); return initialprops; } ... } i increment count in 1 of components works fine when shake reload getlaunchoptions not called , initial value of 1 used. is there hook in can update initial props when reloading app? you can use reactinstancemanager.addreactinstanceeventlistener hook reload event , reactrootview.setappproperties update initial props. mainactivity.java public class mainactivitytest extends reactactivity { private reactinstancemanager minstancemanager; private reactactivitydelegate mdelegate; private reactrootview mreactrootview;

afnetworking - iOS 11 Beta - NSURLErrorDomain - code: 18446744073709550617 -

when running app on ios 11 beta 5 built xcode 9 see error several of our network calls. "nsurlerror * domain: @“nsurlerrordomain” - code: 18446744073709550617" i've never come across error before , haven't made change app currently. networking, using afnetworking v2.5 so turns out ssl related. did add exception domain in info.plist , able reasonable error said there ssl issue. investigating showed our cert weakly signed. replaced resolved issue.

ruby - Rails Devise Token Auth authentication without using email -

i want use 'username' field instead 'email' i used gems gem 'devise' gem 'devise_token_auth' my model 'user' devise :database_authenticatable, :trackable, :registerable, :authentication_keys => [:username] include devisetokenauth::concerns::user has_many :projects def email_required? false end def email_changed? false end i removed 'validatable' and tried change model change_column :users, :email, :string, :null => true remove_index :users, :email also set configuration device.rb config.authentication_keys = [:username] config.case_insensitive_keys = [:username] config.strip_whitespace_keys = [:username] but still have error "email can't blank", "email not email" what made wrong? thank you i found solution routes.rb mount_devise_token_auth_for 'user', at: 'auth', :controllers => { :registrations => "registration

vb.net - Access derived class from base class shared function -

i rewrite function avoid need generic parameter because should available through other means given redundancy of how function called (t should refer class on function called): public shared function fmxsize(of t {new, filestructure})() integer dim result integer if sizecache.trygetvalue(gettype(t), result) return result result = (new t()).calculatesize() sizecache(gettype(t)) = result return result end function it called current implementation (note: libctl inherits filestructure ): return libctl.fmxsize(of libctl)() or ideal implementation (since above looks redundant): return libctl.fmxsize()

html5 - Javascript LocalStorage Scope -

i working localstorage first time , have ran scope issues. when attempt console.log(test) undefined in second if statement. doing wrong? my code follows; $("document").ready(function(){ var is_stopped = false; source.onmessage = function(event) { if (is_stopped) { localstorage.setitem('offline', event.data); var test = localstorage.getitem('offline'); console.log(test); // works here } if (!is_stopped) { document.getelementbyid("result").innerhtml += "data:" + event.data + "<br>"; console.log(test); // undefined } $("#start").click(function(){ is_stopped = false; }); $("#stop").click(function(){ is_stopped = true; }); }); <div id="result"></div> <button id="stop"> stop</button> &l

javascript - Blueimp Gallery with Angular 2+ -

i integrated blueimp js gallery angular 2 (running angular-cli) application. installed through npm ( npm install blueimp-gallery --save ) , imported via .angular-cli.json : "styles": [ "../node_modules/blueimp-gallery/css/blueimp-gallery.css", "../node_modules/blueimp-gallery/css/blueimp-gallery-indicator.css" ], "scripts": [ "../node_modules/blueimp-gallery/js/blueimp-helper.js", "../node_modules/blueimp-gallery/js/blueimp-gallery.js", "../node_modules/blueimp-gallery/js/blueimp-gallery-indicator.js" ] from there, use in angular components: //from .angular-cli.json declare const blueimp: any; public show(event: any, images: any[]) { const options = { event: event || window.event, }; blueimp.gallery(images, options); }; so far, good: works fine, can use gallery. i've been receiving crash reports customers on mobile devices. wanted open github issue, seems it's not

java - How to display image in another activity after taking a picture? -

i want photo have taken , shown in activity. preferably have button next activity, when clicked, displays image took. need simple way. i'm new android studio, therefore i'm not sure how solve this. here's code scanner.java package mapp.com.sg.receiptscanner; import android.content.intent; import android.graphics.bitmap; import android.os.bundle; import android.provider.mediastore; import android.support.v7.app.appcompatactivity; import android.view.view; import android.widget.button; import android.widget.imageview; public class scanner extends appcompatactivity { imageview imageview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_scanner); button btncamera = (button)findviewbyid(r.id.btncamera); imageview = (imageview)findviewbyid(r.id.imageview); btncamera.setonclicklistener(new view.onclicklistener() { @override public void onclick(vie

Is it possible to query multiple keys in firebase (node.js) at once? -

currently doing foreach loop populate array based on user's favorites: usersref.child(formdata.openid + '/favorites').once('value', function(snapshot){ var favlist = []; snapshot.foreach(function(fav){ fav = fav.key(); ref.child(fav).once('value',function(snapshot){ favlist.push(snapshot.val()); }); }); response.writehead(200, {'content-type': 'application/javascript'}); response.write(favlist); response.end(); }); usersref database user, ref database items. formdata.openid user's unique id. since 2 lists disjunct, you'll need separate read each item. ensure reads done before sending response client, can use promises: usersref.child(formdata.openid + '/favorites').once('value', function(snapshot){ var promises = []; snapshot.foreach(function(fav){ promises.push(ref.child(fav.key()).once('value')); }); promise.all(promises).then(function(snapshots)

c# - Move Listview with datatable into another listview -

Image
i want move selected row listview beside it. source listview has fullrowselect = true , multiselect = false. source listview populated via data table database. here have far. moves selected item. want move whole selected row. private static void moveselecteditems(listview source, listview target) { (int = 0; < source.items.count; i++) { if (source.items[i].selected) { target.items.add(source.items[i]); } } } this happens when run code. firstly, since have set multiselect false, dont need loop iterate on items. secondly, moving part simple. take selected item , add in target items. since moving, , not copying, remove item source listview. private static void moveselecteditems(listview source, listview target) { if(source.selecteditems.count > 0) { listviewitem selecteditem= source.selecteditems[0]; foreach (var subitem in source.selecteditems[0]

security - Locking out certain user based on ip, but no the whole business network in PHP -

i have built login system locks out user after 4 failed attempts, logs ip on database , cookie (if cookie exists not re-validate on database). problem if lock out user based on ip, other computers won't have access same ip (same router). there workaround on that? generate or store more specific user on database? simply, no. can make safer example "evercookie", it's still removeable 90% of users don't know how. https://github.com/samyk/evercookie

tf idf - Solr- Order by TF-IDF score -

i've got solr query returns tf-idf document , works fine. however, care top ten words, ranked tf-idf score. i'm analyzing large blocks of text, , current query brings every word, in alphabetical order, hundreds or thousands of words. there way order tf-idf score, or limit top ten based on tf-idf score? i've tried different ideas, no luck far. here's techproducts example query , result: http://localhost:8983/solr/techproducts/tvrh?q=id:ma147ll/a&&fl=id,includes&tv.tf=true&tv.df=true&tv.tf_idf=true&indent=on&wt=json { "responseheader":{ "status":0, "qtime":0}, "response":{"numfound":1,"start":0,"docs":[ { "id":"ma147ll/a", "includes":"earbud headphones, usb cable"}] }, "termvectors":[ "ma147ll/a",[ "uniquekey","ma147ll/a", "inc

JavaFX TreeView adding item to the treeview results the same behavior of the two cells -

i willing parse xml schema definition , treeview parsed file , adding , removing items treeview before generating xml . my issue when want add treeitem selected 1 -duplicating it- results in misbehavior of 2 treeitems : selected 1 , new one. for example expanding 1 treeitem results in expanding other . schematreecell.java public class schematreecell extends treecell<schemaelement> { gridpane grid = new gridpane(); private jfxbutton bt ; private contextmenu detailsmenu ; private treeitem<schemaelement> newitem; private menuitem showitem ; private menuitem addmenuitem; private menuitem deleteitem; public schematreecell() { showitem = new menuitem("show details"); addmenuitem = new menuitem("add element"); deleteitem = new menuitem("remove element"); detailsmenu = new contextmenu(); detailsmenu.getitems().add(showitem); detailsmenu.getitems().add(addmenuitem); detailsmenu.getitems().add(deleteitem); bt

python - Resample by Date in Pandas — messes up a date in index -

i have multi-index dataframe in pandas, data indexed building, , date. different columns represent different kinds of energy, , values represent how energy used given month. image of dataframe's head here. i'd turn yearly data. have line df.unstack(level=0).resample('bas-jul').sum() and works almost perfectly. here issue: dates given 1st of month, reason, resample , picks july 2nd cut-off 2012. number july 1, 2012 ends being counted in 2011 data. it ends looking this. can see second value in usage month column july 2. other that, resample appears work perfectly. if run df.index.get_level_values(1)[:20] , output is: datetimeindex(['2011-07-01', '2011-08-01', '2011-09-01', '2011-10-01', '2011-11-01', '2011-12-01', '2012-01-01', '2012-02-01', '2012-03-01', '2012-04-01', '2012-05-01', '2012-06-01', '2012-07-01', '2012-0

powershell - Alternative to "-Contains" that compares value instead of reference -

i have list of file objects, , want check whether given file object appears inside list. -contains operator i'm looking for, appears -contains uses strict equality test object references have identical. there less strict alternative? want $boolean variable in code below return true second time first time. ps c:\users\public\documents\temp> ls directory: c:\users\public\documents\temp mode lastwritetime length name ---- ------------- ------ ---- -a---- 14.08.2017 18.33 5 file1.txt -a---- 14.08.2017 18.33 5 file2.txt ps c:\users\public\documents\temp> $files1 = get-childitem . ps c:\users\public\documents\temp> $files2 = get-childitem . ps c:\users\public\documents\temp> $file = $files1[1] ps c:\users\public\documents\temp> $boolean = $files1 -contains $file ps c:\users\public\documents\temp> $boolean true ps c:\users\public\documents\temp> $boolean = $f

typescript - ionic3/angular 4 : Injecting a service in another service not working -

Image
i trying make simple use of service within service (not component) dependency injection in ionic3/angular4. thought had understood how in theory, in practise have been struglying several days... here configuration : cli packages: @ionic/cli-plugin-ionic-angular : 1.4.1 @ionic/cli-utils : 1.7.0 ionic (ionic cli) : 3.7.0 local packages: @ionic/app-scripts : 2.1.3 ionic framework : ionic-angular 3.6.0 and tsconfig.json file (as have gone throught threads suggesting compiling options have effects on injection behavior) { "compileroptions": { "allowsyntheticdefaultimports": true, "declaration": false, "emitdecoratormetadata": true, "experimentaldecorators": true, "lib": [ "dom", "es2015" ], "module": "es2015", "moduleresolution": "node", "sourcemap"

ruby - Switching databases in Rails/Postgres is causing error -

i'm trying setup testing environment can simulate writing master database , reading slave database. have parent model before_save , after_save callback switches slave , master. i'm running error though activerecord::statementinvalid: pg::connectionbad: connection closed: rollback application_record.rb class applicationrecord < activerecord::base self.abstract_class = true before_save :switch_to_master after_save :switch_to_slave def switch_to_slave config = yaml.load_file(file.join(rails.root, "config", "database.yml"))[rails.env.to_s] applicationrecord.establish_connection(config) end def switch_to_master config = yaml.load_file(file.join(rails.root, "config", "database_master.yml"))[rails.env.to_s] applicationrecord.establish_connection(config) end end master_slave_test.rb require 'test_helper' class masterslavetest < actioncontroller::testcase def test_one @user =

EX command not working in While Read loop in UNIX -

i getting following error when doing ex command inside while read line loop. 'syntax error: unexpected end of file' here sample code: while ifs= read -r var ex file1 << end command end done < "file.txt" any ideas?

Assembly: list all symbols of an application -

i programmed code: // consoleapplication1.cpp // #include <iostream> #include "stdafx.h" void abc() { printf("abcdef"); } int main() { printf("hello"); printf("2ndstring here"); return 0; } and result of windbg: 0:000> x consoleapplication1!* 00007ff6`dc5335b0 consoleapplication1!__scrt_current_native_startup_state = initialized (0n2) 00007ff6`dc533008 consoleapplication1!__security_cookie_complement = 0xffff6a36`95faba8f 00007ff6`dc531e90 consoleapplication1!_guard_dispatch_icall_nop = 0xff '' 00007ff6`dc5321d0 consoleapplication1!__xp_a = <function> *[1] 00007ff6`dc532650 consoleapplication1!__rtc_taa = <function> *[1] 00007ff6`dc532190 consoleapplication1!__guard_dispatch_icall_fptr = 0x00007ff6`dc531e90 00007ff6`dc532640 consoleapplication1!__rtc_iaa = <function> *[1] 00007ff6`dc5335d8 consoleapplication1!module_local_at_quick_exit_table = struct _onexit_table_t 00007ff6`dc532198

angular - Angular2: Why isn't my component's console.log not logging anything -

this component's code, non of versions anything. blank console in browser. export class assetscomponent { s = 'hello2'; constructor() { this.s = 'ds'; console.log(this.s); <--- nothing console.log('test'); <--- nothing console.log(s); <--- breaks compiler } } it's possible component isn't being loaded. didn't include code showing whole component file or app.module file should included. it's possible isn't compiling, because trying access variable doesn't exist: console.log(s); <--- breaks compiler there no variable 's' in constructor can access. needs this.s or need define variable s in within constructor function: let s = 'something';

javascript - How to normally bind forms in angular -

i have template form, wrote guides , don't work though. have several of models: export class user { constructor(public userid?: userid, public firstname?: string, public lastname?: string, public address?: address) { } } export class address { constructor( public street?: string, public city?: string, public zipcode?: string) { } } i have component: component({ templateurl: 'user.html' }) export class mycomponent implements oninit, ondestroy{ user: user; userform: ngform; ngoninit(): void { } and page itself: <form novalidate #userform="ngform"> <div class="form-group"> <input required minlength="4" type="text" id="firstname" [(ngmodel)]="user.firstname" name="firstname"> <small *ngif="!firstname.valid">not valid!</small> &l

gtk3 - GTK allow open files with new vala application -

i'm developing media player vala , want able open audio files application (once installed). in .descktop files added following mime types indicate files can open (they same mime types in banshee): mimetype=application/musepack;application/ogg;application/rss+xml;application/vnd.emusic-emusic_list;application/x-ape;application/x-democracy;application/x-extension-m4a;application/x-extension-mp4;application/x-flac;application/x-flash-video;application/x-id3;application/x-linguist;application/x-matroska;application/x-miro;application/x-musepack;application/x-netshow-channel;application/x-ogg;application/x-quicktime-media-link;application/x-quicktimeplayer;application/x-shorten;application/x-troff-msvideo;application/xspf+xml;audio/3gpp;audio/amr;audio/amr-wb;audio/ac3;audio/ape;audio/avi;audio/basic;audio/flac;audio/midi;audio/mp;audio/mp2;audio/mp3;audio/mp4;audio/mp4a-latm;audio/mpc;audio/mpeg;audio/mpeg3;audio/mpegurl;audio/musepack;audio/ogg;audio/vorbis;audio/wav;audio/wav

Bootstrap 4 offset not working how can I solve it? -

this question has answer here: offsetting columns not working (bootstrap v4.0.0-beta) 2 answers bootstrap 4 offset not working how can solve ?i have tried many times it's not behaving previous bootstrap please me!my question how can find offset in new version of bootstrap ? it's explained in docs . offset, push, pull no longer exist in bootstrap 4 beta must use auto-margins . e.g... <div class="row"> <div class="col-4 mx-auto"> i'm centered , offset 4 columns </div> </div> https://www.codeply.com/go/givefobaam note: specific column offsets restored in beta 2 also see : offsetting columns not working (bootstrap v4.0.0-beta)

Panda dataframe column conditional on another column -

import pandas pd import urllib.request import numpy np url="https://www.misoenergy.org/library/repository/market%20reports/20170811_da_bc.xls" cnstxls = urllib.request.urlopen(url) xl = pd.excelfile(cnstxls) df = xl.parse("sheet1",skiprows=3) constr = df.iloc[:,1:7] constr['class'] = np.where(constr['hour of occurrence'] == (1,2,3,4,5,6), 'offpeak', 'onpeak') sumsp=constr.groupby('constraint_id','class',axis=0)['shadow price'].sum().sort_values(ascending=true)` 1) new column class giving errors - says typeerror: invalid type comparison . how set new column based on multiple hours? works when put 1 hour (1 or 2 or 3...) 2) typeerror: groupby() got multiple values argument 'axis' . groupby using 2 columns. works 1 column. let's try: constr['class'] = np.where(constr['hour of occurrence'].isin([1,2,3,4,5,6]),'offpeak','onpeak') sumsp = constr.group

javascript - Delete cookie by name? -

how can delete specific cookie name roundcube_sessauth ? shouldn't following: function del_cookie(name) { document.cookie = 'roundcube_sessauth' + '=; expires=thu, 01-jan-70 00:00:01 gmt;'; } and then: <a href="javascript:del_cookie(name);">kill</a> kill roundcube_sessauth cookie? in order delete cookie set expires date in past. function be. var delete_cookie = function(name) { document.cookie = name + '=;expires=thu, 01 jan 1970 00:00:01 gmt;'; }; then delete cookie named roundcube_sessauth do. delete_cookie('roundcube_sessauth');

javascript - #%2F is getting added in Angular routing and not working in angular 1.6.4 -

i trying set routes in first single page application 2 days,i dont know happening application.when click of link,like clicked login link http://localhost:3000/#!/#%2flogin gets in requested url , when did experiments see found http://localhost:3000/#!/login shows me login template. how correct it. code html>> <a href="/#/">posts</a> <a class="nav-item nav-link" href="/#/register">register</a> <a class="nav-item nav-link" href="/#/login">login</a> route.js>> angular.module('app') .config(function ($routeprovider) { $routeprovider .when('/',{controller:'postsctrl',templateurl:'posts.html'}) .when('/register',{controller:'registerctrl',templateurl:'register.html'}) .when('/login',{controller:'loginctrl',templateurl:'login.html'}) }); first off, can remove hash entirely enabling html5 mode. add

I can't get Apache Ignite.NET to start up properly inside my .NET application -

i keep getting null reference exception when try create new igniteconfiguration instance. how create configuration: var cfg = new igniteconfiguration { // explicitly configure tcp discovery spi provide list of initial nodes // first cluster. discoveryspi = new tcpdiscoveryspi { // initial local port listen to. localport = 49500, // changing local port range. optional action. localportrange = 2, ipfinder = new tcpdiscoverystaticipfinder { // addresses , port range of nodes first cluster. // 127.0.0.1 can replaced actual ip addresses or host names. // port range optional. endpoints = { "127.0.0.1:49500..49520" }

Jquery 3 load method -

what best way declare function below jquery 3? read on.load can't figure out. $("nav#menu").load("/v4/inc/menu.php",function(){$("nav#menu").mmenu({offcanvas:{position:"left",zposition:"front"},counters:!0})})

matlab - Vector length comparison whose names are stored in a cell -

there vectors in workspace different vector lengths. have string cell contains vector names. want use cellfun spit out length of these vectors. for example, t1 = 1x10 double t2 = 1x100 double t3 = 1x20 double cel = {'t1','t2','t3'}; cellfun(@(c) eval(['length(',c{:},')']),cel) i thought doing following job, doesn't. have reasons why need use cellfun , eval problem. can point out what's wrong? error messages are: cellfun(@(c) eval(['length(',c{:},')']),cel) cell contents reference non-cell array object. cellfun(@(c) eval(['length(',c(:),')']),cel) error using horzcat dimensions of matrices being concatenated not consistent. cellfun(@(c) eval(['length(',[c{:}],')']),yvar) cell contents reference non-cell array object. depending on variation tried. or better yet. end goal check if length vectors same. if there way without looping, that'd great. you can us

javascript - Protractor error "WebDriverError: Invalid timeout type specified: ms" -

with no changes protractor tests started giving error: [14:07:05] e/runner - unable start webdriver session. [14:07:05] e/launcher - error: webdrivererror: invalid timeout type specified: ms appreciate this i had same issue internet explorer. downgrading protractor 5.1.2 5.0.0 worked me. (5.1.0, 5.1.1 , 5.1.2 seem have bug) see bug here: https://github.com/angular/protractor/issues/4445

asp.net - JQuery looping not working -

i working on jquery loop on textbox such whenever classname="xyz" needs put datetime control there else textbox needs work regular textbox have set validations. having trouble looping through using jquery .each. can let me know if missing something. <script> $(".xyz").each(function () { if ($(this).hasclass('xyz')) { $(".xyz").datepicker(); }}) </script> <asp:textbox id="txt" runat="server" cssclass="xyz"></asp:textbox> you don't need second class selector. inside loop targeting each element "xyz" class. use "this" keyword perform operation. <script> $(".xyz").each(function () { $(this).datepicker(); }); </script> <asp:textbox id="txt" runat="server" cssclass="xyz"></asp:textbox>

swift - Log messages from inside Framework to XCode Console -

i have xcode project builds executable ( swift package init --type executable && swift package generate-xcodeproj ). executable imports framework logs messages console, because framework imported executable log messages not shown. how can display log messages ( log.debug("bla bla") ) inside module/framework invoked executable in xcode console? if you're using kitura, need couple of steps enable logging described here: http://www.kitura.io/en/starter/gettingstarted.html#add-logging-optional

typescript - TS2345: Argument of type 'Promise<ReadonlyArray<Object>>' is not assignable to parameter of type 'T | PromiseLike<T> | undefined' -

what trying return the readonlyarray<> in promise can return original method called 'dispatchtothisprocess', reason why doing abstract state update can change update multiple processes in future. bellow code: private dispatchtothisprocess<t extends object>(action: action): promise<t> { return this.updatestate(action.name, action) } // called dispatchtothisprocess private updatestate<t extends object> (name: string, args: any): promise<t> { return new promise<t>((resolve, reject) => { console.log('in updatestate, replaced send<t>(...) method') switch (name) { case 'add-repositories': { const addedrepos: readonlyarray<repository> = new array<repository>() (const path of args) { const addedrepo: = promise .resolve(this.repositoriesstore.addrepository(path)) .then(result => addedrepo) addedrepos.join(

css - Strikeout li element -

Image
i wonder how make strikeout line on <li> element. needs has specific height, same line before. attached image of menu's project. i used li:before make dash, not know how figure out strikeout line on it. this should work. choose put line-through on specific element adding active css class, on hover, focus or whatever. ul { list-style: none; margin: 0; padding: 0; max-width: 200px; /* demo purpose */ } li { padding-left: 50px; position: relative; line-height: 30px; /* demo purpose */ } li:before { content: ''; height: 4px; background-color: black; width: 30px; position: absolute; left: 0; top: 50%; /* fix alignment upping position of strikeout 50% of height */ transform: translatey(-50%); } li.active:before { width: 100%; } <ul id="footer"> <li>projects</li> <li class="active">books</li>

How to make gulp-git pause until the git command finishes? -

i've been tearing hair out on 2 hours. here simplified gulpfile: var gulp = require('gulp'); var concat = require("gulp-concat"); var rename = require("gulp-rename"); var run_sequence = require("run-sequence"); var del = require("del"); var git = require("gulp-git"); var wait = require("gulp-wait"); var dest = 'build/'; var vendor_javascript_files = [ 'node_modules/jquery/dist/jquery.js', ]; var app_javascript_files = [ 'app.js', ]; // remove existing build directory gulp.task("prepare",function() { return del([dest, "branding_assets/"]); }); gulp.task("get-branding", function() { return git.clone('http://gitserver.local/prod-branding.git', {args: './branding_assets'}, function (err) { if (err) { throw err; } }); }); gulp.task("get-dev-branding", function() { return git.clon

groovy - IntelliJ warning on Spock interactions when combining Mocking and Stubbing -

intellij idea (2017.2) emits following warning on spock interactions combine cardinality return value. 'multiply' in 'org.codehaus.groovy.runtime.defaultgroovymethods' cannot applied to... ...followed return type of interaction. neither stubs nor mocks alone emit warning, combination of two. 1 * mockdao.deletedata() ok. mockdao.readdata() >> mydata ok. 1 * mockdao.readdata() >> mydata warning. is there setting or syntax make intellij understand mock/stub combination?

Anychart - How do I make the scroller contain an image of the chart? -

i saw chart other day had cool miniature image of inside of scroller. love know how similar. chart refereeing can found here: daily nav you can using background series option of scroller, described @ https://docs.anychart.com/7.14.3/stock_charts/scroller#background_series basic sample available @ https://playground.anychart.com/docs/7.14.3/samples/stock_scroller_03-plain any of series available stock charts https://api.anychart.com/7.14.3/anychart.enums.stockseriestype can displayed in scroller.

javascript - Problems retrieving separate Document in Map-Function -

i've written little function results based on 2 search terms user can make. terms are: owner & path of folder. the map function down below works far gives me right folder when user looks bob & holiday . unfortunately elfe if part doesn't work, want retrieve files document. if separate both if 's works. why not in combination? :-) map-function: function(doc) { if (doc.type == 'folder') { emit([doc.owner, doc.path], null); } else if (doc.files) { (var in doc.files) { emit(doc.owner, {_id: doc.files[i]}); } } } documents: // folder { "_id": "folder.abc", "name": "holiday", "type": "folder", "owner": "bob", "path": "\\holiday", "files": [ "file.123" ] } // files { "_id": "file.123", "name": "hawaii.jpg", "type"

c# - ScrollToCaret throws null reference exception when focus lost -

this question has answer here: what nullreferenceexception, , how fix it? 29 answers i creating c# winforms app creates pdfs , outputs name of each pdf rich text box created. using scrolltocaret functionality automatically scroll textbox down each line created. additional detail, print method in separate class winform. the issue running whenever program loses focus, scrolltocaret function throws nullreferenceexception this segment of code throws error each time: private void print<t>(t str) { var form = form.activeform pdfgenerator.form1; try { form.richtextbox1.appendtext(str + environment.newline); } catch { form.richtextbox1.appendtext("couldn't print string"); } form.richtextbox1.scrolltocaret(); } with additional text an unhandled ex