Posts

Showing posts from April, 2014

build - Two Jenkins: Await remotely triggered job -

i'm using 2 jenkins machines (v.1.651.1) - 1 on mac lets call 1 jenkins a job a , other windows machine jenkins b job b . main entry point @ jenkins job triggered. job builds something, puts on shared network directory , triggers job b on jenkins b via remote api. job b continues building independently. in meantime job b acquiring intermediate files network share , starts building something, too. if goes wrong here - stop job via remote api. i'm wondering if there way implement wait @ job turns successfull if job b has been finalized. multijob plugin seems i'm looking for, doesn't work on multiple jenkins instances, right? you make master - slave jenkins. mac machine: master windows machine: slave just notice jenkins web gui on mac machine. install "cloudbees build flow plugin". you can split job if want. have 3 jobs. job a1 : builds something, puts on shared network directory. job b: building independently. job a2: need h...

opencv - Recover plane from homography -

i have used opencv calculate homography relating views of same plane using features , matching them. there way recover plane itsself or plane normal homography? (i looking equation h input , normal n output.) if have calibration of cameras, can extract normal of plane, not distance plane (i.e. transformation obtain scale), wikipedia explains . don't know implementation it, here couple of papers deal problem (i warn not straightforward): faugeras & lustman 1988 , vargas & malis 2005 . you can recover real translation of transformation (i.e. distance plane) if have @ least real distance between 2 points on plane. if case, easiest way go opencv first calculate homography, obtain 4 points on plane 2d coordinates , real 3d ones (you should able obtain them if have real measurement on plane), , using pnp finally. pnp give real transformation.

angularjs - New json file added in i18n folder -

