摘要: 早些时候参考http://code.google.com/p/html5uploader/ 写了一个jquery的html5上传控件。 昨天在一个asp.net mvc3的网站中测试时遇到一些很恶心的问题: 1,文件小的时候,可以正常上传。(比如10M左右都可以。我改了web.config,,理论上可以传200M) 2,在上传一个45MB的PSD文件时,报404错误。 404啊。。。一般是web server找不到资源时才会报的错误,怎么可能在文件上传的时候抛出这种类型的异常呢???最要命的是文件比较小的时候是正常的。 chrome 控制台报的错误: Failed to load resource: the server responded with a status of 404 (Not Found)阅读全文
posted @ 2011-11-20 22:12 Mamboer 阅读(39) 评论(0) 编辑

Windows Command Line Find and replace - Made easy with FART.exe

Here is a great little application that does a find and replace on a particular file, file type or file contents, then replaces it with a string of your choice. It can look in sub directories as well.
The small app is called FART, yes that’s right FART - Find And Replace Text!

Usage: FART [options] [--] [,...] [find_string] [replace_string]
Options
  • -h, –help Show this help message (ignores other options)
  • -q, –quiet Suppress output to stdio / stderr
  • -V, –verbose Show more information
  • -r, –recursive Process sub-folders recursively
  • -c, –count Only show filenames, match counts and totals
  • -i, –ignore-case Case insensitive text comparison
  • -v, –invert Print lines NOT containing the find string
  • -n, –line-number Print line number before each line (1-based)
  • -w, –word Match whole word (uses C syntax, like grep)
  • -f, –filename Find (and replace) filename instead of contents
  • -B, –binary Also search (and replace) in binary files (CAUTION)
  • -C, –c-style Allow C-style extended characters (\xFF\t\n\r\\ etc.)
  • –cvs Skip cvs dirs; execute “cvs edit” before changing files
  • –svn Skip svn dirs
  • –remove Remove all occurences of the find_string
  • -a, –adapt Adapt the case of replace_string to found string
  • -b, –backup Make a backup of each changed file
  • -p, –preview Do not change the files but print the changes
Example 1 (replace text, preview only)
fart -c -r -i -p *.txt original_text new_text
This will look for all .txt files in a sub directory, locate the original_text string within the .txt file and change it to new_text. The -p switch means it won't actually change anything because this is a preview, showing you how many strings it found within each .txt file.

Example 2 (replace text)
fart -c -r -i *.txt original_text new_text
Same as above except it will do the actual replacement.

Example 3 (remove text)
fart -r -i --remove *.txt "remove this text"
Rather than replacing one term for another this will remove the specified term.

NOTE: Use quotes around text if it contains spaces, tabs, etc.

Download FART from SourceForge.
posted @ 2011-08-24 14:13 Mamboer 阅读(19) 评论(0) 编辑

