text:
Q: dplyr group by, carry forward value from previous group to next Ok this is the over all view of what i'm trying to achieve with dplyr:

Using dplyr I am making calculations to form new columns.
initial.capital -
x.long.shares -
x.end.value -
x.net.profit -
new.initial.capital

The code that does this:
# Calculate Share Prices For Each ETF
# Initialize Start Capital Column
library(dplyr)
library(data.table)
df$inital.capital <- 10000
output <- df %>%
  dplyr::mutate(RunID = data.table::rleid(x.long)) %>%
  group_by(RunID) %>%
  dplyr::mutate(x.long.shares = ifelse(x.long == 0,0,
                                       ifelse(row_number() == n(),
                                      first(inital.capital) / first(close.x),0))) %>%
  dplyr::mutate(x.end.value = ifelse(x.long == 0,0,
                                       ifelse(row_number() == n(),
                                              last(x.long.shares) * last(close.x),0))) %>%
  dplyr::mutate(x.net.profit = ifelse(x.long == 0,0,
                                     ifelse(row_number() == n(),
                                            last(initial.capital) - last(x.end.value),0))) %>%
  dplyr::mutate(new.initial.capital = ifelse(x.long == 0,0,
                                      ifelse(row_number() == n(),
                                             last(x.net.profit) + last(inital.capital),0))) %>%

  ungroup() %>%
  select(-RunID)

I am grouping per x.long column. And when grouped. Making calculations from different columns using the first/last positions within the group
My basic question is:
In the photo, see red highlight under new.initial.capital column. How can I 'save' this value (10185.33)... and insert it on the NEXT group, saving it under initial.capital column, again highlighted in red (it would replace 10,000 Or storing it on the first line of the group)?
Edit
What I really need to do is save the final value in the new.initial.capital column into a variable. Then this variable can be used in the next group (see code below) The value here will be used as part of the next groups calculations... and then when the end new.initial.capital is updated, then this values goes into the variable, then it carrys to the start of the next group (see code below).. then all the values will update again.... The variable would be placed here:
output <- df %>%
  dplyr::mutate(RunID = data.table::rleid(x.long)) %>%
  group_by(RunID) %>%
  dplyr::mutate(x.long.shares = ifelse(x.long == 0,0,
                                       ifelse(row_number() == n(),
                                      first(end_of_new.initial.capital_variable_from_previous_group) / first(close.x),0))) %>%

I essentially want to carry over values between dplyr groups. Is this possible?
Or can I store it in a variable each time?
Heres some example data that is in the photo: Save to .txt
df <- read.table("your_dir\df.txt",header=TRUE, sep="", stringsAsFactors=FALSE)

    close.x x.long  y.short x.short y.long  inital.capital  x.long.shares   x.end.value x.net.profit    new.initial.capital
37.96   NA  NA  NA  NA  10000   NA  NA  NA  NA
36.52   0   0   0   0   10000   0   0   0   0
38.32   0   0   0   0   10000   0   0   0   0
38.5504 0   0   0   0   10000   0   0   0   0
38.17   0   0   0   0   10000   0   0   0   0
38.85   1   1   0   0   10000   0   0   0   0
38.53   1   1   0   0   10000   0   0   0   0
39.13   1   1   0   0   10000   0   0   0   0
38.13   1   1   0   0   10000   257.4002574 9814.671815 185.3281853 10185.32819
37.01   0   0   1   1   10000   0   0   0   0
36.14   0   0   1   1   10000   0   0   0   0
35.27   0   0   1   1   10000   0   0   0   0
35.13   0   0   1   1   10000   0   0   0   0
32.2    0   0   1   1   10000   0   0   0   0
33.03   1   1   0   0   10000   0   0   0   0
34.94   1   1   0   0   10000   0   0   0   0
34.57   1   1   0   0   10000   0   0   0   0
33.6    1   1   0   0   10000   0   0   0   0
34.34   1   1   0   0   10000   302.7550711 10396.60914 -396.6091432    9603.390857
35.86   0   0   1   1   10000   0   0   0   0

What I have Tried
I tried to make a variable:
inital.capital <- 10000

And insert this in the code...
output <- df %>%
  dplyr::mutate(RunID = data.table::rleid(x.long)) %>%
  group_by(RunID) %>%
  dplyr::mutate(x.long.shares = ifelse(x.long == 0,0,
                                       ifelse(row_number() == n(),
                                              initial.capital / first(close.x),0))) %>%   # place initial.capital variable.. initialized with 10000
  dplyr::mutate(x.end.value = ifelse(x.long == 0,0,
                                       ifelse(row_number() == n(),
                                              last(x.long.shares) * last(close.x),0))) %>%
  dplyr::mutate(x.net.profit = ifelse(x.long == 0,0,
                                     ifelse(row_number() == n(),
                                            last(initial.capital) - last(x.end.value),0))) %>%
  dplyr::mutate(new.initial.capital = ifelse(x.long == 0,0,
                                      ifelse(row_number() == n(),
                                             last(x.net.profit) + last(inital.capital),0))) %>%
  dplyr::mutate(new.initial.capitals = ifelse(x.long == 0,0,
                                             ifelse(row_number() == n(),
                                                    inital.capital < - last(new.initial.capital),0))) %>%  # update variable with the final balance of new.inital.capital column

  ungroup() %>%
  select(-RunID)

If I can update the initial.capital variable each time. This then would serve as the 'link' between groups. However, this idea is not currently working in the dplyr setup.
Any assistance appreciated.

A: You're using data.table in the question and have tagged the question data.table, so here is a data.table answer. When j evaluates, it's in a static scope where local variables retain their values from the previous group.
Using dummy data to demonstrate :
require(data.table)
set.seed(1)
DT = data.table( long = rep(c(0,1,0,1),each=3),
                 val = sample(5,12,replace=TRUE))
DT
    long val
 1:    0   2
 2:    0   2
 3:    0   3
 4:    1   5
 5:    1   2
 6:    1   5
 7:    0   5
 8:    0   4
 9:    0   4
10:    1   1
11:    1   2
12:    1   1

DT[, v1:=sum(val), by=rleid(long)][]
    long val v1
 1:    0   2  7
 2:    0   2  7
 3:    0   3  7
 4:    1   5 12
 5:    1   2 12
 6:    1   5 12
 7:    0   5 13
 8:    0   4 13
 9:    0   4 13
10:    1   1  4
11:    1   2  4
12:    1   1  4

So far, simple enough.
prev = NA  # initialize previous group value
DT[, v2:={ans<-last(val)/prev; prev<-sum(val); ans}, by=rleid(long)][]
    long val v1         v2
 1:    0   2  7         NA
 2:    0   2  7         NA
 3:    0   3  7         NA
 4:    1   5 12 0.71428571
 5:    1   2 12 0.71428571
 6:    1   5 12 0.71428571
 7:    0   5 13 0.33333333
 8:    0   4 13 0.33333333
 9:    0   4 13 0.33333333
10:    1   1  4 0.07692308
11:    1   2  4 0.07692308
12:    1   1  4 0.07692308

> 3/NA
[1] NA
> 5/7
[1] 0.7142857
> 4/12
[1] 0.3333333
> 1/13
[1] 0.07692308
> prev
[1] NA

Notice that the prev value did not update because prev and ans are local variables inside j's scope that were being updated as each group ran.  Just to illustrate, the global prev can be updated from within each group using R's <<- operator :
DT[, v2:={ans<-last(val)/prev; prev<<-sum(val); ans}, by=rleid(long)]
prev
[1] 4

But there's no need to use <<- in data.table as local variables are static (retain their values from previous group). Unless you need to use the final group's value after the query has finished.

A: You're going to have a hard time finding an 'elegant' pure-dplyr solution, because dplyr isn't really designed to do this. What dplyr likes to do is map/reduce type operations (mutate and summarize) that use window and summary functions respectively. What you're asking for isn't really either of those, because you want each group to depend on the last, so you're really describing a looping operation with side effects - two very non-R-philosophy operations.
If you want to hack your way into doing what you describe, you can try an approach like this:
new.initial.capital <- 0
for (z in split(df, df$x.long)) {
    z$initial.capital[[1]] <- new.initial.capital
    # some other calculations here
    # maybe you want to modify df as well
    new.initial.capital <- foo
}

However, this is really not a very R-friendly piece of code, as it depends on side effects and loops. I would advise seeing if you can reframe your calculations in terms of a summary and/or window function if you want to integrate with dplyr.
For more:
https://www.rstudio.com/wp-content/uploads/2015/02/data-wrangling-cheatsheet.pdf
https://danieljhocking.wordpress.com/2014/12/03/lags-and-moving-means-in-dplyr/

A: This kind of use of first and last is very untidy, so we'll keep it for the latest step.
First we build intermediate data, following your code, but adding some columns to join later at the right places. I'm not sure if you need to keep all columns, you won't need the second join if not.
library(dplyr)
library(tidyr)

df1 <- df0 %>%
  dplyr::mutate(RunID = data.table::rleid(x.long)) %>%
  group_by(RunID) %>%
  mutate(RunID_f = ifelse(row_number()==1,RunID,NA)) %>%  #  for later merge
  mutate(RunID_l = ifelse(row_number()==n(),RunID,NA))    #  possibly unneeded

Then we build summarized data, I refactored your code a bit as you see, because these operations "should" be rowwise.
summarized_data <- df1 %>%
  filter(x.long !=0) %>%
  summarize_at(vars(close.x,inital.capital),c("first","last")) %>%
  mutate(x.long.share        = inital.capital_first / close.x_first,
         x.end.value         = x.long.share         * close.x_last,
         x.net.profit        = inital.capital_last - x.end.value,
         new.initial.capital = x.net.profit         + inital.capital_last,
         lagged.new.initial.capital = lag(new.initial.capital,1))

# A tibble: 2 x 10
#   RunID close.x_first inital.capital_first close.x_last inital.capital_last x.long.share x.end.value x.net.profit new.initial.capital lagged.new.initial.capital
#   <int>         <dbl>                <int>        <dbl>               <int>        <dbl>       <dbl>        <dbl>               <dbl>                      <dbl>
# 1     3         38.85                10000        38.13               10000     257.4003    9814.672     185.3282           10185.328                         NA
# 2     5         33.03                10000        34.34               10000     302.7551   10396.609    -396.6091            9603.391                   10185.33

Then we join our summarized table to the original, getting advantage of the trick of the firt step. The first join may be skipped if you don't need all columns.
df2 <- df1 %>% ungroup %>%
  left_join(summarized_data %>% select(-lagged.new.initial.capital) ,by=c("RunID_l"="RunID")) %>%      # if you want the other variables, if not, skip the line
  left_join(summarized_data %>% select(RunID,lagged.new.initial.capital) ,by=c("RunID_f"="RunID")) %>%
  mutate(inital.capital = ifelse(is.na(lagged.new.initial.capital),inital.capital,lagged.new.initial.capital)) %>%
  select(close.x:inital.capital) # for readability here

