现在位置: 首页 > fApdLWyDeZ发表的所有文章
  • 08月
  • 15日
综合 ⁄ 共 1754字 评论关闭
在使用MySQL的时候,在操作不当时,很容易出现 ERROR 1005 (HY000): Can't create table 这类错误。很多站长朋友可能需要排查很久才会找到问题的原因其实很简单,希望这篇文章可以对站长朋友以及Mysql初学者一点帮助。 MySQL官方提供的问题原因: 在信息中有一组【LATEST FOREIGN KEY ERROR】会有最近错误的详细描述和解决办法。 Cannot find an index in the referenced table where the referenced columns appear as the first columns, or column types in the table and the referenced table do not match for constraint......
阅读全文
  • 04月
  • 19日
综合 ⁄ 共 363字 评论关闭
http://www.1point3acres.com/bbs/thread-37291-1-1.html int sum(int a, int b, int c) {     int two = (a | b | c) & ~(a ^ b ^c);//(a|b|c)表示这三个数只要有一个位上为1,则为1;a^b^c 只保留了奇数个1的位,取反,就是有偶数个1的位,比如0个1或者2个1;最后的式子只保留两个1的位     int three = a & b & c;//保留三个1的位     int one = (a|b|c) ^ two ^ three;//只剩下 只有1个1的位     return (one | three) + ((two | three) <<1);// } 如何只用位运算实现两数相加 int sum(int a, int b) { ......
阅读全文
  • 02月
  • 11日
综合 ⁄ 共 807字 评论关闭
给出一个数环,求最大子段和。 扩展数环为两倍,相当于求固定长度为n的子段和。 保证队列内部元素为单增且距离不超过n,最优解必然是队尾减去队首。 比赛的时候不知道为啥wa成狗了。。大概是忘记把数组开成两倍大小了吧。。 #include <algorithm> #include <stdlib.h> #include <string.h> #include <iostream> #include <stdio.h> #include <math.h> using namespace std; #define MAXN 1000010 #define max(a, b) ((a) > (b) ? (a) : (b)) #define suc(x, k) (((x) > (k)) ? ((x) - ......
阅读全文
  • 11月
  • 09日
移动开发 ⁄ 共 4887字 评论关闭
英文 http://dev.chinamobile.com/cmdn/bbs/thread-13718-1-1.html 如果你有兴趣为Android平台开发游戏,有很多你需要了解的东西。我是Light Racer,Light Racer 3D以及Wixel的开发者,这些游戏目前在Android Market上有售。我以前也开发过游戏,但Light Racer是我的第一个Android应用程序,我从中学到了很多Android游戏开发知识,也愿意与诸位分享。我甚至写了一本在线的书详细介绍了Light Racer3D的开发,内容全是教你怎样做以及有用的代码片段。如果你有过游戏开发经验,那么转移到移动平台上来将不是特别困难。你主要只需学习......
阅读全文
  • 05月
  • 20日
综合 ⁄ 共 10921字 评论关闭
1、基本的动画效果 2、淡入淡出的动画效果 3、滑动效果 4、自定义的动画效果 基本的动画效果指的就是元素的隐藏和显示。在jQuery中提供了两种控制元素隐藏和显示的方法,一种是分别隐藏和显示匹配元素,另一种是切换元素的可见状态,也就是如果元素是可见的,切换为隐藏;如果元素是隐藏的,切换为可见的。     1.隐藏匹配元素     使用hide()方法可以隐藏匹配的元素。hide()方法相当于将元素CSS样式属性display的值设置为none,它会记住原来的display的值。hide()方法有两种语法格式,一种是不带参数的形式,用于实现不带任何......
阅读全文
首先从字面上理解,分别是:选择、点击和触摸,但是在实际中该如何使用呢?笔者在刚刚学习的时候,傻傻分不清,后来在学习群中得到帮助,现在和需要的你分享一下下。 现在做android开发的,所使用的不论是真机还是模拟机,都是触屏交互的,在这里当选择或点击或触摸某个Item时,前后这些操作的先后顺序是:触摸→点击或选择;那么点击和选择的区分呢?在android手机设备中还真分不清,但是在android电视设备中,使用遥控器选择Item与点击Item的时候,这下区分明白了吧!所以在android手机设备中,推荐使用点击,因为笔者在学习的时......
阅读全文
  • 05月
  • 14日
