bnagy

Activity Graph

Page 1 of 25 | Next »

2017-10-27

[08:07:18] bnagy: Client Quit

2016-07-04

[09:35:09] bnagy: Remote host closed the connection

2016-06-25

[20:21:53] bnagy: Ping timeout: 244 seconds
[20:22:02] bnagy: has joined #ruby

2016-06-24

[05:15:18] bnagy: Ping timeout: 246 seconds
[05:15:37] bnagy: has joined #ruby

2016-06-21

[09:06:43] bnagy: has joined #ruby
[09:36:07] bnagy: Ping timeout: 252 seconds
[09:48:42] bnagy: has joined #ruby
[09:53:42] bnagy: Ping timeout: 276 seconds
[10:05:02] bnagy: has joined #ruby
[10:09:57] bnagy: Ping timeout: 276 seconds
[10:20:43] bnagy: has joined #ruby
[10:25:42] bnagy: Ping timeout: 260 seconds
[10:26:05] bnagy: has joined #ruby
[10:32:49] bnagy: Remote host closed the connection
[11:26:35] bnagy: has joined #ruby
[11:33:28] bnagy: Ping timeout: 264 seconds
[11:45:30] bnagy: has joined #ruby
[11:50:04] bnagy: Ping timeout: 260 seconds
[12:01:12] bnagy: has joined #ruby

2016-04-21

[17:19:15] bnagy: *.net *.split

2016-04-18

[11:04:48] bnagy: has joined #ruby

2016-04-15

[15:29:07] bnagy: has joined #ruby
[17:38:51] bnagy: Ping timeout: 250 seconds
[17:39:00] bnagy: has joined #ruby
[19:22:54] bnagy: Ping timeout: 276 seconds

2016-04-13

[10:51:20] bnagy: Ping timeout: 268 seconds
[10:51:30] bnagy: has joined #ruby
[13:43:41] bnagy: *.net *.split

2016-04-12

[05:34:57] bnagy: Ping timeout: 276 seconds
[05:35:08] bnagy: has joined #ruby

2016-03-13

[18:13:02] bnagy: Ping timeout: 260 seconds
[18:25:31] bnagy: has joined #ruby

2016-02-27

[22:24:03] bnagy: Ping timeout: 252 seconds
[22:53:58] bnagy: has joined #ruby
[22:54:04] bnagy: has joined #ruby
[22:54:04] bnagy: Ping timeout: 276 seconds
[23:09:27] bnagy: rubber ducks r us

2016-02-26

[12:52:59] bnagy: omg hanmac is back
[13:04:31] bnagy: Garo_: I'd honestly suggest you rewrite
[13:04:56] bnagy: object integrity over IPC is .. suboptimal
[13:05:14] bnagy: just impose normal API barriers
[13:08:40] bnagy: a few things you said are confusing, but sending an object to an API and getting a new object back is an attractive pattern
[13:09:48] bnagy: "replacing variables" and "in my callstack long enough" I don't really grok
[13:10:55] bnagy: I guess mainly my point is that imho writing all your IPC as RPC tends to pay off in the long run
[13:12:26] bnagy: maybe 1% of applications really need multi-process plus shared memory, for everything else write it as RPC and you're ready for roflscale
[13:13:45] bnagy: tbh I even used to write jruby stuff (which has perfectly good threads) as if it were a multi process app, just because it's easier to reason about bugs
[13:16:19] bnagy: scepticulous: ||= is idiomatic
[13:17:07] bnagy: opinions probably start to differ wildly regarding conditionals following =
[13:17:36] bnagy: personally I wouldn't touch it with a stick
[13:18:15] bnagy: Garo_: everything I said doesn't apply if you need really high perf
[13:18:27] bnagy: it's purely aimed at cleaner code
[13:18:49] bnagy: but anyway, just my 0.02
[17:20:43] bnagy: *.net *.split

2016-02-24

[02:42:31] bnagy: Dusk_: looks like openssl failing to verify google's cert
[02:43:19] bnagy: Dusk_: this can either be a bad installation of the ruby openssl gem, which is less common now, or it could be your host root certs are bad / missing / not found by openssl
[02:44:05] bnagy: or, unlikely, none of those things
[02:44:32] bnagy: Dusk_: fixing them depends on your OS, but if you google for that error with ruby in the search somewhere you'll find a million people with similar problems
[02:44:51] bnagy: how did you install ruby?
[02:45:17] bnagy: oh, ew, windows, didn't even notice
[02:46:12] bnagy: tbh windows should have _less_ trouble re this particular issue
[02:46:26] bnagy: via rubyinstaller anyway, because they have to bundle everything
[02:47:36] bnagy: if you want to learn general ruby dev then you might consider a linux vm
[02:47:56] bnagy: windows is not really a well supported platform
[02:49:34] bnagy: (and try not to presume gender on irc ;)

