Hello
after doing the parsing with a script in Haskell I got a file with the 'appearance' of lists of strings. However when I call the file content with the function getContents or hGetContents, ie, reading the contents I get something like: String with lines (schematically what I want is: "[" aaa "," bbb "" ccc "]" - ["aaa", "bbb" "ccc"]). I have tried with the read function but without results. I need to work with these lists of strings to concatenating them all in a single list. Thanks.
Hi,
Why does the Javascript function call isNaN(123.) return false? Is this a universally acceptable number or will it cause errors downstream?
I'm validating whether a value is a valid decimal using isNaN along with split. Are there cross-browser issues with isNaN? Should I use a bespoke implementation?
Thanks.
Hello, I have some template function and I want to call it using define in c++:
#define CONFIG(key, type, def) getValue<type>(key, def);
Of course, it won't work. Could I make something like this?
public class TestClass{
private String divisions[] ={};
public void doAction(){
Collection testArray = new ArrayList();
// put testArray will data
divisions = (String [] ) testArray.toArray(division); //should i use this
divisions = (String [] ) testArray.toArray(new String [] {}); //should i use this?
}
}
if i use case 1, and i call doaction multiple time, the division, something will show wrong records
if i use case2, divisions will always show the correct records. is my assumption should use case 2?
Hello,
GNU Emacs 23.1.1
I am just wondering is there any feature in emacs where I can find out what functions call a specific function.
In my code, I normally have to do a search on the function name to see what functions calls it.
It would be nice if I could display all the names of the functions where this specific function is being called from.
many thanks for any suggestions,
I want to use a method of an object.
Like $myObject->helloWorld().
However there are a couple of methods so I loop through an array of method names and call the method like this:
my $methodName ="helloWorld";
$myObject->$methodNames;
This works quite nice but some objects don't have all methods.
How can I tell whether $myObject has a method called helloWorld or not?
Is there an easy way to get a summary string of the errors that have been added to a controller's modelstate?
I'm looking to return this in an Ajax method and want the validation errors etc to be returned to the client (i.e. the view does not exist for this method call).
Or do I have to loop through the modelstate and look at each object and extract the error text manually?
Hi
Is there any way to skip the default params, say suppose my method declaration is like this:
procedure Myfunc1(var isAttr1: Boolean = FALSE;
isAttr2: Boolean = FALSE;
isAttr3: Boolean = FALSE);
I can't call the function like this:
Self.Myfunc1( , , Attr3);
because I don't want unnecessary var declarations, at the same time I want the last param return value (it is a var type)
Thank for help in advance
Hello all,
I want to know what's api support checking if BB maps be installed or not on BB device.
Because I have an application on BB and I want call BB map from this application, throw error if BB map hasn't been installed yet.
Thank you.
RubyParser.new.parse "1+1"
s(:call, s(:lit, 1), :+, s(:array, s(:lit, 1)))
Above code is from this link
Why there is array after + in the Sexp. I am just trying to learn ruby parser and the whole AST thing. I have been programming for a while but have no formal education in computer science. So do point to good article which explains AST etc. Please no dragon book. I tried couple of times but couldn't understand much of that book
Do you know any easy way to find a logging call that throws "not enough argumenst for format string".
On my workstation I've modified logging/__init__.py to print the msg so I can easily find the line in the source.
But do you have any idea what to do on the testing environment where you can't change python standard library nor run pdb easily?
I am currently exporting Drupal data to an external source (XML) programmatically. However, I want the data to run through the site's default Input Format (the filter that runs before user content is displayed on the website) before being written to file.
How do I programmatically apply a Drupal input filter? Is there a specific function call or hook for this purpose? If so, links/advice would be most appreciated.
On my page.
i have one textbox and one button.
-- on the button click event. -- one function will be called.
Now,
How to get that value of textbox and store in php variable? this should be done in that function which we will callon button click.
My application allows the user to create their own methods indirectly and I later need to refer to these methods. I am wondering if there is a way (for error checking purposes) to test if a method exists without trying to execute it. If I just try and call the method and it doesn't exist this will crash my application.
I want to display the linklist widget only on a certain category.
The current way the sidebar is fetched is:
if (!function_exists('dynamic_sidebar') || !dynamic_sidebar(1))
Which doesnt give me a say in the calling of the links widget. If i put an if clause there, then the rest of the widgets dont get loaded.
So i either need to customize the links widget it self or find a way to call the links widget directly?
And how do i check which category i'm on?
I'm not experiencing any performance issues, however I'd like to take a look at what takes how long and how much memory cpu it uses etc.
I'd like to get a firsthand understanding of which things can be bottle necks etc and improve any code i might reuse or build upon... (perfectionist)
I'm looking to create a litte function that i can call at the begining and end of each function that records:
execution time
memory used
cpu demand
any ideas?
I have a model
class Car
@@RPCServer = XMLRPC::Client.new("localhost", "/", 8080)
def self.count
@@RPCServer.call("cars.count")
end
end
If server is not running on localhost:8080 I've got a Errno::ECONNREFUSED error.
I want to display an error message to user, how can a handle this error?
In my .m file I call a method that is inside the same .m file. In the header I have the correct import for the header but I keep getting this alert:
What am I doing wrong? What should I do in order to make this error disappear? I'm kinda lost here :-(
Even if I changed this to:
NSString *path = [[NSString alloc]
initWithString:@"...."];
[self parseXMLFileAtURL:path];
[path release];
Let's say you have a Javascript function that calls a web service method. So that webservice completes and calls a callback function, which has the result.
How do I get that result back into the original function that called the web service method? Essentially, I'm trying to "synchronize" an asynchronous call.
Basically -[UIApplication openURL:] would be perfect, if it wasn't for the fact that it doesn't work within the same application (at least on simulator -- if this works on device someone please tell me). It's not a super big deal though if it just relaunches w/o URLness since I can obviously just persist some data. The goal of this is to essentially free all memory in the application and call all of the loading procedures.
I actually don't like #region in my code. BUT for some reason call me crazy, I would like to have them in my XAML. I would like whole sections to have a #region-like thing and collapse them (e.g. my <Window.CommandBindings, <Grid.*Definitions, <Menu, <Toolbar, etc..
Does this exist? If not, how about <RegionCollapse
I have a vector of custom Struct that needs to be sorted on different criteria each time
Implementing operator < will allow only one criteria
But I want to be able to specify sorting criteria each time I call C++ standard sort.
How to do that?
Please note it is better to be efficient in running time..
Thanks
For instance this code:
function stuff() {
this.onlyMethod = function () {
return something;
}
}
// some error is thrown
stuff().nonExistant();
Is there a way to do something like PHP's __call as a fallback from inside the object?
function stuff() {
this.onlyMethod = function () {
return something;
}
this.__call__ = function (name, params) {
alert(name + " can't be called.");
}
}
// would then raise the alert "nonExistant can't be called".
stuff().nonExistant();
I forgot the array syntax while on Zsh-commandline:
$ hello=[1,2,3,4] %ERR:
I want to fix the problem by substitution. In Vim, I would do :.s@,@ @g.
So how can I edit the current line, or let call it a current buffer, by running a command on it?