Posts

Showing posts from September, 2010

Difference between Use Case and User Stories? -

this confuses me difference between user stories , use case. user stories description of how system shall behave in different conditions? the term use case has formal definition in uml: use cases means specifying required usages of system. typically, used capture requirements of system, is, system supposed do.[...] i.e., have formal structure , other concepts associated use case ( actors , example). user stories i've seen used informal way describe specific scenario (typically ui scenario) it's not formally described in uml spec. see uml superstructure spec (check proper link) in chapter 16 more details. hope helps, best regards.

javascript - Change dropdown menu when resizing via jquery -

i want change way dropdown menu works depending on screen resolution. i'm doing via jquery. above 1024px ul.level-2 menu shows when cursor hovers on button , below 1024px reacts on click. works when refreshing page on different screens not work when resizing page - $(window).resize(). when resize browser 1024px lower still reacts on hover. how can make work? advice appreciated. codepen: https://codepen.io/miunik/pen/gqwydg html <ul class="level-1"> <li>1 level item <ul class="level-2"> <li>2 level item</li> <li>2 level item</li> <li>2 level item</li> <li>2 level item</li> </ul> </li> <li>1 level item <ul class="level-2"> <li>2 level item</li> <li>2 level item</li> <li>2 level item</li> <li>2 level item</li> </ul> </li> &

reactjs - Integrating multiple SPAs in one single SPA using React -

we’re in process of re-imagining our suite of software applications , need advice. currently, have 3 large spas (coded in react&redux) need rewrite single spa. what we’d replace each of individual spas new spa written using react&redux. how can achieved? thanks help!!

singleton - Pass global service to child classes in Angular 2 -

