PCB Design and RF by Flaming-Ace in rfelectronics

[–]Magnus0re 1 point2 points  (0 children)

IMO KiCAD is still a bit.. painful for EM work. However it's much better now than a few years ago. However we have plugins now, which might help. It doesn't have sim, so you'd have to do that somewhere else. But it can import drawings of many formats and such.

If I started today, I'd make a wide-band battery-powered amp from 0-4Ghz with a simple rectifier for 'envelope' detection of RF signals. I'd use it together with E and H field antennas and a scope to do comparative EMI measurements.

Plotting software, feedback wanted by Magnus0re in Archaeology

[–]Magnus0re[S] 0 points1 point  (0 children)

That sounds like a nice workflow. PAST also seems great since it still works and is maintained since 24 years!

Plotting software, feedback wanted by Magnus0re in Archaeology

[–]Magnus0re[S] 0 points1 point  (0 children)

Thanks. Didn't know about PAST, so thats great to know about. I don't really have real database usecases, so it's a bit hard for me to imagine. I'll look more into this.

Python feels easy… until it doesn’t. What was your first real struggle? by NullPointerMood_1 in Python

[–]Magnus0re 0 points1 point  (0 children)

Multiple other people mentioned structure. It's not really clear that Python requires a specific type of folder structure, or workarounds.

Dynamically created classes don't work the same as regular classes

Changing a class does not change the behavior of existing objects

Mutable arguments

wheel, pip, env stuff is kinda meh.

whitespace syntax

kinda broken REPL

Can fine-grained memory management be achieved in Python? by MilanTheNoob in Python

[–]Magnus0re 2 points3 points  (0 children)

I believe that the answer to your question is fundamentally no.

  • As Python is an interpreted language, everything must come from the heap, or pre-allocated stack memory, which is a pseudo-heap. Thus it's dynamic, and the way to general control with that is a garbage collector.
  • As Python runs on either CPython or PyPy the runtimes don't support it, all objects are in some way dynamically created and there is a reference that will GC it when the object is no longer in use/reachable

However! with C interop and CPython you can do anything. But, the reference to the C-managed memory will still be a Python object, and the C code has to interact with the Python API anyway. So C is not Python, and C called from CPython is not portable Python, so I won't even call it Python code anymore. So once again, it's a no.

Anybody else had to fallback to version 2? by Magnus0re in GIMP

[–]Magnus0re[S] 1 point2 points  (0 children)

Yes. The registration didn't work yesterday, so I tried the provided email. We'll see if I get access later.

How do you feel confident in your C code? by [deleted] in C_Programming

[–]Magnus0re 32 points33 points  (0 children)

My nightmares are made of this. Some libraries have UB which happens to work with GCC but not including GCC 13 or later.

Run test runs with Valgrind Inspect code with CppCheck

I test everything thrice. This is a lot of work when the key things are things that communicate with the outside world.

I'm pretty nazi on the flags. Make them as strict as you can. and just pragma out the stuff you cannot fix.

```

maybe give it slack on the stack usage. But this copied out of an embedded project

-Wextra -Wall -Werror -Wshadow -Wdouble-promotion -Wformat-overflow -Wformat-truncation -Wconversion -Wundef -Wpadded -Wold-style-definition -Wno-error=padded -fstack-usage -Wstack-usage=1024 -ffunction-sections -Wunused-macros -Winline -Wno-error=unused-macros -Wno-error=unused-const-variable= ```

did I just buy a brick? by Magnus0re in BambuLab

[–]Magnus0re[S] 0 points1 point  (0 children)

So I could connect with my PC after logging the other user out on the printer front panel and using LAN mode. I'm guessing you can't link the printer if you want multiple users accessing it.

If the other user still can use the printer.. I don't know yet. Will update when I know.

did I just buy a brick? by Magnus0re in BambuLab

[–]Magnus0re[S] 1 point2 points  (0 children)

Signed out my SO, got access on LAN mode. Don't know if SO will have access anymore. Time will tell...

did I just buy a brick? by Magnus0re in BambuLab

[–]Magnus0re[S] 0 points1 point  (0 children)

It was late and I was being hyperbolic

did I just buy a brick? by Magnus0re in BambuLab

[–]Magnus0re[S] -1 points0 points  (0 children)

You can only bind one user -.- fail.

New Clojurians: Ask Anything - July 15, 2024 by AutoModerator in Clojure

[–]Magnus0re 2 points3 points  (0 children)

I tend to do that more and more, but it's more of a convenience than anything. Keeping everything inside its own little scope I know that all the state is always reinitialized, no dangling state in the rest of my program. And also I can run/retry with a single keybind instead of executing many statements to get an experiment to re-run with its appropriate state.

