in Objective-c I have this function prototype:
-(NSString*)formatSQL:(NSString*) sql, ...
I may pass to this function any type of parameters: NSString, NSNumber, integer, float
How can I determine in the function if a parameter is an object (NSString..) or a primitive (integer...)?
thanks
BrochPirate
My report has a parameter which uses a base enum. The enum has 4 different options to choose when running the report. How do I insert an option which uses all 4 at once?
For example, I have an enum named Phone and it has 4 types: 1 = None, 2 = Home, 3 = Mobile, 4 = Work. In a drop down, how do I add option 5 = None+Home+Mobile+Work?
Thank you!
In my application I have a string parameter called "shop" that is required in all controllers, but it needs to be transformed using code like this:
shop = shop.Replace("-", " ").ToLower();
How can I do this globally for all controllers without repeating this line in over and over?
Thanks,
Leo
I'm building a test, in wich i need to send question, and wait for the answer.
Message passing is not the problem. In fact to figure out wich answer correspond to wich question, i use an id. My id is generated using an UUID. an i want to retrieve this id, wich is given as a parameter to a mocked object.
It look like this:
…
This might be a duplicate question.But could not find it in search
In java to mark a method parameter as constant we declare it as final whats the equivalent C# keyword?
Like:
public void doSomeThing(final object myObject)
{
//print myobject
}
Hi,
could u give me a sample code of using output parameter in function? I tried to google it but just found it in function. I'd like to use this output value in another function.
I will use this code in Android.
I have an ID that I need in the next jsp once the user click a button. I am trying to do the following:
FirstJSP.jsp:
function getSecond() {
var frm = document.getElementById("frm");
frm.action = "**second.jsp?id=myId;"**
frm.submit();
}
...
form id="frm"
.....
input…
[Sorry about a messy question. I believe I am targeting .Net 2.0 (for now)]
Hi, I am an ASP.NET noob. For starters I am building a page that parses a URL string and populates a table in a database. I want that string to be strictly of the form:
…
Hi, I've made a form containing a TVirtualStringTree that works in Delphi 7 and Delphi 2010. I notice that as I move between the two platforms I get the message '...parameter list differ..' on the tree events and that the string type is changing…
What I would like to do in my code is something like that below:
static class MyClass
{
static byte[,,] array3d = { { {0,0},{0,0}},{{0,0},{0,0}}};
static MyClass()
{
someMethod(array3d[0]);
someMethod(array3d[1]);
…
Hey there,
I'm writing a program that passes data from a file into an array, but I'm having trouble with fopen (). It seems to work fine when I hardcode the file path into the parameters (eg fopen ("data/1.dat", "r");) but when I pass it as a…
Hi I'm new to ObjectiveC / IPhoneSDK and I'm informally trying to study it on my own. What I'm basically trying to do is from one view there are 12 zodiac signs. When a user clicks one, it proceeds to the second view (with animation) and loads…
Hello, I am trying to pass a variable to an ajax request via jquery. I have a triggered event that defines the variable. I want to do this so that I can have one ajax request handle multiple urls. I have alerted the url and it come back fine,…
When I run this code
def func(x, y, *w, **z):
print x
print y
if w:
print w
if z:
print z
else:
print "None"
func(10,20, 1,2,3,{'k':'a'})
I get the result as follows.
10
20
(1, 2, 3, {'k': 'a'})
None
But,…
Is it possible to create a PHP function that takes a variable number of parameters all of them by reference?
It doesn't help me a function that receives by reference an array of values nor a function that takes its arguments wrapped in an…
I am trying to send data to a servlet from a js file but the servlet never received the parameter. so this is what I have:
function showProject(prj)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser does not support…
This is a very basic example of what I am trying to implement in a more complex batch file. I would like to extract a substring from an input parameter (%1) and branch based on if the substring was found or not.
@echo off
SETLOCAL…
Here is my scenario: i have a parent web page, in my javascript code I open a new window. This new window is a server-side aspx page. This child page needs to save some data in the database, and after saving it returns an ID. Now, I…
I have an attribute lets call it SomeAttribute and a class i need to make sure the class is passed a type which has SomeAttribute. So this is how i do it now:
public class Test()
{
public Test(SomeType obj)
{
…
Hi there
I have a regular dll with the followign fucntion exported.
extern "C" __declspec(dllexport) int FindNearestStuff(double _latitude, double _longitude , LocationStruct * locations[])
LocationStruct is very simple
…
Hi All,
I was writing a C program where I use 6 variables a,b,c,d,e,f
a,b,c are constant values which I should pass as an argument(command line)
d,e,f are going to be size of arrays(which are a part of a structure)
…
Suppose I have a class like this:
public class ThingManager {
List<SomeClass> ItemList;
public void AddToList (SomeClass Item)
{
ItemList.Add(Item);
}
public void ProcessListItems()…
I have this method (simplified):
void DoSomething(IEnumerable<int> numbers);
And I invoke it like this:
DoSomething(condition==true?results:new List<int>());
The variable results is formed with a LINQ…
Here is my error:
Warning: mysql_query() expects parameter 2 to be resource, null given...
This refers to line 23 of my code which is:
$result = mysql_query($sql, $connection)
My entire query code looks like…