让foobar支持播放ape格式

从官方http://www.foobar2000.org/download下载的foobar默认是不支持ape格式的音乐,

默认的foobar播放ape音乐会出现错误Unable to open item for plyback(Unsupported file format)

可以通过安装foobar官方网站上提供的插件来解决此问题。进入插件下载页面,下载Monkey’s Audio decoder 2.1.5,下载后,解压缩后得到foo_input_monkey.dll文件,拷贝至foobar安装目录的components文件夹下,就可以正常播放APE格式的音乐了。

[转]人人都能做的美味补血安神汤

当归四季豆木耳汤,是一道清口健脾胃的补血安神汤。当归味甘,既能补血活血,又可通经活络。四季豆富含胡萝卜素、钙、B族维生素、蛋白质和多种氨基酸,可健脾胃,增进食欲,有祛烦清口的作用。当归四季豆木耳汤,能增强肠胃吸收能力,激活淋巴细胞,产生免疫力力。同时有安神的效果,对于心悸、心慌也有很好的改善作用。

 

做法:
1、原料:当归10克、四季豆150克、木耳10克、断生肉片200克、葱姜少量、盐3口味、鸡粉2克、高汤200克、清水1000克。
2、木耳泡发备用。
3、肉片、当归、葱姜加入汤煲。
4、加入高汤和清水煮沸,转文火煲30分钟。
5、加入四季豆和木耳,旺火煮沸。
6、转文火继续煲15分钟,最后加盐、鸡粉调味。

 

[转]Gvim 的 Python 自动补全插件 Pydiction 安装

参考原址

放置 python_pydiction.vim 文件到 C:\Program Files\Vim\vimfiles\ftplugin 目录。
放置 complete-dict 和 pydiction.py 到 C:\Program Files\Vim\vimfiles\ftplugin\pydiction\ 目录。(这两个文件可以放在任何目录,对应于 pydiction_location 变量)
在 _vimrc 文件中加入内容:
1
filetype plugin on
2
let g:pydiction_location = ‘C:/Program Files/Vim/vimfiles/ftplugin/pydiction/complete-dict’
3
let g:pydiction_menu_height = 20
使用时用 Tab 键就可以进行自动补全
官方下载地址

[转]在Windows上安装Python+MySQL 的常见问题及解决方法

原址

验证是否已经安装了MySQLdb:

==========================================================
d:\usr\local\Python25>python
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] onwin32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import MySQLdb
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
ImportError: No module named MySQLdb
==========================================================
如果有类似于上面的”No module named MySQLdb”,表明MySQLdb尚未安装或安装的不成功!

MySQL 版本:5.0.67
下载地址:http://dev.mysql.com/downloads/mysql/5.0.html#downloads
下载exe文件并安装

==========================================================

Python 版本:2.5
下载地址:http://www.python.org/download/releases/2.5.4/
下载msi文件并安装

MySQLdb版本: MySQLdb Windows binary for Python 2.5
下载地址:http://biohackers.net/wikiattach/Python2(2e)5/attachments/MySQL-python.exe-1.2.1_p2.win32-py2.5.exe
参见:http://forums.mysql.com/read.php?50,129618,140611#msg-140611

常见问题:
1.无法定位程序输入点 mysql_server_init 于动态链接库 LIBMYSQL.dll 上。
—————————————————————————————————-
D:\usr\local\Python25>python
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import MySQLdb
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “D:\usr\local\Python25\Lib\site-packages\MySQLdb\__init__.py”, line 19, in <module>
import _mysql
ImportError: DLL load failed: 找不到指定的程序。
—————————————————————————————————-
解决方法:把mysql安装目录的bin\libmySQL.dll文件复制到python安装目录的Lib\site-packages下

==========================================================

Python 版本:2.6
下载地址:http://www.python.org/download/releases/2.6.1/
下载msi文件并安装

MySQLdb版本: MySQL-python-1.2.2.win32-py2.6.exe
下载地址:http://home.netimperia.com/files/misc/MySQL-python-1.2.2.win32-py2.6.exe
参见:http://sourceforge.net/forum/forum.php?thread_id=2316047&forum_id=70460

