现在位置: 首页 > claret发表的所有文章
  • 09月
  • 14日
移动开发 ⁄ 共 1088字 评论关闭
有如下代码: 运行run lint: This Handler class should be static or leaks might occur (com.example.boyaa.MainActivity.1) Issue: Ensures that Handler classes do not hold on to a reference to an outer class Id: HandlerLeak In Android, Handler classes should be static or leaks might occur. Messages enqueued on the application thread's MessageQueue also retain their target Handler. If the Handler is an inner class, its outer class will be retained as well. To avoid leaking the outer class, ......
阅读全文
  • 08月
  • 30日
综合 ⁄ 共 2249字 评论关闭
题意:一棵n个结点的有根树(1 <= n <= 200),问最多能找出多少个结点使得找出的结点中任意两个结点没有直接相连的父子关系,并判断这个最大值方案是否唯一。 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2412 ——>>状态: dp[i][1]表示以结点 i 为根的子树,且选择i,能找出的满足要求的最大结点数。 dp[i][0]表示以结点 i 为根的子树,且不选择i,能找出的满足要求的最大结点数。 状态转移方程(结点 j 是结点 i 的儿子): dp[i][1] += dp[j][0]; dp[i][0] += max(dp[j][1], dp[j][0]); 状态: bUnique[i][......
阅读全文
  • 08月
  • 22日
综合 ⁄ 共 11191字 评论关闭
    各方面的好书,不代表我都看过。后面的是阅读难度和推荐程度,单单只是个人感觉而已。可能会有被我遗忘的书希望大家提醒C、C++:        语法基础:                C程序设计语言 第二版         ☆                 ◆◆◆◆◆◆                        C语言之父的书,不用多说。(C语言之父不是谭浩强)                 C Primer Plus 第五版            ☆☆             ◆◆◆◆◆                 C++ Primer Plus 第五版      ☆☆              ◆◆◆◆◆                 C++编程思想                          ☆☆☆☆      ◆◆◆◆......
阅读全文
  • 05月
  • 27日
综合 ⁄ 共 2999字 评论关闭
#include <windows.h>LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow)...{    static TCHAR szAppName[] = TEXT("Bezier");    HWND        hwnd;    MSG            msg;    WNDCLASS    wndclass;    wndclass.style            = CS_HREDRAW | CS_VREDRAW;    wndclass.lpfnWndProc    = WndProc;    wndclass.cbClsExtra        = 0;    wndclass.cbWndExtra        = 0;    wndclass.hInstance        = hIn......
阅读全文
  • 05月
  • 26日
综合 ⁄ 共 4414字 评论关闭
来源:http://tieba.baidu.com/p/1084211586 本次技能ID大全共收录ID368条 不包括重复的ID,物品类技能的ID使用必须将物品技能单独抽离出来并设置“物品技能=false”,拥有命令字符串的物品请参考拥有相同字符串的4族+中立技能。 P.S所有ID都是按照从小到大的顺序排列的。 收录整理者:najizhimo、卢天罡/勇烈文台、ReviveFullHP、821251400 注意如果ID结尾出现one,是因为百度的敏感词nine one eight(隔2个汉字加回车都能检测出来真牛B),自己翻译成1就是。 人族: 人族建筑菜单851995 激活修理852025 取消修理852026 激活......
阅读全文
  • 05月
  • 22日
综合 ⁄ 共 860字 评论关闭
1.选择“工具箱”,单击鼠标右键,在弹出的快捷菜单中选择“选择项”。 2.弹出“选择工具箱项”对话框,选择“COM组件”选项卡。 3.在COM组件列表,单击[浏览]按钮,在对话框中选择"C:\Windows\System32\Macromed\Flash\Flash10h.ocx"。(版本可能有细微差别)  在工具箱的容器面板里有个MacroMedia Flash Factory Object   而且自动添加了引用AxShockwaveFlashObjects, ShockwaveFlashObjects   如果工具箱中已经有了,可以删除重新添加,以便自动添加引用。 在放入窗体中时报错“未能导入ActiveX 控件。请确保它已正确注册”. 所以手动......
阅读全文
  • 05月
  • 20日
综合 ⁄ 共 5691字 评论关闭
Hibernate复合主键映射 目录: 1. 实现方式一:将复合主键对应的属性与实体其他普通属性放在一起 2. 实现方式二:将主键属性提取到一个主键类中,实体类只需包含主键类的一个引用     在日常开发中会遇到这样一种情况,数据库中的某张表需要多个字段列才能唯一确定一行记录,这时表需要使用复合主键。面对这样的情况Hibernate为我们提供了两种方式来解决复合主键问题。   方式一:将复合主键对应的属性与实体其他普通属性放在一起 例如实体类People中"id"和"name"属性对应复合主键: /*实体类,使用复合主键必须实现Serializab......
阅读全文
  • 05月
  • 18日
综合 ⁄ 共 602字 评论关闭
一般来说报错三酱紫的: error:failed to push some refs to ... Dealing with “non-fast-forward” errors From time to time you may encounter this error while pushing: $ git push origin master  To ../remote/   ! [rejected]        master -> master (non-fast forward)  error: failed to push some refs to '../remote/'  To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes before pushing again.  See the 'non-fast forward' section of 'git push --help' f......
阅读全文
  • 05月
  • 15日
综合 ⁄ 共 1036字 评论关闭
My darling, my lover, my beautiful wife:Marrying you has screwed up my life我的心肝,我的挚爱,我美丽的贤妻,我这辈子就毁在你手里。 I see your face when I am dreaming.That's why I always wake up screaming.你的容颜依稀入梦境,于是我在尖叫中惊醒。 Kind, intelligent, loving and hot;This describes everything you are not.善良、聪慧、多情而性感,可惜这些你一条都不占。 Love may be beautiful, love may be bliss,But I only slept with you 'cause I was pissed.爱是上天赐福,爱情多么美好,可我与你同眠......
阅读全文
  • 05月
  • 09日
综合 ⁄ 共 2291字 评论关闭
package com.secufity.aes; import java.util.UUID; import javax.crypto.Cipher; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; import com.secufity.db.Base64; /** * * @author wfung_kwok * */ public class AES { static String e = "9238513401340235"; // 加密 public static String Encrypt(String src, String key) throws Exception { if (key == null) { System.out.print("Key为空null"); return null; } // 判断Key是否为16位 if (key.length() !=......
阅读全文
  • 04月
  • 23日
综合 ⁄ 共 844字 评论关闭
背景:主要是熟悉bfs写法,虽然1Y,但是中间调试了几次,还是有小失误。看了@liujc的写法,dfs也可,但是感觉bfs效率高些? 我的代码: #include<cstdio> #include<iostream> #include<cstring> #include<queue> using namespace std; char diagram[109][109]; struct place{int x,y;}temp1,temp2; int dir[8][2]={1,0,-1,0,0,1,0,-1,1,1,1,-1,-1,1,-1,-1},n,m; void pond(int i,int j){ diagram[i][j]='.'; temp1.x=i; temp1.y=j; queue<place> q; q.push(temp1); wh......
阅读全文
  • 04月
  • 14日
综合 ⁄ 共 180字 评论关闭
有这样一个需求,需要对一个表中的某个字段分组后取第一条。 在mysql中select * from table group by field,可以直接实现此功能。 如果需要按某个字段排序后显示,可以对select * from table外面在封装一个结果集, 在这个结果集之后在进行group by。 在oracle中直接select * from table group by field会报错。
阅读全文