# # A tibble: 20 x 6
# close.x x.long y.short x.short y.long inital.capital
# <dbl>  <int>   <int>   <int>  <int>          <dbl>
#  1 37.9600     NA      NA      NA     NA       10000.00
#  2 36.5200      0       0       0      0       10000.00
#  3 38.3200      0       0       0      0       10000.00
#  4 38.5504      0       0       0      0       10000.00
#  5 38.1700      0       0       0      0       10000.00
#  6 38.8500      1       1       0      0       10000.00
#  7 38.5300      1       1       0      0       10000.00
#  8 39.1300      1       1       0      0       10000.00
#  9 38.1300      1       1       0      0       10000.00
# 10 37.0100      0       0       1      1       10000.00
# 11 36.1400      0       0       1      1       10000.00
# 12 35.2700      0       0       1      1       10000.00
# 13 35.1300      0       0       1      1       10000.00
# 14 32.2000      0       0       1      1       10000.00
# 15 33.0300      1       1       0      0       10185.33
# 16 34.9400      1       1       0      0       10000.00
# 17 34.5700      1       1       0      0       10000.00
# 18 33.6000      1       1       0      0       10000.00
# 19 34.3400      1       1       0      0       10000.00
# 20 35.8600      0       0       1      1       10000.00

data
df<- read.table(text="close.x x.long  y.short x.short y.long  inital.capital  x.long.shares   x.end.value x.net.profit    new.initial.capital
37.96   NA  NA  NA  NA  10000   NA  NA  NA  NA
36.52   0   0   0   0   10000   0   0   0   0
38.32   0   0   0   0   10000   0   0   0   0
38.5504 0   0   0   0   10000   0   0   0   0
38.17   0   0   0   0   10000   0   0   0   0
38.85   1   1   0   0   10000   0   0   0   0
38.53   1   1   0   0   10000   0   0   0   0
39.13   1   1   0   0   10000   0   0   0   0
38.13   1   1   0   0   10000   257.4002574 9814.671815 185.3281853 10185.32819
37.01   0   0   1   1   10000   0   0   0   0
36.14   0   0   1   1   10000   0   0   0   0
35.27   0   0   1   1   10000   0   0   0   0
35.13   0   0   1   1   10000   0   0   0   0
32.2    0   0   1   1   10000   0   0   0   0
33.03   1   1   0   0   10000   0   0   0   0
34.94   1   1   0   0   10000   0   0   0   0
34.57   1   1   0   0   10000   0   0   0   0
33.6    1   1   0   0   10000   0   0   0   0
34.34   1   1   0   0   10000   302.7550711 10396.60914 -396.6091432    9603.390857
35.86   0   0   1   1   10000   0   0   0   0",stringsAsFactors=FALSE,header=TRUE)

df0 <- df %>% select(close.x:inital.capital)

A: It took me a very long time to understand what you are going for: for a single "update", does this work?
library(tidyverse)
library(magrittr)
temp <- df %>%
  dplyr::mutate(RunID = data.table::rleid(x.long)) %>%
  group_by(RunID) %>% # Don't delete the RunID
  dplyr::mutate(max.new = max(new.initial.capital)) %>%
  slice(1) %>%
  arrange(x.long) %>%
  dplyr::mutate(pass.value = lag(max.new))

df <- left_join(df, temp %>% dplyr::select(x.long, RunID, pass.value)

After this, replace values of initial.capital using pass.value column, according to grouped row_number as you have done above.
I'm not quite sure how to go about it without looping this updating procedure, and I guess if you want to do 10,000 updates like this it will certainly be a bummer. But it will be enable you to "pass" the value to the second red cell as in your picture.

A: Rolling forwards a value like that can be very difficult. I think it would be preferred to put in a line at the top that acts as a transaction whose net effect is to add 10k to your base capital. You can then use a cumulative sum on the offsets to achieve what you are looking for with relative ease:
pdf = df %>% group_by(group) %>% arrange(dates) %>% mutate(cs = cumsum(sales))

Code copied from r cumsum per group in dplyr

A: I decided to revisit this problem here is a solution by grouping per trade signal, making a start and end of trade group ID. After, use a normal for loop to do the calculations on ifelse statements and updating running variables between groups: shares, total_start_capital and total_end_capital. These allow carrying variables over from trade to the next trade and be used in each successive trade calculations. If only dplyr allowed updating of variables between groups. This has value if someone wants to create their own back test script with the use of PnL $ versus % rets.
# Dollar PnL Back Test Script Example
# Andrew Bannerman 1.7.2017

df<- read.table(text="37.96   NA  NA
36.52   0   0
38.32   0   0
38.55  0   0
38.17   0   0
38.85   1   1
38.53   1   1
39.13   1   1
38.13   1   1
37.01   0   0
36.14   0   0
35.27   0   0
35.13   0   0
32.2    0   0
33.03   1   1
34.94   1   1
34.57   1   1
33.6    1   1
34.34   1   1
35.86 0     0   ",stringsAsFactors=FALSE,header=TRUE)

colnames(df)[1] <- "close"
colnames(df)[2] <- "signal"
colnames(df)[3] <- "signal_short"

# Place group id at start/end of each group
df <- df %>%
  dplyr::mutate(ID = data.table::rleid(signal)) %>%
  group_by(ID) %>%
  dplyr::mutate(TradeID = ifelse(signal ==1,as.numeric(row_number()),0))%>% # Run id per group month
  dplyr::mutate(group_id_last = ifelse(signal == 0,0,
                                         ifelse(row_number() == n(), 3,0))) %>%
  dplyr::mutate(group_id_first = ifelse(TradeID == 1 & signal == 1,2,0))

##############################################
# Custom loop
################################################
run_start_equity <- 10000  # Enter starting equity
run_end_equity <- 0        # variable for updating end equity in loop
run.shares <- 0
df$start.balance <- 0
df$net.proceeds <- 0
df$end.balance <-0
df$shares <- 0
i=1
for (i in 1:nrow(df)) {
  df$start.balance[i] <- ifelse(df$group_id_first[i] == 2, run_start_equity, 0)
  df$shares[i] <- ifelse(df$group_id_first[i] == 2, run_start_equity / df$close[i],0)
  run.shares <- ifelse(df$group_id_first[i] == 2, df$shares[i], run.shares)
  df$end.balance[i] <- ifelse(df$group_id_last[i] == 3, run.shares * df$close[i],0)
  run_end_equity <- ifelse(df$group_id_last[i] == 3, df$end.balance[i],run_end_equity)
  df$net.proceeds[i] <- ifelse(df$group_id_last[i] == 3, run_end_equity - run_start_equity,0)
  run_start_equity <- ifelse(df$group_id_last[i] == 3, df$end.balance[i] ,run_start_equity)
   }

With the desired output:
> df
# A tibble: 19 x 11
# Groups:   ID [5]
   close signal signal_short    ID TradeID group_id_last group_id_first start.balance net.proceeds end.balance   shares
   <dbl>  <int>        <int> <int>   <dbl>         <dbl>          <dbl>         <dbl>        <dbl>       <dbl>    <dbl>
 1 36.52      0            0     1       0             0              0         0.000       0.0000       0.000   0.0000
 2 38.32      0            0     1       0             0              0         0.000       0.0000       0.000   0.0000
 3 38.55      0            0     1       0             0              0         0.000       0.0000       0.000   0.0000
 4 38.17      0            0     1       0             0              0         0.000       0.0000       0.000   0.0000
 5 38.85      1            1     2       1             0              2     10000.000       0.0000       0.000 257.4003
 6 38.53      1            1     2       2             0              0         0.000       0.0000       0.000   0.0000
 7 39.13      1            1     2       3             0              0         0.000       0.0000       0.000   0.0000
 8 38.13      1            1     2       4             3              0         0.000    -185.3282    9814.672   0.0000
 9 37.01      0            0     3       0             0              0         0.000       0.0000       0.000   0.0000
10 36.14      0            0     3       0             0              0         0.000       0.0000       0.000   0.0000
11 35.27      0            0     3       0             0              0         0.000       0.0000       0.000   0.0000
12 35.13      0            0     3       0             0              0         0.000       0.0000       0.000   0.0000
13 32.20      0            0     3       0             0              0         0.000       0.0000       0.000   0.0000
14 33.03      1            1     4       1             0              2      9814.672       0.0000       0.000 297.1442
15 34.94      1            1     4       2             0              0         0.000       0.0000       0.000   0.0000
16 34.57      1            1     4       3             0              0         0.000       0.0000       0.000   0.0000
17 33.60      1            1     4       4             0              0         0.000       0.0000       0.000   0.0000
18 34.34      1            1     4       5             3              0         0.000     389.2589   10203.931   0.0000
19 35.86      0            0     5       0             0              0         0.000       0.0000       0.000   0.0000


text:
Q: @id vs. URL for linking JSON-LD nodes I have defined the publisher Organization on the WebSite node defined on the home page, and I now want to link to that publisher from articles on other pages. However, I also want to link to the WebSite as well, and they naturally share the same @id if I follow the advice of using the URL as the @id.
{
    "@context": "http://schema.org",
    "@type": "WebSite",
    "@id": "http://www.example.com/",
    "url": "http://www.example.com/",
    ...
    "publisher": {
        "@type": "Organization",
        "@id": "http://www.example.com/",  <-- duplicated
        "url": "http://www.example.com/"
    }
}

{
    "@context": "http://schema.org",
    "@type": "WebPage",
    "@id": "http://www.example.com/news",
    "url": "http://www.example.com/news",
    "isPartOf": {
        "@id": "http://www.example.com/"  <-- site or publisher?
    }
    ...
    "publisher": {
        "@id": "http://www.example.com/"  <-- site or publisher?
    }
}

I assume IDs must be unique to each node, so is there a best practice for uniquifying IDs such as adding a hash?
{
    "@id": "http://www.example.com/#site",
    ...
    "publisher": {
        "@id": "http://www.example.com/#publisher",
    }
}

If that works, will processors (Google) load the @id to find the rest of the node's properties?
Related to this, is the url property found in many node types assumed to be the @id if missing? I'm ending up duplicating the full URL of the page as the @id and url for most nodes. Is that the norm?

A: @id (JSON-LD)
(and the same goes for itemid in Microdata, and resource in RDFa)
Each thing should get a different URI, and if multiple nodes are about the same thing, they should ideally reuse this URI. Note that these don't have to be URLs, and they should often not be used as values for Schema.org's url property (see section below).
Using URI fragments is a common and the most simple way to achieve this. For examples (and other ways), see my answers to these questions:

*

*Best practices for adding semantics to a website

*Concepts for RDFa DRY references

*RDF 303 redirect clarification

*Structured Data > Microdata & Json-LD > Entity IDs > Fragment Identifier

*How to implement "mainEntityOfPage" to this specific site?
For your example case, an organization's website, the root URL (http://www.example.com/) typically "stands for" three things:

*

*the home page

*the whole website

*the organization

As the home page is the resource that gets retrieved, it should get the URI http://www.example.com/. The site and the organization should get their own fragments; it's up to you to choose which ones, e.g.: http://www.example.com/#site for the site, and http://www.example.com/#organization for the organization (FWIW, Apple seems to use #organization, too.)

*

*the home page:
http://www.example.com/

*the whole website:
http://www.example.com/#site

*the organization:
http://www.example.com/#organization
(Often only two different things are involved: the document, and the thing described by the document. Then the thing often gets a fragment like #this, and in case of persons, #i, but this is just a convention.)

If that works, will processors (Google) load the @id to find the rest of the node's properties?

Google doesn't document if they try to load those URIs.
Note that there is no requirement that these URIs actually point to a document. You could use HTTP URIs that give 404 answers, or you could use a URI scheme that doesn't allow retrieval of documents to begin with (e.g., urn, tag, …).
url (Schema.org)
Schema.org's url property should be used for the URLs that lead to pages that can be visited. It's not intended as a way to provide an ID, so it's not necessarily the same URI as provided in @id.
In your example case, you would probably use the same url value for all three things:

*

*the home page:
@id: http://www.example.com/
url: http://www.example.com/

*the whole website:
@id: http://www.example.com/#site
url: http://www.example.com/

*the organization:
@id: http://www.example.com/#organization
url: http://www.example.com/

redpajama_set_name: RedPajamaStackExchange


text:
Q: It won't let me scroll The code is below and it won't let me scroll.
[https://codepen.io/duggalverse/project/full/DkoeNr][1]
swdefrgtyhujiuhygtfrgthghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
I also want to fix the transparency part so it only gets the text part-any help would be great!!
Last thing I need help in is the background image....it keeps getting repeated no matter what I try...
  [1]: https://codepen.io/duggalverse/project/full/DkoeNr
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>About Me</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">

x

Hello

ABOUT ME:

                        DUGGALverse

                            I'm a self-taught coder utilizing the internet tools to teach myself. With proven communication and creative thinking skills I am always attempting to best myself. I am an aficionado in various innovation fields and plan to keep investigating different dialects in Computer Science. Meaning to use my capacities to effectively fill in the job in your organization/association. Much of the time applauded as persistent by my associates, I can be depended upon to support your organization/association to accomplish its objectives.

                            As a profoundly gifted studen with involvement in the community, I have an assortment of aptitudes and information that would be of incredible advantage to your company. This activity posting is an incredible open door for me to keep expanding on my  experience while picking up introduction to a huge frameworks driven plan of action. I  like to use my dynamic data innovation range of abilities alongside my group driven character to propel information handling within the role I have currently applied for. I accept that my appended resume will show that I am a brilliant contender for this position. My solid initiative capacities has permitted me to effectively combine and solidify numerous ventures as a candidate within the role I amjapplying for, and I am certain they will permit me to keep on settling on trustworthy choices as an ideal candidate. I approach my work with a hands-on perspective, taking on jobs all through the lifetime of an undertaking. I additionally have a solid scholarly foundation in the coding genre seen clearly.

                        Download My Resume

A: First, the body is having overflow: hidden. Remove that and you should be able to scroll.
Secondly, you put the background-repeat on the .main-banner, when it should be on the body where you set the background-image. Also, your background-size doesn't have a '-' in the middle.


text:
Q: Msg 7391 The operation could not be performed because OLE DB provider for linked server was unable to begin a distributed transaction There is 3 Sql Server. Example Server A, Server B and Server C.
-DTC is running in all the machine.
-Local DTC Properties in all three machine:
      -Network DTC Access

      -Allow Inbound

      -Allow Outboud

      -No Authentication Required

      -Enable XA Transaction

      -Enable SNA LU 6.2 Transaction

      -Account: NT AUTHORITY\NetworkService

RPC and RPC OUT is true for link server
Server A: Windows 8, Server B: Windows 7 and Server C: Windows 7
Firewall is off in all three servers
Servers are not in Domain.
Added "set xact_abort on" in the query.
Now, From server A Distributed transaction work fine in both machine.
    From server B Distributed transaction work in Server A only.

    From server c Distributed transaction work in Server A only.

Problem: Distributed Transaction does not work between server B and C.

A: May be you have problem with configuration of your firewalls on A\B\C servers. You can try to temporally disable firewalls to check this.  See following link for more details about "Enable Network DTC Access".

A: This issue was due to same unique identity in MSDTC of server B and server C.  This means that the two MS DTC will not be able to communicate with each other. This problem typically occurs if one of the systems were cloned using unsupported cloning tools. MS DTC requires that the systems be cloned using supported cloning tools such as SYSPREP. Running 'msdtc -uninstall' and then 'msdtc -install' from the command prompt will fix the problem. Note: Running 'msdtc -uninstall' will result in the system losing all MS DTC configuration information. Note: In Windows 2008 use Administrator command prompt, service must be stopped and you must reboot the server.
http://www.sqlwebpedia.com/content/msdtc-troubleshooting


text:
Q: jQuery causing page re-load on iPhone I'm using this piece of jQuery to show a message to my users on first visit and on click of the 'info' button.
$(document).ready(function()
{
if(!localStorage.newVisitor) {
    localStorage.newVisitor="true";
    $('#popUp').fadeIn(300);
}

$('#popUp').click(function(){
    $('#popUp').fadeOut(300);
});

$('#info').click(function(){
    $('#popUp').fadeIn(300);
    }
);
});

The html is essentially:

Hello

Info

The CSS:
#popUp {
    display: none;
}

This is all hunky dory in safari, but when I transfer this to the iPhone for testing, every time I tap the 'Info' button, the popup shows, but then the page instatly refreshes so the message is then reset to it's hidden state.
Any Ideas why this is so anyone?
Thanks!

A: Try this:
$('#info').click(function(e){
    e.preventDefault();
    $('#popUp').fadeIn(300);
});

Btw, your  tag should have an href attribute:
Info

A: Replace you this:
Info

To this:
Info

CSS:
#info{cursor:pointer;}

Because you are targeting the id for the click you dont need the , as the  tag has certain behaviors that it wants to do for example jump to a point on a page or move to another page.


text:
Q: Storing laravel API tokens from one API in another APIs env file Last year my company started using Laravel to build APIs, and we created two separate repositories - one for a primary API and then a second for a secure API that would only accept requests from the primary API. We have been using passport for token creation/handling. Our current process involves creating a token on the secure API and storing that in the .env file of the primary API instance (similar to the scenario posed in this laracast.
This approach has the drawback that the tokens expire after a certain amount of time, and need to be re-created and saved in the appropriate .env file.
Is there a better technique than this?


text:
Q: How to prove the definition of arctangent by G. H. Hardy through integral? From introduction to analysis,by Arthur P. Mattuck,problem 20-1.
I am stuck in the sub-problem (d) of this problem,especially the magic number 2.5,please help,thanks.
Problems 20-1
One way of rigorously defining the trigonometric functions is to start with the definition of the arctangent function. (This is the route used for example in the classic text Pure Mathematics by G. H. Hardy.)
So, assume amnesia has wiped out the trigonometric functions (but the rest of your knowledge of analysis is intact). Define
$$
T(x)=\int_{0}^{x}\frac{dt}{1+t^{2}}
$$
(a) Prove T(x) is defined for all x and odd.
(b) Prove T(x) is continuous and differentiable, and find T'(x).
(c) Prove T(x) is strictly increasing for all x; find where it is convex, where
concave, and its points of inflection.
(d) Show T(x) is bounded for all x, and |T(x)| < 2.5, using comparison
of integrals. Can you get a better bound?


text:
Q: Цикл в PHP Как в данном случае сделать что бы все выводилось в цикле.
$pages=array(
"$file_name"=>"$item_name"
);

Дело в том что здесь выводятся из БД первые строки, а надо что бы выводились все подряд.
A: Не уверен, что правильно понял вопрос.

Цикл для перебора массивов
foreach($page as $key => $value){
print "ключ $key \n";
print "зачение $value";
}

UPD
Если инфа берётся из базы данных, то примеров обработки куча. Например для mysql:
$result = mysql_query("SELECT id, name FROM mytable");

    while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
        printf ("ID: %s  Name: %s", $row[0], $row[1]);
    }


text:
Q: How can i get this certain part of the command output using shell? I am on iOS, im working on a project, I'm using bash/shell. I need to just print this: 5EF31D4F-4C1E-432A-8BDD-D06A1697C33B, from this:
HUANG:/var/mobile/Containers/Data/Application root# find . -name "Safari" -ls
  4426    0 drwxr-xr-x   3 mobile   mobile        306 Oct 17 18:41 ./5EF31D4F-4C1E-432A-8BDD-D06A1697C33B/Library/Safari
HUANG:/var/mobile/Containers/Data/Application root#

The string part I'm trying to print is random for every device.

A: find . -name "Safari" -ls | cut -d/ -f 2

Use cut to extract the desired part from the output.

*

*d/: set '/' as the delimeter

*-f 2: print only the second field


text:
Q: Retrofit 2 cancel request working I have been reading for a while about cancel request in retrofit 2.As far as i have read on cancel requests,onFailure() is called and request is  removed from the queue if not dispatched. But what happens if the request is already been dispatched(i know i'll get callback onFailure()) but does Actual HTTP request to the server is cancelled?
To elaborate let's say I am uploading an image to the server. Request has been dispatched and now cancel is called, I know I will get an onFailure callback for android but will the image get uploaded to the server or will it be abandoned from the server side as well?
This might be a basic thing in network requests but since this is my first time encounter not really aware how generally cancel requests works.

A: Calling cancel on retrofit's Call object will close the socket of the connection if connection has been established.
This means if you are in the middle of the file upload and you call the cancel() method, then the connection will immediately be closed and the file upload will fail.
But if you cancel the call when the file upload has completed and the server is sending response message, the file gets uploaded.


text:
Q: I Can't able to pass a values(id) in urls in django After user login their account,  it is redirect to home page. In that home page i added profile option for user to edit and view their profile. but logged user only view his profile.so i need add id in  url for show the specific profile page for the user.but i cant do that with my code. I need like this [" 121.0.0.1:8000/profile/1 or  121.0.0.1:8000/1/profile]..But i got this ['121.0.0.1:8000/profile/']    cant add  id in url and it throws page not found error
Views.py
class ShowProfilePageView(DetailView):
model = Profile
template_name = 'bgmiapp/user_profilepage.html'

def get_context_data(self,*args,**kwargs):
    context = super(ShowProfilePageView,self).get_context_data(*args,**kwargs)
    page_user = get_object_or_404(Profile,id=self.kwargs['pk'])
    context["page_user"] = page_user
        return context

views.py/home
def home(request):
    profile=Profile.objects.all()
    return render(request,'bgmiapp/home.html',{'profile':profile})

URLS.py
from django.contrib import admin
from django.urls import path
from . import views
from .views import ShowProfilePageView

urlpatterns = [
    path('home/',views.home,name='home'),
    path('register/',views.register,name='register'),
    path('login/',views.login_view,name='login'),
    path('<int:pk>/profile/',ShowProfilePageView.as_view(),name='show_profile_page')

templates : home.html
{% extends 'bgmiapp/base.html' %}
{% load static %}
{% block title %} Home {% endblock %}

{% block content %}

 homepage coming soon!!!!

profile

{% endblock %}


text:
Q: Get the Last 4 Weeks Data as averages in sqlserver 2008 How to get Last 4 weeks of data as an average in sqlserver 2008.
i have the data like 1st week with 4 records - O/P should be like average of these four records week wise similarly i need it for one month as four week of data i.e four records.
 please suggest me the sqlserver query.

A: Something like this:
SELECT  DATEPART(W, Data_Date) AS [Week], AVG([Some_DataField]) AS AverageValue
FROM    [DataTable]
WHERE   Data_Date >= DATEADD(W, -4, GETDATE())
GROUP BY DATEPART(W, Data_Date)

DATEPART(W, [Date]) returns the week number for the month in context


text:
Q: Azure Functions - An attempt was made to access a socket in a way forbidden by its access I have an ARM template that populates a resource group with a Durable Function (C# .Net Core 3.1) and storage account.
The function app contains a durable function that's triggered uses the RabbitMQ binding to collect a message from a queue.
This has been working fine but this morning while making a minor change to the arm template VS Code suggested I update the schema version - no problem I thought! The deployment that followed messed things up so I deleted the function app and storage account and ran again. That time the deployment ran ok. However, now when the app starts, nothing is collected from the queue and I find the following in the function host log file:

Error indexing method 'ConsumeNewClientEntryPoint' ---> RabbitMQ.Client.Exceptions.BrokerUnreachableException : None of the specified endpoints were reachable ---> System.AggregateException : One or more errors occurred. (Connection failed) ---> Connection failed ---> An attempt was made to access a socket in a way forbidden by its access permissions. xx.x.37.141:5672

The ip address given in the error message is that for the RabbitMQ host the binding uses.
Any ideas what's wrong?

A: My bad! I'd forgotten to enable vnet integration on the newly deployed Function App (should be part of ARM template)


text:
Q: Запуск скрипта на опенсервере Как запустить скрипт?
написала скрипт в планировщике задач, назначила ближайшее время, не выполнился... результат выполнения скрипта не написалось в text.txt (файл text.txt вообще не создался и не написал результат в себя ("hello world"))
%progdir%\modules\php\%phpdriver%\php-win.exe -c %progdir%\userdata\temp\config\php.ini -q -f %sitedir%\site.loc\hello.php -O %progdir%\userdata\temp\temp.txt

Это пробный скрипт hello.php.
Вопрос. Как нужно сделать, чтобы результат выполнения скрипта записался в лог?
2)Дайте мне, плиз, документацию, по
-c,-q,-f, -O

Гуглила на эту тему, не нашла... Какой запрос вбить в поисковике?
3)Моя основная задача это сделать выборки из других таблиц и занести в одну. Скажу, что таблица , из которой делается выборка, большая, содержит 46549259 строк. И скрипт, наверное, будет выполнятся 3 дня... На что обратить внимание, и как его запустить, и чтобы результат занесения скрипта заносился в файл? Я попробовала запустить скрипт hello.php(см. выше), у меня не получилось(см. выше) или я что-то неправильно делаю?


text:
Q: ASP.Net MVC Getting HTTP 400 with ajax post request I am trying to post some simple data with ajax from my view to controller. When I switch it to HttpGet it works fine, but when trying httppost I always get error 400.
Here is my view code:
@Html.Hidden("postSettings", Url.Action("MethodName", "MyController"))
$.ajax({
     url: $("#postSettings").val(),
     type: "POST",
     data: JSON.stringify(11),
     dataType: "json",
     contentType: "application/json",
     success: function (_result) {
         console.log("success")
     },
     error: function (e) {
         console.log(e);
         }
});

And code in my controller:
    [HttpPost]
    public IActionResult MethodName(object value)
    {
        return Ok();
    }

A: I did not noticed that I have global filter applied
services.AddMvc(options =>
        {
            options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute());
        });

,adding the CSRF token fixed the problem.
I just added this code to my view:
<script type="text/javascript">
    function gettoken() {
        var token = '@Html.AntiForgeryToken()';
        token = $(token).val();
        return token;
    }
</script>

And to the ajax request:
headers: {
    RequestVerificationToken: gettoken()
},


text:
Q: Managed Memory StringBuilder Problem: JVM OOME caused by appending large files to a String or StringBuilder
Proposed solution: Inspired by the org.apache.axis.attachments.ManagedMemoryDataSource class I have wrote a class that keeps a StringBuilder buffer to a certain maximum. When that maximum is reached the class flush the contents of the StringBuilder to disk, and all subsequent appends are done to disk.
is there any custom class out there that accomplish this?
am I on the right track?

A: Why not just create a bigger virtual memory in your OS and specify a bigger heap for the JVM? It looks like trying to reinvent the wheel.

A: Here is the final version:
package aytos.util.gestion;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
import java.util.UUID;

public class ManagedMemoryStringBuilder implements Serializable
{
  private static final long serialVersionUID = 1L;

  private static String tmpPath;

  private StringBuilder buffer = new StringBuilder();

  private File tmpFile;

  private static int MAX_BUFFER = 262144;// 256KB

  static
  {
    // get temporal path to store the file
    tmpPath = /* TODO initialize your temporal path here */;
    if(!"".equals(tmpPath))
    {
      tmpPath += File.separator + "ManagedMemoryStringBuilder";
      File folder = new File(tmpPath);
      if(!folder.exists())
      {
        if(!folder.mkdirs())
        {
          tmpPath = "";
        }
      }
    }
  }

  public static void setTmpPath(String tmpPath1)
  {
    tmpPath = tmpPath1;
  }

  public static String getTmpPath()
  {
    return tmpPath;
  }

  public File getFile()
  {
    return tmpFile;
  }

  public ManagedMemoryStringBuilder append(String content)
  {
    if(tmpFile != null)
    {// already on disk
      writeToDisk(content);
    }
    else if(!"".equals(tmpPath) && ((buffer.length() + content.length()) > MAX_BUFFER))
    {// buffer overflow, write to disk
      flushToDisk();
      writeToDisk(content);
    }
    else
    {// great, can store in memory
      buffer.append(content);
    }
    return this;
  }

  public ManagedMemoryStringBuilder append(InputStream is)
  {
    try
    {
      BufferedReader reader = new BufferedReader(new InputStreamReader(is));
      // attemp to fill the whole buffer
      char[] cBuf = new char[MAX_BUFFER - buffer.length()];
      int read = reader.read(cBuf);
      buffer.append(cBuf);

      if(read != -1)
      {// something is left on the reader, so we have to flush the buffer to disk and resume writing
        flushToDisk();
        ReadableByteChannel in = null;
        FileChannel out = null;
        try
        {
          in = Channels.newChannel(is);
          out = new FileOutputStream(tmpFile,true).getChannel();
          ByteBuffer bytebuf = ByteBuffer.allocateDirect(MAX_BUFFER);

          while(in.read(bytebuf) > 0)
          { // Read data from Channel into ByteBuffer
            // flip the buffer which set the limit to current position, and position to 0.
            bytebuf.flip();
            out.write(bytebuf); // Write data from ByteBuffer to file
            bytebuf.clear(); // For the next read
          }
        }
        finally
        {
          if(in != null)
          {
            try
            {
              in.close();
            }
            catch(IOException e)
            {
              // nothing to do
            }
          }
          if(out != null)
          {
            try
            {
              out.close();
            }
            catch(IOException e)
            {
              // nothing to do
            }
          }
        }
      }
      return this;
    }
    catch(IOException e)
    {
      throw new RuntimeException(e);
    }
  }

  public ManagedMemoryStringBuilder append(ManagedMemoryStringBuilder content)
  {
    if(!"".equals(tmpPath) && content.tmpFile != null)
    {// content already on disk
      if(tmpFile == null)
      {// have to tranfer to disk
        flushToDisk();
      }
      try
      {
        FileChannel in = null;
        FileChannel out = null;
        try
        {
          in = new FileInputStream(content.tmpFile).getChannel();
          out = new FileOutputStream(tmpFile,true).getChannel();
          ByteBuffer bytebuf = ByteBuffer.allocateDirect(MAX_BUFFER);

          while(in.read(bytebuf) > 0)
          { // Read data from file into ByteBuffer
            // flip the buffer which set the limit to current position, and position to 0.
            bytebuf.flip();
            out.write(bytebuf); // Write data from ByteBuffer to file
            bytebuf.clear(); // For the next read
          }
        }
        finally
        {
          if(in != null)
          {
            try
            {
              in.close();
            }
            catch(IOException e)
            {
              // nothing to do
            }
          }
          if(out != null)
          {
            try
            {
              out.close();
            }
            catch(IOException e)
            {
              // nothing to do
            }
          }
        }
      }
      catch(IOException e)
      {
        throw new RuntimeException(e);
      }
    }
    else
    {
      append(content.toString());
    }
    return this;
  }

  private void flushToDisk()
  {
    tmpFile = new File(tmpPath + File.separator + UUID.randomUUID());
    writeToDisk(buffer.toString());
    buffer = null;
  }

  private void writeToDisk(String content)
  {
    try
    {
      Writer output = null;
      try
      {
        output = new BufferedWriter(new FileWriter(tmpFile.getCanonicalPath(),true),MAX_BUFFER);
        output.write(content);
      }
      finally
      {
        if(output != null)
        {
          try
          {
            output.close();
          }
          catch(IOException io)
          {
            // Nothing to do
          }
        }
      }
    }
    catch(Exception e)
    {
      throw new RuntimeException(e);
    }
  }

  public boolean isFile()
  {
    return tmpFile != null;
  }

  @Override
  public String toString()
  {
    try
    {
      if(isFile())
      {
        FileInputStream fis = new FileInputStream(tmpFile.getCanonicalPath());
        FileChannel fc = fis.getChannel();
        MappedByteBuffer mmb = fc.map(FileChannel.MapMode.READ_ONLY,0,fc.size());
        byte[] buffer str = new byte[(int)fc.size()];
        mmb.get(buffer);
        fis.close();
        fc.close();
        return new String(str);
      }
      else
      {
        return buffer.toString();
      }
    }
    catch(Exception e)
    {
      throw new RuntimeException(e);
    }
  }
}


text:
Q: How to use nested SELECT statements with IN operator in SQL (JPA)? I want to use the following SQL query in my java class:
SELECT *
FROM table1
WHERE attribute1 IN (
  SELECT attribute1
  FROM table2
  WHERE attribute2 = c
)

Here table1 and table2 are two entities having the common column attribute1.
How to get the result of this query as a List of type table1?

A: You cannot get the result as List of type table1.
A table is a collection of columns. A Java List can contain only a collection of one column.
Imagine table1 contains 5 columns of different data types (say INTEGER, VARCHAR2, INTEGER, VARCHAR2, VARCHAR2). Your query will return a ResultSet containing all these values.
Now, you are expecting a simple List to store all these values. It is not correct.
If you want to store all values of a particular column, then you can do it as shown below.
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM table1 WHERE attribute1 IN (SELECT attribute1 FROM table2 WHERE attribute2 = c)");
List<String> attr = new ArrayList<String>();

while (rs.next()) {
    attr.add(rs.getString("attribute1"));
}

If you wish to obtain values of different column, then use rs.getXXX("<column_name"); to fetch its details. Note: Replace getXXX with appropriate method based on datatype of the column. For example, getString() for VARCHAR, getInt() for INTEGER etc.


text:
Q: Java: Can't read file I copied during session, works fine after program restart i am copying a file like this:
            File copy = new File(file.getName());
            // path relative to current working directory
            Path relativePath = Paths.get("src/main/resources/images/",  copy.getPath());
            java.nio.file.Files.copy(
                    file.toPath(), // input path
                    relativePath, // target path
                    java.nio.file.StandardCopyOption.REPLACE_EXISTING);

            logger.info("Copy file to path {}", relativePath);
            // save path for NPC
            currentImagePath = "/images/"+copy.getPath();

and then save the path to the database. When I try to open the copied file like this:
            Image image = new Image(bild);

(bild is the currentImagePath from before), I get an Exception saying that it was an invalid URL or the resource was not found. However, if I end the program and start it anew, opening the file works without a problem. Is there a solution to this?

A: Maybe the file is not done copying yet.  It could take the OS a while to copy the file.   The copy method might return before the copy is complete.

A: Without seeing more code I would say that your issue is this line Image image = new Image(bild);.
Also "/images/"+copy.getPath() is not the same as relativePath, are you using them both correctly? Try this to check if there is an issue:
System.out.println("/images/"+copy.getPath());
System.out.println(relativePath);
System.out.println(copy.getAbsolutePath());

Was your issue caused by an incorrect path?
Now try something a bit like this to load your image (Note how ImageIO is used):
System.out.println("Does file exist: "+ copy.exists());
System.out.println("Is file locked: "+ copy.canWrite());
while (copy.canWrite() != true){
    //stall your application until the file is accessible.
}
//now load the file
Image image = ImageIO.read(copy);

This answer has excellent info on checking for a locked file:
https://stackoverflow.com/a/1500521/1270000


text:
Q: Executing a command inside folders and subfolders with shell script Currently I'm trying use a single command line to rename all .mp4.mp4 to .mp4.
I've a lot of .mp4 files with these names:
103160626309temp1ep10.mp4
103160626309temp1ep10.mp4.mp4

148999555452temp1ep6.mp4
148999555452temp1ep6.mp4.mp4

6802547045temp1ep5.mp4
6802547045temp1ep5.mp4.mp4

335587012366temp1ep4.mp4
335587012366temp1ep4.mp4.mp4
...

I'm trying use find . -iname "*.mp4.mp4" -exec rename -f 's/\.mp4\.mp4\z/.mp4/' *.mp4.mp4 \; to rename all .mp4.mp4 to .mp4 inside all folders and subfolders but I'm getting this error:
Can't rename *.mp4.mp4 *.mp4: No such file or directory
Can't rename *.mp4.mp4 *.mp4: No such file or directory
Can't rename *.mp4.mp4 *.mp4: No such file or directory
Can't rename *.mp4.mp4 *.mp4: No such file or directory
...

Do you know how can I solve this issue? Thank you.

A: There's no good reason to use the rename command at all; just directly rename your matches.
find . -name '*.mp4.mp4' -execdir sh -c 'for f; do mv -- "$f" "${f%.mp4}"; done' _ {} +

...or even...
while IFS= read -r filename; do
  mv -- "$filename" "${filename%.mp4}"
done < <(find . -name '*.mp4.mp4' -print0)

That said, to explain why you got your error: Assuming there are no *.mp4.mp4 files in the directory where you run the command,
find . -iname "*.mp4.mp4" -exec rename -f 's/\.mp4\.mp4\z/.mp4/' *.mp4.mp4 \;

becomes...
find . -iname "*.mp4.mp4" -exec rename -f 's/\.mp4\.mp4\z/.mp4/' '*.mp4.mp4' \;

...so, every rename command started by find contains *.mp4.mp4 as a literal string on its command line. This isn't evaluated as a glob (and replaced with a list of matching files) because glob expansion is performed by the shell, and there's no shell between the find and rename processes.


text:
Q: React Navigation Hardware Back Button exiting app from evey screen i've got my app currently set up like this from the root: -
-SwitchNavigator
 -Splash (Also decides if you have a token or not and where to send you...)
 -AuthFlow (If no Token...)
  -Login Screen
 -SecureFlow (If a Token exists...)

SecureFlow looks like this: -
(MobX Provider)
<Provider store={stores}>
    <DrawerNavigator />
</Provider>

Then the DrawerNavigator is as follows: -
-DrawerNavigator
 -StackNavigator
  -Home(Main screen once authenticated)
  -StackNavigator (Screen1)
   -Screen1a
   -Screen1b
   -Screen1c
  -Screen2
  -Screen3
  -Screen4

React-Navigation version is 2.2.5
So, for whatever reason, if I press the hardware back button from say Screen1a or even Screen3 the App closes rather than actually navigates back... The built in Navigator back buttons work fine.
Anybody know why this is?
I've read about people running Redux have to manually setup the back button behaviour but is that the case here with MobX?
It doesn't seem like MobX or React Navigation have much to do with each other in my implementation?

A: It's pretty impossible to gauge a respectable correct answer here, without reviewing your code.
Nonetheless, this could be due to your android react-native stack, or more likely how your routes are stacked.
My advice would be to employ the react-native-router-flux package to manage this:
https://www.npmjs.com/package/react-native-router-flux
This has Mobx already built-in and you can also pass data via Actions() if not full conversant with Mobx stateless constructs.

A: There's possibly a return true missing in your back handler.


text:
Q: Using upper and lower case Scheme symbols, clarification needed Why is it that when asking Scheme to interpret a symbol value with mixed case, only a lower case version is returned?
#;> 'HelloWorld
helloworld

#;> 'helloworld
helloworld

For the above example, i am using sisc

A: R5RS states that all symbols are case-insensitive and may get their case changed.
Note that some implementations handle this differently.. it's not required (but is common, as in in SISC) that (eq? 'a 'A) return #t, but it is required that if you define a function a that you be able to call it with (A).

A: In some Scheme interpreters symbols are case-insensitive, it seems that's the case in SISC. That's implementation-dependent, and it's not consistent across different implementations. For instance, these are different symbols in Racket:
(equal? 'HelloWorld 'helloworld)
=> #f

According to this FAQ:

R5RS states that identifiers and symbols read via the Scheme reader (i.e. when reading Scheme programs) are case-insensitive and may get their case changed. Hence (eq? 'a 'A) is the same as (EQ? 'a 'A) and returns #t. Note though that it is considered bad style to write programs that rely on this, e.g. by defining a function foo and then calling it using (Foo) or (FOO).

A: Most versions of Scheme, just as its parent language Lisp, are case-insensitive, so the symbol can be interned any way the implementation wants to do it; most versions of Scheme and Lisp use upper-case symbols, but lower-case is also possible, as is whatever case is entered by the user. Since R6RS, most Scheme systems are case-sensitive and will intern the symbol exactly as it is entered.


text:
Q: Why has this configuration chosen for feedback? I'm a newbie in electronics and Trying to understand and build this circuit. would somebody tell me the rule of R1 & C2 in this circuit and their magnitude effect on the controlling of process.why didnt feedback start just after the output of opamp?How could i find the transfer function between the voltage output of Hall effect sensor and the voltage output of MOSFET drain?
The schematic is the circuit of a magnetic levitating tool at:
http://www.bis0uhr.de/index.htm?http://www.bis0uhr.de/projekte/schwebekugel/english.php%99https://www.youtube.com/
Thanks so much

A: You're asking what the role of R1 and C2 is. This circuit is a PI controller.
With just R1 in the feedback path you have a simple amplifier, with a proportional response. With just C2 in the feedback path you have an integrator.
This circuit combines those behaviours. The faster the signal changes, the more C2 looks like a short and you have a simple proportional feedback through R1. The more slowly the signal is changing, the greater the role C2 plays and the circuit is an integrator.
So, with the proportional response dominating at high frequency, the circuit can rush toward the setpoint faster, then when the output is in the right ballpark the integrator takes over to stabilize it.


text:
Q: Store an integer in a cell and use that to set the number of column gaps I'm creating a revenue model on a simple spreadsheet. On the top, I have a variable cell (C5) that is the "number of weeks between transactions". Below that, I have a simple weekly revenue model.
Problem: What I would like is to be able to tweak the fields in yellow and have it apply dynamically to the model below so that it applies the sales amount from C4 every X weeks to the model below, where X is C5.
My initial guess was to use OFFSET, such as F10 =SUM(OFFSET(C10,0,$C$5)), but I've never used this function before and the more I think about it, I'm not sure if I'm approaching this correctly at all.
I created a mock desired results image to show what I would like to have happen if I enter 3 in C5 and then change it to 2.

A: May not be quite right but hopefully 'configurable' to suit. Assumes $500 is entered in C10 and (at least for the time being) 1 will not be entered in C5. Please try in D10 and copied across to suit:
 =IF(MOD(COLUMN()-3,$C5)<MOD(COLUMN()-4,$C5),$C10,"")

A quick fix for the above failing to populate all cells when C5 is 1 is to wrap the formula in the condition =IF($C5=1,$C10,....)
MOD "returns the remainder after a number is divided by a divisor". The remainder being 0 when the number is an exact multiple of the divisor. If we take the first example (every third column) a suitable divisor is 3. Put =MOD(Column(),3) in A1 and copy across and the result is 1, 2, 0, 1, 2, 0, 1, ..... (Column() returns a number representing the column letter, with 1 for A, 2 for B etc., or the actual Column Heading where R1C1 reference style is checked under Working with formulas, in Formulas within Excel Options.)
So that establishes a series where every third position is identifiable as returning a value from MOD that is less than that of the immediately preceding cell. For the second example (every second column) with a divisor of 2 =MOD(Column(),2) in A1 copied across results in 1, 0, 1, 0, 1, ... so again the reduction in the remainder signals the position required for the formula to output the requisite value.
We are comparing the result of calculating the remainder for one column relative to the result of the same calculation performed on the previous column, hence -3, -4. Other (suitably paired) values might work equally well, it just seemed easier to 'start from zero' when in the first column for the formula (ColumnD or 4).
(If anybody would like to provide a proper explanation please feel free to edit!)


text:
Q: Adding a tool tip for for circle using python from bokeh in gmap My code is
from bokeh.io import output_file, show
from bokeh.models import ColumnDataSource, GMapOptions
import bokeh.plotting as plotting
from bokeh.plotting import gmap
import tkinter as tk

screenInfo=tk.Tk()

map_options = GMapOptions(lat=26.366314, lng= 77.016513, map_type="roadmap", zoom=5)

# For GMaps to function, Google requires you obtain and enable an API key:
#
#     https://developers.google.com/maps/documentation/javascript/get-api-key
#
# Replace the value below with your personal API key:
p = gmap(API_KEY, map_options, title="Austin",plot_width=screenInfo.winfo_screenwidth()-100, plot_height=screenInfo.winfo_screenheight()-100)

source = ColumnDataSource(
    df

)

p.circle(x="lat", y="lon", size=15,name="Place", fill_color="blue", fill_alpha=0.8, source=source)
plotting.output_file('gmap.html')
show(p)

Here I need to add a tool tip for a circle
I tried using
    TOOLTIPS = [
       # ("index", "$index"),
       # ("(x,y)", "($x, $y)"),
        ("Place", "@Place"),
    ]
p = gmap(API_KEY, map_options, tooltip=TOOLTIPS,title="The Hindu",plot_width=screenInfo.winfo_screenwidth()-100, plot_height=screenInfo.winfo_screenheight()-150)

but tooltip works for only figure not for gmap.
So,is there any alternative to get tooltips.

A: Finally I got the solution
from bokeh.models import ColumnDataSource, GMapOptions,HoverTool
TOOLTIPS = [
    ("Place", "@Place"),
    ("News","@Title")
]
p.add_tools( HoverTool(tooltips=TOOLTIPS))

I appended these Lines to  my code to get tooltip


text:
Q: Changing the default formating view for Type system.io.directoryinfo.format.ps1xml I am wondering if someone can point me in the right direction or share with me  a working example of this system.io.directoryinfo.format.ps1xml being configured correctly.
Reading the documentation articles of about Format.ps1xml and Out-Default I was able to figure out how to export default "Type" view formatters modify them and then reimport them.
But I am stuck on manually and correctly modifying this file
The expected result I am looking for is to remove the table header, and the directory name that is printed above the table header

As for the properties, it should be:

*

*Basename

*Extension

*LastAccessTime

*Directory or Parent folder

So that the end result I am aiming for looks like this:

In once instance, I attempted to remove the entire node TableHeaders:
        <TableHeaders>
          <TableColumnHeader>
            Mode
            <Width>7</Width>
            <Alignment>Left</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            LastWriteTime
            <Width>26</Width>
            <Alignment>Right</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            Length
            <Width>14</Width>
            <Alignment>Right</Alignment>
          </TableColumnHeader>
          <TableColumnHeader>
            Name
            <Alignment>Left</Alignment>
          </TableColumnHeader>
        </TableHeaders>

Which gives me view like this:
ModeWithoutHardLink LastWriteTimeString LengthString NameString
------------------- ------------------- ------------ ----------
d----               07/02/2023    19:18              Some folder

Further edits and then attempting to reimport the editing xml file just gives me error:
Update-FormatData: Errors occurred while loading the format data file:

I spent all day attempting to understand this and I am at my witts end now. Any help would be greatly appreciated!

A: You can use the CustomControl ExpressionBinding Tag to get that output you're looking thru a format ps1xml file however you should note, since you're interested in displaying objects as if they were strings, there is no way to handle dynamic padding with this method.
Your format file should look like this:
<Configuration>
  <ViewDefinitions>
    <View>
      <Name>CustomIODisplay</Name>
      <ViewSelectedBy>
        <TypeName>System.IO.DirectoryInfo</TypeName>
        <TypeName>System.IO.FileInfo</TypeName>
      </ViewSelectedBy>
      <CustomControl>
        <CustomEntries>
          <CustomEntry>
            <CustomItem>
              <ExpressionBinding>

              </ExpressionBinding>
            </CustomItem>
          </CustomEntry>
        </CustomEntries>
      </CustomControl>
    </View>
  </ViewDefinitions>
</Configuration>

Then you can Update-FormatData:
Update-FormatData -PrependPath path\to\my\test.format.ps1xml

Then Get-ChildItem update would look more or less like you wanted:
PS ..\pwsh> Get-ChildItem C:\Windows\ -File | Select-Object -First 10

bfsvc                    .exe      15/01/2023 19:21:46 C:\Windows
bootstat                 .dat      07/02/2023 15:00:22 C:\Windows
comsetup                 .log      15/08/2021 02:44:15 C:\Windows
Core                     .xml      07/02/2023 10:24:46 C:\Windows
CoreSingleLanguage       .xml      05/02/2023 17:12:19 C:\Windows
diagerr                  .xml      05/02/2023 17:12:19 C:\Windows
diagwrn                  .xml      05/02/2023 17:12:19 C:\Windows
DirectX                  .log      15/08/2021 02:44:15 C:\Windows
DPINST                   .LOG      15/03/2022 13:17:14 C:\Windows
DtcInstall               .log      15/08/2021 02:44:15 C:\Windows

A much simpler solution to the problem would be to use Format-Table -HideTableHeaders, then the cmdlet can handle dynamic padding for you:
Get-ChildItem C:\Windows\ -File |
    Format-Table Basename, Extension, LastAccessTime, DirectoryName -HideTableHeaders


text:
Q: Google Apps Script fails to generate image from EmbeddedChartBuilder I have a Google Spreadsheet with a custom script that has been working just fine for more than a year and it suddenly started failing.
The problem is very simple to reproduce, but I have no idea what's going on.
I create a simple chart from a cell range inside my spreadsheet:
var ss = SpreadsheetApp.getActive();
var sheet = ss.getSheetByName("Sheet1");
var chart = sheet.newChart()
     .setChartType(Charts.ChartType.LINE)
     .addRange(sheet.getRange("A1:D4"))
     .setPosition(5, 5, 0, 0)
     .build();

The I try to create an image from that EmbeddedChart:
sheet.insertImage(chart.getBlob(),6,1);

That fails saying

[Service error: Spreadsheets (line xx, file "")]

Weird enough, I tried to work around it and if I insert the generated chart into the sheet and then try to create the image from the chart, it actually works:
   var temp = ss.insertSheet();
   temp.insertChart(chart);
   var charts = temp.getCharts();
   sheet.insertImage(charts[0].getBlob(),6,1);

I'm extremely confused, I have no idea what could be the problem.
The thing is I have multiple spreadsheets with multiple scripts running some variation of this same code and they are all failing with the same error.
So changing every last one of them to use a temp sheet is a lot of work.
I've created issue 5549 in the issue tracker but nobody has replied
so I don't know what to do.
Is there something I'm missing?
Can anybody figure this out?

A: This is due to a bug in Spreadsheets -- it's being fixed now. If you avoid attempting to create Blobs from charts, you'll avoid the issue for the time being.


text:
Q: Waiting until location is on after turning it on through location services alert I am having a problem where if my phone's location services is turned off, I want to set an alert to open the location services settings and turn it on there. This works fine but the issue is when I navigate back to my application after turning it on. It seems like when I click back, the onResume of my activity is called but the location is still not set correctly there until onResume is completed. Here is my code:
Comments.java:
@Override
public void onResume() {
    super.onResume();
    locationManager = (LocationManager) getContext().getSystemService(Context.LOCATION_SERVICE);
    Location location = LocationService.getLastLocation();
    if(location == null) {
        if(getLastKnownLocation() == null) {
            if(checkLocationEnabled()); {
                location = getLastKnownLocation();
            }
        }
    }

    if(location != null) {
        progressOverlay = fragmentView.findViewById(R.id.progress_overlay);
        AndroidUtils.animateView(progressOverlay, View.VISIBLE, 0.9f, 200);
        //Within this function call, the progress overlay is set to View.GONE.
        databaseQuery.getPublicPosts(location, progressOverlay, fragmentView, getContext());
    } else {
        //We need to handle an error saying that location is not enabled for this device and exit them out of the app
    }
}

private Location getLastKnownLocation() {
    locationManager = (LocationManager) getContext().getSystemService(Context.LOCATION_SERVICE);
    List<String> providers = locationManager.getProviders(true);
    Location bestLocation = null;
    for (String provider : providers) {
        if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {

            return null;
        } else {
            Location l = locationManager.getLastKnownLocation(provider);
            if (bestLocation == null || l.getAccuracy() < bestLocation.getAccuracy()) {
                // Found best last known location: %s", l);
                bestLocation = l;
            }
        }
    }

    return bestLocation;
}

public boolean checkLocationEnabled() {
    try {
        gps_enabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
    } catch(Exception ex) {
    }
    try {
        network_enabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
    } catch(Exception ex) {

    }
    if(!gps_enabled && !network_enabled) {
        // notify user
        AlertDialog.Builder dialog = new AlertDialog.Builder(getContext());
        dialog.setMessage(getContext().getResources().getString(R.string.gpsNetworkNotEnabled));
        dialog.setPositiveButton(getContext().getResources().getString(R.string.openLocationSettings), new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface paramDialogInterface, int paramInt) {
                Intent myIntent = new Intent( Settings.ACTION_LOCATION_SOURCE_SETTINGS);
                getContext().startActivity(myIntent);
                //get gps
            }
        });
        dialog.setNegativeButton(getContext().getString(R.string.cancel), new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface paramDialogInterface, int paramInt) {

            }
        });
        dialog.show();
    }
    return gps_enabled || network_enabled;
}

