IRC logs of #shogun for Wednesday, 2019-05-08

--- Log opened Wed May 08 00:00:06 2019
-!- lambday [a7dcee98@gateway/web/freenode/ip.167.220.238.152] has quit [Ping timeout: 256 seconds]00:15
-!- essam [c5351068@gateway/web/freenode/ip.197.53.16.104] has quit [Quit: Page closed]02:54
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun07:34
-!- durovo [~durovo@8e.68.2ea9.ip4.static.sl-reverse.com] has quit [Remote host closed the connection]07:56
-!- durovo [~durovo@8e.68.2ea9.ip4.static.sl-reverse.com] has joined #shogun07:57
-!- durovo [~durovo@8e.68.2ea9.ip4.static.sl-reverse.com] has quit [Remote host closed the connection]08:07
-!- durovo [~durovo@8e.68.2ea9.ip4.static.sl-reverse.com] has joined #shogun08:07
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has quit [Remote host closed the connection]08:25
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun08:27
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has quit [Remote host closed the connection]08:36
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun08:44
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has quit [Ping timeout: 248 seconds]08:48
-!- geektoni [c1cdd24a@gateway/web/freenode/ip.193.205.210.74] has joined #shogun09:09
-!- wiking [~wiking@2001:67c:10ec:5784:8000::3ff] has joined #shogun09:15
-!- arishuynhvan [67fcc830@gateway/web/freenode/ip.103.252.200.48] has joined #shogun10:00
-!- lambday [a7dcee98@gateway/web/freenode/ip.167.220.238.152] has joined #shogun10:01
-!- mode/#shogun [+o lambday] by ChanServ10:01
-!- geektoni [c1cdd24a@gateway/web/freenode/ip.193.205.210.74] has quit [Ping timeout: 256 seconds]10:05
-!- gf712 [9052084a@gateway/web/freenode/ip.144.82.8.74] has joined #shogun10:14
gf712wiking: weren't you look for a type trait the other day that does this https://en.cppreference.com/w/cpp/types/remove_cvref ?10:22
-!- geektoni [c1cdd24a@gateway/web/freenode/ip.193.205.210.74] has joined #shogun10:27
-!- arishuynhvan [67fcc830@gateway/web/freenode/ip.103.252.200.48] has quit [Ping timeout: 256 seconds]10:31
gf712wiking: ping13:11
-!- HeikoS [~heiko@73.red-83-46-178.dynamicip.rima-tde.net] has joined #shogun14:07
-!- mode/#shogun [+o HeikoS] by ChanServ14:07
-!- aris_ [67fcc830@gateway/web/freenode/ip.103.252.200.48] has joined #shogun14:28
-!- aris_ [67fcc830@gateway/web/freenode/ip.103.252.200.48] has quit [Ping timeout: 256 seconds]14:40
geektoniping HeikoS14:48
@HeikoSgeektoni: pong14:48
geektoniHeikoS: hi, just wanted to talk a bit about a couple of things14:50
geektoniHeikoS: first one is this https://github.com/shogun-toolbox/shogun/pull/4618/files/1e0deeb8b7b749187781458d95fbfd18ccdc3c69#diff-1c4dac8c0dc45d3a55ac37450f8c7b99R4414:50
geektoniget_option works perfectly fine with strings parameters, however renaming it to something like get_string/get_option_string is not nice right?14:51
@HeikoSno14:53
@HeikoSget_string needs to be added14:53
@HeikoSgeektoni: get_option does more than just returning a string14:55
@HeikoSit checks whether the parameter has options14:55
geektoniHeikos: yes yes, get_option is more "advanced"14:55
-!- wiking [~wiking@2001:67c:10ec:5784:8000::3ff] has quit [Remote host closed the connection]14:56
@HeikoSgeektoni: so to answer your question in the PR: yes, makes sense to add a new method in the swig interface14:57
@HeikoSand this is translated to get<string> in c++14:57
geektoniokay, so, first of all, it is not possible to declare %template twice (with a different name) for the same specialization14:58
geektoniI wonder if it exists a way in swig to like add a "duplicate" method with a different name14:58
@HeikoSgf712: ^ any thoughts on this?14:59
@HeikoSgeektoni: good question!14:59
@HeikoSI think yes14:59
@HeikoSmonkeypatching14:59
@HeikoSgf712 did this for some swig stuff15:00
@HeikoSfor the .get method15:00
geektonibut15:00
geektoniin the end15:00
geektoniget_string == get_option15:00
geektonisince they should both translate to get<std::string>15:01
@HeikoSyes15:02
@HeikoSso can just add15:02
@HeikoSdef get_string(bla):15:02
@HeikoS    return get_option(bla)15:02
geektoniI see I see15:03
geektoniand what about the other languages?15:03
@HeikoSbut I am sure if you google swig duplicate template15:03
@HeikoSthe SWIG api should have a clear distinction between get_option and get_string15:03
@HeikoSc++ is just get<string>15:03
geektonisure sure15:04
geektoniokay, I'll see what I can do15:04
geektoniHeikoS: second question, https://github.com/shogun-toolbox/shogun/pull/4626#discussion_r28101188015:05
gf712geektoni: what happens if you use rename instead of template in swig?15:06
gf712i.e. %template(get_string) CSGObject::get<std::string, void>;15:06
@HeikoSgood idea! :)15:06
gf712I doublt it would work though15:06
geektonigf712: mmh not sure15:07
gf712because then it will get confused as to which one to use15:07
@HeikoSgeektoni: re second question, I think since the std:: structures on primitives are fine due to the copy ctor this is ok15:07
@HeikoSbut if we observe sgobjects, there will be problems or?15:07
@HeikoSgeektoni gf712 another option might be to define a get<string, void, void> (3xvoid) in the swig c++ code15:08
@HeikoSand then use that for the template15:08
geektonithe problems will be caused by the copy ctor of those sgobjects15:08
@HeikoSthat should work actually15:08
gf712yea, I think that is the only way to use it15:08
gf712but it starts being a bit confusing :D15:08
geektonie.g. SGVector copy ctor copies only the pointer to the data and not the data itself15:08
@HeikoSgeektoni: sure, this is why clone needs to be called15:08
@HeikoSlike in any15:08
@HeikoSit first checks15:08
@HeikoS->clone15:09
@HeikoS.clone15:09
@HeikoSthen copy ctor15:09
@HeikoSand then =15:09
@HeikoSmakes a lot of sense15:09
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun15:10
geektoniHeikoS: mmh maybe I'm missing something, could you point me to the line where that behaviour is implemented in any.h?15:11
@HeikoSgeektoni: e.g. line 29115:12
@HeikoStemplate <class T>15:12
@HeikoSinline auto clone_impl(maybe_most_important, T* value)15:12
@HeikoS    -> decltype(static_cast<void*>(value->clone()))15:12
@HeikoS{15:12
@HeikoSif (!value)15:12
@HeikoSreturn nullptr;15:12
@HeikoSreturn static_cast<void*>(value->clone());15:12
@HeikoS}15:12
@HeikoSand then above is the cascade15:13
@HeikoStemplate <class T>15:13
@HeikoSinline auto clone_impl(more_important, const T& value)15:13
@HeikoS    -> decltype(value.clone())15:13
@HeikoS{15:13
@HeikoSreturn value.clone();15:13
@HeikoS}15:13
@HeikoSand then next is15:13
@HeikoStemplate <class T, std::enable_if_t<std::is_copy_constructible<T>::value>* = nullptr>15:13
@HeikoSinline T clone_impl(general, T& value)15:13
@HeikoS{15:13
@HeikoSreturn T(value);15:13
@HeikoS15:13
geektoniHeikoS: cool cool15:13
geektonithanks :)15:13
@HeikoSnw15:13
@HeikoSlet me know how that goe15:14
@HeikoSs15:14
@HeikoSIll check back in after lunch15:14
@HeikoSgf712: also see the mmd issue15:14
@HeikoShttps://github.com/shogun-toolbox/shogun/issues/459515:14
-!- HeikoS [~heiko@73.red-83-46-178.dynamicip.rima-tde.net] has quit [Ping timeout: 250 seconds]15:19
-!- geektoni [c1cdd24a@gateway/web/freenode/ip.193.205.210.74] has quit [Ping timeout: 256 seconds]15:29
-!- geektoni [c1cdd24a@gateway/web/freenode/ip.193.205.210.74] has joined #shogun15:39
-!- geektoni [c1cdd24a@gateway/web/freenode/ip.193.205.210.74] has quit [Quit: Page closed]17:00
-!- gf712 [9052084a@gateway/web/freenode/ip.144.82.8.74] has quit [Quit: Page closed]18:17
-!- essam [c5351260@gateway/web/freenode/ip.197.53.18.96] has joined #shogun18:22
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has quit [Remote host closed the connection]18:36
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun18:44
-!- shogun-toolbox [~shogun@7nn.de] has quit [Ping timeout: 250 seconds]22:14
--- Log closed Wed May 08 22:14:43 2019
--- Log opened Wed May 08 22:21:56 2019
-!- shogun-toolbox [~shogun@7nn.de] has joined #shogun22:21
-!- Irssi: #shogun: Total of 14 nicks [3 ops, 0 halfops, 0 voices, 11 normal]22:21
-!- Irssi: Join to #shogun was synced in 6 secs22:21
--- Log closed Thu May 09 00:00:07 2019

Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!