i've added new .json file in /i18n/en/ directory in jhipster generated project. can't access value html page. missing something? (should need mention newly created .json anywhere? add example.state.js resolve: { translatepartialloader: ['$translate', '$translatepartialloader', function ($translate, $translatepartialloader) { $translatepartialloader.addpart('example'); return $translate.refresh(); }] }

Powershell to display Regsvr32 result in console instead of dialog -

i've searched did not find answer. task register 1 dll using powershell ps1, followed other lines of scripts. don't want interrupted dialog, added /s parameter. result information ignored, no matter succeed or fail. want result displayed in console. how? launch regsvr32.exe /s start-process -passthru , inspect exitcode property: $regsvrp = start-process regsvr32.exe -argumentlist "/s c:\path\to\your.dll" -passthru $regsvrp.waitforexit(5000) # wait (up to) 5 seconds if($regsvrp.exitcode -ne 0) { write-warning "regsvr32 exited error $($regsvrp.exitcode)" }

javascript - why $(':not(:has(*))').find("p"); won't give an output -

i wanted parent node of text, , know it's not possible , should done manual traversing. want know why following not working. $(':not(:has(*))').find(':contains("mytext")'); i made easier looking p tag in result. know $(':not(:has(*))'); return p tags .find("p"); should select p tags i know it's not working want know why? you're trying find descendant elements of elements no descendants. that's not going work. if you're looking p elements no descendants, meant use .filter() , not .find() : $(':not(:has(*))').filter('p') or can attach p selector :not() — there no reason run separate selector here (unless selector string coming variable or something): $('p:not(:has(*))')

mysql - Joining reference tables to a table other than the base table -

Image
basically have query follows: select main.response_id 'response id', concat(case when main.months = 'jan - mar' 'march' when main.months = 'apr - jun' 'june' when main.months = 'jul - sep' 'september' when main.months = 'oct - dec' 'december' else 'error' end, ' ', main.year) period, cnt.country_name country, initm.num_modules 'initial training - number of modules', inittrained.num_instr 'initial training - instructors trained', initpass.pass_num 'initial training - instructors passed', initpass.pass_num / inittrained.num_instr 'initial training - pass percentage' responses_main main -- main responses table left outer join responses_init_training_modules initm using (response_id) -- main init training table left outer join responses_init_training_pass_num initpass using (response_id) -- main init training tab...

reporting services - SSRS 2008 Continued Group Header subreports -

i have multiple sub-report included in main report. want achieve have header each report render correctly , change if display on second page or more: main header header sub report 1 / header sub report 1 (continued) header sub report 2 / header sub report 2 (continued) i know not possible use page header disappear when generated subreport inside report. looked solution add group header in subreport, thing here cannot change text (continued) if tablix display on more 1 page. does have solution this? thanks in advance. try this , this , if helps.

php - How to split text in 2 halves? -

i've done so: if(strlen($block_text) > 2000) { $half = strlen($block_text)/2; $second_half = substr($block_text, $half); $block_text = substr($block_text, 0, $half); } but problem here $second_half starts in middle of word , $block_text ends in middle of word. possible tweak somehow first half ends after dot . ? if(strlen($block_text) > 2000) { $half = strpos($block_text, ".", strlen($block_text)/2); $second_half = substr($block_text, $half); $block_text = substr($block_text, 0, $half); } now find first dot after half text.

mysql - Sequilize association for 2 foriegn key of same model -

i need execute below query using sequelize select * haulerrfquotes left join quotes on quotes.jobid = haulerrfquotes.jobid , haulerrfquotes.haulerid = quotes.haulerid haulerrfquotes.jobid = '11' but not getting how use 2 foriegn keys in same model(haulerrfquotes) , create association of both foriegn keys single model (quotes) in node.js orm sequelize.js haulerrfquotes needs index(jobid) . quotes needs index(haulerid, jobid) (or in opposite order). are node.js and/or sequelize.js not providing that? if not, abandon them.

mplot3d - MATLAB set('XData'....) -

i'm having problem updating plot. basically, have function creates figure 3 subplots. have function runs create figure function , updates plot. it's important update don't create new graph each loop since it's 3d data , takes while load. the problem lies in second subplot. load 3 images (3 slices) using slice() , want plot position vector. set position vector (0,0,0) initially, thought update in loop setting 'xdata', 'ydata'... respective values. reason it's not working , spitting error "undefined function 'xdata' input arguments of type 'double'." please help, below code, thanks!!! note--- error lies in update plot function after "%refresh plot" initial plot function [fig] = endosliceviewer_createfigure(figindex,dicomparam) %this function creates , returns figure object visualizes dicom data %in plane orthogonal endoscopic view, rgb view of camera %and orientation of navigation %set resolution endo sl...

node.js - err empty response when trying to insert into mongodb using node -

i'm quite new mean stack , trying create application has 2 data collections, 'users' , 'courses'. users have used login-and registration example , works fine. courses have tried re-create same structure (so files named including same course has similar 1 named user) courses having trouble creating new course , adding database. err empty response cannot understand why , how correct it. below (compressed) code, let me know if more information needed. have excluded client-side code since know error on server-side. server.js called following command client-side: function create(course) { return $http.post('/api/courses', course).then(handlesuccess, handleerror); } server.js require('rootpath')(); var express = require('express'); var app = express(); var session = require('express-session'); var expressjwt = require('express-jwt'); var config = require('config.json'); var bodyparser = require('body-parser...

android - How to add linear layout dynamically to relative layout in a fragment which itself a part of tablayout? -

i couldn't find answer question, please can me this, here scenario (graphically) scenario apply them in fragment class public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.<fragment_xml_name>, container, false); relativelayout rl = (relativelayout)rootview.findviewbyid(r.id.<yourlayoutid>); linearlayout ll = new linearlayout(getactivity().getapplicationcontext()); textview tv1 = new textview(getactivity().getapplicationcontext()); textview tv2 = new textview(getactivity().getapplicationcontext()); //do confs textviews... ll.addview(tv1); ll.addview(tv2); rl.addview(ll); return rootview; }

javascript - How to let the AJAX function handle the submit form -

i creating simple search form <form id="myform" method="post"> <table> <tr> <td><input type="text" name="search" placeholder="search accounts" /></td> <td><button type="submit">search</button></td> </tr> </table> <br/> </form> i don't want form go page. why there no action. ajax function handle that. not working. i have tried doing javascript, $('#myform').click(function(){ $.ajax({ url: root_url + 'account/send', type: "post", datatype: "text" }).done(function(data) { $('#accounts-container').html(data); }); }); when try implement this, directed me home page. edit update: .submit , preventdefault works. problem data. go? need data(name="search") te...

html - CSS3 100vh not constant in mobile browser -

i have odd issue... in every browser , mobile version encountered behavior: all browser have top menu when load page (showing address bar example) slide when start scroll page. 100vh calculated on visible part of viewport, when browser bar slide 100vh increases (in terms of pixels) all layout re-paint , re-adjust since dimensions have changed bad jumpy effect user experience how can avoid problem? when first heard of viewport-height excited , thought use fixed height blocks istead of using javascript, think way in fact javascript resize event... you can see problem at: sample site can me / suggest css solution? simple test code: /* maybe can track issue whe occours... */ $(function(){ var resized = -1; $(window).resize(function(){ $('#currenth').val( $('.vhbox').eq(1).height() ); if (++resized) $('#currenth').css('background:#00c'); }) .resize(); }) *{ margin:0; padding:0; } /* box sould keep con...

Setting @Autowired(required=false) globally during spring-boot test -

i can't classic xml config <bean class="org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor"> <property name="requiredparametervalue" value="false" /> </bean> to work in spring-boot test. i've tried equivalent java style @bean public autowiredannotationbeanpostprocessor annotation() { autowiredannotationbeanpostprocessor annotation = new autowiredannotationbeanpostprocessor(); annotation.setrequiredparametervalue(false); return annotation; } also no avail. i'm trying find solution cherry-pick beans need unit testing. here's code i'm using in test itself: @rollback @springapplicationconfiguration({packageservicetestconfiguration.class, databaseconfiguration.class, mybatisconfiguration.class}) @activeprofiles("test") public class packageservicetest extends abstracttransactionaltestngspringcontexttests {...} the content of ...

Unlock second screen Objective c -

i have app lock screen , try multiple screens. don't know unlock second screen. here how unlock second screen : if([[nsscreen screens] count] > 1){ // draw new window fill screen nsscreen *screen; nsrect screenrect = cgrectmake(0, 0, screen.frame.size.width , screen.frame.size.height); nswindow *secondarymonitorwindow = [[nswindow alloc] initwithcontentrect:screenrect stylemask:nsborderlesswindowmask backing:nsbackingstorebuffered defer:no screen:screen]; [secondarymonitorwindow.contentview exitfullscreenmodewithoptions:nil]; } i unlock first screen not second, if can me... if needs fixed following code : .m [windowarray insertobject:self.window atindex:0]; //if have many screens nsrect screenrect; nsarray *screenarray = [nsscreen screens]; (nsinteger index = 1; index < [screenarray count]; index++) { nsscreen *screen = [screenarray objectatindex: index]; scre...

Unmarshalling issue during Spring Rest Service call -

calling rest webservice using spring rest template follows- responseentity<string> response = resttemplate.exchange(builder.build().encode().touri(), httpmethod.get, entity, string.class); and output in string format as <info xmlns="http://schemas.test.org/2009/09/tests.new" xmlns:i="http://www.w3.org/2001/xmlschema-instance"> <firstname>firstname</firstname> <lastname>lastname</lastname> <testguid>guid</testguid> <testuid>1</testuid> <token>token</token> <testuserid>14</testuserid> </info> when trying unmarshal java class follows responseentity<info> response = resttemplate.exchange(builder.build().encode().touri(), httpmethod.get, entity, info.class) the info class defined @xmlrootelement(name = "info", namespace = "http://schemas.test.org/2009/09/tests.new") public class info implements serializable{ private string firstname;...

Rails: Puma server 3 not showing database queries in development -

i upgraded puma version 3. when start development server ( rails s -b0.0.0.0 ), console shows requests, not actual database queries before (version <= 3). couldn't find option it. how can see database queries in development console? thanks in advance! try adding activerecord::base.logger.level = logger::debug environments.rb or config.log_level = :debug environments/development.rb

android - Button with icon and text -

Image
i make button in android : but don't know how that. have use relativelayout elements ( imageview , textview , separator,...) ? i don't know best practice. you can use button property android:drawableleft="@drawable/ic_done" . refer this. <button android:id="@+id/button111111" android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawablepadding="5dp" android:layout_centerhorizontal="true" android:drawableleft="@drawable/ic_done" android:text="facebook" /> edit 1: if want without using button property android:drawableleft="@drawable/ic_done" then. refer this. create xml file named shape.xml inside res -> drawable folder. if don't see drawable folder in res directory create folder named drawable. <?xml version="1.0" encoding="ut...

python - Prevent Pandas from unpacking a tuple when creating a dataframe from dict -

when creating dataframe in pandas dictionary, tuple automatically expanded, i.e. import pandas d = {'a': 1, 'b': 2, 'c': (3,4)} df = pandas.dataframe.from_dict(d) print(df) returns b c 0 1 2 3 1 1 2 4 apart converting tuple string first, there way prevent happening? want result be b c 0 1 2 (3, 4) try add [] , value in dictionary key c list of tuple : import pandas d = {'a': 1, 'b': 2, 'c': [(3,4)]} df = pandas.dataframe.from_dict(d) print(df) b c 0 1 2 (3, 4)

Not able to changes cards in Java Swing CardLayout -

i have class named addaccounts class addaccounts extends jpanel { jpanel panelcont; //panel deck cardlayout cl; public addaccounts() { panelcont=new jpanel(); cl = new cardlayout(); panelcont.setlayout(cl);//set panel layout cardlayout setpreferredsize(new dimension(1013, 513));//set default size /* add panels main window or integrate panels*/ panelcont.add(new panel1(), "1"); panelcont.add(new panel2(),"2"); panelcont.add(new panel3(),"3"); cl.show(panelcont, "1"); add(panelcont); } public void gonext() { cl.show(panelcont, "2"); // cl.nxet(panelcont); system.out.println("method called"); //for debugging purpose } public void showfirstpanel(){ cl.show(panelcont, "1"); } } and 2 external(separate files) class ...

qbasic what is the difference between open "file.dat" for input as #1 or input as #2 -

now on grade 10 , learning open"file.dat" input/output #n once have @ program cls open "samrat.dat" input #1 input "enter name";n$ write #1,n$ close #1 end so program save name file use output #n print number. have @ next program cls open"samrat.dat" input #1 write #1,n$ print n$ close #1 end so program print or user name. 1 thing confusing me. if use open "samrat.dat" input #5 , change #1 #5 in places output same. dont quite understand how works. if #1 same #1000 need of other number. please tell me you're right, program work long use same filenumber on places. filenumber token tell different files appart in program. it possible program access more 1 file @ same time. example read 1 file, process input, , write file. open infile$ input #1 open outfile$ output #2 input #1, a$ a$ = ucase$(a$) print #2, a$ 'etc.

c# - MVC QueryString is an empty collection -

i want use redirection requested url user wanted access after login somehow returnurl null. (i did research on topic half hour , didn't find solution working me.) i debugged login view of app , i'm trying returnurl with new { returnurl = request.querystring["returnurl"] } inside of @using() tag. saw querystring empty collection , tried use without querystring or viewbag.returnurl neither 1 nor other worked me. the controller has right parameters , redirect via redirecttolocal(returnurl) doesn't matter if returnurl null. in action methods,use code redirecttoaction("login", "controllername", new { returnurl = request.url.absolutepath }); in login action method use public actionresult login(loginviewmodel model, string returnurl){//code}

ios - Reload UITableView without reloading header section -

i have uitableview section , index title. when user click on cell option view of height 42 gets display in cell. display option reload cell. section header getting updated. gives bizarre animation. how reload cell,without getting called other delegate method heightforheaderinsection , viewforheaderinsection . there several methods reloading tableview. to reload whole section including section's cell. - (void)reloadsections:(nsindexset *)sections withrowanimation:(uitableviewrowanimation)animation example: [tableviewcontent reloadsections:[nsindexset indexsetwithindex:1] withrowanimation:uitableviewrowanimationautomatic]; to reload single/multiple cells - (void)reloadrowsatindexpaths:(nsarray<nsindexpath > )indexpaths withrowanimation:(uitableviewrowanimation)animation example: [tableview reloadrowsatindexpaths:[nsarray arraywithobject:[nsindexpath indexpathforrow:0 insection:1]] withrowanimation:uitableviewrowanimationfade]; to reload who...

Weird Python Selenium Button Click Behaviour -

the part i'm trying click: <ul class="btns right"> <li><a href="javascript:void(0)" onclick="hr_expand_event_tab_all(&quot;&quot;)" class="expand-all" id="btn_expand_all_10580503">view cards</a></li> </ul> pretty straightforward thought. seem missing something. question updated little further down page. xpath isn't problem i've tried corrected xpath , it's same using class name. css hiding several versions of button common.exception being thrown on ones find xpath or class name. i've checked page loaded , element there. have check wait until full page loaded , screenshots sure. loadbutton = driver.find_element_by_xpath("//a[@class='expand-all']") gives: <class 'selenium.common.exceptions.elementnotvisibleexception'> so tried find onclick anchor: loadbutton = driver.find_element_by_xpath("//li[contains(@onclick, ...

tablecellrenderer - HTML Cellrenderer Bug -

i trying set rich text in table after event. problem is, html tags recognized after clicked on header or resize table. did little playground example after clicking button data loaded html tags. you set cell renderer before load data : var table = new qx.ui.table.table(null); button1.addlistener("execute", function(e) { var tablecolumnmodel = table.gettablecolumnmodel(); tablecolumnmodel.setdatacellrenderer(0, new qx.ui.table.cellrenderer.html()); tablemodel.setdata([["<b>test</b>"],["<i>test</i>"]]); }); here full playground example .

iphone - iOS SpriteKit animation not working -

i new ios native game development. trying create animation using frames ideal state character. following tutorial ray's website . doing fine can't see animation in working. first frame (default) visible time. debug code & it's indeed visiting blinking player method 3 frames present, nothing happening on screen. it great if can guide/help me identify issue. @implementation gamescene { nsarray *_playerblinkframes; } // player sknode *_player; -(id)initwithsize:(cgsize)size { if (self = [super initwithsize:size]) { [self createplayer]; } return self; } - (void) createplayer { sktextureatlas *playeranimatedatlas = [sktextureatlas atlasnamed:@"assets"]; _player = [sknode node]; skspritenode *sprite = [skspritenode spritenodewithimagenamed:@"idle"]; [_player addchild:sprite]; [sprite setname:@"ball"]; nsmutablearray *blinkframes = [nsmutablearray array]; sktexture *temp = [playera...

parsing a xml file using javascript does not givethe required result -

i trying parse xml-file using java-script. actually, read many tutorials find out how parse data xml-file correctly, , found on right way. concerning loadxmldoc(dname) function, passed path of xml-file loadxmldoc function follows: var dname = "d:\files\files\schriftsteller.xml"; function loadxmldoc(dname) but still parsing not give me desired result, want display name in following tag <name>jane austin</name> but web browser not display it, using chrome. please, (1) let me know mistake is? (2)what extension parser file should saved under(.html/.js) please find below xml-file , java-script file xml file: <?xml version="1.0" ?> <schriftsteller> <englischsprache> <dichtung> <fueller> <name>jane austin</name> <name>rex stout</name> <name>dashiell hammett</name> </fueller> </dichtung> </e...

php - How to reassign an array value in a loop? -

i have following piece of code:- $returnarr = $this->master_model->fetch_all_data($data, $selectstring,$limit, $offset); foreach($returnarr $row) { if (array_key_exists($data.'_image', $row)) { $img = base_url()."uploads/$data/". $row[$data.'_image']; $row[$data.'_image'] = $img; } } print_r($returnarr); the $return in following format: array ( [0] => array ( [sticker_image] => post_1462515402.jpg [sticker_code] => :* ) [1] => array ( [sticker_image] => post_1462515510.jpg [sticker_code] => ^=^ ) [2] => array ( [sticker_image] => post_1462515532.jpg [sticker_code] => >_<* ) [3] => array ( [sticker_image] => post_1462515539.jpg [sticker_code] => :(( ) ) now, in following line of code, changing [sticker_image] link: if (array_key...

c - Runtime error in the following code -

the following code,according me should run successfully,but fails @ runtime.i don't reason: void main() { int arr[5][3]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; int *m=arr[0]; int **p=&m; p=p+1; printf("%d",**p); } a.exe has stopped working @ runtime in gcc compiler,windows 7 64 bit an array of arrays , pointer pointer quite different, , can't used interchangeably. for example, if @ array arr looks in memory +-----------+-----------+-----------+-----------+-----+-----------+ | arr[0][0] | arr[0][1] | arr[0][2] | arr[1][0] | ... | arr[4][2] | +-----------+-----------+-----------+-----------+-----+-----------+ when have pointer-to-pointer p program don't knows points array of arrays, instead it's treated array of pointers, looks in memory: +------+------+------+-----+ | p[0] | p[1] | p[2] | ... | +------+------+------+-----+ | | | | | v | | | v | v so when ...

c# - NEST's method IndexMany to run synchronously -

i run small problem using nest's method indexmany (bulk index). found out when send amount of items elasticsearch indexed, response returned imidiately, not documents indexed @ point. the problem shown on following code: list<object> objecttoindex = new list<object>(); // assume 3000 items here elasticclient client = new elasticclient(settings); client.indexmany(objectstoindex, indexname, type); var readresult = client.search<t>(e => e .type(type) .index(indexname) .query(q => q .range(r => r.onfield(t => t.date).greaterorequals(dates[0]).lowerorequals(dates[1])) ) ); // read result contains 300-500 items system.threading.thread.sleep(2000); readresult = client.search<t>(e => e .type(type) .index(indexname) .query(q => q .range(r => r.onfield(t => t.date).greaterorequals(dates[0]).lowerorequals(dates[1])) ) ); // readresult contains 3000 items right this problem me, because ...

javascript - Gulp-angular, Gulp-less and bootstrap -

i m working gulp-angular yeoman generator , m having troubles dealing gulp-less , bootstrap. actually, when trying serve files, i've got : message: invalid mapping: {"generated":{"line":1293,"column":2},"source":"c:/project/angularjs/ucom/remake/bower_components/bootstrap/less/type.less","original":{"line":1,"column":null},"name":null} in file undefined line no. undefined details: linenumber: undefined filename: undefined i don't know what's happenning there. faced same issue. using gulp-sourcemaps while building css files , looks issue 1 of gulp-sourcemaps dependecies. my hunch convert-source-map. in case, disabling sourcemaps while building css files did trick me.

php - Restore MySQL Database from Wamp Folder -

is possible restore mysql database physical database files. have directory has following file types: request_form.ibd request_form.frm iam using wamp server.... although it's possible it's not recommended if haven't prepared file backup consistent db state. btw if need restore physical files of db need find data directory of dbms (i guess you're working on mysql), stop sql server, replace data files needed ones , restart sql server. after table/indexes restoring may needed; after fixing such problems suggest complete backup of database using proper tools (like mysqldump) , restore on fresh install using proper methods (restoring aforementioned mysqldump generated file)

What is the scope of an inner class Singleton in Java? -

what scope of inner class singleton in java? want class singleton-like class inside, every instance of outer class should have own instance of inner class. (i know not style of code, need pack in 1 class setup.) in advance! if declare inner class private , create instance every time create outer class have single instance of inner class per every instance of outer class. this not singleton pattern. something that. public class myouter { private myouter.myinner inner; public myouter() { inner = new myouter.myinner(); } ... private static class myinner { .... } }

php - magento passing variable to config.xml from frontend -

i have created custom module , custom cron job. here code: <crontab> <jobs> <customer_cron_job> <schedule> <cron_expr>*/1 * * * *</cron_expr><!-- configurable custom admin frontend--> </schedule> <run> <model>globalconnector/observer::cronupdates</model> </run> </customer_cron_job> </jobs> </crontab> now module has custom admin frontend. here want provide functionality user specify time (cron_expr) cron job run. i.e. 'cron_expr' dynamically set. appreciated. <crontab> <jobs> <company_export_send_order> <schedule> <!-- use config path in system.xml here --> <config_path>globalconnector/general/cron_settings</config_path> ...

javascript - Dropdown does not show in IE & on mobile devices -

i'm using https://github.com/recras/angular-jquery-timepicker allow time selection in angular application.it's working in chrome. however, in ie dropdown not show proper gmt value(ideally should show plus 5.30 hours). on mobile device, dropdown disappears touch on it.

javascript - How can I count how many of five properties in an object are non-null? -

i have object test represented typescript interface: interface iwordform { definition: string; sample1: string; sample2: string; sample3: string; sample4: string; sample5: string; } what need create function return count based on how many of sample1, sample2, sample3, sample4 , sample5 defined not null; i think using series of if statements there clean way using modern browser function? interfaces ain't there @ runtime, cannot use object.keys(). use explicit list of keys want check. var count = ["definition", "sample1", "sample2", "sample3", "sample4", "sample5"].filter(k => k in obj && obj[k] != null).length; or this: var iwordformnonnullkeys = array.prototype.filter.bind( ["definition", "sample1", "sample2", "sample3", "sample4", "sample5"], function(k){ return k in && this[k] != null } ...

javascript - Combine 2 arrays and fill with 0 if they are not duplicates -

i have 2 arrays datetimes. want display values in x-axis of chart. i need function combine arrays in 1 , add '0' aren't duplicates. array 1 = [2016-01-20,2016-01-21,2016-01-24] array 2 = [2016-01-21] final array = [0, 2016-01-21, 0] is there quick way this? thank much you can map() , indexof() var array1 = ['2016-01-20', '2016-01-21', '2016-01-24'] var array2 = ['2016-01-21'] var final = array1.map(function(e) { return (array2.indexof(e) == -1) ? e = 0 : e; }); console.log(final)

php - Laravel 5 - Paypal Payment - Pass data form to controller -

i have problem store forms inputs after payment paypal. have pass data form (name, phone_ship, address_ship ecc...) function ordersave () can store data other information. doesnt work. variabile $request->get('inputs of form') doesnt exist function saveorder argument 1 passed dixard\http\controllers\paypalcontroller::saveorder() must instance of illuminate\http\request, none given, called in c:\xampp\htdocs\2016\app\http\controllers\paypalcontroller.php on line 191 , defined paypalcontroller.php <?php namespace dixard\http\controllers; use illuminate\http\request; use dixard\http\requests; use dixard\http\controllers\controller; use illuminate\foundation\bus\dispatchescommands; use illuminate\routing\controller basecontroller; use illuminate\foundation\validation\validatesrequests; use paypal\rest\apicontext; use paypal\auth\oauthtokencredential; use paypal\api\amount; use paypal\api\details; use paypal\api\item; use paypal\api\itemlist;...

ios - UILocalNotification to open detail view controller for a specific item -

i'd set alerts specific items , have uilocalnotification open specific item table view controller , display details. in other words, when notification appears i'd able tap on "show item" , instead of showing list of items i'd see details of specific item. for work need store information on specific item (title, index, etc.) how can this? store title of item in uilocalnotification.userinfo ? to add information objective c localnotification.userinfo =@{@"title":title,@"index":index}; swift var userinfo = [string:string]() userinfo["title"] = title userinfo["index"] = index notification.userinfo = userinfo to information when notification arrive objective c - (void)application:(uiapplication *)application didreceivelocalnotification:(uilocalnotification *)notification { nslog(@“title = %@”,notification.userinfo[@"title"]); nslog(@“index = %@”,notification.userinfo[@"index...

TFS Database - Get list of files in collection -

im trying query tfs database list of files held in collection. we use tfs our version control vs solutions , im trying print out of files in each collections , whether checked in or not. ive got ones still checked out cant find checked in ones any appreciated never mind getting list in tbl_localversion. not ideal should suffice

Binding HTML to property (Vue.js) -

how can bind html vue component property? in php script have: $html = '<div>some text</div>'; $box = "<box_includes html_text='$html' ></box_includes>"; in vue template: <template id="template_box_includes"> {{ html_text }} </template> but in browser see text, including tags, it's being recognized text: <div>some text</div> in vue js, use of double braces escaping html. need use 3 avoid escaping html so: <template id="template_box_includes"> {{{ html_text }}} </template> you can learn more on page of documentation: http://vuejs.org/guide/syntax.html#raw-html i hope helps!

PowerShell: Pass local variable to function -

i have following powershell code: function readconfigdata { $workingdir = (get-location).path $file = "" if ($global:use_local_server) { $file = $workingdir + '\configs\localhost.ini' } else { $file = $workingdir + '\configs\' + $env:computername + '.ini' } write-host 'inifile: ' $file if (!$file -or ($file = "")) { throw [system.exception] "ini fil är inte satt." } if (!(test-path -path $file)) { throw [system.exception] "kan inte hitta ini fil." } } readconfigdata how should declare local variable $file can passed function test-path . local variable $file populated when place argument other function it's out of scope. i read about scopes article wasn't able figure out. currently error: inifile: d:\projects\scripts\configs\hbox.ini test-path : cannot bind argument parameter 'path' b...