Search found 197 matches

by HermannSW
Fri Apr 30, 2021 1:41 pm
Forum: Programs, Libraries and Tools
Topic: lambda, apply, arbitrary precision
Replies: 2
Views: 2500

Re: lambda, apply, arbitrary precision

This is more clean: def siglam(p,q): return (apply(range(p), lambda i: (apply(range(q), lambda j: C(i)*C(j)*C(p+q-i-j-1) )) )) Returns nested tuples >>> catalan.siglam2(3,2) ((14, 5), (5, 2), (4, 2)) >>> which "sum()" cannot handle -- but "sumit()" can: def sumit(t): return t if isinstance(t, (int,f...
by HermannSW
Thu Apr 29, 2021 4:38 pm
Forum: Programs, Libraries and Tools
Topic: lambda, apply, arbitrary precision
Replies: 2
Views: 2500

Re: lambda, apply, arbitrary precision

Cosmetics, easier to read, does not use that much space horizontally, equivalent to previous code:

Code: Select all

def siglam(p,q):
    return sum(apply(range(p), lambda i:
               sum(apply(range(q), lambda j:
                   C(i)*C(j)*C(p+q-i-j-1)
               ))
           ))
        
by HermannSW
Tue Apr 27, 2021 4:08 pm
Forum: Programs, Libraries and Tools
Topic: lambda, apply, arbitrary precision
Replies: 2
Views: 2500

lambda, apply, arbitrary precision

Today I stumbled over this identity for Catalan numbers: https://oeis.org/A000108 C(p+q)-C(p)*C(q) = Sum_{i=0..p-1, j=0..q-1} C(i)*C(j)*C(p+q-i-j-1). - Groux Roland, Nov 13 2009 Normally I use "bc" tool for arbitrary precision calculations, but realized that MicroPython allows for that as well. And ...
by HermannSW
Sat Apr 24, 2021 2:42 pm
Forum: Raspberry Pi microcontroller boards
Topic: Native machine code in Pico .mpy files
Replies: 0
Views: 2211

Native machine code in Pico .mpy files

"micropython/py/dynruntime.mk" does not know about "Pico" (cortex-m0plus) archtecture. I did hijack "armv7m" for the Pico and added support for Pico with 1line change commit on my micropython fork, that provides "string" example module with multiple member functions and multiple (int+str) arguments,...
by HermannSW
Thu Apr 22, 2021 11:28 am
Forum: Raspberry Pi microcontroller boards
Topic: Pico MicroPython with networking over USB
Replies: 10
Views: 8590

Re: Pico MicroPython with networking over USB

Can you help on MicroPython networking client examples (with and without ssl) only working with google. com? https://forum.micropython.org/viewtopic.php?f=15&t=10318 I identified root cause -- Micropython network http[s] examples are too sloppy, most webservers need "Host" header presented. I commi...
by HermannSW
Thu Apr 22, 2021 8:53 am
Forum: Programs, Libraries and Tools
Topic: [SOLVED] [Unix port] examples/network/http_client_ssl.py only works for google.com?
Replies: 3
Views: 3201

[SOLVED] Re: [Unix port] examples/network/http_client_ssl.py only works for google.com?

I identified root cause: google.com is a bit sloppy, other http[s] servers need at least "Host" header presented! I fixed both network http[s] client examples, see this commit on my micropython fork for details: https://github.com/Hermann-SW/micropython/commit/bd5dfd1546ee091c30cf7dd7be293acf85fbb86...
by HermannSW
Thu Apr 22, 2021 7:48 am
Forum: Raspberry Pi microcontroller boards
Topic: Pico MicroPython with networking over USB
Replies: 10
Views: 8590

Re: Pico MicroPython with networking over USB

pythoncoder wrote:
Thu Apr 22, 2021 7:19 am
Light dawns :D
I hope so :D

Can you help on MicroPython networking client examples (with and without ssl) only working with google. com?
viewtopic.php?f=15&t=10318
by HermannSW
Thu Apr 22, 2021 7:15 am
Forum: Raspberry Pi microcontroller boards
Topic: Pico MicroPython with networking over USB
Replies: 10
Views: 8590

Re: Pico MicroPython with networking over USB

Why not use an Esp32 for the network? I connected ESP01 to Pico for enabling Pico to do HTTPS GET requests over ESP01's Wifi -- but that was not real networking between Pico and ESP01. See thread pointed to in my signature. This looks like a lot of development effort and it's great that it works, b...
by HermannSW
Wed Apr 21, 2021 6:21 pm
Forum: Raspberry Pi microcontroller boards
Topic: Pico MicroPython with networking over USB
Replies: 10
Views: 8590

Re: Pico MicroPython with networking over USB

I am done with cleanup and commited+pushed the changes to my micropython fork with this commit (it shows nicely what all needed to be changed and where): https://github.com/Hermann-SW/micropython/commit/f782c8b5a6d6e9f65c2a4feeaaa95a192ab2a123 In case you just want to try without building MicroPytho...
by HermannSW
Tue Apr 20, 2021 9:15 pm
Forum: Raspberry Pi microcontroller boards
Topic: RPI Pico Speed
Replies: 3
Views: 6325

Re: RPI Pico Speed

Default system clock is 125MHz. USB+UART+GPIO works fine for 250MHz. You can overclock to >=420MHz with GPIO still working. My first 3 Picos maxed out with working GPIO at 426/428/436MHz. I was able to run Pico at 10MHz, but all frequencies below did not work. In case you overclock with >400MHz, you...