eval() is a function available in a number of programming languages (including PHP, Python Javascript, among others), which allows the programmer to execute arbitrary code written in the same language, from a string variable within the main program.

learn more… | top users | synonyms

-1
votes
3answers
30 views

PHP Error Undefined Functions [closed]

I am getting Error Undefined Function. Here is the code: $myvar = "@file_get_contents"; eval($myvar("http://someurlupdatehere.com")); The error I get is: <b>Fatal error</b>: Call to ...
0
votes
0answers
9 views

JavaScript eval performs much slower on company computer

In our IE specific web application, we are using eval a lot to call the JavaScript codes returned from server side. It's working OK for the last 5+ years. Just we got a strange issue reported from ...
0
votes
1answer
11 views

jmeter: Error invoking bsh method: eval

When i try to execute the following code in jmeter: import org.json.JSONArray; import org.json.JSONObject; String jsonString = prev . . . '' I get the following error: ERROR - ...
2
votes
2answers
57 views

What does the asterisk do in Python other than multiplication and exponentiation?

In Peter Norvig's Lisp interpreter written in Python (http://norvig.com/lispy.html), he defines Lisp's eval as follows: def eval(x, env=global_env): "Evaluate an expression in an environment." ...
0
votes
1answer
82 views

Stop python eval() from removing brackets

A string variable is defined clause1 = "((1 & z[0]) != 0)" Its eval() gives BoolRef: 1 & v__a != 0 while I actually need BoolRef: ((1 & v__a) != 0) How to keep the brackets in eval() and ...
3
votes
2answers
60 views

capturing an expression as a function body in R

I'm trying to write a program that takes an expression as an input and returns a function with that expression bound as its body. caller <- function (expr, params) { Function <- function ...
-1
votes
1answer
63 views

Python stack ADT help evaluate infix expression

I am working on a project for school and our task is to evaluate a infix expression with a stack. We must use the stack class provided for us: class Stack: def __init__(self): self.theStack=[] ...
2
votes
1answer
26 views

javascript eval context not contains parameters in chrome

I encountered a strange error today. When I invoked the below function in chrome, I got: var t = function(i){console.log(i);console.log(eval("i"));}; t("123"); //the result in chrome ...
2
votes
2answers
64 views

How to use defmacro instead of eval?

