现在位置: 首页 > muziqiushan发表的所有文章
  • 04月
  • 12日
综合 ⁄ 共 3605字 评论关闭
Crazy Search Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 1611    Accepted Submission(s): 586 Problem Description Many people like to solve hard puzzles some of which may lead them to madness. One such puzzle could be finding a hidden prime number in a given text. Such number could be the number of different substrings of a given size that exist in the text. As you soon will discover, you really need the help of a computer and ......
阅读全文
  • 04月
  • 02日
算法 ⁄ 共 2650字 评论关闭
学习了!! 原文地址:poj 2777 : Count Color (线段树)作者:依然 题意:长度为n(1~100000)个单位的画板,有t(1~30,位运算的可能性)种颜料。现在叫你完成m组操作:       1. "C A B C" Color the board from segment A to segment B with color C.       2. "P A B" Output the number of different colors painted between segment A and segment B (including).   思路:很经典的线段树。学习到了很多的新知识,最重要的是三点:1.延迟覆盖的操作。2.位操作,用 | 来合并颜色种类。3.updata操作时递归回来,两个子节点......
阅读全文
  • 03月
  • 11日
综合 ⁄ 共 2861字 评论关闭
TERM Session Session is considered an exchange of data between anassociation of participants. SIP SIP is an application-layer control protocol that canestablish, modify, and terminate multimedia sessions that works independentlyof underlying transport protocols and without dependency on  the type of session that is beingestablished. Transaction Each transaction consists of a request that invokes aparticular method, or function, on the server and at least one response. SIP Layers Syntax an......
阅读全文
  • 09月
  • 21日
综合 ⁄ 共 1768字 评论关闭
//文件路径浏览对话框参考:http://blog.csdn.net/liuwumiyuhuiping/article/details/7348591 void CMainFrame::OnFileCopySave() { // TODO: Add your command handler code here CString pzFullPath; CString pzNewBasePath; CString pzNewProjName; //AfxMessageBox("项目另存为"); CString filter; filter="电气数据(*.grid)|*.grid||"; CFileDialog dlg(FALSE,_T("grid"),_T("项目备份"),OFN_HIDEREADONLY,filter); if(dlg.DoModal()==IDOK) { pzFullPath=dlg.GetPathName(); //MessageBox(pzFullPath); pz......
阅读全文
swift手写代码的页面跳转效果~  let sec=SECViewController.alloc()//实例化 sec.modalTransitionStyle=UIModalTransitionStyle.CrossDissolve//页面跳转效果,可以选择其他的CoverVertical,FlipHorizontal等等 self .presentViewController(sec, animated: true, completion: nil)//页面跳转~
阅读全文
  • 05月
  • 22日
综合 ⁄ 共 609字 评论关闭
  布局文件 <EditText android:id="@+id/factorOne" android:layout_width="fill_parent" android:layout_height="wrap_content" />   id 控件的ID ,在ACTIVITY 中可以通过R.id.myid得到控件  textView = (TextView)findViewById(R.id.myResultTextView);     public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.result); textView = (TextView)findViewById(R.id.myResultTextView); Intent intent = ge......
阅读全文
  • 05月
  • 13日
综合 ⁄ 共 1308字 评论关闭
python里面使用try-except-else-finally来处理异常,流程是:先处理try内的部分,有异常则进入except分支,否则进入else分支,但不管有无异常肯定会进入finally分支。这里结合以前java处理异常的流程,写了几个例子,做一个总结: ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #test 1 def main():     try:         print "In try block"         raise "exception"     except:         print "In exception block"     else:         print "......
阅读全文
  • 05月
  • 10日
综合 ⁄ 共 121字 评论关闭
实现非常简单,就是用一个动态的进度图片,在加载前图片是显示的,在success的回调函数里把图片隐藏掉 下面上图片,代码就不用了 动态图片地址,里面有很多的喔 http://www.lanrentuku.com/gif/a/loading.html
阅读全文
  • 04月
  • 30日
综合 ⁄ 共 846字 评论关闭
程序:public class TestEmail {public static void main(String[] args) {BufferedReader br = null;try {br = new BufferedReader(new FileReader("g:/test/01.htm"));String str = null;StringBuilder sb = new StringBuilder();try {while((str=br.readLine())!=null){sb.append(str);}List<String> es = getEmail(sb.toString());for(String e:es){System.out.println(e);}} catch (IOException e) {e.printStackTrace();}} catch (FileNotFoundException e) {e.printStackTrace();} finally {if(br!=null)try {br.clos......
阅读全文
  • 03月
  • 20日
综合 ⁄ 共 360字 评论关闭
/** * 验证邮箱格式是否正确 */ public boolean emailValidation(String email) { String regex = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"; return email.matches(regex); } 或者:   private boolean isValidEmail(String mail) {   Pattern pattern = Pattern     .compile("^[A-Za-z0-9][\\w\\._]*[a-zA-Z0-9]+@[A-Za-z0-9-_]+\\.([A-Za-z]{2,4})");   Matcher mc = pattern.matcher(mail);   return mc.matches();  }
阅读全文
  • 03月
  • 17日
综合 ⁄ 共 1606字 评论关闭
在公司实习一个多月后,终于能写一点有用的东西了,为了防止以后会忘记,先总结一下: 第一句:想学IT,和度娘说拜拜,投入谷歌的怀抱吧 首先这一个月学习以来发现几个很不错的学习资源: http://csdn.net  这个不用说,国内最大的IT学习网站,论坛和博客都能找到很有用的信息。但是又局限于我国IT发展的历史和水平,还是远远不够的 http://msdn.microsoft.com 因为现在是在windows下用VS编程,msdn无疑是最好的参考工具,绝大部分关于语法、基础知识方面的疑问和一些应用方面的疑问都可以得到很好的解答。问题是有很大部分都没......
阅读全文
  • 02月
  • 20日
综合 ⁄ 共 5126字 评论关闭
C语言文件操作解析(二)       本文转自:http://www.cnblogs.com/dolphin0520/archive/2011/10/05/2199598.html        C语言中对文件进行操作必须首先打开文件,打开文件主要涉及到fopen函数。fopen函数的原型为        FILE* fopen(const char *path,const char *mode)        其中path为文件路径,mode为打开方式        1)对于文件路径,只需注意若未明确给出绝对路径,则默认该文件在工程的目录下。若需给出绝对路径,则注意转义字符'\',比如有文件test.txt存放在C盘根目录下,则文件路径参数值应为C:\\test.txt。        2)......
阅读全文