I have a question re: performance and design. Crux of the problem is: do I wrap RunWithElevatedPriviledges around a sequence of methods all requiring its use (but the call is in the wrong layer), do I call it each time in the appropriate later.
I am refactoring code that initially had 2 layers (front-end & database).
I've now split thi...
I have a singleton that is the main engine container for my game.
I have several abstract classes that make the developer implement the different calls to what that specific object needs.
What I want to do is to make my singleton call those methods upon each given object, but avoiding unecessary calls.
Example so you can understand bet...
I am searching for some sample interface or design for creating a "Share & Embed Widget or Link" interface in my website.
I found scribd.com's interface interesting http://www.scribd.com/doc/22735617/Senate-Health-Care-Bill here click on "Share & Embed" link given in top-right of the doc.
Could any one please provide me some sample li...
This issue is technology agnostic, but I am working with C# and ASP.NET and will use this for the pseudo code. Which is the better approach, and why?
Encapsulate logging, transaction and exception handling:
protected void Page_Load(object sender, EventArgs e) {
SomeBusinessClass.SomeBusinessMethod();
}
public class SomeBusinessClas...
I know that this type of question has been asked over and over again, however, I have yet to find a definitive answer for the problem I am looking into.
From all the content on exception handling that I have read it appears that the general concensus is that exceptions should only be used for exceptional circumstances. I've also read i...
I have a design question on how to design parsing a large excel file say 1000 x 100 Rows, and about 10 tabs.
Each Tab having a set of records with primary key as the first col. but these could be repeted in different tabs and each does not have the same set of primary keys.
Read a single primary key and form a java object with all the...
Including PHP/html/js/css and so on.
The difficult thing is how to avoid the hackers uploading destructive scripts?
Is it just possible?
...
I have an application that might receive a net request for data from another computer. The data can be grouped into several categories so that filtering can be made upon it.
In this situation two things can happen:
I give the user the ability to filter the information he wants to send (thus reducing bandwidth and providing the user wi...
I have been getting more involved with WPF for about a year now. A lot of things are new and sometimes it is hard to get my head wrapped around it.
At the same time I am rereading the GOF Design Patterns book.
A few times I would stop in the middle because I would realize that a certain pattern is the very one used in some WPF functio...
Hello, I have come to a point in my 2D game ( I'm writing the whole engine myself for learning purposes ), where I need to create some kind of class that Inherits from my GameEntity class that will contain Entities that actually move somehow in my game.
For example, that class ( MovableGameEntity ) could contain an enemy, so it would ha...
What resources do you use to make a good and beautiful web site design?
Do you use templates?
What patterns you use?
Are there any web site with good resources and ideas?
...
It seems that in C++ and D, languages which are statically compiled and in which template metaprogramming is a popular technique, there is a decent amount of concern about template instantiation bloat. It seems to me like mostly a theoretical concern, except on very resource-constrained embedded systems. Outside of the embedded space,...
Are there any good patterns/practices used while designing Services. I came across this post today:
http://stackoverflow.com/questions/1549743/when-to-use-the-decorator-pattern/1549771#1549771
Though I didn't completely understand but it really gives a new direction to think about designing services.
Note: This question is not any tec...
I'm using a datalist control. How I can add a row separator in the datalist?
I have more than one item in a row and I'm using .Net 2.0.
Separator template work for each item not for each row.
I want to display it like this.
row1-> item1 item2
---separator
row2-> item3 item4
---separator
row3-> item5 item6
...
I really like the idea of reading others people code to improve your design skills. Open source can help here a lot.
This can teach you basic OO principles. But I'm not writing frameworks, I'm writing code for real customers with quite complicated domain logic.
There are lots of manuals of different MVC frameworks(like Create a blog wi...
I'm developing basic GUI application. I have model class which counts time, I need to display this time to label in specific format. What is the right way to do it in according to MVC paradigm ? Logically I think it should be formatted in the view, but view is standard label control and implementing sub-label class seems a little bit ove...
Hi,
I'm investigating a possible design. Is their a way or established mechanism, or pattern, to select a set of arbitary methods to excute depending on some input. For example, if you were trying to implement a lexer, and you didn't want to go so far as implementing using lex, or even going a far as implementing an LL(1) or LR(k) pars...
Say, I want to create a File class
class File{
public:
File(const char *file){
openFile(file);
}
~File();
isEmpty();
};
openFile checks if the file exists or if the contents of the file are valid or not.
File *file = new File("filepath");
if(file)
file->isEmpty();
if my fil...
Hi there,
Does anybody know if I can improve the visual appearance of bookmarks in a PDF. My marketing dept wants me to make them look more "webby" - by which they mean they want them to look more "designed" rather than plain text links.
Cheers, Stan
...
Hello, I'm working on a game where my character needs to be able to have different weapons. For that I think that somehow overlaying the weapon over the moving sprite would be the correct choice, but I'm not sure about how could I do this.
Assuming my Character spritesheet looks like this:
And my preliminar weapon spritesheet ( haven...