现在位置: 首页 > Estitruth发表的所有文章
在asp.net中,有的时候要动态变换CSS,比如有的时候做个性化页面,可以这样做 <head>     <link id="MyStyleSheet" rel="stylesheet" type="text/css" runat="server" />   </head>   之后,在要更换CSS的页面中,使用如下代码 Sub Page_Load(Sender As Object, E As EventArgs)           If Not (IsPostBack)      MyStyleSheet.Attributes.Add("href","/css/flostyle.css")      End If   Style与Attributes属性 1.Style属性  样式表(Cascading Style Sheets简称CSS)CSS通过其丰富的属性,将目标标......
阅读全文
  • 08月
  • 30日
综合 ⁄ 共 641字 评论关闭
题意:给出一个n*n的图,问这个图是否能由十字架拼成(3 ≤ n ≤ 100)。 题目链接:http://codeforces.com/problemset/problem/389/B ——>>最上面一行的#,一定是一个十字架的头部,判断该头部是否符合要求即可。 #include <cstdio> using namespace std; const int maxn = 100 + 10; char G[maxn][maxn]; int main() { int n; while(scanf("%d", &n) == 1) { int sum = 0; for(int i = 0; i < n; i++) { getchar(); for(int j = 0; j < n; j++) { ......
阅读全文
  • 08月
  • 21日
综合 ⁄ 共 1019字 评论关闭
相等的最小公倍数 Time Limit: 1000 MS Memory Limit: 65536 K Total Submit: 145(55 users) Total Accepted: 63(44 users) Rating:  Special Judge: No Description 定义An为1,2,…,n的最小公倍数,例如,A1 = 1,A2 = 2,A3 = 6,A4 = 12,A5 = 60,A6 = 60。 请你判断对于给出的任意整数n,An是否等于An – 1。 Input 本题有多组测试数据,输入的第一行是一个整数T代表着测试数据的数量,接下来是T组测试数据。 对于每组测试数据: 第1行 包含一个整数n (2 ≤ n ≤ 106)。 Output 对......
阅读全文
  • 04月
  • 27日
综合 ⁄ 共 4435字 评论关闭
学会用 perl -c 检查语法, perl -e 直接执行语句, perldoc 查看文档 , CPAN 查找 module ... 1)url 判断是否合法:   /^(http:\/\/|https:\/\/)?((?:[A-Za-z0-9]+-[A-Za-z0-9]+|[A-Za-z0-9]+)\.)+([A-Za-z0-9]+)[\/\?\:]?.*$/ 如果想不用\ 去转义 /, . , 等特殊字符,可以 /\Q$var\E/ 在用 =~ 判断字符串包含时,需要注意是否包含空格等字符,特别是从文件中读出的时候,还要注意文件中的空白行 $context =~ s/^\s*\n//mg;  Perl Code  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 my $file = "blacklist.txt";......
阅读全文
  • 06月
  • 09日
综合 ⁄ 共 66字 评论关闭
1. Input event ANR 5sed; 2.BroadCastReceiver ANR 10 sed; 3.Service ANR 20 sed;
阅读全文
  • 05月
  • 19日
综合 ⁄ 共 19464字 评论关闭
近来屡有网友提到一个旨在将Wineserver 移入内核的开源项目kernel-win32;有问及其 本身,希望能对其代码作一些分析、讲解的,也有问及兼容内核与此项目之间关系的。所以 从这篇漫谈开始就来谈谈kernel-win32。 首先,兼容内核项目应当从所有(能找到的)相关开源项目吸取营养,有时候甚至就采取 “拿来主义”,反正都是开源项目,只要遵守有关的规定就行。从这个意义上说,我们对于 kernel-win32 肯定要借鉴,也可能要“拿来”一些。但是这种借鉴和拿来的取舍必须以客观 的分析为基础,必须与我们的终极目标相一致。相信读者在看完从本......
阅读全文
  • 05月
  • 07日
综合 ⁄ 共 574字 评论关闭
store.js - 轻松实现本地存储(LocalStorage) store.js 是一个兼容所有浏览器的 LocalStorage 包装器,不需要Flashokie 或者 Flash 。store.js 会根据浏览器自动选择使用 localStorage、globalStorage 或者 userData 来实现本地存储功能 。 store.js 提供非常简洁的 API 来实现跨浏览器的本地存储功能:  复制代码 代码如下: store.set(username, marcus)  store.get(username)  store.remove(username)  store.clear()  store.set(user, { name: marcus, likes: javascript })  var user = store.get(user)  alert(user.name......
阅读全文
  • 04月
  • 19日
综合 ⁄ 共 284字 评论关闭
有时网上看到有的Word电子书的目录设置在左侧,既方便,又漂亮,于是自己也想这样做。具体的步骤是: 这个可以采用Word文档的文档结构视图的方法解决。如果想把目录在左边显示,可以点菜单 视图 -> 文档结构图    注:如果视图菜单中没有文档结构图,这是Word的菜单自动收缩功能,可以点视图菜单最下边的“ ˇ ”展开全部菜单,就可以找到文档结构图    如果文档结构图中的大纲显示不正确,还可以通过大纲工具栏按钮进行调整。打开大纲工具栏的方法, 点菜单中的 视图 -> 工具栏 ->大纲。具体的调整方法可以查看Word帮助,......
阅读全文
  • 04月
  • 12日
综合 ⁄ 共 2697字 评论关闭
Merge Intervals: Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18]. /** * Definition for an interval. * struct Interval { * int start; * int end; * Interval() : start(0), end(0) {} * Interval(int s, int e) : start(s), end(e) {} * }; */ class Interval_cmp:binary_function<Interval,Interval,bool> { public: bool operator()(const Interval& i1,const Interval&......
阅读全文
  • 02月
  • 21日
综合 ⁄ 共 2300字 评论关闭
Balance Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 11042   Accepted: 6855 Description Gigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance.  It orders two arms of negligible weight and each arm's length is 15. Some hooks are attached to these arms and Gigel wants to hang up some weights from his collection of G weights (1 <= G <= 20) knowing that these weights have distinct values in t......
阅读全文
  • 12月
  • 24日
综合 ⁄ 共 1574字 评论关闭
消息系统的基本原理 从一般的系统设计来讲,一个消息循环系统的建立需要有以下几个要素: 发送消息 消息队列 消息分发 消息读取 首先来研究一下消息驱动的基本模型,我使用如下的图形来表示一个消息系统最基本构成: 上面的模型代表应用程序一直查询自己的消息队列,如果有有消息进来,应用消息处理函数中根据消息类型及其参数来作相应的处理。 消息系统要运作起来,必定有消息的产生和消费。我们可以从下图看到消息生产和消费的一个基本的链条,这是一个最基本的,最简单的消息系统。 生产线程将消息发送到消息队列,消息消费者线......
阅读全文
  • 12月
  • 09日
综合 ⁄ 共 198字 评论关闭
UITextField监控输入文字变化方法 [self.textFeild addTarget:self action:@selector(textChangeAction:)  forControlEvents:UIControlEventEditingChanged]; - (void) textChangeAction:(id) sender { NSLog(@"%@",_textFeild.text); }
阅读全文