Hasan Yousef
MModular
•Created by Hasan Yousef on 10/24/2024 in #questions
Python integration: address not mapped to object
I wrote the below simple python code at jupyter notebook for stamping my pdf documents:
I tried writing a mojo code for the same, so wrote:
I'm calling the function, in bot python and mojo using:
With python I got the output.dpf correctly, but with mojo I got the error:
What could be my mistake here?
2 replies
MModular
•Created by Hasan Yousef on 9/24/2024 in #questions
MOJO embeded
Can I use mojo like mictopython for programming Raspberry PI Pico 2.
https://store.rpipress.cc/products/get-started-with-micropython-on-raspberry-pi-pico-2nd-edition
3 replies
MModular
•Created by Hasan Yousef on 9/21/2024 in #questions
Compile to Shared Library
Can I compile mojo code as a shared library,? If yes, how?
6 replies
MModular
•Created by Hasan Yousef on 9/19/2024 in #questions
Define Tuple with PuthonObject
Trying to convert the below opencv python code to mojolang:
So, I wrote the below:
I got the error:
declaration must have either a type or an initializer
at the line var ret, frame = cap.read()
8 replies
MModular
•Created by Hasan Yousef on 9/17/2024 in #questions
Example of parallel computing
I read the this, but unfortunately could not understand how can I do parallel computing at MOJO, can any help help with simple code sample. Thanks
https://docs.modular.com/mojo/stdlib/algorithm/functional/parallelize
8 replies
MModular
•Created by Hasan Yousef on 9/14/2024 in #questions
How can I convert String to StringLiteral
I understood that
str()
is required to convert things to String like (StringLiteral, Int, Bool, ...), but is there a way to covert String to LiteralString.
As part of learning Mojolang I'm trying the below code, then this conversion issue poped up.
5 replies
MModular
•Created by Hasan Yousef on 9/14/2024 in #questions
C/C++ Interop
My understaffed is horror we can get something like:
https://docs.modular.com/mojo/roadmap#cc-interop
And for clib interop we have sys.ffi.external_call
My question is if I have a foo-lib.so that is a c/c++ lob, how can I call it's functions, and do I need the foo.h also?
5 replies
MModular
•Created by Hasan Yousef on 9/12/2024 in #questions
Embedding
Hi all, not sure if I have to ask here or at MAX channek, is there embedding, vector database and similarity search in MAX that I can use with LLM?
3 replies
MModular
•Created by Hasan Yousef on 2/13/2024 in #questions
Printf - print format
Is there a print format in mojo، how can I rewrite this python in mojo:
1 replies
MModular
•Created by Hasan Yousef on 12/23/2023 in #questions
Running Mojo executable at Alpine docker
I created a mojo dockerfile the is working fine:
And wanted to use it as a builder image:
But I could not run the executable at the alpine based docker, and got the error:
I guess there are some dependencies that are exisiting at ubuntu and not exisiting at the Alpine docker, that is making the executable not be seen, noting that I just built the simpletst "heelo world" example.
1 replies
MModular
•Created by Hasan Yousef on 12/15/2023 in #questions
Building Shared and Dynamic library
Can I build an executable and a library with mojo lang or executable only?
3 replies
MModular
•Created by Hasan Yousef on 12/8/2023 in #questions
Distributing the binary as a docker image
I'm playing with mojo at ArchLinux and I am very excited about it, considering it is not yet supporting Windows, nor cross compilation, I would like to build a docker image of my binary, and import it at my Windows docker desktop, I would like to import from the scratch docker, what is the minimal setup or dependencies that should be including in my docker image to get the binary built using mojo run smoothly?
5 replies
MModular
•Created by Hasan Yousef on 11/18/2023 in #questions
Running code at GPU
How can I write a mojo code that is executed at the GPU instead of the CPU?
14 replies
MModular
•Created by Hasan Yousef on 10/19/2023 in #questions
Create a CSR
I can create CSR in Go as below, is there something similar in Mojo
2 replies
MModular
•Created by Hasan Yousef on 9/28/2023 in #questions
Parallelism and multithreading
I couldn't find a sample code of Mojo multithreading, Can anyone guide me where I can find the proper guide, or provide me with sample snippets to learn from. thanks
3 replies
MModular
•Created by Hasan Yousef on 9/25/2023 in #questions
HOWTO fetch internet resources
Is there a way in mojo that can be used for fetching websites, get and post?
14 replies