HN user

raluk

29 karma
Posts1
Comments35
View on HN

At first glance looks like stipped C++ with minor differences. For example go have row polimorphism compared to OOP in C++. What else is there that C++ does not have?

Spending few weeks trying to understand Kalman filterm, I figured out that I need to understand all if the following:

1. Model of system

2. Internal state

3. How is optimal estimation defined

4. Covariance (statistics)

Kalman filter is optimal estimation of internal state and covariance of system based on measurements so far.

Kalman process/filter is mathematical solution to this problem as the system is evolving based on input and observable measurements. Turns out that internal state that includes both estimated value and covariance is all that is needed to fully capture internal state for such model.

It is important to undrstand, that having different model for what is optimum, uncertenty or system model, compared to what Rudolf Kalman presented, gives just different mathematical solution for this problem. Examples of different optimal solutions for different estimation models are nonlinear Kalman filters and Wiener filter.

---

I think that book on this topic from author Alex Becker is great and possibly best introduction into this topic. It has lot of examples and builds requred intuition really well. All I was missing is little more emphasis into mathematical rigor and chapter about LQG regulator, but you can find both of this in original paper by Rudolf Kalman.

What are protental issues with compiler, by just disabling borrow checker? If I recall correctly some compiler optimisations for rust can not be done in C/C++ because of restrictions implied by borrow checker.

Years ago I wrote c++ library for stream compostion. Something like C++20 ranges. It turns out that as long as you compose everything with lambdas, compiled code is same as it would be with naive loops. Everything gets optimised.

For example, you can write sum of numbers less than n as:

  count(uint64_t(0)) 
   | take(n) 
   | sum<uint64_t>();
Clang converted this into n*(n-1)/2.

This is what i hand in mind whit "manually handing of futures". In this case you have to write

   Promise1 = f1(); Promise2 = f2();
   v1,v2 = await Join(Promise1, Promise2);
   return v1 + v2
I think this is just too much of synthactic noise.

On the other hand, it is necessary becase some of underlying async calls can be order dependend.

for example

    await sock.rec(1) == 'A' && await sock.rec(1) == 'B'
checks that first received socket byte is A and second is B. This is clearly order dependant that can't be executed concurrently out of order.

In there is also ApplicativeDo that works nicely with this.

    do 
      x <- f1
      y <- f2
      return $ x + y
this is evaluated as applicative in same way.

One thing that most languages are lacking is expressing lazy return values. -> await f1() + await f2() and to express this concurently requres manually handing of futures.

One problem with fast writing is that it requres more energy to transmit from reader to a card in order for a card that has no internal source of power, to toggle bits. It is harder compared to just reading a bit from a card. Additonaly it is tricky to implement trasaction with single write, given that data transfer can be interrupted (for example user removes card from RF field). I am not sure if single write is enough for making this robust/transactional. It also helps a lot if RFID antenna is well tuned. Proximity of metal and way it is mounted has a big impact, so it is important that RF antenna for reader is tuned for exact environment it is mounted in.

How one writes circular circuit, for example stream of fibonnachi numbers or IIR filter? For IIR filter it would be nice if it has protoype like iir(sig : T, a : vec<T, N>, b : vec<T,M>) -> T

mIRC 7.81 1 year ago

I learned programming using mIRC scripting. There used to be bunch of quiz chaneles about trivia. I logged channel to collect questions and then wrote script that provided response after some time based on linear function k + n*len(response). That was my fist piece of software I wrote. mirc scrpting based on event system was super nice system to work with. Later I also wrote chat bot and i collected have some funny conversations with strangers.

Websocket is not ment to be sent as streams (TCP equvalent), but as datagrams aka packets (UDP equivalents). Correct me if I am wrong, but websockets api in Javascript libraray for browsers is pretty poor and does not have ability to handle backpressure and I am sure it can not handle all possible errors (assertions about delivery). If you want to use websockets as TCP streams including seasson handling, great care should be taken as this is not natively availabe in neither rfc6455 and in browser.

Extra. I am not sure if that is clear from paper, but in example of 1.75 * 2.5 we can represent 1.75 also as (1-0.125) * 2. This gives good aproximations for numbers that are close but less than power of 2. This way abs(a*b) in (1+a)*(1+b) is allways small and strictly less than 0.25.

Another example, if we have for example 1.9 * 1.9 then we need to account for overflow in (0.9 + 0.9) and this seems to induce similar overhead as expressing numbers as (1-0.05)*2 .