现在位置: 首页 > stargazer发表的所有文章
  • 06月
  • 18日
综合 ⁄ 共 5215字 评论关闭
// topo.java // demonstrates topological sorting // to run this program: C>java TopoApp //////////////////////////////////////////////////////////////// // 思想:1.找有向图中无后继的节点              2.删除该节点              3.重复1.2 class Vertex    {    public char label;        // label (e.g. 'A') // -------------------------------------------------------------    public Vertex(char lab)   // constructor       { label = lab; }    }  // end class Vertex /////////////////////////......
阅读全文
  • 02月
  • 27日
综合 ⁄ 共 2996字 评论关闭
Scrambled Polygon Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 5515   Accepted: 2626 Description A closed polygon is a figure bounded by a finite number of line segments. The intersections of the bounding line segments are called the vertices of the polygon. When one starts at any vertex of a closed polygon and traverses each bounding line segment exactly once, one comes back to the starting vertex.  A closed polygon is called convex if the line segment joini......
阅读全文
  • 01月
  • 04日
移动开发 ⁄ 共 10065字 评论关闭
新年伊始,Google发布了包含16个短视频的Android性能优化典范专题,详解Android系统中有关性能问题的底层工作原理,并介绍了如何通过工具找出性能问题以及提升性能的建议。本文作者对这些问题和建议进行了总结梳理。 2015年伊始,Google发布了关于Android性能优化典范的专题,一共16个短视频,每个3-5分钟,帮助开发者创建更快更优秀的Android App。课程专题不仅仅介绍了Android系统中有关性能问题的底层工作原理,同时也介绍了如何通过工具来找出性能问题以及提升性能的建议。主要从三个方面展开,Android的渲染机制,内存与GC......
阅读全文
  • 10月
  • 08日
综合 ⁄ 共 3436字 评论关闭
#include <d3d9.h> #include <d3dx9effect.h> #include <math.h> #pragma comment(lib,"d3d9.lib") #pragma warning(disable : 4996) #include <strsafe.h> #pragma warning(default : 4996) LPDIRECT3D9 g_pD3D = NULL; LPDIRECT3DDEVICE9 g_pd3dDevice = NULL; LPDIRECT3DVERTEXBUFFER9 g_pVB = NULL; LPDIRECT3DINDEXBUFFER9 g_pIB = NULL; //索引缓冲区 HRESULT InitD3D(HWND hWnd) { if(NULL == (g_pD3D = Direct3DCreate9(D3D_SDK_VERSION))) return E_FAIL; D3DPRESENT_PARAMETERS d3dp......
阅读全文
  • 06月
  • 08日
综合 ⁄ 共 2164字 评论关闭
简单工厂模式---》工厂模式---》抽象工厂模式 抽象工厂模式与工厂模式一个大的区别就是工厂模式针对的是一个产品等级结构,而抽象工厂模式针对的时多个产品等级结构 其中的类与对象的关系是 抽象工厂:用于声明生成产品的工厂方法 具体工厂:实现生成产品的工厂方法 抽象产品:声明产品接口 具体产品:实现产品接口 客户:使用抽象产品和抽象工厂生成对象。创建抽象工厂   using System; //抽象大陆工厂 abstract public class ContinentFactory//声明工厂方法 {     abstract public  Herbivore CreateHerbivore();//抽象方法    ......
阅读全文
             Apache CXF实战之六 创建安全的Web Service                本文链接:http://blog.csdn.net/kongxx/article/details/7534035   我们在使用Web Service的过程中,很多情况是需要对web service请求做认证的,对于运行在web容器里的应用程序来说,可能会比较简单一些,通常可以通过filter来做一些处理,但是其实CXF本身也提供了对web service认证的方式。下面来看一下如何实现 1. 首先是一个简单pojo [java] view plaincopyprint? package com.googlecode.garbagecan.cxfstudy.security;      public class U......
阅读全文
  • 04月
  • 14日
