Category "variables"

How to use like in MySQL query in Grafana?

I am working in grafana with MySQL. I have a template variable and it has multiple values and I want to use that template variable with MySQL query using 'like'

How do I 'declare' an empty bytes variable?

How do I initialize ('declare') an empty bytes variable in Python 3? I am trying to receive chunks of bytes, and later change that to a utf-8 string. However, I

SQL Declaring Variables in a View

I have created a view which uses dynamic variables in the where statement below. DECLARE @wkFileYear SMALLINT = (select fs.FileYear from dbo.FileSemesters fs

How to put php code inside opening and closing shortcodes

I am working on a site and I am using a shortcode in my template files that has an opening and close. I would like to know if its possible to place wordpress th

Are Python variables pointers? Or else, what are they?

Variables in Python are just pointers, as far as I know. Based on this rule, I can assume that the result for this code snippet: i = 5 j = i j = 3 print(i) wou

const vs constexpr on variables

Is there a difference between the following definitions? const double PI = 3.141592653589793; constexpr double PI = 3.141592653589793; If not, which styl

how does fscanf works with different variable types?

I was looking at the MSDN documentation for fscanf. I tried changing the sample code in the documentation, but it didn't work as I expected. If, for example, I

Bash variable substitution and strings

Let's say I have two variables: a="AAA" b="BBB" I read a string from a file. This string is the following: str='$a $b' How to create a new string from the

Passing Variable through JavaScript from one html page to another page

I have two pages - "page 1" and "page 2". On page 1 there's an text-box with a value of e.g. 100 and a button at the end. By pressing the button I want javascr

Use a variable's value in a sed command [duplicate]

I can't seem to use a variable in a sed command, for example: sed "24s/.*/"$ct_tname"/" file1.sas > file2.sas I want $ct_tname the varia

Windows Batch: Split String to individual characters to variables

in Windows Batch, if I had a variable (length can change) that was, for example: "hello world!" is it possible to "split" the variable so each character is its

Pythonic implementation of quiet / verbose flag for functions

In an effort to write pythonic code, I wonder is there a style guide covering the use of quiet or verbose options for functions. For example, in my Python pack

how to override the equals() method when you have to compare 7 instance variables? [duplicate]

I am currently doing my programming assignment. But there is one step that i don't quite understand. There are 7 private instance variables an

How to log a variable's name and value?

I am looking for a way to quickly print a variable name and value while rapidly developing/debugging a small Python script on a Unix command line/ssh session.

Powershell Invoke-sqlcmd In-script Variable override

I am using the following: Powershell Command: Invoke-Sqlcmd -AbortOnError -InputFile "C:\FullPath\SQLQuery.sql" -ServerInstance WPU8V9011532 -Variable "PREF = '

How can I get the correct output in this program?

(1)Prompt the user to enter two words and a number, storing each into separate variables. Then, output those three values on a single line separated by a space.

Make a variable from what's in a text file

So I want to make a variable from the contents of a text file. E.g The text file contains the sentence "Ask not what your country can do for you ask what you ca

Getting the name of a variable as a string

This thread discusses how to get the name of a function as a string in Python: How to get a function name as a string? How can I do the same for a variable? As

Subtracting from a variable

I have code setup so that a player clicks an image which gets counted and if they have more than 30 it will allow them to buy an auto clicker for 30 clicks whic

Posix shell: distinguish between empty and not existing variable

In pure /bin/sh how can I distinguish between an empty variable, an unset variable and a not existing (not defined) variable. Here are the case: # Case 1: not