Песочница

Материал из Wiki.crossplatform.ru

(Различия между версиями)
Перейти к: навигация, поиск
(Пример: исходник Boost)
(Geshi test)
Строка 226: Строка 226:
   j++;  /* this line has no lasting effect */
   j++;  /* this line has no lasting effect */
}</geshi>
}</geshi>
 +
 +
== Забавный глюк ==
 +
код обернут в тэг '''nowiki''' и помещен в шаблон {{tl|code}}
 +
 +
{{code
 +
|boost
 +
|code=<nowiki>#include <iostream>
 +
#include <boost/tokenizer.hpp>
 +
#include <string>
 +
 +
int main()
 +
{
 +
  std::string str = ";;Hello|world||-foo--bar;yow;baz|";
 +
  typedef boost::tokenizer<boost::char_separator<char> >
 +
    tokenizer;
 +
  boost::char_separator<char> sep("-;|");
 +
  tokenizer tokens(str, sep);
 +
  for (tokenizer::iterator tok_iter = tokens.begin();
 +
      tok_iter != tokens.end(); ++tok_iter)
 +
    std::cout << "<" << *tok_iter << "> ";
 +
  std::cout << "\n";
 +
  return EXIT_SUCCESS;
 +
}</nowiki>
 +
}}
 +
 +
код обернут в тэг '''nowiki'''без шаблона
 +
 +
<nowiki>#include <iostream>
 +
#include <boost/tokenizer.hpp>
 +
#include <string>
 +
 +
int main()
 +
{
 +
  std::string str = ";;Hello|world||-foo--bar;yow;baz|";
 +
  typedef boost::tokenizer<boost::char_separator<char> >
 +
    tokenizer;
 +
  boost::char_separator<char> sep("-;|");
 +
  tokenizer tokens(str, sep);
 +
  for (tokenizer::iterator tok_iter = tokens.begin();
 +
      tok_iter != tokens.end(); ++tok_iter)
 +
    std::cout << "<" << *tok_iter << "> ";
 +
  std::cout << "\n";
 +
  return EXIT_SUCCESS;
 +
}</nowiki>

Версия 22:33, 11 января 2009

Содержание

Пример списка

1

  1. one
  2. two
//
      Строка 1
      Строка 2
      Строка 3
 
      Строка 1
      Строка 2
      Строка 3
  1. three
    1. three point


2

  1. one
          Строка 1
    
     Строка 2
     Строка 3
     Строка 1
     Строка 2
     Строка 3
##three point two


3

  1. one
  2. two
          Строка 1
          Строка 2
          Строка 3
        
          Строка 1
          Строка 2
          Строка 3
        
  3. three
    1. three point one
    2. three point two


4

  1. one
  2. two
    //-----
          QLabel lbl1;
          QString str;
          Строка 3
     
          Строка 1
          Строка 2
          Строка 3
    //-----
          QLabel lbl1;
          QString str;
          Строка 3
     
          Строка 1
          Строка 2
          Строка 3
  3. three
    1. three point one
    2. three point two

Пример: исходник C/C++

#include <stdio.h>
 
void f(void); 
 
int main(void)
{
  int i; 
  for(i=0; i<10; i++)  f();
  return 0;
}
 
void f(void)
{
  int j = 10;
  printf("%d ", j);
  j++;  /* this line has no lasting effect */
}

Пример: исходник ACE

#include <stdio.h>
 
void f(void); 
 
int main(void)
{
  int i; 
  for(i=0; i<10; i++)  f();
  return 0;
}
 
void f(void)
{
  int j = 10;
  printf("%d ", j);
  j++;  /* this line has no lasting effect */
}

Пример: исходник Boost

#include <iostream>
#include <boost/tokenizer.hpp>
#include <string>
 
int main()
{
  std::string str = ";;Hello|world||-foo--bar;yow;baz|";
  typedef boost::tokenizer<boost::char_separator<char> > 
    tokenizer;
  boost::char_separator<char> sep("-;|");
  tokenizer tokens(str, sep);
  for (tokenizer::iterator tok_iter = tokens.begin();
       tok_iter != tokens.end(); ++tok_iter)
    std::cout << "<" << *tok_iter << "> ";
  std::cout << "\n";
  return EXIT_SUCCESS;
}

Пример: исходник GTK+

#include <stdio.h>
 
void f(void); 
 
int main(void)
{
  int i; 
  for(i=0; i<10; i++)  f();
  return 0;
}
 
void f(void)
{
  int j = 10;
  printf("%d ", j);
  j++;  /* this line has no lasting effect */
}

Пример: исходник Qt

//
    QString locale = QLocale::system().name(); // запрос языка (например: "ru")
    QTranslator* translator = new QTranslator; 
    translator->load(QString("qt_") + locale); // загрузка файла qt_*.qm
    app.installTranslator(translator);         // устанока переводчика

Пример: исходник WxWidgets

#include <stdio.h>
 
void f(void); 
 
int main(void)
{
  int i; 
  for(i=0; i<10; i++)  f();
  return 0;
}
 
void f(void)
{
  int j = 10;
  printf("%d ", j);
  j++;  /* this line has no lasting effect */
}

Geshi test

<geshi lang=cpp lines=0 source=SOURCE>#include <stdio.h>

void f(void);

int main(void) {

 int i; 
 for(i=0; i<10; i++)  f();
 return 0;

}

void f(void) {

 int j = 10;
 printf("%d ", j);
 j++;  /* this line has no lasting effect */

}</geshi>

Забавный глюк

код обернут в тэг nowiki и помещен в шаблон {{code}}

UNIQ755cc47f778edcf-nowiki-0000000C-QINU

код обернут в тэг nowikiбез шаблона

#include <iostream> #include <boost/tokenizer.hpp> #include <string> int main() { std::string str = ";;Hello|world||-foo--bar;yow;baz|"; typedef boost::tokenizer<boost::char_separator<char> > tokenizer; boost::char_separator<char> sep("-;|"); tokenizer tokens(str, sep); for (tokenizer::iterator tok_iter = tokens.begin(); tok_iter != tokens.end(); ++tok_iter) std::cout << "<" << *tok_iter << "> "; std::cout << "\n"; return EXIT_SUCCESS; }