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...
Is it possible to use a variable in the AssignFile command? Yes. The second parameter of AssignFile has type string. The expression cFileDir + '\' + sFile has type string. FWIW, AssignFile is known as a function rather than a command. Getting on top of terminology like this will...
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.
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...
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",...
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...
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]; ...
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...
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,...
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,...
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)...
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);...
Use double quotes instead of single quotes, and the variable will be substituted: preg_match("/^([^.!?]*[\.!?]+){0,$variable}/", $text, $abstract); ...
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...
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,...
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;...
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 %...
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....
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...
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...
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();...
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. ...
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 } ...
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...
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...
Are you sure the format=1 is correct? According to documentation - for named internal nodes we will use format 1 Are you sure your newick tree has named internal nodes? If not, try without passing any value to the format argument. Also, please make sure that the filename is either...
The declaration in your "inner" function is missing the var keyword. That makes val2 a global symbol.
You can get the complete file path for the script resides using __file__ variable , then you can use os.path.abspath() to get the absolute path of your file , and then use os.path.join() along with your current path , and the parent directory descriptor - .. in most operating systems...
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....
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...
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.
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...
for %%f in (*.pdf) do ( set x=%%f ) echo %x% Assuming there's only one PDF in the current directory....
javascript,jquery,variables,object,key
In the same way you already used it with optionSet1 – using the bracket notation: signState = {}; signState[optionSet1] = {}; signState[optionSet1][name1] = value1; ...
./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....
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...
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';...
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 ...
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...
input is just a reactivevalues object so you can use [[: print(input[[a]]) ...
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...
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....
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,...
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.'">'; ...
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 ==....
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...
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.
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. ...
From https://source.android.com/devices/tech/dalvik/dalvik-bytecode.html: Because, in practice, it is uncommon for a method to need more than 16 registers, and because needing more than eight registers is reasonably common, many instructions are limited to only addressing the first 16 registers. When reasonably possible, instructions allow references to up to the first 256...
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;...
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:...
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); ...
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...
variables,powershell,powershell-v2.0
this is a rapid way (variables's lenght must be equal): $i = 0 ; $var3 = $var1 | % { "$_ $($var2[$i])"; $i++ } ...
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...
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:...
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...
jquery,arrays,variables,integer
Just change increase[0]++ to window[increase[0]]++ ...
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,...
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...
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...
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...
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,...
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 ...
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...
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...
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...
The specific error you are asking about is because of the missing colon: And card1 cannot be called. if guess==card1() count+=1 Should be if guess==card1: count+=1 There is also a missing closing bracket on the guess: guess = int(input(""" Pick One! 1:'Crown', 2:'Anchor', 3:'Heart', 4:'Diamond', 5:'Club', 6:'Spade', 0:'Quit', """)) ...
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" /> ...
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 ...
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...
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...
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();...
python,user-interface,variables,radio-button
Use SetValue(self, False) to set it to unchecked. You can read more about it here
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...
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...
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...
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...
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...
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)) {...
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...
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...
>>> spam= [1,2,3] >>> stuff = [spam] >>> eval('spam') in stuff True DISCLAIMER : do this at your own risk. ...
javascript,variables,escaping,quotes
Fix it to: <a href='#' onclick="return launchEditor('editableimage1','http://www.mywebsite.com/' + imgNamePassed);"/>LINK TEXT</a> Example: JSFiddle...
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]); })...
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...
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...
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...
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...
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"/> ...