Questions tagged [header]

This tag is deprecated because it lacks discriminating power. Please use a more specific tag instead, e.g.: html-heading, email-header etc.

This tag is deprecated because it lacks discriminating power. Please use a more specific tag instead, e.g.: , etc.

12624 questions
1078
votes
25 answers

In Node.js, how do I "include" functions from my other files?

Let's say I have a file called app.js. Pretty simple: var express = require('express'); var app = express.createServer(); app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); app.get('/', function(req, res){ res.render('index',…
TIMEX
  • 217,272
  • 324
  • 727
  • 1,038
980
votes
19 answers

Returning JSON from a PHP Script

I want to return JSON from a PHP script. Do I just echo the result? Do I have to set the Content-Type header?
Scott Nicol
  • 10,038
  • 3
  • 13
  • 8
831
votes
11 answers

How to fix "Headers already sent" error in PHP

When running my script, I am getting several errors like this: Warning: Cannot modify header information - headers already sent by (output started at /some/file.php:12) in /some/file.php on line 23 The lines mentioned in the error messages contain…
Moses89
  • 4,367
  • 3
  • 13
  • 6
630
votes
20 answers

*.h or *.hpp for your class definitions

I've always used a *.h file for my class definitions, but after reading some boost library code, I realised they all use *.hpp. I've always had an aversion to that file extension, I think mainly because I'm not used to it. What are the advantages…
Mark Ingram
  • 65,792
  • 48
  • 164
  • 225
572
votes
16 answers

HTML5 best practices; section/header/aside/article elements

There is enough information about HTML5 on the web (and also on stackoverflow), but now I'm curious about the "best practices". Tags like section/headers/article are new, and everyone has different opinions about when/where you should use these…
Bas van Dorst
  • 6,262
  • 3
  • 15
  • 12
572
votes
20 answers

How to use HTML to print header and footer on every printed page of a document?

Is it possible to print HTML pages with custom headers and footers on each printed page? I'd like to add the word "UNCLASSIFIED" in Red, Arial, size 16pt to the top and bottom of every printed page, regardless of the content. To clarify, if the…
ben
551
votes
4 answers

What is the common header format of Python files?

I came across the following header format for Python source files in a document about Python coding guidelines: #!/usr/bin/env python """Foobar.py: Description of what foobar does.""" __author__ = "Barack Obama" __copyright__ = "Copyright…
Ashwin Nanjappa
  • 68,458
  • 72
  • 198
  • 283
397
votes
20 answers

Concatenate multiple files but include filename as section headers

I would like to concatenate a number of text files into one large file in terminal. I know I can do this using the cat command. However, I would like the filename of each file to precede the "data dump" for that file. Anyone know how to do…
Nick
  • 4,541
  • 4
  • 16
  • 7
293
votes
17 answers

Parsing CSV files in C#, with header

Is there a default/official/recommended way to parse CSV files in C#? I don't want to roll my own parser. Also, I've seen instances of people using ODBC/OLE DB to read CSV via the Text driver, and a lot of people discourage this due to its…
David Pfeffer
  • 36,331
  • 28
  • 120
  • 198
259
votes
11 answers

HTTP headers in Websockets client API

Looks like it's easy to add custom HTTP headers to your websocket client with any HTTP header client which supports this, but I can't find how to do it with the JSON API. Yet, it seems that there should be support these headers in the spec. Anyone…
Julien Genestoux
  • 26,486
  • 19
  • 63
  • 91
245
votes
16 answers

Request header field Access-Control-Allow-Headers is not allowed by Access-Control-Allow-Headers

I'm trying to send files to my server with a post request, but when it sends it causes the error: Request header field Content-Type is not allowed by Access-Control-Allow-Headers. So I googled the error and added the…
user3194367
  • 2,657
  • 3
  • 11
  • 10
202
votes
4 answers

How to add header row to a pandas DataFrame

I am reading a csv file into pandas. This csv file constists of four columns and some rows, but does not have a header row, which I want to add. I have been trying the following: Cov = pd.read_csv("path/to/file.txt",…
sequence_hard
  • 3,763
  • 9
  • 24
  • 46
196
votes
9 answers

Where does gcc look for C and C++ header files?

On a Unix system, where does gcc look for header files? I spent a little time this morning looking for some system header files, so I thought this would be good information to have here.
Bill the Lizard
  • 369,957
  • 201
  • 546
  • 842
195
votes
11 answers

Using G++ to compile multiple .cpp and .h files

I've just inherited some C++ code that was written poorly with one cpp file which contained the main and a bunch of other functions. There are also .h files that contain classes and their function definitions. Until now the program was compiled…
Meir
  • 10,735
  • 19
  • 56
  • 70
191
votes
9 answers

Should Jquery code go in header or footer?

Where is the best place to put Jquery code (or separate Jquery file)? Will pages load faster if I put it in the footer?
Simone
  • 1,921
  • 2
  • 12
  • 4
1
2 3
99 100