header

C++ : Code reuse, classes and libraries

Hello. Although I consider myself an experienced programmer (lead programmer of 2 commercially released games), I feel lost now that I have started using C++ for my next project. Right now I want to create a class to read/encrypt/decrypt JSON-like text-based data files (a custom format I have designed for my needs). Let's say it's calle...

mail() header problem for html email

I am trying to write a error reporting feature for a website in php. I cannot get the headers right so that the email will display as html. Here is the code: if( isset($_POST['submit']) ) { $browser = $_SERVER['HTTP_USER_AGENT']; $page = $_POST['page']; $email = $_POST['email']; $error = $_POST['error']; $mess...

firefox cannot load HTML and tells to save "untyped binary data"

In our website,a media file is being played in the HTML when it loads with the help of flash. We encounter a problem in firefox when autoplay is enabled. It seems that when the HTML loads some binary data from streaming corrupts the HTML header and hence is not able to detect the MIME-TYPE and so asks to save UNTYPED-BINARY data. How d...

Why does the order of my #includes matter? (C++)

I've created a header file called "list_dec.h", put it in a folder "C:\Headers", and set my compiler to include files from "C:\Headers", so now I can do things like #include<list_dec.h> int main(){return(0);} but when I try to do something like #include<iostream> #include<list_dec.h> int main(){return(0);} I get an error (not anyth...

Is there any situation in which it would be useful or necessary to "double link" header files? (C++)

I use the term "double link" because I don't know what the actual phrase is, or if there is one, but assuming you have two headers, head1.h and head2.h, with these contents: In head1.h: #include"head2.h" //do stuff In head2.h: #include"head1.h" //do stuff I visualise it as two mirrors placed opposite each other, as it's not really...

Can I do my own HTTP header attribute?

Hi, can I make my own headers in HTTP request? e.g. This is normal HTTP request GET / HTTP/1.1 Host: google.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT x.x; xx; rv:x.x.x.x) xxx Firefox/3.0.10 (.NET CLR 3.5.30729) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: xx,en-us;q=0.7,en;q...

problems using the -ansi switch in MinGW 3.4.5

I was reading about the flags used in gcc, and read a reccommendation to use gcc -ansi -pedantic -Wall file1 [file2 [file3...]] -o output. For the quality of my code's sake, to keep it standard, and get all the warnings about it. Well, about compiling with -ansi... If I include <stdlib.h>, gcc gives me this error: In file included from...

What is the difference between a .cpp file and a .h file?

Because I've made .cpp files then transfered them into .h files, the only difference I can find is that you can't #include .cpp files. Is there any difference that I am missing? ...

C++: When is it acceptable to have code in the header file?

I've been taught to keep class definitions and code separate. However, I've seen situations where people would often include some bits of code in the header, e.g. simple access methods which returns a reference of a variable. Where do you draw the line? ...

Where are the headers for libbz2.dylib for the iPhone?

The headers for libbz2.dylib on the iPhone are missing, or contained in a less than obvious location. I've looked for bzlib.h, bz2lib.h, bz2.h, etc., grepped for patterns, and found nothing - are they included with the SDK, or do I need to just pull the header from the main libbz2 distro and use that instead? ...

Creating a JSON Header on ASP.NET

I am converting a script from PHP to ASP.net C#. In PHP, i could use something like: header('Content-type: text/json'); header('Content-type: application/json'); How can I tell my aspx page to declare in the header that it is printing a JSON file? ...

PHP Outputting File Attachments with Headers

After reading a few posts here I formulated this function which is sort of a mishmash of a bunch of others: function outputFile( $filePath, $fileName, $mimeType = '' ) { // Setup $mimeTypes = array( 'pdf' => 'application/pdf', 'txt' => 'text/plain', 'html' => 'text/html', 'exe' => 'application/oct...

When to use Header files that do not declare a class but have function definitions

I am fairly new to C++ and I have seen a bunch of code that has method definitions in the header files and they do not declare the header file as a class. Can someone explain to me why and when you would do something like this. Is this a bad practice? Thanks in advance! ...

How do I create a SysHeader32 control in C#?

I am in the process of creating a custom control in C# for business process. As a part of it, I need to create what looks like a header on a list view. I've done this in the past using Visual c++ (6.0 :blush:). I have not found a way to do it in C# (2.0). Does anyone have any suggestions or links? Thanks ...

How do I configure apache - that has not got mod_expires or mod_headers - to send expiry headers?

The webserver hosting my website is not returning last-modified or expiry headers. I would like to rectify this to ensure my web content is cacheable. I don't have access to the apache config files because the site is hosted on a shared environment that I have no control over. I can however make configurations via an .htaccess file....

Why does TCP header contain both ACK and SEQ fields?

Since TCP header is a relatively large overhead, why don't we compress it in the way that ACK and SEQ share the same field, and they can still be distinguished by flags in the header? ...

preserve include path in xcode

I separated my header files in folders like: libraryA |-libA1.h |-libA2.h libraryB |-libB1.h |-libB2.h Xcode however removes the path by default, so #include "libraryA/libA1.h" #include "libraryB/libB1.h" doesn't work, only: #include "libA1.h" #include "libB1.h" How can I make xcode preserve the path names for includes?...

Why are the html tags showing up in my string in PHP?

I'm using a mail function which is sending back a message that is contained within the variable $body. I want to send the message to myself with certain words in bold and a number of break tags. Here is my code(HEREDOC SYNTAX): $body = <<<CTS <h1><b>Order for $name on datevariable</b></h1><br /><br /> <b><u>Administrative Details</u>...

php script can't send headers because headers have already been sent, but are characters outside the script

This are my first two lines: <?php header('Content-Type: application/x-javascript'); And it gives me the headers already sent in line 1. It is intended to generate a JavaScript file that loads from an HTML page, when checked the JavaScript file from Firebug i got the following file: 1 <br /> 2 <b>Warning</b>: Cannot modify head...

Overwrite the header output of an ASP.NET gridview control

Is there an efficient way to overwrite the HTML output of a header and footer of an ASP.NET GridView control? I would like to implement a methodology that is similar to the HeaderTemplate tag in an ASP.NET Repeater or does not require to include dynamically building the HTML output in the page code behind. If these two types of option...