Author Archive

转: transfer-encoding:chunked的含义

Transfer-Encoding: chunked 表示输出的内容长度不能确定,普通的静态页面、图片之类的基本上都用不到这个。

但动态页面就有可能会用到,但我也注意到大部分asp,php,asp.net动态页面输出的时候大部分还是使用Content-Length,没有使用Transfer-Encoding: chunked。

不过如果结合:Content-Encoding: gzip 使用的时候,Transfer-Encoding: chunked还是比较有用的。

记得以前实现:Content-Encoding: gzip 输出时,先把整个压缩后的数据写到一个很大的字节数组里(如 ByteArrayOutputStream),然后得到数组大小 -> Content-Length。

如果结合Transfer-Encoding: chunked使用,就不必申请一个很大的字节数组了,可以一块一块的输出,更科学,占用资源更少。

这在http协议中也是个常见的字段,用于http传送过程的分块技术,原因是http服务器响应的报文长度经常是不可预测的,使用Content-length的实体搜捕并不是总是管用。 (continue reading…)


linux命令行下的ftp 多文件下载和目录下载

目标ftp服务器是一个非标准端口的ftp

1 Comment more...

Magento产品的三种关联方式:Related products, Up-sells, Cross-sells

Magento Upsells

当用户进入到一个产品页面时,Upsells关联产品会显示在该页面的下方,表示与该产品相类似的一些产品,它们的质量更好,品牌更好,或者说能给商家带来更丰厚的利润的类似产品。如果顾客对该产品不满意,可以从这些相似产品中选择。例如客户在选购Thinkpad笔记本电脑,Upsells中一般应该显示其它笔记本电脑,T系列,X系列,又或者是戴尔的XPS系列等。

Magento Related Products

Related products同样显示在产品详细页面中,与Upsells不同,Related products默认会显示在右侧边栏。这些产品被用来设计推荐给用户该产品之外的配套产品。比如用户在浏览笔记本电脑的时候,在右侧的Related products中可能会显示笔记本电脑鼠标,笔记本电脑屏幕保护膜等产品。

Magento Cross-sells

Crooss-sells产品会显示在结账时的购物车中。当用户添加产品到购物车后,准备结账时,都会进入购物车页面。Cross-sells关联的产品会显示在购物车页面下部的左侧。在Magento系统的设计中,Cross-sells与上面两个类型的关联产品完全不同。比如说用户购买笔记本电脑之后,进入到购物车页面,Cross-sells产品可能不会是与电脑相关的任何产品,而是杂志,糖果等其它主题的产品。


TS doNotLinkIt

lib.myFooterNav = HMENU
lib.myFooterNav.special = directory
lib.myFooterNav.special.value = 44
lib.myFooterNav.wrap = 
    |
lib.myFooterNav.1 = TMENU lib.myFooterNav.1 { NO.allWrap =
  • |
  • NO.doNotLinkIt.stdWrap.override = 1 NO.doNotLinkIt.stdWrap.if { equals.field = doktype value = 4 } NO.before.stdWrap.cObject = TEXT NO.before.stdWrap.cObject { data = getIndpEnv:REQUEST_URI wrap = !!<=|?===> } NO.before.stdWrap.if { equals.field = uid value = 48 } NO.after = NO.after.stdWrap.if { equals.field = uid value = 48 } ACT.allWrap =
  • |
  • ACT.ATagParams = class="active" ACT = 1 }

    MySQL架构设计相关的方式方法和软件介绍

    前言
    最近,我在学习了解MySQL数据库架构相关的内容,从网上搜索了大量的相关资料和文章,粗粗阅览了一遍,发现架构相关的东西深不可测,需要非常丰富的知识阅历和实践经验。

    我的阅历和经验明显不够用,所以我把了解到的相关内容作了下分类整理,算作这次学习的一个大致总结吧!这篇文章的大部分内容都来自网络,由于我的水平有限,整理的也并不准确,其中可能有很多错误之处,希望大家能不吝指正!希望这篇文章能抛砖引玉,帮助我们了解数据库架构相关的一些内容。
    (continue reading…)

    1 Comment more...

    How to use XLF files in TYPO3

    Adding a localization to an “Extension Builder” generated TYPO3 extbase extension could be a little tricky as it uses the xlf (XLIFF) format.

    This is a simple way to add new localizations without using extra tools like Virtaal or a Pootle server.

    1. copy file and prefix filename with language coed: example.xlf to de.example.xlf
    2. add target-language=”de” attribute to node file
    3. change source nodes to target

    Please make sure…
    your files are UTF8 encoded
    to encapsulate special chars in CDATA

    
    
      
        
    Dummy text Default language xlf file (locallang.xlf)
    
    
      
        
    Das ist ein Test. German language xlf file (de.locallang.xlf)

    MAC上的PHP工作环境搭建

    Part 1: MacPorts
    一步步来,首先需要解决的软件安装工具的问题,毕竟谁也不想php、cgi、mysql一串软件全部自己手动下源码编译吧。所以我们需要安装MacPorts这个软件,这个软件会很方便地提供软件的安装,就像debian、ubuntu的apt和centos的yum一样。 (continue reading…)


    Sphinx中文指南

    Sphinx中文入门指南

    • 1、简介
    • 1.1.Sphinx是什么
    • 1.2.Sphinx的特性
    • 1.3.Sphinx中文分词
    • 2、安装配置实例
    • 2.1 在GNU/Linux/unix系统上安装
      • 2.1.1 sphinx安装
      • 2.1.2.sfc安装(见另文)
      • 2.1.3.coreseek安装(见另文)
    • 2.2 在windows下安装
    • 3、 配置实例
    • 4、应用
    • 4.1 在CLI上测试
    • 4.2 使用API调用
    • 5、附录

    (continue reading…)


    Imagemagick thumbnails 背景填充

    For example: An image which is 400×300 pixels shrunk to fit a 100×100 pixel box will normal (with the above) have a size of 100×75 pixels. We want to add some padding borders to the top and bottom of the image (and to the sides to be sure) to make the final thumbnail image always 100×100 pixels in size.
    There are a number of ways to do this, and as of IM v6.3.2 the best way is using the “-extent” option. (continue reading…)


    PHP mysql_data_seek() 函数

    定义和用法

    mysql_data_seek() 函数移动内部结果的指针。

    语法

    mysql_data_seek(data,row)
    参数 描述
    data 必需。返回类型为 resource 的结果集。该结果集从 mysql_query() 的调用中得到。
    row 必需。想要设定的新的结果集指针的行数。0 指示第一个记录。

    (continue reading…)


    Copyright © 1996-2010 Add Lives. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress