Posts

Showing posts from April, 2015

javascript - Convert a statement to ES5 -

i need helps convert statement below es5 syntax. in es5? const { a, b, c = “foo” } = this.props; i suggest use explicit check if property c exists in given object or not. if not given, use default value. var = this.props.a, b = this.props.b, c = this.props.c === undefined ? 'foo' : this.props.c; the otherwise used pattern c = this.props.c || 'foo'; does not work given falsy value zero. why need check undefined (kudos to loganfsmyth mention problem in comments)? because undefined value check default parameters in function in es6. const f = (c = 'foo') => console.log(c); f(); // 'foo' f(undefined); // 'foo' f(0) // 0

android - Alternative for using webview for oAuth Google without Google Play service incorporation -

we have custom devices run on android os dont have google play services incorporated. have google login using webview oauth2.0 authentication. , per documentation has been deprected. read there way https://developers.google.com/identity/sign-in/android/ seems requires gradle incorporation play services. way use google authentication? found 2 options below helpful in case? 1. https://firebase.google.com/docs/auth/android/start/ 2. https://developers.google.com/api-client-library/java/google-api-java-client/oauth2 which can suitable requirement please help. regards, shraddha yes, indeed google quite time ago has blocked possibility login it's services via app's internal webview . reason google not trust external app providers, is't aware of security of connection. forces external app providers use google's methods of login it's services. source: modernizing oauth interactions in native apps better usability , security indeed have found rig

javascript - How to access the correct `this` inside a callback? -

i have constructor function registers event handler: function myconstructor(data, transport) { this.data = data; transport.on('data', function () { alert(this.data); }); } // mock transport object var transport = { on: function(event, callback) { settimeout(callback, 1000); } }; // called var obj = new myconstructor('foo', transport); however, i'm not able access data property of created object inside callback. looks this not refer object created other one. i tried use object method instead of anonymous function: function myconstructor(data, transport) { this.data = data; transport.on('data', this.alert); } myconstructor.prototype.alert = function() { alert(this.name); }; but exhibits same problems. how can access correct object? what should know this this (aka "the context") special keyword inside each function , value depends on how function

php - Google Maps API and Wordpress with locations -

im busy made page in wordpress calculate diffrence between 2 places. what have far works have couple of locations inside wordpress , there customfield longitude , latitude need loop. <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=geometry"></script> <script> var p1 = new google.maps.latlng(<?php echo $lat;?>, <?php echo $long;?>); // here comes input result var p2 = new google.maps.latlng(52.162304, 5.4606); // every shop location //bereken de aantal km's tussen de twee punten function calcdistance(p1, p2) { return (google.maps.geometry.spherical.computedistancebetween(p1, p2) / 1000).tofixed(2); } //alert(calcdistance(p1, p2)); $( document ).ready(function() { $('#afstand').html('distance between p1 , p2 is: ' + calcdistance(p1,

c++ - Getting user input from R console: Rcpp and std::cin -

i have been doing exercises learn c++ , decided integrate them r since want write c++ backends r functions. having trouble finding solution retrieve user input r console. while there rcpp::rcout printing , returning output, there doesn't seem similar funciton std::cin.... #include <rcpp.h> // [[rcpp::export]] rcpp::string cola() { rcpp::rcout << "pick drink:" << std::endl << "1 - espresso" << std::endl << "2 - americano" << std::endl << "3 - latte" << std::endl << "4 - cafe dopio" << std::endl << "5 - tea" << std::endl; int drink; std::cin >> drink; std::string out; switch(drink) { case 1: out = "here espresso"; case 2: out = "here americano"; case 3: out = "here latte"; case 4: out = "here cafe dopio"; case 5: out = "here tea"; case 0: out = "error. choice

swift - TwitterKit not returning users email ios -

