Title
- - - -**Lasso** - - 10 - ORDER BY `Name` LIMIT 30'); - Inline: -Username=$DBuser, -Password=$DBpass, -Database=$DBname, -sql=#query; - var("class.name" = (found_count != 0 ? `subtotal` | `nonefound`)); - records; - output: ?>Title
+ + + +## Lasso + + 10 + ORDER BY `Name` LIMIT 30'); + Inline: -Username=$DBuser, -Password=$DBpass, -Database=$DBname, -sql=#query; + var("class.name" = (found_count != 0 ? `subtotal` | `nonefound`)); + records; + output: ?>1234
1234
^eval($i+10)
- ^connect[mysql://host/database]{ - $tab[^table::sql{select * from `table` where a='1'}] - $var_Name[some${value}] - } - } - - ^rem{ - Multiline comment with code: $var - ^while(true){ - ^for[i](1;10){ - ^sleep[] - } - } - } - ^taint[^#0A] - - @GET_base[] - ## Comment for code - # Isn't comment - $result[$.hash_item1[one] $.hash_item2[two]] - -**TeX** - - \documentclass{article} - \usepackage[koi8-r]{inputenc} - \hoffset=0pt - \voffset=.3em - \tolerance=400 - \newcommand{\eTiX}{\TeX} - \begin{document} - \section*{Highlight.js} - \begin{table}[c|c] - $\frac 12\, + \, \frac 1{x^3}\text{Hello \! world}$ & \textbf{Goodbye\~ world} \\\eTiX $ \pi=400 $ - \end{table} - Ch\'erie, \c{c}a ne me pla\^\i t pas! % comment \b - G\"otterd\"ammerung~45\%=34. - $$ - \int\limits_{0}^{\pi}\frac{4}{x-7}=3 - $$ - \end{document} - -**Haskell** - - {-# LANGUAGE TypeSynonymInstances #-} - module Network.UDP - ( DataPacket(..) - , openBoundUDPPort - , openListeningUDPPort - , pingUDPPort - , sendUDPPacketTo - , recvUDPPacket - , recvUDPPacketFrom - ) where - - {- this is a {- nested -} comment -} - - import qualified Data.ByteString as Strict (ByteString, concat, singleton) - import qualified Data.ByteString.Lazy as Lazy (ByteString, toChunks, fromChunks) - import Data.ByteString.Char8 (pack, unpack) - import Network.Socket hiding (sendTo, recv, recvFrom) - import Network.Socket.ByteString (sendTo, recv, recvFrom) - - -- Type class for converting StringLike types to and from strict ByteStrings - class DataPacket a where - toStrictBS :: a -> Strict.ByteString - fromStrictBS :: Strict.ByteString -> a - - instance DataPacket Strict.ByteString where - toStrictBS = id - {-# INLINE toStrictBS #-} - fromStrictBS = id - {-# INLINE fromStrictBS #-} - - openBoundUDPPort :: String -> Int -> IO Socket - openBoundUDPPort uri port = do - s <- getUDPSocket - bindAddr <- inet_addr uri - let a = SockAddrInet (toEnum port) bindAddr - bindSocket s a - return s - - pingUDPPort :: Socket -> SockAddr -> IO () - pingUDPPort s a = sendTo s (Strict.singleton 0) a >> return () - -**Erlang** - - -module(ssh_cli). - - -behaviour(ssh_channel). - - -include("ssh.hrl"). - %% backwards compatibility - -export([listen/1, listen/2, listen/3, listen/4, stop/1]). - - %% state - -record(state, { - cm, - channel - }). - - test(Foo)->Foo. - - init([Shell, Exec]) -> - {ok, #state{shell = Shell, exec = Exec}}; - init([Shell]) -> - false = not true, - io:format("Hello, \"~p!~n", [atom_to_list('World')]), - {ok, #state{shell = Shell}}. - - concat([Single]) -> Single; - concat(RList) -> - EpsilonFree = lists:filter( - fun (Element) -> - case Element of - epsilon -> false; - _ -> true - end - end, - RList), - case EpsilonFree of - [Single] -> Single; - Other -> {concat, Other} - end. - - union_dot_union({union, _}=U1, {union, _}=U2) -> - union(lists:flatten( - lists:map( - fun (X1) -> - lists:map( - fun (X2) -> - concat([X1, X2]) - end, - union_to_list(U2) - ) - end, - union_to_list(U1) - ))). - - -**Erlang REPL** - - 1> Str = "abcd". - "abcd" - 2> L = test:length(Str). - 4 - 3> Descriptor = {L, list_to_atom(Str)}. - {4,abcd} - 4> L. - 4 - 5> b(). - Descriptor = {4,abcd} - L = 4 - Str = "abcd" - ok - 6> f(L). - ok - 7> b(). - Descriptor = {4,abcd} - Str = "abcd" - ok - 8> {L, _} = Descriptor. - {4,abcd} - 9> L. - 4 - 10> 2#101. - 5 - 11> 1.85e+3. - 1850 - -**Rust** - - use std; - - import std::io; - export fac, test1; - - 123; // type int - 123u; // type uint - 123_u; // type uint - 0xff00; // type int - 0xff_u8; // type u8 - 0b1111_1111_1001_0000_i32; // type i32 - 123.0; // type float - 0.1; // type float - 3f; // type float - 0.1f32; // type f32 - 12E+99_f64; // type f64 - - /* Factorial */ - fn fac(n: int) -> int { - let s: str = "This is - a multi-line string. - - It ends with an unescaped '\"'."; - let c: char = 'Ф'; - - let result = 1, i = 1; - while i <= n { // No parens around the condition - result *= i; - i += 1; - } - ret result; - } - - pure fn pure_length^eval($i+10)
+ ^connect[mysql://host/database]{ + $tab[^table::sql{select * from `table` where a='1'}] + $var_Name[some${value}] + } + } + + ^rem{ + Multiline comment with code: $var + ^while(true){ + ^for[i](1;10){ + ^sleep[] + } + } + } + ^taint[^#0A] + + @GET_base[] + ## Comment for code + # Isn't comment + $result[$.hash_item1[one] $.hash_item2[two]] + +## TeX + + \documentclass{article} + \usepackage[koi8-r]{inputenc} + \hoffset=0pt + \voffset=.3em + \tolerance=400 + \newcommand{\eTiX}{\TeX} + \begin{document} + \section*{Highlight.js} + \begin{table}[c|c] + $\frac 12\, + \, \frac 1{x^3}\text{Hello \! world}$ & \textbf{Goodbye\~ world} \\\eTiX $ \pi=400 $ + \end{table} + Ch\'erie, \c{c}a ne me pla\^\i t pas! % comment \b + G\"otterd\"ammerung~45\%=34. + $$ + \int\limits_{0}^{\pi}\frac{4}{x-7}=3 + $$ + \end{document} + +## Haskell + + {-# LANGUAGE TypeSynonymInstances #-} + module Network.UDP + ( DataPacket(..) + , openBoundUDPPort + , openListeningUDPPort + , pingUDPPort + , sendUDPPacketTo + , recvUDPPacket + , recvUDPPacketFrom + ) where + + {- this is a {- nested -} comment -} + + import qualified Data.ByteString as Strict (ByteString, concat, singleton) + import qualified Data.ByteString.Lazy as Lazy (ByteString, toChunks, fromChunks) + import Data.ByteString.Char8 (pack, unpack) + import Network.Socket hiding (sendTo, recv, recvFrom) + import Network.Socket.ByteString (sendTo, recv, recvFrom) + + -- Type class for converting StringLike types to and from strict ByteStrings + class DataPacket a where + toStrictBS :: a -> Strict.ByteString + fromStrictBS :: Strict.ByteString -> a + + instance DataPacket Strict.ByteString where + toStrictBS = id + {-# INLINE toStrictBS #-} + fromStrictBS = id + {-# INLINE fromStrictBS #-} + + openBoundUDPPort :: String -> Int -> IO Socket + openBoundUDPPort uri port = do + s <- getUDPSocket + bindAddr <- inet_addr uri + let a = SockAddrInet (toEnum port) bindAddr + bindSocket s a + return s + + pingUDPPort :: Socket -> SockAddr -> IO () + pingUDPPort s a = sendTo s (Strict.singleton 0) a >> return () + +## Erlang + + -module(ssh_cli). + + -behaviour(ssh_channel). + + -include("ssh.hrl"). + %% backwards compatibility + -export([listen/1, listen/2, listen/3, listen/4, stop/1]). + + %% state + -record(state, { + cm, + channel + }). + + test(Foo)->Foo. + + init([Shell, Exec]) -> + {ok, #state{shell = Shell, exec = Exec}}; + init([Shell]) -> + false = not true, + io:format("Hello, \"~p!~n", [atom_to_list('World')]), + {ok, #state{shell = Shell}}. + + concat([Single]) -> Single; + concat(RList) -> + EpsilonFree = lists:filter( + fun (Element) -> + case Element of + epsilon -> false; + _ -> true + end + end, + RList), + case EpsilonFree of + [Single] -> Single; + Other -> {concat, Other} + end. + + union_dot_union({union, _}=U1, {union, _}=U2) -> + union(lists:flatten( + lists:map( + fun (X1) -> + lists:map( + fun (X2) -> + concat([X1, X2]) + end, + union_to_list(U2) + ) + end, + union_to_list(U1) + ))). + +## Erlang REPL + + 1> Str = "abcd". + "abcd" + 2> L = test:length(Str). + 4 + 3> Descriptor = {L, list_to_atom(Str)}. + {4,abcd} + 4> L. + 4 + 5> b(). + Descriptor = {4,abcd} + L = 4 + Str = "abcd" + ok + 6> f(L). + ok + 7> b(). + Descriptor = {4,abcd} + Str = "abcd" + ok + 8> {L, _} = Descriptor. + {4,abcd} + 9> L. + 4 + 10> 2#101. + 5 + 11> 1.85e+3. + 1850 + +## Rust + + use std; + + import std::io; + export fac, test1; + + 123; // type int + 123u; // type uint + 123_u; // type uint + 0xff00; // type int + 0xff_u8; // type u8 + 0b1111_1111_1001_0000_i32; // type i32 + 123.0; // type float + 0.1; // type float + 3f; // type float + 0.1f32; // type f32 + 12E+99_f64; // type f64 + + /* Factorial */ + fn fac(n: int) -> int { + let s: str = "This is + a multi-line string. + + It ends with an unescaped '\"'."; + let c: char = 'Ф'; + + let result = 1, i = 1; + while i <= n { // No parens around the condition + result *= i; + i += 1; + } + ret result; + } + + pure fn pure_length