在flash player 11.3和air3.3之前,我们可以借助第三方类(JPEGEncoder)这些,很容易处理。现在,有了encode和JPEGEncoderOptions这些,处理位图数据就更简单快捷了。 flash.display.BitmapData.encode() 方法允许您将位图 ...
分类:
Web程序 时间:
2016-04-08 14:31:38
阅读次数:
244
1.需求 写一个基于memcache的cache模块, 需要在key前面加上特定的前缀, 所以user cache的原始的store函数应该写成 由于加前缀的操作(key_encode/1)是所有存入cache前必须要做的事, 所以我们可以考虑通过metaprogramming来定义一个行为叫bef ...
分类:
其他好文 时间:
2016-04-05 00:29:54
阅读次数:
321
http://www.poluoluo.com/jzxy/201403/265005.html 首先要记住json_encode返回的是字符串, 而json_decode返回的是对象 判断数据不是JSON格式: .代码如下: function is_not_json($str){ return is ...
分类:
Web程序 时间:
2016-04-04 18:12:05
阅读次数:
123
地址:http://acm.hdu.edu.cn/showproblem.php?pid=1020 题目: Problem Description Given a string containing only 'A' - 'Z', we could encode it using the follo ...
分类:
其他好文 时间:
2016-04-04 14:36:12
阅读次数:
106
从5.2版本开始,PHP原生提供json_encode()和json_decode()函数,前者用于编码,后者用于解码。 1、json_encode()该函数主要用来将数组和对象,转换为json格式。先看一个数组转换的例子:$arr = array ('a'=>1,'b'=>2,'c'=>3,'d' ...
分类:
Web程序 时间:
2016-04-04 06:42:45
阅读次数:
205
decode的作用是将其他编码的字符串转换成unicode编码,如str1.decode('gb2312'),表示将gb2312编码的字符串str1转换成unicode编码。encode的作用是将unicode编码转换成其他编码的字符串,如str2.encode('gb2312'),表示将unico ...
分类:
编程语言 时间:
2016-04-03 20:13:15
阅读次数:
131
在vim中使用ycm插件时,偶尔会出现: “UnicodeEncodeError: 'ascii' codec can't encode characters in position 2-5: ordin al not in range(128)” 自行百度时,发现该提示和python有关,联想到y ...
分类:
Web程序 时间:
2016-04-03 13:00:34
阅读次数:
259
借助于强大的搜索引擎和本地试验。通常来说解决乱码两个方式:1、把文件名(包括汉字)编码成UTF-8StringdownloadOrigalFile="测试文件乱码.xlsx";StringdownloadFileName=java.net.URLEncoder.encode(downloadOrigalFile,"UTF-8");response.setHeader("Content-Disposition","p_..
分类:
其他好文 时间:
2016-04-02 07:18:34
阅读次数:
399
Encode编码: Java是双字节编码utf-16be,中文占用2个字符,英文占用2个字符。 项目默认编码是GBK,中文占用2个字符,英文占用1个字符。 UTF-8编码:中文占用3个字符,英文占用1个字符。 文本文件就是字节序列,可以是任意编码的字节序六二,编码只是读取的方式,当字节序列是某种编码 ...
分类:
Web程序 时间:
2016-04-01 14:42:06
阅读次数:
249
java 获取url及url参数解析 一.url编码:URLEncoder.encode(userName); 二.url解码: URLDecoder.decode(userName); ...
分类:
编程语言 时间:
2016-03-31 10:55:22
阅读次数:
418