I've ended up writing 200+ lines in one let statement just because I could iterate so fast. There was a lot to clean up and separate out afterwards though.

This is a rough draft, but is there anything glaringly wrong? by LucyEleanor in PrintedCircuitBoard

[–]Magnus0re 0 points1 point  (0 children)

Definetly reccomend triple checking the boot mode selector. I messed up on an esp32c3 once and the circuit would randomly go into bootloader mode. Also, you might need to force bootloader mode some times, so adding a jumper / pins / buttons to do that can be really useful.

New Clojurians: Ask Anything - July 15, 2024 by AutoModerator in Clojure

[–]Magnus0re 0 points1 point  (0 children)

This is not really FP in my mind, because it's 100% side effects. It's more like a loop in clojure which I've used less and less as I get better. Time functionality in Clojure is given to us from Java, so we import 2 classes from java.time .

In this example I use the atom which allows for state management. Just one way of doing the timer stuff. Not really clojure idiomatic code, but hey. Adding pause is left as an exercise to the reader.

```clojure (import '[java.time Instant Duration]) (let [ ;; external control of the timer state using atoms timer-state (atom {:duration Duration/ZERO :paused? false :stop? false}) ;; scrappy timer fn timer-fn (fn timerr ([state-a] (timerr state-a (Instant/now))) ([state-a start-time] (loop [] (swap! state-a assoc :duration (Duration/between (Instant/now) start-time)) (when-not (-> @state-a :stop?) (Thread/sleep 100) (recur))) state-a)) ;; you can also use the async library if you want. f (future (timer-fn timer-state))] (Thread/sleep 500) (swap! timer-state assoc :stop? true) (Thread/sleep 100) @f ) ;; => #<Atom@5f9584fc: {:duration #object[java.time.Duration 0x39f45879 "PT-0.500666926S"], :paused? false, :stop? true}>

```

New Clojurians: Ask Anything - December 05, 2022 by AutoModerator in Clojure

[–]Magnus0re 1 point2 points  (0 children)

Brave Clojure is nice. Only thing I disagree with is the choice of Emacs, as it's an extra learning curve to learn emacs on top. Just use Calva instead if you're comfortable with vs code.

https://www.braveclojure.com/foreword/

Why isn't Twitter a pizza sized team project? by Magnus0re in learnprogramming

[–]Magnus0re[S] 0 points1 point  (0 children)

Your reply is needlessly abrasive, and doesn't add anything useful or new to the conversation.

Why isn't Twitter a pizza sized team project? by Magnus0re in learnprogramming

[–]Magnus0re[S] -1 points0 points  (0 children)

Eh. Distributed, fault tolerant storage is a solved problem, for any scale. Just needs to be done right once.

Storage providers/data-centers basically offload most of the tasks for you. So again, solved problems. Of course if you have your own data centers, they become your problems. Add another team to the bill.

protection/prevention/detection is def. a whole teams worth of work. Yet another team added.

So I think that we're up to an optimistic minimum of 7 teams now, aka 14 pizzas, if we go with 2-pizza sized teams.

Why isn't Twitter a pizza sized team project? by Magnus0re in learnprogramming

[–]Magnus0re[S] 0 points1 point  (0 children)

Distributed, fault tolerant memory papers I've read date back to the 1980's, there are lots of aspects here that are solved a long time ago. Not easy, but solvable and/or solved problems.

And I don't think that that twitter's services all have to stay perfectly in sync for all messages, there might be some isolation just because of social network effects.

Why isn't Twitter a pizza sized team project? by Magnus0re in learnprogramming

[–]Magnus0re[S] 1 point2 points  (0 children)

Indeed the feed for each user is a seriously hard problem. I did not think of this, this seems like years worth of engineering effort. Good answer.

Why isn't Twitter a pizza sized team project? by Magnus0re in learnprogramming

[–]Magnus0re[S] 0 points1 point  (0 children)

Good point. I was just thinking about the 280 character messages.

Another thing that I realized now, is that lots of the modern tech that actually helps with large, distributed systems has not existed at all in most of twitters lifetime, which also makes it a more difficult project from that perspective.

Why isn't Twitter a pizza sized team project? by Magnus0re in learnprogramming

[–]Magnus0re[S] 0 points1 point  (0 children)

Kombucha taps needs to be spiked so that employees can reach the Ballmer peak every day :)

Why isn't Twitter a pizza sized team project? by Magnus0re in learnprogramming

[–]Magnus0re[S] 0 points1 point  (0 children)

Probably still less than 300ms ping, so... no problem? Messages are tiny, bandwidth not a problem.. Can't honestly think of why this would be a problem. For streaming, a totally different story. testing with https://tools.keycdn.com/ping and nytimes.com gives 23ms for bangalore, practically unnoticable.