常见问题:
1.ImportError: DLL load failed: 找不到指定的模块。
—————————————————————————————————-
D:\usr\local\Python26>python
Python 2.6 (r26:66721, Oct  2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import MySQLdb
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “D:\usr\local\Python26\Lib\site-packages\MySQLdb\__init__.py”, line 19, in <module>

import _mysql
ImportError: DLL load failed: 找不到指定的模块。
—————————————————————————————————-
解决方法:下载libmmd.dll(附件)和libguide40.dll(附件)两个dll文件并复制到python安装目录的Lib\site-packages下。
参见:http://sourceforge.net/forum/message.php?msg_id=5613887

2.ImportError: DLL load failed: 找不到指定的模块。
—————————————————————————————————-
D:\usr\local\Python26>python
Python 2.6 (r26:66721, Oct  2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import MySQLdb
D:\usr\local\Python26\lib\site-packages\MySQLdb\__init__.py:34: DeprecationWarning: the sets module is deprecated
from sets import ImmutableSet
—————————————————————————————————-
解决方法:
1) file “__init__”, replace:

from sets import ImmutableSet
class DBAPISet(ImmutableSet):

with

class DBAPISet(frozenset)

2) file “converters.py”, remove:

from sets import BaseSet, Set

3) file “converters.py”, change “Set” by “set” (IMPORTANT: only two places):

line 48: return set([ i for i in s.split(',') if i ])
line 128: set: Set2Str,
参见:http://sourceforge.net/forum/message.php?msg_id=5808948

 

[转]使用zen coding for vim快速编写html代码

原文链接

首先是安装
在这里下载:
ZenCoding.vim
或者干脆使用git版
git clone git://github.com/mattn/zencoding-vim
然后复制到~/.vim/plugin下,然后就可以使用了

1. 展开缩写
输入 ‘div>p#foo$*3>a‘ 这样的缩写,然后按 ‘ctrl + y + ,‘ 来展开(注意那个逗号)
展开后它应该是这个样子的

 <div>
      <p id="foo1">
          <a href=""></a>
      </p>
      <p id="foo2">
          <a href=""></a>
      </p>
      <p id="foo3">
          <a href=""></a>
      </p>
  </div>

2. 多行缩写
输入如下:
test1
test2
test3
然后进入行选择模式,选中这三行按 ‘ctrl + y + ,‘
接着它会提示你要使用的tag名称,‘TAG: 输入 ‘ul>li*‘ 会变成如下的样子

<ul>
    <li>test1</li>
    <li>test2</li>
    <li>test3</li>
</ul>

如果是输入’ blockquote‘,那么会变成这样

 
  <blockquote>
      test1
      test2
      test3
  </blockquote>

 

IIS应用程序池回收和工作进程

今天遇到有个进程占满了CPU的情况,把服务器卡的死死的,后来发现原来是IIS应用程序池没回收的问题,已回收问题就解决了.

VIM操作小记

除了一些基本的操作,之前老是遇到需要在行末插入文本的时候,原来是A就OK了,还是没看完tutor不行啊

1. 输入小写的 o 可以在光标下方打开新的一行并将光标置于新开的行首,进入     插入模式。
输入大写的 O 可以在光标上方打开新的一行并将光标置于新开的行首,进入     插入模式。
2. 输入小写的 a 可以在光标所在位置之后插入文本。     输入大写的 A 可以在光标所在行的行末之后插入文本。
3. 输入大写的 R 将进入替换模式,直至按 <ESC> 键退出替换模式而进入正常     模式。

关于在 C# 中实现 Singletondoubanclaim0202fc8b0cfc0aeb

静态初始化

One of the reasons Design Patterns [Gamma95] 避免使用静态初始化的原因之一是,C++ 规范在静态变量的初始化顺序方面留下了一些多义性。幸运的是,.NET Framework 通过其变量初始化处理方法解决了这种多义性:

public sealed class Singleton
{
   private static readonly Singleton instance = new Singleton();
   private Singleton(){}
   public static Singleton Instance
   {
      get
      {
         return instance;
      }
   }
}

