#[allow(clippy::cast_precision_loss)]
fn color_code_base(col: u32, alpha: bool) -> HSLAColor {
let a = if alpha {
((col >> 24) & 0xFF) as f32 / 255.0f32
} else {
1.0f32
};
let x = ((col >> 16) & 0xFF) as f32 / 255.0f32;
let y = ((col >> 8) & 0xFF) as f32 / 255.0f32;
let z = (col & 0xFF) as f32 / 255.0f32;
HSLAColor { x, y, z, a }
}
2, 2, 2, 2
it's 100% agreement but that's without taking into acount that it could be 15, 15, 15, 15
which would aslo be 100% agreement2, 2, 2, 2
it's 100% agreement but that's without taking into acount that it could be 15, 15, 15, 15
which would aslo be 100% agreement >>> def deviation(x):
... return np.exp(np.sum(-np.abs(np.log(x / np.median(x)))) / len(x))
...
>>> deviation([2,2,2,2])
1.0
>>> deviation([2,2,3,1])
0.7598356856515925
>>> deviation([2,2,3,2])
0.9036020036098449
pub fn lookup_host(domain: &str, port: u16) -> io::Result<Option<Addr>> {
for socket_addr in (domain, port).to_socket_addrs()? {
return Ok(Some(Addr::from_socket_addr(socket_addr)));
}
Ok(None)
}
if let
with .next()
>>> def deviation(x):
... return np.exp(np.sum(-np.abs(np.log(x / np.median(x)))) / len(x))
...
>>> deviation([2,2,2,2])
1.0
>>> deviation([2,2,3,1])
0.7598356856515925
>>> deviation([2,2,3,2])
0.9036020036098449
0
will always cause a 0% matcherror: calling `set_len()` immediately after reserving a buffer creates uninitialized values
--> zlib_minimal/src/lib.rs:100:5
|
100 | let mut dest = Vec::with_capacity(upper_bound);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
104 | dest.set_len(upper_bound);
0
?T
.0
? 0
? 0
is a valid number to entertest test::test_compress ... error: unsupported operation: can't call foreign function `compressBound` on OS `linux`
--> zlib_minimal/src/lib.rs:95:15
|
95 | (unsafe { raw::compressBound(source_len as c_ulong) }) as usize
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function `compressBound` on OS `linux`
[8,9]
is also 50% then?closeness = lambda x: 0.64 ** (np.sum(np.abs(x - np.median(x))) / len(x))
>>> closeness = lambda x: 0.64 ** (np.sum(np.abs(x - np.median(x))) / len(x))
>>> closeness([2,2,2,2,3])
0.9146101038546527
>>> closeness([2,2,2,2,8])
0.5853504664669777
>>> closeness([1,2])
0.8
>>> closeness([8,9])
0.8
# I JUST REALIZED I ALREADY USED .scan(/../)
# TO GET .groups_of(2)
# AND DUUUUH .scan() IS BASICALLY ALREADY
# .groups_of()
# TODO: get rid of it?!
# update: no
# .scan(/../) works on strings and groups_of works on arrays
# so it has its purpose
var closeness;
closeness = x => {
return Math.pow(0.64, np.sum(np.abs(x - np.median(x))) / x.length);
};
const sum = [1, 2, 3].reduce((partialSum, a) => partialSum + a, 0);
console.log(sum); // 6
syn
as a dependency of package cxxbridge-macro v1.0.71
https://github.com/rust-lang/crates.io-index
warning: spurious network error (2 tries r...syn
as a dependency of package cxxbridge-macro v1.0.71
crates-io
def int_to_ternary(n):
if n == 0:
return '0'
ternary = ''
while n > 0:
remainder = n % 3
ternary = str(remainder) + ternary
n = n // 3
return ternary
# Example usage:
number = 42
ternary_representation = int_to_ternary(number)
print(f'Ternary representation of {number} is: {ternary_representation}')
c++
#include <iostream>
#include <string>
std::string toTernary(int n) {
if (n == 0) {
return "0";
}
std::string result = "";
while (n != 0) {
int remainder = n % 3;
result = std::to_string(remainder) + result;
n /= 3;
}
return result;
}
int main() {
int number;
std::cout << "Enter an integer: ";
std::cin >> number;
std::string ternaryRepresentation = toTernary(number);
std::cout << "Ternary representation: " << ternaryRepresentation << std::endl;
return 0;
}
#include <iostream>
#include <memory>
#include <string>
struct {
unsigned char e, o, f;
char llp[8], lla[16], llq[32];
} typedef AR;
class UI {
std::string m_ModuleName;
std::shared_ptr<AR> m_spAR[4];
float gravity;
public:
AR* getAR(int index) { return m_spAR[index].get(); }
};
int main() {
UI* pUI = new UI();
for (int i = 0; i < 4; ++i) {
AR* pAR = pUI->getAR(i);
for (int j = 0; j < sizeof(pAR->llq) / sizeof(pAR->llp[0]); ++j) {
pAR->llp[j] = 0;
}
for (int j = 0; j < sizeof(pAR->lla) / sizeof(pAR->lla[0]); ++i) {
pAR->lla[j] = -127;
}
for (int j = 0; j < sizeof(pAR->llq) / sizeof(pAR->llq[0]); ++j) {
pAR->llq[j] = 127;
}
}
}
tell gpt this segfaults and it will fix the ++i to ++j which is right, it will initialize the shared_ptrs first and it will tell you that you need to check for nullptrs first.
what it apparently doesnt notice is the little spelling mistake with llq and llp in the second for loop.library/std/src/io/stdio.rs
.std::cout << "hello" << std::endl;
and std::cout << "hello\n";
?std::cout << "hello" << std::endl;
and std::cout << "hello\n";
? collect_into
a1ea2f1
Split up io.cpp - Marmare314
5f60d68
extract CEditorImage
into separate header - Marmare314
d68029a
extract CEditorSound
into separate header file - Marmare314
c3a07dd
let CEditorSound
inherit CEditorComponent
- Marmare314
07fd8e6
let CAutoMapper
inherit CEditorComponent
- Marmare314
12d0608
let CEditorImage
inherit CEditorComponent
- Marmare314
59df1d8
move CEditorMap::HandleMapDrop
to CEditor
- Marmare314
1ebd209
Merge pull request #7095 from Marmare314/refactor-a1 - Robyt3