Why Do We Say An HTML5 [closed] - html

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
Totally random but why do we say "an HTML5"? I've seen it in a couple of articles and books and have been a bit thrown off by it, as I would think to write "a HTML5 book" rather than "an HTML5 book".
Here's an example: http://www.w3.org/html/logo/

Because it's pronounced "aych te em el"(or similair), the first sound is vocal, and thus "an", not an "a".
Not sure this is truly programming related though ).

The answer is because for acronyms initialisms you pronounce every letter, and the word for the letter 'H' sounds like 'aitch', and hence audibly begins with a vowel. "An Aitch Tee Em Ell Five Book."
See also https://english.stackexchange.com/questions/1016/do-you-use-a-or-an-before-acronyms

H is pronounced /ˈeɪtʃ/
http://en.wikipedia.org/wiki/Wikipedia:IPA_for_English#Key
An is the older form (related to one,
cognate to German ein; etc.), now used
before words starting with a vowel
sound, regardless of whether the word
begins with a vowel letter.[8]
Examples: a light-water reactor; a
sanitary sewer overflow; an SSO; a
HEPA filter (because HEPA is
pronounced as a word rather than as
letters); an hour; a ewe; a one-armed
bandit; an heir; a unicorn (begins
with 'yu', a consonant sound).
http://en.wikipedia.org/wiki/English_articles

Related

