现在位置: 首页 > convict发表的所有文章
1:进入cmd 2:命令:mysql -u root mysql 回车 3:命令:update user set password=password('新密码') where user='root';最后分号不要丢 4:命令:flush privileges; 5: 重启mysql 图:
阅读全文
  • 12月
  • 28日
综合 ⁄ 共 539字 评论关闭
题意:给出一些危险小行星的位置,一次能消灭一行或一列的小行星,为最少多少次能消灭完。 思路:就是行跟列的最大匹配. #include<stdio.h> #include<string.h> const int N=510; int map[N][N],match[N],link[N],n; int find(int i) { int j; for(j=1;j<=n;j++) { if(map[i][j]==1&&link[j]==0) { link[j]=1; if(match[j]==-1||find(match[j])==1) { match[j]=i; return 1; } } } return 0; } int main() { int i,k,x,y,sum; while(scanf("%d%d",&n,&k)!=-1......
阅读全文
  • 09月
  • 10日
综合 ⁄ 共 666字 评论关闭
module ActivityMethods     def self.included(base)       base.send :include, InstanceMethods       base.has_many :activity_memberships       base.has_many :members, :through => :activity_memberships, :source => :user     end end :source Specifies the source association name used by has_many :through queries. Only use it if the name cannot be inferred from the association. has_many :subscribers, :through => :subscriptions will look for either :subscribers or :subscriber on Subscr......
阅读全文
  • 07月
  • 17日
综合 ⁄ 共 737字 评论关闭
参考:http://android.tgbus.com/Android/tutorial/201103/347527.shtml 在实际开发中,LayoutInflater是非常有用的,类似于findViewById,不同的是,LayoutInflater是用来查找layout文件夹下的.xml布局文件的,并且实例化。 而findViewById是查找xml下的具体widget控件。 用法: private LinearLayout mContentLogin; private LayoutInflater inflater; private Context mContext; public ContentLogin(Context context) { mContext = context; context = null; inflater = LayoutInflater.from(mContext); mContentLogin =......
阅读全文
  • 04月
  • 13日
综合 ⁄ 共 9833字 评论关闭
智能指针算是很多人喜欢思考的一种内存管理方案了...虽然这种方案本身存在一些硬伤,但是在很多需要智能,且使用方式相对较简单的场合里应用还是比较多的. 先发一个我最初写好的版本: ////////////////////////////////////////////////////////////////// // TSmartPtr - 智能指针类模板 // // Author: 木头云 // Blog: http://hi.baidu.com/markl22222 // E-Mail: mark.lonr@tom.com // Version: 1.0.819.1654(2009/08/19) // // History: // - 1.0.813.1148(2009/08/13) @ 完成基本的类模板构建 // - 1.0.814.1758(2009/08/14) + ......
阅读全文
  • 04月
  • 05日
综合 ⁄ 共 1722字 评论关闭
poj 1177   http://acm.pku.edu.cn/JudgeOnline/problem?id=1177   求N 个矩形并的边的周长。用离散话通过了,还不知道如果用线段树做,在学习中ing , 发现自己好菜。   #include "iostream" #include "cstdlib" #include "cstdio" #include "algorithm" using namespace std; const int MaxN = 5010; int X[MaxN << 1], Y[MaxN << 1]; int XX[MaxN << 1], YY[MaxN << 1]; int x1,x2,y1,y2; int N; typedef struct superSeg{ int x1,x2,y; bool ceil; void insert(int _x1,int _x2,int _y, bool _ce......
阅读全文
  • 04月
  • 02日
