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.

13526 questions
24 answers

Get a list from Pandas DataFrame column headers

I want to get a list of the column headers from a Pandas DataFrame. The DataFrame will come from user input, so I won't know how many columns there will be or what they will be called. For example, if I'm given a DataFrame like this: y gdp …
  • 24,239
  • 21
  • 46
  • 50
28 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',…
  • 259,804
  • 351
  • 777
  • 1,080
20 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
  • 11,458
  • 3
  • 15
  • 8
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…
  • 4,367
  • 3
  • 15
  • 6
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
  • 71,849
  • 51
  • 176
  • 230
23 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…
5 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 """ Description of what foobar does.""" __author__ = "Barack Obama" __copyright__ = "Copyright…
Ashwin Nanjappa
  • 76,204
  • 83
  • 211
  • 292
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,632
  • 3
  • 17
  • 12
21 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…
  • 5,411
  • 4
  • 19
  • 7
16 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 web platform's WebSocket API. Anyone has a clue on how to achieve it? var ws = new…
Julien Genestoux
  • 31,046
  • 20
  • 66
  • 93
19 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
  • 38,869
  • 30
  • 127
  • 202
7 answers

How to add header row to a pandas DataFrame

I am reading a csv file into pandas. This csv file consists 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", sep='\t') Frame =…
  • 5,115
  • 10
  • 30
  • 50
17 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…
  • 2,987
  • 3
  • 13
  • 10
24 answers

How to change site title, site header and index title in Django Admin?

How can I change the site title Django site admin, the site header Django administration and the index title Site administration in Django Admin?
  • 3,355
  • 3
  • 18
  • 17
13 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…
  • 12,285
  • 19
  • 58
  • 70
2 3
99 100