What I do is when the phone location services is off, I set up an alert that takes you to the location services screen. When the user turns on the location services screen, if he or she clicks "back" on his or her phone, they should be taken back to the initial screen that showed that their location services was off alert. However, when navigating back to that screen, my progressOverlay variable is still visible because the progressOverlay is set to View.GONE when the databaseQuery.getPublicPosts call goes through. That doesn't seem to happen because the if(location != null) statement is probably false right when we navigate back to the screen, but is probably set to true after the phone waits a few seconds and fully obtains the phone's location. It's interesting because if I put a debugger anywhere in that code, the location services will be set correctly and my progressOverlay will go away because the location gets set while I am debugging the code. Is there any way I can "wait" or continue to show the loading screen until the location services is fully on before calling databaseQuery.getPublicPosts? Any help would be appreciated.

A: First you have an unwanted semi-colon in if(checkLocationEnabled()); which acts as an empty statement causing the second call to getLastKnownLocation() to always execute (this will most probably not affect the problem).
The LocationManager class has a constant KEY_STATUS_CHANGED that is the key of a bundle extra that is passed when a status change is broadcast. See the documentation related to the constant. To trigger this change you need to call [LocationManager.requestLocationUpdates](https://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(long, float, android.location.Criteria, android.app.PendingIntent)) so that the location manager receives such a status update.
From the documentation of this method, you can either use a BroadcastReceiver to receive the update by filtering on the above constant. Here is a related post that does this. Or you can use another overloaded version of the request updates method that takes a LocationListener which has an onStatusChanged callback.
A similar update exists when a location provider is enabled, with the KEY_PROVIDER_ENABLED. You can try listening for both updates if the status update didn't work.
Note that when requesting location updates for providers, in order to include updates for all providers including disabled ones, you should retrieve them using LocationManager.getProviders(false).
Once you receive the appropriate update events, you can call removeUpdates to remove the update requests.

A: hi why trying to use getLastKnownLocation.It return your previous latitude and longitude and it might take some time to update lastknown location.
Most probably it retrun you null after on your location.
I'm just referring you google Fused api for location any kind of updation or current.Its very accurate.
How you can fused api in your project.See i'll give you small example.
Step 1. Make this class GoogleLocationService.java
public class GoogleLocationService {
private GoogleServicesCallbacks callbacks = new GoogleServicesCallbacks();
LocationUpdateListener locationUpdateListener;
Context activity;
protected GoogleApiClient mGoogleApiClient;
protected LocationRequest mLocationRequest;

public static final long UPDATE_INTERVAL_IN_MILLISECONDS = 30000;

public GoogleLocationService(Context activity, LocationUpdateListener locationUpdateListener) {
    this.locationUpdateListener = locationUpdateListener;
    this.activity = activity;
    buildGoogleApiClient();
}

protected synchronized void buildGoogleApiClient() {
    //Log.i(TAG, "Building GoogleApiClient");
    mGoogleApiClient = new GoogleApiClient.Builder(activity)
            .addConnectionCallbacks(callbacks)
            .addOnConnectionFailedListener(callbacks)
            .addApi(LocationServices.API)
            .build();
    createLocationRequest();
    mGoogleApiClient.connect();
}

protected void createLocationRequest() {
    mLocationRequest = new LocationRequest();
    mLocationRequest.setInterval(UPDATE_INTERVAL_IN_MILLISECONDS);
    mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);

}

private class GoogleServicesCallbacks implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {

    @Override
    public void onConnected(Bundle bundle) {
        startLocationUpdates();
    }

    @Override
    public void onConnectionSuspended(int i) {
        mGoogleApiClient.connect();
    }

    @Override
    public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {

        if (connectionResult.getErrorCode() == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED) {
            Toast.makeText(activity, "Google play service not updated", Toast.LENGTH_LONG).show();

        }
        locationUpdateListener.cannotReceiveLocationUpdates();
    }

    @Override
    public void onLocationChanged(Location location) {
        if (location.hasAccuracy()) {
            if (location.getAccuracy() < 30) {
                locationUpdateListener.updateLocation(location);
            }
        }
    }
}

private static boolean locationEnabled(Context context) {
    boolean gps_enabled = false;
    LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
    try {
        gps_enabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return gps_enabled;
}

private boolean servicesConnected(Context context) {
    return isPackageInstalled(GooglePlayServicesUtil.GOOGLE_PLAY_STORE_PACKAGE, context);
}

private boolean isPackageInstalled(String packagename, Context context) {
    PackageManager pm = context.getPackageManager();
    try {
        pm.getPackageInfo(packagename, PackageManager.GET_ACTIVITIES);
        return true;
    } catch (PackageManager.NameNotFoundException e) {
        e.printStackTrace();
        return false;
    }
}

public void startUpdates() {
    /*
     * Connect the client. Don't re-start any requests here; instead, wait
     * for onResume()
     */
    if (servicesConnected(activity)) {
        if (locationEnabled(activity)) {
            locationUpdateListener.canReceiveLocationUpdates();
            startLocationUpdates();
        } else {
            locationUpdateListener.cannotReceiveLocationUpdates();
            Toast.makeText(activity, "Unable to get your location.Please turn on your device Gps", Toast.LENGTH_LONG).show();
        }
    } else {
        locationUpdateListener.cannotReceiveLocationUpdates();
        Toast.makeText(activity, "Google play service not available", Toast.LENGTH_LONG).show();
    }
}

//stop location updates
public void stopUpdates() {
    stopLocationUpdates();
}

//start location updates
private void startLocationUpdates() {

    if (checkSelfPermission(activity, ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && checkSelfPermission(activity, ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
        return;
    }
    if (mGoogleApiClient.isConnected()) {
        LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, callbacks);
    }
}

public void stopLocationUpdates() {
    if (mGoogleApiClient.isConnected()) {
        LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, callbacks);
    }
}

public void startGoogleApi() {
    mGoogleApiClient.connect();
}

public void closeGoogleApi() {
    mGoogleApiClient.disconnect();
}

 }

Step2. Make this interface
LocationUpdateListener.java
 public interface LocationUpdateListener {

/**
 * Called immediately the service starts if the service can obtain location
 */
void canReceiveLocationUpdates();

/**
 * Called immediately the service tries to start if it cannot obtain location - eg the user has disabled wireless and
 */
void cannotReceiveLocationUpdates();

/**
 * Called whenever the location has changed (at least non-trivially)
 * @param location
 */
void updateLocation(Location location);

/**
 * Called when GoogleLocationServices detects that the device has moved to a new location.
 * @param localityName The name of the locality (somewhere below street but above area).
 */
void updateLocationName(String localityName, Location location);
}

Step 3. Use this piece of code where you want to get location
public class MainActivity extends ActionBarActivity {

private GoogleLocationService googleLocationService;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    googleLocationService = new GoogleLocationService(context, new LocationUpdateListener() {
    @Override
    public void canReceiveLocationUpdates() {
    }

    @Override
    public void cannotReceiveLocationUpdates() {
    }

    //update location to our servers for tracking purpose
    @Override
    public void updateLocation(Location location) {
        if (location != null ) {
            Timber.e("updated location %1$s %2$s", location.getLatitude(), location.getLongitude());

        }
    }

    @Override
    public void updateLocationName(String localityName, Location location) {

        googleLocationService.stopLocationUpdates();
    }
});
googleLocationService.startUpdates();

}

@Override
public void onDestroy() {
    super.onDestroy();
if (googleLocationService != null) {
    googleLocationService.stopLocationUpdates();
}

}
}

