In MSVC++ #include files are searched for differently depending on whether the file is enclosed in "" or <. The quoted form searches first in the local folder, then in /I specified locations, The angle bracket form avoids the local folder.
This means, in MSVC++, its possible to have header files with the same name as runtime and SDK headers.
So, for example, I need to wrap up the windows sdk windows.h file to undefine some macro's that cause trouble. With MSVS I can just add a (optional) windows.h file to my project as long as I include it using the quoted form :-
// some .cpp file
#include "windows.h" // will include my local windows.h file
And in my windows.h, I can pull in the real one using the angle bracket form:
// my windows.h
#include <windows.h> // will load the real one
#undef ConflictingSymbol
Trying this trick with GCC in XCode didn't work. angle bracket #includes in system header files in fact are finding my header files with similar names in my local folder structure.
The MSVC system means its quite safe to have a "String.h" header file in my own folder structre. On XCode this seems to be a major no no.
Is there some way to control this search path behaviour in XCode to be more like MSVC's? Or do I just have to avoid naming any of my headers anything that might possibly conflict with a system header. Writing cross platform code and using lots of frameworks means the possibility of incidental conflicts seems large.
In MVC Global.asax file, we can see the Application_Start where this event fires only for once. But the session is not yet active/available here. So my question is, is there any event in Global.asax file that fired only for once and session is available also?
The reason I ask this is because, I use ExpandoObject
e.g.:
public static dynamic Data
{
get
{
#region FAILSAFE
if (HttpContext.Current.Session[datakey] == null)
{
HttpContext.Current.Session[datakey] = new ExpandoObject();
}
#endregion
return (ExpandoObject)HttpContext.Current.Session[datakey];
}
}
I want to initialize all of my ExpandoObject at once with the value of null:
MyExpando.Data.UserInformation = null;
MyExpando.Data.FolderInformation = null;
That's why I'm looking for an event that only fired once.
I know that #pragma once is non-standard, however it is supported by most compilers. So on my Mac I can compile C++ code with headers that use #pragma once on the command line using clang++. The strange thing however is that it does not seem to work within Xcode. I get Invalid preprocessing directive when I try to use #pragma once.
I am using the newest version of OSX (10.8.2) and Xcode (Version 4.5.1 (4G1004)).
In OCaml 3.11, I want to "extend" an existing module using the include directive, like so:
module MyString = struct
include String
let trim s = ...
end
No problem. But now I want to expose this module's type explicitly (i.e. in a .mli file). I want something like this:
module MyString : sig
include String
val trim : string -> string
end
But the include syntax is not correct because String refers to a module, not a module type (and the compiler does indeed barf). How can I refer to the module type for String here (without having write it out explicitly in a sig expression)?
Thanks!
I have a sqljdbc_auth.dll file which I want to include in my war in order to enable Windows Authentication.
I tried the following code:
grails.war.copyToWebApp = { args ->
fileset(dir:"web-app") {
include(name: "jdbc/**")
}
}
Where jdbc is the folder which contains my sqljdbc_auth.dll file. However, it doesn't work. The war doesn't include the dll.
Please let me know if I am missing anything here.
Thanks.
I have a "links.tpl" file which contains lines with many variables such as below
{assign var=link_main value="index.php"}
{assign var=link_login value="?a=login"}
but when i include this file in home.tpl using {include file="file.tpl"}
the variables {$link_main}, {$link_login} are not included
i put the {assign var=link_main value="index.php"} in home.tpl and it works but not from included file
i have tried adding scope=global to variable and parent to include but nothing happened
I tried the last few hours finding a solution, any help is appreciated
Hi,
How do you pass a parameter into an include file? I tried the following but it doesn't work.
include "myfile.php?var=123";
and in myfile.php, I try to retrieve the parameter using $_GET["var"].
include "myfile.php?var=123"; will not work. PHP searches for a file with this exact name and does not parse the parameter
for that I also did this:
include "http://MyGreatSite.com/myfile.php?var=123";but it does not also work.
Any hints? Thanks.
I am working through an older php mysql book written in 2003. The author uses the include() function to construct html pages by including header.inc, footer.inc, main.inc files, etc. Now I find out that this is not allowed in the default ini settings, (allow_url_include is set to Off) after I got many warnings from the server.
I noticed also that you can use include without the parenthesis. I tried this and it works and I get no error messages or warnings. Are the two different? That is, is include() different from include ?
Hi,
I am completely new to PHP so forgive me if this question seems very rudimentry. And thank you in advance.
I need to include a jpg that is generated from a webcam on another page. However I need to include only the latest jpg file. Unfortunately the webcam creates a unique filename for each jpg. How can I use include or another function to only include the latest image file?
(Typically the filename is something like this 2011011011231101.jpg where it stands for year_month_date_timestamp).
I am following the best answer on Finding all files containing a text string in linux to search string in my project.
This is my command grep --include=*.rb -rnw . -e "pattern"
Zsh tells me that zsh: no matches found: --include=*.rb
It seems that grep doesn't support --include option.
When I type grep --help, it returns
usage: grep [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
no --include here.
Is my grep version too old? Or is there something wrong with my command?
We have a trac server on our network, and when I run the following:
svn co http://trac.theserver.com/browser/trunk/thefolder .
Then I put in my LDAP password, and I get this
svn: The OPTIONS response did not include the requested activity-collection-set; this often means that the URL is not WebDAV-enabled
What do I need to do to resolve this? The previous IT guy had all sorts of weird ways of setting up stuff on the network.
Edit: Rephrasing my question:
Upon further troubleshooting, I can conclude that:
Touch gestures (dragging, pinch to zoom, touch-and-hold right click) in Internet Explorer start to work when:
The system has been running for ~2 minutes. This coincides with the delayed start of services.
Explorer.exe is being run, then killed. I assume Explorer.exe starts some services?
The services with delayed start are as follows:
Security Center
Software Protection
Windows Defender, Search and Update
Windows Font Cache Service
Microsoft .NET Framework NGEN v4.0.30319_X64 and X86
I see no connection between these services and touch gestures, but just in case, I manually tried starting these services, but without luck.
What else happens delayed after system boot, which also happens when explorer is started?
Old question:
Details: Internet Explorer 9 and Windows 7 Professional, running on a HP TouchSmart (touch screen PC). It is going to be a kiosk PC (running a custom GUI for displaying websites).
Scenario 1:
When running Internet Explorer as a normal program in Windows 7, touch functions work perfectly. I can scroll the website by dragging it with my finger, I can pinch zoom and I can touch-and-hold right click.
I now change the default shell in Windows to Internet Explorer (ie. IE starts instead of explorer.exe). Internet Explorer of course starts up when logging in. However, touch functions are reduced to basic clicking (no dragging, no pinch zooming, no touch-and-hold right click).
Then I manually start explorer.exe, and the touch functions work again!
And here is the weird part: When I kill explorer.exe, the touch functions keeps working - even if I close IE and start a new instance.
Scenario 2:
The exact same, but instead of changing the default shell to Internet Explorer, I change it to my own program, which uses an embedded Internet Explorer ("WebBrowser"). Same thing happens.
What I've tried:
Autorun programs: When explorer.exe launches, it launches all the autorun programs. There are no relevant programs being run by explorer, but just in case, I have manually started all the autorun programs, so that it is identical (but without explorer.exe) to a normal login. It still does not work (until I launch explorer.exe).
Specifically TabTip.exe, TabTip32.exe and wisptis.exe are all running.
All services are also started.
To sum it up
Running explorer.exe once changes something in the touch capabilities of Internet Explorer. It doesn't matter if explorer.exe is running - as long as it has been run once.
Does anyone know what causes this behavior? Or how I can circumvent it neatly?
On Windows Server 2008, is there an easy way to modify security permissions for multiple files at once (as with Windows Server 2003)? Right-click menu - properties does not provide a "Security" tab if more than one file/directory is selected (i.e. ctrl-click multiple files).
Is there really a valid security reason for changing this in Windows Server 2008?
There are several questions here about disabling USB storage in general via GPO but I can find no information on whether it is possible to add exceptions for specific devices. Put another way, can USB drive types that include builtin encryption be enabled but generic USB drives disabled?
This needs to work on Windows XP.
I try command
rsync -v --include-from=/path/to/list.lst /home/user /path/to/backup
list.lst contains for example
.gnupg/
.pki/
.gnome2/keyrings/
.mozilla/firefox/*.default/bookmarkbackups/
.mozilla/firefox/*.default/bookmarks.html
.mozilla/firefox/.default/.db
.mozilla/firefox/.default/.sqlite
and i get error on all strings with * "failed: No such file or directory"
When i use --files-from for this, i get error too.
Can anybody help me use wildcards for this?
Can you burn a DVD film that will play on a standard DVD player but also include on the disk some pc readable files that would auto launch on a PC?
I want to create a dvd disk that essentailly has 2 purposes:
When a DVD is inserted into a standard DVD player it plays like a normal DVD film, i.e. you get the DVD menu and you can play the movie
When you insert the dvd into a pc it auto launches an exe file and behaves like a normal data disk.
I have an AD group as a database user. When I try to drop this group from the database users, using
DROP USER [this_is_the_ad_group]
the group will be dropped but all the individual users in this group will not. How to delete this group and all its users at once?
I can only undo once in Excel and I have taken the steps to change the number in the Edit Registry and that did not fix the problem. Help! Very Annoying!!!
I have some configuration in my vimrc. Some generic ones, and some other really specific.
I would like to share this config with some co workers, but a lot of them don't need these specific ones.
Instead of editing a bunch of different vimrc, I would like to know if it's possible to have an "include" directive - something like a file named ".vimrc_module" and called from vimrc. Is it possible?
I use the following commands to sync folders. Each command requires me to type in the password. How can I group these commands to only enter the password once? Thanks.
rsync -ave ssh /opt/lampp/htdocs/new/folder1/ [email protected]:/home/folder1/
rsync -ave ssh /opt/lampp/htdocs/new/folder2/ [email protected]:/home/folder2/
rsync -ave ssh /opt/lampp/htdocs/new/folder3/ [email protected]:/home/folder3/
Say the folder structure looks like this:
.
|--folder1
|--subfolder1
|--subfolder2
|--subfolder2
|--folder2
|--subfolder1
|--subfolder2
|--subfolder2
|--folder3
|--subfolder1
|--subfolder2
I would like to find all files in subfolder2 only. I know I can just do this:
$ find . -type f |grep subfolder2
But was wondering if find comes with a option to include/exclude given directories?
I've been trying to include a structure called "student" in a student.h file, but I'm not quite sure how to do it.
My student.h file code consists of entirely:
#include<string>
using namespace std;
struct Student;
while the student.cpp file consists of entirely:
#include<string>
using namespace std;
struct Student {
string lastName, firstName;
//long list of other strings... just strings though
};
Unfortunately, files that use #include "student.h" come up with numerous errors like error C2027: use of undefined type 'Student', error C2079: 'newStudent' uses undefined struct 'Student' (where newStudent is a function with a Student parameter), and error C2228: left of '.lastName' must have class/struct/union. It appears the compiler (VC++) does not recognize struct Student from "student.h" or something?
I have tried declaring the whole struct in "student.h", but it didn't help either. How can I declare struct Student in "student.h" so that I can just #include "student.h" and start using the struct? BTW, it seems there are no compiler errors in student.h...