undefined

Typescript: getting an undefined value

独自空忆成欢 提交于 2019-12-24 19:33:07
问题 I seem to have a problem I can't solve. I want 'dialogTitle' variable to also display the startHour and startMinute variables alongside the title variable. However, I seem to get the title and 'undefined' twice after the title. What should I do? event-form.component.ts import { Component, Inject, ViewEncapsulation } from '@angular/core'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; import { MatColors }

php undefined variable, doesnt get unset

天涯浪子 提交于 2019-12-24 19:15:54
问题 The variable $WebSiteDirectory never gets unset how ever i still get an error message the variable gets set in "/../Include/ini.inc.php": $WebSiteDirectory = "mydir\"; $newLine = "<br />"; $phpNewLine = "\n"; the place its getting stuffed up is : echo $WebSiteDirectory; // this line is fine function theFunction($VAR) { $dir = $WebSiteDirectory."my other dir"; // this line gets an error var_dump($dir); return file_exists($dir); } not sure there the error if forming. However, i also reuse

Is it necessary to use the “typeof” operator to check if a global variable exists?

Deadly 提交于 2019-12-24 13:58:59
问题 When I'm writing code that relies on objects created by another script file referenced from the same page I often find myself having to test for the existence of some global variable or another. I'd expect that the logical idiom to do that would be as follows: if (window.myLibrary) myLibrary.someFunction(); However after some research on stackoverflow, the consensus seems to be that the correct idiom is this: if (typeof myLibrary != "undefined") myLibrary.someFunction(); This idiom is given

Batch nested If statement error with not defined variables

亡梦爱人 提交于 2019-12-24 13:58:08
问题 I have a problem with a simple batch script. See: SET TEST= IF NOT DEFINED TEST ( SET "TEST=1" ) ELSE ( IF %TEST% LSS 1 ( SET "TEST=1") ) Here the if in the else branch failes, because the variable TEST ist not defined. But the else branch even shouldn't been executed if the variable TEST isn't defined!? What is here the problem? (I knew, that this code would work, if I leave the else and write it under the if statement, but then this code get's executed every time.) How to solve this problem

How to check for multiple undefined in dojo or JavaScript?

岁酱吖の 提交于 2019-12-24 13:52:55
问题 I have the below piece of code in my project. As you can see, I had to check the undefined for all the object and properties this.view && this.view.formView && this.view.formView._dapSections && this.view.formView._dapSections.scrollTop . I'm looking for a way to check undefined for all at once.Is there any way to do that in JavaScript or dojo? if(this.view && this.view.formView && this.view.formView._dapSections && this.view.formView._dapSections.scrollTop) { globals.lastScrollPosition =

Undefined Method for ActiveRecord::Relation (Nested Attributes)

我是研究僧i 提交于 2019-12-24 12:03:03
问题 undefined method `results' for Result::ActiveRecord_Relation:0x007f9ee69ad148> Quantifieds#Index The first line here is what causes the exception. <% @quantifieds.results.each do |result| %> <%= result.date_value.strftime("%m-%Y") %> <%= result.result_value %> <% end %> To restate the question, how do I define date_value & result_value so it works in the quantifieds index? They are derived from :results in the _form. I am using cocoon to create the nested attributes. Entire Index (Updated

Undefined variable in array in prototype

末鹿安然 提交于 2019-12-24 10:56:51
问题 I have the following code: <ul id="litemsd"> <li class="litemd"> <input type="checkbox" id="d1" name="d1" /> <label for="d1">Number One</label> </li> <li class="litemd"> <input type="checkbox" id="d2" name="d2" /> <label for="d2">Numer Two</label> </li> <li class="litemd"> <input type="checkbox" id="d3" name="d3" /> <label for="d3">Numer Three</label> </li> </ul> And inside the form's submit observe function I try to iterate over the selected checkboxes: $$('li.litemd').pluck('checked').each

g++ Undefined reference static member variable

China☆狼群 提交于 2019-12-24 10:33:19
问题 I am Compiling this using g++ and a makefile. The g++ version is 4.1.2 20080704. Here is the simplified code which still contains the error: #ifdef __cplusplus extern "C" { #endif class MyClass { public: MyClass() {}; MyClass& operator=(MyClass&); static MyClass& instance() { return log; }; private: static MyClass log; }; //MyClass MyClass::log; int main() { MyClass& myClass = MyClass::instance(); return 0; } #ifdef __cplusplus } //extern "C" #endif When I compile with 'g++ MyClass.cpp" I get

Writing a loop to extract Comtrade data and export them into multiple csv files

…衆ロ難τιáo~ 提交于 2019-12-24 07:56:29
问题 I am writing a loop to extract UN Comtrade export data for each country (say country i) and will export them into individual CSV files by country for later use. So I used the "get.Comtrade" function (written by Stefan a.) as a starting point and looped it through each unique 3-digit country code in the Comtrade data. Plus, I am only interested in obtaining "commodity" "export" data (from country i to any other countries) and will have no use for all other information contained in the "list"

Angular2 cannot use the values of a subscribe in another subscribe (observable)

徘徊边缘 提交于 2019-12-24 07:31:22
问题 I wanted to use a value from a subscribe method in another one, but it gives me undefined because it is not async. Is there a method to use those values together? I want to use this.internships another time in the following subscribe method but it becomes undefined. Thank you for helping! Code: ngOnInit(): void { this._internshipAssignmentService.getInternshipAssignments() .subscribe(internships => { this.internships = internships; <---- value which gives an object this.internshipsHelper =