Activity Graph

Page 1 of 2 | Next »


[13:04:03] cdunklau: Quit: leaving


[13:42:29] cdunklau: konsolebox: you know java though right?
[13:42:31] cdunklau: at least ish?
[13:43:13] cdunklau: ponzii seems to be looking for what in Java parlance would be a "static class"
[13:44:42] cdunklau: i don't know enough about ruby to know what modules are, but in python a module is a thing (usually a file) that you can `import`, then you get a kinda "namespace object" which contains (usually) all the names you assign to inside the file
[13:45:19] cdunklau: this typically includes constants, free functions, and classes
[13:45:32] cdunklau: that is, the names refer to those objects
[13:45:49] cdunklau: konsolebox: ok
[13:46:16] cdunklau: konsolebox: so say you have a bunch of pure methods that you want to stick in a namespace that made them easy to use
[13:46:25] cdunklau: would you use a singleton class?
[13:46:37] cdunklau: ponzii: let's not go there :P
[13:46:44] cdunklau: include is an awful, awful thing
[13:47:06] cdunklau: konsolebox: via `require` right?
[13:47:55] cdunklau: i have much to learn about ruby
[13:49:59] cdunklau: konsolebox: ok so when you `require "math"`, assuming the math thing would be implemented in ruby... what would that file look like?
[13:50:55] cdunklau: konsolebox: such that you could then presumably use Math.asin(...)
[13:51:08] cdunklau: i'm not expressing myself effectively :(
[13:54:55] cdunklau: umesh: that looks like a call to me
[13:57:00] cdunklau: konsolebox: ok, so when you `require "somefile"`, it just dumps the names of whatever classes/modules defined therein into the require-ing file's namespace?
[14:04:38] cdunklau: konsolebox: well no i meant outside :)
[14:05:36] cdunklau: ponzii: i think making sweeping generalizations on little evidence is probably not a good tack to take :/
[14:06:04] cdunklau: also what is this, a contest?
[14:07:03] cdunklau: sure if you know python, and don't really know ruby
[14:07:18] cdunklau: i don't see how that's even remotely surprising though
[14:07:48] cdunklau: ponzii: it's not ruby's fault you're trying to do something silly :)
[14:08:52] cdunklau: trying to use language A's idioms to write code using language B
[14:09:19] cdunklau: (full disclosure, i'm a giant python fan, it's my main language)
[14:11:19] cdunklau: ponzii: C, C++, C#, JS, PHP (?), Bash, Java (?)
[14:11:44] cdunklau: i don't think any of those have an import-like thing
[14:13:33] cdunklau: i take JS back, apparently ES2015 modules are supported across a wide range of implementations by now
[14:15:26] cdunklau: konsolebox: ugh i feel bad that you've put so much effort into this, and i can't really grok it
[14:16:11] cdunklau: but thanks for trying :) it'll probably click if i wind up getting interviewed for a job i applied to that probably will want me to show ruby knowledge
[14:16:33] cdunklau: so i'll have a good reason to dedicate serious time to dig into ruby
[14:18:24] cdunklau: if you had two classes with the same name in different files, and you 'require'-ed both files, can you differentiate between them?
[14:18:30] cdunklau: or does one shadow the other
[14:19:30] cdunklau: Burgestrand: does 'require' really run it every time?
[14:20:05] cdunklau: so that's python-ish
[14:21:44] cdunklau: i must admit, i am quite surprised ruby doesn't have a "module" system like python or now JS or whatever
[14:22:47] cdunklau: ccooke: well wait do you mean "modules are different" or "the thing other languages call modules exists in ruby but is just different"
[14:25:44] cdunklau: ccooke: sure sure i get that
[14:25:51] cdunklau: i'm trying to differentiate :)
[14:26:18] cdunklau: Burgestrand: ...bleh
[14:26:29] cdunklau: that's disappointing
[14:28:55] cdunklau: Burgestrand: oh! so you can nest them
[14:29:04] cdunklau: ok then yeah it's not a huge deal
[14:29:41] cdunklau: so this winds up being like python, where the namespace is "flat" in the sense you can't have nested deps
[14:30:02] cdunklau: c.f. node/npm modules
[14:32:11] cdunklau: Burgestrand: oh no i don't mean that
[14:32:25] cdunklau: Burgestrand: node/npm has a concept of nested deps
[14:32:48] cdunklau: Burgestrand: so a "package" can have its own deps, in conflicting versions, and it's cool because it's all segregated
[14:33:39] cdunklau: ccooke: ok i think i'm beginning to understand
[14:33:54] cdunklau: Burgestrand: right ok. python's like that too
[15:05:49] cdunklau: ccooke: cool ok
[15:05:52] cdunklau: thanks everyone!
[22:02:17] cdunklau: al2o3-cr: they are, on my mac at least
[22:02:25] cdunklau: pico is nano


