FAQ Database Discussion Community


Codeigniter: Head & Title Tags with if/else

php,codeigniter,if-statement,header,head
I am newbie in CodeIgniter and in PHP as well. I am looking for an example to find out how it is worked before recode it to my project. And also you can explain basically if you want without any example. I have been looking for it on the internet...

Selecting the nth character within a loop using R

r,loops,head,tail
For context, I am writing a code in R that selects out the most common character from a list of strings - determining the most common character in the first position of each string, and so on. To start I am running a loop within a loop to save each...

function similar to head() for matrix

r,matrix,head,corners
I am looking for a function in any package that can print matrix[1:5, 1:5]. head() is good for those that have few columns but not for a large matrix. I know I can create my own function for it but I am wondering if there is a function for it...

Practicality of head and tail in a linked list

java,data-structures,linked-list,tail,head
From what I come to understand is that the head always point to the first node in the list. The tail always point to the last node in the list. Questions: 1) But in terms of practicality, why is having the tail useful? I understand having head is useful because...

Read a file from byte a until byte b

file,sed,bigdata,head
I want to break a big file into to smaller files mainly. I use stream because I do not want to keep the big file in my disk. What I am looking it is something similar to: sed -n 'a,bp,' #this uses lines in file while i want bytes or:...

HTML: How to initiate HTML document header

html,character-encoding,doctype,head
I am still pretty new to HTML and programming in general so this is more of a curiosity question but I am asking as I want to use it the right way. Whenever I have to initiate an HTML document I start it as below and never observed any issues....

make a linked list with head and tail nodes

linked-list,head,tail
I am a newbie to data structure. When you make a linked list with head and tail nodes, why do I have to link new node to tail? Isn't it enough for tail.next to be linked to newNode? like this: public void add( Object data ) { ListNode newNode =...

Using subprocess to get output of grep piped through head -1 [duplicate]

python,grep,pipe,subprocess,head
This question already has an answer here: Python subprocess command with pipe 5 answers 'yes' reporting error with subprocess communicate() 3 answers The gist of what I'm trying to do is this: grep -n "some phrase" {some file path} | head -1 I would like to pass the output...

R - aggregate results in disparity between names(data) and columns in head(data)

r,aggregate,head,names
I have a dataset of long format with 3 factors (strain, genotype, region) and 1 value (volume). This dataset is called individualData. Basically what I'm trying to do is calculate the mean and standard deviation of volume for every combination of strain * genotype * region, with the exception of...

Errors “noscript”, W3C XHTML

xhtml,w3c-validation,head,noscript
I am trying to validate my document as XHTML 1.0 Transitional (W3C). I have the following error: "document type does not allow element "noscript" here; assuming missing "object" start-tag" which corresponds to this code: <noscript> <div style="display:inline;"> <img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/1096/? value=1.00&amp;label=Y-skCMY_QM&amp;guid=ON&amp;script=0"/> </div> </noscript> </head> But I get...

Linked lists, how to insert if head does not exist?

c,struct,linked-list,head
I got a linked list, which should save the Outcome (W or L) and the gained/lost points for each match. All good so far, but I'm getting trouble when the head does not exist/is empty. I also realized I have a pretty bad overview of how to implement linked lists,...

Prolog-iterating through list

list,prolog,iteration,head
Let's say i have list Xs = [a,b,c]. Now i want to iterate through all elements and call another function for this elements. My question is: how to do this using head and tail? I would be grateful for help.

Use awk to print custom lines

bash,awk,head
I have a file like this: >ref AAAAAAA >seq1 BBBBBBB >seq2 CCCCCCC >seq3 DDDDDD I want to get: >ref AAAAAAA >seq1 BBBBBBB >ref AAAAAAA >seq2 CCCCCCC >ref AAAAAAA >seq3 DDDDDD I was thinking of using this command in bash: ref=$(head -n 2 file) awk '/>/{print "'"$ref"'"}1' file And here is...

Unix head/tail a percentage of lines to an output file

unix,lines,percentage,head,tail
I'm using unix to read through an excel file, sort by one column, and then I want a percentage (lets say the top 10%) of the sorted lines exported to a new .xls file. I have the code below which works fine but I need to do a wc -l...

No head section when requesting page via YQL API

proxy,yql,head
I'm trying to get the full page via yahoo YQL API, in order to access metadata fields defined in the target page head section (specifically open graph metadata). My example URL: http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http://www.google.com%22&format=xml But it does not contain any metadata parameters...is there another way to call this Yahoo API to include...

PHPStorm find and replace complete tag in all the project files

html,search,replace,phpstorm,head
I have got a bunch of HTML files from a client in a project. All the html pages have the same header and footer div, I have modified the header in the homepage index.html file. I want this modifed header to be replaced in all the html files in the...