Info

Login

Channels

APIs

Credits

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

« 2019-03-14

2019-03-15

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 https://developer.android.com/reference/java/lang/SafeVarargs [02:19]
HatesLongFiles HatesLongFiles's title: "SafeVarargs | Android Developers" [02:19]
Android [Android!~Android@cpe-172-193-55-193.qld.foxtel.net.au] 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 https://bpaste.net/show/9f8444241030 [02:50]
Android https://bpaste.net/show/d5a4288ef6d2 * [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 https://bpaste.net/show/fe04ff376713 [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@109.164.114.141] 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@31.28.114.241] has joined #kotlin [03:25]
Pitel [Pitel!~pitel@fw2o.masterinter.net] has joined #kotlin [03:28]
henbruas [henbruas!~henbruas@unaffiliated/henbruas] has joined #kotlin [04:01]
bravoslo [bravoslo!~bravoslo@178.162.204.214] has joined #kotlin [04:04]
HatesLongFiles [HatesLongFiles!~Android@cpe-172-193-55-193.qld.foxtel.net.au] has joined #kotlin [04:05]
glosoli [glosoli!~glosoli@unaffiliated/glosoli] has joined #kotlin [04:08]
padrepio [padrepio!~padrepio@62-11-54-188.dialup.tiscali.it] 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!~ppareit@d5152f254.static.telenet.be] 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!~rager@lolrav.es] has joined #kotlin [06:07]
Tazmain [Tazmain!~Tazmain@unaffiliated/tazmain] has joined #kotlin [06:22]
flamebeard [flamebeard!~flamebear@83.68.252.33] has joined #kotlin [06:28]
DiabloD3 [DiabloD3!foobar@exelion.net] has joined #kotlin [06:39]
lankanmon [lankanmon!~LKNnet@CPE64777d632383-CM64777d632380.cpe.net.cable.rogers.com] 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@31.28.114.241] 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@43.226.3.181] has joined #kotlin [09:21]
Pitel [Pitel!~pitel@fw2o.masterinter.net] has joined #kotlin [09:24]
t2mkn [t2mkn!~t2mkn@43.226.3.181] has joined #kotlin [09:59]
Crash1hd [Crash1hd!~Crash1hd@unaffiliated/crash1hd] has joined #kotlin [10:11]
ppareit [ppareit!~ppareit@d5152f254.static.telenet.be] has joined #kotlin [10:16]
ppareit [ppareit!~ppareit@d5152f254.static.telenet.be] has joined #kotlin [10:20]
t2mkn [t2mkn!~t2mkn@43.226.3.181] has joined #kotlin [10:51]
OtakuSenpai [OtakuSenpai!avraneel@unaffiliated/neel] has joined #kotlin [10:51]
ChrisLane [ChrisLane!~irc@cpc119606-heme14-2-0-cust161.9-1.cable.virginm.net] has joined #kotlin [11:09]
veegee [veegee!~veegee@ipagstaticip-3d3f7614-22f3-5b69-be13-7ab4b2c585d9.sdsl.bell.ca] has joined #kotlin [11:13]
rohdef [rohdef!~rohdef@90.184.72.135.1.fullrate.ninja] has joined #kotlin [11:30]
orbyt_ [orbyt_!~orbyt@172.92.5.20] has joined #kotlin [12:05]
padrepio [padrepio!~padrepio@62-11-54-188.dialup.tiscali.it] has joined #kotlin [12:16]
waz [waz!~waz@pdpc/supporter/active/waz] has joined #kotlin [12:19]
orbyt_ [orbyt_!~orbyt@192.211.15.73] has joined #kotlin [12:36]
pheerai [pheerai!~pheerai@92.117.152.231] has joined #kotlin [12:55]
esro [esro!~esro@user119-167.otvarta.com.pl] 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 https://github.com/Avocarrot/json2view/blob/master/sample/src/main/java/com/avocarrot/json2view/sample/MainActivity.java#L45 [01:17]
HatesLongFiles HatesLongFiles's title: "json2view/MainActivity.java at master Avocarrot/json2view GitHub" [01:17]
exonity01 [exonity01!~exonity01@HSI-KBW-046-005-156-193.hsi8.kabel-badenwuerttemberg.de] 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@31.28.114.241] 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 https://bpaste.net/show/4f6b94d31e18 [01:31]
freeone3000 HatesLongFiles: Your MainActivity no longer implements OnClickListener [01:33]
HatesLongFiles oh [01:34]
kapil____ [kapil____!uid36151@gateway/web/irccloud.com/x-jgckyistuunqjuyr] 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!~Funeral@102.79-160-144.customer.lyse.net] 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("http://www.avocarrot.com/"))) } [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 https://is.gd/bYdbFp [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? https://stackoverflow.com/questions/55188105/having-trouble-writing-unit-test-for-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/irccloud.com/x-fjfyeqgdhfdlsipn] has joined #kotlin [02:47]
henbruas [henbruas!~henbruas@unaffiliated/henbruas] has joined #kotlin [03:07]
t2mkn [t2mkn!~t2mkn@43.226.3.181] has joined #kotlin [03:08]
worric [worric!~worric@3e6b7560.rev.stofanet.dk] 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){this.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 http://www.junit.org/ [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 this.bar 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.2.244.118.204] 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!~rruizt@5354177C.cm-6-5a.dynamic.ziggo.nl] 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 https://pastebin.com/Mv17XBT5 - 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@172.92.5.20] has joined #kotlin [08:11]
ziyourenxiang [ziyourenxiang!~ziyourenx@unaffiliated/ziyourenxiang] has joined #kotlin [08:16]
rruizt [rruizt!~rruizt@5354177C.cm-6-5a.dynamic.ziggo.nl] has joined #kotlin [08:43]
kapil____ [kapil____!uid36151@gateway/web/irccloud.com/x-kdbbryakndmamqmg] has joined #kotlin [09:44]
ChrisLane [ChrisLane!~irc@cpc119606-heme14-2-0-cust161.9-1.cable.virginm.net] has joined #kotlin [11:26]
kostrifon [kostrifon!~kostrifon@31.28.114.241] has joined #kotlin [11:55]