How to set value 1 (integer) into an variable inside IF clause in ASP classic? [closed] - asp-classic

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed last year.
Improve this question
I'm currently working on a webpage using ASP Classic.
I have created an If statement, if the company id is equal to 1, then the variable receives a connection.execute.
Else, the variable must receive an fixed value of 1.
For some reason it's not working. I've tried to google the correct syntax for such case, but I haven't been successful... here is the part of the code I have just told you guys about:
<%
Dim integrated_code
if SESSION("Company_ID") = 1 Then
set integrated_code = connection.execute("SELECT TOP 1 ID_BLABLABLA FROM BLABLABLA")
Else
set integrated_code = 1
End if
%>

Lose the "set", at least for the simple variable. The other one depends on the nature of "connection".
<%
Dim integrated_code
If Session("Company_ID") = 1 Then
Set integrated_code = connection.execute("...")
Else
integrated_code = 1
End If
%>

Related

How to solve key issue of API [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
Hi I try to call some data using API but it shows error message of "invalid key". But In the function I didn't figure out where I can input my key. The code is shown below:
sahie_years <- getCensus(
name = "timeseries/healthins/sahie",
vars = c("NAME", "PCTUI_PT"),
region = "state:01",
time = "from 2006 to 2018")
head(sahie_years)
Can anybody have some ideas?
See documentation here for setting up your API key.
You need to sign up for an API key here.
Once you've done that you can either specify your API key by setting an environment variable using Sys.setenv(CENSUS_KEY="YOUR_CENSUS_KEY_GOES_HERE"), or
just set it directly in your getCensus call by adding the argument key = "YOUR_CENSUS_KEY_GOES_HERE".
For API keys in general, it is often easiest to set them in a .Renviron file, which will make them available in each session using Sys.getenv.

Firebase Database Update creating duplicate node [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a users object, in that I am trying to update a specific node(status) by using the firebase update(payload) method. But when I try to do that, instead of updating the value in the parent node, it creates a new child node(duplicate node) with the value being updated there.
let firebaseApp = firebase.initializeApp(firebaseConfig);
let uniqueID = "OEHCrSnKFrd87JDivvA0sLMnj8u1"
firebaseApp.database()ref("users/" + uniqueID).update({
status: false
})
Duplicate node image
On .update() you have to specify the path for the key.
try the following:
let firebaseApp = firebase.initializeApp(firebaseConfig);
let uniqueID = "OEHCrSnKFrd87JDivvA0sLMnj8u1"
let updates = {};
updates["/status"] = false;
firebaseApp.database()ref("users/" + uniqueID).update(updates)

How to access array items in VBscript dictionary [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I have a dictionary object in UFT (VBScript) where it contains items that is array. I want to know how to iterate thru every element in that array item that is refered by key.
Below is the example of my dictionary having items that is array
Set NodeValues = CreateObject("Scripting.Dictionary")
NodeValues.Add "Nodename", Array("EMS", "ACM") 
NodeValues.Add "MSW", Array("0x31,0x32,0x33,0x34" , "0x25,0x25,0x12,0x12")
NodeValues.Add "SBL", Array("0x35,0x32,0x30,0x31" , "0x45,0x55,0x22,0x92")
NodeValues.Add "Data", Array(array("0x21,0x21,0x21", "0x11,0x11,0x22") , array("0x45,0x55,0x22,0x92","0x25,0x65,0x25"))
Since this dictionary is generated dynamically am not sure how many elements it will have in array. Now i need to loop thru all the elements in array to find my required elements
For example. How do I iterate thru all the elements in Array of Nodename ( key) untill i find EMS. I tried different ways to access but no success.
Please help me with solution.
To check if "EMS" is found in the array stored for the key Nodename, you can check the following code:
For Each element In NodeValues.Item("Nodename")
If StrComp(element, "EMS", 1) = 0 Then
MsgBox "found"
Exit For
End If
Next
To get the Index:
arrTemp = NodeValues.Item("Nodename")
blnFound = False
For i = 0 To UBound(arrTemp)
If StrComp(arrTemp(i), "EMS", 1) = 0 Then
blnFound = True
Exit For
End If
Next
If blnFound Then
MsgBox "Index: " & i
Else
MsgBox "Not found"
End If

Meaning of flag code "SWTED" of unix process? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Code of proc.h.
The S of SWTED probably means stat. What about WTED? Is it the abbreviation of word watched?
In UNIX 7 the SWTED flag is used in two places:
Inside ptrace(), the SWTED flag is cleared before running the child process
ptrace()
{
...
p->p_flag &= ~SWTED;
setrun(p);
...
}
Inside wait(), if the process is stopped (traced) and the SWTED flag is cleared, then flag will be set, and its PID and signal passed back.
wait()
{
...
if(p->p_stat == SSTOP) {
if((p->p_flag&SWTED) == 0) {
p->p_flag |= SWTED;
u.u_r.r_val1 = p->p_pid;
u.u_r.r_val2 = (fsig(p)<<8) | 0177;
return;
}
continue;
}
...
}
That means SWTED is set when a traced process is used in wait(), thus most likely meaning waited. (SWAIT already exists so the name can't be used.)

How to trying to avoid message from device if The message is same [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
How to try to use ban message from device if The message is same .
I want to get message from device like "OK" While it is connect . Then it will respond to me message "OK" . Device permenently send me message "OK" after send new message. How can I avoid this message.
var list = new List<string>();
...
// in the loop or other repeating code
list.Add("OK");
...
// at the end of code
var summary = string.Join(". ", list.ToArray());
gotNewmesage(summary);
Istead of showing a message directly, collect all messages and show them at the end of the action/method.
Example:
var list = new List<string>();
...
// in the loop or other repeating code
list.Add("OK");
...
// at the end of code
var summary = string.Join(". ", list.ToArray());
gotNewmesage(summary);
If you want to avoid duplicates, check it before adding a message, for example
if (!list.Contains("OK"))
list.Add("OK");

Resources