Posts

Spark-Scala quote issue -

i have input data in iso-8859-1 format. cedilla delimited file. data has double quote in it. converting file utf8 format. when doing so, spark inserting escape character , more quotes. can make sure quotes , escape character not added output? sample input xyzÇvib bros crane , big "tonyÇ1961-02-23Ç00:00:00 sample output xyzÇ"vib bros crane , big \"tony"Ç1961-02-23Ç00:00:00 code var inputformatdataframe = sparksession.sqlcontext.read .format("com.databricks.spark.csv") .option("delimiter", delimiter) .option("charset", input_format) .option("header", "false") .option("treatemptyvaluesasnulls","true") .option("nullvalue"," ") .option("quote","") .option("quotemode","none") //.option(...

Kubernetes HA leader control plane services restarting -

while following kubernetes-the-hard-way , porting local ubuntu 16.04 vms, bringing ha control plane giving me problems. kube-apiserver , kube-controller-manager services elected leader keep failing , restarting control planes on other 2 non-leader masters come fine. behavior follows leader around cluster. etcd looks happy: member 7f44a7567a5e995 healthy: got healthy result https://10.1.15.117:2379 member 43d2258c438cbf4e healthy: got healthy result https://10.1.15.116:2379 member a83b22e9f907f471 healthy: got healthy result https://10.1.15.115:2379 cluster healthy i've verified current leader by: kubectl endpoints kube-controller-manager --namespace=kube-system -o yaml apiversion: v1 kind: endpoints metadata: annotations: control-plane.alpha.kubernetes.io/leader: '{"holderidentity":"df-dev-kube-test02","leasedurationseconds":15,"acquiretime":"2017-09-13t17:15:06z","renewtime":"2017-09-13t18:10...

How do I access the name of the variable assigned to the result of a function within the function in R? -

for example, suppose able define function returned name of assignment variable concatenated first argument: a <- add_str("b") # "ab" the function in example above this: add_str <- function(x) { arg0 <- as.list(match.call())[[1]] return(paste0(arg0, x)) } but arg0 line of function replaced line name of variable being assigned ("a") rather name of function. i've tried messing around match.call , sys.call, can't work. idea here assignment operator being called on variable , function result, should parent call of function call.

uilabel - Send Labels forward and back in Swift... do I have to? -

i uilabel continually update behind interface elements on same screen. can see label starts below other elements using debug view hierarchy tool in swift's xcode tool. update text in label, jumps top , writes on other labels , interface elements. first image 3d debugger image first question... can't find tool setting front layers in interface builder... if can point out me that'd great, google has not been friend. since it's going end on top when update label, figure can send label whenever refresh it... in viewcontroller.swift file, in function update label's text, i've tried: (my label's outlet hook called "consoleme" super.sendsubview(toback:consoleme) nope... that's backwards maybe? tried: consoleme.sendsubview(toback: super) ...as "self" instead of super. doesn't super @ all. complains self viewcontroller , not uiview. finally, i'm wondering if have @ all-- surely there's way specify uilabel s...

ngrx - TypeScript compiler incorrectly reports that action.payload does not exist -

i'm using ngrx 4.03 , typescript 2.5.2. i have defined action such: import { action } '@ngrx/store'; import { iuser } '../models'; export const login_success = '[auth] login success'; export const logout_success = '[auth] logout success'; export class loginsuccess implements action { readonly type = login_success; constructor ( public payload: iuser ) {} } export class logoutsuccess implements action { readonly type = logout_success; } export type authactions = loginsuccess | logoutsuccess; in corresponding reducer, typescript telling me action.payload not exist on action , though can log value fine. doing wrong? i'm sure if have 1 action (or more) without payload, introduce behavior. so change code: export class logoutsuccess implements action { readonly type = logout_success; } to export class logoutsuccess implements action { readonly type = logout_success; constructor(public payload: nul...

python - Message: Element is not visible - Selenium error happens randomly -

i'm working on side project monitor flight prices i'm getting error message: element not visible only . weird thing error not thrown every time , cannot manage figure out causes it. tried adding implicit wait incase page hasn't loaded didn't help. page loads google flights , error happens when tries send text destination city. import time selenium import webdriver selenium.webdriver.common.keys import keys selenium.webdriver.common.by import selenium.webdriver.support.ui import webdriverwait selenium.webdriver.support import expected_conditions ec class bot: def __init__(self): self.browser = webdriver.firefox(executable_path='./geckodriver') # self.browser = webdriver.chrome('./chromedriver') self.departure_city = "cou" self.destination_city = "hnd" self.departure_day = "december 1" self.return_day = "december 10" self.prices = [] self.ru...

coq tactic - Simplifying Subformulas in Coq -

i'm trying solve equation of form a * b * c * d * e = f where * complicated left associative operation. at moment, opaque (including * , a through f ), , can made transparent via autounfold m_db . the problem if globally unfold definition in formula, simplification take forever. instead, want first unfold a * b , apply tactics reduce normal form x , , same x * c , forth. any idea how accomplish this? here's current approach in a or at a doesn't work. also, it's not clear me whether right structure, or reduce_m ought return something. ltac reduce_m m := match m | ?a × ?b => reduce_m a; reduce_m b; simpl; autorewrite c_db | ?a => autounfold m_db (* in *); simpl; autorewrite c_db end. ltac simpl_m := match goal | [|- ?m = _ ] => reduce_m m end. a minimalish example: require import arith. definition add_f (f g : nat -> nat) := fun x => f...