How to pass column name with function readtable in julia? - dataframe

using DataFrames
label = ["Data", "tempo", "RAh", "RAm", "RAs", "DEh", "DEm", "DEs"]
df = readtable("mars.dat", separator = ' ',header = false, names = label)
I get the next error
MethodError: no method matching DataFrames.ParseOptions(::Bool, ::Char, ::Array{Char,1}, ::Char, ::Array{String,1}, ::Array{String,1}, ::Array{String,1}, ::Bool, ::Array{String,1}, ::Array{Any,1}, ::Bool, ::Char, ::Bool, ::Int64, ::Array{Int64,1}, ::Bool, ::Symbol, ::Bool, ::Bool)
Closest candidates are:
DataFrames.ParseOptions(::Bool, ::Char, ::Array{Char,1}, ::Char, ::Array{S<:String,1}, ::Array{T<:String,1}, ::Array{T<:String,1}, ::Bool, ::Array{Symbol,1}, ::Array{T,1} where T, ::Bool, ::Char, ::Bool, ::Int64, ::AbstractArray{Int64,1}, ::Bool, ::Symbol, ::Bool, ::Bool) where {S<:String, T<:String} at /home/juser/.julia/v0.6/DataFrames/src/dataframe/io.jl:9
Stacktrace:
[1] #readtable#84(::Bool, ::Char, ::Array{Char,1}, ::Char, ::Array{String,1}, ::Array{String,1}, ::Array{String,1}, ::Bool, ::Int64, ::Array{String,1}, ::Array{Any,1}, ::Bool, ::Char, ::Bool, ::Int64, ::Array{Int64,1}, ::Bool, ::Symbol, ::Bool, ::Bool, ::DataFrames.#readtable, ::IOStream, ::Int64) at /home/juser/.julia/v0.6/DataFrames/src/dataframe/io.jl:843
[2] (::DataFrames.#kw##readtable)(::Array{Any,1}, ::DataFrames.#readtable, ::IOStream, ::Int64) at ./<missing>:0
[3] #readtable#85(::Bool, ::Char, ::Array{Char,1}, ::Char, ::Array{String,1}, ::Array{String,1}, ::Array{String,1}, ::Bool, ::Int64, ::Array{String,1}, ::Array{Any,1}, ::Bool, ::Char, ::Bool, ::Int64, ::Array{Int64,1}, ::Bool, ::Symbol, ::Bool, ::Bool, ::DataFrames.#readtable, ::String) at /home/juser/.julia/v0.6/DataFrames/src/dataframe/io.jl:945
[4] (::DataFrames.#kw##readtable)(::Array{Any,1}, ::DataFrames.#readtable, ::String) at ./<missing>:0

From the documentation for readtable, it seems it expects a vector of symbols, not a vector of strings:
names::Vector{Symbol} – Use the values in this array as the names for all columns instead of or in lieu of the names in the file's header.
You can convert your vector of strings to a vector of symbols (assuming your strings are valid names) with a list comprehension, e.g.
labelSymbols = [Symbol(i) for i in label];
and pass this to your names parameter.
Disclaimer: I have not tested to see if this works as I don't have access to the mars.dat file. I'm just reading the docs and pointing out the most likely problem.

Related

Obtaining names of data frame in Julia

I am trying to simply extract the list of names of a dataframe columns in Julia, but I get this error message:
ERROR: MethodError: objects of type Array{String,1} are not callable
Use square brackets [] for indexing an Array.
I am simply doing a call names(df).
(It also complains about some IOerror).
Thanks.
Edit: Here is the (ridiculously long) error I get with the MWE suggested below:
julia> df = DataFrame(:a => [2,3,5])
3×1 DataFrame
¦ Row ¦ a ¦
¦ ¦ Int64 ¦
+-----+-------¦
¦ 1 ¦ 2 ¦
¦ 2 ¦ 3 ¦
¦ 3 ¦ 5 ¦
julia> names(df)
ERROR: MethodError: objects of type Array{String,1} are not callable
Use square brackets [] for indexing an Array.
Stacktrace:
[1] top-level scope at REPL[144]:1
caused by [exception 6]
IOError: symlink: operation not permitted (EPERM)
Stacktrace:
[1] uv_error at .\libuv.jl:97 [inlined]
[2] symlink(::String, ::String) at .\file.jl:851
[3] probe_symlink_creation(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\std
lib\v1.3\Pkg\src\PlatformEngines.jl:131
[4] #unpack#95(::Bool, ::typeof(Pkg.PlatformEngines.unpack), ::String, ::String) at D:\buildbot\wo
rker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\PlatformEngines.jl:727
[5] #unpack at .\logging.jl:0 [inlined]
[6] #download_verify_unpack#100(::Nothing, ::Bool, ::Bool, ::Bool, ::typeof(Pkg.PlatformEngines.do
wnload_verify_unpack), ::String, ::String, ::String) at D:\buildbot\worker\package_win64\build\usr\
share\julia\stdlib\v1.3\Pkg\src\PlatformEngines.jl:894
[7] #download_verify_unpack at .\none:0 [inlined]
[8] #download_artifact#38(::Bool, ::typeof(Pkg.Artifacts.download_artifact), ::Base.SHA1, ::String
, ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts
.jl:744
[9] #download_artifact at .\none:0 [inlined]
[10] #ensure_artifact_installed#42(::Pkg.BinaryPlatforms.Platform, ::Bool, ::typeof(Pkg.Artifacts.
ensure_artifact_installed), ::String, ::Dict{String,Any}, ::String) at D:\buildbot\worker\package_w
in64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:869
[11] (::Pkg.Artifacts.var"#kw##ensure_artifact_installed")(::NamedTuple{(:platform, :verbose),Tupl
e{Pkg.BinaryPlatforms.Windows,Bool}}, ::typeof(Pkg.Artifacts.ensure_artifact_installed), ::String,
::Dict{String,Any}, ::String) at .\none:0
[12] #ensure_all_artifacts_installed#43(::Pkg.BinaryPlatforms.Platform, ::Nothing, ::Bool, ::Bool,
::typeof(Pkg.Artifacts.ensure_all_artifacts_installed), ::String) at D:\buildbot\worker\package_wi
n64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:919
[13] #ensure_all_artifacts_installed at D:\buildbot\worker\package_win64\build\usr\share\julia\std
lib\v1.3\Pkg\src\Operations.jl:0 [inlined]
[14] #download_artifacts#78(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.downloa
d_artifacts), ::Array{String,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v
1.3\Pkg\src\Operations.jl:580
[15] #download_artifacts at .\none:0 [inlined]
[16] #download_artifacts#73(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.downloa
d_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share
\julia\stdlib\v1.3\Pkg\src\Operations.jl:570
[17] (::Pkg.Operations.var"#kw##download_artifacts")(::NamedTuple{(:platform,),Tuple{Pkg.BinaryPla
tforms.Windows}}, ::typeof(Pkg.Operations.download_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at
.\none:0
[18] #add#112(::Bool, ::Pkg.BinaryPlatforms.Windows, ::typeof(Pkg.Operations.add), ::Pkg.Types.Con
text, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}) at D:\buildbot\worker\package_win64\b
uild\usr\share\julia\stdlib\v1.3\Pkg\src\Operations.jl:1017
[19] #add at .\none:0 [inlined]
[20] #add#25(::Bool, ::Pkg.BinaryPlatforms.Windows, ::Base.Iterators.Pairs{Union{},Union{},Tuple{}
,NamedTuple{,Tuple{}}}, ::typeof(Pkg.API.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1
}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:102
[21] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win6
4\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:72
[22] #add#24 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:
69 [inlined]
[23] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:69 [
inlined]
[24] #add#21 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:
67 [inlined]
[25] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:67 [
inlined]
[26] #add#20(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}, ::typeof(Pkg.AP
I.add), ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API
.jl:66
[27] add(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\A
PI.jl:66
[28] top-level scope at REPL[65]:1
caused by [exception 5]
IOError: symlink: operation not permitted (EPERM)
Stacktrace:
[1] uv_error at .\libuv.jl:97 [inlined]
[2] symlink(::String, ::String) at .\file.jl:851
[3] probe_symlink_creation(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\std
lib\v1.3\Pkg\src\PlatformEngines.jl:131
[4] #unpack#95(::Bool, ::typeof(Pkg.PlatformEngines.unpack), ::String, ::String) at D:\buildbot\wo
rker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\PlatformEngines.jl:727
[5] #unpack at .\logging.jl:0 [inlined]
[6] #download_verify_unpack#100(::Nothing, ::Bool, ::Bool, ::Bool, ::typeof(Pkg.PlatformEngines.do
wnload_verify_unpack), ::String, ::String, ::String) at D:\buildbot\worker\package_win64\build\usr\
share\julia\stdlib\v1.3\Pkg\src\PlatformEngines.jl:894
[7] #download_verify_unpack at .\none:0 [inlined]
[8] #download_artifact#38(::Bool, ::typeof(Pkg.Artifacts.download_artifact), ::Base.SHA1, ::String
, ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts
.jl:744
[9] #download_artifact at .\none:0 [inlined]
[10] #ensure_artifact_installed#42(::Pkg.BinaryPlatforms.Platform, ::Bool, ::typeof(Pkg.Artifacts.
ensure_artifact_installed), ::String, ::Dict{String,Any}, ::String) at D:\buildbot\worker\package_w
in64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:869
[11] (::Pkg.Artifacts.var"#kw##ensure_artifact_installed")(::NamedTuple{(:platform, :verbose),Tupl
e{Pkg.BinaryPlatforms.Windows,Bool}}, ::typeof(Pkg.Artifacts.ensure_artifact_installed), ::String,
::Dict{String,Any}, ::String) at .\none:0
[12] #ensure_all_artifacts_installed#43(::Pkg.BinaryPlatforms.Platform, ::Nothing, ::Bool, ::Bool,
::typeof(Pkg.Artifacts.ensure_all_artifacts_installed), ::String) at D:\buildbot\worker\package_wi
n64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:919
[13] #ensure_all_artifacts_installed at D:\buildbot\worker\package_win64\build\usr\share\julia\std
lib\v1.3\Pkg\src\Operations.jl:0 [inlined]
[14] #download_artifacts#78(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.downloa
d_artifacts), ::Array{String,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v
1.3\Pkg\src\Operations.jl:580
[15] #download_artifacts at .\none:0 [inlined]
[16] #download_artifacts#73(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.downloa
d_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share
\julia\stdlib\v1.3\Pkg\src\Operations.jl:570
[17] (::Pkg.Operations.var"#kw##download_artifacts")(::NamedTuple{(:platform,),Tuple{Pkg.BinaryPla
tforms.Windows}}, ::typeof(Pkg.Operations.download_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at
.\none:0
[18] #add#112(::Bool, ::Pkg.BinaryPlatforms.Windows, ::typeof(Pkg.Operations.add), ::Pkg.Types.Con
text, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}) at D:\buildbot\worker\package_win64\b
uild\usr\share\julia\stdlib\v1.3\Pkg\src\Operations.jl:1017
[19] #add at .\none:0 [inlined]
[20] #add#25(::Bool, ::Pkg.BinaryPlatforms.Windows, ::Base.Iterators.Pairs{Union{},Union{},Tuple{}
,NamedTuple{,Tuple{}}}, ::typeof(Pkg.API.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1
}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:102
[21] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win6
4\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:72
[22] #add#24 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:
69 [inlined]
[23] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:69 [
inlined]
[24] #add#21 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:
67 [inlined]
[25] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:67 [
inlined]
[26] #add#20(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}, ::typeof(Pkg.AP
I.add), ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API
.jl:66
[27] add(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\A
PI.jl:66
[28] top-level scope at REPL[65]:1
caused by [exception 4]
IOError: symlink: operation not permitted (EPERM)
Stacktrace:
[1] uv_error at .\libuv.jl:97 [inlined]
[2] symlink(::String, ::String) at .\file.jl:851
[3] probe_symlink_creation(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\std
lib\v1.3\Pkg\src\PlatformEngines.jl:131
[4] #unpack#95(::Bool, ::typeof(Pkg.PlatformEngines.unpack), ::String, ::String) at D:\buildbot\wo
rker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\PlatformEngines.jl:727
[5] #unpack at .\logging.jl:0 [inlined]
[6] #download_verify_unpack#100(::Nothing, ::Bool, ::Bool, ::Bool, ::typeof(Pkg.PlatformEngines.do
wnload_verify_unpack), ::String, ::String, ::String) at D:\buildbot\worker\package_win64\build\usr\
share\julia\stdlib\v1.3\Pkg\src\PlatformEngines.jl:894
[7] #download_verify_unpack at .\none:0 [inlined]
[8] #download_artifact#38(::Bool, ::typeof(Pkg.Artifacts.download_artifact), ::Base.SHA1, ::String
, ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts
.jl:744
[9] #download_artifact at .\none:0 [inlined]
[10] #ensure_artifact_installed#42(::Pkg.BinaryPlatforms.Platform, ::Bool, ::typeof(Pkg.Artifacts.
ensure_artifact_installed), ::String, ::Dict{String,Any}, ::String) at D:\buildbot\worker\package_w
in64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:869
[11] (::Pkg.Artifacts.var"#kw##ensure_artifact_installed")(::NamedTuple{(:platform, :verbose),Tupl
e{Pkg.BinaryPlatforms.Windows,Bool}}, ::typeof(Pkg.Artifacts.ensure_artifact_installed), ::String,
::Dict{String,Any}, ::String) at .\none:0
[12] #ensure_all_artifacts_installed#43(::Pkg.BinaryPlatforms.Platform, ::Nothing, ::Bool, ::Bool,
::typeof(Pkg.Artifacts.ensure_all_artifacts_installed), ::String) at D:\buildbot\worker\package_wi
n64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:919
[13] #ensure_all_artifacts_installed at D:\buildbot\worker\package_win64\build\usr\share\julia\std
lib\v1.3\Pkg\src\Operations.jl:0 [inlined]
[14] #download_artifacts#78(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.downloa
d_artifacts), ::Array{String,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v
1.3\Pkg\src\Operations.jl:580
[15] #download_artifacts at .\none:0 [inlined]
[16] #download_artifacts#73(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.downloa
d_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share
\julia\stdlib\v1.3\Pkg\src\Operations.jl:570
[17] (::Pkg.Operations.var"#kw##download_artifacts")(::NamedTuple{(:platform,),Tuple{Pkg.BinaryPla
tforms.Windows}}, ::typeof(Pkg.Operations.download_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at
.\none:0
[18] #add#112(::Bool, ::Pkg.BinaryPlatforms.Windows, ::typeof(Pkg.Operations.add), ::Pkg.Types.Con
text, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}) at D:\buildbot\worker\package_win64\b
uild\usr\share\julia\stdlib\v1.3\Pkg\src\Operations.jl:1017
[19] #add at .\none:0 [inlined]
[20] #add#25(::Bool, ::Pkg.BinaryPlatforms.Windows, ::Base.Iterators.Pairs{Union{},Union{},Tuple{}
,NamedTuple{,Tuple{}}}, ::typeof(Pkg.API.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1
}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:102
[21] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win6
4\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:72
[22] #add#24 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:
69 [inlined]
[23] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:69 [
inlined]
[24] #add#21 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:
67 [inlined]
[25] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:67 [
inlined]
[26] #add#20(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}, ::typeof(Pkg.AP
I.add), ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API
.jl:66
[27] add(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\A
PI.jl:66
[28] top-level scope at REPL[65]:1
caused by [exception 3]
IOError: symlink: operation not permitted (EPERM)
Stacktrace:
[1] uv_error at .\libuv.jl:97 [inlined]
[2] symlink(::String, ::String) at .\file.jl:851
[3] probe_symlink_creation(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\std
lib\v1.3\Pkg\src\PlatformEngines.jl:131
[4] #unpack#95(::Bool, ::typeof(Pkg.PlatformEngines.unpack), ::String, ::String) at D:\buildbot\wo
rker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\PlatformEngines.jl:727
[5] #unpack at .\logging.jl:0 [inlined]
[6] #download_verify_unpack#100(::Nothing, ::Bool, ::Bool, ::Bool, ::typeof(Pkg.PlatformEngines.do
wnload_verify_unpack), ::String, ::String, ::String) at D:\buildbot\worker\package_win64\build\usr\
share\julia\stdlib\v1.3\Pkg\src\PlatformEngines.jl:894
[7] #download_verify_unpack at .\none:0 [inlined]
[8] #download_artifact#38(::Bool, ::typeof(Pkg.Artifacts.download_artifact), ::Base.SHA1, ::String
, ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts
.jl:744
[9] #download_artifact at .\none:0 [inlined]
[10] #ensure_artifact_installed#42(::Pkg.BinaryPlatforms.Platform, ::Bool, ::typeof(Pkg.Artifacts.
ensure_artifact_installed), ::String, ::Dict{String,Any}, ::String) at D:\buildbot\worker\package_w
in64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:869
[11] (::Pkg.Artifacts.var"#kw##ensure_artifact_installed")(::NamedTuple{(:platform, :verbose),Tupl
e{Pkg.BinaryPlatforms.Windows,Bool}}, ::typeof(Pkg.Artifacts.ensure_artifact_installed), ::String,
::Dict{String,Any}, ::String) at .\none:0
[12] #ensure_all_artifacts_installed#43(::Pkg.BinaryPlatforms.Platform, ::Nothing, ::Bool, ::Bool,
::typeof(Pkg.Artifacts.ensure_all_artifacts_installed), ::String) at D:\buildbot\worker\package_wi
n64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:919
[13] #ensure_all_artifacts_installed at D:\buildbot\worker\package_win64\build\usr\share\julia\std
lib\v1.3\Pkg\src\Operations.jl:0 [inlined]
[14] #download_artifacts#78(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.downloa
d_artifacts), ::Array{String,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v
1.3\Pkg\src\Operations.jl:580
[15] #download_artifacts at .\none:0 [inlined]
[16] #download_artifacts#73(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.downloa
d_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share
\julia\stdlib\v1.3\Pkg\src\Operations.jl:570
[17] (::Pkg.Operations.var"#kw##download_artifacts")(::NamedTuple{(:platform,),Tuple{Pkg.BinaryPla
tforms.Windows}}, ::typeof(Pkg.Operations.download_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at
.\none:0
[18] #add#112(::Bool, ::Pkg.BinaryPlatforms.Windows, ::typeof(Pkg.Operations.add), ::Pkg.Types.Con
text, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}) at D:\buildbot\worker\package_win64\b
uild\usr\share\julia\stdlib\v1.3\Pkg\src\Operations.jl:1017
[19] #add at .\none:0 [inlined]
[20] #add#25(::Bool, ::Pkg.BinaryPlatforms.Windows, ::Base.Iterators.Pairs{Union{},Union{},Tuple{}
,NamedTuple{,Tuple{}}}, ::typeof(Pkg.API.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1
}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:102
[21] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win6
4\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:72
[22] #add#24 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:
69 [inlined]
[23] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:69 [
inlined]
[24] #add#21 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:
67 [inlined]
[25] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:67 [
inlined]
[26] #add#20(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}, ::typeof(Pkg.AP
I.add), ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API
.jl:66
[27] add(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\A
PI.jl:66
[28] top-level scope at REPL[20]:1
caused by [exception 2]
IOError: symlink: operation not permitted (EPERM)
Stacktrace:
[1] uv_error at .\libuv.jl:97 [inlined]
[2] symlink(::String, ::String) at .\file.jl:851
[3] probe_symlink_creation(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\std
lib\v1.3\Pkg\src\PlatformEngines.jl:131
[4] #unpack#95(::Bool, ::typeof(Pkg.PlatformEngines.unpack), ::String, ::String) at D:\buildbot\wo
rker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\PlatformEngines.jl:727
[5] #unpack at .\logging.jl:0 [inlined]
[6] #download_verify_unpack#100(::Nothing, ::Bool, ::Bool, ::Bool, ::typeof(Pkg.PlatformEngines.do
wnload_verify_unpack), ::String, ::String, ::String) at D:\buildbot\worker\package_win64\build\usr\
share\julia\stdlib\v1.3\Pkg\src\PlatformEngines.jl:894
[7] #download_verify_unpack at .\none:0 [inlined]
[8] #download_artifact#38(::Bool, ::typeof(Pkg.Artifacts.download_artifact), ::Base.SHA1, ::String
, ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts
.jl:744
[9] #download_artifact at .\none:0 [inlined]
[10] #ensure_artifact_installed#42(::Pkg.BinaryPlatforms.Platform, ::Bool, ::typeof(Pkg.Artifacts.
ensure_artifact_installed), ::String, ::Dict{String,Any}, ::String) at D:\buildbot\worker\package_w
in64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:869
[11] (::Pkg.Artifacts.var"#kw##ensure_artifact_installed")(::NamedTuple{(:platform, :verbose),Tupl
e{Pkg.BinaryPlatforms.Windows,Bool}}, ::typeof(Pkg.Artifacts.ensure_artifact_installed), ::String,
::Dict{String,Any}, ::String) at .\none:0
[12] #ensure_all_artifacts_installed#43(::Pkg.BinaryPlatforms.Platform, ::Nothing, ::Bool, ::Bool,
::typeof(Pkg.Artifacts.ensure_all_artifacts_installed), ::String) at D:\buildbot\worker\package_wi
n64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:919
[13] #ensure_all_artifacts_installed at D:\buildbot\worker\package_win64\build\usr\share\julia\std
lib\v1.3\Pkg\src\Operations.jl:0 [inlined]
[14] #download_artifacts#78(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.downloa
d_artifacts), ::Array{String,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v
1.3\Pkg\src\Operations.jl:580
[15] #download_artifacts at .\none:0 [inlined]
[16] #download_artifacts#73(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.downloa
d_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share
\julia\stdlib\v1.3\Pkg\src\Operations.jl:570
[17] (::Pkg.Operations.var"#kw##download_artifacts")(::NamedTuple{(:platform,),Tuple{Pkg.BinaryPla
tforms.Windows}}, ::typeof(Pkg.Operations.download_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at
.\none:0
[18] #add#112(::Bool, ::Pkg.BinaryPlatforms.Windows, ::typeof(Pkg.Operations.add), ::Pkg.Types.Con
text, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}) at D:\buildbot\worker\package_win64\b
uild\usr\share\julia\stdlib\v1.3\Pkg\src\Operations.jl:1017
[19] #add at .\none:0 [inlined]
[20] #add#25(::Bool, ::Pkg.BinaryPlatforms.Windows, ::Base.Iterators.Pairs{Union{},Union{},Tuple{}
,NamedTuple{,Tuple{}}}, ::typeof(Pkg.API.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1
}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:102
[21] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win6
4\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:72
[22] #add#24 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:
69 [inlined]
[23] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:69 [
inlined]
[24] #add#21 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:
67 [inlined]
[25] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:67 [
inlined]
[26] #add#20(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}, ::typeof(Pkg.AP
I.add), ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API
.jl:66
[27] add(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\A
PI.jl:66
[28] top-level scope at REPL[20]:1
caused by [exception 1]
IOError: symlink: operation not permitted (EPERM)
Stacktrace:
[1] uv_error at .\libuv.jl:97 [inlined]
[2] symlink(::String, ::String) at .\file.jl:851
[3] probe_symlink_creation(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\std
lib\v1.3\Pkg\src\PlatformEngines.jl:131
[4] #unpack#95(::Bool, ::typeof(Pkg.PlatformEngines.unpack), ::String, ::String) at D:\buildbot\wo
rker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\PlatformEngines.jl:727
[5] #unpack at .\logging.jl:0 [inlined]
[6] #download_verify_unpack#100(::Nothing, ::Bool, ::Bool, ::Bool, ::typeof(Pkg.PlatformEngines.do
wnload_verify_unpack), ::String, ::String, ::String) at D:\buildbot\worker\package_win64\build\usr\
share\julia\stdlib\v1.3\Pkg\src\PlatformEngines.jl:894
[7] #download_verify_unpack at .\none:0 [inlined]
[8] #download_artifact#38(::Bool, ::typeof(Pkg.Artifacts.download_artifact), ::Base.SHA1, ::String
, ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts
.jl:744
[9] #download_artifact at .\none:0 [inlined]
[10] #ensure_artifact_installed#42(::Pkg.BinaryPlatforms.Platform, ::Bool, ::typeof(Pkg.Artifacts.
ensure_artifact_installed), ::String, ::Dict{String,Any}, ::String) at D:\buildbot\worker\package_w
in64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:869
[11] (::Pkg.Artifacts.var"#kw##ensure_artifact_installed")(::NamedTuple{(:platform, :verbose),Tupl
e{Pkg.BinaryPlatforms.Windows,Bool}}, ::typeof(Pkg.Artifacts.ensure_artifact_installed), ::String,
::Dict{String,Any}, ::String) at .\none:0
[12] #ensure_all_artifacts_installed#43(::Pkg.BinaryPlatforms.Platform, ::Nothing, ::Bool, ::Bool,
::typeof(Pkg.Artifacts.ensure_all_artifacts_installed), ::String) at D:\buildbot\worker\package_wi
n64\build\usr\share\julia\stdlib\v1.3\Pkg\src\Artifacts.jl:919
[13] #ensure_all_artifacts_installed at D:\buildbot\worker\package_win64\build\usr\share\julia\std
lib\v1.3\Pkg\src\Operations.jl:0 [inlined]
[14] #download_artifacts#78(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.downloa
d_artifacts), ::Array{String,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v
1.3\Pkg\src\Operations.jl:580
[15] #download_artifacts at .\none:0 [inlined]
[16] #download_artifacts#73(::Pkg.BinaryPlatforms.Windows, ::Bool, ::typeof(Pkg.Operations.downloa
d_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share
\julia\stdlib\v1.3\Pkg\src\Operations.jl:570
[17] (::Pkg.Operations.var"#kw##download_artifacts")(::NamedTuple{(:platform,),Tuple{Pkg.BinaryPla
tforms.Windows}}, ::typeof(Pkg.Operations.download_artifacts), ::Array{Pkg.Types.PackageSpec,1}) at
.\none:0
[18] #add#112(::Bool, ::Pkg.BinaryPlatforms.Windows, ::typeof(Pkg.Operations.add), ::Pkg.Types.Con
text, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}) at D:\buildbot\worker\package_win64\b
uild\usr\share\julia\stdlib\v1.3\Pkg\src\Operations.jl:1017
[19] #add at .\none:0 [inlined]
[20] #add#25(::Bool, ::Pkg.BinaryPlatforms.Windows, ::Base.Iterators.Pairs{Union{},Union{},Tuple{}
,NamedTuple{,Tuple{}}}, ::typeof(Pkg.API.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1
}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:102
[21] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win6
4\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:72
[22] #add#24 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:
69 [inlined]
[23] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:69 [
inlined]
[24] #add#21 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:
67 [inlined]
[25] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API.jl:67 [
inlined]
[26] #add#20(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}, ::typeof(Pkg.AP
I.add), ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\API
.jl:66
[27] add(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Pkg\src\A
PI.jl:66
[28] top-level scope at REPL[20]:1
You've assigned a variable (of type Vector{String}) called names in your workspace prior to using DataFrames (Julia will prevent you from doing it after). The error message just tells you that you're trying to use names as function, which it isn't in your workspace.
names(df) should work on a data frame:
julia> using DataFrames
julia> df = DataFrame(:a => [2, 3, 5])
3×1 DataFrame
│ Row │ a │
│ │ Int64 │
├─────┼───────┤
│ 1 │ 2 │
│ 2 │ 3 │
│ 3 │ 5 │
julia> names(df)
1-element Array{Symbol,1}:
:a
Can you show us your code and try println(df) as well?

PersistenceQuery and Akka-Http zombie stream

Im atempting to stream the PersistenceQuery result with akka-http as SSE but it seems like when the http connection is closed from the client the PersistenceQuery stream is still hitting the event backend periodically.
// Http part
complete {
source(id)
.map(e => e.event) // other transformations
.map(e => ServerSentEvent(m.toString))
.keepAlive(4 seconds, () => ServerSentEvent.heartbeat)
}
// source
def source(id: UUID)(implicit system: ActorSystem, materializer: ActorMaterializer)= {
import system.dispatcher
val journalQuery = PersistenceQuery(system).readJournalFor[CassandraReadJournal](CassandraReadJournal.Identifier)
val futureSrcGraph: RunnableGraph[Future[Source[EventEnvelope, NotUsed]]] =
journalQuery.currentEventsByPersistenceId(id.toString, 0, Long.MaxValue)
.map(_.sequenceNr)
.toMat(Sink.last)(Keep.right)
.mapMaterializedValue(fs => fs.recoverWith {
case _ => Future { 0L } // assume we start at 1
}.map(s => journalQuery.eventsByPersistenceId(id.toString, s + 1, Long.MaxValue)))
Source.fromFutureSource(futureSrcGraph.run())
So this basically works the only problem is that the stream is never finished or so it seems. I have tried it with both CassandraReadJournal and LevelDb
Example of the log output:
[DEBUG] [06/18/2018 10:52:16.774] [sys-cassandra-plugin-default-dispatcher-17] [EventsByPersistenceIdStage(akka://sys)] EventsByPersistenceId [c6031a8a-db71-4dcb-9d4f-f140faa2f4c4] Query from seqNr [6] in partition [0]
[DEBUG] [06/18/2018 10:52:16.790] [sys-cassandra-plugin-default-dispatcher-17] [EventsByPersistenceIdStage(akka://sys)] EventsByPersistenceId [c6031a8a-db71-4dcb-9d4f-f140faa2f4c4] Query took [15] ms (empty)
[DEBUG] [06/18/2018 10:52:16.790] [sys-cassandra-plugin-default-dispatcher-17] [EventsByPersistenceIdStage(akka://sys)] EventsByPersistenceId [c6031a8a-db71-4dcb-9d4f-f140faa2f4c4] Query from seqNr [6] in partition [1]
[DEBUG] [06/18/2018 10:52:16.796] [sys-cassandra-plugin-default-dispatcher-17] [EventsByPersistenceIdStage(akka://sys)] EventsByPersistenceId [c6031a8a-db71-4dcb-9d4f-f140faa2f4c4] Query took [5] ms (empty)
[DEBUG] [06/18/2018 10:52:19.768] [sys-cassandra-plugin-default-dispatcher-17] [EventsByPersistenceIdStage(akka://sys)] EventsByPersistenceId [c6031a8a-db71-4dcb-9d4f-f140faa2f4c4] Query from seqNr [6] in partition [0]
[DEBUG] [06/18/2018 10:52:19.784] [sys-cassandra-plugin-default-dispatcher-17] [EventsByPersistenceIdStage(akka://sys)] EventsByPersistenceId [c6031a8a-db71-4dcb-9d4f-f140faa2f4c4] Query took [15] ms (empty)
[DEBUG] [06/18/2018 10:52:19.784] [sys-cassandra-plugin-default-dispatcher-17] [EventsByPersistenceIdStage(akka://sys)] EventsByPersistenceId [c6031a8a-db71-4dcb-9d4f-f140faa2f4c4] Query from seqNr [6] in partition [1]
[DEBUG] [06/18/2018 10:52:19.790] [sys-cassandra-plugin-default-dispatcher-17] [EventsByPersistenceIdStage(akka://sys)] EventsByPersistenceId [c6031a8a-db71-4dcb-9d4f-f140faa2f4c4] Query took [6] ms (empty)
[DEBUG] [06/18/2018 10:52:22.765] [sys-cassandra-plugin-default-dispatcher-17] [EventsByPersistenceIdStage(akka://sys)] EventsByPersistenceId [c6031a8a-db71-4dcb-9d4f-f140faa2f4c4] Query from seqNr [6] in partition [0]
[DEBUG] [06/18/2018 10:52:22.772] [sys-cassandra-plugin-default-dispatcher-17] [EventsByPersistenceIdStage(akka://sys)] EventsByPersistenceId [c6031a8a-db71-4dcb-9d4f-f140faa2f4c4] Query took [6] ms (empty)
[DEBUG] [06/18/2018 10:52:22.772] [sys-cassandra-plugin-default-dispatcher-17] [EventsByPersistenceIdStage(akka://sys)] EventsByPersistenceId [c6031a8a-db71-4dcb-9d4f-f140faa2f4c4] Query from seqNr [6] in partition [1]
[DEBUG] [06/18/2018 10:52:22.790] [sys-cassandra-plugin-default-dispatcher-17] [EventsByPersistenceIdStage(akka://sys)] EventsByPersistenceId [c6031a8a-db71-4dcb-9d4f-f140faa2f4c4] Query took [17] ms (empty)
And it keeps going for ever.
I have also tried omitting the Source.fromFutureSource and just running journalQuery.eventsByPersistenceId with the same results.
What am I doing wrong?
The here were that my corporat proxy never drops the connection to the server even when the client closes the connection.

Transform the output of an SqlQuery to numeric

I have got a Sql table and connected to it using R with odbcConnect(). The data I used is to find here: http://robjhyndman.com/tsdldata/data/nybirths.dat
I loaded a Query with
bstring <- sqlQuery(dbcon, "SELECT maptostring(__raw__) FROM births")
where dbcon is the connection to my database. The returned data is the following String:
bstring
$maptostring
[1] {\n "26.663;23.598;26.931;24.74;25.806" : "24.364;24.477;23.901;23.175;23.227"\n}\n
[2] {\n "26.663;23.598;26.931;24.74;25.806" : "21.672;21.87;21.439;21.089;23.709"\n}\n
[3] {\n "26.663;23.598;26.931;24.74;25.806" : "21.669;21.752;20.761;23.479;23.824"\n}\n
[4] {\n "26.663;23.598;26.931;24.74;25.806" : "23.105;23.11;21.759;22.073;21.937"\n}\n
[5] {\n "26.663;23.598;26.931;24.74;25.806" : "20.035;23.59;21.672;22.222;22.123"\n}\n
[6] {\n "26.663;23.598;26.931;24.74;25.806" : "23.95;23.504;22.238;23.142;21.059"\n}\n
[7] {\n "26.663;23.598;26.931;24.74;25.806" : "21.573;21.548;20;22.424;20.615"\n}\n
[8] {\n "26.663;23.598;26.931;24.74;25.806" : "21.761;22.874;24.104;23.748;23.262"\n}\n
[9] {\n "26.663;23.598;26.931;24.74;25.806" : "22.907;21.519;22.025;22.604;20.894"\n}\n
[10] {\n "26.663;23.598;26.931;24.74;25.806" : "24.677;23.673;25.32;23.583;24.671"\n}\n
[11] {\n "26.663;23.598;26.931;24.74;25.806" : "24.454;24.122;24.252;22.084;22.991"\n}\n
[12] {\n "26.663;23.598;26.931;24.74;25.806" : "23.287;23.049;25.076;24.037;24.43"\n}\n
[13] {\n "26.663;23.598;26.931;24.74;25.806" : "24.667;26.451;25.618;25.014;25.11"\n}\n
[14] {\n "26.663;23.598;26.931;24.74;25.806" : "22.964;23.981;23.798;22.27;24.775"\n}\n
[15] {\n "26.663;23.598;26.931;24.74;25.806" : "22.646;23.988;24.737;26.276;25.816"\n}\n
[16] {\n "26.663;23.598;26.931;24.74;25.806" : "25.21;25.199;23.162;24.707;24.364"\n}\n
[17]{\n "26.663;23.598;26.931;24.74;25.806" : "22.644;25.565;24.062;25.431;24.635"\n}\n
[18] {\n "26.663;23.598;26.931;24.74;25.806" : "27.009;26.606;26.268;26.462;25.246"\n}\n
[19] {\n "26.663;23.598;26.931;24.74;25.806" : "25.18;24.657;23.304;26.982;26.199"\n}\n
[20] {\n "26.663;23.598;26.931;24.74;25.806" : "27.21;26.122;26.706;26.878;26.152"\n}\n
[21] {\n "26.663;23.598;26.931;24.74;25.806" : "26.379;24.712;25.688;24.99;24.239"\n}\n
[22] {\n "26.663;23.598;26.931;24.74;25.806" : "26.721;23.475;24.767;26.219;28.361"\n}\n
[23] {\n "26.663;23.598;26.931;24.74;25.806" : "28.599;27.914;27.784;25.693;26.881"\n}\n
[24] {\n "26.663;23.598;26.931;24.74;25.806" : "26.217;24.218;27.914;26.975;28.527"\n}\n
[25] {\n "26.663;23.598;26.931;24.74;25.806" : "27.139;28.982;28.169;28.056;29.136"\n}\n
[26] {\n "26.663;23.598;26.931;24.74;25.806" : "26.291;26.987;26.589;24.848;27.543"\n}\n
[27] {\n "26.663;23.598;26.931;24.74;25.806" : "26.896;28.878;27.39;28.065;28.141"\n}\n
[28] {\n "26.663;23.598;26.931;24.74;25.806" : "29.048;28.484;26.634;27.735;27.132"\n}\n
[29] {\n "26.663;23.598;26.931;24.74;25.806" : "24.924;28.963;26.589;27.931;28.009"\n}\n
[30] {\n "26.663;23.598;26.931;24.74;25.806" : "29.229;28.759;28.405;27.945;25.912"\n}\n
[31] {\n "26.663;23.598;26.931;24.74;25.806" : "26.619;26.076;25.286;27.66;25.951"\n}\n
[32] {\n "26.663;23.598;26.931;24.74;25.806" : "26.398;25.565;28.865;30;29.261"\n}\n
[33] {\n "26.663;23.598;26.931;24.74;25.806" : "29.012;26.992;27.897"\n}\n
[34] {\n "26.663;23.598;26.931;24.74;25.806" : "24.364;24.477;23.901;23.175;23.227"\n}\n
[35] {\n "26.663;23.598;26.931;24.74;25.806" : "21.672;21.87;21.439;21.089;23.709"\n}\n
[36] {\n "26.663;23.598;26.931;24.74;25.806" : "21.669;21.752;20.761;23.479;23.824"\n}\n
[37] {\n "26.663;23.598;26.931;24.74;25.806" : "23.105;23.11;21.759;22.073;21.937"\n}\n
[38] {\n "26.663;23.598;26.931;24.74;25.806" : "20.035;23.59;21.672;22.222;22.123"\n}\n
[39] {\n "26.663;23.598;26.931;24.74;25.806" : "23.95;23.504;22.238;23.142;21.059"\n}\n
[40] {\n "26.663;23.598;26.931;24.74;25.806" : "21.573;21.548;20;22.424;20.615"\n}\n
[41] {\n "26.663;23.598;26.931;24.74;25.806" : "21.761;22.874;24.104;23.748;23.262"\n}\n
[42] {\n "26.663;23.598;26.931;24.74;25.806" : "22.907;21.519;22.025;22.604;20.894"\n}\n
[43] {\n "26.663;23.598;26.931;24.74;25.806" : "24.677;23.673;25.32;23.583;24.671"\n}\n
[44] {\n "26.663;23.598;26.931;24.74;25.806" : "24.454;24.122;24.252;22.084;22.991"\n}\n
[45] {\n "26.663;23.598;26.931;24.74;25.806" : "23.287;23.049;25.076;24.037;24.43"\n}\n
[46] {\n "26.663;23.598;26.931;24.74;25.806" : "24.667;26.451;25.618;25.014;25.11"\n}\n
[47] {\n "26.663;23.598;26.931;24.74;25.806" : "22.964;23.981;23.798;22.27;24.775"\n}\n
[48] {\n "26.663;23.598;26.931;24.74;25.806" : "22.646;23.988;24.737;26.276;25.816"\n}\n
[49] {\n "26.663;23.598;26.931;24.74;25.806" : "25.21;25.199;23.162;24.707;24.364"\n}\n
[50] {\n "26.663;23.598;26.931;24.74;25.806" : "22.644;25.565;24.062;25.431;24.635"\n}\n
[51] {\n "26.663;23.598;26.931;24.74;25.806" : "27.009;26.606;26.268;26.462;25.246"\n}\n
[52] {\n "26.663;23.598;26.931;24.74;25.806" : "25.18;24.657;23.304;26.982;26.199"\n}\n
[53] {\n "26.663;23.598;26.931;24.74;25.806" : "27.21;26.122;26.706;26.878;26.152"\n}\n
[54] {\n "26.663;23.598;26.931;24.74;25.806" : "26.379;24.712;25.688;24.99;24.239"\n}\n
[55] {\n "26.663;23.598;26.931;24.74;25.806" : "26.721;23.475;24.767;26.219;28.361"\n}\n
[56] {\n "26.663;23.598;26.931;24.74;25.806" : "28.599;27.914;27.784;25.693;26.881"\n}\n
[57] {\n "26.663;23.598;26.931;24.74;25.806" : "26.217;24.218;27.914;26.975;28.527"\n}\n
[58] {\n "26.663;23.598;26.931;24.74;25.806" : "27.139;28.982;28.169;28.056;29.136"\n}\n
[59] {\n "26.663;23.598;26.931;24.74;25.806" : "26.291;26.987;26.589;24.848;27.543"\n}\n
[60] {\n "26.663;23.598;26.931;24.74;25.806" : "26.896;28.878;27.39;28.065;28.141"\n}\n
[61] {\n "26.663;23.598;26.931;24.74;25.806" : "29.048;28.484;26.634;27.735;27.132"\n}\n
[62] {\n "26.663;23.598;26.931;24.74;25.806" : "24.924;28.963;26.589;27.931;28.009"\n}\n
[63] {\n "26.663;23.598;26.931;24.74;25.806" : "29.229;28.759;28.405;27.945;25.912"\n}\n
[64] {\n "26.663;23.598;26.931;24.74;25.806" : "26.619;26.076;25.286;27.66;25.951"\n}\n
[65] {\n "26.663;23.598;26.931;24.74;25.806" : "26.398;25.565;28.865;30;29.261"\n}\n
[66] {\n "26.663;23.598;26.931;24.74;25.806" : "29.012;26.992;27.897"\n}\n
33 Levels: {\n "26.663;23.598;26.931;24.74;25.806" : "20.035;23.59;21.672;22.222;22.123"\n}\n ...
I want to use ARIMA to create a forecast using this data. To do so I tried to parse this data into numeric using
bnumeric <- as.numeric(unlist(bstring))
This did not work well, I got a pretty useless vector of numbers. How can I extract the numbers from this data to create a forecast?

object->ref_count > 0 Assertion failures when using webkitgtk

I'm experimenting with an app that creates a tray menu. One of the tray menu items creates a window that connects to a login service. However, I'm getting assertion failures despite the fact that it otherwise appears to work. I must be doing something simple that is wrong, but what?
The below program demonstrates the problem.
test.cpp
#include <gtk/gtk.h>
#include <webkit/webkit.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
GtkWidget * web_window = NULL;
WebKitWebView * web_view = NULL;
gtk_init(0L, 0L);
if (web_window = gtk_window_new(GTK_WINDOW_TOPLEVEL)){
//g_object_ref(G_OBJECT(web_window));
gtk_window_set_default_size(GTK_WINDOW(web_window), 800, 600);
g_signal_connect(web_window, "delete_event", G_CALLBACK(gtk_widget_hide_on_delete), NULL);
if (web_view = WEBKIT_WEB_VIEW(webkit_web_view_new())){
//g_object_ref(G_OBJECT(web_view));
gtk_window_set_title(GTK_WINDOW(web_window), "Web View Test");
gtk_container_add(GTK_CONTAINER(web_window), GTK_WIDGET(web_view));
webkit_web_view_load_uri(web_view, "http://www.google.com/");
gtk_widget_grab_focus(GTK_WIDGET(web_view));
gtk_widget_show_all(web_window);
gtk_window_present(GTK_WINDOW(web_window));
gtk_main();
}
else
printf("Failed to create WebView\n");
}
return 0;
}
Compiled with:
g++ test.cpp $(pkg-config --cflags --libs webkitgtk-3.0) $(pkg-config --cflags --libs gtk+-3.0)
After the window is opened and the URL is loaded I see these assertion failures:
(a.out:20179): GLib-GObject-CRITICAL **: g_object_ref: assertion 'object->ref_count > 0' failed
(a.out:20179): GLib-GObject-CRITICAL **: g_object_unref: assertion 'object->ref_count > 0' failed
When I then click the close button (which should hide the window) I then see these assertion failures:
(a.out:20179): GLib-GObject-CRITICAL **: g_object_ref: assertion 'object->ref_count > 0' failed
(a.out:20179): GLib-GObject-CRITICAL **: g_object_unref: assertion 'object->ref_count > 0' failed
As you can see I tried adding ref counts to the web_window and web_view to see if that was where the problem is, but it made no difference.
Turning on G_DEBUG=fatal-warnings produced a core dump which I backtraced with gdb below.
Program terminated with signal SIGTRAP, Trace/breakpoint trap.
#0 0x00007fdd04662c13 in g_logv () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
(gdb) bt
#0 0x00007fdd04662c13 in g_logv () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1 0x00007fdd04662d72 in g_log () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007fdd090c9aea in g_object_ref ()
from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#3 0x00007fdd090de05f in g_signal_emit_valist ()
from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#4 0x00007fdd090dece2 in g_signal_emit ()
from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#5 0x00007fdd095345e6 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#6 0x00007fdd0953609a in gtk_style_context_invalidate ()
from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#7 0x00007fdd09537e4c in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#8 0x00007fdd090c9dba in g_object_unref ()
from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#9 0x00007fdd08440133 in derefGPtr<_GtkStyleContext> (ptr=<optimized out>)
at ../Source/WTF/wtf/gobject/GRefPtr.h:235
#10 ~GRefPtr (this=0x7ffd0e22c3d0, __in_chrg=<optimized out>)
at ../Source/WTF/wtf/gobject/GRefPtr.h:70
#11 WebCore::styleColor (themePart=themePart#entry=WebCore::Entry,
state=state#entry=(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_FOCUSED),
colorType=colorType#entry=WebCore::StyleColorForeground)
at ../Source/WebCore/platform/gtk/RenderThemeGtk3.cpp:1098
#12 0x00007fdd084401f5 in WebCore::RenderThemeGtk::platformActiveSelectionForegr---Type <return> to continue, or q <return> to quit---
oundColor (this=<optimized out>)
at ../Source/WebCore/platform/gtk/RenderThemeGtk3.cpp:1121
#13 0x00007fdd07dba689 in WebCore::RenderTheme::activeSelectionForegroundColor
(this=0x7fdcf40e2870) at ../Source/WebCore/rendering/RenderTheme.cpp:567
#14 0x00007fdd07d6e521 in WebCore::RenderObject::selectionColor (
this=0x7fdc811b4738, colorProperty=335)
at ../Source/WebCore/rendering/RenderObject.cpp:1462
#15 0x00007fdd07d6e55e in WebCore::RenderObject::selectionForegroundColor (
this=this#entry=0x7fdc811b4738)
at ../Source/WebCore/rendering/RenderObject.cpp:1469
#16 0x00007fdd07de27c4 in WebCore::computeTextSelectionPaintStyle (
textPaintStyle=..., renderer=..., lineStyle=..., paintInfo=...,
paintSelectedTextOnly=#0x7ffd0e22c5f1: false,
paintSelectedTextSeparately=#0x7ffd0e22c5f2: false,
selectionShadow=#0x7ffd0e22c628: 0x0)
at ../Source/WebCore/rendering/TextPaintStyle.cpp:127
#17 0x00007fdd07c5265a in WebCore::InlineTextBox::paint (this=0x1956f60,
paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/InlineTextBox.cpp:575
#18 0x00007fdd07c4bc91 in WebCore::InlineFlowBox::paint (
this=this#entry=0x1956fc0, paintInfo=..., paintOffset=..., lineTop=...,
lineTop#entry=..., lineBottom=..., lineBottom#entry=...)
at ../Source/WebCore/rendering/InlineFlowBox.cpp:1162
---Type <return> to continue, or q <return> to quit---
#19 0x00007fdd07dd46c1 in WebCore::RootInlineBox::paint (this=0x1956fc0,
paintInfo=..., paintOffset=..., lineTop=..., lineBottom=...)
at ../Source/WebCore/rendering/RootInlineBox.cpp:210
#20 0x00007fdd07d4252e in WebCore::RenderLineBoxList::paint (
this=0x7fdc811b62e0, renderer=0x7fdc811b6240, paintInfo=...,
paintOffset=...) at ../Source/WebCore/rendering/RenderLineBoxList.cpp:265
#21 0x00007fdd07c59759 in WebCore::RenderBlock::paintContents (
this=this#entry=0x7fdc811b6240, paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2373
#22 0x00007fdd07c6a473 in WebCore::RenderBlock::paintObject (
this=0x7fdc811b6240, paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2509
#23 0x00007fdd07c57135 in WebCore::RenderBlock::paint (this=0x7fdc811b6240,
paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2186
#24 0x00007fdd07c42b4c in WebCore::InlineElementBox::paint (this=0x195b4c0,
paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/InlineElementBox.cpp:88
#25 0x00007fdd07c4bc91 in WebCore::InlineFlowBox::paint (
this=this#entry=0x195b500, paintInfo=..., paintOffset=..., lineTop=...,
lineTop#entry=..., lineBottom=..., lineBottom#entry=...)
at ../Source/WebCore/rendering/InlineFlowBox.cpp:1162
#26 0x00007fdd07dd46c1 in WebCore::RootInlineBox::paint (this=0x195b500,
---Type <return> to continue, or q <return> to quit---
paintInfo=..., paintOffset=..., lineTop=..., lineBottom=...)
at ../Source/WebCore/rendering/RootInlineBox.cpp:210
#27 0x00007fdd07d4252e in WebCore::RenderLineBoxList::paint (
this=0x7fdc811b63a0, renderer=0x7fdc811b6300, paintInfo=...,
paintOffset=...) at ../Source/WebCore/rendering/RenderLineBoxList.cpp:265
#28 0x00007fdd07c59759 in WebCore::RenderBlock::paintContents (
this=this#entry=0x7fdc811b6300, paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2373
#29 0x00007fdd07c6a473 in WebCore::RenderBlock::paintObject (
this=0x7fdc811b6300, paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2509
#30 0x00007fdd07c57135 in WebCore::RenderBlock::paint (this=0x7fdc811b6300,
paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2186
#31 0x00007fdd07c5988a in WebCore::RenderBlock::paintChild (
this=this#entry=0x7fdc811b63c0, child=..., paintInfo=..., paintOffset=...,
paintInfoForChild=..., usePrintRect=usePrintRect#entry=false)
at ../Source/WebCore/rendering/RenderBlock.cpp:2423
#32 0x00007fdd07c59b72 in WebCore::RenderBlock::paintChildren (
this=0x7fdc811b63c0, paintInfo=..., paintOffset=...,
paintInfoForChild=..., usePrintRect=false)
at ../Source/WebCore/rendering/RenderBlock.cpp:2393
#33 0x00007fdd07c59730 in WebCore::RenderBlock::paintContents (
---Type <return> to continue, or q <return> to quit---
this=this#entry=0x7fdc811b63c0, paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2386
#34 0x00007fdd07c6a473 in WebCore::RenderBlock::paintObject (
this=0x7fdc811b63c0, paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2509
#35 0x00007fdd07c57135 in WebCore::RenderBlock::paint (this=0x7fdc811b63c0,
paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2186
#36 0x00007fdd07c5988a in WebCore::RenderBlock::paintChild (
this=this#entry=0x7fdc811b69c0, child=..., paintInfo=..., paintOffset=...,
paintInfoForChild=..., usePrintRect=usePrintRect#entry=false)
at ../Source/WebCore/rendering/RenderBlock.cpp:2423
#37 0x00007fdd07c59b72 in WebCore::RenderBlock::paintChildren (
this=0x7fdc811b69c0, paintInfo=..., paintOffset=...,
paintInfoForChild=..., usePrintRect=false)
at ../Source/WebCore/rendering/RenderBlock.cpp:2393
#38 0x00007fdd07c59730 in WebCore::RenderBlock::paintContents (
this=this#entry=0x7fdc811b69c0, paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2386
#39 0x00007fdd07c6a473 in WebCore::RenderBlock::paintObject (
this=0x7fdc811b69c0, paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2509
#40 0x00007fdd07c57135 in WebCore::RenderBlock::paint (this=0x7fdc811b69c0,
---Type <return> to continue, or q <return> to quit---
paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2186
#41 0x00007fdd07c5988a in WebCore::RenderBlock::paintChild (
this=this#entry=0x7fdc811b6a80, child=..., paintInfo=..., paintOffset=...,
paintInfoForChild=..., usePrintRect=usePrintRect#entry=false)
at ../Source/WebCore/rendering/RenderBlock.cpp:2423
#42 0x00007fdd07c59b72 in WebCore::RenderBlock::paintChildren (
this=0x7fdc811b6a80, paintInfo=..., paintOffset=...,
paintInfoForChild=..., usePrintRect=false)
at ../Source/WebCore/rendering/RenderBlock.cpp:2393
#43 0x00007fdd07c59730 in WebCore::RenderBlock::paintContents (
this=this#entry=0x7fdc811b6a80, paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2386
#44 0x00007fdd07c6a473 in WebCore::RenderBlock::paintObject (
this=0x7fdc811b6a80, paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2509
#45 0x00007fdd07c57135 in WebCore::RenderBlock::paint (this=0x7fdc811b6a80,
paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2186
#46 0x00007fdd07c5988a in WebCore::RenderBlock::paintChild (
this=this#entry=0x7fdc811b6b40, child=..., paintInfo=..., paintOffset=...,
paintInfoForChild=..., usePrintRect=usePrintRect#entry=false)
at ../Source/WebCore/rendering/RenderBlock.cpp:2423
---Type <return> to continue, or q <return> to quit---
#47 0x00007fdd07c59b72 in WebCore::RenderBlock::paintChildren (
this=0x7fdc811b6b40, paintInfo=..., paintOffset=...,
paintInfoForChild=..., usePrintRect=false)
at ../Source/WebCore/rendering/RenderBlock.cpp:2393
#48 0x00007fdd07c59730 in WebCore::RenderBlock::paintContents (
this=this#entry=0x7fdc811b6b40, paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2386
#49 0x00007fdd07c6a473 in WebCore::RenderBlock::paintObject (
this=0x7fdc811b6b40, paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2509
#50 0x00007fdd07c57135 in WebCore::RenderBlock::paint (this=0x7fdc811b6b40,
paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2186
#51 0x00007fdd07c5988a in WebCore::RenderBlock::paintChild (
this=this#entry=0x7fdc98144540, child=..., paintInfo=..., paintOffset=...,
paintInfoForChild=..., usePrintRect=usePrintRect#entry=false)
at ../Source/WebCore/rendering/RenderBlock.cpp:2423
#52 0x00007fdd07c59b72 in WebCore::RenderBlock::paintChildren (
this=0x7fdc98144540, paintInfo=..., paintOffset=...,
paintInfoForChild=..., usePrintRect=false)
at ../Source/WebCore/rendering/RenderBlock.cpp:2393
#53 0x00007fdd07c59730 in WebCore::RenderBlock::paintContents (
this=this#entry=0x7fdc98144540, paintInfo=..., paintOffset=...)
---Type <return> to continue, or q <return> to quit---
at ../Source/WebCore/rendering/RenderBlock.cpp:2386
#54 0x00007fdd07c6a473 in WebCore::RenderBlock::paintObject (
this=0x7fdc98144540, paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2509
#55 0x00007fdd07c57135 in WebCore::RenderBlock::paint (this=0x7fdc98144540,
paintInfo=..., paintOffset=...)
at ../Source/WebCore/rendering/RenderBlock.cpp:2186
#56 0x00007fdd07d15c74 in WebCore::RenderLayer::paintForegroundForFragmentsWithPhase (this=this#entry=0x193c340,
phase=phase#entry=WebCore::PaintPhaseForeground, layerFragments=...,
context=context#entry=0x7ffd0e22e7c0, localPaintingInfo=...,
paintBehavior=paintBehavior#entry=0,
subtreePaintRootForRenderer=subtreePaintRootForRenderer#entry=0x0)
at ../Source/WebCore/rendering/RenderLayer.cpp:4477
#57 0x00007fdd07d1aad6 in WebCore::RenderLayer::paintForegroundForFragments (
this=this#entry=0x193c340, layerFragments=...,
context=context#entry=0x7ffd0e22e7c0,
transparencyLayerContext=transparencyLayerContext#entry=0x7ffd0e22e7c0,
transparencyPaintDirtyRect=...,
haveTransparency=haveTransparency#entry=false, localPaintingInfo=...,
paintBehavior=paintBehavior#entry=0,
subtreePaintRootForRenderer=subtreePaintRootForRenderer#entry=0x0,
selectionOnly=selectionOnly#entry=false,
---Type <return> to continue, or q <return> to quit---
forceBlackText=forceBlackText#entry=false)
at ../Source/WebCore/rendering/RenderLayer.cpp:4441
#58 0x00007fdd07d27406 in WebCore::RenderLayer::paintLayerContents (
this=this#entry=0x193c340, context=context#entry=0x7ffd0e22e7c0,
paintingInfo=..., paintFlags=224)
at ../Source/WebCore/rendering/RenderLayer.cpp:4162
#59 0x00007fdd07d27a7f in WebCore::RenderLayer::paintLayerContentsAndReflection
(this=this#entry=0x193c340, context=context#entry=0x7ffd0e22e7c0,
paintingInfo=..., paintFlags=paintFlags#entry=224)
at ../Source/WebCore/rendering/RenderLayer.cpp:3858
#60 0x00007fdd07d283d9 in WebCore::RenderLayer::paintLayer (
this=this#entry=0x193c340, context=context#entry=0x7ffd0e22e7c0,
paintingInfo=..., paintFlags=paintFlags#entry=224)
at ../Source/WebCore/rendering/RenderLayer.cpp:3839
#61 0x00007fdd07d29d02 in WebCore::RenderLayer::paintList (this=0x192bcd0,
list=0x7fdc8115a830, context=0x7ffd0e22e7c0, paintingInfo=...,
paintFlags=224) at ../Source/WebCore/rendering/RenderLayer.cpp:4255
#62 0x00007fdd07d27520 in WebCore::RenderLayer::paintLayerContents (
this=this#entry=0x192bcd0, context=context#entry=0x7ffd0e22e7c0,
paintingInfo=..., paintFlags=224)
at ../Source/WebCore/rendering/RenderLayer.cpp:4173
#63 0x00007fdd07d27a7f in WebCore::RenderLayer::paintLayerContentsAndReflection
(this=this#entry=0x192bcd0, context=context#entry=0x7ffd0e22e7c0,
---Type <return> to continue, or q <return> to quit---
paintingInfo=..., paintFlags=paintFlags#entry=224)
at ../Source/WebCore/rendering/RenderLayer.cpp:3858
#64 0x00007fdd07d283d9 in WebCore::RenderLayer::paintLayer (
this=this#entry=0x192bcd0, context=context#entry=0x7ffd0e22e7c0,
paintingInfo=..., paintFlags=paintFlags#entry=224)
at ../Source/WebCore/rendering/RenderLayer.cpp:3839
#65 0x00007fdd07d29d02 in WebCore::RenderLayer::paintList (this=0x180d8f0,
list=0x7fdc8115a840, context=0x7ffd0e22e7c0, paintingInfo=...,
paintFlags=224) at ../Source/WebCore/rendering/RenderLayer.cpp:4255
#66 0x00007fdd07d27520 in WebCore::RenderLayer::paintLayerContents (
this=this#entry=0x180d8f0, context=context#entry=0x7ffd0e22e7c0,
paintingInfo=..., paintFlags=224)
at ../Source/WebCore/rendering/RenderLayer.cpp:4173
#67 0x00007fdd07d27a7f in WebCore::RenderLayer::paintLayerContentsAndReflection
(this=this#entry=0x180d8f0, context=context#entry=0x7ffd0e22e7c0,
paintingInfo=..., paintFlags=paintFlags#entry=0)
at ../Source/WebCore/rendering/RenderLayer.cpp:3858
#68 0x00007fdd07d283d9 in WebCore::RenderLayer::paintLayer (
this=this#entry=0x180d8f0, context=context#entry=0x7ffd0e22e7c0,
paintingInfo=..., paintFlags=paintFlags#entry=0)
at ../Source/WebCore/rendering/RenderLayer.cpp:3839
#69 0x00007fdd07d2867e in WebCore::RenderLayer::paint (
this=this#entry=0x180d8f0, context=context#entry=0x7ffd0e22e7c0,
---Type <return> to continue, or q <return> to quit---
damageRect=..., paintBehavior=0,
subtreePaintRoot=subtreePaintRoot#entry=0x0, region=region#entry=0x0,
paintFlags=paintFlags#entry=0)
at ../Source/WebCore/rendering/RenderLayer.cpp:3623
#70 0x00007fdd07bdda1d in WebCore::FrameView::paintContents (
this=0x7fdcf40dd800, p=0x7ffd0e22e7c0, rect=...)
at ../Source/WebCore/page/FrameView.cpp:3507
#71 0x00007fdd082ef894 in WebCore::ScrollView::paint (this=0x7fdcf40dd800,
context=0x7ffd0e22e7c0, rect=...)
at ../Source/WebCore/platform/ScrollView.cpp:1162
#72 0x00007fdd074bc3bb in paintWebView (dirtyRegion=..., frame=0x7fdcf40f5c00,
webView=0x17dc440)
at ../Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:588
#73 WebKit::ChromeClient::paint (this=0x173da00)
at ../Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:631
#74 0x00007fdd075c67b1 in WebCore::ThreadTimers::sharedTimerFiredInternal (
this=0x7fdcf4108f50) at ../Source/WebCore/platform/ThreadTimers.cpp:132
#75 0x00007fdd075dea62 in WebCore::sharedTimerTimeoutCallback ()
at ../Source/WebCore/platform/gtk/SharedTimerGtk.cpp:49
#76 0x00007fdd0465c703 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#77 0x00007fdd0465bce5 in g_main_context_dispatch ()
from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#78 0x00007fdd0465c048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#79 0x00007fdd0465c30a in g_main_loop_run ()
from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#80 0x00007fdd094a6e25 in gtk_main ()
from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#81 0x0000000000400d52 in main ()
It's natural to think that you are doing something wrong but when it comes to GLib-GObject-CRITICAL failures the issue has little, if anything, to do with your code and more to do with the GNOME ecosystem.
For instance, I can reproduce this issue with both well established projects and barebone GTK+ 3 applications in C++/Python by running them on older versions of GNOME but the issue goes away with a recent version of GNOME.
Since I didn't modify the code between tests then the code must be fine.
If you develop with planned obsolescence in mind, forcing users of your software to upgrade GNOME in order to use it then this is probably non-issue nowadays.
But if you are developing against an older version of GNOME or for some reason this (or a new) GLib-GObject-CRITICAL failure is present with a recent version of GNOME then the easiest solution is to filter it out.
Personally, I would unit test where applicable and ignore the following GLib-GObject-CRITICAL failure patterns:
object->ref_count > 0
source->priv != NULL

LLVM insertvalue bad optimized?

Should I avoid using the 'insertvalue' instruction combined with load and store when I emit LLVM code?
I always get bad optimized native code when I use it. Look at the following example:
; ModuleID = 'mod'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-pc-linux-gnu"
%A = type { i64, i64, i64, i64, i64, i64, i64, i64 }
#aa = external global %A*
define void #func() {
entry:
%a1 = load %A** #aa
%a2 = load %A* %a1
%a3 = insertvalue %A %a2, i64 3, 3
store %A %a3, %A* %a1
ret void
}
When I run "llc -o - -O3 mod.ll", I get this horrible code:
func: # #func
.Ltmp0:
.cfi_startproc
# BB#0: # %entry
movq aa(%rip), %rax
movq (%rax), %r8
movq 8(%rax), %r9
movq 16(%rax), %r10
movq 32(%rax), %rdi
movq 40(%rax), %rcx
movq 48(%rax), %rdx
movq 56(%rax), %rsi
movq %rsi, 56(%rax)
movq %rdx, 48(%rax)
movq %rcx, 40(%rax)
movq %rdi, 32(%rax)
movq %r10, 16(%rax)
movq %r9, 8(%rax)
movq %r8, (%rax)
movq $3, 24(%rax)
ret
But what I would like to see is this:
func: # #func
.Ltmp0:
.cfi_startproc
# BB#0: # %entry
movq aa(%rip), %rax
movq $3, 24(%rax)
ret
Of course I can use getelementptr or something, but sometimes it is easier to generate insertvalue and extractvalue instructions, and I want these to be optimized...
I think it would be quite easy for the codegen to see that things like these are bad:
movq 56(%rax), %rsi
movq %rsi, 56(%rax)
First, note that llc does not do any IR-level optimizations. So, you should run opt to run the set of IR-level optimizers.
However, opt does not help in this. I'd expect that standard IR-level optimizers canonicalize the stuff into gep somehow.
Please file a LLVM PR, this looks like a missed optimization!