Updated answer
how to send and receive lat lng through broadcast
call this onlocationchanged
Intent sendBroadIntentPND = new Intent("COORD_BROADCAST_FILTER");
                    sendBroadIntentPND.putExtra("LOC_LAT", location.getLatitude());
sendBroadIntentPND.putExtra("LOC_LON", location.getLongitude());
getApplicationContext().sendBroadcast(sendBroadIntentPND);

then where you want to receive the location call this way
// declear global variable
private final String COORD_BROADCAST_FILTER = "COORD_BROADCAST_FILTER";
private Location newLocation;

private BroadcastReceiver coordinateReceiver = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
try {
            newLocation.setLatitude(intent.getDoubleExtra("LOC_LAT", 0.0));
            newLocation.setLongitude(intent.getDoubleExtra("LOC_LON", 0.0));
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

 };

Register you receiver oncreate,
 getActivity().registerReceiver(coordinateReceiver, new IntentFilter(COORD_BROADCAST_FILTER));

unregister your receiver ondestroy
 getActivity().unregisterReceiver(coordinateReceiver);

Thanks hope this help you.

A: Please take note that

The Google Play services location APIs are preferred over the Android
  framework location APIs (android.location) as a way of adding location
  awareness to your app. If you are currently using the Android
  framework location APIs, you are strongly encouraged to switch to the
  Google Play services location APIs as soon as possible.