综合 ⁄ 共 824字 评论关闭
1、将要签名的类打包成jar jar cvf friend.jar com/example/tools/security/Friend*.class 2、生成密钥对文件 keytool -genkey -alias friend -keypass friend4life -validity 1000 -keystore ijvmkeys 3、对jar文件进行签名 jarsigner -keystore ijvmkeys -storepass passwd00 -keypass friend4life friend.jar friend E:\eclipse\j2ee\new-workspace\common-tools\bin>jar cvf friend.jar com/example/tools/security/Friend*.class E:\eclipse\j2ee\new-workspace\common-tools\bin>keytool -genkey -alias friend ......
阅读全文
  • 04月
  • 10日
综合 ⁄ 共 20102字 评论关闭
    怎样从10亿查询词中找出出现频率最高的10个 http://dongxicheng.org/big-data/select-ten-from-billions/《蕫的博客》   TopK类问题:分治 + trie树/hash + 小顶堆   固定方法   2^32 = 4G种IP地址取值情况 不完全加载到内存中处理 分而治之:Hash(IP)%1024 将海量IP日志分到1024个小文件,每个文件中构建IP为KEY。出现次数为VALUE的Hash_map。同时记录出现次数最多的那个IP地址。   BitSet数据结构以及jdk中实现源码分析     一. Bitset 基础 Bitset,也就是位图,由于可以用非常紧凑的格式来表示给......
阅读全文
  • 02月
  • 13日
综合 ⁄ 共 9295字 评论关闭
--1、查找员工的编号、姓名、部门和出生日期,如果出生日期为空值, --显示日期不详,并按部门排序输出,日期格式为yyyy-mm-dd。 select emp_no ,emp_name ,dept ,        isnull(convert(char(10),birthday,120),'日期不详') birthday from employee order by dept --2、查找与喻自强在同一个单位的员工姓名、性别、部门和职称 select emp_no,emp_name,dept,title from employee where emp_name<>'喻自强' and dept in    (select dept from employee     where emp_name='喻自强') --3、按部门进行汇总,统计每个部门的......
阅读全文
  • 01月
  • 27日
综合 ⁄ 共 1804字 评论关闭
转载一下邹老大的代码 SQL code Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ CREATE PROC p_ToUnicode @type tinyint=0 --修改方式,0=仅查询可修改情况,1=仅所有列可修改时才修改,2=修改可修改列,报告不可修改列 AS SET NOCOUNT ON --查询非unicode列转换为unicode列的可行性 SELECT TableName=o.name,FieldName=c.name, FieldType=t.name N'(' CAST(c.prec as varchar) N')' CASE WHEN c.isnullable=1 THEN N'' ELSE ......
阅读全文
  • 01月
  • 19日
综合 ⁄ 共 533字 评论关闭
a.变量、函数、或者类未声明或者定义。 (一定注意大小写什么的!) b.头文件相互#include时,导致了依赖关系错误。比如,头文件形成了一个环形依赖,   /***file a ****/ #ifndef FILE_A_ #define FILE_A_ #include <file b> #endif  /****file b ***/    #ifndef FILE_B_ #define FILE_B_ #include <file a> #endif  如果在file b中用到了file a中的变量、函数、类,那么由于#ifndef和#define的作用,file b中的#include <file a>语句将失去效果。 c.在给头文件起名字的时候不小心和某个库中......
阅读全文
  • 12月
  • 18日
综合 ⁄ 共 1924字 评论关闭
并行接口,简称并口。并口采用的是25针D形接头。所谓“并行”,是指8位数据同时通过并行线进行传送,这样数据传送速度大大提高,但并行传送的线路长度受到限制,因为长度增加,干扰就会增加,数据也就容易出错,目前,并行接口主要作为打印机端口等。                                                                                       并口的工作模式:   1:SPP(Standard Parallel Port)称为标准并口,它是最早出现的并口工作模式,几乎所有使用并口的外设都支持该模式。   2:EPP(Enhanced Parallel Port)称......
阅读全文