Arcanist: Arc Land Exception - phabricator

I'm trying to arc land with arcanist but I'm getting the following exception:
[2021-07-23 08:44:49] EXCEPTION: (ConduitClientException) ERR-CONDUIT-CALL: <harbormaster.buildable.search> Conduit API method "harbormaster.buildable.search" does not exist. at [<arcanist>/src/conduit/ConduitFuture.php:70]
arcanist(head=master, ref.master=76a2976fd9a4)
#0 ConduitFuture::didReceiveResult(array) called at [<arcanist>/src/future/FutureProxy.php:40]
#1 Future::updateFuture() called at [<arcanist>/src/future/FutureProxy.php:35]
#2 FutureProxy::isReady() called at [<arcanist>/src/conduit/ConduitSearchFuture.php:62]
#3 ConduitSearchFuture::isReady() called at [<arcanist>/src/future/Future.php:63]
#4 Future::updateFuture() called at [<arcanist>/src/future/FutureIterator.php:224]
#5 FutureIterator::next() called at [<arcanist>/src/hardpoint/ArcanistHardpointEngine.php:215]
#6 ArcanistHardpointEngine::updateFutures() called at [<arcanist>/src/hardpoint/ArcanistHardpointEngine.php:176]
#7 ArcanistHardpointEngine::waitForRequests(array) called at [<arcanist>/src/runtime/ArcanistRuntime.php:858]
#8 ArcanistRuntime::loadHardpoints(array, ArcanistHardpointRequestList) called at [<arcanist>/src/workflow/ArcanistWorkflow.php:2327]
#9 ArcanistWorkflow::loadHardpoints(array, array) called at [<arcanist>/src/land/engine/ArcanistLandEngine.php:542]
#10 ArcanistLandEngine::confirmBuilds(array) called at [<arcanist>/src/land/engine/ArcanistLandEngine.php:524]
#11 ArcanistLandEngine::confirmRevisions(array) called at [<arcanist>/src/land/engine/ArcanistLandEngine.php:1220]
#12 ArcanistLandEngine::execute() called at [<arcanist>/src/workflow/ArcanistLandWorkflow.php:344]
#13 ArcanistLandWorkflow::runWorkflow(PhutilArgumentParser) called at [<arcanist>/src/workflow/ArcanistWorkflow.php:227]
#14 ArcanistWorkflow::executeWorkflow(PhutilArgumentParser) called at [<arcanist>/src/toolset/ArcanistPhutilWorkflow.php:21]
#15 ArcanistPhutilWorkflow::execute(PhutilArgumentParser) called at [<arcanist>/src/parser/argument/PhutilArgumentParser.php:492]
#16 PhutilArgumentParser::parseWorkflowsFull(array) called at [<arcanist>/src/runtime/ArcanistRuntime.php:171]
#17 ArcanistRuntime::executeCore(array) called at [<arcanist>/src/runtime/ArcanistRuntime.php:37]
#18 ArcanistRuntime::execute(array) called at [<arcanist>/support/init/init-arcanist.php:6]
#19 require_once(string) called at [<arcanist>/bin/arc:10]
Anyone knows how to solve this?

Related

How do I return the name of an argument in my function as a column value?

I'm generating a reference table from a numerical vector and a vector of start dates. I want one of the columns in my reference table to equal the name of my first argument (it should read "Ekonom" for each row). This is important since I will join several tables together and since I need to tell my observations apart.
My input:
Ekonom<-c(15,15,15,15,7.5,7.5,15,7.5,7.5,15,15,15,30,0)
sdEkonom<-structure(c(15586, 15950, 16314, 16678, 17042, 17406, 17777,
18141), class = "Date")
My program is as follows:
reference_table<-function(x,y){
summer_break<-ifelse(cumsum(x)<=60, 0, ifelse(cumsum(x)>60 & cumsum(x)<=120 , 1,2))
program<-cbind(x,summer_break)
program<-as.data.frame(program)
program<-program%>%rename(points=x)
program<-program%>%mutate(program=as.character(rlang::enexpr(x)))
program<-program%>%mutate(weeks_course=points/1.5)
program<-program%>%mutate(points_expected=lag(cumsum(points)))
program<-program%>%mutate(points_expected=ifelse(is.na(points_expected),0,points_expected))
program<-program%>%mutate(order=1:n())
program<-crossing(y, program)
program<-program%>%arrange(y, order)
program<-program%>%mutate(starttermin=ifelse(order==1,1,0))
program$kull<-cumsum(program$starttermin)
program<-program%>%mutate(start_date=y-1)
program<-program%>%group_by(kull)%>%mutate(start_date_points=start_date+lag(cumsum(weeks_course)*7+3*7+summer_break*12*7))
program<-program%>%group_by(kull)%>%mutate(end_date_points=start_date+cumsum(weeks_course)*7+3*7+summer_break*12*7-1)
program<-program%>%mutate(start_date_points=if_else(is.na(start_date_points),start_date,as.Date(start_date_points)))
program<-program%>%group_by(start_date)%>%mutate(finished_date=max(start_date_points))
program<-program%>%mutate(finished=ifelse(lead(kull, default=0)==kull,0,1))
}
What's particularly importamt is this row:
program<-program%>%mutate(program=as.character(rlang::enexpr(x)))
I execute the program by writing:
ekon_program<-reference_table(Ekonom, sdEkonom)
For some reason the function has not evaluated x as "Ekonom" but as "15" in my program column. Why is this happening and how do I get the correct output?
Define the variable earlier and use it later in the function
library(dplyr)
reference_table<-function(x,y){
col_values <- as.character(rlang::enexpr(x))
summer_break<- ifelse(cumsum(x)<=60, 0,
ifelse(cumsum(x) > 60 & cumsum(x)<=120 , 1,2))
program<- data.frame(x,summer_break)
program %>%
rename(points=x) %>%
mutate(program = col_values)
}
reference_table(Ekonom, sdEkonom)
# points summer_break program
#1 15.0 0 Ekonom
#2 15.0 0 Ekonom
#3 15.0 0 Ekonom
#4 15.0 0 Ekonom
#5 7.5 1 Ekonom
#6 7.5 1 Ekonom
#7 15.0 1 Ekonom
#8 7.5 1 Ekonom
#9 7.5 1 Ekonom
#10 15.0 1 Ekonom
#11 15.0 2 Ekonom
#12 15.0 2 Ekonom
#13 30.0 2 Ekonom
#14 0.0 2 Ekonom
In this case, you can also use
col_values <- deparse(substitute(x))

