Menu
  • HOME
  • TAGS

How to take name from file with specific extension and use it as variable in batch script?

windows,variables,batch-file

for %%f in (*.pdf) do ( set x=%%f ) echo %x% Assuming there's only one PDF in the current directory....

How to extract first letters of dashed separated words in a bash variable?

linux,string,bash,shell,variables

This isn't the shortest method, but it doesn't require any external processes. IFS=- read -a words <<< $MY_TEXT for word in "${words[@]}"; do MY_INITIALS+=${word:0:1}; done ...

subtracting from multiple variables at a time

python,variables,syntax-error

Just move them to two separate lines if minutes >= 60: hours += 1 minutes -= 60 From PEP 8 Compound statements (multiple statements on the same line) are generally discouraged. For the sake of completeness, I will tell you that you can add ; to terminate a statement, so...

Maya MEL variables declaration and initialization

variables,maya,mel

You don't need to populate the variable, initializing it with a type declaration sets it to a default value (0 for ints, 0.0 for floats, and "" for strings). In general it's good practice to assign in place when the initial variable is meaningful: string $topCamera = "|top|topShape"; but it's...

Div with a simple variable height

javascript,html,css,variables,height

<?php $numberOfPurchases = getNumberOfPurchases(); // call the function that queries the database ?> <script> var defaultDivHeight = 10; var purchaseDiv = document.getElementById('purchaseDiv'); if (<?= numberOfPurchases; ?> > 0) { purchaseDiv.style.height = <?= numberOfPurchases; ?> * defaultDivHeight + 'px'; } else { purchaseDiv.style.height = defaultDivHeight + 'px'; } </script> I suggest...

VBA SUM Variable Range

excel,vba,variables,sum,range

Sub Test() Dim y As Variant Dim firstRow As Variant Dim lastRow As Variant lastRow = Range("C" & Rows.Count).End(xlUp).Row firstRow = Cells(lastRow, 3).End(xlUp).Row If IsNumeric(Cells(lastRow + 1, 1)) And IsEmpty(Cells(lastRow + 1, 2)) Then Cells(lastRow + 1, 3).Formula = "=SUM(C" & firstRow & ":C" & lastRow & ")" End If...

jQuery - Increase integer by using arrays content as the variable name

jquery,arrays,variables,integer

Just change increase[0]++ to window[increase[0]]++ ...

PHP Define var = one or other (aka: $var=($a||$b);)

php,variables,operators

