include

what is the difference between #include <filename> and #include "filename"

In the C and C++ programming languages, what is the difference between using angle brackets and using quotes in an include statement. #include <filename> #include "filename" ...

How to handle including needed classes in PHP

I'm wondering what the best practice is for handling the problem with having to "include" so many files in my PHP scripts in order to ensure that all the classes I need to use are accessible to my script. Currently, I'm just using includeonce to include the classes I access directly. Each of those would includeonce the classes that the...

Setting PHP Include Path on a per site basis?

I can set the php include path in the php.ini: include_path = /path/to/site/includes/ But then other websites are effected so that is no good. I can set the php include in the start of every file: $path = '/path/to/site/includes/'; set_include_path(get_include_path() . PATH_SEPARATOR . $path); But that seems like bad practice and ...

Find Missing Javascript Includes in Website

Say I have several JavaScript includes in a page: <script type="text/javascript" src="/js/script0.js"></script> <script type="text/javascript" src="/js/script1.js"></script> <script type="text/javascript" src="/js/script2.js"></script> <script type="text/javascript" src="/js/script3.js"></script> <script type="text/javascript" src="/js/...

How should I detect unnecessary #include files in a large C++ project?

I am working on a large C++ project in Visual Studio 2008, and there are a lot of files with unnecessary #include's. Sometimes the #include's are just artifacts and everything will compile fine with them removed, and in other cases classes could be forward declared and the #include could be moved to the .cpp file. Are there any good to...

How to create a fast PHP library ?

For our online game, we have written tons of PHP classes and functions grouped by theme in files and then folders. In the end, we have now all our backend code (logic & DB access layers) in a set of files that we call libs and we include our libs in our GUI (web pages, presentation layer) using *include_once('pathtolib/file.inc')*. The ...

wxwidgets setup.h "no such file"

A quick Google search of this issue shows it's common, I just can't for the life of me figure out the solution in my case. I have a straight forward install of wxWidgets 2.8.8 for Windows straight from the wxWidgets website. Whenever I try to compile anything (such as the sample app described in "First Programs for wxWidgets" - http://...

Can the C preprocessor be used to tell if a file exists?

I have a very large codebase (read: thousands of modules) that has code shared across numerous projects that all run on different operating systems with different c++ compilers. Needless to say, maintaining the build process can be quite a chore. There are several places in the codebase where it would clean up the code substantially if...

PHP - How do I include a file over 2 directories back?

How do you include a file that is more than 2 directories back. I know you can use ../index.php to include a file that is 2 directories back, but how do you do it for 3 directories back? Does this make sense? I tried .../index.php but it isn't working. I have a file in /game/forum/files/index.php and it uses PHP include to include a fil...

What's quicker; including another file or querying a MySQL database in PHP?

In PHP, which is quicker; using include('somefile.php') or querying a MySQL database with a simple SELECT query to get the same information? For example, say you had a JavaScript autocomplete search field which needed 3,000 terms to match against. Is it quicker to read those terms in from another file using include or to read them from ...

C++ include and import difference

What is the difference between include and import in C++? ...

How can I include a servlet in a jsp page?

is it possible to include a servlet in a jsp page? if so how? ...

Best Practice: include( or <script src="

I have minified my javascript and my css. Now, Which is better? <script type="text/javascript"> <? $r = file_get_contents('min.js'); if($r) echo $r; ?> </script> OR <script type="text/javascript" src="min.js"></script> Same question for CSS. If the answer is 'sometimes because browsers fetch files simultaneously?' Which brow...

Your preferred C/C++ header policy for big projects?

When working on a big C/C++ project, do you have some specific rules regarding the #include within source or header files? For instance, we can imagine to follow one of these two excessive rules: #include are forbidden in .h files; it is up to each .c file to include all the headers it needs Each .h file should include all its dependa...

How do I include a header into my site that is hosted externally?

We are hosting a site for a client and they want us to include the header they have on their server into the pages we are hosting. So whenever they change it, it will automatically change on our site. We are attempting to use the "include" tag in our JSP code. The code we are using is as follows: <%@ include file="www.CLIENT.com/CLIE...

Use javascript to inject script references as needed?

I have a JS function that may occasionally get used on some pages. It is dependent on another JS file (swfObject.js), but I'd like to avoid having to include this file all over the place, as thats a wasted request most of the time. Instead, I'd like to create a generic function that can inject a script reference into the page DOM as nee...

Include directory in VS 2003

Where is the setting in Visual Studio 2003 to set the include path for individual projects? I know about the VC Directories option in Tools>Options but that is machine specific and won't help when I hand this off to other developers. ...

Automatically discovering C dependencies

I'm required to write documentation for my current project that lists all .c files and for each one lists every .h file which is directly or indirectly included by that file. This is a large project, and although we have Makefiles which theoretically have this information, those Makefiles are sometimes incorrect (we inherited this proje...

fatal error C1083: Cannot open include file: 'Windows.h': and scons

Hi, today is officially my first day with C++ :P I've downloaded Visual C++ 2005 express edition and Microsoft Platform SDK for Windows Server 2003 SP1 because I want to put my hands on open source Enso ( http : // code.google.com/p/enso ) . So, after installing scons I went to the console and try to compile it using scons but I go...

Grabbing Domain Name With Include In PHP

I know how to find out the current domain name in PHP already, the problem is when I put this code into a file and then include it from another server it shows the domain name of where the file is located. Is there any way for it to find out the domain or the site containing the include() code? ...