realm to Excel conversion - objective-c

The realm-browser is great to look at realm-files, but what about exporting data from the realm-browser? Is there a tool out there to convert realm-files into other formats?
For example, is there an easy way to get data converted from .realm into an excel spreadsheet?

The realm-browser will eventually be extended to both import and export in various formats. The realm bindings will also get export to json capabilities.
Until then you can just iterate through allObjects and print them to a file with the built-in description method or extract each property and dump it in another preferred format.

Related

Convert a Smart Form into PDF in an Xstring variable

I have to generate a Smart Form in PDF format. I have to save this output (in any possible format which I would say is type either string or xstring) in a Z table so it can be generated again without the processing.
Could you please clarify if there is any way of saving the Smart Form PDF in xstring type?
I have looked into the output of function module that generates the Smart Form and tried to look for xstring but was unable to find it.
In the CONTROL_PARAMETERS importing parameter of the function module you use to output the Smart Form, pass the field GETOTF = 'X' in order to receive the field OTF_DATA from the exporting parameter JOB_OUTPUT_INFO.
Then you can convert the field OTF_DATA into PDF format with the function module CONVERT_OTF.
That gives you a binary table that you can convert to the xstring type using the function module SCMS_BINARY_TO_XSTRING.

Octave: converting dataframe to cell array

Given an Octave dataframe object created as
c = cell(m,n);
%populate c...
pkg load dataframe
df = dataframe(c);
(see https://octave.sourceforge.io/dataframe/overview.html),
Is it possible to access the underlying cell array?
Is it there a conversion mechanism back to cell array?
Is it possible to save df to CSV?
Yes. A dataframe object, like any object, can be converted back into a struct.
Once you have the resulting struct, look for the fields x_name to get the column names, and x_data to get the data in the form of a cell array, i.e.
struct(df).x_data
As for conversion to csv, the dataframe package does not seem to provide any relevant methods as far as I can tell (in particular the package does not provide an overloaded #dataframe/csvwrite method). Therefore, I'd just extract the information as above, and go about writing it into a csv file from there.
If you're not dealing with strictly numerical data, you might want to have a look at the cell2csv / csv2cell methods from the io package (since the built-in csvwrite function is strictly for numerical data).
And if that doesn't do exactly what you want, I'd probably just go for creating a csv file manually via custom fprintf statements.
PS. You can generally see what methods a package provides via pkg describe -verbose dataframe, or the methods for a particular class via methods(dataframe) (or even methods(df)). Also, if you ever wanted to access the documentation for an overloaded method, e.g. say the summary method, then this is the syntax for doing so: help #dataframe/summary

Equivalent to pickle in Julia

I'm looking for a convenient way to dump and load variables in Julia, just like pickle does in Python.
Is there a package which does something like myVar = load(myPath) and dump(myVar, myPath) (or similarly f = open(myPath, "r"); myVar = load(f)) ?
HDF5.jl package have been split into HDF5 new package and JLD
see here:
https://github.com/JuliaLang/JLD.jl
Saving and loading julia variables while preserving native types is now possible using JLD
According doc:
JLD, for which files conventionally have the extension .jld, is a
widely-used format for data storage with the Julia programming
language. JLD is a specific "dialect" of HDF5, a cross-platform,
multi-language data storage format most frequently used for scientific
data. By comparison with "plain" HDF5, JLD files automatically add
attributes and naming conventions to preserve type information for
each object.
I think the HDF5 package has the functionality you want, it worked very good for me using some custom types and all:
see here:
https://github.com/JuliaLang/HDF5.jl

Noflo .fbp array initiallizer

I'm using noflo and am trying to send an array as an initiallizer. There doesn't seem to be a supported (or at least documented) way to do this.
I'm currently using:
'["Kicker"]' -> IN Nodes(strings/ParseJson)
'{"in":"go!"}' -> IN Config(strings/ParseJson)
Nodes() OUT -> NODES MyComponent(noflotest/Universe)
Config OUT -> CONFIG MyComponent()
Is there a better way to do this?
Currently arrays and other complicated data structures are not supported in the .fbp syntax. There is a feature request about this.
Right now you have three options:
If FBP parser accepts your string (see the matching rules), you can first send it to the strings/ParseJson component to turn it to the appropriate data structure
Reading the value from a JSON or YAML file and passing it through the appropriate parser component
Converting your graph to the JSON graph format

Developing a Shapefile using MATLAB Mapping Toolbox using Object Oriented Programming

I'm using MATLAB (Mapping Toolbox) to create a large number of lines between different countries. Since there are so many lines, I'm trying to do this using object-oriented programming.
The problem is that I've created a lot of objects (lines) from the class, 'Transline', but when I try to export the whole set as a shape-file using the 'shapewrite' command, MATLAB tells me that it's invalid because the 'shapewrite' command expects an input argument of type 'struct' rather than 'Transline' (which is the class of these objects). Is there any way I can use object-oriented programming to export the set of lines as a shapefile?
Thank you.
I would think your best option is to simply call struct(myObjs)on your object before passing it to shapewrite. If the output of the structure is not in the correct format you can overload the struct method in your object. eg.
methods
function myStructOfObj=struct(obj)
%create correct structure
end
end