现在位置: 首页 > lustre发表的所有文章
  • 11月
  • 09日
综合 ⁄ 共 862字 评论关闭
受此文启发,dijskstra的改动:http://blog.csdn.net/wangjian8006/article/details/7871812   #include<stdio.h> #include<string.h> #include<math.h> #define max(a,b) (a>b?a:b) double d[201]; typedef struct { int x,y; }n1; n1 point[201]; double distance(n1 a,n1 b) { return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)); } void dijskstra(int n) { double min; int vis[201],v,i; memset(vis,0,sizeof(vis)); for(i=2;i<=n;i++) d[i]=1e10; d[1]=0; d[1]=1; while(1) {......
阅读全文
  • 04月
  • 08日
综合 ⁄ 共 984字 评论关闭
大意:求一个序列的逆序数对数,然后把前i个元素移动到尾部去,然后求这些序列中最小的逆序数对数。 思路:利用时效性来求逆序数对数,可以达到O(nlogn)的时间复杂度。 #include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> #include <string> using namespace std; const int maxn = 5100; int sum[maxn<<2]; int x[maxn]; int n; int ql, qr; int p, v; void pushup(int o) { sum[o] = sum[o*2] + sum[o*2+1]; } void build(int o, int L, int R) { int M......
阅读全文
  • 02月
  • 14日
综合 ⁄ 共 1859字 评论关闭
Problem Description Today is army day, but the servicemen are busy with the phalanx for the celebration of the 60th anniversary of the PRC. A phalanx is a matrix of size n*n, each element is a character (a~z or A~Z), standing for the military branch of the servicemen on that position. For some special requirement it has to find out the size of the max symmetrical sub-array. And with no doubt, the Central Military Committee gave this task to ALPCs. A symmetrical matrix is such a matri......
阅读全文
  • 10月
  • 16日
综合 ⁄ 共 1836字 评论关闭
double转uint8 A是double型,先对A做一个截尾取整运算,然后再转换数据类型吧 A=fix(A);  AA=uint8(A);这样可能会好一点吧 或者 im2double():将图像数组转换成double精度类型 im2uint8():将图像数组转换成unit8类型 im2uint16():将图像数组转换成unit16类型 cell转uint8  %EO(1,1);为 1*1 cell 数值类型 >> sss = EO(1,1); >> mm = cell2mat(sss); %cell转double >> mm = fix(mm); >> mm= unit8(mm); axis equal:纵、横坐标轴采用等长刻度 sskkm是M*N矩阵 sskkmmm = unique(sskkm); sskkmmm是统计ssk......
阅读全文
  • 09月
  • 13日
综合 ⁄ 共 1059字 评论关闭
1 package JDBCDEMOS; 2 3 //import java.net.ConnectException; 4 import java.sql.DriverManager; 5 import java.sql.ResultSet; 6 import java.sql.SQLException; 7 import java.sql.Connection; 8 import java.sql.Statement; 9 10 //import com.mysql.jdbc.Statement; 11 12 public class JDBCDEMO1 { 13 public static final String DBDRIVER = "com.mysql.jdbc.Driver"; 14 public static final String DBURL = "jdbc:mysql://localhost:3306/test"; 15 public static final String DBUSER = "roo......
阅读全文
   在数字科技日新月异的今天,软件和硬件的完美结合,造就了智能移动设备的流行。今天大家对iOS和Android系统的趋之若鹜,一定程度上是由于这两个系统上有着丰富多彩的各种应用软件。因此,软件和硬件的关系,在一定程度上可以说,硬件是为软件服务的。硬件工程师研发出一款硬件设备,自然少了软件工程师为其编写驱动程序;而驱动程序的最终目的,是为了使得最上层的应用程序能够使用这些硬件提供的服务来为用户提供软件功能。对Android系统上的应用软件来说,就是要在系统的Application Frameworks层为其提供硬件服务。在前面的......
阅读全文
  • 06月
  • 08日
