polpak

Activity Graph

Page 1 of 1

2015-08-28

[16:13:05] polpak: has joined #ruby
[16:13:10] polpak: has joined #RubyOnRails
[18:49:39] polpak: Quit: leaving

2015-08-27

[15:20:34] polpak: has joined #ruby
[15:20:44] polpak: has joined #RubyOnRails
[17:14:00] polpak: DEA7TH: welcome to rails
[17:14:58] polpak: DEA7TH: if you don't want a database you have to do a little bit of work to get rails to believe you
[17:15:55] polpak: DEA7TH: oh.. well it can't know that you don't want to access the DB and setting up the connection evertime you need it is slower than just keeping one around
[17:16:22] polpak: DEA7TH: oh that's a different problem
[17:17:28] polpak: DEA7TH: each rails process needs a db connection, and the number of parallel requests you can handle is limited by the number of rails processes you have
[17:23:53] polpak: jhass: it was different the first time
[17:25:05] polpak: jhass: funzies
[17:27:29] polpak: Inoperable: keys will include every k because k comes from keys
[17:28:32] polpak: Inoperable: why not construct a new hash where the key is the value and the value is the list of keys which had it
[17:32:07] polpak: >>> a = {a:1, b:1, c:2}; b = Hash.new { |h, k| h[k] = [] }; a.each { |k,v| b[v] << k }; # Inoperable
[17:32:21] polpak: >> a = {a:1, b:1, c:2}; b = Hash.new { |h, k| h[k] = [] }; a.each { |k,v| b[v] << k }; # Inoperable
[17:32:48] polpak: >> a = {a:1, b:1, c:2}; b = Hash.new { |h, k| h[k] = [] }; a.each { |k,v| b[v] << k }; b;# Inoperable
[22:47:44] polpak: Quit: leaving

2015-08-26

[21:44:03] polpak: has joined #ruby
[21:44:10] polpak: has joined #RubyOnRails
[22:42:50] polpak: Quit: leaving

2015-08-21

[00:21:16] polpak: Quit: leaving
[15:22:48] polpak: has joined #ruby
[15:22:52] polpak: has joined #RubyOnRails
[23:03:08] polpak: Quit: leaving

2015-08-20

[17:06:14] polpak: has joined #ruby
[17:06:18] polpak: has joined #RubyOnRails
[17:47:27] polpak: clickedlabs: just as your question, don't ask to ask
[17:47:34] polpak: clickedlabs: if someone can help they will
[17:47:51] polpak: clickedlabs: no worries.
[17:49:38] polpak: tesaf: @hostname.split("-")[2] is nil
[17:49:51] polpak: tesaf: so maybe your hostname isn't what you think it is
[17:50:28] polpak: > 'localhost'.split('-')[2]
[17:50:36] polpak: >> 'localhost'.split('-')[2]
[17:52:58] polpak: clickedlabs: what is php-fpm?
[18:32:31] polpak: people are still using soap?
[18:33:19] polpak: xml makes programmers cry
[22:28:39] polpak: 16^6 possibilities
[22:29:20] polpak: 1 in 16million
[22:29:46] polpak: but that's just for one attempt

2015-08-18

[22:42:19] polpak: Quit: leaving

2015-08-17

[19:48:56] polpak: has joined #ruby
[19:49:01] polpak: has joined #RubyOnRails

2015-08-13

[15:39:50] polpak: has joined #ruby
[15:39:56] polpak: has joined #RubyOnRails
[19:22:28] polpak: Quit: leaving

2015-08-11

[00:17:26] polpak: Quit: leaving
[15:14:38] polpak: has joined #ruby
[15:14:44] polpak: has joined #RubyOnRails
[15:49:21] polpak: youch: self.var calls a method
[23:41:22] polpak: Quit: leaving

2015-08-10

[16:30:34] polpak: has joined #ruby
[16:30:39] polpak: has joined #RubyOnRails
[20:25:54] polpak: gambl0re: both!
[20:26:33] polpak: gambl0re: it DRYs up your views and also allows more granular caching so you can be smarter about what/how you cache

2015-08-07

[16:10:09] polpak: has joined #ruby
[16:10:14] polpak: has joined #RubyOnRails
[20:56:46] polpak: Quit: Lost terminal

2015-08-06

[16:10:24] polpak: has joined #ruby
[16:10:30] polpak: has joined #RubyOnRails
[20:53:40] polpak: Quit: leaving

