repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
jefersonbelmiro/tron | src/common/int_array.c | <reponame>jefersonbelmiro/tron<gh_stars>10-100
#include "common/int_array.h"
static void int_array_init(IntArray *data, int size)
{
data->size = size;
data->length = 0;
data->items = array_create(size);
}
static void* int_to_ptr(int item)
{
return (void*) (long int) item;
}
static int ptr_to_int(void... |
jefersonbelmiro/tron | src/state/menu.c | #include "state/menu.h"
#include "state/play.h"
#include "core/window.h"
#include "core/board.h"
#include "core/game.h"
#include <curses.h>
static void create(Game* game);
static void update(Game* game);
static void draw(Game* game);
static void draw_menu(Game* game);
static void destroy(Game* game, State* menu);
Sta... |
jefersonbelmiro/tron | inc/core/board.h | #ifndef BOARD_H
#define BOARD_H
#include <stdlib.h>
typedef struct {
// sizes
int width, height, length;
// allow directions to move
int moves[4];
// 2d map store in single dimensional array
int* map;
} Board;
Board* board_create(int width, int height);
void board_destroy(Board* board);
v... |
jefersonbelmiro/tron | inc/core/light_cycle.h | #ifndef LIGHT_CYCLE_H
#define LIGHT_CYCLE_H
#include "core/game.h"
#include "common/ptr_array.h"
#include <curses.h>
typedef struct LightCycle LightCycle;
enum LightCycleDirection {
LEFT = 0,
UP = 1,
RIGHT = 2,
DOWN = 3
};
enum LightCycleColor {
WHITE = COLOR_WHITE,
BLUE = COLOR_BLUE,
... |
jefersonbelmiro/tron | test/negamax.c | #include "common/test.h"
#include "core/negamax.h"
int width = 10;
int height = 10;
int* map = NULL;
void test_dist_map()
{
int x = width/2, y = height/2;
int map_position = x + y * width;
int* dist_map = negamax_create_dist_map(map, width, height, map_position);
// up and down
for (int i = 0; i ... |
jefersonbelmiro/tron | inc/core/state.h | <reponame>jefersonbelmiro/tron
#ifndef STATE_H
#define STATE_H
#include <stdlib.h>
// just for avoid circular dependency
typedef struct Game Game;
typedef struct State State;
struct State {
void (*create)(Game* game);
void (*destroy)(Game* game, State* state);
void (*update)(Game* game);
void (*draw)... |
jefersonbelmiro/tron | src/core/light_cycle.c | #include "core/light_cycle.h"
LightCycle* light_cycle_create(int position, int color, int direction, void* update)
{
LightCycle* light_cycle = malloc(sizeof(LightCycle));
light_cycle->position = position;
light_cycle->color = color;
light_cycle->direction = direction;
light_cycle->alive = true;
... |
jefersonbelmiro/tron | inc/core/game.h | #ifndef GAME_H
#define GAME_H
#include <stdlib.h>
#include <stdbool.h>
#include <time.h>
#include <unistd.h>
#include "core/window.h"
#include "core/board.h"
#include "core/input.h"
#include "state/menu.h"
#define SECOND 1000000
#define FPS SECOND / 10
// just for avoid circular dependency
typedef struct Game Game;... |
jefersonbelmiro/tron | test/array.c | #include "common/test.h"
#include "common/array.h"
void** array = NULL;
int array_length = 0;
int array_size = 20;
void test_add_elements()
{
int t1 = 10, t2 = 20, t3 = 30;
array_push(array, &t1, &array_length, &array_size);
array_push(array, &t2, &array_length, &array_size);
array_push(array, &t3, ... |
jefersonbelmiro/tron | src/core/player.c | #include "core/player.h"
static void update(Game* game, LightCycle *player, PtrArray* players);
static void input_direction(LightCycle *player, int keypress);
LightCycle* player_create(int position, int color, int direction)
{
return light_cycle_create(position, color, direction, update);
}
void player_destroy(L... |
jefersonbelmiro/tron | src/core/negamax.c | <gh_stars>10-100
#include "core/negamax.h"
// unit-cost specialization of dijkstra's algorithm, using queues
int* negamax_create_dist_map(int* map, int map_width, int map_height, int map_position)
{
int map_length = map_width * map_height;
int map_moves[4] = {-1, -map_width, 1, map_width };
int dist_score... |
jefersonbelmiro/tron | src/core/ai.c | <reponame>jefersonbelmiro/tron
#include "core/ai.h"
#include "core/negamax.h"
static void update(Game* game, LightCycle *ai, PtrArray* players);
LightCycle* ai_create(int position, int color, int direction)
{
return light_cycle_create(position, color, direction, update);
}
void ai_destroy(LightCycle* ai)
{
r... |
jefersonbelmiro/tron | inc/core/window.h | <filename>inc/core/window.h
#ifndef WINDOW_H
#define WINDOW_H
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
typedef struct {
// screen size
int width, height;
// ncurses window
void* _window;
} Window;
enum draw {
WALL = '#',
EMPTY = ' ',
BOUND_CORNER = '+',
BOUND_LIN... |
jefersonbelmiro/tron | inc/main.h | <reponame>jefersonbelmiro/tron
#ifndef MAIN_H
#define MAIN_H
#include "core/game.h"
#endif
|
jefersonbelmiro/tron | src/common/test.c | #include "common/test.h"
#define ERROR_ASSERT_FAIL 1
#define ERROR_MALLOC 2
#define ERROR_REALLOC 3
#define ERROR_UNINITIALIZED 4
#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
#define ANSI_COLOR_RESET "\x1b[0m"
typedef struct {
int total;
int failed;
} AssertionCount;
typedef struct... |
jefersonbelmiro/tron | src/common/ptr_array.c | <reponame>jefersonbelmiro/tron
#include "common/ptr_array.h"
static void ptr_array_init(PtrArray *data, int size)
{
data->size = size;
data->length = 0;
data->items = array_create(size);
}
PtrArray *ptr_array_create(int size)
{
PtrArray* data = malloc(sizeof(PtrArray));
ptr_array_init(data, size);... |
jefersonbelmiro/tron | inc/state/play.h | <gh_stars>10-100
#ifndef PLAY_STATE_H
#define PLAY_STATE_H
#include "core/state.h"
#include "core/window.h"
State* play_create();
void play_destroy(State* menu);
#endif
|
jefersonbelmiro/tron | inc/common/array.h | <reponame>jefersonbelmiro/tron<filename>inc/common/array.h
#ifndef ARRAY_H
#define ARRAY_H
#include <stdlib.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
void** array_create(int size);
void array_destroy(void** data);
void array_resize(void **data, int size, int* data_size);
void ... |
jefersonbelmiro/tron | inc/core/ai.h | <filename>inc/core/ai.h
#ifndef AI_H
#define AI_H
#include "core/light_cycle.h"
LightCycle* ai_create(int position, int color, int direction);
void ai_destroy(LightCycle* ai);
#endif
|
jefersonbelmiro/tron | src/core/game.c | <filename>src/core/game.c
#include "core/game.h"
static void tick(Game* game);
static void quit(Game* game);
static void process_next_state(Game* game);
Game* game_create(Window* window, Board* board, Input* input)
{
Game* game = malloc(sizeof(Game));
game->window = window;
game->board = b... |
jefersonbelmiro/tron | src/state/play.c | <reponame>jefersonbelmiro/tron<gh_stars>10-100
#include "state/play.h"
#include "core/window.h"
#include "core/board.h"
#include "core/player.h"
#include "core/ai.h"
#include "core/game.h"
#include "common/ptr_array.h"
#include <curses.h>
static void create(Game* game);
static void update(Game* game);
static void draw... |
jefersonbelmiro/tron | src/core/state.c | <filename>src/core/state.c
#include "core/state.h"
State* state_create(void* create, void* update, void* draw, void* destroy)
{
State* state = malloc(sizeof(State));
state->create = create;
state->update = update;
state->draw = draw;
state->destroy = destroy;
return state;
}
void state_destroy... |
jefersonbelmiro/tron | test/ptr_array.c | <reponame>jefersonbelmiro/tron
#include "common/test.h"
#include "common/ptr_array.h"
PtrArray* array;
void test_empty()
{
assert_not_equal(array, NULL);
assert_equal(array->length, 0);
}
void test_add_elements()
{
int t1 = 10, t2 = 20, t3 = 30;
ptr_array_push(array, &t1);
ptr_array_push(array,... |
jefersonbelmiro/tron | inc/common/test.h | <filename>inc/common/test.h
#ifndef TEST_H
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#undef assert
#undef assert_equal
#undef assert_not_equal
#undef describe
#define assert(expression) \
Test_assert((int)(expression), #expression, __func__, __FILE__, __LINE__)
#define assert_equal(expression, ... |
imos/icfpc2017 | iwiwi/src/agl/statistics/statistics.h | <gh_stars>1-10
#pragma once
#include "agl.h"
namespace agl {
std::pair<size_t, size_t> num_triangles_and_wedges(const G &g);
std::vector<std::pair<size_t, size_t>> num_local_triangles_and_wedges(const G &g);
// https://en.wikipedia.org/wiki/Clustering_coefficient#Local_clustering_coefficient
std::vector<double> local... |
imos/icfpc2017 | iwiwi/src/agl/shortest_path/shortest_path.h | #pragma once
#include "dijkstra.h"
#include "visitor.h"
|
imos/icfpc2017 | iwiwi/src/agl/visualize/graphviz.h | <reponame>imos/icfpc2017
#pragma once
#include <unordered_map>
#include "graph/graph.h"
#include "edge_centrality/edge_centrality.h"
DECLARE_string(graphviz_engine);
namespace agl {
class graphviz {
public:
using property_map = std::unordered_map<std::string, std::string>;
//
// Input
//
graphviz() : gra... |
imos/icfpc2017 | iwiwi/src/agl/graph/graph_index_interface.h | <gh_stars>1-10
#pragma once
#include <functional>
namespace agl {
template<typename GraphType>
class graph_index_interface {
public:
virtual ~graph_index_interface() {}
virtual void construct(const GraphType &g) = 0;
virtual size_t estimate_memory_usage() { return 0; }
};
template<typename GraphType>
class d... |
imos/icfpc2017 | iwiwi/src/agl/cut_tree/cut_tree_query_handler.h | <gh_stars>1-10
#pragma once
#include <base/base.h>
#include <graph/graph.h>
#include <vector>
#include <queue>
#include <utility>
#include <string>
#include <fstream>
namespace agl {
class cut_tree_query_handler {
void build(std::vector<std::vector<std::pair<V, int>>>& edges) {
depth_.resize(num_vertices_, -1);
... |
imos/icfpc2017 | iwiwi/src/agl/shortest_path/diameter.h | <gh_stars>1-10
#pragma once
#include "dijkstra.h"
#include "connectivity/strongly_connected_components.h"
namespace agl {
template<typename GraphT = G>
typename GraphT::W diameter(const GraphT& g, const int kNumDoubleSweep = 10) {
using W = typename GraphT::W;
constexpr W kInfW = infinity_weight<W>();
auto cmp ... |
imos/icfpc2017 | iwiwi/src/agl/graph/graph.h | #pragma once
#include <cstdint>
#include "base/base.h"
namespace agl {
using V = int32_t;
}
#include "direction.h"
#include "edge_type.h"
#include "basic_graph.h"
#include "unweighted_graph.h"
#include "weighted_graph.h"
namespace agl {
using G = unweighted_graph;
using E = unweighted_graph::E;
using W = G::W;
usin... |
imos/icfpc2017 | iwiwi/src/agl/graph/dynamic_index_evaluation.h | <filename>iwiwi/src/agl/graph/dynamic_index_evaluation.h
/**
* update_interface, update_add_edge, update_remove_edge = single update
* update_workload = sequence of updates
* update_scenario = initial graph + sequence of workloads
*/
#include <unordered_set>
#include <memory>
#include <algorithm>
#include "graph_i... |
imos/icfpc2017 | iwiwi/src/agl/agl.h | #pragma once
#include "base/base.h"
#include "graph/graph.h"
#include "heap/heap.h"
#include "edge_centrality/edge_centrality.h"
#include "connectivity/connectivity.h"
#include "visualize/graphviz.h"
#include "statistics/statistics.h"
#include "shortest_path/shortest_path.h"
#include "prettyprint.h"
|
imos/icfpc2017 | iwiwi/src/agl/shortest_path/dijkstra.h | #pragma once
#include "graph/graph.h"
#include "heap/heap.h"
namespace agl {
template<typename GraphT = G>
std::vector<typename GraphT::W> single_source_distance(const GraphT &g, V s, D d = kFwd) {
using W = typename GraphT::W;
auto h = make_dijkstra_heap(g);
h.decrease(s, 0);
while (!h.empty()) {
V v = ... |
imos/icfpc2017 | iwiwi/src/agl/base/functions.h | #include <string>
#include <sstream>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <functional>
#include "type.h"
namespace agl {
// Cygwin/MinGW では to_string が定義されていないバグがある.
// http://stackoverflow.com/questions/12975341/to-string-is-not-a-member-of-std-says-so-g
// http://gcc... |
imos/icfpc2017 | iwiwi/src/agl/base/base.h | <reponame>imos/icfpc2017<filename>iwiwi/src/agl/base/base.h
#pragma once
#include <cstddef>
#include <limits>
namespace agl {
static constexpr size_t kInfSize = std::numeric_limits<size_t>::max();
} // namespace agl
#include "macros.h"
#include "functions.h"
#include "jlog.h"
#include "random.h"
#include "irange.h"... |
imos/icfpc2017 | iwiwi/src/agl/box_cover/box_cover.h | <gh_stars>1-10
#include "agl.h"
namespace agl {
namespace box_cover_internal {
class coverage_manager {
private:
V num_v;
std::vector<W> dist;
V cnt;
W radius;
double least_coverage;
coverage_manager() {}
public:
/**
* Coverage Manager
* \param g is the graph to cover
* \param r is the radius... |
imos/icfpc2017 | nineserver/common.h | <reponame>imos/icfpc2017
#pragma once
#include <ctype.h>
#include <string.h>
#include <algorithm>
#include "base/base.h"
#ifndef DVLOG_IS_ON
#ifdef NDEBUG
#define DVLOG_IS_ON(level) false
#else
#define DVLOG_IS_ON(level) VLOG_IS_ON(level)
#endif
#endif
// Enables to prioritize functions.
template<unsigned priority>
... |
imos/icfpc2017 | iwiwi/src/agl/cut_tree/cut_tree.h | #pragma once
#include "two_edge_cc_filter.h"
#include "cut_tree_with_2ecc.h"
#include "dinitz.h"
#include "bi_dinitz.h"
#include "plain_gusfield.h"
#include "cut_tree_query_handler.h"
namespace agl {
using cut_tree = agl::cut_tree_internal::two_edge_cc_filter<cut_tree_with_2ecc>; // fastest
using plain_gusfield_bi_di... |
imos/icfpc2017 | iwiwi/src/random.h | <filename>iwiwi/src/random.h
#pragma once
#include "base.h"
pair<int, int> RandomRemaining(const GameState &game_state);
|
imos/icfpc2017 | iwiwi/src/graph.h | <filename>iwiwi/src/graph.h<gh_stars>1-10
#pragma once
#include "base.h"
struct Edge {
int to;
int owner, owner2;
double score; // Used for some scoring (e.g., betweenness centrality)
bool Available(int rank) const {
return owner == -1 || owner == rank;
}
};
using Graph = vector<vector<Edge>>;
Graph ... |
imos/icfpc2017 | ninetan/ninestream_util.h | <filename>ninetan/ninestream_util.h
#include "base/base.h"
namespace ninetan {
class StreamUtil {
public:
static constexpr char kCommunicatorStreams[] = "communicator";
static constexpr char kWorkerStreams[] = "worker";
enum StatusCode {
OK = 0,
CANCELLED = 1,
UNKNOWN = 2,
INVALID_ARGUMENT = 3... |
imos/icfpc2017 | iwiwi/src/agl/shortest_path/visitor.h | <reponame>imos/icfpc2017
#pragma once
#include "heap/heap.h"
// http://pgkiss.web.fc2.com/cxx/parameterize-code.html
namespace agl {
// TODO: specialize for |unweighted_graph|
template<typename GraphType>
class visitor_by_distance {
public:
using W = typename GraphType::W;
visitor_by_distance(const GraphType &g... |
imos/icfpc2017 | iwiwi/src/agl/graph/weight_type.h | <reponame>imos/icfpc2017<gh_stars>1-10
#pragma once
#include <algorithm>
#include <random>
#include "base/base.h"
namespace agl {
//
// W traits
//
template<class T>
struct weight_traits {
static constexpr inline T eps() {
return T();
}
static constexpr inline T abs(T x) {
return std::abs(x);
}
sta... |
imos/icfpc2017 | iwiwi/src/agl/cut_tree/two_edge_cc_filter.h | #pragma once
#include "connected_components_filter.h"
namespace agl {
namespace cut_tree_internal {
// two-edge connected components filter
template<class handler_t>
class two_edge_cc_filter {
public:
void lowlink_dfs(int v, int par, int& cur_ord) {
lowlink_[v] = order_[v] = cur_ord++;
for (int dir = 0; dir... |
imos/icfpc2017 | iwiwi/src/agl/cut_tree/dinitz.h | #pragma once
#include <base/base.h>
#include <graph/graph.h>
namespace agl {
namespace cut_tree_internal {
class dinitz {
struct E {
int to_, rev_, cap_;
E(int to, int rev_, int cap_) : to_(to), rev_(rev_), cap_(cap_) {}
};
void bfs(int s);
int dfs(int v, int t, int f);
void add_undirected_edge(int ... |
imos/icfpc2017 | iwiwi/src/agl/connectivity/strongly_connected_components.h | <reponame>imos/icfpc2017
#pragma once
#include <stack>
#include "graph/graph.h"
namespace agl {
template<typename GraphT = G>
std::vector<V> strongly_connected_components(const GraphT& g) {
const V num_v = g.num_vertices();
std::vector<V> scc(num_v);
V num_visit = 0, num_scc = 0;
std::vector<V> ord(num_v, -1... |
imos/icfpc2017 | iwiwi-visualizer/src/ofApp.h | <gh_stars>1-10
#pragma once
#include "ofMain.h"
void SetInput(const string &str);
class ofApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void keyPressed(int key);
void keyReleased(int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);
void... |
imos/icfpc2017 | iwiwi/src/agl/vertex_centrality/vertex_centrality.h | #pragma once
#include "graph/graph.h"
namespace agl {
std::vector<double> vertex_centrality_degree(const G &g);
/// 1 / (sum of distances to all vertices), higher is better, currently O(nm)
std::vector<double> vertex_centrality_classic_closeness(const G &g);
/// Move to neighbor with probability |C| and jump with pr... |
imos/icfpc2017 | iwiwi/src/agl/heap/heap.h | #pragma once
#include "radix_heap.h"
#include "dijkstra_heap.h"
namespace agl {
template<typename KeyT>
using heap = radix_heap::radix_heap<KeyT>;
template<typename KeyT, typename ValueT>
using pair_heap = radix_heap::pair_radix_heap<KeyT, ValueT>;
}
|
imos/icfpc2017 | iwiwi/src/agl/shortest_path/dynamic_pruned_landmark_labeling.h | <gh_stars>1-10
#pragma once
#include "graph/graph.h"
#include "graph/graph_index_interface.h"
#include <set>
namespace agl {
template <size_t kNumBitParallelRoots = 16>
class dynamic_pruned_landmark_labeling
: public dynamic_graph_index_interface<G>,
public distance_query_interface<G> {
public:
virtual ~d... |
imos/icfpc2017 | nineserver/json.h | <reponame>imos/icfpc2017
#pragma once
#include <string>
#include <type_traits>
#define PICOJSON_USE_INT64
#include "base/base.h"
#include "nineserver/common.h"
#include "nineserver/json11/json11.hpp"
using Json = json11::Json;
template<class T>
string JsonEncode(const T& value, bool prettify = false) {
return Json... |
imos/icfpc2017 | iwiwi/src/agl/edge_centrality/edge_centrality.h | #pragma once
#include <unordered_map>
#include "graph/graph.h"
DECLARE_string(edge_betweenness_centrality_algorithm);
DECLARE_int32(edge_betweenness_centrality_num_samples);
namespace agl {
using edge_centrality_map = std::unordered_map<std::pair<V, V>, double>;
edge_centrality_map merge_edge_centrality_map_entries_f... |
imos/icfpc2017 | iwiwi/src/agl/cut_tree/connected_components_filter.h | #pragma once
#include <base/base.h>
#include <graph/graph.h>
#include <vector>
#include <queue>
namespace agl {
template<class handler_t>
class connected_components_filter {
public:
connected_components_filter(const G& g)
: n_(g.num_vertices()), uf_(n_), local_indices_(n_), handlers_indices_(n_), num_connected_c... |
imos/icfpc2017 | iwiwi/src/agl/heap/dijkstra_heap.h | #pragma once
#include "radix_heap.h"
#include "graph/graph.h"
namespace agl {
template<typename GraphT = G>
class dijkstra_heap {
public:
using V = typename GraphT::V;
using W = typename GraphT::W;
explicit dijkstra_heap(V num_vertices = 0) : ws_(num_vertices, infinity_weight<W>()) {}
inline bool decrease(V ... |
imos/icfpc2017 | iwiwi/src/agl/connectivity/connectivity.h | <filename>iwiwi/src/agl/connectivity/connectivity.h
#pragma once
#include <queue>
#include <algorithm>
#include "graph/graph.h"
namespace agl {
template<typename GraphType>
bool is_connected(const GraphType &g) {
if (g.num_vertices() == 0) return true;
std::queue<V> que;
std::vector<bool> vis(g.num_vertices());... |
imos/icfpc2017 | iwiwi/src/base.h | <reponame>imos/icfpc2017
#pragma once
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include ... |
imos/icfpc2017 | iwiwi/src/agl/base/data_structures.h | <filename>iwiwi/src/agl/base/data_structures.h<gh_stars>1-10
#pragma once
#include <cstdint>
#include <type_traits>
#include <vector>
namespace agl {
class union_find {
public:
using T = int32_t;
explicit union_find(T n = 0) {
init(n);
}
void clear() {
init(0);
}
void init(T n) {
par_.assi... |
imos/icfpc2017 | iwiwi/src/agl/base/hash.h | <filename>iwiwi/src/agl/base/hash.h
#pragma once
#include <functional>
namespace std { // argh!
template<typename A, typename B>
struct hash<std::pair<A, B>> {
size_t operator()(const std::pair<A, B> &p) const {
return std::hash<A>()(p.first) * 1000000007 + std::hash<B>()(p.second);
}
};
} // namespace std
|
imos/icfpc2017 | iwiwi/src/agl/heap/radix_heap.h | // https://github.com/iwiwi/radix-heap/blob/master/radix_heap.h
#pragma once
#include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <cstdint>
#include <limits>
#include <type_traits>
#include <utility>
#include <vector>
namespace radix_heap {
namespace internal {
template<bool Is64bit> c... |
imos/icfpc2017 | sulume/liner.c | <reponame>imos/icfpc2017
#include <stdio.h>
#include <stdlib.h>
int main() {
setbuf(stdout, NULL);
size_t bufsize = BUFSIZ;
char* buf = malloc(bufsize);
size_t n, m;
do {
if (scanf("%zu:", &n) < 1) break;
if (bufsize < n) {
buf = realloc(buf, n);
bufsize = n;
}
m = fread(buf, 1, n... |
mr-glt/NCAEP | Data Logging/Libraries/Adafruit_TSL2561-master/pgmspace.h | <filename>Data Logging/Libraries/Adafruit_TSL2561-master/pgmspace.h<gh_stars>1-10
/**************************************************************************/
/*!
@file pgmspace.h
@author <NAME>
@section LICENSE
Software License Agreement (BSD License)
Copyright (c) 2013, <NAME>
All ri... |
mr-glt/NCAEP | Tracking/Habduino/ax25modem.h | <filename>Tracking/Habduino/ax25modem.h
/* From Project Swift - High altitude balloon flight software */
/*=======================================================================*/
/* Copyright 2010-2012 <NAME> <<EMAIL>> */
/* <NAME> <<EMAIL>> */
/* ... |
mr-glt/NCAEP | Tracking/Habduino/sine_table.h | 0x80,0x81,0x83,0x84,0x86,0x87,0x89,0x8A,0x8C,0x8D,0x8F,0x91,0x92,0x94,0x95,0x97,
0x98,0x9A,0x9B,0x9D,0x9E,0xA0,0xA1,0xA3,0xA4,0xA6,0xA7,0xA9,0xAA,0xAC,0xAD,0xAF,
0xB0,0xB2,0xB3,0xB4,0xB6,0xB7,0xB9,0xBA,0xBB,0xBD,0xBE,0xBF,0xC1,0xC2,0xC3,0xC5,
0xC6,0xC7,0xC9,0xCA,0xCB,0xCC,0xCE,0xCF,0xD0,0xD1,0xD2,0xD4,0xD5,0xD6,0xD7,0x... |
bitpdg/cie-middleware-macos | CIEToken/CIEToken.h | //
// Token.h
// CIEToken
//
// Created by <NAME> on 06/10/18.
// Copyright © 2018 IPZS. All rights reserved.
//
#import <CryptoTokenKit/CryptoTokenKit.h>
// directive for PKCS#11
#include "../cie-pkcs11/PKCS11/cryptoki.h"
#include <dlfcn.h>
// per abilitare il cryptotokendriver
// sudo -u _securityagent plugink... |
bitpdg/cie-middleware-macos | CIE ID/CIE ID-Bridging-Header.h | <reponame>bitpdg/cie-middleware-macos
//
// CIEID-Bridging-Header.h
// CIE ID
//
// Created by <NAME> on 10/02/21.
// Copyright © 2021 IPZS. All rights reserved.
//
#ifndef CIEID_Bridging_Header_h
#define CIEID_Bridging_Header_h
#import "ChangeView.h"
#endif /* CIEID_Bridging_Header_h */
|
bitpdg/cie-middleware-macos | CIEIDBar/MessageViewController.h | <reponame>bitpdg/cie-middleware-macos
//
// MessageViewController.h
// CIEIDBar
//
// Created by <NAME> on 05/01/2019.
// Copyright © 2019 IPZS. All rights reserved.
//
#import <Cocoa/Cocoa.h>
NS_ASSUME_NONNULL_BEGIN
@protocol CIEPopoverProtocol
- (void) showPopover: (NSObject*) sender;
- (void) closePopover: (... |
bitpdg/cie-middleware-macos | cie_sign_sdk/include/UUCTextFileWriter.h | // UUCTextFileWriter.h: interface for the UUCTextFileWriter class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_UUCTEXTFILEWRITER_H__F64974CA_4F95_4200_B7AE_4A53FB004B75__INCLUDED_)
#define AFX_UUCTEXTFILEWRITER_H__F64974CA_4F95_4200_B7AE_4A53FB004B75__INCLUDED_
#i... |
bitpdg/cie-middleware-macos | cie_sign_sdk/include/SignedDataGeneratorEx.h | <filename>cie_sign_sdk/include/SignedDataGeneratorEx.h
/*
* SignedDataGenerator.h
* iDigitalS
*
* Created by svp on 05/07/11.
* Copyright 2011 __MyCompanyName__. All rights reserved.
*
*/
//#include "ASN1/utiltypes.h"
#include "UUCByteArray.h"
#include "SignedDocument.h"
#include "ASN1/SignerInfo.h"
#includ... |
bitpdg/cie-middleware-macos | CIE ID/PINNoticeViewController.h | //
// PINNoticeViewController.h
// CIE ID
//
// Created by <NAME> on 01/07/2019.
// Copyright © 2019 IPZS. All rights reserved.
//
#import <Cocoa/Cocoa.h>
NS_ASSUME_NONNULL_BEGIN
@interface PINNoticeViewController : NSViewController
@end
NS_ASSUME_NONNULL_END
|
bitpdg/cie-middleware-macos | CIE ID/Carousel/CarouselCard.h | <reponame>bitpdg/cie-middleware-macos<filename>CIE ID/Carousel/CarouselCard.h
//
// CarouselCard.h
// CIE ID
//
#import <Cocoa/Cocoa.h>
#import "Cie.h"
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, CarouselCardSizeMode) {
CarouselCardSizeModeSmall,
CarouselCardSizeModeRegular,
};
@interface CarouselC... |
bitpdg/cie-middleware-macos | cie_sign_sdk/include/PdfSignatureGenerator.h | /*
* PdfSignatureGenerator.h
* SignPoDoFo
*
* Created by svp on 26/05/12.
* Copyright 2012 __MyCompanyName__. All rights reserved.
*
*/
#ifndef _PDFSIGNATUREGENERATOR_H_
#define _PDFSIGNATUREGENERATOR_H_
#include "podofo/podofo.h"
#include "podofo/doc/PdfSignOutputDevice.h"
#include "podofo/doc/PdfSignatur... |
bitpdg/cie-middleware-macos | CIE ID/IntroViewController.h | //
// IntroViewController.h
// CIE ID
//
// Created by <NAME> on 14/12/2018. http://www.ugochirico.com
// Copyright © 2018 IPZS. All rights reserved.
//
#import <Cocoa/Cocoa.h>
NS_ASSUME_NONNULL_BEGIN
@interface IntroViewController : NSViewController <NSWindowDelegate>
@property IBOutlet NSView* firstPageView;
... |
bitpdg/cie-middleware-macos | CIEIDBar/AppDelegate.h | //
// AppDelegate.h
// CIEIDBar
//
// Created by <NAME> on 05/01/2019.
// Copyright © 2019 IPZS. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "MessageViewController.h"
@interface AppDelegate : NSObject <NSApplicationDelegate,CIEPopoverProtocol>
@end
|
bitpdg/cie-middleware-macos | CIE ID/Cie.h | //
// Cie.h
// CIE ID
//
// Created by <NAME> on 21/09/2020.
// Copyright © 2020 IPZS. All rights reserved.
//
#ifndef Cie_h
#define Cie_h
#import <Foundation/Foundation.h>
@interface Cie : NSObject <NSCoding>
-(id)init: (NSString*) name serial:(NSString*) serialNumner pan:(NSString *) pan;
-(NSString*) getNam... |
bitpdg/cie-middleware-macos | CIE ID/CieList.h | //
// CieList.h
// Dictionary_Class_Example
//
// Created by <NAME> on 21/09/2020.
// Copyright © 2020 <NAME>. All rights reserved.
//
#ifndef CieList_h
#define CieList_h
#import <Foundation/Foundation.h>
#import "Cie.h"
@interface CieList : NSObject
-(id) init;
//-(id) init:(NSDictionary*)dictionary;
-(id) ... |
bitpdg/cie-middleware-macos | CIE ID/MainViewController.h | <reponame>bitpdg/cie-middleware-macos
//
// MainViewController.h
// CIE ID
//
// Created by <NAME> on 11/12/2018. http://www.ugochirico.com
// Copyright © 2018 IPZS. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
#import "CarouselView.h"
NS_ASSUME_NONNULL_BEGIN
@interface MainViewCont... |
bitpdg/cie-middleware-macos | cie-pkcs11/CSP/VerificaConCIE.h | //
// VerificaConCIE.h
// cie-pkcs11
//
// Copyright © 2021 IPZS. All rights reserved.
//
#ifndef VerificaConCIE_h
#define VerificaConCIE_h
#include <stdio.h>
#include "AbilitaCIE.h"
#include "../Sign/CIEVerify.h"
//typedef CK_RV (*verificaConCIEfn)(const char* inFilePath, verifyInfos_t* vInfos);
typedef CK_RV (*... |
bitpdg/cie-middleware-macos | CIE ID/AppDelegate.h | <gh_stars>10-100
//
// AppDelegate.h
// CIE ID
//
// Created by <NAME> on 11/12/2018. http://www.ugochirico.com
// Copyright © 2018 IPZS. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@end
|
bitpdg/cie-middleware-macos | cie_sign_sdk/src/Util/util.h | <filename>cie_sign_sdk/src/Util/util.h<gh_stars>10-100
#pragma once
#include "wintypes.h"
#include <string>
#include "Array.h"
#include "log.h"
#define ERR_BAD_POINTER "Puntatore non valido"
#define ERR_CANT_CREATE_MUTEX "Impossibile creare il mutex"
#define ERR_CANT_CREATE_EVENT "Impossibile creare l'evento... |
bitpdg/cie-middleware-macos | CIE ID/Carousel/CarouselView.h | //
// CarouselView.h
// CIE ID
//
#import <Cocoa/Cocoa.h>
#import "Cie.h"
NS_ASSUME_NONNULL_BEGIN
@protocol CarouselViewDelegate <NSObject>
- (void) shouldAddCard;
- (void) shouldRemoveCard:(Cie *)card;
- (void) shouldRemoveAllCards;
@end
@interface CarouselView : NSView
@property (nonatomic, weak, nullable) ... |
greedyhao/LittlevGL2RTT | lvgl/lv_objx/lv_list.c | <gh_stars>10-100
/**
* @file lv_list.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_list.h"
#if USE_LV_LIST != 0
#include "../lv_core/lv_group.h"
#include "../lv_themes/lv_theme.h"
#include "../lv_misc/lv_anim.h"
#include "../lv_misc/lv_math.h"
/*********************
* D... |
greedyhao/LittlevGL2RTT | lvgl/lv_misc/lv_log.h | /**
* @file lv_log.h
*
*/
#ifndef LV_LOG_H
#define LV_LOG_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lv_conf.h"
#else
#include "../../lv_conf.h"
#endif
#include <stdint.h>
/*********************
* DEFINES
... |
greedyhao/LittlevGL2RTT | lvgl/lv_hal/lv_hal_indev.c | <filename>lvgl/lv_hal/lv_hal_indev.c
/**
* @file hal_indev.c
*
* @description Input device HAL interface
*
*/
/*********************
* INCLUDES
*********************/
#include "../lv_hal/lv_hal_indev.h"
#include "../lv_misc/lv_mem.h"
/*********************
* DEFINES
*********************/
/*******... |
greedyhao/LittlevGL2RTT | lvgl/lv_objx/lv_kb.c |
/**
* @file lv_kb.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_kb.h"
#if USE_LV_KB != 0
#include "lv_ta.h"
#include "../lv_themes/lv_theme.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/... |
greedyhao/LittlevGL2RTT | littlevgl2rtt.c | <filename>littlevgl2rtt.c<gh_stars>1-10
#include "littlevgl2rtt.h"
#include "lvgl.h"
static rt_device_t device;
static struct rt_device_graphic_info info;
static struct rt_messagequeue *input_mq;
/* Todo: add gpu */
static void lcd_fb_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color)
{
/... |
greedyhao/LittlevGL2RTT | lvgl/lv_draw/lv_draw_label.c | /**
* @file lv_draw_label.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_draw_label.h"
#include "lv_draw_rbasic.h"
#include "../lv_misc/lv_math.h"
/*********************
* DEFINES
*********************/
#define LABEL_RECOLOR_PAR_LENGTH 6
/**********************
* ... |
greedyhao/LittlevGL2RTT | lvgl/lv_themes/lv_theme_alien.c | <filename>lvgl/lv_themes/lv_theme_alien.c
/**
* @file lv_theme_alien.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_theme.h"
#if USE_LV_THEME_ALIEN
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/... |
greedyhao/LittlevGL2RTT | lvgl/lv_themes/lv_theme.c | /**
* @file lv_theme.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_theme.h"
#include "../lv_core/lv_obj.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROT... |
mprs-kiran/IEEE-802.15.4 | IEEE802_15_4_CSMA_ONNODE_STORAGE.c | <filename>IEEE802_15_4_CSMA_ONNODE_STORAGE.c
/*
This simulation code models the behaviour of IEEE 802.15.4 Slotted CSMA/CA with limited on-node storage and connected in star topology.
We assume ideal channel conditions and only the CSMA/CA is modeled without any PHY layer.
All the delays are measured in slots (1 slot... |
mprs-kiran/IEEE-802.15.4 | SlottedCSMAWithPCA.c | <reponame>mprs-kiran/IEEE-802.15.4<filename>SlottedCSMAWithPCA.c
/*
* CSMAWithPCASlotted.c
*
* Created on: Jan 10, 2017
* Author: Kiran
*/
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<math.h>
#define t 40000000 // Simulation duration in backoff slots
#define node_num 40 //No. of nodes
#de... |
harderthan/autoware | ros/src/computing/planning/motion/packages/waypoint_follower/include/mpc_follower/lowpass_filter.h | /*
* Copyright 2018-2019 Autoware Foundation. All rights reserved.
*
* 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 requi... |
harderthan/autoware | ros/src/computing/planning/motion/packages/waypoint_follower/include/mpc_follower/mpc_utils.h | /*
* Copyright 2018-2019 Autoware Foundation. All rights reserved.
*
* 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 requi... |
Appla/yaconf | php_yaconf.h | /*
+----------------------------------------------------------------------+
| Yet Another Conf |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundl... |
joaofbsm/battleship-intel | cpp/src/graph.h | #ifndef GRAPH_H
#define GRAPH_H
#include <iostream>
#include <vector>
#include <list>
using namespace std;
// Graph class represents a undirected graph
// using adjacency list representation
class Graph {
int V; // No. of vertices
int E; // No. of edges
// Pointer to an array containin... |
coolbutuseless/simplec | src/add.c |
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Add 2 numbers and store the result in 'res'
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void add_(double* x, double* y, double* res) {
res[0] = x[0] + y[0];
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... |
CedarChennn/myC | 04ObjectScopeandConversions/constants.h | <reponame>CedarChennn/myC<filename>04ObjectScopeandConversions/constants.h
#ifndef CONSTANTS_H
#define CONSTANTS_H
namespace constants
{
inline constexpr int max_class_size{30};
} // namespace constants
#endif |
CedarChennn/myC | 08Basic object-oriented programming/friend-functions-and-classe/quiz/Vector3d.h | <gh_stars>1-10
#ifndef VECTOR3D_H
#define VECTOR3D_H
#include "Point3d.h"
class Vector3d
{
private:
double m_x{};
double m_y{};
double m_z{};
public:
Vector3d(double x = 0.0, double y = 0.0, double z = 0.0)
: m_x{x}, m_y{y}, m_z{z}
{
}
void print() const;
friend void Point3d::... |
CedarChennn/myC | 08Basic object-oriented programming/class-code-and-header-files/Date.h | #ifndef DATE_H
#define DATE_H
class Date
{
private:
int m_year;
int m_month;
int m_day;
public:
Date(int year,int month,int day);
void setDate(int year,int month,int day);
int getYear() { return m_year; }
int getMonth() { return m_month; }
int getDay() { return m_day; }
};
#end... |
CedarChennn/myC | 05ControlFlow/ball_falling_off_of_a _tower/constants.h | <filename>05ControlFlow/ball_falling_off_of_a _tower/constants.h
#ifndef CONSTANTS_H
#define CONSTANTS_H
namespace myConstants
{
constexpr double gravity{ 9.8 }; // in meters/second squared
}
#endif |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.