i've got main component has 2 child components , service. bootstrap(main, [myservice]) , want have functionality (possibility call service functions) these both child components. how should pass 1 instance of service parent component child components? don't specify provider of service in component, include in constructor. if you're providing service in bootstrap , want singleton, component this. @component({ template: '<child-component></child-component>', directives: [childcomponent], providers: [] // no need include specify service here }) export class mycomponent { /*even though you're injecting service here, use same instance provided in bootstrap */ constructor(private myservice: myservice) { } } @component({ selector: 'child-component', providers: [] // no need include specify service here }) export class childcomponent { //you can long don't spec

ios - UIViewController Interactive Transition error when cancelled -

Image
i have custom transition between 1 uiviewcontroller (vc1) , modal uiviewcontroller (vc2) . interactively hide vc2 uipangesturerecognizer . when pan gesture finishes , translation in y axis equal or more 100pt, finish transition finishinteractivetransition() . otherwise cancel transition cancelinteractivetransition() . vc1 vc2 transition between vc1 , vc2 when transition cancelled because pan gesture translation less 100pt, expected behaviour revert custom transition animation , show vc2 again instead of this, vc1 shown. you can download project github .

vue.js - Vue 'computed' filters -

is possible pull in variable filter, , have filter update when changes? in computed property? i'm wanting able like: vue.filter('t', function(val) { return this.currentlanguage[val]; }); and have filter recompile template when this.currentlanguage changes. obviously can pass in additional parameter, don't want have each string. my code works when switching components, alternatively, there way force recompile? i'm using vue-router , this.$route.router.go({ path: this.$route.router.path, query: { t: + new date() } }) } unfortunately doesn't trigger recompile. you define reactivity using: vue.util.definereactive(obj, key, val) https://jsfiddle.net/pespantelis/qzuyxqq7/3/ also, have created package that: https://github.com/pespantelis/vue-localizer

c# - Not able to run BusyIndicator with BackgroundWorker in Wpf -

i have 2 windows. mainwindow , window busyindicator. i'm using backgroundworker , dispatcher work (calculation , ui) in main window, while want show busyindicator. window shows without busyindicator. busyindicator_window busy = new busyindicator_window(); busy.show(); backgroundworker worker = new backgroundworker(); worker.dowork += (o, ea) => { dispatcher.invoke((action)(() => { plot.plot_mv.startanke(selectedfilepath, lw); })); }; worker.runworkercompleted += (o, ea) => { busy.busyindicator.isbusy = false; }; busy.busyindicator.isbusy = true; worker.runworkerasync(); is there got wrong? thanks a background worker delegates ui thread pretty useless. work want do: worker.dowork += (o, ea) => { plot.plot_mv.startanke(selectedfilepath, lw); };

java - Can I pass column names in this manner? -

query = "update personal_details set '" + field + "' = '" + edit + "' associate_id = '" + associate_id + "'"; here table name personal_details , taking table column name parameter in variable filed , new value in edit. code in java. , database i'm accessing in postgresql. although can build string using plain concatenation, more recommended ways are: use stringbuilder/stringbuffer when build strings optimize program speed, specially if concatenate strings inside loop; the recommended way use preparedstatement , fill parameter values. see: http://docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html

android - How to change the permission in the manifest based on the app flavor? -

i need change required permission of app based on app flavor. it's 1 permission should replaced. how can it? edit i'm releasing 2 version of app 2 different market. i'm using in app billing , 2 market use different permission billing dialog need use different permission access market's billing dialog. create apk first market permissions required. copy apk desktop , store in folder name of market(this simplify handling). then create second apk second market different permissions. same in previous one(folder , desktop). not edit permissions.

javascript change the animation sequence without input -

what im looking add code change animation , make sequence of light go on automatically without user input.. here code far, need code change button clicking function automatic sequence of lights. <h1>changing html images</h1> <p> click button change traffic lights </p> <img id="myimage" onclick="changeimage()" src="red.jpg" width="100" height="180"> <button type ="button" onclick="changeimage()">change traffic light</button> <script> var counter = 0 var image = ["red.jpg","redandorange.jpg","orange.jpg","green.jpg"] function changeimage () { window.alert(counter) counter++ if(counter > 3 ){ counter = 0 } document.getelementbyid('myimage').src=image[counter] } </script> <body> </body> </html> you can use setinterval(method, intervaltime) or sett

Cracking zip password -

i have created zip archive of files , set password that. unfortunately, forget password. tried crack password "john ripper" , other cracking tools, not successful. have created file in ubuntu, , far consider crypto algorithm aes. since have files in zip file out of zip file, wondering if can use them in order crack or retrieve password or not? thanks in advanced. well, backup lost. there no better option brute force. want chosen plaintext attack , won't work against aes. this why encryption scares me. keep important keys printed , stored in safe. use incremental backups (notice "s") every night plus off-site continuous backup. paranoia can pay off, heck, wife paid paranoid.

javascript - How to make custom text cursor? -

Image
this question has answer here: styling text input caret 5 answers i need make text input cursor (text cursor) own styling using css or javascript. it's not possible css3, how can javascript? then final input should picture above. it's called caret . cannot style using css, using javascript, can mimic it: function $(elid) { return document.getelementbyid(elid); } var cursor; window.onload = init; function init() { cursor = $("cursor"); cursor.style.left = "0px"; } function nl2br(txt) { return txt.replace(/\n/g, "<br />"); } function writeit(from, e) { e = e || window.event; var w = $("writer"); var tw = from.value; w.innerhtml = nl2br(tw); } function moveit(count, e) { e = e || window.event; var keycode = e.keycode || e.which; // alert(count

Data distribution in Apache Spark -

i'm new spark , have general question.as far know whole file must available on worker nodes processed.if so, how know partition should read?driver controls partitions how driver tell them read partition? each rdd divided multiple partition. compute each partition, spark generate task , assign worker node. when driver sends task worker, specifies partitionid of task. the worker executes task chaining rdd's iterator way inputrdd , pass along partitionid. inputrdd determines part of input corresponding specified partition id , return data. rdditer.next -> parentrdditer.next -> grandparentrdditer.next -> ... -> inputrdditer.next

Packing a rectangle with equal sized circles python -

i have rectangular bounding box defined width w , height h , area a . how can pack n number of circles of equal area a inside rectangle such a-n*a minimal. in other words, how can calculate optimal number of equal sized circles can packed inside rectangle my use case: using kmeans clustering algorithm clustering vehicles in geographical bounding box. in order set number of clusters kmeans algorithm, experimenting circle packing 1 way of deriving number of clusters before apply kmeans algorithm. edit : edited op number can in deciding number of k-means clusters based on fitting circles in plane , minimizing uncovered places. from math import sqrt, pi def get_approximate_k(rectangle_area, circle_area): # making use of fact in infinite hexagonal packing, packing ratio (pi*sqrt(3)/6) return int((rectangle_area * pi * sqrt(3))/(6 * circle_area)) print get_approximate_k(10*100, 12) # returns 75

authentication - HTTPS test server that checks client certificates -

i have written web service client uses ssl client certificates authenticate remote server. since actual web service not yet available me, i'm looking public test server accepts client certificate authentication, can test ssl part of client correct implementation , configuration. i have tried https://requestb.in replies http status 403 (forbidden) when use client certificate. , https://httpbin.org/ accepts request doesn't give indication if certificate usable. is there similar service checks ssl client certificate? you can use following urls test ssl client authentication: https://server.cryptomix.com/secure/ https://prod.idrix.eu/secure/ they both use same configuration: accept client certificate , upon success display content of various webserver variables certificate used , ciphersuite selected. if authentication fails, error displayed. i hope useful.

excel - How to copy cell value only if other two cells matches -

i have excel file containing 2 spreadsheet shown below. want update value comm level in sheet 1 comm level in sheet 2 provided modem id in sheet 1 matches modem id in sheet 2. how automatically in libre office ? can suggest me formula or script work in libre office not have license ms office. sheet 1 modem id | comm level ----------------------- 70000 | 90 70001 | 90 70004 | 90 70007 | 90 70010 | 90 sheet 2 modem id | comm level ----------------------- 70001 | 80 70002 | 90 70003 | 60 70004 | 90 70009 | 90 thanks assuming modem id in a1 on both sheets. in c2 of sheet1 , copied down suit: =iferror(vlookup(a2,sheet2.a:b,2,0),b2) looks corresponding value vlookup match exists , if not found defaults existing value iferror .

android - Image receive slow from server json format? -

here receiving picture json in form of json , display picture in listview, problem images receive smoothly slow, mean display 1 pic , after3,4 second display 1 more , simillarly. want picture should display atonce,so sholud do? here code protected void onpostexecute(string result){ string s = result.trim(); loadingdialog.dismiss(); jsonobject respobject; try { respobject = new jsonobject(s); string active = respobject.getstring("status_message"); if(active.equalsignorecase("success")){ jsonarray array = respobject.getjsonarray("response"); (int =0; i<array.length();i++){ jsonobject jsonobject = array.getjsonobject(i); string icon= jsonobject.getstring("image"); string name = jsonobject.gets

php - regular expression match, Need to match both number -

how match both number 123,340.00 , 1.9e10? have tried regex below ^-?\d+(,)*(\d+\.(\d+e?)) but matches 123,340.00, looking match both number. idea? please. note: have tried @ online regex tool https://regex101.com you should allow digits after e @ least. also, ,* matches 0 or more commas, , think should allow comma + digits groups. i suggest using '~^-?\d+(?:,\d+)*(?:\.\d+)?(?:e[+-]?\d+)?$~i' see regex demo pattern explanation : ^ - start of sting -? - optional - (you may use [-+]? match plus or minus) \d+ - 1 or more digits (?:,\d+)* - 0 or more sequences of comma + 1 or more digits (?:\.\d+)? - optional decimal part, dot , 1+ digits (?:e[+-]?\d+)? - optional exponent part, e , optional minus or plus, , 1+ digits $ - end of string. note ~i modifier used match both e , e .

php - Get all the values in the table if parameter is null -

products::active($userid) ->where('name','like','%'.input::get('search').'%') ->orderby('created_at', 'desc') ->with('color') ->wherehas('seasons', function ($query)use($seasons) { $query->wherein('season_id', $seasons); }); in above query want results if $seasons null. in sql can write where( $seasons null) or ( season_id in $season ). how can write in laravel. wherehas makes inner join. products have atleast 1 season come. how can make left join products come if season null?

javascript - Error in Function to add Google Fonts in WordPress Theme -

i have following function in wordpress themes functions file should add google fonts theme. problem getting following error. parse error: syntax error, unexpected '=', expecting ')' in /home/***/wp-content/themes/sienna/functions.php on line 382 anyone know how can fix please ? heres function // add google fonts function sienna_fonts_url() { $fonts_url = ''; $font_families = array(); $font_families[] = 'questrial'; $font_families[] = 'open sans:400,600,700'; $font_families[] = 'playfair display:400,700'; $query_args = array( 'family' =&gt; urlencode( implode( '|', $font_families ) ), 'subset' =&gt; urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } return esc_url_raw( $fonts_url ); } many thanks, scott.

javascript - Take a picture from html5 -

i read lot of ways acquire image html5 page. i'm still unsure what's best needs: wide support browsers , os: @ least: chrome, firefox, android default, safari i don't need real-time acquisition. user must press button take picture, requesting system camera application there @ least 3 solutions : <input type="file" accept="image/*;capture=camera"> navigator.getusermedia() (it seems deprecated) mediadevices.getusermedia() (it seems experimental) anyway, see lot of examples embed camera page (w/ getusermedia) don't know if can rely on first method. using webrtc getusermedia api going cover modern browsers apart safari: http://caniuse.com/#feat=stream here example page uses getusermedia take still picture (with link page describing code). getusermedia demos show video stream in visible canvas area, that's not required. can capture image using getusermedia without displaying video stream in visible canvas. un

AngularJS global error handling - custom method error handler doesn't fire -

here's scenario (angularjs v1.3.15): $httpprovider.interceptors.push(function($rootscope) { return { 'responseerror': function(rejection) { //...some custom data checking console.log('error #1'); return rejection; } }; }); and now, send query server using $resource (which returns 404 error, desired in case), , return $promise : var promise = controller.sendcustomquery(); promise.catch(function (response) { console.log('error #2'); } ); and in console can see message error #1 , no error #2 . why ? instead of returning rejection return rejected promise angular.module('app', []) .config(function($httpprovider) { $httpprovider.interceptors.push(function($q) { return { responseerror: function(rejection) { console.log('error #1') return $q.reject(reject

Elasticsearch single indexing performance -

is there difference when indexing elasticsearch batch data , single data? want use single indexing, don't know it's performance. bulk api should used when ingesting large amounts of data. there significant overhead pay in terms of resource utilization/performance when using single index api (instead of bulk) index large amount of docs.

sql - java search-getting an integer value from a string preparedstatement -

i have java code, , want able search year (which int ) textfield , show table. how implement in preparestatement ? need parse? try { connection = dbconnect.getconnection(); //int filmyear = integer.parseint(txtsearch.gettext()); statement = connection.preparestatement("select filmtitle, filmyear, filmgenre, companyname production, film, company (lower(filmtitle) lower (?) or " + "lower (filmgenre) lower (?) or filmyear = ?)and production.companyid = company.companyid , production.filmid = film.filmid"); statement.setstring(1, "%" +txtsearch.gettext()+"%"); statement.setstring(2, "%" +txtsearch.gettext()+"%"); // statement.setint(3, +txtsearch.gettext()); resultset = statement.executequery(); table.setmodel(dbutils.resultsettotablemodel(resultset)); }catch(sqlexception e) { e.printstacktrace(); } as can see tried cre

How to send array from javascript to JSp -

in code need send array javascript jsp did many times , i'm unable output i'm getting array printing array please me i'm missing my code is <%@page import="sun.security.util.length"%> <%@ page import="java.util.list" %> <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> <script> function funct() { var h=localstorage.getitem('m'); location.replace("test1jsp.jsp?arr="+h); } </script> </head> <body onload="funct();"> <% string arr[]=request.getparametervalues("arr"); list<string> larr = (list<string>)request.getattribute("arr"); for(int p =

Excel: Transpose data from rows to column headings -

my problem, title states, has transposing data rows columns original data came csv format in second column 'dates , rank' semicolons , spaces acted delimiters. country dates , rank switzerland [2014-03-07] 7;[2014-10-17] 7; usa [2011-07-01] 7;[2012-02-17] 7;[2012-09-30] 7;[2013-01-31] 7; france [2011-07-01] 4;[2012-02-17] 4;[2012-09-30] 4; china [2015-01-16] 7;[2015-03-06] 7;[2015-10-16] 7;[2015-10-23] 7; so, using text columns function excel separated data within 'dates , rank' column different cells. , result looks this: country dates , rank c d e f g h switzerland [2014-03-07] 7 [2014-10-17] 7 usa [2011-07-01] 7 [2012-02-17] 7 [2012-09-30] 7 [2013-01-31] 7 france [2011-07-01] 4 [2012-02-17] 4 [2012-09-30] 4 china [2015-01-16] 7 [2015-03-06] 7 [2015-10-16] 7

ios - GCD Semaphore does not wait (Swift) -

i'm pretty new gcd. have function forward geocoding , issue returns before completion closure completes. every time returns nil . found out can use semaphores return waits completion closure complete, there little examples online , found none of function returns. tried implement it, function still returns nil though location printed out console moments later. if tell me making mistake grateful. func forwardgeocoding(address: string) -> cllocation? { var userlocation: cllocation? var returnvalue: cllocation? let semaphore = dispatch_semaphore_create(0) clgeocoder().geocodeaddressstring(address, completionhandler: { (placemarks, error) in if error != nil { print("geocoding error: \(error)") return } if placemarks?.count > 0 { let placemark = placemarks?.first let location = placemark?.location let coordinate = location?.coordinate print("setting

xamarin - How to draw circles or Line in UrhoSharp -

am using urhosharp game engine xamarim develop cross-platform game .... choice , compatible wpf did not know how draw shapes , went through guide , documentation , did not find way maybe draw circles,rounded shapes,annulus or geometric type knows or me . grateful . thanks in advance i tried piece of code no circle appeared in screen: debugrenderer debug = new debugrenderer(); debug.addcircle(new vector3(50,50,0),new vector3(100,25,0),50,color.magenta,2 ,true ); (int = 0; < 512; ++i) { var start = new vector3(i, 0, 0); var end = new vector3(i, 100, 0); debug.addline(start, end, color.white, false); debug.addcircle(start, end, 50f, color.red, i, false); } scene.addcomponent(debug); just want note debugrenderrender intended debugging purposes. if want make debugrenderer work need subscribe postrenderupdate this: engine.subscribetopostrender

XCTest: how can I tell which XCTestExpectation invoked 'fulfill'? -

i'm testing class has delegate. delegate test class of course, , implementation of delegate methods call different expectations: - (void)mysuccess { [self.successexpectation fulfill]; } - (void)myfail:(nserror *)error { [self.failexpectation fulfill]; } how can tell test class expectation called 'fulfill'? this isn't true way expectations supposed used. should queue expectation happen, may or may not fulfilled. test fail if expectation not met, means don't need track whether 'fail' or 'success' expectation has been met. can derive success or failure single expectation, should use expectations in manner, if that's possible code. for example, mysuccess method should call fulfill on expectation, myfail should nothing (resulting in expectation not being fulfilled) and/or raise error or xctfail().

javascript - AngularJS Update input with two models with onSubmit -

i want have following. directive 1 -> displays in users form directive 2 -> updates when user presses submit button. examplesnippet: <h2>{{directive1}}</h2> <!-- seen user when changes directive 1 !--> <input type="text" class="form-control" ng-model="directive1" name="input" placeholder="this primary input (this needs updated when form used user. "> <h3>{{directive2}}</h3> <!-- should changed when user presses submit button on form ng-model-options: {onupdate: 'submit'} here modified example. directive1 updates on user input. directive2 updates on enter . jsfiddle var app = angular.module("myapp", []); app.controller("myctrl", function($scope) { $scope.directive1 = "stackoverflow"; $scope.directive2 = "submit text"; $scope.myfunc = function () { $scope.directive2 = $scope.directive1; } }

android async http - AndroidAsyncHttp post data with 4 parameter in header and 10 in body -

hello want use androidasynchttp posting data server. for have 4 parameters in header , 10 in body request have done following code not working , getting null response.. void callmethod() { asynchttpclient clinet = new asynchttpclient(); httppost httppost = new httppost(); httppost.setheader("headerprmname", "werew"); httppost.setheader("headerprmname", "werwer"); httppost.setheader("headerprmname", "rwerwep"); httppost.setheader("headerprmname", "werwe"); network.request r = new network.request(); clinet.addheader("headerprmname"werr"); clinet.addheader("headerprmname", "werwer"); clinet.addheader("headerprmname", "1223134"); clinet.addheader("headerprmname", "wer"); // headers headers1=headers.of("head

user interface - Enable mouse wheel in Spinbox Tk Python -

i wondering if there smart way of enabling mouse wheel in tk widget 'spinbox' in python. the sensible solution found far derive new spinbox class wanted functionality: class spinbox(tk.spinbox): def __init__(self, *args, **kwargs): tk.spinbox.__init__(self, *args, **kwargs) self.bind('<mousewheel>', self.mousewheel) self.bind('<button-4>', self.mousewheel) self.bind('<button-5>', self.mousewheel) def mousewheel(self, event): if event.num == 5 or event.delta == -120: self.invoke('buttondown') elif event.num == 4 or event.delta == 120: self.invoke('buttonup') but given expected behavior, suspecting there better solution.

performance - Notification with setGroupSummary(true) is not visible in Android N -

Image
tried show 3 notification in cluster format. per doc, added setgroupsummary(true) property first notification.but in result have got 2 notification. notification added groupsummary property not visible. notificationcompat.builder firstnotification = createnotification(context,"1.message","here go 1"); firstnotification .setgroupsummary(true); firstnotification .setgroup("key_notification_group"); notificationcompat.builder secondnotifi = createnotification(context,"2.message","here go 2"); secondnotifi .setgroup("key_notification_group"); notificationcompat.builder thirdnotifi= createnotification(context,"3.message","here go 3"); thirdnotifi.setgroup("key_notification_group"); here notification trigger, notificationmanager = (notificationmanager) context.getsystemservice(context.notification_service); notificationmanager.notify(0,firstnotification .build()); notificationmana

xamarin - UWP - Object reference not set to an instance of an object -

after upgrading microsoft.netcore.universalwindowsplatform cannot compile xamarin app-project in release anymore, internal compiler error: object reference not set instance of object . i using these nuget packages acr.userdialogs 5.2.2 exiflib.pcl 1.0.1 (in portable project) microsoft.netcore.universalwindowsplatform 5.2.0 mr.gestures 1.3.4 newtonsoft.json 7.0.1 (in portable project) splat 1.6.2 (in portable project) sqlite.net.core-pcl 3.1.1 sqlite.net-pcl 3.1.1 win2d.uwp 1.18.0 (in portable project) xam.plugins.settings 2.1.0 xamarin.forms 2.3.0.107 xamarin.insights 1.12.3 xlabs.core 2.2.0-pre02 xlabs.forms 2.2.0-pre02 xlabs.ioc 2.2.0-pre02 xlabs.platform 2.2.0-pre02 xlabs.serialization 2.2.0-pre02 a log can found here . i hope in here can me. all platforms set compile .net native tool chain . update if build xlabs myself , set compile .net native tool chain unchecked. these errors occurs. app manifest error found: app

javascript - Using Value of a Date Picker/Time Picker -

i got date , time picker in code: <datepicker id="datepicker" placeholder="{i18n>enterdate}" width="15%"> <layoutdata> <flexitemdata growfactor="1" /> </layoutdata> </datepicker> <timepicker id="timepicker" placeholder="{i18n>entertime}" width="15%"> <layoutdata> <flexitemdata growfactor="0" /> </layoutdata> </timepicker> from api reference not able understand how can use values user types in....  what did this: var abc = new sap.m.datepicker(); var date = abc.getvaluedate().byid("datepicker"); but seems not work.... guess i'm doing horribly wrong here var abc = this.byid("datepicker"); // 'this' - controller instance var date = abc.getdatevalue(); first, instance of date picker -

python - Scipy.misc import not working -

i'm having problems importing scipy.misc in python script. know other people posted questions concerning this, solutions not working me. the program writing begins this: import matplotlib plt matplotlib.pyplot import imshow pil import image scipy.misc import bytescale skimage import exposure import numpy np and error scipy.misc line: importerror: cannot import name doccer i gathered had update scipy , maybe numpy, let me these posts: can't install scipy through pip , importerror when importing modules scipy after this, updated pip succesfully (this installer use) , tried update scipy. however, gave me lot of errors. in end, tried manually update scipy using post , website, suggested others: filename.whl not supported wheel on platform , http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy however, somehow lot of red text , 'exception' messages (unfortunately cannot copy/paste here), , ends ioerror: [errno22] invalid mode ('rb') or filename. tri

javascript - DefinitelyTyped vs index.d.ts for angular library -

i created simple library unit testing helpers angular 1.x: https://github.com/dakolech/angular-unit-testing-helpers and want add types definitions. question is: should create index.d.ts file in repository or should create w new folder in definitelytyped repository? if first, how import angular types in files (e.g. ng.iscope )? the preferred approach if possible include types within npm package , specify location in package.json. you need include [something].d.ts file in project, add "typings" property package.json referencing it, , publish , code npm. see https://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html official documentation on this. if project depends on types don't have types included in npm packages, gets more complicated. see https://github.com/typings/typings/blob/master/docs/faq.md#should-i-use-the-typings-field-in-packagejson details. want include typings.json file specifies how hold of dependencies typings, , t

google api - How to stream repeated fields into bigquery for non-records? -

i'm streaming data google bigquery. have repeated field, i'm receiving following error: [{"errors"=[ {"debuginfo"="generic::invalid_argument: field not record.", "location"="hashtags", "message"="this field not record.", "reason"="invalid"}], "index"=0}] the schema contains: ..., { "name": "hashtags", "type": "string", "mode": "repeated" } i'm passing list of strings hashtags in json i'm sending. what's going wrong , how can fix it? don't want have make single-field value record.

php - How to store/send language specific characters via XML -

i have system uses ajax send/receive information server(php). on server side, suppose 'store' following code xml , read , use on client: <div id="somediv">Čiča gliša</div> the server gives no 'error' in logs, xml gets sent, on client side "not well-formatted" error when attempting read this. the xml 'created' line (as far can tell, not back-end dev, wouldn't proficient these things, 'content' causing issue time tasked resolving it. $this->xml = new simplexmlelement('<?xml version="1.0" encoding="utf-8"?><xml/>') when change letters Č , Š c , s works. dont know how make work otherwise. using mozzila on client if matters, freshly installed. edit: xml requested in comments (if managed debug properly) response: <?xml version="1.0" encoding="utf-8"?> <xml> <client_contents> <frame> <![cdata[

windows - Python -Edit with IDE doesn't show up on right click of any python file -

i have installed python version 2.7.later updated 3.4 , able see " edit ide" option python files.due project requirements went 2.7.later on, not able see "edit ide option". gone through answers same issue , followed steps explained.but still i'm facing same issue.not sure if i'm doing silly mistake.please can 1 me figure out issue. snapshot of python installed location in registry

javascript - How to dynamically edit rows/columns to a Google Line chart on user action(slider/dropdown) -

i have create line chart using google visualization api , data coming json line chart. want edit line chart on user action(can dropdown each point on horizontal axis) i.e. change data values passes google chart i.e. edit value in " arraytodatatable ". var linedata = google.visualization.arraytodatatable([ ['popularity', 'time'], [0, 0], [1, 10], [2, 23], [3, 17], [4, 18], [5, 9], [6, 11], [7, 27], [8, 33], [9, 40], [10, 32], [11, 35], [12, 30], [13, 40] ]); i tried using controls , dashboards(google chart feature) allows change chart below mentioned link: https://jsfiddle.net/harshl22/nuff8zlc/1/ but changing axis values not datatable values wanted. is there feature or property allow me so. thanks in advance.

ios - xcode, how to use storyboard reference connect inner view controller? -

Image
in screen shot 1 have view controller connect storyboard reference. in screen shot 2 reference storyboard, have initial view controller one , inner view controller two . how connect inner vc two reference? step 1: add id view controller inner storyboard(you want segue connect with). step 2: in storyboard reference, add id of vc want connect with.

javascript - AngularJS Does not send HTTP Post request -

i have following code: application.controller('userlogincontroller', function($scope,$http){ window.document.title = "user login"; $scope.form = { username: '',password: ''}; $scope.submitlogin = function(){ var config = { method: 'post', url: 'server_app/login.php', data: { 'username' : $scope.form.password, 'password' : $scope.form.password } }; var request = $http(config); request.then(function (response){ $scope.errormessage = response.data; },function(error){ $scope.errormessage = error.data; }) } }); i trying send post request backend server that: var_dump($_post); after submitting data button should array $_post back. insteed of get array (size=0) empty my html code that: <input placeholder="login" class="searchproduct" autocomplete="off" name="u

scala - udf spark column names -

i need specify sequence of columns. if pass 2 strings, works fine val cols = array("predicted1", "predicted2") but if pass sequence or array, error: val cols = array(seq("predicted1", "predicted2")) could please me? many thanks! function signature def array(colname: string, colnames: string*): column means takes 1 string , 1 or more strings. if want use sequence, this: array("predicted1", seq("predicted2"):_*) from can see in code , there couple of overloaded versions of function, neither 1 takes seq directly. converting varargs described should way go.

swift - Advise where to store data for iOS app -

i have created app using ionic , cordova , want remake on ios. working ios first time, , cannot figure out how store data. example: have form user has input data, inputs not in 1 view, there must several views. used create empty array , put step step, can't use same view controller on multiple views. tried core data, core data cannot store arrays. object this: var samplearray = ( duration: 13, dayoftheweek: thursday, personlist: [ (name: rocky, age: 26), (name: ralph, age:23) ] ) the question be: how make input form on several views , should store data, , later able store data core data? as first comment says, question quite large. when 'one form on several view', consider 'one form per view'. keep simple s... ;) (except if use page control form.) basically, have 3 ways store data : nsuserdefaults : store data in dictionary later use file : save data file (why not .csv ?) coredata : can persist arrays binary data in core data t

go - Godoc, create html for entire package -

how can use godoc create html documentation entire package. i.e. recursively. @ moment when run: godoc -html -goroot="mypath" pkg > index.html i index.html contains information on .go files in current directory. there no documentation other sub packages index.html include dead links them. how can run above command in recursive fashion? perhaps missing because there no mention of recursion in godoc documentation. go has no notion of "sub packages" in reality - packages packages, can tell package declaration @ top of file not having hierarchy. unidiomatic package documentation nested subdirectories single file - subdirectories contain different packages, documentation should separate.

aggregation framework - How to get count of multidimentional array with conditions in mongodb? -

i have mongo document chatmessages as { "_id" : objectid("5784dcd9db2c60b54b8b45d3"), "sender_id" : "55505ad6b5a0925f4c8b7707", "receivers_id" : [ "57715368db2c60e5208b4579" ], "messages" : [ { "_id" : objectid("5784e0fadb2c605c6d8b4578"), "sender" : "57715368db2c60e5208b4579", "message" : "hai", "send_at" : numberlong(1468326138), "read_by" : [ { "user" : "55505ad6b5a0925f4c8b7707", "at" : numberlong(0) } ] } ], "updated_at" : numberlong(1468327157), "created_at" : numberlong(1468327157) } i need find total unread messages document above. suppose current user_id 55505ad6b5a092

php - parallel payment or chained payment -

how send payment in 2 users account on single click, want payment freelancer , admin on same time , single click. example: have $3000,i want pay $2000 freelancer , $1000 admin in single click. <?php if ($data['accept_freelancer_status1'] == "1") { ?> <td> <br> <br>&nbsp; <?php $mode = "sandbox"; //live $admin_email = "busineess_mail"; if ($mode == "sandbox") { $url = "https://www.sandbox.paypal.com/cgi-bin/webscr"; } else { $url = "https://www.paypal.com/cgi-bin/webscr"; } ?> <form action="<?php echo $url; ?>" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="hosted_button_id" value="aw72ma4xcqtsa">

swift - How to run a previously compiled version (or a previous build) of an Xcode project in ios 10.0 simulator -

i'm trying test 1 of apps on ios 10. have downloaded xcode 8 beta ships ios 10.0 simulator. however, expected, xcode 8 throwing tons of errors on libraries i'm using [like alamofire] preventing me building in xcode 8, don't feel need worry right now. i'm looking easy way run last stable compiled version (which can build within xcode 7 ios 9.3). unable trigger ios 10.0 simulator terminal via xcrun have used achieve similar things in past. any guidance appreciated! edit -- solved i figured out way achieve looking for, interested. in xcode7 go preferences > locations > , change command line tools xcode 8.0 in terminal, type xcrun simctl list see available simulators (ios 10.0 simulators should available now). copy udid of simulator want. make sure normal simulator app not running, run open /applications/xcode-beta.app/contents/developer/applications/simulator.app --args -currentdeviceudid <copied udid> after desired simulator booted, run xcrun

javascript - Why is it a bad idea to override native methods? -

i posted question overriding push using object.defineproperty . original question here . code working on over my codepen . a user left following comment: it's bad idea overwrite native method, both on prototype or on instantiated objects why? the reason why decided override push because needed have push call method after element had been pushed. not changing functionality of push except have fire event on completion. is bad did , if alternative? one problem can think of have push method specific problem, , if later need normal push method. don't know if case or not, might cause have refactor code later, allow both "normal push" , "altered push". another problem can think of, if , not 1 working on code, else might not know push overridden , not follow standard behaviour anymore. this cause potential issues. might not have changed lot, in case changes made cause error, might leave else scratching head wondering why (in opinion

c# - Error CS0120 with FindViewById in Xamarin/Android -

i have error findviewbyid under xamarin/android: error cs0120 object reference required property , method, or non-static field ' . here axml file: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layoutdeadreckoning" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <textview android:id="@+id/startx" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#ff66ff66" android:padding="20px" android:text="startx" /> </linearlayout> and here code public class deadreckoningactivity : activity {//declaration protected override void oncreate(bundle savedinstancestat

javascript - Substitue $_REQUEST -

i know enough code dangerous, couldn't write scratch if life depended on it. i'm migrating website new hosting has newer version of php doesn't allow $_request (i think). code designed encrypt pdf. works great on old site (probably older version of php). tried replacing $_request $_get , didn't work. appreciated. excluded formatting code , basic html. <?php $timearr = explode( ' ', microtime( ) ); $pagestarttime = $timearr[ 1 ] + $timearr[ 0 ]; $file = $_files['file']; if($_request['submit'] && (!trim($_request['password']) || $_request['password'] == 'password')) { $msg = 'please enter password.'; } elseif(is_array($file) && $file['error'] == 0) { $enc_path = 'encrypted'; $src = $file['tmp_name']; $dest = "{$enc_path}/{$file['name']}"; $pass = trim($_request['password']); $cmd_fmt = "pdftk '$src' o

error handling - Report SSIS success when loop fails -

Image
i have package has loop in it, loops through few connections. each iteration through loop new connection. problem though these connections down @ package run time. i've added on error, send email notification, , continue loop. this works fine, using event handlers , changing propagate value false . issue is, if connection fails, finish loop, report entire package fails. issue because inside job in ssms, stop job after package complete, , report failed, when did not. is there way have package report success if loop kicks out failed e-mail? don't want "continue next step on fail" because there other parts package legit fail, , need notified on. edit: here screen shots of i'm doing. inside loop there dataflow task, first dataflow has connection fails. when does, triggers email task notify us, continue loop. unfortunately failpackageonfailure set false. on task fails (or parent container if applicable), change value of failpackageonfail

Java XML Insert a parent node -

i have following xml <root> <page> <object ref="a"></object> <object ref="b"></object> </page> </root> i want convert <root> <page> <objectgroup ref="a"> <object ref="a"/> </objectgroup> <objectgroup ref="b"> <object ref="b"/> </objectgroup> </page> </root> basically want introduce new parent node. used below way it's introducing more parents private static void loadroots(string xmlpath) { document doc = migrate.inittreeopfromstring(xmlpath); element rootelement = doc.getdocumentelement(); loadpage(rootelement); migrate.finishtreeop(doc, "d:\\a.xml"); } private static void loadpage(element root) { nodelist pagenodes = root.getchildnodes(); (int j = 0

angular - ng2-table: Can't bind to 'X' since it isn't a known native property -

i'm having problems trying demo work. i've installed module via: npm ng2-table --save i've added entries in systemjs.config.js map , package fields: var map = { ..., 'ng2-table': 'node_modules/ng2-table' }; var packages = { ..., 'ng2-table': { defaultextension: 'js' } }; copied html , ts here: http://valor-software.com/ng2-table/ when loading created component following error: can't bind 'totalitems' since isn't known native property what missing? i think it's because directives aren't correctly specified in directives attributes of component want use ng2-table. @component({ selector: 'table-demo', template: template, directives: [ng_table_directives, pagination_directives] // <------ }) export class tabledemocomponent implements oninit { (...) } are sure ng_table_directives correctly set

arrays - PHP SOAP Salesforce Sub Query -

i using soap query our salesforce database , can query , display results. want use relationship queries (sub queries). can results query, struggling displaythe sub query results in php. i doing following: $query = "select account.name, (select contact.name, contact.accountid contacts) account name '%test client%'"; $response = $sforceconnection->query($query); foreach ($response->records $recordset) { echo "$recordset->name."<br />"; } i can display company name fine, struggling display sub query data contact.name , contact.accountid. not sure of correct syntax display these 2 fields. when run sql following array repose: ["querylocator"]=> null ["done"]=> bool(true) ["records"]=> array(1) { [0]=> object(stdclass)#10 (3) { ["id"]=> null ["contacts"]=> object(stdclass)#11 (4) { ["done"]=> bool(true) [&qu

imageicon - Android App iCon configuration issue - black & white -

Image
i'm trying setup icon android app when click icon setup , select launcher icons, selected image, ic_launcher.png showing black & white. missing setting here? posting solution or issue causing problem. using android studio preview , issue. preview not ready production app, it's beta version. reverted stable version of app , it's working icons. attached sample image android studio 2.1.2