WP-Cache:an extremely efficient WordPress page caching system

WP-Cache is an extremely efficient WordPress page caching system to make you site much faster and responsive. It works by caching Worpress pages and storing them in a static file for serving future requests directly from the file rather than loading and compiling the whole PHP code and the building the page from the database. WP-Cache allows to serve hundred of times more pages per second, and to reduce the response time from several tenths of seconds to less than a millisecond. Read the rest of this entry »

Open Source MP3 Player

coolcode test

  1. /*
  2. Copyright (c) 2006 - 2008  Eric J. Feminella  <eric@ericfeminella.com>
  3. All rights reserved.
  4.  
  5. Permission is hereby granted, free of charge, to any person obtaining a copy
  6. of this software and associated documentation files (the "Software"), to deal
  7. in the Software without restriction, including without limitation the rights
  8. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the Software is furnished
  10. to do so, subject to the following conditions:
  11.  
  12. The above copyright notice and this permission notice shall be included in all
  13. copies or substantial portions of the Software.
  14.  
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  16. INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  17. PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  18. HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  19. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  20. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21.  
  22. @internal
  23. */
  24.  
  25. package com.ericfeminella.collections
  26. {
  27.     import flash.utils.Dictionary;
  28.     import mx.collections.IList;
  29.    
  30.     /**
  31.      *
  32.      * Defines the contract for lightweight HashMap implementations
  33.      * which are to expose an API into a managed collection of key
  34.      * value pairs
  35.      *
  36.      */
  37.     public interface IMap
  38.     {
  39.         /**
  40.          *
  41.          * Adds a key / value pair to the current Map
  42.          *
  43.          * @param the key to add to the map
  44.          * @param the value of the specified key
  45.          *
  46.          */
  47.         function put(key:*, value:*) : void;
  48.        
  49.         /**
  50.          *
  51.          * Places all name / value pairs into the current
  52.          * <code>IMap</code> instance.
  53.          * 
  54.          * @param an <code>Object</code> of name / value pairs
  55.          *
  56.          */       
  57.         function putAll(table:Dictionary) : void;
  58.        
  59.         /**
  60.          *
  61.          * <code>putEntry</code> is intended as a pseudo-overloaded
  62.          * <code>put</code> implementation whereby clients may call
  63.          * <code>putEntry</code> to pass an <code>IHashMapEntry</code>
  64.          * implementation.
  65.          * 
  66.          * @param concrete <code>IHashMapEntry</code> implementation
  67.          *
  68.          */       
  69.         function putEntry(entry:IHashMapEntry) : void;
  70.        
  71.         /**
  72.          *
  73.          * Removes a key / value from the HashMap instance
  74.          * 
  75.          * @param  key to remove from the map
  76.          *
  77.          */
  78.         function remove(key:*) : void;
  79.  
  80.         /**
  81.          *
  82.          * Determines if a key exists in the HashMap instance
  83.          *
  84.          * @param  the key in which to determine existance in the map
  85.          * @return true if the key exisits, false if not
  86.          *
  87.          */
  88.         function containsKey(key:*) : Boolean;
  89.  
  90.         /**
  91.          *
  92.          * Determines if a value exists in the HashMap instance
  93.          *
  94.          * @param  the value in which to determine existance in the map
  95.          * @return true if the value exisits, false if not
  96.          *
  97.          */
  98.         function containsValue(value:*) : Boolean;
  99.  
  100.         /**
  101.          *
  102.          * Returns a key value from the HashMap instance
  103.          *
  104.          * @param  the key in which to retrieve the value of
  105.          * @return the value of the specified key
  106.          *
  107.          */
  108.         function getKey(value:*) : *;
  109.  
  110.         /**
  111.          *
  112.          * Returns a key value from the HashMap instance
  113.          *
  114.          * @param  the key in which to retrieve the value of
  115.          * @return the value of the specified key
  116.          *
  117.          */
  118.         function getValue(key:*) : *;
  119.  
  120.         /**
  121.          *
  122.          * Returns each key added to the HashMap instance
  123.          *
  124.          * @return String Array of key identifiers
  125.          *
  126.          */
  127.         function getKeys() : Array;
  128.  
  129.         /**
  130.          *
  131.          * Returns each value assigned to each key in the HashMap instance
  132.          *
  133.          * @return Array of values assigned for all keys in the map
  134.          *
  135.          */
  136.         function getValues() : Array;
  137.        
  138.         /**
  139.          *
  140.          * Retrieves the size of the HashMap instance
  141.          *
  142.          * @return the current size of the map instance
  143.          *
  144.          */
  145.         function size() : int;
  146.  
  147.         /**
  148.          *
  149.          * Determines if the HashMap instance is empty
  150.          *
  151.          * @return true if the current map is empty, false if not
  152.          *
  153.          */
  154.         function isEmpty() : Boolean;
  155.        
  156.         /**
  157.          *
  158.          * Resets all key value assignments in the HashMap instance to null
  159.          *
  160.          */
  161.         function reset() : void;   
  162.        
  163.         /**
  164.          *
  165.          * Resets all key / values defined in the HashMap instance to null
  166.          *
  167.          */
  168.         function resetAllExcept(key:*) : void;   
  169.                
  170.         /**
  171.          *
  172.          * Clears all key / values defined in the HashMap instance
  173.          *
  174.          */
  175.         function clear() : void;
  176.  
  177.         /**
  178.          *
  179.          * Clears all key / values defined in the HashMap instance
  180.          * with the exception of the specified key
  181.          *
  182.          */
  183.         function clearAllExcept(key:*) : void;
  184.        
  185.         /**
  186.          *
  187.          * <code>putEntry</code> is intended as a pseudo-overloaded
  188.          * <code>put</code> implementation whereby clients may call
  189.          * <code>putEntry</code> to pass an <code>IHashMapEntry</code>
  190.          * implementation.
  191.          * 
  192.          * @param concrete <code>IHashMapEntry</code> implementation
  193.          *
  194.          */       
  195.         function getEntries() : IList;
  196.     }
  197. }

usage of coolcode

使用的语法是:

 

<coolcode>
代码
</coolcode>

如果要加亮具体的语言,可以用 lang 属性来指定:

 

<coolcode lang=”程序设计语言”>
代码
</coolcode>

如果不需要行号,可以使用 linenum 属性来指定:

 

<coolcode lang=”程序设计语言” linenum=”off”>
代码
</coolcode>

如果希望可以直接以文件下载代码,可以使用 download 属性来指定:

<coolcode lang=”程序设计语言” download=”文件名.扩展名”>
代码
</coolcode>

这三个属性可以组合使用,互不影响。

目前支持的程序设计语言有:

  • actionscript
  • cpp
  • css
  • diff
  • dtd
  • html
  • java
  • javascript
  • mysql
  • perl
  • php
  • python
  • ruby
  • sql
  • xml

coolcode third test

Download: body.html
  1. <html>
  2. <title>this is title</title>
  3. <body>
  4. this is body
  5. </body>
  6. </html>