i implementing twitter login on ios application using twitter kit. { let loginbutton = twtrloginbutton(logincompletion: { session, error in if (session != nil) { print("signed in \(session?.username)"); self.perform(#selector(viewcontroller.requestforemail), with: nil, afterdelay: 5.0) } else { print("error: \(error?.localizeddescription)"); } }) loginbutton.center = self.view.center self.view.addsubview(loginbutton) } i logged in successfully. when request email below code: { let client = twtrapiclient.withcurrentuser() client.requestemail { email, error in if (email != nil) { print("signed in \(email)"); } else { print("error: \(error?.localizeddescription)"); } }} i error: this user not have email address. i enabled request email addre

In Haskell, when we use a do block, how does it figure out which monad to be used? -

we know block syntactic sugar. how figure out monadic context in? assume don't use <- operator anywhere in block. maybe "practical" examples help: foo1 = print 5 return 7 -- print belongs io monad. whole thing in io. foo2 x = writetvar x 7 return 11 -- writetvar belongs stm monad. whole thing in stm. foo3 = let x = 5 [1, 2, 3, 4] -- last line list expression. whole thing in list monad. foo4 = put 7 return 9 -- put in state monad. whole thing in state monad. foo5 = x <- magic1 y <- magic2 return (x, y) -- in whatever monad magic1 , magic2 in. foo6 = return 13 -- doesn't mention monad. works possible monads! foo7 abc def = x <- abc y <- def return (x, y) -- runs in whatever monad abc , def run in. -- passing different arguments, can change monad is!

archlinux arm - .Net Core 2.0 publish, dependency missing -

i have same hello world project (which create template) on 2 separate computers, 1 created , copied other pc. both have .net core 2.0, , i'm using command line build: "dotnet publish -r linux-arm". for while worked on both, 1 of them stops on console.writeline exeption doesn't find system.runtime.extensions. , build it's not there in folder (the dll), not referenced in "consoleapp1.deps.json", that's difference between 2 builds, source 100% same. i tried removing .net core installations pc, , vs2017 preview , reinstalling .net core 2.0 (tried right after uninstallation , didn't recognize dotnet command) if replace dependency file , add dll failing build, works. i had delete "c:\users{user}.nuget\packages", "dotnet restore", afterwards build ran fine

Circular diagram using sankey in Python -

i work on jupyter, python 2.7. want set cycle circle arrow diagram. able start question: circular arrow flow chart in python that's code far: import numpy np import matplotlib.pyplot plt matplotlib.sankey import sankey fig = plt.figure() pos = [3, 1] color = 'w' fontsize= 16 ax = fig.add_subplot(1, 1, 1, xticks=[], yticks=[], title ="intelligence cycle") flows = [pos[1], -pos[1]] sankey = sankey(ax=ax, gap=0.5, scale=1.0/pos[0]) sankey.add(facecolor='darkslateblue', flows=flows, labels = ["identify need",none], orientations=[-1,0] ) sankey.add(facecolor='blueviolet', flows=flows, labels = ["collect",none], orientations=[0,-1],prior = 0, connect=(1, 0) ) sankey.add(facecolor='cornflowerblue', flows=flows, labels = ["process",none], orientations=[-1,0],prior = 1, connect=(1, 0)

reactjs - Target specific CSS classes with Styled Components -

Image
how go styling react-datepicker styled-components? datepicker library looks uses type of bem style (screenshot below) use provided class names , style using sass. but, how target class names styled-components? possible? since styled-components css™ you'd other style sheet, using class names react-datepicker provided. the difference you'll have wrap datepicker in 1 wrapper styled component applies of these classes: const wrapper = styled.div` &.react-datepicker { color: blue; } ` <wrapper> <datepicker /> </wrapper>

javascript - Angualr JS: Fire an event on editable-text change -

i have editable text, want fire event when values changing not after changed. e-ng-change fire when value changed. <span editable-text="user.displayname" onbeforesave="checkname($data)" e-ng-change="checkname" e-form="userdisplayname" edit-disabled="{{!user.displayname}}" e-maxlength="50" e-required ng-disabled="uiselectform.$waiting" onaftersave="updateuserprofile(true)">{{user.displayname}}</span> <a ng-click="userdisplayname.$show()" ng-hide="isvisitor || userdisplayname.$visible" > <span class="fa fa-pencil pencil-color"></span> </a>

Xslt get value of created xml element -

<xsl:when test="conditon = 'value1'"> <typeid>4</typeid> </xsl:when> <xsl:when test="conditon = 'value2'"> <typeid>4</typeid> </xsl:when> <xsl:when test="conditon = 'value3'"> <typeid>4</typeid> </xsl:when> .... .... i have above. want check condition on created xml tag (typeid). i.e, below condition in xslt file, <xsl:if test="$typeid = 4"> <price>100</price> </xsl:if> so, how can use above condition on created tag (above typeid created tag on want make condition) or other way achieve above? $typeid refers variable named typeid , , not element have created. what can do, define variable called typeid set value want, , use variable create element, , check in condition. <xsl:variable name="typeid"> <xsl:choose> <xsl:when test="conditon = 'value1'&qu

api - Google Directions not enough "steps" items in "legs" list -

i trying show direction between , b points, , optionally several waypoints between , b. managed response, no problem @ all. response little bit "inaccure" (or inexact). when search same location in google maps , in app, there big difference in amount of circles between locations. using google map directions api, travel mode is: walking. tried use google roads. tried pass waypoint coordinates roads api , build path using that, fails when place waypoints on roads travelling car not possible. see images below. can provide source, have no reputation provide more 2 links :( google maps screenshot my app screenshot private void drawdirections(directionresponse directionresponse) { if (directionresponse.getstatus().equals("ok")) { list<routesitem> routitems = directionresponse.getroutes(); (routesitem routesitem : routitems) { log.d(tag, "drawdirections: " + routesitem); list<legsitem> legs = routes

How to record call in android ? (old methods not working) -

asking questions quickly. mediarecorder = new mediarecorder(); mediarecorder.setaudiosource(mediarecorder.audiosource.mic); mediarecorder.setoutputformat(mediarecorder.outputformat.mpeg_4); mediarecorder.setaudioencoder(mediarecorder.audioencoder.aac); mediarecorder.setoutputfile((audiofile.getabsolutepath())); this code works on note5 not on s8+. cannot record other sides voice. i cant use audiosource.voice_call or audiosource.voice_downlink , audiosource.voice_uplink because of capture_audio_output permission problem. but acr app record conversations possible. note: not think format or encoder related topic full code: private void startrecord() { mediarecorder = new mediarecorder(); long tslong = system.currenttimemillis() / 1000; string ts = tslong.tostring(); file recorddirectory = new file(environment.getexternalstoragedirectory().tostring() + "/callrecord"); if (!recorddirectory.isdirectory()) { recorddire

javascript - Load events on FullCalendar upon datepicker selection not working -

i wanna click '+' button in dates in fullcalendar cell go jsp page add events have datepicker. whatever date set in jsp page , must show data in cell. in case title. if pick 4th feb 2017 in datepicker , fill other inputs in form such title, description , on..it should retrieve , display in specific cell of date. index.jsp: <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <%@page import="model.addevents,java.util.arraylist,java.util.listiterator" %> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> <script type="text/javascript" src= "https://code.jquery.com/jquery-3.2.1.min.js"> var checkin = jqu

performance - index is not being used in oracle query with collection in where condition -

i have event table name mytable , in table have mytableid column on have created index. table having 70 million rows. now, have created purge proc purges events based on table type collection mytablecollection . collection have 100 rows limit.so, whole can purge 100 rows @ time. when ran below query in proc got stuck 40 mins. delete mytable mytableid in (select mytableid table(mytablecollection)) when ran analyzer on query hard coded values, showed indexed range scan delete mytable mytableid in (10,20,30) is collection in query behind scenes playing role of not using index in query? thinking oracle might confused number of rows being fetched in collection. correct ? solution? p.s: thinking of implementing forall delete rows. when execute ... where mytableid in (10,20,30) ... optimizer clever enough know it's going hit 3 rows. if ... where mytableid in (select /*+ cardinality(mytablecollection 3) */mytableid tabl

php - Jquery DataTable serverside rendering and pagination error in front end -

i using php , query select * table , result want show in jquery datatable in server side processing means want use jquery datatable 's own ajax method. have total 58 rows. default should have 6 page. 10 rows per page. data coming , shown in table. wrong pagination. actually shows 58 rows in first page , showing 6 pagination buttons. if click on nothing working. searching , sorting not working. i not pasting sql code here pasting procedural code of php here. php code: require_once("logic/logsdatalogic.php"); $ldl = new logsdatalogic(); $data = $ldl->getdatabyfromdatetodate(); $arr = [ "draw" => $_post["draw"], "recordstotal" => count($data), "recordsfiltered" => count($data), "data" => $data ]; echo json_encode($arr); jquery code: $(document).ready(function(){ $('#logs_table').datatable( { "processing": t

javascript - Script to check for keyword on website -

i want write script goes trough list of url's checking wheter valid or not. the page not redirect 404 rather displays sentence 'sorry, not found! if url invalid. so if script finds sentence, url invalid. if not should valid. any idea on how realize in js? pointers possible methods in other languages welcome too! thanks! a simple python way be: import requests urls = ['https://www.google.com'] # fill url in urls: resp = requests.get(url) if 'sorry, not found!' in resp.text: print(url + ' had no page') # or

ios - NSFetchedResultsController Called When Not in View -

i have: viewcontroller_a viewcontroller_b viewcontroller_c where there's nsfetchedresultscontroller powering tableview in b. my problem can edit b's underlying data while in or c. when edit b's underlying data or c, runs b's delegate function: func controller(_ controller: nsfetchedresultscontroller<nsfetchrequestresult>, didchange anobject: any, @ indexpath: indexpath?, type: nsfetchedresultschangetype, newindexpath: indexpath?) { so appears observer still running, makes sense because never dismissed b. still, delegate function tries update b's tableview , causes crash every time. i'm new using nsfetchedresultscontroller , appreciate advice on how prevent observer behaving way.

javascript - Does startWith() operator turns Observable into ReplaySubject(1)? -

if want subscribers @ least x , can use startwith( x ) existing observable: streamfromlibrary.startwith( x ).subscribe( myhandler ); //i want myhandler() not wait until streamfromlibrary produce value //but called instantly x or still needs carried through intermediate replaysubject( 1 ) this? let carrier = new rx.replaysubject( 1 ); carrier.next( x ); streamfromlibrary.subscribe( value => carrier.next( value ) ); carrier.subscribe( myhandler ); or if not, there other more elegant way carry values existing streams subscription @ least 1 initial/last value? you don't need use replaysubject , should know these 2 aren't same: the startwith() operator emits preset value every observer when subscribe. the replaysubject(1) class re-emits 1 last item went through it. first value emits every observer might not same depending on pushed subject. note, there's behaviorsubject takes initial value parameter , overrides every emission works replaysubje

Excel: text conversion to date format -

Image
i convert text - apr 7 2017 date format on excel spread sheet. there formula might it? have tried format cell date format did not change cell properties. thank suggestions with data in a1 , in cell enter: =datevalue(lookup(left(a1,3),{"apr","aug","dec","feb","jan","jul","jun","mar","may","nov","oct","sep"},{4,8,12,2,1,7,6,3,5,11,10,9}) & mid(substitute(a1," ","/"),4,99)) an alternative: =datevalue(trim(mid(a1,5,2)) & "-" & left(a1,3) & "-" & right(a1,4))

android - XML file saved by svm opencv gives strange content -

i trained svm classifier using following code , gave me wrong classification , when looked @ saved xml file, found strange contents. 1 vector in xml file , classification -1 test data. found classifier same before , after classifier.train(...). here code: log.i(tag,"training..."); v_features.copyto(trainingdata); trainingdata.convertto(trainingdata, cvtype.cv_32f); traininglabels.copyto(classes); classes.convertto(classes, cvtype.cv_32s); classes.convertto(classes, cvtype.cv_32s); cvsvmparams params = new cvsvmparams(); //first method working fine params.set_svm_type(cvsvm.c_svc); params.set_kernel_type(cvsvm.linear); params.set_gamma(0.01); params.set_nu(0.5); params.set_c(1000); termcriteria criteria = new termcriteria(termcriteria.max_iter,100, 1e-6); params.set_term_crit(criteria); // initialize svm object avoid being null object classifier = new cvsvm(trainingdata, classes, new mat(), new mat(), params); classifier.save(xml1.tostring()); classifier.train(train

java - Problems while parsing enums using gson -

i have class this: @jsoninclude(include.non_null) @jsonnaming(propertynamingstrategy.snakecasestrategy.class) public class vpc { @notnull() private string id; @notnull() @dynamodbmarshalling(marshallerclass = subnettypemarshaller.class) private map<subnettype, list<string>> subnettypetoid; } here, subnettype enum this: public enum subnettype { appsubnet, dbsubnet, dmzsubnet; } now, want store above in aws dynamodb. this, need convert enum string , have written following. public class subnettypemarshaller implements dynamodbmarshaller<map<subnettype, list<string>>> { private gson gson = new gsonbuilder().create(); @override public string marshall(final map<subnettype, list<string>> securitygrouptypelistmap) { return gson.tojson(securitygrouptypelistmap); } @override public map<subnettype, list<string>> unmarshall(final class<map<subnettype

ruby on rails - Acts_as_follower display follows RoR -

i using ruby gem called acts_as_follower my code: user.rb class user < applicationrecord acts_as_followable acts_as_follower end users_controller.rb def follow @user = user.find(params[:id]) current_user.follow(@user) redirect_to root_path end def unfollow @user = user.find(params[:id]) current_user.stop_following(@user) redirect_to root_path end followers.html.erb <% @user.followers.each |user| %> <div class="panel panel-default col-md-offset-3 col-md-6"> <br> <div class="panel panel-heading"> <%= avatar_for(user, size: 50) %> <h1> <%=link_to user.name, user %></h1> </div> </div> routes.rb #followers resources :users member :follow :unfollow end end how display users follow? how display users follow? i believe method want all_following user.all_following returns array of every followed obje

performance - Java running faster after using JVisualVM -

we have simple java application receives commands on tcp socket (netty), translates these commands json strings , sends them 1 connected client on websocket connection (jetty). the application performs windows on different java versions. on centos machine java 1.8_121 (or 1.8_45) noticed delay of 200ms between receiving command , sending json string. so tried understand behaviour using jvisualvm. startet application, jvisualvm, selected application in jvisualvm , switched tab "profiler". clicked on "cpu" , got error "redefinition failed error 62". closed jvisualvm. the strange thing after using jvisualvm in way delay in application gone. reduce 200ms 1ms. does have idea why happens or why code faster after starting profiler? can run in faster mode?

Routes for users and admins separation Laravel -

i'm trying separate user admin , forbid access of user admin section. my directories structure is resources/ -views/ --site/ ---users/ ---admin/ in web.php i've added route::get ('/', ['uses' => 'homecontroller@index']); route::auth(); route::group(['middleware' => ['auth'], 'namespace' => 'users', 'prefix' => 'site/users'], function() { // users routes }); route::group(['middleware' => ['auth'], 'namespace' => 'admin', 'prefix' => 'site/admin'], function() { // admin routes route::get ('/admin', ['uses' => 'admincontroller@index', 'before' => 'admin']); }); when log admin , tried open http://example.com/admin i've got (1/1) notfoundhttpexception same happens users. i have column in database is_admin check , store in session during l

android - Switch State Change Does Not Work On The First Click -

if change switch state databasereference doesn't change previous value first time... if change same switch state 1 more time works perfectly. here code: public sigadapter(context context, string[] web, integer[] imageid) { super(context, r.layout.list, web); this.context = context; this.web = web; this.imageid = imageid; } @override public view getview(final int position, view view, viewgroup parent) { databasereference databasereference1 = database.getreference("data").child(web[position1].replace("/","")); databasereference=databasereference1.child("switch"); viewholder viewholder=new viewholder(); view listitemview = view; if (listitemview == null) { listitemview = layoutinflater.from(getcontext()).inflate(r.layout.list, parent, false); viewholder.txttitle = (textview) listitemview.findviewbyid(r.id.text_view); viewholder.imageview = (imageview) listitemview.findviewbyid

reactjs - TS2403 error at every typescript-react project -

error in [at-loader] ..\node_modules\@types\react\index.d.ts:3376:13 ts2403: subsequent variable declarations must have same type. variable >'a' must of type 'detailedhtmlprops, >htmlanchorelement>', here has type 'detailedhtmlprops, htmlanchorelement>'. i used microsofts typescript react starter , using month. if today couldn't. try adding typescript myself , same error again. can ?

ruby on rails - Ajax Datatables testing with rspec and capybara -

i'm trying create tests app, can't make tests pages datatables work. i'm loading records table ajax. if go browser works fine none of tests pass. heres code. index.html.slim table.table.table-striped.table-bordered.table-hover.table-checkable.order-column#dtable data-source="#{ admin_analysts_path(format: :json)}" thead tr th nome th email tbody analysts_controller def index add_breadcrumb "todos analistas" respond_to |format| format.html format.json { render json: analystsdatatable.new(view_context)} end end analysts_datatable.rb class analystsdatatable delegate :params, :h, :link_to, :number_to_currency, to: :@view def initialize(view) @view = view end def as_json(options = {}) { draw: params[:draw].to_i, recordstotal: analyst.count, recordsfiltered: analysts.total_entries, data: data } end private def data analysts.map |analyst| [ lin

google docs - R and RGoogleDocs - trouble with auth -

here's deal rgoogledocs: when run: auth = getgoogleauth("mymail@gmail.com", "my pass",service="wise") i have (i try different login/passw): error in strsplit(ans, "\\\n") : non-character argument i trying different ways no success. please help, what's wrong? , may there're other packages connect r , google sheets? ~~~~~~~~~~~~~~~~~~~~~~~~ 1 day later: i fix library(googlesheets), works fine

javascript - AngularJs: Testing performance -

is there approach test how time processing of every user's action gets in web application based on angularjs? i see how time every element on every page in ms gets. there out-of-box , ready-to-use solution this? thank in advance.

java - SIGSEGV with JNI call converting jlong to long -

i'm working jni call java application external c library given software editor access/write datas application. i sigsegv fatal error calls , can't found out why. here error log given jvm : # # fatal error has been detected java runtime environment: # # sigsegv (0xb) @ pc=0x00007f1b357729e0, pid=18693, tid=139752817592064 # # jre version: 6.0_45-b06 # java vm: java hotspot(tm) 64-bit server vm (20.45-b01 mixed mode linux-amd64 compressed oops) # problematic frame: # c 0x00007f1b357729e0 # # if submit bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # crash happened outside java virtual machine in native code. # see problematic frame report bug. # --------------- t h r e d --------------- current thread (0x00007f1b1001d000): javathread "http-bio-10.70.4.12-10767-exec-12" daemon [_thread_in_native, id=18888, stack(0x00007f1abcfc8000,0x00007f1abd0c9000)] siginfo:si_signo=sigsegv: si_errno=0, si_code=1 (segv_maperr), si_addr=0x0

c# - call a code when done playing in unity -

i got tcp server in java , class called client among unity scripts. client singleton connects server @ constructor . when press play button connects server when press again stop game client not disconnects automatically when run game again gets stack because tries connect computer connected. tried disconnect @ destructor never been called. how can it? tried implement idisposable not know if need call or garbage collector calls (for me not). client's code ( read write , loop not important question left in case wants it): using assets.scripts.tools; using system.collections; using system.collections.generic; using system.io; using system.net.sockets; using system.threading; using unityengine; using system; public class client : system.object, idisposable{ private tcpclient tcp; private stream stream; private iclientcallback callback; private thread recvthread; private static client instance = null; public static client instance {

jquery - How to select part of a specific css class name out of multiple classes -

given following html markup: <div id="my-id" class="my-class items-5"/> how can extract 5 class attribute, if 5 generated dynamically? split on ' ' , reference index of '-' on second index, seems long winded: var count = $("#my-div").attr("class").split(' ')[1].split('-')[1]; another solution fixed markup can't change, , assuming relevant class items-number split items- , , first word after it: var count = $("#my-id").attr("class").split('items-')[1].split(' ')[0]; console.log(count); var count2 = $("#my-id2").attr("class").split('items-')[1].split(' ')[0]; console.log(count2); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="my-id" class="my-class items-5"/> <div id="my-id2" class="

Create sparse cross table in R from lists -

i can't reproduce sample, here problem. i have large list object (1.1gb, ~ 3 million elements). looks not dissimilar this: > head(xx, n = 3) [[1]] [1] "start" [2] "a|b|c" [3] "c|c|b" [4] "lose" [[2]] [1] "start" [2] "b|null|null" [3] "lose" [[3]] [1] "start" [2] "c|null|null" [3] "win" what want count number of transitions between each step within nested list, i.e. how start goes c|null|null, how c|null|null goes win, across massive list. on small subsample, can use following (where placeholder offsets lists one):

angular - Angular2 - app.module routing: blank path not redirecting to component -

i've added login feature app. when navigates url blank path( http://example.com ), want homecomponent show activate authguard, keep url path blank. still testing locally, may issue? i'm not sure. whats happening - when navigate localhost:3000/ nothing, blank screen. when navigate localhost:3000/home, homecomponent show no issue homecomponent called when url localhost:3000/. here's app.module file - i'm not sure other files need post since issue lies routing. said, can of other components typing path. home, not want have type path. app.module.ts import { ngmodule } '@angular/core'; import { browsermodule } '@angular/platform-browser'; import { formsmodule, reactiveformsmodule } '@angular/forms'; import { httpmodule } '@angular/http'; import { routermodule, routes } '@angular/router'; import { appcomponent } './app.component'; import { homecomponent } './home/home.component'; i

node.js - Raspberrypi npm Package installation failure -

i have rpi 0 w, i'm trying install npm in rpi using following command sudo apt-get install npm unfortunately failed fetch package, couldn't understand error log(i believe server down, kindly correct me if i'm wrong), have solved installation error before, have attached log below: ~/desktop/alexa-avs-sample-app/samples/companionservice $ sudo apt-get install npm reading package lists... done building dependency tree reading state information... done following packages automatically installed , no longer required: coinor-libipopt1 libboost-filesystem1.55.0 libboost-program-options1.55.0 libboost-regex1.55.0 libffi5 libgmime-2.6-0 libmumps-seq-4.10.0 liboauth0 libraw10 wolframscript use 'apt-get autoremove' remove them. following packages installed: gyp libc-ares-dev libjs-node-uuid libv8-3.14-dev node-abbrev node-ansi node-ansi-color-table node-archy node-async node-block-stream node-combined-stream node-cookie-jar node-delayed-stream node-