This is a very generic 'best practice' question, but here's an example.
Let's say I have a movie cataloging app. I want to give my users the chance to specify, say, IMDb or Metacritic for their synopsis/ rating info.
Do I do this:
if (preferredSupplier == "imdb"){
getIMDbRating(movieName);
}else{
getMetacriticRating(movieN...
Here's the code in AlertTableView:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
NSInteger index = 12345;
NSLog(@"AlertTableView: selecting row at index %d", index);
[self.caller didSelectRowAtIndex:index withContext:self.context];
}
In self.caller:
- (void)didSelectRowAtIndex:(NS...
I have written an Service Provider implementation for OAuth and one of the Devs found a bug in the way the implementation was ordering query parameters. I totally missed the lexicographical ordering requirement in the OAuth spec and was just doing a basic string sort on the name value parameters
Given the following URI request from the...
I'd like to implement the following logic:
function setMyValue (myVar:int = undefined):void
{
if (myVar == undefined)
{
/* Generate a value for myVar */
}
else
{
/* Use the supplied value for myVar */
}
}
So if the value is supplied, use it. If not, generate it. Seems simple enough.
Problem is that A...
I'm trying to work out what the best method to passing a large number of parameters into a stored procedure.
Some methods i was thinking about are;
Create the relevant database objects, including a parameter object for each item and invoke the command object
Pass in an XML document and have the stored procedure unpack it. (The app wil...
I have a Search Form that can search by a few different fields. The problem field is birthDate. On the form it is a string. In the SQL 2005 db it is a DateTime that can be null.
The code below is sequential as far as declaring the variable on the form and then setting it. Then the call to the BLL and then the call to the DAL.
On ...
I've come across several instances of C# code like the following:
public static int Foo(this MyClass arg)
I haven't been able to find an explanation of what the this keyword means in this case. Any insights?
...
Does the method get called with a null value or does it give a null reference exception?
MyObject myObject = null;
myObject.MyExtensionMethod(); // <-- is this a null reference exception?
If this is the case I will never need to check my 'this' parameter for null?
...
I want to do something like the following
class A:
def static_method_A():
print "hello"
def main(param=A):
param.static_method_A()
I want this to be equivalent to A.static_method(). Is this possible?
...
The following code kills VB6 (sp6) with an 'unhandled exception fault in VB.exe' on two machines in the office on the line marked.
''# Form1.frm
Option Explicit
Private ArrayHolder As Class2
Private Sub Command1_Click()
Set ArrayHolder = New Class2
Dim arr(3) As Long
arr(0) = 1
arr(1) = 2
arr(2) = 3
ArrayHolde...
No matter how I try, I cannot mimic the clean syntax of Rhino Mocks, without declaring a delegate.
Example:
Expect.Call(service.HelloWorld("Thanks"))
Do you have any idea on how to do this?
Thanks.
...
Earlier today I asked a question
about passing dictionary values to a function. While I understand now how to accomplish what I was trying to accomplish the why question (which was not asked) was never answered. So my follow up is why can't I
def myFunction(newDict['bubba']):
some code to process the parameter
Is it simply beca...
The situation is as follows:
page.jsp?var[0]=foo&var[1]=bar
How can this be retrieved in an array in Java?
The following:
page.jsp?var=foo&var=bar
I know can be retrieved using request.getParameterValues("var")
Any solutions for the above though?
...
(N is unknown)
$controller->$action($params);
must be
$controller->$action($param1, $param2, $param3... $paramN);
...
Group,
We built a data cube using SSAS and are now building SSRS reports off of that cube. Not sure if anyone has come across this, but when you build the report using the wizard and include parameters all looks fine. However if you are in the report after the wizard is compete, and you decide you want to remove one of the parameters y...
I have done some research, and majority of the examples I have found use forms (obviously for user input) to collect data which is then passed to another JSP page through the request object.
My question is: "Is it possible to pass a parameter between JSP pages IF the parameter hasn't been set in HTML tags?"
Thankyou,
Lucas
...
I have a COM-visible method which looks something like the following:
Public Sub SomeMethod(someControl as Object)
On Error Goto ErrHandler
Dim someSpecificControl as SpecificControl
MsgBox TypeOf someControl is Control
MsgBox TypeOf someControl is SpecificControl
On Error Resume Next
Set someSpecificControl = someCon...
So my background is in Java web services, but I'm trying to make the move to ROR.
I'm using FlexImage to handle image uploading and thumbnail generation. I followed the guide and CRUD behavior was working fine at one point. However, at some point, CRUD behavior for one of my models (Images) was broken.
The error code I'm getting back...
Hello,
Let's say a have a stored procedure SetCustomerName which has an input parameter Name, and I have a table customers with column Name.
So inside my stored procedure I want to set customer's name. If I write
UPDATE customers SET Name = Name;
this is incorrect and I see 2 other ways:
UPDATE customers SET Name = `Name`;
UPDATE cu...
Hello,
Let's say a have a stored procedure SetCustomerName which has an input parameter Name, and I have a table customers with column Name. So inside my stored procedure I want to set customer's name. If I write
UPDATE customers SET Name = Name;
this is incorrect and I have to write (for example)
UPDATE customers SET `Name` = Name;...