<Matt2843>
trying to append a list to another list, when printing the resulting list, I just get an entry followed by a new line, followed by an entry followed by a new line etc. no square brackets
<guacamole>
matcouto where is 0.15 coming from? can you use 1.5 and then just to_i?
<Matt2843>
iterating a json object, list = []; object.each do |x| list << [ x['something'] ] end; puts list
pastorinni has quit [Remote host closed the connection]
<matcouto>
guacamole: 0.15 is actually the percentage amount. What I'm doing there is calculating the percentage of the amount in cents(5550)
<matcouto>
guacamole: and the return must be in cents too
alfiemax has joined #ruby
<guacamole>
so can you convert the percentage value to something that will give you an integer, or easily convert to an integer instead of focusing on converting the result of the equation?
<Matt2843>
oh.. im doing puts instead of print.. gah
Vapez has quit [Read error: Connection reset by peer]
<guacamole>
what if you used 1.5 and then to_i on the result? that'll drop the zero because the result will be 8325.0
<guacamole>
not sure if thats sturdy enough for all of your use cases though
jeffreylevesque has quit [Ping timeout: 268 seconds]
workmad3 has joined #ruby
<Matt2843>
how do I output unicode chars in ruby?
<matcouto>
guacamole: right. Will play a bit with it. Thanks :)
<guacamole>
matcouto np!
alfiemax has joined #ruby
cagomez has quit [Remote host closed the connection]
jeffreylevesque has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cagomez has joined #ruby
<matcouto>
guacamole: yeah just found a use case where it would fail. if you replace 1.5 to 2.5. That would give you 13875 which if you convert that to dollars we'll get 138.75 instead of 13.875
<guacamole>
yeah i didn't know if the 1.5 was a hardcoded thing or variable
<Matt2843>
anyone knows a good CLI table output library? to output some fancy tables
<matcouto>
guacamole: I can't believe that I'm struggling to make a percentage calc hahah
morenoh149 has joined #ruby
cdg has joined #ruby
cagomez has quit [Ping timeout: 248 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
morenoh149 has quit [Ping timeout: 240 seconds]
cdg has quit [Ping timeout: 255 seconds]
kapil___ has joined #ruby
dviola has joined #ruby
axsuul has quit [Quit: Peace]
rubycoder37 has joined #ruby
<rubycoder37>
I need to find a way to change my nick, I'm 38 now
<rubycoder37>
hi
<rubycoder37>
38 and still learning ruby to this day, what a great language it is!
d10n-work has quit [Quit: Connection closed for inactivity]
<rubycoder37>
I have a question, when raising an exception, is there a default exception that is raised or that I have to specify? for example, I want to stop my program if the amount is zero or negative
sylario has quit [Quit: Connection closed for inactivity]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
b100s has joined #ruby
schneide_ has quit [Ping timeout: 256 seconds]
jnollette has quit [Ping timeout: 255 seconds]
<b100s>
hi2all; is it possible to send headers in sinatra before send body? I mean I would like to send 100 header and start do something (some busines logic), finally i will send a body, but it will happen not imediately
Matt2843 has quit [Quit: Page closed]
morenoh149 has joined #ruby
Asher has joined #ruby
alfiemax has joined #ruby
matcouto has quit [Remote host closed the connection]
<tefa>
goodnight, question.. i got a this type of hash : announcements = [{city: 'Tandil', company: 'Plasmar', platform: 12 },{city: 'Buenos Aires', company: 'El lento', platform: 13 },{city: 'Azcochinga', company: 'Artazar', platform: 18 },{city: 'Tandil', company: 'Johnny Tur', platform: 12 }] how do i get the last value ? i want to get from the last one only the value of platform...
bigblind has quit [Remote host closed the connection]
<leitz>
tefa, announcements is an array. Do you know how to get the last item from an array?
<leitz>
And the real answer is that as long as you ask good questions and try to figure things out you will find a lot of smart folks here to help you.
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bigblind has quit [Remote host closed the connection]
bmurt has joined #ruby
darkhanb has joined #ruby
<tefa>
from annoucemts arrays.. its a list of bus... from wich city.. the company and the platforms.. lets suppose the departure of the bus are from x -> x2 -> x3 ... i mean.. in the list.. the first one.. is the first to departure.. the 2nd the 2nd.. and continues.. now.. knowing that.. i need to know only the last one of departure... but i dont know the real array.. it could be random... i only know
<tefa>
that i need to know the last bus from tandil.. and output his platform... the array changes.. it could be any form.. so in the last example.. the last but to tandil its from company johnny tur platform 12... so to output that i do...
<leitz>
tefa, is this a class assignment?
<tefa>
annoucements[-1][:platform] and i get the value platform of the last of the list... but i dont know if its tandil...
dreaduo has joined #ruby
<tefa>
how to know if its tandil ? scan... and determinate if its tandil... i would scan the array for tandil.. create a new array and from that one get the last one...
<tefa>
i guess i would use something like... annoucements.each { |x| seek tandil..} now that i got tandil.. use the last code.. but i dont know how to config my ".each" or whatever i should use
bigblind has joined #ruby
<leitz>
Look at array.index. tandil_index = announcements.index('tandil')
<tefa>
im new to ruby, so please soft words... or a soft guide ?
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aguestuser has quit [Remote host closed the connection]
jaequery has joined #ruby
aguestuser has joined #ruby
jaequery has quit [Client Quit]
alfiemax has joined #ruby
<havenwood>
tefa: In Ruby there didn't used to be a #sum method already defined. So it was a popular exercise to define one. Now there is one.
<havenwood>
tefa: So the code you're showing actually stomps on the new Array#sum method.
<havenwood>
[].method(:sum).owner #=> Array
<havenwood>
tefa: That said, this would redefine Array#sum.
<tefa>
i think i got that part..its just definig sum on array... but i dont understand how that it works that block
<tefa>
inject(0) { |accum, it| accum + it }
<havenwood>
gotcha
<havenwood>
tefa: #inject is an alias for #reduce
<havenwood>
tefa: the 0 is is the initial value
<havenwood>
that's where things start
<havenwood>
0
nwm_ has quit [Ping timeout: 256 seconds]
<havenwood>
inside the pipes || are the block arguments
<havenwood>
`accum` starts as the initial value, 0
jaequery has joined #ruby
<havenwood>
each iteration, accum will become the new return value of the block
morenoh149 has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood>
the second block argument, `it`, will be the current array iteration item
nwm has joined #ruby
alfiemax has joined #ruby
<havenwood>
tefa: so starting with 0 as the accumulator value, this method will iterate over the array, and add each element of the array to the accumulator
nwm_ has joined #ruby
cdg has joined #ruby
dinfuehr has quit [Ping timeout: 248 seconds]
<havenwood>
tefa: basically, it sums the array values, starting with 0 and adding each one as it goes through the array
<havenwood>
tefa: does that make any sense? i know it's a bit abstract.
<havenwood>
it's hard to explain without using loaded terms
<tefa>
i got half of it... this is what i understand.. if i do array.select { |x| x > 10 } it will look up inside the array for values over 10... the x its every value evaluated.... so when i see |accum, it| i dont understand...exactly.. if its looking up for 1 item and use it in accum.. and other using it.. for example... array = [10, 34, 8, 6, 22] if i do arrray.map { |x| x > 10} i will get 34
<tefa>
22... so it look up inside for each one and analize using x... if its bigger than 10.. so if i use the same.. .map.. and insted x, i use |accum, it| (i know it wont work...) but ccan you tell me what will try to do there ?
nwm_ has quit [Ping timeout: 260 seconds]
suhdood has quit [Remote host closed the connection]
<havenwood>
tefa: map and reduce are different
<tefa>
(with you explanation i understand what it does, but i dont understand how it does it)
cdg has quit [Ping timeout: 265 seconds]
<havenwood>
tefa: you're spot on with select
<tefa>
reduce aparently can look up for 2 values...
luna_x[m] has joined #ruby
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has joined #ruby
konsolebox has quit [Ping timeout: 268 seconds]
konsolebox has joined #ruby
<havenwood>
tefa: So the first block argument is an accumulator. It's the thing that reduce will return.
jordanm has joined #ruby
<havenwood>
tefa: map returns 1-to-1 values for each item in the collection
<havenwood>
tefa: map may map to anything, but it'll be the same number of items
<havenwood>
tefa: select will be at max the same number of items, but may be fewer
<havenwood>
tefa: select will never change the items, it just may remove some from the collection
<havenwood>
tefa: reduce on the other hand will not return a collection necessarily, it often just return a single item
<havenwood>
tefa: the accumulator is the thing that will be returned
naprimer2 has quit [Ping timeout: 276 seconds]
<havenwood>
that's the first block argument for reduce
naprimer has joined #ruby
<havenwood>
the second is the value for each iteration, like the single block argument for select or map
jaequery has quit [Read error: Connection timed out]
<havenwood>
the new accumulator value is set to the return value for each iteration
<havenwood>
and returned at the end of the iterations
<havenwood>
tefa: Does any of that make sense?
ramfjord has quit [Ping timeout: 264 seconds]
<havenwood>
It's often easier to understand with examples
<tefa>
i understood the it value... working like map and static..
<tefa>
i got half of accum... exaplanation
<tefa>
and dont get it whats exactly the value inside the () for reduce
<havenwood>
or in modern Ruby, just: [1,2,3].sum(42) #=> 48
marmorkreb has joined #ruby
<tefa>
[1,2,3].reduce(42)i understand till here now.... then from here... { |acc, n| acc + n } only that n will be 1 or 2 or 3... wright ?
<havenwood>
tefa: they ^ all do the same thing, they start with 42 then add each item in the array and return the result
ahrs has joined #ruby
alfiemax has joined #ruby
ahrs has quit [Remote host closed the connection]
<tefa>
oh i think i got it
<tefa>
[1,2,3].reduce(42) { |acc, n| acc + n }.... its doing something like this... |acc=42, n= 1 or 2 or 3 | acc + n.. every time it executes till it array every value.. will do... 42 + 1 now acc isnt anymore 42 now its 43... so |acc=43, n = 2 or 3| acc + 2... now execute rest of the values.. 43 + 2 = 45... now the same till 3.. and get 48 right ?
<havenwood>
tefa: yup, correct
<tefa>
iujuu
<tefa>
^^
<tefa>
ty for your time
<havenwood>
tefa: you're welcome, happy coding!
<tefa>
and the explanation obviously :D
konsolebox has quit [Ping timeout: 256 seconds]
jordanm has quit [Quit: Konversation terminated!]
konsolebox has joined #ruby
snickers has joined #ruby
LocaMocha has joined #ruby
LocaMocha has quit [Max SendQ exceeded]
rabajaj has joined #ruby
Sifrael884 has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
marmorkreb has quit [Remote host closed the connection]
alfiemax has joined #ruby
LocaMocha has joined #ruby
benjen has quit [Ping timeout: 240 seconds]
anisha_ has joined #ruby
Gnut has quit [Ping timeout: 260 seconds]
eroux has joined #ruby
anisha has quit [Ping timeout: 260 seconds]
roonsauce has joined #ruby
konsolebox has quit [Ping timeout: 252 seconds]
konsolebox has joined #ruby
alfiemax has quit [Remote host closed the connection]
darkhanb has joined #ruby
alfiemax has joined #ruby
roonsauce has quit [Ping timeout: 268 seconds]
alfiemax has quit [Ping timeout: 248 seconds]
morenoh149 has joined #ruby
anisha__ has joined #ruby
anisha_ has quit [Ping timeout: 268 seconds]
morenoh149 has quit [Ping timeout: 240 seconds]
konsolebox has quit [Ping timeout: 260 seconds]
konsolebox has joined #ruby
jordanm has joined #ruby
alfiemax has joined #ruby
marmorkreb has joined #ruby
jud has quit [Read error: Connection reset by peer]
<Bish>
or you do it the other way around, you have a Hash with default values, and update it with your new values
qba73 has quit []
<Bish>
sounds clean to me
<guardian>
thanks will try playing with .update
qba73 has joined #ruby
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
hairui has quit [Ping timeout: 264 seconds]
hairui has joined #ruby
amatas has joined #ruby
bijan_ has joined #ruby
SebastianThorn has quit [Ping timeout: 256 seconds]
ldnunes has joined #ruby
hairui has quit [Ping timeout: 260 seconds]
schneide_ has quit [Remote host closed the connection]
konsolebox has quit [Ping timeout: 256 seconds]
lukeyb has joined #ruby
hairui has joined #ruby
<lukeyb>
Say I have a number 33, and I need to go up in increments of 2, is there a ruby method that will round up or down to the nearest x? i.e. 33.round(:down, 2)
<zenspider>
dionysus69: you're starting to sound like a help vampire... write some code. when you have *specific* problems, ask *good* questions and we'll be happy to help.
<dminuoso>
Anyway. Hello zenspider by the way. You're a rare sight nowadays, what keeps you busy? :0
<zenspider>
life. just not hanging out on irc much these days
konsolebox has joined #ruby
catphish has joined #ruby
Jose__ has quit [Client Quit]
rabajaj has quit [Ping timeout: 268 seconds]
<catphish>
is there a simple way to parse a fairly language-generic string into an appropriate object? for example "1" => 1, "'hello'" => "hello", "\"world\"" => "world", "true" => true, "FALSE" => false, etc
<catphish>
essentially the opposite of inspect for the most common types
<zenspider>
EVAL!
<dminuoso>
>> to = -> (t, n) { (n / t).round * t }.curry; 1.step.lazy.map(&to[5]).take(20).zip(1.step.lazy).force # havenwood cool, you can alzo zip lazy enums =)
<catphish>
looks like YAML is plenty good enough for now
<catphish>
thanks
<zenspider>
again, think about security issues. yaml lets you specify the type and goes through dump/load code
hairui has quit [Ping timeout: 256 seconds]
<zenspider>
json might be a better choice, depending...
* zenspider
goes to bed...
<dminuoso>
zenspider: I thought about it, but that wont parse "FALSE" sadly :(
<dminuoso>
Good night o/
alfiemax has joined #ruby
Cavallari has quit [Ping timeout: 276 seconds]
Cavallari1 is now known as Cavallari
cdg_ has joined #ruby
dextrey has quit [Ping timeout: 268 seconds]
alfiemax has quit [Ping timeout: 255 seconds]
cdg_ has quit [Remote host closed the connection]
jnyw has quit [Quit: WeeChat 2.0.1]
hairui has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mrush has quit [Ping timeout: 276 seconds]
mikecmpb_ has quit [Read error: Connection reset by peer]
hairui has quit [Ping timeout: 248 seconds]
ocher has joined #ruby
mikecmpbll has joined #ruby
tomlukeywood has joined #ruby
<ocher>
hi. I wonder if there is a way of creating a "view" of a file. I want to read some part of the file, but I don't want to read all of it into memory, but rather provide that "view" to the component which then sends data further
mikecmpbll has quit [Client Quit]
<ocher>
that "view" is a stream, which points to a given range of bytes in the file. and then some other object may read data from that stream
AJA4350 has joined #ruby
mikecmpbll has joined #ruby
hairui has joined #ruby
mikecmpbll has quit [Client Quit]
tjbp has quit [Ping timeout: 255 seconds]
alfiemax has joined #ruby
konsolebox has quit [Ping timeout: 276 seconds]
konsolebox has joined #ruby
tomeaton17 has joined #ruby
qba73 has quit [Remote host closed the connection]
<tomeaton17>
I have never worked with ruby before and trying to maintain some one elses code. Can somebody please explain what this line does? real_code = "%010d" % entry_code[1..-2].to_i(2)
<ocher>
basically, I would be interested in something which works like this: IO.binread(path, length, offset) but instead of returning String, it returns stream (Enumerable)
qba73 has joined #ruby
<havenwood>
tomeaton17: You could alternatively write that: sprintf("%010d", entry_code[1..-2].to_i(2))
tjbp has joined #ruby
<apeiros>
tomeaton17: what parts do you understand and what parts do you have trouble with?
alfiemax has quit [Ping timeout: 264 seconds]
tomlukeywood has quit [Remote host closed the connection]
<damasceno>
Hi! Does anyone know how to check the latest release of a github repo? I want to show the latest version available when the user executes the application with the version "-v". Is it possible?
<tobiasvl>
damasceno: usually, that kind of thing is done when releasing. so you run a command to make a new release, which creates the git(hub) "version" as a tag and gem version at the same time
<rubycoder38>
I think I'll frame that picture and put it on my desk
teclator is now known as teclator_laptop
RougeR has quit [Ping timeout: 240 seconds]
<sagax>
i send method to other like as this way -> some_method( Class.method(:method_name) )
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<sagax>
but maybe we have other way?
Ltem has quit [Ping timeout: 248 seconds]
<sagax>
method to other method*
hairui has joined #ruby
ianfleeton has joined #ruby
<dminuoso>
sagax: Say what?
<dminuoso>
sagax: If you want to pass functions as first class, use blocks/procs/lambdas
<sagax>
i wont send method to other method as argument
qba73 has quit [Ping timeout: 268 seconds]
ruby-learning has joined #ruby
<ruby-learning>
Why is that that ENV is listed as a class in ruby-doc.org, but when I do ENV.is_a? Class it returns false?
<rubycoder38>
ENV.class #=> Object
miskatonic has joined #ruby
<rubycoder38>
ENV.is_a? Object #=> true
<rubycoder38>
I'm confused also
hairui has quit [Ping timeout: 252 seconds]
qba73 has joined #ruby
krawchyk has quit [Ping timeout: 276 seconds]
hairui has joined #ruby
ruby-lang177 has joined #ruby
<ruby-lang177>
exit
troys has joined #ruby
willsams has joined #ruby
ruby-lang177 has quit [Ping timeout: 260 seconds]
eroux has quit [Ping timeout: 260 seconds]
SynSynack has joined #ruby
synthroid has quit [Remote host closed the connection]
aufi has quit [Read error: Connection reset by peer]
aufi_ has joined #ruby
tefa has joined #ruby
tomphp has joined #ruby
<dminuoso>
ruby-learning: ENV is method.
<dminuoso>
>> method(:ENV)
<ruby[bot]>
dminuoso: # => undefined method `ENV' for class `#<Class:#<Object:0x40f2d344>>' (NameError) ...check link for more (https://eval.in/956998)
<dminuoso>
Oh well
<dminuoso>
Its a constant.
<dminuoso>
to
<dminuoso>
ruby-learning: Anyway. Upper case does not mean Class, it just means constant.
<ruby-learning>
dminuoso: yeah but if you go to ruby-doc.org/core-2.5.0 you see ENV listed as a class
hairui has quit [Ping timeout: 248 seconds]
willsams is now known as storminator16
dionysus69 has joined #ruby
<dminuoso>
ruby-learning: Ah I remember this. That was just done as an rdoc hack to somehow display ENV.
<tefa>
hello, question.. if i declare this sd = {la: 88, lo: 54}, how can i get the first value? usually sd[:la] but what happens when you dont know the name that will have... it could be fd... how to get the fisrt value or the seocnd etc ?
<ruby-learning>
dminuoso: mm makes sense now... wow, thanks for that precise insight : )
tvon has quit [Client Quit]
synthroid has joined #ruby
Ltem has joined #ruby
stormpack has quit [Quit: Leaving]
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
schneide_ has quit [Remote host closed the connection]
n008f4g_ has joined #ruby
hairui has quit [Ping timeout: 256 seconds]
hairui has joined #ruby
clemens3 has quit [Ping timeout: 265 seconds]
blackmesa has joined #ruby
<tefa>
hello, question.. if i declare this sd = {la: 88, lo: 54}, how can i get the first value? usually sd[:la] but what happens when you dont know the name that will have... it could be fd... how to get the fisrt value or the seocnd etc ?
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snickers has joined #ruby
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tefanga has joined #ruby
<tefanga>
hello, question.. if i declare this sd = {la: 88, lo: 54}, how can i get the first value? usually sd[:la] but what happens when you dont know the name that will have... it could be fd... how to get the fisrt value or the seocnd etc ?
<mozzarella>
tefanga: sd.first
pastorinni has quit [Remote host closed the connection]
tefa has quit [Ping timeout: 240 seconds]
ianfleeton has joined #ruby
hairui has quit [Ping timeout: 264 seconds]
jerikl has joined #ruby
krawchyk has joined #ruby
<tefanga>
thaks, how do i get the second one ?
<mozzarella>
hashes weren't guaranteed to be ordered in older versions of ruby
marxarelli|afk is now known as marxarelli
<mozzarella>
I guess you'd have to turn it into an array first
<mozzarella>
sd.to_a[1]
<mozzarella>
why do you even need to do that
<mozzarella>
are you sure hashes are the right fit for what you're trying to do?
<tefanga>
haha
aufi_ has quit [Quit: Leaving]
rabajaj has quit [Quit: Leaving]
cagomez has joined #ruby
<tefanga>
mozzarella here it is the gist with my explanation, if you could help me...
<tefanga>
i will try, but i dont know if im able to use .values :(
skweek has joined #ruby
<tefanga>
i didnt learn that method %s
<tefanga>
yet
nckpz has joined #ruby
<tefanga>
ok.. it works.. but it does the same of doing :lat or :long
<tefanga>
but my real problem is the following..
raynold has joined #ruby
jamiejackson has quit [Ping timeout: 240 seconds]
blahgh has joined #ruby
cagomez has quit [Remote host closed the connection]
<tefanga>
the virtual class test me in 3 ways.... the first one it is : expected: "lat: 0\nlong: 0" got: "lat: 0\nlong: 0" perfect.... then the second its the same but with differents values... perfect... but the 3rd test... it is expected: "foo: 3\nbar: 5\ngoo: 6" got: "lat: 3\nlong: 5"
cagomez has joined #ruby
<tefanga>
if the hash change.. im not getting not eigther the name of the values and the values.. none of them :S
blahgh has quit [Client Quit]
reaVer has quit [Ping timeout: 256 seconds]
krawchyk has quit [Quit: krawchyk]
TomyWork has quit [Ping timeout: 240 seconds]
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
ianfleeton has joined #ruby
vutral|kali has quit [Ping timeout: 264 seconds]
rwb has joined #ruby
blackmesa has joined #ruby
mtkd has quit []
jaruga has quit [Quit: jaruga]
cagomez has quit [Ping timeout: 248 seconds]
hairui has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
skweek has quit [Quit: Leaving]
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mtkd has joined #ruby
EG^ has joined #ruby
<tefanga>
thanks mozzarella that solves it.. but may i know how does it works ? cause... im not pretty sure..
<mozzarella>
are you familiar with map?
vutral|kali has quit [Excess Flood]
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
blackmesa has quit [Ping timeout: 276 seconds]
<mozzarella>
I'm going to sleep, sorry
<tefanga>
h.map {|p| p.join(': ') }.join("\n") map will scan h... and every key or value..(not sure) will name it p for his understanding... now.. will get the first value or key... and execute join... the parameters for join is ": " but cant understand 2 things... what its exactly mapping (using this example, if you can tell me so i can understand) and.. how does join is joining using ": "
hairui has quit [Ping timeout: 255 seconds]
<mozzarella>
good night
<tefanga>
ok, np, thanks
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mozzarella>
when you're mapping over an hash it's returning an array that's basically [key, value]
<tefanga>
got it
apeiros has quit []
<mozzarella>
>> sd = {la: 88, lo: 54}; p sd.to_a
<ruby[bot]>
mozzarella: # => [[:la, 88], [:lo, 54]] ...check link for more (https://eval.in/957054)
<tefanga>
and how joining its working
<tefanga>
ok thats what im getting while mapping
<mozzarella>
join inserts a string between every element
<mozzarella>
and returns the resulting string
<tefanga>
in this case ": "
<dminuoso>
havenwood: arry.step.lazy.zip(1.step.lazy) should be a pattern. now I know why I hate .with_index. =P
guacamole has joined #ruby
guacamole has quit [Changing host]
guacamole has joined #ruby
<dminuoso>
havenwood: I was so ruined that it felt wrong to do this in Haskell, just to realize that this is just the more explicit way of doing it - but giving more fine grained control.
jcarl43 has joined #ruby
<tefanga>
so... join will do... this? la: 88:\nlo: 54
jaruga has joined #ruby
s2013 has quit [Read error: Connection reset by peer]
rubycoder38 has quit [Quit: Lost terminal]
banisterfiend has quit [Read error: Connection reset by peer]
jerikl has joined #ruby
guacamole has quit [Client Quit]
alfiemax has joined #ruby
jamiejackson has joined #ruby
jerikl has quit [Client Quit]
schneide_ has joined #ruby
teclator_laptop has quit [Remote host closed the connection]
alfiemax has quit [Ping timeout: 248 seconds]
roonsauce has quit [Remote host closed the connection]
hairui has joined #ruby
roonsauce has joined #ruby
za1b1tsu has joined #ruby
jaruga has quit [Quit: jaruga]
roonsauce has quit [Remote host closed the connection]
roonsauce has joined #ruby
jerikl has joined #ruby
schneide_ has quit [Ping timeout: 276 seconds]
armyriad has quit [Quit: Leaving]
garyserj has quit []
EG^ has quit [Ping timeout: 255 seconds]
krawchyk has quit [Quit: krawchyk]
hairui has quit [Ping timeout: 276 seconds]
yohji has quit [Remote host closed the connection]
aupadhye has quit [Quit: Leaving]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
bigblind has quit [Ping timeout: 240 seconds]
roonsauce has quit [Remote host closed the connection]
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta has joined #ruby
jerikl has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
darkhanb has joined #ruby
jamesaxl has joined #ruby
bigblind has joined #ruby
mtkd has quit []
Serpent7776 has quit [Quit: Leaving]
hairui has joined #ruby
SeepingN has joined #ruby
blackmesa has joined #ruby
al2o3-cr has quit [Ping timeout: 240 seconds]
minimalism has quit [Quit: minimalism]
hairui has quit [Ping timeout: 265 seconds]
mtkd has joined #ruby
morenoh149 has joined #ruby
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
despai has joined #ruby
qba73 has quit [Client Quit]
jaruga has joined #ruby
sanscoeur has joined #ruby
Mrgoose2 has quit [Ping timeout: 255 seconds]
Beams has quit [Quit: .]
roonsauce has joined #ruby
catphish has quit [Quit: Leaving]
orbyt_ has joined #ruby
alfiemax has joined #ruby
jamiejackson has quit [Ping timeout: 248 seconds]
cagomez has joined #ruby
bigblind has quit [Ping timeout: 240 seconds]
jamiejackson has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
c_nick has joined #ruby
despai has quit [Quit: ...]
krawchyk has joined #ruby
graft has quit [Remote host closed the connection]
cagomez has quit [Ping timeout: 240 seconds]
<c_nick>
while installing Ruby using the windows installer i was exploring the option of /s which silently installed it for me. Is it possible for me to give it an installation path too ?
despai has joined #ruby
Mrgoose has joined #ruby
despai has quit [Client Quit]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
beauby has quit [Ping timeout: 256 seconds]
za1b1tsu has quit [Quit: Leaving]
beauby has joined #ruby
hairui has joined #ruby
<tefanga>
c_nick if im not wrong.. --f dir
sameerynho has joined #ruby
<tefanga>
the directory should already exist
beauby has quit [Ping timeout: 248 seconds]
clemens3 has joined #ruby
<c_nick>
tefanga, I think the directory gets created
<c_nick>
tefanga, will check
<tefanga>
example... if you have a setup.exe file... that contain compressed files.. if you do -f dir ... dir=c:\blabla\blabla
hairui has quit [Ping timeout: 248 seconds]
<tefanga>
it will descompress every file on that directory.. but the directory should already exist.. to work..
<c_nick>
so i presume it does create the directory because when you pass the directory location from the installer option (the regular installation process) it creates one
cliq has joined #ruby
<tefanga>
yes it will create one
<c_nick>
however like how tefanga mentioned, it will create the second level blabla while the first level blabla should exist ? or does it do it recursively
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kliq has quit [Ping timeout: 248 seconds]
jaruga has joined #ruby
tomlukeywood has joined #ruby
blackmesa has quit [Quit: WeeChat 2.0.1]
orbyt_ has joined #ruby
<tefanga>
if i dont missunderstood you.. it will create first the first folder, when first exist, the second one..
miskatonic has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
quobo has joined #ruby
hairui has quit [Ping timeout: 240 seconds]
suhdood_ has joined #ruby
anisha_ has quit [Quit: This computer has gone to sleep]
suhdood_ has quit [Remote host closed the connection]
Thaelimm has joined #ruby
Thaelim has quit [Ping timeout: 252 seconds]
luna_x has quit [Quit: WeeChat 2.0.1]
MrBusiness has quit [Ping timeout: 255 seconds]
nopolitica has joined #ruby
nopolitica has quit [Client Quit]
RougeR has quit [Ping timeout: 248 seconds]
morenoh149 has quit [Ping timeout: 265 seconds]
alfiemax has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
alfiemax has quit [Ping timeout: 276 seconds]
My_Hearing has quit [Quit: WeeChat 2.0.1]
hairui has joined #ruby
n0m4d1c has joined #ruby
Thaelimmm has joined #ruby
tefanga has quit []
hairui has quit [Ping timeout: 240 seconds]
Thaelimm has quit [Ping timeout: 276 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<c_nick>
tefanga, its creating them recursively .. if folder is existing it rewrites the contents in it same goes for hierarchy it just dumps the contents freshly
<c_nick>
thanks all :-)
jaruga has quit [Quit: jaruga]
anjen has joined #ruby
orbyt_ has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
RougeR has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
bijan_ has joined #ruby
cthulchu has joined #ruby
troys has quit [Quit: Bye]
matchaw has joined #ruby
troys has joined #ruby
anjen has quit [Quit: anjen]
cthulchu_ has quit [Ping timeout: 240 seconds]
schneide_ has joined #ruby
EG^ has joined #ruby
alfiemax has joined #ruby
Thaelimmm has quit [Remote host closed the connection]
Thaelimmm has joined #ruby
tomlukeywood has quit [Remote host closed the connection]
morenoh149 has joined #ruby
brendan- has quit [Read error: Connection reset by peer]
c_nick has quit [Quit: ciaos]
bigblind has joined #ruby
brendan- has joined #ruby
Thaelimmm has quit [Remote host closed the connection]
marr has joined #ruby
ramfjord has joined #ruby
LocaMocha has quit [Read error: Connection reset by peer]
<rubycoder38>
the question is: if I do WalletCentral.transfer('jon', 'jaime', 'USD', 100.0) and jaime doesn't take USD, I want to convert the amount automagically, so I might create a Currency#convert class/method for this
<rubycoder38>
and then return the value to the amount variable
hairui has joined #ruby
<rubycoder38>
but I have no idea how, should I use a sequel hook for that or?
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SpeakerToMeat has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
Mrgoose has quit [Ping timeout: 256 seconds]
* SpeakerToMeat
see snone of his old friends here and goes away sad
cagomez has joined #ruby
nadir has joined #ruby
<SpeakerToMeat>
Oh well it's ok, I use better languages now like VB.net
<rubycoder38>
SpeakerToMeat: :(
hairui has quit [Ping timeout: 248 seconds]
<SpeakerToMeat>
rubycoder38: Actually I don't use ruby much anymore it's true but at leats it's not vb.net.. or was it for the friends? there's one I miss
Mrgoose2 has joined #ruby
<rubycoder38>
who do you miss?
<SpeakerToMeat>
He went by Slyphon int he ruby community.
<Han>
And every time yet another missed dependency I have to add to the Gemfile, it's more than 40 lines long by now.
d10n-work has joined #ruby
hairui has quit [Ping timeout: 248 seconds]
synthroid has quit []
nowhereman_ has joined #ruby
aguestuser has quit [Remote host closed the connection]
aguestuser has joined #ruby
Ltem has quit [Quit: good night]
bigblind has joined #ruby
jcalla has quit [Quit: Leaving]
despai has quit [Quit: ...]
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bigblind has quit [Ping timeout: 248 seconds]
Rvampire has joined #ruby
<Rvampire>
hii I am sorry I have a quick question..I have a string all upper case. How can I build something that IF a letter is a duplicate..it should lowercase the duplicate letter ?
bigblind has joined #ruby
hairui has joined #ruby
despai has joined #ruby
<Rvampire>
ah come on anyone willing to help a vampire ?
<Rvampire>
:D
<Rvampire>
woah this channel used to be way more fun back in the days
<Rvampire>
now everyone got so serious and just ghosting
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shinnya has joined #ruby
bmurt has joined #ruby
al2o3-cr has joined #ruby
hairui has quit [Ping timeout: 265 seconds]
<Rvampire>
this is scary on so many levels
<weaksauce>
Rvampire keep track of the last letter and build up a string with it if the last letter == the current letter then downcase it and if not don't
schneide_ has quit [Remote host closed the connection]
<Rvampire>
weaksauce thanks! this is the spirit
<miah>
no response in ~1 minute. channel is dead. =)
schneide_ has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
nowhere_man has joined #ruby
nowhereman_ has quit [Ping timeout: 256 seconds]
bijan_awaaaay is now known as bijan_
krawchyk has quit [Quit: krawchyk]
drewmcmillan has joined #ruby
tomphp has joined #ruby
drewmcmillan has quit [Client Quit]
drewmcmillan has joined #ruby
hairui has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bigblind has quit [Ping timeout: 268 seconds]
bmurt has joined #ruby
banisterfiend has joined #ruby
hairui has quit [Ping timeout: 256 seconds]
n008f4g_ has quit [Ping timeout: 260 seconds]
mtkd has quit []
roonsauce has quit [Remote host closed the connection]
bijan_awaaaay has quit [Quit: System has gone to sleep. ZZZzzz…]
roonsauce has quit [Ping timeout: 276 seconds]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ruby[bot] has quit [Remote host closed the connection]
bmurt has joined #ruby
ruby[bot] has joined #ruby
bmurt has quit [Client Quit]
bmurt has joined #ruby
bmurt has quit [Client Quit]
raynold has quit [Quit: Connection closed for inactivity]
<zenspider>
damn... JUMP TO or I'll declare you all dead
ramfjord has quit [Ping timeout: 256 seconds]
<al2o3-cr>
sup zenspider?
<rubycoder38>
I'm afraid to die
workmad3 has joined #ruby
milardovich has joined #ruby
<zenspider>
Han: perhaps you're adding from the bottom instead of the top? makes it seem like more deps than you need to declare.
<al2o3-cr>
rubycoder38: don't wish time away
milardovich has quit [Remote host closed the connection]
<zenspider>
al2o3-cr: not much. you?
<rubycoder38>
al2o3-cr: ?
Badman703 has joined #ruby
<al2o3-cr>
zenspider: cool beans =)
<miah>
i am un-dead
<al2o3-cr>
rubycoder38: being afraid is wishing time away =)
_aeris_ has quit [Remote host closed the connection]
milardovich has joined #ruby
<rubycoder38>
I see
<rubycoder38>
al2o3-cr: you mean in the sense that you could be doing something with your time rather than worrying?
<al2o3-cr>
rubycoder38: spot on ;)
<rubycoder38>
nice, good point
<miah>
i wish it were that easy some times
<rubycoder38>
al2o3-cr: thanks
<al2o3-cr>
no worries :)
_aeris_ has joined #ruby
ramfjord has joined #ruby
banisterfiend has joined #ruby
SkyFire has quit [Ping timeout: 264 seconds]
<al2o3-cr>
why worry when you can laugh
banisterfiend has quit [Remote host closed the connection]
<miah>
sometimes that is also difficult
workmad3 has quit [Ping timeout: 248 seconds]
starseed0000 has joined #ruby
<al2o3-cr>
miah: sometimes...
<al2o3-cr>
worrying is what makes people ill.
<al2o3-cr>
if this, if that... and so on
<miah>
i had my confidence crushed and i didnt touch ruby for a few years. coming back to it i've had to deal with anxiety. its been hard to laugh. but i'm getting better.
jeffreylevesque has joined #ruby
<miah>
sorry, kinda offtopic <3
ramfjord has quit [Ping timeout: 248 seconds]
<al2o3-cr>
miah: all i can say times a healer and it will get better (no matter how low you are) pinky promise ;)
cliq has quit [Ping timeout: 240 seconds]
<miah>
yup. agreed. i had to quit my job and start fresh and now im doing ruby dev full time so i'm healing =)
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr>
miah: ruby will bring up your spirits =)
<rubycoder38>
last year I worked at a company as a python developer, I was fired for reasons but when I was fired the boss threatened me with actual violence and screamed at me, I still have nightmares to this day
jnollette has quit [Quit: ZNC 1.6.5 - http://znc.in]
ramfjord has joined #ruby
<miah>
im sorry that happened, i can relate.
jnollette has joined #ruby
<zenspider>
miah: that sucks. :/
bmurt has joined #ruby
bmurt has quit [Client Quit]
<rubycoder38>
the good thing is that I recorded all the audio so I can release it anytime I want
<rubycoder38>
they better don't annoy the heck of me
<al2o3-cr>
rubycoder38: shit happens in life (people can be dicks) sorry about the swearing.
<al2o3-cr>
it's a funny old world
<miah>
ya it does suck. but im getting better. i just feel like i should have left that job sooner but hindsight..
<al2o3-cr>
miah: you in a good place now?
ramfjord has quit [Ping timeout: 268 seconds]
ramfjord has joined #ruby
<miah>
yes =)
<miah>
doing open source dev on a ruby project
<al2o3-cr>
miah: i have no regrets in life and never will. life is for living not existing.