Activity Graph

Page 1 of 28 | Next »


[09:58:02] Bish: Ping timeout: 250 seconds


[13:00:44] Bish: kke: haha, that's good to know
[13:05:25] Bish: what's even to_hash isn't that to_h?
[14:32:21] Bish: kke: ** should be used with super extra care either way
[14:32:26] Bish: thanks for the enlightenment
[14:32:39] Bish: on the long/short thing


[10:04:56] Bish: can somebody tell me what problem conditionvariable solves
[10:05:03] Bish: i don't quit get it what its good forẞ
[10:05:32] Bish: canton7: why does and or && matter
[10:08:40] Bish: oh i see
[10:17:21] Bish: does Hash check existence of a thing with === ?
[10:18:47] Bish: well, if i do h[some_method_creating_a_new_object] = true
[10:19:03] Bish: == of those 2 objects is false, === of these 2 objects is true
[10:19:38] Bish: not really, trying to artificially create one right now
[10:21:26] Bish: class Test; def === b;true;end;end;
[10:21:36] Bish: h={};class Test; def === b;true;end;end;h[] = 1; h[] = 1;h
[10:21:49] Bish: can i somehow make that hash check for equality with === ?
[10:22:15] Bish: >> h={};class Test; def === b;true;end;end;h[] = 1; h[] = 1;h
[10:25:59] Bish: well Hash has 2 elements i want it to be one
[10:26:08] Bish: at some point Hash checks for equality
[10:27:04] Bish: oh im guessing i might be able to do that with the default proc
[10:27:53] Bish: well that's not what i am asking
[10:28:04] Bish: i don't want to change == of "Test"
[10:28:45] Bish: isn't eql? a alias of == or the other way around?
[10:29:12] Bish: well for the object im working on, it is :(
[10:30:40] Bish: Tuor: wrap it the code inside begin; <code>; rescue ErrorType => e; end;
[10:30:55] Bish: and lines behind that rescue will work for that errortype
[10:31:15] Bish: ljarvis: yeah and my question is if i can change that :/, i want a hash that uses ===
[10:32:05] Bish: ljarvis: background is my ORM, it uses equality(==) if content of rows are the same and === for the database ids
[10:32:27] Bish: i liked it until now
[10:32:30] Bish: and why?
[10:33:15] Bish: i don't follow
[10:33:33] Bish: last time i checked === can be whatever you like there is no "standard"
[10:33:41] Bish: and == works correctly
[10:37:06] Bish: why do == and === exists if you want them to be the same, the fuck?
[10:37:37] Bish: ljarvis: yes, to the last part
[10:38:00] Bish: and sure, === is a standard operator.. but NOWHERE used in the codebase of ruby standardlibrary (atleast as i hae seen)
[10:38:09] Bish: just for "case" and everyone knows that
[10:38:30] Bish: afaik === is exactly that the "case" equality
[12:04:34] Bish: al2o3-cr: what?
[12:05:38] Bish: al2o3-cr: i don't follow, what are you refering to?
[12:06:36] Bish: get a better hobby than trolling
[12:12:39] Bish: that depends on the purpose
[12:13:03] Bish: for web, yes
[12:38:32] Bish: cache.each do |k,(last_filled:,data:)| pattern matching like this possible in ruby?
[12:43:44] Bish: gotta know what "shit" is handed to me
[13:18:40] Bish: al2o3-cr: so i better write my own brainfuck interpreter so i don't have to know about it's features
[13:25:47] Bish: how bad is spawning a thread that is sleeping all day, unless it's woken up
[13:45:18] Bish: c-c: puh... i have a call inside my code that gets a Coupon code from a database
[13:45:30] Bish: it has to be a single code (bad software design)
[13:45:45] Bish: but it also has to be fast, because it gets called thousand times a second
[13:46:05] Bish: so i have a thread in background, that manages the cache (gets codes from the database ⇒ ram, when neeeded)
[13:46:46] Bish: no, it's just i have to start that thread somewhere, and doing it in the "get" call would mean, if i have to check if that thread is already spawned every call
[13:47:47] Bish: so, the get methods manages the cache itself?
[13:48:50] Bish: why is everyone in this channel in troll mood today? if you got so much better to do, go ahead and do it
[13:52:14] Bish: i did an antisocial comment?
[13:52:26] Bish: "that is beyond my skill"? do you mean that one?
[15:59:16] Bish: if a coniditonvariable#wait times out, does i still hold the mutex lock? i guess so, right?


[11:38:58] Bish: has joined #ruby
[11:39:24] Bish: is there a queue which can have timeout on .pop
[13:45:03] Bish: Xeago: like calling it non blocking and rettrying?
[14:01:27] Bish: marz_d`ghostman: no, never
[14:02:36] Bish: sarcasm, ofcourse someone has done that
[14:05:51] Bish: is Queue implemented in C?
[14:56:41] Bish: whats the gag about conditionvariables
[14:56:54] Bish: i mean.. can't you just re-open mutexes as you like?
[14:56:58] Bish: in that example on the man page
[14:57:53] Bish:
[16:35:18] Bish: ytti: im guessing that depends on what something is
[16:36:10] Bish: &> [1].map(&->(a=1,b=2){ a+1 })
[16:36:30] Bish: >> [1].map(&->(a=1,b=2){ a+1 })
[16:37:12] Bish: >> [1].map(& { |a,b=2| a+b+1 })
[16:37:41] Bish: ytti: also, if you want to call & with parameters you can help yourself with clojures & nasty hacks
[16:38:36] Bish: matsaman: i was thinking about something like overwriting .to_proc of Symbol
[16:38:47] Bish: then you could stuff like
[16:38:56] Bish: .each(&:_add_1)
[16:39:30] Bish: or implement a .to_proc for arrays
[16:39:47] Bish: and give parameters that way
[16:40:10] Bish: readability, people will hate you if you put that inside a gem
[16:40:48] Bish: Short is not readable, no
[16:41:09] Bish: assembler has the shortest statements i know, how is that readable
[16:41:19] Bish: or ask the haskellers about short = readable, they would say yes
[16:42:39] Bish: filterM (const [True,False]) [1,2,3]
[16:42:44] Bish: its super short, but what is it?
[16:43:12] Bish: took me days to understand whats happening there
[16:43:58] Bish: i disagree
[16:44:32] Bish: the code i posted solves a hard problem and makes it a simple one, even though you need a lot of learning to understand it
[16:44:53] Bish: monkeypatching to_proc introduces errors like hell and solves a really simple problem
[16:45:57] Bish: i think having clojures is a good way to go about it
[16:46:06] Bish: .each(&some_clojure_generator(3))
[16:46:11] Bish: tada, you have parameters in it
[16:48:37] Bish: well, it wouldn't be part of the language, either way
[16:48:49] Bish: a to_proc hack wouldn't be a part of the language
[16:49:19] Bish: a clojure on the other hand is a feature of ruby, my approach is more ruby as what you suggest
[16:50:48] Bish: matsaman: yeah if you want that as a feature in a language you want haskell :p
[16:51:07] Bish: what i wrote before was the implementation of this
[16:51:55] Bish: i never used pandoc


[09:30:05] Bish: Ping timeout: 245 seconds


[15:58:55] Bish: has joined #ruby
[15:59:01] Bish: there is nothing in default ruby that makes
[15:59:19] Bish: [{a:3}].map {|x| x[:a] } less cumbersome, right?
[16:00:06] Bish: phaul: im guessing u know what i want?
[16:02:33] Bish: |a:| holy shit that works?
[16:11:16] Bish: what is actually the reason hashes dont have method access to it's contents?
[16:11:29] Bish: as long as they're symbols
[16:11:45] Bish: because of things like {to_h:1}


[10:17:14] Bish: has joined #ruby
[15:01:22] Bish: Quit: leaving


[09:26:11] Bish: does rescue always change the return value of a block?
[09:26:23] Bish: begin;...;rescue ...;end;
[09:26:33] Bish: i remember something being fishy about that
[09:26:45] Bish: but i also fell into the trap using "return" inside a proc
[11:18:32] Bish: Ping timeout: 268 seconds


[10:51:20] Bish: isn't there a do missing?
[10:51:43] Bish: well it seems to be optional
[10:51:53] Bish: for x in y do;...;end


[14:39:56] Bish: (m = { content_type "text/plain; charset=UTF-8";body "text" }).convert_to_multipart;puts m.to_s
[14:40:02] Bish: any reason this should not be multipart?
[14:40:19] Bish: chruby and rvm sucks </opinion>
[15:32:18] Bish: isn't that more or less what happens by default in ruby
[15:32:59] Bish: i once wrote a module that takes a module and makes a method (fibonacci for example) memoized
[15:33:14] Bish: and i think i didn't use a single send. while that wouldn't have bothered me


[13:50:08] Bish: has joined #ruby
[13:50:12] Bish: yo rubyist
[13:52:01] Bish: szulak_: that's an okay choice, ruby is great!
[13:52:25] Bish: ruby will fuck you over with 2-3 things
[13:52:43] Bish: speed, threads mostly
[13:52:46] Bish: it sucks at those 2
[13:53:16] Bish: there will be people telling you otherwise, but that's straight up a lie!
[13:53:41] Bish: that is correct, but you will need to know about ruby internals then, quite well
[13:54:24] Bish: szulak_: don't do rails, rails also sucks ballz
[13:54:50] Bish: szulak_: when i started ruby.. i started using it for tooling.. and i thought it's fucking great(because it is)
[13:55:13] Bish: and everyone was doing rails.. and i could never get my head around it
[13:55:23] Bish: so i tried and tried, and still thought it sucks
[13:55:27] Bish: (still do)
[13:55:42] Bish: when i noticed there is a small minority of people using ruby as a webserver without rails
[13:56:20] Bish: i recommend looking into roda(my favourite) / sinatra
[13:56:40] Bish: but as you can see i have a strong opinions
[13:56:52] Bish: roda is sinatra on crack
[13:57:10] Bish: so does php
[13:57:34] Bish: szulak_: i would disagree, as i have tried real hard to do things with it..
[13:57:59] Bish: when i created my startup, i even started with php, because i didn't feel ready with ruby, that was until i noticed it's IMPOSSIBLE to write a good ORM with php
[13:58:34] Bish: tbuehlmann: yeah well, maybe your requirements of what a language/toolkit should do a lower than mine..
[13:58:48] Bish: but as i remember your name i know what you're talking about, sure you can do great things with php
[13:59:23] Bish: but as i said.. i tried really hard to write a ORM that fits my needs, literally impossible
[13:59:34] Bish: if you don't want to rewrite some things in C, that is
[14:02:23] Bish: &>> [1,2,3].map { |x| x.succ }
[14:02:41] Bish: &>> [1,2,3].map(& { |x| x.succ })
[14:02:50] Bish: &>> [1,2,3].map(&:succ)
[14:03:01] Bish: szulak_: does this help, these 3 things being the same thing ?
[14:04:27] Bish: it's a thing of beauty that &:symbol(in parameterlist) is the same thing as :symbol.to_proc which is { |x| x.symbol }
[14:04:46] Bish: is going to be deprecated, btw in 2.6 if i remember correctly
[14:05:10] Bish: it will be replaced by the stabby operator, which looks burrowed from the js people
[14:05:33] Bish: &>> (*1..3).map(&->(x){x.succ})
[14:06:27] Bish: uhm, where do i use the splat operator wrong there?
[14:06:55] Bish: ah, can only use it inside a parameter list, forgot about that one
[14:07:16] Bish: &>> [*1..3].map(&->(x){x.succ})
[14:07:55] Bish: szulak__: all cool
[14:07:57] Bish: &>> [*1..3].map(&->(x){x.succ})
[14:08:08] Bish: that will be it's replacement and "lambda" i guess
[14:11:20] Bish: there he goes
[14:11:53] Bish: szulak__: do me a favor and do it in roda :>
[14:12:04] Bish: and tell me if i am just heavily opionated
[14:12:27] Bish:
[14:12:58] Bish: that guy is the shit
[14:13:13] Bish: he also maintains the best ORM on the planet
[14:13:39] Bish: try it, you won't regret
[14:15:02] Bish: have a look at sequel and ROM in any case.. whatever you use as webserver
[14:17:17] Bish: im sure i did, since i searched a long time until i found sequel, but im looking into it why i thought it's bad
[14:18:33] Bish: well it looks very similiar, yes, true
[14:18:49] Bish: a little less ruby idiomatic code with those "include" statements, but other than that *shrug*
[14:18:56] Bish: things might have changed the last 4 years tho
[14:57:47] Bish: ACTION can't believe still nobody wrote a good http/2 serer for ruby
[14:57:57] Bish: i mean, okay, it's not rack compliant, but who cares
[14:58:09] Bish: freakin rails people
[14:58:45] Bish: doesn't have rails ⇒ we don't do it


[15:14:32] Bish: has joined #ruby
[15:14:57] Bish: does somebody here know a good trick to ignore tests when using the github search
[15:56:43] Bish: Ping timeout: 246 seconds


[09:34:34] Bish: Ping timeout: 246 seconds


[09:17:24] Bish: has joined #ruby
[11:03:43] Bish: <a href=""><table><tr><td><span>Test<span></td></table></a>
[11:03:54] Bish: can somebody explain to me why Nokogiri closes this a tag?
[11:07:00] Bish: it is closed
[11:07:04] Bish: (look at the end)
[11:13:04] Bish: well, try that line:
[11:13:13] Bish: Nokogiri::HTML("<a href=\"\"><div>t<table><tr><td><span>Test<span></td></table><span></a>").to_html
[11:13:50] Bish: Nokogiri::HTML("<a href=\"\"><table><tr><td><span>Test<span></td></table></a>").to_html
[11:13:53] Bish: rather this one
[11:14:03] Bish: result will have an empty a tag
[11:14:10] Bish: i want to know why
[11:19:49] Bish: <a href=\"\"></a>
[11:19:50] Bish: like this
[11:19:56] Bish: while this is not int he inüut at all
[11:21:23] Bish: i guess so, but i don't know
[14:07:05] Bish: old_relik: repeated_combination and each_char
[14:10:12] Bish: old_relik: well no that would rather be permutation
[14:10:30] Bish: but from your example it seems you want to keep the order?
[14:10:45] Bish: okay, hm
[14:11:54] Bish: why you want to do this, i was tackling a very similiar problem
[14:11:56] Bish: weeks ago
[14:12:23] Bish: i remember doing it with repeated_combination summing up
[14:12:53] Bish: ah, okay
[14:18:33] Bish: nope i am too stupid right now
[14:19:02] Bish: i would get all possible combinations of n numbers where n is (0..length_of_string)
[14:19:08] Bish: and split them
[14:19:13] Bish: at that poin


[09:40:19] Bish: has joined #ruby
[09:40:33] Bish: hello folks, out company tries to publish it's first gem
[09:40:54] Bish: when doing gem install it works flawlessly, when doing bundler install it says it installs but is yet to be found (by require)
[09:45:03] Bish: when doing that as root (i know i am not supposed to do that) it's also not showing up in the "global gem" folder
[09:59:56] Bish: okay, i get it..bundler does his own weird repository
[11:42:54] Bish: Remote host closed the connection


[10:29:41] Bish: has joined #ruby
[10:29:46] Bish: anyone worked here with sisimai?
[10:30:02] Bish: i try to do bounce handling of emails and sisimai does analyze the bounce state of an email
[10:30:12] Bish: but i can't get the bounce adress (including some sort of id)
[10:30:27] Bish: how would i get the return path of an analyzed bounce
[10:32:18] Bish: ACTION guesses not at all
[10:41:01] Bish: lunarkitty7: i know, but usually is one of the faster channels i lirk in
[10:41:15] Bish: but this beinga very special problem it might take time
[10:41:22] Bish: but i found a way anyways i think !
[10:44:35] Bish: yeah, sisimai allows to "hook" into the parse process
[10:44:37] Bish: that's great.
[13:20:32] Bish: RougeR: always depends i'd say
[13:20:51] Bish: but there wouldn't be a then if it shouldn't be done
[13:20:57] Bish: i like inline case statements
[13:30:59] Bish: > case 1 when Integer then "it's an Integer" end
[13:31:04] Bish: i don't see wher this is ugly
[13:31:47] Bish: more readable than x ? y : z if you ask me
[16:11:27] Bish: Ping timeout: 240 seconds


[10:46:44] Bish: canton7: my problem was that i have code like
[10:46:56] Bish: .to_address = "Something, Somethingelse <>"
[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