In my class I want to declare an event that other classes can subscribe to. What is the correct way to declare the event?
This doesn't work:
public event CollectMapsReportingComplete;
I recently encountered this error when I attempted to consume a new hosted WCF service. The service used the Request/Response model and had been properly decorated. The response and request objects were marked as DataContracts and had a specified namespace. My WCF service interface was marked as a ServiceContract and shared…
<b>Open Enterprise:</b> "...now the industry is in the process of sorting out what royalties will be for the software stack, which now represents the principal value proposition for smartphones."<br><i>Really? So the value proposition is not in delivering features and services that customers want.--ed.</i>
I have a sql statement which is hardcoded in an existing VB6 app. I'm upgrading a new version in C# and using Linq To Sql. I was able to get LinqToSql to generate the same sql (before I start refactoring), but for some reason the Sql generated by LinqToSql is 5x slower than the original sql. This is running the generated Sql Directly in…
Hi,
I got the following stored procedure from http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html
Does this work?
CREATE FUNCTION myWithin(p POINT, poly POLYGON) RETURNS INT(1) DETERMINISTIC
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE pX DECIMAL(9,6);
DECLARE pY DECIMAL(9,6);
DECLARE ls…
I'm getting this error whenever I attempt to declare a class:
Parse error: syntax error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or
T_FUNCTION or T_VAR or '}' in /home3/foundloc/public_html/booka/page2.php
on line 7 (line 7 is the class declaration by the way).
Here's the incredibly simple class I am attempting to declare:
…
Hello,
In Python, I can declare attributes all over the class. For example :
class Foo:
def __init__(self):
self.a = 0
def foo(self):
self.b = 0
It's difficult to retrieve all attributes in my class when I have a big class with a lot of attributes.
Is it better to have the following code (a) or the next following code…
I'm trying to write a little SQL Helper. I have a query like this stored in a string:
DECLARE @V1 INT
--ignore
DECLARE @V11 INT
DECLARE @V12 INT
--endignore
DECLARE @V2 INT
--ignore
SELECT * FROM SampleTable
INNER JOIN AnotherSampleTable
......
--endignore
SELECT * From Employee ORDER BY LastName
My helper method should cut…
I code in Python a lot, and I frequently create classes. Now, I'm not sure if this is good Python form, but I just declare a class in the same file as my main().
class foo {
...
}
I'm wondering if it's good form in Java to do the same?
For example,
class foo {
public static int name;
public static int numPoints;
…
I recently spent some time troubleshooting odd query plans and came to the conclusion that we needed better statistics. We’ve been running sp_updatestats but apparently it wasn’t sampling enough of the table to get us what we needed. I have a pretty limited window at night where I can hammer the disks while this…
How can i solve "must declare a body because it is not marked abstract, extern, or partial". This problem. Can you show me some advices?
Full Error message is about Save, Update, Delete, Select events...
Full message sample : GenoTip.DAL._AccessorForSQL.Save(string, System.Collections.Specialized.ListDictionary,…
Is it possible to declare two variables of different types in the initialization body of a for loop in C++?
For example:
for(int i=0,j=0 ...
defines two integers. Can I define an int and a char in the initialization body? How would this be done?
Hi everyone,
My problems is in a Struts2 action, where
I have a class :
public class MyAction<T> extends ActionSupport
with a private member like this :
private T myData;
And I would like to declare this aciton in the struts.xml file,
how can i manage to do so ?
Thanks for the answer.
Ps : I've…
I know we can declare the exception for our method if we want it to be handled by the calling method. This will even allow us to do stuff like write to the OutputStream without wrapping the code in try/catch block if the enclosing method throws IOException.
My question is: Can anyone provide an instance…
I'm trying to understand what is the correct why to implement COM interfaces from C# code. It is straightforward when the interface doesn't inherit from other base interface. Like this one:
[ComImport, Guid("2047E320-F2A9-11CE-AE65-08002B2E1262"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public…
Is it better to declare fields of a class in this way:
function MyClass() {
this.aMethod = function() {
// code
}
}
Or this way:
function MyClass() {
}
MyClass.prototype.aMethod = function() {
// code
}
Any why?
Thanks in advance.
Is there a way to "declare" a variable with a particular user-defined type in MATLAB? zeros() only works for built-in numeric types. The only solution I've come up with involves using repmat() to duplicate a dummy object zero times:
arr = repmat(myClass(), [1 0])
Without declaring variables this way, any…
lets say I have this
char *something[] = {
"/bi",
"-c",
"5",
NULL,
NULL
};
but I want to declare it in hex, how would I do this; compiler keeps erroring out on me:
char *something[] = {
{0x2f,0x62,0x69},
{0x2d,0x63},
{0x35},
{0x00},
{0x00}
};
What Could be the example scenarios to declare any class or any method as "final"? When do we need to do this?
Please give me some example to understand the practical use of "final"...
please guide me as I am a beginner in OOP
Hi,
If I am developing a class and I don't know who are going to use it. What's the drawback if I declare all the member functions virtual? It's a good design or bad design?
Thanks so much!
Regards.
Generally we derive custom activity from Activity or CompositeActivity class, i want to have my custom base class for all activities :
like
public class BusinessActivity : Activity
{
}
then my custom activities will derive from BusinessActivity .
The quetions is if i want ErrorMessageProperty and…