text:
Q: WPF TextBox Border Style Trigger IsFocused only works if has focus but not keyboard focus I would like a nice little orange border around my Textbox whilst the user is typing in it (Has Focus).
I defined styles for the tiggers I think I need, but there is a strange behavior.
When the cursor is in the TextBox and the WPF app has focus, it has a blue border.
But while the cursor is focused and I click outside of the app (like in visual studio) it becomes orange.
I've tried overriding many triggers but to no avail.
This is what happens when I focus on the textbox but am focused on another app:

This is the textbox w/focus in the app:

And here is the code:
CTRL Xaml:
   <TextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
                                         Style="{StaticResource RegistrationTextbox}"
                                         IsReadOnly="{Binding Path=IsFirstNameReadOnly}" Text="{Binding FirstName}"  BorderThickness="0.99">
                                        <b:Interaction.Triggers>
                                            <b:EventTrigger EventName="GotFocus">
                                                <b:InvokeCommandAction Command="{Binding GotFocusFirstNameCommand}" />
                                            </b:EventTrigger>
                                        </b:Interaction.Triggers>
                                    </TextBox>

Styles:
  <Style x:Key="RegistrationTextbox" TargetType="{x:Type TextBox}">
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>

    <Style.Triggers>
        <Trigger Property="IsReadOnly" Value="true">
            <Setter Property="Background" Value="#f2f2f2"/>
            <Setter Property="BorderBrush" Value="#f2f2f2"/>
            <Setter Property="BorderThickness" Value="2"/>
        </Trigger>
        <Trigger Property="IsKeyboardFocused" Value="true">
            <Setter Property="BorderBrush" Value="Red"/>
            <Setter Property="BorderThickness" Value="2"/>
        </Trigger>
        <Trigger Property="IsFocused"  Value="True">
            <Setter Property="BorderBrush" Value="#FAA634"/>
            <Setter Property="BorderThickness" Value="2"/>
        </Trigger>
        <Trigger Property="IsMouseOver" Value="True">
            <Setter Property="BorderBrush" Value="#F8B963"/>
            <Setter Property="BorderThickness" Value="2"/>
        </Trigger>
    </Style.Triggers>
