• cheeser
  • ernimril
  • joed
  • kinabalu
  • lunk
  • ojacobson
  • r0bby
  • ThaDon
  • ricky_clarkson
  • topriddy

« 2019-03-14


2019-03-16 »

Nick Message Date
chaosruler [chaosruler!~chaosrule@unaffiliated/chaosruler] has joined #kotlin [12:37]
Crash1hd [Crash1hd!~Crash1hd@unaffiliated/crash1hd] has joined #kotlin [01:10]
HatesLongFiles if i want a vararg to accept more than one type does it need to be of type Any [01:29]
HatesLongFiles for example, f(1, 2, 3.5, "5", *na) [01:30]
HatesLongFiles also what is SafeVarargs [01:58]
HatesLongFiles varargs: SafeVarargs java.lang [01:59]
glosoli [glosoli!~glosoli@unaffiliated/glosoli] has joined #kotlin [02:01]
HatesLongFiles apparently SafeVarargs is part of android [02:19]
HatesLongFiles HatesLongFiles's title: "SafeVarargs | Android Developers" [02:19]
Android [Android!] has joined #kotlin [02:42]
Android ok i think my LibJSON is done [02:45]
Bombe [noises of disbelieve] [02:47]
Android XD [02:48]
Bombe show us [02:49]
Bombe Paste the code (and any errors) in a pastebin where we can see it. See ~pastebin for options. Also see ~testcase for good examples as to how to help us help you quickly diagnose and solve problems. [02:49]
Android [02:50]
Android * [02:52]
Android 6000 was meant to be an int, not a string [02:52]
Bombe That looks about as complex to use as e.g. Jackson. [02:54]
Android oh [02:54]
Bombe Well, a bit more, actually, if you factor in all the unexpectedness. [02:54]
Bombe Like the value-key argument order; everybody and their dog uses key-value. [02:55]
Android true [02:55]
Bombe Underscores are also frowned upon in Java/Kotlin-land. [02:55]
Bombe Variables begin with a lowercase letter. [02:56]
Bombe Function names starting with ?new? indicate a function that creates an object, not a function that modifies some other object. [02:56]
Android should i overload new_value so its new_value(value: LibJSON) { ... } new_value(name: String? = null, value: LibJSON) instead of new_value(value: LibJSON, name: String? = null) ? [02:57]
Android ok [02:57]
glosoli [glosoli!~glosoli@unaffiliated/glosoli] has joined #kotlin [02:57]
Bombe And the name ?LibJSON? is also inappropriate because it?s not a lib, it merely seems to be the implementation of a JSON object, or a POJO with a JSON printer built-in. [02:57]
Bombe Why would the name be null? [02:58]
Bombe heads off to work. [03:01]
Android Bombe: hows this [03:07]
Android Bombe: because add_value can be specified with just a value, for example, Layout.add_name("children"); Layout.add_array(Layout_Children_1, Layout_Children_2); uses this concept, where it can ALSO be Layout.add_array("children", Layout_Children_1, Layout_Children_2) [03:09]
Android HOWEVER doing it this way for a varargs function is unsuitible as it breaks compatibility, for example, how does it know if "children" is a varargs or a name [03:10]
Android is part of a varargs* [03:10]
Ladicek [Ladicek!~lthon@] has joined #kotlin [03:11]
Android for example, these are valid [03:12]
Android Layout.add_name("type") [03:12]
Android Layout.add_value("LinearLayout") [03:12]
Android Layout.add_value("type", "LinearLayout") [03:12]
Tazmain [Tazmain!~Tazmain@unaffiliated/tazmain] has joined #kotlin [03:12]
kostrifon [kostrifon!~kostrifon@] has joined #kotlin [03:25]
Pitel [Pitel!] has joined #kotlin [03:28]
henbruas [henbruas!~henbruas@unaffiliated/henbruas] has joined #kotlin [04:01]
bravoslo [bravoslo!~bravoslo@] has joined #kotlin [04:04]
HatesLongFiles [HatesLongFiles!] has joined #kotlin [04:05]
glosoli [glosoli!~glosoli@unaffiliated/glosoli] has joined #kotlin [04:08]
padrepio [padrepio!] has joined #kotlin [04:33]
chaosruler_ [chaosruler_!~chaosrule@unaffiliated/chaosruler] has joined #kotlin [04:42]
chaosruler [chaosruler!~chaosrule@unaffiliated/chaosruler] has joined #kotlin [04:48]
chaosruler_ [chaosruler_!~chaosrule@unaffiliated/chaosruler] has joined #kotlin [04:52]
chaosruler__ [chaosruler__!~chaosrule@unaffiliated/chaosruler] has joined #kotlin [05:00]
chaosruler_ [chaosruler_!~chaosrule@unaffiliated/chaosruler] has joined #kotlin [05:18]
Bombe The ?children? in your example above is _not_ the value, though, it?s the key. [05:21]
chaosruler__ [chaosruler__!~chaosrule@unaffiliated/chaosruler] has joined #kotlin [05:31]
ppareit [ppareit!] has joined #kotlin [05:40]
HatesLongFiles i know [05:58]
HatesLongFiles but same concept, how does it tell the difference between something being part of a vararg or not [05:59]
Bombe ?It? does not do anything of that sort. [05:59]
Bombe You have a method, it has parameters. [06:00]
HatesLongFiles anyway, does anyone work with proteus [06:00]
Bombe One of the parameters can be a vararg and it will be clearly marked. [06:00]
rager [rager!] has joined #kotlin [06:07]
Tazmain [Tazmain!~Tazmain@unaffiliated/tazmain] has joined #kotlin [06:22]
flamebeard [flamebeard!~flamebear@] has joined #kotlin [06:28]
DiabloD3 [DiabloD3!] has joined #kotlin [06:39]
lankanmon [lankanmon!] has joined #kotlin [06:46]
chaosruler__ [chaosruler__!~chaosrule@unaffiliated/chaosruler] has joined #kotlin [06:55]
chaosruler__ [chaosruler__!~chaosrule@unaffiliated/chaosruler] has joined #kotlin [06:57]
chaosruler__ [chaosruler__!~chaosrule@unaffiliated/chaosruler] has joined #kotlin [06:59]
waz [waz!~waz@pdpc/supporter/active/waz] has joined #kotlin [07:45]
kostrifon [kostrifon!~kostrifon@] has joined #kotlin [07:54]
ziyourenxiang [ziyourenxiang!~ziyourenx@unaffiliated/ziyourenxiang] has joined #kotlin [07:57]
waz [waz!~waz@pdpc/supporter/active/waz] has joined #kotlin [07:57]
waz [waz!~waz@pdpc/supporter/active/waz] has joined #kotlin [09:04]
t2mkn [t2mkn!~t2mkn@] has joined #kotlin [09:21]
Pitel [Pitel!] has joined #kotlin [09:24]
t2mkn [t2mkn!~t2mkn@] has joined #kotlin [09:59]
Crash1hd [Crash1hd!~Crash1hd@unaffiliated/crash1hd] has joined #kotlin [10:11]
ppareit [ppareit!] has joined #kotlin [10:16]
ppareit [ppareit!] has joined #kotlin [10:20]
t2mkn [t2mkn!~t2mkn@] has joined #kotlin [10:51]
OtakuSenpai [OtakuSenpai!avraneel@unaffiliated/neel] has joined #kotlin [10:51]
ChrisLane [ChrisLane!] has joined #kotlin [11:09]
veegee [veegee!] has joined #kotlin [11:13]
rohdef [rohdef!] has joined #kotlin [11:30]
orbyt_ [orbyt_!~orbyt@] has joined #kotlin [12:05]
padrepio [padrepio!] has joined #kotlin [12:16]
waz [waz!~waz@pdpc/supporter/active/waz] has joined #kotlin [12:19]
orbyt_ [orbyt_!~orbyt@] has joined #kotlin [12:36]
pheerai [pheerai!~pheerai@] has joined #kotlin [12:55]
esro [esro!] has joined #kotlin [01:03]
HatesLongFiles does the 'this' keyword act differently in kotlin and java [01:14]
jdlee i don't think so [01:15]
jdlee it's wonky in lambdas, though [01:15]
HatesLongFiles as i get [01:16]
HatesLongFiles Type mismatch: inferred type is MainActivity but View.OnClickListener! was expected [01:16]
HatesLongFiles for [01:16]
HatesLongFiles (sampleView.getTag() as SampleViewHolder).clickableView?.setOnClickListener(this) [01:16]
cheeser scope matters [01:16]
cheeser show us [01:16]
cheeser Paste the code (and any errors) in a pastebin where we can see it. See ~pastebin for options. Also see ~testcase for good examples as to how to help us help you quickly diagnose and solve problems. [01:16]
HatesLongFiles that is originally in a .java file [01:16]
cheeser but it's not anymore. [01:17]
HatesLongFiles [01:17]
HatesLongFiles HatesLongFiles's title: "json2view/ at master Avocarrot/json2view GitHub" [01:17]
exonity01 [exonity01!] has joined #kotlin [01:17]
HatesLongFiles im trying to get it to work in Kotlin [01:18]
exonity01 parted the channel: [01:18]
freeone3000 uh, why? If it works in Java you're done. [01:21]
freeone3000 If you're having trouble, what's your Kotlin attempt? [01:21]
HatesLongFiles cus my application is written in Kotlin [01:21]
freeone3000 so? [01:21]
gdrc hi [01:21]
gdrc i do I pass an array of enum to a method? [01:22]
freeone3000 gdrc: Array<EnumType> [01:22]
cheeser like any other array [01:22]
gdrc public final void getToy(ToylListener<Toy> listener, ToySource... sources) { [01:22]
gdrc I'm a bit lost guys [01:23]
freeone3000 gdrc: fun getToy(listener: ToyIListener<Toy>, varargs sources: ToySource) [01:23]
freeone3000 *vararg not varargs [01:23]
gdrc right, that's the equivalent in kotlin [01:25]
gdrc but I have to call that method in kotlin passing two ToySource [01:25]
freeone3000 gdrc: Ah. getToy(listener, arrayOf(source1, source2)) [01:25]
gdrc okay I figured out lol, was just comma separated [01:25]
cheeser eh? [01:25]
gdrc no I don't need arrayOf [01:25]
kostrifon [kostrifon!~kostrifon@] has joined #kotlin [01:25]
freeone3000 so. basically, exactly as you'd do it otherwise. cool. [01:25]
gdrc getToy(this, ToySource.LOCAL,ToySource.SERVER) [01:26]
gdrc thanks :) [01:26]
HatesLongFiles this is my current kotlin file [01:31]
freeone3000 HatesLongFiles: Your MainActivity no longer implements OnClickListener [01:33]
HatesLongFiles oh [01:34]
kapil____ [kapil____!uid36151@gateway/web/] has joined #kotlin [01:36]
HatesLongFiles how do i do that in kotlin [01:41]
Bombe Like you are doing it in Java. [01:41]
funeral [funeral!] has joined #kotlin [01:44]
HatesLongFiles i get Expecting a top level declaration [01:44]
HatesLongFiles for [01:44]
HatesLongFiles class MainActivity : AppCompatActivity() implements View.OnClickListener { [01:45]
cheeser s/implements/,/ [01:46]
HatesLongFiles Class 'MainActivity' is not abstract and does not implement abstract member public abstract fun onClick(p0: View!): Unit defined in android.view.View.OnClickListener [01:49]
yawkat have you considered implementing onClick [01:51]
HatesLongFiles abstract should only be used if it is not meant to be called in production code right? [01:51]
yawkat no [01:51]
Bombe Hahaha, good one. [01:54]
vikikas [vikikas!~vikas@2a02:1205:5035:8020:88eb:5028:ef18:eadf] has joined #kotlin [01:59]
HatesLongFiles Modifier 'override' is not applicable to 'local function' [01:59]
HatesLongFiles override fun onClick(v: View) { startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(""))) } [01:59]
freeone3000 It's not marked public. [02:00]
cheeser public is the default [02:01]
cheeser what would a local function even override? [02:01]
HatesLongFiles nvm i was declaring the function inside the onCreate function [02:03]
Bombe Doesn?t this frustrate you? [02:05]
HatesLongFiles a bit [02:05]
freeone3000 It'd be nice if people leveraged their existing expertise in corresponding domain systems to apply the same theory to other systems, yes. [02:06]
HatesLongFiles and (sampleView.getTag() as SampleViewHolder).clickableView?.setOnClickListener(this) crashes my app... [02:06]
freeone3000 HatesLongFiles: With what exception? [02:06]
HatesLongFiles java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.libkeyboard2/com.example.libkeyboard2.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.view.View.getTag()' on a null object reference [02:07]
cheeser there you go [02:07]
cheeser npe [02:07]
cheeser NullPointerExceptions are easy to spot and deal with. For some tips on dealing with them, please see [02:07]
HatesLongFiles and sampleView is null [02:11]
HatesLongFiles and it appears that the first line of the function is if (jsonObject==null) return null; [02:13]
Crash1hd Anyone able to assist me in understanding how to test a kotlin object? [02:16]
HatesLongFiles and its cus i have no widgit ._. [02:33]
HatesLongFiles great, json2view only operates on widgets -_- ffs [02:38]
aarobc [aarobc!uid151482@gateway/web/] has joined #kotlin [02:47]
henbruas [henbruas!~henbruas@unaffiliated/henbruas] has joined #kotlin [03:07]
t2mkn [t2mkn!~t2mkn@] has joined #kotlin [03:08]
worric [worric!] has joined #kotlin [03:11]
Crash1hd Hey all how does one test foo? In an object like this -> object foobar { private latent val bar:Bar foo(bar){ = bar} } Do I user sometime of assertThat or verify? I can get verify to work with mocking the object itself but that doesn't seem right [03:30]
cheeser junit [03:31]
cheeser cheeser, junit is a unit testing tool for java. See [03:31]
Crash1hd cheeser, I know of junit lol and fair enough my question maybe was not specific enough [03:33]
Crash1hd Just wondering how does one go about doing an assert on foo. I mean I can do asserNotNull(foobar().foo(Bar)) and mock out Bar but that seems wrong [03:35]
vigilanc1 [vigilanc1!~developer@unaffiliated/vigilancer] has joined #kotlin [03:35]
cheeser in general, i think mocks are wrong so i might not be the right one to answer [03:35]
Crash1hd I guess what I am asking is how do I verify that gets what I am asking it to get [03:35]
waz [waz!~waz@pdpc/supporter/active/waz] has joined #kotlin [03:44]
zutat [zutat!02f476cc@gateway/web/freenode/ip.] has joined #kotlin [04:32]
Dejan [Dejan!~dejan@unaffiliated/dejan] has joined #kotlin [05:05]
glosoli [glosoli!~glosoli@unaffiliated/glosoli] has joined #kotlin [05:39]
rruizt [rruizt!] has joined #kotlin [06:04]
gdrc hi guys, I don't get why when line 6 gets it, it doesn't actually return the value and exit from the function - any idea? thanks [07:03]
gdrc having the same behaviour with a normal for-in [07:09]
jdlee what does it return? [07:27]
jdlee iirc, return in a lambda exits just the lambda? [07:27]
gdrc it hits #6 and then cheeser #13 so it returns null [07:30]
gdrc i am very confused. [07:30]
gdrc i don't know why I typed c.heeser [07:30]
gdrc okay, was missing a return at #9, sorry :/ [07:37]
jdlee i missed that too :) [07:38]
taelore [taelore!~taylorrr@unaffiliated/taylorrr] has joined #kotlin [07:53]
Crash1hd [Crash1hd!~Crash1hd@unaffiliated/crash1hd] has joined #kotlin [08:02]
orbyt_ [orbyt_!~orbyt@] has joined #kotlin [08:11]
ziyourenxiang [ziyourenxiang!~ziyourenx@unaffiliated/ziyourenxiang] has joined #kotlin [08:16]
rruizt [rruizt!] has joined #kotlin [08:43]
kapil____ [kapil____!uid36151@gateway/web/] has joined #kotlin [09:44]
ChrisLane [ChrisLane!] has joined #kotlin [11:26]
kostrifon [kostrifon!~kostrifon@] has joined #kotlin [11:55]