code
stringlengths
1
2.06M
language
stringclasses
1 value
#include "mm.h" #include "hvcall.h" // This is mainly adapted from graf's code int mm_insert_htab_entry(u64 va_addr, u64 lpar_addr, u64 prot, u64 * index) { u64 hpte_group, hpte_index = 0, hpte_v, hpte_r, hpte_evicted_v, hpte_evicted_r; hpte_group = (((va_addr >> 28) ^ ((va_addr & 0xFFFFFFFULL) >> 12)) &...
C++
#include <cell/error.h> #include <cell/sysmodule.h> #include <sysutil/sysutil_sysparam.h> #include <stdio.h> #include <string.h> #include <math.h> #include <sys/timer.h> #include <cell/cell_fs.h> #include <cell/gcm.h> #include <cell/control_console.h> #include <sysutil/sysutil_sysparam.h> #include...
C++
#include "common.h" #include "peek_poke.h" #include "hvcall.h" #include "mm.h" #include <string.h> #include <psl1ght/lv2.h> u64 mmap_lpar_addr; extern unsigned char bdemu[0x1380]; int map_lv1() { int result = lv1_undocumented_function_114(HV_START_OFFSET, HV_PAGE_SIZE, HV_SIZE, &mmap_lpar_addr); if (result != 0) ret...
C++
#include "peek_poke.h" int poke_syscall = 7; u64 lv2_peek(u64 address) { return Lv2Syscall1(6, address); } void lv2_poke(u64 address, u64 value) { Lv2Syscall2(poke_syscall, address, value); } void lv2_poke32(u64 address, u32 value) { u32 next = lv2_peek(address) & 0xffffffff; lv2_poke(address, (u64) value << 32...
C++
/* # Portions of code and idea for localization by: # (c) 2006 Eugene Plotnikov <e-plotnikov@operamail.com> # SMS Media Player for PS2 / PS2DEV Open Source Project # Used: SMS_Locale.h, SMS_Locale.c */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "language.h" static unsigned char...
C++
#include <stdio.h> #include <string.h> #include <sys/process.h> SYS_PROCESS_PARAM(1001, 0x10000) int main(int argc, char **argv) { (void) argc; char tn[128]; char filename[128]; sprintf(tn, "%s", argv[0]); char *pch=tn; char *pathpos=strrchr(pch,'/'); pathpos[0]=0; sprintf(filename, "%s/RE...
C++
#include "mscommon.h" static int audioInitCell(void); // SPURS information #define SPURS_SPU_NUM 1 #define SPU_THREAD_GROUP_PRIORITY 128 CellSpurs spurs __attribute__((aligned (128))); sys_ppu_thread_t s_MultiStreamPuThread = 0; void * s_pMultiStreamMemory = NULL; #define...
C++
#include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <assert.h> #include <string.h> #include <dirent.h> #include <unistd.h> #include <fcntl.h> #include <time.h> #include <math.h> #include <stddef.h> #include <netdb.h> #include <stdbool.h> #include <sys/synchronization.h> #include <sys/spu...
C++
#include "hvcall.h" #include "peek_poke.h" int lv1_insert_htab_entry(u64 htab_id, u64 hpte_group, u64 hpte_v, u64 hpte_r, u64 bolted_flag, u64 flags, u64 * hpte_index, u64 * hpte_evicted_v, u64 * hpte_evicted_r) { INSTALL_HVSC_REDIRECT(0x9E); // redirect to hvcall 158 // call lv1_insert_htab_entry u64 re...
C++
// _I_.h : main header file for the _I_ application // #if !defined(AFX__I__H__5161CB99_70DA_47CD_AED4_CDECAAA8D92B__INCLUDED_) #define AFX__I__H__5161CB99_70DA_47CD_AED4_CDECAAA8D92B__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #ifndef __AFXWIN_H__ #error include 'stdafx.h' befo...
C++
// MainFrm.h : interface of the CMainFrame class // ///////////////////////////////////////////////////////////////////////////// #if !defined(AFX_MAINFRM_H__E63E34E0_F1D1_4B0B_9A9F_F995B64D0005__INCLUDED_) #define AFX_MAINFRM_H__E63E34E0_F1D1_4B0B_9A9F_F995B64D0005__INCLUDED_ #if _MSC_VER > 1000 #pragma once...
C++
// _I_Doc.h : interface of the C_I_Doc class // ///////////////////////////////////////////////////////////////////////////// #if !defined(AFX__I_DOC_H__26FAAC3C_F2B1_44CF_9407_3E1633F04A29__INCLUDED_) #define AFX__I_DOC_H__26FAAC3C_F2B1_44CF_9407_3E1633F04A29__INCLUDED_ #if _MSC_VER > 1000 #pragma once #end...
C++
// stdafx.cpp : source file that includes just the standard includes // _I_.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h"
C++
// _I_View.h : interface of the C_I_View class // ///////////////////////////////////////////////////////////////////////////// #if !defined(AFX__I_VIEW_H__75D881CE_AE01_44F7_8ABF_062050986ABD__INCLUDED_) #define AFX__I_VIEW_H__75D881CE_AE01_44F7_8ABF_062050986ABD__INCLUDED_ #if _MSC_VER > 1000 #pragma once ...
C++
// _I_.cpp : Defines the class behaviors for the application. // #include "stdafx.h" #include "_I_.h" #include "MainFrm.h" #include "_I_Doc.h" #include "_I_View.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ////////////////////////////////////////...
C++
// SC.h : main header file for the SC application // #if !defined(AFX_SC_H__31046A8F_CDB6_43A4_A4E7_77300BF8E218__INCLUDED_) #define AFX_SC_H__31046A8F_CDB6_43A4_A4E7_77300BF8E218__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #ifndef __AFXWIN_H__ #error include 'stdafx.h' before i...
C++
// stdafx.cpp : source file that includes just the standard includes // SC.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h"
C++
// HaarDWT.h : main header file for the HAARDWT application // #if !defined(AFX_HAARDWT_H__928D14AE_D76A_43B2_AD51_CB15BC20FB53__INCLUDED_) #define AFX_HAARDWT_H__928D14AE_D76A_43B2_AD51_CB15BC20FB53__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #ifndef __AFXWIN_H__ #error include...
C++
// HaarDWT.cpp : Defines the class behaviors for the application. // #include "stdafx.h" #include "HaarDWT.h" #include "HaarDWTDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif //////////////////////////////////////////////////////////////////////////...
C++
#if !defined(AFX_LOADDATA_H__F0E2AFF9_767E_49AC_8462_9173D1AF04C6__INCLUDED_) #define AFX_LOADDATA_H__F0E2AFF9_767E_49AC_8462_9173D1AF04C6__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // loaddata.h : header file // #include "HaarDWTDlg.h" //////////////////////////////////////////////...
C++
// stdafx.cpp : source file that includes just the standard includes // HaarDWT.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h"
C++
#include "stdio.h" #include "stdlib.h" #include "string.h" typedef unsigned char T_U8; /* unsigned 8 bit integer */ typedef char T_S8; /* unsigned 8 bit integer */ typedef unsigned int T_U32,T_BOOL; /* unsigned 32 bit integer */ typedef signed int T_S32; /* signed 32 bit integer ...
C++
/** * @FILE: * @BRIEF: * @Copyright (C) 2011 . * @AUTHOR: WX * @DATE: 2011-02-28 * @VERSION: 1.0 * @REF:this file depends by STL and WIN API. */ #include <windows.h> #include <iostream> #include <string> #include <list> using namespace std; #define ENABLE_DEBUG_OUTPUT #define Debug_...
C++
#include "stdio.h" #include "test_define.h" struct st_List{ char first;//4 short second;//2 char third;//1 long fouth;//4 char fifth;//1 }; void main() { unsigned long pad_cnt = 0; struct_pad_dump(struct st_List, first, offsetof(struct st_List, second), pad_cnt); struct_pad_d...
C++
#include<stdio.h> #include<string.h> #include<iostream.h> void main() { double d=12345.65898; char *p; p="hello"; sprintf(p,"lf",d); cout<<p<<endl; }
C++
#include <stdio.h> struct st_bittype_a{ struct { int a:6; int b:4; int c:4; int d:3; } test; int e:1; }; struct st_bittype_b{ int a:6; int b:4; int c:4; int d:3; int e:1; }; void main() { int a=0x00070001; int b=0x000007ff; int c=a|b; printf("%08X | %08X = %0...
C++
// WPDlg.h : header file // #if !defined(AFX_WPDLG_H__189E2E5A_4C20_45AD_815C_5E8E8980D318__INCLUDED_) #define AFX_WPDLG_H__189E2E5A_4C20_45AD_815C_5E8E8980D318__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 ////////////////////////////////////////////////////////////////////////////...
C++
// WP.h : main header file for the WP application // #if !defined(AFX_WP_H__4E72150A_D583_4280_BE28_7EF7EB0AB988__INCLUDED_) #define AFX_WP_H__4E72150A_D583_4280_BE28_7EF7EB0AB988__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #ifndef __AFXWIN_H__ #error include 'stdafx.h' before i...
C++
// WP.cpp : Defines the class behaviors for the application. // #$Author: helloworld $ #$Date: 2011-08-25 23:21:24 +0800 (星期四, 25 八月 2011) $ #$Rev: 11 $ #$URL: https://virtualxp-54269:8443/svn/wp_vc/WPVC/WP.cpp $ #include "stdafx.h" #include "WP.h" #include "WPDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #un...
C++
// stdafx.cpp : source file that includes just the standard includes // WP.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h"
C++
#include<iostream.h> void main() { //short int i=5,k=5,j=5; // cout<<sizeof(short int)<<endl; // while(k--) // { cout<<i<<endl;i=!i;} // i=j; // cout<<"endl>>>> "<<i<<endl; double i=-1.01; signed int j; unsigned int k; int l; l=(int)i; k=(unsigned int)i; j=(signed int)i; cout<<"double is :"<<...
C++
#include "stdio.h" #include "stdlib.h" #include "string.h" int main(int argc,char**argv) { char *filename = NULL,*keystr = NULL; FILE *fp = NULL; char *headbuf = NULL; int i = 0,j=0,z =0,headlen = 0,keylen = 0,blkcnt=0; printf(" %0x\n",argc); printf(" %s\n",argv[0]); if (NULL != (filename = argv...
C++
#include "iostream.h" #include "math.h" void main() { int row=4; int col=3; int **A_val,**D_val; A_val=new int*[row]; D_val=new int*[row]; int i,j; for(i=0;i<row;i++) { A_val[i]=new int[col]; D_val[i]=new int[col]; } for(i=0;i<row;i++) for(j=0;j<col;j++) { A_val[i][j...
C++
#include <stdio.h> #include <math.h> void Int2Str(unsigned char str[],float var) { float num=(float)var; int t=(int)num; int j=(int)((num-t)*100); int i,k; for(i=4;i>=0;i--) { k=(int)pow(10,i); str[4-i]=(unsigned char)((t/k)+48); t=t%k; } str[5]='.'; str[6]=...
C++
#include <iostream.h> void main (void) { int keycode = 0xff; int row; int col; for(col=0;col<4;col++) { for(row=0;row<4;row++) { keycode = row*10+col; cout<<keycode<<endl; } } }
C++
#include "stdio.h" #include "stdlib.h" #include "string.h" typedef unsigned char T_U8; /* unsigned 8 bit integer */ typedef char T_S8; /* unsigned 8 bit integer */ typedef unsigned int T_U32,T_BOOL; /* unsigned 32 bit integer */ typedef signed int T_S32; /* signed 32 bit integer ...
C++
#line 1 "skinMainView.tmpl" #include "content.h" #line 2 "skinMainView.tmpl" #include "constants.h" #line 3 "skinMainView.tmpl" namespace my_skin { #line 5 "skinMainView.tmpl" struct master :public cppcms::base_view #line 5 "skinMainView.tmpl" { #line 5 "skinMainView.tmpl" cppcms::base_content &content; #line...
C++
#include <cppcms/view.h> #include <string> /** * This namespace defines the structures used for information exchange between * the controller and view. */ namespace content { struct master : public cppcms::base_content{ }; struct overview : public cppcms::base_content { int si...
C++
#include <cppcms/application.h> #include <cppcms/applications_pool.h> #include <cppcms/service.h> #include <cppcms/http_response.h> #include <cppcms/url_dispatcher.h> #include <iostream> #include <cppdb/frontend.h> #include <ctime> #include "content.h" #include "constants.h" using namespace std; /** * Klas...
C++
#ifndef TYPES_HPP #define TYPES_HPP #include <boost/smart_ptr.hpp> #include <boost/asio.hpp> namespace netspy { typedef boost::shared_ptr<boost::asio::ip::tcp::socket> socket_ptr; typedef char char_t; typedef unsigned char uchar_t; typedef short int16_t; typedef unsigned short uint16_t; typedef int ...
C++
#include "DataProxy.h" #include <sstream> #include <iostream> #include <boost/lexical_cast.hpp> #include <vector> #include <string> #include <boost/thread.hpp> #include "Config.hpp" using namespace netspy::db; using namespace std; using namespace boost; mutex DataProxy::singletonWatchdog; shared_ptr<DataProxy> DataPr...
C++
#include "ClientRegistrar.hpp" #include <boost/bind.hpp> #include <boost/smart_ptr.hpp> #include "JSONParser.hpp" #include "Message.hpp" #include "Types.hpp" #include "ClientManager.hpp" #include <cstdlib> #include <sstream> #include "Config.hpp" using boost::asio::ip::tcp; namespace netspy { void ClientRegistrar::s...
C++
#include "Message.hpp" namespace netspy { const char * getCommandString(const Command &command) { switch(command) { case UNKNOWN: return NULL; case REGISTER: return "register"; case CHECK_STATUS: return "check_status"; ...
C++
#ifndef CLIENT_REGISTRAR_HPP #define CLIENT_REGISTRAR_HPP #include "Types.hpp" #include <boost/asio.hpp> #include <boost/thread/thread.hpp> namespace netspy { /** * @brief Obsługuje rejestrację klientów * * Klasa obsługuje połączenia przychodzące - rejestrację klientów (w osobnych wątkach). Zaimplementowana jako...
C++
#ifndef CLIENT_CHECKER_HPP #define CLIENT_CHECKER_HPP #include <boost/thread.hpp> namespace netspy { /** * Klasa opakowujaca wątki odpytujące klientów */ class ClientChecker { public: static ClientChecker & getInstance() { static ClientChecker checker; return checker; } /** * Uru...
C++
#ifndef MESSAGE_HPP #define MESSAGE_HPP #include<string> #include "Structures.hpp" #include <boost/unordered_map.hpp> #include <boost/shared_ptr.hpp> #include <vector> using namespace netspy::db; namespace netspy { enum Command { UNKNOWN=0, REGISTER, CHECK_STATUS }; const char * getCommandString(con...
C++
#ifndef STRUCTURES_HPP #define STRUCTURES_HPP #include <string> namespace netspy { namespace db { struct Client { unsigned int id; std::string ip; std::string hash; unsigned short port; std::string remarks; int status; // for communi...
C++
#include "Message.hpp" #include "DataTypes.hpp" #include "boost/shared_ptr.hpp" #include "boost/thread.hpp" namespace netspy { class RequestManager { public: static RequestManager & getInstance() { static RequestManager requestManager; return requestManager; } /// do pobierania wiadomości przez wątek sh...
C++
#ifndef CLIENT_MANAGER_HPP #define CLIENT_MANAGER_HPP #include "DataTypes.hpp" #include "Message.hpp" #include <string> #include <boost/thread/mutex.hpp> namespace netspy { /** * @brief Klasa odpowiedzialna za bufforowanie klientów. Dostarcza interfejsy umożliwiające * rejestrację nowych klientów, sprawdze...
C++
#include "ClientManager.hpp" #include "DataProxy.h" //#include <boost/random/random_device.hpp> //#include <boost/random/uniform_int_distribution.hpp> #include "DataProxy.h" #include <boost/nondet_random.hpp> #include <sstream> namespace netspy { bool ClientManager::isClientUpdated() const { return isClientUpdate...
C++
#include "Config.hpp" #include <boost/program_options.hpp> namespace po = boost::program_options; namespace netspy { Config::Config() { setDefaultValues(); } void Config::parseCommandLine(int argc, char *argv[]) throw (int) { po::options_description desc("Available options"); desc.add_options() ("help", "...
C++
#include "ClientChecker.hpp" #include <cstdlib> #include <iostream> #include <boost/asio.hpp> #include <boost/lexical_cast.hpp> #include "Types.hpp" #include <cstdlib> #include "Message.hpp" #include "JSONParser.hpp" #include "RequestManager.hpp" #include "Config.hpp" using boost::asio::ip::tcp; namespace netspy {...
C++
#ifndef JSON_PARSER_HPP #define JSON_PARSER_HPP #include "Message.hpp" #include <string> namespace netspy { /** * Klasa parsująca stringi na obiekty JSON a następnie na wewnętrzne struktury rozumiane przez aplikację i na odwrót. * */ class JSONParser { public: /** * @retur...
C++
#ifndef DATA_TYPES_HPP #define DATA_TYPES_HPP #include "Types.hpp" #include "Structures.hpp" #include "Message.hpp" #include "SynchronizedQueue.hpp" #include <boost/shared_ptr.hpp> #include <vector> #include <map> namespace netspy { typedef boost::shared_ptr<Reply> reply_ptr; typedef boost::shared_ptr<Client> cl...
C++
#include "RequestManager.hpp" #include "ClientManager.hpp" #include "Message.hpp" #include "DataProxy.h" #include "Config.hpp" #include <boost/thread/thread.hpp> namespace netspy { void RequestManager::generateRequests() { for(;;) { boost::this_thread::sleep(boost::posix_time::seconds(Config::getInstance()...
C++
#include <cppcms/json.h> #include <iostream> #include <sstream> #include "JSONParser.hpp" using namespace netspy; namespace cppcms { namespace json { // // We specilize cppcms::json::traits structure to convert // objects to and from json values // template<> stru...
C++
#ifndef DATAPROXY_H #define DATAPROXY_H #include <cppdb/frontend.h> #include <vector> #include <sstream> #include <boost/shared_ptr.hpp> #include "Structures.hpp" #include <boost/thread.hpp> namespace netspy { namespace db { /** * Klasa umożliwiająca komunikację z bazą danych w zakresie określonym specyf...
C++
#include <cstdlib> #include "DataProxy.h" #include "Structures.hpp" //#include "Request.hpp" #include <iostream> #include <boost/shared_ptr.hpp> using namespace std; using namespace netspy::db; using namespace boost; void queryAll(shared_ptr<DataProxy> db) { //get all clients int i = 1; shared_ptr<Client...
C++
#include <iostream> #include "Config.hpp" #include "ClientRegistrar.hpp" #include "ClientManager.hpp" #include "RequestManager.hpp" #include "ClientChecker.hpp" #include "Types.hpp" /** * @mainpage * @author Marcin Ciechowicz * Main Loop for Net-Spy * */ using namespace netspy; int main(int argc, char* argv[])...
C++
#ifndef CONFIG_HPP #define CONFIG_HPP #include "Types.hpp" #include <string> namespace netspy { class Config { public: static Config &getInstance() { static Config config; return config; } void parseCommandLine(int argc, char *argv[]) throw(int); void setDefaultValues(); bool isVerbose() const; uin...
C++
#ifndef SYNCHRONIZED_QUEUE_HPP #define SYNCHORNIZED_QUEUE_HPP #include <queue> #include <boost/thread.hpp> template<typename Data> class SynchronizedQueue { private: std::queue<Data> queue_; mutable boost::mutex mutex_; boost::condition_variable conditionVariable_; public: void push(Data const& data) { ...
C++
/* COMPILING: * If you're compiling this with MSVC2010, you'll need to change the include and library directory * paths for opencv to reflect the path on your computer. I think that's all you have to do, but * I may be overlooking something. * * RUNNING: * Several dlls must be in the bin directory for this progra...
C++
#include <cmath> #include <iostream> #include <QVBoxLayout> #include <QFileDialog> #include <QDir> #include <QSize> #include <QSizePolicy> #include "Panel.hpp" #include "Drawing.hpp" Panel::Panel(QWidget *parent) : QWidget(parent) { QVBoxLayout *vbox; QHBoxLayout *box; vbox = new QVBoxLayout(); file = new QGroup...
C++
#include "Parameter.hpp" #include <GL/gl.h> #include <iostream> #include <cstdio> #include <cmath> #include <cstdlib> void UserParameter::init() { facefront = GL_CCW; for(int i = 0;i<3;i++){ color[i]=255; rotation[i]=0; translation[i]=0; } nearer = 0.1; farer = 6; primitive = GL_LINE; rotated = false; } ...
C++
#ifndef MATRIXDRAWING_HPP #define MATRIXDRAWING_HPP #include <QtOpenGL/QGLWidget> #include <string> #include <vector> #include <QGLShaderProgram> #include <QGLShader> using std::vector; using std::string; class MatrixDrawing : public QGLWidget { Q_OBJECT public: float u[3],v[3],n[3]; float translat...
C++
#ifndef __unix__ #include <windows.h> #endif #include <GL/glu.h> #include <QColor> #include <QSizePolicy> #include <QtOpenGL/QtOpenGL> #include "Drawing.hpp" #include <iostream> #include <fstream> #include <string> #include <vector> #include <cstdio> #include <math.h> void Drawing::reset() { cameraorientation[0] = c...
C++
#include <QGLWidget> #include <QtOpenGL/QtOpenGL> #include <QColor> #include <QSizePolicy> #include <QFileInfo> #include <iostream> #include <fstream> #include <cstdio> //#include <string> //#include <vector> #include "MatrixDrawing.hpp" #include <GL/glu.h> #include <GL/gl.h> #include <QMatrix4x4> void MatrixDrawi...
C++
#ifndef PANEL_HPP #define PANEL_HPP #include <QWidget> #include <QSignalMapper> #include <QLabel> #include <QGroupBox> #include <QPushButton> #include <QRadioButton> #include <QSpinBox> #include <QDoubleSpinBox> class Panel : public QWidget { Q_OBJECT public: explicit Panel(QWidget *parent = 0); QSignalMapper *si...
C++
#ifndef DEBUG_H #define DEBUG_H #include <iostream> #define OUT(x) std::cout << x << std::endl #endif // DEBUG_H
C++
#ifndef PARAMETER_HPP #define PARAMETER_HPP #include <QObject> #include <GL/gl.h> #include <vector> #include <string> using namespace std; class UserParameter : public QObject { Q_OBJECT public: GLenum facefront; float color[3]; float rotation[3]; float rotationold[3]; bool rotated; float translati...
C++
#ifndef MAINWINDOW_HPP #define MAINWINDOW_HPP #include <QMainWindow> #include <QtGui> #include "Panel.hpp" #include "Drawing.hpp" #include "MatrixDrawing.hpp" class MainWindow : public QMainWindow { Q_OBJECT public: Panel *bottom; Drawing *left; MatrixDrawing *right; UserParameter uipara; InputParameter inpara...
C++
#include "MainWindow.hpp" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { setCentralWidget(new QFrame); QVBoxLayout *vbox = new QVBoxLayout; QHBoxLayout *hbox = new QHBoxLayout; left = new Drawing; left->uipara = &uipara; left->inpara = &inpara; right = new MatrixDrawing; bottom = new Panel; ...
C++
#include <QApplication> #include "MainWindow.hpp" int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow w; //Window w; w.show(); return app.exec(); }
C++
#ifndef DRAWING_HPP #define DRAWING_HPP #include <QtOpenGL/QGLWidget> #include <string> #include <vector> #include "Parameter.hpp" using std::vector; using std::string; class Drawing : public QGLWidget { Q_OBJECT public: explicit Drawing(QWidget *parent = 0); void initializeGL(); UserParameter *uipara; InputPar...
C++
/* * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
C++
/* * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
C++
/* * Copyright (C) 2009 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
C++
/* ** ** Copyright 2009, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by appl...
C++
/* ** ** Copyright 2009, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by appl...
C++
#include "OK.h" #include <windows.h> #include <stdio.h> #include <fcntl.h> #include <io.h> #include <iostream> #include <fstream> #include <list> #include <ctime> using namespace std; int main(int argc, char *argv[]) { _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_WAR...
C++
/** * Implementation of Closure function * * author: Marcin Wachulski * */ #include "OK.h" #include <set> #include <algorithm> #include <iterator> void Closure(const AttributeSet &prefix, OAPair &oa_pair, FormalContext &local_fc) { oa_pair.second->data.insert(prefix.data.begin(), prefix.data.end()...
C++
/** * Functions responsible for determining the local context for the OK algorithm. * * author: Maciej Rubikowski */ #include "ok.h" typedef std::pair<ObjectSet, FormalContext*> ObjectContextPair; typedef std::vector<ObjectContextPair> LocalContextGrouping; FormalContext* OKLocalContext(const OAPair &oa, ...
C++
/** * Implementation of Order function * * author: Marcin Wachulski * */ #include "OK.h" #include <algorithm> void Order(FormalContext &local_fc, bool (*sort_f)(const OAPair &e1, const OAPair &e2)) { if (local_fc.data.size() < 2) return; // processed group std::sort(local_fc.data....
C++
#ifndef _OK_H_ #define _OK_H_ // declaration of structures used in OK algorithm implementation #include "Attribute.h" #include "AttributeSet.h" #include "Object.h" #include "ObjectSet.h" #include "OAPair.h" #include "FormalContext.h" #include "DataStructure.h" #include "DataSetLoader.h" #include <iostr...
C++
/** * Test collector and executor * * author: Marcin Wachulski * */ #include "gtest\gtest.h" int main(int argc, char *argv[]) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
C++
/** * Local context function testing * * author: Maciej Rubikowski */ #include "OK.h" #include <iostream> int main(int argc, char *argv[]) { FormalContext *FC = new FormalContext; OAPair oa1; OAPair oa2; OAPair oa3; OAPair oa4; OAPair oa5; OAPair oa6; OAPair oa7; OAPair oa; /* oa.fir...
C++
/** * Test of Order function * * author: Marcin Wachulski * */ #include "OKTest.h" class OrderTest : public testing::Test { }; TEST_F(OrderTest, order_empty_seq) { FormalContext fc; Order(fc); EXPECT_EQ(0, fc.data.size()); EXPECT_EQ(0, fc.processedNo); EXPECT_TRUE(is_sorted(...
C++
/** * Test function to check whether Formal Context is sorted properly * * author: Marcin Wachulski * */ #include "OK.h" bool is_sorted(const FormalContext &fc) { if (fc.processedNo > 1) for (std::vector<OAPair>::const_iterator i = fc.data.begin(); (i+1) != fc.data.begin() + fc....
C++
/** * Test of Closure function * * author: Marcin Wachulski * */ #include "OKTest.h" // checks whether all elements in sub set are included within super set bool subsumes(AttributeSet *sub, AttributeSet *super) { for (std::set<Attribute>::iterator i = sub->data.begin(); i != sub->data.end()...
C++
/** * Local context function testing * * author: Maciej Rubikowski */ #include "KOV.h" #include <iostream> int main(int argc, char *argv[]) { _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); { FormalContext *FC = new FormalContext; OAPair...
C++
/** * Test of Order function * * author: Marcin Wachulski * */ #include "KOVTest.h" class OrderTest : public testing::Test { }; TEST_F(OrderTest, order_empty_seq) { FormalContext fc; Order(fc); EXPECT_EQ(0, fc.data.size()); EXPECT_EQ(0, fc.processedNo); EXPECT_TRUE(is_sorted...
C++
/** * Test function to check whether Formal Context is sorted properly * * author: Marcin Wachulski * */ #include "KOV.h" bool is_sorted(const FormalContext &fc) { if (fc.data.size() < 2) return true; for (std::vector<OAPair>::const_iterator i = fc.data.begin(); (i+1) != fc.dat...
C++
/** * Test of Closure function * * author: Marcin Wachulski * */ #include "KOVTest.h" // checks whether all elements in sub set are included within super set bool subsumes(AttributeSet *sub, AttributeSet *super) { for (std::set<Attribute>::iterator i = sub->data.begin(); i != sub->data.end(...
C++
/** * Test collector and executor * * author: Marcin Wachulski * */ #include "gtest\gtest.h" int main(int argc, char *argv[]) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
C++
/** * Test of DataSetLoader class * * author: Marcin Wachulski * */ #include "DataStructure.h" #include "DataSetLoader.h" #include "gtest\gtest.h" #include <iostream> class DataSetLoader : public testing::Test { public: }; TEST_F(DataSetLoader, a) { DataStructure *data = loadDataSet("../datas...
C++
/** * Test collector and executor * * author: Marcin Wachulski * */ #include "gtest\gtest.h" int main(int argc, char *argv[]) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
C++
#ifndef _OBJECT_SET_H_ #define _OBJECT_SET_H_ #include "Object.h" #include <set> // set of objects class ObjectSet { public: ~ObjectSet() {}; std::set<Object> data; }; #endif
C++
/** * Implementation of file data loader * * author: Marcin Wachulski * */ #include "DataSetLoader.h" DataStructure* loadDataSet(const char* filepath) { if (filepath == NULL || filepath == "") throw std::exception("Unspecified file path"); std::ifstream input; input.open(filepath, ...
C++
/** * Implementation of main data structure * * author: Marcin Wachulski * */ #include "DataStructure.h" DataStructure::DataStructure() { this->_allAttrs = new AttributeSet(); this->_allObjs = new ObjectSet(); } DataStructure::~DataStructure() { // cleaning attributes with object referenc...
C++
/** * Implementation of OAPair universal comparator function * * author: Marcin Wachulski * */ #include "OAPair.h" // universal comparator w.r.t |O| that is the support of an attribute bool OAPairCompare(const OAPair& e1, const OAPair& e2) { return e1.first->data.size() < e2.first->data.size(); }
C++