Semantically / Best Practice for formatting data in HTML5 [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 months ago.
Improve this question
I've been trying to find the most correct way to format random sets of data using HTML.
In my particular case, I have something like:
John Johnson
20K Service Due
2000 Honda Civic
It's not a paragraph, so wrapping each line in <p> tags doesn't seem correct.
It's not a list, so using <ul> and wrapping each line in <li> tags doesn't seem correct.
Placing the content inside a <div> and then using <br>s after each line works but still doesn't seem like it's the best.
The data is similar to an address, which if it was, I could do something like:
<address>
John Johnson<br>
20K Service Due<br>
2000 Honda Civic
</address>
If you are simply pushing data to the screen and want to "know" what format the data is then maybe you can tag each element with the "data" attribute and set a value to it before you push it to the dom. Once you set the data attribute (e.g. data-format) to any value you like, you can than use CSS to format it and you can use JavaScript to manipulate it as well based on the value you set.
let data_format = document.querySelectorAll('[data-format]')
data_format.forEach((element) => {
console.log(`Data Format = ${element.dataset.format}`)
})
<div>
<li data-format="name">John Johnson</li>
<li data-format="service-date">20K Service Due</li>
<li data-format="model">2000 Honda Civic</li>
</div>

How do i select text with regex based on tag and class content in html? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I have an html tag as a string. If 'md' is included in the class attribute in this tag, I want to select it and get the expression in the tag.
Example:
'<tag class="...blah md blah...">(expression)</tag>
<tag></tag> is first selector
Class attribute included md is second selector
At the same time, the tag should not be empty.
I mean, I need a regex that starts with <tag> and ends with </tag> and gives tag with md in class attribute, but I couldn't get out of it.
What I did is trying to select those with direct md attribute, but this is wrong. Also problem with nested tag ones as well.
(<b md(?!<|>).+>|<b \S+ md>|<b md>|<b .+ md .+>)(.+)(<\/b>)
https://regex101.com/r/3Vv0WG/1
I decided that the correct form is in the class attribute, but I could not write this regex. Thanks for your help.
Example:
'<b class="... md ..."></b>' not match because tag is empty
'<i class="..."></i>' not match because class attribute not include md
<span class="...md...">ANYTHING</span> match
It would be more appropriate not to be nested because it causes chaos in the code.
If you have no parser or dom available and can only get the parts from the string with a pattern, you might get away with:
<(\w+) [^<>]*\bclass\s*=\s*"[^"]*\bmd\b[^"]*"[^<>]*>[^<>]+<\/\1>
Regex demo
Notes
[^ Means a negated character class matching any char except what is listed
(\w+) captures 1+ word chars in group 1, and \1 is a backreference to match the same as group 1
The pattern assumes that for the ANYTHING parts there are no chars < or >
The md is matched between word boundaries, preventing a partial match with another "word"
» Food for thought, read about tony the pony.

Extract values after certain string with Google Sheets [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm trying to extract the values that come after the word 'rawValue=' in the following text with a Google Sheet REGEX formula, so not a script.
nowrap;" rawValue="-18245000000">18,245</div><div id="Y_5"
class="pos" style="overflow:hidden;white-space: nowrap;"
rawValue="19916000000">19,916</div><div id="Y_6" class="pos"
style="overflow:hidden;white-space: nowrap;"
rawValue="20350000000">20,350</div></div><div id="data_i25"
class="rf_crow" style="display:none"><div id="Y_1" class="pos"
style="overflow:hidden;white-space: nowrap;"
rawValue="—">—</div><div id="Y_2" class="pos"
style="overflow:hidden;white-space: nowrap;"
rawValue="—">—</div><div id="Y_3"
The variations that follow 'rawValue=' are fourfold:
a large positive number: 19916000000
a large negative number: -18245000000
a small number: 0
the words mdash or nbsp, in the example above: mdash
The examples above are also the preferable output form.
How would I be able to extract all these cases? Good to know is that the amount of instances of rawValues in a cell varies. So it should work regardless of how many matches there are, if that's even possible..
Can anyone help me with this? Much appreciated!
try:
=ARRAYFORMULA(REGEXEXTRACT(SPLIT(REGEXEXTRACT(A2;
"(rawValue="".+)"); "rawValue="""; 0); "^([^""]+)"))

How to correctly comment tags on HTML? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Let's imagine we got this html:
<p>some text</p>
I have always comented like this:
<!--p>some text</p-->
And my co-worker says that's the right way to comment on html:
<!--<p>some text</p>-->
Is not valid the way I comment? Is one way more correct than the other?
Is not valid the way I comment?
It is valid.
Is one way more correct than the other?
Your method is not traditional. Instead of commenting out the code, you are effectively deleting the first and last characters while adding comments.
everything between
<!-- -->
will be treated as a comment, so both are valid
Both would be valid HTML comments. It's a matter of taste, but I've never seen your variant before.
Yes, it is.. The valid way is <!-- Text Here -->, so doing <!-- <p>Comment</p> --> will remove the paragraph element and treat it as a comment.
Comments consist of the following parts, in exactly the following order:
the comment start delimiter "<!--"
text
the comment end delimiter "-->"
The text part of comments has the following restrictions:
must not start with a ">" character
must not start with the string "->"
must not contain the string "--"
must not end with a "-" character
According to this.

extract details from mysql table data [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a mysql table which consists of 1000 records. In the content field there is an anchor tag and I want to extract the author name from this content field and insert it in author field of the same table.
content is
<p>
When air conditioning, escalators, and advertising appeared, shopping expanded its scale, but also limited its spontaneity. And it became much more predictable, almost scientific. What had once been the most surprising became the most manipulated.</p>
<p class="bq_fq_a">
<a id="qut" title="rem_koolhaas"> Rem Koolhaas </a>
</p> <br>
Here you can see that author is Rem Koolhaas. I want to extract the author and update author field in same table with this. In all cell there are different content but the format is same.All rows consists of anchor.
in addition to that I have three more columns in that table tag1,tag2,tag3. I have 50 tags (like success,fun,morning,beach etc )which I want to match with this content and place them in tag1,tag2,tag3 if it matches
table is
id content author tag1 tag2 tag3
1 as given above blank blank blank blank
any way to do this?
SQL as a language isn't quite expressive enough to achieve this easily. I'd look to using another language (for example, what you've got the rest of your application written in), reading the data from the MySQL database row-by-row, extracting or transforming the data using an HTML parser, and then inserting the data into a new table in the desired format.
MYSQL doesn't have the facility of interacting with HTML..can you specify your language..
It can easily done by simply writing these two lines.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
var a = $('#qut').html();
alert(a);
})
</script>