goeast

Activity Graph

Page 1 of 1

2016-07-21

[13:26:20] goeast: has joined #ruby
[13:27:54] goeast: Hello ! db.execute("SELECT name FROM artists ORDER BY name ASC") I would like this statement to returns an array of strings. Any hints ?
[13:29:46] goeast: database its because I have a sql database
[13:30:40] goeast: def sorted_artists(db)
[13:30:42] goeast: puts db.execute("SELECT name FROM artists ORDER BY name ASC")
[13:30:56] goeast: (remove the puts)
[13:33:29] goeast: no activerecord
[13:33:57] goeast: should return something like this ["A Cor Do Som", "AC/DC"]
[13:34:44] goeast: ["A Cor Do Som"], ["AC/DC"],
[13:35:29] goeast: flatten !
[13:35:34] goeast: I was looking for it !
[13:35:43] goeast: thanks manveru !
[13:36:10] goeast: yep ! thank you very much !
[13:37:06] goeast: very clear now
[13:38:46] goeast: Quit: ChatZilla 0.9.92 [Firefox 47.0/20160604131506]

2016-07-06

[11:19:46] goeast: has joined #ruby
[12:05:50] goeast: hello Guys ! what is wrong with my code ? Why is it always printing the previous entry ?
[12:05:52] goeast: https://gist.github.com/go-east/ecca3548e9c6ec5481fafe6c19ad605c
[12:09:29] goeast: but it is only pushing into the array. I am not asking to print no ?
[12:09:40] goeast: ah "puts"
[12:15:48] goeast: Ping timeout: 272 seconds
[12:24:20] goeast: has joined #ruby
[12:50:51] goeast: Remote host closed the connection

2016-07-05

[13:42:03] goeast: has joined #RubyOnRails
[13:42:12] goeast: has joined #ruby
[13:43:26] goeast: Hello ! Why my loop is ending and not continuing unless the condition is met ?
[13:43:28] goeast: https://gist.github.com/go-east/6e91b9d9c8c9357bb41a3d0f8dcdc71b
[13:45:03] goeast: Thanks guys !
[13:45:40] goeast: Actually yes I just put until and the loop is infinite..
[13:46:29] goeast: thank you :) I will see what I can do :)
[13:47:05] goeast: Quit: ChatZilla 0.9.92 [Firefox 47.0/20160604131506]

2016-06-04

[10:22:26] goeast: has joined #ruby
[12:24:45] goeast: Ping timeout: 250 seconds
[13:48:42] goeast: has joined #ruby
[13:59:53] goeast: Ping timeout: 258 seconds
[14:44:37] goeast: has joined #ruby
[20:06:34] goeast: Ping timeout: 240 seconds

2016-06-03

[08:50:45] goeast: has joined #ruby
[09:55:56] goeast: Read error: Connection reset by peer
[12:32:08] goeast: has joined #ruby
[14:34:40] goeast: Ping timeout: 264 seconds
[15:06:18] goeast: Ping timeout: 276 seconds
[15:38:37] goeast: has joined #ruby
[15:43:41] goeast: Ping timeout: 240 seconds
[15:56:07] goeast: has joined #ruby
[16:11:08] goeast: Ping timeout: 272 seconds
[17:17:03] goeast: Ping timeout: 240 seconds

2016-06-02

[15:48:01] goeast: has joined #ruby
[15:48:16] goeast: Hello ! I am creating a music library. The artist and the song name should be stored in a Hash. So that for example :
[15:48:18] goeast: Adele(key) => Hello, Skyfall (values).
[15:48:19] goeast: Today I have {"Adele"=>[], nil=>"Hello"}
[15:48:21] goeast: Can you help me ?
[15:48:27] goeast: https://gist.github.com/go-east/063eb95bb960bf029404e5461b533fdc
[15:51:10] goeast: Yes I know and I am not able to store something in it
[15:52:54] goeast: domgetter : I am checking
[15:55:21] goeast: domgetter : https://gist.github.com/go-east/063eb95bb960bf029404e5461b533fdc still doesn't work or I might do something wrong ?
[16:01:33] goeast: domgetter : Thank you I slowy starting to get it :)
[16:41:33] goeast: Read error: Connection reset by peer
[16:42:54] goeast: has joined #ruby
[16:43:59] goeast: domgetter : Thank you sooooo much. Just your little explanation was soooo useful. I just moved to the next step !
[16:47:43] goeast: Read error: Connection reset by peer
[16:53:56] goeast: has joined #ruby
[17:05:37] goeast: Read error: No route to host
[17:38:19] goeast: has joined #ruby
[18:08:33] goeast: Ping timeout: 276 seconds

2016-05-30

