Bish

Activity Graph

Page 1 of 27 | Next »

2019-01-11

[09:42:47] Bish: has joined #ruby
[09:42:59] Bish: why does mail.from_addrs from the mail gem exist
[09:43:10] Bish: it just wraps ".from" inside an array
[10:46:44] Bish: canton7: my problem was that i have code like
[10:46:56] Bish: .to_address = "Something, Somethingelse <a@b.de>"
[10:47:16] Bish: the mail gem made this 2 addresses.. and it resulted in multiple sender addresses
[10:47:19] Bish: man that was hard to find
[10:48:04] Bish: canton7: i expected the mail gem to encode that
[10:48:20] Bish: canton7: slighty more? u mean the flaten thing?
[15:46:14] Bish: Remote host closed the connection

2019-01-08

[08:58:12] Bish: Quit: leaving

2019-01-07

[14:58:10] Bish: has joined #ruby
[14:58:25] Bish: why is net/http so weird, seperating GET/POST into classes?
[15:01:55] Bish: can't see the benefit of having "Request" Classes
[15:02:23] Bish: what do you do with them except for filling them with data
[15:02:37] Bish: so these things might aswell be parameters
[15:03:20] Bish: well response classes make sense, because they have: return code & content
[15:03:30] Bish: content alone would be useless if you don't know if it's 200
[15:03:35] Bish: that isn't true for requests
[15:04:22] Bish: well.. reponse classes contain more information than requests,therefor they're useful
[15:04:35] Bish: request only have a body and head, and they only get written never read
[15:05:01] Bish: mspo: weird, last time i checked they were different numbers
[15:06:23] Bish: well everything is
[15:06:39] Bish: mspo: how are they any different.. at low level
[15:06:42] Bish: head and body
[15:06:58] Bish: catphish: so is not using types at all
[15:07:36] Bish: yeah but good they're not part of the request in ruby
[15:07:44] Bish: since they have a class for those ^^
[15:08:27] Bish: catphish: guessing the style of fewer people, because i rarely see people use net/http
[15:08:32] Bish: always some httparty something stuff
[15:08:59] Bish: well i never got the benefit, it does http requests
[15:09:05] Bish: and you add a dependency for it
[15:09:12] Bish: i have only read / fixed code with it, not sure though
[15:10:32] Bish: like having your own function which then gets a parameter for being get post put patch whatever?
[15:22:49] Bish: catphish: so you write your function to get around the great comfort of having multiple requst classes

2019-01-05

[00:49:08] Bish: Remote host closed the connection

2019-01-03

[09:05:07] Bish: has joined #ruby
[09:05:17] Bish: & is intersect for arrays | is union
[09:05:19] Bish: is there also
[09:05:27] Bish: {a,b,c}\{b,c} == {a}
[09:07:02] Bish: im guessing - does that, but i always figured it gets the "difference"
[11:10:54] Bish: why does Chronic.parse("23.05.90") ⇒ => 2019-01-03 23:06:30 +0100
[11:27:40] Bish: yeah, that sucks
[11:30:23] Bish: damn americans
[12:57:39] Bish: Remote host closed the connection
[13:53:50] Bish: has joined #ruby

2019-01-01

[03:59:56] Bish: Ping timeout: 250 seconds

2018-12-17

[10:55:44] Bish: has joined #ruby

2018-12-06

[14:35:29] Bish: has joined #ruby
[14:35:39] Bish: somebody have a good gem for swagger defined apis?
[14:35:51] Bish: (client)
[14:50:30] Bish: swagger seems to be not in here, :o
[18:48:54] Bish: Quit: Lost terminal

2018-12-04

[09:50:19] Bish: Remote host closed the connection

2018-11-28