Fatal error: Uncaught Error: Class 'WP_Widget_Custom_HTML' not found

Sorry if I don't write it right(it is my 1st post here).
I was editing a site adding pages and posts and after I refresh I see this:
Fatal error: Uncaught Error: Class 'WP_Widget_Custom_HTML' not found
in
/home/u430904391/public_html/wp-includes/class-wp-widget-factory.php:106
Stack trace: #0
/home/u430904391/public_html/wp-includes/widgets.php(113):
WP_Widget_Factory->register('WP_Widget_Custo...') #1
/home/u430904391/public_html/wp-includes/widgets.php(1477):
register_widget('WP_Widget_Custo...') #2
/home/u430904391/public_html/wp-includes/class-wp-hook.php(298):
wp_widgets_init('') #3
/home/u430904391/public_html/wp-includes/class-wp-hook.php(323):
WP_Hook->apply_filters(NULL, Array) #4
/home/u430904391/public_html/wp-includes/plugin.php(453):
WP_Hook->do_action(Array) #5
/home/u430904391/public_html/wp-settings.php(448): do_action('init')
6 /home/u430904391/public_html/wp-config.php(92): require_once('/home/u43090439...') #7
/home/u430904391/public_html/wp-load.php(37):
require_once('/home/u43090439...') #8
/home/u430904391/public_html/wp-blog-header.php(13):
require_once('/home/u43090439...') #9
/home/u430904391/public_html/index.php(17): require in
/home/u430904391/public_html/wp-includes/class-wp-widget-factory.php
on line 106

Ignoring specific characters in read table of list

