I want to take HttpContext.Current.Request and HttpContext.Current.Session and wrap them together into one class.
Basically i want to write col["key"]; and have it check one of these for the key and if it doesnt exist to check the other.
AFAIK they don't share an interface (i looked around using "Go To Definition" but i am pretty bad)....
I'm looking for a bit of advice with regards to the structure of an application I'm tasked with.
I need to have a series of webforms to store some data, most of the data is the same but each form would have some differeing data depending on the form used.
Would a base class then a series of classes inheriting from this for the specific...
Hi.
In a large Application is there any way to distinguish user-defined classes with built-in classes without checking ?
...
I'm actually creating websites for fun and some of my friends told me that I could be more efficient if I could create the output of the page with a php class that would represent the whole page.
I was wondering how you people would do it.
Thanks
...
I will go straight to the example:
class Foo:
@execonce
def initialize(self):
print 'Called'
>>> f1 = Foo()
>>> f1.initialize()
Called
>>> f1.initialize()
>>> f2 = Foo()
>>> f2.initialize()
Called
>>> f2.initialize()
>>>
I tried to define execonce but could not write one that works with methods.
PS: I cannot define the code ...
to create an instance of another class from a class even if the class I want to have an instance of is declared next of the class I am creating an instance from. Just like in C# and Java.
Thank you
...
Possible Duplicate:
How many Python classes should I put in one file?
Coming from a C++ background I've grown accustomed to organizing my classes such that, for the most part, there's a 1:1 ratio between classes and files. By making it so that a single file contains a single class I find the code more navigable. As I introduce...
Edit
Since there were many downvotes and people who didn't understand what I'm asking for, I'll rephrase:
How do I find out at runtime what is the class that foo was generified from?
public boolean doesClassImplementList(Class<?> genericClass)
{
// help me fill this in
// this method should return true if genericClass implements Li...
Hello,
I googled,I binged,I already have seen the other "duplicates" here,but none of them work in Delphi 2009 updated up to update 4.
Like in C#,I want to make a static variable in on line or as short as possible.In the end it works like a global variable,but its sorted.
What's the shortest way to do this in delphi 2009?
EDIT
I fol...
Hi,
imagine I have a bunch of C++ related classes (all extending the same base class and providing the same constructor) that I declared in a common header file (which I include), and their implementations in some other files (which I compile and link statically as part of the build of my program).
I would like to be able to instantia...
First thing i want to say that it's not an easy question to explain, so please be patient if it seems confusing.
I have a set of classes like this
class Product {
public static $static_type = 'product';
public static $static_table = 'product_table';
public function __construct($params) { //do some }
}
and then there are t...
Hi all! I have a situaion in which I want to declare a class member function returning a type that depends on the class itself. Let me give you an example:
class Substring {
private:
string the_substring_;
public:
// (...)
static SubstringTree getAllSubstring(string main_string, int min_size);
};
And Su...
Hello. I have three files: one called sql.php witch has a class db that I use to ease the get results operation from MySQL; one called session.class.php that has class session (extending class db) witch I use to make my basic operations as functions... like check_login function witch I use to check if user is logged in; and another one c...
I recently had an idea to create my own String class to make using PHP's functions easier. Instead of strlen($str) I write $str->length(). Makes it easier to remember parameter orders in certain functions, like substr.
I ran some timing scripts on it and found that it's about 5 times slower than using the regular functions. I haven't te...
In Flash Actionscript 3, when you need to load text, you use a class called 'URLLoader', and when you need to load an image (or .swf) you use a class called 'Loader.' As far as I know, loading a .bmp with URLLoader is as useless as loading an .xml into a Loader - it doesn't compute.
I'm making a class that handles a queue of external as...
Hi there,
I want to rewrite several methods of HighLine to customise my console and at the moment my code looks like this:
cmd = ask("#{@prompt_label} #{@prompt_separator} ", @tab_completion_candidates) do |q|
q.readline = true
# rewriting the Question class to make it do what we want
class ...
Hi there
2 months ago I was writing a web-application which use some classes to draw some charts. I've modified little those classes in order to fit with my needs. Now I wish to use a new(and official) version of that class, but also to have my modifications available.
The problem is that I don't remember exactly all the modification ...
I have a class named Car with property Name. Now every time I like to change Name of my Car I must write Car1.Name = "Porka Turbo". Now what I would like to acomplish is 5 characters less to write like this:
Car1 = "Porka Turbo"
It should work like this: if I assign a class derrived from Car class it should make regular class assignme...
I have several different lists I want to call. They all have the same format for the class:
id, value, description, order. Instead of creating a bunch a classes to return the all of the many lists, I wanted to use generics and just TELL it what kind of list to return. However, I can not figure out how to populate the classes.
Here are 2...
This is a question about tidyness. The project is already working, I'm satisfied with the design but I have a couple of loose ends that I'd like to tie up.
My project has a plugin architecture. The main body of the program dispatches work to the plugins that each reside in their own AppDomain.
The plugins are described with an interfa...