<tbuehlmann>
myspace, just an example: question[:answers].each_with_index { |answer, index| puts "#{index}. #{answer}" }
<tbuehlmann>
where you put that is up to you
iooner has joined #ruby-lang
<tbuehlmann>
I get to go now. a tip from me: try to be more patient after posing a question, people aren't watching this channel regularly. answers may take some time
<tbuehlmann>
have fun you guys
<myspace>
ok thanks guys :)
rbowlby has joined #ruby-lang
<apeiros>
also not join/part every 5s helps.
<myspace>
I know lol
<myspace>
I read all the rules now I think I got it. And I will start following them. thanks
Nimf has joined #ruby-lang
<myspace>
tbuehlmann: It didnt really work, maybe I put the code wrong but doesnt work.
<bnagy>
popcorn.gif
rbowlby has quit [Ping timeout: 252 seconds]
revath has quit [Ping timeout: 264 seconds]
Nimf has quit [Read error: Connection reset by peer]
<ljarvis>
read your code again and find that problem
<myspace>
is it a problem?
<myspace>
cause my code works now for what I have programmed it to do
<bnagy>
ffs
<ljarvis>
myspace: ok, then you don't have any more questions?
<jds>
Anyone got a good head for timezones? I'm confused by ActiveSupport::TimeZone[3600].at(Time.now.utc).utc_offset # => 7200
<myspace>
no I am dont with questions :)
<myspace>
I got 3 questions
<ljarvis>
ok, ask the first one
<myspace>
now I only want the answer to come up after the questions
<jds>
AFAICT TimeZone#at ought to be returning times with the same utc offset that you ask for originally - ie I'd expect ActiveSupport::TimeZone[3600].at(Time.now.utc).utc_offset to equal 3600
<ljarvis>
question is a hash, so you can access your answers with question[:answers]
<bnagy>
jds: ActiveSupport is voodoo
<apeiros>
jds: sounds like dst happening
<myspace>
where should I put in question[:answers] ?
<apeiros>
though dst & tz are two different things and I'm not sure why AS::TZ would do it like that
<myspace>
in the question.each_with_index?
<ljarvis>
myspace: yes, because that's where your question variable exists
<ljarvis>
myspace: explain to me what line 32 does?
<myspace>
nothing
<myspace>
really
<myspace>
do I need to do print?
<ljarvis>
so, if it does nothing, why are you expecting something?
<myspace>
xD
yatish27 has joined #ruby-lang
<myspace>
ok
<myspace>
fixed it now
<myspace>
and the gets.chomp have to be after
<myspace>
:)
<myspace>
well ok now I am done with that :)
<ljarvis>
well done
SylarRuby has quit [Remote host closed the connection]
<jds>
Hm. I guess "ActiveSupport::TimeZone[3600].local(Time.now.to_i).utc_offset" behaves how I'd expect. I'm struggling to figure out the difference between 'at' and 'local' based on the docs, though
<myspace>
Thanks so much ljarvis
Sivkaumar has quit [Ping timeout: 246 seconds]
<myspace>
yeyeyeyeyeyeyyyeye it worke
<myspace>
Its just amazing when you use 2 hours to find something out, and you give up, and then its working
<myspace>
thats just amazing :)
myspace has quit [Quit: Lost terminal]
banister has quit [Ping timeout: 265 seconds]
dzejrou has quit [Ping timeout: 246 seconds]
ur5us has quit [Remote host closed the connection]
benlovell has joined #ruby-lang
gix has quit [Quit: Client exiting]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
benlovell has quit [Ping timeout: 264 seconds]
gix has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 272 seconds]
revath has joined #ruby-lang
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby-lang
Forgetful_Lion has quit [Remote host closed the connection]
Lewix has joined #ruby-lang
Lewix has quit [Client Quit]
yfeldblum has quit [Ping timeout: 256 seconds]
x44x45x41x4E has joined #ruby-lang
fusillicode1 has joined #ruby-lang
dellavg_ has joined #ruby-lang
<x44x45x41x4E>
I wanna practice Ruby this weekend. I know the basics by completing Codecademy's Ruby course about a year ago. Anyone can suggest a website where I could challenge myself besides Codewars?
airdisa has quit [Remote host closed the connection]
dvlwrk has quit [Ping timeout: 265 seconds]
airdisa has joined #ruby-lang
elia has joined #ruby-lang
centrx has quit [Ping timeout: 256 seconds]
lytol has joined #ruby-lang
<simi>
Also is there any way how to get element from ruby array in C code?
<simi>
without using rb_ary_*
dagda1 has joined #ruby-lang
<|jemc|>
why wouldn't you use rb_ary_*?
<simi>
maybe RARRAY_AREF?
<simi>
|jemc|, I don't want to pretend I'm calling it with argv, argc and stuff.
charliesome has joined #ruby-lang
lytol has quit [Ping timeout: 265 seconds]
alestuber has joined #ruby-lang
atomical has joined #ruby-lang
alestuber has quit [Remote host closed the connection]
delongG has joined #ruby-lang
mikecmpbll has joined #ruby-lang
araujo has joined #ruby-lang
araujo has quit [Read error: Connection reset by peer]
brixen_ is now known as brixen
Caius has quit [Ping timeout: 276 seconds]
araujo has joined #ruby-lang
araujo has quit [Max SendQ exceeded]
elia has quit [Quit: Computer has gone to sleep.]
michaeldeol has joined #ruby-lang
b_hoffman has quit [Quit: b_hoffman]
centrx has joined #ruby-lang
bb010g has quit [Quit: Connection closed for inactivity]
Caius has joined #ruby-lang
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tsujp_ has joined #ruby-lang
tsujp has quit [Ping timeout: 256 seconds]
tsujp has joined #ruby-lang
dvlwrk has joined #ruby-lang
tsujp_ has quit [Ping timeout: 252 seconds]
__butch__ has joined #ruby-lang
banister has joined #ruby-lang
charliesome has quit [Quit: zzz]
symm- has quit [Ping timeout: 264 seconds]
rbowlby has joined #ruby-lang
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
skade has joined #ruby-lang
rbowlby has quit [Ping timeout: 245 seconds]
tubbo has joined #ruby-lang
__butch__ has quit [Quit: Leaving.]
tubbo is now known as Guest17760
hahuang65 has joined #ruby-lang
stan_ has quit [Ping timeout: 256 seconds]
__butch__ has joined #ruby-lang
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
b_hoffman has joined #ruby-lang
Guest17760 is now known as tubbo
_djbkd has joined #ruby-lang
elia has joined #ruby-lang
hahuang65 has quit [Ping timeout: 272 seconds]
delongG has quit [Remote host closed the connection]
elia has quit [Client Quit]
dik_dak has joined #ruby-lang
elia has joined #ruby-lang
michaeldeol has joined #ruby-lang
dik_dak has quit [Max SendQ exceeded]
dik_dak has joined #ruby-lang
Mark-6ma has joined #ruby-lang
simi has quit [Ping timeout: 276 seconds]
Musashi007 has quit [Quit: Musashi007]
Mon_Ouie has quit [Quit: WeeChat 1.1.1]
lytol has joined #ruby-lang
b_hoffman has quit [Quit: b_hoffman]
wallerdev has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
malconis has joined #ruby-lang
RobertBirnie has joined #ruby-lang
_djbkd has quit [Read error: Connection reset by peer]
_djbkd has joined #ruby-lang
smoitra has joined #ruby-lang
_djbkd has quit [Remote host closed the connection]
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<smoitra>
hello all, I today took a algorithim test in which I failed miserably. I want to improve what books should i study and where can I get practice questions
_djbkd has joined #ruby-lang
dagda1 has joined #ruby-lang
dagda1 has quit [Client Quit]
SylarRuby has joined #ruby-lang
knu has quit [Read error: Connection reset by peer]
SylarRuby has quit [Ping timeout: 256 seconds]
elia has joined #ruby-lang
scampbell has joined #ruby-lang
SylarRuby has joined #ruby-lang
<centrx>
smoitra, What areas did you do well on?
elia has quit [Client Quit]
elia has joined #ruby-lang
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ropeney has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
stef204 has joined #ruby-lang
<smoitra>
webdevelopment and webdesigning
<smoitra>
centrx: ^
<centrx>
How would those be on an "algorithm" test?
* imperator
guesses that was a separate part of the test
allomov has quit [Remote host closed the connection]
airdisa has quit [Remote host closed the connection]
<havenwood>
smoitra: What kind of questions were on the test that you struggled with?
* havenwood
has never taken an algorithm test.
allomov has joined #ruby-lang
<smoitra>
I actually applied for a job and they have this algorithm test
momomomomo has quit [Quit: momomomomo]
<smoitra>
there was base negative to inverse question
allomov has quit [Remote host closed the connection]
* imperator
sucks at those
<imperator>
there are some general algorithm books out there, but i've never read them
<imperator>
maybe some of the fine folks here can recommend one or two
<smoitra>
I am upset but want to improve.
<smoitra>
There was question like I will be given a array of 1s and 0s with base -2 I have to convert it to a decimal number I did that but the 2nd part I have to negate that number and with base -2 I have to convert it to binary form
<pipework>
Or aim for places that don't either require that kind of knowledge off-hand or don't have those kinds of problems.
<pipework>
I don't personally do whiteboarding, but I'll gladly talk through a problem.
elia has joined #ruby-lang
<smoitra>
There were three problem the 1st problem was to find the index of an integer array such that the array can be split into two parts so that one part have contains number x n times and 2nd part dont contains x ntimes
<smoitra>
I solved that but I got a poor score of 30 out of 100
Ropeney has quit [Quit: Leaving...]
jacaballero has joined #ruby-lang
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alestuber has joined #ruby-lang
<smoitra>
2nd problem was I will be given a array of 1s and 0s with base -2 I have to convert it to a decimal number I did that but the 2nd part I have to negate that number and with base -2 I have to convert it to binary form
<smoitra>
3rd problem i didn't get time to attempt
<smoitra>
I was given total 90mins time
joaomdmoura has joined #ruby-lang
michael_mbp has quit [Excess Flood]
alestuber has quit [Remote host closed the connection]
elia has quit [Quit: Computer has gone to sleep.]
pr0ton has joined #ruby-lang
rbowlby has joined #ruby-lang
michael_mbp has joined #ruby-lang
elia has joined #ruby-lang
rbowlby has quit [Remote host closed the connection]
airdisa has joined #ruby-lang
SylarRuby has quit [Remote host closed the connection]
rbowlby has joined #ruby-lang
baweaver has joined #ruby-lang
__butch__ has quit [Quit: Leaving.]
hahuang65 has joined #ruby-lang
<djellemah>
smoitra: 2nd problem is a standard base conversion. Think converting h:m:s to seconds. Works the same way.
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
workmad3 has quit [Ping timeout: 265 seconds]
<smoitra>
I know I think i can do it but lack of time i failed
skade has quit [Quit: Computer has gone to sleep.]
ruby-lang374 has joined #ruby-lang
SylarRuby has joined #ruby-lang
<ruby-lang374>
so I used a RegExp in my code to catch if someone puts a letter after a number ex. "5cat" it would ask them to re-enter a number, it worked like a charm yesterday. I leterally just opened it up and re-ran it and it doesnt work, any ideas as to why/
<ruby-lang374>
literally* ?*
<apeiros>
ruby-lang374: not without code and example input
<apeiros>
ruby-lang374: gist.github.com for your reproducible example
elia has quit [Quit: (IRC Client: textualapp.com)]
|jemc| has left #ruby-lang ["WeeChat 1.1.1"]
postmodern has joined #ruby-lang
<ruby-lang374>
ok ill see what i can do, just wierd because it worked yesterday. thats my thing how could it work one day over and over again and not the next day
b_hoffman has joined #ruby-lang
brauminski has joined #ruby-lang
<ruby-lang374>
apeiros: ok ill see what i can do, just wierd because it worked yesterday. thats my thing how could it work one day over and over again and not the next day
brauminski has quit [Client Quit]
rube-n00b has joined #ruby-lang
ogpastaling has joined #ruby-lang
stef204 has quit [Ping timeout: 264 seconds]
flycatcher has joined #ruby-lang
duderonomy has quit [Ping timeout: 252 seconds]
<ogpastaling>
Could someone help to clarify the difference in behavior here?
<ogpastaling>
I see that If you do not explicitly specify an initial value for memo, then the first element of collection is used as the initial value of memo but I'm still not totally clear on whats going on
airdisa has quit [Remote host closed the connection]
lytol has quit [Remote host closed the connection]
stamina has quit [Ping timeout: 244 seconds]
lytol has joined #ruby-lang
<jhass>
exactly that and nothing more
baweaver has quit [Remote host closed the connection]
<jhass>
first variant: c=0, i=1, second variant c=0, i=0, c=nil, i=1
cornerma1 has joined #ruby-lang
<jhass>
c=nil since puts returns nil
cornerman has quit [Ping timeout: 252 seconds]
cornerma1 is now known as cornerman
lytol has quit [Ping timeout: 246 seconds]
<ogpastaling>
Okay, that helps.
<ogpastaling>
so as I now understand it, the first element in the collection is really shifted in as the inject argument as apposed to just being 'used' as the inject arg
<jhass>
yes
<jhass>
you can visualize inject as the block being put between each two elements in the collection
<jhass>
the argument to inject is just prepended to the collection
jacaballero has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ogpastaling>
Thanks guys, this does help.
ruby-lang710 has joined #ruby-lang
bungoman has quit [Remote host closed the connection]
sarkyniin has quit [Ping timeout: 246 seconds]
momomomomo has joined #ruby-lang
ascarter has joined #ruby-lang
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ruby-lang710 has quit [Ping timeout: 246 seconds]
allomov has joined #ruby-lang
baweaver has joined #ruby-lang
smoitra has quit [Quit: Ex-Chat]
duderonomy has joined #ruby-lang
OnBrokenWings has joined #ruby-lang
imperator has quit [Quit: Leaving]
sarkyniin has joined #ruby-lang
stef204 has joined #ruby-lang
imperator has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
imperator has quit [Client Quit]
kadoppe has quit [Ping timeout: 264 seconds]
_djbkd has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 240 seconds]
imperator has joined #ruby-lang
knu has joined #ruby-lang
kadoppe has joined #ruby-lang
airdisa has joined #ruby-lang
OnBrokenWings has quit [Quit: Leaving]
airdisa_ has joined #ruby-lang
leat2 has joined #ruby-lang
airdisa has quit [Ping timeout: 256 seconds]
_djbkd has joined #ruby-lang
_djbkd has quit [Read error: Connection reset by peer]
_djbkd has joined #ruby-lang
jds has quit [Quit: Connection closed for inactivity]
bungoman has joined #ruby-lang
airdisa has joined #ruby-lang
airdisa_ has quit [Ping timeout: 265 seconds]
Sirupsen has joined #ruby-lang
Sirupsen has quit [Client Quit]
allomov has quit [Remote host closed the connection]
ahuegyua has joined #ruby-lang
<ahuegyua>
.did usa intelligence supply isis with weapons like they did with al-qaeda to justify creating wars?did usa excute the creative mess in the middle east like they said they will, does the creative mess include explosions with uncertain responsibles to create wars?plz, send my qs to help limiting usa & israel aggression against others& may then lessen number of people killed in the middle
<ahuegyua>
east..did usa intelligence supply isis with weapons like they did with al-qaeda to justify creating wars?
ahuegyua has left #ruby-lang [#ruby-lang]
Sirupsen has joined #ruby-lang
thelastinuit has joined #ruby-lang
hahuang65 has joined #ruby-lang
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]