semantics

In HTML5, is it ok to use a strong tag within an em tag?

柔情痞子 提交于 2019-12-24 00:38:28
问题 I'm currently marking up some user alerts as follows <em>You are in danger of exceeding your <strong>40GB</strong> download limit</em> I've found other answers suggesting that, although valid html, this is not semantically valid. But is it really not OK to nest em/strong tags in all instances? The above example seems to me to be a perfectly reasonable use - to specifically emphasise a subsection of something that's already emphasised. But can screen readers interpret this as it's meant to be

Custom post types support in WordLift

怎甘沉沦 提交于 2019-12-23 19:45:58
问题 I am using the WordLift plugin for WordPress and I'd like to add support for Semantic SEO for other custom post types in my web site. Is there a way to do this? 回答1: Yes, there's a filter you can use to add the custom post types: wl_valid_entity_post_types . The filter takes an array with the supported post types (by default post , page and entity ). You can add custom post types to the array and return it, e.g.: add_filter('wl_valid_entity_post_types', function ($post_types) { $post_types[]

SQL UPDATE read column values before setting

。_饼干妹妹 提交于 2019-12-23 10:05:56
问题 I have searched for this information both on SO and on google, but have not found any authoritative answer. When you have an update statement like: UPDATE table SET rowA = rowB, rowB = NULL ... It seems that: ordering is not important ( UPDATE table SET rowB = NULL, rowA = rowB ) nonetheless, the result is that rowA takes the prev value in rowB, because it seems that UPDATE first reads the previous values, then it updates them. I would like to know if the two above points are true in general

at-most-once and exactly-once

时间秒杀一切 提交于 2019-12-23 07:32:16
问题 I am studying Distributed Systems and when it comes to the RPC part, I have heard about these two semantics (at-most-once and exactly-once). I understand that the at-most-once is used on databases for instances, when we don't want duplicate execution. First question: How is this achieved? How does the server know that it shouldnt execute the request again? It might be a duplicate but it might be a legitimate request as well. The second question is: What is the difference between the two

formal method to do semantic analysis in compiler

痞子三分冷 提交于 2019-12-23 02:41:20
问题 I know there is a formalism called attribute grammar,and a non-formalism method called syntax-directed translation,but the first is inefficient and the latter one is difficult to automate. Does there exist other recent formalism about semantic analysis? 回答1: OP suggests "attribute grammars" are inefficient, and syntax-directed translation is difficult to automate. I offer a proof-point showing otherwise, name a few other semantic systems, and suggest how they might be integrated, below. Our

Auto Categorization of Content

孤街浪徒 提交于 2019-12-22 09:55:17
问题 I'm developing a script that extracts the messages from the message archive of a particular meetup.com group of which I'm a member - http://www.meetup.com/opencoffee/messages/archive/ The idea is to dynamically add these to a wordpress site and allow people to search messages, auto tag messages etc. The issue I have is how best to auto categorize these messages. I would welcome any thoughts and ideas of how best to go about this and what would be the most efficient way of programming this.

Why would one choose an editable DIV over an INPUT or TEXTAREA

馋奶兔 提交于 2019-12-22 04:31:40
问题 There are several questions about asking how to make a div editable. However one could just use a textarea or input field and make those disabled or readonly. I would guess this would yield better semantics. Even the example given at MDN looks like a plain old input field to me. So why would I use an editable div? What are its advantages over textareas and input fields? I just had a look at an example I found in the tag wiki contenteditable. Is the advantage, that I can use markup inside an

How to mark the copyright of an image in html?

吃可爱长大的小学妹 提交于 2019-12-22 03:17:18
问题 this is a mostly semantic question. I want to put images with copyrights on the website. I know the figure and figcaption element, but figcaption doesn't seem the best tag for that. It's rather a caption which I also need. If I've got an image like that: <figure> <img src="img/content/preview.jpg" alt="Alttext für das Bild" /> <figcaption>Caption goes here</figcaption> </figure> Where do I put the copyright? EDIT: The copyright text must be visible. 回答1: In general The copyright notice should

NLTK relation extraction returns nothing

雨燕双飞 提交于 2019-12-21 12:34:09
问题 I am recently working on using nltk to extract relation from text. so i build a sample text:" Tom is the cofounder of Microsoft." and using following program to test and return nothing. I cannot figure out why. I'm using NLTK version: 3.2.1, python version: 3.5.2. Here is my code: import re import nltk from nltk.sem.relextract import extract_rels, rtuple from nltk.tokenize import sent_tokenize, word_tokenize def test(): with open('sample.txt', 'r') as f: sample = f.read() # "Tom is the

Dynamic Semantic errors in Python

我只是一个虾纸丫 提交于 2019-12-21 06:55:57
问题 i came across this as an interview question. This question seemed interesting. So, i am posting it here. Consider the operation which gives semantic error like division by zero. By default, python compiler gives output like "Invalid Operation" or something. Can we control the output that is given out by Python compiler, like print some other error message, skip that division by zero operation, and carry on with rest of the instructions? And also, how can i evaluate the cost of run-time