</Style>

A: Take a look at default TextBox style here: https://msdn.microsoft.com/en-us/library/cc645061%28v=vs.95%29.aspx
You will notice that in ControlTemplate there is this block:
     <Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1" Opacity="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
     <Grid>
           <Border x:Name="ReadOnlyVisualElement" Opacity="0" Background="#5EC9C9C9"/>
           <Border x:Name="MouseOverBorder" BorderThickness="1" BorderBrush="Transparent">
               <ScrollViewer x:Name="ContentElement" Padding="{TemplateBinding Padding}" BorderThickness="0" IsTabStop="False"/>
           </Border>
     </Grid>
     </Border>
     <Border x:Name="DisabledVisualElement" Background="#A5F7F7F7" BorderBrush="#A5F7F7F7" BorderThickness="{TemplateBinding BorderThickness}" Opacity="0" IsHitTestVisible="False"/>
     <Border x:Name="FocusVisualElement" BorderBrush="#FF6DBDD1" BorderThickness="{TemplateBinding BorderThickness}" Margin="1" Opacity="0" IsHitTestVisible="False"/>

You see here that only one Border's BorderBrush is bound to BorderBrush property of TextBox. When control goes to focused state - another border (FocusVisualElement) becomes visible and because it's positined later in visual tree - it overlays regular Border. Same is true when control goes to disabled or readonly state. So your style setters basically have no effect.
Now when your are switching to another app - TextBox does not consider it focused any more (note that it does not just use IsFocused property to determine that). So it hides FocusVisualElement and here you see border color applied by your trigger.
Long story short - control developers are not forced to bind to single BorderBrush property for every possible state. They could have provided something like FocusedBorderBrush property, but they did not - so you have to overwrite ControlTemplate of TextBox (you can use default template as provided by link above and overwrite some colors).


