Hi
I have a parent object that I use for general CRUD in my applications - it has basic save & retrieve methods so I can don't have to reinclude them them in all my objects. Most of my child objects extend this base object. This has worked fine, but I'm finding a problem with retrieving a serialized child object. I use a "retrieve" meth...
Hello,
I have an app that has settings the user can pick before running the app. The settings are stored in a database. The entire app uses these settings. Right now, each class that uses the settings calls the database in its constructor to load the settings into a class. This seems odd to me because, the settings shouldn't change in t...
How can i model foollwing problem statatement into java classe?
I have a class vehincle.
Vehicles can be of type Trucks, Cars, Scooters, motorcycles.
Vehicle has a engine.
engine shold have following contraints
Petrol Engine and Diesel Engine are types of Engines
Truck comes with 4 stroke, 12 cylinder Diesel Engine
Car can have eithe...
I wrote a nice little app that gets Yahoo weather info and posts it to Twitter. It worked flawlessly and now I want to rearrange the code into differently named files so it makes more sense. And that's when I hit some issues.
Previously, I had a Class in libtweather.py. It was my account. It allowed me to do accountName.parseFeed() an...
Hi Guys,
I have a tree structure design problem, and i can't think of a way out.
i want to have one class Tree containing a generic data, and extend the Tree class with ComplexTree that will contain more methods like Iterate, DoSomthingOnComplex, etc.
here is a sample of the code i have:
class Tree<TData>
{
public TData Data { ge...
I have a class called PriceStep. I keep a list of PriceStep objects in a class called PriceStepSearchSpace. Now I am required to have different PriceStepSearchSpace objects for different products and I need to keep them in some sort of a dictionary. I called this new class PriceStepSearchSpaceRepository.
Can you think of a simpler/short...
catch google.maps.Marker.prototype.setPosition calls
(function(){
var setPos = google.maps.Marker.prototype.setPosition;
google.maps.Marker.prototype.setPosition = function(latLng){
console.log(["setPos", latLng]);
setPos(latLng);
};
})();
return error
this.set is not a function
http://maps.gstatic.com/intl/cs_ALL/mapfiles/ap...
I get the Error
Fatal error: Call to undefined function getAvnet() in C:\xampp\htdocs\ems\app\controllers\queries_controller.php on line 23
when accessing the source file attached.
The line is:
$ret = getAvnet('de', $searchstring);
supposably calling
function getAvnet($country, $query)
The Source File
...
Hi All,
Just a quick question here:
If I choose the object oriented style to interact with my database, ie...
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
And I then use $mysqli->close(); to close the connection at some point...
Can I reopen that connection by simply initiating another query $mysqli->quer...
I'm trying to take full advantage of object oriented php and learn something along the way.
Following an MVC tutorial I was able to do this:
class Repository {
private $vars = array();
public function __set($index, $value){
$this->vars[$index] = $value;
}
public function __get($index){
return $this->va...
If I replace all object references in my Delphi program with interface references, and use objects which are inherited from TInterfacedObject, will the resulting application run with the same speed as before? Or does the reference counting add a significant execution overhead at run time?
...
In writing my current project, I have created interfaces for all of my objects. I thought that this was considered good coding practice.
I've basically ended up with a bunch of interfaces which define pretty trivial classes.
Eg:
public interface IUser
{
int Id { get; }
string DisplayName { get; }
}
I don't really see any po...
I'm trying to visualize the results of a quiz in ActionScript 3.0.
What I would like some input on is how to best link the "filters" (top right corner in attached image) to the data source in a flexible OOP way.
The result array now contains both number of correct answers and meta data about the person taking the quiz. The meta data cou...
Hi all. This might be a little subjective, but I'd like to get your input on my current situation. I have a class that will be used to serialize/deserialize an object.
public class MyClass
{
public static string ToXmlString( MyClass c ) { /*...*/ }
public static MyClass FromXmlString( string xml ) { /*...*/ }
}
I only like th...
The question is in the title.
...
function A(){
this.a = {};
this.b = 0;
this.Test = function(value){
this.a.x = value;
this.b = value;
};
}
function B(){}
B.prototype = new A;
var b1= (new B());
b1.Test(1);
var b2= (new B());
b2.Test(2);
log(b1.b == 1); //true
log(b2.b == 2); //true
log(b1.a.x == 1);//false ...
I'm new to Ruby (experienced with Python, C++ and C). I need to create a class that is only to be used by other classes and methods in a module. In Python, I'd just call it __classname. I'd use an empty typedef in C++. How do I do this in Ruby (or am I barking up the wrong tree and not doing this the "Ruby way"?)
...
Hey guys,
I am hoping someone can explain about subclasses accessing variables from the super class.
I found that the subclass can only access variables which are set in the constructor of the super class. Is there any way around this?
package Character {
import flash.display.MovieClip;
public class Character extends MovieClip {
...
I'm getting a bit of a headache trying to figure out how to organise modules and classes together. Coming from C++, I'm used to classes encapsulating all the data and methods required to process that data. In python there are modules however and from code I have looked at, some people have a lot of loose functions stored in modules, wh...
I am working on a personal project that uses a custom config file. The basic format of the file looks like this:
[users]
name: bob
attributes:
hat: brown
shirt: black
another_section:
key: value
key2: value2
name: sally
sex: female
attributes:
pants: yellow
shirt: red
There can be an arbitrary number of users ...