[06:12:43] goeast: has joined #ruby
[08:06:41] goeast: Ping timeout: 258 seconds
[09:03:56] goeast: has joined #ruby
[09:37:03] goeast: Ping timeout: 240 seconds
[09:44:11] goeast: has joined #ruby
[11:39:19] goeast: Ping timeout: 252 seconds
[11:43:51] goeast: has joined #ruby
[12:08:56] goeast: Read error: Connection reset by peer
[12:12:39] goeast: has joined #ruby
[13:48:30] goeast: Hello I have library.rb:32:in `add_song': undefined method `<<' for nil:NilClass (NoMethodError). I know why its because I need to use two different instances of Artist as equivalent hash keys and use eql? and hash appropriately.
[13:48:42] goeast: https://gist.github.com/anonymous/79dee1aae800de3da00e2d98f972d18e
[13:49:05] goeast: However I am not able to imlement the code
[13:49:10] goeast: *implement
[13:49:45] goeast: Can you give me a hint ?
[13:49:56] goeast: I found that http://stackoverflow.com/questions/1931604/whats-the-right-way-to-implement-equality-in-ruby
[13:50:23] goeast: but I still stucked
[13:52:47] goeast: thank you tildes and Hates
[13:53:35] goeast: Hates : yes it why I need to say that it is equivalent
[13:56:34] goeast: @Hates : iyou mean as a parameter ? def add_song(artist, song)
[13:58:30] goeast: @tildes : yes
[13:58:54] goeast: I am doing it as an exercise
[14:00:16] goeast: one class for artist
[14:00:16] goeast: OK so I will do one class for song
[14:00:37] goeast: the add song will that 2 parameters artist and song
[14:00:38] goeast: I will check my attr-accessor that I am using
[14:00:44] goeast: in the Library class
[14:02:02] goeast: Read error: Connection reset by peer
[14:03:09] goeast: I had a problem with my conection
[14:03:25] goeast: @tildes and @hates thank you very mich for your kind help
[14:03:33] goeast: I will try to improve my code first
[14:03:46] goeast: with your suggestion
[14:25:48] goeast: Read error: No route to host
[14:26:37] goeast: has joined #ruby
[15:31:20] goeast: Read error: Connection reset by peer
[15:33:30] goeast: has joined #ruby
[17:10:39] goeast: Remote host closed the connection

2016-05-29

[06:55:59] goeast: has joined #ruby
[07:24:33] goeast: Ping timeout: 240 seconds
[07:32:41] goeast: has joined #ruby
[07:43:26] goeast: Read error: No route to host
[07:45:40] goeast: has joined #ruby
[08:13:14] goeast: Ping timeout: 272 seconds
[10:51:12] goeast: has joined #ruby
[11:12:58] goeast: Read error: Connection reset by peer
[11:15:23] goeast: has joined #ruby
[14:58:12] goeast: Ping timeout: 258 seconds
[16:06:24] goeast: has joined #ruby
[18:33:43] goeast: Ping timeout: 250 seconds

2016-05-28

[15:47:27] goeast: has joined #ruby
[16:46:15] goeast: Read error: Connection reset by peer

2016-05-27

[09:25:02] goeast: has joined #ruby
[09:41:22] goeast: Read error: Connection timed out
[09:44:53] goeast: has joined #ruby
[10:00:03] goeast: Read error: Connection reset by peer
[10:02:30] goeast: has joined #ruby
[10:16:04] goeast: Read error: Connection reset by peer
[10:17:43] goeast: has joined #ruby
[11:05:43] goeast: Ping timeout: 250 seconds
[11:06:26] goeast: has joined #ruby
[11:31:06] goeast: Read error: Connection reset by peer
[11:32:24] goeast: has joined #ruby
[11:36:05] goeast: Read error: Connection reset by peer
[11:37:28] goeast: has joined #ruby
[11:42:28] goeast: Ping timeout: 264 seconds
[11:45:06] goeast: has joined #ruby
[13:10:46] goeast: Hello ! I have a question. I am creating a Music Library. I want to store songs which belong to artists. Here is my code : https://gist.github.com/go-east/33058007cad5985214d79b6658ebaa58
[13:10:57] goeast: I have 2 class. 1 is creating the artist and the other 1 is storing the artist into the library.
[13:10:58] goeast: I have 2 problems : 1) I am not able to store my artist in the library. The code is not working. 2) I would like it to respect the artist = Hash.new { |h,k| h[k]=[]} because 1 artist can have many songs.
[13:11:36] goeast: (line 26)
[13:17:47] goeast: Yes please thank you very much
[13:21:18] goeast: Sorry Jhass Its one of the first time I am using gist. I "edit" and "add"a file. But I don't see what is expected :/
[13:22:32] goeast: ah Get it thanks
[13:23:44] goeast: https://gist.github.com/go-east/33058007cad5985214d79b6658ebaa58
[13:26:22] goeast: yes I just added it
[13:26:39] goeast: I update the gist
[13:37:02] goeast: Yes I get that I can't use >> for a Hash so instead I think I should use something like hash [key ]= value
[13:37:22] goeast: but this is exactly where I am lost since its already created one time :/
[13:38:19] goeast: Yes I know the difference and I need a hash in this format artist = Hash.new { |h,k| h[k]=[]} or maybe I am mystaking. I want to add many songs to one artist
[13:41:52] goeast: Jhass : I updated the gist and corrected the mystake >> into <<
[13:41:54] goeast: https://gist.github.com/go-east/33058007cad5985214d79b6658ebaa58
[13:42:34] goeast: Jhass : Thank you very much ! It seems it is working but how can I make sure that the format artist = Hash.new { |h,k| h[k]=[]}
[13:46:06] goeast: Jhass : ahah I know. Actually it is much more for a training purpose. What is interesting for me is to learn how to play with a Hash
[14:48:59] goeast: Remote host closed the connection
[15:31:40] goeast: has joined #ruby
[16:00:41] goeast: Ping timeout: 244 seconds
[16:01:16] goeast: has joined #ruby
[17:08:17] goeast: Read error: Connection reset by peer
[17:29:09] goeast: has joined #ruby
[17:36:18] goeast: Read error: No route to host

2016-05-25

[09:11:18] goeast: has joined #ruby
[16:38:12] goeast: Read error: Connection reset by peer
[16:53:28] goeast: has joined #ruby
[18:25:21] goeast: Remote host closed the connection