Posts

Showing posts from March, 2015

html - Table cells resize when zooming in browser -

when displaying table in chrome, table changes cells size when zooming in. table displayed in wrong way in other browsers(ie, firefox). i've tried changing sizes percentage, didn't seem work. how should (works in chrome when zooming 90%): correct table here code in jsfiddle (how shouldn't like) <table id="form50_t_data" style="table-layout: fixed; width: 100%; height: 100%; max-height: 104.00; position: absolute; left: 1.00; top: 38.50; border-bottom: 0.10mm solid #00ffff; border-collapse: collapse; text-align: left;"> <tr> <td colspan="3" id="form50_t_title" style="border-bottom: 0.30mm solid #00ffff; background-color: #8080c0; min-height: 9.70; max-height: 9.70;"> <div style="height: 100%; width: 100%; overflow: hidden; line-height: 10.00mm; text-align: center;">chrono</div> </td> </tr> <tr class

javascript - Drop Down menu Validation with Alert -

if drop down menu left unanswered provide alert user. have code providing alert unanswered drop down menu. however, im trying add code existing javascript. the code creates form gathers information regarding users. form has 5 steps: user information (name, email, phone, age, gender) yes or no question (drop down menu) yes or no question (drop down menu) yes or no question (drop down menu) yes or no question (drop down menu) the code has embedded animation every time user presses next/previous button. how add drop down menu validation alert, existing javascript (for steps 2-5). please visit http://thecodeplayer.com/walkthrough/jquery-multi-step-form-with-progress-bar better understanding of animation looks like. var current_fs, next_fs, previous_fs; //fieldsets var left, opacity, scale; //fieldset properties animate var animating; //flag prevent quick multi-click glitches $(".next").click(function(){ //text inputs if(!document.getelementbyid(

Uber API: https://api.uber.com/v1.2/estimates/price …? takes ~ 1.5-2 sec which is too large .Is there a way to reduce the time? -

if 1 knows uber api best practises, please let me know. google driving , transit api takes less 100 milliseconds , uber api takes more 1 sec. thanks in advance. i not have specific recommendations reduce time. amount higher seeing hits /v1.2/estimates/price on last 7 days @ upper range requests endpoint. the uber api team continue working on optimizing , improving speed uber api. thanks. wiki

javascript - How to Query two tables together in MongoDB with both columns present? -

i met stumbling block while doing join statement mongo db. have 2 different tables show below user table ( _id , username ) message table ( user_id ) i trying fetch messages alongside username of user posted message. output { "msg":[ { "_id":"599a2ca773905b2787cb91c8", "user_id":"5997da7868f45f39206f703d", "topic_id":0,"message":"hello black_man", "datecreated":"2017-08-21t00:43:19.000z", "__v":0, "user_messages":[] }, ] } it not seems have values inside user_message believe should contact corresponding user details. please kindly this. thanks... wiki

python - adding datime.datetime and datetime.time -

i trying add datetime.datetime , datetime.time 1 column. trying combine: import datetime dt dt.datetime.combine(mydf['date'].astype(dt.date), mydf['time'].astype(dt.time)) but get: typeerror: combine() argument 1 must datetime.date, not series and trying this: mydf['date'] + mydf['time'] but get typeerror: unsupported operand type(s) +: 'datetime.datetime' , 'datetime.time' does know, how can combine 2 colums? date time 0 2011-08-08 00:00:00 08:10:00 1 2011-08-08 00:00:00 08:10:00 2 2011-08-08 00:00:00 08:10:00 3 2011-08-08 00:00:00 11:20:00 4 2011-08-08 00:00:00 12:25:00 5 2011-08-08 00:00:00 14:20:00 you trying combine whole columns , datetime.combine() doesn't know how applied separate columns. use dataframe.apply() method instead: def combine_cols(row): return dt.datetime.combine( row['date'].date(),

NGINX error: "Invalid port in upstream" when using proxy_pass with IPv6 -

i have been unable find explanation nginx error on nginx version: nginx/1.9.14. this nginx.conf attempts forward client request webserver port 442 port 9442. when using ipv4 client , server address works fine , webserver request forwarded 9442. when using ipv6 address client , server address following error occurs: 2017/08/21 19:05:56 [error] 6694#0: *5 invalid port in upstream "2000::157:9442/", client: 2000::158, server: , request: "get / http/1.1", host: "[2000::157]:442" nginx.conf: http { server { listen 442 ssl; # ipv4 support listen [::]:442 ssl; # ipv6 support ssl_certificate /etc/ssl/active.crt; ssl_certificate_key /etc/ssl/active.key; ssl on; ssl_session_cache builtin:1000 shared:ssl:10m; ssl_protocols tlsv1 tlsv1.1 tlsv1.2; ssl_prefer_server_ciphers on; location / { proxy_pass https://$server_addr:9442$request_uri;

python - Round the number to its nearest base 10 number -

i want nearest base 10 number (ex. 10, 100, 1000) called new_n of input n . example, 99 gets 100 (not 10 ), 551 gets 1000 (not 100 ). what try using np.log10 extract power of input number n , use power 10 import numpy np n = 0.09 new_n = 10**(int(round(np.log10(n)))) print new_n n = 35 new_n = 10**(int(round(np.log10(n)))) print new_n n = 999 new_n = 10**(int(round(np.log10(n)))) print new_n n = 4655 new_n = 10**(int(round(np.log10(n)))) print new_n > 0.1 > 100 > 1000 > 10000 the problem number such 35 np.log10(n) (which expect use power) 1.544068 , rounding 2 . result 100 instead of 10 . or result of 4655 10000 . how round number nearest base 10 number? add check in linear space (with possible correction) after obtaining exponent: n = np.array([0.09,35,549,551,999,4655]) e = np.log10(n).round() #array([-1., 2., 3., 3., 3., 4.]) so, number closer "rounded" answer or previous degree of 10? new_n = np.where(10**e - n &l

javascript - $.ajax will not work within a function -

i having trouble function using jquery's ajax. function checks api see if variable called "success" true. if is, want function return true. if success false, want return false. here code: function loggedin() { $.ajax({ type: "get", url: "/api/auth", success: function (a) { if (a.success == "true") { return true; } else { return false; } } }); } this code in document (myjs.js, etc), , called html file after jquery , before function called. have script tag in html function called. here is: <script type="text/javascript"> $(function() { if (loggedin() == true) { $('#send-to-user-btn').css('display', 'block'); $('#sign-in-button-btn').css('display', 'none'); $('#login-bar-my').css('display', 'none&#

javascript - How to add distance between to points in info window Using google maps -

var iconbase = 'content/images/'; var icons = { parking: { icon: iconbase + 'iconmonstr-car-21-24.png' }, library: { icon: iconbase + 'iconmonstr-fast-food-1-24.png' }, info: { icon: iconbase + 'iconmonstr-shopping-cart-3-24.png' }, hospital: { icon: iconbase + 'iconmonstr-building-38-24.png' } }; var markers = [{ title: 'aksa beach', lat: '19.1759668', lng: '72.79504659999998', description: 'aksa beach popular beach , vacation spot in aksa village @ malad, mumbai.', type: 'hospital', nearby: '' }, { title: 'juhu beach', lat: '19.0883595', lng: '72.82652380000002', description: 'juhu beach 1 of favourite tourist attractions situated in mumbai.', type: 'hospital', nearby: '' }, { title: 'girgaum beach', lat: &#

mysql - Error Code: 1054. Unknown column 'abcdef' in 'field list' in stored procedure -

i have written following stored procedure. working quite fine , giving correct results. after addition of attributes shows error. if change name of last retrieved attribute 4 letters word runs correctly. if run stored procedure shows error: "error code: 1054. unknown column 'fiel' in 'field list'" if run independent statements shows errors: "0 row(s) affected, 1 warning(s): 1260 row 69 cut group_concat()" "error code: 1054. unknown column 'fiel' in 'field list'" create definer=`root`@`localhost` procedure `getcases`() begin set @sql = concat('select ', (select group_concat(column_name) information_schema.columns table_schema = 'xyz_data_base' , table_name = 'table1' , column_name not in ('col_one', 'col_last')), ', table2.name xyz_data_base.table1, xyz_data_base.table2 table1.col_last = tabl

javascript - AngularJS - Run jQuery on route change - Not working -

i have jquery code need run when route changed in single-page angular app. the app.run function works, because i've added js alert run whenever route changes, , appears correctly, jquery i've tried run on route change doesn't work. js: app.run(function($rootscope) { $rootscope.$on('$routechangesuccess', function(event, current, previous) { console.log('$routechangesuccess: ', current); alert('route changed'); $('ul.tabs').tabs({ fullwidth: true }); $('select').material_select(); $('.select-wrapper span.caret').empty().removeclass('caret').addclass('fa').addclass('fa-angle-down'); $('.datepicker').pickadate({ selectmonths: true, selectyears: 15, today: 'today', clear: 'clear', close: 'cancel', closeonselect: true, }); $('.tabs-content').css('height',

c# - An exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll but was not handled in user code -

i have console application generates set of fake data/information on database testing. public list<lcs_exchangedatastaging> generatenewdata(int count) { var newdata = new list<lcs_exchangedatastaging>(); var random = new random(); var branches = new lcsbranchcontext().getallbranches(); var schemeids = new lcsschemeportfoliocontext().schemeportfolios(); var branchcount = branches.count - 1; var schemecount = schemeids.count - 1; parallel.for(1, count + 1, => { int gender = random.next(0, 1); var data = new lcs_exchangedatastaging { accountnumber = (3000000000 + random.next(999999999)).tostring(), accountstatement = random.next(), address = faker.address.streetaddress(), addressofkeycontact = faker.address.streetaddr

C++ "not declared in this scope" error, with include files -

in code include following (this excerpt, make reader understand problem): #include <iostream> #include <gsl/gsl_sf_gamma.h> #include <gsl/gsl_integration.h> #include "metry.h" #include "growth.h" #include <vector> using namespace std; struct integral_params{ double = 1.; double b = 1.; }; double f(double chizero, void* pp) { integral_params *ip=static_cast<integral_params*>(pp); params cp; bool cls = true; cosmo=new metry(cp); structure=new growth(cp,cls); } at beginning of metry.h have #ifndef metry_h #define metry_h #include <gsl/gsl_spline.h> #include "cosmology.h" class metry : public virtual cosmology which connected therefore cosmology.h , @ beginning of have #ifndef cosmology_h #define cosmology_h struct params { //bla bla } and class cosmology { //bla bla } instead in growth.h have #ifndef growth_h #define growth_h #include <gsl/gsl_spline.h>

python - Reading in specific data from a text file -

i trying read in specific data text file 10-10-1cnt_pot.pot_fmt . data needed a , b , c fft coefficients (25,300,300) in case. way can think of read these in, position in text file. not prone bugs if text file changes slightly. can suggest alternate method? please see example text file below (and buggy code): begin header real lattice(a) lattice parameters(a) cell angles 2.4675850 0.0000000 0.0000000 = 2.467585 alpha = 90.000000 0.0000000 30.0000000 0.0000000 b = 30.000000 beta = 90.000000 0.0000000 0.0000000 30.0000000 c = 30.000000 gamma = 90.000000 1 ! nspins 25 300 300 ! fine fft grid along <a,b,c> end header: data "<a b c> pot" in units of hartrees code: file = open("10-10-1cnt_pot.pot_fmt", 'r') lines = file.readlines() file.close() parts = lines[3].split() = parts[5] parts1 = lines[4].split() b = part

excel vba - Sort array in VBA -

i have 182.123 size array , want sort them specific attribute of class of array. class called cflujo , property want sort them by string called id_flujo. far i'm doing bubble sort takes long: sub sort_arreglo(arreglo variant) x = lbound(arreglo) ubound(arreglo) y = x ubound(arreglo) dim aux cflujo aux = new cflujo if ucase(arreglo(y).id_flujo) < ucase(arreglo(x).id_flujo) set aux = arreglo(y) set arreglo(y) = arreglo(x) set arreglo(x) = aux end if next y next x end sub so far i've researched selection sort know can't delete items array can't make 2 lists sort values 1 other. put data in collection have had trouble regarding quality of data unless alocate memory beforehand (like in array). there's couple of things can improve execution time: load properties in array sort pointers instead of objects use better algorithm quciksort with example: sub sort(arreglo variant) dim cache, vals(), ptrs() long, long re

SQL Server - WHERE Clauses for column dynamic -

i have following table, id idattribute valueattribute idpiece 1 9 '2048' 10 2 18 'ddr3' 10 3 9 '2048' 11 4 18 'ddr3' 12 when doing query: select * tb_inventary_report (idatribute = 9 , valueatribute = '2048') or (idatribute = 18 , valueatribute = 'ddr3') i returning records 1, 2, 3 , 4, want return 1 , 2 because have same idpiece, can not inform idpiece, ie, idpiece has iqual between ors pass how can return 1 , 2? using exists() aggregation query count(*) rows match conditions, having count(*) = number of conditions need match. select * tb_inventary_report t exists ( select 1 tb_inventary_report i.idpiece = t.idpiece , ( (idattribute = 9 , valueattribute = '2048') or (idattribute = 18 , valueattribute = 'ddr3') ) group i.idpiece having

java - Kotlin+Dagger2 @Named annotation in Module provider method usage -

i’m having problem using dagger 2 @named annotation in kotlin preventing me migrating dagger graph kotlin. problem occurs when need inject in dagger module method @named parameter. in case i’m not injecting through constructor or field. i’ve tried kotlin annotation use-sites targets , none of them seems work in method parameter. please, solution appreciated. below portion of java code once converted kotlin won't compile: @module public final class mymodule { (...) @provides @singleton loginstore provideloginstore(@named("main_dao_session") daosession maindaosession, @named("demo_dao_session") daosession demodaosession) { return new loginstoreimpl(maindaosession, demodaosession); } (...) } use-site targets not apply in case, since you're dealing function parameters. target needs specified constructors because lot of code generated in background each constructor parameters. just use annotation would: @provides @s

java - Waiting for a callback method to be called in Android -

i writing android application interacts sensor using bluetooth , obtains temperature values. doing calling connectgatt() asynchronous , calls callback once connection established. problem facing code has wait until connection gets established. this implementation of method being used in code below. public boolean connect(final string address) { log.v(log_tag,"in connect method"+thread.currentthread().getname()); if(btadapter == null || address == null) { log.v(log_tag,"unable bluetooth adapter or address not valid"); return false; } if(address != null && address.equals(btaddress) && btgatt != null) { log.v(log_tag,"trying connect bt gatt profile directly"); boolean result = btgatt.connect(); if(result) return true; return false; } btdevice = btadapter.getremotedevice(address); if(btdevice == null) { log.v(log_tag,"could n

android - Some questions about hybrid Daydream VR app -

1.our project hybrid app contains 2d traditional activities , cardboad vr mode, , want introduce daydream api publish app on daydream platform, seems app published on daydream published on google play vr, means 2d traditional activities should never been shown users have put on daydream view. right? if so, how know whether user actives app google play vr,or daydream platform? actually, our app of vertical screen except vr mode,which means, if users active google play vr platform, first shown 2d traditional activity,and seems not meet requirements of daydream app quality,but if users tap 2d icon open app,it ok,because users have not yet put on daydream view,and can choose vr mode finger. another question can publish app daydream , google play vr platform in state,a vertical screen app daydream vr mode button?if ok,how work out problem when user active app google play vr? you can set app when launched vr home user sent directly vr activity, , when launched 2d launcher

How to link to current page url and title with just php? -

i'm trying modify code non-javascript share buttons share current page url , title (which unfortunately code-writer didn't include how http://sharingbuttons.io/ ) <!-- sharingbutton facebook --> <a class="resp-sharing-button__link" href="https://facebook.com/sharer/sharer.php?u=" target="_blank" aria-label=""> <div class="resp-sharing-button resp-sharing-button--facebook resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid"> <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24"><path d="m18.77 7.46h14.5v-1.9c0-.9.6-1.1 1-1.1h3v.5h-4.33c10.24.5 9.5 3.44 9.5 5.32v2.15h-3v4h3v12h5v-12h3.85l.42-4z"/></svg> </div> </div> </a> there several of these buttons, obviously, i'll use facebook example. i've tried using options suggeste

java - By using a loop construct, how to generate following output? -

Image
how coding output? far did this....(new it)... for (int i=0; i<7; i++) { (int j=7; j>i; j--) { system.out.print(i); } system.out.println(""); } } } wiki

java - Issue weblogic debug mode in eclipse -

i able deploy application in binary format i.e, ear file in weblogic , when trying depoy same application in debug mode in exploded forma, getting below error !entry org.eclipse.wst.xml.core 4 4 2017-08-23 11:10:29.980 !message istructureddocumentregion management failed. !stack 0 org.eclipse.wst.xml.core.internal.document.structureddocumentregionmanagementexception: istructureddocumentregion management failed. @ org.eclipse.wst.xml.core.internal.document.xmlmodelparser.removestructureddocumentregion(xmlmodelparser.java:2200) @ org.eclipse.wst.xml.core.internal.document.xmlmodelparser.replacestructureddocumentregions(xmlmodelparser.java:2339) @ org.eclipse.wst.xml.core.internal.document.dommodelimpl.nodesreplaced(dommodelimpl.java:737) @ org.eclipse.wst.sse.core.internal.text.basicstructureddocument._fireevent(basicstructureddocument.java:600) @ org.eclipse.wst.sse.core.internal.text.basicstructureddocument.firestructureddocumentevent(basicstructureddocument.j

SOLR indexing performance with large amount of data -

i have indexed of 10 millions documents, per new requirement need add field in solr schema. question ideal approach? mean add field in schema , re-index whole data? or partial index? or else?. the data has submitted regardless of do, answer depend on size of rest of fields. if small, add field , reindex everything. if there's large field present, might more effective letting solr fetch content internally (i.e. partial update) instead of submitting on network, require have fields defined stored or doc values. it's impossible exactly, you'll have perform small test small number of documents see how performance dataset. wiki

javascript - controller's function won't work in angular js -

the button code is <div class="btn-group" align="center"> <button ng-click="myfunction()" id="one" class='btn btn-primary btn1' >save entry</button> <button ng-click="close_window()" id="two" class='btn btn-primary btn2'>exit</button> </div> the new controller is var app=angular.module('userapp',[]) app.ng-controller('usercontroller', function($scope)){ $scope.myfunction = function(){ var change= document.getelementbyid("one") if (change.innerhtml == "save entry") { change.innerhtml = "saved!"; } else { change.innerhtml = "save entry"; } return } $scope.close_window = function() { if (confirm("close window?")) {

Disable 'Suggested Names' with latest Visual Studio 2017 Update? -

i've updated newest visual studio 2017 update (enterprise) through 'extensions , updates' window. i've noticed have added 'suggested names' intellisense when using snippets (i.e propfull ), seems overwrite value have typed when pressing 'tab' (the normal way cycle through items). this super annoying, know how disable it? wiki

typescript - Updating textview at a interval using Angular $interval -

i still new ionic , angular. want update textview number going 10 0 , update each second. in class got property public timeleft: string = 'your timer'; bound html <div>{{timeleft}}</div> i have tried using regular javascript setinterval() fails when i'm trying update property timeleft using keyword this because this not in same scope class when running setinterval function. i've read should use angular function $interval because has access same scope or view, didn't quite understand part fully. i found pieces of code saying should make controller , should contain along lines of myapp.controller(function($scope, $interval) {...}) on ionic blog found post mentioning angular 1 concepts controllers , scope out. so question is. how use angular $interval update textview @ interval in ionic? full code example fantastic i'm literally lost here. cli-utils: 1.9.2 ionic cli: 3.9.2 cordova cli: 6.5.0 ionic app-scripts: 2.

Execution of Sequence a chain of async web requests with Retrofit and LiveData in android -

so have 3 retrofit web requests call mainactivity , each call won't depend on each other. so let's first 1 getimages() , second getcountry() , , final 1 getuser() but have condition next activity shouldn't load until these request executed successfully. so have 2 options here 1) create nested request , execute each request onsuccess on each response . seems reliable hence these async call need optimize time. 2) create variable , increment on each success call , approach seems time saving i'm not sure practice. so there way can done . .and i'm not using rxandroid wiki

python - How to convert from a NumPy data type to a custom data type? -

i have defined new numeric data type in python using python's data model . convert existing numpy arrays existing data types custom data type. understand numpy's astype method converts 1 data type another, based on understanding, can convert between built-in data types. in contrast answer provided here , data type not based on built-in data types , has it's own addition, multiplication, bit-wise operations, etc., cannot use np.dtype define data type. in other words, following solution not work: kerneldt = np.dtype([('myintname', np.int32), ('myfloats', np.float64, 9)]) arr = np.empty(dims, dtype=kerneldt) is there way convert between built-in data type , custom data type , vice versa? this isn't possible. there plans allow custom dtypes in numpy in future. wiki

c# - How to set a DataContext of multiple Views to one instance of ViewModel -

i'm using viewmodellocator views, configured in bootstrapper following method: protected override void configureviewmodellocator() { base.configureviewmodellocator(); viewmodellocationprovider.register<viewa, viewabviewmodel>(); viewmodellocationprovider.register<viewb, viewabviewmodel>(); } it works fine, makes 2 separate instances of viewmodel 2 views. want both views use same instance of viewmodel. checking source code shows problem of creating new instance every view default: static func<type, object> _defaultviewmodelfactory = type => activator.createinstance(type); prism allows define method types or special types. second case should preferred. viewmodellocationprovider.register<viewa, viewabviewmodel>(); only links types of view , viewmodel together, no factory defined. means new instance created each view. use instance @ multiple views need define factory method. create 1 instance of viewmodel viewabviewmo

web services - REST- SOAP - oData - Web API explanation -

i've been developer since 1 year ago working c#, javascript , microsoft dynamics crm. however, there's topic that, honest, not undertand @ all, web services. i know used "connect" 2 systems , transfer information using xml. thing not understand differences between soap, rest, odata , other terminoligies related this. so, wondering... there easy explanation this? rest based on http it's web services. odata standardized rest protocol don't need invent own api. soap not use http used integration within businesses network. wiki

docker - How to package vagrant/Virtual box VM for loading to another system -

i have vagrant vm, , want create image can take machine , start vm settings before. i tried doing export appliance , import appliance virtual box, , able start vm, don't vagrant cannot ssh vagrant ssh , , inside vm run web server in docker , cannot connect it. docker container start up, can't connect to. what proper way create image of vagrant/virtualbox/docker environment entire system , can move it? vagrant , virtualbox installation needed if want use vagrant ssh . both separate softwares. vagrant used automation of vm creation using online available images. this make easier ship source code , provisioning scripts. when 1 vagrant up downloads base box online , provisioning scripts necessary setup. save sharing large boxes of 400mb+ when export vm , import someplace else, don't need vagrant ssh such. settings of box have port forwarding set. assuming 22 guest mapped 2222 on host can ssh directly using this ssh -p 2222 vagrant@127.0.0.1 or if h

Singleton method and class method Java -

i'm wondering different between static method , singleton class method when use them multiple thread. think if use static method, conflict result data or parameter don't think use singleton method class same problem occur. when create static method can used without creating instance of class, not true when you're creating class-method. synchronization orthogonal issue: you'll have use kind of synchronization mechanism regardless of 1 of 2 options chose use. wiki

go - Deepcopying struct having pointer-to 0 value in golang -

i have struct in golang below type test struct { prop *int } i want take deepcopy of struct object when prop pointer-to 0 value. real struct has lot more fields in , want deepcopy of entire struct obj. tried use gob encode-decode way converts pointer-to 0 nil pointer due consequence of design mentioned here . tried use reflect.copy panics error panic: reflect: call of reflect.copy on struct value . there better way deepcopy such struct objects? edit: tried use json encoding/decoding , kind of worked. don't know drawbacks. func deepcopy(a, b interface{}) { byt, _ := json.marshal(a) json.unmarshal(byt, b) } any comments on solution? https://play.golang.org/p/fvkw62bydm i used https://github.com/mohae/deepcopy/blob/master/deepcopy.go example. reflect.copy works slices or arrays. can see, using reflection right way, more complex calling reflect.copy. there few other packages, implement deep copy, don't have experience of packages. https

angular - ngAfterViewInit dosn't work -

//notes module //////////// const notesroutes: routes = [ { path: 'notes', component: notescomponent, children: [{ path: 'detail', component: notesdetailcomponent }, { path: '', redirectto: 'page1', pathmatch: 'full' }] } ]; ////////////// import { component, oninit, viewchild} '@angular/core'; ... export class notescomponent{ ngafterviewinit() { console.log('notes.location ', window.location); } } /////////////// import { component, oninit, viewchild} '@angular/core'; ... export class notesdetailcomponent{ ngafterviewinit() { console.log('detail.location ', window.location); } } ///////////// //notesdetail html: <a routerlink="/notes" routerlinkactive="active">notes</a> //notes html: <a routerlink="/detail" routerlinkactive="active">detail</a

Spark's dataframe count() function taking very long -

in code, have sequence of dataframes want filter out dataframe's empty. i'm doing like: seq(df1, df2).map(df => df.count() > 0) however, taking extremely long , consuming around 7 minutes approximately 2 dataframe's of 100k rows each. my question: why spark's implementation of count() slow. there work-around? count lazy operation. not matter how big dataframe. if have many costly operations on data dataframe, once count called spark operations these dataframe. some of costly operations may operations needs shuffling of data. groupby, reduce etc. so guess have complex processing these dataframes or initial data used dataframe huge. wiki

php - Caddy Server, http.fastcgi 502 Error -

my caddy file http://bot.vibs.tech { root /home/caddy/www/botsite tls off errors { 404 /home/caddy/www/botsite/404.html } fastcgi / 127.0.0.1:9001 php { ext .php split .php index index.php } } the webpage http://bot.vibs.tech/test.php home page http://bot.vibs.tech my php script <?php if($_post["submit"]) { $test=$_post["botsname"]; $redis->set(';message';, $test;); $value = $redis->get('message'); <p>$value</p> } if (empty($url)) { echo "<h2><div style=\"color: black;\">thank you, bot being made!</div></h2>"; echo "<h2><div style=\color: black;\"><a href=http://bot.vibs.tech/>home</a></div></h2>"; } tried lots of different things, not sure else try do. also im trying implement redis can have database form im working on. additional info tried /etc/init.d/php7.0-fpm status ● p

Laravel 5.4 - choose route based on role -

i have following code: route::group(['middleware' => ['auth']], function () { dd($user); route::get('/', 'sitecontroller@index'); }); the $user created in appserviceprovider , not accessible in route : public function boot() { view()->composer('layouts.main', function($view){ $employees = \app\bamboo::getemployees(); $employeeindex = \app\bamboo::getemployeeindex(auth()->user()->email, $employees); $view->with('employees', $employees); $view->with('user', $employees['employees'][$employeeindex]); }); } is there why me choose function called in sitecontroller based on role (this contained in $user)? i want this: $method = $user->role === 'dev' ? 'index' : 'admin'; route::get('/', "sitecontroller@{$method}"); is possible? you try if

amazon s3 - Is it possible for traefik to append index.html to empty ('/') paths? -

how can conditionally append "index.html" request url ends in slash? as background: deploy multiple static, single page apps multiple domain names single s3 bucket web hosting enabled. bucket available as: https://our-bucket-name.s3.amazonaws.com the bucket organized object key prefix that: https://our-bucket-name.s3.amazonaws.com/environment/app_name/build_id/index.html https://our-bucket-name.s3.amazonaws.com/environment/app_name/build_id/app.css https://our-bucket-name.s3.amazonaws.com/environment/app_name/build_id/app.js if there request for: https://www.example.com/ should routed to: https://our-bucket-name.s3.amazonaws.com/environment/app-name/build_id/index.html if there request for: https://www.example.com/app.css should routed to: https://our-bucket-name.s3.amazonaws.com/environment/app-name/build_id/app.css not sure if relevant, traefik here kubernetes ingress want backed aws s3. you use addprefix or repla

c# - Swagger UI not working with OData Controller V3 & WebApi 2 -

swashbuckle.odata seems have integration issues odata v3 controllers.i can see end points on swagger ui, ui cant fetch data due incorrect route prefix 'api' taken framework. end points working when testing using postman. the other approach tried use explicit routeprefix on odatacontroller, helped swagger ui show routeprefix 'odata', causes api break , not able query or fetch data postman well. this frustrating, guidance on helpful. i have uploaded sample solution in following git repo .. ## https://github.com/ss27051980/swagger-odata.git## wiki

windows - Method not found: 'System.Threading.Tasks.Task System.Threading.Tasks.Task.Run(System.Action)' -

i have uninstalled .net 4.5 , installed 4.0. now, powershell not working. opening , closing itself. below error getting. suggestions please :- method not found: 'system.threading.tasks.task system.threading.tasks.task.run(system.action)' thanks in advance !! wiki

c# - Why can't I override the default BasedOn Style? WPF -

i have default label style <style x:key="labelstyle" targettype="{x:type label}"> <setter property="fontfamily" value="segoe ui" /> <setter property="fontsize" value="13.333" /> <setter property="foreground" value="{staticresource foregroundbrush}" /> <setter property="istabstop" value="false" /> <setter property="horizontalcontentalignment" value="left" /> </style> <style basedon="{staticresource labelstyle}" targettype="{x:type label}" /> i try use different style single label <style x:key="headerlabelstyle" targettype="{x:type label}"> <setter property="fontfamily" value="segoe ui" /> <setter property="fontsize" value="16" /> <setter property="foreground" value="{staticresource

android - AdColony with AdMob Mediation. JNI_OnLoad -

in android game, want use adcolony admob mediation. so, did tutorial: https://developers.google.com/admob/android/mediation/adcolony modified build.gradle, added activities, etc. adcolony ads doesn't work. here see in logcat: 09-06 11:20:05.889 14382-14382/com.ogurecapps.box2 i/adcolony [info]: configuring adcolony 09-06 11:20:11.479 14382-14382/com.ogurecapps.box2 e/adcolony: jni_onload i tryed google error, found nothing. need help! game built on libgdx engine, matter. wiki

html - Paragraph is not showing -

i following jon duckett's beginner's book. reason, paragraph has "upload song in mp3 format" not showing when website loaded. other paragraphs work intended. please help. blockquote <!doctype html> <html> <body> <form action="http://www.example.com/login.php"> <p> username:<input type="text" name="username" maxlenth="30" /> </p> <p> password:<input type="password" name="password" maxlength="30" /> </p> <p> did think of gig?<textarea mame="comments" cols="20" rows="4">enter comments...</textarea> </p> <p> please select favorite genre: <br /> <input type="checkbox" name="genre" value="rock" checked="chec

Can i transform string in template expression or lambda expression in kotlin? -

can transform string in template expression or lambda expression in kotlin? val tm = "x = $"+"x" val fn: (x: string) -> string = { -> tm} val str = fn("this x!!!") need get x = x!!! why?: can receive templates, example, database ps: or suggestions kotlin templates evaluated @ compile time - won't work. you should use 3rd party template engine. freemarker such engine format similar kotlin's own templating format: val tm = "x = \${x}" fun fn (x: string) : string { val t = template("name", stringreader(tm), configuration(configuration.version_2_3_26)) val out = stringwriter() t.process(mapof("x" x) ,out) return out.tostring() } println (fn("this x!!!")) // x = x!!! two notes: you won't able use "$x" on freemarker, "${x}" $ sign can escaped in kotlin string using \$ wiki