`
wss71104307
  • 浏览: 219153 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论
文章列表
随即抽样问题:       要求从N个元素中随机的抽取k个元素,其中N无法确定。     是在 《计算机程序设计与艺术》 中看到的这个题目,书中只给出了解法,没给出证明。     解决方法是叫Reservoir Sampling (蓄水池抽样)                            Init : a reservoir with the size: k                          for   i= k+1 to N                               M=random(1, i);           ...
     thickbox跨越iframe的问题很好解决,只需要在父页和iframe页都要载入 jquery.js thickbox.js thickbox.css(别忘记了父页面) 修改thickbox.js 函数function tb_init(domChunk) 找到tb_show(t,a,g); 这句修改为: if (window.parent.frames[window.name] && (parent.document.getElementsByTagName('frameset').length <= 0)) { ...

HRule组件

    博客分类:
  • Flex
  HRule组件     所属包: mx.controls     用途:绘制一条水平直线。     属性: Characteristic Description Default size The default width is 100 pixels, default height is 2 pixels. By default, the HRule control is not resizable; set width and height to percentage values to enable resizing. strokeWi ...
调不尽的内存泄露,用不完的Valgrind (一个介绍程序调试的精彩讲解:http://www.ibm.com/developerworks/cn/linux/l-pow-debug/) Valgrind 介绍 Valgrind 是一个GPL的软件,用于Linux(For x86, amd64 and ppc32)程序的内存调试和代码剖析。你可以在它的环境中运行你的程序来监视内存的使用 情况,比如C 语言中的malloc和free或者 C++中的new和 delete。使用 Valgrind 的工具包,你可以自动的检测许多内存管理和线程的bug,避免花费太多的时间 ...
魔数 很多类型的文件其文件起始的几个字节的内容是固定的(或是有意填充,或是本就如此)。因此这几个字节的内容也被称为魔 数 (magic number,还有别的意思),因为根据这几个字节的内容就可以确定文件类型。例如 FreeBSD 上 ELF 文件的 magic number 就是文件的前四个字节依次为"7f 45 4c 46",对应的ascii字符串即 "^?ELF"。tar 文件的 magic number 是从第257个字节起为 "ustar"。Unix 命令 "file" 应该就是利用这个原理工作的。 ...

echo $IFS

学习IFS的时候,我一直想知道 默认的时候 IFS=' \t\n' 那么我echo $IFS的时候应该显示' \t\n'才对啊. 因为通过 set | grep IFS的时候确实能看到' \t\n'.   后来才知道 IFS中的值 已经不是普通的字符了,而是起隔离作用的特殊字符。 例如: $IFS=: $a=hello:world $echo $a 这个时候输出的是hello world而:已经看不到了。
#!/usr/bin/python #Remove BOM head and replace the Windows linefeeds with the Unix linebreak. #The script search the jsp files in the current directory by defalut. #You can specify the directory and the file type in the parameters #python rmbom.py [directory] [file type] #For example, you can us ...

Linux backtricks "`"

shell中 backtricks  "`"的用法:   The backtick allows you to assign the output of a shell command to a variable.   可以把一个shell命令的输出付给一个变量   例如   date=`date` echo The time is $date         user=`who` echo Now: $user     还是不错的命令
深入分析Flex [Bindable] 以及使用方法 http://www.gold98.net/blog/article.asp?id=1078   [Bindable]大概又是Flex用得最多的元数据了。刚开始用用确实好简单,效率真是没的说。不过这几天用着却碰到了些问题,我自己搜集了些资料,想着有必要在blog里总结一下吧。 啥是元数据(metadata) 知 道就跳过吧。今天不晓得为什么livedoc.adobe.com这么慢,没办法,拿不到权威的解释了。我就按自己的理解随便解释一下:首先要明白元数据 不是语法的一部分,而是专门给编译器用的,说白了是告诉编译器做 ...
  文档上这样写的: The State class defines a view state, a particular view of a component. For example, a product thumbnail could have two view states; a base view state with minimal information, and a rich view state with additional information. The overrides property specifies a set of chil ...
不管前端展现技术是jsp或者是Flex抑或其他web语言,对于Server而言只会看到通过HTTP协议传送过来的数据(不论是POST还是GET方法);不同的只是jsp和Flex提交请求的方式(语法不同) 和 对服务器返回的数据展现的方式。     下面给出了一个Flex 和 Servlet(struts的Action) 通信的例子。   <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/ ...
前天在弄VMware的时候,在VMware上clone了一个linux,后来在clone的linux(RedHat Enterprise Linux 4)上不能上网了,激活eth0时老弹出 Device eth0 has different MAC address than expected ,我们只要编辑这个文件:/etc/sysconfig/network-scripts/ifcfg-eth0,把HWADDR=.... 这行删掉就行了. 还有一个问题,若是点击激活,出现错误: /sbin/ifup: configuration for eth0 not found.Usage: ifu ...
  1. 安装Araxis Merger 2008.             PRODUCT INFORMATION You purchased the following product: Product Purchased: Araxis Merge Professional Product Code: MGP Single-User Serial Number(s): Key[1]: hkgIgjYG:AMwcJF#7:BDyz*mr+:]h@]ANGp:8CmCTDcK:+y5@N4bU Key[2]: hkhFgzYG:APGvh#2k:WWDonwhy:DvKTAB3 ...

getKey

#include <iostream> #include <fstream> #include <afx.h> #include <string> using namespace std; int WCharToChar(UINT PageCode, std::wstring strWChar, std::string &strChar); int findKey(const string key); int main() { CFileFind finder; / ...
  去trend笔试也是这个题目。不过比这个简单。。不过这个题目以前看过了,没仔细看,笔试的时候自己把之给想出来了。     输入两个字符串,从第一字符串中删除第二个字符串中所有的字符。例如,输入 ”They are students ...
Global site tag (gtag.js) - Google Analytics