Diferencia entre revisiones de «Sandbox»

De Cuba-Wiki
m (Agregué sección para contener mi testeo)
(Sin diferencias)

Revisión del 00:40 8 jul 2016

Página para jugar un poco con la Wiki o probar como quedaria el codigo en un articulo de verdad. Cada uno puede hacer lo que quiera.

Syntax Highlighting

<source lang="php"> <?php

   $v = "string";    // sample initialization

?> html text <?

   echo $v;         // end of php code

?> </source>

<source lang="java" line="1"> /* This is a regular multi-

* line comment. */

import java.io.*;

/**

* This is a javadoc comment
* @see java.lang.String
*/

public class Main extends Foo {

   @Test
   public static void main(final String[] args)
   {
       // This is a one-line comment
       System.out.println("Hello, World!");
       int n = 1 + 2;
       System.out.println("One plus two is: " + n);
       Foo foo = new Foo("foo");
       List<Foo> list = new ArrayList<Foo>();
       list.add(foo);
   }

} </source>


<source lang="python"> import time import threading import Network from CliqueIPC.RunnerThread import RunnerThread

  1. Dispatcher

class Dispatcher(RunnerThread):

   """
   """
   def __init__(self):
       RunnerThread.__init__(self, "Dispatcher")
       self.__connection = None
       self.__connection_lock = threading.Lock()
   def Iteration(self):
       if self.__connection_lock.acquire() and self.__connection:
           Network.Protocol.RequestCommandHeader(self.__connection)
           cl = self.__connection.GetEscaped().split()
           
           print "Dispatching:", cl
           mod = __import__(cl[0])
           # server-side process file
           mod.ss_process_file(self.__connection, cl[1], cl[2], cl[3])
           
           # release module
           del mod
           
           self.__connection.Close()
           self.__connection = None
           self.__connection_lock.release()
       else:
           # wait
           self.__connection_lock.release()
           time.sleep(0.01)
   def IsConnected(self):
       self.__connection_lock.acquire()
       localst = (self.__connection != None)
       self.__connection_lock.release()
       return localst
   def ConnectTo(self, con):
       self.__connection_lock.acquire()
       self.__connection = con
       self.__connection_lock.release()
   
  1. DispatcherTasksMgr

class DispatcherTasksMgr:

   """
   """
   def __init__(self, max_dispatchers):
       self.__thread_pool = []
       for i in range(max_dispatchers):
           self.__thread_pool.append(Dispatcher())
   def Start(self):
       for t in self.__thread_pool:
           t.start()
   def Stop(self):
       for t in self.__thread_pool:
           t.Stop()
   def FreeSlots(self):
       freeslots = 0
       for t in self.__thread_pool:
           if not t.IsConnected():
               freeslots += 1
       return freeslots
   # AddJob
   # precondition: FreeSlots() > 0
   def AddJob(self, con):
       for t in self.__thread_pool:
           if not t.IsConnected():
               t.ConnectTo(con)
               return

</source>

Uml plugin

<uml> Begin.b;

 State.reading("Reading commands")();
 State.processing("Processing commands")();

End.e;

State.composite("Working")(b, reading, processing, e); composite.info.left := composite.info.right := 10; composite.info.drawNameLine := 1;

topToBottom(20)(b, reading, processing, e); drawObject(composite);

clink(transition)(b, reading); clink(transition)(reading, processing); clink(transition)(processing, e);

ExitPoint.exit; exit.c=(composite.right, reading.midy); drawObject(exit); item(iAssoc)("error")(obj.nw = exit.s);

clink(transition)(reading, exit);

State.error("Preparing error report")(); State.result("Writing result")(); End.theEnd;

topToBottom(20)(error, result, theEnd); leftToRight(30)(exit, error);

drawObjects(error, result, theEnd);

clink(transition)(exit, error); clink(transition)(error, result); clink(transition)(result, theEnd);

link(transition)(rpathHorizontal(result.w, composite.right)); </uml>

Graphviz plugin

<graphviz> digraph G {Hello->World} </graphviz>