[注:本文转自http://hi.baidu.com/vivaid/blog/item/68fe35736c1d440d8701b08b.html]

具体设置如图:网络上的设置好像不大对,这个是我这有效的设置。可以压缩css与js。

需要其它参数的就自己到http://developer.yahoo.com/yui/compressor/中寻找了。

command:java

argument:-jar $(AppDir)\filters\yuicompressor-2.4.2.jar --type $(FileExt) --charset utf-8 $(FileName)‍ -o $(FileNameNoExt)-min.$(FileExt)

initial dirctory:$(FileDir)

至于如何关联SVN,请参考这篇文章 【http://bugsidea.com/2009/05/editplus-integrate-subversion-yui-compresor.html

至于如何关联TortoiseSVN,请参考【http://hi.baidu.com/bujichong/blog/item/ef86368730799b26c65cc3c8.html

posted @ 2011-07-27 16:01 Mamboer 阅读(21) 评论(0) 编辑

本文适用于Ubuntu 10.10

这两天一直在搭建ubuntu里面到开发环境,对于习惯了win7的傻瓜式的操作的我来说还算是小挑战~

不过整个过程还是蛮有意思,渐渐地你会发现鼠标真的是浮云。

下面记录下偶怎么安装aptana3(aptana2应该也适用)。

翻译参考文档: http://www.ygamretuta.com/2010/12/install-aptana-3-in-ubuntu-10-10/

  1. 安装java运行时,偷看这里 

    说明:实际上偶并没有执行这步,因为发现在安装aptana3之前 java的运行时已经安装过了。

    貌似是安装ubuntu-restricted-extra这个包时自动安装滴! 

  2. 到aptana官网上载 aptana3,我下载到的压缩包为Aptana_Studio_3_Setup_Linux_x86_3.0.0

  3. 解压上面的压缩包得到文件夹Aptana Studio 3。建议重命名为AptanaStudio3。

    现在假设你的AptanaStudio3的路径是/home/yourname/Downloads/AptanaStudio3,下面该考虑将AptanaStudio3放在什么地方了~~

    在终端进到/opt文件夹下,建一个目录叫aptana,将AptanaStudio3移动至aptana下,并加下root权限

    $ cd /opt
    $ sudo mkdir aptana
    $ sudo chown -R root:root aptana
    $ sudo chmod -R +r aptana
    $ cd aptana
    $ sudo mv /home/yourname/Downloads/AptanaStudio3 .
    $ sudo chown -R root:root AptanaStudio3
    $ sudo chmod -R +r AptanaStudio3

  4. 建立aptana的可执行文件(这个类似windows里面到exe的概念)

    $ touch /usr/bin/aptana
    $ chmod 755 /usr/bin/aptana
    $ nano /usr/bin/aptana

    这时nano会打开一个编辑器,在nano编辑器里面加入以下代码并保存:

    #!/bin/sh
    #
    export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
    export APTANA_HOME="/opt/aptana/AptanaStudio3"
    $APTANA_HOME/AptanaStudio3 $*


  5. 在左上角的Applications菜单下加aptana的启动菜单

    $ nano /usr/share/applications/aptana.desktop

    在编辑器里面插入以下代码并保存

    [Desktop Entry]
    Encoding
    =UTF-8
    Name
    =Aptana Studio 3
    Comment
    =IDE for Rails, Python, PHP
    Exec
    =/opt/aptana/AptanaStudio3/AptanaStudio3
    Icon
    =/opt/aptana/AptanaStudio3/icon.xpm
    Terminal
    =false
    Type
    =Application
    Categories
    =GNOME;Application;Development;
    StartupNotify
    =true

  6. 最后初始化启动一下aptana3!

    $ /opt/aptana/AptanaStudio3/AptanaStudio3 -clean

    搞定了~~不知道aptana有没有ppa源可用。遇到的同学和我说一下
posted @ 2011-03-27 12:53 Mamboer 阅读(314) 评论(1) 编辑

注:本文提及的内容适用于ubuntu 10.10

Ubuntu里面的环境配置文件:

(1)/etc/enviroment 是系统的环境变量。

(2)/etc/profile: 是所有用户的环境变量。当用户第一次登录时,该文件被执行. 并从/etc/profile.d目录的配置文件中搜集shell的设置。

(3)/etc/bashrc: 为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取。

(4)~/.bash_profile: 每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该文件仅仅执行一次!默认情况下,他设置一些环境变量,执行用户的.bashrc文件。

(5)~/.bashrc: 该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该该文件被读取。

(6) ~/.bash_logout:当每次退出系统(退出bash shell)时,执行该文件. 另外,/etc/profile中设定的变量(全局)的可以作用于任何用户,而~/.bashrc等中设定的变量(局部)只能继承 /etc/profile中的变量,他们是”父子”关系。

(7)~/.bash_profile 是交互式、login 方式进入 bash 运行的~/.bashrc 是交互式 non-login 方式进入 bash 运行的通常二者设置大致相同,所以通常前者会调用后者。

posted @ 2011-03-27 11:12 Mamboer 阅读(78) 评论(0) 编辑