2,456 questions
0
votes
1
answer
53
views
How can I change images on click in a specfic order, with the final image being randomly selected from a folder?
I am very new to javascript, so help is much appreciated! On my website, I want to have seven photos that cycle on click. So every time the photo is clicked, it is replaced by the next photo in the ...
1
vote
1
answer
147
views
Autocomplete for nested vars imported from a library
I’m building a Google Apps Script library and I’d like to expose some constants as a nested object.
var CONFIG = {
LEVEL0: {
LEVEL1_A: 'A',
LEVEL1_B: 'B'
}
};
When I use this library in ...
0
votes
2
answers
87
views
countback from date is negative, how to make numbers positive? [closed]
i am trying to use a countback from a certain date, and want it to read something like (100d, 10hrs, 10sec). the countback does this fine, except it reads as (-100d, -10hrs, -10sec). is there a way to ...
1
vote
0
answers
80
views
Givens Rotation on Python
I’m replicating Shapiro & Watson (1988) and need to impose the long-run restriction with a Givens rotation.
The target identity is
C_inf@B=C_inf(P@Q_total)=(C_inf@P)@Q_total=A@Q_total
Yet my code ...
1
vote
1
answer
103
views
What sequence does JS go through trying to access a variable
Variable declared with var and functions in script at global scope level, are a able to accessed with variable_name and window.*variable_name* .
var foo = "10";
let bar= "20";
...
0
votes
0
answers
57
views
error when using let and var to store php value [duplicate]
<script>
let checked = <?php echo $row["restriction"] ?>;
console.log(checked);
</script>
When I was using a JS variable with let to store a php value, this output ...
0
votes
0
answers
120
views
How to Perform Out-of-Sample Forecast for a Hybrid VAR-LSTM Model?
I have built a hybrid model that combines a Vector Autoregressive (VAR) model and a Long Short-Term Memory (LSTM) network. The VAR model is used to capture linear dependencies between macroeconomic ...
0
votes
1
answer
45
views
AttributeError: 'SVARResults' object has no attribute 'k_exog_user'
I am using the following code to conduct a SVAR estimation:
data_q = pd.DataFrame({'GDP': GDP,
'CPI': CPI_q,
'Interest_rate': Interest_rate_q,
...
1
vote
0
answers
43
views
SVAR from statsmodel.tsa: if len(A_guess) != n_masked_a: TypeError: object of type 'int' has no len()
I am using the following code to conduct a SVAR estimation but it keeps crashing, always the same kind of error:
len(A_guess) != n_masked_a: TypeError: object of type 'int' has no len().
CAN ANYONE ...
2
votes
1
answer
368
views
Replace var with explicit type after applying Code Cleanup in Rider
I use Rider. What I would like to do is to replace var with explicit type after using Reformat and cleanup code.
For example, I have the following code snippet:
var number = 1;
I've set the following ...
2
votes
3
answers
170
views
C# var keyword not behaving as expected
The code below loops over an XmlNodeList and prints the text content in them. It works as expected:
using System;
using System.Threading.Tasks;
using System.Xml;
namespace cabinet;
public class ...
0
votes
0
answers
29
views
I reduced a dataframe of times series, and now get "Error in replCmat4" and "Incompatible methods" error messages
I want to estimate a panel VAR model on a large set of data (130 companies, 6 variables, 2 identifiers over 10 years), so large I had to cut my sample by half to have enough memory to run the function....
3
votes
0
answers
50
views
Removing Lombok's `var` in an Android project
Our codebase is Android, and it targets JDK 17.
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version("0.8.0")
}
java {
toolchain {
...
1
vote
2
answers
125
views
does nodejs's eval() would change the behavior of var keyword?
all these code snippets run in nodejs.
below are demo1.js, ps: run these code in nodejs rather than browser js engine
// demo1.js
var1 = 'var1'; // in nodejs or Chrome-V8 js engine, this line would ...
1
vote
1
answer
98
views
How can foreach know the item type of a 2D array when it's doesn't implement IEnumerable<T>?
I can't seem to reconcile these two observations:
A 2D array (T[,]) can't be assigned to a variable of type IEnumerable<T>
In foreach(var item in (T[,])array2d), the compiler knows that var is ...
0
votes
1
answer
65
views
PineScript - Plot once when condition is met and only plot again when a condition in the opposite direction is met
I would like to plot when a condition, in either direction, is met and then only make the next plot when the condition is met in the opposite direction. My current code plots every time a condition is ...
3
votes
2
answers
61
views
How to implement something like this in C#: var provider = options.IsBinary ? new BinaryProvider() : new NonBinaryProvider()
It is possible to implement in C# something like this:
var provider = options.isBinary ? new BinaryProvider() : new NonBinaryProvider()
Both BinaryProvider and NonBinaryProvider implement IProvider&...
0
votes
0
answers
62
views
JS Function return undefined why?
I need to add +1 to each card clicked but
Function result 3 as undefined why?
what is wrong with my code?
card2 and card3 function recive each variable inside each click function
inside function ...
-1
votes
2
answers
71
views
How to revert Java 10 "use local varaible type inference" via save actions?
I checked out the Java 10 option of "use local variable type inference" (JEP 286), but I think it is terrible to replace all type information with just the keyword var - was so much better ...
1
vote
1
answer
75
views
How to get a formatted line from a dictionary var?
I'm pretty new to Ansible and I'm not sure how to get it right.
To start with, I have implemented this dictionary var for an exemple. There is 2 values but it could be a greater number:
tf_ETCD:
1:
...
1
vote
0
answers
134
views
How to Automatically Update a View When a Variable Changes in Swift
I have a Flutter Application that regularly sends me "messages" with Data. In my ViewModel I have the code to decode the data and in my ContentView I make an @State private var viewModel = ...
0
votes
1
answer
97
views
What means -z ${var+x}? [closed]
I would like to know what means -z ${var+x}
if [ -z ${VAR+x} ]; then
echo "Variable VAR is unset."
else
echo "VAR = ${VAR}."
I would like to understand in which case I ...
1
vote
1
answer
46
views
caret:: varImp() for caret::bagFDA() in R: Error in .(var) : could not find function "."
I am successfully running caret::bagFDA() in R, but I cannot use the caret::varImp() function to identify the most important variables.
The reproducible example is quite simple:
library(tidyverse)
...
0
votes
1
answer
40
views
how using css variable with SASS rails interpreter? (conflict)
I'm using sass-rails gem and I try to use css variable like this :
--h: 198
--l: 38%
--c: hsl(var(--h), 100%, var(--l))
background-image: linear-gradient(to right, var(--c) 0%, #000 100%)
...
0
votes
2
answers
118
views
How can I report a VARX model (MTS class) with modelsummary (or other LaTeX table packages) in R?
Consider an example of a VARX model estimate in R, using MTS package:
library(tidyverse)
library(MTS)
library(modelsummary)
library(vars)
library(stats)
set.seed(10)
ts1 <- rnorm(200, mean = 10, ...
0
votes
1
answer
61
views
BGtest for VAR model in R gives me error message
I am new here, but I checked other threads and have not found solution so far.
I am trying to make a VAR model in R, it looks like this:
library(vars)
library(lmtest)
# from loaded data I create ...
0
votes
4
answers
62
views
Did I use this JS variable correctly in the html document?
<head>
<script>
var bgcolor = #ff0000
</script>
</head>
<body style="background-color: var(--bgcolor);">
</body>
I want to make a JS function ...
0
votes
1
answer
61
views
use my calculator data as variables in chart
I have a calculator built in Jquery, I would like to pass these numbers to my chart js program and have the chart dynamically adjust as new results show in the calculations,
how would I do this with ...
0
votes
1
answer
125
views
jMeter - How to escape quotes?
I need help to escape quotes in jMeter!
I've to put into a var some words with quotes, for example "dummy", so I've tried with:
vars.put("example", '"dummy"')
vars.put(&...
-2
votes
1
answer
30
views
How Would I Make the (x,y,width,height) of a strokeRect a Var?
I'm trying to make a square in a canvas that moves(Tetris), and I want to know if there's an alternative to making a independent fillRect. My line of thought is that I can make the fillRect() position ...
-1
votes
1
answer
115
views
Having Trouble Figuring out how to get text into my drag and drop scripts in unity
So I am a beginner at unity and am slowly making a game but, I ran into this problem and I can't seem to figure out how to solve it. You see I have several text Mesh Pro UGUI objects within a canvas ...
0
votes
0
answers
140
views
Lua error "mutating non-standard global variable 'love'"
I'm starting to code with love2d, so I installed love2d with the love2d support extension, there is no problem running the code and it works perfectly (I can draw hello world and have it appear on a ...
1
vote
1
answer
172
views
Scala case class: Is public var member possible?
Scala noob here, but while learning about case classes, I see the members are by default read-only. However, if you add var, they become private; and there is no public access modifier. Any way to ...
0
votes
0
answers
45
views
"OR" in var selector
I've trying to customise a script that normally triggers a GTM tag to populate a form's hidden field with a variable (session_url_campaign).
Here is the script:
<script>
(function () {
var value ...
-1
votes
2
answers
72
views
Dax code in Power BI for getting specific column
I need to get specific column which rows are depended on another column. Here is the raw example table,
Affiliate
Brand
x17
B
x17
B
x17
B
x17
B
x17
B
x17
B
1x2
B
1x2
F
1x2
F
1x2
B
1x2
F
1x2
B
1x2
F
...
0
votes
3
answers
114
views
JS var with multiple values
Something I can't understand :
I got a function opening the same page <div id="page"> but with different contents depending the clicked button in menu:
<nav>
<button ...
0
votes
0
answers
162
views
What is the difference between using is with a specific type and var?
What is the difference between these 2 code snippets? One with the var works but the one with the type string gives an error.(use of unassigned variable error) Aren't they both unassigned until ...
-3
votes
1
answer
124
views
dax formula/calculate days since last orders
days since last orders =
VAR currentCustomers = MAX('stats de vente'[client])
VAR currentDate = 'stats de vente'[date]
VAR lastOrderDate =
CALCULATE(
MAX('dim date'[Date]),
FILTER(
...
3
votes
1
answer
167
views
VS 2023 'var' suggestions
foreach (int dirId in dirIds)
{
serieIds.AddRange((from serie in TableDataGrid.TargetBaseContext.Series
where serie.RepertoireId == dirId
select serie....
0
votes
1
answer
212
views
How can I efficiently import all global variables from external globals.js file in JavaScript?
I need to import hundreds of global variables from global.js to the main.js.
Does JavaScript have an efficient method to import all exports from that file at once, without importing them one-by-one?
I ...
2
votes
1
answer
631
views
Non-state variable inside SwiftUI View
I just rewatched Demistify SwiftUI and noticed that some of the examples use variable properties inside a SwiftUI View, without using the @State property wrapper. For example (around 19.04):
struct ...
0
votes
0
answers
842
views
Statsmodel SVAR (python) - unable to add exogenous variables?
I hope you can help me with an issue I am having with the python time series code for SVAR from statsmodels.tsa.vector_ar.svar_model.
When I run the SVAR command below it appears that I am unable to ...
0
votes
1
answer
86
views
variable stores EQUALS instead of string | python based interpreter
I've been making an interpreter in python and I've run into a problem, it identifies strings, variables, numbers and expressions. while testing the .lang file I noticed it outputted {'$var': 'EQUALS'}...
0
votes
0
answers
35
views
What is the scope of a variable declared with 'var' inside of a function in JavaScript [duplicate]
I saw another post with the same question and it seemed to have differing explanations. Online resources also seem to have conflicting explanations, unless I am misunderstanding something.
MDN says:
&...
-3
votes
1
answer
65
views
Difference between var Foo struct and type Foo struct [closed]
I have hard time to understand what is the diffrence between:
var requestPayLoad struct {
Email string `json:"email"`
Password string `json:"string"`
}
and:
...
0
votes
1
answer
213
views
Check if a variable is redefined by Tcl
In my script, I will source other owner's TCL script.
I try to check all variable if redefined in their tcl script file, Here I try in my script:
proc trace_var {args} {
set frame [info frame];
...
2
votes
1
answer
55
views
Scopes captured by an EventListener include all let variables but not var variables?
I have the following code for attaching an event listener to a html element. I understand that the callback for this event listener forms a closure with its lexical environment.
var submit = document....
0
votes
1
answer
393
views
R - Error on one device only: Error in chol.default() : the leading minor of order is not positive definite, BVAR
I am estimating an BVAR model in R and get the following error:
Error in chol.default(V_post) : the leading minor of order 1 is not positive definite
Thats actually not the problem, since I work ...
0
votes
2
answers
74
views
Problems accessing var in kotlin object (singleton)
Having this object:
object BarManager {
private var bars = mutableMapOf<String, Bar>()
}
Can't access bars like this:
BarManager.bars[name]
It gives me this error:
Cannot access 'bars': ...
1
vote
1
answer
50
views
IIFE strange behavior linked to variables declared with let or var
I try to understand why the variable 'Permissions' will be typeof 'function' when Permissions declared with var but typeof 'object' when declared with let (which is the excepted behavior)
With 'var' - ...