dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.1.0
irsol has quit [Remote host closed the connection]
djbkd has joined #cinch
irsol has joined #cinch
Azure has quit [Read error: Connection reset by peer]
Azure has joined #cinch
djbkd has quit [Ping timeout: 245 seconds]
djbkd has joined #cinch
djbkd has quit [Quit: My people need me...]
Trenal has quit [Ping timeout: 240 seconds]
Trenal has joined #cinch
postmodern has quit [Quit: Leaving]
catepillar has quit [*.net *.split]
catepillar has joined #cinch
<Netfeed> dominikh: i'm trying to write some sort of sql-interface for shits and giggles, and i'd like to show my row sets into structs
<Netfeed> (i which channel this is:)
<dominikh> Netfeed: just use an existing library, like sqlx :)
<Netfeed> yeah, i know i probably should use that instead, (and i know i have way too little go skills atm), but i just wanted to try and see if i could, and there's so much crap in sqlx
<dominikh> reflection is hard to get right in Go :)
<Netfeed> i've noticed, it's even easier in java :P
<dominikh> it's that way by design, though. reflection in Go should be a last resort, not a default solution
<dominikh> (it's also something that should only be touched by people who have a proper and good understanding of Go's type system)
<Netfeed> fuck that :)
<Netfeed> this problem would be much easier if there where some sort of generics
* dominikh sighs
<dominikh> generics would not even help you here in any way.
<Netfeed> i would be able to do the .(T) conversion though and i'd be done
<Netfeed> and i know the stance in what the go-devs thinks about generics :)
<dominikh> and how do you know, statically, at compile time, the field name, if it comes from an sql query? :)
<dominikh> so great, you've got an isntance of T. you don't know what fields it has, you don't know what fields to assign to
<Netfeed> well, the runtime has to solve that for me *cough*
<dominikh> maybe you're looking for an interpreted language? :)
<dominikh> I heard Ruby is quite dynamic :P
<Netfeed> it works in java doesn't it?
<dominikh> it works in Go, too, and probably in pretty much the same way: reflection. compile-time stuff like generics still won't help you here, it's strictly a runtime problem
<Netfeed> sqlx has solved it, that means that i can solve it, but i'm starting to think that this will take more time than i have to make it workable and it would probably be easier to just write the interface upon sqlx than database/sql :(
<dominikh> of course it's solveable. and of course it'll take time, especially if one is new to Go
<dominikh> or reflection. or both.
<Netfeed> and i would have written this in another language, but i need threads, and loads of them and i don't really want to use the jvm and i'd like to learn go :)
<dominikh> and you're learning it the wrong way ;)
<Netfeed> trial by fire
<dominikh> let's hope you're a dragon then.
<Netfeed> you sound a bit pessimistic :)
<Netfeed> this would be so much easier in perl :P
<dominikh> well, use perl then :P
<dominikh> I'm sure perl got threads
<Gizmokid2005> Oh you're a riot dominikh. I'm glad I've stuck around so far :)
<Netfeed> what's the fun in that
<dominikh> if that's your definition of a riot, you must have very boring friends :P
<Gizmokid2005> dominikh: you're implying I have friends :P
<Netfeed> awh, don't be a bummer
<Netfeed> ok, yeah, sqlx went a little bit faster to implement than doing it myself :)
<dominikh> no kidding
<dominikh> fwiw, the sqlx dev is a good dev
<Netfeed> i'm not doubting that
Zackio has quit [Ping timeout: 260 seconds]
postmodern has joined #cinch
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
_djbkd has joined #cinch
djbkd has quit [Ping timeout: 264 seconds]
_djbkd has quit [Ping timeout: 250 seconds]
djbkd has joined #cinch
djbkd has quit [Remote host closed the connection]
sarkyniin has joined #cinch
<sarkyniin> hey
<sarkyniin> how do I check if a user is op/sop/admin?
<sarkyniin> def is_admin?(user)
<sarkyniin> true if user.nick == $admin
<sarkyniin> this page uses that
<sarkyniin> oh wait
<sarkyniin> it specifies the $admin before
<sarkyniin> yeah thanks I guess for that doc age
<onewheelskyward> I think you mean @admin.
<sarkyniin> page
<onewheelskyward> oh, I'm wrong, it's outside of the class.
<onewheelskyward> Be careful with that, if injekt isn't there, anyone can assume the nick and use your plugin.
<sarkyniin> onewheelskyward: if m.user.oper? && query.user.oper?
<sarkyniin> could I use something like this?
<onewheelskyward> That'd be good, too,
<onewheelskyward> at least then they'd have to be op'd.
<sarkyniin> onewheelskyward: it doesn't work, for some reason
<onewheelskyward> Have a real-time debugger handy?
<sarkyniin> [2014/07/22 20:36:57.878] !! [New thread] For #<Cinch::Handler @event=:message pattern=#<Cinch::Pattern:0x0000000223d988 @prefix=nil, @pattern=/^!kb (.+)/, @suffix=nil>>: #<Thread:0x00000002141868> -- 1 in total.
<sarkyniin> [2014/07/22 20:36:57.879] !! [Thread done] For #<Cinch::Handler @event=:message pattern=#<Cinch::Pattern:0x0000000223d988 @prefix=nil, @pattern=/^!kb (.+)/, @suffix=nil>>: #<Thread:0x00000002141868> -- 0 remaining.
<sarkyniin> it just starts the thread
<sarkyniin> and ends it
<sarkyniin> I'm not even using it on someone op'd
<onewheelskyward> Does your thread do anything if the user is not op'd?
<sarkyniin> no
<onewheelskyward> mission accomplished.
<sarkyniin> wait
<sarkyniin> I think I know why it won't work
Zackio has joined #cinch
<ayonix> does query.user.oper even make sense?
<ayonix> hm yeah seems like it :D
geopet has joined #cinch
geopet has quit [Client Quit]
sarkyniin has quit [Quit: Quitte]