#ruby - 24 December 2017
« Back 1 day Forward 1 day »
[11:35:08] user3: i have read that when statement in ruby is an equivalent of ===() but when i try to use it with an if-else and comparing an Net::HTTPResponse object with Net::HTTPSuccess work only with when statement, so in what they differs ? (im sorry for my bad english)
[13:26:00] matthewd: user3: The order of the comparison is significant; you probably need it the other way around
[13:39:33] matthewd: It's a good way to get a handle on the codebase while doing something I'm already familiar with ¯\_(ツ)_/¯
[14:30:32] user3: matthewd no, i have make the comparison in the same order, but dosn't matter anymore
[15:16:31] nofxx: Trying to convert this snippet, missing something =/, -> https://gist.github.com/nofxx/9b2ea3f3a0629fd7012cd4610ddd335d
[15:55:29] dminuoso: Oh. Just looked as if you were kind of reimplementing that PHP Script line by line..
[16:04:19] nofxx: dminuoso, sorry made you look (PHP) but it's good sometimes, you can't know happiness if you don't know sadness said the poet
[16:05:21] dminuoso: As long as languages like PHP or Go exist, those braindead monkeys asking really stupid questions have their own channel, sub-reddit and SO tags.
[16:05:32] nofxx: dminuoso, I prefer $ before my numbers, is my common answer. But the dollar thing was nasty, this -> everywwhere thing is absurd
[16:06:08] dminuoso: nofxx: Honestly the visuals is the smallest thing. Ruby has some horrid things on its own, but its not really a meaningful factor in the quality of a language.
[16:07:07] nofxx: disagree... visuals is great, at a glance you get a lot from (well written) ruby code
[16:08:13] dminuoso: When your code is designed to read like a natural language, it leads to poorer abstractions.
[16:09:35] dminuoso: nofxx: Mostly everything revolving around method calls, optional/non-optional parens, blocks/hash
[16:11:17] dminuoso: nofxx: and then there's small things that Ive began to hate like how Ruby has poor support for real first-class functions.
[16:13:41] nofxx: yeah, singletons are ugly... parens could be consensus in your team, but w/o args kinda urgly. And blocks are nice, dunno a better way heh
[16:14:58] dminuoso: One that offers core extensions to patch.. basically anything that takes a block.
[16:16:56] dminuoso: That library suffers from multiple problems (which also arise from Ruby issues)
[16:17:50] dminuoso: and when you have to do l.(a).(b).. well lets just say I curry "the right way™"
[19:29:34] dionysus69: does anyone know how does p2p file transfer work technically? I am most interested in how can parts of file be downloaded from multiple sources at once and then combined
[19:30:36] dionysus69: how complex would it be to build something like that in ruby, say one pc is downloading 1 file from 2 other pc-s should I start from there? :S
[19:31:42] dionysus69: thing is I want to create such tool so I can build stuff on top of it, crypto world influence here hehe
[19:33:11] dionysus69: thanks allot, cause I was looking for implementing from scratch articles/tutorials and results werent that helpful
[20:53:34] dionysus69: there's divmod but it doesnt show how many times the divisor fits in the the number it is dividing
[21:20:03] dionysus69: dminuoso: sorry for ping but this is cool :D https://gist.github.com/webzorg/0723e58ddce6b99bf6f711cbcd6387cc
[21:20:31] dionysus69: I just created a download accelerator, and an important part of p2p file transfer :)