Skip to content

Instantly share code, notes, and snippets.

View Riateche's full-sized avatar

Pavel Strakhov Riateche

  • Moscow Institute of Physics and Technology
  • Moscow
View GitHub Profile
/* See LICENSE file for copyright and license details. */
/* appearance */
static const char font[] = "-*-*-medium-*-*-*-14-*-*-*-*-*-iso10646-*"; // this font supports unicode
static const char normbordercolor[] = "#444444";
static const char normbgcolor[] = "#222222";
static const char normfgcolor[] = "#bbbbbb";
static const char selbordercolor[] = "#00ff00";
static const char selbgcolor[] = "#001000";
static const char selfgcolor[] = "#eeeeee";
Item drop_random_item() {
int r = rand(0, total_chance_sum);
int current_sum = 0;
for(int i = 0; i < items.count(); i++) {
if (current_sum <= r && r < current_sum + items[i].chance) return items[i];
current_sum += items[i].chance;
}
}
namespace hsp {
class File;
class Properties_widget;
template<class T>
class Properties_registry_entry {
public:
Properties_registry_entry() {}
Making all in data
make[1]: Entering directory `/home/ri/programs/emperor/data'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ri/programs/emperor/data'
Making all in po
make[1]: Entering directory `/home/ri/programs/emperor/po'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ri/programs/emperor/po'
Making all in src
make[1]: Entering directory `/home/ri/programs/emperor/src'
#include <iostream>
using namespace std;
class ListItem {
public:
int d;
ListItem *next;
};
class MyClass {
#include <stdio.h>
#include <string.h>
int main() {
FILE * file = popen("/usr/bin/crontab", "w");
const char* command = "* * * * * /bin/true\n";
fwrite(command, 1, strlen(command), file);
pclose(file);
}
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
int main() {
int fd[2], kol = 0, i;
char instr[30], outstr[30], symb;
template<class T>
void create(const QString& type_name, qint64 width, qint64 height, qint64 depth) {
QVariant(T); // test if T can be converted to QVariant
_array = _project->create_block<Variant_3d_array>(_project->next_block_id());
_array->create<T>(type_name, width, height, depth);
}
#include "window.h"
#include <QKeyEvent>
#include <QtCore/QRegExp>
#include <QtGui/QMessageBox>
#include <QGraphicsTextItem>
#include <QFont>
#include <QTransform>
#include <QTimeLine>
#include <QGraphicsItemAnimation>
#include <QDebug>
import sip
sip.setapi('QString', 2)
sip.setapi('QVariant', 2)
from PyQt4 import QtCore, QtGui
class TableModel(QtCore.QAbstractTableModel):
"""
A simple 5x4 table model to demonstrate the delegates