Hi all how do i declare a new lookup class for a property in the object intialiser routine in c#?
eg
new Component() { ID = 1, Name = "MOBO", Category = new Lookup<int,string>}
the category bit always get a compile error
thanks
...
Hi all!
I would like to know about static (class) field representation within PHP interpreter.
For example, when you load a class in Java, static fields will be associated with that Class object; that means two applications running same JVM (and same classloader) will have some kind of shared global variable ;)
I'm just wondering, if ...
hello
I wrote a java test and I run it from run as junit test
in my project a bin folder was created with ".class" file
when I wrote a shell to launch the same test(with some modif) by command line it it launches the test without taking account my modif , do the tests use tha generated .class ?
could I remove this ".class" and launch te...
I am coming from c# where this was easy, and possible.
I have this code:
public abstract class clsAbstractTable {
public abstract String TAG;
public abstract void init();
}
but Eclipse tells me I use illegal modifier.
I have this class:
public class clsContactGroups extends clsAbstractTable {
}
I want the variable an...
I'm a Java developer who's trying to move into C#, and I'm trying to find a nice equivalent to some Java code. In Java, I can do this:
public interface MyInterface
{
public void theMethod();
}
public abstract class MyAbstractClass implements MyInterface
{
/* No interface implementation, because it's abstract */
}
public class ...
I've just started combining my knowledge of C++ classes and dynamic arrays. I was given the advice that "any time I use the new operator" I should delete. I also know how destructors work, so I think this code is correct:
main.cpp
...
int main()
{
PicLib *lib = new PicLib;
beginStorage(lib);
return 0;
}
void beginStorage...
In my Java project I need to list all class names in the current package, I usually run my app in two different modes : <1> From NetBeans, <2> From an executable jar file packaged by the NetBeans.
My question is : How to write my program so that no matter which mode it is running, it can list all the class names in my app. Because when ...
I am looking for differences between those 3 ways of using static class in asp.net application scope.
Will all of these point to the same class?
Which one is preferable >object< defined declaratively inside global.asax or static class ?
examples:
<object runat="server" scope="application" class="classname" ID="objID"></object>
VS
pu...
Per this question (see comments near the bottom), I was wondering if anyone knows any way to get Eclipse to store .class files in a folder of my choosing outside the project folder where the .java source files are stored. I have not seen an option to do this in the new project creation wizard, but my knowledge of Eclipse is quite limited...
So that the final class have all member variables/methods in both class
Is there an easy way to go?
...
What are the purposes of having private/protected members of a class/structure in object-oriented programming? What's the harm in having all members be public?
...
I have two projects 'HOD', and 'Controllers'. Controllers is a class library with a namespace of 'Controllers'. In the code file for HOD I am trying to reference the Controllers namespace by 'using Controllers'. I added a reference in the HOD project to Controllers and it does show up in VS2008 under the references folder.
When I bui...
I want to measure dependencies between classes - what's the best approach and tools to use?
I'm working in MS .Net
Text based information / reports are OK, but I'd prefer something visual.
Open source tool would be ideal.
...
I am trying to find out the reasons why the class cant be created as a static?
Like
public static class Qwert{
public static void main(String args[]){
int x = 12;
while(x<12){
x--;
}
System.out.println(" the X value is : "+ x);
}
}
...
In the following code below, how to retrieve the value of id,Id has multiple values in it.How to access the values of id and update it to result1
def parse_results ():
try:
xml = minidom.parseString(new_results)
for xmlchild in xmldoc.childNodes[0].childNodes :
result1 = {}
result1.update ({'f...
Since I'm using Postgresql and can't use LINQ to SQL, I wrote my own wrapper classes.
This is a part of the Student class:
public class Student : User
{
private static NpgsqlConnection connection = null;
private const string TABLE_NAME = "students";
public int Id { get; set; }
public string FirstName { get; set; }
...
I want to reload just my web layer classes without reloading my service layer classes (which take longer to initialize and change less frequently). There are no references from my service layer into the web layer and I can create a whole new instance of the web layer without problems.
I can conceive of a solution involving complicated ...
I'm debating with myself about the best practice approach to controlling an Aggreate View Model class that I've created for my app... Let's say I have an aggregate model that has a PurchaseOrder object and a list of line items that belong to that Purchase Order, and a few other auxuliary/related objects. This view model is just a wrapper...
If I delcare an object to be a subclass of handle
classdef obj < handle
my object is now essentially a "pointer" to some memory somewhere. How do I find out how much memory my object is using up?
For example, say I have a class foo with a field bar
classdef foo < handle
properties
bar = randn(1000);
end
bar takes up 8 megabytes...
<?php
class obj {
var $primary_key;
function obj($key = null){
if(isset($key)){
$this->primary_key = $key;
}
echo "primary_key: ".$this->primary_key."<br/>";
$this->obj_id = 14;
echo "obj_id: ".$this->obj_id."<br/>";
$key = $this->primary_key;
echo "obj_id...