2015-08-05

[18:40:14] polpak: has joined #ruby
[18:40:19] polpak: has joined #RubyOnRails
[23:49:24] polpak: Quit: leaving

2015-08-04

[00:08:50] polpak: Quit: leaving
[17:28:53] polpak: has joined #ruby
[17:28:57] polpak: has joined #RubyOnRails
[22:27:19] polpak: Quit: leaving

2015-08-03

[16:10:25] polpak: has joined #ruby
[16:10:31] polpak: has joined #RubyOnRails
[18:34:24] polpak: Quit: Lost terminal
[21:07:18] polpak: has joined #ruby
[21:07:21] polpak: has joined #RubyOnRails
[21:09:53] polpak: Client Quit
[22:57:52] polpak: has joined #ruby
[22:57:56] polpak: has joined #RubyOnRails

2015-07-31

[00:14:05] polpak: Quit: leaving
[16:07:06] polpak: has joined #ruby
[16:07:10] polpak: has joined #RubyOnRails
[19:25:58] polpak: turing test passed!
[22:19:44] polpak: leitz: it's a scoping problem
[22:21:33] polpak: leitz: variables defined within the block can't be accessed after you're out of the block again
[22:23:49] polpak: >> [1,2].each { |i| b = i }; puts b
[22:24:48] polpak: leitz: ^^
[22:25:45] polpak: >> b = nil; [1,2].each { |i| b = i }; puts b
[22:26:46] polpak: leitz: it has nothing to do with options, or OptionParser
[22:26:53] polpak: leitz: see my code snippets above
[22:27:01] polpak: leitz: it's a scoping issue with the variables
[22:27:22] polpak: leitz: if you define the variable within the block it only has scope within the block
[22:32:36] polpak: leitz: I'm not sure what your question is
[22:35:16] polpak: leitz: you can't access variables that aren
[22:35:21] polpak: nt in scope
[22:35:39] polpak: leitz: if you give them scope outside the block then you can still access them outside the block
[23:56:57] polpak: Quit: leaving

2015-07-30

[00:05:05] polpak: i8igmac: what are you trying to do
[00:07:29] polpak: alternatively you can use ? to make the . non-greedy
[00:10:53] polpak: >>> "(size 85 GB) and some junk (junk)".scan /\(size.*?\)/ # i8igmac
[00:11:01] polpak: >> "(size 85 GB) and some junk (junk)".scan /\(size.*?\)/ # i8igmac
[00:11:44] polpak: i8igmac: or as apeiros said, you can exclude the ) from your search with [^\)]* instead of .
[00:11:55] polpak: i8igmac: err instead of .*
[00:13:30] polpak: i8igmac: the question mark makes the .* "non-greedy"
[00:14:05] polpak: i8igmac: it will find the smallest possible match instead of the largest
[00:21:55] polpak: Quit: leaving
[18:02:03] polpak: has joined #ruby
[18:02:09] polpak: has joined #RubyOnRails
[21:35:39] polpak: ruby-lang891: #rubyonrails is a thing that exists

2015-07-29

[19:03:08] polpak: has joined #ruby
[19:03:13] polpak: has joined #RubyOnRails

2015-07-28

[00:25:30] polpak: Quit: leaving
[17:10:40] polpak: has joined #ruby
[17:10:46] polpak: has joined #RubyOnRails
[18:31:14] polpak: Quit: Lost terminal
[18:53:34] polpak: has joined #ruby
[18:53:39] polpak: has joined #RubyOnRails
[21:37:47] polpak: dukedave: pass :symbolize_names=>true to the parse method's options
[22:03:26] polpak: Ping timeout: 246 seconds
[22:04:17] polpak: has joined #RubyOnRails
[22:04:17] polpak: has joined #ruby
[23:19:55] polpak: dfockler: they are more like immutable strings
[23:21:13] polpak: hays: what are you trying to do?
[23:21:53] polpak: dfockler: oh. they are instances of the Symbol class
[23:21:59] polpak: dfockler: the end. ;p
[23:23:06] polpak: hays: they're an annoying side effect of the fact that ruby chose to implement strings as mutable (rather than immutable)
[23:24:31] polpak: hays: indeed
[23:25:10] polpak: hays: you see that in python too
[23:25:15] polpak: hays: and yes they are ;p
[23:28:49] polpak: hays: you can also do foo.class.ancestors to get everybody
[23:29:32] polpak: dfockler: I disagree about the string formatting arguement, but I'm not going to debate the point
[23:30:24] polpak: dfockler: indeed
[23:32:25] polpak: hays: of course. but you can refer to them by the symbol to call them (via send or similar)
[23:33:56] polpak: hays: it defines a block (like braces)
[23:41:40] polpak: hays: it's interesting, but personally I still prefer python
[23:41:49] polpak: hays: I just have to do this for work ;p
[23:44:06] polpak: hays: I think you mean lingua franca
[23:45:24] polpak: hays: we've all had those moments :)
[23:45:32] polpak: hays: brains are funny things
[23:47:13] polpak: Quit: leaving

