现在位置: 首页 > checkered发表的所有文章
  • 10月
  • 31日
综合 ⁄ 共 671字 评论关闭
midir (01-Mar-2009 03:44) Here is a good magazine article (PDF format) that explains the internals of PHP's reference mechanism in detail:http://derickrethans.nl/files/phparch-php-variables-article.pdf It should explain some of the odd behavior PHP sometimes seems to exhibit, as well as why you can't create "references to references" (unlike in C++), and why you should never attempt to use references to speed up passing of large strings or arrays (it will make no difference, or it will ......
阅读全文
  • 08月
  • 16日
综合 ⁄ 共 2107字 评论关闭
题目链接:hdu 5008 Boring String Problem 题目大意:给定一个字符串,初始状态l,r为0,每次询问子串中字典序第l^r^v+1的子串区间,对于重复的输出下标小的。 解题思路:后缀数组,对给定字符串做后缀数组,然后根据height数组确定每个位置做为起点的子串有多少,然后二分查找确定起点位置,但是因为子串的重复的要输出下表小的,所以确定起点后还要确定字典序最小的下标。 #include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef unsigned long long ll; const int m......
阅读全文
  • 03月
  • 04日
综合 ⁄ 共 405字 评论关闭
Java的内存分配 Java程序运行时的内存结构分成:方法区、栈内存、堆内存、本地方法栈四种。 方法区:存放装载的类数据信息,包括:基本信息(每个类的名、每个类的直接超类名、该类是类还是接口、该类型的访问修饰符)。 栈内存:Java栈内存由局部变量区、以级对象的引用 堆内存:堆内存用来存放由new创建的对象和数组. 示例如下: package com.blog; /* * 如下例子Person类: * 1,先在栈里生成一个引用类型p, * 2,new Person(),在堆中生成一个对象,并进行属性的默认初始化 * 3,绑定构造方法,为属性赋值 * 4,把堆内存的地址赋给引用......
阅读全文
  • 05月
  • 26日
综合 ⁄ 共 444字 评论关闭
部署测试环境的时候,需要用到Tomcat。故在Linux上部署了Tomcat,并将开发提供的工程包部署到Tomcat的webapps目录下,启动Tomcat,部署成功。第二天修改工程配置文件时,发现webapps下很多自带应用很多余,故把Tomcat自带应用从webapps目录下删除,重启Tomcat。邪门的事情发生了:Tomcat竟然报错!错误信息如下:严重: Error starting static Resources java.lang.IllegalArgumentException: Document base .../apache-tomcat-6.0.35/webapps/manager does not exist or is not a readable directory ... 起初以为是Tomcat的缓存导......
阅读全文
  • 04月
  • 29日
综合 ⁄ 共 313字 评论关闭
# include<cstdio> # include<iostream> using namespace std; int main(void) { int a[11]; int t; for ( int i = 0;i <= 10;i++ )a[i] = 0; for ( int i = 1;i <= 5;i++ ) { cin>>t; a[t]++; } for ( int i = 0;i <= 10;i++ ) {//从小到大的输出 for ( int j = 1;j <= a[i];j++ ) { cout<<i<<" "; } ......
阅读全文
  • 04月
  • 23日
综合 ⁄ 共 2441字 评论关闭
先看一道sony中国的笔试题: #include<stdio.h> #include<setjmp.h> static jmp_buf buf; int main() { volatile int b; b = 3; if(setjmp(buf)!= 0 ) { printf("%d\n",b); exit(0); } b = 5; longjmp(buf,1); } 非局部跳转语句---setjmp和longjmp函数。非局部指的是,这不是由普通C语言goto,语句在一个函数内实施的跳转,而是在栈上跳过若干调用帧,返回到当前函数调用路径上的某一个函数中。这两个函数包含在头文件<setjmp.h>中。 int setjmp(jmp_buf env); 返回值:若直接调用则返回0,若从......
阅读全文
  • 04月
  • 20日
综合 ⁄ 共 30字 评论关闭
点击打开链接 点击打开链接 点击打开链接 点击打开链接 点击打开链接
阅读全文
  • 04月
  • 13日
综合 ⁄ 共 7105字 评论关闭
 由于需要将平时做实验时程序的一些输出信息保存下来,以前都是截图之类的,这样虽然也能将输出信息保存下来,但是这样不方便后面整理实验数据,一个比较好的方法是直接将输出信息保存为文本的格式,这样既能保存数据,也方便以后整理数据。       要将输出信息保存下来,有两个问题要解决: 1.文件保存的名字; 2.如何将不同类型的数据输出到文件中。     对于第一个问题,以及在另外一个博客已经解决了,现在来解决第二个问题,在OpenCV中,已经重载过输出操作符<<了,因此,在基于OpenCV的情况下,我们只需要定义一个......
阅读全文
  • 03月
  • 31日
综合 ⁄ 共 2061字 评论关闭
  准备一张名为picture的图片。     在main.xml中:   <LinearLayout     android:id="@+id/group"     xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:background="#000000"     android:orientation="vertical"     android:gravity="center_horizontal">   <ImageView       android:id="@+id/mlyw"       android:layout_marginTop="8dp"       android:layout_width="fill_parent"       android:layou......
阅读全文
  • 02月
  • 23日
综合 ⁄ 共 854字 评论关闭
      苹果推出了iOS7.1,当然是第一时间升级。       升级前先看了一下说明,苹果提到了几个重点,CarPlay,Siri,iTunesRadio,日历,相机等等,应该说,第一印象是修复了很多比较微小的问题以及比较边角UI的完善。       升级之后试用了一下,发现来电界面,拨号界面,日历界面,输入法有些不同,其它感觉不明显。又看见说苹果花了大力气优化了系统,iPhone4上开启应用速度加快了不少,我不是iPhone4,但还是尝试了一下。打开Safari,打开Camera。。。自我感觉打开Camera感觉是快了一点,其它的不算明显,可能是心理作用吧。   ......
阅读全文
  • 02月
  • 09日
综合 ⁄ 共 1906字 评论关闭
ibm的was连jdk都采用的自己的。下面把我的经验列一下: 1、include的文件要注意: <%@ page contentType="text/html; charset=UTF-8"%> 这个在was5下不能被多次设置,include文件中如果有要去掉,不过was6.0以上就可以了。 2、web.xml中的serlvet标准 was5.1只支持2.3标准,was6.0以上才可以支持2.4,如果程序需要跨不同版本的应用服务器,最好采用2.3标准. 2.3的开头设置如下: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http:......
阅读全文
  • 01月
  • 12日
综合 ⁄ 共 3839字 评论关闭
The die is cast  InterGames is a high-tech startup company that specializes in developing technology that allows users to play games over the Internet. A market analysis has alerted them to the fact that games of chance are pretty popular among their potential customers. Be it Monopoly, ludo or backgammon, most of these games involve throwing dice at some stage of the game. Of course, it would be unreasonable if players were allowed to throw their dice and then enter the result into th......
阅读全文