<graphviz> digraph G {

               node [shape=plaintext];
               Mollusca [URL="Mollusca"];
               Neomeniomorpha [URL="Neomeniomorpha"];
               X1 [shape=point,label=""];
               Caudofoveata [URL="Caudofoveata"];
               Testaria [URL="Testaria"];
               Polyplacophora [URL="Polyplacophora"];
               Conchifera [URL="Conchifera"];
               Tryblidiida [URL="Tryblidiida"];
               Ganglioneura [URL="Ganglioneura"];
               Bivalvia [URL="Bivalvia"];
               X2 [shape=point,label=""];
               X3 [shape=point,label=""];
               Scaphopoda [URL="Scaphopoda"];
               Cephalopoda [URL="Cephalopoda"];
               Gastropoda [URL="Gastropoda"];
               Mollusca->X1->Testaria->Conchifera->Ganglioneura->X2->Gastropoda
               Mollusca->Neomeniomorpha
               X1->Caudofoveata
               Testaria->Polyplacophora
               Conchifera->Tryblidiida
               Ganglioneura ->Bivalvia
               X2->X3->Cephalopoda
               X3->Scaphopoda

} </graphviz>

Latexin?

Sensible and humble engineering soul


Símbolos matemáticos sin usar latex =

Opérateurs binaires

HTML Unicode Rendu TeX Rendu
&times; &#xd7; × \times
&divide; &#xf7; ÷ \div
&minus; &#x2212; -
&lowast; &#x2217; \star
&#8729; &#x2219; \bullet
&and; &#x2227; \land
&or; &#x2228; \lor
&cap; &#x2229; \cup
&cup; &#x222a; \cup
&oplus; &#x2295; \oplus
&otimes; &#x2297; \otimes
&sdot; &#x22c5; \cdot

Relations binaires

HTML Unicode Rendu TeX Rendu
&equiv; &#x2261; \equiv
&le; &#x2264; \leq
&#x2a7d; \leqslant
&ge; &#x2265; \geq
&#x2a7e; \geqslant
&isin; &#x2208 \in
&ni; &#x220b; \ni
&prop; &#x221d; \propto
&there4; &#x2234;
&sim; &#x223c; \sim
&cong; &#x2245; \cong
&asymp; &#x2248; \approx
&sub; &#x2282; \subset
&sup; &#x2283; \supset
&sube; &#x2286; \subseteq
&supe; &#x2287; \supseteq


Négations de relations binaires

HTML Unicode Rendu TeX Rendu
&ne &#x2260; \neq
&#x2262; \not\equiv
&notin; &#x2209; \not\in
&nsub; &#x2284; \not\subset
&#x2285; \not\supset

Flèches

Liste complète

HTML Unicode Rendu TeX Rendu
&larr; &#x2190; \leftarrow
\gets
&uarr; &#x2191; \uparrow
&rarr; &#x2192; \rightarrow
\to
&darr; &#x2193; \downarrow
&harr; &#x2194; \leftrightarrow
&#8597; &#x2195; \updownarrow
&#8598; &#x2196; \nwarrow
&#8599; &#x2197; \nearrow
etc. jusqu'à &#x21ff;
&#x256d;
&#x256e;
&#x256f;
&#x2570;
&#x2794;
&#x2798;
&#x2799;
&#x279a;
&#x279b;
&#x279c;
&#x279d;
&#x279e;
etc. jusqu'à &#x27be;
&#x2900;
&#x2901;
&#x2902;
&#x2903;
&#x2904;
&#x2905;
&#x2906;
&#x2907;
&#x2908;
etc. jusqu'à &#x297f;

Caractères grecs

Liste complète

HTML Unicode Rendu TeX Rendu
&alpha; &#x03b1; α \alpha
&Alpha; &#x0391; Α \Alpha
&beta; &#x03b2; β \beta
&Beta; &#x0392; Β \Beta
&gamma; &#x03b3; γ \gamma
&Gamma; &#x0393; Γ \Gamma
&epsilon; &#x03b5; ε \epsilon
&#x03f5; ϵ \varepsilon
&tetha; &#x03b8; θ \theta
&thetasym; &#x03d1; ϑ \vartheta
&kappa; &#x03ba; κ \kappa
&#x03f0; ϰ \varkappa
&pi; &#x03c0; π \pi
&piv; &#x03d6; ϖ \varpi
&rho; &#x03c1; ρ \rho
\varrho
&sigma; &#x03c3; σ \sigma
&sigmaf; &#x03c2; ς \varsigma
&phi; &#x03c6; φ \phi
&#x03d5; ϕ \varphi
&#x03dd; Ϟ
&#x03dc; Ϝ \digamma
\mho
etc. jusqu'à &#x03f6;

Quiero ver si logueado me pide captcha o no.