现在位置: 首页 > erupt发表的所有文章
  • 11月
  • 13日
综合 ⁄ 共 709字 评论关闭
         一、概念          Memcache是一个高性能的分布式的内存对象缓存系统,通过在内存里维护一个统一的巨大的hash表,它能够用来存储各种格式的数据,包括图像、视频、文件以及数据库检索的结果等。简单的说就是将数据调用到内存中,然后从内存中读取,从而大大提高读取速度(即用于在动态应用中减少数据库负载,提升访问速度)。Memcached由Danga Interactive开发,用于提升LiveJournal.com访问速度的。LJ每秒动态页面访问量几千次,用户700万。Memcached将数据库负载大幅度降低,更好的分配资源,更快速访问。          二......
阅读全文
  • 08月
  • 14日
综合 ⁄ 共 1920字 评论关闭
tarjan算法求连通分量的核心还是聚类,为每个节点设置后续遍历序号dfn、节点最早追溯序号low low(u) = min(low(v))(v 为 u 后续) low(u) = min(dfn(v))(u 为 v 后续) low(u)= min(low(u),dfn(u)) 桥(u,v): low(v) > dfn(u) 割点 u :  u为根 & 子树大于1 u不为根 & 存在边(u,v)使dfn(u)<= low(v) 块:在该点集内的点没有桥 块与块之间通过桥连通 入度,出度:对于压缩点后的有向图来说,每个点均有入度出度,若某个点存在入度或出度为0,则该点必不可能处于其他强连通分......
阅读全文
  • 04月
  • 03日
综合 ⁄ 共 1191字 评论关闭
d[ i ][ j ][ k ] 代表当前i个箭头已经跳过,左腿在j右腿在k时候的最小移动代价; 注意两条腿可以同时移动; #include<iostream> #include<cstdio> #include<algorithm> #include<vector> #include<queue> #include<cmath> #include<cstring> #include <iostream> using namespace std; const int maxn = 110; const int inf = 1000000; int c[5][5]; void init(){ for(int i=1;i<=4;i++) c[i][0]=c[0][i]=2; for(int i=1;i<=4;i++){ int te = i==4? 1:i+1;......
阅读全文
  • 03月
  • 07日
综合 ⁄ 共 397字 评论关闭
给定两个有序数组A和B,其中A的空间足够存放A和B的所有元素。实现一个函数:将B合并到A中,并保持有序。 思路: 比较简单,类似于字符串中将空格替换成“20%”那个问题。从尾到头进行合并即可。 #include <iostream> using namespace std; void Merge(int a[], int n, int b[], int m) { int i = n - 1; int j = m - 1; int k = n + m - 1; while (i >= 0 && j >= 0) { if (a[i] > b[j]) a[k--] = a[i--]; else a[k--] = b[j--]; } while (j >= 0) a[k--] = b[j--]; } int main() {......
阅读全文
  • 02月
  • 16日
综合 ⁄ 共 3500字 评论关闭
Safecracker Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 8718    Accepted Submission(s): 4409 Problem Description === Op tech briefing, 2002/11/02 06:42 CST === "The item is locked in a Klein safe behind a painting in the second-floor library. Klein safes are extremely rare; most of them, along with Klein and his factory, were destroyed in World War II. Fortunately old Brumbaugh from research knew Klein's secrets and wrote them......
阅读全文
  • 06月
  • 08日
综合 ⁄ 共 4999字 评论关闭
进程间通信 http://www.chromium.org.sixxs.org/developers/design-documents/inter-process-communication 目录 1。      概述     1.1 在浏览器中的IPC      1.2 在渲染器中的IPC 2。     消息      2.1 消息的类型      2.2 声明消息           2.2.1 产生值      2.3 消息的发送      2.4 消息的处理      2.5 安全注意事项 3。   通道 4。同步消息      4.1 同步消息的声明      4.2 同步消息的发布      4.3 同步信息处理概述 Chromium 有一个多进程架构,这意味着我们可以用多个进程进行相互的沟通。我们的主要进程......
阅读全文
  • 04月
  • 10日
综合 ⁄ 共 160字 评论关闭
启动模拟器 启动命令行 通过ipconfig /all 查本机的DNS执行adb shell 输入执行getprop,显示所有属性,看其net.dns1的值,通常是10.0.2.3 执行setprop,设置dns属性为本机,比如:root@android:/ # setprop net.dns1 202.106.195.68 之后上网效果如图
阅读全文
  • 01月
  • 13日
综合 ⁄ 共 586字 评论关闭
#include<iostream> #include<cstring> #include<cstdio> using namespace std; int n,m,ans,lk[1001]; bool f[1001][1001],vis[1001]; inline int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f; } bool find(int x){ for(int i=0;i<=n-1;i++){ if(!vis[i]&&f[x][i]){ vis[i]=1; if(!lk[i]||find(lk[i])){ lk[i]=x;return 1; ......
阅读全文
  • 12月
  • 24日
综合 ⁄ 共 4281字 评论关闭
every list item is created in the list adapter’s getView method, and this method is called whenever you scroll the list to see more items. We could use this method to spawn a thread that downloads the image thumbnail because if we were to do it in place then getView would block. A commonly used kind of thread pool is one that manages a fixed number of threads that execute tasks posted to a shared queue. First, the movie_item.xml layout because we need an ImageView next to the movie ti......
阅读全文
  • 12月
  • 08日
综合 ⁄ 共 2626字 评论关闭
Ext.onReady(function() { Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); // 使用表单提示 Ext.QuickTips.init(); Ext.form.Field.prototype.msgTarget = 'side'; // 根据Cookie里面存放的CSS style来动态改变id为text的样式 var file = Ext.state.Manager.get('style'); Ext.util.CSS.swapStyleSheet('test', 'resources/css/' + file); // 定义表单 var loginForm = new Ext.FormPanel({ labelAlign : 'top', frame : true, monitorValid : true,// 把有formBind:true的按钮和验证绑定 ......
阅读全文
  • 11月
  • 23日
综合 ⁄ 共 3107字 评论关闭
  Bicoloring  In 1976 the ``Four Color Map Theorem" was proven with the assistance of a computer. This theorem states that every map can be colored using only four colors, in such a way that no region is colored using the same color as a neighbor region. Here you are asked to solve a simpler similar problem. You have to decide whether a given arbitrary connected graph can be bicolored. That is, if one can assign colors (from a palette of two) to the nodes in such a way that no two ......
阅读全文
  • 10月
  • 28日
综合 ⁄ 共 2318字 评论关闭
Django默认会在配置文件setting.py的TEMPLATE_LOADERS中开启'django.template.loaders.filesystem.Loader',开启该选项后可以按照TEMPLATE_DIRS中列出的路径的先后顺序从中查找并载入模板。 比如有如下配置: TEMPLATE_LOADERS = (     'django.template.loaders.filesystem.Loader', ) TEMPLATE_DIRS = (     '/var/www/site/mycitsm/mycitsm/templates',     '/var/www/site/mycitsm/sqlreview/templates', ) 现在TEMPLATE_DIRS中指定的两个目录中均存在base.html,渲染模板的语句为 return render(request, 'base.html',context......
阅读全文