undefined

Ruby forgets local variables during a while loop ?

I'm processing a record-based text file: so I'm looking for a starting string which constitutes the start of a record: there is no end-of-record marker, so I use the start of the next record to delimit the last record. So I have built a simple program to do this, but I see something which suprises me: it looks like Ruby is forgetting lo...

What is a concise and robust way to write these statements in JavaScript?

I have an <iframe> that uses some variables that are set in an object literal in the parent document. These variables are optional; if they're set, I want to use their values, assigning them to a more succinct global variable; if not, I want to call the function error(). First of all, is this ternary operator statement valid and effecti...

Undefined method 'map' for nil:NilClass

My app seems to randomly be throwing a "undefined method `map' for nil:NilClass" error when users are trying to update their profile. But what's weird is it's saying the error happens on update, but the error line is actually in a view. Full error: users#update (ActionView::TemplateError) "undefined method `map' for nil:NilClass" On...

'RTLD_NEXT' undeclared

I'm trying to compile a C program but I get the error 'RTLD_NEXT' undeclared. I think this is supposed to be defined in dlfcn.h which the c program includes, but when I looked inside dlfcn.h there is no RTLD_NEXT. How do I fix this? ...

Mysql++ "undefined reference to __imp___ZN7mysqlpp10ConnectionC1Eb"

I am trying to install the mysql++ in Code::Blocks, but When I try to run the example code I get this error: undefined reference to __imp___ZN7mysqlpp10ConnectionC1Eb What I am doing wrong? ...

Bizarre Javascript JSON undefined error

I'm experiencing an error that I haven't been able to find any mention of anywhere. I'm developing an AJAX-enabled WCF web service with ASP.NET. In my ASP.NET master page's , I included the json.js file, copied fresh from json.org. When I run the page, it fails (VS 2008 catches a Javascript exception) on the first line of code in json.js...

A question about union in C

I was reading about union in C from K&R, as far as I understood, a single variable in union can hold any one of the several types and if something is stored as one type and extracted as another the result is purely implementation defined. Now please check this code snippet: #include<stdio.h> int main(void){ union a{ int i; char c...

Library redefines NULL

I'm working with a library that redefines NULL. It causes some problems with other parts of my program. I'm not sure what I can do about it. Any idea? My program's in C++, the library's in C. #ifdef NULL #undef NULL #endif /** * NULL define. */ #define NULL ((void *) 0) Oh, and it produces these errors: Generic.h:67: error: def...

Another Javascript Undefined Null Question

So I have been through most of the questions here. Also quite a few articles good and bad. One thing I am looking for some additional clarification on is how undefined and un declared variables are treated. Take the code below. var a; if(a == null) // True - Due to Type Coercion if(a == 'null') // False if(a === null) // False ...

Unusual javascript HTTP caching / undefined issues

Ok. I have never seen anything like this before and I am quite confused... On a website I am working on, there are two JavaScript includes. (Well, many more, but the problem occurs with only two). We'll call these A.js and B.js. A.js defines a JavaScript singleton A. Likewise B.js defines a JavaScript singleton B. The B class depends on...

Comparing window.parent/opener with NULL or 'undefined'

If I have this method: this.getForm = function () { try { var frmIndex = arguments[0]; if (isNaN(frmIndex)) frmIndex = 1; if (window !== null) { if (window.opener !== null) { return window.parent; } else if (window.parent !== null) { if (window.parent.frames !== null) { if (window.parent.frames(...

How do I undefined the value for a hash key in Perl?

#!/usr/bin/perl use strict; use warnings; my %hash; undef($hash{"a"}); undef($hash{"b"}); print scalar values %hash; # i need here 0 print scalar keys %hash; # and here 2 thank you, guys! ...

1020 undefined property right after associative array defined via var

Hello, I'm really frustrated in this case. While developing with Adobe Flex, I'm working on my first application - and use pretty much actionscript. In my mxml application, I include as3 file via <mx:Script source="as/myas3file.as></mx:Script>. In myas3file.as, I include (thru include "variables.as";) file variables.as, which contai...

jquery: radio button input checked attribute is undefined

I have the following and in this order: <script type="text/javascript"> $(document).ready(function(){ var overwrite = $('#itemList input:radio:checked').val() alert('value = '+ overwrite); }); </script> <body> <form ..... > <div id="itemList"> Overwrite? <input type="radio" value="Yes" class="overWrite" nam...

Delphi - undeclared identifier: LOCALE_SYSTEM_DEFAULT

Hi all, I'm trying to format a float (extended) by the system locale's default currency settings. I have found the key proponent to this solution to be the following line: GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, format_settings); and everywhere I look, they provide the solution exactly as shown (no class specifier before, li...

When is it OK to use an undefined variable in perl with warnings enabled?

With warnings enabled, perl usually prints Use of uninitialized value $foo if $foo is used in an expression and hasn't been assigned a value, but in some cases it's OK, and the variable is treated as false, 0, or '' without a warning. What are the cases where an uninitialized/undefined variable can be used without a warning? ...

Undefined Symbols

The Image class is a subclass of the BMP class. I am attempting to use some methods TellHeight(), TellWidth(), etc. from the BMP class in order to manipulate an image in this method. However, when I create a BMP and attempt to call functions on it, upon compilation I get an error saying Undefined Symbols: BMP::BMP(), reference...

Can a value be uninitialized, but still defined, in Perl?

Running ActiveState Perl 5.10.1 on win32. How is it that this code: die(defined($r->unparsed_uri =~ '/(logout.pl)?$')); ...dies with 1, whereas changing the same line to say this: die($r->unparsed_uri =~ '/(logout.pl)?$'); ...dies with Use of uninitialized value in die? How is it defined yet uninitialized? I thought uninitialize...

resolving undefined references! [linker error]

how to resolve undefined references [linker error] in dev cpp? ...

FancyBox iframe returns parent.$ as undefined (using WordPress)

I'm trying to close FancyBox from within the iframe, but parent.$ is always undefined. This is my iframe JavaScript: <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js'&gt; </script> <script type="text/javascript"> jQuery(document).ready(function($){ (function($) { $....