Update I've managed to create a function for you that achieves exactly what you desire, allowing infinite arguements being supplied and fetching as you desire: function _vars() { $args = func_get_args(); // loop through until we find one that isn't empty foreach($args as &$item) { // if empty if(empty($item)) {...

Create variable execution time Java [on hold]

java,variables

No. You cannot create a variable, at execution time, with a particular name. However, you can use a Map, which probably does what you want. The get method will look up an entry, and the put method will set an entry. Example: Map<String, Integer> myMapOfThings = new HashMap<>(); String nameOfThing...

What code is required to swap a javascript variable (trailimage) to another when clicking within a website

javascript,jquery,image,variables,cursor

Try this Fiddle var trailimage = ["http://img2.wikia.nocookie.net/__cb20130626213446/elderscrolls/images/2/2d/TES3_Morrowind_-_Glove_-_Black_Left_Glove.png", "http://img2.wikia.nocookie.net/__cb20130626213454/elderscrolls/images/9/91/TES3_Morrowind_-_Glove_-_Black_Right_Glove.png"] $(function() { $(".logo").attr("src",trailimage[0]); $(document).mousemove(function(e) { $('.logo').offset({ left: e.pageX, top: e.pageY + 20 }); }); $(document).on("mousedown",function() { $(".logo").attr("src",trailimage[1]); })...

Python: Eval with undefined variables (2*x+x = 3*x)

python,variables,placeholder

You could use sympy for symbolic computation: In [126]: import sympy as sy In [127]: sy.simplify('2*x+x') Out[127]: 3*x To convert rationals to floats, use sy.nfloat: In [170]: sy.nfloat(sy.simplify('2*3+x+3/4')) Out[170]: x + 6.75 ...

How do I keep quotations in variable used with PHP string

php,string,variables

If Magic Quotes is On It automatically escapes incoming data to the PHP script. This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0. When on, all ' (single-quote), " (double quote), \ (backslash) and NULL characters are escaped with a backslash automatically. magic_quotes_gpc Affects...

Better coding of making a check each time function runs

javascript,variables

Removing a single if statement, especially considering it only occurs once per click will not effect running time at all. However for the purpose of discussion say it was performance critical, like if it was attached to onmousemove, then you can adjust your second approach with a small change to...

Variable value changing after returning from a function in C

c,variables,matrix

Update the function void allocate( int ***mat, int n, int m ) { int i; *mat = (int **) malloc( n * sizeof( int* ) ); for ( i = 0; i < n; i++ ) { ( *mat )[i] = ( int *) malloc ( m * sizeof( int...

Bind every line from two variables in a third variable in powershell

variables,powershell,powershell-v2.0

this is a rapid way (variables's lenght must be equal): $i = 0 ; $var3 = $var1 | % { "$_ $($var2[$i])"; $i++ } ...

SQL Repeated Condition in Two Tables

sql,variables,coding-style,condition

you can achieve it like this DECLARE @AccountId int; @AccountID=20; DELETE FROM Table_A WHERE FunctionId IN (Select FunctionId FROM Table_B WHERE [email protected]); DELETE FROM Table_B WHERE [email protected]; ...

Is there a variable type for comparators?

c#,variables,compare

The various operators you've listed do not have a type no. Objects have types. You've listed operators, which are themselves not objects, and so have no type. If you're interested in how the C# language uses operators, you can look at the language spec; section 7.3 of the C# 5.0...

PS pipe WorkingSet as variable

variables,powershell

Use Select-Object -ExpandProperty to grab just a single property from the process: $WorkingSet = Get-Process spiceworks |Select-Object -First 1 -ExpandProperty WorkingSet if($WorkingSet -gt 120MB) { # Send email } ...

Swift Reverse Geocoding using the Data

swift,variables,geocode

Your problem is most likely due to the fact that reverseGeocodeLocation is an asynchronous request made to Apple servers. What needs to happen is: You call reverseGeocodeLocation reverseGeocodeLocation finishes, starts its completion which calls a method passing the placemark you just recovered. In order to do that: @IBAction func btnInsertClicked(sender:...

Batch file %%i was unexpected at this time

variables,batch-file

If you are executing this directly in command prompt try this: for /f %i in ('wmic process where "name='chrome.exe'" get caption /format:value ^| find "chrome.exe" /c') do set var=%i for batch file left the double %...

Substitution of variable into link with many interior quotes - how to escape correctly

javascript,variables,escaping,quotes

Fix it to: <a href='#' onclick="return launchEditor('editableimage1','http://www.mywebsite.com/' + imgNamePassed);"/>LINK TEXT</a> Example: JSFiddle...

How do I include variable between {} brackets in a php preg_match?

php,variables,preg-match

Use double quotes instead of single quotes, and the variable will be substituted: preg_match("/^([^.!?]*[\.!?]+){0,$variable}/", $text, $abstract); ...

do while repeated region in variable php

php,variables

Do can do it by iterating it into a while loop and concat it and adding a comma near to it. $CountingQuery = "SELECT * FROM users"; $ExecutingCountingQuery = $Connection->query($CountingQuery); $Bcc = ''; // Declaring a Variable while($row = $ExecutingCountingQuery->fetch_array()) { $Bcc .=$row['email'].','; } echo $Bcc; // Now $Bcc is...

PHP global variable is not changing [duplicate]

php,variables,global

Your solution could look like this: <?php require_once("rpcl/rpcl.inc.php"); //Includes use_unit("forms.inc.php"); use_unit("extctrls.inc.php"); use_unit("stdctrls.inc.php"); //Class definition class Page1 extends Page { public $Label8 = null; private $someVar; public function __construct($application) { parent::__construct($application); //load from storage $this->someVar = $_SESSION['someVar']; $this->Label8->Caption = $this->someVar; } public function __destruct() { //save to storage $_SESSION['someVar'] = $this->someVar;...

SSIS “Failed to lock variable” error in File System Task within foreach Loop

variables,foreach,ssis,source,ssis-2012

The issue turned out to be that the parameter for the import file path was being used where the User::FilePath was needed in the source Connection Manager.

If a = b, what happens if each value changes respectively?

java,variables

What happens to b? Nothing happens to b. When you do a = b; you're copying the value stored in b and putting it in a. (You're not making a an alias of b.) When you then do a += 1; you're changing the value stored in a (and...

What is the best nomenclature for a task that “only happens once” or a task that “repeats”?

variables,theory,nomenclature

Repeat is definitely going to work, although I would probably use iterate or maybe recurrent; if it could be confused with a loop. Ad hoc is not a good choice in my opinion. I would go for onetime or simply put a non- in front of the other word (non-iterating,...

Increment Variable on horizontal UIScrollView slide

swift,variables,uiscrollview

I'm assuming you can't use the paging property of UIScrollView. Contrary to the previous answer, you will actually need two different swipe recognizers. See http://stackoverflow.com/a/7760927/5007059 I understand that you want to detect swipes on the scroll view. To accomplish this, you could add two UISwipeGestureRecognizers to your scrollView, one for...

Java: Assigning a variable its current value?

java,variables,optimization,value

the cost of calling the method isEmpty() (allocating new space in the thread stack etc) negate any gains. if you want to assign an empty String to the variable, its most efiicient to do so without the if statement.

AS3 Dynamic variable naming

actionscript-3,flash,variables,dynamic

You should use an array for this kind of list of variables. While you can create properties dynamically, you usually want to avoid it. Especially in your case, where the actual identifier of each variable is not a String, but a number. So why not use something that does exactly...

Get variable *value* instead of variable itself

javascript,variables

JavaScript has function scope for variables. If you want to use the same variable twice but it should not be the same reference, you need to put the code in different scopes (functions). So you could do this: button = document.getElementById("button"); button2 = document.getElementById("button2"); (function() { var x = 5;...

Problems with Flash 8 (AS2), Timelines, and Variable Scopes

flash,variables,scope,actionscript-2

The issue is likely that your Text fields are being unloaded (eg There are frame where they are not on the stage anymore), so when frame 1 comes around, it re creates them (which gives them the text that you put in on the keyframe). To work around this, In...

Global variables, Jquery

javascript,jquery,variables,scope

The following piece of code does the same you are trying to accomplish. This way you declare the global variables: oss, mainLogo and container outside the scope of document.ready(). var oss; var mainLogo; var container; $(document).ready(function(){ oss = $("#us"); mainLogo = $("#mainLogo"); container = $(".container"); oss.hide(); oss.fadeIn(1000); mainLogo.hide(); mainLogo.fadeIn(1000); container.find("#images").hide();...

How to use Dynamic Variables?

excel-vba,variables,dynamic

Y10 cannot be the name of variable (because it could be confused with cell Y10). Code that attempts to use such variable names will not work. Try other name, for example y_10 will be fine.

Replacing a variable in vba powerpoint

vba,excel-vba,variables,powerpoint-vba

FreeMan's got the right idea ... store the value in non-volatile memory. Luckily, PowerPoint has a feature that's perfect for this: Tags. With ActivePresentation .Tags.Add "ProjectID", Cstr(intProjID) End With The string version of intProjID is now a permanent "tag" attached to the presentation object. To retrieve it: MsgBox ActivePresentation.Tags("ProjectID") Each...

Defining variable with multiple values in parentheses uses 2nd value [duplicate]

javascript,variables,parentheses

Because that's how the comma operator works: It evalutes both its operands, and the result of the expression is the value of the second one. Note that this is very different from what you'd have if you didn't have the parentheses there: // Differs *significantly* from your example: var x...

Django : How to hide a variable in a template

django,variables,templates

In the template, {{ category }} is interpreted as Category.__str__() and a string is displayed. But in {% if category != "general" %}, category is an object that will always be different to the String "general". What you want to do is: {% if category.name != "general" %} Also, note...

Return Variable From Method

c#,variables,return-value

Just use the function itself to return the value. You do not need an additional output parameter. private static int runupdates(string arr) { updatestatement = ""; using (SqlConnection connection = new SqlConnection(SQLConnectionString)) { connection.Open(); using (SqlCommand command = new SqlCommand(updatestatement, connection)) { command.CommandText = updatestatement; int nummmm = command.ExecuteNonQuery(); connection.Close();...

C passing terminal commands and print answer

c,variables,terminal

system doesn't return the output the command you run but simply returns the exit status. You probably want to use popen() to read the output of the command you run. See an example in the linked man page. You also need to use strcmp for comparing strings, not ==....

Java Pass-by-reference not working?

java,variables,reference,pass-by-reference

The problem is that you aren't updating the reference in your Player class. When you store your Dimension in your Entity constructor you are storing a reference to that Dimension in memory. In your resetOverWorld() method you change the overworld and activedimension variables to point to a new OverWorldDimension but...

How do I use the Find function with a variable term, for example Run1, Run2, RunX

vba,excel-vba,loops,variables

Yes, you need a variable, and just concatenate it. Use something like this: Dim counter as long counter = 1 Cells.Find(What:="Run:" & counter, After:=Cells(1, 1), _ ...yaddayadda Or use it in a loop: For i=1 to 100 Cells.Find(What:="Run:" & i, After:=Cells(1, 1), _ ...yaddayadda Next i ...

php form mail function

php,email,variables,concatenation

As I mentioned in comments, you're overthinking this and there are a few simpler ways to go about this. Either by changing your whole block to: (no need for all those variables) $mail = " <h1> </h1><h2>Afzender:</h2><p> ( )</p><h2>Bericht:</h2><p> </p> "; then mail("$myEmail","$emailOnderwerp",$mail,... But, if you wish to continue using...

Call known function (with parameters) in class whose name is defined by string variable

java,function,class,variables

Your can use Reflection Object action = ???; // perhaps you need .newInstance() for action class // Hopefully you have a interface with performLogic String methodName = "performLogic"; try { Method method = action.getClass().getMethod(methodName, param1.class, param2.class); method.invoke(action, param1, param2); } catch (SecurityException | NoSuchMethodException e) { // Error by get...

Very weird behavior when using “var” keyword in an ajax request

javascript,ajax,variables,var

Cool, you discovered hoisting. MDN explains it as good as anyone: Because variable declarations (and declarations in general) are processed before any code is executed, declaring a variable anywhere in the code is equivalent to declaring it at the top. This also means that a variable can appear to be...

How to check for a variable name using a string in Python?

python,variables

>>> spam= [1,2,3] >>> stuff = [spam] >>> eval('spam') in stuff True DISCLAIMER : do this at your own risk. ...

Access to class instance variable

ruby-on-rails,ruby,variables

First of all, @randomUsrId refers to an instance variable, not a class variable. You can access it through an instance of the class, not direct on the class. For a class variable, you should use @@randomUsrId. What you are actually looking for is attr_accessor :randomUsrId, through this, you can read...

Why does the variable executes the window object right away and not store it instead?

javascript,variables,global-scope

Because you are storing the result of calling the function, not storing a function. This would be what you are after: var alertMe = function () { alert("I\'m being executed then stored to be called again, but why?"); }; And then when you want to call it: alertMe(); ...

Run 3 variables at once in a python for loop.

python,loops,variables,csv,for-loop

zip the lists and use a for loop: def downloadData(n,i,d): for name, id, data in zip(n,i,d): URL = "http://www.website.com/data/{}".format(name) #downloads the file from the website. The last part of the URL is the name r = requests.get(URL) with open("data/{}_{}_{}.csv".format(name, id, data), "wb") as code: #create the file in the format...

Having two arrays in variable php

php,mysql,arrays,variables,multidimensional-array

The explode function is being used correctly, so your problem is further up. Either $data[$i] = mysql_result($result,$i,"data"); isn't returning the expected string "2015-06-04" from the database OR your function $data[$i] = data_eng_to_it_($data[$i]); isn't returning the expected string "04 June 2015" So test further up by echo / var_dump after both...

Variable in html code

variables

You need to create a form in html. Basically, a form is a block which let user input some values (text, password, email, date, integer, file, ...) and that send these values, once submitted through a submit button, to a certain file that will process these datas. A classic example...

Matches in a string in Java

java,string,variables,match

String string = "40' & 40' HC"; if(string.contains("&")) System.out.println("Found"); replace .matches with .contains, i believe you are trying to check for a character in the string....

How to create an variable property based on the other property in the class

swift,variables,properties

Declare restaurantIsVisited with the lazy keyword. This will insure that it isn't created until it is accessed the first time, and by that time you will be able to ask restaurantNames for its count: class someClass { // This is a list of restaurant names var restaurantNames = ["Cafe Deadend",...

Writing PHP variable based on jQuery calculations and displaying predetermined value

php,jquery,list,variables,automation

The problem your having is the difference between server-side processing and client-side processing. An easy way to think about this is that PHP is handled before the HTML is even put on the screen replacing all the PHP parts with their variable contents. meaning that adding that php text with...

Calling a variable in Matlab without using the full name? [closed]

matlab,variables,filenames

Sure, you can use fieldnames to get a list of names, do your matching, then grab the field you want: f = fieldnames(Data01); match = regexp(f, '^SubData.*'); fieldnum = find(~cellfun(@isempty, match)); subdata = Data01.(f{fieldnum}); If the confusion is at the top level rather than at the substruct level, you can...

Why does $variable not return the most recently assigned value of variable in a shell script?

bash,shell,variables

Bash performs full variable expansion every time it is evaluating an expression. That is filename="Testfile_$variable" can be interpreted as Evaluate the expression "Testfile_$variable" performing variable expansion. Assign the resulting string to variable $filename. Therefore any further changes to $variable would not affect the value of $filename. You can somehow get...

Javascript variable not acting global

javascript,variables

Remove the <a> and have the event on the image, it's refreshing the page. You don't need to have it wrapped in an <a> tag for a onclick event: <img src="_images/next.png" onclick="test()" width="100" /> ...

MySQL multi SELECT query into form and then UPDATE

php,mysql,forms,variables,post

Success, I figured it out myself [= i had to add a row to the end of the table with the end value of $i <tr hidden> <td hidden> <input type="text" name="ivalue" style="width:120px;" Value="'; echo $i;echo '" style="width:70px" hidden></font> </td> </tr> Then this was in my <form action="senddata.php" file> i...

Is [ $var ] an acceptable way to check for variables set/empty in bash?

bash,shell,variables

./script one '' oops [ $2 ] will be false when $2 is the empty string. And as that other guy points out in a comment, bash will split both strings, opening up a range of issues, including potential security holes....

XSLT filePath with document as variable

variables,xslt,filepath

I am mostly guessing here, but supposing your XSLT stylesheet contains: <xsl:variable name="vpDocNr" select="'abc123'"/> <BodyPart filePath="C:\FileOutEmail\{$vpDocNr}.xml"/> then the result of this part will be: <BodyPart filePath="C:\FileOutEmail\abc123.xml"/> ...

Matlab - Constructor doesn't initliaize member values

matlab,variables,interface,constructor

Your constructor should be defined by function cObj = MeasurerComponent, without the PerformanceMeasurement prefix. This is just the way that packages are defined and used in Matlab - you add the prefix if using the class from outside the package, but not within the package (explained here: "Note that definitions...

Javascript: Resetting variable value created by form

javascript,forms,variables

your function resetForm(){ document.getElementById("form").reset(); } should be function resetForm(){ document.getElementById("form").reset(); msg.innerText=""; msg.className=""; } basically: you are not re-setting #message back to hidden which is where you start. And, I am also making sure that innerText is blank. ...

Is it necessary to Initialize / Declare variable in PHP?

php,variables,initialization,declaration

PHP does not require it, but it is a good practice to always initialize your variables. If you don't initialize your variables with a default value, the PHP engine will do a type cast depending on how you are using the variable. This sometimes will lead to unexpected behaviour. So...

Is there any way of protecting a variable for being modified at runtime in C?

c,variables,constants

You can make the result of the input be const like this: int func() { int op = 0; scanf( "%d", &op ); if( op == 0 ) return 1; else return 2; } int main() { const int v = func(); // ... } NB. Of course, there is...

gnuplot - get errors on fit parameters, get fit output values as variables, print variable to screen

variables,gnuplot,curve-fitting,data-fitting,function-fitting

Quoting the documentation: If activated by using set fit errorvariables, the error for each fitted parameter will be stored in a variable named like the parameter, but with "_err" appended. ...

Declare a php constant within a php variable

php,string,variables,echo,constants

$background_holder is just a variable you're assigning a variable to, no need to echo. Additionally, seems like you're trying to concat '/images/banner.jpg' to some base directory. If this is the case, you'd need to use the concatination operator (.`): <?php $background_holder = get_bloginfo('template_directory') . '/images/banner.jpg';?> background-image: url("<?php echo get_theme_mod('header_background_image', $background_holder);...

Assign the value from a text field into an int variable to do some math with other variables and then return it?

ios,xcode,variables,textfield,assign

The opposite of that would be getting converting string to float. You can do it with this init = [_Initial.text floatValue]; ...

calling string as variable in python

python,string,variables

It's probably better to use a dictionary here. Define one with segments = {}. Then you can create a SignalParam by keying into your dictionary with your segment number: segments[segment_number] = SignalParam() and use the object like this: segments[segment_number].frequency = 33 ...

String concatenation not working in HTML declaration of TABS through PHP variables [closed]

php,html,variables,tabs

It looks like you are missing " //your code echo '<div class="tab-pane" id="panel-"'.$a.'>'; ///should be echo '<div class="tab-pane" id="panel-'.$a.'">'; ...

Why is interface variable instantiation possible?

c#,variables,interface,instance

You're not instantiating an interface, but an array of that interface. You can assign an instance of any class that implements IDynamicCode<string> to that array. Say you have public class Foo : IDynamicCode<string> { }, you can instantiate that and assign it to an element of that array: var x...

When are variables evaluated when passing them into functions?

javascript,function,variables,arguments

My question is, if you wrapped the modifying methods in a function and passed objects[i] to the function, would objects[i] be calculated once and set as the local variable obj in the function? Yes. Once the value is passed, it's passed. It doesn't recompile the argument each time. Therefore,...

Deleting unnecessary symbols from variable in Jmeter

variables,jmeter,trim,symbols,beanshell

It can be done via Beanshell PreProcessor as follows: Add Beanshell PreProcessor as a child of the request which needs "another variable" Put the following code into the PreProcessor's "Script" area: String yourvar = vars.get("yourvar"); String anothervar = yourvar.replace("[","").replace("]","").replaceAll("\\\"",""); vars.put("anothervar",anothervar); Change "yourvar" and "anothervar" according to your variables reference names....

What is the scope of public variable in different methods of a same class in Console C#

c#,variables,scope

To help you a little i have redesigned your example : class Program { static void Main(string[] args) { var obj = new Data(); obj.setData("First", "Last"); obj.GetDataToXml(); Console.ReadLine(); } } class Data { public string FirstName { get; set; } public string LastName { get; set; } public void setData(string...

How can I use a variable to get an Input$ in Shiny?

r,variables,csv,shiny

input is just a reactivevalues object so you can use [[: print(input[[a]]) ...

PHP: How to use function to either echo result or to save it in a variable (partially working)

php,function,variables,echo

Just return the value in the function instead of echoing it: function fetchTransMain($trans, $itemID){ foreach($trans as $key => $val){ if($val["ID"] == $itemID){ return $val["trans"]; } } } Then, when you want to print it you do: echo fetchTransMain($trans, someID); Otherwise you do: $someVariable = fetchTransMain($trans, someID); ...

Need Help in Python Variable updation (Pygame module)

python,python-2.7,variables,python-3.x,pygame

You are confusing the event KEYUP with the UP key. The event KEYUP occurs when a key (any key) is released. The event KEYDOWN occurs when any key is pressed down. In you code, this means that when the UP key is pressed down, the speed is set to 0.1,...

JMeter 2.10 Random Variable that gets data from string

variables,random,jmeter

Your code looks good, the only possible failure point is your erroridcox variable not being set. Add a Debug Sampler and View Results Tree listener to double-check erroridcox and rnd_erroridcoxvariable values. Also you can put debug(); function at the beginning of your script and look into STDOUT to observe its...

Calling PHP variable as function value

javascript,php,jquery,variables,sharepoint

I tried what MattyF and Venkat suggested, and I couldn't get it to work, and what I ended up doing was creating a solution using Java alone. var day = new Date().getDate(); var checkActive; if (day % 2 == 0) { // If the day number is Odd, we will...

How to change css image via php depending on weekday

php,html,css,variables

Instead of <img> place another div inside <div class="image center"> and place an image in its background depending on the day Like this <div class="image center"><div class="image1"></div></div> and your css will be <style type="text/css"> .image .image1{background: url(http://www.mydomain.de/img/<?php $day = strftime('%A'); if($day == 'Monday') echo 'montag'; elseif($day == 'Tuesday') echo 'dienstag';...

Prolog- singleton variable in branch warning

variables,prolog,singleton

TL;DR: Prolog is right. And you really are doing the best taking the messages seriously. You are using if-then-else in an unconventional manner. For this reason it is not that simple to figure out what is happening. When I say listing(check) I get the following: check(A, B) :- ( related_to(A,...

read variable excel data into variant with the same format

excel,vba,excel-vba,variables,data-structures

You could force test to be an array with only one cell, if the last column is B or less : ' Define Last Column with a value LastCol = Sheets("Filter").Cells(20, Sheets("Filter").Columns.Count).End(xlToLeft).Column Col_Letter = Split(Cells(1, LastCol).Address(True, False), "$")(0) If LastCol <= 2 Then ReDim test(1 To 1, 1 To 1)...

Undefined local variable post

ruby-on-rails,ruby,variables,undefined,local

You need to use partial: when you pass locals to a partial as follows: <%= render partial: 'post', locals: { post: post, user: @user} %> I hope this will help you....

Compiler modifying a variable without adressing it

c#,variables,dictionary

What you are currently doing: Dict2 = Dict1; Is reference copying, so both Dict1 and Dict2 are pointing to the same location. You can create a new copy like: Dict2 = Dict1.ToDictionary(d=> d.Key, d=> d.Value); Remember, if your Key and Value are custom objects (based on some class), in that...

How to get value from property in BeanShell (jmeter)

variables,jmeter,beanshell

In the first Thread Group: props.put("erroriden", vars.get("erroriden1")); In the second Thread Group: String[] erroriden = props.get("erroriden").split(","); JMeterVariables scope is limited to the current thread group only JMeter Properties are usual Java Properties which are global for JVM instance See How to use BeanShell: JMeter's favorite built-in component guide for more...

Importing .kit file (variables) into .kit file (css)

css,variables,import,codekit

I figured out that the import tag inserted into a css document gets included into the first declaration because there is no end to it and it acts like it's part of the declaration. I simply put css comment tags on the import itself which allowed the variables to still...

PHP / JavaScript: How to pass variable from one page to another

javascript,php,jquery,variables,get

You can use cookies to do so setcookie(name, value, expire, path, domain, secure, httponly); i.e.: setcookie('language', 'german', 60000,"/"); and then check this wherever with $_COOKIE["language"] http://php.net/manual/en/features.cookies.php reference...

C# PictureBox variable in a class

c#,variables,picturebox

A class would be easier, and I would also recommend using a List instead of array. Example: class Container { public PictureBox picture { get; set; } public double number { get; set; } } List<Container> PicturesAndNumbers = new List<Container>(); To add things to the list you will need to...

SQL Multiple LIKE Statements

sql,sql-server,tsql,variables,like

WITH CTE AS ( SELECT VALUE FROM ( VALUES ('B79'), ('BB1'), ('BB10'), ('BB11'), ('BB12'), ('BB18'), ('BB2'), ('BB3'), ('BB4'), ('BB5'), ('BB6'), ('BB8'), ('BB9'), ('BB94'), ('BD1'), ('BD10'), ('BD11'), ('BD12'), ('BD13'), ('BD14'), ('BD15'), ('BD16'), ('BD17'), ('BD18'), ('BD19'), ('BD2'), ('BD20'), ('BD21'), ('BD22'), ('BD3'), ('BD4'), ('BD5'), ('BD6') ) V(VALUE) ) SELECT * FROM tbl_ClientFile...

read Excel cells into Stata global as variables

excel,variables,import,stata

I would recommend reading the variable names into a local, and use only global if strictly necessary. One way to do that is to use import excel along with levelsof: clear set more off // import from MS Excel and create local import excel using myvars.xlsx, cellrange(B2:B5) firstrow levelsof myvars,...

Java Variable Scope - Instance and class variables

java,variables

ClassVar is declared static. public static int classVar = 25; This means that it is not tied to an instance of Roughwork. It is a global variable if you will. You can call this variable even from other classes in your application like this: Roughwork.classVar To get your expected behaviour,...

Pass variable from PHP into HTML [duplicate]

php,html,variables

You should generate your HTML page from PHP file too. That's how php works. That way you can print out PHP variables. HTML is no programming language - it's just markup language...like ...hmmm..XML.

Variable value assign and retrieve

c#,variables,properties

You can look at the IL if you want. Here's a simple sample using linqpad: void Main() { int i ; i=5 ; i.Dump(); i_p = 6; i.Dump(); } // Define other methods and classes here public int i_p {get; set;} and here's the IL for it: IL_0000: nop IL_0001:...