Skip to content

Instantly share code, notes, and snippets.

#include <utils.h>
#include <RadioLib.h>
// Heltec WiFi LoRa has the following connections:
#define I2C_SDA 21
#define I2C_SCL 22
// #define OLED_RST UNUSE_PIN
#define RADIO_SCLK_PIN 5 // OK Heltec
#define RADIO_MISO_PIN 19 // OK Heltec
"""
Rules:
IF room_temperature IS LOW AND humidity IS LOW AND number_of_people IS FEW THEN thermostat_temperature IS VERY HIGH
IF room_temperature IS LOW AND humidity IS LOW AND number_of_people IS ALOT THEN thermostat_temperature IS HIGH
IF room_temperature IS LOW AND humidity IS LOW THEN thermostat_temperature IS HIGH
IF room_temperature IS LOW AND humidity IS HIGH THEN thermostat_temperature IS QUITE HIGH
IF room_temperature IS LOW AND humidity IS LOW AND number_of_people IS FEW THEN thermostat_temperature IS QUITE LOW
IF room_temperature IS LOW AND humidity IS LOW AND number_of_people IS ALOT THEN thermostat_temperature IS LOW
IF room_temperature IS LOW AND humidity IS LOW THEN thermostat_temperature IS VERY LOW
IF room_temperature IS LOW AND humidity IS HIGH AND number_of_people IS FEW THEN thermostat_temperature IS LOW
@Pascal66
Pascal66 / SSOZJ5.java
Created July 4, 2022 07:35
Segmented Sieve of Zakiya (SSoZ) to find Twin Primes
package fr.cridp.sieve;
import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
@Pascal66
Pascal66 / SSOZJCL2.java
Last active February 4, 2020 15:02
Fast Segmented Twin Primes SieveopenCL (Aparapi)
package fr.cridp.sieve;
import com.aparapi.Kernel;
import com.aparapi.ProfileInfo;
import com.aparapi.Range;
import com.aparapi.internal.kernel.KernelManager;
import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.Arrays;
@Pascal66
Pascal66 / SSOZJ
Last active January 5, 2020 11:25
package fr.cridp.sieve;
import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
@Pascal66
Pascal66 / twinprimes_ssoz.nim
Last active November 25, 2019 09:58 — forked from jzakiya/twinprimes_ssoz.nim
Twinprimes generator, multi-threaded, using SSoZ (Segmented Sieve of Zakiya), written in Nim
#[
This Nim source file is a multiple threaded implementation to perform an
extremely fast Segmented Sieve of Zakiya (SSoZ) to find Twin Primes <= N.
Inputs are single values N, or ranges N1 and N2, of 64-bits, 0 -- 2^64 - 1.
Output is the number of twin primes <= N, or in range N1 to N2; the last
twin prime value for the range; and the total time of execution.
This code was developed on a System76 laptop with an Intel I7 6700HQ cpu,
2.6-3.5 GHz clock, with 8 threads, and 16GB of memory. Parameter tuning
contract TheBarCounter {
address private owner;
//Stored variables
uint private balance = 0;
uint private uniqueUsers = 0;
uint private usersProfits = 0;
uint private rescues = 0;
uint private collectedFees = 0;
<!--
* 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 writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@Pascal66
Pascal66 / gist:6634061
Created September 20, 2013 06:39
Condensation algorithm (Conditional Density Propagation)
import android.util.Log;
public class CondensationAlgo {
// http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/ISARD1/condensation.html
// "model_parameters.h"
/** The following are all the constants controlling the behaviour of the system and output. */
/** How many samples in the distribution? */
int NSamples = 1000;
/** How many iterations to run the filter? */