head

Do any lisps have a s-expression as their head, e.g. ((f 2) 3 4)? If not, why?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 01:47:07
问题 Do any lisps support nested s-expression on their head? For example ((f 2) 3 4) for which (f 2) presumably evaluates to a function/macro to apply on 3 4 . Is it possible to have a lisp supporting such a thing? Or are there technical limitations that prohibit this/make it impractical? 回答1: In those Lisps, which have single namespace for variables and functions, your expression is valid. These are called Lisp-1. Scheme and Clojure are examples of such Lisps. In those Lisps, which have separate

What is the real difference between the “head” and “header” tag? [duplicate]

强颜欢笑 提交于 2019-11-30 14:52:23
This question already has an answer here: <header> vs. <head> 5 answers The Question I've been coding for a while and realized that the head and header look exactly the same. Are they the same, and what is the difference between them? Does it make a difference? After researching a bit I couldn't find much info on this, I may not have been digging deep enough. The info I found was that the <head> tag came out since HTML 1 as the <header> tag came out in HTML5. Is one more stable from the other? Summary I would like to understand the difference between the two tags. I would like a creditable/ or

cURL hanging for 15 seconds when sending HEAD requests

时光总嘲笑我的痴心妄想 提交于 2019-11-30 12:30:04
Background I've been timing some HTTP requests via the CLI using time and tools such as wget and curl as follows: /usr/bin/time -v wget --spider http://localhost/index /usr/bin/time -v curl http://localhost/index 2>&1 > /dev/null What I noticed is that when using curl , I was getting similar response times as with wget only on the first request, and much lower times on subsequent requests, as if the responses to curl were served from cache and wget were not. After investigating I found out that when specifying --spider , wget issues a HEAD request as appended below which could explain why the

Get first element of Series without knowing the index [duplicate]

强颜欢笑 提交于 2019-11-30 05:35:09
This question already has an answer here: Pandas - Get first row value of a given column 7 answers Is that any way that I can get first element of Seires without have information on index. For example,We have a Series import pandas as pd key='MCS096' SUBJECTS=pd.DataFrame({'ID':Series([146],index=[145]),\ 'study':Series(['MCS'],index=[145]),\ 'center':Series(['Mag'],index=[145]),\ 'initials':Series(['MCS096'],index=[145]) }) prints out SUBJECTS: print (SUBJECTS[SUBJECTS.initials==key]['ID']) 145 146 Name: ID, dtype: int64 How can I get the value here 146 without using index 145? Thank you very

How do I limit (or truncate) text file by number of lines?

别来无恙 提交于 2019-11-30 04:38:44
I would like to use a terminal/shell to truncate or otherwise limit a text file to a certain number of lines. I have a whole directory of text files, for each of which only the first ~50k lines are useful. How do I delete all lines over 50000? In-place truncation To truncate the file in-place with sed, you can do the following: sed -i '50001,$ d' filename -i means in place. d means delete. 50001,$ means the lines from 50001 to the end. You can make a backup of the file by adding an extension argument to -i , for example, .backup or .bak : sed -i.backup '50001,$ d' filename In OS-X or FreeBSD

create a git symbolic ref in remote repository

北城以北 提交于 2019-11-30 01:16:24
问题 In my remote bare repository the HEAD is pointing to "refs/heads/master" and I want it to point to "refs/heads/other". I am not able to go to remote repository directory and run git symbolic-ref . Is there any git command to achieve it? Or any other way? If there is no way, does Github allow one to change the HEAD? Thanks in advance. 回答1: To change it in github, go to the admin section. You can select the default branch from a dropdown there. 回答2: (There has been posted another question

What is the real difference between the “head” and “header” tag? [duplicate]

大兔子大兔子 提交于 2019-11-29 21:16:20
问题 This question already has an answer here: <header> vs. <head> 5 answers The Question I've been coding for a while and realized that the head and header look exactly the same. Are they the same, and what is the difference between them? Does it make a difference? After researching a bit I couldn't find much info on this, I may not have been digging deep enough. The info I found was that the <head> tag came out since HTML 1 as the <header> tag came out in HTML5. Is one more stable from the other

PHP: get_headers set temporary stream_context

隐身守侯 提交于 2019-11-29 10:30:16
I guess PHP's get_headers does not allow for a context, so I have to change the default stream context to only get the HEAD of a request. This causes some issues with other requests on the page. I can't seem to figure out how to reset the default stream context. I'm trying something like: $default = stream_context_get_default(); //Get default stream context so we can reset it stream_context_set_default( //Only fetch the HEAD array( 'http' => array( 'method' => 'HEAD' ) ) ); $headers = get_headers($url, 1); //Url can be whatever you want it to be //var_dump($headers); var_dump($default); stream

Jquery add css to head

对着背影说爱祢 提交于 2019-11-28 23:17:13
I am asynchronously adding a few scripts and style sheets to a project that I am building and would like to keep the style sheets all grouped together in the HEAD. <head> <title>home</title> <meta charset="utf-8"> <link rel="Shortcut Icon" type="image/ico" href="/img/favicon.png"> <!-- STYLES--> <link rel="stylesheet" href="/css/fonts-and-colors.css" type="text/css" media="screen"> <link rel="stylesheet" href="/css/layout.css" type="text/css" media="screen"> <!-- JS--> <script type="text/javascript" async="" src="/js/light-box.js"></script> <script type="text/javascript" src="/js/jquery-1.7.2

unstaged files gone after git reset --hard

旧时模样 提交于 2019-11-28 11:11:36
I tried the git reset --hard HEAD@{n} from git reflog and I lost everything with my current unstaged files :'( the unstaged files is the last git add I did, before then I tried git reset to the last git commit . And all my files gone, I can't go back to the git add before last commit :'( Andrew C It's not clear if you lost files in your working directory, or files in the index. You say you lost your "unstaged files", but then you mention you might have run "git add". "unstaged files" are lost for good. Staged files can be recovered with git fsck --full --unreachable --no-reflog For each file