text:
Q: Row operations in data.table using `by = .I` Here is a good SO explanation about row operations in data.table
One alternative that came to my mind is to use a unique id for each row and then apply a function using the by argument. Like this:
library(data.table)

dt <- data.table(V0 =LETTERS[c(1,1,2,2,3)],
                 V1=1:5,
                 V2=3:7,
                 V3=5:1)

# create a column with row positions
dt[, rowpos := .I]

# calculate standard deviation by row
dt[ ,  sdd := sd(.SD[, -1, with=FALSE]), by = rowpos ]

Questions:

*

*Is there a good reason not to use this approach? perhaps other more efficient alternatives?

*Why does using by = .I doesn't work the same?
dt[ ,  sdd := sd(.SD[, -1, with=FALSE]), by = .I ]

A: UPDATE:
Since data.table version 1.4.3 or later, by=.I has been implemented to work as expected by OP for row-wise grouping. Note using by=.I will create a new column in the data.table called I that has the row numbers. The row number column can then be kept or deleted according to preference.
The following parts of this answer records an earlier version that pertains to older versions of data.table.  I keep it here for reference in case someone still uses legacy versions.

Note: section (3) of this answer updated in April 2019, due to many changes in data.table over time redering the original version obsolete.  Also, use of the argument with= removed from all instances of data.table, as it has since been deprecated.
1) Well, one reason not to use it, at least for the rowsums example is performance, and creation of an unnecessary column.  Compare to option f2 below, which is almost 4x faster and does not need the rowpos column (Note that the original question used rowSums as the example function, to which this part of the answer responds.  OP edited the question afterwards to use a different function, for which part 3 of this answer is more relevant`):
dt <- data.table(V0 =LETTERS[c(1,1,2,2,3)], V1=1:5, V2=3:7, V3=5:1)
f1 <- function(dt){
  dt[, rowpos := .I]
  dt[ ,  sdd := rowSums(.SD[, 2:4]), by = rowpos ] }
f2 <- function(dt) dt[, sdd := rowSums(.SD), .SDcols= 2:4]

library(microbenchmark)
microbenchmark(f1(dt),f2(dt))
# Unit: milliseconds
#   expr      min       lq     mean   median       uq      max neval cld
# f1(dt) 3.669049 3.732434 4.013946 3.793352 3.972714 5.834608   100   b
# f2(dt) 1.052702 1.085857 1.154132 1.105301 1.138658 2.825464   100  a

2) On your second question, although dt[, sdd := sum(.SD[, 2:4]), by = .I] does not work, dt[, sdd := sum(.SD[, 2:4]), by = 1:NROW(dt)] works perfectly.  Given that according to ?data.table ".I is an integer vector equal to seq_len(nrow(x))", one might expect these to be equivalent. The difference, however, is that .I is for use in j, not in by. NB the value of .I is calculated internally in data.table, so is not available beforehand to be passed in as a parameter value as in by=.I.
It might also be expected that by = .I should just throw an error. But this does not occur, because loading the data.table package creates an object .I in the data.table namespace that is accessible from the global environment, and whose value is NULL.  You can test this by typing .I at the command prompt. (Note, the same applies to .SD, .EACHI, .N, .GRP, and .BY)
.I
# Error: object '.I' not found
library(data.table)
.I
# NULL
data.table::.I
# NULL

The upshot of this is that the behaviour of by = .I is equivalent to by = NULL.
3) Although we have already seen in part 1 that in the case of rowSums, which already loops row-wise efficiently, there are much faster ways than creating the rowpos column.  But what about looping when we don't have a fast row-wise function?
Benchmarking the by = rowpos and by = 1:NROW(dt) versions against a for loop with set() is informative here.  We find that looping over set in a for loop is slower than either of the methods that use data.table's by argument for looping.  However there is neglibible difference in timing between the by loop that creates an additional column and the one that uses seq_len(NROW(dt)).  Absent any performance difference, it seems that f.nrow is probably preferable, but only on the basis of being more concise and not creating an unnecessary column
dt <- data.table(V0 = rep(LETTERS[c(1,1,2,2,3)], 1e3), V1=1:5, V2=3:7, V3=5:1)

f.rowpos <- function() {
  dt[, rowpos := .I]
  dt[,  sdd := sum(.SD[, 2:4]), by = rowpos ]
}

f.nrow <- function() {
  dt[, sdd := sum(.SD[, 2:4]), by = seq_len(NROW(dt)) ]
}

f.forset<- function() {
  for (i in seq_len(NROW(dt))) set(dt, i, 'sdd', sum(dt[i, 2:4]))
}

microbenchmark(f.rowpos(),f.nrow(), f.forset(), times = 5)
# Unit: milliseconds
#       expr       min        lq      mean    median        uq       max neval
# f.rowpos()  559.1115  575.3162  580.2853  578.6865  588.5532  599.7591     5
#   f.nrow()  558.4327  582.4434  584.6893  587.1732  588.6689  606.7282     5
# f.forset() 1172.6560 1178.8399 1298.4842 1255.4375 1292.7393 1592.7486     5

So, in conclusion, even in situations where there is not an optimised function such as rowSums that already operates by row, there are alternatives to using a rowpos column that, although not faster, don't require creation of a redundant column.


text:
Q: Monitor connections in the connection pool on Sun App Server On a Sun (now Oracle) Application Server, how can I monitor connections in the connection pool, on a scheduled frequency?

A: Use the monitor command.
You would use:

--type
connectorpool

and

--interval  The interval in seconds before capturing monitoring
  attributes. If the interval must be
  greater than 0. The monitoring
  attributes are displayed on stdout
  until you type ctrl-c or q. The
  default value is 30.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How do I turn results in ASP.NET Web Forms application into URLs? I'm creating an ASP.NET web form application that searches PDFs for text, if the PDF has that text, it returns the name of the file and the path in a text box. So far everything works but now I'm ready to take that full path and put it inside a link.
So for example, a result would be:
https:\\www.mysite.com\example1.PDF

I want to show a hyper link in the text box that is clickable and simply labeled as:
Example 1

I wonder if I made a mistake in going with ASP.NET Web Forms to do this since it only has a Text Box form control and not a rich text box. The thing is my results are being stored in a string builder so it's not like I just need one static label to be a URL.
Here is what I have:
foreach (var f in files)
            {
                string pdfSearchMatch = ReadPdfFile(f.File, txtBoxSearchString.Text);
                if (pdfSearchMatch != null)
                {

                    string fileNameOnly = Regex.Replace(pdfSearchMatch, @"\\\\my\.test\.site@SSL\\Home\\Sections\\PDFs\\Courses\\.+?\\.+?\\.+?\\", "");
                    myCommand.CommandText = "select cc.pk1 as 'pid', f.file_name as 'xid', f.link_name as 'linkname' from course_contents cc join course_main cm on cc.crsmain_pk1 = cm.pk1 join course_contents_files ccf on cc.pk1 = ccf.course_contents_pk1 join files f on ccf.files_pk1 = f.pk1 where cm.course_id = 'COM-Syllabi' and f.link_name = '"+fileNameOnly+"'";
                    using (SqlDataReader sqlReader = myCommand.ExecuteReader())
                    {
                        while (sqlReader.Read())
                        {
                            string rid = Regex.Replace(sqlReader["xid"].ToString(), "/xid", "rid");
                            string pdfHyperlink = @"https://my.test.site/Home/pid-"+sqlReader["pid"].ToString()+"-dt-content-"+rid+sqlReader["xid"].ToString();
                            sb.AppendLine(pdfHyperlink);
                        }
                    }
                }
            }
            myConnection.Close();
            txtBoxResults.Text = sb.ToString();

I want the results that get assigned to txtBoxResults.Text to be clickable links.
Thanks.

A: This is the smallest and quickest fix for your code , but it's inappropriate
whereever you have your textbox , just create an
<asp:Literal ID="Literal1" runat="server" ></asp:Literal>

and the exact same line
txtBoxResults.Text = sb.ToString();

replace with
Literal1.Text = sb.ToString();

See how it shows , haven't tested . Still would suggest to resolve the SQL Injection and extra load on the server connection keeping it open.
UPDATE:-
Add the hyperlink part try replace with this the same line , ay face issues with the escape
string pdfHyperlink = @"Test";


text:
Q: Need help isolating results from xhr request When I run the code below, it's giving me a lot of information I don't want.  I only want to capture the data circled starting with 4. Does anyone know how to isolate the data in the request to get rid of everything but what is circled?  Also, if anyone knows how to bring the results to a csv or xlsx file, that would be even better.

Working code:
   import requests

url = "https://www.stockrover.com/stock_infos/grid?_dc=1644769629231"

data = {
"ticker": 4,
"rank": "5",
}
payload = "state=%7B%22sortInfo%22%3A%7B%7D%2C%22columns%22%3A%5B77%2C32%2C498%2C500%2C31%2C27%2C499%2C30%2C578%2C28%2C29%2C544%2C181%2C185%2C186%5D%2C%22view%22%3A281%2C%22priorPrimaryColumn%22%3A170%2C%22filterData%22%3A%5B%5D%2C%22name%22%3A%22New%201%22%2C%22cType%22%3A%22Screener%22%2C%22cNode%22%3A%22s_39%22%2C%22cIsFolder%22%3Afalse%2C%22gridSelection%22%3A%22BTU%22%2C%22lastActive%22%3A1396898415%2C%22primaryColumn%22%3A76%2C%22folderDisabledParams%22%3A%7B%22filterData%22%3A%5B%5D%7D%2C%22mainGridDateRange%22%3A%22ytd%22%2C%22groupState%22%3Anull%2C%22moversGridDateRange%22%3A%221_day%22%2C%22peersGridDateRange%22%3A%221_day%22%2C%22lastGridSelections%22%3A%5B%22BTU%22%5D%2C%22lastQuantNode%22%3A%5B%5D%2C%22includeQuotesInTable%22%3Afalse%2C%22includeAllQuotesLastValue%22%3Afalse%2C%22markets%22%3A%7B%22panel%22%3A%22summary%22%7D%2C%22researchPanel%22%3A%22tablePanel%22%2C%22recentSearchTickers%22%3A%5B%22SPY%22%2C%22AMZN%22%2C%22AAPL%22%2C%22s_32%22%2C%22%5ENDX%22%2C%22AXP%22%2C%22XOM%22%2C%22AFL%22%2C%22%5EDJX%22%2C%22AIT%22%2C%22ADVC%22%5D%2C%22quotesBoxTickers%22%3A%5B%22AMZN%22%2C%22AAPL%22%2C%22SPY%22%5D%2C%22checkedQuotesBoxTickers%22%3A%5B%22AMZN%22%2C%22AAPL%22%2C%22SPY%22%5D%2C%22dashboard%22%3A%7B%22buttonRef%22%3A%22272%22%7D%2C%22tickerSelectedFeeds%22%3A%5B%22Benzinga%20News%22%2C%22Yahoo%20News%22%5D%2C%22marketSelectedFeeds%22%3A%5B%22Google%20News%22%2C%22Stock%20Market%20News%20-%20Investing.com%22%5D%2C%22bondsSelectedFeeds%22%3A%5B%22Bonds%20Strategy%20-%20Investing.com%22%5D%2C%22commoditiesSelectedFeeds%22%3A%5B%22Commodities%20%26%20Futures%20News%20-%20Investing.com%22%2C%22Commodities%20Fundamental%20Analysis%20-%20Investing.com%22%2C%22Commodities%20Strategy%20Analysis%20-%20Investing.com%22%5D%2C%22stocksSelectedFeeds%22%3A%5B%22CNNMoney%20News%22%2C%22Google%20News%22%2C%22Seeking%20Alpha%20Top%20Stories%22%5D%2C%22etfsSelectedFeeds%22%3A%5B%22Economy%20News%20-%20Investing.com%22%2C%22ETF%20Analysis%20-%20Investing.com%22%2C%22Investing%20Ideas%20-%20Investing.com%22%5D%2C%22topPanel%22%3A%22researchPanel%22%2C%22maxRecordsNode%22%3Afalse%2C%22version%22%3A7%2C%22lastGridSelectionsRaw%22%3A%5B%22BTU%22%5D%2C%22lastSelectionScreeners%22%3A%22s_39%22%2C%22quotesDisabled%22%3Atrue%2C%22lastSelectionPortfolios%22%3A%22p_2%22%2C%22comparisonPanels%22%3A%7B%22Portfolio%22%3A%22p_2%22%2C%22Index%22%3A%22%5EDJX%22%2C%22Watchlist%22%3A%22Watchlists%22%2C%22Screener%22%3A%22s_39%22%7D%2C%22lastSelectionWatchlists%22%3A%22w_26%22%2C%22indicesSelectedFeeds%22%3A%5B%22Google%20News%22%2C%22Yahoo%20News%22%5D%2C%22newsActive%22%3A%22tickerNews%22%2C%22recentSearchMetrics%22%3A%5B%22Price%22%2C%22EPS%22%2C%22Sales%22%5D%2C%22editPanel%22%3A%22positionsPanel%22%2C%22newsType%22%3A%22marketNews%22%2C%22tableColumns%22%3A%5B%22ticker%22%2C%22rank%22%2C%22score_rank%22%2C%22filter_score%22%2C%22company%22%2C%22cash%22%2C%22currentassets%22%2C%22netppe%22%2C%22intangibles%22%2C%22totalassets%22%2C%22currentliabilities%22%2C%22longtermdebt%22%2C%22totaldebt%22%2C%22totalliabilities%22%2C%22equity%22%2C%22tangiblebookvalue%22%2C%22cash_short_term_p%22%2C%22net_ppe_p%22%2C%22intangibles_p%22%5D%2C%22last_save%22%3A1644769379%2C%22panels%22%3A%7B%22collapsed%22%3A%7B%22chp%22%3Atrue%2C%22ip%22%3Atrue%2C%22mp%22%3Afalse%2C%22qp%22%3Afalse%2C%22conp%22%3Atrue%2C%22fsp%22%3Afalse%7D%2C%22viewportWidth%22%3A%221920%22%2C%22viewportHeight%22%3A%221069%22%2C%22chartPanelHeight%22%3A483%2C%22controlPanelWidth%22%3A296%2C%22insightPanelWidth%22%3A%22485%22%2C%22quoteBoxHeight%22%3A200%2C%22navigationPanelWidth%22%3A277%7D%7D&updateMarket=true&page=1&start=0&limit=250"
headers = {
  'authority': 'www.stockrover.com',
  'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"',
  'x-csrf-token': '7yR4pfI0kAArtjJak535+NJrpB0L212PAbXCg0kbyE4SyjFaQ73sMHJLiqAkPb5nGzfC8KvAa3kTADLAEQXyOQ==',
  'sec-ch-ua-mobile': '?0',
  'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36',
  'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
  'accept': 'application/json',
  'x-requested-with': 'XMLHttpRequest',
  'sec-ch-ua-platform': '"Windows"',
  'origin': 'https://www.stockrover.com',
  'sec-fetch-site': 'same-origin',
  'sec-fetch-mode': 'cors',
  'sec-fetch-dest': 'empty',
  'referer': 'https://www.stockrover.com/research/table/281/s_39/BTU',
  'accept-language': 'en-US,en;q=0.9',
  'cookie': 'remember_me_pref=0; user_name=test11964; plan=3; premiumBraintreeKey=MIIBCgKCAQEAzM4LJfrNnBOgRFB1dDJkmqTFCWT2Y%2BksOydD8xDH4R033WUzxbffMZb%2B3dqEyQvOVjLcwFIHByDc4Xwej7enas2E%2FVRyh7Cvyadn7M5zQeRyLcI9Ys5KCozMwxJPc0x76FlXPwiAo1Qlz3RcLb9wGHBag2R51FuTie%2BhVDCgzWajqDCREzRhi%2Fqlt3D%2FxXNo%2FiwJlpOUr%2Fx1QnkkILxgKlq1dD7KJ767O5ojYKXsO%2BV2Bfu7sSD3djsOxQJ1%2FRbaDm2E96EDkWhhOeOpPndQ6IuSl4NmnJg%2Fcq6f8csW8M3Ys%2BMZPFkdxPC4%2FfRM1XC9o76PjpVNBIO%2ByJEELKZedwIDAQAB; lr=1644769628; _Ruby2_session=Q1drcmlhazYvUFZLd0NydnRXUGpoUzArZDlxYWRCcW9sRUx5VDBydWVWRHdGWDZlMnlESURzbldwbFV1L0drbUlKaWt5MXRtaS9iR0ZYZEpPVHQ1N25qRnR1d3FrY0tzQW1qQm9CdTZ3MSs0d2c3MlpuMjRiQWhCOHI1cGNWekZ4cUdJd0ZFcGtpeng3MFlqZjFDUW9RYmpFMU9DeGdGMVZKR1EwMjVhSE9yVHl4VXFtQm9aYVBtNHF5d0pwMjJ1aVlNMUVRUzdnVFZWZ1AxQkY5Q0p6a2RKay9QL05tOWk4cHZiSERtaGRxeTlxTWZnV3Q0cjdwR3RndUtmeUp3QThhMnJaV2dGZjlPUUtjcGRidDhiajRxK2g0RUZTMWNZUDBaeGNCcUVxSDJ1QnZVRlRkWk9tUExJNWN3TDN5T1BQcmhVVGsycStVTzJRaUwvSkk2TnNVZldTOGU3Tm5wQ3RUMy9nazFqbzdrUWtvYzRwQWRpV3dnTVB3YzhodFV2U0FRR3VKdllMY01NZmdOdGtmOEJ4UT09LS1nTXBrYldhQ0pEeWJ3ak9qQjcrTGV3PT0%3D--1439f36a7f9362aee4b5b666747a2d63d72e81bd'
}

response = requests.request("POST", url, headers=headers, data=payload)
print(response.json())

A: The data structure in this case is rather unusual but this looks like it might work for you:
import requests

url = "https://www.stockrover.com/stock_infos/grid?_dc=1644769629231"

payload = "state=%7B%22sortInfo%22%3A%7B%7D%2C%22columns%22%3A%5B77%2C32%2C498%2C500%2C31%2C27%2C499%2C30%2C578%2C28%2C29%2C544%2C181%2C185%2C186%5D%2C%22view%22%3A281%2C%22priorPrimaryColumn%22%3A170%2C%22filterData%22%3A%5B%5D%2C%22name%22%3A%22New%201%22%2C%22cType%22%3A%22Screener%22%2C%22cNode%22%3A%22s_39%22%2C%22cIsFolder%22%3Afalse%2C%22gridSelection%22%3A%22BTU%22%2C%22lastActive%22%3A1396898415%2C%22primaryColumn%22%3A76%2C%22folderDisabledParams%22%3A%7B%22filterData%22%3A%5B%5D%7D%2C%22mainGridDateRange%22%3A%22ytd%22%2C%22groupState%22%3Anull%2C%22moversGridDateRange%22%3A%221_day%22%2C%22peersGridDateRange%22%3A%221_day%22%2C%22lastGridSelections%22%3A%5B%22BTU%22%5D%2C%22lastQuantNode%22%3A%5B%5D%2C%22includeQuotesInTable%22%3Afalse%2C%22includeAllQuotesLastValue%22%3Afalse%2C%22markets%22%3A%7B%22panel%22%3A%22summary%22%7D%2C%22researchPanel%22%3A%22tablePanel%22%2C%22recentSearchTickers%22%3A%5B%22SPY%22%2C%22AMZN%22%2C%22AAPL%22%2C%22s_32%22%2C%22%5ENDX%22%2C%22AXP%22%2C%22XOM%22%2C%22AFL%22%2C%22%5EDJX%22%2C%22AIT%22%2C%22ADVC%22%5D%2C%22quotesBoxTickers%22%3A%5B%22AMZN%22%2C%22AAPL%22%2C%22SPY%22%5D%2C%22checkedQuotesBoxTickers%22%3A%5B%22AMZN%22%2C%22AAPL%22%2C%22SPY%22%5D%2C%22dashboard%22%3A%7B%22buttonRef%22%3A%22272%22%7D%2C%22tickerSelectedFeeds%22%3A%5B%22Benzinga%20News%22%2C%22Yahoo%20News%22%5D%2C%22marketSelectedFeeds%22%3A%5B%22Google%20News%22%2C%22Stock%20Market%20News%20-%20Investing.com%22%5D%2C%22bondsSelectedFeeds%22%3A%5B%22Bonds%20Strategy%20-%20Investing.com%22%5D%2C%22commoditiesSelectedFeeds%22%3A%5B%22Commodities%20%26%20Futures%20News%20-%20Investing.com%22%2C%22Commodities%20Fundamental%20Analysis%20-%20Investing.com%22%2C%22Commodities%20Strategy%20Analysis%20-%20Investing.com%22%5D%2C%22stocksSelectedFeeds%22%3A%5B%22CNNMoney%20News%22%2C%22Google%20News%22%2C%22Seeking%20Alpha%20Top%20Stories%22%5D%2C%22etfsSelectedFeeds%22%3A%5B%22Economy%20News%20-%20Investing.com%22%2C%22ETF%20Analysis%20-%20Investing.com%22%2C%22Investing%20Ideas%20-%20Investing.com%22%5D%2C%22topPanel%22%3A%22researchPanel%22%2C%22maxRecordsNode%22%3Afalse%2C%22version%22%3A7%2C%22lastGridSelectionsRaw%22%3A%5B%22BTU%22%5D%2C%22lastSelectionScreeners%22%3A%22s_39%22%2C%22quotesDisabled%22%3Atrue%2C%22lastSelectionPortfolios%22%3A%22p_2%22%2C%22comparisonPanels%22%3A%7B%22Portfolio%22%3A%22p_2%22%2C%22Index%22%3A%22%5EDJX%22%2C%22Watchlist%22%3A%22Watchlists%22%2C%22Screener%22%3A%22s_39%22%7D%2C%22lastSelectionWatchlists%22%3A%22w_26%22%2C%22indicesSelectedFeeds%22%3A%5B%22Google%20News%22%2C%22Yahoo%20News%22%5D%2C%22newsActive%22%3A%22tickerNews%22%2C%22recentSearchMetrics%22%3A%5B%22Price%22%2C%22EPS%22%2C%22Sales%22%5D%2C%22editPanel%22%3A%22positionsPanel%22%2C%22newsType%22%3A%22marketNews%22%2C%22tableColumns%22%3A%5B%22ticker%22%2C%22rank%22%2C%22score_rank%22%2C%22filter_score%22%2C%22company%22%2C%22cash%22%2C%22currentassets%22%2C%22netppe%22%2C%22intangibles%22%2C%22totalassets%22%2C%22currentliabilities%22%2C%22longtermdebt%22%2C%22totaldebt%22%2C%22totalliabilities%22%2C%22equity%22%2C%22tangiblebookvalue%22%2C%22cash_short_term_p%22%2C%22net_ppe_p%22%2C%22intangibles_p%22%5D%2C%22last_save%22%3A1644769379%2C%22panels%22%3A%7B%22collapsed%22%3A%7B%22chp%22%3Atrue%2C%22ip%22%3Atrue%2C%22mp%22%3Afalse%2C%22qp%22%3Afalse%2C%22conp%22%3Atrue%2C%22fsp%22%3Afalse%7D%2C%22viewportWidth%22%3A%221920%22%2C%22viewportHeight%22%3A%221069%22%2C%22chartPanelHeight%22%3A483%2C%22controlPanelWidth%22%3A296%2C%22insightPanelWidth%22%3A%22485%22%2C%22quoteBoxHeight%22%3A200%2C%22navigationPanelWidth%22%3A277%7D%7D&updateMarket=true&page=1&start=0&limit=250"
headers = {
    'authority': 'www.stockrover.com',
    'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"',
    'x-csrf-token': '7yR4pfI0kAArtjJak535+NJrpB0L212PAbXCg0kbyE4SyjFaQ73sMHJLiqAkPb5nGzfC8KvAa3kTADLAEQXyOQ==',
    'sec-ch-ua-mobile': '?0',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36',
    'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'accept': 'application/json',
    'x-requested-with': 'XMLHttpRequest',
    'sec-ch-ua-platform': '"Windows"',
    'origin': 'https://www.stockrover.com',
    'sec-fetch-site': 'same-origin',
    'sec-fetch-mode': 'cors',
    'sec-fetch-dest': 'empty',
    'referer': 'https://www.stockrover.com/research/table/281/s_39/BTU',
    'accept-language': 'en-US,en;q=0.9',
    'cookie': 'remember_me_pref=0; user_name=test11964; plan=3; premiumBraintreeKey=MIIBCgKCAQEAzM4LJfrNnBOgRFB1dDJkmqTFCWT2Y%2BksOydD8xDH4R033WUzxbffMZb%2B3dqEyQvOVjLcwFIHByDc4Xwej7enas2E%2FVRyh7Cvyadn7M5zQeRyLcI9Ys5KCozMwxJPc0x76FlXPwiAo1Qlz3RcLb9wGHBag2R51FuTie%2BhVDCgzWajqDCREzRhi%2Fqlt3D%2FxXNo%2FiwJlpOUr%2Fx1QnkkILxgKlq1dD7KJ767O5ojYKXsO%2BV2Bfu7sSD3djsOxQJ1%2FRbaDm2E96EDkWhhOeOpPndQ6IuSl4NmnJg%2Fcq6f8csW8M3Ys%2BMZPFkdxPC4%2FfRM1XC9o76PjpVNBIO%2ByJEELKZedwIDAQAB; lr=1644769628; _Ruby2_session=Q1drcmlhazYvUFZLd0NydnRXUGpoUzArZDlxYWRCcW9sRUx5VDBydWVWRHdGWDZlMnlESURzbldwbFV1L0drbUlKaWt5MXRtaS9iR0ZYZEpPVHQ1N25qRnR1d3FrY0tzQW1qQm9CdTZ3MSs0d2c3MlpuMjRiQWhCOHI1cGNWekZ4cUdJd0ZFcGtpeng3MFlqZjFDUW9RYmpFMU9DeGdGMVZKR1EwMjVhSE9yVHl4VXFtQm9aYVBtNHF5d0pwMjJ1aVlNMUVRUzdnVFZWZ1AxQkY5Q0p6a2RKay9QL05tOWk4cHZiSERtaGRxeTlxTWZnV3Q0cjdwR3RndUtmeUp3QThhMnJaV2dGZjlPUUtjcGRidDhiajRxK2g0RUZTMWNZUDBaeGNCcUVxSDJ1QnZVRlRkWk9tUExJNWN3TDN5T1BQcmhVVGsycStVTzJRaUwvSkk2TnNVZldTOGU3Tm5wQ3RUMy9nazFqbzdrUWtvYzRwQWRpV3dnTVB3YzhodFV2U0FRR3VKdllMY01NZmdOdGtmOEJ4UT09LS1nTXBrYldhQ0pEeWJ3ak9qQjcrTGV3PT0%3D--1439f36a7f9362aee4b5b666747a2d63d72e81bd'
}

response = requests.request("POST", url, headers=headers, data=payload)

stock_info = response.json()['stock_infos']

for info in stock_info:
    key = info[0]
    for i, sub in enumerate(info[1:], 1):
        if sub == key:
            print(info[i:])
            break

Output:
['AA', 1452.0, 4285.0, 6679.0, 0.0, 14197.0, 2929.0, 1724.0, 1725.0, 8736.0, 3878.0, 3878.0, 10.23, 47.05, None]
['ACH', 1773.84, 7909.0, 18758.17, 788.41, 30523.38, 9252.6, 8782.1, 14242.28, 18580.33, 9038.55, 8250.17, 5.81, 61.46, 2.58]

...and the values for all observed tickers


text:
Q: Edit the Outer Variable With the Class Constructor how do i edit the chattile variable in the contructor 'tambah' as shown below:
class ChatCardList extends StatefulWidget {
  List<ChatTile> chattile; //EDIT THIS
  ChatCardList({Key key, this.chattile}) : super(key: key);
  Future<void> _onSocketInfo_newMessage(dynamic data) async {
    ChatCardList _data = new ChatCardList.tambah(data);
  }

  ChatCardList.tambah(String message) {
    print("PESAN BARU : " + message);
   this.chattile.add(message); //PUSH OBJECT
  }
  print(chattile); //notting added
  @override
  _ChatCardListState createState() => new _ChatCardListState(chattile:chattile);
}

why did that happen? is my script wrong, or is there something missing from my code?
many thanks,

A: Could you go back and check that this is the actual code that is causing your problem.
The code displayed here will not compile at all, so it's hard to say where the real problem is. Alternatively, describe in detail what you are actually trying to achieve.
The ChatCardList.tambah(String message) { constructor does not initialize chattile, so the value of this.chattile in the body should be null. Calling add on that will throw. Otherwise that code is perfectly fine, it is how you add to a list stored in this's chattile variable.
The Future<void> _onSocketInfo_newMessage(dynamic data) async { method creates a new ChatCardList using CharCardList.tambah, but never does anything with it (it doesn't return the value), so nobody will ever see that object or its chattile value.
Also, the print(chattile); code is outside of any function or constructor body, so it is really declaring an abstract method called print which takes a parameter named chattile. Since your class isn't abstract, that should cause a compile-time error.
So, one way to rewrite your program could be:
class ChatCardList extends StatefulWidget {
  List<ChatTile> chattile; //EDIT THIS
  ChatCardList({Key key, this.chattile}) : super(key: key);
  Future<void> _onSocketInfo_newMessage(dynamic data) {
    String message = data;
    this.chattile.add(message);
  }

  @override
  _ChatCardListState createState() => new _ChatCardListState(chattile: chattile);
}

This code doesn't introduce the tambah constructor, but instead updates the chattile list immediately in the _onSocketInfo_newMessage method. That method still needs to be called from somewhere.


text:
Q: how to implement Network Reachebility status in multiple files? I am using readability class to check network availability and it works fine with this code. But in my app I am having approx 25 view that needs to check the network. I need to know that do I have to write pieces of code in every file ? or is there any way to write it once ?
In the code there is 3 methods that I have to implement to check the network status.
any good suggestions ?
Thanks...

A: You can use this sample application for your requirement. Provided by APPLE.
In this they have kept it under Application Delegate to be available to all the classes.
Hope it helps.

A: here goes, import the header in the app delegate file.
in applicationDidFinishLaunching add
 [[NSNotificationCenter defaultCenter] addObserver: self
                                             selector: @selector(reachabilityChanged:)
                                                 name: kReachabilityChangedNotification object: nil];
this means the appDelegate will be informed each time the reachability is changed. you need to implement the following:
add
-(void)reachabilityChanged: (NSNotification* )note {
Reachability* curReach = [note object];
NSParameterAssert([curReach isKindOfClass: [Reachability class]]);
NetworkStatus netStatus = [curReach currentReachabilityStatus];

if(curReach == hostReach)
{
    if (netStatus == NotReachable)
    {
        //no conn

    }

    else if (netStatus !=NotReachable)
    {

        //has conn
    }

}

}
this is just an overview and you wont learn by just copying and pasting right, the reachability class can give you all you want to know, even they type of connection... so keep playing.

A: Make a static method in Reachability class like
-(BOOL)isInternetReachable{
//your code to check the internet connectivity
// return yes or no
}

the you can use as simple as
if([Reachability isInternetReachable])
{
///// do ur stuff
}
else{
////show some error message
}


text:
Q: JSON Array in PowerShell Am trying to generate the below JSON string in PowerShell:
[
    {
        "FirstName": "Test",
        "LastName": "Account2"
    }
]

The code I have at the moment in PowerShell is:
$Body = @{
    @{
        FirstName='Test'
        LastName='Account2'
     }
}

The error I get with this is: Missing '=' operator after key in hash literal.

A: The outer [] is a list in JSON and you're trying to use @{}, which is a hashtable in PowerShell. Use @() which is an array (list) in PowerShell:
$Body = @(
    @{
        FirstName='Test'
        LastName='Account2'
    }
)
ConvertTo-Json -InputObject $Body

(and I use -InputObject instead of piping, because PowerShell is obsessed with flattering lists, and drops the list otherwise).

A: I had some problems adding new items to the Powershell list. I tried to add an item using the .add() function. This returned the error "Collection was of a fixed size."
Adding items to the list is just simple by using the += symbol.
$Body += @{FirstName='Test2'; LastName='Account3'}

That simple.


text:
Q: Redux: Action was successfully dispatched but the State was not created I am just making a simple app to learn Redux. I use the Redux DevTools to see my 2 states: lists and todos. However it shows only todos and although I tried everything I know, it doesn't show lists:
Initial State:

After clicking on the "Add" buttons:

Here are my codes:
lists.js
import { createSlice } from "@reduxjs/toolkit";

const slice = createSlice({
  name: "lists",
  initialState: [],
  reducers: {
    listAdded: (lists, action) => {
      lists.push({
        id: action.payload.id,
        title: action.payload.title,
        todos: action.payload.todos,
      });
    },
  },
});

export const { listAdded } = slice.actions;
export default slice.reducer;

todos.js
import { createSlice } from "@reduxjs/toolkit";

const slice = createSlice({
  name: "todos",
  initialState: [],
  reducers: {
    todoAdded: (todos, action) => {
      todos.push({
        id: action.payload.id,
        content: action.payload.content,
        check: action.payload.check
      });
    },
    todoEdited: (todos, action) => {
      const index = todos.findIndex((todo) => todo.id === action.payload.id);
      todos[index].content = action.payload.content;
    }
  }
});

export const { todoAdded, todoEdited } = slice.actions;
export default slice.reducer;

reducer.js
import { combineReducers } from "redux";
import todosReducer from "./todos";
import listsReducer from "./lists";

export default combineReducers({
  lists: listsReducer,
  todos: todosReducer
});

configureStore.js
import { configureStore } from "@reduxjs/toolkit";
import reducer from "./reducer";

const store = () => {
  return configureStore({ reducer });
};

export default store();

index.js
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
import store from "./configureStore";
import { Provider } from "react-redux";

ReactDOM.render(
  <React.StrictMode>
    <Provider store={store}>
      <App />
    </Provider>
  </React.StrictMode>,
  document.getElementById("root")
);

So as you see, it takes the action after I use dispatch. However, because it doesn't have the state, when I use lists.map, it says 'TypeError: Cannot read property 'map' of undefined'
What do I do wrong please? Please help! I appreciate it!
edit: Put more codes related to the Add buttons:
App.js
import React from "react";
import ItemTodo from "./ItemTodo";
import ItemList from "./ItemList";
import { useSelector } from "react-redux";
import NewListButton from "./NewListButton";
import NewTodoButton from "./NewTodoButton";

function App() {
  const todos = useSelector((state) => state.todos);
  const lists = useSelector((state) => state.lists);
  return (

        <NewListButton />

          {lists.map((item) => (
            <ItemList key={item.id} title={item.title} />
          ))}

write a todo

          {todos.map((item) => (
            <ItemTodo
              key={item.id}
              id={item.id}
              content={item.content}
              check={item.check}
            />
          ))}
          <NewTodoButton />

  );
}

export default App;

ItemList.js
import React from "react";

const ItemList = ({ title }) => {
  return (

{title}

edit name

remove list

  );
};

export default ItemList;

ItemTodo.js

import React, { useState } from "react";
import { useDispatch } from "react-redux";
import { todoEdited } from "./todos";

const ItemTodo = ({ id, content, check }) => {
  const dispatch = useDispatch();
  const [contentX, setContentX] = useState("");
  const inputTodo = (e) => {
    setContentX(e.target.value);
  };
  const clickEdit = (e) => {
    e.preventDefault();
    dispatch(todoEdited({ id, content: contentX }));
  };
  return (

      <form className="nav-submit">
        <input
          type="text"
          onClick={inputTodo}
          onChange={inputTodo}
          value={contentX}
          onBlur={clickEdit}
        />
      </form>

  );
};

export default ItemTodo;

NewListButton.js
import { listAdded } from "./lists";
import { v4 as uuidv4 } from "uuid";
import { useDispatch } from "react-redux";
import React, { useState } from "react";

const NewListButton = () => {
  const dispatch = useDispatch();
  const [titleX, setTitleX] = useState("");
  const getListTitle = (e) => {
    setTitleX(e.target.value);
  };
  const setNewList = (e) => {
    e.preventDefault();
    const id = uuidv4();
    dispatch(listAdded({ id, title: titleX, todos: [] }));
    setTitleX("");
  };
  return (

write a list

      <form action="">
        <input type="text" onChange={getListTitle} value={titleX} />
        <button className="button-newlist" onClick={setNewList}>
          New List
        </button>
      </form>

  );
};

export default NewListButton;

NewTodoButton.js
import React from "react";
import { v4 as uuidv4 } from "uuid";
import { useDispatch } from "react-redux";
import { todoAdded } from "./todos";

const NewTodoButton = () => {
  const id = uuidv4();
  const dispatch = useDispatch();
  const newTodo = (e) => {
    e.preventDefault();
    dispatch(todoAdded({ id, content: "", check: true }));
  };
  return (

      <button className="button-new" onClick={newTodo}>
        New Todo
      </button>

  );
};

export default NewTodoButton;

edit: more info.
Here is something strange:
I added a file: ListInitialState.js
const ListInitialState = [
  {
    id: 1,
    title: "first list",
    todos: [],
  },
];

export default ListInitialState;

then import ListInialState.js to list.js:
import ListInitialState from "./ListInitialState";
import { createSlice } from "@reduxjs/toolkit";

const slice = createSlice({
  name: "lists",
  initialState: ListInitialState,
  reducers: {
    listAdded: (lists, action) => {
      lists.push({
        id: action.payload.id,
        title: action.payload.title,
        todos: action.payload.todos,
      });
    },
  },
});

export const { listAdded } = slice.actions;
export default slice.reducer;

Finally it worked but I had no idea why:

It would be great if someone explains it. I really appreciate it!

A: Probably you didn't enable redux dev tools.
You can enable redux dev tools with this configuration.
const store = configureStore({
  reducer,
  devTools: process.env.NODE_ENV !== 'production',
})

The Redux DevTools Extension is disabled for production


text:
Q: LetsEncrypt generates fullchain.pem and privkey.pem files. I need .crt and .key files. How can I get them? After running sudo certbot --nginx -d mydomain.io -d www.mydomain.io
I'm getting:
Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/mydomain.io/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/mydomain.io/privkey.pem

For my app to work, I need private.key and certificate.crt files.
I have tried converting .pem files like so:
openssl x509 -outform der -in /etc/letsencrypt/live/mydomain.io/fullchain.pem -out certificate.crt
openssl rsa -outform der -in /etc/letsencrypt/live/mydomain.io/privkey.pem -out private.key

When trying to run my app, I'm getting this error in the browser dev tools:
WebSocket connection to 'wss://<my-ip>:<my-port>/' failed:
Error in connection establishment: net::ERR_CERT_COMMON_NAME_INVALID

On server I'm getting this error (apparently it means that my app couldn't parse the key file):
mbedtls error: returned -0x7780

So it looks like an issue with the certificate. Can you help me to figure out what I have done wrong? What could be causing this issue? Are there other ways to generate .crt and .key files, so I could double check that I didn't make a mistake?

A: Turns out my problem wasn't related to generating the keys, I was doing it correctly.
But the client version of my app was trying to connect to wss://<my-ip>:<my-port>/, and instead I was supposed to connect to wss://<my-domain-name>:<my-port>/.


text:
Q: String indexing within loop only returns two values I am trying to iterate over a string and find all of the occurrences of a certain substring, like so:
contant = "old men old men old men"

def this (l,n):
  while n < 20:
    m = contant[l:].index("o")
    l = m + 3
    n += 1
    print(m,l)

this(0,1)

Which will only return the nnumbers 0 3 and 5 8 over and over again, instead of iterating through the entire string.

A: Try this
value = "old men old men old men"

location = -1

# Loop while true.
while True:
    # Advance location by 1.
    location = value.find("o", location + 1)

    # Break if not found.
    if location == -1: break

    # Display result.
    print(location)

output
0
8
16


text:
Q: Type hinting for a function wrapping another function, accepting the same arguments def function(a: int, b: str) -> None:
    pass

def wrapper(extra: int, *args, **kwargs) -> None:
    do_something_with_extra(extra)
    function(*args, **kwargs)

Is there an easy way for wrapper to inherit function()'s type hints without retyping all of them?
Normally I'd write
def wrapper(extra: int, a: int, b: str) -> None:

But it becomes very verbose with a lot of arguments, and I have to update wrapper() every time I update function()'s arguments, and using *args, **kwargs means there won't be proper autocomplete in vscode and other editors.

A: The best that you can do is to use a decorator for this purpose, and you can use Concatenate and ParamSpec. I use python 3.8 and I had to install typing_extensions for them.
In the code below, if you type function in VSCode, it will show the int argument but without the "extra" name in front of it.
from typing import Callable, TypeVar
from typing_extensions import Concatenate, ParamSpec

P = ParamSpec('P')
R = TypeVar('R')

def wrapper(func: Callable[P, R]) -> Callable[Concatenate[int, P], R]:
    def inner(extra, *args, **kwargs):
        print(extra)
        func(*args, **kwargs)

    return inner

@wrapper
def function(a: int, b: str) -> None:
    print(a, b)
    pass

# typing function will show 'function: (int, a: int, b: str) -> None'


text:
Q: How to prove that $(A \cup B) \oplus (B \cup C) = (A \oplus C) - B$?
Prove
$(A \cup B) \oplus (B \cup C) = (A \oplus C) - B$

It's a problem I met when studying discrete mathematics. I'm a starter so I'm still unfamiliar with some operations.
Here is how I tried and failed:
$$\begin{align}
&(A \cup B - B \cup C)\cup(B \cup C - A \cup B) \\
&=B\cup(A-C)\cup B \cup(C-A)\\
&=B\cup(A-C)\cup(C-A)\\
&=B\cup(A \oplus C)\\
\end{align}$$

A: We want $(A \cup B) \oplus (B \cup C) = (A \oplus C) - B$
case 1: If $x \in B$, then $x \in (A \cup B) \oplus (B \cup C)$ cannot hold, as $x$ is in both $A \cup$ and $B \cup C$. Also $x \notin (A \oplus C) - B$ by definition.
So the only interesting case is when $x \notin B$. Then $x$ is in the left hand side iff $x \in A \oplus C$ because e.g. $x \in B \cup C$ implies $x \in C$ in this case and ditto for $A \cup B$ and $A$.
And so it's clearly in the right hand side and vice versa too. QED.


text:
Q: jQuery form submit not working php I am creating a form that need to be submit using jQuery. Below is my code -

<form method="post" class="needs-validation" id="new-item" action="admin-add-inventory2.php">

                                    Item Name
                                    <input type="text" class="form-control" id="itemname" name="itemname" placeholder="Item name" required>

                                    Description
                                        (Optional)

                                    <input type="text" class="form-control" id="description" name="description" placeholder="description...">

                                <input type="submit" value="Add To Inventory" name="submit" id="submit" class="btn btn-primary btn-lg btn-block error-w3l-btn">
                            </form>

Code for app.js --
$(function() {

    // Get the form.
    var form = $('#new-item');

    // Get the messages div.
    var formMessages = $('#form-messages');

    // Set up an event listener for the contact form.
    $(form).submit(function(e) {
        // Stop the browser from submitting the form.
        e.preventDefault();

        // Serialize the form data.
        var formData = $(form).serialize();

        // Submit the form using AJAX.
        $.ajax({
            type: 'POST',
            url: $(form).attr('action'),
            data: formData
        })
        .done(function(response) {
            // Make sure that the formMessages div has the 'success' class.
            $(formMessages).removeClass('error');
            $(formMessages).addClass('success');

            // Set the message text.
            $(formMessages).text(response);

            // Clear the form.
            $('#itemname').val('');
            $('#description').val('');
        })
        .fail(function(data) {
            // Make sure that the formMessages div has the 'error' class.
            $(formMessages).removeClass('success');
            $(formMessages).addClass('error');

            // Set the message text.
            if (data.responseText !== '') {
                $(formMessages).text(data.responseText);
            } else {
                $(formMessages).text('Oops! An error occured, please try again.');
            }
        });

    });

});

But when pressing the submit button, app.js is not getting executed. Its directly going to action="admin-add-inventory2.php" of form tag.
Kindly point me the logic i m missing.
Its not taking the question in stackoverflow due to more code and less text, so i am adding extra text to submit. Pls ignore the below text.
But when pressing the submit button, app.js is not getting executed. Its directly going to action="admin-add-inventory2.php" of form tag.
Kindly point me the logic i m missing.
But when pressing the submit button, app.js is not getting executed. Its directly going to action="admin-add-inventory2.php" of form tag.
Kindly point me the logic i m missing.

A: Please replace button type from submit to button.
Eg: <input type="button" value="Add To Inventory" name="submit" id="submit" class="btn btn-primary btn-lg btn-block error-w3l-btn">
Also replace $(form).submit(function(e) { with $("#submit").click(function(e) { if you want to call the AJAX code in your JS file on click of the button.


text:
Q: Is the last variable of any implicational tautology also the last variable of one of its premises? I'll define my terminology via the following BNF grammar for implicational logical expressions:
<clause> ::= "(" <premise> <conclusion> ")"
<conclusion> ::= any variable
<premise> ::= (<clause> "$\rightarrow$")*
(In other words, the premise of a clause is any number of sub-clauses, separated from themselves and from the last variable of the clause by the right-associative implication connective, "$\rightarrow$".)
Example: $(((p \rightarrow q) \rightarrow r) \rightarrow (r \rightarrow p) \rightarrow (s) \rightarrow p)$ is a clause with premise clauses $((p \rightarrow q) \rightarrow r)$, $(r \rightarrow p)$, and $(s)$, and a conclusion of $p$.
I wrote a program to enumerate the classical implicational propositional tautologies, and noticed an interesting pattern that is true for (at least) the first 120,957,915 tautologies (i.e. all tautologies having up to 19 characters when converted to polish notation).
The pattern is as follows: every tautology's conclusion is the same variable as the conclusion of at least one of its premise clauses.
Does this pattern extend to every tautology in existence, and is there a proof of it?

A: Yes, and here's the proof: Suppose you have a clause with conclusion $p$, but $p$ is not the conclusion of any of its premises. Then if $p$ is false but every other propositional variable is true, we have that each premise of the clause is true, while the conclusion is false. So the clause is false under this valuation of the propositional variables, and hence the clause is not a tautology.


text:
Q: Dim screen on Windows 10 So, I've had the update for about a week and honestly I've been loving it so far. Only problem was I couldn't regulate screen brightness which was stuck at 100%. But I chose to ignore this, until today when it dropped down to minimum. I almost can't read the screen unless I move to a dark room like I did to type this post =/
Adaptive screen brightness is disabled.
I'm using a Lenovo IdeaPad Z400. I tried to update drivers but Lenovo hasn't released any updates for Windows 10. Can anybody please help? I can barely use my computer like this, it's very frustrating :(
EDIT: I tried this solution offered on a similar post and it didn't work:
Search for Device Manager in Start Menu
Expand the Monitors section
Right click on Generic PnP Monitor and
Click on Enable and you are good!

The Generic PnP Monitor was already on so this wasn't the problem.

A: I finally know the answer - and it's not pleasant.
This solution on Reddit partially solved my problem:

So I managed to fix the Brightness problem on my Lenovo Z500
  (non-touch) here's what I did
1  Downloaded the Intel Video Drivers for 8.1 off the Lenovo Website
2   Ran the unpacker but >did not install< once unpacked
3   Navigated to C:\Drivers\Intel Video Driver\9.17.10.3223
(On mine there are two folders like this http://prntscr.com/7z1wrq[1]
  )
4 Inside 9.17.xxx right click setup -> run as administrator
5 Run installer
Once it finished I was able to change brightness again

Problem is, the driver doesn't work perfectly, so it would raise brightness to the maximum and it'd be stuck there. If I tried to lower it, it would drop to min and I'd have to reinstall the driver again. I chose to use the screen on max brightness for a while, until I got tired of this and other compatibility problems and decided to go back to 8.1

A: Pressing F3 will give you a little brightness changer in the top left. You can click on that and adjust your brightness.


text:
Q: Make Annotation clickable in Annotation Overlay Effect with CSS3 by Tympanus I came across this very neat annotation overlay effect: http://tympanus.net/codrops/2012/05/14/annotation-overlay-effect-with-css3/
You can see a live demo here: http://tympanus.net/Tutorials/CSS3AnnotationOverlayEffect/ (you will need to click on the picture there to see the effect)
I am trying to make the text within annotation  clickable with some external link, like:
Easy Theme Options

but it doesn't work... whenever I click on the annotation, it transitions back to full size image.
I appreciate any help, thank you!

A: I made it work, as you see in this Fiddle.
The problem is that the checkbox is always over the spans. And because all the checkbox and the spans are positioned absolute, changing the z-index wouldn't work! The only way I found it to work with only CSS (by not changing to much) is by messing with the pointer-events property and the
's z-index. (z-index is layered within an element. Because the annotations
 and the checkbox are both in
, changing the  z-index wouldn't work.
I did the following:
I set the z-index of the div.ao-annotations higher than the input.ao-toggle. This results to not being able to click on the input, so not being able to toggle.
To solve this I added pointer-events: none to the
. Now the result is the same, but the s are now positioned on top of the input.
To be able to click on the s I added this CSS:
input.ao-toggle:checked ~ .ao-annotations span{
    pointer-events: auto;
}

This results to only being able to click on the s when the checkbox is checked.
Summary:
.ao-annotations {
    z-index: 20;
    pointer-events: none;
}

input.ao-toggle {
    z-index: 10;
}

input.ao-toggle:checked ~ .ao-annotations span{
    pointer-events: auto;
}

I am very sad to say this only works in IE11 (and all the other browsers)... So you'd probably have to 'hack' with Javascript or rebuild the HTML / CSS.
I hope you can build on this!


text:
Q: Regex match first sentence even on one sentence I have a interesting regex problem. say I have paragraph like this
Johannesburg (; Afrikaans: ; also known as Jozi, Jo'burg, and eGoli) is the largest city in South Africa and one of the 50 largest urban areas in the world. It is the provincial capital and largest city of Gauteng, which is the wealthiest province in South Africa. While Johannesburg is not one of South Africa's three capital cities, it is the seat of the Constitutional Court. The city is located in the mineral-rich Witwatersrand range of hills and is the centre of large-scale gold and diamond trade.

this regex (^.*?[a-z]{2,}[.!?])\s+\W*[A-Z] works well in finding the first sentence based on sentence construct logic. the problem comes when I have just one sentence like this
Johannesburg (; Afrikaans: ; also known as Jozi, Jo'burg, and eGoli) is the largest city in South Africa and one of the 50 largest urban areas in the world.
It doesn't match this sentence understandably because there's no other sentence starting after it. My question is now how do I adjust this expression so it applies to both cases?

A: You could use an alternation (^.*?[a-z]{2,}[.!?])(?:\s+\W*[A-Z]|$) to match either the required logic or assert the end of the string $.
(^.*?[a-z]{2,}[.!?])(?=\s+\W*[A-Z]|$)

Regex demo
If you don't need the capturing group () at the start you might omit it as well and use a positive lookahead (?=  to get a match only:
^.*?[a-z]{2,}[.!?](?=\s+\W*[A-Z]|$)

Regex demo


text:
Q: Mongoid relation throwing NoMethodError: undefined method 'push' for nil:NilClass Edit: This issue is resolved. The issue was caused by a conflict specific to my application. Another module dynamically created a method named .sources. I was able to troubleshoot by removing the relationship and inspecting the objects method list. Thanks anyways.
I'm using Rails 4.1 with Mongoid 4.0 and have setup a relation as follows:
class Organization
  include Mongoid::Document
  has_many :sources
end

and
class Source
  include Mongoid::Document
  belongs_to :organization
end

Then in my rspec test I have:
require 'rails_helper'
RSpec.describe PartnershipsController, :type => :controller do
describe "POST #record" do
  it "should create a partnership for the source's organization" do
    organization = FactoryGirl.create(:organization)
    source = FactoryGirl.create(:source)
    organization.sources.push source
  end
end

There's more after, but the test fails at the organization.sources.push source line with:
undefined method `push' for nil:NilClass

I don't understand why the error is happening. Looks like in the mongoid documentation that's how I should be adding the related source, but so far no dice. What is the correct way to make this relation?
Edit: adding factory
Here's the organization factory, in case it helps clarify something:
FactoryGirl.define do
  factory :organization do
    app_name = Faker::App.name
    company_name = Faker::Company.name
    sequence(:name) { |n| "#{([app_name, company_name].sample)}#{n}" }
    defaults_hash = { 'item_type' => 'charity', 'child_item_type' => 'product'}
    defaults defaults_hash
  end
end


text:
Q: Why do I get a Bad Request with this jQuery post? I have this JavaScript that executes when the commit button for a form is clicked. It is supposed to submit the form body and a file:
$("#submitButton").off("click").on("click", function(evt) {
    evt.preventDefault();
    var url = "/portal/ProjectAuthority/Boq" + "?projectId=" + "0831260e-7018-dd49-9a84-daaf442bc1ec";

    debugger;
    var data = new FormData();

    //Form data
    var formData = $('#BoqReviewForm').serializeArray();
    $.each(formData, function (key, input) {
        data.append(input.name, input.value);
    });

    //File data
    var fileData = $('input[name="boqFile"]')[0].files;
    for (var i = 0; i < fileData.length; i++) {
        data.append("boqFile", fileData[i]);
    }

    $("#boqDataWrapper").empty();
    $.post({
        url: url,
        data: data,
        processData: false,
        contentType: false,
        success: function (resp) {
            setTimeout(function() {
                getBoqReviewData(resp.importId);
            },
            100);
        },
        error: function(xmlHttpRequest, textStatus, errorThrown) {
            alert(errorThrown);
        }
    });
    return false;
});

The url is:
http://localhost/portal/ProjectAuthority/Boq?projectId=0831260e-7018-dd49-9a84-daaf442bc1ec

and the action method signature is:
public ActionResult Boq(Guid projectId, BoqUploadViewModel model, HttpPostedFileBase boqFile)

When I click the submit button, the jQuery Ajax error function is invoked before my breakpoint at the beginning of the action method, so the action method itself is not returning Bad Request, whatever tries to invoke the action method is.
Is there any obvious reason for the Bad Request error?

A: It turns out the viewmodel property for boqFile has a homemade data annotation attribute that is supposed to validate file extensions, e.g. to only xlsx, and that attribute was constantly failing, causing a bad request because the ajax call didn't return the model with errors.
I found this by skipping the ajax call and doing a straight postback, and then I got an error about the file extension, which was correct. I removed the faulty attribute, and the postback returned the valid json intended for the ajax call. Then I just went back to the ajax call and all is working.


text:
Q: How to concatenate result from one query to other query I have two queries:

*

*ps aux | pgrep -f mongod_arb //it will fetch pid

*kill -SIGUSR1 pid //it will kill process

I want to run them as single query.
I have already tried below different queries but none is working:

*

*echo "$(kill -SIGUSR1 ) $(ps aux | pgrep -f mongod_arb)";

*kill -SIGUSR1 echo "$(ps aux | pgrep -f mongod_arb)";

*echo "$(kill -SIGUSR1 ) $(ps aux | pgrep -f mongod_arb)";

*kill -SIGUSR1 echo "$(ps aux | pgrep -f mongod_arb)";
How can I do this to achieve single line query?

A: can you try this :
ps aux | pgrep -f mongod_arb | xargs kill -SIGUSR1
ps aux | pgrep -f mongod_arb | xargs sudo kill -SIGUSR1 # if permission issues.


text:
Q: JButton show tooltip programically: actionMap.get("postTip") is null I need to programically show tooltip for my button2 when it gets focus. (I press Tab as intially focus at button1)
            JButton button = new JButton("Button 1");

            JButton button2 = new JButton("Button 2");
            button2.setToolTipText("tooltip2");
            button2.addFocusListener(new FocusListener());

I refer the code by @camickr
private class FocusListener extends FocusAdapter {
 public void focusGained(FocusEvent e)
 {
    JComponent component = (JComponent)e.getSource();
    Action toolTipAction = component.getActionMap().get("postTip");

but toolTipAction is set null.
I have printed all the entries of ActionMap using this code
        ActionMap actionMap = component.getActionMap();
        Object[] actionMapKeys = actionMap.allKeys();

        for (int i = 0; i < actionMapKeys.length; i++) {
            Object key = actionMapKeys[i];
            System.out.println(key.toString() + " : " + actionMap.get(key).toString());
        }

This is what it gives me
pressed : javax.swing.plaf.basic.BasicButtonListener$Actions@49cf9f
released : javax.swing.plaf.basic.BasicButtonListener$Actions@1de0b5e

So how can I call this code if I got toolTipAction null?
ActionEvent postTip = new ActionEvent(component, ActionEvent.ACTION_PERFORMED, "");
toolTipAction.actionPerformed(postTip);

A: You could also try alternative approach of configuring the tooltip manager to immediately show the tooltip when mouse is entered.
javax.swing.ToolTipManager.sharedInstance().setInitialDelay(0)

If you want this to happen only for some components then you could change this value depending on the component that gets focus.
Tooltip is also shown when Ctrl+F1 is pressed. So may be you could simulate a Ctrl+F1 using java.awt.Robot on the button when you want to display tooltip.

A:
actuall I want to show tooltip on some network event, which has
  nothing to do with mouse. but I have started experiments with focus
  gained by Tab key

*

*use JWindow (undecorated JDialog) or JLabel instead of ToolTip, examples for JLabel by @Guillaume Polet and here

*you can to lay this container to the Mouse Cursor possition or to stick to absolute coordinates, Point to the visible GUI

*standard could be (can be annoying) see SystemTray and TrayIcon#displayMessage


text:
Q: Can you add pseudo classes in the attribute element? I saw some HTML the other day that had what looked like pseudo class selectors defined in the class attribute. Is this correct or is there something else going on?
It looked something like this:

Ok

Is it the same as this:
.styles {}
.styles:focus {}

Ok

I will try and find the exact code but it was a while ago. Found it:
class="inline-flex items-center rounded-md border border-transparent px-1 text-xs font-medium leading-4 text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-primaryAccent focus:ring-offset-2"

And yes to the comment that asked if it was from Tailwind
Original post:

Working with Tailwind (CSS) for the first time and...does it get
easier at some point?  I feel like I'm constantly stringing together
long sentences of class names. I miss working with just regular old
CSS variables and REMs (and CSS modules)

BTW I don't know what tailwind is but I'm guessing this is a feature it offers since a related post says that pseudo selectors are not supported.


text:
Q: Unable to change state property when clicking on child - React I am wanting to change the colour of text when I click on it by triggering a function in a child element, such that it affects the state of the parent - As a particular parent state property determines whether the text is one colour or another.
I know that the function fired in the child DOES feed back up to the parent, as I can get the parent to console.log properly. However, I can't seem to get it to change the state property.
PS. I would like to use a "(prevState) =>" if this is applicable
Parent
const tasks = [
  { name: 'task1', isComplete: false },
  { name: 'task2', isComplete: true },
  { name: 'task3', isComplete: false },
]

class App extends React.Component {
  constructor() {
    super();
    this.state = {
      tasks
    }
  }
  ...
  toggleTask(taskToToggle) {
    const foundTask = tasks.find(task => task.name === taskToToggle.name)

    foundTask.isComplete !== foundTask.isComplete;

    this.setState({ tasks: this.state.tasks })
  }
  ...

Child
return (
      <div key={name} style={taskStyle} onClick={this.handleToggleComplete.bind(this)}>
        {name}
      </div>

    )

handleToggleComplete() {
    const taskToToggle = this.props;
    this.props.toggleTask(taskToToggle);
  }

A: You are returning the same array and task object.
So that current state tasks is the same array as next state tasks containing the same objects.
You need to return another array for example using Array.prototype.map
 toggleTask(taskToToggle) {
    this.setState(({tasks}) => ({
      tasks: tasks.map(task =>
        task.name === taskToToggle.name ? {...task, isComplete: !task.isComplete} : task)
    }))
  }

A: in your child onClick pass the this.props.toggleTask and bind the name the task directly to it like :

onClick={this.props.toggleTask.bind(name)}

And in your Parent in the function dont use taskToToggle.name but just "name" :
const foundTask = tasks.find(task => task.name === name)

Or you can just change completly the function to make it easier like :

toggleTask(name){
  const updated = tasks.map(task => {
    if(task.name === name){
       task.isComplete = !task.isComplete
    }
   return task
  })
this.setState({tasks: updated})
}

A: I think you need to calculate the final state before assigning the state
change your
this.setState({ tasks: this.state.tasks }) //doesn't change anything

to
let finalState = Object.assign({}, ...this.state.tasks, foundTask)
this.setState({ tasks: finalState }) //new object gets assigned to state

A: @Chris was correct in pointing out my n00bish error.
foundTask.isComplete !== foundTask.isComplete

Should have been
foundTask.isComplete = !foundTask.isComplete

This now works.


text:
Q: iOS two tabbar button same naviguation controller with segue i have a Tab Bar Controller with two "buttons"
I want the two "buttons" show the SAME naviguation controller, but one button set the rootviewcontroller var to "a" and the second button set the var to "b"
Is it possible using storyboard and segue?

Many thanks in advance.

A: You can't change the rootViewController from the storyboard. But you can do so programatically.
UIWindow *window = [[[UIApplication sharedApplication] delegate] window];

//For tab 1
window.rootViewController = a;

//For tab 2
window.rootViewController = b;

A: After an afternoon of google search, i haven't found a way to do this with segue.
But i found an answer that use the tag of the tabBarItem to differentiate the uiviewcontroller to initiate.
    if(self.navigationController.tabBarController.tabBar.selectedItem.tag == 1){
        self.typeToDisplay = "a"
    }else{
        self.typeToDisplay = "b"
    }


text:
Q: Android w/ Kotlin pure-java-Junit NoClassDefFoundError workaround not working Repository that reliably reproduces the error: explodes/bug-kotlin-junit
My Android app consists of an application module and 4 library modules.
My tests are written in pure Java. Tests that do not touch Kotlin code run just fine, but when I run tests that use (MyKotlinObj::methodRef) or inits a class (new MyKotlinObj()), my test will fail with the following:
java.lang.NoClassDefFoundError: com/explod/api/UserCreated

    at com.explod.api.Bug.initUserCreated_shouldNotTriggerNoClassDefFoundError(Bug.java:19)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.application.AppMainV2.main(AppMainV2.java:131)
Caused by: java.lang.ClassNotFoundException: com.explod.api.UserCreated
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 28 more

Using:

*

*Android Studio 3.0 Canary 2

*Build tools 26.0.0-rc2

*Kotlin Version 1.1.2-4

*Android-Gradle Plugin 3.0.0-alpha2

*Gradle gradle-4.0-milestone-1

*Target SDK 25

*Min SDK 19
The workaround suggested here does not work for me:
android {
    task copyTestClasses(type: Copy) {
        from "build/tmp/kotlin-classes/debugUnitTest"
        into "build/intermediates/classes/debug"
    }

It looks like the Android Studio team possibly has a solution but I am hoping for a workaround that works. Is my issue different? There is no Kotlin code in my tests.

A: Turns out, the destination copy directory for the workaround was incorrect.
I had been using:
task copyTestClasses(type: Copy) {
    from "build/tmp/kotlin-classes/devDebugUnitTest"
    into "build/intermediates/classes/devDebug"
}

task copySdkClasses(type: Copy) {
    from "build/tmp/kotlin-classes/devDebug"
    into "build/intermediates/classes/dev/debug"
}

But the following works for me:
task copyTestClasses(type: Copy) {
    from "build/tmp/kotlin-classes/devDebugUnitTest"
    into "build/intermediates/classes/dev/debug"
}

task copySdkClasses(type: Copy) {
    from "build/tmp/kotlin-classes/devDebug"
    into "build/intermediates/classes/dev/debug"
}

On clean builds, the SDK classes are not available. I also needed to add :api:assembleDevDebug to the run configuration to make it work from clean builds.


text:
Q: How Show Loading form whenever Application Loads or Fetch Large Data from Database Please help to implement this code whenever my application loads while database operations
I've code like this
Private bgw As New BackgroundWorker
Public Sub showLoading()
    bgw.WorkerSupportsCancellation = True

    AddHandler bgw.DoWork, AddressOf bgw_doWork
    AddHandler bgw.RunWorkerCompleted, AddressOf bgw_Complete

    If Not bgw.IsBusy = True Then
        bgw.RunWorkerAsync()
    End If
End Sub

Public Sub closeLoading()
    If bgw.WorkerSupportsCancellation = True Then
        bgw.CancelAsync()
    End If
End Sub

Private Sub bgw_doWork(ByVal sender As Object, ByVal e As DoWorkEventArgs)
    Dim worker As BackgroundWorker = CType(sender, BackgroundWorker)
    Dim loadingScreen As New frmLoading

    loadingScreen.Show()

    While True
        If Not bgw.CancellationPending Then
            Threading.Thread.Sleep(50)
        Else
            e.Cancel = True
            Exit While
        End If
        End While
    End Sub

    Private Sub bgw_Complete(ByVal sender As Object, ByVal e As RunWorkerCompletedEventArgs)
        Dim lstFrm As New List(Of frmLoading)
        lstFrm = Application.OpenForms.OfType(Of frmLoading)()

        If lstFrm.Count > 0 Then
            For Each frm As frmLoading In lstFrm
                frm.Close()
            Next
        End If
    End Sub

Please help me how to call this method to multiple forms whenever needed

A: Your problem seems to be loadingScreen.ShowDialog().
Use loadingScreen.Show() as .ShowDialog() blocks the execution as long as the Dialog stays open.


text:
Q: Redirect users to iTunes app store or google play store? I'm looking for an easy solution to post one link of my app e.g. on Facebook and it should automatically redirect to the right app store if the user accesses it with a mobile device. Otherwise the users should be redirected to my website.
iOS app:
http://itunes.apple.com/de/app/dawawas/id588285122
Android app:
https://play.google.com/store/apps/details?id=de.conceptspace.dawawas.greenturtle&hl=en
Website:
https://www.dawawas.com/

A: If you want to roll your own and not use a third party, there's also a Javascript solution:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
<script>
function getMobileOperatingSystem() {
  var userAgent = navigator.userAgent || navigator.vendor || window.opera;

      // Windows Phone must come first because its UA also contains "Android"
    if (/windows phone/i.test(userAgent)) {
        return "Windows Phone";
    }

    if (/android/i.test(userAgent)) {
        return "Android";
    }

    // iOS detection from: http://stackoverflow.com/a/9039885/177710
    if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
        return "iOS";
    }

    return "unknown";
}</script>

<script>
function DetectAndServe(){
    let os = getMobileOperatingSystem();
    if (os == "Android") {
        window.location.href = "http://www.Androidexample.com";
    } else if (os == "iOS") {
        window.location.href = "http://www.IOSexample.com";
    } else if (os == "Windows Phone") {
        window.location.href = "http://www.WindowsPhoneexample.com";
    } else {
        window.location.href = "http://www.NowherLandexample.com";
    }
}
</script>
</head>
<body onload="DetectAndServe()">
</body>
</html>

A: We were looking for a solution to direct users to the proper App Store, plus carry along extra metadata, so when the app is launched after App Store install, it would know where the user came from and launch a specific activity.
So, if any others like me hits this Stack Overflow article, a hint for obtaining both the OP's requirements, plus the extra benefits of carrying along extra metadata (and track all the conversions) is to look at Firebase Dynamic Links: https://firebase.google.com/docs/dynamic-links

A: You can create a short link for iTunes and Google Playstore at once with http://toSto.re.
Just select a name and the enter the different app store urls you get a link like toSto.re/facebook which directs automatically to the right url depending on the user agent and even supports Google Analytics itegration for some stats.

A: U mean something like this?
Onelink

How to use onelink.to
onelink.to is the easy and fuss-free way to link to your app!
Just add the URLs to your app and we will determine which to use every time someone is using your onelink.to address.
You can use onelink.to free of charge, both for private and commercial use. We have no plans to change that.
And you can also add a fallback url to your website.

Hope this helps u out.

A: In PHP you can use something like:
<?php

$iPod    = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone  = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad    = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
$Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android");
$webOS   = stripos($_SERVER['HTTP_USER_AGENT'],"webOS");

//do something with this information
if( $iPod || $iPhone ){
    //browser reported as an iPhone/iPod touch -- do something here
    $string = "Location: <<your itunes app link>>";
    header($string);
    die();
}else if($iPad){
    //browser reported as an iPad -- do something here
    $string = "Location: <<your itunes app link>>";
    header($string);
    die();
}else if($Android){
    //browser reported as an Android device -- do something here
    $string = "Location: <<Google Play Link>>";
    header($string);
    die();
}else if($webOS){
    //browser reported as a webOS device -- do something here
    $string = "Location: <<Your Page link>>";
    header($string);
    die();
}else{
    //browser reported as PC -- do something here
    $string = "Location: <<Your Page link>>";
    header($string);
    die();
}

?>

You can use links for iTunes or Android, respectively:
itms-apps://itunes.apple.com/app/<<App ID>>
market://details?id=<<Package id>>

I don´t remember the source, but at least it works for me for sharing in other apps like Whatsapp, but unfortunately is not working on Facebook.
The problem in Facebook is that they use the metadata of the final link on the path of redirections, and the link points to GooglePlay store.

A: Plain javascript version:
<script>
window.addEventListener('DOMContentLoaded', (event) => {
  var userAgent = navigator.userAgent.toLowerCase();
  if (userAgent.indexOf('android') > -1) {
    window.location.href = 'https://play.google.com/store/apps/details?id=de.winterworks.ultimate_puzzle.winterworksGmbH.game';
  } else if (userAgent.indexOf('iphone') > -1 || userAgent.indexOf('ipod') > -1 || userAgent.indexOf('ipad') > -1) {
    window.location.href = 'https://apps.apple.com/us/app/puzzles-for-toddlers-kids/id1463362222';
  }
});

</script>

A: You can create that functionality by Backend.Just create one PHP script or what ever language your backend is using.Here I am asuming PHP.
Just Create one php script that will determine that you are using iphone or android or web.check this link for php script Mobile or desktop browser detection and redirect to respective web page
And redirect it to respective Url.Like You can use a url of site with php file
https://www.dawawas.com/detect_mobile.php
a user will share this url and when another user will tap on above link then php script will determine whether it ios or android or web and repective link will open automatically via redirection
I have implemented this in our ios app.

A: You can use simple javascript code
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>

<script>
    $(document).ready(function () {
        if (navigator.userAgent.toLowerCase().indexOf("android") > -1) {
            window.location.href = 'market://details?id=<appID>';
        }
        if (navigator.userAgent.toLowerCase().indexOf("iphone") > -1) {
            window.location.href = 'itms-apps://itunes.apple.com/app/<appID>';
        }
    });
</script>

Or if working with .net can use
Dim systOS = Request.UserAgent.ToString.ToLower

    If (systOS.IndexOf("android").ToString.ToLower > 0) Then
        Response.Redirect("market://details?id=com.manomayelectronics")

    ElseIf (systOS.IndexOf("iPod").ToString.ToLower > 0) Then
         Response.Redirect("itms-apps://itunes.apple.com/app/com.manomayelectronics")
 End if

OR if using PHP can use
<?php

$iPod    = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone  = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad    = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
$Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android");

//do something with this information
if( $iPod || $iPhone ){
    //browser reported as an iPhone/iPod touch -- do something here
    $string = "Location: <<your itunes app link>>";
    header($string);
    die();
}else if($iPad){
    //browser reported as an iPad -- do something here
    $string = "Location: <<your itunes app link>>";
    header($string);
    die();
}else if($Android){
    //browser reported as an Android device -- do something here
    $string = "Location: <<Google Play Link>>";
    header($string);
    die();
}

Regards
Multicore Solutions.
https://multicoresolutions.in/


text:
Q: Scaling TikZ matrix of nodes having shadowed nodes I try to use TikZ' matrix of nodes for rebuilding a previously created image. The goal is the following:

There are two general questions I got for this:
1) Is there a more 'TikZy' way to create the rectangled shapes in the illustration with the respective sizes, spanning over multiple rows?
2) How can I scale the whole image, such that it will fit on a portrait a4paper (image below is created on landscape a3paper)?
What I did until now (code and current resulting image are attached below):
In order to create the shapes 'Job Builder', 'GNU Parallel', and 'Computing Cluster', I created nodes and fitted the respective rectangles to it.
If I now use the scaling as described here (adding [scale=0.6, every node/.style={scale=0.6}] to tikzpicture), the shadowed nodes acting as fitting points become visible (last image).
Also, the relation between nodes becomes weird. Is there any way to scale the whole illustration, as one can do that using the \includegraphics[width=\textwidth]{...} statement?
\documentclass{scrartcl}
\usepackage{lscape}
\usepackage{tikz}
\usetikzlibrary{backgrounds,matrix,fit}
\tikzset{
    >=latex,
    every path/.style={thick},
    grey_vertex/.style={rectangle, draw, thick, top color=white, bottom color=black!20, draw=black!50, align=center, minimum size = 10pt},
    edge_label/.style={auto, font={\tiny\itshape}},
    vertex_bg_good/.style={rectangle,thick,bottom color=green!20,top color=green!10}
}

\begin{document}
    \begin{figure}
        \begin{tikzpicture}
            \matrix(m)[row sep=5mm, column sep=15mm, matrix of nodes, nodes={grey_vertex, circle, text width=4.7em}, font=\footnotesize]
            {
                {Parameters\\EA 1}  &                 & {Config\\EA 1}  &            & {EA\\Template}    & {Input\\Files}    & \node(mRes1){Results\\EA 1}; & \node(mSta1){Statistics\\EA 1};   \\
                {Parameters\\EA 2}  & \node(m22){};   & {Config\\EA 2}  &            &                   &                   & \node(mRes2){Results\\EA 2}; & \node(mSta2){Statistics\\EA 2};   \\
                                    &                 &                 & {jobs.sh}  & \node(mPar1){};   & \node(mPar2){};   &                              &                                   \\
                {...}               & \node(m42){};   & {...}           &            &                   &                   & \node(mResx){...};           & \node(mStax){...};                \\
                {Parameters\\EA n}  &                 & {Config\\EA n}  &            & \node(mclu1){};   & \node(mclu2){};   & \node(mResn){Results\\EA n}; & \node(mStan){Statistics\\EA n};   \\
            };
            \node[grey_vertex, rectangle, rounded corners, fit=(m22)(m42)]       (BG1)   {Job\\Builder};
            \node[grey_vertex, rectangle, rounded corners, fit=(mPar1)(mPar2)]   (BG2)   {GNU\\Parallel};
            \node[grey_vertex, rectangle, rounded corners, fit=(mclu1)(mclu2)]   (BG3)   {Computing\\Cluster};
            \begin{scope}[on background layer]
                \node[vertex_bg_good,draw,fit=(mRes1)(mSta1)] (mFRes1) {};
                \node[vertex_bg_good,draw,fit=(mRes2)(mSta2)] (mFRes2) {};
                \node[vertex_bg_good,draw,fit=(mResx)(mStax)] (mFResx) {};
                \node[vertex_bg_good,draw,fit=(mResn)(mStan)] (mFResn) {};
            \end{scope}
            \draw[->] (m-1-1) -- (BG1);
            \draw[->] (m-2-1) -- (BG1);
            \draw[->] (m-4-1) -- (BG1);
            \draw[->] (m-5-1) -- (BG1);
            \draw[->] (BG1) -- (m-1-3);
            \draw[->] (BG1) -- (m-2-3);
            \draw[->] (BG1) -- (m-4-3);
            \draw[->] (BG1) -- (m-5-3);
            \draw[->] (m-1-3) -- (m-3-4);
            \draw[->] (m-2-3) -- (m-3-4);
            \draw[->] (m-4-3) -- (m-3-4);
            \draw[->] (m-5-3) -- (m-3-4);
            \draw[->] (m-3-4) -- (BG2);
            \draw[->] (m-1-5) -- (BG2);
            \draw[->] (m-1-6) -- (BG2);
            \draw[->] (BG2) edge[bend left=30] (BG3);
            \draw[->] (BG3) edge[bend left=30] (BG2);
            \draw[->] (BG2.east) -- (mFRes1.south west);
            \draw[->] (BG2.east) -- (mFRes2.south west);
            \draw[->] (BG2.east) -- (mFResx.north west);
            \draw[->] (BG2.east) -- (mFResn.north west);
        \end{tikzpicture}
    \end{figure}
\end{document}

Current result without scaling on a3paper and landscape.

Current result with scaling on a4paper and portrait.

A: To avoid complication of layers (and others) rescaling, you can use \resizebox, except if the tikzpicture contens & due to matrix material. In this case, one has to change the & in to something else : for example \& as suggested by the manual and add the option : ampersand replacement=\&.

\documentclass{scrartcl}
\usepackage{lscape,graphicx}
\usepackage{tikz}
\usetikzlibrary{backgrounds,matrix,fit}
\tikzset{
    >=latex,
    every path/.style={thick},
    grey_vertex/.style={rectangle, draw, thick, top color=white, bottom color=black!20, draw=black!50, align=center, minimum size = 10pt},
    edge_label/.style={auto, font={\tiny\itshape}},
    vertex_bg_good/.style={rectangle,thick,bottom color=green!20,top color=green!10}
}

\begin{document}
    \begin{figure}
   \resizebox{\linewidth}{!}{%
        \begin{tikzpicture}[ampersand replacement=\&]
            \matrix(m)[row sep=5mm, column sep=15mm, matrix of nodes, nodes={grey_vertex, circle, text width=4.7em}, font=\footnotesize]
            {
                {Parameters\\EA 1}   \&                  \& {Config\\EA 1}   \&             \& {EA\\Template}     \& {Input\\Files}     \& \node(mRes1){Results\\EA 1};  \& \node(mSta1){Statistics\\EA 1};   \\
                {Parameters\\EA 2}   \& \node(m22){};    \& {Config\\EA 2}   \&             \&                    \&                    \& \node(mRes2){Results\\EA 2};  \& \node(mSta2){Statistics\\EA 2};   \\
                                     \&                  \&                  \& {jobs.sh}   \& \node(mPar1){};    \& \node(mPar2){};    \&                               \&                                   \\
                {...}                \& \node(m42){};    \& {...}            \&             \&                    \&                    \& \node(mResx){...};            \& \node(mStax){...};                \\
                {Parameters\\EA n}   \&                  \& {Config\\EA n}   \&             \& \node(mclu1){};    \& \node(mclu2){};    \& \node(mResn){Results\\EA n};  \& \node(mStan){Statistics\\EA n};   \\
            };
           \node[grey_vertex, rectangle, rounded corners, fit=(m22)(m42)]       (BG1)   {Job\\Builder};
            \node[grey_vertex, rectangle, rounded corners, fit=(mPar1)(mPar2)]   (BG2)   {GNU\\Parallel};
            \node[grey_vertex, rectangle, rounded corners, fit=(mclu1)(mclu2)]   (BG3)   {Computing\\Cluster};
            \begin{scope}[on background layer]
                \node[vertex_bg_good,draw,fit=(mRes1)(mSta1)] (mFRes1) {};
                \node[vertex_bg_good,draw,fit=(mRes2)(mSta2)] (mFRes2) {};
                \node[vertex_bg_good,draw,fit=(mResx)(mStax)] (mFResx) {};
                \node[vertex_bg_good,draw,fit=(mResn)(mStan)] (mFResn) {};
            \end{scope}
            \draw[->] (m-1-1) -- (BG1);
            \draw[->] (m-2-1) -- (BG1);
            \draw[->] (m-4-1) -- (BG1);
            \draw[->] (m-5-1) -- (BG1);
            \draw[->] (BG1) -- (m-1-3);
            \draw[->] (BG1) -- (m-2-3);
            \draw[->] (BG1) -- (m-4-3);
            \draw[->] (BG1) -- (m-5-3);
            \draw[->] (m-1-3) -- (m-3-4);
            \draw[->] (m-2-3) -- (m-3-4);
            \draw[->] (m-4-3) -- (m-3-4);
            \draw[->] (m-5-3) -- (m-3-4);
            \draw[->] (m-3-4) -- (BG2);
            \draw[->] (m-1-5) -- (BG2);
            \draw[->] (m-1-6) -- (BG2);
            \draw[->] (BG2) edge[bend left=30] (BG3);
            \draw[->] (BG3) edge[bend left=30] (BG2);
            \draw[->] (BG2.east) -- (mFRes1.south west);
            \draw[->] (BG2.east) -- (mFRes2.south west);
            \draw[->] (BG2.east) -- (mFResx.north west);
            \draw[->] (BG2.east) -- (mFResn.north west);
        \end{tikzpicture}}
    \end{figure}
\end{document}


text:
Q: Appended div not located properly My code:

     <button onclick="myFunction()">Append</button>

When I append the tooltip div it can't append the exact location.. I set the location top as 20 but it was appended at 50... because the parent div position as relative... i need to append the tooltip div exact location what i mentioned
How do I solve this without change the position(both parent and child)?

A: I think the problem was the .css() call. The only style was being applied to your element was the top : 20px.
Fiddle
This is your method call:
$(tooltipdivRect).css('top', '20px', 'left', '0px', 'width', '20px', 'height', '20px', "border-color", 'red', 'border', '2px solid #a1a1a1', 'position', 'absolute');

This is the way it needs to be with your css styles inside of a object.
$(tooltipdivRect).css({
    'top': '50px',
    'left': '0px',
    'width': '20px',
    'height': '20px',
    "border-color": 'red',
    'border': '2px solid #a1a1a1',
    'position': 'absolute'
 });

A: So, let's say you just want to insert a tooltip to your div #container
The way you are doing it is trying to insert manually a div that behaves as a tooltip. As you created it: var tooltipdivRect = $("

");
My suggestion is either you do something more clean like:
function myFunction() {
    var tooltipdivRect = $("

");
    $(tooltipdivRect).html("check")
    $("#container").append(tooltipdivRect);
}

Using a extracted css like this:
#manualTooltip {
    top : 20px;
    left : 0px;
    width: 20px;
    height: 20px;
    border-color: red;
    border: 2px solid #a1a1a1;
    position: absolute;
}

OR you just set a title for your div container:
function appendTitleToDiv(){
    $("#container").attr("title", "check");
}

You can see both solutions here in this fiddle: http://jsfiddle.net/epbuw2sm/


text:
Q: iOS & Parse.com: How to set User when calling Parse Cloud Code? I have defined a function in Parse.com's Cloud Code. According to documentation the request.usr should be "The Parse.User that is making the request. This will not be set if there was no logged-in user.".
Im invoking my method from iOS and the user object is "empty", as in all attributes are undefined.
I guess Im missing how to set it when invoking the cloud code.
Here are my pieces:
1) cloud code

Parse.Cloud.define("userRatesMovie", function(request, response) {
  //Parameters: user, movieId, rating
  var user = request.user;
  var username = "nothing"
  var movieId = request.params.movieId;
  var rating = request.params.rating;

  var aux = "User: " + username + " Rated: " + movieId + " with a " + rating + " user " + user.username +":" +user.objectId;
  console.log(aux);

  //Fetch for previous rating for this user,movie pair
  response.success(aux);
});

For now Im just writing and returning a log line.
2) iOS code
    //Test code
PFUser *pfUser = [PFUser currentUser];
NSLog(@"User Id:%@ Username:%@",pfUser.objectId, pfUser.username);
[PFCloud callFunctionInBackground:@"userRatesMovie"
                   withParameters:@{
                                    @"movieId":@"12345",
                                    @"rating":@"3"}
                            block:^(NSString *someString, NSError *error) {
                                if (!error) {
                                    NSLog(@"userRatesMovie:%@",someString);
                                }
                            }];

I first check that I have a PFUser and then invoke my cloud code
3) Output
    User Id:32P3Hwk1Hv Username:1NpFRFVPFJT45znXosx8g8Ay2
    userRatesMovie:User: nothing Rated: 12345 with a 3 user undefined:undefined