[09:54:37] cdunklau: grr12314: i'm still a babe-in-the-woods with ruby, but ISTM sudo gem install is something to be avoided
[09:55:41] cdunklau: grr12314: has an example of how to install a thing without using root
[09:55:44] cdunklau: grr12314: as it should! :)
[09:59:18] cdunklau: or just symlink it somewhere
[09:59:26] cdunklau: (somewhere inside PATH)
[11:26:25] cdunklau: grr12314: this is why sudo gem install is bad yes :)
[11:26:55] cdunklau: sudo <anything besides apt/yum/etc> install is bad that is


[08:47:36] cdunklau: Bish: "The return value is always true since every private key is also a public key."
[08:47:47] cdunklau:
[08:51:38] cdunklau: Bish: this might explain it


[09:25:44] cdunklau: a great source of confusion for newbies, that
[09:25:48] cdunklau: but yeah the explictness is nice


[14:39:48] cdunklau: catphish: forwarding keys isn't a great idea
[14:40:00] cdunklau: that is, forwarding the agent connection
[14:41:10] cdunklau: catphish: because it implicitly trusts the remote system to not be evil
[14:41:21] cdunklau: catphish: sure if you absolutely trust the remote box :)
[14:41:41] cdunklau: catphish: an alternative would be to do a port forward, and jump through that
[14:43:40] cdunklau: catphish: i do see :forward_agent
[14:44:12] cdunklau: catphish:
[14:44:38] cdunklau: catphish: ":forward_agent => set to true if you want the SSH agent connection to be forwarded"
[14:45:45] cdunklau: catphish: aha i missed that part
[14:45:55] cdunklau: i would doubt that, yes
[14:46:33] cdunklau: catphish: but you could probably spawn the agent yourself and add the key
[14:47:01] cdunklau: hmm that might require the key material to be on the disk though
[14:47:10] cdunklau: catphish: sure sure that's what ssh-agent's job is
[14:48:40] cdunklau: catphish: ok, will you be running this interactively
[14:49:20] cdunklau: catphish: oh, but the private key isn't encrypted, right?
[14:50:19] cdunklau: catphish: hmm wait what do you mean ssh-add - worked
[14:50:30] cdunklau: i thought the agent needed to see both pub and priv
[14:55:03] cdunklau: catphish: aha i hadn't considered that
[14:56:20] cdunklau: catphish: so yeah i think this will work: you run ssh-agent -s, parse out the env vars, set them in your program's environment, run ssh-add - and give it the key, then you should be good
[14:57:55] cdunklau: catphish: confirm this, but presumably net/ssh will look in the environment to get the agent info
[14:58:21] cdunklau: catphish: and ssh-add definitely needs it
[14:59:38] cdunklau: oh and make sure you kill the agent on cleanup :)
[15:00:30] cdunklau: catphish: oh it looks like you can tell ssh-agent what address to use for its domain socket
[15:00:42] cdunklau: catphish: so you might not even have to do the parsing dance
[15:01:42] cdunklau: catphish: i might also add a check that the pid is still alive
[15:05:03] cdunklau: catphish: why do you have to jump through systems though
[15:06:48] cdunklau: catphish: i'd probably do this via the backup server, and just have the management server tell the backup server to do it
[15:07:19] cdunklau: fewer hosts involved == more reliable
[15:08:26] cdunklau: i mean you have to have comms between the target server and the backup server, of course, but do you really want the whole thing to *also* depend on the management server <-> target server connection?
[15:08:59] cdunklau: that just seems brittle, especially for a presumably long-running thing like backup
[15:10:12] cdunklau: catphish: either way is the same number of hosts, sure, but my suggestion doesn't rely on all three of them communicating properly for the whole process
[15:10:27] cdunklau: brain food :)
[15:10:35] cdunklau: the network is evil
[15:11:12] cdunklau: who watches the watchers? :D


