repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
asimm-hirani/SimpleSerial | lib/nrjavaserial-master/src/main/c/src/fixup.c | /*-------------------------------------------------------------------------
| RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface.
| RXTX is a native interface to serial ports in java.
| Copyright 1997-2007 by <NAME> <EMAIL> and others who
| actually wrote it. See individual source files for mo... |
asimm-hirani/SimpleSerial | lib/nrjavaserial-master/src/main/c/include/target/gnu_io_RXTXCommDriver.h | /* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class gnu_io_RXTXCommDriver */
#ifndef _Included_gnu_io_RXTXCommDriver
#define _Included_gnu_io_RXTXCommDriver
#ifdef __cplusplus
extern "C" {
#endif
#undef gnu_io_RXTXCommDriver_debug
#define gnu_io_RXTXCommDriver_debug 0L
#undef gnu... |
lmaas/sigmod2012contest | benchmark/core/logger.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, ... |
lmaas/sigmod2012contest | BasicImpl.c | /*
Copyright (c) 2011 TU Dresden - Database Technology Group
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merg... |
lmaas/sigmod2012contest | benchmark/core/generators/normal_generator.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, c... |
lmaas/sigmod2012contest | include/contest_interface.h | /*
Copyright (c) 2011 TU Dresden - Database Technology Group
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merg... |
lmaas/sigmod2012contest | benchmark/core/utils/rngs/xor_shift_number_generator.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, ... |
lmaas/sigmod2012contest | benchmark/core/loggers/console_logger.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, ... |
lmaas/sigmod2012contest | benchmark/version.h | <gh_stars>1-10
//
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rig... |
lmaas/sigmod2012contest | benchmark/core/generators/discrete_generator.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, ... |
lmaas/sigmod2012contest | example/util.h | <gh_stars>1-10
/*
Copyright (c) 2012 TU Dresden - Database Technology Group
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
us... |
lmaas/sigmod2012contest | example/transaction.h | /*
Copyright (c) 2012 TU Dresden - Database Technology Group
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify... |
lmaas/sigmod2012contest | example/iterator.h | <gh_stars>1-10
/*
Copyright (c) 2012 TU Dresden - Database Technology Group
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
us... |
lmaas/sigmod2012contest | benchmark/core/benchmark_properties.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, ... |
lmaas/sigmod2012contest | benchmark/core/workload.h | <reponame>lmaas/sigmod2012contest
//
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without... |
lmaas/sigmod2012contest | example/connection_manager.h | /*
Copyright (c) 2012 TU Dresden - Database Technology Group
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify... |
lmaas/sigmod2012contest | unittests/util.h | <filename>unittests/util.h<gh_stars>1-10
/*
Copyright (c) 2012 TU Dresden - Database Technology Group
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without li... |
lmaas/sigmod2012contest | benchmark/core/generators/constant_string_generator.h | <filename>benchmark/core/generators/constant_string_generator.h<gh_stars>1-10
//
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Sof... |
lmaas/sigmod2012contest | benchmark/core/utils/argument_parser.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, ... |
lmaas/sigmod2012contest | benchmark/core/cached_key_store.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, ... |
lmaas/sigmod2012contest | benchmark/core/importers/json_importer.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, ... |
lmaas/sigmod2012contest | benchmark/core/utils/timer.h | <reponame>lmaas/sigmod2012contest
//
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without... |
lmaas/sigmod2012contest | benchmark/core/generators/zipf_generator.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, c... |
lmaas/sigmod2012contest | common/macros.h | /*
Copyright (c) 2011 TU Dresden - Database Technology Group
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merg... |
lmaas/sigmod2012contest | benchmark/core/benchmark.h | <filename>benchmark/core/benchmark.h
//
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including with... |
lmaas/sigmod2012contest | unittests/test_runner.h | /*
Copyright (c) 2012 TU Dresden - Database Technology Group
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify... |
lmaas/sigmod2012contest | example/index.h | /*
Copyright (c) 2012 TU Dresden - Database Technology Group
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify... |
lmaas/sigmod2012contest | example/mutex.h | /*
Copyright (c) 2012 TU Dresden - Database Technology Group
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify... |
lmaas/sigmod2012contest | benchmark/workloads/sigmod_2012_basic_workload.h | <reponame>lmaas/sigmod2012contest
//
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without... |
lmaas/sigmod2012contest | benchmark/workloads/sigmod_2012_properties.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, ... |
lmaas/sigmod2012contest | benchmark/core/generators/uniform_generator.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, ... |
lmaas/sigmod2012contest | benchmark/core/statistics.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, ... |
lmaas/sigmod2012contest | benchmark/core/generator.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, ... |
lmaas/sigmod2012contest | benchmark/core/generators/fixed_length_string_generator.h | <filename>benchmark/core/generators/fixed_length_string_generator.h
//
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software witho... |
lmaas/sigmod2012contest | benchmark/core/generators/sequence_generator.h | <reponame>lmaas/sigmod2012contest
//
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without... |
lmaas/sigmod2012contest | unittests/test_util.h | /*
Copyright (c) 2012 TU Dresden - Database Technology Group
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify... |
lmaas/sigmod2012contest | benchmark/core/utils/rng.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, ... |
lmaas/sigmod2012contest | benchmark/core/utils/mutex.h | //
// Copyright (c) 2012 TU Dresden - Database Technology Group
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, ... |
Zefiros-Software/Args | args/include/args/args.h | <reponame>Zefiros-Software/Args
/**
* @cond ___LICENSE___
*
* Copyright (c) 2016-2018 Zefiros Software.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including... |
Zefiros-Software/Args | args/include/args/option.h | <filename>args/include/args/option.h<gh_stars>0
/**
* @cond ___LICENSE___
*
* Copyright (c) 2016-2018 Zefiros Software.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restri... |
mtiapko/imgroot | include/imgroot/FileBrowser.h | <gh_stars>1-10
#ifndef __IM_GROOT_FILE_BROWSER_H__
#define __IM_GROOT_FILE_BROWSER_H__
#include <filesystem>
namespace ImGroot
{
class FileBrowser
{
private:
std::filesystem::path m_current_dir = std::filesystem::current_path();
uint32_t m_selected_item_id = std::numeric_limits<uint32_t>::max();
private:
void un... |
fgrehm/pucrs-AR-road | scene.h | #ifndef SCENE_H
#define SCENE_H
void drawBuildingsThatHaveMarkers();
void drawCarsAndStaticBuildings(int executionTime);
#endif
|
fgrehm/pucrs-AR-road | globals.h | #ifndef GLOBALS_H
#define GLOBALS_H
#include <AR/arMulti.h>
#include "object.h"
/* Road multi marker configs */
ARMultiMarkerInfoT *multiMarkerConfig;
/* Independent buildings settings */
ObjectData_T *buildingMarkers;
int totalBuildingMarkers;
/* scene settings */
extern int showBuildings;
static doubl... |
fgrehm/pucrs-AR-road | main.c | <filename>main.c
#ifdef _WIN32
#include <windows.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#ifndef __APPLE__
#include <GL/gl.h>
#include <GL/glut.h>
#else
#include <OpenGL/gl.h>
#include <GLUT/glut.h>
#endif
#include <AR/gsub.h>
#include <AR/video.h>
#include <AR/param.h>
#include <AR/ar.h>
#include <AR/arMulti.... |
fgrehm/pucrs-AR-road | object.c | /*
** ARToolKit object parsing function
** From https://github.com/seichter/artoolkit/blob/49a8aef445490a528b655443b94c317a48765a25/examples/loadMultiple/object.c
**
** Format:
** <obj_num>
**
** <obj_name>
** <obj_pattern filename>
** <marker_width>
** <centerX centerY>
**
** ...
**
** eg
**
** #pattern 1
** Hiro
** D... |
fgrehm/pucrs-AR-road | scene.c | #ifdef _WIN32
#include <windows.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#ifndef __APPLE__
#include <GL/gl.h>
#include <GL/glut.h>
#else
#include <OpenGL/gl.h>
#include <GLUT/glut.h>
#endif
#include "globals.h"
#include "object.h"
#include "scene.h"
double distance = 0;
int showBuildings = 0;
static void dra... |
LordMathis/neural-nets | test/test_functions.c | #include "test.h"
#include "../lib/functions.h"
#include <stdbool.h>
static bool is_approx_equal(double a, double b)
{
int a_int = (int) a * 1000000;
int b_int = (int) a * 1000000;
return a_int == b_int;
}
static int test_act_sigmoid()
{
int res = 0;
if (act_sigmoid(0) != 0.5 ||
!is_app... |
LordMathis/neural-nets | test/test.h | #include <stdbool.h>
#include "../lib/matrix.h"
int fail(const char *test_name, const char *message);
int eval_test_result(const char *test_name, int result);
bool is_non_zero(Matrix *matrix);
int test_matrix();
int test_layer();
int test_network();
int test_functions();
int test_utils();
|
LordMathis/neural-nets | lib/layer.c | #include "layer.h"
#include "matrix.h"
#include "functions.h"
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <stdio.h>
static int init_layer(Layer *layer);
Layer* create_layer(int layer_size, int input_size, Activation *activation)
{
Layer *layer = (Layer *) malloc (sizeof (Layer));
layer->... |
LordMathis/neural-nets | examples/xor.c | <gh_stars>1-10
#include "../lib/network.h"
#include "../lib/functions.h"
#include "../lib/utils.h"
#include "../lib/matrix.h"
#include <stdlib.h>
#include <stdio.h>
int main() {
int layers[] = {2,1};
Activation *act_sigmoid = create_sigmoid_activation();
Network *xor_network = create_network(2, 2, layers,... |
LordMathis/neural-nets | test/test.c | <gh_stars>1-10
#include "test.h"
#include "../lib/matrix.h"
#include "../lib/utils.h"
#include <stdbool.h>
#include <stdio.h>
int fail(const char *test_name, const char *message)
{
RED_COLOR;
printf("%s %s\n", test_name, message);
RESET_COLOR;
return -1;
}
int eval_test_result(const char *test_name, i... |
LordMathis/neural-nets | lib/matrix.c | <gh_stars>1-10
#include "matrix.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
Matrix* create_matrix(int rows, int cols, const double mat[][cols])
{
Matrix *matrix = (Matrix *) malloc (sizeof (Matrix));
matrix->rows = rows;
matrix->cols = cols;
matrix->matrix = NULL;
if (rows > 0 ... |
LordMathis/neural-nets | lib/matrix.h | #ifndef MATRIX_H
#define MATRIX_H
#include <stdbool.h>
typedef struct
{
int rows;
int cols;
double **matrix;
} Matrix;
Matrix *create_matrix(int rows, int cols, const double mat[][cols]);
void print_matrix(Matrix *matrix);
bool is_null(Matrix *matrix);
int transpose(Matrix *a, Matrix *result);
int multi... |
LordMathis/neural-nets | test/test_matrix.c | #include "../lib/matrix.h"
#include "test.h"
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
static bool is_equal(Matrix *matrix, int rows, int cols, const double mat[rows][cols])
{
if (matrix->rows != rows || matrix->cols != cols)
{
return false;
}
for (int i = 0; i < rows; i++)
... |
LordMathis/neural-nets | lib/utils.h | <reponame>LordMathis/neural-nets
#ifndef UTILS_H
#define UTILS_H
#include "matrix.h"
#include "functions.h"
#define RED_COLOR printf("\033[0;31m")
#define GREEN_COLOR printf("\033[0;32m")
#define RESET_COLOR printf("\033[0m" )
#define DEBUG 0
#define INFO 1
#define EXCEPTION 2
#ifndef LOG_LEVEL
#define LOG_LEVEL 1... |
LordMathis/neural-nets | lib/functions.h | <reponame>LordMathis/neural-nets
#include "matrix.h"
#ifndef FUNCTIONS_H
#define FUNCTIONS_H
// Activation functions
double act_sigmoid(double num);
double act_sigmoid_der(double num);
double act_relu(double num);
double act_relu_der(double num);
typedef enum
{
SIGMOID,
RELU
} ActivationType;
typedef stru... |
LordMathis/neural-nets | lib/network.c | #include "layer.h"
#include "matrix.h"
#include "network.h"
#include "utils.h"
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
Network* create_network(int input_size, int num_layers, int layers[], Activation *activation)
{
Network *network = (Network *) malloc (sizeof (Network));
network->num_layers... |
LordMathis/neural-nets | lib/layer.h | <reponame>LordMathis/neural-nets<filename>lib/layer.h
#ifndef LAYER_H
#define LAYER_H
#include "matrix.h"
#include "functions.h"
typedef struct
{
Matrix *weights;
Matrix *bias;
Matrix *neurons;
Matrix *neurons_act;
Activation *activation;
int num_neurons;
} Layer;
Layer* create_layer(int laye... |
LordMathis/neural-nets | test/test_network.c | #include "test.h"
#include "../lib/network.h"
#include "../lib/matrix.h"
#include <stdlib.h>
#include <stdio.h>
static double f(double num)
{
return num;
}
static int test_create_network()
{
int res = 0;
int input_size = 10;
int num_layers = 3;
int layers[] = {30,20,10};
Activation *sigmoid... |
LordMathis/neural-nets | lib/functions.c | <reponame>LordMathis/neural-nets
#include <math.h>
#include <stdlib.h>
#include "functions.h"
#include "matrix.h"
// Activations and derivatives
double act_sigmoid(double num)
{
return 1 / (1 + exp(-1*num));
}
double act_sigmoid_der(double num)
{
return exp(-1*num)/pow(1 + exp(-1*num),2);
}
double act_relu(... |
LordMathis/neural-nets | lib/utils.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "utils.h"
#include "matrix.h"
void logger(int log_level, const char *function_name, const char *message)
{
if (log_level >= LOG_LEVEL)
{
if (log_level == EXCEPTION)
{
RED_COLOR;
}
printf("%s: %s\n", ... |
LordMathis/neural-nets | test/test_layer.c | #include "test.h"
#include "../lib/layer.h"
#include "../lib/matrix.h"
#include "../lib/functions.h"
#include <stdbool.h>
static int test_create_layer()
{
// Setup
int res = 0;
int layer_size = 20;
int input_size = 30;
Activation *sigmoid = create_sigmoid_activation();
Layer *layer = create_l... |
LordMathis/neural-nets | lib/network.h | #include "layer.h"
#include "matrix.h"
#include "functions.h"
#include "utils.h"
typedef struct
{
Layer **layers;
int num_layers;
} Network;
Network* create_network(int input_size, int num_layers, int layers[], Activation *activation);
void print_network(Network *network);
int delete_network(Network *network... |
LordMathis/neural-nets | examples/mnist.c | <gh_stars>1-10
#include "../lib/utils.h"
#include "../lib/functions.h"
#include "../lib/network.h"
#include "../lib/matrix.h"
#include <stdio.h>
int main()
{
int num_train = 60000;
int num_test = 10000;
char *train_inputs_fn = "./resources/mnist_train_vectors.csv";
Matrix **train_inputs = load_csv(tra... |
LordMathis/neural-nets | test/test_utils.c | <reponame>LordMathis/neural-nets
#include "../lib/matrix.h"
#include "../lib/utils.h"
#include "test.h"
#include <stdlib.h>
static int test_vectorize()
{
// Setup
int res = 0;
double mat[15][1][1];
for (int i = 0; i < 15; i++)
{
mat[i][0][0] = i;
}
Matrix **a = (Matrix**) malloc... |
douglasdavis/ac2020 | day08.c | #define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef enum {
NOP,
ACC,
JMP,
} opcode_t;
size_t remove_newline(char* line) {
size_t slen = strlen(line) - 1;
if (*line && line[slen] == '\n') {
line[slen] = '\0';
}
return slen;
}
int run_program2(const opcode_t* ops,
... |
douglasdavis/ac2020 | day05.c | #include <stdio.h>
int get_val(const char* linep, size_t start_idx, size_t end_idx,
int lo, int hi, char up_char, char dn_char) {
int val = -1;
int div = -1;
char c;
for (int i = start_idx; i < end_idx; ++i) {
c = linep[i];
div = (hi - lo + 1) / 2;
if (c == dn_char) {
hi = hi - di... |
douglasdavis/ac2020 | day06.c | #include <ctype.h>
#include <string.h>
#include <stdio.h>
void clear_things(char* b) {
memset(b, 0, sizeof(char) * 256);
}
size_t count_em(const char* s, int n_people) {
int table[256] = {0};
size_t c = strlen(s);
if (c < 1) return 0;
for (size_t i = 0; i < c; ++i) {
char ch = s[i];
size_t ach = (si... |
douglasdavis/ac2020 | day01.c | #include <stdio.h>
#define N 200
int main(int argc, char *argv[]) {
/* place to store ints */
int all[N] = {0};
/* read all the ints */
FILE* f;
int value;
f = fopen("data/day1.dat", "r");
int i = 0;
while (fscanf(f, "%d", &value) == 1) {
all[i] = value;
i++;
}
fclose(f);
/* brute for... |
douglasdavis/ac2020 | day03.c | #include <stdlib.h>
#include <stdio.h>
#define N 31
#define TREE '#'
int main(int argc, char *argv[]) {
FILE* f;
f = fopen("data/day3.dat", "r");
int irow = 0;
int ntree = 0;
char in_row[N];
int overall_cell = 0;
int current_cell = 0;
int n_right = atoi(argv[1]);
printf("%d\n", n_right);
while ... |
douglasdavis/ac2020 | day02.c | <reponame>douglasdavis/ac2020<gh_stars>0
#include <stdio.h>
#include <string.h>
typedef struct {
int min;
int max;
char c;
char* s;
} entry_t;
int is_valid_part_one(const entry_t* entry) {
int n = 0;
char* s = entry->s;
for (size_t i = 0; i < strlen(s); ++i) {
n += s[i] == entry->c;
}
return n >... |
bukinr/mdepx | arch/arm/microchip/sam_usart.h | /*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of co... |
bukinr/mdepx | arch/arm/nordicsemi/nrf9160_twim.h | <filename>arch/arm/nordicsemi/nrf9160_twim.h<gh_stars>0
/*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must ... |
bukinr/mdepx | arch/arm/stm/stm32f4_dma.h | <reponame>bukinr/mdepx<gh_stars>10-100
/*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above ... |
bukinr/mdepx | lib/libc/string/bcmp.c | /*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributio... |
bukinr/mdepx | arch/arm/stm/stm32l4_usart.h | <reponame>bukinr/mdepx
/*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* ... |
bukinr/mdepx | arch/arm/nordicsemi/nrf9160_spu.c | /*-
* Copyright (c) 2019 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of co... |
bukinr/mdepx | arch/arm/nxp/lpc43xx_i2c.h | <reponame>bukinr/mdepx<gh_stars>10-100
/*-
* Copyright (c) 2019 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above ... |
bukinr/mdepx | kernel/net/netinet/if_ethersubr.c | <gh_stars>10-100
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1982, 1986, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
*... |
bukinr/mdepx | arch/arm/stm/stm32f4_rcc.c | <reponame>bukinr/mdepx
/*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* ... |
bukinr/mdepx | arch/mips/microchip/pic32_ddr.h | <filename>arch/mips/microchip/pic32_ddr.h
/*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the abo... |
bukinr/mdepx | arch/mips/mips/trap.c | /*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
* ("CTSRD"), as part of the DARPA CRASH research programme.
*
* Redistribution and use in source ... |
bukinr/mdepx | arch/mips/include/cheriasm.h | <reponame>bukinr/mdepx<gh_stars>10-100
/*-
* Copyright (c) 2012-2016 <NAME>
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
* ("CTSRD"), as part of the DARPA CRASH research programme.
*
... |
bukinr/mdepx | arch/arm/maxim/max32660_uart.c | <filename>arch/arm/maxim/max32660_uart.c
/*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the abov... |
bukinr/mdepx | lib/bluetooth/conn.c | <gh_stars>10-100
/*
* Copyright (c) 2016, Intel Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
... |
bukinr/mdepx | lib/bluetooth/bluetooth/gatt.h | <reponame>bukinr/mdepx
/*
* Copyright (c) 2016, Intel Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright not... |
bukinr/mdepx | lib/bluetooth/bluetooth/bluetooth.h | <filename>lib/bluetooth/bluetooth/bluetooth.h
/*
* Copyright (c) 2016, Intel Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain ... |
bukinr/mdepx | arch/arm/nordicsemi/nrf9160_rtc.h | <filename>arch/arm/nordicsemi/nrf9160_rtc.h
/*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the a... |
bukinr/mdepx | arch/mips/microchip/pic32_port.c | <gh_stars>10-100
/*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice... |
bukinr/mdepx | arch/arm/nordicsemi/nrf9160_dppi.h | <filename>arch/arm/nordicsemi/nrf9160_dppi.h<gh_stars>10-100
/*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code ... |
bukinr/mdepx | arch/arm/nordicsemi/nrf9160_gpiote.h | /*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of co... |
bukinr/mdepx | kernel/systm/mdx_of.c | /*-
* Copyright (c) 2019 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of co... |
bukinr/mdepx | dev/altera/fifo/fifo.h | <gh_stars>0
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2012 <NAME>
* All rights reserved.
*
* This software was developed by SRI International and the University of
* Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-11-C-0249)
* ("MRC2"), as part of the DARPA MRC resear... |
bukinr/mdepx | arch/mips/microchip/pic32_ddr.c | <gh_stars>10-100
/*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice... |
bukinr/mdepx | arch/arm/stm/stm32f4_gpio.c | /*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of co... |
bukinr/mdepx | demo/hifive-unleashed/src/main.c | /*-
* Copyright (c) 2019 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of co... |
bukinr/mdepx | demo/qemu-cheri128/src/main.c | /*-
* Copyright (c) 2019 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of co... |
bukinr/mdepx | arch/arm/stm/stm32f4_gpio.h | /*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of co... |
bukinr/mdepx | arch/mips/microchip/pic32_adc.h | /*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of co... |
bukinr/mdepx | arch/arm/nordicsemi/nrf9160_egu.h | <gh_stars>10-100
/*-
* Copyright (c) 2018 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.