2015-07-27

[16:39:13] polpak: has joined #ruby
[16:39:19] polpak: has joined #RubyOnRails

2015-07-24

[16:03:09] polpak: has joined #ruby
[16:03:13] polpak: has joined #RubyOnRails
[22:34:17] polpak: without the %w
[22:34:43] polpak: ght: the important thing here is that you want to use the .include? method of the Array class.
[23:35:20] polpak: Quit: leaving

2015-07-23

[16:41:30] polpak: has joined #ruby
[16:41:34] polpak: has joined #RubyOnRails
[19:15:43] polpak: Quit: Lost terminal
[20:04:12] polpak: has joined #ruby
[20:04:18] polpak: has joined #RubyOnRails
[22:28:05] polpak: Quit: Lost terminal

2015-07-22

[00:09:48] polpak: Quit: leaving
[16:08:58] polpak: has joined #ruby
[16:09:03] polpak: has joined #RubyOnRails
[21:14:48] polpak: Quit: Lost terminal

2015-07-21

[16:42:14] polpak: has joined #ruby
[16:42:19] polpak: has joined #RubyOnRails

2015-07-20

[21:48:06] polpak: has joined #ruby
[21:48:15] polpak: has joined #RubyOnRails
[22:52:32] polpak: Ox0dea: I have to say that's not a situation I've ever needed
[22:52:55] polpak: Ox0dea: enumerating forever
[22:54:49] polpak: Ox0dea: sure, I've just never needed to count while I did it
[23:00:44] polpak: ryanprior: the problem is you changed what's in A between the map and the select
[23:00:59] polpak: ryanprior: somehow you got a string in there
[23:01:33] polpak: mutation ftl
[23:01:52] polpak: ryanprior: that's correct
[23:02:20] polpak: Ox0dea: no, he wants to know what a's have foo==Nil
[23:02:56] polpak: ryanprior: oh you want reject then
[23:03:29] polpak: Ox0dea: that could remove things for which foo is false
[23:04:07] polpak: ryanprior: but either way the issue isn't reject/select it's that you've mutated A
[23:05:33] polpak: ryanprior: it's unfortunately very easy to mutate things unintentionally
[23:10:31] polpak: ryanprior: well if it's already been mutated, freezing it won't help
[23:10:49] polpak: ryanprior: you have a string in your array. when it encounters the string and calls .foo it bails
[23:11:08] polpak: ryanprior: make sure the Array has what you think it does
[23:13:01] polpak: ryanprior: bleh. where is the array coming from?
[23:13:54] polpak: ryanprior: where some of the commands are strings and some are some other object?
[23:14:26] polpak: ryanprior: well if none of them were strings it wouldn't tell you that String has no method .foo
[23:14:48] polpak: ryanprior: that's true
[23:14:58] polpak: ryanprior: the strings were introduced after the map then
[23:34:28] polpak: ryanprior: I would probably use respond_to for this myself, but it should work the way you are trying to do it I think
[23:34:37] polpak: ryanprior: err respond_to?

2015-07-18

[00:02:52] polpak: Quit: leaving

2015-07-17

[21:16:06] polpak: has joined #ruby

2015-07-14

[00:08:07] polpak: Quit: leaving

2015-07-13

[16:03:31] polpak: has joined #ruby

2015-07-10

[17:31:21] polpak: Ox0dea: Why not just Kernel ?
[17:39:00] polpak: Quit: leaving

2015-07-09

[16:47:11] polpak: Quit: leaving
[16:47:59] polpak: has joined #ruby
[17:00:53] polpak: they wouldn't
[17:01:17] polpak: rehat: bundler is your friend

2015-07-08

[22:10:26] polpak: has joined #ruby