As you can see user.username and user.objectId are undefined.

A: The error wasn't sending the user, but the code that checked for it:
user.username

That is not a valid Cloud Code syntaxis. The correct code should look like this:
user.get("username")

Then it all worked fine....


text:
Q: How to work with docker containers created by cookiecutter-django? I started a project using cookiecutter-django. I use docker. I also use wsl 2 (ubuntu 20.04) on windows 10. I edit using vscode started from wsl shell.
When I create a new file using a remote docker command, e.g. when I issue  docker-compose -f local.yml --rm django python manage.py startapp appname
, the new files have the user and group root, and then I need to fix owner and group to my user to edit the files created this way.
The questions are: Is this the way I am supposed to work? Should I edit directly in the container created, so that things like mypy linting and code completion would work better hopefully. Can you give steps to do that for a docker noob?

A: For this (and a lot of other things) you could use a bash script with bash alias to automate the process:

~/scripts/manage.sh
docker-compose -f local.yml --rm django python manage.py "$@"
sudo chown -R $USER:www-data ~/path_to_your_git_directory_or_project_directory

~/.bash_aliases
alias manage="source ~/scripts/manage.sh"

Once you've got these, you can either logout and log back in, or just use
source ~/.bash_aliases

to activate the alias.
From now on you can just use commands like this:
$ manage startapp appname
$ manage makemigrations
# etc...