在此策略中,将在第一次引用类的任何成员时创建实例。公共语言运行库负责处理变量初始化。该类标记为 sealed 以阻止发生派生,而派生可能会增加实例。有关将类标记为 sealed 的利与弊的讨论,请参阅 [Sells03]。此外,变量标记为 readonly,这意味着只能在静态初始化期间(此处显示的示例)或在类构造函数中分配变量

 

详细见msdn

[转]降低网页加载时间的10个技巧

sixrevisions的一篇文章,降低网页加载时间的10个技巧(10 Tips for Decreasing Web Page Load Times“)。

系统的介绍了如何降低网页加载时间的方法,分享一下。

 

1. 检测当前站点网速

The first thing you will want to do is to analyze your current page speed. This allows you to track your improvement and ensure that any changes you make positively improves your page load times.

There are many free tools out there for checking how long it takes to load your website. Here are a few of them:

  • Pingdom offers an easy-to-use site speed test that mimics that way a page is loaded in a web browser.
  • Page Speed is an open source Firefox add-on that helps you assess the performance of your web pages. It also provides suggestions on how to fix performance issues.
  • Web Page Test is another great tool that shows you the speed and performance of your website in different browsers.

2. 优化图片

Know when to use the appropriate file format for your images. Changing to a different file format can dramatically decrease the file size of an image.

  • GIF is ideal for images with few colors like logos.
  • JPEG is great for images with lots of colors and details like photographs.
  • PNG is the choice when you need high quality transparent images.

Check out these resources to learn more about optimizing images:

3. 不要按比例缩小图片

Avoid using a larger image than you need just because you can set the width and height attributes of <img> elements in HTML.

If you need a 100x100px image and you have a 700x700px image, use an image editor like Photoshop or one of theseweb-based image editors to resize the image to the needed dimensions. This lowers the file size of the image, thus helping to decrease page loading times.

4. 压缩与优化站点内容

The task of compressing your website content can have a huge impact on reducing load times. When using HTTP compression, all of your web page data is sent in a single smaller file instead of a request that is full of many different files. For more information, see this Wikipedia article on HTTP Compression.

You can also optimize and compress your JavaScript and CSS files by combining them and minifying the source code.

5.将Stylesheet References放在最前面

Moving your stylesheet references to the <head> of your HTML document helps your pages feel like it is loading faster because doing so allows your pages to render the styles progressively. In addition, it doesn’t hurt that it’s the W3C standard.

6. 将Script References放在最底部

Browsers can only download two components per hostname at the same time. If you add your scripts towards the top, it would block anything else below it on the initial loading of the page. This makes it feel like the page is loading slower.

To avoid this situation, place script references as far down the HTML document as possible, preferably right before the closing <body> tag.

7. JavaScript 与CSS置于外部文件

If your JavaScript and CSS are directly in your HTML document, they are downloaded every time an HTML document is requested. This, then, doesn’t take advantage of browser caching and increases the size of the HTML document.

Always place your CSS and JavaScript in external files; it’s a best practice and makes your site easier to maintain and update.

8. 最小化Http请求

When visiting a new web page, most of the page-loading time is spent downloading components of that page (e.g. images, stylesheets, and scripts).

By minimizing the number of requests a web page needs to make, it will load faster. To reduce HTTP requests for images, one thing you can do is to use CSS sprites to combine multiple images.

If you have multiple stylesheets and JavaScript libraries, consider combining them to reduce the number of HTTP requests.

9. 缓存你的网页

If you use a content management system that dynamically generates your web pages, you should statically cache your web pages and database queries so that you can decrease the strain on your server as well as speed up page rendering times.

When you cache your page, it saves a static version of it to be presented to the user instead of recreating it every time it’s requested.

For WordPress, check out WP Super Cache and W3 Total Cache (also read this WordPress codex entry on optimizing/caching WordPress). Drupal core has native caching.

10. 减少301重定向

Every time a 301 redirect is used, it forces the browser to a new URL which increases page-loading times. If possible, avoid using 301 redirects.

结论

Web page speed is a metric that should not be ignored if you are concerned about providing an optimal user experience.

