I see that in Ruby (and dynamically typed languages, in general) a very common practice is to pass a hash, instead of declaring concrete method parameters. For example, instead of declaring a method with parameters and calling it like this:
def my_method(width, height, show_border)
my_method(400, 50, false)
you can do it this way:
de...
class Class1(object):
...
class Class2(object):
...
class Class3(object):
...
class A(object):
def _methA(parm1, parm2)
...
def _methB(parm1, parm2)
...
def _methC(parm1, parm2)
...
def manager(parm1, method, params)
...
if parm1.__class__.__name__==Class1.__name__...
I have a textbox that I want to validate, but when I validate it and whatever way I am setting the border seems to actually wrap the actual border I want to change inside the textbox i.e. it adds another border outside the textbox.
Has anyone got any example of how to set a pixel perfect border that doesn't look pants on an event?
...
The question is pretty simple actually. I have a module in my system containing classes that describe some measurement results. I also have a module containing classes used for a visualization. These two modules are not really related to each other and I prefer to not let them know each other.
Now I want to visualize the results using ...
These methods are laughably stupid, IMO, but I want to get a feel for what other developers think of such code. Criticisms may include technical and stylistic errors. Corrections may use anything from Apache commons-lang, such as StringUtils, DateUtils, etc, as well as anything in Java 5. The code is intended for a web application, if th...
I'm building a set of methods to provide functionality to a number of different web applications, the methods basically get some data from SQL perform some operations on it and then pass it back to the calling application. They have to be implemented via web services.
So my question is what are the pros and cons between creating one mas...
I'm planning to code a library that should be usable by a large number of people in on a wide spectrum of platforms. What do I have to consider to design it right? To make this questions more specific, there are four "subquestions" at the end.
Choice of language
Considering all the known requirements and details, I concluded that a lib...
Do you know any source for nice looking software designs? (non Web).
...
Hi
We have a C++ application for which we try to improve performance. We identified that data retrieval takes a lot of time, and want to cache data. We can't store all data in memory as it is huge. We want to store up to 1000 items in memory. This items can be indexed by a long key. However, when the cache size goes over 1000, we want to...
Suppose I have a class Base which has a member variable A* my_hash.
I also have class Extended which inherits from class Base. I also have a class B
which extends A.
class Base{
Base(): my_hash(new A) {}
//methods which use my_hash
protected:
A* my_hash;
};
class Extended:public Base{
//methods which use my_hash from A
//I can...
What is the best way to represent an XML file in a design document?
For table we typically show it as
Name Type
CustomerID {GUID}
For XML do we just paste the XML in the document?
...
HI all.
I have started a new job recently where I am supposed to work with C++/ I have been doing programming in C language for past 5 years. I am looking for ways to get me up to an acceptable level in OOP. I have all the basic concepts of C++ and OOP but don't have much experience of actual class designing.
What I really am looking for...
Hi,
I am looking for recommendations on resources (both books and websites) on designing GUI applications. By designing I mean the technical design (when and how to use data binding, when should MVC/MVP be used, what functionality should go into the model, the view, the controller/presenter, how can different parts of the UI best be kep...
Once upon a time I had a little .net project called Intranet. It simply served up web pages, and displayed some data retrieved from a database. Over time a monster has grown out of this little .net project. I've added different dashboards and reporting functionality and whatever else was requested of me at the time. Now I have a big ...
I am developing an archive module for an application using Dotnet and SQL Server as back end. From multiple approaches of archiving we've decided to build a custom application to archive the complete database up-to a chosen threshold to another mirrored database and then removing the archived items from source DB. This has to be done fro...
I have a project that I have recently started working on seriously but had a bit of a design discussion with a friend and I think he raised some interesting points.
The project is designed to be highly scalable and easy to maintain the business objects completely independently. Ease of scalability has forced some of the design decisions...
I often catch myself doing the following (in non-critical components):
some_small_struct *ptr=(some_small_struct *) malloc(sizeof(some_small_struct));
ptr->some_member= ...;
In words, I allocate dynamically memory for a small structure and I use it directly without checking the malloc'ed pointer. I understand there is always a chance...
I'm new to Django (and databases in general), and I'm not sure how to structure the following. The sources of data I'll have for my site are:
a blog
for a few different games:
a high score list
user-created levels
If I were storing the data in ordinary files, I'd just have one file for each of the above. In Django, ideally (I think...
i'm reading about way to implemnt client-server in the most efficient manner, and i bumped into that link :
http://msdn.microsoft.com/en-us/library/ms740550%28VS.85%29.aspx
saying :
"Concurrent connections should not exceed two, except in special purpose applications. Exceeding two concurrent connections results in wasted resources. A ...
i'm looking for a book that talks about sofware decision like :
when should i use thread pool and shouldn't. and in the first case, explains how.
how should i acess my DB , how big my transactions should be
how to read XML, to use DOM or SAX, what library to choose, and best ways to parse
how to handle client-server app best efficient...