码迷,mamicode.com
首页 > 其他好文
JUnit4
JUnit4是JUnit框架有史以来的最大改进,其主要目标便是利用Java5的Annotation特性简化测试用例的编写。 先简单解释一下什么是Annotation,这个单词一般是翻译成元数据。元数据是什么?元数据就是描述数据的数据。也就是说,这个东西在Java里面可以用来和public、static等关键字一样来修饰类名、方法名、变量名。修饰的作用描述这个数据是做什么用的,差不多和publ...
分类:其他好文   时间:2015-01-26 17:10:07    阅读次数:157
1602液晶显示屏
#include #define uchar unsigned char #define uint unsigned int sbit rs=P3^5; sbit lcden=P3^4; sbit dula=P2^6; sbit wela=P2^7; uchar table1[]="TX-51STAR MCU"; uchar table2[]="WWW.TXMCU.COM"; void delay...
分类:其他好文   时间:2015-01-26 17:07:57    阅读次数:183
Easy Gesture Service
1. VirtualRecentService.java package com.jianli.virtualrecent; import java.lang.reflect.Field; import android.annotation.SuppressLint; import android.app.Activity; import android.app.Service; impor...
分类:其他好文   时间:2015-01-26 17:07:52    阅读次数:275
hdu 1059 Dividing 多重背包
Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same value, because then they could just split the collection ...
分类:其他好文   时间:2015-01-26 17:08:53    阅读次数:206
通过 Membership用户存储验证用户凭据,实现会员控制
对于使用表单身份验证的 web 网站来说 , 用户通过访问登录页面并输入自己的凭据来登录网站。系统会将用户输入的凭据与数据库中的内容相对比。如果凭据有效,则会授予该用户一个表单身份验证票证,该票证是一个安全令牌,用以指示该访问者的身份标识和真实性。 本文实例说明怎样吧验证工作委托给已配置的 Membership 提供者。...
分类:其他好文   时间:2015-01-26 17:08:00    阅读次数:221
hdu4009---Transfer water
Transfer water Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 3964    Accepted Submission(s): 1424 Problem Description XiaoA lives in ...
分类:其他好文   时间:2015-01-26 17:08:33    阅读次数:228
MessageBox函数在VC6与VS2010中的调用
MessageBox这个函数可以在VC里面显示一个标准对话框,是比较常用的一个信息对话框,其不仅能够定义显示的信息内容、信息提示图标,而且可以定义按钮组合及对话框的标题,是一个功能齐全的信息对话框。 函数原型及参数 int MessageBox(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT, uType); 参数含义: HWND ...
分类:其他好文   时间:2015-01-26 17:06:42    阅读次数:174
马踏棋盘递归所有解
这次马踏棋盘是用递归实现的,而且可以弄出来所有解,当时电脑跑的最快的都有40多万解了,这个也可以看你电脑cpu好坏,一般超级本跑不动。这是实际上和八皇后是同一种性质的问题,都用到了回溯的思想,有接进行下一个,不行了退回去,在进行尝试。不多说了,直接上代码;     #include #include #include #define N 8 int cnt=1; // 记录马的位置 i...
分类:其他好文   时间:2015-01-26 17:07:46    阅读次数:574
八皇后的问题
八皇后的问题和马踏棋盘的思路是一样,都用到了回溯的思想。代码也都差不多。这个里面最精彩的地方用4个一位数组表示了这个棋盘。这个里面总共有92组解             代码展示                       #include #include int col[8]={0}; int right[15]={0}; int left[15]={0}; int Queen[8]; i...
分类:其他好文   时间:2015-01-26 17:05:35    阅读次数:182
UVA 23 Out of 5(DFS+回溯)
Problem I 23 Out of 5 Input: standard input Output: standard output Time Limit: 1 second Memory Limit: 32 MB Your task is to write a program that can decide whether you can find an arithmetic ex...
分类:其他好文   时间:2015-01-26 17:07:04    阅读次数:183
setsockopt()用法
头文件:#include   #include 定义函数:int setsockopt(int s, int level, int optname, const void * optval, ,socklen_toptlen); 函数说明: s         :setsockopt()用来设置参数s 所指定的socket 状态. level   :参数level 代表欲设置的网络...
分类:其他好文   时间:2015-01-26 17:05:03    阅读次数:145
UVA How Big Is It? (DFS+回溯)
How Big Is It?  Ian's going to California, and he has to pack his things, including his collection of circles. Given a set of circles, your program must find the smallest rectangular box in...
分类:其他好文   时间:2015-01-26 17:05:21    阅读次数:265
POJ 2449 Remmarguts' Date【SPFA】【A*】
题目大意:公主要求王子通过第k短的路径去找她。给出了N个点,M条单向边的图。也给出了 起点s(王子所在的点)、终点t(公主所在的点)和k。问:K短路是多少。 思路:第一次做K短路的题目。用的A*+SPFA来做的。下边简单说下这个算法。 使用链式前向星存储图。安装下边步骤来做。 (1)将有向图的所有边正向、反向分别存入两个不同的边集(Edges,Edges1)中。用反向边集, 以所求终点t为源点,利用SPFA或Dijkstra求解出所有点到t的最短路径,用Dist[i]数组来表示点i 到点t的最短距离。 (2...
分类:其他好文   时间:2015-01-26 17:06:18    阅读次数:246
Climbing Stairs
题目: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? 我的解法: (1)算法思想: 问题可以...
分类:其他好文   时间:2015-01-26 17:04:06    阅读次数:200
Canvas---Canvas版画图、虚线、辅助线、线条颜色、线条宽度,整合加强版
使用Canvas实现画图程序。 本次更新主要实现了一下功能: 虚线实线的选择、辅助线、线条颜色选择、线条宽度选择 进一步整理了下代码,发现了不少很有用的写法,具体看下面。 canvas{ background-color: rg...
分类:其他好文   时间:2015-01-26 17:03:06    阅读次数:254
UVA The Sultan's Successors (八皇后问题)
The Sultan's Successors  The Sultan of Nubia has no children, so she has decided that the country will be split into up to k separate parts on her death and each part will be inherited by...
分类:其他好文   时间:2015-01-26 17:04:34    阅读次数:277
64位bitmap操作
#include #define set_bit1(x,y) (x|=(0x01L<<y)) #define set_bit0(x,y) (x&=(~(0x01L<<y))) #define get_bit(x,y) (x&(0x01L<<y)) int main() { int pos = 31; unsigned long bitmap = 0xffffff...
分类:其他好文   时间:2015-01-26 17:03:02    阅读次数:238
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!