综合 ⁄ 共 705字 评论关闭
系统情况: Win7 + Mac10.9.5 + Clover 我要达到的目标是:默认进入Windows系统,如果有需要,可以选择进入其他系统,如Mac OS X 我原以为可以在clover中配置,达到这个目标,可是我经过多次实践,没有一次成功的,最后只能放弃。   通过与群友的交流,这个目标算是实现了,但不是通过配置clover,方法如下: 1. 进入bios,将第一启动项选择为:Windows Boot Manager,这样,就可以实现默认进入windows了。 2. 要想进入Mac系统,我在启动后,不停按快捷键,我的电脑是F8,然后就能出现引导选择界面,如图,选中你要的并回车。   ......
阅读全文
  • 04月
  • 02日
综合 ⁄ 共 2444字 评论关闭
背景 由于项目中mysql的日志格式只能选用MIXED格式(binlog存在一定的局限性,请参考),因此需要解析SQL语句。 在查找的SQL语句处理器中,都有一定的局限性,而所选中,其中一个基于javacc实现的解析器JSqlParser,使用起来方便,而且代码结构模块很好,基于其重构也比较简单。 虽然项目很久没更新与维护了,基于其改造也可以接受,因此选用了JSqlParser,而这也有了后面的SQL解析器的改造。 javacc简单的介绍 JavaCC 是一个代码生成器,可以根据输入的语言定义输出一个词法分析器和解析器,JavaCC 输出的代码是合法的可编译Java代......
阅读全文
  • 03月
  • 31日
综合 ⁄ 共 6455字 评论关闭
    在main.xml中:   <?xml version="1.0" encoding="utf-8"?> <LinearLayout   xmlns:android="http://schemas.android.com/apk/res/android"   android:orientation="vertical"   android:layout_width="fill_parent"   android:layout_height="fill_parent"   android:gravity="center_horizontal"   android:background="#3399ff">   <TableLayout     xmlns:android="http://schemas.android.com/apk/res/android"      android:orientation="vertical"      android:layout_width="fill_parent"      andr......
阅读全文
  • 01月
  • 26日
综合 ⁄ 共 562字 评论关闭
脚本的基本框架 脚本结构 Example: class iPhoneTestCase(iPhoneTestBaseCase):       def__init__(self):        iPhoneTestBaseCase.__init__(self)         self.m_MID = 6011         self.m_CID = 7706         self.m_AUTHOR="TaoFang"        pass         defOnSetUp(self):         self.m_iPhoneList= [deviceiPhone01,deviceiPhone02]         pass         defOnTearDown(self):        TALog('CaseResult=Pass')         pass         defOnFail(self):        TALog('CaseResult=Failed')         sys.e......
阅读全文
  • 01月
  • 24日
综合 ⁄ 共 14668字 评论关闭
Oracle 自10g 以后,企业管理器(Oracle Enterprise Manager:OEM)变成了网页形式。 OEM 分两种:Grid Control(网格控制) 和 Database Control(数据库控制)。  Grid Control 是具有完整功能的全企业Oracle 生态系统管理工具。  Database Control是可以只作为数据库管理实用程序部署的OEM 版本。 Grid Control 和 Database Control 区别: Grid Control 可以监控整个Oracle 生态环境,它具有一个中心存储仓库,用于收集有关多个计算机上的多个目标的数据,并且提供一个界面来显示所有已发现目标的共同信息。 Database Co......
阅读全文
  • 01月
  • 11日
综合 ⁄ 共 1229字 评论关闭
说明: 三色旗的问题最早由 E.W.Dijkstra所提出,他所使用的用语为 Dutch Nation Flag(Dijkstra为荷兰 人),而多数的作者则使用Three-Color Flag来称之。 假设有一条绳子,上面有红、白、蓝三种颜色的旗子,起初绳子上的旗子颜色并没有顺序,您 希望将之分类,并排列为蓝、白、红的顺序,要如何移动次数才会最少,注意您只能在绳子上 进行这个动作,而且一次只能调换两个旗子。   解法:在一条绳子上移动,在程式中也就意味只能使用一个阵列,而不使用其它的阵列来作辅助,问 题的解法很简单,您可以自己想像一下在移动旗子,从绳......
阅读全文