[10:36:08] cdunklau: isn't that just !(v && b)
[10:36:31] cdunklau: right that's modus ponens
[10:36:58] cdunklau: err wait no, modus ponens is with if/then
[11:16:03] cdunklau: apeiros: is it a laptop psu?
[11:16:21] cdunklau: almost certainly C6
[11:16:44] cdunklau: apeiros: do you not have any cord for it?
[11:17:47] cdunklau: apeiros: right but they have a cord, right?
[11:18:53] cdunklau: apeiros: it might be easier to find a pin adapter for the plug side of their cord, assuming the PSU is a switching supply, which it most likely is if it has a C6 inlet
[19:31:54] cdunklau: does ruby have some kind of standardized HTTP application interface?
[19:32:02] cdunklau: like, say, WSGI for python?
[19:32:24] cdunklau: Rack looks similarish
[19:41:09] cdunklau: cthulchu: js objects have string (or symbol) keys
[19:41:27] cdunklau: ruby's hashes can have anything as a key
[19:41:45] cdunklau: (modulo i don't know if hashability matters in ruby)
[19:42:12] cdunklau: cthulchu: JS does have a Map thing in recent versions
[19:42:23] cdunklau: gizmore: really?
[19:42:28] cdunklau: i'm a totally off?
[19:42:36] cdunklau: *am i totally off*
[19:44:28] cdunklau: gizmore: i don't know what that @hash thing does
[19:44:56] cdunklau: oh wait that's just the instance attribute sigel
[19:46:15] cdunklau: cthulchu: it's worse with python. a python "package" is a dir with python modules in it, not something you can really install (that would technically be a "distribution")
[19:47:11] cdunklau: cthulchu: ...what?
[19:47:42] cdunklau: cthulchu: you mean you have class A, and class B that inherits from A, but class A calls B?
[19:49:20] cdunklau: gizmore: hmm classes work fine as keys...
[19:49:50] cdunklau: gizmore:
[19:50:16] cdunklau: cthulchu: it might be reasonable, say you need to dispatch behavior based on the type of the thing you get
[19:51:06] cdunklau: gizmore: >> should do it
[19:51:13] cdunklau: >> puts 123
[19:51:48] cdunklau: cthulchu: yeah that sounds really bad
[19:52:33] cdunklau: does ruby have a module cache?
[19:53:13] cdunklau: like, in python, when you do `import foo`, and then in another file also `import foo`, the second time it happens it just does a hash table lookup, it doesn't reexecute
[19:53:53] cdunklau: gizmore: ...what?
[19:54:05] cdunklau: i'm having trouble understanding how that's relevant at all :)
[19:54:23] cdunklau: gizmore: like, you require a thing. the next time you require it, does it get reexecuted?
[19:55:17] cdunklau: terminology collisions :)
[19:55:41] cdunklau: in python a module is the object you get when you import a file
[19:56:13] cdunklau: apeiros: can Map have arbitrary keys?
[19:56:34] cdunklau: apeiros: i'm pretty sure everything in JS lacks a proper equality protocol :)
[19:59:03] cdunklau: cthulchu: do you mean a hash with the key "name" that refers to the value "asd"?
[20:01:46] cdunklau: !class method
[20:03:38] cdunklau: hmm. can someone point me to the doc that discusses class vs. instance method?
[20:05:43] cdunklau: apeiros: is that the proc thing
[20:10:22] cdunklau: is Class... a metaclass?


