deque<int>q; void spfa(int s) { ;i<=n;i++) d[i]=1e9; d[s]=; q.push_back(s); used[s]=; while(!q.empty()) { int x=q.front(); q.pop_front(); used[x]=; for(int i=first[x];i;i=next[i]) { int u=hh[i].t; if(d[u]>d[x]+hh[i].c) { d[u]=d[x]+hh[i].c; if(…
转载来自朱小厮博客的 一文看懂Kafka消息格式的演变     ✎摘要 对于一个成熟的消息中间件而言,消息格式不仅关系到功能维度的扩展,还牵涉到性能维度的优化.随着Kafka的迅猛发展,其消息格式也在不断的升级改进,从0.8.x版本开始到现在的1.1.x版本,Kafka的消息格式也经历了3个版本.本文这里主要来讲述Kafka的三个版本的消息格式的演变,文章偏长,建议先关注后鉴定. Kafka根据topic(主题)对消息进行分类,发布到Kafka集群的每条消息都需要指定一个topic,每个topi…
JavaScript 数组去重经常出现在前端招聘的笔试题里,比如: 有数组 var arr = ['a', 'b', 'c', '1', 0, 'c', 1, '', 1, 0],请用 JavaScript 实现去重函数 unqiue,使得 unique(arr) 返回 ['a', 'b', 'c', '1', 0, 1, ''] 作为笔试题,考点有二: 正确.别小看这个考点,考虑到 JavaScript 经常要在浏览器上运行,在千姿百态的各种浏览器环境下要保障一个函数的正确性可不是一件简单的事…
WordPress 很慢? 很多博主都会感觉 WordPress 很慢?作为全世界最常用的建站和博客系统 WordPress 来说,在性能设计上肯定不会有太大的问题,WordPress 开发团队也肯定也考虑到这个问题. 那么 WordPress 效率问题主要是出在哪里呢?根据我多年 WordPress 建站和维护的经验,很多性能的问题都是 WordPress 使用不当造成的,比如安装太多效率低下的插件,使用代码质量低下的主题,没有正确处理 WordPress 的缓存等等,所以提高 WordPre…
#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> using namespace std; ; int prime[maxn]; bool not_prime[maxn]; int main() { ; scanf("%d",&n); memset(not_prime,,sizeof(not_prime)); not_prime[]=tr…
使用MarsEdit编辑的第一个测试博客. 希望我们一帆风顺! 插图,在插图时可以调整尺寸:   六种公式写法,记得要在选项中打开-启用数学公式: \begin{equation}\sum\end{equation} \begin{equation*}\sum\end{equation*}  \(\sum\) $\sum$ \[\sum\] $$\sum$$ #include <iostream> int main(int argc, const char * argv[]) { // ins…
一句话为当前窗口客户区捉图: GetFormImage http://www.cnblogs.com/del/archive/2008/10/24/1318738.html unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButto…
using System; using System.Collections.Generic; using System.Text; using System.Web; using System.Web.UI; /// <summary> /// 一些常用的Js调用 /// 采用ClientScript.RegisterStartupScript(string msg)的方式输出,不会改变xhtml的结构, /// 不会影响执行效果. /// 为了向下兼容,采用了重载的方式,新版本中要求一个S…
是因为更新过系统,安装并更新了系统自带的apache 执行这个命令即可 #ln -sf /www/wdlinux/init.d/httpd /etc/rc.d/init.d/httpd#reboot    …
前言 在 <一篇带你用 VuePress + Github Pages 搭建博客>中,我们使用 VuePress 搭建了一个博客,最终的效果查看:TypeScript 中文文档. 本篇讲讲 SEO 中的一些细节优化. 1. 设置全局的 title.description.keywords // config.js module.exports = { title: "title", description: 'description', head: [ ['meta', {…