undefined

Checking if a variable has been set is not working

核能气质少年 提交于 2019-12-11 06:03:45
问题 I am trying to set a variable initially only if it has not been set. For some reason the logic I'm using to determine whether the variable has been set seems to run even regardless of whether the variable has been set. My code is var l0 = -210; function add(){ var lThis; if (lThis == null){ lThis = l0; console.log('set lThis to '+ lThis); } lThis ++; } var incrementInterval = setInterval(add, 33); The console logs "set lThis to -210" every time the interval runs, so the "if (lThis == null)"

C++ Ref Count Changes While Destructing Object

丶灬走出姿态 提交于 2019-12-11 05:22:47
问题 I've got a private ref count inside the class SharedObject. SharedObject is a base class for other classes, for example Window. Window is the base class of Editor. When the ref count reaches 0, because of calling SharedObject::Release(), the SharedObject deletes itself. First we get to the Editor destructor, which shows that the this pointer contains m_refs == 0, but when we get to the Window destructor it is suddenly 1, and when we reach the SharedObject destructor, it is still 1. I put a

ERROR: Undefined is not an object (evaluating 'NativeGraphRequestManager.start') - react-native-fbsdk (Android)

坚强是说给别人听的谎言 提交于 2019-12-11 04:28:06
问题 Does anyone know how to solve it? Help please! Console error: Events.js //When i onPress appear the error. I think that my issue is here. import React, { Component } from 'react'; import { Image, StyleSheet, View, TouchableOpacity, Text } from 'react-native'; const FBSDK = require('react-native-fbsdk'); const { GraphRequest, GraphRequestManager, } = FBSDK; class Eventos extends Component { getInfo() { const infoRequest = new GraphRequest( '/me', null, this.responseInfoCallback, ); new

Undefined Offset 0 , how can i set this array

社会主义新天地 提交于 2019-12-11 04:24:47
问题 Hello i have an Undefined Offset 0 . inside this code. $q = mysql_query("SELECT * FROM category"); if (false === $q) { echo mysql_error(); } while ($r = mysql_fetch_row($q)) { $names[$r[0]] = $r[2]; $children[$r[0]][] = $r[1]; } function render_select($root=0, $level=-1) { global $names, $children; if ($root != 0) echo '<option>' . strrep(' ', $level) . $names[$root] . '</option>'; foreach ($children[$root] as $child) render_select($child, $level+1); } echo '<select>'; render_select(); echo '

PHPUnit TDD, PHP Fatal error: Call to undefined method

拟墨画扇 提交于 2019-12-11 03:23:20
问题 I'm starting a TDD project using PHPUnit and something really bugs me. It seem that all test can't be run as long as all classes and methods will not be implemented. How can I do to make the test continue event if a class or a method is not yet implemented ? Thanks. Edit: "Isn't the point of TDD that your testsuite fails while writing tests?" Yes, of course, but I want to have a global sight of the project. Let say we've written 1000 test, and the first one that is run makes a fatal error.

Suppress code analysis warnings for conditional methods

我的梦境 提交于 2019-12-11 03:01:38
问题 Running code analysis (Visual Studio 2015) on code that calls Conditional methods causes warnings for unused locals (CA1804) or unused parameters (CA1801). E.g. for: using System.Diagnostics; namespace ConsoleApplication1 { class Program { [Conditional ("NEVER_DEFINED")] static void Log(string message) { System.Console.WriteLine("Demo conditional message logging: " + message); } static void Main(string[] args) { string message = "Only log this when `NEVER_DEFINE` is #defined"; Log(message);

PHP Fatal error: Call to undefined function?

▼魔方 西西 提交于 2019-12-11 02:08:45
问题 So i have a problem with my website when im hosting it on my webhost. i get this error: PHP Fatal error: Call to undefined function getSkillIcons() The weird thing is that locally(Xampp) it works just fine. This is how i included the function(in index.php): <?php include 'http://sub.website.com/incl/Settings.php'; ?> this is where i call it (index.php): <div class="panel-body" style="text-align:center"> <?php getSkillIcons(explode(',', skills)); ?> </div> This how i defined skills (settings

Fail to link c code to lapack / blas : undefined reference

北城以北 提交于 2019-12-11 01:23:54
问题 i have been trying for hours and it drives me crazy. The last error I get is : demo_cblas.c:(.text+0x83): undefined reference to `clapack_sgetrf' demo_cblas.c:(.text+0xa3): undefined reference to `clapack_sgetri' I am compiling the code using /usr/bin/gcc -o demo_cblas demo_cblas.c -L /usr/lib64 -l :libgfortran.so.3 -L /usr/lib64 \ -llapack -L /usr/lib64 -lblas I try with and without libgfortran, with different compilers gcc-33, gcc-47, gcc-48. The test code is not from me but comes from this

strange g++ linking behavior depending on arguments order

会有一股神秘感。 提交于 2019-12-11 01:19:08
问题 I was trying to compile a simple opengl program on msys using g++. To my surprise the linker was complaining on undefined references: $ g++ -mwindows -lopengl32 glut_md2.cpp C:\Users\...\cceQtYAy.o:glut_md2.cpp:(.text+0x67a): undefined reference to `glGenTextures@8' C:\Users\...\cceQtYAy.o:glut_md2.cpp:(.text+0x696): undefined reference to `glBindTexture@8' .... After googling for a while I found that the problem was in g++ arguments order: $ g++ glut_md2.cpp -mwindows -lopengl32 --- all ok!

Knockout.js: Function parameter undefined

ぃ、小莉子 提交于 2019-12-11 00:59:54
问题 I have a very simple example that is not working. jsfiddle: http://jsfiddle.net/ThomasDeutsch/8hzhp/3/ // My Model function Customer(id, name, lastname) { this.Id = ko.observable(id); this.Name = ko.observable(name); this.LastName = ko.observable(lastname); } // My ViewModel ViewModel = (function () { var getName = ko.computed(function (x) { return x.Name(); }); return { getName: getName(new Customer(1, "Thomas", "D")) }; })(); ko.applyBindings(ViewModel);​ problem: parameter (x) is undefined