reference

c++ returning const reference of local variable

Hi! is it possible/ok to return a const reference even if the value the function returns is a local variable of this function? i know that locals are not valid anymore once the function returns - but what if the function is inlined and the returned value is only used within the callers scope? then the locals of the function should be in...

Is there any way to add references without recompiling in .NET?

I am using a IoC Container (Castle Windsor) to instantiate classes accordingly to the configuration file. If I want to add classes from a new dll that didn't exist when I compiled the project, there is any way to do that without recompiling? Edit: As this project is a Service Host for WCF service, and the classes that I want to include ...

Reference DLLs in ASP.NET without \Bin or GAC

I have an ASP.NET project under source control (Subversion). For various reasons, I don't want to add the \Bin directory or its contents to source control, so I have it svn:ignored. DLLs are loaded into here during a Visual Studio build, and I can start with a clean directory and/or delete all the contents of this directory and still hav...

iPhone - Problem with MKMapView instance

Hi, I've got a problem with a MKMapView, which is placed as a full-sized view in a UITabBarController at first position. Before the view will be shown, I add several annotations to the mapView. Everything just works fine. When I change the tab (so that the mapView is out of view) and switch back to the tab with the mapView, all annotat...

PHP Unset via References

I have been reading the PHP manual about references and something is confusing me. It says that references are not pointers to memory addresses but rather... Instead, they are symbol table aliases. Isn't this essentially a pointer if the reference points to the symbol table entry which then points to a memory address? Edit: So...

Recommended resources for learning database development with Cocoa?

I am currently learning Cocoa. However I am coming from a traditional Sybase/Oracle background using Powerbuilder. Having been spoiled by the 'power' of a datawindow for may years, I not sure that coredata or sqllite will satisfy my needs and ideas. Basically I'm looking for some good reference sites, books, or just plain old advice on...

Python equivalent of pointers

in python everything works by reference: >>> a = 1 >>> d = {'a':a} >>> d['a'] 1 >>> a = 2 >>> d['a'] 1 i want something like this >>> a = 1 >>> d = {'a':magical pointer to a} >>> d['a'] 1 >>> a = 2 >>> d['a'] 2 what would you substitute for 'magical pointer to a' so that python would output what i want i would appreciate general s...

How do I return a list as an array reference in Perl?

Hey. In Python I can do this: def fnuh(): a = "foo" b = "bar" return a,b Can I return a list in a similarly elegant way in perl, especially when the return type of the subroutine should be a reference to an array? I know I can do sub fnuh { my $a = "foo"; my $b = "bar"; my $return = []; push (@{$return}, ...

Python Function Reference

There're tons of apps/widgets for PHP function reference and even for Ruby but I'm shocked to find there is nothing available for a popular language like Python (besides the official online documentation ofcourse). Is there really not a single handy reference widget/app available for Python? I have 'Pocket Reference' book, but a dashbo...

How to use Global Hook

Hi! I tried using global hook, and when I typed in using gma.System.Windows; it did not recognize gma? What do I need to do? ...

Development terms and definitions reference

Are there any good references for terms and expressions within development? I'm talking a site that defines patterns, terms, prefixes, suffixes and so on. Definitions examples can be something like this: Factory Builder Parser Collection / List / Dictionary / Set Provider Expression Something to refer to when you get into an argumen...

'out' issue in VB.NET

When in C# we have the out and ref parameter options, in VB there is a only one: ByRef. Now, little 'problem' when trying to 'eliminate' the compiler warning saying that test was not initialized before passing as argument: Dim test As MyParsableClass ' = Nothing need imperatively?? ' ' some code ... ' MyParsableClass.TryParse("value",...

Literal initialization for const references

How does the following code work in C++? Is it logical? const int &ref = 9; const int &another_ref = ref + 6; Why does C++ allow literal initialization for const references when the same is not permitted for non-const references? E.g.: const int days_of_week = 7; int &dof = days_of_week; //error: non const reference to a const objec...

How can I pass the elements in a Perl array reference as separate arguments to a subroutine?

I have a list that contains arguments I want to pass to a function. How do I call that function? For example, imagine I had this function: sub foo { my ($arg0, $arg1, $arg2) = @_; print "$arg0 $arg1 $arg2\n"; } And let's say I have: my $args = [ "la", "di", "da" ]; How do I call foo without writing foo($$args[0], $$args[1], $$...

tomcat; reference one war as a library in another war

I have a few tomcat applications, deployed in tomcat using .war files. Even though these wars are separate from each other, they are all part of a larger concept / application, and quite often, one war needs to call code from another war. Let's say I have 2 .wars, "a.war" and "b.war"... I would like to be able to use some classes found...

reference to the pointed object

Dereferencing pointers can make the code very hard to read. What I usually do is putting a reference to the pointed object and working with the reference. Example: shared_ptr<std::vector<int> > sp = get_sp_to_vector(); std::vector<int>& vec = *sp; ... vec.push_back(5); I wonder if it's a good practice. Does it have any drawback? Upda...

Problem getting variables from Class and passing a reference of that Class

Hi everyone, once again I'm getting plagued by the dreaded Flash error: Cannot access a property or method. I'm building a new video player and I need to send the total width of my progress bar(created in PlayerControls.as) to my VideoPlayer.as class. As well as control the width of the progress bar from an update function inside my Vid...

How does object reference and cloning works in java

Below is the code ArrayList arList = someMethod();// returning ArrayList with customDO objects Now somewhere in different class I am getting data from this arList CustomDo custDO= (CustomDO)arList.get(0); Will the arList be alive as long as custDO is alive ? If yes, will below piece of code help CustomDO custDO = ((CustomDO)arList...

Access field in a many-to-many intermediate table with DQL in Doctrine

i have a model called ContentGroup and another called Content with a many-to-many relation between them. The intermediate table has a field called Position, When i try to write a DQL query to obtain all the contents associated with a ContentGroup i cannot reference the position field usign the aliases of the models or relations involved...

Returning reference to a pointer- C++

Consider the following class. class mapping_items { public: mapping_items(){} void add(const mapping_item* item) { items_.push_back( item ); } size_t count() const{ return items_.size(); } const mapping_item& find(const std::string& pattern){ const mapping_item* item = // iterate vecto...