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
1331
votes
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 …
natsuki_2002
  • 24,239
  • 21
  • 46
  • 50
1212
votes
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',…
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080
1121
votes
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
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
  • 15
  • 6
748
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
  • 71,849
  • 51
  • 176
  • 230
663
votes
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…
ben
630
votes
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 """Foobar.py: Description of what foobar does.""" __author__ = "Barack Obama" __copyright__ = "Copyright…
Ashwin Nanjappa
  • 76,204
  • 83
  • 211
  • 292
607
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,632
  • 3
  • 17
  • 12
471
votes
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…
Nick
  • 5,411
  • 4
  • 19
  • 7
371
votes
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
340
votes
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
279
votes
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 =…
sequence_hard
  • 5,115
  • 10
  • 30
  • 50
278
votes
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…
user3194367
  • 2,987
  • 3
  • 13
  • 10
274
votes
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?
samurailawngnome
  • 3,355
  • 3
  • 18
  • 17
238
votes
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…
Meir
  • 12,285
  • 19
  • 58
  • 70
1
2 3
99 100