sdouglas has quit [Remote host closed the connection]
sdouglas has joined #ruby-lang
wallerdev has joined #ruby-lang
nofxx has quit [Remote host closed the connection]
sdouglas has quit [Ping timeout: 264 seconds]
tkuchiki_ has joined #ruby-lang
tkuchiki has quit [Ping timeout: 255 seconds]
centrx has quit [Quit: All this computer hacking is making me thirsty]
amerine has quit [Quit: Computer has gone to sleep.]
kalehv has quit [Remote host closed the connection]
amerine has joined #ruby-lang
ur5us has quit [Remote host closed the connection]
agrinb has quit [Remote host closed the connection]
agrinb has joined #ruby-lang
JoshuaPaling has joined #ruby-lang
Wardrop has joined #ruby-lang
amclain has quit [Quit: Leaving]
sdouglas has joined #ruby-lang
<Wardrop>
Can anyone tell me what a safe method of processing a file path is. For example, I have an endpoint in my web application that takes a path. This path will be joined to some prefix, i.e /opt/data, but want to prevent directory traversal attacks. Does Ruby provide any built-in methods for doing this. Something like #expand_path but which doesn’t do directory traversal (i.e. ../../etc/blah)
marcdel has quit []
cschneid has quit [Ping timeout: 240 seconds]
sdouglas has quit [Ping timeout: 252 seconds]
<Wardrop>
I suppose just validating the result of #expand_path is the best approach.
<wallerdev>
i dont think ruby provides any tools for that
<wallerdev>
and it can get complicated
<wallerdev>
like if you have a symlink or something
yubrew has joined #ruby-lang
sdouglas has joined #ruby-lang
toastynerd has joined #ruby-lang
<johnny5>
yeah, if you consider /opt/data to be safe you simply shouldn't be able to get out of it via traversal
karamazov has quit [Read error: Connection reset by peer]
karamazov has joined #ruby-lang
cschneid has joined #ruby-lang
yubrew has quit [Ping timeout: 276 seconds]
AKASkip has joined #ruby-lang
vpretzel has quit [Ping timeout: 250 seconds]
apeiros_ has joined #ruby-lang
nofxx has joined #ruby-lang
nofxx has quit [Changing host]
nofxx has joined #ruby-lang
apeiros has quit [Ping timeout: 240 seconds]
swills has quit [Ping timeout: 240 seconds]
tkuchiki_ has quit [Remote host closed the connection]
tkuchiki has joined #ruby-lang
omosoj has quit [Ping timeout: 255 seconds]
swills has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
rolfb has joined #ruby-lang
swills has quit [Changing host]
swills has joined #ruby-lang
Guest62510 has quit [Remote host closed the connection]
_ht has joined #ruby-lang
khaase has joined #ruby-lang
khaase has quit [Changing host]
khaase has joined #ruby-lang
WishBoy- has quit [Remote host closed the connection]
rahul_j has quit [Quit: rahul_j]
WishBoy has joined #ruby-lang
dnewkerk-keyz has joined #ruby-lang
havenwood has quit []
agrinb has quit [Remote host closed the connection]
<toretore>
i think these kinds of things are usually done with eval
luiz_lha has quit [Ping timeout: 240 seconds]
yubrew has joined #ruby-lang
<apeiros>
sssczy: `Kernel.send :define_method, :each_event do |&block|` <-- no. just no.
<apeiros>
don't define public instance methods on Kernel.
luiz_lha has joined #ruby-lang
<apeiros>
also hiding local variables in a lambda --> ew
<toretore>
what's wrong with that?
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ColdBlooder has joined #ruby-lang
agrinb has quit [Ping timeout: 264 seconds]
<ddfreyne>
It's a very JavaScripty approach
allomov has joined #ruby-lang
<ddfreyne>
I don't mind it
<toretore>
functional
<toretore>
it's not "hiding" as much as "introducing a new scope"
tomkadwill has quit [Remote host closed the connection]
<apeiros>
toretore: it's hiding. it means you can't reach that information from anywhere
<apeiros>
and I do mind it. it has nothing functional about it.
<apeiros>
(mutable state isn't functional)
<toretore>
the mutability has nothing to do with the scope
dsp___ has joined #ruby-lang
<toretore>
and as for the "hiding", it's called encapsulation ;)
<ddfreyne>
Functionality has nothign to do with mutability. There's pure vs impure functional langauges too
<apeiros>
toretore: eh, no
yubrew has quit [Ping timeout: 255 seconds]
<apeiros>
there's a *huge* difference between hiding and encapsulating.
Mon_Ouie has quit [Ping timeout: 252 seconds]
<toretore>
class Whatever; def initialize; @setups, @events = [], {}; end; end
<toretore>
what's the difference?
<apeiros>
the difference is that that is encapsulation and not hiding.
<toretore>
but you haven't explained the difference between hiding and encapsulation, so it's still the same thing
tomkadwill has joined #ruby-lang
<apeiros>
toretore: how do you inspect the values of setups & events in his code?
D9 has quit [Quit: Leaving]
<apeiros>
that's why it's hiding
* apeiros
off to work
<toretore>
from the outside? you're not supposed to
<toretore>
that's what encapsulation is
<apeiros>
you have a misunderstanding there.
<apeiros>
you're not supposed to change it
<apeiros>
that's not the same as you're not supposed to have any way to observe it
<apeiros>
(or rather, you're not supposed to change it without going through "approved" channels)
<toretore>
that's true for ivars too, until the class *provides* a way
<bougyman>
nah, you can always #instance_variable_get
<apeiros>
^
<bougyman>
but, for that matter, you can #instance_variable_set, so they _can_ be changed.
<apeiros>
anyway, really got to work now.
<apeiros>
bougyman: correct. but then we get into the topic of hand-holding developers
<toretore>
yeah and for the lambda you can do lambda.binding.local_variable_get/set
<apeiros>
and using procs/lambdas to hide state is just precisely that
<apeiros>
hand-holding devs
<apeiros>
which is yucky, stupid and pointless.
fijimunkii has joined #ruby-lang
<toretore>
you are so wrong apeiros and i am right
<apeiros>
anyway, really really off now :-p
<apeiros>
toretore: u so stupid!!! u can't find ass with both hands!!!!!!!1! :-p
<toretore>
great, glad we got that settled. i was right all along :P
<ddfreyne>
What's wrong with hiding, and providing a way to query those variables?
<toretore>
this is exactly the way encapsulation is done in fp
<ddfreyne>
I like providing functionality that is necessary, and not giving access to all my instance vars just because they happen to be instance vars
<ddfreyne>
There's two schools of thought clashing here
ikrima has quit [Ping timeout: 240 seconds]
<ddfreyne>
Both are fine
<ddfreyne>
DISCUSSION OVER
<toretore>
encapsulation with objects introduces mutable state, which most would agree could be considered bad
<ddfreyne>
I started doing lambda encapsulation since I got into JavaScript a few days ago
elia has quit [Quit: Computer has gone to sleep.]
<ddfreyne>
(JavaScript is actually a nice language if you forget about the awful parts)
<toretore>
js is quite elegant
Sirupsen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<toretore>
much more so than ruby in its implementation
<ddfreyne>
It's not elegant when jumping into an existing project and fixing bugs and adding features
<ddfreyne>
That's awful.
<toretore>
ruby is messy
<toretore>
ruby trades being "elegant" for allowing "elegant" code
<apeiros>
I do not argue against using lambdas for state in JS.
<toretore>
js is the other way
<apeiros>
but ruby *is not* JS
<ddfreyne>
apeiros: I thought you were off!
<apeiros>
I am
<apeiros>
this is just my echo
<ddfreyne>
Liar liar pants on fiar
<ddfreyne>
I have to go
<ddfreyne>
AFK
<apeiros>
naw, waiting for the deploy to finish
<ddfreyne>
(this is how you to it)
allomov has quit [Remote host closed the connection]
<toretore>
go back to work apeiros and stop questioning my brilliance
johnny5 has joined #ruby-lang
<toretore>
yorickpeterse: 2.1.1p76 works fine too
<apeiros>
ddfreyne, toretore: explorable code is valuable. there is zero reasons to use a lambda to hide your data. I repeat - the only reason to do that is to hand-hold other developers ("no, you must not see this"). which is a) fucking stupid and b) utterly annoying as it makes code much less explorable.
<apeiros>
and no, you don't need to provide accessors to them (since you encapsulate it), but with ivars, you don't hide them from rubys introspection tools (ivar_get/_set)
<apeiros>
so really, if you want to write fucked up code, do it. but I'll call it out as fugly and annoying.
<toretore>
haha
<toretore>
ivar_get/set doesn't count
<apeiros>
"because I say so"?
<apeiros>
it exists. it counts very much.
<toretore>
if you want to expose the data, do it explicitly
<apeiros>
eh, no.
cHarNe2 has joined #ruby-lang
<toretore>
and, as i said above, so does lambda.binding.lvar_get/set
<yorickpeterse>
toretore: hmpf
<apeiros>
I did *not* say you should *expose* the data.
kalehv has joined #ruby-lang
<apeiros>
you're still not getting the difference between encapsulation and hiding.
<yorickpeterse>
toretore: what do you have in /etc/sysctl.conf ?
<toretore>
you still haven't explained it apeiros ;)
<apeiros>
with hidden stuff, I have no means of introspection. you're intentionally robbing me of those.
<toretore>
yorickpeterse: nothing, so defaults
<apeiros>
encapsulated stuff is data for which I provide "sanctioned" access (accessors, specific methods)
<toretore>
sure. but ivars alone are not that
<apeiros>
so yes, hidden data is encapsulated, but not just. it's also hidden. but the term encapsulation alone doesn't imply hidden.
<toretore>
if you made your argument with getters and setters it would make more sense
Mon_Ouie has joined #ruby-lang
<apeiros>
toretore: ivars are by default not accessible. so yes, they are exactly that.
<apeiros>
adding a getter/setter is providing a sanctioned access.
<toretore>
i'm not following
<toretore>
how is it any different from an lvar in that regard?
elia has joined #ruby-lang
<apeiros>
*sob*
ylluminate` has joined #ruby-lang
<apeiros>
IT. IS. NOT. HIDDEN. FROM. INTROSPECTION.
<apeiros>
introspection is not a sanctioned way
<apeiros>
but it is part of the language
<toretore>
and neither is the lvar, as i've explained a few times now
<apeiros>
lvar_get/set is 2.1+
<apeiros>
so yes, it is
<toretore>
you are making a big deal out of something that's not
ldnunes has joined #ruby-lang
<toretore>
any fpers reading what you write would disagree quite violently
<toretore>
(cue "ruby is not fp")
<apeiros>
toretore: dude, if you want to write haskell in ruby, you're doing it wrong
Sirupsen has joined #ruby-lang
<apeiros>
and I'll tell that to any FPer
<yorickpeterse>
but functional programming is fast
<yorickpeterse>
You can not achieve that performance in an OO language
<toretore>
lol
<cout>
yeah, everyone knows you should be writing intercal in ruby
shinnya has joined #ruby-lang
<toretore>
objects are evil
<apeiros>
seriously, if you want to hide your data in lambdas, go use a language where that is idiomatic
<[spoiler]>
Has anyone tried AWS's Route 53? I can't really think of when it's *really really* useful. Is there ever a situation where you'll have *that* many DNS queries?
<apeiros>
but if you use it in ruby, it's just and simply *bad code*, period.
<toretore>
i am a free man and i do as i please thank you very much!!!!!1
kalehv has quit [Remote host closed the connection]
<toretore>
[spoiler]: i use it. not for anything special, just regular dns
elia has quit [Ping timeout: 255 seconds]
elia has joined #ruby-lang
<[spoiler]>
Oh well. I was curious if there's any special advantage to it. Thanks
<yorickpeterse>
[spoiler]: we use Route 53 extensively
dsp___ has quit [Remote host closed the connection]
<apeiros>
btw. toretore, re "you are making a big deal out of something that's not" - seems like you make it the same big.
dsp___ has joined #ruby-lang
TvL2386 has quit [Quit: Ex-Chat]
<toretore>
i'm not the one getting angry ;)
<apeiros>
now you're reading something into my words which isn't there
<sssczy>
thank you all. I don't quite understand, but I will try to learn
torrieri has joined #ruby-lang
Lewix has joined #ruby-lang
arBmind1 has joined #ruby-lang
michaeldeol has joined #ruby-lang
vpretzel has quit [Quit: Adios!]
arBmind has quit [Ping timeout: 255 seconds]
vpretzel has joined #ruby-lang
<elia>
btw I hate unaccessible "private" vars too, you don't do that in Ruby (and I don't do it in JS too, because opal) cc: apeiros, toretore, ddfreyne
tkuchiki_ has joined #ruby-lang
torrieri has quit [Ping timeout: 264 seconds]
<elia>
also think twice even if you access your ivars from the same class (instead of using some accessor method)
* elia
is late at the party
<ledestin>
elia: so, can you avoid most of JS when using Opal?
<elia>
ledestin, sure
r0bby has quit [Ping timeout: 240 seconds]
<elia>
you can still access it by using x-strings (`` %x{}) but you just won't most of the time
yubrew has joined #ruby-lang
tkuchiki has quit [Ping timeout: 258 seconds]
yubrew has quit [Client Quit]
tkuchiki_ has quit [Ping timeout: 252 seconds]
<ledestin>
elia: do you use any js frameworks?
<elia>
For the biggest thing I did with it I used a modified version of Vienna, which is an Opal MVC
<elia>
similar to backbone
AncientAmateur has joined #ruby-lang
<elia>
ledestin, on another I made an existing half-built backbone app use some opal classes
<ledestin>
hmm, I didn’t know there was an Opal mvc. that should be great
miqui has quit [Read error: Connection reset by peer]
<ledestin>
elia: the latest “game of life in Opal” I didn’t like at all
thmzlt has joined #ruby-lang
thmzlt has quit [Client Quit]
<ledestin>
so horribly written and full of ``
<elia>
yeah, agree
thmzlt has joined #ruby-lang
<ledestin>
I switched to looking at JS frameworks, but they all suck. Knockout is left to look at.
minivan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ddfreyne>
I'm wirting my own JavaScript framework!
<ddfreyne>
For gaming!
beef-wellington has joined #ruby-lang
<elia>
back to the original topic, most JS frameworks will ask you to use getter/setters to access properties
<ledestin>
ddfreyne: I’d rather not deal with JS at all
<elia>
well, maybe not gaming frameworks :)
<ddfreyne>
ledestin: JavaScript is a nice language. I used to hate it until two weeks ago
<ddfreyne>
But it's surprisingly elegant
<elia>
cough cough
<elia>
:)
<ledestin>
var nightmare?
<ledestin>
elegant?
SilkFox has quit [Ping timeout: 240 seconds]
minivan has joined #ruby-lang
<elia>
ddfreyne, what made you change your mind about JS?
<ddfreyne>
var is not a nightmare if you deal with it properly (i.e. you always use var)
<ledestin>
ddfreyne: well, we differ much in our assessment
<ddfreyne>
elia: Starting my own JavaScript project from scratch and spending enough time to understand the language
r0bby has joined #ruby-lang
<ddfreyne>
ledestin: What assignment is that?
<ledestin>
ddfreyne: they should have either made proper scoping or made possible var at the beginning of a function (so that everyone can see the shitty language for what it is)
<ledestin>
*only at the beginning
<toretore>
define proper scoping
<ledestin>
new block - new scope
<[spoiler]>
Hmm. I never had a problem with JavaScript that most people seem to have. It's not perfect, but it is what it is; I accept it.
<ddfreyne>
ledestin: Yup, those were mistakes in the language
<ljarvis>
psh, javascript is shite
<toretore>
you mean let?
tkuchiki has joined #ruby-lang
<ledestin>
toretore: let would od it
<toretore>
hating on languages is a useless and revealing excercise
beef-wellington has quit [Ping timeout: 240 seconds]
<ledestin>
if it worked
<ddfreyne>
What toretore said -^
<ledestin>
hate leads to Opal or something
<ddfreyne>
(Except for PHP)
<elia>
lol
<[spoiler]>
I hate PHP, though. I work in it at least once a week, but I loathe that language
<[spoiler]>
My hate for PHP is unfathomable.
<ljarvis>
PHP, no differently from JavaScript, is fine once you know where and how much it sucks
<ljarvis>
that doesn't make them not suck, though
<toretore>
how does js suck?
<elia>
let's say "wanting to make oneselves life better" leads to opal
<ddfreyne>
toretore: Variables global by default, for instance
<ddfreyne>
Or the 'with' keyword
<[spoiler]>
ljarvis, same can eb said for any language, though. it depends in how many areas it sucks, how much it impacts productivity, performance and other factors
<toretore>
it is only a problem id you don't understand how it works
<toretore>
if*
<ddfreyne>
Or being able to callf unctions with the wrong number of arguments and not getting a warning, let alone an error
<toretore>
which is also beneficial in certain circumstances
<ljarvis>
even if it was written by Gary
<[spoiler]>
ljarvis, the wat talk is getting old lol
<ddfreyne>
Or ==, which you should never use
<ljarvis>
[spoiler]: I don't disagree, but it's still relevant
<elia>
toretore, I think ruby does the right thing not allowing ivars to leak and having external stuff always access them via methods
<toretore>
rubyists are the worst
<[spoiler]>
toretore, We are just spoiled ;)
<toretore>
elia: it also means ruby doesn't have first class functions
<elia>
of course that is not just "the ruby way" most langs (including several js frameworks) want you to do that
<ljarvis>
im not saying ruby doesn't have parts that suck, im just saying it sucks less than js
<toretore>
and you get stuff like lambda.()
<[spoiler]>
toretore, ruby has methods, not functions
<elia>
toretore, yeah you right, but that's the 20% case and I'm happy to have a better 80%
r0bby has quit [Ping timeout: 252 seconds]
<wm3|away>
elia: ruby does the right thing forcing ivars to always be accessed via methods... but then it provides you with the 'instance_variable_get' and 'instance_variable_set' methods :)
<elia>
toretore, (also you have #call and #[])
<toretore>
but it's still not a first class function
<elia>
wm3|away, that's called sugar/vinegar
wm3|away is now known as workmad3
<toretore>
it's a compromise that was made
<ljarvis>
lets be honest they're really for metaprogramming
<elia>
toretore, does 1st class fuc have intrinsic value?
enebo has joined #ruby-lang
<ljarvis>
[spoiler]: I always avoid pointing that out as our answer to not having first class functions
<toretore>
of course
<ljarvis>
[spoiler]: (because it sucks) :D
<toretore>
ask any functional programmer
<[spoiler]>
ljarvis, haha it's not perfect, but it's ~a thing~
<ljarvis>
aye
<toretore>
rubyists think ruby is the end all be all of languages, and that is going to be its bane
yatish27 has joined #ruby-lang
<ljarvis>
I don't think that at all
<toretore>
too obsessed with "community"
<[spoiler]>
Nobody thinks that
nathanstitt has joined #ruby-lang
<elia>
toretore, ok, let's say ruby isn't a good functional language…
<ljarvis>
I write in lots of languages, that doesn't mean I have to appreciate the shit language that js is
<elia>
at least it has 1st class objects :D
<toretore>
i'm not really in the mood for an argument
<[spoiler]>
I like C, Go and Ruby equally.
<toretore>
when the arguments being made are one sided and subjective
<ljarvis>
im not making an argument for js sucking, the internet has made it for me
<elia>
lol
dsp____ has joined #ruby-lang
<[spoiler]>
Lmao
<toretore>
ljarvis: i would think you'd be able to come up with specifics
<ljarvis>
now haskell, that's a language
<toretore>
otherwise you have no reason to hate it
<[spoiler]>
Aaw, I don't think it *sucks*. There are some quirks, sure, but I still like.
<[spoiler]>
I don't like Haskell, the syntax is confuse me.
<[spoiler]>
:P
<elia>
anyways, I'm better at OOD than functional, so I do OOP in JS, that's it, and I do it in vanilla JS, coffee, or opal
sdouglas has joined #ruby-lang
<ljarvis>
toretore: the thing that annoys me about js is not anything fundamental like not having proper OOP, it's more the little inconsistencies and stuff I have to double check on because I'm not 100% something with behave the way I'd expect it too
<[spoiler]>
I mostly use vanilla JS or Coffee. Never used Opal for anything serious
<ljarvis>
toretore: I have absolutely no doubt that if I wrote JS 100% of my work time for a while that I'd be so used to them that I could see past it, but that's not the case
dsp___ has quit [Ping timeout: 258 seconds]
<toretore>
that's very non-specific
<ljarvis>
Again, the 'wat' talk sums of most of it
momomomomo has joined #ruby-lang
<toretore>
that talk is entertainment for gullible rubyists
<ljarvis>
uh
<ljarvis>
okay
<[spoiler]>
toretore, Am I naive if I expect 0.1 + 0.2 === 0.3 to evaluate as true in JS?
vondruch has quit [Ping timeout: 255 seconds]
<toretore>
not if you understand how floats work
<toretore>
i mean, "if"
<johnny5>
sup linda
<toretore>
boolean logic is not my strong point
sdouglas has quit [Ping timeout: 240 seconds]
<ljarvis>
ahhh
<ljarvis>
there we go
<workmad3>
[spoiler]: you're naive if you expect that in any language... ;)
<johnny5>
linda leighton
<johnny5>
crazy
<[spoiler]>
workmad3 never had a problem with it in C?
<ljarvis>
does {} == {} in js?
<workmad3>
[spoiler]: 0.1 in decimal is a repeating fraction in binary
<canton7>
[spoiler], then you're playing with fire and you just haven't been burned yet
<ddfreyne>
ljarvis: Never use == in JS
<toretore>
ddfreyne: more like "understand the difference between == and ==="
<ljarvis>
ddfreyne: right, but == shits on types, so that should return true
<workmad3>
[spoiler]: so it can't be represented exactly in floats... and so 0.1 + 0.2 == 0.3 will always need an epsilon
<johnny5>
shits on types lawl
<ljarvis>
it does, like php
<johnny5>
like you? ;)
<ljarvis>
"0" == 0 herp derp i want this literally never
<johnny5>
herp derp awh
<workmad3>
ljarvis: "0" + 0 === 0 = "0" ? :D
<ddfreyne>
My JavaScript subset does not include ==
<toretore>
that is common in many languages, and the users of those find it quite useful
<ljarvis>
ddfreyne: right, so === insteap
<ljarvis>
instead
<johnny5>
no
<ljarvis>
{} === {} right?
<johnny5>
====!xx===
<johnny5>
and it might work
<ddfreyne>
ljarvis: yes
<johnny5>
not sure though
<ljarvis>
ddfreyne: that returns true?
<ddfreyne>
Also, I just put johnny5 on ignore
<johnny5>
no it returns woowoo
<ljarvis>
workmad3: i wat
<ljarvis>
lol
<ljarvis>
oh right i read ? as ternary
<ljarvis>
? :D
<workmad3>
oh, I meant 0 + "0"
<workmad3>
on the rhs
<ljarvis>
yeah
<ddfreyne>
{} === {} is false but I don't quite understand why :(
<johnny5>
if you know the pitfalls, they're easy to avoid
<canton7>
reference compoarison?
loincloth has joined #ruby-lang
<DefV>
too lazy to read up, what language are we talking about
<johnny5>
javascript
<ljarvis>
ddfreyne: right.. hence my hatred for JS, maybe it's selfish, but I hate having no idea what something will return
<toretore>
>>> (function(o){ return o === o; })({});
<ljarvis>
right, so with that logic in mind, surely {} == {} would work?
<[spoiler]>
workmad3, oh yeah you're right. I guess 0.1 + 0.2 == 0.3 was recognised by gcc or something. To be honest I never really looked into or cared how floats worked :-); cc canton7
<canton7>
worth doing ;)
<toretore>
ljarvis: what logic is that?
<ledestin>
I get syntax error in Chrome
<deg->
hi! how to you specify that you have to have a minimum version of ruby? For example, >= 2.0? in Bundler i can ruby 'specific version' but it doesn't seem to work with >=
<workmad3>
[spoiler]: yeah, gcc did have some float optimisations in it
yfeldblum has joined #ruby-lang
<workmad3>
probably still does
<[spoiler]>
I'll read up on how floats are represented; I'm really curious now.
cfz has joined #ruby-lang
<johnny5>
javascript is also an evolving language
<johnny5>
it doesn't have to suck forever and ever
<johnny5>
and it never really did
<johnny5>
imho
<[spoiler]>
ljarvis, I think {} is synonym for Object.new
<workmad3>
[spoiler]: the fractional part is fractional powers of 2... so 0.1011 is 1 * 1/2 + 0 * 1/4 + 1 * 1/8 + 1 * 1/16
<ljarvis>
what about []?
<[spoiler]>
Array.new
<johnny5>
have you used JSON?
<workmad3>
[spoiler]: 1/10 in a binary expansion is similar to 1/3 in a decimal expansion though... infinitely repeating
<[spoiler]>
well, "new Array()" technically
<johnny5>
JavaScript Object Notation. {} is an object and a kv pair, [] an array etc, similar to ruby
jvrmaia has joined #ruby-lang
<[spoiler]>
workmad3, ahha! Ok, I think I get it now.
yatish27 has quit []
yfeldblum has quit [Ping timeout: 252 seconds]
<workmad3>
[spoiler]: yeah... most of the IEEE standard for floats is about error corrections and how the arithmetic and so on should work... the bare-bones of it though are the binary representation of fractions as above, and that rounding happens so be careful :D
<workmad3>
[spoiler]: I'd be interested to see if gcc picks up on 'float a = 0.1; float b = 0.2; float c = 0.3; a + b == c;'
cfz has quit [Read error: Connection reset by peer]
cfz_ has joined #ruby-lang
bearlulz has joined #ruby-lang
<[spoiler]>
workmad3, I'll test in a bit; on the phone rn; I'm at work
yatish27 has joined #ruby-lang
cfz_ has quit [Client Quit]
cfz has joined #ruby-lang
alexju has joined #ruby-lang
alexju has quit [Read error: Connection reset by peer]
alexju has joined #ruby-lang
<[spoiler]>
workmad3, it didn't!
cfz has quit [Client Quit]
torrieri has joined #ruby-lang
<workmad3>
[spoiler]: :)
<[spoiler]>
with version 4.7.2
<workmad3>
[spoiler]: it still picked up on '0.1 + 0.2 == 0.3' directly?
<[spoiler]>
Yeah
<workmad3>
heh :)
<[spoiler]>
Damn, I love learning this kinda stuff
<[spoiler]>
haha
bin7me has quit [Quit: Leaving]
jsullivandigs has joined #ruby-lang
jgpawletko has joined #ruby-lang
torrieri has quit [Ping timeout: 240 seconds]
vpretzel is now known as vpretzel|1419
yatish27 has quit []
yatish27 has joined #ruby-lang
tbuehlmann has quit [Quit: Leaving]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jvrmaia has quit [Remote host closed the connection]
toastynerd has joined #ruby-lang
banister has joined #ruby-lang
chouhoulis has joined #ruby-lang
banister has quit [Max SendQ exceeded]
elia has quit [Quit: Computer has gone to sleep.]
banister has joined #ruby-lang
ikrima has joined #ruby-lang
tomkadwill has quit [Remote host closed the connection]
loincloth has quit [Remote host closed the connection]
pskosinski has joined #ruby-lang
|jemc| has joined #ruby-lang
tomkadwill has joined #ruby-lang
<[spoiler]>
workmad3: So, if I understood this right, all floating point numbers are actually represented as fractions in memory? Then 0.1 would actually be represented as 1/10 (01 / 1010)?
<workmad3>
[spoiler]: no
<workmad3>
[spoiler]: floating point numbers are represented as the binary equivalent of decimal expansions
vpretzel|1419 has quit [Remote host closed the connection]
francisfish has quit []
vpretzel|1419 has joined #ruby-lang
<apeiros>
workmad3, [spoiler]: actually yes. but not decimal fractions.
<workmad3>
apeiros: I guess it depends on what you're willing to call a fraction :)
<apeiros>
n/(2**n) is a fraction
<workmad3>
apeiros: is '1.3456' a fraction?
<apeiros>
i.e., floats are of the form a/(2**b) * 2**c
<apeiros>
workmad3: you can express it as a fraction
<apeiros>
not sure faction is actually the correct terminus, though (I went with his example)
<workmad3>
apeiros: yeah... that's why I was going with the term binary expansion and decimal expansion
elia has joined #ruby-lang
<apeiros>
ok
<workmad3>
apeiros: on the idea that the underlying value is the rational fraction a/b, but the representation that gets stored is the expansion of that :)
malconis has quit [Remote host closed the connection]
Sirupsen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
malconis has joined #ruby-lang
* apeiros
off for commute
apeiros has quit [Remote host closed the connection]
workmad3 is now known as shevy
apeiros has joined #ruby-lang
shevy is now known as workmad3
sdouglas has joined #ruby-lang
mnngfltg has joined #ruby-lang
cnivolle has quit [Remote host closed the connection]
loincloth has joined #ruby-lang
omosoj has joined #ruby-lang
cnivolle has joined #ruby-lang
chouhoul_ has joined #ruby-lang
<workmad3>
[spoiler]: in memory, floats are stored as a mantissa and an exponent though, so you have the binary equivalent of '0.345 * 10^15'
ruurd has joined #ruby-lang
<workmad3>
[spoiler]: which is why floats are good for storing really large numbers and really small numbers, but not very good at doing maths that involves both of them at the same time :)
ikrima has quit [Ping timeout: 240 seconds]
vpretzel_ has joined #ruby-lang
chouhoulis has quit [Ping timeout: 240 seconds]
Sirupsen has joined #ruby-lang
apeiros has quit [Ping timeout: 252 seconds]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ledestin>
elia: sadly, todo app is broken. installed and ran it.
fragamus has joined #ruby-lang
vpretzel|1419 has quit [Ping timeout: 240 seconds]
<cHarNe2>
im having trouble with a gem "viewpoint", im only getting version 0.1.27, but i need the latest. "gem list viewpoint --remote --all" dont list the latest, but it seems to exist on https://www.ruby-toolbox.com/categories/Exchange_Clients
<apeiros>
hybristic: oh, .sample returns a random element
<apeiros>
as I understand it, you should try any combination of 2 elements in your array
<hybristic>
yeah. so when i do a.combination(2) I get stuck because I don't know how to add each variation of pairs to see if any one of them == nx
<hybristic>
*x
<hybristic>
total noob issue no doubt.
<jhass>
hybristic: .combination(2) returns an Enumerator, that included the very helpful Enumerable module. Check the methods it provides
<hybristic>
jhass: thank you I will do that now
fijimunkii has quit [Read error: Connection reset by peer]
<hybristic>
that explains the #Enumerator error I was getting.
fijimunkii has joined #ruby-lang
<jhass>
it's not an error, just the type of object you get returned
araujo has quit [Ping timeout: 250 seconds]
<hybristic>
ah thank you for the clarification.
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tbuehlmann has quit [Remote host closed the connection]
banister has quit [Read error: Connection reset by peer]
<apeiros>
hybristic: you can use .each to iterate over them
<apeiros>
hybristic: but for your problem, there are even better methods on it (thanks to Enumerable, as jhass already mentioned)
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
<apeiros>
you can use .to_a to just get an array of all combinations. may be helpful to make up your mind on how to proceed.
banister has joined #ruby-lang
<hybristic>
apeiros: thanks, I am looking at the documentation now. and I think you are right about the to_a its likely going to help me figure out how to move forward.
<apeiros>
hybristic: you know irb/pry ?
<hybristic>
not pry but I am using irb
<apeiros>
ok. pry is like irb, but lots better. I'd recommend you take a look (gem install pry pry-doc)
araujo has joined #ruby-lang
<[spoiler]>
hybristic, so, you basically need to check if there are two instances of X inside of an array?
<[spoiler]>
I guess...
<hybristic>
on it!
<hybristic>
[spoiler]: I need to see if any 2 instances in an array ever == x
<[spoiler]>
the_array.dup.keep_if {|element| element == x }.length == 2
<[spoiler]>
it's not *the most optimal* way
<[spoiler]>
but it's a way
<hybristic>
[spoiler]: thanks for that, I will test that just to mess around. I enjoy seeing the multitude to ways to solve something in ruby. its quickly becoming my favorite language.
<apeiros>
hybristic: hm? I understood if *the sum* of any two elements was == x, no?
<[spoiler]>
Object#dup because keep_if modifies the array in place
<apeiros>
and then [spoiler]'s way would not work
<hybristic>
apeiros: I am likely explaining poorly. if at any point two values with an array == x then it should return true, even if not every variation == x
<[spoiler]>
I guess, a.select {|e| e == x }.length would work too
<hybristic>
*within an
ikrima_ has joined #ruby-lang
<apeiros>
hybristic: I guess you should make an example to clarify
<hybristic>
I agree
musl has quit [Quit: WeeChat 0.4.3]
ikrima has quit [Read error: Connection reset by peer]
<apeiros>
19:55 hybristic: apeiros: sorry, I am trying to see if the sum of any 2 numbers in an array == x
<apeiros>
original question included "sum", though
musl has joined #ruby-lang
<apeiros>
so I understood e.g. array = [1,2,3,4,5] and x = 5, then possible results would be [2,3] and [1,4]
<hybristic>
yeah allow me to post an example and more clear explanation. I am unwisely trying for brevity to avoid spamming the irc which is likely counterproductive.
dsp___ has quit [Ping timeout: 252 seconds]
<hybristic>
apeiros: precisely
<[spoiler]>
Ah
<[spoiler]>
My example won't work in that case; sorry
<apeiros>
ok. in that case [spoiler]'s solution won't help, as it solves a different problem
<hybristic>
as long as there is a combination that sums to x I should return true
<[spoiler]>
I misunderstood the problem
<hybristic>
gotcha I still like what you posted. I want to figure out what it does lol.
MartynKeigher2 has joined #ruby-lang
mehlah has joined #ruby-lang
<[spoiler]>
`a.select {|e| e == x }.length` basically, takes every element, compares it to x, and creates a new array of all elements matching the criteria `e == x`; then you `[new array returned by Array#select].length == 2`
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<[spoiler]>
It's not what you asked though; I misunderstood. :-) Sorry for adding confusion to the discussion
ikrima_ has quit [Ping timeout: 240 seconds]
<hybristic>
[spoiler]: no worries, you didnt set me back at all. I dont have enough insight to be confused if Im to be honest.
Lewix has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 240 seconds]
r0bby has joined #ruby-lang
symm-_ has joined #ruby-lang
<hybristic>
apeiros: thanks for the advice with pry I already like it a lot.
Coincidental has joined #ruby-lang
<apeiros>
hybristic: if you've installed pry-doc, try this: ? Array#combination
<apeiros>
hybristic: or: ? [].combination
torrieri has joined #ruby-lang
<hybristic>
sweet. thanks. that is very helpful as well.
fangari has joined #ruby-lang
philoserf has joined #ruby-lang
<[spoiler]>
Hmm
<[spoiler]>
Is combination a good idea? o.o
<hybristic>
I am honestly wondering the same thing.
<[spoiler]>
Oh i guess it is
<[spoiler]>
Well
<[spoiler]>
let me try something
<jhass>
.combination(2) is the first part, a method in Enumerable is the second ;)
<apeiros>
(the ? is the first char)
<hybristic>
apeiros: yeah I did that it gave me a few examples and I am trying to work with it.
torrieri has quit [Ping timeout: 240 seconds]
<jhass>
hybristic: try ls Enumerable in pry
<apeiros>
[spoiler]: that's the way to the 4 method solution ;-)
<hybristic>
jhass: on it!
Prandium has joined #ruby-lang
<hybristic>
yeah pry is kind of a bad ass.
r0bby has quit [Remote host closed the connection]
r0bby has joined #ruby-lang
<hybristic>
okay so I got this far does it look like I might be on the right track? a.combination(2).each {|x| puts "#{x[0]}, #{x[1]"} or am I going down the wrong rabbit hole?
<apeiros>
just array.combinatin(2).select { |a,b| a + b == x }
<apeiros>
I wouldn't monkey-patch Array for that
philoserf has left #ruby-lang [#ruby-lang]
Prandium has joined #ruby-lang
<apeiros>
.find instead of select if you want only the first match
Coincidental has quit [Remote host closed the connection]
<hybristic>
apeiros: very nice. i was absolutely going to make a mess of that array.
<[spoiler]>
Hmm, I used inject, in case the requirements increase to more than 2 numbers, but yeah your version is cleaner
<apeiros>
[spoiler]: yes, if requirement changes to a variable number of elements, inject(:+) is the way to go
<apeiros>
hybristic: I'd try to find a solution without combination(2)
devgiant has quit [Ping timeout: 258 seconds]
<[spoiler]>
And yeah, monkey patching Array is generally a bad idea, I agree
<apeiros>
[spoiler]: your solution without combination has one mistake in it
<apeiros>
it also tries combinations of elements combined with itself
vpretzel|1419 is now known as vpretzel
<hybristic>
thanks, I want to learn the right way to do it. so if this is going to be a quick and dirty I would rather skip combination as the soultion.
<[spoiler]>
apeiros, ah good point
<[spoiler]>
there's duplicates
<apeiros>
[spoiler]: also it'll retry already tried combinations (not as bad, but would need filtering)
<[spoiler]>
apeiros, didn't think about that, yeah
<[spoiler]>
combination doesn't seem like a quick-n-dirty way
<[spoiler]>
it's the idiomatic/readable way ihmo
Sirupsen has quit [Ping timeout: 252 seconds]
<apeiros>
[spoiler]: oh, it's not. it's an excellent and clean way
<apeiros>
I suggested trying without for exercise' sake
<hybristic>
the variations that I have been coming up with just seem like patch work. but yours looks very clean lol
<hybristic>
thats likely me being a noob and less to do with the combination method
<apeiros>
hybristic: yeah. more experience will let you write more elegant code
ironhide_604 has joined #ruby-lang
<apeiros>
elegance & conciseness are IMO valuable in code. and IMO they come naturally with experience, if you strive for it.
r0bby has quit [Read error: Connection reset by peer]
BucOder_ has joined #ruby-lang
<hybristic>
that seems to be the case. I just need to toy around with what you guys have given me already because the solution is there I just need to understand it better.
<hybristic>
I greatly appreciate all of your help.
<[spoiler]>
I love it when people combine efforts like this :D lol
<hybristic>
[spoiler]: I like it.
Lewix has joined #ruby-lang
<hybristic>
it went from something I couldnt even understand to something that I can actually grasp in a very clean manner.
* [spoiler]
is childish; but he ain't bovvered.
<hybristic>
I need to read a lot more docs but you guys have helped me A LOT!
<apeiros>
for sum of 2, I prefer to avoid the added abstraction of .inject
<[spoiler]>
pry's built in documentation, like apeiros suggested, and ruby-doc.org/ are awesome
<apeiros>
so just arr.combination(n).any? { |a,b| a+b == x } # for me
<[spoiler]>
yeah, it's if you're sure you'll always need only 2 numbers, you can just use a+b
<[spoiler]>
it's cleaner
metus_violarium has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<hybristic>
I used that same .inject method in code just above the method I was trying to build here so I can see how it can be useful depending on the need.
BucOder has quit [Quit: Computer has gone to sleep.]
<apeiros>
it's a fine method. but IMO avoid unecessary abstractions.
<apeiros>
*unnecessary
<apeiros>
they add up
solars has quit [Ping timeout: 252 seconds]
<hybristic>
I can see how that would be true
<apeiros>
add abstractions as requirements are being added, not prematurely.
<apeiros>
IME, most premature abstractions end up never being used
<[spoiler]>
apeiros, do you mean for the sake of clarity or performance? or both?
<apeiros>
clarity
<apeiros>
it's the most costly aspect of code
<apeiros>
usually clarity also helps performance. and if not, you can always tune those ~3% bottle neck code
<apeiros>
(and sacrifice clarity in those parts, if needed)
BucOder has joined #ruby-lang
sarkyniin has quit [Quit: Quitte]
<[spoiler]>
tbh, inject is a stupid name. Is there an alias for it apart from #reduce?
elia has quit [Quit: Computer has gone to sleep.]
<apeiros>
put differently: any unused abstraction is immediately technical debt
alex-quiterio has quit [Quit: Leaving.]
<[spoiler]>
it should be called thingyfy
<[spoiler]>
instead of inject
<[spoiler]>
is inject a maths term or something
<avdi>
it's a smalltalk term
<avdi>
not sure if/where it came from before then
<apeiros>
[spoiler]: it's pretty apt
<apeiros>
you inject an operation in between each two elements
<avdi>
I'm holding out for #fold
CaryInVictoria has joined #ruby-lang
<apeiros>
.inject(:+) --> [a + b + c + d], the + is injected
CaryInVictoria has quit [Remote host closed the connection]
<apeiros>
also, I think it's taken from smalltalk?
chouhoulis has quit []
ratmav has joined #ruby-lang
Bwild has joined #ruby-lang
<[spoiler]>
apeiros, OH!
<[spoiler]>
yeah, ok it makes sense now
MichD is now known as michd
toastynerd has quit [Remote host closed the connection]
<apeiros>
oh, avdi already said it's from smalltalk. missed that :) sorry
<hybristic>
I need to just idle here more often.
<apeiros>
nice to see you more active on irc avdi!
<ratmav>
I'm making some kind of weird mistake with implicit concatenation
<avdi>
apeiros: haha, I was wondering if I was somehow not getting through :-)
<avdi>
apeiros: thanks. all hail irccloud for making IRC manageable in a multi-device world :-)
<apeiros>
avdi: na, I'm slightly distracted and thus sometimes miss messages :)
<[spoiler]>
yeah, I don't like when my editors do anything without me telling them to (except matching parentheses, brackets, braces, <>s, quotes and similar)
<ericwood>
atom's Vim mode needs a lot of work
<eam>
I think vim embeds a reasonable extension language now along with vimscript (python?) but I made the switch before that was a thing
<ratmav>
eam, you have to be sure your binary has python/ruby/etc. support compiled in
<eam>
yeah too much hassle
willdrew has quit []
<ericwood>
I'm excited to see neovim evolve :D
<eam>
emacs forever
<[spoiler]>
I still haven't bothered with atom; I'll wait a while before I try switching to it. Many people report it's sluggish compared to sublime
skade has quit [Ping timeout: 264 seconds]
<ratmav>
ericwood, me too
<ratmav>
eam, i might have to give emacs a try some day
<ratmav>
not today
<ratmav>
but *some* day
skade has joined #ruby-lang
<ericwood>
I'd like to try it but I'm really happy with my Vim config + MacVim
<eam>
it's hilarious reading "omg the SIZE of emacs" jokes these days when vim is even bigger and beyond that, I have intellij running ...
<ratmav>
[spoiler], what makes atom attractive as an editor?
<yorickpeterse>
you can play angry bird in it
<yorickpeterse>
errr
<yorickpeterse>
flappy bird
<yorickpeterse>
probably Angry birds too though
<ratmav>
my boss would love that
<ericwood>
atom has a neat architecture
<ratmav>
i'm refactoring that code right now! flap flap
<ericwood>
I'm also looking forward to seeing it evolve
<ratmav>
ericwood, i'll have to look into that. i just skimmed over the features a bit
tris has quit [Ping timeout: 276 seconds]
<ratmav>
being honest
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
relix_ has joined #ruby-lang
<ratmav>
isn't atom osx only?
wallerdev has quit [Quit: wallerdev]
<ericwood>
nope, runs on windows and linux
<ericwood>
only a mac binary currently but you can build it
<ratmav>
not an issue. i currently have to build vim to get all of what i want
<ericwood>
there were a few things that made it tough for me to use (undo only does one char at a time...)
<ratmav>
i do remember reading that it has a lot features that i have to tack on with plugins
aef has quit [Remote host closed the connection]
<ratmav>
oh man, gundo.
<ratmav>
and regular :u stuff
<ericwood>
the trick is to just not make mistakes
<ratmav>
lol
relix has quit [Ping timeout: 240 seconds]
<ratmav>
coding in concrete
dade has quit [Ping timeout: 240 seconds]
skade has quit [Ping timeout: 255 seconds]
torrieri has joined #ruby-lang
<ratmav>
at any rate, i've got to head out. thanks again avdi for spotting that whitespace problem
ratmav has quit [Quit: Leaving]
skade has joined #ruby-lang
<avdi>
np!
<[spoiler]>
ratmav, No idea! :P I guess it sort of excites me that it's written in JS/HTML/CSS and on top of Chromium. It's just... A childish reason, I guess.
<[spoiler]>
dam
<[spoiler]>
LOL
<[spoiler]>
he lef
<[spoiler]>
damn he left*
<ericwood>
I want to see NeoVim with a neat GUI
<ericwood>
one that has a better tree viewer of sorts
michaeldeol has joined #ruby-lang
<apeiros>
speaking of editors - anybody use atom.io on a regular basis?
<katlogic>
Everyone and his dad too wrote a half-decent editor at some point. Its just that half-decent editor is ok, but you still need it to support vim scripts or emacs macros.
<katlogic>
Otherwise one ends up like sublimetext where most people figure out its useless since there are zero useful plugins for it.
torrieri has quit [Ping timeout: 255 seconds]
Lewix has quit [Remote host closed the connection]
allomov has quit [Remote host closed the connection]
gnufied has quit [Ping timeout: 245 seconds]
allomov has joined #ruby-lang
miwood has joined #ruby-lang
gnufied has joined #ruby-lang
gnufied has left #ruby-lang [#ruby-lang]
<whitequark>
sublimetext is hardly "useless for most people" or "has zero useful plugins"
rindolf has joined #ruby-lang
<rindolf>
Hi all.
aef has joined #ruby-lang
<Jamo>
howdy
<rindolf>
Jamo: hey.
<rindolf>
Jamo: how are you doing?
<katlogic>
whitequark: Sorry for generalization. Well, ask any serious programmer about it then.
<rindolf>
katlogic: ah, you're here too.
<Jamo>
fine thanks, how are you?
<whitequark>
katlogic: just asked myself. myself thinks sublime is just fine
<katlogic>
It's true that for js/html design is st perfect.
<apeiros>
same as whitequark
<apeiros>
only need 1 plugin really, valign
<rindolf>
Jamo: I'm fine. Had a productive day.
<apeiros>
additionally have gitgutter for convenience and soda theme for eye candy
<whitequark>
(your implication that I'm not a serious programmer is funny :p)
<rindolf>
Jamo: I went over various todo lists and completed the items in them.
<katlogic>
whitequark: I don't like asking myself tricky questions :>
MartynKeigher2 has quit [Ping timeout: 252 seconds]
<rindolf>
Jamo: and I also installed an Ubuntu 14.04 x86-64 VM to test a KDE bug. I could not reproduce it.
<katlogic>
Maybe it's just that sublimetext ex mode was too flaky.
<apeiros>
whitequark: well, if asking yourself is not acceptable, we could ask each other :D
<whitequark>
the thing I like about sublime is that it's a really decent editor *without* a lot of plugins
<apeiros>
ex ode?
<apeiros>
*ex mode
<katlogic>
You know, actual modal editor.
<whitequark>
I regularly use... only git and sublime-ocp-index (completion for OCaml)
<katlogic>
Without using mouse.
<avdi>
anyone know a silly programmer? 'cause I have some questions about what hat to wear while coding.
<whitequark>
Sublime is very good at not requiring mouse. I don't think there is any operation that needs mouse.
<whitequark>
avdi: tinfoil is never a bad choice
<apeiros>
and it supports mouse decently, and mousing is IMO in a couple of cases superior to keyboard
allomov has quit [Remote host closed the connection]
<apeiros>
note, there are things I don't like about sublime. namely its slow rendering in hi-res and its inability to print :(
<whitequark>
slow rendering?
<whitequark>
seems like an OSX-specific bug
<whitequark>
(on Linux it renders for dpi=170 just as well as for dpi=90)
<apeiros>
whitequark: might be. did you try on 2880x1800 or higher?
<whitequark>
no, I don't have such a display. only 1920x1080. but let me try it for you.
<apeiros>
actually I think the problem got severe at 3840x2400
<whitequark>
can do that too
<apeiros>
(retina display set to 1920x1200 pretends to be 3840x2400 then downscales - native resolution is 2880x1800)
<apeiros>
I think I had a type-lag of roughly 100ms/char
<apeiros>
let me try though, it might have gotten better. at least he promised something for ST3
<apeiros>
oh, indeed, far better now
<whitequark>
uhhh, my window manager refuses to make the windows larger than the viewport
<whitequark>
silly thing
Coincidental has joined #ruby-lang
toastynerd has joined #ruby-lang
<apeiros>
hm, nice, I might use 1920x1200 again :D
<apeiros>
aaaaaah, precccious ssssspace
_ht has quit [Remote host closed the connection]
<whitequark>
(there's a weird "panning" mode in Linux xorg, where you move your viewport over a larger framebuffer with mouse)
loincloth has quit [Remote host closed the connection]
<matled>
hybristic: you don't even need the special case for array.count < 2 as .combination(2) is empty and .any? on an empty enumerator is always false.
<hybristic>
matled: good point, I can simplify it even further, thank you!
futilegames has joined #ruby-lang
MartynKeigher2 has joined #ruby-lang
loincloth has joined #ruby-lang
djbkd has quit [Quit: Leaving...]
djbkd has joined #ruby-lang
allomov has joined #ruby-lang
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
[spoiler] has quit [Quit: Leaving]
Lewix has joined #ruby-lang
kyb3r_ has joined #ruby-lang
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
apeiros: with sublime text 3? iirc they improved it there
<apeiros>
jhass: yes. a lot.
<apeiros>
with st2 I had - as said - about 100ms/typed char
<apeiros>
which is unbearable. I could write a line of code and then wait half a minute.
<jhass>
matled: and if you'd like to be explicit about it another way to write it would be array.size > 1 && array.combinations....
jonathanmarvens has quit [Remote host closed the connection]
amsi has joined #ruby-lang
<jhass>
more stable and more faster, faster startup, still a bit less plugins. Didn't find any other major differences personally
<jhass>
idk. why they don't release the current build as stable
MartynKeigher2 has quit [Ping timeout: 240 seconds]
<ddfreyne>
But ST2 plugins are not compatible with ST3, right? Or are they?
<jhass>
some are, most that are are tagged as such in package control. But there were quite a few API changes and it got ported to python3 (the plugin API/runner)
<apeiros>
ddfreyne: didn't notice much difference tbh
fragamus has quit [Quit: Computer has gone to sleep.]
<apeiros>
I guess performance (except for the retina thing) just isn't an issue with an i7, 16GB RAM and an SDD
<jhass>
yes, the major things really are the faster startup and that a bogus plugins less likely crash the whole thing
<apeiros>
k, I guess that explains the rest - I barely have any plugins
shinnya has joined #ruby-lang
wallerdev has joined #ruby-lang
metus_violarium has quit [Remote host closed the connection]
<apeiros>
NameError: undefined method `block_given?' for class `Tempfile'
<apeiros>
inside the app
<apeiros>
outside the app, `ruby -v -rtempfile -e 'p Tempfile.instance_method(:block_given?)'` works perfectly fine
cored has quit [Ping timeout: 276 seconds]
Miphix has quit [Read error: Connection reset by peer]
Miphix has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
vpretzel is now known as vpretzel|1484
nofxx has joined #ruby-lang
nofxx has quit [Changing host]
nofxx has joined #ruby-lang
ldnunes has quit [Quit: Leaving]
MartynKeigher2 has joined #ruby-lang
futilegames has joined #ruby-lang
<apeiros>
god damit
<apeiros>
I added method_removed and _undefined hooks. but of course, if I require tempfile before sass does, everything is fine
dev123 has joined #ruby-lang
<dev123>
Anybody know if there is a way to make a HTML/PHP button send a command to an irc channel via Ruby
alexju has quit []
WishBoy has quit [Remote host closed the connection]
araujo has quit [Ping timeout: 240 seconds]
alexju has joined #ruby-lang
skade has joined #ruby-lang
<apeiros>
why does this sound like "lets write a spambot"?
futilegames has quit [Client Quit]
<apeiros>
yes, of course it's possible.
yfeldblu_ has quit [Remote host closed the connection]
allomov has quit [Remote host closed the connection]
<dev123>
I'll explain myself so I don't come off as a script kiddie trying to spam
<dev123>
There is an IRC channel for organizing games, and you can do commands such as !add game1 to add yourself to the people who can be picked for the next game
<dev123>
I want to create a way for people to simply click the game they want on a site and have them added
<dev123>
I'm basically just trying to open the system to people who are less familiar with IRC
<|jemc|>
dev123: so read the docs for one of the IRC gems or read the docs on the raw IRC protocol and start doing it
<apeiros>
|jemc|: don't make me go find that 5y old document on connect quirks of various ircds :-p
agrinb_ has joined #ruby-lang
<eam>
http 0.9 is just as simple and I'd recommend against reimplementing it too
<apeiros>
|jemc|: also plaintext auth? or just no auth and set yourself up for impersonation?
fangari has joined #ruby-lang
agrinb has quit [Read error: Connection reset by peer]
<eam>
anything that talks to a network is an attack vector
<dev123>
Yeah I'm trying to figure that out
araujo has joined #ruby-lang
* |jemc|
shrugs
<|jemc|>
his application doesn't sound to serious, I still say, meh :P
vlad_starkov has joined #ruby-lang
<eam>
still, why set him down the wrong path :P
<apeiros>
|jemc|: all the more reason not to reinvent the wheel
<dev123>
Well it had the potential to have about 500-600 concurrent users once I get it finished
nathanstitt has quit [Quit: I growing sleepy]
thmzlt has quit [Remote host closed the connection]
<dev123>
I was thinking that since the site already has a login system, I would have users be connected to the IRC channel with a name of their site username so that it is easy to identify people
AKASkip has quit [Ping timeout: 240 seconds]
RobertBirnie has joined #ruby-lang
<eam>
dev123: sounds like you'd be asking them for their nickserv password, at which point you may be violating the ToS of the IRC service
Pupeno has joined #ruby-lang
araujo has quit [Max SendQ exceeded]
<eam>
which you may not care about, but be aware
<dev123>
Yeah I probably wouldn't need them to verify with nickserv
araujo has joined #ruby-lang
torrieri has quit [Ping timeout: 276 seconds]
djbkd has quit [Remote host closed the connection]
<cHarNe2>
dev123: just make your own nickserv
<dev123>
lol
jonathanmarvens has quit [Remote host closed the connection]
<dev123>
I don't know about that
crudson has quit [Quit: Leaving.]
<dev123>
Well I guess I'll look into those links, thanks cHarNe2
yfeldblum has joined #ruby-lang
jonathanmarvens has joined #ruby-lang
jgpawletko has quit [Quit: jgpawletko]
relix has joined #ruby-lang
Bwild has quit [Ping timeout: 252 seconds]
musl has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby-lang
musl has joined #ruby-lang
<apeiros>
oh wow… after 1h of debugging, the culprit is found
<apeiros>
late jim weirichs good old blankslate
havenwood has quit [Ping timeout: 272 seconds]
<apeiros>
I don't yet see how exactly this happens, but it's definitively the culprit
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fenicks has quit [Ping timeout: 252 seconds]
djbkd has joined #ruby-lang
havenwood has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
ok, not jims fault. a sloppy modification caused the issue.
<apeiros>
+on my part
thmzlt has joined #ruby-lang
AKASkip has joined #ruby-lang
crudson has joined #ruby-lang
Pupeno has quit [Ping timeout: 252 seconds]
jackyalcine is now known as jacky
WishBoy has joined #ruby-lang
nathanstitt has joined #ruby-lang
rindolf has quit [Quit: Leaving]
djbkd has quit [Read error: Connection reset by peer]
djbkd has joined #ruby-lang
allomov has joined #ruby-lang
AncientAmateur has quit [Remote host closed the connection]
Lewix has quit [Remote host closed the connection]
BucOder has quit [Quit: Computer has gone to sleep.]
djbkd has quit [Read error: Connection reset by peer]
djbkd has joined #ruby-lang
dnewkerk-keyz has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
momomomomo has joined #ruby-lang
momomomomo has quit [Client Quit]
alexju has quit [Remote host closed the connection]
omosoj has quit [Ping timeout: 240 seconds]
beef-wellington has quit [Ping timeout: 255 seconds]
saarinen has quit [Quit: saarinen]
_djbkd has joined #ruby-lang
ascarter has joined #ruby-lang
_djbkd has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 265 seconds]
_djbkd has joined #ruby-lang
djbkd has quit [Ping timeout: 240 seconds]
fangari has left #ruby-lang [#ruby-lang]
fangari has joined #ruby-lang
lsegal has joined #ruby-lang
allomov has quit [Remote host closed the connection]
shinnya has joined #ruby-lang
zastern has quit [Ping timeout: 276 seconds]
saarinen has joined #ruby-lang
saarinen has quit [Client Quit]
michaeldeol has joined #ruby-lang
zastern has joined #ruby-lang
saarinen has joined #ruby-lang
mehlah has joined #ruby-lang
Xzyx987X_ has joined #ruby-lang
rhodee has joined #ruby-lang
rhodee has quit [Client Quit]
bjh13 has quit [Quit: leaving]
nullFxn has joined #ruby-lang
Xzyx987X has quit [Ping timeout: 240 seconds]
torrieri has joined #ruby-lang
loincloth has quit [Remote host closed the connection]
nullFxn has quit [Client Quit]
jgpawletko has joined #ruby-lang
jgpawletko has quit [Client Quit]
jonathanmarvens has quit [Remote host closed the connection]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fenicks has joined #ruby-lang
fenicks has quit [Remote host closed the connection]
fenicks has joined #ruby-lang
vpretzel|1484 has quit [Quit: Adios!]
fangari has quit [Ping timeout: 250 seconds]
dnewkerk-keyz has quit [Quit: dnewkerk-keyz]
nofxx has quit [Remote host closed the connection]
nofxx has joined #ruby-lang
vlad_starkov has quit []
kitak has quit [Remote host closed the connection]
kitak has joined #ruby-lang
nofxx has quit [Ping timeout: 252 seconds]
kitak has quit [Read error: Connection reset by peer]
kitak has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
__butch__ has quit [Quit: Leaving.]
apeiros has joined #ruby-lang
skade has quit [Ping timeout: 250 seconds]
rsl has quit [Ping timeout: 240 seconds]
agrinb_ has quit [Remote host closed the connection]
rsl has joined #ruby-lang
skade has joined #ruby-lang
agrinb has joined #ruby-lang
enebo has quit [Quit: enebo]
franzip has quit [Quit: ...]
RobertBi_ has joined #ruby-lang
agrinb has quit [Ping timeout: 240 seconds]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
RobertBirnie has quit [Ping timeout: 255 seconds]
workmad3 has quit [Ping timeout: 252 seconds]
jonathanmarvens has joined #ruby-lang
arrubin has quit []
devgiant_ has quit [Quit: Leaving]
AKASkip has quit [Ping timeout: 240 seconds]
alexju has joined #ruby-lang
cfz has joined #ruby-lang
agrinb has joined #ruby-lang
symm has quit [Read error: Connection reset by peer]
RobertBi_ has quit [Read error: Connection reset by peer]
symm- has joined #ruby-lang
fijimunkii has joined #ruby-lang
RobertBirnie has joined #ruby-lang
dnewkerk-keyz has joined #ruby-lang
_djbkd has quit [Read error: Connection reset by peer]
djbkd has joined #ruby-lang
Olipro has joined #ruby-lang
cored has quit [Ping timeout: 250 seconds]
djbkd has quit [Read error: Connection reset by peer]
djbkd has joined #ruby-lang
omosoj has joined #ruby-lang
kalehv has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
|jemc| has quit [Ping timeout: 240 seconds]
nofxx has joined #ruby-lang
nofxx has quit [Changing host]
nofxx has joined #ruby-lang
toastynerd has joined #ruby-lang
cfz has quit [Quit: qicr for android: faster and better]
cfz has joined #ruby-lang
cfz has quit [Client Quit]
cfz has joined #ruby-lang
cfz has quit [Remote host closed the connection]
cfz has joined #ruby-lang
cfz has quit [Client Quit]
alex-quiterio has joined #ruby-lang
alex-quiterio has quit [Client Quit]
NinoScript has joined #ruby-lang
mykoweb has joined #ruby-lang
<NinoScript>
hey, I’m playing with metaprogramming, is it possible to define arguments dynamically? (Ruby 2.1.1)
<centrx>
NinoScript, Use define_method
toastynerd has quit [Remote host closed the connection]
<NinoScript>
centrx: using define_method I can pass it a block with the arguments I want, but then how do I define those arguments dynamically?
<centrx>
NinoScript, What do you mean?
dnewkerk-keyz has quit [Quit: dnewkerk-keyz]
<NinoScript>
I’d like to do something like… define_method :name, arguments: {first, second:, third:”default}
<NinoScript>
I mean… let’s say I have this hash: {first: :required, second: :named_required}
dnewkerk-keyz has joined #ruby-lang
<centrx>
NinoScript, You mean keyword arguments?
<centrx>
NinoScript, I think you have to do it by manipulating the hash within the block, instead of as parameters
kirin` has quit [Ping timeout: 252 seconds]
centrx has quit [Quit: All this computer hacking is making me thirsty]