visited

二分图/二部图检测(动图&代码实现)

一个人想着一个人 提交于 2019-12-06 12:20:01
定义 二分图(中文翻译问题,有时也称作二部图),是图论中的一种特殊模型。 如果图可以分为两部分: 绿色和蓝色,并且每一条连线都连接着一个绿色顶点和一个蓝色定点,则称这个图为一个二分图.下图就是一个二分图. 二分图检测 示例图,如下: 肉眼很难区分出两部分,需要采用一定的算法才可区分,下面就介绍检测的方法--染色. 染色 首先,选择一个节点,置为蓝色(绿色也可),再将与之连线的节点置为对立的颜色-绿色,按深度优先(广度优先也可)的逻辑,将节点依次置为对立色,如果最终结果为:每条边都连接这一个蓝色和一个绿色节点,则二分图检测成功. 代码实现(java) import java.util.ArrayList; public class BipartitionDetection { /** * 图的类 * public class Graph { * private int V; // 顶点 * private TreeSet<Integer>[] adj; // 每个顶点相连的顶点树数组 * } */ private Graph G; /** * 已访问的顶点数组 */ private boolean[] visited; /** * 0->蓝色, 1->绿色 */ private int[] colors; /** * 是否为二分图 */ private boolean

Jquery: mark links as visited without opening them?

天涯浪子 提交于 2019-12-06 03:55:39
I have no intention of just altering the link (I hear that's impossible, but if it's not I'd love to know how). I'm fine with adding it to the the browser history if that needs to be done. I'd like to loop through all <a> 's on a page and change their state to visited. For example: $("a").each(function(){ //mark as visited (somehow?) }); Essentially creating a "Mark All as Read" button on my page. Any ideas? You could ... 1) Try using AJAX (ie. $.get(a.href)), but I don't know if that would actually work. 2) Try styling the links to look visited (by changing their CSS "color" attribute),

CSS :link and :visited pseudo-classes - are web browsers adhering to the spec?

喜夏-厌秋 提交于 2019-12-05 17:29:49
问题 The W3.org CSS specification states the following (emphasis mine): The :link pseudo-class applies for links that have not yet been visited. The :visited pseudo-class applies once the link has been visited by the user. The two states are mutually exclusive . This means that any style applied to the :link selector should only be applied to unvisited links. However, the only property for which this is true appears to be color . Applying font sizes, backgrounds and so on to the :link selector

二分图/二部图检测(动图&代码实现)

爱⌒轻易说出口 提交于 2019-12-05 12:44:04
定义 二分图(中文翻译问题,有时也称作二部图),是图论中的一种特殊模型。 如果图可以分为两部分: 绿色和蓝色,并且每一条连线都连接着一个绿色顶点和一个蓝色定点,则称这个图为一个二分图.下图就是一个二分图. 二分图检测 示例图,如下: 肉眼很难区分出两部分,需要采用一定的算法才可区分,下面就介绍检测的方法--染色. 染色 首先,选择一个节点,置为蓝色(绿色也可),再将与之连线的节点置为对立的颜色-绿色,按深度优先(广度优先也可)的逻辑,将节点依次置为对立色,如果最终结果为:每条边都连接这一个蓝色和一个绿色节点,则二分图检测成功. 代码实现(java) import java.util.ArrayList; public class BipartitionDetection { /** * 图的类 * public class Graph { * private int V; // 顶点 * private TreeSet<Integer>[] adj; // 每个顶点相连的顶点树数组 * } */ private Graph G; /** * 已访问的顶点数组 */ private boolean[] visited; /** * 0->蓝色, 1->绿色 */ private int[] colors; /** * 是否为二分图 */ private boolean

Visited links lose CSS color animation in Chrome

假如想象 提交于 2019-12-05 01:27:01
I'm trying to set color animations on links. Once a link has been visited in Chrome, the color animation is no longer applied. This is not the case for other animated styles (I've tested background color, font weight, and font size) nor in other browsers (Firefox, Safari, IE11). Here's a demo: http://codepen.io/benjarwar/pen/rVJbeR http://s.codepen.io/benjarwar/debug/rVJbeR HTML: <a href='#' target='_blank' class='color'>Color Animation</a> CSS: a.color, a.color:visited { -moz-animation: color-animation 1s ease-in-out infinite; -webkit-animation: color-animation 1s ease-in-out infinite;

a:visited doesn't work in Mozilla Firefox

本小妞迷上赌 提交于 2019-12-04 04:31:15
I have created a link and when I try to set the style; a:visited { text-decoration: underline; color: #FF0000; } It doesnt seem to work. It works fine in IE. I have also followed the order; link, visited, hover, active. Is this a known issue, or am I making any mistake? Justin Gallagher It might have to do with specificity and the order that you have your selectors in. In general, when specifying link states, you should follow the " l o v e/ ha te" principal: : l ink : v isited : h over : a ctive Maybe you have the :hover or :active selector before :visited ? Download the Firebug or

CSS :link and :visited pseudo-classes - are web browsers adhering to the spec?

﹥>﹥吖頭↗ 提交于 2019-12-04 03:22:56
The W3.org CSS specification states the following (emphasis mine): The :link pseudo-class applies for links that have not yet been visited. The :visited pseudo-class applies once the link has been visited by the user. The two states are mutually exclusive . This means that any style applied to the :link selector should only be applied to unvisited links. However, the only property for which this is true appears to be color . Applying font sizes, backgrounds and so on to the :link selector targets all links. There is a note further down the page that states: Note. It is possible for style sheet

How can I create a “first-load” event in html or javascript?

霸气de小男生 提交于 2019-12-02 04:27:10
问题 I'm starter. I have an idea. I want to implement an event like this. Is it possible? <html> <head> <title>First visit event</title> <script> function do_something() { alert("Hello my friend. This is your first visit."); } </script> </head> <body firstVisitEvent="do_something()"> </body> 回答1: Use on load. It will execute when the page loads, and you will see your alert. Good luck with your knowledge. <html> <head> <script> function load() { alert("Page is loaded"); } </script> </head> <body

How can I create a “first-load” event in html or javascript?

早过忘川 提交于 2019-12-02 03:07:14
I'm starter. I have an idea. I want to implement an event like this. Is it possible? <html> <head> <title>First visit event</title> <script> function do_something() { alert("Hello my friend. This is your first visit."); } </script> </head> <body firstVisitEvent="do_something()"> </body> Use on load. It will execute when the page loads, and you will see your alert. Good luck with your knowledge. <html> <head> <script> function load() { alert("Page is loaded"); } </script> </head> <body onload="load()"> <h1>Hello World!</h1> </body> </html> Edit: You can get more advance and set cookies to see

jQuery 选择器使用大全(标签选择器,ID选择器等)

本秂侑毒 提交于 2019-11-30 05:55:05
jQuery的选择器是CSS 1-3,XPath的结合物。jQuery提取这二种查询语言最好的部分,融合后创造出了最终的jQuery表达式查询语言。如果你了解CSS(绝大部分WEB开发者都用到的),那么你学起来就很容易了。 同时使用CSS和XPath 看几个例子: 隐藏所有包含有链接的段落: $("p[a]").hide(); 显示页面的第一个段落: $("p:eq(0)").show(); 隐藏所有当前可见的层元素: $("div:visible").hide(); 获取所有无序列表的列表项: $("ul/li") /* valid too: $("ul > li") */ 取得name值为bar的输入字段的值: $("input[@name=bar]").val(); 所有处于选中状态的单选r按钮: $("input[@type=radio][ @checked ]") 如果你对查询语言的工作原理还有疑问,可以订阅这里的邮件列表。 CSS查询器 jQuery完全支持CSS1.3。 关于CSS的一些资料查看下面的连接: •CSS 1 •CSS 2 •CSS 3 下面列出来的是支持的CSS查询器的列表式语法: •* 任何元素 •E 类型为E的元素 •E:root 类型为E,并且是文档的根元素 •E:nth-child(n) 是其父元素的第n个类型为E的子元素 •E:first