1. 代码自动换行

function fun(){
var s = document.getElementByID("dfgfd");
{"asd",{"asd"},"asd",{"asd"},"asd",{"asd"},"asd",{"asd"},"asd",{"asd"},"asd",{"asd"},"asd",{"asd"}}
s.onclick = function sd(){
var s = document.getElementByID("dfgfd");
s.onclick = function sd(){

} var s = document.getElementByID("dfgfd");
s.onclick = function sd(){

}
}
}

  1. 代码高亮

public int void main(String a[]){
System.out.println("Hello World!");

}

def assert_fingerprint(cert, fingerprint):
"""
Checks if given fingerprint matches the supplied certificate.

:param cert:
Certificate as bytes object.
:param fingerprint:
Fingerprint as string of hexdigits, can be interspersed by colons.
"""

fingerprint = fingerprint.replace(":", "").lower()
digest_length = len(fingerprint)
hashfunc = HASHFUNC_MAP.get(digest_length)
if not hashfunc:
raise SSLError("Fingerprint of invalid length: {0}".format(fingerprint))

# We need encode() here for py32; works on py2 and p33.
fingerprint_bytes = unhexlify(fingerprint.encode())

cert_digest = hashfunc(cert).digest()

if not _const_compare_digest(cert_digest, fingerprint_bytes):
raise SSLError(
'Fingerprints did not match. Expected "{0}", got "{1}".'.format(
fingerprint, hexlify(cert_digest)
)
)


def resolve_cert_reqs(candidate):
"""
Resolves the argument to a numeric constant, which can be passed to
the wrap_socket function/method from the ssl module.
Defaults to :data:`ssl.CERT_REQUIRED`.
If given a string it is assumed to be the name of the constant in the
:mod:`ssl` module or its abbreviation.
(So you can specify `REQUIRED` instead of `CERT_REQUIRED`.
If it's neither `None` nor a string we assume it is already the numeric
constant which can directly be passed to wrap_socket.
"""
if candidate is None:
return CERT_REQUIRED

if isinstance(candidate, str):
res = getattr(ssl, candidate, None)
if res is None:
res = getattr(ssl, "CERT_" + candidate)
return res

return candidate

#include <iostream>
using namespace std;
int main()
{
int x, y, n;
for (x=1, n=0; n<9; y=(x+1)*2, x=y, n++);
cout<<"第一天共摘的桃子数量为 "<<x<<endl;
return 0;
}


#region
// 注意到区别g.DrawImage中第二个new Rectangle。目标其实都是new Rectangle(0, 0, iWidth, iHeight),
//缩放算法把整个原始图都往目标区域里塞new Rectangle(0, 0, bmp.Width, bmp.Height),
// 而剪裁只是把原始区域上等宽等高的那个区域new Rectangle(StartX, StartY, iWidth, iHeight)1:1的塞到目标区域里
#endregion

public Bitmap ChangeImgSize(Bitmap bit,double mutiple)
{
int newW =(int) (bit.Width * mutiple);
int newH = (int)(bit.Height * mutiple);
if (newW < 400 || newH < 300)
{
newW = 400;newH = 300;
}
else if (newW > 1960 || newH> 960)
{
newW = 1960; newH = 960;
}

Bitmap newBitmap = new Bitmap(newW, newH);
Graphics g = Graphics.FromImage(newBitmap);

g.Clear(Color.Transparent);
//设置画布的描绘质量
g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
//将原图以新的大小绘制到 新的bitmap中
g.DrawImage(bit, new Rectangle(0, 0, newBitmap.Width, newBitmap.Height), 0, 0, bit.Width, bit.Height, GraphicsUnit.Pixel);
g.Dispose();
return newBitmap;
}