carlcaulkett
MModular
β’Created by Cdjones on 8/18/2024 in #questions
Reading Tensor From File
Do you need to use a Tensor at all? I had some code that used Tensors, until I found that I could just use the FileHandle.read_bytes function. Here's my code...
6 replies
MModular
β’Created by Andrey on 8/14/2024 in #questions
Interacting with Desktop Files such as .pdf documents
I see that @maxim has a new string handling package out https://discord.com/channels/1087530497313357884/1151418092052815884/1273544370578133046
I am certain that his code will be much more efficient than mine. I haven't looked at it yet, though. In my case it's a case of "if it ain't broke, don't fix it" π
7 replies
MModular
β’Created by Andrey on 8/14/2024 in #questions
Interacting with Desktop Files such as .pdf documents
Hi Andrey! In my
parser
code, where I needed to convert from the bytes to a string, I used this method...
Something similar should do the trick π7 replies
MModular
β’Created by Andrey on 8/14/2024 in #questions
Interacting with Desktop Files such as .pdf documents
Hello Andrey. I would think it is possible. I've had a Bitwig preset parser up and running for a few months.. Have a look at https://github.com/carlca/ca_mojo.git and in particular the
./bitwig/preset_parser
for some ideas.
Essentially you just open a file using var f = open(file_name, "r")
and then use methods like var data: List[UInt8] = f.read_bytes(size)
to read the data.
Or did you mean more specialised code geared towards PDF file in particular? I fear that for the moment, it's a case of using first-principles and a handy reference to the file-format in question.7 replies
MModular
β’Created by Vijay Yadav on 12/19/2023 in #questions
How to convert string to float value?
I'm in the fortunate position of not having any looming deadlines for my code noodling, so I can afford to maintain a pure-mojo approach π
12 replies
MModular
β’Created by Vijay Yadav on 12/19/2023 in #questions
How to convert string to float value?
Or if you do it, you can let me know π
12 replies
MModular
β’Created by Vijay Yadav on 12/19/2023 in #questions
How to convert string to float value?
Ooh! Iβd forgotten about that format. Good call! Iβll let you know when I do thatβ¦
12 replies
MModular
β’Created by Vijay Yadav on 12/19/2023 in #questions
How to convert string to float value?
Check out the
test_float_utils.mojo
unit in the repo root to get started with it!12 replies
MModular
β’Created by Vijay Yadav on 12/19/2023 in #questions
How to convert string to float value?
12 replies
MModular
β’Created by RogSat on 11/10/2023 in #questions
argv()
Testing with
mojo argv_test.mojo param1
gives the output...
Executable at [0] and params at [1] onwards...4 replies