This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <iostream> | |
#include "Shlwapi.h" | |
#pragma comment(lib, "Shlwapi.lib") | |
using namespace std; | |
int main(void) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert a wide Unicode string to an UTF8 string | |
std::string utf8_encode(const std::wstring &wstr) | |
{ | |
int size_needed = WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), NULL, 0, NULL, NULL); | |
std::string strTo(size_needed, 0); | |
WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), &strTo[0], size_needed, NULL, NULL); | |
return strTo; | |
} | |
// Convert an UTF8 string to a wide Unicode String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int map_month_name(char const *mmm) | |
{ | |
static char const *months[] = | |
{ | |
"JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IcoSphereCreator | |
{ | |
private struct TriangleIndices | |
{ | |
public int v1; | |
public int v2; | |
public int v3; | |
public TriangleIndices(int v1, int v2, int v3) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <osgViewer/Viewer> | |
#include <iostream> | |
#include <cmath> | |
#include <osg/Group> | |
#include <osg/Geometry> | |
#include <osg/Geode> | |
#include <osg/PositionAttitudeTransform> | |
#include <osg/PolygonMode> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Father | |
{ | |
public: | |
Father():i_(2){} | |
~Father(){} | |
int GetIValue(){return i_;} | |
void SetIValue(int i){i_ = i;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sqlite3.h> | |
static int callback(void *NotUsed, int argc, char **argv, char **azColName){ | |
int i; | |
for(i=0; i<argc; i++){ | |
printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL"); | |
} | |
printf("\n"); | |
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QSettings settings("test.ini", QSettings::IniFormat); | |
settings.beginGroup("players"); | |
const QStringList childKeys = settings.childKeys(); | |
foreach (const QString &childKey, childKeys) | |
qDebug() << settings.value(childKey); | |
settings.endGroup(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CameraUpdateCallback : public osg::NodeCallback { | |
private: | |
osg::ref_ptr<osg::Camera> mOtherCam; | |
public: | |
CameraUpdateCallback(osg::Camera* otherCam) : mOtherCam(otherCam) { } | |
osg::ref_ptr<osg::Camera> m_sourceCamera; | |
void operator()(osg::Node* node, osg::NodeVisitor* nv) { | |
osg::Camera* cam = static_cast<osg::Camera*>( node ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
///@Author pezy | |
///@Date Aug, 2014 | |
///@See http://www.douban.com/group/topic/61226023/ | |
///Exercise 11.32: | |
///Using the multimap from the previous exercise, write a program to | |
///print the list of authors and their works alphabetically. | |
/// | |
#include <iostream> |
OlderNewer