2016-02-23

[02:29:16] bnagy: afaik the most foolproof way to do that is using binwrite
[02:29:22] bnagy: but print should work
[02:32:05] bnagy: it looks like everything gets sent in this AVL packet format
[02:32:57] bnagy: and the data in that is a data array
[02:34:55] bnagy: that's probably an artifact of the way you're receiving
[02:35:35] bnagy: can you sniff the comms from the thing you're trying to impersonate?
[02:36:47] bnagy: my guess is the data is \x08\x01\x01\x01
[02:37:20] bnagy: and you need to frame it in the TCP packet as described
[02:38:03] bnagy: \x00\x00\x00\x00\x04 [data above] [2 byte crc]
[02:38:54] bnagy: I think the app you are looking at is parsing the raw
[02:39:16] bnagy: which is why you only see \x00\x01
[02:41:24] bnagy: if you have this packetsender app maybe you can sniff the wire and see the raw response with tcpdump or wireshark or something
[02:50:16] bnagy: whichever side you're trying to impersonate

2016-02-22

[01:03:22] bnagy: bougyman: that's kind of a ridiculous diatribe
[01:03:33] bnagy: it is the heaviest version manager available
[01:03:46] bnagy: it is the least unix-like (cd hooks, script magic)
[01:04:01] bnagy: those are indisputable
[01:04:38] bnagy: the rest of what you said is personal experience. In mine, there are 4-5x as many people on here with hair pulling problems with RVM compared to the other two
[01:05:02] bnagy: and again IME usually those problems can't be fixed in here, we have to send people to the RVM channel
[01:05:09] bnagy: because it requires specialist knowledge
[01:05:31] bnagy: so, in summary, I think everything you said there is either wrong or baseless
[01:11:01] bnagy: so all rubies actually target a VM. The "standard" ruby targets a VM written in C called YARV
[01:11:18] bnagy: so your ruby gets turned into VM code not raw machine code
[01:11:28] bnagy: JVM is ruby targeting the Java VM
[01:12:04] bnagy: rubinius targets a VM called LLVM which is used for a ton of projects these days, it's a very good VM
[01:12:32] bnagy: which means they can implement a lot of stdlib in ruby because their VM translation yields good code
[01:12:59] bnagy: although I am slightly mixing the 'in theory' with the 'IRL' here
[01:13:32] bnagy: YARV translation is not very good, which is why most of core is actually written in C
[01:14:20] bnagy: well the methods are written in ruby
[01:14:37] bnagy: so they wrote the 'turn ruby in LLVM' part
[01:14:47] bnagy: LLVM takes care of emitting code that the CPU can run
[01:15:12] bnagy: so yeah, 'bootstrapping it' is an OK analogy
[01:17:25] bnagy: presumably
[01:18:07] bnagy: shuttup chrisseaton what would you know
[01:19:53] bnagy: rubynuby: you probably want select
[01:20:02] bnagy: numbers are not strings
[01:28:57] bnagy: ?anyone roccia
[01:30:39] bnagy: hays: you don't
[01:30:58] bnagy: hays: no first class functions, only procs blocks and lambdas
[01:32:23] bnagy: hays: uh I can't really answer that because I have no idea what you are doing or what you're using to assess best
[01:37:27] bnagy: it's a "not from here" shibboleth
[01:37:51] bnagy: roccia: sry, that's just IRC. If someone knows they'll answer.
[01:38:07] bnagy: be patient
[01:38:12] bnagy: or don't, I'm not the cops
[01:41:20] bnagy: looks pretty functional, which suggests not
[01:41:32] bnagy: but I dunno, it's still pretty abstract

2016-02-21

