defined

How is "0" result from readdir() not false in a while condition?

See also: Where in the documentation does it say that while tests readdir for definedness?. (Not a duplicate; just closely related.) Many people treat the loop below as idiomatic: while (defined(my $file = readdir($dir)) { ... } instead of: while (my $file = readdir($dir)) { ... } because supposedly with the latter vers...

[MSBuild] How to programatically list all properties defined?

Hi, I'm looking for a way to access all the Build properties defined while executing MSBuild. I have a configuration file. I want to modify the Properties in the configuration file and copy it to a new location. Is there a way to do it? ...

Is there any way to check to see if a VBScript function is defined?

This is probably just wishful thinking... Is there any way to check to see if an ASP/VBScript function is defined before calling it? ...

MySQL Function to return table name to be used in a query

Can I use a MySQL function or procedure to return table names that can be used in a query? Something like SELECT * FROM get_db_table_name(2342352412); where get_db_table_name() is a user defined function which accepts a user_id as a parameter and returns the db.table where that user resides. I have not been able to do this this way be...

Determine if variable is defined in Python

How do you know whether a variable has been set at a particular place in the code at runtime? This is not always obvious because (1) the variable could be conditionally set, and (2) the variable could be conditionally deleted. I'm looking for something like defined() in Perl or isset() in PHP. if condition: a = 42 # is a defined he...

Hibernate entity with user defined attributes

Can someone please give me some tips on modeling hibernate entities that have some known attributes while the majority are defined by the user of the system (during initial setup of the system) I need to be able to search on these user defined attributes at a later point in time. ...

How to spawn thread when defined function is set (sequentially dependent) and calling is spatially dependent

Hi. I apologize for my question being a bit confusing. So I have code written in python but also used H3D haptics platform. I'm trying to unload some of the processing of this one, very large thread so that I can log faster. I'm not sure how to write it since a function 'moveCursor' is already defined and later set to a specific number...

How can I determine if a Perl hash contains a key mapping to an undefined value?

I need to determine if a Perl hash has a given key, but that key will be mapped to an undef value. Specifically, the motivation for this is seeing if boolean flags while using getopt() with a hash reference passed into it. I've already searched both this site and google, and exists() and defined() don't seem to be applicable for the si...

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...

Javascript error in IE

Hello =) My problem in ie browser only... auth.js Deferred.errorHandler = function(e) { alert('Unhandled error ' + e); }; function User() { SbApi.url = 'http://api.sindbad.ru'; var user = new SbApi('User'); ... IE console: 'Deffered not defined' on line 1 symbol 1 'SbApi not defined' on line 4 symbol 1 Any ideas? Thank you ...

How do I fix class template has already been defined?

I am implementing ZipArchive library into my project, and I fought with it for over an hour getting it setup right to stop all the linker errors. But now I still have this left over and I am not sure of the best approach to fix it, could use some help. C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afxtls_.h(199) : error...

Follow-up. Is return reference to x++ defined?

I recently asked the question http://stackoverflow.com/questions/2380803/is-the-behavior-of-return-x-defined The result was about what I expected, but got me thinking about a similar situation. If I were to write class Foo { ... int x; int& bar() { return x++; } }; Where bar now returns an int reference, is this behav...

Another BC30002: Type is not defined.

Here's what I've done... I used wsdl.exe to create a .cs class for my wsdl service connection. I made a Visual Studio project to compile the .cs into a dll having namespace CalculatorService (CalculatorService.dll). Successful thus far. I created an asp.net project added my namespace import: %@ Import Namespace="CalculatorService" % ...

Is there a simple way to validate a hash of hash element exists and is defined?

I need to validate a Perl hash of hash element such as $Table{$key1}{$key2} to exist and be defined. Here is what I do. (I have no idea $key1 even exists) if ((defined $Table{$key1}) && (exists $Table{$key1}) && (defined $Table{$key1}{$key2}) && (exists $Table{$key1}{$key2})) { #do whatever } Is there an easier and cleaner w...

Nested hash defined?()

What's the most concise way to determine if @hash[:key1][:key2] is defined, that does not throw an error if @hash or @hash[:key1] are nil? defined?(@hash[:key1][:key2]) returns True if @hash[:key1] exists (it does not determine whether :key2 is defined) ...

How to judge whether a method has defined in a class?

class C1 unless method_defined? :hello # Certainly, it's not correct. I am asking to find something to do this work. def_method(:hello) do puts 'Hi Everyone' end end end So, how to judge whether a mehtod has defined or not? ...

problems with VBA code application or object error

I have coded some code in VBA my code breaks at this line raising Application defined or object defined error. .Formula = "=IF(AND(chr(34) & ' & chr(34) & Criterion " & i & "'!" & cellAdress & ">=1;chr(34) & ' & chr(34) & Criterion " & i & "'!" & cellAdress & "<=4);chr(34) & ' & chr(34) & Criterion " & i & "'!" & cellAdress & ";0)" ...

how to get List Of User Defined Functions using OleDbSchemaGuid in c#?

how to get List Of User Defined Functions using OleDbSchemaGuid in c#? ...