<carpeliam>
i don’t know the possible names beforehand, so it could be “Sarah 98 Jessica Parker”
scripore has joined #ruby
<havenwood>
carpeliam: Pretty fancy to have a digit in your name.
<carpeliam>
havenwood: they’re line numbers
<havenwood>
carpeliam: For better suggestions show some possible input data with the return values you'd like.
<carpeliam>
so if your first name “Henry” is at the end of line 3 and your last name “Fonda” is at the end of line 4, it’d show up as “Henry 4 Fonda”
dfockler has joined #ruby
atomical has joined #ruby
<carpeliam>
input data would be any sentence with a name in it, where a number could be between any word, and the return value would be the name without a number in between
<havenwood>
carpeliam: Example input would be nicer than a description if you have any.
blackmes1 has joined #ruby
<havenwood>
carpeliam: Like the real stuff.
<carpeliam>
so “hello my 6 name is Jim Smith” would return “Jim Smith”, and “hello my name is Sarah 8 Jessica Parker” would return Sarah Jessica Parker
y0da has joined #ruby
<havenwood>
carpeliam: So you just want to remove any digits and the space either preceding or following them? Is that all?
freerobby has quit [Quit: Leaving.]
freerobby has joined #ruby
fabrice31 has joined #ruby
<havenwood>
carpeliam: Are there any digits you don't want to remove?
but3k4 has quit [Ping timeout: 240 seconds]
blackmesa has quit [Ping timeout: 246 seconds]
<havenwood>
carpeliam: Do you ever want double spaces?
josh2 has joined #ruby
dfockler has quit [Ping timeout: 250 seconds]
kies^ has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<carpeliam>
havenwood: I can always do something like name.split.reject{|x| x =~ /\d+/ }.join(‘ ‘) if there’s no better way to do it, but i’m specifically asking how to remove text from a match group in a regular expression
<carpeliam>
that works too
fabrice31 has quit [Ping timeout: 252 seconds]
<havenwood>
carpeliam: A positive lookahead or lookbehind.
pulgolino has quit [Remote host closed the connection]
ndrei has joined #ruby
shock_one has joined #ruby
robbyoconnor has quit [Max SendQ exceeded]
Thomas-0725 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
robbyoconnor has joined #ruby
oo_ has quit [Remote host closed the connection]
Yzguy has joined #ruby
freerobby has quit [Quit: Leaving.]
freerobby has joined #ruby
<BStheHD>
whenever I write a script or something it executes in the console.. but how do I build an interface for a program?
GriffinHeart has quit [Remote host closed the connection]
bruno- has joined #ruby
GriffinHeart has joined #ruby
frem has joined #ruby
darkf has joined #ruby
Spami has joined #ruby
bruno- has quit [Ping timeout: 244 seconds]
dopie has joined #ruby
pwnz0r_ has joined #ruby
bronson has joined #ruby
serivichi has joined #ruby
ledestin has joined #ruby
qiukun has quit [Quit: qiukun]
kkeuning has joined #ruby
nateberkopec has quit [Quit: Leaving...]
hoofed has joined #ruby
Channel6 has joined #ruby
iateadonut has joined #ruby
josh2 has joined #ruby
hashrocket has joined #ruby
hoofed has left #ruby [#ruby]
pwnz0r_ is now known as pwnz0r
<Antiarc>
any_instance_of is generally a code smell
serivich has quit [Ping timeout: 255 seconds]
<Antiarc>
You should only use it if you have no other option
<Antiarc>
v.some_method should be done by passing an array of mocks that behave like whatever v will be
<Antiarc>
array of doubles rather
bronson has quit [Ping timeout: 265 seconds]
kkeuning has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
eggoez has quit [Ping timeout: 252 seconds]
kkeuning has joined #ruby
kkeuning has quit [Client Quit]
annihilannic has joined #ruby
arooni-mobile has joined #ruby
arooni-mobile__ has joined #ruby
kkeuning has joined #ruby
cytoskeletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pico-pete has quit [Read error: No route to host]
al2o3-cr has quit [Ping timeout: 252 seconds]
kkeuning has quit [Max SendQ exceeded]
<annihilannic>
hi, can anyone tell me which package/gem/whatever provides vm_core.h, please? I'm unable to install debugger-linecache due to the lack of this file.
davedev2_ has joined #ruby
<Aeyrix>
if you paste "vm_core.h" into google
<Aeyrix>
the first result will giev you a fix.
<Aeyrix>
I just checked.
kkeuning has joined #ruby
<annihilannic>
I tried, and it made no sense to me, let me double-check.
davedev24 has quit [Ping timeout: 265 seconds]
Musashi007 has quit [Quit: Musashi007]
krz has joined #ruby
Scroff has joined #ruby
kkeuning has quit [Max SendQ exceeded]
kkeuning has joined #ruby
nathanstitt has quit [Quit: I growing sleepy]
Guest24 has quit [Ping timeout: 248 seconds]
lele has joined #ruby
ecksit has joined #ruby
evanjs has joined #ruby
<annihilannic>
Aeyrix: so I tried the 'gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-p290' command mentioned there, and it gave me the same error. I have installed ruby-2.1.2 though, do I need to adjust that path? and does it need to point to some ruby source that I may not have installed?
davedev2_ has quit [Read error: Connection reset by peer]
pwnz0r has quit [Remote host closed the connection]
eggoez has joined #ruby
davedev24 has joined #ruby
<annihilannic>
Aeyrix: for e.g., if I 'locate src/ruby', I get no hits.
kkeuning has quit [Max SendQ exceeded]
pwnz0r has joined #ruby
kkeuning has joined #ruby
surs has joined #ruby
spuk has joined #ruby
<Antiarc>
is ruby installed via your system package manager?
<Antiarc>
you may need to install the -dev/-devel package if so
<Antiarc>
(which will contain the ruby headers)
braincras has quit [Quit: bye bye]
kkeuning has quit [Max SendQ exceeded]
spuk has quit [Changing host]
spuk has joined #ruby
surs4 has quit [Ping timeout: 264 seconds]
kkeuning has joined #ruby
kkeuning has quit [Max SendQ exceeded]
<annihilannic>
Antiarc: I had ruby-1.8.7 installed (RHEL6) via yum, but the package I'm trying to install (kandan) requires ruby-1.9.3 or higher. I located a 2.1.2 rpm via pbone.net and installed that. I couldn't find a source package initially, just found a ruby-devel which I'll try, although I'm not sure it matches the ruby- package exactly...
pwnz0r has quit [Ping timeout: 248 seconds]
<Antiarc>
annihilannic: you will need a -devel package that matches the version of Ruby that you have installed
<Antiarc>
Consider using something like rvm or rbenvm though - they may be a bit cleaner. Though I know some folks like to stick to rpms.
<Antiarc>
rbenv*
<annihilannic>
Antiarc: thanks, I'll read about what those are.
prestorium has quit [Ping timeout: 255 seconds]
<Antiarc>
If you're familiar with python, they're similar in concept to virtualenv
<Antiarc>
Though IMO are far better at the job
<annihilannic>
I'm not, I come from perl
braincrash has joined #ruby
<annihilannic>
Well, going backwards, I found a binary RPM corresponding to that source package.
<annihilannic>
However examining the contents of the source I see no vm_core.h either.
jenrzzz has quit [Ping timeout: 264 seconds]
<Antiarc>
vm_core is part of the Ruby source, FWIW
thiagovsk has joined #ruby
<Antiarc>
Speaking as a fellow RHEL6 deployer, though, rvm will do quite nicely :)
eggoez has quit [Ping timeout: 248 seconds]
cytoskeletor has joined #ruby
radialneon has quit [Remote host closed the connection]
<Antiarc>
(some folks don't like it because it messes with your shell, rbenv is less intrusive and slightly less full-featured, but does the job just as well)
scripore has quit [Quit: This computer has gone to sleep]
scripore has joined #ruby
Scroff has quit [Ping timeout: 256 seconds]
eggoez has joined #ruby
carpeliam has quit [Quit: carpeliam]
yh has quit [Ping timeout: 256 seconds]
zacstewart has quit [Remote host closed the connection]
scripore has quit [Ping timeout: 250 seconds]
<Thomas-0725>
Integer.respond_to?(:+)
<Thomas-0725>
> Integer.respond_to?(:+)
<Thomas-0725>
Ok, that is evaluating to false for me. What am I doing wrong?
<annihilannic>
Antiarc: fast getting out of my depth here. so I gather installing rvm under a single user would be the "light touch" approach. but then would I be able to install a "bundle" simply under that? and if so, how would my web server know about it?
<bnagy>
nothing about rvm is "light" imo
_blizzy_ has quit [Ping timeout: 240 seconds]
<Antiarc>
annihilannic: You would "rvm use 2.2.2" and rvm will adjust your paths to that particular ruby install
<Antiarc>
Then you would "bundle install" and it would execute the ruby currently on path and install it into a gempath for that ruby install
<Thomas-0725>
mmm, ok. I guess I'll just use instance_methods.include?(sym)
<annihilannic>
And everything it installs would be under ~rvmuser/.rvm somewhere?
<bnagy>
Thomas-0725: what's the actual question?
cytoskeletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
christiandsg has joined #ruby
<Thomas-0725>
bnagy, the actual question is: if I have some arbitrary symbol, sym, how do I determine whether or not I can use it on a Float?
gix has quit [Ping timeout: 248 seconds]
<bnagy>
ask an instance of Float if it minds
<bnagy>
but don't ask Float
<Thomas-0725>
And more usefully, how do I determine if, when used on Float, it accepts a Float as the argument?
<bnagy>
uh.. dynamic typing
<bnagy>
as in the answer won't be useful
<sevenseacat>
'can i use it on a float?' != 'does it make sense to use it on a flat in this circumstance'
<bnagy>
what's the actual, actual question? ;)
<sevenseacat>
*float
<Antiarc>
annihilannic: What application server are you using? If it's passenger, then you'll just install passenger with your target ruby active. Otherwise, you'll just install your app server and invoke it from that environment
<Antiarc>
Under rvm, that could be `rvm 2.2.2 do ruby whatever.rb`, which would execute whatever.rb under your 2.2.2 install
<Thomas-0725>
The actual actual question is, I'm trying to make a parser for an RPN calculator, and I would like to parse the string into floats and symbols, and then error check to establish whether any of the symbols are invalid. My first idea was to just make an array of valid symbols and check against that, and that seems to be the most practical solution now.
<Antiarc>
I haven't used rbenv/chruby in a while though, so I couldn't tell you the equivalents there
<bnagy>
Thomas-0725: that is definitely how I would do it
<bnagy>
tokenise, parse, do stuff
surs2 has joined #ruby
<annihilannic>
Antiarc: I've installed nodejs and execjs as per the very undetailed kandan setup instructions. Is execjs the application server in this scenario?
<Thomas-0725>
Cool. I just wasn't sure if there was some more handy way to ask Ruby "Does this method work on two floats?" Seems there is not. :D Thanks for the help!
<bnagy>
imho ruby is too dynamic to be able to metaprogram your way to a sensible implementation in such a specific domain
<Antiarc>
Oh, kandan. No, nodejs and execjs are almost certianly only used for asset compilation.
<bnagy>
respond_to? is awesome, and the heart of duck typing, which is also awesome
NeverDie has joined #ruby
<bnagy>
I just have ptsd from leaky parsers
cytoskeletor has joined #ruby
<Antiarc>
annihilannic: `bundle exec thin start` - thin is the application server there. So really all you need to do is install rvm, `rvm install 2.2`, `rvm use 2.2`, and then follow the rest of the instructions
swgillespie has joined #ruby
M-Technic has joined #ruby
SylarRuby has joined #ruby
<annihilannic>
Antiarc: thanks muchly, I'll give it a try.
<Antiarc>
(also, as a tip - if you ever feel that rvm has screwed stuff up, `rvm implode` will remove everything installed by RVM and return your system to a pre-rvm state)
<annihilannic>
Antiarc: quaint!
<sevenseacat>
run it once, then install something that doesnt screw stuff up
Ropeney has joined #ruby
sharpmachine has quit [Remote host closed the connection]
jesterfraud has joined #ruby
mercwithamouth has quit [Ping timeout: 246 seconds]
<Antiarc>
(I'm personally a fan of RVM, but I don't mind its shell shenannigans. Others I respect are far less bullish on it!)
cytoskeletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<bnagy>
*everything may not include actually everything
evanjs has quit [Remote host closed the connection]
Spami has quit [Quit: This computer has gone to sleep]
dellavg has quit [Ping timeout: 264 seconds]
saadq has joined #ruby
davedev24 has quit [Remote host closed the connection]
<annihilannic>
Antiarc: yes, well, as long as I can ringfence it under a specific user I doubt they will bother me
rbennacer has quit [Remote host closed the connection]
<Ox0dea>
bnagy: Does the visibility of #initialize ever actually matter?
<bnagy>
I don't know :)
<Ox0dea>
Heh, fair enough.
super` has joined #ruby
<bnagy>
but it's illogical to have it private, even if you can't really make it private
<bnagy>
like.. creating instances is a public function of a class in my world
super` has left #ruby [#ruby]
<Ox0dea>
Right, it certainly shouldn't be private, I just wondered whether it had any actual effect.
<bnagy>
I guess not because Klass#new magic?
dgutierrez1287 has quit [Ping timeout: 252 seconds]
<Thomas-0725>
Ox0dea:(
<Ox0dea>
Thomas-0725: Pardon?
<Thomas-0725>
So basically you just did in 1 line what I did in 80? :O
<Ox0dea>
Yay, Ruby?
<bnagy>
but uglier :)
<bnagy>
and with less checking
peter_paule has joined #ruby
<Thomas-0725>
so what does rescue do there?
<bnagy>
Thomas-0725: it abuses the way reduce works, because it has a very liberal to_proc or something in there
<Ox0dea>
bnagy: Nah, #reduce with a String "just works".
mercwithamouth has joined #ruby
allcentury has quit [Ping timeout: 240 seconds]
davedev24 has quit [Remote host closed the connection]
<Ox0dea>
Thomas-0725: Kernel.Integer will fail given non-numeric input; in this case, I'm catching that error and assuming it means the token was an operator.
xkickflip has joined #ruby
jenrzzz has joined #ruby
<Thomas-0725>
Ox0dea does it fail on a 1.1 or does it simply truncate?
<Thomas-0725>
>> Integer "r"
<ruboto>
Thomas-0725 # => invalid value for Integer(): "r" (ArgumentError) ...check link for more (https://eval.in/397289)
<Thomas-0725>
>> Inteer "1.2"
<ruboto>
Thomas-0725 # => undefined method `Inteer' for main:Object (NoMethodError) ...check link for more (https://eval.in/397290)
<Thomas-0725>
erg
<Thomas-0725>
anyway, IRB I know.
<Thomas-0725>
ok, so your cool little trick fails for floating input
<Ox0dea>
No?
<Ox0dea>
Ah, it does, but there's also Kernel.Float. :)
<Thomas-0725>
>> '6 3.0 / 8 7 + + 3 * 9 -'.split.map { |t| Integer t rescue t }.each_with_object([]) { |t, o| o << (t[1] ? t : o.pop(2).reduce(t)) }
<ruboto>
Thomas-0725 # => String can't be coerced into Fixnum (TypeError) ...check link for more (https://eval.in/397291)
<Thomas-0725>
Ah, ok. So just bad class choice
<Ox0dea>
No, it's a method.
<sphex>
Ox0dea: hey.. are you working on somekind of parser?
<Thomas-0725>
Yes, sorry.
<Ox0dea>
sphex: It's charitable to call it a "parser", but I'm working on converting any Ruby code to a non-alphanumeric "equivalent". :)
spuk has quit [Ping timeout: 264 seconds]
pwnz0r has joined #ruby
<Thomas-0725>
OK, well thank you both for the input. I'm sure I'll be pestering often over the next few weeks.
<sphex>
haha.. whoa..
fabrice31 has joined #ruby
davedev24 has joined #ruby
Musashi007 has quit [Quit: Musashi007]
<Ox0dea>
sphex: It was technically possible to write any conceivable program using non-alphanumerics, but Mon_Ouie showed me how to invoke #send, so now it's possible to write real, heavy-duty Ruby with no numbers or letters.
<Ox0dea>
I figured I'd try to automate that process for giggles.
Thomas-0725 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Channel6 has quit [Quit: Leaving]
arescorpio has quit [Quit: Leaving.]
fabrice31 has quit [Ping timeout: 244 seconds]
<Ox0dea>
bnagy: rb_class_new_instance() calls rb_obj_call_init(), which (after jumping through quite a few hoops) calls vm_call0_body(), which does lots of checks, but none for visibility.
<sphex>
Ox0dea: wow. man.. I don't even want to think about it. :p
casadei_ has quit [Remote host closed the connection]
<Ox0dea>
sphex: It's actually kinda fun.
<Ox0dea>
In an admittedly warped sort of way.
msnyon has quit [Ping timeout: 255 seconds]
ecksit has quit [Read error: Connection reset by peer]
xkickfl-1 has joined #ruby
xkickfl-1 has left #ruby [#ruby]
xkickflip_ has joined #ruby
<bnagy>
Ox0dea: hm.. I guess in theory initialize is actually always private
<bnagy>
it just freaks me out to see it declared as such
<sphex>
Ox0dea: I've been working on a ruby parser too. mostly to practice metaprogramming. I made a small DSL to help with operator precedence parsing... which I think works correctly. but there's a lot of stuff missing. I may be able to get it complete-ish in a few days.
zacstewart has joined #ruby
xkickflip_ has quit [Client Quit]
davedev24 has quit [Remote host closed the connection]
PeterHsieh has quit [Quit: Connection closed for inactivity]
shock_one has joined #ruby
peter_paule has quit [Ping timeout: 248 seconds]
freerobby1 has quit [Quit: Leaving.]
arooni-mobile has quit [Ping timeout: 248 seconds]
arooni-mobile__ has quit [Ping timeout: 248 seconds]
<Ox0dea>
>> Class.new { public def initialize; end }.public_methods.include?(:initialize)
<Ox0dea>
bnagy: In practice, as well. I wonder what that's about.
davedev24 has joined #ruby
mercwithamouth has quit [Ping timeout: 240 seconds]
verto has quit [Ping timeout: 240 seconds]
<bnagy>
cause you're supposed to call new
shock_one has quit [Ping timeout: 265 seconds]
<Ox0dea>
sphex: I trust you're not cheating by looking into how seattlerb and/or Rubinius are doing it?
s2013 has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
<sphex>
I was going to try to make a small "meta-circular interpreter" after to see if I can get the class semantics right, but looks like this is going to be way too hard. I guess I would have to override *all* the introspection features of Object for the objects that get into the interpreter...
tmtwd has joined #ruby
<sphex>
Ox0dea: no. mine is a pure recursive-descent "pratt" parser. will prolly be no more than 2000 lines of code when finished.
<ght>
Question: if I want to halt execution but I want it to return a normal exit code, which I believe is 0, what should I use?
<ght>
Normally I use abort but I believe that's an exit code 1, indicating error
verto has joined #ruby
<Ox0dea>
~ $ ruby -e 'exit 42'
<Ox0dea>
~ $ echo $?
<Ox0dea>
42
<Antiarc>
re: private initialize, you'd do that for a singleton class
<saadq>
I kind of liked what the first answer was talking about, but I don't really want to go against standard conventions in style
<apeiros>
and when you have to use a return statement, then you've got an indicator for spaghetti
* sevenseacat
downvotes top answer
GriffinHeart has joined #ruby
<saadq>
:p
bruno- has quit [Ping timeout: 256 seconds]
* apeiros
too
<apeiros>
you don't write code for people who don't know the language.
<apeiros>
that's silly and no other language does it either.
otzeloot has joined #ruby
otzeloot has left #ruby [#ruby]
jimmythe1at has joined #ruby
<apeiros>
"let's not use >@> in haskell! it's not obvious to people who don't know haskell!"
<sevenseacat>
(is that actually a haskell thing?)
<heftig>
foo = (hash[bar] ||= baz)
<adaedra>
Hello
<heftig>
i surprisingly often forget [] ||= is possible
<apeiros>
sevenseacat: yupp
<sevenseacat>
nice :D
<sevenseacat>
but yeah, ruby has perhaps the strongest style conventions out of any language I've worked with - is silly to flaunt those for the fun of it
* apeiros
added a comment
jimmythehat has quit [Ping timeout: 244 seconds]
<pontiki>
two clients ago, their style *required* returns
<apeiros>
pontiki: that's fine
<pontiki>
fine
<apeiros>
*if* there is a styleguide, follow it. doesn't matter if it collides with your personal preferences. consistent style trumps personal preference.
<pontiki>
F.I.N.E
yh has joined #ruby
<pontiki>
in every case
<apeiros>
weeeeeelll…
<apeiros>
:D
<pontiki>
well, they sign the checks
<apeiros>
nah, when I can, I'll convince people of my style preferences
jenrzzz has joined #ruby
<apeiros>
but if I fail, I go with the project's style
<pontiki>
i did get them to give up on enforcing single quotes
blackmes1 has joined #ruby
zacstewart has joined #ruby
Pupeno has joined #ruby
Pupeno has joined #ruby
* apeiros
uses heredocs for all string literals
<apeiros>
j/k
<maloik>
I quite like single quotes
<pontiki>
you rebel
<maloik>
it shows the intention of the string right away
<sevenseacat>
i always use double quotes, because I find no-one else is consistent with them so I don't really care about following convention
<apeiros>
I stopped using single quotes and use either " or %{}
<pontiki>
i quite like using translation tokens.
<pontiki>
they show the purpose of the string
<apeiros>
what's a translation token?
<sevenseacat>
its completely common in every codebase I've ever seen to use single quotes on one line and double quotes on the next, for no reason
arturaz has joined #ruby
<pontiki>
generally symbol, or a string of dotted words
<apeiros>
require "foo"; require 'bar' # yepp, to my shame, seen in my own code
white_bear has joined #ruby
yh has quit [Ping timeout: 244 seconds]
<pontiki>
TAM: when you're shoulder surfing over the lead dev's shoulder and they're trying to figure out why '#{var} ..' isn't working
luriv_ has quit [Ping timeout: 256 seconds]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Hounddog has joined #ruby
<ljarvis>
oO
<ljarvis>
"lead dev"
<apeiros>
urban dict says: "Tam: extremely hot chick who is an animal in the sack and gives you a throbbing cock"
<apeiros>
I'm now very confused as to what you said…
<pontiki>
yikes
<maloik>
I've found the same thing
<maloik>
:D
<pontiki>
that awkward moment
<maloik>
looked it up as well
<maloik>
right
jackjackdripper has joined #ruby
<pontiki>
now i am super embarassed
jackjackdripper has quit [Client Quit]
vali has joined #ruby
<pontiki>
and i may now be pretty pissed off, too
<vali>
hi guys
<maloik>
blame urban dictionary though
<maloik>
that thing goes for the filthiest explanations first
baweaver_ has quit [Read error: Connection reset by peer]
<apeiros>
so what does TAM mean?
<maloik>
13.09:57:08 < pontiki> that awkward moment
<maloik>
:-)
<apeiros>
aaah
Musashi007 has quit [Quit: Musashi007]
<sevenseacat>
apeiros: thats the last thing I expected from you >_>
<apeiros>
sevenseacat: that I didn't know TAM or that I use urban dict?
<vali>
I'm trying to deploy some dnssec monitoring using the following plugin (https://github.com/opendnssec/dnssec-monitor). The problem is that I'm getting the following error -> (nagios_dnssec.rb:101:in `process_log': undefined method `each' for #<String:0x00000001b54bf8> (NoMethodError))
* sevenseacat
is sitting here giggling
oo_ has quit [Remote host closed the connection]
<vali>
using ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
<apeiros>
UD is relatively good at slang. for technical acronyms I use acronymfinder.com
<maloik>
?code vali
<ruboto>
vali, We can't help you without your code, please post it to https://gist.github.com
<apeiros>
but maloik is right. UD goes for the filthies explanation first :-/
<apeiros>
+t
Emaker has quit []
<apeiros>
pontiki: how does somebody become lead dev if they don't even know that? o0
aspiers has quit [Ping timeout: 256 seconds]
<apeiros>
I can understand lead architect (still bad… at least if they don't at least code in a similar language), but lead dev?
<vali>
maloik: it seems that the problem is related to ruby2.1, the code works ok on ruby1.8
<maloik>
maybe they know why, but just didn't spot it right away
<apeiros>
vali: 1.8 had String#each
djbkd_ has quit [Remote host closed the connection]
<apeiros>
vali: 1.9+ no longer does. use String#each_line
oo_ has joined #ruby
<vali>
apeiros: aaa, ok
<apeiros>
(since that's what String#each in 1.8 did)
<vali>
so, could I replace the method by some chance and work ?
<apeiros>
o0
<apeiros>
I don't understand what you mean "by some chance"
ndrei has joined #ruby
<vali>
:)
<apeiros>
you can just replace .each with .each_line, if the receiver is always a string. no chance involved.
<vali>
If try to use the new method is it going to work ?
<vali>
ok
<pontiki>
apeiros: it's not that they didn't know it
SylarRuby has quit [Remote host closed the connection]
jottr has joined #ruby
<yorickpeterse>
morning
tomphp has joined #ruby
<apeiros>
I would use an AbstractInterfaceFactory
<ljarvis>
dont get that confused with an AbstractInterfaceFactoryBean
Igorshp has joined #ruby
baweaver has joined #ruby
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Igorshp has quit [Remote host closed the connection]
[k- has joined #ruby
platzhirsch has joined #ruby
platzhirsch has left #ruby [#ruby]
<[k->
Ox0dea existence confirmed
mercwithamouth has quit [Ping timeout: 252 seconds]
quimrstorres has joined #ruby
quimrstorres has quit [Remote host closed the connection]
revath1 has left #ruby [#ruby]
zacstewart has quit [Ping timeout: 246 seconds]
baweaver has quit [Ping timeout: 244 seconds]
edwinvdgraaf has joined #ruby
<TheBrayn>
what's the standard way of reading a file if it exists? should I check with File.exist? and then read it or try to read it and then catch an exception?
<adaedra>
check first
<[k->
if you want to be really sure, both ways
<adaedra>
meh
quimrstorres has joined #ruby
<ljarvis>
I would just try to read it, unless there's some other logic you'd need if the file did or did not exist (i.e create it)
<[k->
that is for critical apps, where errors are death
<[k->
but you wouldn't be writing critical apps in Ruby
<ljarvis>
what?
<[k->
as in doing both
<ljarvis>
why wouldn't you write critical apps in Ruby?
ryez has quit [Quit: Page closed]
<yorickpeterse>
Yeah, you should be using Node.js for that
<maloik>
it's not webscale
<maloik>
duh...
<adaedra>
webscale?
<maloik>
before you turn this into a serious discussion, I was trolling :-) sorry
<adaedra>
If /dev/null is webscale, I will use it
Scrofff has joined #ruby
serivich has joined #ruby
<ljarvis>
you just need to fork the shards
olistik has joined #ruby
Brainling has quit [Quit: Leaving]
Brainling has joined #ruby
Scroff has quit [Ping timeout: 240 seconds]
startupality has joined #ruby
<yorickpeterse>
That makes no sense
<yorickpeterse>
You're not supposed to fork, you're supposed to be running a cluster from the start
<ljarvis>
but if you forked the cluster you would have more shards
<maloik>
that's premature scaling, you're not doing lean startup right
<adaedra>
> webscale
sepp2k has joined #ruby
<adaedra>
> sense
<ljarvis>
needs more agile
tomphp has quit [Max SendQ exceeded]
Igorshp has joined #ruby
<yorickpeterse>
I hear the terms "agile" and "lean" pretty much on a weekly basis here at the office
olistik has quit [Remote host closed the connection]
<yorickpeterse>
"We have to do things the lean and agile way"
<yorickpeterse>
"the what?"
Brainling has quit [Read error: Connection reset by peer]
<yorickpeterse>
Unless it actually involves people doing backflips and what not it's not agile
<ljarvis>
everyone in my office would lol all over the place if I said something like that
xkickflip has quit [Quit: xkickflip]
<yorickpeterse>
did they not jump aboard the agile hype train?
<yorickpeterse>
(hhehehehe)
<ljarvis>
heuheuheu
xkickflip has joined #ruby
<adaedra>
yorickpeterse: you need to invent a new buzzword and try to make them use it
arup_r has joined #ruby
<yorickpeterse>
peterscale
<[k->
the Big O Scalation
<[k->
:>
<yorickpeterse>
It has a scaling factor of P(Y)
<yorickpeterse>
or Y(P)
<yorickpeterse>
might be better
<yorickpeterse>
or Y(log P)
<ljarvis>
but is the app supersynchronous?
<maloik>
why peter? (my mind immediately jumped to family guy)
<maloik>
oh.
<maloik>
ignore me
<ljarvis>
...
* ljarvis
hands maloik some coffee
<adaedra>
it's okay, it's monday
<maloik>
there's so many letters in his name, I never make it past "yor"
<yorickpeterse>
and my spin on agile would be Yagile
<maloik>
it's been a long weekend
<yorickpeterse>
you're just getting old
lkba has joined #ruby
<ljarvis>
^
<maloik>
well sure, but I'm also fitter than I have ever been :D
<ljarvis>
you'll gain a few more years after arrrcamp too
<ljarvis>
+r
<adaedra>
tbh, I read it with the e and r switched, yorickpetrese
<maloik>
actually, I think I may take a break from organizing
<maloik>
and I have a feeling the others might too
xkickflip has quit [Client Quit]
<[k->
yorickpeter-erse
<yorickpeterse>
adaedra: that sounds incredibly feminine
<yorickpeterse>
I like it
<ljarvis>
you going to brighton, maloik?
xkickflip has joined #ruby
<maloik>
nah, tomorrow is my last day at work, holiday time
<ljarvis>
noice
GriffinHeart has quit [Remote host closed the connection]
CloCkWeRX has joined #ruby
CloCkWeRX has left #ruby [#ruby]
<maloik>
I think my only conf until the end of the year may be rocketconf in amsterdam
scripore has quit [Quit: This computer has gone to sleep]
<yorickpeterse>
rocketconf?
<yorickpeterse>
man these conf names
<maloik>
I know right
<maloik>
they do have an astronaut in the lineup though
<maloik>
so it's acceptable
<yorickpeterse>
also why are all these conferences in November
codecop has quit [Remote host closed the connection]
<ljarvis>
this year i will have gone to zero confs :/
dgutierrez1287 has joined #ruby
<yorickpeterse>
wait, they have Kuipers?
<maloik>
it's not too late to get an arrrrrcamp ticket :D
<yorickpeterse>
That's both really cool and really out of places
<ljarvis>
actually i went to a Google thing but it doesn't count
<yorickpeterse>
* place
<adaedra>
ljarvis: to zeroconf?
<maloik>
I'll get you an early bird if you want
<ljarvis>
maloik: yeah I can't really afford it with the house purchase :(
<yorickpeterse>
you bought a house?
<ljarvis>
I did
<yorickpeterse>
So lets see the checklist:
<yorickpeterse>
[x] got married
<yorickpeterse>
[x] got house
<yorickpeterse>
[ ] got a kid
<ljarvis>
no no, got engaged
<yorickpeterse>
[ ] got a dog
<ljarvis>
still not married yet
<yorickpeterse>
oh
<yorickpeterse>
well close enough
<ljarvis>
that's next year prolly
<yorickpeterse>
might as well buy a motor bike while you still can
<ljarvis>
:D
<adaedra>
[ ] eat the dog
eGGsha has joined #ruby
<yorickpeterse>
:<
<adaedra>
[ ] eat the kid
<ljarvis>
why am i eating everything
<yorickpeterse>
not sure if baby fat is tasty
<adaedra>
because you're hungry
devbug has quit [Ping timeout: 256 seconds]
RegulationD has joined #ruby
<yorickpeterse>
shit that reminds me, I still need to submit a talk to RubyConf
<yorickpeterse>
Yorick On Tour 2015
<adaedra>
Tour de Ruby
dgutierrez1287 has quit [Ping timeout: 256 seconds]
tomphp has joined #ruby
noname1 has quit [Read error: Connection reset by peer]
<yorickpeterse>
"Gender Identity"
<yorickpeterse>
oooh I'm so filling that in with Airplane
<yorickpeterse>
"Ethnicity" hmmm
<yorickpeterse>
I'll go with "White and sexy"
<yorickpeterse>
How to not get accepted
<yorickpeterse>
in 2 easy steps
bodgix_wrk has joined #ruby
RegulationD has quit [Ping timeout: 255 seconds]
tomphp has quit [Max SendQ exceeded]
haneen has quit [Read error: Connection reset by peer]
haneen has joined #ruby
tomphp has joined #ruby
krz has joined #ruby
<apeiros>
yorickpeterse: isn't the answer to all those questions "Oga"?
<maloik>
ljarvis: loco2 can't sponsor? :(
<ljarvis>
maloik: I've used my conf budget (I think, I need to check)
<yorickpeterse>
apeiros: ha
<yorickpeterse>
"Bio: Oga"
<maloik>
but but but, you did 0 confs? :D
astrobun_ has quit [Remote host closed the connection]
<ljarvis>
maloik: it didn't reset in jan :(
<yorickpeterse>
I too already blew my budget on FOSDEM
<maloik>
aha gotcha
<yorickpeterse>
so I'm just going to apply everywhere as a speaker so I can get free tickets
<yorickpeterse>
HoboConf 2015
<yorickpeterse>
I really want a conference that's just 1 day, single track and only puns
<ljarvis>
yoriconf
<yorickpeterse>
so basically tenderlove giving all the talks
duderonomy has quit []
<maloik>
your "white and sexy" line reminded me of aziz ansari
<yorickpeterse>
maloik: who?
<maloik>
the guy from Parks & Recreations (Tom Haverford), also a standup comedian
<yorickpeterse>
oh that one
<maloik>
started watching a show of his last night, pretty good stuff
<yorickpeterse>
well he's not white though
<maloik>
I know, but it's the kind of joke he'd make :D
meph has joined #ruby
<yorickpeterse>
there's this one episode where he borrows Ron's racoon hat and tries to seduce women with it
<yorickpeterse>
needless to say it doesn't work
<maloik>
hahaha :D and then ron puts it on for one second and gets a compliment
<maloik>
"my friend over here was digging through your trash"
<maloik>
:D
slucx has quit [Ping timeout: 256 seconds]
sebbers_ has quit [Remote host closed the connection]
mduk has quit [Quit: WeeChat 0.3.7]
oo_ has joined #ruby
serivich has quit [Ping timeout: 264 seconds]
<yorickpeterse>
"There's a racoon on my head, he knows how to *****"
platzhirsch has joined #ruby
<DefV>
Hmz
tmtwd has joined #ruby
leat has quit [Remote host closed the connection]
leat has joined #ruby
<DefV>
I love him in his P&R role, but don't like his show. ALSO: #ruby-offtopici
<DefV>
I love him in his P&R role, but don't like his show. ALSO: #ruby-offtopic
<DefV>
wow, this doesn't work like slack does :-)
bluOxigen has quit [Read error: No route to host]
withnale_ has joined #ruby
bluOxigen has joined #ruby
<adaedra>
yeah, irc's not slack.
<ljarvis>
i dunno, i see lots of slacking
<adaedra>
:D
<DefV>
It's become a habit that I can't seem to shake
<DefV>
write smth with typo
<DefV>
pointer up
<DefV>
change
<DefV>
enter
tvw has joined #ruby
VictorBjelkholm has joined #ruby
haraoka has quit [Ping timeout: 255 seconds]
Hounddog has quit [Read error: Connection reset by peer]
haxrbyte_ has quit [Ping timeout: 256 seconds]
Pathfinder has joined #ruby
txdv_ has joined #ruby
<txdv_>
arr
poguez_ has quit [Quit: Connection closed for inactivity]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Papierkorb has joined #ruby
shredding has joined #ruby
lkba_ has joined #ruby
surs2 has joined #ruby
Tritone has joined #ruby
surs1 has quit [Ping timeout: 252 seconds]
lkba has quit [Ping timeout: 256 seconds]
zacstewart has joined #ruby
nfk has joined #ruby
rfish2 has quit [Ping timeout: 264 seconds]
eGGsha has joined #ruby
oo_ has quit [Remote host closed the connection]
n008f4g_ has joined #ruby
ndrei has quit [Ping timeout: 255 seconds]
zacstewart has quit [Ping timeout: 246 seconds]
konsolebox has quit [Quit: Leaving]
<arup_r>
As Array#compact don't remove empty string objects like "" .. I am using my own `[popular.state, popular.country].tap { |o| o.delete("") }.join(", ")` ... I am on Rails platform.. But I didn't find there also any helper.. What you guys use to do the same ?
ndrei has joined #ruby
<yorickpeterse>
If you're using Rails you can probably do `[....].reject(&:blank?)`
haxrbyte has joined #ruby
koos303 has joined #ruby
serivich has joined #ruby
<jhass>
or .select(&:present?) for some less negation
shredding has quit [Remote host closed the connection]
serivich has quit [Read error: Connection reset by peer]
shredding has joined #ruby
beef-wellington has joined #ruby
<jhass>
but this really is a #RubyOnRails question
haxrbyte_ has joined #ruby
<arup_r>
jhass: humm.. But more Rubyish
<arup_r>
nothing specific to core Rails :)
<arup_r>
yorickpeterse: didn't recall that..
xkef has joined #ruby
<arup_r>
thanks to both of you
<yorickpeterse>
for Ruby itself you'd need something like `[...].reject { |x| x.nil? || x.empty? }`
craysiii has quit [Quit: craysiii]
fabrice31 has joined #ruby
haxrbyte has quit [Ping timeout: 264 seconds]
oo_ has joined #ruby
<gregf_>
arup_r: a state would always have a country :/
beef-wellington has quit [Ping timeout: 248 seconds]
<arup_r>
gregf_: yes.. from UI we have a way to make it blank also.. The requirement is only US country need state(required).. for rest optional.. and that is causing problem :)
<arup_r>
so managing it in presentation layer
<yorickpeterse>
Just call it province already, darn Americanos thinking it's always called a state
<yorickpeterse>
pet peeve: apps using "ZIP code" instead of "Postal code"
<adaedra>
code.zip
<apeiros>
d'oh
fabrice31 has quit [Ping timeout: 272 seconds]
* apeiros
guilty of using zip code instead of postal code
<adaedra>
that maybe why swiss post is so slow, they look for the wrong kind of code.
<adaedra>
:p
auzty has quit [Quit: Leaving]
<apeiros>
swiss post actually corrected their postal code file upon my feedback :D
<adaedra>
cool
jaygen has joined #ruby
PpPyg has joined #ruby
Rickmasta has joined #ruby
<apeiros>
I'm split on it. it's cool I found the broken data and they fixed it. it's not cool that data was broken in the first place.
<adaedra>
now, fix all the other broken things
<ddv>
postal_code ftw
jaygen_ has quit [Ping timeout: 264 seconds]
<neanias>
apeiros: things slip through the net sometimes :P
jottr has quit [Ping timeout: 264 seconds]
knu has quit [Remote host closed the connection]
SylarRuby has joined #ruby
xkef_ has joined #ruby
xkef has quit [Ping timeout: 255 seconds]
zacstewart has joined #ruby
knu has joined #ruby
yardenbar has quit [Remote host closed the connection]
CatMartyn has joined #ruby
Blaguvest has joined #ruby
CatMartyn has quit [Max SendQ exceeded]
tmtwd has quit [Ping timeout: 256 seconds]
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
saadq has quit []
pwnz0r has joined #ruby
joshmyers has joined #ruby
<waxjar>
What would be a nice interface to update a list of integers over an HTTP API? I can think two options: 1) a single endpoint that accepts some sort of delta object (POST /list?add=1,2&del=3,4) or 2) multiple endpoints for each action (POST /list/add?ids=1,2 and POST /list/del?ids=1,2). Is there a standard way to do this (or something a bit nicer perhaps)?
<joshmyers>
hola, anyone know how to sudo using Net::SSH? SO posts don't seem to be cutting it.
<adaedra>
waxjar: you know that there are other methods than GET and POST?
<waxjar>
adaedra: yes, i am aware
jottr has joined #ruby
<waxjar>
substitute POST for PATCH if you fancy ;)
<adaedra>
Could be POST to add new, PATCH to replace all, DELETE to remove, or something like that
<waxjar>
DELETE is meant to delete the full resource, no?
<adaedra>
if you say so
pwnz0r has quit [Ping timeout: 248 seconds]
n008f4g_ has quit [Ping timeout: 246 seconds]
mos has joined #ruby
<jhass>
PACTH /list with a {"ids": {"add": [], "remove": []}} payload probably makes the most sense
agent_white has joined #ruby
Musashi007 has quit [Quit: Musashi007]
nfk has quit [Remote host closed the connection]
startupality has quit [Quit: startupality]
startupality has joined #ruby
VictorBjelkholm has quit [Ping timeout: 264 seconds]
<jhass>
that is if you have to save requests, of course the "true" (but inefficient) way would be POST /list with {"id": 1} (no array) and DELETE /list/1
<waxjar>
yeah, this is not an option unfortutely, i need to be able to add/delete multiple IDs at a time :)
<waxjar>
I'll go with the single PATCH endpoint, thx guys
jimmythe1at has quit [Ping timeout: 246 seconds]
serivich has joined #ruby
oo_ has quit [Remote host closed the connection]
<Stratege>
say I got a function foo, how would I bind that function to a variable? Given that function invocation doesn't need () I'm not seeing an easy way to do so and search engines haven't been helpful
Tempesta has joined #ruby
<apeiros>
Stratege: a method is always defined on an object. so you'd define the method on an object and assign that object to a variable.
<apeiros>
Stratege: alternatively you use a proc object
ruby-lang709 has joined #ruby
<jhass>
or describe your actual problem / show your code
<apeiros>
Stratege: what are you trying to achieve? i.e. NOT your abstract goal. your concrete goal.
tuor has joined #ruby
<tuor>
hi, i want to set a parameter to undef by default. I tried like this, but it's wrong (syntax error, unexpected keyword_undef): http://paste.debian.net/281881/
ruby-lang709 has quit [Client Quit]
<apeiros>
tuor: there's no undef in ruby.
<jhass>
tuor: you'll likely want nil
<apeiros>
^
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<tuor>
apeiros, ah ok.
<Stratege>
apeiros playing the ruby warrior game, decided "fuck trying to assemble clever logic" and now I'm just trying to create an array of instructions that it should go through one by one.
<adaedra>
you can use method to get a callable object on which you can do .call()
<tuor>
jhass, thx
<Stratege>
okay, cool. thanks
<jhass>
Stratege: or just use public_send and an array of symbols & parameters
<apeiros>
or have an array of procs
<adaedra>
if those are just method names, you can also just save the names as symbols and use send
<apeiros>
adaedra: s/send/public_send/
<adaedra>
the former is more useful if your method comes from different objects
<apeiros>
always hone the good practices ;-)
<Stratege>
hm, public_send sounds useful.
unshadow has joined #ruby
leat has quit [Remote host closed the connection]
<Stratege>
a friend of mine just pointed out to me that in ruby methods are not values, is that really true?
leat has joined #ruby
<adaedra>
they're not directly values as they are in some FP languages, no
<Stratege>
is there a particular reason why they aren't?
<jhass>
you can get an object representing one though
<adaedra>
is there a particular reason why they should be? :)
olistik has joined #ruby
Zai00 has quit [Quit: Zai00]
<Stratege>
adaedra yeah, because there is no fundamental difference between them.
<Stratege>
it's like treating a string differently than an integer, on a fundamental level.
<adaedra>
it is?
but3k4 has joined #ruby
PlasmaStar has quit [Ping timeout: 256 seconds]
Tempesta has quit [Quit: Going offline, see ya! (( www.adiirc.com )]
<Stratege>
yes
oo_ has joined #ruby
surs3 has joined #ruby
<jhass>
that's purely viewpoint ;)
PlasmaStar has joined #ruby
sdothum has joined #ruby
<Stratege>
I am, of course, open to hearing about the benefits of treating methods as not-values.
<jhass>
where you declare atomicity is arbitrary, you declare it at function level, ruby declares it at object level
meph has quit [Quit: Leaving.]
oo_ has quit [Remote host closed the connection]
<Stratege>
so numbers in ruby are actually objects as well? No distinction between object types and value types?
<apeiros>
either upgrade your ruby, or use one of the other forms to mark the method as private
<apeiros>
upgrading clearly preferred
<apeiros>
if you're starting with ruby, there's no reason not to use the current version, 2.2.2
Zai00 has quit [Client Quit]
<ddv>
lol debian has an ugly pastie
pfish has quit [Ping timeout: 246 seconds]
<adaedra>
but it's stable at least
revath has joined #ruby
yardenbar has joined #ruby
<apeiros>
there are unstable pastebins? o0
<ddv>
apparantly....
<adaedra>
debian stable joke
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ddv>
this is a serious channel adaedra
<apeiros>
oh
<ddv>
no jokes
<apeiros>
it's monday! that's not a day for jokes!
<darkf>
adaedra: I was going to make fun of arch not having one but they actually do. in french. http://pastebin.archlinux.fr/
<ddv>
also im tired and cranky
shredding has quit [Ping timeout: 256 seconds]
<Stratege>
I still don't see the benefit of methods requiring special treatment to be considered as objects. Something that not even php requires. What benefit does that provide?
<tuor>
apeiros, I have to write it for debian wheezy ruby version. I'll use the "normal/old" way for "private"
<apeiros>
Stratege: uh, what?
<adaedra>
darkf: what an awful language, I wonder who even speaks it.
<apeiros>
Stratege: how are methods first level objects in php?
<darkf>
adaedra: Arch users! that's how they go fast, you know
<adaedra>
Stratege: er, PHP has no method as values. You just store strings.
stnly has quit [Remote host closed the connection]
<yorickpeterse>
and oh it doesn't work for scalars
eGGsha has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<adaedra>
they even differentiate internal functions from user functions
<adaedra>
using PHP to prove your point? kek.
surs4 has joined #ruby
<ddv>
lol
lessless has joined #ruby
<apeiros>
adaedra: absolutely valid! "this is just as shitty as in php"
<apeiros>
it's difficult to achieve that, though
<adaedra>
php > function hello() { }; $a = hello;
<adaedra>
PHP Notice: Use of undefined constant hello - assumed 'hello' in php shell code on line 1
<darkf>
well it _is_ similar to PHP :p
<yorickpeterse>
well, in Ruby that too would get you an error
<yorickpeterse>
but at least it would be an error
<ddv>
I feel sad for Stratege
<apeiros>
Stratege: anyway - lets take a language where you actually can get at the function object without a special method call or syntax: javascript
<apeiros>
Stratege: there it's like: x = some_obj.func_name
startupality has quit [Quit: startupality]
<apeiros>
and you can do that because they require parens. so getting function vs. calling the function is unambiguous
startupality has joined #ruby
Zai00 has joined #ruby
surs3 has quit [Ping timeout: 255 seconds]
<apeiros>
now ruby could either use special syntax to differ, e.g. reserve :: for the method object (x = obj::method_name), or it can do what it currently does: not introduce additional syntax but just provide a method
Asher has quit [Ping timeout: 248 seconds]
<apeiros>
not using syntax has one big benefit: it's discoverable.
<apeiros>
or rather: using methods has that benefit.
<apeiros>
there are, of course, also downsides to it. but all in all it's a design decision.
Asher has joined #ruby
polyrob_ has joined #ruby
blueOxigen has joined #ruby
<darkf>
apeiros: perhaps you could enlighten me as to why Ruby thinks non-existent indices/keys on arrays/hashes should be 'nil' and not an error?
yashinbasement has joined #ruby
startupality has quit [Read error: Connection reset by peer]
<adaedra>
darkf: actually, they can be whatever you want to be
<apeiros>
darkf: .fetch and it raises
<apeiros>
darkf: it's a matter of which method you use
<apeiros>
as for *why* they chose one over the other - ask the authors. I can only provide possible rationales.
<darkf>
apeiros: well, most everyone is going to know about #[] which uses an IMO shitty-by-default 'return nil for default values'
<Stratege>
ddv why feel sad for me?
<yashinbasement>
hello rubishists , someone asked me what is the meaning of <%== %> , any idea , i have no idea
<darkf>
I did not know about #fetch and it seems more heavyhanded than I'd want beyond just using #[] :/
bluOxigen has quit [Ping timeout: 255 seconds]
<adaedra>
"Ton ptit nom" "Combien de temps doit-on garder ce superbe post " – Lol archlinuxfr
<canton7>
yashinbasement, look up erb syntax
polyrob has quit [Ping timeout: 248 seconds]
polyrob_ is now known as polyrob
<apeiros>
darkf: *shrug*
oo_ has joined #ruby
<apeiros>
darkf: honestly, I haven't had an issue with [] returning nil
<apeiros>
darkf: you can also create your hash with a default proc which raises
<yashinbasement>
canton7: double equals
<apeiros>
I do that in some rare places where I want to make sure neither I nor any co-developer accidentally fucks up
<adaedra>
if you want to check for existance, they're .key?
<apeiros>
(and where nil are valid values)
<darkf>
apeiros: I do. nil is a value I would probably have as values, and if my code is buggy it will access some key/index that does not exist and I am erroneously getting a value I would expect :p
<canton7>
ah
<darkf>
and I would not know about it (much like JS' undefined, which is also shit)
bruno- has joined #ruby
<yorickpeterse>
then use `if x.key?(...)`
<apeiros>
darkf: as in all programming: use proper tools.
<yorickpeterse>
problem solved
<apeiros>
it's as simple as that
<apeiros>
you can't blame the language for you not knowing the proper methods.
<darkf>
apeiros: proper tools? so, not Ruby? /s
<apeiros>
darkf: read again.
<ddv>
just dont use programming languages I hate them all
<darkf>
apeiros: I can blame the language for not doing things I'd expect, and when everyone uses #[] I cannot be expected to know that #fetch exists
<darkf>
ddv: +1
<canton7>
yashinbasement, read the erubis docs :P
startupality has joined #ruby
<darkf>
believe it or not you can blame things for bad design
<apeiros>
darkf: fine, don't use ruby. use mental-lang. it figures what you expect from it automatically.
<canton7>
it's in there somewhere... trying to find where
<yorickpeterse>
darkf: yes you can, it's called "Read the documentation"
<apeiros>
sorry, but that's obtuse.
<yorickpeterse>
Everybody using X is not an excuse for not knowing Y doesn't exist
<yorickpeterse>
That's such bullshit it's not even funny
zz_Outlastsheep is now known as Outlastsheep
<yorickpeterse>
"Everybody uses petrol powered cars, therefor I don't know electric cars exist"
<darkf>
yorickpeterse: it's the most obvious way to access an item. why would i not expect that to do something sane?
<darkf>
that is a bullshit cop-out
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<darkf>
"you can just use this other method, just RTFM!"
<yorickpeterse>
darkf: what's not sane about returning nil?
<apeiros>
darkf: it does something perfectly sane
<apeiros>
darkf: you're all "oh my use case must be everybody's use case"
<Stratege>
also yeah sorry about the php comment, for some silly reason I thought lambdas and methods would be treated the same... I shouldn't have made that silly assumption ^^
<yorickpeterse>
nil is a value yes, but so is an integer or a string or anything else
<ddv>
he has a point tho, asking for something that doesn't exist is an error right
<apeiros>
anyway, pointless to continue that discussion. entitlement never hears arguments.
<darkf>
apeiros: nor are you. clearly nobody has this problem because a few of you don't, right; everybody just RTFMs and uses #fetch instead
<yorickpeterse>
so by that argument #[] returning anything else is equally wrong
<adaedra>
Stratege: never make assumptions in PHP. This language was designed with a dice.
<apeiros>
darkf: correct. we read the manual and don't run into the problem. great you see that.
<darkf>
great
<yorickpeterse>
darkf: No, people use #fetch when they need to have custom behaviour or raise an error
<apeiros>
darkf: we don't blindly expect the language to do whatever our imagination happens to come up with
<yorickpeterse>
In the 10ks of LOC that I have #fetch is only used in a few places, #[] works fine everywhere else
<apeiros>
darkf: we don't guess. we verify.
<adaedra>
if you know how the tool work, you're better using it.
<darkf>
I hope when you run into errors which cause you to lose hours of your time due to shitty default behavior you finally RTFM and find an obscure method which solves all of that by providing sane behavior ;)
c355E3B has joined #ruby
<yashinbasement>
canton7: thankss
<yorickpeterse>
#[] raising an error by default would be useful if a compiler could catch this prior to running the app
<Stratege>
adaedra yeah ... my bad xD I normally don't xD
<yorickpeterse>
darkf: is that not the core of programming?
<yorickpeterse>
As in, find bug, find something better, use that?
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<darkf>
not when it's something the language could easily prevent, no
<apeiros>
darkf: you refuse to accept that the language *does* easily prevent it.
<canton7>
I think the lesson here is "don't try to use something you don't know how to use". If you say "I tried to drive a lorry but crashed it, that's the lorry's fault" people will laugh at you
<yorickpeterse>
apeiros: yeah but imagine having to learn this new thing
<adaedra>
I prefer having #[] returning nil rather than raising
<yorickpeterse>
heavens forbid actually having to spend some time on your program
<Stratege>
to me the core of programming is to think about what the problem requires and then express that in a way that captures the essence of the problem and takes care of the cornercases. And then go see if the compiler agrees with me or not.
<yorickpeterse>
You know, that thing that might earn you lots of money
<canton7>
ruby has a design philosophy that guides these sorts of decisions. they're consistent within that philosophy.
<darkf>
well I am sorry if you get paid to learn ruby's flaws :)
krz has quit [Read error: Connection reset by peer]
<yorickpeterse>
Here's a personal flow chart on how to solve this problem:
leat has quit [Remote host closed the connection]
<yorickpeterse>
1) Do you need to get a key and raise an error? Use #fetch
<darkf>
and then try to defend the language's shit-by-default behavior with "there are alternates... just hidden away!"
<yorickpeterse>
2) Do you not care about errors, use #[]
<yorickpeterse>
DONE
leat has joined #ruby
<yorickpeterse>
problem solved
<apeiros>
darkf: do us a favor. stop using ruby.
<agent_white>
shevy: PING
<ddv>
thats a pretty simple flowchart
<yorickpeterse>
ddv: Yeah, I patented it
<ddv>
lol
yashinbasement has left #ruby ["Leaving"]
<adaedra>
darkf: be our guest, go use your better designed language if you're not able to adapt other languages with other ways of thinking
<darkf>
apeiros: nah, I think I will continue terrorizing you by pointing out flaws in the design
<darkf>
while you incessantly try to defend it and how dare I
<darkf>
have a chill pill
<apeiros>
darkf: all you did was point out that you're unable to read docs.
<adaedra>
oh, people think differently, how dare they!
<yorickpeterse>
darkf _does_ have a point that #[] raising errors is more common, at least in statically typed languages
<darkf>
no, also in dynamic ones
<yorickpeterse>
but Ruby isn't statically typed, nor does the language itself have a compiler
<yorickpeterse>
(that can check for this)
<darkf>
"JS does it" is not an excuse
<darkf>
yorickpeterse: that ... is irrelevant
<adaedra>
"X does it" is not an excuse, whatever X is
zacstewart has quit [Remote host closed the connection]
<darkf>
python raises an error, and tells you what you fucked up
ndrei has joined #ruby
<darkf>
Ruby silently passes nil, which is a reasonable value
<darkf>
it's stupid as shit
<apeiros>
darkf: oh, funny, same applies otherwise: "X does it that way" isn't an excuse for expecting that behavior from Y
<yorickpeterse>
based on what?
<adaedra>
because they think it's an error, while ruby thinks it's not, it's another way of seeing it
prestorium has joined #ruby
<yorickpeterse>
How is it stupid?
<apeiros>
darkf: anyway, stop the inflammatory tone.
<darkf>
yorickpeterse: _it is a value I would expect_. _nil does not tell me what I did wrong_.
<yorickpeterse>
darkf: sure it does
<darkf>
apeiros: you are the one doing that
<adaedra>
you have #key? and #fetch for force checking, and Hash.new to change default value.
<darkf>
yorickpeterse: imagine I return x[i] from a possibly complex method
<adaedra>
And accessing a non-existing element is not always an error.
<darkf>
it returns nil instead of what I expect
<darkf>
where do I know where this nil came from?
tmtwd has joined #ruby
Takumo has quit [Quit: ZNC is going down!]
<yorickpeterse>
Why do you need to know the origin? You only need to know its presence or not
<darkf>
wat.
<yorickpeterse>
Why do you give a crap where the nil originates from?
<darkf>
because I want to fix my code?
<canton7>
darkf, again, this is "darkf doesn't know how ruby (or objective-c, or any other language which makes this decision) works", not "ruby is shit" :P
<darkf>
or do you just not do that?
Zai00 has quit [Quit: Zai00]
Takumo has joined #ruby
Takumo has quit [Changing host]
Takumo has joined #ruby
<yorickpeterse>
darkf: why is returning nil a problem?
<yorickpeterse>
oh and btw you can track where nil originates from just fine if it weren't a singleton
<yorickpeterse>
IIRC brixen and I have been talking about adding location information to NilClass
<darkf>
yorickpeterse: how would I track that?
<apeiros>
debugging… how does it work
<darkf>
apeiros: who knows, you clearly don't do it
<apeiros>
darkf: I don't have to
<adaedra>
apeiros: you send the code to India and they fix everything
<yorickpeterse>
nil being returned by accident is a problem yes, but #[] very clearly communicates it returns nil when a key is not found
<darkf>
apeiros: right, you write a buggy mess ;)
<apeiros>
!kick darkf told you
darkf was kicked from #ruby by ruboto [told you]
darkf has joined #ruby
<darkf>
yorickpeterse: it also returns nil for [nil][0]
<yorickpeterse>
darkf: Yeah....please actually read up on Ruby's documentation
<darkf>
except as some magical sentinel value?
<yorickpeterse>
because Array#[] says the exact same thing
<canton7>
darkf, again, if you need a "sentinal" value, use #fetch
<yorickpeterse>
From the rdoc
<yorickpeterse>
"Returns nil if the index (or starting index) are out of range.
<yorickpeterse>
boom there you have it
<darkf>
yorickpeterse: you don't seem to understand what I find wrong so nevermind
<canton7>
it's a debatable decision, but it is the way that it is.
<yorickpeterse>
darkf: I do perfectly understand it and I heavily disagree
<canton7>
given that, your place is to learn the langauge, not fight it :P
<yorickpeterse>
There are plenty of cases where raising an error in #[] is super counter productive
Zai00 has joined #ruby
<adaedra>
if the language is not for you because you don't like it, there are so many others to use
<darkf>
fyi the inflammatory tone you all took before me is not conductive to anything
<yorickpeterse>
Same as there might be cases where returning nil is
Takumo has quit [Client Quit]
<apeiros>
darkf: wow
<yorickpeterse>
The solution? Deal with it instead of trying to force one method over there other
* canton7
isn't sure how to tell darkf he's the inflammatory one here
axsuul has quit [Ping timeout: 256 seconds]
Takumo has joined #ruby
Takumo has joined #ruby
<yorickpeterse>
darkf: You're the one here who's making false claims about people
<darkf>
canton7: if you cannot see yourselves being inflammatory then that is the issue
<[k->
I just read a kick and a buggy mess ;)
<canton7>
darkf, I somewhat sympathise with you in principle
<Stratege>
I've kept out of the conversation since it took a bit of a hostile turn, but while darkf has definitly been hostile, he has also had other people be hostile towards him.
prestorium has quit [Quit: Konversation terminated!]
yfeldblum has quit [Ping timeout: 248 seconds]
<apeiros>
!ban darkf !T 1h easy, we can calm the situation down for you.
darkf was banned on #ruby by ChanServ [darkf!*@*]
darkf was kicked from #ruby by ChanServ [Banned: easy, we can calm the situation down for you.]
<canton7>
darkf, but your attitude means I won't argue your case :P
Takumo has quit [Remote host closed the connection]
<adaedra>
2-0
prestorium has joined #ruby
ldnunes has joined #ruby
<adaedra>
Stratege: I guess that's what happens when an unstoppable force encounters an unmovable object.
fantazo has joined #ruby
<txdv_>
boohoo
<yorickpeterse>
but gais why does Ruby not let you do 1 + "1", PHP does that too
<yorickpeterse>
it's so stupid
<adaedra>
ikr
<apeiros>
as I said, it's a case of entitlement
krz has joined #ruby
<yorickpeterse>
Granted it would be nice if Ruby had an Option type and #[] returned an Option
<apeiros>
"I'm entitled to the language behaving the way *I* expect"
* yorickpeterse
might've written too much Rust
shock_one has quit []
<yorickpeterse>
omg monads
<adaedra>
rust <3
<yorickpeterse>
meh, rust is ok
<yorickpeterse>
it's really verbose and the tooling around it is _super_ basic (given it's still very young)
<adaedra>
I was disapointed when I was reading rust guide and got a "To be written later" chapter.
Takumo has joined #ruby
Takumo has joined #ruby
<Stratege>
yorickpeterse oi, if my claim about php's abilities hadn't been false the question would have ben decent. ^^
<txdv_>
you can't coerce ruby to coerce an integer into a string
<yorickpeterse>
Stratege: :P
<yorickpeterse>
Stratege: well, your question isn't too bad to be honest
<Stratege>
and apeiros has given a fairly nice answer to it.
<yorickpeterse>
What I'm uncertain about is Ruby requiring #method and #instance_method to get a method object
ndrei has quit [Ping timeout: 248 seconds]
<yorickpeterse>
instead of referring to the method without parenthesis, although I know why _that_ is (so you can call it without parenthesis)
<apeiros>
Stratege: yay! at least somebody today appreciates my replies :D
<Stratege>
still, personally I think just requiring () to be used for method calls and method objects being obtained via leaving the () out would have been more consistent and nice
<[k->
technically you can coerce
Aderium has joined #ruby
<yorickpeterse>
Stratege: well, not requiring () allows you to write something like "foo if bar?" instead of "foo() if bar?()"
<yorickpeterse>
which is a lot more pleasant on the fingers
tvw has quit [Read error: Connection reset by peer]
<[k->
and eyes
xkef_ has quit [Quit: leaving]
<apeiros>
in my toy language I chose the path of different syntax for invocation vs. getting the method itself
xkef has joined #ruby
ndrei has joined #ruby
<[k->
aka python
<apeiros>
but there I have more syntax anyway. the syntax you choose decides whether you get the method, the method's result, or the receiver as return value
<Stratege>
personally I love the idea of doing function application via whitespace and assignment working via = and never having (), so a nullary function and a value would be indistinguishable, but that requires purity.
<Stratege>
(which, is, ofc, not something every language wants or would benefit from. Atleast not radical purity like that)
<[k->
sounds abit like Nim :o
<agent_white>
Where is shevy ?
but3k4 has joined #ruby
olistik has joined #ruby
y0da has joined #ruby
<Stratege>
yorickpeterse yeah, guess that's a tradeoff. Personally I'm not comfortable with leaving () out yet, since I want to be able to see without a doubt wether what I'm doing is a method call or just accessing a value.
<yorickpeterse>
Stratege: well, at least when using a receiver "foo.bar" is always a method call
<yorickpeterse>
It gets a bit tricky when there's no receiver
<yorickpeterse>
since you have to scan the surrounding code to see if there's a local variable with the same name
<yorickpeterse>
also stuff such as "foo = foo" being valid and resulting in "foo" always being nil (even if there's a method called "foo") is stupid
<Stratege>
foo = foo is valid and does not result in a non-terminating program? o.o
<apeiros>
shevy: since constants start with an uppercase letter - no :)
<shevy>
yeah
<apeiros>
you could consider it a magical string literal
<shevy>
it is indeed magical
eggoez has joined #ruby
<shevy>
it pops up!
tsvenson has quit [Ping timeout: 252 seconds]
<shevy>
I don't think I had a use case for reassigning to __FILE__ yet so that's fine by me
leonardoajim has joined #ruby
Rickmasta has joined #ruby
magical-imouto is now known as ninja-maid-robot
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
revath has joined #ruby
PhantomSpank has quit []
gagrio has joined #ruby
nateberkopec has quit [Quit: Leaving...]
iooner has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
<[k-_>
i have a strong itch to show Ox0dea my code to receive praises :<
lessless has joined #ruby
bluOxigen has joined #ruby
leat has quit [Remote host closed the connection]
<livcd>
#notruby does anybody have a clue how to set a default terminal's theme via cli ? :P
<jhass>
?ot livcd
<ruboto>
livcd, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
Voker57 has joined #ruby
leat has joined #ruby
blueOxigen has quit [Ping timeout: 244 seconds]
<shevy>
livcd via ruby? perhaps! you can call system()
<shevy>
:)
<tuor>
hi, my Method: http://paste.debian.net/281899/, I want to make it possible to give the rules as parameter (with a default) insteed of only harcoding them. Is this possible?
Musashi007 has joined #ruby
<shevy>
I can use ruby for fbsetbg or something like that in fluxbox
_blizzy_ has joined #ruby
<jhass>
?gist tuor
<ruboto>
tuor, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<livcd>
jhass: sorry :-)
<livcd>
shevy: yes it can be via ruby as well lol :-)
<jhass>
tuor: the standard strategy is to define the defaults hash and .merge the parameter into it
<livcd>
shevy: though i would probably know how to do it with ruby if i would know what the hell should i do in the first place :S
<shevy>
livcd what desktop is it?
<jhass>
so foo(rules={}); default_rules = { ... }; default_rules.merge(rules) end
<jhass>
however that's one dimensional
<livcd>
shevy: standard yosemite :D
nateberkopec has joined #ruby
<shevy>
I don't know what that means... is that gnome3? kde4?
<shevy>
or is it the evil OSX
<jhass>
if you want it to work for the nested hashes too, in this case you want to iterate over the defaults and .merge the subhashes
<livcd>
shevy: evil OS X
<shevy>
ah ok
tvw has joined #ruby
victortyau has joined #ruby
Kully3xf has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
<jhass>
livcd: there's ##apple and ##mac
<adaedra>
livcd: come to #ruby-offtopic
Kully3xf has quit [Remote host closed the connection]
<jhass>
livcd: oh and #MacOSX
<tuor>
I only need the "toplevel" hashes. So ex: :template. If the hash is not given as argument I need to take the default on. So if I right understood, I can do it with default_rules.merge(rules).
JoshL has joined #ruby
<livcd>
jhass: ok ok i'll obey the rulez :-)
DoubleMalt has quit [Ping timeout: 256 seconds]
cytoskeletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
_blizzy_ has joined #ruby
ninja-maid-robot is now known as magica-imouto
MatrixBridge has quit [Ping timeout: 264 seconds]
joonty has joined #ruby
<[k-_>
look, people come to the ruby-community for all sorts of things
<[k-_>
this says very good of the community ;)
<shevy>
I came for [k-_
<[k-_>
lies
<[k-_>
you were already here before I
eshy has quit [Max SendQ exceeded]
<[k-_>
looooooooong ago
magica-imouto is now known as magical-imouto
george2 has joined #ruby
MatrixBridge has joined #ruby
evanjs has joined #ruby
tomaz_b has joined #ruby
eshy has joined #ruby
<adaedra>
shevy: we don't care about your sexual life.
rbennacer has quit [Remote host closed the connection]
charliesome has joined #ruby
stantonnet has quit [Remote host closed the connection]
njs126 has quit [Ping timeout: 246 seconds]
blackmesa has quit [Ping timeout: 252 seconds]
dagda1 has joined #ruby
njs126 has joined #ruby
<apeiros>
charliesome: ping. not important, but eval-in seems to have a race condition when creating paste id's. yesterday two people evaled at the same time and both got the same id, the latter overriding the former.
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
krz has quit [Quit: WeeChat 1.0.1]
<charliesome>
wat really
<charliesome>
it just uses mysql auto increment
<charliesome>
it must be a bug in the bot
konsolebox has joined #ruby
<apeiros>
:D
Scroff has joined #ruby
<yorickpeterse>
you're not using BSON object IDs?
<yorickpeterse>
Tssssk
<apeiros>
but the bot uses the ID it gets from eval.in, no?
<apeiros>
so what I think happened: first eval curls, gets 397075 returned, second curls, gets 397076 returned, mutates some global state in curl of the first
<charliesome>
yeah
<apeiros>
it's still your code ;-)
<charliesome>
that would explain it
DoubleMalt has quit [Ping timeout: 246 seconds]
<jhass>
but wouldn't have that mutated the result too?
<apeiros>
the bot isn't opensource atm. I aim to release non-critical parts until end of year.
neanderslob has quit [Read error: Connection reset by peer]
<jhass>
oh, right, we scrape Location, mmh
<apeiros>
jhass: timing
<apeiros>
we read the body first, header later
<charliesome>
apeiros: yeah maybe just toss a mutex around the whole thing
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tkuchiki has joined #ruby
<apeiros>
ok, anyway. sorry for the noise. could have checked for bot-side bug first.
<apeiros>
charliesome: wrt open sourcing ruboto: I remember correctly that you said the eval code was fine to release?
<charliesome>
yeah that's fine
<charliesome>
also that bot's code goes back to like 2012
<charliesome>
at the time I just went with curl but it's probably not necessary
evanjs has joined #ruby
gagrio has quit [Ping timeout: 246 seconds]
<ujjain>
is this ruby? <% scope['hazelcast::extra_libraries'].each do |extra_library| %><%= scope.function_template(<%= extra_library.template %>) %><% end %>
<shevy>
ujjain the part inside the <% and %>
<apeiros>
ujjain: looks like erb
<apeiros>
ujjain: which is a template language embedding ruby
<ujjain>
oh, I didn't know that was a seperate thing
<apeiros>
it's part of ruby. not separate.
<ujjain>
ah ok, interesting. It does not accept <%= inside of <%= though
<shevy>
it's a bit like embedding php/html
<bougyman>
i've not seen hazelcast used in ruby before
<ujjain>
it's Puppet to deploy Hazelcast
<bougyman>
gotcha
<ujjain>
<%= scope.function_template(<%= extra_library.template %>) %> - Complains about this syntax.
umgrosscol has joined #ruby
<bougyman>
it should
<apeiros>
because it's not valid
<bougyman>
you don'e need the <%= in the function call
<ruboto>
pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
Steve_Jobs has joined #ruby
<neanias>
He's alive!
tagrudev has joined #ruby
<neanias>
It's a Christmas mircale
<ddv>
lol
<jhass>
ujjain: <% %> doesn't print, <%= %> does
<ujjain>
ahhhh
<ddv>
another devops guy who doesn't know programming?
<ujjain>
thanks a lot jhass
<ujjain>
haha true
<ujjain>
I used ansible for 2 years though
mercwithamouth has joined #ruby
<bougyman>
i wish devops people would stop writing devops tools.
<bougyman>
they get worse every week.
<yorickpeterse>
bougyman: you don't like your Gulp with your Docker and Ansible?
<bougyman>
hahahah
<bougyman>
believe it or not we're still on chef.
malconis has joined #ruby
<bougyman>
they all suck in many ways. we've wrestled our way around most of chef's suck by now, though.
lele|w has joined #ruby
leat1 has quit [Remote host closed the connection]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
leat1 has joined #ruby
<yorickpeterse>
oh fuck me, I also have to deal with people using "Belgie" for "Belgium"
presto has joined #ruby
<yorickpeterse>
Instead of "België"
<adaedra>
België
<adaedra>
Don't forget Belgique
<shevy>
cheese and chocolate
<shevy>
just like switzerland
prestorium has quit [Ping timeout: 256 seconds]
<bougyman>
I don't differentiate between europeans.
<adaedra>
I thought it were beer and fries
<adaedra>
bougyman: too bad
mesamoo has joined #ruby
julieeharshaw has quit [Ping timeout: 246 seconds]
<shevy>
beer and fries - isn't this the UK
<ujjain>
then I guess it's also obvious why <%= scope.function_template(extra_library['template']) %> returns custom functions must be called with a single array that contains the arguments. For example, function_example([1]) instead of function_example(1) - Evaluation Error: Error while evaluating a Function Call
y0da has quit [Ping timeout: 252 seconds]
vt102 has joined #ruby
abuzze has quit []
vt102 has quit [Remote host closed the connection]
dhjondoh has quit [Quit: dhjondoh]
<yorickpeterse>
gah also the French of course calling it Pays-bas instead of The Netherlands
<yorickpeterse>
ᕕ(ᐛ)ᕗ time to get the boss' credit card
<yorickpeterse>
because those 2500 reqs/day will be blown away in a few minutes
Kully3xf_ has quit [Ping timeout: 240 seconds]
mleung has joined #ruby
mleung has quit [Client Quit]
<[k-_>
A geocoder turns a geographic reference, such as an address, a place name or locality into geographic coordinates as latitude and longitude. The good folks at Wikipedia explain this far better than we can.
bjornar has joined #ruby
<yorickpeterse>
I need more like, 20k/day
davedev24 has joined #ruby
<[k-_>
thats a lot
<[k-_>
you have 20k customers per day? :o
<[k-_>
noice
mos has joined #ruby
<shevy>
all dutch!
otisZart has joined #ruby
<shevy>
[k-_ don't mess with them, they are the asians in europe, watch at their muay thai fighters
Igorshp has joined #ruby
bronson has joined #ruby
<yorickpeterse>
[k-_: No, 20k reviews coming in on a daily basis
<yorickpeterse>
though we've had peaks of 100k
segfalt has joined #ruby
evanjs has quit [Remote host closed the connection]
Blaguvest has quit []
Igorshp has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 246 seconds]
arup_r has quit [Remote host closed the connection]
tvw has quit [Ping timeout: 264 seconds]
<[k-_>
time to freeze some values
gambl0re has quit [Ping timeout: 255 seconds]
<[k-_>
so they dont get changed
Kully3xf has joined #ruby
beef-wellington has joined #ruby
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
varunwachaspati has joined #ruby
hal_9000_ has joined #ruby
devdazed has quit [Quit: Bye]
julieeharshaw has joined #ruby
tvw has joined #ruby
pothibo has joined #ruby
codecop has joined #ruby
davedev24 has quit [Remote host closed the connection]
lxsameer has quit [Quit: Leaving]
lapide_viridi has quit [Quit: Leaving]
mos has quit [Read error: Connection reset by peer]
cpruitt has joined #ruby
paulcsmith has joined #ruby
stantonnet has joined #ruby
SylarRuby has quit [Remote host closed the connection]
<yorickpeterse>
hrmpf, based on our current dataset this would take weeks to reprocess our data
<yorickpeterse>
e.g. at 200k max per day this would take about 50 days
<yorickpeterse>
That assumes an instant response from the server, if it takes 2-3 seconds that would be even longer
<yorickpeterse>
:/
casadei_ has joined #ruby
djbkd_ has quit [Remote host closed the connection]
jpfuentes2 has joined #ruby
<apeiros>
parallelize!!!
jschoolcraft has joined #ruby
* apeiros
goes back under his rock
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
chipotle has quit [Quit: cheerio]
whippythellama has quit [Ping timeout: 256 seconds]
JakFrist has joined #ruby
<yorickpeterse>
apeiros: well yeah, that we already do
<yorickpeterse>
but even then I can still only request per day whatever the rate limit is
<ddv>
pay more
<ddv>
moarrr
whippythellama has joined #ruby
nathanstitt has joined #ruby
<apeiros>
oh yorickpeterse - since you're all into xpath atm - if I have <foo><bar><baz>text</baz></bar></foo>, how would I write an xpath selecting <bar>, based on it having the child <baz> with text "text"?
charliesome has quit [Quit: zzz]
<apeiros>
yorickpeterse: get multiple accounts!
<apeiros>
or yes, in essence: pay more :D
<apeiros>
xpath is one of those technologies I re-learn every ~15 months.
scripore has quit [Quit: This computer has gone to sleep]
aganov has quit [Remote host closed the connection]
scripore has joined #ruby
<shevy>
so powerful is it
<ddv>
money?
chouhoulis has joined #ruby
<ddv>
pretty
<yorickpeterse>
apeiros: foo/bar[baz[.="test"]]
<ddv>
the invisible hand that guides us all
<shevy>
imagine which other technology requires you to relearn it every some months!
<yorickpeterse>
errr "text"
Soda has quit [Remote host closed the connection]
<[k-_>
more powerful than than my library ;-;
<[k-_>
...java
charliesome has joined #ruby
<[k-_>
pretty soon my library will be on that list
<yorickpeterse>
apeiros: you just smack it in front of the name
<[k-_>
adaedra: you are being awful :(
<apeiros>
but my real example has namespaces, so I have to figure out how to properly use them in the xpath
<yorickpeterse>
e.g. for "<foo:bar />" that would be "foo:bar"
<adaedra>
[k-_: I am?
<[k-_>
yes
<yorickpeterse>
assuming the xmlns is registered
<apeiros>
yorickpeterse: ah, k. in CSS it's | not :
<yorickpeterse>
Yeah
<apeiros>
(and I only remembered it was different)
<apeiros>
thanks :D
fabrice31 has joined #ruby
<adaedra>
[k-_: what did I do again?
dopie has joined #ruby
<neanias>
What didn't you do?
fgo has joined #ruby
<[k-_>
22:12:22 adaedra: you would prefer that we poke fun at you, shevy ?
<ddv>
apeiros: i'm always screwing around with namespaces and nokogiri
<adaedra>
neanias: coding in java. I never coded in Java.
vyorkin has quit [Read error: Connection reset by peer]
<neanias>
adaedra: probably for the best
tesuji has quit [Ping timeout: 255 seconds]
vyorkin1 has joined #ruby
lavros has joined #ruby
tomaz_b has quit [Quit: Leaving]
<adaedra>
[k-_: it was an honest proposition.
<[k-_>
therefore, awful
eggoez has quit [Ping timeout: 246 seconds]
<neanias>
[k-_: that gist is giving me headaches
<[k-_>
awful as in mean
<[k-_>
neanias: :>
<adaedra>
right [k-_, let's say I'm awful.
<adaedra>
what now?
pfish has joined #ruby
<shevy>
don't poke me
<apeiros>
ddv: you just have to pass them in on .css/.xpath
<Aderium>
is there a way to tell gem install which compiler to use ?
chrissonar has quit [Remote host closed the connection]
* adaedra
pokes shevy with [k-_
<Aderium>
I am down to one gem that will not compile
<shevy>
ouch!
<apeiros>
e.g. .css("ns|tag", "ns" => "fully qualified namespace")
Xiti has quit [Ping timeout: 246 seconds]
<ddv>
apeiros: I once had a xml file littered with dozens of namespaces
<pfish>
is there a single c function that called when an object is edited?
<[k-_>
if you are mean you should stop :c
<ddv>
apeiros: and I registered all namespaces but still it wouldn't work
<shevy>
Aderium hmm I think there is a way, but remember, you can always extract a .gem and enter the directory and then manually compile or modify anything there
<yorickpeterse>
well sent these peeps an Email, lets see how they respond to my "can we do 30k on average with a burst of 100k and oh we also need 10 million initially" Email
<shevy>
Aderium what gem is it?
<yorickpeterse>
because I cbf writing city/country matchers myself
<Aderium>
Its one we have created
<shevy>
aha
<adaedra>
[k-_: okay, I'll stop being what you call mean and be what I call evil, is that ok? >:]
fabrice31 has quit [Ping timeout: 252 seconds]
<Aderium>
I cloned it locally but it seems to always call cc instead of gcc during gem install
<shevy>
problem is I also don't know how to compile on solaris sorry
tagrudev has quit [Remote host closed the connection]
evanjs has joined #ruby
havenwood has joined #ruby
<[k-_>
im sure shevy has learnt to ignore my code
eggoez has quit [Ping timeout: 252 seconds]
<[k-_>
shevy, there is a nicer translation of the code at the end!
<ddv>
not just your code, [k-_
<[k-_>
and what?
dudedudeman has quit [Ping timeout: 256 seconds]
<[k-_>
there is errata in square_root and cube_root. Should be (1/2r) and (1/3r)
kies^ has joined #ruby
iooner has quit [Ping timeout: 246 seconds]
eggoez has joined #ruby
Hobbyboy has quit [Ping timeout: 246 seconds]
<shevy>
[k-_ I still don't quite understand how you manage to surpass Ox0dea
<[k-_>
i also used and, thats a first
<[k-_>
i needed the lower precendence
<[k-_>
i didnt surpass him, he wrote concise non-alphanum code
<shevy>
Aderium oh that reminds me. if you have a autogenerated Makefile, can you not just modify the part where it grabs the C compiler?
<Aderium>
we use cmake
<[k-_>
i write ugly and unconcise mostly non-alphanum code
<Aderium>
not sure how to tell cmake to use gcc
Hobbyboy has joined #ruby
jonathanwallace has joined #ruby
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
t0rrieri__ has joined #ruby
<JMoir>
I'm reading some code and I came across this: @now = session || Hash.new Am I right in thinking that this line sets @now to session if it is set, but if it is nil or false, it creates a new Hash?
<jimmythehat>
jhass no its still undefined
DaniG2k has joined #ruby
startupality has joined #ruby
iooner has joined #ruby
dudedudeman has joined #ruby
<jhass>
jimmythehat: paste some actual code and the error output
stamina has quit [Remote host closed the connection]
<ljarvis>
JMoir: yes
dudedudeman has quit [Changing host]
dudedudeman has joined #ruby
<JMoir>
ljarvis: Thank you! I just wanted to check, I've never seen it before
vyorkin1 has joined #ruby
<jimmythehat>
its not a method on the original string but a method on a different string. The inblock variable 'letter' is a new string for each loop (I think). It becomes a new string containing one letter of the original string
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
t0rrieri__ has quit [Quit: Be back later ...]
frem has joined #ruby
tmtwd has quit [Ping timeout: 246 seconds]
theery has joined #ruby
eGGsha has joined #ruby
werelivinginthef has joined #ruby
presto has quit [Read error: Connection reset by peer]
presto has joined #ruby
lapide_viridi has joined #ruby
rsty1 has joined #ruby
theery has quit [Remote host closed the connection]
decoponio has joined #ruby
victortyau has quit [Quit: Leaving]
sharpmachine has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
riotjones has quit [Remote host closed the connection]
<Aderium>
ok adding extconf the ruby config worked
aspiers has quit [Ping timeout: 246 seconds]
<Aderium>
yone knows this error ? gcc: error: unrecognized command line option ‘-KPIC’
<rsty1>
a JSON object that has many sets of {:notes=>"value", :key=>"value", :value=>"value}... how would i display the :value value, when :keys value = "ExpectedKey"
<shevy>
Aderium I only know of -fPIC
<jhass>
rsty1: you mean an array of hashes or?
<rsty1>
i have JSON output
Zamyatin has joined #ruby
<[k-_>
shevy: quick, throw me something easy to write in ruby (eg Run-length encoder)
theery has joined #ruby
_blizzy_ has joined #ruby
<jhass>
rsty1: no, what you posted is the inspect of a hash
<rsty1>
and i have an object called :custom_fields, with the above 3 values in each
<jhass>
?code rsty1
<ruboto>
rsty1, We can't help you without your code, please post it to https://gist.github.com
Dreamer3 has joined #ruby
<shevy>
[k-_ a random word insulter
tkuchiki has quit [Remote host closed the connection]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ljarvis>
better yet build your own objects from that hash
aspiers has joined #ruby
<ljarvis>
tune in for more unscalable tips and tricks
dblessing has quit [Ping timeout: 256 seconds]
<jhass>
or at least .map {|field| [field[:key], field] }.to_h
acke has quit [Quit: Leaving...]
<apeiros>
adding ?jsonobject next…
MagePsycho_ has joined #ruby
rippa has joined #ruby
<jhass>
yes please
<apeiros>
so common
<ljarvis>
aye
charliesome has quit [Ping timeout: 246 seconds]
unshadow has quit [Quit: leaving]
pfish has quit [Quit: Page closed]
<apeiros>
!fact add jsonobject there is no such thing as a JSON object. You either have a String containing serialized JSON, or you have ruby objects (usually Hashes/Arrays/Strings). Which is it?
<ruboto>
apeiros, I will remember that jsonobject is there is no such thing as a JSON object. You either have a String containing serialized JSON, or you have ruby objects (usually Hashes/Arrays/Strings). Which is it?
<apeiros>
good to go?
<[k-_>
wait, he wants the key and the hash?
jimmythehat has quit [Ping timeout: 248 seconds]
jottr has quit [Ping timeout: 244 seconds]
TomyWork has joined #ruby
<TomyWork>
hi
<rsty1>
thank you all, i have a solution now :)
<ljarvis>
hi
symm- has joined #ruby
* apeiros
still ponders creating a JsonObject gem which would provide XML DOM like access to json data :D
agent_white has quit [Read error: Connection reset by peer]
<TomyWork>
how can i pass a {} block on to another function?
<ljarvis>
apeiros: jpath!
<jhass>
TomyWork: def foo(&block) other(&block)
<TomyWork>
ah
<jhass>
TomyWork: where block is an arbitrary name
tmtwd has joined #ruby
<TomyWork>
i'll stick with block though :)
msnyon has joined #ruby
<TomyWork>
i tried various variations of that, but &block on both ends i didnt try
<TomyWork>
thanks
dudo has joined #ruby
mary5030 has quit [Remote host closed the connection]
dudo has quit [Remote host closed the connection]
jottr has joined #ruby
mdarby has joined #ruby
Zai00 has quit [Quit: Zai00]
mary5030 has joined #ruby
silverdust is now known as bl4ckdu5t
agent_white has joined #ruby
allomov has quit [Remote host closed the connection]
davedev24 has joined #ruby
bruno- has joined #ruby
wprice has quit [Quit: wprice]
presto has quit [Quit: Konversation terminated!]
presto has joined #ruby
presto has quit [Client Quit]
bl4ckdu5t is now known as silverdust
presto has joined #ruby
sharpmachine has joined #ruby
gwendall has quit [Read error: Connection timed out]
theery has quit [Remote host closed the connection]
sarkyniin has joined #ruby
aspiers has quit [Ping timeout: 256 seconds]
programmerq has joined #ruby
gwendall has joined #ruby
fullofcaffeine has joined #ruby
ItSANgo__ has quit [Quit: Leaving...]
mary5030 has quit [Remote host closed the connection]
werelivinginthef has quit [Remote host closed the connection]
mary5030 has joined #ruby
charliesome has joined #ruby
varunwachaspati has quit [Ping timeout: 264 seconds]
pothibo has quit [Quit: pothibo]
presto has quit [Read error: Connection reset by peer]
<shevy>
pfish everything in ruby is C behind the scene isn't it :D
<ljarvis>
?context pfish
<ruboto>
pfish, Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
brianpWins has quit [Ping timeout: 256 seconds]
white_bear has quit [Quit: leaving]
fantazo has quit [Quit: Verlassend]
<shevy>
to set a hash, one would use rb_hash_aset()
<noobda>
know any good client library that I can check out?
CatMartyn has joined #ruby
<adaedra>
neanias told you about httpparty, I usually use curb, there are others, check ruby-toolbox
<jhass>
noobda: http looks pretty neat, faraday hasn't failed on me either
<neanias>
I didn't like that curb needed to step out of ruby
<noobda>
okay thanks!!
<havenwood>
neanias: just libcurl
<ljarvis>
D:
<neanias>
True, but HTTParty is all ruby
<havenwood>
neanias: HTTPClient and Excon are two more pure-Ruby honorable mentions.
<neanias>
And wraps Net::HTTP
<ljarvis>
libvomit
<havenwood>
neanias: It's actually a wrapper around Net::, yeah
<neanias>
Close enough
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood>
neanias: Not so for HTTPClient and Excon
jespada has joined #ruby
<neanias>
Are they independent solutions?
<havenwood>
neanias: If you might want to switch your adapter, Faraday. I do like HTTP's chaining syntax personally.
<ljarvis>
faraday is http.rb are my favs too
ledestin has joined #ruby
<ljarvis>
s/is/and/
<neanias>
I don't use Faraday
<neanias>
I just use HTTParty
treehug88 has joined #ruby
JakFrist has joined #ruby
<adaedra>
When you HTTPParty, you must party hard!
<havenwood>
neanias: Maybe give HTTP.rb a try.
<havenwood>
If the partying gets to be too much.
<neanias>
Might have a look
arup_r has joined #ruby
Soda has joined #ruby
gizmore has joined #ruby
presto has quit [Ping timeout: 248 seconds]
a346 has joined #ruby
<neanias>
havenwood: looks p nice
DoubleMalt has quit [Remote host closed the connection]
ljt has quit [Read error: Connection reset by peer]
ledestin has quit [Client Quit]
arturaz has quit [Ping timeout: 255 seconds]
NeverDie has joined #ruby
rcvalle has joined #ruby
NeverDie has quit [Max SendQ exceeded]
baweaver has joined #ruby
Pathfinder has quit [Ping timeout: 265 seconds]
Cache_Money has joined #ruby
Pathfinder_ has joined #ruby
scripore has joined #ruby
NeverDie has joined #ruby
ljt has joined #ruby
lessless has joined #ruby
ljt has quit [Read error: Connection reset by peer]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<iamse7en>
I have a button that adds a filter: <%= link_to 'NFL', request.original_url + '&league[]=nfl', class: 'btn btn-default' %>, but how do I do the exact opposite, removing the filter or removes '&league[]=nfl' from the url?
NeverDie has joined #ruby
<apeiros>
odd, I remembered it doing something else
<apeiros>
maybe I'm confusing stuff again…
niko has quit [Ping timeout: 615 seconds]
<apeiros>
iamse7en: rails?
neektza has joined #ruby
<jhass>
?crosspost iamse7en
<ruboto>
iamse7en, Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
<iamse7en>
ok i'll check it out thanks
<apeiros>
oh, crosspost and unresponsive. good riddance.
allomov has joined #ruby
mroth has joined #ruby
<apeiros>
!kick iamse7en crosspost
iamse7en was kicked from #ruby by ruboto [crosspost]
iamse7en has joined #ruby
<jhass>
heh
<[k-_>
lel, that looks too complex for me
iamse7en has left #ruby ["I'm out like a black kid in a spelling bee."]
<[k-_>
i force people to write obfuscated code!
frankS2 has joined #ruby
fullofcaffeine has joined #ruby
Guest74302 has quit [Changing host]
Guest74302 has joined #ruby
jimbeaudoin has joined #ruby
Guest74302 is now known as nitrix
Marc_Aldrich has joined #ruby
Lloyd has joined #ruby
shinnya has joined #ruby
kedare has joined #ruby
SylarRuby has quit [Remote host closed the connection]
<Marc_Aldrich>
I've got a quick question about RubyInstaller: IRB is broken on setup, Ruby -v works. Path doesn't seem to be an issue. Win7-x64 machine. Anybody have a hint or advice on where to point my question?
fgo has quit [Quit: WeeChat 1.1.1]
mary5030 has quit [Ping timeout: 255 seconds]
quimrstorres has quit [Ping timeout: 246 seconds]
mary5030 has joined #ruby
k3asd` has joined #ruby
kedare has quit [Client Quit]
jmcc has joined #ruby
kedare has joined #ruby
mary5030 has quit [Remote host closed the connection]
niko has joined #ruby
dmoe has joined #ruby
mary5030 has joined #ruby
rehat_ has joined #ruby
kedare has quit [Client Quit]
<havenwood>
Marc_Aldrich: How is it broken?
kedare has joined #ruby
<Marc_Aldrich>
A cascading error: "rbreadline.rb:1097:in `<module:RbReadline>': HOME environment variable (or HOMEDRIVE and HOMEPATH)
<Marc_Aldrich>
must be set and point to a directory (RuntimeError)"
<Marc_Aldrich>
That is top error though
<Marc_Aldrich>
Also thank you for your time
bove has joined #ruby
cbetta has joined #ruby
<shevy>
try to set that var?
nathanstitt has quit [Quit: Laters]
<Marc_Aldrich>
I'm not entirely sure what var it wants to have set or where it want it to point. HOME is currently undefined. I could set it, just not sure what to point at and readme doesn't seem to list it
im0b has joined #ruby
Guest85414______ has joined #ruby
mleung has joined #ruby
* Marc_Aldrich
is a Linux user stuck on windows for work
quimrstorres has joined #ruby
Lucky___ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chouhoulis has quit []
<shevy>
well set it anyway to your home dir, perhaps it won't help but if it helps that would have solved that quite quickly
<shevy>
I am also a Linux user :)
Ilyas has joined #ruby
t0rrieri__ has quit [Quit: Be back later ...]
theery has joined #ruby
<Marc_Aldrich>
A fair recommendation. I'll give it a shot
snockerton has quit [Quit: Leaving.]
iamdevnul has joined #ruby
Igorshp has quit [Remote host closed the connection]
t0rrieri__ has joined #ruby
<Marc_Aldrich>
Did not work when setting HOME or HOMEPATH to ruby install direction or ruby/lib
<Marc_Aldrich>
Same error
yo61 has joined #ruby
<Antiarc>
You probably want to set it to c:\Users\YourUsername
<Antiarc>
or something like that
neersighted has joined #ruby
yo61 has quit [Client Quit]
snockerton has joined #ruby
<Antiarc>
Also if you're setting it via the env vars manager in advanced system settings, be sure to relaunch any command prompts so they'll pick up the change
<Marc_Aldrich>
Thank you for the suggestion. Result-> Same error
<shevy>
yeah let me look at that strange rbreadline.rb file ...
shredding has quit [Ping timeout: 248 seconds]
allomov has quit [Remote host closed the connection]
<shevy>
btw on a sidenote, is Readline required on windows?
<Marc_Aldrich>
Current procedure is using: setx HOME ..., then cmd, then irb
lordkryss has joined #ruby
<Marc_Aldrich>
I added it with gem install rb-readline just in case
djbkd_ has quit [Remote host closed the connection]
<Marc_Aldrich>
But I honestly do not know.
Agoldfish has joined #ruby
<shevy>
hmm
polpak has joined #ruby
<Marc_Aldrich>
wait got it!
<shevy>
when I installed ruby on my windows machine downstairs, it worked fine, irb too. I did not install readline though
zacstewart has quit [Remote host closed the connection]
dling has quit [Ping timeout: 252 seconds]
allcentury has joined #ruby
sarkyniin has quit [Remote host closed the connection]
Mojo_Nixon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sarkyniin has joined #ruby
<dfockler>
arup_r: when you raise an error you can just pass a message to it
peter_paule has joined #ruby
<arup_r>
In the line where am I raising... if I pass message it is becoming a long like.. so I push it there.. But I was not sure about my idea,,, thus asked
MarkTurner has quit [Quit: This is probably a wireless dropout]
lkba has joined #ruby
MarkTurner has joined #ruby
<dfockler>
You probably want to make each type of error you throw subclass from Standard error then you can raise it like
_djbkd has quit [Remote host closed the connection]
yardenbar has joined #ruby
<dfockler>
raise NoPostDataError, "There was no data to post"
malconis_ has joined #ruby
Soda has quit [Remote host closed the connection]
einarj has quit [Remote host closed the connection]
<dfockler>
or raise ConnectionFailureError, "Failed to make connection"
rdark has quit [Quit: leaving]
malconis has quit [Ping timeout: 248 seconds]
<dfockler>
for the most part they can just subclass StandardError unless you need custom behavior
bungoman has joined #ruby
quimrstorres has quit [Remote host closed the connection]
yfeldblum has joined #ruby
<arup_r>
ok
darkf has quit [Quit: Leaving]
lkba_ has quit [Ping timeout: 256 seconds]
toretore has joined #ruby
genpaku has quit [Ping timeout: 256 seconds]
jerius_ has joined #ruby
<dfockler>
and you don't really even need to subclass if you just want to display a message like how you had it
tomphp has joined #ruby
<dfockler>
just raise "Simple error here"
genpaku has joined #ruby
quimrstorres has joined #ruby
_djbkd has joined #ruby
pfish has quit [Quit: Page closed]
_djbkd has joined #ruby
<arup_r>
No.. I Need to do subclass because, I'll rescue those from my different controller and redirec to different urls as per the exceptions..
quimrstorres has quit [Remote host closed the connection]
jerius has quit [Ping timeout: 246 seconds]
veduardo_ has joined #ruby
<dfockler>
arup_r: yeah if you want to catch those error types then you'll want to give them a class
<arup_r>
that's why I am buliding custom exception classes
veduardo_ has quit [Client Quit]
mary5030 has quit [Remote host closed the connection]
<arup_r>
humm
<arup_r>
shevy: I am still porting :p
werelivinginthef has quit [Ping timeout: 255 seconds]
<adaedra>
You could also, in your subclass, set the message there
mary5030 has joined #ruby
marr has quit [Ping timeout: 255 seconds]
mary5030 has quit [Remote host closed the connection]
sp4rrow has joined #ruby
mary5030 has joined #ruby
jhack has joined #ruby
<arup_r>
adaedra: didn't get you
axsuul has joined #ruby
axsuul has quit [Excess Flood]
reset has joined #ruby
werelivinginthef has joined #ruby
jottr_ has joined #ruby
dgutierrez1287 has joined #ruby
a346 has quit [Quit: a346]
bronson has joined #ruby
jpfuente_ has quit [Ping timeout: 244 seconds]
koos303 has quit [Quit: Connection closed for inactivity]
platzhirsch has quit [Ping timeout: 264 seconds]
fumihiro has quit [Ping timeout: 252 seconds]
aaeron has joined #ruby
Aswebb__ has joined #ruby
fabrice31 has joined #ruby
Aswebb_ has quit [Ping timeout: 252 seconds]
jobewan has joined #ruby
bklane has joined #ruby
jottr_ has quit [Ping timeout: 250 seconds]
hololeap has quit [Ping timeout: 264 seconds]
dgutierrez1287 has quit [Ping timeout: 246 seconds]
Eiam has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
<dfockler>
arup_r: when you subclass you can set the message in the class definition so you don't have to write the same message everytime
s00pcan has quit [Ping timeout: 256 seconds]
fabrice31 has quit [Ping timeout: 246 seconds]
HakN99 has joined #ruby
bungoman has quit [Remote host closed the connection]
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
aaeron has quit [Quit: Leaving.]
_djbkd has quit [Remote host closed the connection]
icebourg has quit []
s00pcan has joined #ruby
_djbkd has joined #ruby
aaeron has joined #ruby
mbeasley has joined #ruby
evanjs has joined #ruby
aaeron has quit [Client Quit]
mbeasley has left #ruby [#ruby]
bungoman has joined #ruby
saadq has joined #ruby
bklane has quit [Read error: Connection reset by peer]
guest000014 has joined #ruby
danzilio has joined #ruby
simplyianm has joined #ruby
tomphp has joined #ruby
kadoppe has quit [Ping timeout: 264 seconds]
marr has joined #ruby
zacstewart has joined #ruby
DLSteve has joined #ruby
riotjones has joined #ruby
kadoppe has joined #ruby
<guest000014>
Good day. I have some simple code in Ruby stored on web. Is there a way to use it offline, if I have only a flash-driver? Would you recommend me to use some addon for portable google-chome or find a portable compiler?
aaeron has joined #ruby
<jhass>
wat
Xaitec has joined #ruby
<jhass>
"stored in the web"? what does that even mean?
_djbkd has quit [Remote host closed the connection]
vickleton has joined #ruby
simplyianm has quit [Ping timeout: 246 seconds]
<jimmythehat>
?pastebin
<ruboto>
I don't know anything about pastebin
fantazo has quit [Ping timeout: 244 seconds]
simplyianm has joined #ruby
<jhass>
?gist jimmythehat
<ruboto>
jimmythehat, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<guest000014>
compileonline, codepad. But they compile only with internet
<jimmythehat>
jhass haha thats it thanks
<jhass>
guest000014: install ruby?
_djbkd has joined #ruby
casadei_ has quit [Remote host closed the connection]
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
bklane has quit [Read error: Connection reset by peer]
VT is now known as Violent
Violent has quit [Client Quit]
werelivinginthef has quit [Remote host closed the connection]
blaines has quit [Ping timeout: 244 seconds]
poguez_ has joined #ruby
m8 has joined #ruby
olistik has joined #ruby
guest000014 has left #ruby [#ruby]
jenrzzz has joined #ruby
felltir has joined #ruby
Tritone has joined #ruby
phutchins has quit [Quit: WeeChat 1.1.1]
Rollabun_ has quit [Quit: Leaving...]
blaines has joined #ruby
Pathfinder has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
NeverDie has joined #ruby
ivanf has quit [Ping timeout: 244 seconds]
davedev2_ has joined #ruby
Sypheren has quit [Ping timeout: 256 seconds]
davedev24 has quit [Read error: Connection reset by peer]
jackjackdripper has joined #ruby
NeverDie has quit [Max SendQ exceeded]
Sypheren has joined #ruby
Tritone has quit [Ping timeout: 265 seconds]
ivanf has joined #ruby
symbol has quit [Quit: WeeChat 1.1]
baweaver has quit [Remote host closed the connection]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bklane has joined #ruby
werelivinginthef has joined #ruby
Violentr has joined #ruby
radialneon has quit [Remote host closed the connection]
NeverDie has joined #ruby
kirun has joined #ruby
radialneon has joined #ruby
dblessing has joined #ruby
a346 has joined #ruby
TheHodge has quit [Quit: Connection closed for inactivity]
<dudedudeman>
jhass: thank you
<arup_r>
Ruby is cute........... I like it very much, :)
pullphinger has joined #ruby
pullphinger has quit [Client Quit]
pullphinger has joined #ruby
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bklane has quit [Read error: Connection reset by peer]
loc22 has joined #ruby
serivich has quit [Ping timeout: 255 seconds]
dopie has quit [Quit: This computer has gone to sleep]
Aswebb__ has quit [Ping timeout: 264 seconds]
<ght>
Question: With a Ruby date object, when calling mydate.month, if the month is < 10, it prints with a single digit, as in month 7 is simply 7, instead of 07.
mrconfused_ has quit [Remote host closed the connection]
<ght>
Without having to convert it to an integer and check if it's less than 10, then add a leading zero as a string, is there any way
<ght>
to get date objects to return .month or .day with leading zeros?
<ght>
I've been reading the documentation and haven't seen anything.
<ght>
Just curious if anyone here knew.
<jhass>
ght: your problem is representation
davedev24 has joined #ruby
werelivinginthef has quit [Remote host closed the connection]
dagda1 has joined #ruby
<jhass>
07 and 7 is the same number, the same Fixnum (Integer) object
<loc22>
ght: Use strftime to print them
<jhass>
you care about its String representation though
<ght>
loc22: Thank you
jottr_ has joined #ruby
<jhass>
so yeah ^, use strftime
<loc22>
ght: You are welcome
davedev2_ has quit [Ping timeout: 256 seconds]
<jhass>
it helps to get clear on what representation and what value is though
radialneon has quit [Remote host closed the connection]
radialneon has joined #ruby
sarkyniin has quit [Remote host closed the connection]
Torrieri has joined #ruby
Torrieri has joined #ruby
Aswebb_ has joined #ruby
bklane has joined #ruby
k3asd` has quit [Ping timeout: 256 seconds]
Notte has quit [Remote host closed the connection]
bklane has quit [Remote host closed the connection]
<apeiros>
must be scary if it can't be highlighted! :-p
allcentury has quit [Ping timeout: 246 seconds]
<apeiros>
oh. wow.
<apeiros>
O-KAY…
<schov>
hmm, I'm wondering why the following code doesn't work " if arr[i] > arr[i].downcase then puts "working" end " - when i type ABC then it should respond with "working" three times, but i get nothing?
radialneon_ has quit [Remote host closed the connection]
bklane has quit [Read error: Connection reset by peer]
radialneon has joined #ruby
Pumpkin- has joined #ruby
allomov has joined #ruby
acke has quit [Quit: Leaving...]
pietr0 has quit [Quit: pietr0]
_blizzy_ has joined #ruby
djbkd_ has quit [Remote host closed the connection]
mhib has joined #ruby
Anthony__ has joined #ruby
MarkTurner has quit [Ping timeout: 256 seconds]
fullofcaffeine has joined #ruby
bklane has joined #ruby
baweaver has quit [Ping timeout: 240 seconds]
eggoez has joined #ruby
DoubleMalt has joined #ruby
<jimmythehat>
How do I mock an in-block variable? In this case, I would want to mock match.contains_a_number? Also, this is a learning excercize, I am aware of the dangers of monkey patching I just want to know how you're meant to mock an in-block variable. Thanksies!!
_djbkd has quit [Remote host closed the connection]
Notte has quit [Remote host closed the connection]
_djbkd has joined #ruby
<jimmythehat>
jhass thanks, great responses. If I follow your advice and mock what match returns, how should I spec the regex? I liked seeing that the regex was working before and would lose that if I was mocking match. any_instance_of makes the most sense to me, but it's discouraged by the rspec team (note how its placed under the heading 'Working with legacy code'. Worrying - could be depricated. https://relishapp.com/rspec/rspec-mocks/docs/working-with-lega
quimrstorres has quit [Remote host closed the connection]
fabrice31 has quit [Ping timeout: 244 seconds]
<jimmythehat>
so I guess...how should I test the regex? Or is it okay to use allow_any_instance_of() ?
<jhass>
jimmythehat: well, you're assuming too much about the implementation either way I guess
<jhass>
the example is pretty much one you want to observe only with input & return values
<toretore>
iamse7en: gsub(/.foo/, '') will remove 'foo' preceded by 1 character
<jhass>
since it's side effect free
quimrstorres has joined #ruby
loc22 has quit [Quit: Be back later ...]
arturmartins has joined #ruby
but3k4_ has quit [Read error: Connection reset by peer]
GitGud has joined #ruby
rapha has quit [Ping timeout: 246 seconds]
<jimmythehat>
jhass I'm feeling allow_any_instance_of but it would suck if they drop it in future. Oh well :/
GitGod has quit [Ping timeout: 256 seconds]
suffice has quit [Ping timeout: 256 seconds]
<jimmythehat>
just cross that bridge if and when it does get dropped
but3k4 has joined #ruby
maletor has joined #ruby
<jhass>
I doubt it'll be dropped, but it's true that you should avoid it as long as you can
mleung has quit [Quit: mleung]
<jhass>
again, what troubles you is that it's a bad example for mocking and stubbing
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
t_ has quit [Ping timeout: 256 seconds]
<jhass>
it's so much much better speced without
codecop has quit [Remote host closed the connection]
peter_paule has quit [Ping timeout: 255 seconds]
xkef has quit [Ping timeout: 255 seconds]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DLSteve has quit [Quit: Leaving]
<jimmythehat>
jhass Yeah I do see why. I wouldn't have this trouble if I was sending the string to another class of analysis. then I could mock that class easily. You should only mock other classes I guess?
xkef has joined #ruby
<jimmythehat>
*for analysis
jespada has joined #ruby
<jhass>
no, the real issue is that you assert implementation instead of behavior
_ht has quit [Remote host closed the connection]
<jhass>
mocking & stubbing is for replacing expensive or impossible to run code in tests
rsty1 has quit [Read error: Connection reset by peer]
<jhass>
or recreating conditions that are otherwise hard to achieve
_ht has joined #ruby
triangles2 has quit [Ping timeout: 248 seconds]
maletor has quit [Max SendQ exceeded]
<jhass>
you attempt to use it as a tool for asserting the method is implemented in certain manner
<jhass>
you do not care of "it returns/causes X when Y" but "it does X when Y"
maletor has joined #ruby
<jhass>
but you shouldn't care about the how, just that it happens
baweaver has quit [Remote host closed the connection]
dopie has quit [Quit: This computer has gone to sleep]
suffice has joined #ruby
t_ has joined #ruby
yfeldblum has quit [Ping timeout: 264 seconds]
<jimmythehat>
doesn't it give you better feedback if you isolate and then break something? only the code that's failing would turn up red. if I mocked less-so, wouldn't I get a whole set of red specs rather than justt the one that's actually failing? shouldn't behaviour and the end result only be tested in an integration spec?
quimrstorres has quit [Remote host closed the connection]
felltir has quit []
dopie has joined #ruby
arturmartins has quit [Quit: Leaving...]
Papierkorb has joined #ruby
<jhass>
not if your mocks go to the point of asserting a special implementation
<jhass>
er, *specific
aaeron has quit [Quit: Leaving.]
aryaching has quit [Ping timeout: 246 seconds]
MarkTurner has joined #ruby
MarkTurner has quit [Remote host closed the connection]
<jimmythehat>
jhass not sure I follow :P
<jimmythehat>
specific implementation?
<jhass>
yes
El3ktra has quit [Quit: Leaving]
MarkTurner has joined #ruby
<jimmythehat>
I suppose I could just 'allow' rather than expect? That would be less brittle. is that what you mean?
<jhass>
basically if your specs becomes a recipe of "this call with these parameters should happen and then on the return value this call should happen and then this call should happen" you're doing it wrong
but3k4 has quit [Ping timeout: 248 seconds]
<jhass>
allow just changes the should to a may
JakFrist has joined #ruby
pietr0 has joined #ruby
hanmac has quit [Ping timeout: 246 seconds]
werelivinginthef has quit [Remote host closed the connection]
postmodern has joined #ruby
jerius has quit [Quit: /quit]
sepp2k has joined #ruby
mleung has joined #ruby
m8 has quit [Quit: Sto andando via]
MarkTurner has quit [Client Quit]
MarkTurner has joined #ruby
rsiqueira has quit [Ping timeout: 246 seconds]
<jhass>
after all a big part of your specs is to make refactoring easier. I've written specs like ^ and can tell you that they break with the slightest changes that don't actually change behavior as viewed from the outside
peter_paule has joined #ruby
<jhass>
a small cascade in failures is less annoying and usually easily identified anyway
tmtwd has joined #ruby
bb010g has joined #ruby
dgutierrez1287 has joined #ruby
bronson has joined #ruby
leonardoajim has joined #ruby
_ht has quit [Quit: Konversation terminated!]
sofija has quit [Ping timeout: 256 seconds]
<jimmythehat>
jhass you're right about a small cascade being easy to fix. I don't follow you 100% but mocking too much does make specs brittle. So I am not going to mock other methods of the same class, however I am going to mock other classes and their methods, and then have some integration specs that contain no mocks at all. I don't think I'll go too wrong doing that :P
t_ has quit [Ping timeout: 256 seconds]
peter_paule has quit [Ping timeout: 264 seconds]
charliesome has joined #ruby
<jhass>
probably not, but following such rules religiously is often impractical
dgutierrez1287 has quit [Ping timeout: 244 seconds]
MagePsycho__ has quit [Quit: MagePsycho__]
<toretore>
a lot of the time mocking is a code smell - well-structured code is usually easy to test and doesn't need mocking of hard coded dependencies
<toretore>
iamse7en: you should learn regular expressions
<iamse7en>
k
<toretore>
regularexpressions.info
howdoicomputer has joined #ruby
bronson has quit [Ping timeout: 264 seconds]
jerius has joined #ruby
Violentr has quit [Remote host closed the connection]
baweaver has joined #ruby
rwilcox has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
t_ has joined #ruby
<jimmythehat>
toretore awh this is sort of going in the face everything ive learned...to test classes in isolation and then test in integration. Or is that more of a rails thing?
fullofcaffeine has joined #ruby
devbug has quit [Ping timeout: 250 seconds]
<toretore>
jimmythehat: those are also true, and the two aren't mutually exclusive
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
hanmac has joined #ruby
<toretore>
but you can achieve those things without mocking
varunwachaspati has quit [Quit: Leaving]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<toretore>
mocking is more of a last resort
centrx has quit [Quit: Shutting down, Please wait...]
<toretore>
or if you're lazy
sharpmachine has quit [Remote host closed the connection]
<Senjai>
olistik: You can use s_client --connect sitename:port
<olistik>
jhass: shouldn't rvm osx-ssl-certs update take care of everything?
<Senjai>
olistik: It will help you debug the things
schov has quit [Quit: Leaving]
<jhass>
no idea, I'm on linux and don't need such stuff
<Senjai>
openssl s_client **
<Senjai>
olistik: If the above command works for google.com:443, the problem is with ruby and not your computer
baweaver has quit [Remote host closed the connection]
<jimmythehat>
I think you call that name spacing anyway, they're all inside a ActionController module. But I fail to see the benefit. It would be easier if they were all in one file, searching for methods ect...
<raenk>
I'm in the process of learning ruby (and rails). I'm excited about it and in a couple of weeks I'm going to start a project that basically would be a simple API that serves JSON data. I'm not sure if I should hold my excitement about ruby and just develop it with PHP considering it might be overkill going with ruby. What do you think?
<toretore>
jimmythehat: yeah, i tend to see that as a smell too - when you have too much in one class/module that you have split it into several files
<toretore>
jimmythehat: it's not actually namespacing
bungoman has quit [Remote host closed the connection]
<olistik>
it looks like it's working
<olistik>
I'll try reinstalling ruby with rvm
<Senjai>
olistik: Or use chruby
<Senjai>
:/
MarkTurner has quit [Ping timeout: 256 seconds]
<Senjai>
instead of rvm
<olistik>
or rbenv :-)
bmurt has quit []
<toretore>
jimmythehat: it's just a way to make it look cleaner - cheating, if you will
<jhass>
raenk: Ruby offers a ton of lightweight solutions for this that aren't rails
<Senjai>
olistik: or... chruby :P
<olistik>
^_^
pengin has quit [Remote host closed the connection]
<Senjai>
But yeah, any SSL issues, run that command before debugging, it helps you point out if its a system issue or a software one.
RegulationD has quit [Remote host closed the connection]
<jimmythehat>
toretore Yeah I get that. Think I'll just have one file per module. If it gets to big, create another module entirely. It's funny how lenient ruby is an how restrictive(not a bad thing) rails is
decoponio has quit [Quit: Leaving...]
bungoman has joined #ruby
allcentury has quit [Ping timeout: 265 seconds]
<dfockler>
rails RAILS!
<jimmythehat>
dfockler indeed
quimrstorres has joined #ruby
<toretore>
jimmythehat: though in the example you linked to i don't know of any better way to do it
MagePsycho_ has joined #ruby
davedev24 has quit [Remote host closed the connection]
MagePsycho_ has quit [Client Quit]
<toretore>
sometimes you just need a whole lot of methods
<raenk>
jhass: what would you recommend? Obviously I need something with a smooth learning curve considering It will be my first project
<dfockler>
ruby never specified convention, and went for programmer happiness, which means lots of ways of doing the same thing
HakN99 has quit [Ping timeout: 240 seconds]
<toretore>
"What make Programmer Brain Happy is What I Make To Ruby" - matz
leonardoajim has quit [Ping timeout: 252 seconds]
riotjones has joined #ruby
<jhass>
raenk: I know nothing about your requirements, my recommendation would be as good as rolling a dice
blaines has quit [Ping timeout: 264 seconds]
bodgix has joined #ruby
<jimmythehat>
toretore just wondering, what would be wrong with one big (i.e. not split over multiple files) ActionController module in the example I linked you? Is it purely organizational?
prestorium has quit [Quit: Konversation terminated!]
malconis_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aaeron has joined #ruby
<toretore>
jimmythehat: yes in that case it's purely organizational
werelivinginthef has joined #ruby
<toretore>
it's the same module in every file
<toretore>
(afaicg)
FernandoBasso has joined #ruby
leat1 has quit [Remote host closed the connection]
leat1 has joined #ruby
<jimmythehat>
toretore what I thought, thanks for your help :)
<yorickpeterse>
normally it comes minus indentation too
<yorickpeterse>
so even better
<shevy>
I also have to deal with XML stuff right now :( doc = Nokogiri::HTML(open(uri)); path = doc.xpath("//link[@rel='shortcut icon' or @rel='icon']/@href").first
jonathanwallace has quit [Quit: Leaving.]
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
waah, throw
dfockler has quit [Remote host closed the connection]
<jhass>
the hidden goto
<yorickpeterse>
jhass: it actually makes perfect sense here
<yorickpeterse>
I'm not even kidding
mjuszczak has joined #ruby
<yorickpeterse>
It has to break out of potentially infinitely nested recursion
<yorickpeterse>
and since it's in a lambda it can't use "return" at this point
<yorickpeterse>
so yay throw/catch
<adaedra>
next?
baweaver has quit [Remote host closed the connection]
<yorickpeterse>
That only deals with the inner most recursion
<adaedra>
ah yes
jespada has quit [Ping timeout: 246 seconds]
<yorickpeterse>
here the "node.children.each do |node|" bit could be repeated a lot of times
<Ox0dea>
Come on! It's gotta be in there somewhere.
<adaedra>
shevy: there is a legit use for throw: exceptional error cases.
<jhass>
wat
<shevy>
rescue TheWorld
<yorickpeterse>
adaedra: No
MarkTurner has quit [Ping timeout: 256 seconds]
<yorickpeterse>
throw is not meant for exception handling
<shevy>
lol
<yorickpeterse>
not at all
rbennace_ has quit [Ping timeout: 265 seconds]
<jhass>
adaedra: the fireworks made you all dizzy
<yorickpeterse>
fuck yeah, this code is 5,5x faster than Nokogiri
<adaedra>
no
<shevy>
nokogiri is slower than a snail
<adaedra>
so exceptions are not for errors now?
<yorickpeterse>
shevy: tell that to all the nerds going "OMMGMGMG BUT C IS WEBSCALE"
<jhass>
adaedra: you're confusing throw for raise
<yorickpeterse>
adaedra: "raise" is for exception handling, "throw" is for recursion/flow-control
<shevy>
there used to be .cgi written in C!
<adaedra>
that's not the same now? o_O
<yorickpeterse>
adaedra: correct
<jhass>
no
<yorickpeterse>
they're different
<yorickpeterse>
throw/catch is basically a goto
<shevy>
throw is when you wanna throw someone out of the club
<yorickpeterse>
raise is "fuck shit broke"
<yorickpeterse>
plus an oxford comma
wallerdev has joined #ruby
<adaedra>
oh wait
<yorickpeterse>
so "fuck, shit broke"
<adaedra>
guess I'm mixing languages
<shevy>
how descriptive
<yorickpeterse>
adaedra: yeah, it doesn't help that pretty much every other language uses throw/try/catch
<jhass>
raise Fuck, "shit broke"
ruurd_ has joined #ruby
<jhass>
gotta stick that somewhere
ruurd has quit [Quit: Be back later]
<yorickpeterse>
rescue Exception => error
<yorickpeterse>
# lol
arooni-mobile has joined #ruby
<yorickpeterse>
end
arooni-mobile__ has joined #ruby
<yorickpeterse>
I think I actually have something like that somewhere
<jhass>
s/lol/I'm an idiot/
<hj2007>
I'm getting "Your Ruby version is 2.0.0, but your Gemfile specified 2.1.2" while bundle install even though rbenv version returns 2.1.2. Any help?
bungoman has quit [Remote host closed the connection]
<al2o3-cr>
now check web server OS's :p
olistik has quit [Remote host closed the connection]
<Ox0dea>
al2o3-cr: Or supercomputers.
roolo has quit [Remote host closed the connection]
quimrstorres has joined #ruby
<al2o3-cr>
or that :p
jespada has joined #ruby
ascarter has quit [Max SendQ exceeded]
<Ox0dea>
It's 94% of the top 500, apparently.
olistik has joined #ruby
bklane has joined #ruby
ascarter has joined #ruby
<shevy>
\o/
fabrice31 has joined #ruby
<al2o3-cr>
wouldn't trust ms on a cray :D
ascarter has quit [Client Quit]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
or google to drive your car
danzilio has quit [Quit: Baiii!]
<al2o3-cr>
not to sure i would :p
charliesome_ has quit [Quit: zzz]
<yorickpeterse>
well, 318 failing tests to fix
<yorickpeterse>
before I can ship this new xpath compiler
tomphp has joined #ruby
<al2o3-cr>
probably better than most drivers :)
edwinvdgraaf has quit [Remote host closed the connection]
<shevy>
dunno
edwinvdgraaf has joined #ruby
freerobby has joined #ruby
evanjs_ has quit [Remote host closed the connection]
<al2o3-cr>
i'd place a bet :p
<shevy>
99% use cases perhaps - but what if someone else drives into your car
<al2o3-cr>
then it's not you fault
evanjs has joined #ruby
jespada_ has joined #ruby
<shevy>
I am sure I'll be very relieved of that upon impact time :P
<al2o3-cr>
:D
fabrice31 has quit [Ping timeout: 246 seconds]
<Darkwater>
why does `bundle gem foo-bar` create Foo::Bar? Why not just FooBar?
<Ox0dea>
> Chris Urmson, the head of Google's self-driving initiative, says 11 accidents in 1.7 million miles is a lot better record than most humans achieve.
<adaedra>
Ox0dea: iirc, all of these accidents were 3rd party fault
triangles2 has joined #ruby
ndrei has quit [Ping timeout: 250 seconds]
bodgix has quit [Client Quit]
<Ox0dea>
Indeed.
<Ox0dea>
I, for one, welcome a road full of "drivers" who've been properly instructed in how to use a fucking on ramp.
evanjs has quit [Ping timeout: 244 seconds]
duderonomy has quit []
<al2o3-cr>
bhahaha lol
Igorshp has joined #ruby
olistik has quit [Remote host closed the connection]
hj2007 has quit [Quit: This computer has gone to sleep]
edwinvdgraaf has quit [Remote host closed the connection]
solars has quit [Ping timeout: 264 seconds]
<adaedra>
I work in Paris, I guess driving correctly is a concept
olistik has joined #ruby
quimrstorres has quit [Remote host closed the connection]
amargherio has quit [Remote host closed the connection]
astrobun_ has joined #ruby
<Ox0dea>
Y'all Yurop fellers got it so good in that regard.
<yorickpeterse>
"Yurop fellers"?
<Ox0dea>
Oui.
blue_deref has joined #ruby
<al2o3-cr>
sure that's meant to mean "Europe fellows" :p
loc22 has quit [Ping timeout: 264 seconds]
nfk has quit [Read error: Connection reset by peer]
nateberkopec has joined #ruby
<adaedra>
what is gotten so good? Driving correctly?
<Ox0dea>
The phrasing was intended as a self-deprecation of the American south.
radialneon is now known as _ZomB
<Ox0dea>
adaedra: Yes. Floridian drivers are, on average, a shit.
quimrstorres has joined #ruby
_ZomB is now known as Zom-B
xkickflip has joined #ruby
<al2o3-cr>
taxi in england are the worst :(
bklane has joined #ruby
Igorshp has quit [Ping timeout: 246 seconds]
Zom-B is now known as radialneon
<adaedra>
don't know how they compete with us, we have quite a bad driving habit here.
<adaedra>
al2o3-cr: don't talk about taxis, thanks.
<al2o3-cr>
they don't give a s***
iamninja has joined #ruby
quimrstorres has quit [Remote host closed the connection]
olistik has quit [Ping timeout: 240 seconds]
<adaedra>
but I guess the worst here are cyclists
mjuszczak has quit []
<al2o3-cr>
adaedra: ok sir!
xkickflip has quit [Client Quit]
<adaedra>
"Red lamp? Stop? Curb? Pedestran crossing? Priority? Lanes? What are those?"
SylarRub_ has quit [Remote host closed the connection]
<al2o3-cr>
adaedra: what are they?
mjuszczak has joined #ruby
lkba has quit [Remote host closed the connection]
<al2o3-cr>
:p
quazimodo has quit [Ping timeout: 240 seconds]
quazimod1 has quit [Ping timeout: 246 seconds]
<ruurd>
adaedra where are you? Netherlands I guess :-)
<adaedra>
not exactly.
bklane has quit [Read error: Connection reset by peer]
<adaedra>
I actally told it above.
quimrsto_ has joined #ruby
chadrien_ has quit [Remote host closed the connection]
maknz has joined #ruby
duderonomy has joined #ruby
quimrsto_ has quit [Remote host closed the connection]
<ruurd>
adaedra ah well amsterdam bikers...
<ruurd>
maybe paris is heaven compared to that in that respect. :-)
alicanyilmaz has joined #ruby
<alicanyilmaz>
hello guys
<alicanyilmaz>
I need to write a code to calculating nth term of PI number in ruby
kies^ has joined #ruby
<adaedra>
ruurd: tbh, I really wished I could kick bikes in Paris sometimes
<alicanyilmaz>
can someone help me for this ?
<adaedra>
alicanyilmaz: you need an allgorithm to calculate PI if you want to go deep down, first.
<adaedra>
*-l
ndrei has joined #ruby
bklane has joined #ruby
<ruurd>
plus doing your homework for you costs $150
GPrime has joined #ruby
<alicanyilmaz>
ruurd: its not a homework, sorry its an challenge for me to implement rest api. I need to solve the challenge for enter the company as an employee
kirun has quit [Quit: Client exiting]
<alicanyilmaz>
adaedra: can you suggest me some docs ?
<jhass>
alicanyilmaz: that's not any better than doing homework for you
<adaedra>
google has all of that, I'm not really good at maths.
<jhass>
if you can't do that without external help you probably should question why you apply
<jhass>
after all the challenge is there to find candidates who can
<alicanyilmaz>
jhass: you are totally right. This is the last part of the challenge but my math is not that good..
<jhass>
as said, google
<alicanyilmaz>
jhass: ok thank you..
<jhass>
there will be algorithms for that you just have to implement
<Ox0dea>
alicanyilmaz: There was an IOCCC winner that calculated pi using the "surface area" of the program itself. I think reading its source would be most instructive.
bklane has quit [Read error: Connection reset by peer]
<alicanyilmaz>
Ox0dea: :)
<Ox0dea>
alicanyilmaz: I wasn't *completely* trolling, for what that's worth. I suspect being able to decipher that program really would teach you quite a bit about how to calculate pi.
<alicanyilmaz>
Ox0dea: got it
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
[k- has quit [Ping timeout: 246 seconds]
duderonomy has quit []
jhack has quit [Ping timeout: 256 seconds]
<al2o3-cr>
i am an ape man
<alicanyilmaz>
Ox0dea: found an algorithm Gauss–Legendre algorithm