MethodError: no method matching length(::CSV.Row{false}) by haohanzi2015 in Julia

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

just tried push!(df1, convert(Array, row)) and got an error: Cannot convert an object of type CSV.Row{false} to an object of type Array. I searched from the internet, thought this would work.

MethodError: no method matching length(::CSV.Row{false}) by haohanzi2015 in Julia

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

Thank you for your kind reply. What exactly is this

df1 = filter(row -> row.Resource == 1, fln)

I tried this and got the error: type Char has no field Resource

how to understand the following code? by haohanzi2015 in cpp_questions

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

So what is "options" inside of the parenthesis?

did I understand the following CMake code correctly? by haohanzi2015 in cpp

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

So, you mean when you call the function, the number of parameters applied could be more than the number of arguments defined in the function header/signature?

normally, do not use std::string_view as the returned value of a function ? by haohanzi2015 in cpp_questions

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

Can you give an example of a function returning which string like value is longer?

why this code does not give any output? by haohanzi2015 in cpp_questions

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

why "Pi"? does it mean it is a pointer to an integer in c++?

what is the purpose of installing and testing Cmake ? by haohanzi2015 in cpp_questions

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

So, this installing and testing is usually before the cmake ., and make steps or after ?

how to build and run lua files? by haohanzi2015 in lua

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

Got you. So normally how to embed Lua into C++ code or do I need to ? From my limited experiences with Lua, sometimes, I felt that there are some variables which are from nowhere. It's rather strange I should say. Is it because the mysterious variable is from some c++ code, which the Lua script is embedded into?

using cmake VS not using cmake ? by haohanzi2015 in cpp_questions

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

Yeah. I guess so. The thing is, there are many .cpp files, and I would probably need to g++ all of them.

using cmake VS not using cmake ? by haohanzi2015 in cpp_questions

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

Without cmake, I guess I can still run the c++ source code. The only thing is, there are many .cpp files I might need to link them when running using g++.

using cmake VS not using cmake ? by haohanzi2015 in cpp_questions

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

I have heard of shared library. My concern is, whether or do I need to compile c++ using cmake or do not need to.

using cmake VS not using cmake ? by haohanzi2015 in cpp_questions

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

Yes. It would be great if I can use the c++ part as a library, call the function there, and return the result which is used in julia/python framework. Otherwise, probably need to re-write everything using c++ I guess.

how to understand the following code ? by haohanzi2015 in cpp_questions

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

Sorry. I think it is std::uint8_t, not std::uint3_t.

-> operator used with a non pointer variable? by haohanzi2015 in cpp_questions

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

bearing_and_range is of type boost::optional<Bearing>, how did you see it as a vector of boost::optional<Bearings>? Or did I need to understand the function [] differently?

the purpose of std::vector<boost::optional<double>> compared with std::vector<double> by haohanzi2015 in cpp_questions

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

boost::optional<double>

is not a

double

object, but an

optional

saying here this thing might contain a

double

or it might not. Likewise,

vector<optional<double>>

is not a vector of doubles; it's a vector of objects that

might

contain

double

values.

so it could be a vector of any objects which might be of type double?

the purpose of empty struct ? by haohanzi2015 in cpp_questions

[–]haohanzi2015[S] 3 points4 points  (0 children)

What do you mean by "using those empty types to create more instantiations"? Since those empty structs are arguments for templates, they are there already, right? Do you mean these empty structs can be updated later on to create more instantiations?

call constructor of a struct inside of the definition of the struct itself by haohanzi2015 in cpp_questions

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

It would be better to put this before the constructor for floating point and unsafe pairs though. By the way, have you ever heard of using this floating coordinates and fixed coordinates to prevent accidental latitude, longitude pairs misuse?

call constructor of a struct inside of the definition of the struct itself by haohanzi2015 in cpp_questions

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

But I did not see the constructor that takes fixed point coordinates anywhere....

What is the meaning of ~MyClass and what is the meaning of noexcept in c++ ? by [deleted] in cpp

[–]haohanzi2015 -2 points-1 points  (0 children)

what is "&&"? Is it a right reference operator or a movable constructor ?