text:
Q: Consolidating results of cypher query when two result nodes are the same Take for example the following scenario:
A hospital node is related to many doctor nodes. Doctor nodes are related to other doctors representing when they refer a patient to another doctor. These referrals can be to a doctor at a different hospital. The relationship between doctors has a property called count that indicates how many times that doctor has referred any of their patients to that second doctor.
What I'm trying to do is take these referral relationships and look at it from the hospital level. My query currently looks like this:
START hospital1 = Node:Hospitals("*:*")
MATCH (hospital1)-[:CHILD_DOCTOR]->(doctor1)-[referral:REFERRED]-(doctor2)<-[:CHILD_DOCTOR]-(hospital2)
WHERE hospital1 <> hospital2
RETURN DISTINCT hospital1, hospital2, referral.count

It sounds complicated but the query is pretty straight forward. Here's the only problem. Let's say two doctors from Hospital A refer a patient to two doctors from Hospital B, I'll end up with two records where hospital1 = Hospital A, and hospital2 = Hospital B. I want to combine these results together and add the referral.count properties together. Is there any way to do this with Cypher?

A: Not sure if I understood your domain correctly. My understanding is that you have a lot of paths (aka referrals) between two arbitrary hospitals and want to sum them up. In this case use
START hospital1 = Node:Hospitals("*:*")
MATCH (hospital1)-[:CHILD_DOCTOR]->(doctor1)-[referral:REFERRED]-(doctor2)<-[:CHILD_DOCTOR]-(hospital2)
WHERE hospital1 <> hospital2
RETURN hospital1, hospital2, sum(referral.count)

