Skip to content

Instantly share code, notes, and snippets.

View yifu's full-sized avatar

Yves Baumes yifu

  • Montpellier, France
View GitHub Profile
@yifu
yifu / server.cpp
Created September 21, 2012 14:36
Chat room with asio.
#include <iostream>
#include <boost/asio.hpp>
using namespace std;
using namespace boost;
using namespace boost::asio;
using namespace boost::asio::ip;
using namespace boost::system;
int main(int argc, char *argv[])
@yifu
yifu / main.cpp
Created September 21, 2012 14:36
locale exemple
#include <iostream>
#include <locale>
using namespace std;
int main()
{
setlocale(LC_CTYPE,"");
wchar_t orig = 2222; //3333 is the deciaml value of unicode character.
wcout <<orig<< endl;
return 0;
@yifu
yifu / syntax-check.cpp
Created September 21, 2012 14:37
Clang framework tutorial.
#include <clang-c/Index.h>
#include <iostream>
#include <string>
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
// gcc -I /data/mag/ut0tyb/llvm-3.0/include/ /data/mag/ut0tyb/llvm-3.0/lib/libclang.a syntax-check.cpp
/////////////////////////////////////////////////////
@yifu
yifu / list.c
Created September 21, 2012 14:38
Material for the clang framework tutorial.
#include <string>
struct List{
int Data;
struct List *Next;
};
int sum(struct List *Node) {
int result = 0;
@yifu
yifu / another.cpp
Created September 21, 2012 14:39
Another exemple for the clang framework tutorial.
namespace {
int GlobalValue = 5;
}
class AAA
{
public:
int aaa;
private:
int bbb;
#include <ace/Time_Value.h>
#include <ctime>
#include <iostream>
#include <deque>
#include <vector>
#include <list>
#include <limits>
using namespace std;
#include <iostream>
bool f (const bool& b = bool(true))
{
return b;
}
using namespace std;
#include <string>
#include <cstring>
int main()
{
// const std::string test (0/*NULL*/);
const std::string test (0/*NULL*/, std::strlen(0));
}
#include <algorithm>
#include <iostream>
#include <iterator>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// --------------------------------------------------------------------------
#include <algorithm>
#include <iostream>
#include <iterator>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// --------------------------------------------------------------------------