which will

*

*run the manage.sh script (and append any arguments to the docker-compose command,

*after that, it will make your user the owner of all files (recursively) in the directory. Note that it's also useful when creating migration files.

By creating more script files and more aliases you can save yourself a lot of terminal typing. Good luck!


text:
Q: Expressions for LPsolve I'm working on a problem that involves constraints containing certain kind of expressions, which are to be solved using LPsolve. I can't seem to figure out how to formulate the constraints though.

e.g:-  I'd like to reformulate the following constraint:

+0.35 C1 +0.15 C2 +0.15 C3 +0.2 C4 +0.15 C5 +0.15 C6 +0.15 C7 +0.15 C8 +0.15 C9 +0.15 C10 <= 3750;

as
+(0.35)*(1+C1) +0.15*(1+C2) +0.15*(1+C3)....+0.15*(1+C10)<= 3750;

I've tried using set.constr.value() but that only takes a fixed row  as an input.
and then solve for the optimal solution.

A: To maximize the sum of the Ci variables subject to the constraint given int he question and assuming that they are non-negative:
library(lpSolve)

cc <- c(0.35, 0.15, 0.15, 0.2, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15)
result <- lp(direction = "max",
   objective = rep(1, length(cc)),
   const.mat = t(cc),
   const.dir = "<=",
   const.rhs = 3750 - sum(cc))

result
## Success: the objective function is 24988.33

result$solution
##  [1]     0.00 24988.33     0.00     0.00     0.00     0.00     0.00     0.00
##  [9]     0.00     0.00

A: The constraint in the program (assumet C_i >= 0):
+(0.35)*(1+C1) +0.15*(1+C2) +0.15*(1+C3)....+0.15*(1+C10)<= 3750;

is the same as:
+0.35*C1 +0.15*C2 + ... +0.15*C10 <= 3750 - (0.35 + 0.15 + ... + 0.15)

Dont get the point of the question... Pls try to writte down the program in normal form and make your question more precise.


text:
Q: Limit $\lim_{x \to \infty} \ln x - x$ Consider $f(x) = \ln \ x  - x$ where $\ln \ x$ refers to base $e$ logarithm. Find limit of $f(x)$ when $x$ goes to infinity.
My try: I know that $f'(x) = \frac{1}{x} - 1$ but what's the next step?
Please Help!

A: Let $f(x)=e^{\ln x-x}$, hence $f(x)=\frac{x}{e^x} \to 0$  for $x \to \infty$.
Thus $ \ln x-x \to - \infty$ for $x \to \infty$.

A: $\ln(x)$ is a function that is strictly increasing on $\mathbb R^+$, but it "flattens out".
$x$ is also strictly increasing, but it keeps a constant positive slope.
This means that $x$ will increase infinitely more than $\ln(x)$.
Thus, $\ln(x)-x \to -\infty$ as $x\to\infty$.
Alternative method using the derivative you found
You know that $f'(x) = \frac1x - 1$, and what we can see from this is that when $x\to\infty$, then $\frac1x \to 0$, and as we subtract 1, the slope will always be negative, and thus the function will tend towards $-\infty$.

A: You can use your observation for the derivative. Note that
$$ f'(x) = \frac 1x - 1 \to -1, \quad x\to \infty $$
Hence, we can choose an $N$ such that
$$ f'(x) < -\frac 12, \qquad x \ge N. $$
This allows us to estimate
$$ f(x) = f(N) + \int_N^x f(y)\, dy < f(N) - \frac 12(x-N) \to -\infty, \qquad x \to \infty $$

A: We have $\ln(x) - x$. Factoring out $x$, we get:
$x (\frac{\ln(x)}{x} - 1)$
We know as $x \to \infty$, the first term becomes $\infty$
What about $(\frac{\ln(x)}{x} - 1)?$
If we consider $(\frac{\ln(x)}{x})$, we get an indeterminate form $\frac{\infty}{\infty}$. Applying L'Hopital, we can rewrite $(\frac{\ln(x)}{x})$ in terms of derivative as $(\frac{\frac{1}{x}}{1})$. Evaluating this derivative as $x \to \infty$ gives us $0$.
So we have:
$\infty(0  - 1) = \infty(-1) = -\infty$


text:
Q: Multi-Image picker Library Permission issue Using expo version 37..0.12
While trying to load multi-images there is a permission error reading the images
Following is the error
Permissions.askAsync(Permissions.CAMERA,Permissions.CAMERA_ROLL, Permissions.READ_EXTERNAL_STORAGE);
Error: [Unhandled promise rejection: Error: Failed to get permissions]

This happens in Android while using multi-image picker library: "expo-image-picker-multiple": "1.4.0"

A: I assume you already used this permission in your manifest
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />.
If yes its probably because you don't have runtime permissions in your project like this
val requestPermissionLauncher =
    registerForActivityResult(RequestPermission()
    ) { isGranted: Boolean ->
        if (isGranted) {
            // Permission is granted. Continue the action or workflow in your
            // app.
        } else {
            // Explain to the user that the feature is unavailable because the
            // features requires a permission that the user has denied. At the
            // same time, respect the user's decision. Don't link to system
            // settings in an effort to convince the user to change their
            // decision.
        }
    }

Ref: Android Docs for Runtime Permission


text:
Q: LWC Local Server says Couldn't find the custom component when I pass attribute using Custom Event from child to Grandparent Im trying to do a simple operation which is pass an attribute from child to grandparent in LWC using Custom Event where I set the Bubbles and composed attribute to true to pass it through the hierarchy. This I am trying using LWC Local Development on a localhost server. But The LWC Local Server gives the following error "Couldn't find the compiled component. If this component has a dependency on a component in the org or a component in a package in the org, test this component directly in the org."
I am sharing snippets of the code below
ChildComponent Template
<template>

    <lightning-layout class="slds-align_absolute-center slds-text-align_center container" multiple-rows>

        <lightning-layout-item size="12">
          <lightning-button variant="brand" label="Click Me" onclick={handleClick}></lightning-button>

        </lightning-layout-item>
        </lightning-layout>

</template>

Child JS
export default class Childcomponent extends LightningElement {

    myval = "testo";

handleClick(event){

    const cv = this.myval;

this.dispatchEvent(new CustomEvent('myevent',{detail:cv }, {bubbles:true,composed:true}))

}

Parent Template
<template>

    <lightning-layout class="slds-align_absolute-center slds-text-align_center container" multiple-rows>

        <lightning-layout-item size="12">
           <c-child-component onmyevent ={handleEventFromChild}></c-child-component>

        </lightning-layout-item>
        </lightning-layout>

</template>

Parent JS
export default class Parentcomponent extends LightningElement {

    handleEventFromChild(event){
alert('From Parent'+event.detail);

    }

}

GrandParent Template
<template>

    <lightning-layout class="slds-align_absolute-center slds-text-align_center container" multiple-rows>

        <lightning-layout-item size="12">
           <c-parent-component onmyevent ={handleEventfromGrandChild}></c-parent-component>
        </lightning-layout-item>
        </lightning-layout>

</template>

GrandParent JS

export default class GrandParent extends LightningElement {

    handleEventfromGrandChild(event){

        alert('From GrandParent'+event.detail);
    }
}

I cannot understand where I am going wrong. I have already set the isExposed attribute to true in the meta xml for all the components. Also is the right way to pass attribute from child to grandparent?

A: CustomEvent takes only two parameters: the first is the name of the event, the second is its configuration. You must provide detail, bubbles, and composed in this second parameter, as demonstrated here:
this.dispatchEvent(new CustomEvent('myevent',{detail:cv, bubbles:true, composed:true}))

Demo.
As far as the second problem, the demo above worked with minimal modification. Make sure you don't have any typos or missing files in your local workspace. This can cause compilation errors like what you've described.
However, please note that using { composed: true, bubbles: true } isn't recommended; the parent should fire off its own event to pass from the child to the grandparent. The reason why is that using this forces the parent to accept the event as part of its own signature, which means that if child ever changes, then all dependencies of parent must also change, which can be harder to maintain.


text:
Q: Transfer Windows 8 (or its license) to virtual machine in newly purchased laptop while replacing OS with Ubuntu I just purchased a new laptop, which comes with Windows 8 Home Pro preinstalled. But I'm a Ubuntu user. However, I find it handy to have a virtual machine with Windows in it.
I have yet to receive the laptop and Windows hasn't been activated. I wonder what would be the best steps, if I can activate this copy on Virtualbox somehow. I presume it won't come with W8 disk, so I also need to consider how to actually install Windows on virtualbox if I wipe everything and start fresh with Ubuntu without activating it.
Since I purchased Windows and I'm going to install it on a single machine, albeit Virtual, I believe this would be legal? I'm not sure of the best procedure. I'm sure this was asked before, but I couldn't find a best practice for newly purchased laptops.

A: As someone pointed in the comments to my original question, there's no way to let Windows 8/10 accept an OEM license key when you install from a VM.
I tried with different methods, extracting my product ID and license key from the OEM installed Windows 8 (there was no key supplied with a sticker on the bottom of the laptop or on the battery or along the attached docs (Lenovo Thinkpad). I also updated Windows 8 to Windows 10, the key changed but this didn't work either. If you happen to be in this situation you can still try though.
However, I found out that you can download Windows 10 Home/Pro from Microsoft itself. You are prompted for activation but Windows lets you skip that and from what I understood apart from some nagging and the inability to customize the desktop, it seems a fully working copy of Windows, which also updates. Since I really needed this for occasional testing, it wouldn't bother me. Of course I don't know if this will go on forever or not. Ideally I would like to have it activated. Perhaps will contact MS, who knows maybe they will be friendly enough to give me a key...