repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
jonrood/simulations | smoke/viewer.h | #ifndef _VIEWER_H
#define _VIEWER_H
#include <stdlib.h>
#include <vector>
#include "vec3.hpp"
class Fluid;
class Viewer
{
private:
int _sx, _sy; // screen width and height
int _ax, _ay; // mouse movement anchor
float _quat[4]; // view rotation quaternion
float _lquat[4]; // light orientation quaternion (... |
jonrood/simulations | smoke64/viewer.h | #ifndef _VIEWER_H
#define _VIEWER_H
#include <stdlib.h>
#include <vector>
#include "vec3.hpp"
class Fluid; // forward definition
class Viewer
{
private:
int _sx, _sy; // screen width and height
int _ax, _ay; // mouse movement anchor
float _quat[4]; // view rotation quaternion
float _lquat[4]; // light o... |
jonrood/simulations | smoke64/genfunc.h | #ifndef _GENFUNC_H
#define _GENFUNC_H
extern float* genparams;
float* randfloats(int n);
float genfunc(int x, int y, int sx, int sy, float t, float* p);
#endif
|
caoliver/tft | cpiofns.c | <filename>cpiofns.c<gh_stars>0
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <fcntl.h>
#include <errno.h>
#include <ctype.h>
#include <limits.h>
#include <err.h>
#include "lua_head.h"
// Process files in 16MB clump... |
caoliver/tft | ljcurses.c | <filename>ljcurses.c
#include "lua_head.h"
#include <ncurses.h>
#include <ctype.h>
#include <termios.h>
#include <unistd.h>
// Milliseconds
#define ESC_DELAY 50
static WINDOW *curwin;
static int curtimeout;
static int which_window(lua_State *L, WINDOW **w)
{
if (lua_islightuserdata(L, 1)) {
*w = (WINDOW *)lua... |
caoliver/tft | lua_head.h | <filename>lua_head.h<gh_stars>0
#ifndef __LUA_HEAD__
#define __LUA_HEAD__
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
#define LUAFN(NAME) static int lua_fn_##NAME(lua_State *L)
#define FN_ENTRY(NAME) { #NAME, lua_fn_##NAME }
#define AT_NAME_PUT(NAME, VALUE, TYPE) \
lua_pushstring(L, #NAME); \
l... |
caoliver/tft | util.c | <filename>util.c<gh_stars>0
// Needed for clock_gettime() and friends.
#define _POSIX_C_SOURCE 199309
#include <signal.h>
#include <unistd.h>
#include <stdint.h>
#include <fcntl.h>
#include <time.h>
#include "lua_head.h"
#include <errno.h>
#include <glob.h>
#include <termios.h>
#include <sys/time.h>
#include <sys/type... |
caoliver/tft | xxhash.c | <gh_stars>0
/*
* xxHash - Fast Hash algorithm
* Copyright (C) 2012-2016, <NAME>
*
* BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* ... |
caoliver/tft | elfutil.c | #include "lua_head.h"
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <gelf.h>
#include <errno.h>
#include <alloca.h>
char *realpath(const char *path, char *resolved_path);
#define PT_INTERP 3
#define SHT_DY... |
VictorHaine/r-packages-itau | Windows/Rcpp/include/Rcpp/vector/Matrix.h | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
//
// Matrix.h: Rcpp R/C++ interface class library -- matrices
//
// Copyright (C) 2010 - 2016 <NAME> and <NAME>
//
// This file is part of Rcpp.
//
// Rcpp is free software: you can redistribute it and/or modify it
// under the terms o... |
VictorHaine/r-packages-itau | Windows/dplyr/include/dplyr/Result/Var.h | #ifndef dplyr_Result_Var_H
#define dplyr_Result_Var_H
#include <dplyr/Result/Processor.h>
namespace dplyr {
namespace internal {
inline double square(double x) {
return x * x;
}
}
template <int RTYPE, bool NA_RM>
class Var : public Processor<REALSXP, Var<RTYPE, NA_RM> > {
public:
typedef Processor<REALSXP, Va... |
VictorHaine/r-packages-itau | Windows/dplyr/include/dplyr/Result/Mean.h | <gh_stars>1-10
#ifndef dplyr_Result_Mean_H
#define dplyr_Result_Mean_H
#include <dplyr/Result/Processor.h>
namespace dplyr {
namespace internal {
template <int RTYPE, bool NA_RM, typename Index>
struct Mean_internal {
static double process(typename Rcpp::traits::storage_type<RTYPE>::type* ptr, const Index& indic... |
VictorHaine/r-packages-itau | Windows/dplyr/include/dplyr/Result/Processor.h | #ifndef dplyr_Result_Processor_H
#define dplyr_Result_Processor_H
#include <tools/utils.h>
#include <dplyr/GroupedDataFrame.h>
#include <dplyr/RowwiseDataFrame.h>
#include <dplyr/Result/Result.h>
namespace dplyr {
// if we derive from this instead of deriving from Result, all we have to
// do is implement a proces... |
VictorHaine/r-packages-itau | Windows/dplyr/include/dplyr/Result/GroupedHybridCall.h | <gh_stars>0
#ifndef dplyr_GroupedHybridCall_H
#define dplyr_GroupedHybridCall_H
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <tools/Call.h>
#include <tools/utils.h>
#include <dplyr/Result/Result.h>
#include <bindrcpp.h>
namespace dplyr {
SEXP dplyr_object(... |
VictorHaine/r-packages-itau | Windows/dplyr/include/tools/Quosure.h | <reponame>VictorHaine/r-packages-itau<gh_stars>1-10
#ifndef dplyr__Quosure_h
#define dplyr__Quosure_h
#include <tools/SymbolString.h>
#include <tools/utils.h>
#include "SymbolVector.h"
namespace dplyr {
inline SEXP quosure(SEXP expr, SEXP env) {
return internal::rlang_api().new_quosure(expr, env);
}
class Named... |
VictorHaine/r-packages-itau | Windows/RcppParallel/include/RcppParallel/TinyThread.h | #ifndef __RCPP_PARALLEL_TINYTHREAD__
#define __RCPP_PARALLEL_TINYTHREAD__
#include <cstdlib>
#include "Common.h"
#include <tthread/tinythread.h>
#include <stdio.h>
#include <vector>
namespace RcppParallel {
namespace {
// Class which represents a range of indexes to perform work on
// (worker functions are pass... |
VictorHaine/r-packages-itau | Windows/RcppParallel/include/RcppParallel.h |
#ifndef __RCPP_PARALLEL__
#define __RCPP_PARALLEL__
// TinyThread implementation
#include "RcppParallel/TinyThread.h"
// Use TBB only where it's known to compile and work correctly
// (NOTE: Windows TBB is temporarily opt-in for packages for
// compatibility with CRAN packages not previously configured
// to link t... |
VictorHaine/r-packages-itau | Windows/dplyr/include/dplyr/dplyr.h | <filename>Windows/dplyr/include/dplyr/dplyr.h
#ifndef dplyr_dplyr_dplyr_H
#define dplyr_dplyr_dplyr_H
#include <dplyr/registration.h>
#include <dplyr/CharacterVectorOrderer.h>
#include <dplyr/white_list.h>
#include <dplyr/checks.h>
#include <dplyr/visitor_set/visitor_set.h>
#include <dplyr/BoolResult.h>
#include <dply... |
VictorHaine/r-packages-itau | Windows/Rcpp/include/Rcpp/sugar/functions/cbind.h | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
//
// cbind.h: Rcpp R/C++ interface class library -- cbind
//
// Copyright (C) 2016 <NAME>
//
// This file is part of Rcpp.
//
// Rcpp is free software: you can redistribute it and/or modify it
// under the terms of the GNU Gene... |
VictorHaine/r-packages-itau | Windows/dplyr/include/dplyr/HybridHandler.h | <reponame>VictorHaine/r-packages-itau
#ifndef dplyr_dplyr_HybridHandler_H
#define dplyr_dplyr_HybridHandler_H
namespace dplyr {
class ILazySubsets;
class Result;
struct HybridHandler {
typedef dplyr::Result* (*HybridHandlerFun)(SEXP, const dplyr::ILazySubsets&, int);
enum Origin { DPLYR, STATS, BASE };
Hybrid... |
VictorHaine/r-packages-itau | Windows/RcppParallel/include/RcppParallel/Common.h | <filename>Windows/RcppParallel/include/RcppParallel/Common.h
#ifndef __RCPP_PARALLEL_COMMON__
#define __RCPP_PARALLEL_COMMON__
#include <cstddef>
namespace RcppParallel {
// Work executed within a background thread. We implement dynamic
// dispatch using vtables so we can have a stable type to cast
// to from the vo... |
VictorHaine/r-packages-itau | Windows/dplyr/include/dplyr/Result/Sum.h | <reponame>VictorHaine/r-packages-itau<filename>Windows/dplyr/include/dplyr/Result/Sum.h
#ifndef dplyr_Result_Sum_H
#define dplyr_Result_Sum_H
#include <dplyr/Result/Processor.h>
namespace dplyr {
namespace internal {
template <int RTYPE, bool NA_RM, typename Index>
struct Sum {
typedef typename Rcpp::traits::stor... |
VictorHaine/r-packages-itau | Windows/RcppParallel/include/RcppParallel/TBB.h | <filename>Windows/RcppParallel/include/RcppParallel/TBB.h
#ifndef __RCPP_PARALLEL_TBB__
#define __RCPP_PARALLEL_TBB__
#include "Common.h"
#include <tbb/tbb.h>
#include <tbb/scalable_allocator.h>
namespace RcppParallel {
namespace {
struct TBBWorker
{
explicit TBBWorker(Worker& worker) : worker_(worker) {}
... |
VictorHaine/r-packages-itau | Windows/dplyr/include/dplyr/Result/Sd.h | <filename>Windows/dplyr/include/dplyr/Result/Sd.h
#ifndef dplyr_Result_Sd_H
#define dplyr_Result_Sd_H
#include <dplyr/Result/Processor.h>
namespace dplyr {
template <int RTYPE, bool NA_RM>
class Sd : public Processor<REALSXP, Sd<RTYPE, NA_RM> > {
public:
typedef Processor<REALSXP, Sd<RTYPE, NA_RM> > Base;
Sd(SE... |
superwofy/F-ZBE-TO-E | src/mcp_can.h | <reponame>superwofy/F-ZBE-TO-E
/*
mcp_can_dfs.h
2012 Copyright (c) Seeed Technology Inc. All right reserved.
2017 Copyright (c) <NAME> All Rights Reserved.
Author:Loovee
Contributor: <NAME>
2017-09-25
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU L... |
countingCrow/ph_fetch_hash | php_pHash.h | // insert the following before PHP_FUNCTION(ph_texthash);
#if HAVE_IMAGE_HASH
PHP_FUNCTION(ph_fetch_hash);
#if (PHP_MAJOR_VERSION >= 5)
ZEND_BEGIN_ARG_INFO_EX(ph_fetch_hash_arg_info, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1)
ZEND_ARG_INFO(0, h1)
ZEND_END_ARG_INFO()
#else /* PHP 4.x */
#define ph_fetch_hash_arg_info NUL... |
Banananaman91/voxels | Voxelcpp/FReader/FileReader.h | #include <string>
#include <iostream>
#include <fstream>
#include <sstream>
namespace freader {
class FileReader{
public:
std::string ReadFile(std::string filePath);
};
} |
Banananaman91/voxels | Voxelcpp/Renderer/Shader.h | #include "../ProjectMain/MainHeader.h"
namespace renderer{
class Shader{
public:
unsigned int ID;
//Constructor to generate the shader
Shader(std::string vertexPath, std::string fragmentPath);
//Activate the shader
void use() const;
//... |
Banananaman91/voxels | Voxelcpp/ProjectMain/MainHeader.h | <reponame>Banananaman91/voxels
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream> |
Banananaman91/voxels | Voxelcpp/Renderer/RenderCube.h | #include "Vertex.h"
#include <array>
namespace renderer{
class RenderCube{
public:
const std::array<glm::vec3, 8> cubeVertices {
glm::vec3(0, 0, 0), //0
glm::vec3(1, 0, 0), //1
glm::vec3(1, 1, 0), //2
glm::vec3(0, 1, 0), //3
... |
Banananaman91/voxels | Voxelcpp/ProjectMain/WindowRender.h | <filename>Voxelcpp/ProjectMain/WindowRender.h
#include "../Renderer/RenderCube.h"
#include "Camera.h"
#include <iostream>
#include <array>
using namespace renderer;
namespace ProjectMain {
class WindowRender{
public:
const float _width = 1920.0f;
const float _height = 1080.0f;
... |
Banananaman91/voxels | Voxelcpp/Renderer/Vertex.h | <gh_stars>0
#include "Shader.h"
struct Vertex {
glm::vec3 pos;
glm::vec3 normal;
}; |
WalinnsAnalytics/walinns-ios-sdk | WalinnsAPI.framework/Headers/WalinnsSDK.h | <reponame>WalinnsAnalytics/walinns-ios-sdk<filename>WalinnsAPI.framework/Headers/WalinnsSDK.h
//
// WalinnsAnalytics.h
// WalinnsAnalytics
//
// Created by Walinns Innovation on 09/02/18.
// Copyright © 2018 Walinns Innovation. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <WalinnsSDK.h>
#import <Walinns... |
WalinnsAnalytics/walinns-ios-sdk | WalinnsAPI_Swift.framework/Headers/WalinnsAPI.h | //
// WalinnsAPI.h
// WalinnsAPI
//
// Created by Walinns Innovation on 22/02/18.
// Copyright © 2018 Walinns Innovation. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for WalinnsAPI.
FOUNDATION_EXPORT double WalinnsAPIVersionNumber;
//! Project version string for WalinnsAPI.
FOUNDAT... |
WalinnsAnalytics/walinns-ios-sdk | StarterProject-ObjC/StarterProject-ObjC/AppDelegate.h | //
// AppDelegate.h
// StarterProject-ObjC
//
// Created by Walinns Innovation on 28/02/18.
// Copyright © 2018 Walinns Innovation. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
WalinnsAnalytics/walinns-ios-sdk | StarterProject-Swift/Pods/Target Support Files/WalinnsAPI-Swift/WalinnsAPI-Swift-umbrella.h | #ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "WalinnsAPI.h"
FOUNDATION_EXPORT double WalinnsAPI_SwiftVersionNumber;
FOUNDATION_EXPORT const unsigned char Walinns... |
WalinnsAnalytics/walinns-ios-sdk | StarterProject-ObjC/StarterProject-ObjC/ViewController.h | //
// ViewController.h
// StarterProject-ObjC
//
// Created by Walinns Innovation on 28/02/18.
// Copyright © 2018 Walinns Innovation. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
hculpan/winprotz | src/mainpaint.c | #include "mainpaint.h"
#include <string.h>
#include <commctrl.h>
#include <stdio.h>
int cxClient = 0;
int cyClient = 0;
HWND childHwnd = NULL;
HWND reportHwnd = NULL;
HWND startPushButtonHwnd;
HWND stopPushButtonHwnd;
HWND writeLogHwnd;
HWND startingBacteriaHwnd;
HWND delayTrackHwnd;
HWND delayLabelHwnd;
HWND pauseB... |
hculpan/winprotz | src/boardpaint.h | #ifndef __BOARDPAINT_H__
#define __BOARDPAINT_H__
#include <windows.h>
void paintBoard(HDC hdc);
VOID Thread(PVOID pvoid);
VOID reportStuff(HWND hwnd, HDC hdc);
VOID rereadSimParams();
extern BOOL ThreadRun;
extern BOOL ThreadPaused;
extern long cycle;
extern int bugCount;
enum GeneModel {
dewdney,
simplif... |
hculpan/winprotz | src/main.c | #include <windows.h>
#include <stdlib.h>
#include <time.h>
#include <process.h>
//#include <stdio.h>
#include "mainpaint.h"
#include "boardpaint.h"
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK ReportWndProc(HWND, UINT, WPARAM, LPARAM... |
hculpan/winprotz | src/boardpaint.c | #include "boardpaint.h"
#include "mainpaint.h"
#include <stdlib.h>
#include <process.h>
#include <time.h>
#include <stdio.h>
#include <math.h>
HBITMAP backbuffer = NULL;
HDC backbuffDC = NULL;
COLORREF bacteriaColor = RGB(0, 255, 0);
int maxGeneValue = 6;
BOOL ThreadRun = FALSE;
BOOL ThreadPaused = FALSE;
FILE *o... |
hculpan/winprotz | src/mainpaint.h | <reponame>hculpan/winprotz
#ifndef __MAINPAINT_H__
#define __MAINPAINT_H__
#include <windows.h>
extern int cxClient;
extern int cyClient;
extern HWND childHwnd;
extern HWND reportHwnd;
extern HWND startPushButtonHwnd;
extern HWND stopPushButtonHwnd;
extern HWND writeLogHwnd;
extern HWND delayTrackHwnd;
extern HWND r... |
ioriayane/masterqtquick4 | src/C4_Plugin/colorfulflower.h | <gh_stars>0
#ifndef COLORFULFLOWER_H
#define COLORFULFLOWER_H
#include "flower.h"
class ColorfulFlower : public Flower
{
Q_OBJECT
public:
explicit ColorfulFlower(Flower *parent = nullptr);
virtual void paint(QPainter *painter);
public slots:
signals:
};
#endif // COLORFULFLOWER_H
|
ioriayane/masterqtquick4 | src/C4_Plugin/randomcolorgenerator.h | #ifndef RANDOMCOLORGENERATOR_H
#define RANDOMCOLORGENERATOR_H
#include <QObject>
#include <QQmlPropertyValueSource>
#include <QQmlProperty>
#include <QTimer>
class RandomColorGenerator : public QObject, public QQmlPropertyValueSource // [1]
{
Q_OBJECT
Q_INTERFACES(QQmlPropertyValueSource) // [2]
Q_... |
ioriayane/masterqtquick4 | src/C4_Plugin/flowerextension.h | #ifndef FLOWEREXTENSION_H
#define FLOWEREXTENSION_H
#include "flower.h"
class FlowerExtension : public QObject
{
Q_OBJECT
Q_PROPERTY(QColor complementaryColor
READ complementaryColor
WRITE setComplementaryColor
NOTIFY complementaryColorChanged) // [1]
public:
expl... |
ioriayane/masterqtquick4 | src/C2-6_Plugin/flower.h | <filename>src/C2-6_Plugin/flower.h
#ifndef FLOWER_H
#define FLOWER_H
#include <QQuickPaintedItem>
#include <QPainter>
class Flower : public QQuickPaintedItem
{
Q_OBJECT
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
QColor m_color;
QPointF rotatePoint(double x, double y, double rad);... |
ioriayane/masterqtquick4 | src/C1-2_MakeByCPPExample/myitem.h | #ifndef MYITEM_H
#define MYITEM_H
#include <QQuickItem>
#include <QSGGeometryNode>
class MyItem : public QQuickItem
{
Q_OBJECT
public:
MyItem(QQuickItem *parent = nullptr)
: QQuickItem(parent)
{
//このフラグ設定でupdatePaintNodeが呼ばれるようになる [1]
setFlag(ItemHasContents, true);
}
protected:
//描画処理 ... |
ioriayane/masterqtquick4 | src/C4_Plugin/flower.h | <gh_stars>0
#ifndef FLOWER_H
#define FLOWER_H
#include <QQuickPaintedItem>
#include <QPainter>
class Flower : public QQuickPaintedItem
{
Q_OBJECT
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Q_PROPERTY(int petalCount READ petalCount WRITE setPetalCount
... |
EnricoPittini/Virtual-machine | src/esegui.c | <reponame>EnricoPittini/Virtual-machine
#include<stdio.h>
#include<stdlib.h>
#include"esegui.h"
/*Lo stack di interi deve essere di 64 KB ovvero 2^16 B. Un intero è 2^2 Byte: dunque lo stack è composto da 2^16/2^2= 2^14 interi.
Stack con 2^14 elementi, ovvero 16384*/
#define N_STACK 16384
#define N_MAX 2147483647 /*... |
EnricoPittini/Virtual-machine | src/vm.c | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"leggi.h"
#include"stampa.h"
#include"esegui.h"
int main(int argc,char *argv[]){
/*Il programma deve prendere due parametri da linea di comando: il primo (argv[1]) dice l'azione da svolgere, il secondo (argv[2])
è il nome del file conte... |
EnricoPittini/Virtual-machine | src/leggi.c | <filename>src/leggi.c<gh_stars>0
#include<stdio.h>
#include<stdlib.h>
#include"leggi.h"
int control(char *buffer){ /*funzione che data la stringa contenente una riga acquisita dal file ,verifica se ci sono errori di formato. Se
sono presenti errori la funzione ritorna 1 altrimenti 0 */
i... |
EnricoPittini/Virtual-machine | src/esegui.h | <filename>src/esegui.h
/**************************STACK: DEFINIZIONE DI TIPO********************************************/
/* Definisco lo stack come una struttura con un puntatore a interi, che punta all'array in memoria dinamica contenete i valori dello stack,
e con un unsigned int che è l'indice che corrisponde... |
EnricoPittini/Virtual-machine | src/leggi.h | int leggi(char *s,int **pa,int *pdim);
|
EnricoPittini/Virtual-machine | src/stampa.h | int stampa_istruzione(int *arr,int *i);
void stampa(int *arr,int dim);
|
EnricoPittini/Virtual-machine | src/stampa.c | #include<stdio.h>
#include"stampa.h"
/*Funzione stampa che dato un vettore di interi arr, di dimensione dim, contenente le istruzioni e i loro parametri, stampa su terminale il
formato mnemonico di queste istruzioni.*/
void stampa(int *arr,int dim){
int i=0;/*E' l'indice che mi dice dove sono arrivato a stam... |
pyperanger/mazethread | src/rrand.c | /*
* Generate the random number in a range defined by number of runners in main.c
* Formula: N = RAND([0:T*5])
*/
#include "rrand.h"
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
int
tryharder(struct racebj* race) // return a number in context of endline
{
srand(race->seed);
return rand() % (race-... |
pyperanger/mazethread | src/racing.h | <reponame>pyperanger/mazethread
#pragma once
void*
rungo(void* racego);
|
pyperanger/mazethread | src/rrand.h | <reponame>pyperanger/mazethread<filename>src/rrand.h
#pragma once
#include "maze.h"
int
meters(struct racebj* race);
int
tryharder(struct racebj* race);
|
pyperanger/mazethread | src/maze.c | <filename>src/maze.c
/*
* Maze Thread
* | - --thread|-t 5 (RANGE = RAND(T*10))
* | - --help|-h
*/
// MAZE HEADER
#include "maze.h"
#include "racing.h"
#include "rrand.h"
#include <ctype.h>
#include <getopt.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#define die(STR) ... |
pyperanger/mazethread | src/racing.c | <gh_stars>1-10
#include "racing.h"
#include "maze.h"
#include "rrand.h"
#include <pthread.h>
#include <stdio.h>
void*
rungo(void* racego)
{
struct racebj* rgo = (struct racebj*)racego;
for (int r = 0; r < rgo->endline / 2; r++) // X chance to find the vlue
{
if (tryharder(rgo) != rgo->endline) {
print... |
pyperanger/mazethread | src/maze.h | <filename>src/maze.h
#pragma once
#define MAZE_VERSION 0.1
#define AUTHOR "pype"
#define MIN_THREAD 4 // the more competitors the better
#define MAX_THREAD 255 // ignore > /proc/sys/kernel/threads-max
struct racebj
{
unsigned int runners;
unsigned int endline;
int player;
int seed;
int end;
};
|
Fragrant-Yang/git-test-copy | MyMuduo/Lib/EPollPoller.h | #ifndef NLIB_POLLER_EPOLLPOLLER_H
#define NLIB_POLLER_EPOLLPOLLER_H
#include "header.h"
#include <sys/epoll.h>
#include "Poller.h"
struct epoll_event;
class EPollPoller : public Poller
{
public:
EPollPoller(
EventLoop* loop);
~EPollPoller() override;
TimeStamp poll(
int timeoutMs,
C... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/header.h | <filename>MyMuduo/Lib/header.h
#ifndef LIB_HEADER_H
#define LIB_HEADER_H
#include <functional>
#include <memory>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <errno.h>
#include <sys/uio.h>
#include <functional>
#include <memory>
#include <stdint.h>
#include <endian.h>
#include <functional>
#include <memor... |
Fragrant-Yang/git-test-copy | MuduoClient/Global/global.h | #ifndef GOLBAL_GOLBAL_H
#define GOLBAL_GOLBAL_H
#include "header.h"
#define PI 3.141592
class COLOR
{
public:
COLOR()
{
m_nR = 0;
m_nG = 0;
m_nB = 0;
m_nA = 255;
}
COLOR(int nR_, int nG_, int nB_, int nA_)
{
m_nR = nR_;
m_nG = nG_;
m_nB = nB_... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/ThreadPool.h | #ifndef NLIB_THREADPOOL_H
#define NLIB_THREADPOOL_H
#include "header.h"
#include "Condition.h"
#include "Mutex.h"
#include "Thread.h"
// 1.通过类成员函数启动多个线程+
// 线程回调设置为类的成员函数好处
//
// 一个控制线程通过线程池对象
// 构造多个Thread对象,并启动多个并发执行的线程
//
// 由于线程池对象所启动的线程
// 最后的线程函数是线程池类型的成员函数
// 且std::bind时绑定了this
//
// 所有线程池启动的每个线程均可通过
// 隐式的thi... |
Fragrant-Yang/git-test-copy | MuduoClient/Ui/chatwidget.h | // Author : XuBenHao
// Version : 1.0.0
// Mail : <EMAIL>
// Copyright : XuBenHao 2020 - 2030
//
#ifndef APP_UI_CHATWIDGET_H
#define APP_UI_CHATWIDGET_H
#include "header.h"
namespace Ui {
class ChatWidget;
}
class ChatWidget : public QWidget
{
Q_OBJECT
public:
explicit ChatWidget(QWidget *parent = nullptr... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/InetAddress.h | #ifndef NLIB_INETADDRESS_H
#define NLIB_INETADDRESS_H
#include "header.h"
#include "StringPiece.h"
const struct sockaddr* sockaddr_cast(
const struct sockaddr_in6* addr_);
class InetAddress
{
public:
explicit InetAddress(
uint16_t port_ = 0,
bool loopbackOnly_ = false,
bool ip... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/lib.h | <filename>MyMuduo/Lib/lib.h
#ifndef NLIB_LIB
#define NLIB_LIB
#include "Atomic.h"
#include "Condition.h"
#include "CountDownLatch.h"
#include "CurrentThread.h"
#include "Date.h"
#include "Exception.h"
#include "FileUtil.h"
#include "Logging.h"
#include "LogStream.h"
#include "Mutex.h"
#include "ProcessInfo.h"
#include ... |
Fragrant-Yang/git-test-copy | MuduoServer/Global/lib.h | <filename>MuduoServer/Global/lib.h
#ifndef GLOBAL_LIB_H
#define GLOBAL_LIB_H
#include "Global/global.h"
#endif // LIB_H
|
Fragrant-Yang/git-test-copy | MuduoServer/Application/main.h | <filename>MuduoServer/Application/main.h
#ifndef APPLICATION_MAIN_H
#define APPLICATION_MAIN_H
#include "header.h"
#endif // MAIN_H
|
Fragrant-Yang/git-test-copy | MyMuduo/Lib/Condition.h | <reponame>Fragrant-Yang/git-test-copy<gh_stars>1-10
#ifndef NLIB_CONDITION_H
#define NLIB_CONDITION_H
#include "Mutex.h"
class Condition
{
public:
explicit Condition(
MutexLock& mutex)
: m_nMutex(mutex)
{
pthread_cond_init(&m_nCond, NULL);
}
~Condition()
{
... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/TimeStamp.h | <filename>MyMuduo/Lib/TimeStamp.h
#ifndef NLIB_TIMESTAMP_H
#define NLIB_TIMESTAMP_H
#include "header.h"
class TimeStamp :
public boost::equality_comparable<TimeStamp>,
public boost::less_than_comparable<TimeStamp>
{
public:
TimeStamp()
: m_nMicroSecondsSinceEpoch(0)
{
}
explicit TimeSta... |
Fragrant-Yang/git-test-copy | MyMuduo/Tcp/TcpClient.h | <gh_stars>1-10
#ifndef NLIB_TCPCLIENT_H
#define NLIB_TCPCLIENT_H
#include "../Lib/lib.h"
#include "TcpConnection.h"
class Connector;
// Muduo的事件循环/线程池/客户端/服务端/Io复用总结:
// 1.一个EventLoop的loop独占一个线程
// EventLoop本身构成了此线程执行的语境
// 2.利用EventLoop内的epoll描述符,
// 事件循环可以对一个或多个描述符进行监听
// 监听的事件可以指定
// 事件循环还支持任务回调,其他可访问到EventLoop的线程... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/ThreadLocalSingleton.h | #ifndef NLIB_THREADLOCALSINGLETON_H
#define NLIB_THREADLOCALSINGLETON_H
#include "header.h"
template<typename T>
class ThreadLocalSingleton
{
class Deleter
{
public:
Deleter()
{
pthread_key_create(
&m_nKey,
&ThreadLocalSingleton::destructor);
}
... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/Timer.h | <filename>MyMuduo/Lib/Timer.h
#ifndef LIB_TIMER_H
#define LIB_TIMER_H
#include "Atomic.h"
#include "TimeStamp.h"
#include "CallBacks.h"
// 将定时器回调函数作为类的数据成员的好处:
// 类对象构成了定时器回调及其回调语境
//
class Timer
{
public:
Timer(
// 定时器回调函数
TimerCallback cb,
// 何时触发时间戳
TimeStamp when,
//... |
Fragrant-Yang/git-test-copy | MuduoClient/Ui/mainwindow.h | // Author : XuBenHao
// Version : 1.0.0
// Mail : <EMAIL>
// Copyright : XuBenHao 2020 - 2030
//
#ifndef APP_UI_MAINWINDOW_H
#define APP_UI_MAINWINDOW_H
#include "header.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = null... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/Mutex.h | <reponame>Fragrant-Yang/git-test-copy
#ifndef NLIB_MUTEX_H
#define NLIB_MUTEX_H
#include "header.h"
#include "CurrentThread.h"
// 互斥锁,同时包含拥有此锁的线程id
class MutexLock
{
class UnassignGuard
{
public:
explicit UnassignGuard(
MutexLock& owner)
: m_nOwner(owner)
{
... |
Fragrant-Yang/git-test-copy | MuduoServer/MySqlAgent/lib.h | #ifndef MYSQL_AGENT_LIB_H
#define MYSQL_AGENT_LIB_H
#include "mysqlagent.h"
#endif // LIB_H
|
Fragrant-Yang/git-test-copy | MuduoClient/Ui/mainchatwidget.h | // Author : XuBenHao
// Version : 1.0.0
// Mail : <EMAIL>
// Copyright : XuBenHao 2020 - 2030
//
#ifndef APP_UI_MAINCHATWIDGET_H
#define APP_UI_MAINCHATWIDGET_H
#include "header.h"
class ChatWidget;
namespace Ui {
class MainChatWidget;
}
class MainChatWidget : public QWidget
{
Q_OBJECT
public:
explicit Main... |
Fragrant-Yang/git-test-copy | MuduoClient/MuduoApp/lib.h | <gh_stars>1-10
#ifndef MUDUO_APP_LIB_H
#define MUDUO_APP_LIB_H
#include "muduoclient.h"
#endif // LIB_H
|
Fragrant-Yang/git-test-copy | MyMuduo/Tcp/Connector.h | #ifndef NLIB_CONNECTOR_H
#define NLIB_CONNECTOR_H
#include "../Lib/lib.h"
class Channel;
class EventLoop;
class Connector :
public std::enable_shared_from_this<Connector>
{
public:
typedef std::function<void (int sockfd)> NewConnectionCallback;
Connector(
EventLoop* loop,
const InetAddre... |
Fragrant-Yang/git-test-copy | MuduoServer/MuduoApp/codec.h | #ifndef MUDUO_APP_CODEC_H
#define MUDUO_APP_CODEC_H
#include "header.h"
// 消息编码格式:
// 4字节长度[长度指的是数据部分的长度]+数据本身
// 消息解码:
// 先取出4字节
// 在取出该长度表示的数据部分
//
//
// 直接通过Tcp传递数值类型时,
// 需要
// 传递前将本机数值转换为网络字节序数值再写入
// 接收时,先取出数据内容,再将其转化为本机字节序再实际使用
//
// 如果传递的是字符串,
// 不需要上述处理
//
//
// Tcp的消息编码和解码其实就是应用层协议
class LengthHeaderCodec
{... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/Thread.h | #ifndef NLIB_THREAD_H
#define NLIB_THREAD_H
#include "header.h"
#include "Atomic.h"
#include "CountDownLatch.h"
// 提供线程启动接口
// 包含线程回调指定,线程信息保持
// 通过一个Thread类成员函数内部调线程api
// 为线程api提供了语境
// 成员函数内部通过this指向对象的数据成员
// 可以得到调用发生时需要的语境信息
// 并可据此作对应的处理
//
class Thread
{
public:
typedef std::function<void ()> ThreadFunc;... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/Socket.h | #ifndef NLIB_SOCKET_H
#define NLIB_SOCKET_H
struct tcp_info;
class InetAddress;
class Socket
{
public:
explicit Socket(int sockfd)
: m_nSockFd(sockfd)
{ }
~Socket();
int fd() const
{
return m_nSockFd;
}
bool getTcpInfo(struct tcp_info*) const;
bool getTcpInfoStr... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/SocketOps.h | #ifndef NLIB_SOCKETSOPS_H
#define NLIB_SOCKETSOPS_H
int createNonblockingOrDie(
sa_family_t family);
int connect(
int sockfd,
const struct sockaddr* addr);
void bindOrDie(
int sockfd,
const struct sockaddr* addr);
void listenOrDie(int sockfd);
int accept(
int sockfd,
struct sockaddr... |
Fragrant-Yang/git-test-copy | MuduoServer/DataStruct/dynqueue.h | // Author : XuBenHao
// Version : 1.0.0
// Mail : <EMAIL>
// Copyright : XuBenHao 2020 - 2030
#ifndef DATA_STRUCT_DYNQUEUE_H
#define DATA_STRUCT_DYNQUEUE_H
#include "header.h"
#include "doublelist.h"
namespace NDataStruct
{
template <typename T>
class DynQueue
{
public:
DynQueue();
vir... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/CurrentThread.h | #ifndef NLIB_CURRENTTHREAD_H
#define NLIB_CURRENTTHREAD_H
#include "header.h"
#include "TimeStamp.h"
// __thread修饰的全局对象
// 每个线程有各自独立的一份,
// 天然就是线程特定的数据
extern __thread int t_cachedTid;
extern __thread char t_tidString[32];
extern __thread int t_tidStringLength;
extern __thread const char* t_threadName;
pid_t gettid();... |
Fragrant-Yang/git-test-copy | MuduoServer/Global/header.h | <filename>MuduoServer/Global/header.h
#ifndef GLOBAL_HEADER_H
#define GLOBAL_HEADER_H
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <malloc.h>
#include <iostream>
#include <bitset>
#include <time.h>
#include <functional>
#include <iostream>
#include <memory>
#include <string>
#include <math.h>
#in... |
Fragrant-Yang/git-test-copy | MuduoServer/DataStruct/dynarray.h | // Author : XuBenHao
// Version : 1.0.0
// Mail : <EMAIL>
// Copyright : XuBenHao 2020 - 2030
#ifndef DATA_STRUCT_DYNARRAY_H
#define DATA_STRUCT_DYNARRAY_H
#include "header.h"
namespace NDataStruct
{
// 突破固定容量数组限制
// 容量可以动态增加和减少的数组
// 适合作为管理动态元素集合的容器
template<typename T>
class DynArray
{
pu... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/Date.h | #ifndef NLIB_DATE_H
#define NLIB_DATE_H
#include "header.h"
struct tm;
class Date
{
public:
struct YearMonthDay
{
int year; // [1900..2500]
int month; // [1..12]
int day; // [1..31]
};
static const int s_nDaysPerWeek = 7;
static const int s_nDayOf1970_01_01;
Date()
... |
Fragrant-Yang/git-test-copy | MuduoServer/MuduoApp/muduocodec.h | // Author : XuBenHao
// Version : 1.0.0
// Mail : <EMAIL>
// Copyright : XuBenHao 2020 - 2030
//
#ifndef MUDUO_APP_MUDUOCODEC_H
#define MUDUO_APP_MUDUOCODEC_H
#include "header.h"
// 消息编码格式:
// 4字节长度[长度指的是数据部分的长度]+数据本身
// 消息解码:
// 先取出4字节
// 在取出该长度表示的数据部分
//
//
// 直接通过Tcp传递数值类型时,
// 需要
// 传递前将本机数值转换为网络字节序数值再写入
// 接收时,... |
Fragrant-Yang/git-test-copy | MuduoClient/Ui/lib.h | <filename>MuduoClient/Ui/lib.h
#ifndef APP_UI_LIB_H
#define APP_UI_LIB_H
#include "mainwindow.h"
#include "registerandloginwidget.h"
#endif
|
Fragrant-Yang/git-test-copy | MyMuduo/Lib/TimerQueue.h | #ifndef LIB_TIMERQUEUE_H
#define LIB_TIMERQUEUE_H
#include "Mutex.h"
#include "TimeStamp.h"
#include "CallBacks.h"
#include "Channel.h"
class EventLoop;
class Timer;
class TimerId;
class TimerQueue
{
public:
explicit TimerQueue(
EventLoop* loop);
~TimerQueue();
TimerId ... |
Fragrant-Yang/git-test-copy | MuduoServer/MySqlAgent/header.h | <reponame>Fragrant-Yang/git-test-copy<gh_stars>1-10
#ifndef MYSQL_AGENT_HEADER_H
#define MYSQL_AGENT_HEADER_H
#include "Global/lib.h"
#include "../MyMuduo/Tcp/lib.h"
#include "../MyMuduo/Tcp/lib.h"
#include <mysql.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#endif // HEADER_H
|
Fragrant-Yang/git-test-copy | MyMuduo/Lib/EventLoopThreadPool.h | #ifndef NLIB_EVENTLOOPTHREADPOOL_H
#define NLIB_EVENTLOOPTHREADPOOL_H
#include "header.h"
// 事件循环线程池对象
// 可由可访问者用以实现
// 1.开启多个并行线程
// 2.获得开启的每个线程的属性/状态
// 3.与每个开启的线程进行交互
//
//
// 这里假定了
// 事件循环线程池对象的访问者
// 存在于一个线程中.
// 所以,
// 线程池对象成员访问中没有进行多线程下访问共享对象的互斥/同步处理
class EventLoop;
class EventLoopThread;
class EventLoopThread... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/LogStream.h | <filename>MyMuduo/Lib/LogStream.h
#ifndef NLIB_LOGSTREAM_H
#define NLIB_LOGSTREAM_H
#include "StringPiece.h"
const int s_nSmallBuffer = 4000;
const int s_nLargeBuffer = 4000*1000;
template<int SIZE>
class FixedBuffer
{
public:
FixedBuffer()
: m_pCur(m_arrData)
{
setCookie(cookieStart);
}
... |
Fragrant-Yang/git-test-copy | MuduoServer/DataStruct/doublelist.h | <gh_stars>1-10
// Author : XuBenHao
// Version : 1.0.0
// Mail : <EMAIL>
// Copyright : XuBenHao 2020 - 2030
#ifndef DATA_STRUCT_DOUBLELIST_H
#define DATA_STRUCT_DOUBLELIST_H
#include "header.h"
namespace NDataStruct
{
template <typename T>
class DoubleList
{
public:
class Node
{
... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/Logging.h | #ifndef NLIB_LOGGING_H
#define NLIB_LOGGING_H
#include "LogStream.h"
#include "TimeStamp.h"
class TimeZone;
class Logger
{
public:
enum LogLevel
{
TRACE,
DEBUG,
INFO,
WARN,
ERROR,
FATAL,
NUM_LOG_LEVELS,
};
// 类
class SourceFile
{
... |
Fragrant-Yang/git-test-copy | MyMuduo/Lib/Exception.h | <gh_stars>1-10
#ifndef NLIB_EXCEPTION_H
#define NLIB_EXCEPTION_H
#include "header.h"
class Exception : public std::exception
{
public:
Exception(string what);
~Exception() noexcept override = default;
const char* what() const noexcept override
{
return m_strMessage.c_str();
}
const ... |
Fragrant-Yang/git-test-copy | MuduoServer/Application/header.h | #ifndef APPLICATION_HEADER_H
#define APPLICATION_HEADER_H
#include "Global/lib.h"
#include "MuduoApp/lib.h"
#endif // HEADER_H
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.