N.B. didn't try the query myself. For further discussion please create a sample dataset on http://console.neo4j.org.


text:
Q: use router angular 2 to show wordpress I would like to show http://localhost:4200/blog WordPress installation and plugin.
But when I navigate to this URL, angular 2 needs to assign component for that.
How can I do this?


text:
Q: How to create AWS IAM role with ServiceAccount and attach to Kubernetes DaemonSet I found that documentation that we can add AWS IAM role to kubernetes serviceaccount and attach to Pods. And what I'm supposed to do is I want to attach that service account to DaemonSet instead of Pods level permission. But I configured same as that documentation and attached to DaemonSet but I've encountered following error message after that:
Aws::STS::Errors::AccessDenied error="Not authorized to perform sts:AssumeRoleWithWebIdentity
Is that meant those type of serviceaccount with IAM role cannot be attached to DaemonSet?

A:
Is that meant those type of serviceaccount with IAM role cannot be attached to DaemonSet?

No,there shouldn't be any issues with that. I checked here and there is an example with service account in a deployment.

As @PPShein mentioned in comments the issue occurs because he forgot to add the openid_url.
Please refer to this and this documentation.


text:
Q: Access an Object from the FX Controller Class i have a FXML project and therefore a Controller class. I created an instance of a class called "Control" inside the initialize method of my Controller class.
The Problem now is: I created a second FXML Controller for a Preferences Menu and i to need access the Control object created in the main Controller class.
How do i do that?
I cannot use a simple getter, i get an error that this cannot be derefferenced from a static context.
Edit:
For the Code:
This is the main Gui Controller:
private Control control;
.
.
.
@Override
public void initialize(URL url, ResourceBundle rb) {
    //Create a Controller
    control = new Control(0);
       .
       .
       .
}

The second FXML is loaded within this handler:
 @FXML
public void handleSetPreferences(ActionEvent ae) throws Exception {
    Group root = new Group();
    Stage stage = new Stage();

    BorderPane frame = FXMLLoader.load(getClass().getResource("guipreferences.fxml"));
    root.getChildren().add(frame);
    Scene scene = new Scene(root);

    stage.initStyle(StageStyle.UNDECORATED);//disables the OS frame
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.setScene(scene);
    stage.show();
}

I need to access the control object created within the first Controller from the Controller created with the handle above.


text:
Q: undefined is not a function error in AngularJS I am getting the below error is my AngularJs app.
 TypeError: undefined is not a function
    at Scope.$rootScope.shareImageNow (index.controller.js:150)

I am not sure what's the reason after doing some Google research.
controller.js File
app.controller('ViewCtrl', function($rootScope, $state, $scope, $ionicPlatform, $ionicPopup, $ionicLoading, $ionicSlideBoxDelegate, $ionicScrollDelegate, $timeout, Service) {

    var appUrl = "https://play.google.com";

    $rootScope.shareNow = function() {

        var message = "xx";
        var subject = "yy";

        Service.share(message, subject, null, appUrl);

    }

    $rootScope.shareImageNow = function() {

        var imageIndex = 0;

        var imgUrl = $rootScope.itemData[imageIndex]['url'];

        var message = "xx";
        var subject = "yy";

        Service.share(message, subject, imgUrl, appUrl);

    }
});

service.js File:
module.service('Service', function($rootScope, $ionicPlatform, $cordovaSocialSharing) {

    $rootScope.share = function(message,subject,file,link) {

        $ionicPlatform.ready(function() {
            $cordovaSocialSharing
                .share(message, subject,file,link);
        }, false);

    }
}

The error is shown at the below line in controller.js file.
Service.share(message, subject, null, appUrl);

A: You're registering the Service service, but not defining any methods on it.
You're also doing a lot of things with $rootScope, which I'd question why you're doing that.
Anyways, you can define your service as follows, and you will not get the error at Service.share()
module.service('Service', function($ionicPlatform, $cordovaSocialSharing) {

  var share = function(message,subject,file,link) {
      $ionicPlatform.ready(function() {
          $cordovaSocialSharing
              .share(message, subject,file,link);
      }, false);

  };

  return {
      share: share
  }
}


text:
Q: Custrom 404 error, routing error stops the app In ApplicationController I added:
class ApplicationController < ActionController::Base

# This code never reached when routing error occurs
unless Rails.application.config.consider_all_requests_local
  rescue_from ActionController::RoutingError, with: :render_404
  rescue_from ActionController::UnknownController, with: :render_404
  rescue_from ActionController::UnknownAction, with: :render_404
  rescue_from ActiveRecord::RecordNotFound, with: :render_404
end

As I am trying to catch  exceptions for not found pages, I've noticed that when routing error triggered, the code above never reached, as a result, render_404 never called
Rails.application.config.consider_all_requests_local is false, Any idea ?
Here is what I get:
ActionController::RoutingError (No route matches [GET] "/not_there_route"):
  actionpack (3.2.5) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (3.2.5) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.5) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.5) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.5) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.1) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.5) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.1) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.5) lib/action_dispatch/middleware/static.rb:62:in `call'
  railties (3.2.5) lib/rails/engine.rb:479:in `call'
  railties (3.2.5) lib/rails/application.rb:220:in `call'
  railties (3.2.5) lib/rails/railtie/configurable.rb:30:in `method_missing'
  rack (1.4.1) lib/rack/deflater.rb:13:in `call'
  rack (1.4.1) lib/rack/content_length.rb:14:in `call'
  railties (3.2.5) lib/rails/rack/log_tailer.rb:17:in `call'
  thin (1.3.1) lib/thin/connection.rb:80:in `block in pre_process'
  thin (1.3.1) lib/thin/connection.rb:78:in `catch'
  thin (1.3.1) lib/thin/connection.rb:78:in `pre_process'
  thin (1.3.1) lib/thin/connection.rb:53:in `process'
  thin (1.3.1) lib/thin/connection.rb:38:in `receive_data'
  eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
  eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
  thin (1.3.1) lib/thin/backends/base.rb:61:in `start'
  thin (1.3.1) lib/thin/server.rb:159:in `start'
  rack (1.4.1) lib/rack/handler/thin.rb:13:in `run'
  rack (1.4.1) lib/rack/server.rb:265:in `start'
  railties (3.2.5) lib/rails/commands/server.rb:70:in `start'
  railties (3.2.5) lib/rails/commands.rb:55:in `block in <top (required)>'
  railties (3.2.5) lib/rails/commands.rb:50:in `tap'
  railties (3.2.5) lib/rails/commands.rb:50:in `<top (required)>'

A: You should add catch all route, something like this:
match "*path", :to => "application#routing_error"

More detailed here http://www.bdunagan.com/2012/04/27/rescue_from-routingerror-in-rails-3/


text:
Q: Building Hadoop 1.2.1 core jar using ant - Failed I need to make some modifications to the map class and reduce class from Hadoop, so, I have been trying to compile Hadoop 1.2.1 jar files using ant from the source files, but I always get the following error:
Buildfile: build.xml

clover.setup:

clover.info:
 [echo]
 [echo]      Clover not found. Code coverage reports disabled.
 [echo]

clover:

ivy-download:
  [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.1.0   /ivy-2.1.0.jar
  [get] To: /home/user/Downloads/hadoop-1.2.1/ivy/ivy-2.1.0.jar
  [get] Not modified - so not downloaded

ivy-init-dirs:

ivy-probe-antlib:

ivy-init-antlib:

ivy-init:
[ivy:configure] :: Ivy 2.1.0 - 20090925235825 :: http://ant.apache.org/ivy/ ::
[ivy:configure] :: loading settings :: file = /home/user/Downloads/hadoop-1.2.1/ivy/ivysettings.xml

ivy-resolve-common:

ivy-retrieve-common:
[ivy:cachepath] DEPRECATED: 'ivy.conf.file' is deprecated, use 'ivy.settings.file'  instead
[ivy:cachepath] :: loading settings :: file = /home/user/Downloads/hadoop-1.2.1/ivy/ivysettings.xml

init:
[touch] Creating /tmp/null1102494190
[delete] Deleting: /tmp/null1102494190
 [exec] svn: E155007: '/home/user/Downloads/hadoop-1.2.1' is not a working copy
 [exec] svn: E155007: '/home/user/Downloads/hadoop-1.2.1' is not a working copy

record-parser:

compile-rcc-compiler:

compile-core-classes:

compile-hdfs-classes:
[javac] Compiling 2 source files to /home/user/Downloads/hadoop-1.2.1/build/classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6
[javac] 1 warning

compile-mapred-classes:
Trying to override old definition of task jsp-compile

create-native-configure:
 [exec] configure.ac:42: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
 [exec] ../../lib/autoconf/specific.m4:314: AC_GNU_SOURCE is expanded from...
 [exec] configure.ac:42: the top level
 [exec] configure.ac:42: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
 [exec] ../../lib/autoconf/specific.m4:314: AC_GNU_SOURCE is expanded from...
 [exec] configure.ac:42: the top level
 [exec] configure.ac:42: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
 [exec] ../../lib/autoconf/specific.m4:314: AC_GNU_SOURCE is expanded from...
 [exec] configure.ac:42: the top level
 [exec] configure.ac:48: error: possibly undefined macro: AC_PROG_LIBTOOL
 [exec]       If this token and others are legitimate, please use m4_pattern_allow.
 [exec]       See the Autoconf documentation.
 [exec] autoreconf: /usr/bin/autoconf failed with exit status: 1

BUILD FAILED
/home/user/Downloads/hadoop-1.2.1/build.xml:634: exec returned: 1

Does anybody know what could be the problem? or knows how to create the jar files using ant?
Thanks

A: The error was that it was missing a library.
Fixed just by installing libtool.
sudo apt-get install libtool

Now it will build successfully the project.
source: [link] http://desk.stinkpot.org:8080/tricks/index.php/2007/05/fixing-error-undefined-macro-ac_prog_libtool/