Why do I get a Git fatal: index file smaller than expected error regularly?
By : Bighouse Design
Date : March 29 2020, 07:55 AM
this one helps. I'm not sure if this is the entire story to why this is "fixed", however by disabling bash customisation (~/.bashrc) around Git in the PS1 variable and shutting the virtual machine down gracefully with a sudo shutdown -h now rather than just closing the VM window it appears to have resolved the issue for a week or more now.
|
In a dataframe, find the index of the next smaller value for each element of a column
By : Denis Kovačević
Date : March 29 2020, 07:55 AM
will be helpful for those in need You can group your data by the item, calculate the different between rows using the diff function and check if it is smaller than zero which will then generate a logic vector and you can use the logic vector to pick up the next day. And since you are picking up the next day, you will need the lead function to shift the day column forward so that it can match the rows where you want to place them. Side note: Since diff function create a vector one element shorter than the original one and you will always leave the last row out per group, we can pad the diff result by a FALSE condition. code :
library(dplyr);
df %>% group_by(item) %>% mutate(smaller = c(diff(val) < 0, F),
next.smaller.day = ifelse(smaller, lead(day), -1)) %>%
select(-smaller)
# Source: local data frame [6 x 4]
# Groups: item [2]
# item day val next.smaller.day
# <int> <int> <int> <dbl>
# 1 1 2 3 4
# 2 1 4 2 5
# 3 1 5 1 -1
# 4 2 1 1 -1
# 5 2 3 2 -1
# 6 2 5 3 -1
find.next.smaller <- function(ini = 1, vec) {
if(length(vec) == 1) NA
else c(ini + min(which(vec[1] > vec[-1])),
find.next.smaller(ini + 1, vec[-1]))
} # the recursive function will go element by element through the vector and find out
# the index of the next smaller value.
df %>% group_by(item) %>% mutate(next.smaller.day = day[find.next.smaller(1, val)],
next.smaller.day = replace(next.smaller.day, is.na(next.smaller.day), -1))
# Source: local data frame [6 x 4]
# Groups: item [2]
#
# item day val next.smaller.day
# <int> <int> <dbl> <dbl>
# 1 1 2 2 5
# 2 1 4 3 5
# 3 1 5 1 -1
# 4 2 1 1 -1
# 5 2 3 2 -1
# 6 2 5 3 -1
|
Debezium with kafka or only embedded-Debezium?
By : Avinash Yadav
Date : March 29 2020, 07:55 AM
This might help you With Kafka (Connect) you gain a great level of fault-tolerance and scalability. Check out the documentation of the embedded mode for a detailed description of its trade-offs.
|
How to use custom payload column with outbox transform on standalone Debezium?
By : NandhiniBaskaran
Date : March 29 2020, 07:55 AM
|
Search into pandas dataframe column for which input value is smaller than the next index column value
By : user3702855
Date : March 29 2020, 07:55 AM
|