Highlight Code Syntax in WordPress Tips

To high-light the syntax in WordPress, install WP-Syntax and wrap code blocks with

<pre lang="LANGUAGE" line="1"> and</pre>, where LANGUAGE is

  • A: abap, actionscript, actionscript3, ada, apache, applescript, apt_sources, asm, asp, autoit, avisynth,
  • B: bash, bf, bibtex, blitzbasic, bnf, boo,
  • C: c, c_mac, caddcl, cadlisp, cil, cfdg, cfm, cmake, cobol, cpp-qt, cpp,csharp,css,
  • D: d, dcs, delphi, diff, div, dos, dot,
  • E: eiffel, email, erlang,
  • F: fo, fortran, freebasic,
  • G: genero, gettext, glsl, gml, gnuplot, groovy,
  • H: haskell, hq9plus, html4strict,
  • I: idl, ini, inno, intercal, io,
  • J: java,java5,javascript,
  • K: kixtart, klonec, klonecpp,
  • L: latex, lisp, locobasic, lolcode lotusformulas, lotusscript, lscript, lsl2, lua,
  • M: m68k, make, matlab, mirc, modula3, mpasm, mxml, mysql,
  • N: nsis,
  • O: oberon2, objc, ocaml-brief, ocaml, oobas, oracle11, oracle8,
  • P: pascal, per, pic16, pixelbender, perl, php-brief, php, plsql, povray, powershell, progress, prolog, properties, providex, python,
  • Q: qbasic,
  • R: rails, rebol, reg, robots, ruby,
  • S: sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql,
  • T: tcl, teraterm, text, thinbasic, tsql, typoscript,
  • V: vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog,
  • W: whitespace, whois, winbatch,
  • X: xml, xorg_conf, xpp,
  • Z: z80

For more info, check out more usage info.

Then copy this following code to your template/index.html file

import os
import re
import time
import sys

lifeline = re.compile(r"(\d) received")
report = ("No response","Partial Response","Alive")

print time.ctime()

for host in range(60,70):
   ip = "192.168.200."+str(host)
   pingaling = os.popen("ping -q -c2 "+ip,"r")
   print "Testing ",ip,
   sys.stdout.flush()
   while 1:
      line = pingaling.readline()
      if not line: break
      igot = re.findall(lifeline,line)
      if igot:
           print report[int(igot[0])]

print time.ctime()
-(void)setEditing:(BOOL)editing animated:(BOOL) animated {
    [ super setEditing:editing animated:animated];
    [ tableView setEditing:editing animated:animated];
    [ tableView reloadData];
}