摘要:
一、在页面调用window.open()函数后,可以直接在打开的页面中用window.opener来调用父页面的方法,然而如果用showModalDialog打开一个模态窗口,就不能通过window.opener去调用父窗口的方法了,这时,要用window.dialogArguments去调用,注意在showModalDialog方法中的第二个参数是window,即把当前窗口传给子页面,所以子页面才可以通过window.dialogArguments去调用父页面的方法。 父页面js如下: //显示设置页面 function showSet(url) { //showWin(800, 600,.
阅读全文
posted @ 2013-09-09 20:55
you Richer
阅读(159)
推荐(0)
摘要:
1、GET方式其实GET方式说白了,就是拼接字符串。。最后拼成的字符串的格式是: path ? username= ....& password= ......public boolean loginByGet(String path, String username , String password) throws Exception{ String url_path = path +"?username=" + URLEncoder.encode(username, "utf-8") + "&password="
阅读全文
posted @ 2013-09-09 20:53
you Richer
阅读(253)
推荐(0)
摘要:
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=30506#problem/T题意:给你一束光,问你在一个三层的平面类传递n次的种数;仔细想下,就是一个fibonacci数列;#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std ;vector Fi
阅读全文
posted @ 2013-09-09 20:51
you Richer
阅读(212)
推荐(0)
摘要:
http://en.wikipedia.org/wiki/Singleton_patternLazy initialization[edit source| editbeta]This method uses double-checked locking, which should not be used prior to J2SE 5.0, as it is vulnerable to subtle bugs. The problem is that an out-of-order write may allow the instance reference to be returne...
阅读全文
posted @ 2013-09-09 20:48
you Richer
阅读(162)
推荐(0)
摘要:
Oracle百问百答(一)01.如何查看oracle的版本信息?02.如何查看系统被锁的事务信息?03.怎么获取有哪些用户在使用数据库?04. 数据表中的字段最大数是多少?表或视图中的最大列数为 100005. 怎样查得数据库的SID ?select name from v$database;,也可以直接查看 init.ora文件06. 如何查询表空间信息?07. 如何统计两个表的记录总数?08.如何获取系统的当前日期,若天数大于15,显示1,否则显示0?09. drop user和drop user cascade有什么区别?drop user :仅仅是删除用户;drop user
阅读全文
posted @ 2013-09-09 20:47
you Richer
阅读(238)
推荐(0)
摘要:
1. ISO/OSI的参考模型共有7层,由低层至高层分别为:物理层、数据链路层、网络层、传输层、会话层、表示层、 应用层。各层功能分别为:(1)物理层 提供建立、维护和拆除物理链路所需的机械、电气、功能和规程的特性;提供有关在传输介质上传输非结构的位流 及物理链路故障检测指示。在这一层,数据还没有被组织,仅作为原始的位流或电气电压处理,单位是比特。(2)数据链路层 负责在两个相邻结点间的线路上,无差错地传送以帧为单位的数据,并进行流量控制。每一帧包括一定数量的数据 和一些必要的控制信息。与物理层相似,数据链路层要负责建立、维持和释放数据链路的连接。在传送数据时,如果接收点检测到所传数据中有..
阅读全文
posted @ 2013-09-09 20:45
you Richer
阅读(229)
推荐(0)
摘要:
package test.remote.tools.combine;import java.text.SimpleDateFormat;import java.util.Calendar;import java.util.Date;import java.util.GregorianCalendar;public class TestOutDate { public static void main(String[] args) { //method 1 Calendar nowtime = new GregorianCalendar(); String strDateTime="[
阅读全文
posted @ 2013-09-09 20:42
you Richer
阅读(7321)
推荐(0)
摘要:
1.创建新的C++工程 创建基于对话框的MFC程序 2.添加库、添加Excel类库 在工程名上右键,选择“添加”—“类”(或者点击菜单栏的“项目”->“添加类”),选择“TypeLib中的MFC类”(MFC Class From TypeLib) 类来源选“注册表”,在可用的类型库中选择“MicrosoftExcel 14.0 Object Library”在接口列表框中选择需要的类,在此,我们选择_Application,_Workbook,Worksheet,Range,Workbooks,Worksheets这六个就可以了。 可以看到,六个类被添加了进来。 3.修改头文件 分别将加
阅读全文
posted @ 2013-09-09 20:40
you Richer
阅读(525)
推荐(0)
摘要:
题意:有个工厂的老板给工人发奖金,每人基础都是888,工人们有自己的想法,如:a 工人想要比 b 工人的奖金高,老板想要使花的钱最少 那么就可以 给b 888,给a 889 ,但是如果在此基础上,b也想比a高,那么就不能让他们满意,输出 -1;分析,根据题意可以得出一个拓扑的关系,比如 一组数据:4 41 21 32 43 4那么有如图关系:(位于上层的要求比下层的高)由图可以知道,我们需要给1号890,2、3号889,4号888元,但是我们在拓扑排序的时候总是从入度为0的点 (从图中也就是1号) 开始,如果这样那么我们怎么知道 入度为 0 的点是在第几层呢?那么同样也不好计算总共的奖金数量。
阅读全文
posted @ 2013-09-09 20:37
you Richer
阅读(197)
推荐(0)
摘要:
首先,要安装GCC 4.8, 参考前文:Ubuntu 12.04 & 13.04 安装 GCC4.8.1其中,重点是安装multilibapt-get install gcc-4.8-multilib 接着前文premake管理一个solution和多个project的目录树做一些修改:1.创建四个configuration,分别为Debu64, Release64, Debug32和Release32, 把它们放在solution下面,这样,每个proejct都共享这些设置。-- A solution contains projects, and defines the availa
阅读全文
posted @ 2013-09-09 20:35
you Richer
阅读(459)
推荐(0)
摘要:
Traits含义就是特性,应用Trait模板参数,使得我们的程序既保持灵活性,同时减少类型参数的数量。能够使得我们对函数进行更加细粒度的控制。 #ifndef TRAIT_H_#define TRAIT_H_/*templateT accumulate( const T *begin, const T *end ){ T total = T(); while ( begin != end ) { total += *begin; ++begin; } return total;}*/templateclass AccumulationTrai...
阅读全文
posted @ 2013-09-09 20:33
you Richer
阅读(228)
推荐(0)
摘要:
/*生产者、消费者*/ #include #include #define BUFFER_SIZE 16 /***struct prodcons***/ struct prodcons { int buffer[BUFFER_SIZE]; pthread_mutex_t lock; int readpos,writepos; pthread_cond_t notempty; pthread_cond_t notfull;};void init(struct prodcons *b) { pthread_mutex_init(&b->lock,NULL); pthread_cond
阅读全文
posted @ 2013-09-09 20:30
you Richer
阅读(306)
推荐(0)
摘要:
1. 使用do-while结构去避免潜在的内存泄漏问题。do { p1 = malloc(10); if (null == p1) { break; } p2 = malloc(20); if (null == p2) { break; } return ok; }while(0);de_init(); return fail;2. 使用指针时必须先检查指针的有效性,这样做的一大好处是可以防止误用null pointer而引起系统crash。if (p1 != null) { do_something(); } else { printf("\nnull pointer...
阅读全文
posted @ 2013-09-09 20:28
you Richer
阅读(160)
推荐(0)
摘要:
内容简要:1、初始化 2、创建无图的精灵 3、设置精灵贴图大小 4、添加入层中5、对精灵进行缩放 6、对精灵宽或高进行缩放 7、旋转精灵8、设置精灵透明度 9、精灵的镜像反转 10、设置精灵的颜色11、得到图的宽高 12、按照像素设定图片大小 13、在原有的基础上加xy的坐标14、设置图片锚点 15、从新排列z轴顺序 16、更换精灵贴图17、设置可视区域 18、贴图无锯齿//初始化 CCSprite* sprite =[CCSprite spriteWithFile:@"Icon.png"];//创建无图的精灵CCSprite*sprite2 =[CCSprite node
阅读全文
posted @ 2013-09-09 20:26
you Richer
阅读(159)
推荐(0)
摘要:
思路:sm=n^n,两边分别对10取对数得 log10(m)=n*log10(n),得m=10^(n*log10(n)),由于10的任何整数次幂首位一定为1,所以m的首位只和n*log10(n)的小数部分有关; #include #include int main() { int T; double ans1; __int64 ans2,ans,n; scanf("%d",&T); while(T--) { scanf("%I64d",&n); ans1=n*log10(double(n)); ans2=__int64(ans1); an
阅读全文
posted @ 2013-09-09 20:23
you Richer
阅读(151)
推荐(0)
摘要:
虽然题中有n#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define FF(i, a, b) for(int i=a; i=b; i--)#define REP(i, n) for(int i=0; i w) g[u][v] = g[v][u] = w; } FF(k, 1, n+1) FF(i, 1, n+1) FF(j, 1, n+1) g[i][j] = min(g[i][j], ...
阅读全文
posted @ 2013-09-09 20:22
you Richer
阅读(227)
推荐(0)
摘要:
------- 源自梦想、永远是你IT事业的好友、只是勇敢地说出我学到! ---------- 1.在API Guides中找到Camera,里面讲解了如何使用系统自带的摄像头进行工作,之后我会试着翻译这部分的内容。2.找到Camera类:有android.hardware.Camera和android.graphics.Camera两个类,我们这里使用android.hardware.Camera。使用Camera类来拍照的步骤如下(API 原文):Obtain an instance of Camera fromopen(int).Get existing (default) setti.
阅读全文
posted @ 2013-09-09 20:19
you Richer
阅读(551)
推荐(0)
摘要:
本人在使用精灵表单创建动画的过程中突然遇到了一些个问题,下面进行一下分析总结。 根据在Cocos2d-iphone中的经验,我写出了如下的代码:CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("my.plist"); CCSpriteBatchNode *batchNode = CCSpriteBatchNode::create("my.png"); this->addChild(batchNode); CCArray *frameArray = CC
阅读全文
posted @ 2013-09-09 20:17
you Richer
阅读(399)
推荐(0)
摘要:
原文:24 JavaScript Best Practices for Beginners译者:youngsterxyf(注:阅读原文的时候没有注意发布日期,觉得不错就翻译了,翻译到JSON.parse那一节觉得有点不对路才发现是2009年发布的文章,不过还是不错的啦。另外,文章虽说24条最佳实践,其实只有23条,不知道原作者怎么漏了一条。)1.优先使用===,而不是==JavaScript使用两种相等性操作符:===|!==和==|!=。通常认为做比较的最佳实践是使用前一组操作符。“若两个操作数的类型和值相同,那么===比较的结果为真,!==比较的结果为假。” — JavaScript语言精
阅读全文
posted @ 2013-09-09 20:14
you Richer
阅读(222)
推荐(0)
摘要:
#pragma onceclass AutoRelease{public: AutoRelease(void){ m_count = 0; } virtual ~AutoRelease(void){} AutoRelease* GetPointClone() { ++m_count; return this; } void Release() { m_count = m_count - 1; if( m_count #include "AutoRelease.h"using namespace std;class A:public AutoRelease{};void ma
阅读全文
posted @ 2013-09-09 20:12
you Richer
阅读(454)
推荐(0)