现在位置: 首页 > avert发表的所有文章
  • 08月
  • 27日
综合 ⁄ 共 688字 评论关闭
typedef NS_ENUM(NSInteger, NSPUIImageType) { NSPUIImageType_JPEG,   NSPUIImageType_PNG,   NSPUIImageType_Unknown }; static inline NSPUIImageType NSPUIImageTypeFromData(NSData *imageData) { if (imageData.length > 4) { const unsigned char * bytes = [imageData bytes]; if (bytes[0] == 0xff && bytes[1] == 0xd8 && bytes[2] == 0xff) { return NSPUIImageType_JPEG; } i......
阅读全文
  • 10月
  • 14日
综合 ⁄ 共 2923字 评论关闭
时间 - 摘自《德鲁克管理思想精要》第16章 掌握自己的时间 知识工作者的工作计划很少有能够真正发生作用的。计划通常只是纸上谈兵,或只是良好的意愿而已,很少能够真正实现。 根据我的观察,有效的知识工作者并不是一开始就着手工作,他们往往会从时间安排上着手。他们并不以计划为起点,认识清楚自己的时间用在什么地方才是起点。然后,他们管理自己的时间,减少非生产性工作所占用的时间。最后,再将“可自由运用的时间”,由零星的集中成大块连续性的时段。这3个步骤是知识工作者实现有效性的基础: • 记录时间; • 管理时间......
阅读全文
  • 05月
  • 25日
综合 ⁄ 共 491字 评论关闭
    华科的这道考研上机题的大意是,给一个字符串,计算每个字符的二进制表示中的1的个数,如果有奇数个1,则奇偶位为0, 偶数个1,则奇偶位为1。     题目URL:http://ac.jobdu.com/problem.php?id=1197     我的AC代码:     #include <iostream> #include <stdio.h> using namespace std; const int Max = 100 + 10; char d[Max]; int main() { int pos, ones; while(scanf("%s", d) != EOF) { pos = ones = 0; while(d[pos]) { ones = 0; for(in......
阅读全文
  • 05月
  • 07日
综合 ⁄ 共 839字 评论关闭
在使用springmvc时,都会在web.xml中配置一个dispatchservlet,如下: <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <!-- Spring MVC Servlet --> <servlet> <servlet-name>servletName</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <load-on-startup>......
阅读全文
  • 04月
  • 23日
综合 ⁄ 共 1594字 评论关闭
水题,暴力枚举,但是wa了好多次,有数组开小了,还有边界处理问题,各种囧 code /* ID: yueqiq PROG: ariprog LANG: C++ */ #include <set> #include <map> #include <ctime> #include <queue> #include <cmath> #include <stack> #include <limits> #include <vector> #include <bitset> #include <string> #include <cstdio> #include <cstring> #include <fstream> #include <string.h> #include <iostream> #include <algori......
阅读全文
  • 12月
  • 09日
综合 ⁄ 共 3855字 评论关闭
原文地址:http://www.linuxsky.org/doc/admin/200803/262.html 一、链的基本操作 1、清除所有的规则。 1)清除预设表filter中所有规则链中的规则。 # iptables -F 2)清除预设表filter中使用者自定链中的规则。 #iptables -X #iptables -Z 2、设置链的默认策略。一般有两种方法。 1)首先允许所有的包,然后再禁止有危险的包通过放火墙。 #iptables -P INPUT ACCEPT #iptables -P OUTPUT ACCEPT #iptables -P FORWARD ACCEPT 2)首先禁止所有的包,然后根据需要的服务允许特定的包通过防火墙。 #iptables -P INPUT DROP #iptable......
阅读全文
  • 12月
  • 03日
综合 ⁄ 共 3874字 评论关闭
8005,8012     代表没有在DOS下运行Ghost;  8006,8007,8008   代表试用版的Ghost过期;  10002         你试图在试用版的Ghost中注册;  10003,10009,10012,10016,10018,10030   代表Ghost找不到多点传送服务器  10098,12412     你输入的批次指令缺少分区代号  11010,10013,10014,10016,10017,10019,10032,10041,10042,11000   路径或文件名不对  14030         没有注册的Ghost试用期已过  15150         镜像文件出错,很可能是文件坏  15170         无法格式化你的硬盘。  19900,19901     多点传送没有正确设定    8004 Th......
阅读全文
  • 10月
  • 14日
综合 ⁄ 共 1221字 评论关闭
private static byte hexValueOf(String hex) { byte result = 0; if (hex.charAt(0) == '0' && (hex.charAt(1) == 'X' || hex.charAt(1) == 'x')) { for (int i = 2; i < hex.length(); i++) { char temp = hex.charAt(i); if (i == 2) { if (temp == '0' || temp == '1' || temp == '2' || temp == '3' || temp == '4' || temp == '5' || temp == '6' || temp == '7') { result += Byte.valueOf(temp + "") * 16; } } else { if (temp == '0' || temp ==......
阅读全文
  • 10月
  • 06日
综合 ⁄ 共 3549字 评论关闭
方法一:使用API:WideCharToMultiByte进行转换 view sourceprint? 01.#include <afx.h> 02.  03.int _tmain(int argc, _TCHAR* argv[]) 04.{ 05.CString cstr = _T("test测试"); 06.  07.//获取宽字节字符的大小,大小是按字节计算的 08.int len = WideCharToMultiByte(CP_ACP,0,cstr,cstr.GetLength(),NULL,0,NULL,NULL); 09.  10.  11.//为多字节字符数组申请空间,数组大小为按字节计算的宽字节字节大小 12.char * pbuffer = new char[len+1];   //以字节为单位 13.  14.  15.//宽字节编码转换成多字节编码 16.Wid......
阅读全文
  • 12月
  • 10日
综合 ⁄ 共 1768字 评论关闭
在自己的项目中显示了一个基础的地图MapView控件之后  我们可以对该View控件进行一些操作   操作地图 :   初始化SDK以及找到控件 SDKInitializer.initialize(getApplicationContext()); MapView  mMapView = (MapView) findViewById(R.id.bmapView); 得到BaiduMap对象 官方文档描述的是 : 该类是地图对象的操作方法与接口 BaiduMap  mBaiduMap = mMapView.getMap(); 通过View控件的getMap方法得到BaiduMap对象 通过BaiduMap对象设置地图的一些属性,比如:     // 定义中心点(哈尔滨中央大街的经纬)   LatLn......
阅读全文
  • 10月
  • 22日
综合 ⁄ 共 538字 评论关闭
#include using namespace std; int main(){ int n,m,c,nu=1; while(cin>>n>>m>>c&&n>=1&&n<=20&&m&&c){ int d[25][2]={0},t,sum=0,max=0,flag=0; for(int i=1;i<=n;i++)  cin>>d[i][0]; for(int i=1;i<=m;i++) { cin>>t; if(flag) continue; if(d[t][1]==0&&sum+d[t][0]<=c){ sum+=d[t][0]; if(max d[t][1]=1; } else if(d[t][1]==0&&sum+d[t][0]>c){ flag=1; } else if(d[t][1]==1){  sum-=d[t][0];  d[t][1]=0; }  }     c......
阅读全文
今天tom猫案例效果: (1)最傻最笨的办法: ——所有的点击都是按钮,只不过有6个有图标的按钮,有些头部、左右脚、肚子、尾巴那块也是一个按钮,只不过没背景没文字没边框的按钮用户按不到而已。 ——这里的帧动画核心是UIImageView对象的一个属性animationImages,这个属性里面是以数组形式存放的图片。当然还有个重要的方法startAnimating用来播放前面那个属性里面的图片,就形成动画。再当然一下,还有设置时间和播放次数的属性。 注意点: ——我们一般把图片放在Images.xcassets里面,而且无论是png格式还是jpg格式貌似都可以......
阅读全文