class

Create class diagram from already existent iphone code

Hey, does anybody know, how i could create automatically a UML class diagram from an already existent iphone project. Is it possible? Thanks in advance. ...

About Python class and instance variables

I've been trying to understand Python's handling of class and instance variables. In particular, I found this answer quite helpful. Basically it says that if you declare a class variable, and then you do an assignment to [instance].property, you will be assigning to a different variable altogether -- one in a different namespace from the...

How to dynamically access class properties in Python?

Let's say I create an instance of a class and want to assign some values to its public properties. Usually, this would be done like this: class MyClass: def __init__(self): self.name = None self.text = None myclass = MyClass() myclass.name = 'My name' But, what if a write a function that takes a class as parameter...

Use of class definitions inside a method in Java

Hi public class TestClass { public static void main(String[] args) { TestClass t = new TestClass(); } private static void testMethod(){ abstract class TestMethod{ int a; int b; int c; abstract void implementMe(); } class DummyClass extend...

Handwritten linked list is segfaulting and I don't understand why

Hi I was working on a bit of fun, making an interface to run gnuplot from within c++, and for some reason the my linked list implementation fails. The code below fails on the line plots->append(int> and ll<char*> but for some reason it fails as ll<Plot*>. Could youp please help me figure out why it fails? and perhaps help me understand...

python: variable not getting defined after several conditionals

For some reason this program is saying that 'switch' is not defined. What is going on? #PYTHON 3.1.1 class mysrt: def __init__(self): self.DATA = open('ORDER.txt', 'r') self.collect = 0 cache1 = str(self.DATA.readlines()) cache2 = [] for i in range(len(cache1)): ...

How to access constant defined in child class from parent class functions?

I saw this example from php.net: <?php class MyClass { const MY_CONST = "yonder"; public function __construct() { $c = get_class( $this ); echo $c::MY_CONST; } } class ChildClass extends MyClass { const MY_CONST = "bar"; } $x = new ChildClass(); // prints 'bar' $y = new MyClass(); // prints ...

How to get all possible generic type in StructureMap?

I just used StructureMap few days ago. I use StructureMap for collecting all validator class like the following code. public class BaseClassA {} public class ClassB : BaseClassA {} public class ClassC : BaseClassB {} public BaseClassAValidator : IValidator<BaseClassA>() {} In StructureMap, I only register IValidator interface for B...

Google Analytics API Authentication Speedup

I'm using a Google Analytics API Class in PHP made by Doug Tan to retrieve Analytics data from a specific profile. Check the url here: http://code.google.com/intl/nl/apis/analytics/docs/gdata/gdataArticlesCode.html When you create a new instance of the class you can add the profile id, your google account + password, a daterange and wh...

Can someone here explain constructors and destructors in python - simple explanation required - new to programming

i will try to see if it makes sense :- class Person: '''Represents a person ''' population = 0 def __init__(self,name): //some statements and population += 1 def __del__(self): //some statements and population -= 1 def sayHi(self): '''grettings from person''' print 'Hi My name i...

When and how are classes garbage collected in Java?

I asked a question about Garbage Collection in Java in this topic. But the answer I got, gave me another question. Someone mentioned that classes can be collected by the garbage collector too. Is this true? And if it is true, how does this work? ...

.NET/C#: How to remove/minimize code clutter while 'triggering' Events

Hi, I just wanna find out if there's a way I could minimize code clutter in my application. I have written code/s similar to this: private void btnNext_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e) { btnNext.Opacity = 1; } private void btnNext_MouseLeave(object sender, System.Windows.Input.Mo...

sorting a gridview in class

ok i have a project which has many gridview in its pages... now i am sorting the fridveiw using the sorting function like this: protected void GridView1_Sorting(object sender, GridViewSortEventArgs e) { DataTable dt = Session["TaskTable2"] as DataTable; if (dt != null) { //Sort the data. ...

How do you resolve the common naming collision between type and object?

Since the standard c# convention is to capitalize the first letter of public properties, the old c++ convention of initial capital for type names, and initial lowercase for non-type names does not prevent the classic name collision where the most obvious object name matches the type name: class FooManager { public BarManager BarMana...

Animate programmatically added subviews

Hey, I've setup an own class(custom UIView). I'am adding two of these customViews to my UIView as subviews. So now the question araises: How do I animate the subviews? myCustomView *myCustomViewInstance = [[myCustomView alloc] initWithText:@"myText"]]; [self.viewContainer addSubview:myCustomViewInstance]; myCustomView *myCustomVie...

PHP and Classes: access to parent's public property within the parent class

Hi, here is what my code looks like i have two forms: class Form_1 extends Form_Abstract { public $iId = 1; } class Form_2 extends Form_1 { public $iId = 2; } i expect the code behave like this: $oForm = new Form_2; echo $oForm->getId(); // it returns '2' echo $oForm->getParentId(); // i expect it returns '1' here is m...

Compare Database container and class container

I am using a SQL Server database in my current project. I was watching the MVC Storefront videos (specifically the repository pattern) and I noticed that Rob (the creator of MVC Storefront) used a class called Category and Product, instead of a database and I have notice that using LINQ-SQL or ADO.NET, that a class is generated. Is there...

Can I join 2+ styles together into a superstyle?

Hi I was looking to join 2 styles together to make a super style for easy use and customisation of my page. Is it possible to define something like this? (if so how) .bold { font-weight: bold;} .color1 {color: white;} .boldColor {.bold; .color1;} where .boldColor is effectively .boldColor {font-weight:bold; color:white;} I want t...

Objective-C Class Question?

Hey, My head is about to explode with this logic, can anyone help? Class A #imports Class B. Class A calls Method A in Class B. This works great Class B wants to send a response back to Class A from another method that is called from Method A. If you #import Class A from Class B, it is in effect an infinite loop and the whole thing cr...

Flash AS3 undefined property MouseEvent in document class

Hi guys, this is my first time trying to use document classes in AS3 and im struggling. I am trying to add event listeners to a 2 levels deep movie clip, waiting for a click however i am getting the following error. ERROR: Access of undefined property MouseEvent package { import flash.display.MovieClip; import flash.media.Soun...