I have the following list:
> str1<-'cor [1] 0.8832846 0.8880517 0.8881286 0.8845148 0.8832846 0.8880517 0.8818238 0.8767492 0.8876672 0.8822851 0.8854375 0.8850531 0.8835153
[14] 0.8832846 0.8908965 0.8803629'
I use the following command:
> df1 <- read.table(text=scan(text=str1, what='', quiet=TRUE), header=TRUE)
However, [1] and [14] are included in df1. What can I change in df1 in order to ignore all [x] (where x is a number?
We can remove the square brackets including the numbers inside with gsub, scan and then read.table as in the OP's post.
read.table(text=scan(text=gsub('\\[\\d+\\]', '', str1),
what='', quiet=TRUE), header=TRUE)
# cor
#1 0.8832846
#2 0.8880517
#3 0.8881286
#4 0.8845148
#5 0.8832846
#6 0.8880517
#7 0.8818238
#8 0.8767492
#9 0.8876672
#10 0.8822851
#11 0.8854375
#12 0.8850531
#13 0.8835153
#14 0.8832846
#15 0.8908965
#16 0.8803629
Or without using scan as #Richard Scriven mentioned
read.table(text=gsub('\\s+(\\[\\d+\\]\\s+)?', '\n', str1), header=TRUE)

Load all R data files from specific folder

I've got a lot of Rdata files which I want to combine in one dataframe.
My files, as an example, are:
file1.RData
file2.RData
file3.RData
All the datafiles have the structure: datafile$a and datafile$b. From all of the files above I would like to load take the variable $aand add this to and already existing dataframe called md. My problem isn't loading the files into the global environment, but processing the data in the RData file.
My code so far, which obviously doesn't work.
library(dplyr)
files <- list.files("correct directory", pattern="*.RData")
This returns the correct list of files.
I also know I need to lapply over a function.
lapply(files, myFun)
My problem is in the function. What I've got at the moment:
myFun <- function(files) {
load(files)
df <- data.frame(datafile$a)
md <- bind_rows(md, df)
}
The code above doesn't work, any idea how I get this to work?
Try
library(dplyr)
bind_rows(lapply(files, myFun))
# a
#1 1
#2 2
#3 3
#4 4
#5 5
#6 1
#7 2
#8 3
#9 4
#10 5
#11 6
#12 7
#13 8
#14 9
#15 10
#16 11
#17 12
#18 13
#19 14
#20 15
where
myFun <- function(files) {
load(files)
df <- data.frame(a= datafile$a)
}
data
datafile <- data.frame(a=1:5, b=6:10)
save(datafile, file='file1.RData')
datafile <- data.frame(a=1:15, b=16:30)
save(datafile, file='file2.RData')
files <- list.files(pattern='file\\d+.RData')
files

Stack columns row by row

I have a dataframe which contains 2 columns, such as
Name Seq
1 ENSE00000789668:ENSE00000789668 CTCAAAATTTGCTGCAGCAGAAATTACTGAGGCGATCCATTTTCTCAGCCTATTAAATTTC
2 ENSE00000789668:ENSE00000814448 CTCAAAATTTGCTGCAGCAGAAATTACTGAGTTTCAGCGGATGTTCTCTCCAGCTTTCAAC
3 ENSE00000789668:ENSE00000814452 CTCAAAATTTGCTGCAGCAGAAATTACTGAGGTTTTGCTGGGCCTGCGTGATACTAGCGAT
4 ENSE00000789668:ENSE00001021870 CTCAAAATTTGCTGCAGCAGAAATTACTGAGTGTCCCGTTTCCGGACCCGTCTCTATGGTG
5 ENSE00000789668:ENSE00001316145 CTCAAAATTTGCTGCAGCAGAAATTACTGAGATTCTCCTATGTGTGTCGTCTGCAGCCATC
6 ENSE00000789668:ENSE00001445604 CTCAAAATTTGCTGCAGCAGAAATTACTGAGCTGCTTGGCTTTGAGGAAGAGTGGCAGTAC
I wish to stack one column onto anther row by row to give:
ENSE00000789668:ENSE00000789668
CTCAAAATTTGCTGCAGCAGAAATTACTGAGGCGATCCATTTTCTCAGCCTATTAAATTTC
ENSE00000789668:ENSE00000814448
CTCAAAATTTGCTGCAGCAGAAATTACTGAGTTTCAGCGGATGTTCTCTCCAGCTTTCAAC
ENSE00000789668:ENSE00000814452
CTCAAAATTTGCTGCAGCAGAAATTACTGAGGTTTTGCTGGGCCTGCGTGATACTAGCGAT
ENSE00000789668:ENSE00001021870
CTCAAAATTTGCTGCAGCAGAAATTACTGAGTGTCCCGTTTCCGGACCCGTCTCTATGGTG
ENSE00000789668:ENSE00001316145
CTCAAAATTTGCTGCAGCAGAAATTACTGAGATTCTCCTATGTGTGTCGTCTGCAGCCATC
ENSE00000789668:ENSE00001445604
CTCAAAATTTGCTGCAGCAGAAATTACTGAGCTGCTTGGCTTTGAGGAAGAGTGGCAGTAC
How do I do this?
You can try
data.frame(Col1=c(t(df)))
# Col1
#1 ENSE00000789668:ENSE00000789668
#2 CTCAAAATTTGCTGCAGCAGAAATTACTGAGGCGATCCATTTTCTCAGCCTATTAAATTTC
#3 ENSE00000789668:ENSE00000814448
#4 CTCAAAATTTGCTGCAGCAGAAATTACTGAGTTTCAGCGGATGTTCTCTCCAGCTTTCAAC
#5 ENSE00000789668:ENSE00000814452
#6 CTCAAAATTTGCTGCAGCAGAAATTACTGAGGTTTTGCTGGGCCTGCGTGATACTAGCGAT
#7 ENSE00000789668:ENSE00001021870
#8 CTCAAAATTTGCTGCAGCAGAAATTACTGAGTGTCCCGTTTCCGGACCCGTCTCTATGGTG
#9 ENSE00000789668:ENSE00001316145
#10 CTCAAAATTTGCTGCAGCAGAAATTACTGAGATTCTCCTATGTGTGTCGTCTGCAGCCATC
#11 ENSE00000789668:ENSE00001445604
#12 CTCAAAATTTGCTGCAGCAGAAATTACTGAGCTGCTTGGCTTTGAGGAAGAGTGGCAGTAC
Or
library(reshape2)
melt(t(df))[3]
Or may be this too
data.frame(Col1=as.matrix(df)[c(matrix(seq(prod(dim(df))), nrow=2, byrow=2))])

Resources