Just wondering if you can return two arguments in an objective c method, for example I'd like to return a cartesian coordinate (x,y), basically two ints. is the only way to do this by creating a class and returning an instance? Is there some other way I'm not thinking of, kind of a beginner here.
any syntactical help would also be appre...
I have inherited an existing code base where the "features" are as follows:
huge monolithic classes with
(literally) 100's of member variables
and methods that go one for pages
(er. screens)
public and private methods with a large number of arguments.
I am trying to clean up and refactor the code, to leave it a little better
than how...
I have a class 'KeyEvent'; one of which's members is:
public delegate void eventmethod(object[] args);
And the method passed to the object in the constructor is stored in this member:
private eventmethod em;
Constructor:
public KeyEvent(eventmethod D) {
em = D;
}
public KeyEvent(eventmethod D, object[] args) : this(D) {
...
I find myself constantly writing what I see as unnecessary code in Ruby when using named arguments for methods.
Take for example the following code:
def my_method(args)
orange = args[:orange]
lemon = args[:lemon]
grapefruit = args[:grapefruit]
# code that uses
# orange, lemon & grapefruit in this format which is way prettie...
I've been struggling with this for two days right now.
At the moment I have the following rewrite rule:
RewriteRule ^(.*)$ index.php?u=$1 [NC,L]
Which ports everything behind example.com/ to index.php as the GET variable u. Which is being processed in index.php with an explode to define te different arguments being: the city (betwee...
Suppose I have a view that rolls up data via a GROUP BY clause:
CREATE VIEW InvoiceAmountsByCustomer AS
SELECT
Customer.CustomerID,
SUM(Invoice.TotalAmount) AS TotalInvoiceAmount
FROM
Customer LEFT OUTER JOIN Invoice ON Customer.CustomerID = Invoice.CustomerID
GROUP BY Customer.CustomerID
Now, suppose I want the view...
Hello there,
I have a LaTeX file, 'myfile.tex' say, that sometime in the middle of the code an ASCII file with LaTeX macros
has to be input, 'macrofile.tex, say, through an '\input{macrofile}' command. Actually, there are more than one 'macrofiles', so every time I have to edit 'myfile' and change the name of 'macrofile'. I can avoid th...
I have the code (inside one object)
onclick: this._addX.bind(this)
and then inside another object
onclick: this._addY.bind(this)
Now, _addX() and _addY are nearly identical, except they both end up calling (on the click event) a function with different argument values, say _addX calls foo('x') and _addY calls foo('y'). So I tried:
...
Hello,
I'm very new to ruby and I'm trying to write a web application using the rails framework. Through reading I've seen methods being called like this:
some_method "first argument", :other_arg => "value1", :other_arg2 => "value2"
Where you can pass an unlimited number of arguments.
How do you create a method in ruby that can be u...
I don't know if this is possible, but in some of my unit tests, I end up initializing different objects with the same arguments. I would like to be able to store those arguments in some variable and just initialize the multi-parameter object constructor with that variable so instead of doing:
Thing thing1 = new Thing(arg1, arg2, arg3, ...
How do I assign a sequence of character strings to a char ** argv variable in a program? Its a command line argument. I'm currently trying to convert an .exe app to a dll.
For example:
{ "string1", "string2", "string3" } --- > char ** argv variable
My problem is somehow realted to this:
http://stackoverflow.com/questions/1015944/ho...
I am using a Jquery plugin named Jquery gzoom. It's very nice script but when I test it in IE. The script show the Invalid Argument Error. The error only shows in IE.
I am wondering if anyone can figure about where in the script cause the error.
Plugin page: http://lab.gianiaz.com/jquery/gzoom/index_it.html
Thanks in advance.
...
Hello,
So a constant headache at my current employer is that we (the devs) all share a common development 'test' environment. The current process is as follows:
Dev works on a piece of functionality on their working copy of the project branch
When they are confident it works, test the change in the shared development environment
Chec...
When I input commandline arguments,
In Eclipse, using with run configuration. But I don't Know How do i input commandline arguments in IntelliJ IDEA.
...
Hi.I created two applications.(Console Appliaction: MyConApp.exe and Windows Application: MyWinApp.exe)
Purpose, Attach MyConApp.exe to MyWinApp.exe and transfer the MyConApp.exe args with the MyWinApp's Pre-build event.
[update]
MyConApp.exe is a small tool to parse a XSD file and generate a FromXSD.cs file. It worked very vell if i d...
Ok, I guess that this is a very absurd/basic question, but still:
class m
{
public:
void f(int ***);
/***/
}
void m::f(int ***a = NULL)
{
/***/
}
The call to f (as well as any function which has default values for all the arguments) doesn't accept 0 arguments. Why? How should I format the declaration then?
Thanks already.
...
I have a node (node a) with which various other nodes (node b/c/d/e) references.
I can create a view with an argument as the node I'm viewing, (node a), and get a list of the nodes that are referencing that node.
Basically on node a viewing a list of node b-e.
I want to create a views page just for the node references of that node. Bu...
I have a very simple cart which displays the item quantity in a text_field, and the item name. I can fetch the proper data, I can't pass both of my arguments into my method (inventory ID and quantity). I'm receiving an argument error in my cart_update method of the inventories controller.
add_to_cart.html.erb
<% for item in @cart.items...
Possible Duplicate:
Default value to a parameter while passing by reference in C++
Is it possible to do something like this:
// definition
bool MyFun(int nMyInt, char* szMyChar, double& nMyReferencedDouble = 0.0);
Then the function can be called either like this:
MyFun(nMyInt, szMyChar, nMyReferencedDouble);
or like this:
...
What arguments can I use to encourage a beginner Web Designer that jQuery library is worth learning and using? For someone that is proficient in HTML and CSS, with some PHP expertise but with little JavaScript, jQuery appears like a huge risk and a maintenance nightmare.
Presentation articles like these ones published by “Smashing Magaz...