[22:10:16] bnagy: maybe you just got owned by glibc
[23:05:44] bnagy: using [] on an array is actually a method call, but if your variable is not yet defined then it's not an Array (or indeed anything)
[23:06:01] bnagy: ruby lets you shortcut create and assign via inference with like a = "foo"
[23:06:33] bnagy: only once the variable is attached to an object can you then call methods on the object
[23:11:05] bnagy: smart quotes :P
[23:11:50] bnagy: your client sends smart quotes, which confuses the interpreter
[23:11:58] bnagy: >> a = "b"
[23:13:42] bnagy: still smart quotes
[23:14:13] bnagy: if you can't see the difference between my line and yours then you have two problems
[23:14:35] bnagy: mine uses dumb quotes "" yours use smart quotes “”
[23:15:47] bnagy: it's probably a client setting, if not then a terminal setting
[23:16:38] bnagy: google "stop <name of your irc client> sending smart quotes" maybe
[23:19:52] bnagy: I have no idea what client you're using, and fixing IRC clients isn't really on topic
[23:20:45] bnagy: nothing to do with ruby
[23:21:12] bnagy: we're talking about why the bot here isn't eval'ing your >> commands correctly
[23:21:33] bnagy: and that is because your IRC client is sending the wrong quotes
[23:22:15] bnagy: I use chruby on osx
[23:23:10] bnagy: imho don't use macports / brew, just install either by hand or with ruby-install
[23:23:29] bnagy: (ruby-install after installing chruby according to the instructions)
[23:24:27] bnagy: don't use sudo
[23:25:46] bnagy: personally I hate it
[23:26:07] bnagy: some people like it, ymmv
[23:27:56] bnagy: I used rbenv for years with no problems
[23:29:07] bnagy: I just borg each new macbook via firewire from the old one, which is probably even more wrong :P

2016-02-19

[18:25:34] bnagy: *.net *.split
[18:25:51] bnagy: has joined #ruby

2016-02-18

[22:03:22] bnagy: sounds like an escaping problem
[22:03:52] bnagy: >> "\n".bytesize # for example
[22:05:50] bnagy: you'll still have to escape backslashes though

2016-02-17

