semantics

The parentheses rules of PostgreSQL, is there a summarized guide?

偶尔善良 提交于 2019-12-01 06:30:50
In Mathematics and many programming languages (and I think standard SQL as well), parentheses change precedence (grouping parts to be evaluated first) or to enhance readability (for human eyes). Equivalent Examples: SELECT array[1,2] @> array[1] SELECT (array[1,2]) @> array[1] SELECT array[1,2] @> (array[1]) SELECT ((array[1,2]) @> (array[1])) But SELECT 1 = ANY array[1,2] is a syntax error (!), and SELECT 1 = ANY (array[1,2]) is valid. Why? OK, because "the manual says so" . But what the logic for humans to remember all exceptions? Is there a guide about it? I do not understand why

CSS, nested divs & margins vs. padding

眉间皱痕 提交于 2019-12-01 05:41:58
问题 i totally understand the box model. this question is more about trying to pin down a semantic methodology regarding when to use margins and when to use padding. here is a typical example, first, in plain English: situation: we have a container div, inside of which there is a paragraph element. goal: to have a 12px space between the inside of the div and the outside of the paragraph. option a) apply 12px of padding to the container div option b) apply 12px margins to the paragraph element or,

The parentheses rules of PostgreSQL, is there a summarized guide?

无人久伴 提交于 2019-12-01 05:33:49
问题 In Mathematics and many programming languages (and I think standard SQL as well), parentheses change precedence (grouping parts to be evaluated first) or to enhance readability (for human eyes). Equivalent Examples: SELECT array[1,2] @> array[1] SELECT (array[1,2]) @> array[1] SELECT array[1,2] @> (array[1]) SELECT ((array[1,2]) @> (array[1])) But SELECT 1 = ANY array[1,2] is a syntax error (!), and SELECT 1 = ANY (array[1,2]) is valid. Why? OK, because "the manual says so". But what the

What is a correct approach to using strong/em tags when localising strings?

别等时光非礼了梦想. 提交于 2019-12-01 04:25:44
I know some languages emphasise words differently to English, e.g. via changing word endings rather than stressing words with inflection of the voice. If you are localising a site, would you trust that <strong> and <em> tags (and their placement) will have the same meaning in other languages — would you maintain this emphasis, check with your translator or leave them out? What I'm wondering is how this translates (excuse the pun) into the semantics of the web? — Strong and em tags carry semantic meaning that is used within SEO, screen-readers etc. So should they be left in place so this isn't

How to get rid of accents just with CSS

筅森魡賤 提交于 2019-12-01 04:18:41
问题 Without using JS, I wanted to remove accents with CSS so the HTML continues semantically correct while visually achieving UPPERCASE without accents. Example: h1 { text-transform: uppercase; /*sth here*/ } <h1>Fácil</h1> Tks! 回答1: You can adjust the line-height and use overflow:hidden but pay attention when using a different font-family you may need another value: h1 { text-transform: uppercase; line-height: 0.75em; overflow: hidden; } <h1>Fácil é â ä</h1> <h1 style="font-size:25px">Fácil é â

How does Ruby's max function order duplicates?

元气小坏坏 提交于 2019-12-01 04:10:31
I've been looking at the max method in Ruby's Enumerable mixin (v2.4.1). It's a fairly straightforward method, but how it orders items when duplicates are present is a bit confusing. For example: x = [1,2,3,4,5,6,7,8,9] x.max {|a, b| a%2 <=> b%2} => 1 10.times{|y| p x.max(y) {|a, b| a%2 <=> b%2}} [] [1] [1, 7] # why is 7 the next element after 1? [3, 1, 5] # why no more 7? [7, 3, 1, 5] # 7 is now first [9, 7, 3, 1, 5] [9, 7, 3, 1, 5, 6] [9, 7, 3, 1, 5, 4, 6] [9, 7, 3, 1, 5, 2, 4, 6] [9, 7, 5, 3, 1, 8, 6, 4, 2] # order has changed again (now seems more "natural") How is 7 chosen as the second

Is there a way to disable short circuit evaluation in Java?

谁说我不能喝 提交于 2019-12-01 03:06:41
Say I have code like this: boolean ret = a() && b() && c() && d() && e(); Usually e() is only called if all other calls a()-d() return true. Is there maybe some compiler or JVM option to disable short circuit evaluation, so e() would be called always, regardless of other functions' results? Basically I am doing UAT of huge system and need to test e(), however setting up environment and scenario that assures all a(), b() etc. return true is extremely painful... EDIT: ok, I guess using bit AND instead of logical one could provide SOME sort of workaround, however ideally I am looking for a

How does Ruby's max function order duplicates?

﹥>﹥吖頭↗ 提交于 2019-12-01 01:43:01
问题 I've been looking at the max method in Ruby's Enumerable mixin (v2.4.1). It's a fairly straightforward method, but how it orders items when duplicates are present is a bit confusing. For example: x = [1,2,3,4,5,6,7,8,9] x.max {|a, b| a%2 <=> b%2} => 1 10.times{|y| p x.max(y) {|a, b| a%2 <=> b%2}} [] [1] [1, 7] # why is 7 the next element after 1? [3, 1, 5] # why no more 7? [7, 3, 1, 5] # 7 is now first [9, 7, 3, 1, 5] [9, 7, 3, 1, 5, 6] [9, 7, 3, 1, 5, 4, 6] [9, 7, 3, 1, 5, 2, 4, 6] [9, 7, 5,

Is there a way to disable short circuit evaluation in Java?

烈酒焚心 提交于 2019-11-30 23:06:43
问题 Say I have code like this: boolean ret = a() && b() && c() && d() && e(); Usually e() is only called if all other calls a()-d() return true. Is there maybe some compiler or JVM option to disable short circuit evaluation, so e() would be called always, regardless of other functions' results? Basically I am doing UAT of huge system and need to test e(), however setting up environment and scenario that assures all a(), b() etc. return true is extremely painful... EDIT: ok, I guess using bit AND

What's the best method to semantically structure a form?

≯℡__Kan透↙ 提交于 2019-11-30 21:41:06
I've seen several examples of how developers structure their forms using tables, divs, and lists; all of which are not very semantic. What is the best method for structuring an HTML document so it breaks each label & input group to the next line and can be easily read - without the use of CSS ? (I feel that ol's and ul's are simply a replacement for tr's and td's. A form, in my opinion, is not a content or definition list) I almost feel like div's are the best format since a div is a clear 'division' or grouping of items but I'm not sure. Sample HTML <form> <fieldset> <legend>Your Favorites<