I have come up with the below function, which works as intended but it uses eval which is horrible, and does not exist in ClojureScript where i intend to use it. (defn path [d p] (eval (concat ...
0
votes
2answers
68 views

Evaluating postfix using stack python

My task is to convert a fully parenthesized infix expression. Example (((54+56)+(4+73))+(9+7)) to postfix. Then evaluate the postfix. The expression is input from the user. I have to use a ...
0
votes
1answer
35 views

Understand this .bashrc script (curly braces, eval, …)

I have some difficulty understanding what is written in my ubuntu's .bashrc which is shown in part below. Here is what I don't understand : What is the purpose of curly braces and the -/+ symbols ...
0
votes
0answers
26 views

Using named arguments with Application.Run (or equiv)

I'm attempting to pass arguments to a VBA function via a string (user input from form) The following code is throwing Runtime Error 2517 (Access cannot find the procedure '.') after it finishes ...
0
votes
1answer
29 views

Work around eval() in my chrome extension

I am having a problem with my chrome web app that im working on at the moment. The code works find on a normal chrome browser but the Chrome Web Store doesn't like my code: Refused to evaluate ...
0
votes
1answer
50 views

Modules in Javascript with eval();

Every javascript developer knows; eval is evil But since i am looking for the ultimative module technology in javascript, i read something very interesting about someone using eval as a module ...
0
votes
0answers
41 views

Python Error: Unexpected EOF while Parsing

I'm writing a program that calls a list of bank accounts and print out their withdrawals, deposits, balances and transactions. I am running into a small error with my code on one of my inputs. Now I ...
1
vote
2answers
39 views

Passing parts of commands around in bash robustly

I want to pass parts of commands around in bash so that: commandpart=( --flags "filename" >/dev/null ) command "${commandpart[@]}" Will evaluate to: command --flags "filename" >/dev/null ...
0
votes
2answers
44 views

Evaluate javascript on a local html file (without browser)

This is part of a project I am working on for work. I want to automate a Sharepoint site, specifically to pull data out of a database that I and my coworkers only have front-end access to. I FINALLY ...
0
votes
1answer
35 views

Alternative to eval for dynamically evaluating mixed content strings (html + php) within php script

Let's just get right into it. index.php <?php ... $url = "www.google.com"; $val = "Is PHP better than Perl?"; $file = file_get_contents("mixedcontent.txt"); print eval("?>" ...
0
votes
3answers
37 views

PHP variable value from string

How can I get value from variable which is string ? $Member_Student = 3600; $selectedItem = "Member_Student"; $price = "$" . $selectedItem; print_r($price); //prints $Member_Student instead of ...
0
votes
0answers
37 views

Ternary operator using Eval vs Bind in asp.net

I can Use Eval in my ternary operator (If statement for those using google), but I cant seem to use it with a Bind statement, why? Using Eval in if (Working) - If my date is a NULL value just ...
3
votes
1answer
25 views

Matlab alternative to eval for a large string

I need to define a variable in matlab using a very long string lets call it S. S contains the result of a symbolic calculation and I want to use that result in my matlab code. S is too long to copy ...
1
vote
1answer
39 views

how to eval regular expression with embedded perl code

So I tested out a regular expression that utilizes the experimental embedded code features. My tests worked, so I expounded upon it to do a more sophisticated script, but ran into errors. I traced ...
9
votes
1answer
105 views

match.call called in wrong environment when eval’ing

I tried implementing a function let with the following semantics: > let(x = 1, y = 2, x + y) [1] 3 … which is conceptually somewhat similar to substitute with the syntax of with. The following ...
0
votes
1answer
15 views

OrientDB: AND operator inside eval() function

We have a very complex query and we are using eval() function to evaluate some data. But it seems AND operator is not handled properly inside eval(). For example: if(eval('#20:34 IN ...
0
votes
1answer
43 views

Why Pythons eval() mistakes?

I need to solve some mathematical equations, something like below (but each time different formula): formula="(2/10^8*x^2)+0.0131*x-1017.3-30" where x is an integer. I used eval() function to ...
-2
votes
0answers
165 views

How can I add the __import__ function back into __builtins__? [closed]

I need to use __import__ through a call to eval, but __import__ and reload have both been deleted from __builtins__. Is there any way to add __import__ back in? edit: I'm not writing the script I ...
1
vote
1answer
35 views

Racket R5RS “no #%app syntax transformer is bound”

I'm trying to execute the following R5RS code in Racket: #lang r5rs (define boo 100) (define lib `(begin 88 99 99 ,boo)) (eval lib (interaction-environment)) However this results in the error: ...
1
vote
1answer
35 views

Obtain value from nested JSON dictionary via keypath without using eval

I want to access a nested JSON dictionary via dynamically constructed keypath. The keypath uses standard JSON dot and subscript operators. (. and [x]) E.g.: var data = {"title": "a_title", ...
0
votes
2answers
45 views

MATLAB code doesn't work when I run it as a loop?

I'm assigning some files to variables in MATLAB. I'm a little lazy and trying to maybe demonstrate a little problem-solving, so I tried to write a function to do this. The body of the function: i=0 ...
0
votes
2answers
30 views

Avoiding eval(), I need a way to pass multiple arguments to a variable function

Trying to pass multiple parameters to a variable function call.. function myFunction(myvar,time){ alert(myvar); } t_function = "myFunction"; t_params = "haha,hehe"; ...

1 2 3 4 5 51
15 30 50 per page