Was going to call this "Eval won't give me the Time of Day," but thought that too cute.
I'm kind of having the opposite problem from the suggested questions I see for my title, so here goes:
Visual Studio 2008 Pro, SQL Express 2008, Vista. Web Project, where I'm opening records from an Event Table with JOINed info from a Facilities tab...
I'd like to get value of variable named $(MYVAR)_SOME_SUFFIX in the b.mak makefile.
Instead I get "b.mak(2) : fatal error U1001: syntax error : illegal character '$' in macro"
# ---- a.mak ----
all :
set MYVAR=SOME_PREFIX
nmake -f b.mak
#--- END ---
# ---- b.mak ----
all:
@echo $($(MYVAR)_SOME_SUFFIX)
#--- END ---
...
I saw there is such question in c++
I am a very begginer and I need a very simple example how to do it .
the user writes code in the text box and what I need o do is to execute it
how???
...
Lets say I have an array which has n dimensions. Now in order to access a slot you typically use:
array [1][0]
What if the number of dimensions are not known at compile-time, is there an easy access like:
slot = "1,0"
array [slot] // accessing 1,0
Which means I can also easily navigate back and forth
slot += ",2"
array [slo...
These weekend I've been tearing down to pieces Michele Simionato's decorator module, that builds signature-preserving decorators. At the heart of it all there is a dynamically generated function, which works something similar to this...
src = """def function(a,b,c) :\n return _caller_(a,b,c)\n"""
evaldict = {'_caller_' : _caller_}
co...
I'm trying to improve the speed of our server but I would like to have your view of that before modifying everything.
I have a high read rate on my file system. Right now we are using regular PHP file. I wonder if I can cache these file in Memcache and later do an eval on the code if it will be faster than letting these file get interpr...
Quick Question. Eval in JavaScript is unsafe is it not? I have a JSON object as a string and I need to turn it into an actual object so I can obtain the data:
function PopulateSeriesFields(result)
{
data = eval('(' + result + ')');
var myFakeExample = data.exampleType
}
If it helps I am using the $.ajax method from jQuery.
T...
hi all,
i all the years i have been developing in php, i've always heard that using eval() is evil.
considering the following code, wouldn't it make sense, to use the second (and elegant) option? if no, why?
// $type is the result of an SQL statement
// e.g. SHOW COLUMNS FROM a_table LIKE 'a_column';
// hence you can be pretty sure ab...
I have a piece of Perl code somewhat like the following (strongly simplified): There are some levels of nested subroutine calls (actually, methods), and some of the inner ones do their own exception handling:
sub outer { middle() }
sub middle {
eval { inner() };
if ( my $x = $@ ) { # caught exception
if (ref $x eq 'ARRA...
I have to convert an MSSQL stored proc that passes a varchar that is a query. The proc has the following command:
INSERT INTO Results
EXEC (@Expresion);
This isn't working. I'm pretty sure that EXEC and EXECUTE arent MySQL commands but CALL doesn't work either. Does anyone know if its even possible to have something like JavaScript'...
Hi,
I am trying very hard to pass three parameters to a javascript function from within a itemtemplate of a gridview:
For one parameter, it works fine:
<asp:HyperLink ID="hypComment" runat="server" Font-Bold="True"
NavigateUrl='<%# Eval("CCN", "javascript:ShowCommentPopUp({0});") %>'>Add
</asp:HyperLink>
where CCN is my column in gr...
I'm writing a game engine using pygame and box2d, and in the character builder, I want to be able to write the code that will be executed on keydown events.
My plan was to have a text editor in the character builder that let you write code similar to:
if key == K_a:
## Move left
pass
elif key == K_d:
## Move right
pass
...
Just trying to figure out the proper and safer way to execute mathematic operation passed as string. In my scenario it is values fetched from image EXIF data.
After little research I found two way of doing it.
first, using eval:
function calculator1($str){
eval("\$str = $str;");
return $str;
}
second, using create_function:
...
Hi Guys,
we need to evaluate a value in an object in run time while we have a textual statement of the exact member path for example: myobject.firstMember.secondMember[3].text
we thought of parsing this textual statement using regex and then evaluate the text value by using reflection but before we do that i wonder if C# support some kin...
I have a string that has HTML & PHP in it, when I pull the string from the database, it is echo'd to screen, but the PHP code doesn't display. The string looks like this:
$string = 'Hello <?php echo 'World';?>';
echo $string;
Output
Hello
Source Code
Hello <?php echo 'World';?>
When I look in the source code, I can s...
I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends.
As an example I've written a script called question (The fist command is to show what is the contents of the variable $tab)
(23:32:12\[[email protected])
[~/bin]$ ...
While running eval() in IE7 if my JSON contains language specific characters like è, its not evalled properly. Is there a way I can change the language settings to make this work?
...
hi, i've got a problem, i'm using cakephp and im loading into a div a page
function loadContent(targetDiv, sourceUrl) {
$(targetDiv).empty().html('<img src="/gambu/img/ajax-loader.gif" />');
$(targetDiv).load(sourceUrl);
}
it work's ok, but in a loaded page i've got autocomplete and thickbox, and that's not workin...
I have some javascript that goes out and fetches a javascript "class" on another xhtml page. The remote javascript looks something like the following:
(function() {
this.init = function() {
jQuery("#__BALLOONS__tabs").tabs();
};
})
After this is fetched into this.javascript, I try to eval it and ins...
Given that EVAL is Evil how do I create an Array name dynamically:
I have a bunch of Arrays and I need to reference different ones depending on what the user clicks.
This bit of code gives me the array object:
(eval(calendarObject.id + '7'))
But eval is bad, so how to do I construct an Array name and then reference it?
Here's a bi...