综合 ⁄ 共 5548字 评论关闭
转载自: http://www.cnblogs.com/yyangblog/archive/2011/03/10/1980086.html  monkeyrunner工具  前言: 最近开始研究Android自动化测试方法,对其中的一些工具、方法和框架做了一些简单的整理,其中包括android测试框架、CTS、Monkey、Monkeyrunner、benchmark、其它test tool等等。因接触时间很短,很多地方有不足之处,希望能和大家多多交流。 一、什么是monkeyrunner monkeyrunner工具提供了一个API,使用此API写出的程序可以在Android代码之外控制Android设备和模拟器。通过monkeyrunner,您可以写出一个Python程......
阅读全文
  • 05月
  • 05日
综合 ⁄ 共 2353字 评论关闭
        今天在网上搜了一下图形学里面比较常用的模型,觉得挺有意思,把它们收集起来,总结一下。 1、Lena/Lenna         这个模型是一个美女,名字叫Lena,是1972年11月《Playboy》(国内译为:花花公子)杂志的一个插图。不知道花花公子杂志为何物的请自己去百度。          Lena是瑞典人,根据英语标准发音,译为Lenna。下面来张截图:                  花花公子中的原图:http://www.ee.cityu.edu.hk/~lmpo/lenna/len_full.jpg         1973年6月,美国南加州大学的信号图像处理研究所的一个助理教授和他的一个研究生打算为了......
阅读全文
  • 02月
  • 09日
综合 ⁄ 共 218字 评论关闭
解决方案是: 第一步:删除已经生成缓存文件 路径:/search/data/news 提示:在/search/data/下有许多文件夹的情况,将其全部删除。第二步:清空phpcms_search数据表 执行SQL语句:truncate phpcms_search; 第三步:更新searchid为0 执行SQL语句:update phpcms_content set searchid='0';最后一步:更新URL后台内容管理=》生成HTML=》更新URL
阅读全文
  • 12月
  • 22日
综合 ⁄ 共 9186字 评论关闭
常见变换 MoveTo/MoveBy:位置变换(移动到某个位置/移动某个偏移量) RotateTo/RotataBy角度变换 RotateTo::create(2, 61.0f); RotateTo::create(2, 180, 180);   // ActionRotationalSkew RotateBy::create(4, Vec3(360, 0, 0));传入一个三维向量  //ActionRotateBy3D ScaleTo/ScaleBy缩放变换 SkewTo/SkewBy(dt,sx,sy)偏度变换        sx,sy分别 x轴,y轴的偏移角度。 JumpTo/JumpBy 跳跃(float duration, const Vec2& position, float height, int jumps) 时间,位置偏移,高度,次数 CardinalSplineBy duration,array,t......
阅读全文
  • 12月
  • 07日
综合 ⁄ 共 820字 评论关闭
这个股票软件准备很久了,终于开始动手,从朋友处弄到些代码,不过由于版权的问题,只能重头写过。 前段日子看另一套代码,那是很久以前从朋友处弄来的,一直觉得写的很好,也一直没认真看过,因为不能连上服务器,纯从代码上分析起来比较痛苦。 这三天突然想到可以动手造一些模拟数据,将http协议改成从本地读取文件,这样便可实际看到软件的效果了,动手试了一下,果然效果不错,只是和现在成熟的软件,如大智慧,同花顺相比,明显由于年代久远,已经完全不能比了。这两天将其加入到自己的工程中来,发现改用2005后存在一些......
阅读全文
  • 12月
  • 04日
综合 ⁄ 共 518字 评论关闭
public void doGet(HttpServletRequest request, HttpServletResponse response)                        throws ServletException, IOException {        response.setContentType("application/jar");                ServletContext ctx = getServletContext();        InputStream is = ctx.getResourceAsStream("/bookCode.jar");                int read = 0;        byte[] bytes = new byte[1024];                OutputStream os = response.getOutputStream();        while ((read = is.read(bytes)) != -1) {       ......
阅读全文