header

What is the preferred way to redirect a request in Pylons without losing form data?

I'm trying to redirect/forward a Pylons request. The problem with using redirect_to is that form data gets dropped. I need to keep the POST form data intact as well as all request headers. Is there a simple way to do this? ...

Precedence: header in email

My web application sends email fairly often, and it sends 3 kinds of emails: initiated by user, in response to an event in the system, and in automatic response to an email received by the application. I would like to make sure that the third type of email does not get stuck in an endless loop of auto-responders talking to each other. ...

What do I need for a compliant email header

I am trying to send an email from a site I am building, but it ends up in the yahoo spam folder. It is the email that sends credentials. What can I do to legitimize it? $header = "From: site <[email protected]>\r\n"; $header .= "To: $name <$email>\r\n"; $header .= "Subject: $subject\r\n"; $header .= "Reply-To: site <[email protected]>" . "\r\...

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...

static variables in an inlined function

I have a function that is declared and defined in a header file. This is a problem all by itself. When that function is not inlined, every translation unit that uses that header gets a copy of the function, and when they are linked together there are duplicated. I "fixed" that by making the function inline, but I'm afraid that this is a ...

last-modified header and linux file system

hi guys, im using httpclient and last-modified header in order to retrieve the last updated date of an html file however when i try this on a linux box it returns yesterdays date but when i use a windows machine it returns todays date. is anyone aware of issues using this header field in linux? ...

How to declare a structure in a header that is to be used by multiple files in c?

If I have a source.c file and it uses a structure like struct a { int i; struct b { int j; } }; if this structure is to be used by some other file func.c how to do it? shall we open a new header file and declare the structure there and include that header in the func.c? or can we define the total structure in ...

c# WebRequest class and headers

Hi, When I try to set the header properties on a WebRequest object, I get the following exception This header must be modified using the appropriate property I've tried modifying the .Headers propery and adding them that way like so webRequest.Headers.Add(HttpRequestHeader.Referer, "http://stackoverflow.com"); But still getting exce...

c++ adding method to class defined in header file

I'm wondering if it is possible to add methods in main program to an existing class defined in header file. For example: There is class CFun defined in file CFun.hpp, but in our party.cpp we want to add a method void hello() {cout << "hello" << endl;};without editing CFun.hpp Obviously (unfortunately) construction: #include "CFun.hpp" ...

What to put at the top of source files in large projects?

It is necessary to put copyright information and some other stuff on top of every source file in large enterprise projects. What is your preferred template, what should be included/excluded? I am more or less thinking of this: /** * This file is part of blabla. * Created: * Changes: * * * * $Id$ * Copyright (C) YEARS BlaB Com...

Header files in dev-C++

I'm trying to add an header file to dev-C++ but when I compile it it doesn't work. Here are my exact steps (for my example, I'm trying to get mysql.h to work): copy "mysql.h" into c:\dev-c++\includes check that in dev-C++ tools > compiler options > directories > c includes and c++ includes have the path to "c:\dev-c++\includes" include...

Dynamic Header , xslt

I have a webpage with a dynamic list. I want the headers to be configurable. To start with the headers are named as "column1,column2....columnn" . On clicking on any of these header i open up a DHTML modal window where I select the header name from a predefined list so that I can assign this header name to the selected column. So I am re...

How to export / dump a MySql table into a text file including the field names (aka headers or column names)

In MySql's interpreter, it's very easy to dump a table to the screen along with its field names. There seems to be no simple way to export a table to a tab-delimted or CSV outfile including its column headers. I'm trying to do this using only SQL or the Linux command line, without writing a program in another language. Thank you ...

Inclusion cycles in C header files

How does one prevent an inclusion cycle in C? ie. You shouldn't have a.h #include "b.h", which #include's "c.h" which #include's "a.h". I'm looking for a way of preventing this from happening using some sort of C directive. I had originally thought this would've prevented this from happening: Contents of a.h: #ifndef __A_H #define __A...

How to structure #includes in C

Say I have a C program which is broken to a set of *.c and *.h files. If code from one file uses functions from another file, where should I include the header file? Inside the *.c file that used the function, or inside the header of that file? E.g. file foo.c includes foo.h, which contains all declarations for foo.c; same for bar.c and...

Professional #include contents

I need to create an API that will allow my customer's developers to use a proprietary C module that will be released as a library (think .lib or .so -- not source). I'd like to make the header as developer-friendly as possible (so I won't need to be), following best practices and providing comments with descriptions, examples, caveats, ...

C++ Header Files, Code Separation

Hi, I am new to C++ and I had a few general questions about code separation. I have currently built a small application, all in one file. What I want to do now is covert this into separate files such that they contain similar code or whatnot. My real question right now is, how do I know how to separate things? What is the invisible m...

Why does UDP have a length field in the header and TCP does not?

Why does UDP have a length field in the header and TCP does not? I am guessing that the length of the segment in TCP is inferred from the IP header but one should be able to do the same for a UDP datagram ...

How do you declare arrays in a c++ header?

This is related to some other questions, such as: this, and some of my other questions. In this question, and others, we see we can declare and initialise string arrays in one nice step, for example: const char* const list[] = {"zip", "zam", "bam"}; //from other question This can be done in the implementation of a function with no bo...

How can I have a Makefile automatically rebuild source files that include a modified header file? (In C/C++)

I have the following makefile that I use to build a program (a kernel, actually) that I'm working on. Its from scratch and I'm learning about the process, so its not perfect, but I think its powerful enough at this point for my level of experience writing makefiles. AS = nasm CC = gcc LD = ld TARGET = core BUILD = build SOURCES...