repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
Mirmik/crow | crow/gates/self_driven_gstuff.h | #ifndef CROW_SELF_DRIVEN_GSTUFF_H
#define CROW_SELF_DRIVEN_GSTUFF_H
#include <crow/gateway.h>
#include <crow/tower.h>
#include <igris/iovec.h>
#include <igris/protocols/gstuff.h>
#include <igris/sync/semaphore.h>
#include <nos/print.h>
namespace crow
{
class self_driven_gstuff : public crow::gateway
{
... |
Mirmik/crow | bindings/arduino/src/crow/addons/noslogger.h | #ifndef CROW_NOS_LOGGER_H
#define CROW_NOS_LOGGER_H
#include <nos/log/logger.h>
#include <nos/timestamp.h>
#include <crow/pubsub/pubsub.h>
namespace crow
{
class publish_logger : public nos::log::logger
{
public:
crow::hostaddr_view addr;
const char *theme;
const char *_name = ... |
Mirmik/crow | bindings/arduino/src/crow/packet.h | <reponame>Mirmik/crow
/**
@file
@brief Всё, что касается работы с пакетом.
*/
#ifndef CROW_PACKAGE_H
#define CROW_PACKAGE_H
#include <stdint.h>
#include <stdlib.h>
#include <crow/defs.h>
#include <crow/hostaddr_view.h>
#include <igris/buffer.h>
#include <igris/container/pool.h>
#include <igris/datastruct/dlist.h>
... |
Mirmik/crow | crow/nodes/queue_publisher_node.h | <reponame>Mirmik/crow<filename>crow/nodes/queue_publisher_node.h
#ifndef CROW_QUEUE_PUBLISHER_NODE_H_
#define CROW_QUEUE_PUBLISHER_NODE_H_
#include <crow/nodes/publisher_node.h>
#include <crow/proto/node.h>
#include <deque>
#include <memory>
#include <string>
namespace crow
{
class queue_publisher_node : public ... |
Mirmik/crow | apps/crowker/control_node.h | #ifndef CONTROL_NODE_H
#define CONTROL_NODE_H
void init_control_node();
#endif |
Mirmik/crow | bindings/arduino/src/crow/tower.h | <reponame>Mirmik/crow
/** @file */
#ifndef CROW_TOWER_H
#define CROW_TOWER_H
#include <crow/defs.h>
#include <crow/gateway.h>
#include <crow/packet_ptr.h>
#define CROW_SENDED 0
#define CROW_WRONG_ADDRESS -1
namespace crow
{
extern uint16_t debug_data_size;
extern dlist_head protocols;
extern bool diagn... |
Mirmik/crow | crow/hexer.h | /** @file */
#ifndef CROW_HEXER_H
#define CROW_HEXER_H
#include <igris/compiler.h>
#include <stdint.h>
#include <stdlib.h>
#define CROW_HEXER_UNDEFINED_SYMBOL -1
#define CROW_HEXER_MORE3_DOT -4
#define CROW_HEXER_ODD_GRID -5
/// Утилита для удобной записи хекс адреса.
/// Пример: .12.127.0.0.1#2714 -> 0C7F00000127... |
Mirmik/crow | bindings/arduino/src/crow/gates/chardev/gstuff_protocol.h | #ifndef CROW_chardev_PROTOCOLS_GSTUFF_H
#define CROW_chardev_PROTOCOLS_GSTUFF_H
namespace crow
{
class gstuff_protocol : public chardev_protocol
{
int size_encoded(crow_packet *pack) override;
void encode(crow_packet *pack, igris::buffer);
void decode(crow_packet *pack, igris::buffer);... |
Mirmik/crow | crow/hostaddr.h | /** @file */
#ifndef CROW_HOSTADDR_H
#define CROW_HOSTADDR_H
#include <cstring>
#include <igris/buffer.h>
#include <vector>
namespace crow
{
class hostaddr_view;
class hostaddr
{
std::vector<uint8_t> _addr = {};
public:
hostaddr() = default;
hostaddr(const hostaddr &addr) = ... |
Mirmik/crow | crow/pubsub/pubsub.h | <reponame>Mirmik/crow
/** @file */
#ifndef CROW_PUBSUB_H
#define CROW_PUBSUB_H
#include <assert.h>
#include <igris/buffer.h>
#include <igris/event/delegate.h>
#include <igris/sync/syslock.h>
#include <crow/proto/protocol.h>
#include <crow/tower.h>
#define SUBSCRIBE 0
#define PUBLISH 1
#define MESSAGE 2
#define SER... |
Mirmik/crow | bindings/arduino/src/crow/proto/protocol.h | <reponame>Mirmik/crow
#ifndef CROW_PROTOCOL_H
#define CROW_PROTOCOL_H
#include <crow/packet.h>
#include <crow/tower.h>
#include <igris/datastruct/dlist.h>
namespace crow
{
class protocol
{
public:
struct dlist_head lnk = DLIST_HEAD_INIT(lnk);
uint8_t id;
virtual void incoming(cr... |
Mirmik/crow | bindings/arduino/src/crow/warn.h | /** @file */
#ifndef CROW_WARN_H
#define CROW_WARN_H
#include <igris/buffer.h>
namespace crow
{
void warn(igris::buffer msg);
}
#endif |
Mirmik/crow | crow/qosbyte.h | <reponame>Mirmik/crow<filename>crow/qosbyte.h
#ifndef CROW_QOSBYTE_H
#define CROW_QOSBYTE_H
#undef round
#include <cassert>
#include <cmath>
#include <type_traits>
namespace crow
{
static constexpr int quant_const = 10;
struct qosbyte
{
uint8_t _qos : 2;
uint8_t _quant_code : 6;
s... |
Mirmik/crow | crow/nodeaddr.h | <reponame>Mirmik/crow
#ifndef CROW_NODEADDR_H
#define CROW_NODEADDR_H
#include <crow/address.h>
#include <crow/proto/node.h>
#include <vector>
namespace crow
{
class nodeaddr
{
public:
crow::hostaddr addr;
nodeid_t nid;
public:
crow::hostaddr_view hostaddr() const
... |
Mirmik/crow | bindings/arduino/src/crow/defs.h | /**
@file
*/
#ifndef CROW_DEFS_H
#define CROW_DEFS_H
#define CROW_UDPGATE_NO 12
#define G1_ACK_TYPE 0
#define G1_ACK21_TYPE 1
#define G1_ACK22_TYPE 2
#define CROW_NODE_PROTOCOL 3
#define CROW_PUBSUB_PROTOCOL 4
#define CROWKER_CLI_NODE_NO 0
#define CROWKER_ALIVE_NODE_NO 1
#define CROW_RPC_NODE_NO 2
#define CRO... |
Mirmik/crow | crow/constexpr_hexer.h | #ifndef CROW_CONSTEXPR_HEXER_H
#define CROW_CONSTEXPR_HEXER_H
#include <array>
#include <crow/hexer.h>
#include <ctype.h>
#include <igris/util/hexascii.h>
namespace crow
{
template <size_t N>
constexpr std::pair<std::array<char, N>, int>
constexpr_hexer(const std::array<char, N> &arr)
{
std::a... |
Mirmik/crow | apps/ctrans/HIDE/bincommon.h | #pragma once
#include <string>
#include <map>
extern std::map<std::string, size_t> visitor_size; |
Mirmik/crow | bindings/arduino/src/crow/gates/serial_gstuff.h | /**
@file
*/
#ifndef CROW_GATES_SERIAL_GSTUFF_H
#define CROW_GATES_SERIAL_GSTUFF_H
#include <stdbool.h>
#include <stdint.h>
#include <sys/cdefs.h>
#include <crow/gateway.h>
//#include <igris/protocols/gstuff/autorecv.h>
#include <igris/protocols/gstuff.h>
namespace crow
{
struct serial_gstuff : public crow... |
Mirmik/crow | crow/brocker/options.h | <reponame>Mirmik/crow<filename>crow/brocker/options.h
/** @file */
#ifndef CROWKER_OPTIONS_H
#define CROWKER_OPTIONS_H
#include <stdint.h>
namespace crowker_implementation
{
struct options
{
};
struct crow_options : public options
{
uint8_t qos = 0;
uint16_t ackquant = 200;
... |
Mirmik/crow | crow/gates/loopgate.h | /** @file */
#ifndef CROW_GATES_LOOPGATE_H
#define CROW_GATES_LOOPGATE_H
#include <crow/gateway.h>
#include <crow/tower.h>
namespace crow
{
class loopgate : public gateway
{
public:
loopgate() {}
void send(crow::packet *pack) override
{
crow::packet *copypack =
... |
Mirmik/crow | apps/ctrans/HIDE/binout.h | #pragma once
#include <igris/buffer.h>
#include <string>
#include <crow/packet.h>
std::string flt32_output(void *tgt);
std::string int32_output(void *tgt);
void binout_mode_prepare(const std::string &fmt);
void output_binary(igris::buffer data, crow::packet *pack); |
Mirmik/crow | crow/asyncio.h | <reponame>Mirmik/crow
#ifndef CROW_ASYNCIO_H
#define CROW_ASYNCIO_H
#include <stdint.h>
#include <unordered_map>
#include <vector>
#include <sys/select.h>
#include <unistd.h>
#include <igris/event/delegate.h>
#include <igris/math.h>
#include <igris/osutil/fd.h>
#include <nos/print.h>
namespace crow
{
enum clas... |
Mirmik/crow | bindings/java/crow/crow_CrowSubscriber.h | <gh_stars>1-10
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class crow_CrowSubscriber */
#ifndef _Included_crow_CrowSubscriber
#define _Included_crow_CrowSubscriber
#ifdef __cplusplus
extern "C"
{
#endif
/*
* Class: crow_CrowSubscriber
* Method: nativeNew
... |
Mirmik/crow | crow/proto/deprecated/rpc.h | #ifndef CROW_RPC_H
#define CROW_RPC_H
#include <crow/proto/node.h>
#include <igris/buffer.h>
#include <igris/datastruct/dlist.h>
#include <igris/event/delegate.h>
#include <string>
#include <unordered_map>
#include <igris/result.h>
#include <igris/serialize/serialize.h>
#include <igris/serialize/stdtypes.h>
#includ... |
Mirmik/crow | crow/brocker/crow_client.h | /** @file */
#ifndef CROW_BROCKER_CROW_SUBSCRIBER_H
#define CROW_BROCKER_CROW_SUBSCRIBER_H
#include <map>
#include <string>
#include "client.h"
#include "options.h"
namespace crowker_implementation
{
class crow_client : public client
{
public:
std::string addr={};
static std::map<std::s... |
Mirmik/crow | bindings/java/crow/crow_CrowPublisher.h | /* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class crow_CrowPublisher */
#ifndef _Included_crow_CrowPublisher
#define _Included_crow_CrowPublisher
#ifdef __cplusplus
extern "C"
{
#endif
/*
* Class: crow_CrowPublisher
* Method: nativeNew
* Signature: ()J... |
Mirmik/crow | bindings/arduino/src/crow/gates/udpgate.h | <gh_stars>1-10
/** @file */
#ifndef CROW_GATES_UDPGATE_H
#define CROW_GATES_UDPGATE_H
#include <crow/defs.h>
#include <crow/gateway.h>
#include <iostream>
namespace crow
{
class udpgate : public gateway
{
int sock = 0;
crow_packet *block = nullptr;
bool fastsend = CROW_FASTSEND_DEFAU... |
Mirmik/crow | bindings/arduino/src/crow/sender.h | <gh_stars>1-10
/** @file */
#ifndef CROW_SENDER_H
#define CROW_SENDER_H
#include <crow/tower.h>
namespace crow
{
class sender
{
uint8_t *addr;
uint16_t alen;
uint8_t type;
uint8_t qos;
uint16_t ackquant;
sender(uint8_t *addr, uint16_t alen, uint8_t type, uint8... |
Mirmik/crow | bindings/arduino/src/crow/proto/socket.h | #ifndef CROW_SOCKET_H
#define CROW_SOCKET_H
#include <crow/proto/node.h>
namespace crow
{
class socket_base : public node
{
public:
dlist_head q = DLIST_HEAD_INIT(q);
void incoming_packet(crow_packet *pack) { dlist_add(&pack->ulnk, &q); }
};
class socket : public socket_base
... |
Mirmik/crow | crow/gates/serial_gstuff.h | /**
@file
*/
#ifndef CROW_GATES_SERIAL_GSTUFF_H
#define CROW_GATES_SERIAL_GSTUFF_H
#include <stdbool.h>
#include <stdint.h>
#include <sys/cdefs.h>
#include <crow/gateway.h>
//#include <igris/protocols/gstuff/autorecv.h>
#include <igris/protocols/gstuff.h>
namespace crow
{
struct serial_gstuff : public crow... |
Mirmik/crow | bindings/java/crow/Crow_library.h | <filename>bindings/java/crow/Crow_library.h
#include <jni.h>
extern JavaVM *g_vm; |
Mirmik/crow | bindings/arduino/src/crow/brocker/theme.h | /** @file */
#ifndef CROWKER_THEME_H
#define CROWKER_THEME_H
#include <memory>
#include <set>
#include <string>
namespace crowker_implementation
{
class subscriber;
class theme
{
public:
std::string name;
std::set<subscriber *> subs;
int64_t timestamp_publish;
int64... |
Mirmik/crow | crow/packet_ptr.h | /** @file */
#ifndef CROW_PACKET_PTR_H
#define CROW_PACKET_PTR_H
#include <crow/packet.h>
#include <igris/sync/syslock.h>
namespace crow
{
class packet_ptr
{
protected:
crow::packet *pack = nullptr;
public:
packet_ptr(crow::packet *pack_) : pack(pack_)
{
if (pack ... |
Mirmik/crow | bindings/arduino/src/crow/gates/self_driven_gstuff.h | <gh_stars>1-10
#ifndef CROW_SELF_DRIVEN_GSTUFF_H
#define CROW_SELF_DRIVEN_GSTUFF_H
#include <crow/gateway.h>
#include <crow/tower.h>
#include <igris/protocols/gstuff.h>
namespace crow
{
class self_driven_gstuff : public crow::gateway
{
dlist_head to_send = DLIST_HEAD_INIT(to_send);
int reserv... |
Mirmik/crow | crow/nodes/service_node.h | #ifndef CROW_SERVICE_NODE_H
#define CROW_SERVICE_NODE_H
#include <crow/nodes/subscriber_node.h>
namespace crow
{
class service_node : public crow::abstract_subscriber_node
{
using delegate = igris::delegate<void, char *, int, service_node &>;
delegate dlg = {};
crow::packet *curpack = ... |
Mirmik/crow | crow/nodes/node_delegate.h | #include <crow/proto/node.h>
#include <igris/event/delegate.h>
namespace crow
{
class node_delegate : public crow::node
{
igris::delegate<void, crow::node_packet_ptr> incom;
igris::delegate<void, crow::node_packet_ptr> undeliv;
public:
node_delegate(igris::delegate<void, crow::node... |
Mirmik/crow | bindings/arduino/src/crow/brocker/subscriber.h | <filename>bindings/arduino/src/crow/brocker/subscriber.h
/** @file */
#ifndef CROWKER_SUBSCRIBER_H
#define CROWKER_SUBSCRIBER_H
#include "options.h"
#include "theme.h"
#include <unordered_map>
namespace crowker_implementation
{
struct themenote
{
options *opts = nullptr;
~themenote() { delet... |
Mirmik/crow | crow/address.h | /** @file */
#ifndef CROW_ADDRESS_H
#define CROW_ADDRESS_H
#include <igris/compiler.h>
#include <stdint.h>
#include <stdlib.h>
#include <crow/hexer.h>
#include <crow/hostaddr.h>
#include <igris/buffer.h>
namespace crow
{
hostaddr crowker_address();
hostaddr address(const igris::buffer &in);
hostaddr ad... |
Mirmik/crow | crow/nodes/requestor_node.h | <reponame>Mirmik/crow
#ifndef CROW_requestor_node_H
#define CROW_requestor_node_H
#include <crow/nodes/publisher_node.h>
#include <crow/proto/node.h>
#include <igris/event/delegate.h>
namespace crow
{
class requestor_node : public crow::publisher_node
{
dlist_head incoming_list = DLIST_HEAD_INIT(incom... |
Mirmik/crow | crow/nodes/nospublisher.h | <reponame>Mirmik/crow
#ifndef CROW_NODES_NOSPUBLISHER_H
#define CROW_NODES_NOSPUBLISHER_H
#include <crow/nodes/publisher_node.h>
#include <nos/io/ostream.h>
namespace crow
{
class nospublisher : public crow::publisher_node, public nos::ostream
{
public:
nospublisher() = default;
nospubli... |
Mirmik/crow | crow/keepalive.h | <reponame>Mirmik/crow
#ifndef CROW_KEEPALIVE_H
#define CROW_KEEPALIVE_H
#include <igris/time/systime.h>
#include <igris/time/timer_manager.h>
namespace crow
{
extern igris::timer_manager<igris::timer_spec<decltype(millis())>>
keepalive_timer_manager;
}
#endif |
Mirmik/crow | bindings/arduino/src/crow/gates/chardev_gateway.h | /**
@file
*/
#ifndef CROW_GATES_CHANNEL_GATE_H
#define CROW_GATES_CHANNEL_GATE_H
#include <crow/gateway.h>
#include <crow/packet.h>
#include <igris/buffer.h>
namespace crow
{
class chardev_protocol;
class chardev_driver;
class chardev_gateway;
class chardev_protocol
{
public:
chard... |
Mirmik/crow | bindings/arduino/src/crow/gates/chardev/pipe_driver.h | #ifndef CROW_GATES_chardev_PIPE_H
#define CROW_GATES_chardev_PIPE_H
#include <crow/gates/chardevchannel.h>
namespace crow
{
class chardev_pipe_driver : public crow::chardev_driver
{
int fd;
public:
chardev_pipe_driver() {}
chardev_pipe_driver(int fd) { bind_fd(fd); }
vo... |
Mirmik/crow | crow/tower.h | /** @file */
#ifndef CROW_TOWER_H
#define CROW_TOWER_H
#include <crow/defs.h>
#include <crow/gateway.h>
#include <crow/packet_ptr.h>
#include <igris/event/delegate.h>
#define CROW_SENDED 0
#define CROW_WRONG_ADDRESS -1
namespace crow
{
extern uint16_t debug_data_size;
extern dlist_head protocols;
exter... |
Mirmik/crow | bindings/arduino/src/crow/nodes/node_delegate.h | <reponame>Mirmik/crow<filename>bindings/arduino/src/crow/nodes/node_delegate.h
#include <crow/proto/node.h>
#include <igris/event/delegate.h>
namespace crow
{
class node_delegate : public crow::node
{
igris::delegate<void, crow::node_packet_ptr> incom;
igris::delegate<void, crow::node_packet_pt... |
Mirmik/crow | bindings/arduino/src/crow/print.h | /** @file */
#ifndef CROW_PRINT_H
#define CROW_PRINT_H
#include <crow/packet.h>
namespace crow
{
void diagnostic(const char *notation, crow_packet *pack);
}
#endif
|
Mirmik/crow | bindings/arduino/src/crow/proto/channel.h | #ifndef CROW_CHANNEL_H
#define CROW_CHANNEL_H
#include <crow/proto/node.h>
#include <igris/buffer.h>
#include <igris/event/delegate.h>
#include <igris/sync/syslock.h>
#define CROW_CHANNEL_INIT 0
#define CROW_CHANNEL_WAIT_HANDSHAKE_REQUEST 1
#define CROW_CHANNEL_WAIT_HANDSHAKE_ANSWER 2
#define CROW_CHANNEL_CONNECTED ... |
Mirmik/crow | bindings/arduino/src/crow/pubsub/pubsub.h | <gh_stars>1-10
/** @file */
#ifndef CROW_PUBSUB_H
#define CROW_PUBSUB_H
#include <assert.h>
#include <crow/proto/protocol.h>
#include <crow/tower.h>
#include <igris/buffer.h>
#include <igris/event/delegate.h>
#include <igris/sync/syslock.h>
#include <igris/buffer.h>
struct crow_theme;
#define SUBSCRIBE 0
#define ... |
Mirmik/crow | bindings/arduino/src/crow/gates/chardev/serial_port_driver.h | #ifndef CROW_SERIAL_PORT_DRIVER_H
#define CROW_SERIAL_PORT_DRIVER_H
#include <crow/gates/chardev_gateway.h>
#include <nos/io/serial_port.h>
namespace crow
{
class serial_port_driver : public chardev_driver
{
nos::serial_port port;
public:
int open(const char *path, uint32_t baud, char p... |
aut-ce/CE304-OS-Lab | fp/server/main.c | <filename>fp/server/main.c
#include <unistd.h>
#include <stdio.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <pthread.h>
#include "slice.h"
#define PORT 8080
// shared queue
struct slice_t *ms;
// server socket
int server_fd;
// handler ha... |
aut-ce/CE304-OS-Lab | s5/fifo-server.c | <filename>s5/fifo-server.c
/*
* In The Name of God
* =======================================
* [] File Name : fifo-server.c
*
* [] Creation Date : 06-11-2018
*
* [] Created By : <NAME> <<EMAIL>>
* =======================================
*/
/*
* Copyright (c) 2018 <NAME>.
*/
#include <sys/stat.h>
#include <... |
aut-ce/CE304-OS-Lab | s4/nd_fork.c | <reponame>aut-ce/CE304-OS-Lab<gh_stars>1-10
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
#include <time.h>
/*
* here we are going to see a normal distribution from binomial distribution for a large n
*/
const int k = 10; // create 10 process then wait for their results
int gen()... |
aut-ce/CE304-OS-Lab | s9/main.c | #include <omp.h>
#include <stdio.h>
int main() {
int i, N = 10;
omp_set_num_threads(10);
#pragma omp parallel
{
for (i = 0; i < N; i++) {
printf("%d\n", i);
}
}
}
|
aut-ce/CE304-OS-Lab | s4/thread/hello.c | /*
* In The Name of God
* =======================================
* [] File Name : hello.c
*
* [] Creation Date : 13-11-2018
*
* [] Created By : <NAME> <<EMAIL>>
* =======================================
*/
/*
* Copyright (c) 2018 <NAME>.
*/
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#defin... |
aut-ce/CE304-OS-Lab | s5/fifo-client.c | /*
* In The Name of God
* =======================================
* [] File Name : fifo-client.c
*
* [] Creation Date : 06-11-2018
*
* [] Created By : <NAME> <<EMAIL>>
* =======================================
*/
/*
* Copyright (c) 2018 <NAME>.
*/
#include <sys/stat.h>
#include <sys/types.h>
#include <stdi... |
aut-ce/CE304-OS-Lab | s4/nd.c | <reponame>aut-ce/CE304-OS-Lab<gh_stars>1-10
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
/*
* here we are going to see a normal distribution from binomial distribution for a large n
*/
int gen();
void print_his(int[25]);
int main() {
int n;
int i;
int his[25];
// Use current time as seed for r... |
aut-ce/CE304-OS-Lab | s4/ps/vfork.c | /*
* In The Name Of God
* ========================================
* [] File Name : code.c
*
* [] Creation Date : 19-11-2016
*
* [] Created By : <NAME> (<EMAIL>)
* =======================================
*/
/*
* Copyright (c) 2016 <NAME>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include... |
aut-ce/CE304-OS-Lab | s2/linked-list/main.c | <gh_stars>1-10
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/list.h>
#include <linux/slab.h>
struct birthday{
int day;
int month;
int year;
struct list_head list;
};
static LIST_HEAD(birthday_list);
int simple_init(void)
{
struct birthd... |
aut-ce/CE304-OS-Lab | s5/shmget.c | /*
* In The Name of God
* =======================================
* [] File Name : shmget.c
*
* [] Creation Date : 06-11-2018
*
* [] Created By : <NAME> <<EMAIL>>
* =======================================
*/
/*
* Copyright (c) 2018 <NAME>.
*/
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#incl... |
aut-ce/CE304-OS-Lab | fp/server/slice.h | /*
* In The Name of God
* =======================================
* [] File Name : slice.h
*
* [] Creation Date : 20-11-2018
*
* [] Created By : <NAME> <<EMAIL>>
* =======================================
*/
/*
* Copyright (c) 2018 <NAME>.
*/
#ifndef SLICE_H
#define SLICE_H
#include <pthread.h>
// slice_t is ... |
aut-ce/CE304-OS-Lab | s4/ps/fork.c | <reponame>aut-ce/CE304-OS-Lab<filename>s4/ps/fork.c<gh_stars>1-10
/*
* In The Name Of God
* ========================================
* [] File Name : code-code.c
*
* [] Creation Date : 23-11-2016
*
* [] Created By : <NAME> (<EMAIL>)
* =======================================
*/
/*
* Copyright (c) 2016 <NAME>.
... |
aut-ce/CE304-OS-Lab | s5/tcp-server.c | <gh_stars>1-10
/*
* In The Name of God
* =======================================
* [] File Name : tcp-server.c
*
* [] Creation Date : 06-11-2018
*
* [] Created By : <NAME> <<EMAIL>>
* =======================================
*/
/*
* Copyright (c) 2018 <NAME>.
*/
// Server side C/C++ program to demonstrate S... |
aut-ce/CE304-OS-Lab | s2/hello/hello.c | <reponame>aut-ce/CE304-OS-Lab
/*
* In The Name of God
* =======================================
* [] File Name : hello.c
*
* [] Creation Date : 30-08-2019
*
* [] Created By : <NAME> <<EMAIL>>
* =======================================
*/
/*
* Copyright (c) 2019 <NAME>.
*/
#include <linux/init.h>
#include <linux... |
aut-ce/CE304-OS-Lab | queue/main.c | <filename>queue/main.c<gh_stars>1-10
/*
* In The Name of God
* =======================================
* [] File Name : main.c
*
* [] Creation Date : 20-11-2018
*
* [] Created By : <NAME> <<EMAIL>>
* =======================================
*/
/*
* Copyright (c) 2018 <NAME>.
*/
#include <stdio.h>
#include <stdl... |
aut-ce/CE304-OS-Lab | s5/pipe.c | /*
* In The Name of God
* =======================================
* [] File Name : pipe.c
*
* [] Creation Date : 06-11-2018
*
* [] Created By : <NAME> <<EMAIL>>
* =======================================
*/
/*
* Copyright (c) 2018 <NAME>.
*/
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
/*
* ... |
aut-ce/CE304-OS-Lab | s4/thread/arg.c | <gh_stars>1-10
/*
* In The Name of God
* =======================================
* [] File Name : hello.c
*
* [] Creation Date : 13-11-2018
*
* [] Created By : <NAME> <<EMAIL>>
* =======================================
*/
/*
* Copyright (c) 2018 <NAME>.
*/
#include <pthread.h>
#include <stdio.h>
#include <s... |
aut-ce/CE304-OS-Lab | s4/thread/retval.c | #include <pthread.h>
#include <stdio.h>
#include <unistd.h>
// student represents a collegian
struct student {
int number;
char* name;
};
// print_student is a function that is called by pthread within a new thread.
// this function prints student information.
void *print_student(void *input) {
struct student *std... |
aut-ce/CE304-OS-Lab | queue/slice.c | <filename>queue/slice.c
/*
* In The Name of God
* =======================================
* [] File Name : slice.c
*
* [] Creation Date : 20-11-2018
*
* [] Created By : <NAME> <<EMAIL>>
* =======================================
*/
/*
* Copyright (c) 2018 <NAME>.
*/
#include "slice.h"
#include <stdlib.h>
#incl... |
Whiteblock/beam | 3rdparty/qrcode/QRCodeGenerator.h |
#if !defined(AFX_QR_ENCODE_H__AC886DF7_C0AE_4C9F_AC7A_FCDA8CB1DD37__INCLUDED_)
#define AFX_QR_ENCODE_H__AC886DF7_C0AE_4C9F_AC7A_FCDA8CB1DD37__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
//
#define QR_LEVEL_L 0
#de... |
Whiteblock/beam | utility/logger.h | <filename>utility/logger.h
// Copyright 2018 The Beam Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by app... |
Whiteblock/beam | 3rdparty/equihash_gpu.h | // Copyright 2018 The Beam Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... |
coord-e/ili9328SPI | ili9328.h | <gh_stars>1-10
#ifndef _ILI9328_SPI_H
#define _ILI9328_SPI_H
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <Adafruit_GFX.h>
#include <SPI.h>
#define TFT_WIDTH 320
#define TFT_HEIGHT 240
#define CS_HIGH (*CSPort |= CSPinSet)
#define CS_LOW (*CSPort &= ~CSPinSet)
#define WRITE1... |
JimmyRetza/Theano | theano/gpuarray/c_code/magma_cholesky.c | #section kernels
#kernel tril_kernel : size, size, size, *:
#include "cluda.h"
KERNEL void tril_kernel(const ga_size nthreads, const ga_size ncols,
const ga_size a_off, GLOBAL_MEM DTYPE_INPUT_0 *a) {
a = (GLOBAL_MEM DTYPE_INPUT_0 *)(((char *)a) + a_off);
// grid stride looping
for (ga_si... |
JimmyRetza/Theano | theano/gpuarray/c_code/dnn_sptf_gt.c | <reponame>JimmyRetza/Theano
#section support_code_struct
cudnnSpatialTransformerDescriptor_t APPLY_SPECIFIC(sptf);
#section init_code_struct
APPLY_SPECIFIC(sptf) = NULL;
{
cudnnStatus_t err = CUDNN_STATUS_SUCCESS;
if ((err = cudnnCreateSpatialTransformerDescriptor(&APPLY_SPECIFIC(sptf))) != CUDNN_STATUS_SUC... |
JimmyRetza/Theano | theano/gpuarray/c_code/pool_grad_grad.c | <reponame>JimmyRetza/Theano
#section kernels
#kernel max_pool2d_grad_grad_kernel : size, size, size, size, size, size, size, *, size, *, size, *, size, size, size, size, size, size, size, *, size :
#include "cluda.h"
KERNEL void max_pool2d_grad_grad_kernel(const ga_size nthreads,
const ga_size num, const ga_size c... |
JimmyRetza/Theano | theano/gof/tests/c_code/test_cenum.h | #ifndef THEANO_TEST_CENUM
#define THEANO_TEST_CENUM
#define MILLION 1000000
#define BILLION 1000000000
#define TWO_BILLIONS 2000000000
#endif
|
JimmyRetza/Theano | theano/gpuarray/c_code/dnn_batchnorm.c | #section support_code_struct
int dnn_batchnorm_op(PyGpuArrayObject *inp, PyGpuArrayObject *scale,
PyGpuArrayObject *bias, npy_float64 epsilon,
npy_float64 running_average_factor,
PyGpuArrayObject *in_running_mean, // may be NULL
PyGpuA... |
JimmyRetza/Theano | theano/gpuarray/c_code/dimshuffle.c | #section support_code_apply
int APPLY_SPECIFIC(gpu_dimshuffle)(PyGpuArrayObject* input, PyGpuArrayObject** out, PARAMS_TYPE* params) {
PyGpuArrayObject *tmp = NULL;
npy_intp nd_in = PyArray_SIZE(params->input_broadcastable);
npy_intp nd_out = PyArray_SIZE(params->_new_order);
npy_int64* new_order = NUL... |
JimmyRetza/Theano | theano/gpuarray/c_code/dnn_sptf_grid.c | <reponame>JimmyRetza/Theano
#section support_code_struct
cudnnSpatialTransformerDescriptor_t APPLY_SPECIFIC(sptf);
#section init_code_struct
APPLY_SPECIFIC(sptf) = NULL;
{
cudnnStatus_t err = CUDNN_STATUS_SUCCESS;
if ((err = cudnnCreateSpatialTransformerDescriptor(&APPLY_SPECIFIC(sptf))) != CUDNN_STATUS_SUC... |
JimmyRetza/Theano | theano/gpuarray/c_code/magma_inv.c | <reponame>JimmyRetza/Theano
#section init_code
setup_ext_cuda();
#section support_code_struct
int APPLY_SPECIFIC(magma_inv)(PyGpuArrayObject *A, PyGpuArrayObject **A_inv,
PARAMS_TYPE *params) {
const size_t *dims;
magma_int_t N, ldwork, info;
magma_int_t *piv = NULL;
gpudata *dw... |
JimmyRetza/Theano | theano/tensor/nnet/c_code/corr_gemm.c | // This uses a lot of code from Caffe (http://caffe.berkeleyvision.org/);
// sources are clearly marked. Below we reproduce the original license of
// the Caffe software.
/*
Copyright (c) 2014, The Regents of the University of California (Regents)
All rights reserved.
Redistribution and use in source and binary forms,... |
LarsGardien/HackerDogeAir | src/includes/shared/shared_session.h | <filename>src/includes/shared/shared_session.h
#ifndef SHARED_SESSION_H
#define SHARED_SESSION_H
#include <kore/kore.h>
int
auth_not_user(
struct http_request *req);
int
auth_user(
struct http_request *req,
const char *cookie);
int
auth_admin(
struct http_request *req,
const char *cookie);
int
... |
LarsGardien/HackerDogeAir | src/pages/flight/flight_search/flight_search.c | #define _XOPEN_SOURCE 700 //must be defined for strptime from time.h
#include <stdbool.h>
#include <limits.h>
#include <mustache.h>
#include <kore/kore.h>
#include <kore/http.h>
#include <kore/pgsql.h>
#include "shared/shared_time.h"
#include "shared/shared_error.h"
#include "shared/shared_http.h"
#include "pages/fli... |
LarsGardien/HackerDogeAir | src/includes/pages/partial/partial_render.h | <reponame>LarsGardien/HackerDogeAir<gh_stars>0
#ifndef PARTIAL_RENDER_H
#define PARTIAL_RENDER_H
#include <stdbool.h>
#include <mustache.h>
#include "model/session.h"
#define SHARED_RENDER_ERROR_TEMPLATE 1001
#define SHARED_RENDER_ERROR_RENDER 1002
#define SHARED_RENDER_MUSTACHE_FAIL 0
#define SHARED_RE... |
LarsGardien/HackerDogeAir | src/shared/shared_http.c | #include "shared/shared_http.h"
#include <stdint.h>
#include <kore/kore.h>
#include <kore/http.h>
#include "shared/shared_error.h"
#include "model/user.h"
#include "model/session.h"
uint32_t
shared_http_get_user_from_request(struct http_request *req, User **user)
{
uint32_t error = 0;
char *session_identifier... |
LarsGardien/HackerDogeAir | src/pages/partial/partial_render.c | <gh_stars>0
#include "pages/partial/partial_render.h"
#include <stdio.h>
#include <stdbool.h>
#include <kore/kore.h>
#include <mustache.h>
#include "shared/shared_error.h"
#include "shared/shared_escape.h"
#include "pages/partial/header/header_render.h"
int full_render(PartialContext *, mustache_api_t *, const char*... |
LarsGardien/HackerDogeAir | src/pages/error/error_render.c | <gh_stars>0
#include "pages/home/home_render.h"
#include <stdbool.h>
#include <kore/kore.h>
#include <mustache.h>
#include "assets.h"
#include "shared/shared_error.h"
#include "pages/partial/partial_render.h"
#include "pages/error/error_render.h"
int error_render(ErrorContext *);
void error_render_cle... |
LarsGardien/HackerDogeAir | src/pages/admin/flightlist/flightlist_render.c | #include "pages/admin/flightlist/flightlist_render.h"
#include <stdbool.h>
#include <kore/kore.h>
#include <mustache.h>
#include <sys/queue.h>
#include "assets.h"
#include "shared/shared_error.h"
#include "pages/partial/partial_render.h"
#include "pages/shared/shared_flight_render.h"
int admin_flight_list_re... |
LarsGardien/HackerDogeAir | src/includes/pages/admin/userlist/userlist_render.h | #ifndef USERLIST_RENDER_H
#define USERLIST_RENDER_H
#include <mustache.h>
#include <sys/queue.h>
#include "pages/partial/partial_render.h"
#include "model/user.h"
typedef struct UserListContext
{
PartialContext partial_context;
const char *error_message;
struct UserCollection *user_collection;
} UserList... |
LarsGardien/HackerDogeAir | src/pages/user/user_actions_render.c | #include "pages/user/user_actions_render.h"
#include <kore/kore.h>
#include <mustache.h>
#include "assets.h"
#include "shared/shared_error.h"
#include "pages/partial/partial_render.h"
#include "pages/shared/shared_user_render.h"
#include "model/user.h"
int user_actions_render(PartialContext *);
void u... |
LarsGardien/HackerDogeAir | src/includes/pages/user/user_detail/user_detail_render.h | #ifndef USER_DETAIL_RENDER_H
#define USER_DETAIL_RENDER_H
#include <mustache.h>
#include <sys/queue.h>
#include "pages/partial/partial_render.h"
#include "pages/shared/shared_user_render.h"
int
user_detail_render(UserContext *context);
void
user_detail_render_clean(UserContext *context);
#endif |
LarsGardien/HackerDogeAir | src/shared/shared_session.c | #include "shared/shared_session.h"
#include <time.h>
#include <kore/kore.h>
#include "shared/shared_error.h"
#include "model/session.h"
#include "model/user.h"
#include "model/role.h"
int
auth_user(struct http_request *req, const char *cookie)
{
uint32_t error = 0;
if (cookie == NULL)
{
return (K... |
LarsGardien/HackerDogeAir | src/includes/shared/shared_escape.h | #ifndef HESCAPE_H
#define HESCAPE_H
#include <sys/types.h>
#include <stdint.h>
/*
* Replace characters according to the following rules.
* Note that this function can handle only ASCII-compatible string.
*
* " => "
* & => &
* ' => '
* < => <
* > => >
*
* @return size of dest. If it's larg... |
LarsGardien/HackerDogeAir | src/shared/shared_error.c | #include <stdbool.h>
#include <kore/kore.h>
#include <kore/http.h>
#include "shared/shared_error.h"
#include "pages/partial/partial_render.h"
#include "pages/error/error_render.h"
void shared_error_handler(struct http_request *, int, const char *);
void shared_error_response(struct http_request *, int, const c... |
LarsGardien/HackerDogeAir | src/model/airport.c | #include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <kore/kore.h>
#include <kore/pgsql.h>
#include "model/airport.h"
#include "shared/shared_time.h"
#include "shared/shared_error.h"
#include "model/database_engine.h"
static const char airrport_insert_query[] =
... |
LarsGardien/HackerDogeAir | src/includes/model/database_engine.h | <reponame>LarsGardien/HackerDogeAir<filename>src/includes/model/database_engine.h
#ifndef DATA_BASE_ENGHINE_H
#define DATA_BASE_ENGHINE_H
#define DATABASE_NAME "DogeAir"
#include <stdint.h>
#include <stdarg.h>
uint32_t
database_engine_execute_write(
const char *sql_query,
uint32_t count,
...
);
void... |
LarsGardien/HackerDogeAir | src/includes/pages/user/user_bookings/user_bookings_render.h | #ifndef USER_BOOKINGS_RENDER_H
#define USER_BOOKINGS_RENDER_H
#include <mustache.h>
#include <sys/queue.h>
#include <stdbool.h>
#include <time.h>
#include "pages/partial/partial_render.h"
//#include "model/flight.h"
#include "model/ticket.h"
typedef struct UserBookingsContext
{
PartialContext partial_context;
... |
LarsGardien/HackerDogeAir | src/includes/pages/home/home_render.h | <reponame>LarsGardien/HackerDogeAir
#ifndef HOME_RENDER_H
#define HOME_RENDER_H
#include <mustache.h>
#include "pages/partial/partial_render.h"
int
home_render(PartialContext *context);
void
home_render_clean(PartialContext *context);
#endif |
LarsGardien/HackerDogeAir | src/model/login_attempt.c | <filename>src/model/login_attempt.c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/queue.h>
#include <stdbool.h>
#include <kore/kore.h>
#include <kore/pgsql.h>
#include <kore/http.h>
#include "model/login_attempt.h"
#include "model/user.h"
#include "model/database_engine.... |
LarsGardien/HackerDogeAir | src/includes/model/flight.h | <reponame>LarsGardien/HackerDogeAir<gh_stars>0
#ifndef FLIGHT_H
#define FLIGHT_H
#include <stdint.h>
#include <sys/queue.h>
#include <time.h>
typedef struct
{
uint32_t flight_identifier;
uint32_t arrival_location_identifier;
uint32_t departure_location_identifier;
char *arrival_locatio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.