This file contains hidden or 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
fn main() { | |
// ------------------------------------------------------------------------- | |
// settings | |
let V: f64 = 12.0; // Напруга акумулятора [В] | |
let Pu: f64 = 200.0; // Номінальна потужність підключеного пристрою [Вт] | |
let Th: f64 = 4.0; // Необхідний час роботи системи [год] | |
let η: f64 = 0.92; // ККД інвертору [%] (0.00 - 1.00) | |
// ------------------------------------------------------------------------- | |
// calculation |
This file contains hidden or 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
-- https://github.com/neovim/neovim/pull/21100/files#diff-f11809d8946cebd21b6bec568546afe4589930ac9c6e89f49e7f398adc574c90R39 | |
local function binary_search(tokens, line) | |
local lo = 1 | |
local hi = #tokens | |
while lo < hi do | |
local mid = math.floor((lo + hi) / 2) | |
if tokens[mid].line < line then | |
lo = mid + 1 | |
else | |
hi = mid |
This file contains hidden or 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
From 26641de736600618efbb99ee31c4ffec522433d2 Mon Sep 17 00:00:00 2001 | |
From: Andrii Savytskyi <[email protected]> | |
Date: Wed, 2 Nov 2022 20:58:03 +0200 | |
Subject: [PATCH] 20130 | |
--- | |
src/nvim/api/extmark.c | 4 ++++ | |
src/nvim/decoration.h | 3 ++- | |
src/nvim/drawline.c | 48 +++++++++++++++++++++++++++++++++++++----- | |
src/nvim/plines.c | 27 ++++++++++++++++++++++-- |
This file contains hidden or 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
// https://stackoverflow.com/questions/28003334/modulus-optimization-in-c | |
pub struct MU128 { | |
pub magic: u128, | |
pub do_add: bool, | |
pub shift: i32, | |
} | |
fn magic_u128(d: u128) -> MU128 { | |
debug_assert!(d > 1); |
This file contains hidden or 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
#if canImport(Darwin) | |
import Darwin | |
#else | |
import Glibc | |
#endif | |
class Singleton { | |
static var shared: Singleton! = Singleton() | |
private init() { |
This file contains hidden or 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
ASRock X570 has NCT6683D | |
According to the https://www.kernel.org/doc/Documentation/hwmon/nct6683.rst This driver is disabled by default on non-Intel platforms. | |
So: | |
$ sudo echo "options nct6683 force=1" >> /etc/modprobe.d/sensors.conf | |
$ sudo shutdown -r now | |
$ sudo modprobe nct6683 | |
$ sudo echo "nct6683" >> /etc/modules-load.d/modules.conf | |
This file contains hidden or 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
<?php | |
function test(): array { | |
return [ | |
[1], | |
[1] | |
[0] | |
]; | |
} | |
print_r(test()); |
This file contains hidden or 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
<?php | |
interface ITest { | |
public function test(self $test): void; | |
} | |
class TestBase implements ITest { | |
// all ok | |
public function test(parent $test): void { | |
} | |
} |
This file contains hidden or 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
<?php | |
/// Work in PHP < 5.4.1 | |
interface ITest { | |
public function testSelf(self $test); | |
} | |
class Test implements ITest { | |
private $a = 10; | |
This file contains hidden or 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
Build flags: --configuration release | |
swiftc: -Ounchecked -gnone -whole-module-optimization -static-stdlib | |
Time elapsed for inverse: 2.64717900753021 s. | |
Time elapsed for inverse2: 1.35483705997467 s. | |
Time elapsed for inverse3: 11.727156996727 s. | |
Time elapsed for inverse4: 1.38384604454041 s. | |
Time elapsed for inverse5: 11.8544869422913 s. | |
Time elapsed for inverse6: 1.38975405693054 s. | |
Time elapsed for inverse7: 1.37177407939121 s. |
NewerOlder