Want more information on decreasing your website’s page load times? Read Google’s section on page speed, which provides tools, articles, and community feedback regarding website speed. Good luck and happy optimizing!

兄弟们,你是这么干的吗?

 

[转载]不想穷,就好好记住这些吧

无论你是男人,还是女人,做人,想成功,下面就是你必须要做到的:
1,这是个现实的社会,感情不能当饭吃,贫穷夫妻百事哀。不要相信电影里的故事情节,那只是个供许多陌生人喧嚣情感的场所。只有不理智和不现实的人才相信
2,给自己定目标,一年,两年,五年,也许你出生不如别人好,通过努力,往往可以改变70%的命运。破罐子破摔只能和懦弱做朋友。
3,朋友请你吃饭,不要觉得理所当然,请礼尚往来,否则你的名声会越来越差。
4,好朋友里面,一定要培养出一个知己,不要以为你有多么八面玲珑,到处是朋友,最后真心对你的,只有一个,相信我。
5,不要相信算卦星座命理,那是哄小朋友的,命运掌握在自己手中。坐在家里等什么房子,车子,还不如睡一觉做个好梦。
6,不喜欢的人少接触,但别在背后说坏话,说是非之人,必定是是非之人,谨记,祸从口出。
7,少玩游戏,这不是韩国,你打不出房子车子还有资本。可以有爱好,但要把握尺度,少玩农场,牧场,斗地主等一些高度吸引人思想的晋级游戏,也许你的级别很高,但不代表你有多么成功,反而会影响和占据你成功的时间。
8,是人都有惰性,这是与生俱来的,但是我们后天可以改变这种惰性,因为有很多人正在改变。对于某种事物或是生意不要等别人做到了,我才想到。不要等别人已经赚到钱了,我才想去做。没有人相信的是市场和机遇,大家都相信的叫做膨胀。
9,知道自己要干什么,夜深人静,问问自己,将来的打算,并朝着那个方向去实现。而不是无所事事和做一些无谓的事。
10,出路出路,走出去了,总是会有路的。困难苦难,困在家里就是难。《社会调查》普遍认为。
11,作为女人,不要以老卖老,认为事业跟自己没关系,以为自己就是洗衣服,做饭,看孩子,那就是大错特错。
12,做人,要做到;万事孝为先,教童品之道,夫妻和谐美,幸福万年长。但是这些不是拿来用嘴说说就能办到的,解放初期年代要做到这些,需要付出很大的努力和辛苦,当今现实的社会需要你付出很大的金钱,聪明的人都知道这个道理。
13,空闲时间不要经常上网做无聊的事和玩一些没有意义的游戏,读点文学作品,学习一些经营流程,管理规范,国际时事,法律常识。这能保证你在任何聚会都有谈资。
14,宁可错杀一千次来自各方面的信息,也不放过任何一个有可能成功的机会。只有这样你才不会去买后悔药。
15,要做一件事,成功之前,没有必要告诉其他人。成功之后不用你说,其他人都会知道的。这就是信息时代所带来的效应
16,头发,指甲,胡子,打理好。社会是个排斥性的接受体,这个星球所需要的艺术家极其有限,请不要冒这个险,就算你留长头发比较好看,也要尽量给人干净的感觉。
17,不要以为你是个男人,就不需要保养。至少饮食方面不能太随便,多吃番茄,海产品,韭菜,香蕉,都是对男性健康有益处的食物。你要是看不到价值,我可以告诉你。至少你能把看病节约下来的钱给你的女人多买几个化妆品.
18,力求上进的人,不要总想着靠谁谁,人都是自私的,自己才是最靠得住的人。
19,面对失败,不要太计较,天将降大任于斯人也,必先苦其心志,劳其筋骨,饿起体肤……但要学会自责,找到原因,且改掉坏习惯。 二十岁没钱,那很正常;三十岁没钱,可能是没有好的家境,需要更大的努力;四十岁没钱,只能自己找原因。穷人变成富人是可能的,而且很可能。穷人能穷一辈子,也是必然的,存在就是理由,只是有所选择。
20,每个人都有成功的机会!就看你给不给自己机会!
原文