Questions tagged [head]

DO NOT USE as this is an ambigous tag. It might refer to HTML

element, UNIX command, HTTP HEAD method. Instead use [html] for questions about html, [http-head] for questions about the HTTP HEAD method, [unix-head] for question about the UNIX head command.

The <head> element is a container for all the head elements.

The element must include a title for the document, and can include scripts, styles, meta information, and more.

The following elements can go inside the element:

<title> (this element is required in the head section)
<style>
<base>
<link>
<meta>
<script>
<noscript>

head is also a unix command which displays the first lines of a file. It's counterpart which displays the last lines is tail ().

Example: head -n 10 file will output first 10 lines of file.


Related

807 questions
1232
votes
2 answers

How do I use 'git reset --hard HEAD' to revert to a previous commit?

I know that Git tracks changes I make to my application, and holds on to them until I commit the changes. To revert to a previous commit, I used: $ git reset --hard HEAD HEAD is now at 820f417 micro How do I then revert the files on my hard drive…
Brian McDonough
  • 13,829
  • 4
  • 19
  • 23
513
votes
10 answers

Get first row value of a given column

This seems like a ridiculously easy question... but I'm not seeing the easy answer I was expecting. So, how do I get the value at an nth row of a given column in Pandas? (I am particularly interested in the first row, but would be interested in a…
Ahmed Haque
  • 7,174
  • 6
  • 26
  • 33
264
votes
6 answers

What is the HEAD in git?

There seems to be a difference between the last commit, the HEAD and the state of the file I can see in my directory. What is HEAD, what can I do with it and what mistake should I avoid?
Bite code
  • 578,959
  • 113
  • 301
  • 329
127
votes
1 answer

Get first element of Series without knowing the index

Is there any way to access the first element of a Series without knowing its index? Let's say I have the following Series: import pandas as pd key='MCS096' SUBJECTS = pd.DataFrame( { "ID": pd.Series([146], index=[145]), "study":…
Hello lad
  • 17,344
  • 46
  • 127
  • 200
116
votes
5 answers

Head and tail in one line

Is there a pythonic way to unpack a list in the first element and the "tail" in a single command? For example: >> head, tail = **some_magic applied to** [1, 1, 2, 3, 5, 8, 13, 21, 34, 55] >> head 1 >>> tail [1, 2, 3, 5, 8, 13, 21, 34, 55]
Giacomo d'Antonio
  • 2,215
  • 3
  • 19
  • 23
95
votes
7 answers

Delete all local changesets and revert to tree

I'm using Mercurial and I've got into a terrible mess locally, with three heads. I can't push, and I just want to delete all my local changes and commits and start again with totally clean code and a clean history. In other words, I want to end up…
Richard
  • 62,943
  • 126
  • 334
  • 542
82
votes
6 answers

Is header('Content-Type:text/plain'); necessary at all?

I didn't see any difference with or without this head information yet.
omg
  • 136,412
  • 142
  • 288
  • 348
44
votes
3 answers

how to get content of the current page with jquery or JS

how to get content of the current page
faressoft
  • 19,053
  • 44
  • 104
  • 146
43
votes
3 answers

inject a javascript function into an Iframe

This link (archived version) describes how to inject code from a script into an iframe: function injectJS() { var iFrameHead = window.frames["myiframe"].document.getElementsByTagName("head")[0]; var myscript = document.createElement('script'); …
janesconference
  • 6,333
  • 8
  • 55
  • 73
35
votes
7 answers

HTML & CSS - put tag outside of the

Is it ok to put the to a css file out of the tag, for example in the footer side? Which are bad and good results of this? I ask this, cause actually i have a css file which doesn't styles anything but brings just some css3 animations…
itsme
  • 48,972
  • 96
  • 224
  • 345
33
votes
3 answers

HEAD with WebClient?

I am going to assume the answer is no but.... Is there a way to use WebClient to send the HEAD method and return the headers as a string or something similar?
user34537
32
votes
3 answers

Make git master HEAD point to current HEAD of branch

I have to admit that I haven't played with gits advanced features but on my current project I had to. The situation: Someone tried to implement some features and comitted them to the master, now I was called to do what this other person tried to do…
Maxem
  • 2,634
  • 1
  • 20
  • 14
28
votes
9 answers

python pandas select both head and tail

For a DataFrame in Pandas, how can I select both the first 5 values and last 5 values? For example In [11]: df Out[11]: A B C 2012-11-29 0 0 0 2012-11-30 1 1 1 2012-12-01 2 2 2 2012-12-02 3 3 3 2012-12-03 4 4 4 2012-12-04 …
fu xue
  • 361
  • 1
  • 3
  • 10
23
votes
3 answers

Getting HEAD content with Python Requests

I'm trying to parse the result of a HEAD request done using the Python Requests library, but can't seem to access the response content. According to the docs, I should be able to access the content from requests.Response.text. This works fine for me…
Yarin
  • 173,523
  • 149
  • 402
  • 512
23
votes
4 answers

Making HTTP HEAD request with urllib2 from Python 2

I'm trying to do a HEAD request of a page using Python 2. I am trying import misc_urllib2 ..... opender = urllib2.build_opener([misc_urllib2.MyHTTPRedirectHandler(), misc_urllib2.HeadRequest()]) with misc_urllib2.py containing class…
Wizzard
  • 12,582
  • 22
  • 68
  • 101
1
2 3
53 54