综合 ⁄ 共 2013字 评论关闭
http://www.soasp.net/FilePage/200804/20080404132503.htm 关于钩子请参见微软中国社区中《HOOK专题》一文。 纯C#钩子(Hook)实现 要实现系统钩子其实很简单,调用三个Win32的API即可。SetWindowsHookEx 用于设置钩子。(设立一道卡子,盘查需要的信息)         [DllImport( "user32.dll", CallingConvention = CallingConvention.StdCall )]        public static extern IntPtr SetWindowsHookEx ( WH_Codes idHook, HookProc lpfn,            IntPtr pInstance, int threadId ); CallNextHookEx 用于传递钩子(消息是重......
阅读全文
  • 04月
  • 21日
综合 ⁄ 共 1446字 评论关闭
#include <stdio.h>     /* for printf */ #include <stdlib.h>    /* for exit */ #include <getopt.h> int main(int argc, char **argv) {     int c;     int digit_optind = 0;     while (1) {         int this_option_optind = optind ? optind : 1;         int option_index = 0;         static struct option long_options[] = {             {"add", 1, 0, 0},             {"append", 0, 0, 0},             {"delete", 1, 0, 0},             {"verbose", 0, 0, 0},             {"create", 1, ......
阅读全文
  • 04月
  • 03日
综合 ⁄ 共 1882字 评论关闭
题意:给定一个有向图,问从起点到终点,最短路+比最短路距离长1的路的个数。 思路:最短路+次短路。 #include <iostream> #include <cstdio> #include <algorithm> #include <string> #include <cmath> #include <cstring> #include <queue> #include <set> #include <vector> #include <stack> #include <map> #include <iomanip> #define PI acos(-1.0) #define Max 10005 #define inf 1<<28 #define LL(x) (x<<1) #define RR(x)(x<&......
阅读全文
  • 02月
  • 09日
综合 ⁄ 共 2756字 评论关闭
查看tomcat的日记文件,看下如下信息,不知哪位大侠知道为什么会产生这样的信息; 2013-7-14 6:00:14 org.apache.coyote.http11.Http11Protocol pause 信息: Pausing Coyote HTTP/1.1 on http-8088 2013-7-14 6:00:15 org.apache.catalina.core.StandardService stop 信息: Stopping service Catalina 2013-7-14 6:00:15 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc 严重: The web application [/dmscs] registered the JDBC driver [oracle.jdbc.driver.OracleDriver] but failed to unregister it when......
阅读全文
  • 01月
  • 30日
综合 ⁄ 共 1009字 评论关闭
char dec2hexChar(short int n) { if ( 0 <= n && n <= 9 ) {  return char( short('0') + n ); } else if ( 10 <= n && n <= 15 ) {  return char( short('A') + n - 10 ); } else {  return char(0); }} short int hexChar2dec(char c) { if ( '0'<=c && c<='9' ) {  return short(c-'0'); } else if ( 'a'<=c && c<='f' ) {  return ( short(c-'a') + 10 ); } else if ( 'A'<=c && c<='F' ) {  return ( short(c-'A') + 10 ); } else {  return -1; }......
阅读全文
  • 01月
  • 29日
综合 ⁄ 共 1551字 评论关闭
要区分MoveWindow和setwindowpos的区别,我们先从msdn上入手: 1、MoveWindow This function changes the position and dimensions of the specified window. For a top-level window, the position and dimensions are relative to the upper-left corner of the screen. For a child window, they are relative to the upper-left corner of the parent window's client area. BOOL MoveWindow( HWND hWnd, int X, int Y, int nWidth, int nHeight, BOOL bRepaint ); MoveWindow sends WM_WINDOWPOSCHAN......
阅读全文