include

"#include" a text file in a C program as a char[]

Is there a way to include an entire text file as a string in a C program at compile-time? something like: file.txt: This is a little text file main.c: #include <stdio.h> int main(void) { #blackmagicinclude("file.txt", content) /* equiv: char[] content = "This is\na little\ntext file"; */ printf("%s", content); } o...

How can I find duplicate headers in a large solution in MSVC++ 2005 or 2008?

In Visual Studio (C++), is there a way to easily find duplicate headers that are defined in .cpp files? I'm also trying to find ways to detect this situation: A includes B includes C A includes C => A doesn't need to include C ...

How to have an Ant INCLUDE fileset take priority over an EXCLUDE

If I have a fileset like this: <fileset dir="."> <exclude name="classes/*"/> <include name="**/zar.class"/> </fileset> The exclude takes precedence over the include and I don't end up with any classes. [since for this hypothetical example, zar.class is in the classes dir] I would like to include the zar file, even though it is in...

What is the difference between #import and #include in Objective-C?

What are the differences between #import and #include in Objective-C and are there times where you should use one over the other? Is one deprecated? I was reading the following tutorial: http://www.otierney.net/objective-c.html#preamble and its paragraph about #import and #include seems to contradict itself or at least is unclear. ...

When can you omit the file extension in an #include directive?

I'm playing around with gmock and noticed it contains this line: #include <tuple> I would have expected tuple.h. When is it okay to exclude the extension, and does it give the directive a different meaning? ...

Howto get filename from which class was included in PHP

I understand that the question is rather hard to understand, I didn't know how to ask it better, so I'll use this code example to make things more clear: If I have the following files: test.php: <?php include('include.php'); echo myClass::myStaticFunction(); ?> include.php <?php __autoload($classname){ include_once("class/".$cl...

Including .asp file into html file.

How can include .asp file inside of html file and have it proccessed besides having to process all html files with asp. ...

How can I dynamically update a variable in plain html files in on windows web server.

We have some old html files on the website that have copyright year on the bottom of the page (from include file). We are trying to find a way to update that dynamically to current year so the include file does not need to be edited every year. We are using asp and .net on the same server so there might be ways to use those technologies...

Disadvantages of a <std.h> file that brings in all std headers?

I find long sequences of standard includes annoying: #include <vector> #include <string> #include <sstream> #include <iostream> Considering these header files change only very rarely, is there a reason why I should not make a "std.h" file #including all std headers and just use that everywhere? ...

AppEngine and Django: including a template file

As the title suggests, I'm using Google App Engine and Django. I have quite a bit of identical code across my templates and would like to reduce this by including template files. So, in my main application directory I have the python handler file, the main template, and the template I want to include in my main template. I would have t...

QueryObject Include Entity Framework

Hi, I have three tables: Scenarios, Components and Blocks. Blocks has a foreign key to ComponentId and Components has a foreign key to Scenarios. Blocks also has a foreign key (TreeStructureId) to another table TreeStructures. Now, why does this work: ObjectQuery<Blocks> blocks = edumatic3Entities.Blocks.Include("TreeStructures").Inc...

can I include dll in exe (in visual studio) ?

To run my App I need AxInterop.WMPLib.dll and Interop.WMPLib.dll that are located in Debug and Release folder is there any way to include those dlls into exe? so my app is available in one file only. ...

is it possible to issue dynamic include in asp-classic?

I mean, like php'h include... something like my_file_to_be_included = "include_me.asp" -- > for what I've seen so far, there are a couple of alternatives, but every one of them has some sort of shortcoming... what I'm trying to figure out is how to make a flexible template system... without having to statically include the whole t...

Include indirection on Visual C++

Let's say we have an application that will need Boost to compile. Boost being an external library, updated regularly, and our application having multiple binaries and multiple versions ("multiple" as in "Let them grow and multiply"... don't ask...), we need an easy to update/maintain indirection to have for each app's version link with t...

Describing header file locations in makefile

In a new project I am working on I have the following dir structure: Project_base |---- src |---- bin |---- h | Makefile And in my source files I have includes that look like so: #include "../h/SomeHeaderFile.h" instead of the more correct form: #include "SomeHeaderFile.h" What do I need to add to my makefile so that I can remov...

Include file_exists safety

/* define page path */ define("PAGE_DIR", "pages/"); if (file_exists(PAGE_DIR."$_GET[page].php")) include(PAGE_DIR."$_GET[page].php"); How safe is this? Could you for example include a page on another webserver if the page is in a folder called pages? Thanks ...

Python includes, module scope issue

Hi everyone, I'm working on my first significant Python project and I'm having trouble with scope issues and executing code in included files. Previously my experience is with PHP. What I would like to do is have one single file that sets up a number of configuration variables, which would then be used throughout the code. Also, I wan...

Dynamic Include

What would be the safest way to include pages with $_GET without puttingt allowed pages in an array/use switch etc. I have many pages so no thank you. $content = addslashes($_GET['content']); if (file_exists(PAGE_PATH."$content.html")) { include(PAGE_PATH."$content.html"); } How safe is that? Thanks. ...

Using something like user control to put in the <head> of aspx pages.

Basically I just want something like an include control that I can put into the head and also something that could be nested(optional). I want to put the links to the css and js files in there so I have them all in one place. NO MASTERPAGES - I am trying to(read have to) avoid them for this project. User controls work fine for this but ...

Is there a good way to call a CGI script from a PHP script?

I saw that there is a virtual() function in PHP that will call a CGI script, but is that the best way? Can I pass any parameters to that scripts as well? I saw some examples using file_get_contents() or include() and passing in the URL of a CGI script, but that feels like a hack. ...