undefined

node.js socket.io socket.set() undefined property

心不动则不痛 提交于 2019-12-11 19:49:00
问题 I have something like this. This is my Controller. new singleton('User', function(model){ model.find({username:data.username, password:_pass}, function(err,user){ if (user.length==1) { socket.set('taxiId',user[0].id); cb(true); } else cb(false); }); }); If I set socket property like socket.set('name',value, function(){cb}); I get undefined here auth.authentificate(data, socket, function(logged){ if (logged) { logs.login(data,socket); console.log(socket.taxiId); socket.emit('authOk',{err:

javascript override undefined

拥有回忆 提交于 2019-12-11 19:24:07
问题 After searching many hours i dont find a solution for my problem: function pseudoclass(Value){ this.Value = Value; } aPlayGround = new Array(); aPlayGround[0] = new pseudoclass(0); var Actual = 0; var Width = 1; var bBool = new Boolean(Actual%Width); //left becomes 0%1 ----> false if (bBool && (aPlayGround[Actual-1].Value < 9)) {} if i let my browser execute this codeblock i get this error message via mozilla firebug: "TypeError: aPlayGround[(Actual - 1)] is undefined" bBool is my error

PHP Error: Fatal error: Call to undefined method

不打扰是莪最后的温柔 提交于 2019-12-11 19:07:59
问题 I'm having a problem with my Mail class. It was working before, but now i'm not sure what happened. here is the error: Fatal error: Call to undefined method Mail::sendTo() in C:\...\web\modules\register.php on line 30 My mail class: class Mail { public static $Headers = 'From:akshay@myemail.com'; public $sendtowho; public $subject; public $message; public $template; public function sendTo($who='') { $this->sendtowho = $who; } public function with($subj='',$template) { $this->subject = $subj;

PHP Notice: Undefined offset error when importing from .csv [duplicate]

依然范特西╮ 提交于 2019-12-11 18:51:17
问题 This question already has answers here : “Notice: Undefined variable”, “Notice: Undefined index”, and “Notice: Undefined offset” using PHP (28 answers) Closed 2 years ago . I'm continually getting the above error when importing data from csv using the following code: $csv_data=file_get_contents("data3_received.csv"); foreach(preg_split("/((\r?\n)|(\r\n?))/", $csv_data) as $line){ list($service_id, $ki3) = explode(',', $line,2); The data imports as expected but the error log is filling up as

undefined reference, compilation error

陌路散爱 提交于 2019-12-11 15:37:44
问题 I am trying to use class inheritance. I have taken a code from a book and tweaked it a bit to create Class Mammal and a Class Dog which inherits Mammal member data. The code is: #include<iostream> enum BREED{Labrador,Alcetian,Bull,Dalmetian,Pomerarian}; class Mammal{ public: Mammal(); ~Mammal(){} double getAge(){return age;} void setAge(int newAge){age=newAge;} double getWeight(){return weight;} void setWeight(double newWeight){weight=newWeight;} void speak(){std::cout<<"Mammal sound!\n";}

g++ stops on undefined reference when using -O0

佐手、 提交于 2019-12-11 15:18:18
问题 I want to debug a program I wrote. Therefor I'd like to link it using "-g -O0". When I compile (using autotools Makefile) using make CXXFLAGS='-g -O0' I get some errors: libtool: link: g++ -O2 -g -O0 -I/opt/adolc-2.2.1/include -o oc_poly oc_poly-oc_poly.o oc_poly-oc_p2p.o -L/opt/ipopt-3.9.3/lib/coin -L/opt/ipopt-3.9.3/lib/coin/ThirdParty -L/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2 -L/usr/lib/i386-linux-gnu/gcc/i686- linux-gnu/4.5.2/../../.. -L/usr/lib/i386-linux-gnu /opt/ipopt-3.9.3

Primefaces <p:graphicImage /> is throwing undefined function

谁说我不能喝 提交于 2019-12-11 15:03:02
问题 <p:galleria id="gal" value="#{homeBean.images}" var="image" panelWidth="600" panelHeight="300" > <p:graphicImage value="#{image.imagePath}" width="600" height="300" /> </p:galleria> Problem: Uncaught TypeError: undefined is not a function galleria.js?ln=primefaces&v=4.0:1 And no preview, nothing - like it doesn't exist. But in the source code it does exist. The generated source code is : <div id="gal" class="ui-galleria ui-widget ui-widget-content ui-corner-all"> <ul class="ui-galleria-panel

JNI, Java to C++ in Eclipse: undefined reference to '_imp__JNI_CreateJavaVM@12'

强颜欢笑 提交于 2019-12-11 14:14:29
问题 I'm a beginner to c++ and JNI and I want to call a Java methode from my C++ program. When compiling (with Eclipse) I get the following error: undefined reference to '_imp__JNI_CreateJavaVM@12' I searched for this problem and came across this post There the answer was, if I get that right, including the jvm library to the compiling command. Since I'm not compiling by hand I'm not sure how I can make Eclipse do this. Could somebody explain that step by step for a complete beginner? Here is the

Issue with image upload php: undefined index

纵然是瞬间 提交于 2019-12-11 14:11:28
问题 I am having trouble getting the image upload feature to work on the code below with the following error meesage: 'An error occurred in script '/database.php' on line 135: Undefined index: image' which is this part: 'if (is_uploaded_file ($_FILES ['image']['tmp_name'])) {' I've done a few php/mysql forms before but this is the first time I've tried to use image uploads. If possible I'm after a form that allows pdfs and jpegs only and limits the upload to 1.5 meg. The rest of the form works ok,

Cannot read property 'backgroundColor' of undefined

孤街浪徒 提交于 2019-12-11 11:54:19
问题 When the function call below gets run it returns this error. "Uncaught TypeError: Cannot read property 'backgroundColor' of undefined" I am trying to change the background color of a class called .jumbotron. I have tried everything I can thing of so far. Could anyone tell me why this is happening? clrElementJumbo("cornsilk"); function clrElementJumbo(scolor) { var el = document.getElementsByClassName("jumbotron"); el.style.backgroundColor = scolor; } 回答1: Try to replace the code var el =