ActionScript 3 AS3å©©è> <é“®ç>~äº<件

//color egg
function colorEgg() 
{
    stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
    stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
    stage.addEventListener(Event.DEACTIVATE, clearKeys);
}

colorEgg();

var keyDowns = '';
function keyPressed(evt)
{
	//Tracer.debug(evt.keyCode);
	keyDowns += evt.keyCode.toString();
}

function keyReleased(evt)
{
	if(keyDowns == '76908989')
	{
		var txt:TextField = new TextField();
		txt.htmlText = '&lt;font color=&quot;#ff6600&quot; size=&quot;20&quot; face=&quot;verdana&quot;&gt;&lt;b&gt;YY , Have a Nice day :) - From LZ&lt;/b&gt;&lt;/font&gt;';
		txt.x = stage.stageWidth - txt.textWidth;
		txt.y = stage.stageHeight - txt.textHeight;
		txt.width = txt.textWidth+10;
		txt.selectable = false;
		addChild(txt);
	}
}

function clearKeys(evt)
{
	keyDowns = '';
}

Ruby 避免“找不到JPEG标记!”错误

&lt;%

my_file = File.open(&quot;image.jpg&quot;, &quot;rb&quot;) {|f| f.read}
img = ImageSize.new( my_file )


# Testing: get img width with image_size lib.

img_witdh = img.get_width

%&gt;

Other Vim排序线

:!sort

PHP Drupal使命声明包括

&lt;?php 
$mission = theme_get_setting('mission', false);  
if ($mission != &quot;&quot;): ?&gt; &lt;div id=&quot;mission&quot;&gt;&lt;?php print $mission; ?&gt;&lt;/div&gt;&lt;?php endif; ?&gt;

CSS Agrandar Imagenes

&lt;style type='text/css'&gt;



.thumbnail{

position: relative;

z-index: 0;

}



.thumbnail:hover{

background-color: transparent;

z-index: 50;

}



.thumbnail span{ /*CSS for enlarged image*/

position: absolute;

background-color: black;

padding: 5px;

left: -100px;

border: 1px dashed gray;

visibility: hidden;

color: #FFFF00;

text-decoration: none;

}



.thumbnail span img{ /*CSS for enlarged image*/

border-width: 0;

padding: 2px;

}



.thumbnail:hover span{ /*CSS for enlarged image on hover*/

visibility: visible;

top: 0;

left: 10px; /*position where enlarged image should offset horizontally */



}



&lt;/style&gt;

Después sólo nos faltará aplicar este otro en el sitio que queramos mostrarlo bien sea un post o en el -sidebar-:

&lt;a class=&quot;thumbnail&quot; href=&quot;#thumb&quot;&gt;&lt;img src=&quot;http://i81.photobucket.com/albums/j219/jgutierrezs/arbol-2.jpg&quot; width=&quot;100px&quot; height=&quot;100px&quot; border=&quot;0&quot; /&gt;&lt;span&gt;&lt;img src=&quot;http://i81.photobucket.com/albums/j219/jgutierrezs/arbol-2.jpg&quot; /&gt;&lt;br /&gt;Inseguridad&lt;/span&gt;&lt;/a&gt;

ASP 金色功能

&lt;%
    ' Copyright (c) 2008, reusablecode.blogspot.com; some rights reserved.
    '
    ' This work is licensed under the Creative Commons Attribution License. To view
    ' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or
    ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
    ' 94305, USA.

    ' The golden function is the upper branch of the hyperbola.
    function gold(x)
        gold = (x + sqr(x^2 + 4)) / 2
    end function
%&gt;

HTML HTML模板

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=&quot;es&quot; xml:lang=&quot;es&quot;&gt;
&lt;head&gt;
    &lt;title&gt;Title&lt;/title&gt;
    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;sheet.css&quot;&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;/body&gt;
&lt;/html&gt;

Rails product.rb

class Product &lt; ActiveRecord::Base
	validates_presence_of :title, :description, :image_url
	validates_numericality_of :price
	validates_uniqueness_of :title
	validates_format_of :image_url, 
			:with =&gt; %r{\.(gif|jpg|png)$}i, 
			:message =&gt; &quot;must be a URL for a GIF, JPG, or PNG image&quot;
	protected
	def validate
		errors.add(:price, &quot;should be at least 0.01&quot;) if price.nil? || price &lt; 0.01
	end
end

ActionScript 3 RemotingService.as

package{ 
    import flash.net.NetConnection; 
    import flash.net.ObjectEncoding; 
    public class RemotingService extends NetConnection{ 
        function RemotingService(url:String){ 
            objectEncoding = ObjectEncoding.AMF0; 
            connect(url); 
        } 
    } 
}

C++ C ++中字符串的修剪功能

void trim(char *s, const int len)
{
    int end = len - 1;
    int start = 0;
    int i = 0;

    while ((start &lt; len) &amp;&amp; (s[start] &lt;= ' '))
    {
        start++;
    }

    while ((start &lt; end) &amp;&amp; (s[end] &lt;= ' '))
    {
        end--;
    }

    if (start &gt; end)
    {
        memset(s, '\0', len);
        return;
    }

    for (i = 0; (i + start) &lt;= end; i++)
    {
        s[i] = s[start + i];
    }
    memset((s + i), '\0', len - i);
}