This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {Client} = require('reduct-js'); | |
const client = new Client('http://localhost:8383'); | |
client.getBucket('mqtt').then(async (bucket) => { | |
let data = await bucket.read('mqtt_data'); | |
console.log('Last record: %s', data); | |
// Get data for the last hour | |
const stopTime = BigInt(Date.now() * 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
reduct-storage: | |
image: ghcr.io/reduct-storage/reduct-storage:latest | |
volumes: | |
- ./data:/data | |
ports: | |
- "8383:8383" | |
mqtt-broker: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MQTT = require('async-mqtt'); | |
const {Client} = require('reduct-js'); | |
MQTT.connectAsync('tcp://localhost:1883').then(async (mqttClient) => { | |
await mqttClient.subscribe('mqtt_data'); | |
const reductClient = new Client('http://localhost:8383'); | |
const bucket = await reductClient.getOrCreateBucket('mqtt'); | |
mqttClient.on('message', async (topic, msg) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HttpClient { | |
public: | |
HttpClient() { /* init only fields or allocate memory, threads etc */ } | |
[[ nodiscard ]] ErrorCode Connect() { | |
// Connect to server | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ISmartObject { | |
public: | |
virtual int Foo() const = 0; | |
} | |
class RealObject : public ISmartObject { | |
public: | |
RealObject() { /* allocate resource and throw exception */ } | |
int Foo() const override { /* do real work */ } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A { | |
public: | |
A() { is_valid_ = Init(); }; | |
void Foo() { | |
if (!is_valid_) { | |
is_valid_ = Init() | |
} | |
// do work | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by Aleksey Timin on 11/16/19. | |
// | |
#include <cstdlib> | |
#include <sstream> | |
#include <cip/connectionManager/NetworkConnectionParams.h> | |
#include "SessionInfo.h" | |
#include "MessageRouter.h" | |
#include "ConnectionManager.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "vendor/ra/powerFlex525/DPIFaultManager.h" | |
using namespace eipScanner; | |
using namespace eipScanner::vendor::ra::powerFlex525; | |
struct DPIFaultManagerResponse { | |
bool isTripped; | |
bool isErrored; // flag to say that we failed to make the request | |
std::vector<DPIFaultObject> faultObjects; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/OpcUaStackServer/ServiceSet/Session.cpp b/src/OpcUaStackServer/ServiceSet/Session.cpp | |
index e6ec6a85..54ba71e4 100644 | |
--- a/src/OpcUaStackServer/ServiceSet/Session.cpp | |
+++ b/src/OpcUaStackServer/ServiceSet/Session.cpp | |
@@ -255,10 +255,10 @@ namespace OpcUaStackServer | |
Log(Debug, "user name invalid"); | |
return BadIdentityTokenInvalid; | |
} | |
- if (token->passwordLen() == 0) { | |
- Log(Debug, "password name invalid"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pp' | |
require 'test/unit/assertions.rb' | |
class NMatrix | |
attr_reader :shape, :elements, :count, :strides | |
def initialize(shape, elements = nil) | |
@shape = shape |
NewerOlder