[00:22:49] bnagy: Ox0dea: but you already did
[00:22:58] bnagy: 07:14 < Ox0dea> `rvm implode`
[00:24:17] bnagy: chruby ftw
[00:24:33] bnagy: but if you don't need to switch you can also just install ruby
[00:25:37] bnagy: zach2825: as a heuristic, most of these problems come from your 'ruby' and/or 'gem' commands not invoking the binaries you expect them to invoke
[00:25:52] bnagy: which is diagnosed with `which xxx`
[00:26:11] bnagy: or fixed with just killing everything with fire
[00:27:16] bnagy: trouble is that all the switchers have different magics that infect rc files
[00:27:50] bnagy: well that's not really a switcher
[01:07:53] bnagy: dnewkerk: that kind of regex is unmaintainable shite, don't use it
[01:08:04] bnagy: having said that, change the $ in the lookahead to \z
[01:12:32] bnagy: that regex makes me mad >:(
[01:12:42] bnagy: -{2}> >:(
[01:12:55] bnagy: [\s\S] >X(
[01:15:37] bnagy: not really. I am a huge regex bigot.
[01:16:13] bnagy: but -{2}> instead of just --> is just bizarre, same with [\s\S] - like.. say what you mean! SPACE OR NOT SPACE LOL
[01:16:48] bnagy: lookaheads are a good sign you've gone too far. It's like when you start writing functions in shellscripts
[01:16:52] bnagy: just stop and do it properly

2016-02-02

[03:37:16] bnagy: vishwa: playing around in irb is a good way to explore namespaces
[03:37:53] bnagy: basically you just need to find some toplevel constant that actually exists :)
[03:38:12] bnagy: but it's can't be ai4r because that's lowercase (so can't be a constant)
[03:39:29] bnagy: I'm actually completely fine with lying for didactic purposes
[03:41:35] bnagy: about a dozen ways :\
[03:42:52] bnagy: the first way that springs to mind is to turn it into one string and print that, eg with join
[03:43:13] bnagy: but there's also interpolation, or just iterating the collection and using print not puts
[03:43:55] bnagy: well a Fixnum is not an Array so maybe you're invoking join on the wrong thing
[03:44:09] bnagy: >> ['a', 3].join ' '

2016-01-31

[12:25:10] bnagy: *.net *.split
[12:29:47] bnagy: has joined #ruby
[12:35:49] bnagy: Remote host closed the connection

2016-01-28

[01:37:05] bnagy: ellistaa: google 'longest common subsequence'
[01:37:40] bnagy: there are a bunch of approaches of varying complexity, but it's a Hard problem
[01:38:25] bnagy: although making it a prefix makes it a lot easier
[01:54:50] bnagy: I think it's worth clearly separating two problems -> "make the string "4.2" into "4.20"" and "handle currency correctly"
[01:55:01] bnagy: because 4.20 as a number is nonsense
[01:58:50] bnagy: because the number is 4.2
[01:59:17] bnagy: right padding with zeros is to make columns line up, it has nothing to do with arithmetic
[02:00:05] bnagy: as a number it is nonsense. It is like calling 000 a number
[02:00:33] bnagy: and conflating presentation with values leads to pain
[02:02:50] bnagy: ModusPwnens: so if you want a string that's right padded with zeros them manipulate strings
[02:03:13] bnagy: because at least it's clear what you're doing
[02:03:35] bnagy: the units as dollars or cents is entirely a red herring
[02:04:00] bnagy: because there will always be fractional units in anything but the most trivial system
[02:04:34] bnagy: don't be dim
[02:06:41] bnagy: there's no difference in precision between 4.2 and 4.20 only in string length
[02:12:18] bnagy: I don't agree, but I have zero motivation for pedantic bikeshedding that's irrelevant to the problem
[02:13:03] bnagy: significant figures vs precision re 4.2 and 4.20
[02:33:34] bnagy: >> ['313233', '343536'].pack 'H*H*'

2016-01-26

[22:40:10] bnagy: that is the usual outcome when using regex
[22:40:49] bnagy: "I thought [something] so I tried with a regex and now I am sad" ~ Everyone, Ever

2016-01-25

[00:56:36] bnagy: _darinthompson: https://eval.in/507321
[00:57:07] bnagy: there are a few style things as well (which I didn't fix)
[00:57:48] bnagy: _darinthompson: and assigning to number_of_days in that method is useless
[00:58:06] bnagy: so basically I think you need to do locals versus ivars exercises :)
[01:01:05] bnagy: no it shouldn't that's crazy talk
[01:01:13] bnagy: https://eval.in/507322
[01:01:55] bnagy: _darinthompson: ^^ there I force it to use the accessor by referring to self
[01:10:05] bnagy: don't know tbh
[01:10:27] bnagy: you can probably just work it out by playing with how locals vs @ivars work in toy classes in irb
[01:10:49] bnagy: I don't know what's good these days for online exercises
[01:11:32] bnagy: _darinthompson: https://eval.in/507321 and https://eval.in/507322 both fix your core issue, although the first is 'right' in this case, the second is to make a point
[01:12:37] bnagy: is why we write code

2016-01-22

[17:05:09] bnagy: Ping timeout: 250 seconds
[17:44:32] bnagy: has joined #ruby

2016-01-21

[22:11:02] bnagy: that might make things a lot easier to wrangle
[22:11:27] bnagy: 05:43 < bnagy> meh either way, personally I tend to track OS pids and kill those, Threads are fiddly when combined with exec
[22:13:32] bnagy: nymous: I just looked up some old scrapers, back then I used celerity and capybara, and both were ok
[22:15:32] bnagy: I don't know what that means or why it's relevant
[22:16:32] bnagy: well you haven't managed to kill it at all yet
[22:16:52] bnagy: anyway do what you want, I'm not the cops
[22:19:42] bnagy: shellie: Rails
[22:19:45] bnagy: ACTION dies laughing
[22:20:23] bnagy: srsly though imvho writing code > reading code for learning ruby
[22:20:51] bnagy: "There's More Than One Way To Do It" leads to a pretty wide range of idiom
[22:22:01] bnagy: shellie: the style guide is worth a look
[22:22:28] bnagy: and will teach you good vs poor form in a more condensed form than reading complete libs / apps
[22:23:43] bnagy: ?quickref
[22:23:53] bnagy: shellie: ^^ that too
[22:25:59] bnagy: so much side-eye right now
[22:38:29] bnagy: that should work iff the target process sends more traffic
[22:40:37] bnagy: not sure that will make the client disconnect
[22:41:10] bnagy: right but dropping traffic won't make the client disconnect right away
[22:41:30] bnagy: -reject might work (looking at manpage)
[22:42:01] bnagy: you get an unreachable, that should make the tcp stack treat that as dead?
[22:42:52] bnagy: yeah, nothing much works without traffic being sent
[22:43:01] bnagy: except spoofing a RST from server
[22:49:56] bnagy: -reject >= -blackhole I think
[23:15:47] bnagy: roller123: please stop spamming
[23:16:15] bnagy: people heard you. Nobody is answering because they don't know or they're not active
[23:17:24] bnagy: np. Best bet is to hang around and idle. It can be hours before someone picks up a question
[23:17:47] bnagy: in the meantime you've opened an issue on the actual project, they're usually the best bet to help (just can be slow)