[10:42:15] cdunklau: the US does too. taxes can be applied at each level
[10:42:28] cdunklau: dminuoso: sure you do. Kreis ~= County
[10:43:17] cdunklau: dminuoso: district is a generic word, county is the normal US-specific one
[10:43:40] cdunklau: except in Louisiana, they have parishes instead
[10:45:21] cdunklau: i just don't know what the rules are for taxation at the various levels in germany. In the US, each administrative level can levy their own taxes
[10:46:15] cdunklau: i'm just a filthy Ausländer, i pay whatever they tell me :P
[10:46:23] cdunklau: (in germany)
[10:47:53] cdunklau: dminuoso: ah looks like it's similar, according to wikipedia at elast: "The municipalities and the districts (Kreise) can decide on some minor local taxes like the taxation of dogs (Hundesteuer)."
[10:48:02] cdunklau: s/elast/least
[10:52:58] cdunklau: (what's an ICO)
[12:18:03] cdunklau: dminuoso: how about a PEG
[12:18:10] cdunklau: (i have no idea how good that lib is)
[12:18:54] cdunklau: there's that damn word again :D
[12:24:23] cdunklau: dminuoso: jesus i do *not* know ruby well enough to even begin understanding that :d
[12:24:35] cdunklau: or is that even ruby
[12:25:58] cdunklau: dminuoso: is this something that works, or something that you wish worked? :)
[12:26:29] cdunklau: dminuoso: so the >-> and >> bits... are those just methods or what
[12:27:11] cdunklau: "stabby lambda"?!?
[12:30:01] cdunklau: wouldn't it be better to indent that
[12:34:17] cdunklau: dminuoso: would this be a reasonable indentation?
[12:38:40] cdunklau: i think this is so difficult for me because i'm not used to expression langauges
[12:45:41] cdunklau: i get the composibility part
[12:45:50] cdunklau: i just don't get how the fuck this code works
[12:46:53] cdunklau: dminuoso: hahah no
[12:47:13] cdunklau: dminuoso: you keep using that word. i do not think it means what you think it means :)
[12:48:19] cdunklau: ok that's clear
[12:48:56] cdunklau: dminuoso: -> str { ... } is the lambda, right?
[12:50:16] cdunklau: c, rest = str is that a real thing or shorthand for c, rest = str[0], str[1:] or so
[12:53:37] cdunklau: following yes
[12:55:52] cdunklau: { return [parser2( for pair in parser1(str)]; }
[12:56:00] cdunklau: if list comps are a thing
[12:56:12] cdunklau: or just some mappy thing
[12:56:54] cdunklau: { return -> str { return [parser2( for pair in parser1(str)]; }; }
[12:57:10] cdunklau: sequence = -> str { return -> str { return [parser2( for pair in parser1(str)]; }; }
[12:58:09] cdunklau: well no i did. the pair is the thing parser2 returns
[12:58:25] cdunklau: but i don't know if that's correct
[13:00:46] cdunklau: so that's like (Pair[]) -> Parser ?
[13:02:31] cdunklau: you lost me there. give me a bit
[13:02:37] cdunklau: let me roll it around in my head
[13:03:38] cdunklau: but your euro parser thing
[13:04:41] cdunklau: \d+,\d{2}€? is the regex right?
[13:06:46] cdunklau: samosaphile: python and ruby aren't as scary-looking
[13:07:05] cdunklau: dminuoso: let me mull this over for a bit
[13:14:18] cdunklau: dminuoso: i suspect this would be difficult to write reasonable in python because of how badly lambda is crippled... and a decorator API would probably look awful
[13:38:43] cdunklau: dminuoso: so far
[13:39:47] cdunklau: i'm still thinking about what you mean by the f with shape "take the result from a previous parser, and then *give a parser back*"
[13:47:03] cdunklau: dminuoso: sequence doesn't strictly need to be curried though, right?
[13:53:10] cdunklau: dminuoso: what's kf here bind = -> parser, kf { ... }.curry
[13:54:16] cdunklau: dminuoso: "result of the previous parser" meaning the list of pairs?
[13:57:01] cdunklau: dminuoso: that's a rather long-winded way of saying "yes" :)
[13:57:14] cdunklau: but that does illuminate things, sure
[14:03:39] cdunklau: dminuoso: so bind is just this?
[14:04:59] cdunklau: oh that's what you meant by map
[14:09:52] cdunklau: so when i map kf i get a list of parsers...
[14:10:17] cdunklau: [kf(pp.result) for result in parserA(string)]
[14:10:40] cdunklau: err s/result/pp/
[14:10:55] cdunklau: [kf(pp.result) for pp in parserA(string)]
[14:11:20] cdunklau: dminuoso: OH
[14:11:37] cdunklau: [kf(pp.result)( for pp in parserA(string)]
[14:14:38] cdunklau: dminuoso: pure is... ready_result -> string -> [Pair(ready_result, string)]
[14:16:25] cdunklau: dminuoso: a single specific character or just the first one
[14:18:31] cdunklau:
[14:18:38] cdunklau: item_parser
[14:21:04] cdunklau: dminuoso: satisfy returns a parser that does the thing right?
[14:24:57] cdunklau: oh bind has to be curried doesn't it
[14:30:16] cdunklau: this feels like one of those riddles that i'm so terrible at, where once you hear the solution it's all "duuuuuh that's obvious *now*"
[14:59:21] cdunklau: dminuoso: that did help. made me realize my bind is wrong, it doesn't concat
[15:26:34] cdunklau: dminuoso: so what's the point :)
[15:27:04] cdunklau: so are PEGs
[15:27:36] cdunklau: (PEGs are the only parser thingies used, so i don't really know what i'm talking about)
[15:27:46] cdunklau: s/used/i've used/