153 karma · joined Apr 24, 2018 (8y ago) · 72 submissions
comment 1y ago · link · parent
These sensors (based on thermal resistance) for example have an accuracy of 0.2 °C under typical conditions [1].
[1] https://www.ti.com/lit/ds/symlink/tmp1826.pdf?ts=17427997638...
comment 1y ago · link · parent
If you change the locale to an uninstalled one, then yes. But if the locale is installed, then I don't see a problem.
echo $LANG
# output: en_US.UTF-8
touch fusée.txt
LANG=fr_FR.UTF-8 ls
# output: 'fus'$'\303\251''e.txt'
sudo locale-gen fr_FR.UTF-8
sudo update-locale
LANG=fr_FR.UTF-8 ls
# output: fusée.txt
Are you maybe using non-UTF-8 locale?
comment 1y ago · link · parent
comment 2y ago · link · parent
> A majority of Python projects use a scheme that resembles semantic versioning. However, most projects, especially larger ones, do not strictly adhere to semantic versioning, since many changes are technically breaking changes but affect only a small fraction of users...
[0] https://github.com/pydata/xarray/issues/6176
[1] https://numpy.org/doc/stable/dev/depending_on_numpy.html
[2] https://packaging.python.org/en/latest/discussions/versionin...
comment 2y ago · link · parent
I made some simple 2D Navier-Stokes solver here where you can use the mouse to draw a section of a wing:
https://alexander-barth.github.io/FluidSimDemo-WebAssembly/
The color represents the pressure (I should add a proper color bar!)
comment 2y ago · link · parent
It can give people also a second change to notice, e.g. the typo in the package name.
comment 2y ago · link · parent
https://www.tandfonline.com/doi/pdf/10.4169/amer.math.monthl...
But this time not with complex numbers.
comment 2y ago · link · parent
I would be genuinely interested what are the inconsistency from a Python-perspective.
I am former Matlab/Octave user. To me the julia interface of matplotlib is actually quite nice to use, but unfortunately the installation is a bit brittle.
comment 3y ago · link · parent
comment 3y ago · link · parent
https://alexander-barth.github.io/FluidSimDemo-WebAssembly/
But here the wasm code does only the number crunching. The visualization (and memory allocation) is all done in javascript.
comment 3y ago · link · parent
A useful macro is @. which allows you to write "@. A * B * C" instead of "A .* B .* C". Also the macro avoid the creation of an intermediate vector with A times B.
comment 3y ago · link · parent
julia> count(age > 17 for age in ages)
Or even shorter:
julia> count(ages .> 17)
Under the hood many of the functions are implemented using the reduce function (similar to / in APL):
julia> reduce(+,ages .> 17)
I think many languages in data science have been influenced by APL. But sometimes this influence come from an intermediate language like matlab.
comment 3y ago · link · parent
If you need a quantitative measure, one can use e.g. the number of difference species per area (biodiversity) to know the area where an accident has the least impact. Or maybe the number of endangered species.
Granted, computing these metrics are however quite difficult. However, what is easy to measure from space is the amount of chlorophyll in the surface water of the ocean. Besides coastal areas, the Arctic stands out as relatively chlorophyll rich.
https://commons.wikimedia.org/wiki/File:AYool_SEAWIFS_annual...
18.
Systematic abuse of DMCA take downs via back-dated articles (2022)(lumendatabase.org ↗)
3 points · by kwertzzz · 3y ago · discuss
20.
Interactive fluid simulation model implemented in Julia and compiled to WASM(alexander-barth.github.io ↗)
2 points · by kwertzzz · 3y ago · discuss
comment 4y ago · link · parent
When a malicious package is found on NPM or PIP, it will get removed. However, it is quite unlikely that a website will be taken town for a malicious script (or only after a long time).
I really doubt that most readers of HN would run a random script unless it comes from a source they trust (trusted enough to least to remove a malicious script in a timely fashion).
comment 4y ago · link · parent
julia> k = Int32.(1:1000_0000); v = rand(Int32,1000_0000);
julia> dict = Dict(zip(k,v));
julia> Base.summarysize(dict) / (2 * 4 * 1000_0000)
1.8874391
julia> Base.summarysize(dict)
150995128comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
using Random, BenchmarkTools
seq = rand(0:2,10_000); sub = rand(0:2,4);
# translation of the "readable" but slow python code
function_1(seq, sub) = [i for i in 1:(length(seq)-length(sub)) if view(seq,i:i+length(sub)-1) == sub];
@btime function_1(seq, sub);
# 93.858 μs (5 allocations: 1.98 KiB)
Which is more than twice as fast as the vectorized (and quite unreadable) python %timeit function_2(seq, sub)
215 µs ± 1.94 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
Having a JIT (like julia, numba...) has really a bit potential to improve code readability and reduce the need of vectorized numpy operations. In some cases, it can even be faster due to be better memory utilization and by computing more directly what you need.comment 4y ago · link · parent
"And at the same time it is stated on behalf of Chancellor Hilter that these acts of violence [against Jews] by Nazis have been condemned and that official order haves been issued to prevent their recurrence"
Telling X and doing !X is not a recent invention.
comment 4y ago · link · parent
This is the purpose of the @which macro:
julia> @which diag(randn(3,3))
diag(A::AbstractMatrix) in LinearAlgebra at /opt/julia1.7.2/share/julia/stdlib/v1.7/LinearAlgebra/src/dense.jl:249
It gives you filename, line number and function signature.comment 4y ago · link · parent
Some DMCA claims do indeed mention "The repository [from the student] contains code provided to complete assignments [georgia tech]" ([1]). But the claim at [2] does not mention this. It only says "This repository contains Georgia Tech class assignment solutions." under the section "Please provide a detailed description of the original copyrighted work".
[1] https://github.com/github/dmca/blob/master/2022/04/2022-04-0...
[2] https://github.com/github/dmca/blob/master/2022/03/2022-03-1...
comment 4y ago · link · parent
[1] https://github.com/github/dmca [2] https://github.com/github/dmca/blob/master/2022/03/2022-03-1...