Ahora ya es posible postear código fuente, bueno... siempre era posible, la diferencia que ahora realiza el coloreado de sintaxis.
Para utilizarlo tienen que usar las etiquetas [ code=LANG ] [ /code ] (!sin espacios!)
Donde LANG puede ser los siguientes: cpp, java, php, html, css, py, js, sql.
Si no les sale coloreado, entonces les falta cargar el css, pueden usar el tema por defecto o cargar las definicios de estilo a su css personalizado.
Espero sus sugerencias!
<?
include 'header.php';
function index(){
echo "Weclcome to my php site!<br><a href="index.php?cmd=section2">Click Here to go to the next section!</a>";
}
function section2(){
echo "Great! You have made it to section 2.<br><a href="index.php">Go back to the index</a>";
}
switch($_REQUEST['cmd']){ //updated to work with register_globals "off";
default:
index();
break;
case "section2":
section2();
break;
}
include 'footer.php';
?>
#!/usr/bin/env python
#....
'''Funcion principal.
dijkstra(filename) -> lista
devuelve las rutas (cortas) a
cada nodo a partir del origen
descritas en _filename_'''
def dijkstra(filename='figure3.grf'):
''' graph dict con el grafo
S lista de nodos procesados
d dict con el costo de la ruta
a cada nodo a partir del origen
pi descripcion de las rutas a
cada nodo
'''
global graph, S, d, pi
#cargamos el grafo con los datos del archivo
graph = dict(map(mkgraph, open(filename).readlines()))
#sacamos nodo origen
source = graph.pop('source')
from decimal import Inf
#todos los nodos con d[nodo] = Inf
#d = dict( [ [v,Inf] for v in graph.iterkeys() ] )
d = dict( map(lambda v: [v, Inf], graph.keys()) )
#todos los nodos con pi[nodo] = None
#pi = dict( [ [v, None] for v in graph.iterkeys() ] )
pi = dict( map(lambda v: [v, None], graph.keys()) )
#inicializamos el origen
d[source], pi[source] = 0, None
#lista de nodos procesados
S=[]
#Procesamos cada nodo restante en d-S
while len(listsub(d,S)) > 0:
#el nodo mas cercano que no haya sido procesado
node = minDist(dict(dlsub(d,S)))
S.append(node)
#relajamos los adyacentes a nodo
doit(node)
#devolvemos las rutas en _pretty format_
return map(pretty, S)
if __name__ == '__main__':
import sys, posix
if len(sys.argv)==2 and posix.lstat(sys.argv[1]):
routes = dijkstra(sys.argv[1])
else: routes = dijkstra()
#impresion de la salida segun Assignment 6, Handout #14
#Computer Science 51, Spring 2002
#FIXME: Same route output order as graph file
for route in routes:
node = route.split('->')[-1].split('(')[0]
line = node+': '
if '->' not in route: line += node+' is the source node'
else: line += route
print line
Palabras clave: código fuente

Comentarios
// XMLReaderAdapter.java - adapt an SAX2 XMLReader to a SAX1 Parser // <a href="http://www.saxproject.org">http://www.saxproject.org</a> // Written by David Megginson // NO WARRANTY! This class is in the public domain. // $Id: XMLReaderAdapter.java,v 1.5.2.3 2002/01/29 21:34:15 dbrownell Exp $ package org.xml.sax.helpers; import java.io.IOException; import java.util.Locale; //... /* * @since SAX 2.0 * @author David Megginson * @version 2.0.1 (sax2r2) * @see org.xml.sax.Parser * @see org.xml.sax.XMLReader */ public class XMLReaderAdapter implements Parser, ContentHandler { public XMLReaderAdapter () throws SAXException { setup(XMLReaderFactory.createXMLReader()); } public XMLReaderAdapter (XMLReader xmlReader) { setup(xmlReader); } private void setup (XMLReader xmlReader) { if (xmlReader == null) { throw new NullPointerException("XMLReader must not be null"); } this.xmlReader = xmlReader; qAtts = new AttributesAdapter(); } //... }Interesante..
sobre todo si es hecho en casa...
class HolaNena { public static void main(String arg[]) { System.out.println("Hola Nena, esto si funciona!!"); } }Rho, felicidades por el trabajo, si funciona!!
[ code=cpp ]
printf(%s,"Vaya.. me gusta esto");
[ /code ]
printf(%s,"Vaya.. me gusta esto, ¿Asi?");//testing from TinyMCE visual editor int *n = &b[0]; for (i = 0; i < 5; i++) *n++ = i * 2;//testing from TinyMCE HTML Source Editor int *n = &b[0]; for (i = 0; i < 5; i++) *n++ = i * 2;//testing from TinyMCE visual editor //using source code with 'LF' EOL int *n = &b[0]; for (i = 0; i < 5; i++) *n++ = i * 2;//testing from TinyMCE HTML Source Editor using //manually inserted 'non-break-space-points' int *n = &b[0]; for (i = 0; i < 5; i++) *n++ = i * 2;/* * @(#)Main.java 1.0, 07/24/09 * * Copyright (c) 2009. Ajayu and friends. All rights reserved. * Use is subject to license terms. */ package net.jmt4b04d4v.ajayu; import javax.swing.SwingUtilities; import org.apache.log4j.Logger; import net.jmt4b04d4v.ajayu.ui.swing.SwingGUI; /** * <p> * <code>Main</code> is the Main class for Ayaju. Ayaju aims to be a pure Java * implementation of Elgg, the current spirit of Ajayu. * </p> * * @author jmt4b04d4v * @version 1.0, 07/24/09 * @since Ayaju-1.0 */ public final class Main { /** Logger for this class. */ private static Logger logger = Logger.getLogger(Main.class); /** * Main method. * * @param args * Command line arguments. */ public static void main(final String[] args) { logger.trace("main(String[])"); final SwingGUI ui = SwingGUI.getInstance(); SwingUtilities.invokeLater(new Runnable() { public void run() { logger.info("Starting Hello!"); ui.setVisible(true); } }); } }Some comments: