eval Questions
5
Solved
I'm trying to rename all files in current directory such that upper case name is converted to lower. I'm trying to do it like this:
ls -1|gawk '{print "`mv "$0" "tolower($0)"`"}'|xargs -i -t eval ...
4
Solved
I meet about problem to pass arguments to the client-side event OnClientClicking.
I tried to use the String.Format () function, but it does not work.
Do you have an idea for a workaround to send ...
Earthshaker asked 8/7, 2013 at 11:30
1
Solved
For a specific application, I do a GUI to manipulate some data (internally: numpy 1D arrays), and plot them.
The end-user can choose in the UI to plot various series a, b, c.
Now I also need to all...
5
I've been trying to make an eval function in C for a while.
At the moment, my idea is to make a hash String -> function pointer with all the standard library C functions, and all the functions ...
11
Solved
I would like to do the equivalent of:
object result = Eval("1 + 3");
string now = Eval("System.DateTime.Now().ToString()") as string
Following Biri s link, I got this snippet (modified to remove...
Amidase asked 10/9, 2008 at 12:6
6
Solved
ConfigParser requires all sections, keys and values to be strings; no surprise. It has methods to convert the values to datatypes with getfloat, getint, getboolean. If you don't know the datatype, ...
Glossator asked 2/6, 2011 at 0:4
7
We all know that eval is dangerous, even if you hide dangerous functions, because you can use Python's introspection features to dig down into things and re-extract them. For example, even if you d...
Attrahent asked 4/3, 2016 at 19:55
25
Solved
I've got a script that inserts some content into an element using innerHTML.
The content could for example be:
<script type="text/javascript">alert('test');</script>
<stron...
Lefthand asked 7/4, 2010 at 11:48
6
Solved
I use eval() in my current project like this:
if (class_exists($class_name)) //$class_name depends on user input
eval($class_name.'::MyStaticMethod()');
eval() is executed if and only if class ...
8
Solved
I have been using the eval method in ruby many times. But I have heard people saying eval is nasty. When asked, why and how, I could never get a convincing reason not to use it. Are they really nas...
5
Since getting started in Dart I've been watching for a way to execute Dart (Text) Source (that the same program may well be generating dynamically) as Code. Like the infamous "eval()" function.
Re...
2
I have to move a project from Java 8 to Java 17.
I could solve most issues, but it contains a method, in which I use the ScriptEngineManager to evaluate a mathematical term.
ScriptEngineManager mg...
Helfand asked 15/3, 2022 at 11:34
4
Solved
I'm working on the "Error Handling and Reporting" chapter of Mastering Perl. In perlvar's entry for $@, it says:
The Perl syntax error message from the last eval() operator. If $@ is the null str...
11
Solved
I'm working with this:
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
I have a script like below:
#!/bin/bash
e=2
function test1() {
e=4
echo "hello"
}
test1
echo "$e"
Whi...
Kotto asked 9/5, 2014 at 12:44
23
Solved
Is it possible to create a template string as a usual string,
let a = "b:${b}";
and then convert it into a template string,
let b = 10;
console.log(a.template()); // b:10
without eval, ...
Hardden asked 21/3, 2015 at 11:34
3
Solved
I need to run a Javascript function that is completely written by the user. I provide him a skeleton, but the details are for him to specify, e.g.
function main(model, console) {
// the user can ...
Orphrey asked 1/9, 2014 at 8:37
14
is there any way I can execute eval() on a specific scope (but NOT global)?
for example, the following code doesn't work (a is undefined on the second statement) because they are on different scop...
Backus asked 20/3, 2012 at 4:18
11
Google Chrome extensions using manifest_version: 2 are restricted from using eval or new Function. All of the JavaScript templating libraries I checked (mustachejs, underscorejs, jQuery template, h...
Hoffman asked 24/5, 2012 at 20:24
21
Solved
In all the years I have been developing in PHP, I have always heard that using eval() is evil.
Considering the following code, wouldn't it make sense to use the second (and more elegant) option? If...
5
Solved
I'm building something that includes javascripts on the fly asynchronously, which works, but I'm looking to improve upon the error detection (so all the errors don't just appear to come from some l...
Hedveh asked 19/8, 2010 at 22:50
10
Solved
I have a project, in which some JavaScript var is evaluated. Because the string needs to be escaped (single quotes only), I have written the exact same code in a test function. I have the following...
Goy asked 26/2, 2013 at 11:6
10
Solved
I have a javascript file that reads another file which may contain javascript fragments that need to be eval()-ed. The script fragments are supposed to conform to a strict subset of javascript that...
Arian asked 12/2, 2009 at 21:53
5
Solved
In JavaScript I have a var str = ".a long string that contains many lines..."
In case of exception that caused by eval(str);
I had like to catch it and print the the line number that caused the ex...
Arpent asked 15/8, 2010 at 19:59
3
Solved
I'm trying to write a bash script that takes an environment variable and passes it along to a command.
So if I had something like:
export OUT="-a=arg1 -b=\"arg2.0 arg2.1\""
I want in my bash s...
7
There is function in python called eval that takes string input and evaluates it.
>>> x = 1
>>> print eval('x+1')
2
>>> print eval('12 + 32')
44
>>>
What is ...
Dekow asked 18/3, 2010 at 10:49
1 Next >
© 2022 - 2024 — McMap. All rights reserved.