Anonymous
Can I post stack overflow link here ?
Anonymous
I want save op_array (c program) for PHP .
Serhii
Anonymous
It is PHP byte code
Anonymous
Please check PHP c source code
Anonymous
I am developing c extension
Anonymous
How to serialize c pointer struct with simple function
Anonymous
Can I use mmap ?
Dima
Lol
Igor🇺🇦
I am developing c extension
What is a C extensions? I've heard of PHP extension, but don't know what C extension is.
Anyway - if you want to serialize anything you need to come up with some standard representation of your data structure. You can't just save it as it is in a memory. For example pointers are meaningless in a different process that will read your "save"
Dima
Francisco
Format the code
Honestly, I don't think it would make much more difference hahaha
Dima
Indeed
Anonymous
Anonymous
Please check attached file
Dima
So?
Dima
Doesn’t tell anything
Anonymous
Formated code
Dima
So?
Dima
Learn the basics first
Anonymous
Can I save data without Serialization ?
Anonymous
Dima
Dima
Learn the basics first before writing a code
Igor🇺🇦
Anonymous
Thank you
Igor🇺🇦
Arshid what is the problem you're trying to solve?
Anonymous
Making cache PHP extension
Anonymous
Anonymous
I think, I need add data one by one, am I right ?
Anonymous
Any simple serialization library available? Like seriouse(op_array) like;
Igor🇺🇦
Making cache PHP extension
Generic serialization is not easy. You need to tell what should and shouldn't be saved. I'm not familiar with PHP very well, but it knows how to save PHP classes. Why do you need C?
In short - somebody has to describe how to save every structure in your specific object.
Anonymous
I want save all elements in op_array
Igor🇺🇦
Why do you need this specific structure? Can't you save only relevant data and re build this object afterwards?
Anonymous
zend_op is array.
Anonymous
I am confused, how to save this zend_op array
Igor🇺🇦
I think you need to go to drawing board and redesign whatever you are trying to do. This requires deep understanding of PHP. Can't help you with that. Sorry ☹️
Anonymous
@LaurenSyme i think you are not supposed to be here😂😂.
Fabio
Hi, everyone...i've a dumb question to do
Fabio
I'm trying to concatenate an int to a const char *, I've try a thousands of way to do that...so which is the best method to that?
Fabio
And when I cast the integer, what happened, I mean something is put before or after the number?
Francisco
你那個朋友
if performance is not much an issue, one can simply std::to_string(the int).c_str()
Artöm
Artöm
Anyway use sprintf and preallocated buffer
Fabio
Serhii
Fabio
I used ("imu" + std::to_string(i)).c_str() or strcat("imu_" ,std::to_string(i).c_str())
Artöm
Use std::string and either std::to_string or std::to_chars
Artöm
Fabio
Publisher(const char * topic_name, Msg * msg, int endpoint = rosserial_msgs::TopicInfo::ID_PUBLISHER) :
Fabio
i don't know, this is the constructor i'm using from ros_lib
Artöm
Why not std::string?
Serhii
Artöm
Well, use 17
Fabio
Like to_chars(i)
Artöm
Nope, read the docs
Igor🇺🇦
Fabio
like "imu_1" "imu_2" and so on
Fabio
using rosserial_arduino, but rosserial_server crash launching an exception saying that topic name is not valid (I think it is somenthing related to the cast, which made strange character)
Igor🇺🇦
Igor🇺🇦
You need to concatenate strings not add something to char*
Fabio
Fabio
i is a number
Fabio
Okay it seems to work let me debug for a while
Manish
Hi, I am using Google protobuf 3 . I don't have any idea what protoc generate. I need help. Anyone plz?
klimi
Igor🇺🇦
Dima
Asdew
Will there ever be #duckit?
Manish
I have tried and successfully ran example given at GitHub. But when I am using with my own code then getting segmentation fault error.
Artöm
There could be lots of reasons for segfault. Debug it
Artöm
With gdb or debug prints
Artöm
Or vs debugger if youre windows user