[10:36:01] Bish: has joined #ruby
[10:36:24] Bish: proc does not have a operator to chain methods right?
[10:37:08] Bish: something like &:to_f&:to_i
[10:43:16] Bish: yeah, that'd be cool
[10:43:40] Bish: but i can't see .map(p1 << p2) being a thing either :D
[10:44:31] Bish: the pipe would be cool
[10:44:57] Bish: .map(p1 | :p2 | p3)
[10:45:04] Bish: yeah i'd like that
[10:45:54] Bish: yeah let's use symbols we totally use for something different in our brain!
[10:46:10] Bish: while a pipe is like the defacto standard for chaining input and output
[10:46:19] Bish: even it's name says it
[10:46:27] Bish: ACTION sighs
[11:33:27] Bish: calling super in ensure, is that a thing?
[11:34:24] Bish: hm, it won't get the return value
[11:41:50] Bish: same thing, really
[11:42:27] Bish: marz_d`ghostman: well the thing that logs could have a reference to the logger
[11:42:58] Bish: kinda like
[11:43:08] Bish: App.loggers << Logger.new($stdout)
[11:44:19] Bish: marz_d`ghostman: rather MyApp.log
[11:44:53] Bish: same thing, really :p
[11:45:26] Bish: >> Class.is_a? Module
[11:45:42] Bish: marz_d`ghostman: you access constants of a module with ::
[11:45:49] Bish: methods aren't constants
[11:46:53] Bish: why does that work in the first place, hm
[11:49:03] Bish: what's a pretty way to get month,weeks,days,hours out of a time difference
[11:49:12] Bish: i can only think of some ugly inject
[11:51:21] Bish: if you're inside MyApp you can ask Configuration without prefix
[11:51:32] Bish: if you're deeper, or higher, you can't
[11:55:08] Bish: [30,7,1].each_with_object({a:69}).map { |e,res| result = res[:a]/e;res[:a] = res[:a]%e;result }
[11:55:18] Bish: why does that work.. why shouldn't it.. and how do i do it better?
[11:55:35] Bish: phaul: didn't they change that in more recent versions?
[11:55:56] Bish: well it still works in 2.5
[11:56:07] Bish: &>> RUBY_VERSION
[11:59:27] Bish: 2 month 1 week 2 days
[11:59:40] Bish: are 69 days, considering 30 day months
[12:00:13] Bish: a more readable approach would be cool, since is basicially "clock math"?
[12:00:40] Bish: and mfw i found it map works with each_with_object
[12:03:15] Bish: because references for numbers don't work, kinda like primitives i guess?
[12:03:18] Bish: Integers*
[12:03:49] Bish: they get duplicated before hitting the block
[12:03:57] Bish: or they're not mutable or whatever
[12:04:31] Bish: &>> x = 5; [x.object_id,(x+1).object_id]
[12:05:21] Bish: &>> x = 5; [x.object_id,[x].map{ |x| x.object_id }]
[12:05:40] Bish: guessing they're immutable
[12:06:59] Bish: but immutability is not the right term
[12:07:32] Bish: yeah thing is i need to carry through 2 values
[12:07:43] Bish: so i would carry on an array, which is the same thing
[12:10:38] Bish: guess there is no real pretty way to do that

2018-11-10

[01:19:54] Bish: Quit: leaving

2018-11-09

[10:48:04] Bish: has joined #ruby
[10:48:09] Bish: >> Integer === Integer
[10:48:23] Bish: why is that false :o
[10:51:05] Bish: i mean i get what it does.. but what is the logic behind that
[12:57:54] Bish: phaul: well i agree on the semantically broken thing
[12:58:10] Bish: i totally fell into the == ⇒ === trap
[13:21:16] Bish: biberao: just write something in ruby
[13:21:20] Bish: boom, u learned it
[13:21:37] Bish: ACTION 's guide to learning languages
[13:23:09] Bish: everyone is
[13:23:44] Bish: as i said, pick a project of your skill level work on it
[13:23:48] Bish: i suppose you want to do web?
[13:24:12] Bish: try to write the todo app with rails/sinatra/rails
[13:24:29] Bish: start by displaying a list of items, then add a form( u know those from php right? ), then save it
[13:24:45] Bish: rails/sinatra/roda *
[13:25:22] Bish: yeah, that's how i learned, too
[13:25:29] Bish: i actually hated rails, but everyone was doing it
[13:25:39] Bish: still hate, btw
[13:25:52] Bish: but same principle... pick a project of your skill level
[13:26:01] Bish: one of the first things i did was creating a generator for files
[13:26:20] Bish: say you have a folder template.. and you want to put that folder with parameters somewhere, like a javascript MVC thingie
[13:26:23] Bish: like yeoman
[20:33:52] Bish: >> a = ['/','\']; "#{a.sample}o#{a.sample}"
[20:34:00] Bish: &>> a = ['/','\']; "#{a.sample}o#{a.sample}"
[21:10:26] Bish: &>> (0..5).map { |x| (0..5).to_a.sample (1..5).rand }
[21:10:43] Bish: &>> (0..5).map { |x| (0..5).to_a.sample (1..5).sample }
[21:10:48] Bish: &>> (0..5).map { |x| (0..5).to_a.sample (1..5).to_a.sample }
[21:17:21] Bish: havenwood: was just going to confuse the audience
[21:17:25] Bish: bad code is good for that

2018-11-08

[14:02:18] Bish: *.net *.split

2018-11-07

[12:18:54] Bish: kann mir jemand mit geilem backlog sagen warum ich gehighlighted wurde?
[12:19:08] Bish: oopsy, i have been highlighted, can someone tell me who did it
[12:19:14] Bish: thought this was a german channel, sorry?
[12:19:31] Bish: nevermind i found it
[12:19:36] Bish: havenwood: yes, that's what i did, thank you
[13:26:26] Bish: hows before hoes

2018-11-06

[10:44:18] Bish: has joined #ruby
[10:44:49] Bish: i have a thingie in my code which looks like this
[10:44:57] Bish: use_cache! if File.basename($PROGRAM_NAME) == 'client_api_server'
[10:45:10] Bish: i switched to unicorn as a webserver, and this says "unicorn" now
[10:46:25] Bish: is there a clever way to find out what i started?
[13:55:54] Bish: hightower4: which is equivalent to $PROGRAM_NAME

2018-10-24

[09:11:24] Bish: has joined #ruby
[09:11:26] Bish: >> [true,false].repeated_permutation(5).first
[09:12:02] Bish: is that thing broken?
[10:43:22] Bish: that was too musk to ask sorry ruby[bot]
[10:43:53] Bish: didn't notice
[11:46:35] Bish: i've seen that snowman in a stackoverflow post regarding csv in ruby
[11:47:00] Bish: that guy did quote_char:'☃' so it doesn't quote anything
[11:47:16] Bish: since you cannot provide nil there
[12:02:17] Bish: whysthatso: nice nick
[12:07:31] Bish: would fit me well :>
[18:48:51] Bish: *.net *.split

2018-10-23

[08:49:48] Bish: WHATS UP RUBYFOOOLKS
[08:50:45] Bish: to the windoow \o\
[08:52:21] Bish: stemid: what's wrong with ruby >:|
[14:04:40] Bish: Ping timeout: 272 seconds

2018-10-22

[10:03:09] Bish: has joined #ruby
[10:03:21] Bish: how do i paginage 0..10000 in 512er steps?
[10:03:34] Bish: >> (0....2000000).each_slice(512).map(&:first)
[10:03:49] Bish: >> (0..2000000).each_slice(512).map(&:first)
[10:04:07] Bish: like this, or is there a better way?

2018-10-17

[11:59:11] Bish: since when is 2007-01-01 not valid 8601?
[11:59:21] Bish: >> Time.iso8601("2007-01-01")
[12:00:23] Bish: >> require 'time';Time.iso8601("2007-01-01")
[12:03:40] Bish: ArgumentError: invalid date: "2018-10-17"
[12:03:49] Bish: while this is taken from the wikipedia page of iso8601
[12:11:59] Bish: apeiros: but i don't know beforehand if i have a date part
[12:12:58] Bish: ruby - where method named after a standard, don't get you the standard
[12:13:20] Bish: and i remember this being differently
[12:13:26] Bish: different*
[12:17:44] Bish: bhaak: no, that code is super old
[12:18:13] Bish: apeiros: well, there will always be testcases that slip through
[12:18:28] Bish: like.. not testing a method that is named after an iso
[12:18:54] Bish: maybe i should test if nil.nil?

2018-10-04

[08:27:08] Bish: has joined #ruby
[08:27:23] Bish: is there a way to overwrite a method definition without changing the parameters?
[08:33:56] Bish: well if i don't want to change the behaviour of the method and just "add" things
[08:34:05] Bish: i do def method(*args,&block)
[08:34:14] Bish: which changes the parameter count from x to undefined
[08:35:33] Bish: something like, i don't want to change the behaviour at all
[08:35:39] Bish: just emit an event when it's called or something
[08:37:33] Bish: what's the difference?
[08:38:43] Bish: well it's possible with weird hacks like eval
[08:39:20] Bish: yeah you can call super in there, it's pretty much equivalent to inheritance.. isn't it?
[08:40:17] Bish: but they're pretty much equivalent.. aren't they
[08:40:22] Bish: if not: what's different?
[08:41:47] Bish: yeh, i know.. but that's jsut like redeininfg to_s of the class
[08:41:48] Bish: isn't it?
[08:43:36] Bish: oh, i see
[08:44:57] Bish: just because of error messages,, for example
[08:45:08] Bish: but i guess i could just through argument errors
[08:46:29] Bish: puuh, because it stops working when the gem gets updated?
[08:46:31] Bish: had this several times
[10:18:22] Bish: Pupeno: rubyist are actaully working instead of being in chat all the time :p
[10:20:17] Bish: and python is busy fixing 2.7 vs 3 issues
[10:20:26] Bish: or unicode
[10:56:25] Bish: so it's many datas not big data?
[10:57:01] Bish: catphish: what are you doing.. invoking a process and want to get it's stdout?
[10:57:32] Bish: ah. then just do it? i mean.. what are you expecting..
[10:57:37] Bish: something like stdin is ready to get data?

2018-09-20

[08:22:38] Bish: i've never seen this, yet i have written 2 programs doing both these things
[08:22:40] Bish: super odd
[09:01:48] Bish: i am using HTML, which the cod eis
[09:02:49] Bish: it's odd, even if i use it on the "broken" system
[09:02:51] Bish: it doesn't do it
[09:03:01] Bish: it doesn't remove the alt="" thingie..
[09:03:15] Bish: but i have some code that walks over it.. i expect the error to be there
[09:03:34] Bish: attribute.value,ph_info = URI.unescape(attribute.value).extract_with_regex(PlaceholderRex)
[09:03:48] Bish: no.. there is alt="" and after i walk over it.. it's alt
[09:03:59] Bish: im guessing if nokogiri itself sets it.. it will do just "alt"
[09:04:08] Bish: but if it parses it like "alt="""
[09:04:15] Bish: it will not omit it
[09:09:07] Bish: >> require 'nokogiri'
[09:09:07] Bish: even attribute.value = attribute.value seems to "break" it
[09:09:07] Bish: the code i posted is the cause
[09:09:07] Bish: yeah, definetely
[09:09:07] Bish: if it parsed it otherwise
[09:09:07] Bish: but it doesn't seem to do that
[09:09:27] Bish: interesting
[09:10:23] Bish: nono.. if you leave out the scond command, the output is different
[09:10:27] Bish: even though i say x = x
[09:10:42] Bish: wouldn't expect this
[09:12:21] Bish: the c-code seems to do that
[09:20:43] Bish: just copy my code
[09:23:15] Bish: attribute.value = new_value unless attribute.value == new_value
[09:23:21] Bish: this basicially fixes it for me
[09:23:30] Bish: kinda pointless code, but it does the trick
[09:33:44] Bish: what other differences are there for xhtml?
[09:33:46] Bish: i never knew
[09:36:03] Bish: i just feel weird that
[09:36:06] Bish: value = value
[09:36:11] Bish: changes something in the result
[09:36:29] Bish: and you can't really see it in the object-state
[09:41:12] Bish: yeah i figured
[09:41:23] Bish: that's what i said
[09:41:28] Bish: 11:11 < Bish> the c-code seems to do that
[09:43:52] Bish: i don't know.. both are correct htmls, but it really strikes me odd
[09:48:22] Bish: okay, will do