markit

Activity Graph

Page 1 of 1

2019-04-06

[09:48:49] markit: has joined #RubyOnRails

2019-04-01

[05:06:52] markit: has joined #elixir-lang
[05:07:31] markit: Client Quit

2019-02-11

[18:44:21] markit: has joined #RubyOnRails

2019-01-26

[17:53:36] markit: has joined #RubyOnRails

2019-01-07

2019-01-06

[12:07:52] markit: has joined #RubyOnRails

2018-08-11

[16:58:58] markit: has joined #RubyOnRails

2018-02-08

[14:45:08] markit: has joined #RubyOnRails

2017-09-01

[14:27:23] markit: has joined #RubyOnRails

2017-07-29

[17:42:29] markit: has joined #ruby
[17:43:40] markit: hi, not related to ruby but I know some of you are very good with regular expressions. I need to find this EXACT url, but probably escapes and other stuff makes me find nothing. What is the right syntax? The phrase I need to find is (without quotes) 'Go to http://local-one-other.com/ NOW!'
[17:45:09] markit: mmm should be Go to http:\/\/local-one-other.com\/ NOW! but seems not working, maybe there is another reason for it
[17:47:52] markit: gizmore|2: apologise, I just noticed that the text is 'Go to (double spaces!) http...'
[17:48:08] markit: sigh, sorry for the noise :(

2017-05-07

[09:06:09] markit: has joined #RubyOnRails

2016-07-26

[14:10:27] markit: has joined #RubyOnRails
[14:11:16] markit: anyone using rghost_render? I don''t understand how survive if there is an error in the rendering, second time I run it the report is wrong until I restart the server
[15:13:13] markit: Quit: Konversation terminated!

2016-07-25

[15:21:03] markit: has joined #RubyOnRails
[15:25:07] markit: I'm trying to solve a problem with rghost and I've been away from ror since long long time. Anyone using it? I sometime have an exception (non utf-8 character) and after that the sequent pdf are badly rendered, I've to restart the server. Any tip about how handle the exception in rghost view?
[15:45:30] markit: Quit: Konversation terminated!

2016-01-02

[15:55:35] markit: has joined #ruby
[15:56:12] markit: Client Quit
[15:57:18] markit: has joined #ruby
[16:00:35] markit: Client Quit

2015-10-25

[12:12:25] markit: has joined #ruby
[12:12:29] markit: has left #ruby: ()

2015-06-16

[06:39:48] markit: has joined #RubyOnRails
[06:40:09] markit: Client Quit

2014-11-16

[16:28:03] markit: hi, usually there are regexp expert here, and I will never be... I've a string like 'cls-2a', but the prefix is optional, also the suffix, I would need to extract the numerical part starting from the end until reached the beginning of the string or a non numerical character
[16:28:10] markit: in this case, only '2'
[16:29:58] markit: Mateon1: how can it use with ruby? let's say a = 'cls-2a', how can I set b = a elaborated_by_your_regexp?
[16:30:56] markit: jhass: interesting site, thanks
[16:32:11] markit: apeiros: would fail for "c3ls-2b", I need only the final '2'
[16:33:47] markit: apeiros: Mateon1 does not work even in my basic case
[16:34:49] markit: Mateon1: input cl3sl-2b -> 2
[16:35:13] markit: Mateon1: or clsl-10 -> 10, or clsl-10whatever -> 10
[16:36:02] markit: apeiros: I've a random prefix, then a separator NOT numerical, then a number (the one I want to extract) then an optional suffix not numerical (tail)
[16:36:16] markit: shevy: lol, sorry
[16:37:29] markit: apeiros: I've tied in robular putting "(?:\w+-)?(\d)\w" and it selects my whole string
[16:37:50] markit: marahin: ups, sorry, misused it
[16:39:20] markit: http://rubular.com/r/Ml4esZLh4U
[16:39:27] markit: match result I need is '2' only
[16:45:47] markit: shevy: maybe, I'm going to consider only the simple case with just one number there and hope to make it better in the future. Something like "cls-2b".gsub(/\d+/){|x|x.to_i+1} to increment the numerical part (that is what I really need)
[16:46:11] markit: just hoping not having another number in the prefix
[16:47:10] markit: Hanmac: great indeed!
[16:48:00] markit: Hanmac: any idea if is easy do it only for the first number starting from the end? like "cl321-2b" -> "cl321-3b" ?
[16:48:47] markit: if capturing group is really needed is beyond my understanding (I'm in a hurry right now can't learn new stuff)
[16:50:10] markit: Hanmac: thanks a lot, exactly what I was looking for!!!
[16:51:00] markit: apeiros: thanks for your patience and help, sorry if I was a pain
[16:52:49] markit: apeiros: I've a book to read about regexp, but I learn something, then I don't need regexp for a long time, then I urgently need a solution with them and I've almost forgot anything, and I have to start over... depressing
[16:56:31] markit: apeiros: mmm what's wrong with my initial description? "I've a string like 'cls-2a', but the prefix is optional, also the suffix, I would need to extract the numerical part starting from the end until reached the beginning of the string or a non numerical character"
[16:58:59] markit: apeiros: reading backlog seems fine to me, and about the "extract" not being what I wanted, is just because I never imagined that you could do an methematical operation with a regex, with extract I would have solved my problem in a different way so extract was all I needed
[16:59:51] markit: apeiros: I don't want to fight over this, but usually (and happens to me too), the helper does not read the request carefully :)
[17:00:13] markit: apeiros: in any case, you have been so helpful in the past that I just have to thank you once more :)
[17:01:39] markit: apeiros: unfortunately I really have no time right now, what I say is that I don't find fault in my exposition of the problem, not because I think I'm perfect, but because my fist statement has all the needed info OMHO
[17:02:23] markit: if you can point me on the exact problem, I will be happy, if you say "find yourself in the backlog" is pointless
[17:02:44] markit: shevy: lol
[17:04:18] markit: apeiros: in any case, I'll have a look at XyProblem link, seems interesting (and being one that provides helps himself, I understand the matter better than you think I do ;P)
[17:29:51] markit: apeiros: briefly back.. what is "c2" you mentioned?

2014-09-21

[07:57:35] markit: hi, I've code that worked with ubuntu 12.04, probably ruby 1.8, and does not with ubuntu 14.04, ruby 2.1
[07:57:52] markit: is code someone helped me wrote and I'm not very familiar with the insight
[07:58:08] markit: but is short and simple ;P
[07:58:45] markit: elementi = %x[lsb_release -a 2>/dev/null].split("\n")
[07:58:50] markit: and this is fine
[07:58:58] markit: distributor = elementi.select{|r| r =~ /Distributor ID:/}.to_s.split("\t").last.downcase # es. debian, ubuntu
[07:59:01] markit: this fails
[07:59:25] markit: to my opinion, is the ".to_s" that behaves different
[07:59:45] markit: b = elementi.select{|r| r =~ /Distributor ID:/}
[07:59:53] markit: ' => ["Distributor ID:\tDebian"]
[08:00:03] markit: b = elementi.select{|r| r =~ /Distributor ID:/}.to_s
[08:00:21] markit: apeiros: will work with ruby 1.8 too?
[08:00:39] markit: apeiros: thanks a lot
[08:01:02] markit: works fine, wow
[08:01:20] markit: ah, I see... better check all my code then

2014-08-13

[20:37:58] markit: hi, not strictly ruby related but I know here there are some regular expression wizards :) I've a string like "Release 8.0.7.GA.6021.UBUNTU12.64 UBUNTU12_64 FOSS edition." and I want to extract the "8.0" (only) part, how can I do?
[20:39:16] markit: waxjar: yes
[20:39:19] markit: centrx: let me test
[20:41:10] markit: waxjar: lol, but version number could be 10.05 in the future
[20:45:32] markit: mm forive my ignorance, but if I have myvar='Release 8.0.7.GA.6021.UBUNTU12.64 UBUNTU12_64 FOSS edition", how can I assign to variable "secondvariable" the regexp result ?
[20:45:47] markit: I'm googling but can't find at the 5?? try
[20:46:50] markit: I've found examples like "1234567890".sub /(\d{3})(\d{3})(\d{4})/ but I get an error
[20:46:54] markit: shevy: just a typo here
[20:47:00] markit: waxjar: let's try
[20:48:05] markit: waxjar: b= a[/^Release (\d\.\d)\.\d\.GA.UBUNTU/] I get "nil"
[20:48:11] markit: shevy: oh, I see
[20:48:31] markit: ACTION is not using ruby since too long time, I've forgot a lot
[20:49:14] markit: shevy: I need to extract the "8.0" part only
[20:50:03] markit: shevy: should be the most elegant thing.. the first number after "Release" and with only 2 digits
[20:50:53] markit: waxjar: perfect
[20:51:08] markit: I really would love to be so proficient in regex...
[20:51:20] markit: every time I need them I urge for a solution and I've no time to learn
[20:51:42] markit: godd2: I bought it, and start reading, really good book
[20:51:54] markit: but I've forgot what I learned :(
[20:52:06] markit: I rarely need regexp
[20:52:09] markit: godd2: lol :)
[20:52:27] markit: I've a long long list of things I should be fluent with
[20:52:36] markit: in any case, thanks you all again :)

2014-07-03

[13:37:36] markit: hi, I use rbenv, debian 7.x, and I want rails to start when the server boots. I've tried to insert in rc.local a command like su rails -c '/home/rails/os1webmag_errebi/bundle exec unicorn -p 3000' but does not work. In short, if I'm user root, I can't execute bundle that needs rvenv of user "rails", how can I do?
[13:38:24] markit: btw, urgh, rails 4.1.4? I've upgraded to 4.1.2 just a couple of days ago
[13:40:05] markit: pduersteler: is a really small app, I use unicorn is more than enough

2014-07-02

[08:44:22] markit: hi, once I've developed the application locally, if I want to transfer to another host and have bundle install THE SAME gems as in original Gemfile.lock, how can I do?
[08:44:27] markit: ror 4.1.2
[08:46:27] markit: rushed: ah, I misunderstood it's behaviour, thanks a lot. This is a really small app/test/installation, "deploy" is move to another GNU/Linux host in local lan, I just wanted to learn :)
[08:46:31] markit: rushed: thanks a lot
[12:46:58] markit: I'm confused, I've a _form for web_mov model, when I post a new record I have this: "causale_id"=>"SCI", "mov_web"=>{"magazzino1_id"=>"1", "magazzino2_id"=>"", "nota_agg"=>"222"}, "nota_id"=>"B" , why some fields are inside "mov_web" hash while others (causale_id, nota_id) are not? Seems that are 2 fields that I've a select_tag() for them. Is select_tag(:nota_id, options_for_select(NoteTerm.to_select)) wrong? What
[12:46:59] markit: should be wrote like?
[12:51:52] markit: helpa: https://gist.github.com/anonymous/b85ad45cad6d7aad5c30
[12:56:40] markit: mozzarella: I would love to understand what's wrong with that code, AFAIR select_tag has some options / works on some situations where collection_select does not
[13:00:29] markit: mozzarella: let me try
[13:02:26] markit: mozzarella: mov_web[nota_id]' worked, thanks!
[13:02:45] markit: elaptics: mmm never heard of f.select, let's google
[13:05:41] markit: wondering why all the official doc about select_tag does not mention the "param" problem
[14:44:20] markit: I just want to have the browser land in a "welcome" main page, I've added the route: root 'main#index', created the controller "class MainController < ApplicationController" but I get "uninitialized constant MainController", any idea?
[14:52:21] markit: elaptics: , seanmarcia: thanks, I had "main.rb" and not "main_controller.rb", my bad! thanks a lot

2014-06-26

[08:51:17] markit: hi, I've a dropdown box in the form, if I save it its ok, but if I raise a validate error, the selected item becomes the first one (looses the choice), while other textual fields preserve their value. Am I doing something wrong? In the view I've something like <%= select_tag(:causale_id, options_for_select(ReasoncodeWarehouse.to_select, :autofocus => true)) %>

2014-03-11

[15:17:03] markit: hi, I've been a long long time away from RoR. I've to modify a line of 3.x code, the "Whatever.find(:all, :select => "DISTINCT birdth_date", :order => 'birdth_date DESC')" and I have to add a simple condition, like "name = 'mary'. How can I do?
[15:23:53] markit: workmad3: thanks a LOT!
[15:31:23] markit: workmad3: I'll have a look asap, thanks

2013-09-12

[13:53:30] markit: Hi, trying to fix a problem in a program after have been long time away from rails.. I've a for_for and |f|, I need to blank (= nil) that field, what property is the right one? f.value does not exist for instance

2013-08-27

[09:37:10] markit: hi, a simple question but I'm confused right now. I've @mov_web.mov_web_items, how can I sort it by an attribute of mov_web_items? simple ascending sort
[09:39:44] markit: omarqureshi: let me try
[09:42:24] markit: omarqureshi: works, thanks a LOT

2013-04-29

[09:20:22] markit: hi, I've a monetary value that has "0" as default, but if I modify a record and "blank" it, I see a SQL update that sets it as "null". Is there something I'm missing? Would love to avoid to having to modify the model to "intercept" it and set to "0"
[09:21:56] markit: codecaster: set as not null would probably trigger an error
[09:23:38] markit: ok, I'll try, don't know how to add the "null:false" part without having to drop and recreate the column
[10:09:03] markit: I wanted to add validation to my model, to check if the money field is a valid number, but validates_numericality_of does not report an error if the field is empty (so = nil), instead the rails server error appears complayining that nil can't be converted in bigdecimal. I've tried to to add a "presence" validation before it, but no luck (same error), any tips? Ror 3.0.20
[10:24:29] markit: found, the problem is that I have a "number_to_currency" in the view, so after the validation error I've the feeling that the view is re-rendered and that triggers the conversion error :(

2013-03-21

[14:49:38] markit: hi, I've a function in application_controller, I'm trying to use it in layout/application.html.erb but says "undefined method..." how can I make it available to the application layout?
[14:50:16] markit: btw, is in in protected section, maybe this is the problem?
[14:51:06] markit: fxn: do you mean that I have to put it in a helper_method? I need to call that function even in a controller
[14:52:35] markit: fxn: thanks a lot
[14:54:21] markit: fxn: works like a charm, thanks again

2013-01-17

[16:35:21] markit: hi, I need to execute 2 or more procedures on before_update. Do I have to add multiple "before_update :procedurename" or is there a different syntax to list them all in a single line?

2013-01-16

[10:04:31] markit: hi, I've a cryptic error "NoMethodError (undefined method `importo_prova=' for #<Class:0x7fc98994e260>)", how can I find what class is it? That would help me troubleshoot
[10:05:54] markit: sevenseacat: well, is even more obscure
[10:07:27] markit: Scient: I know the controller where error is, but don't find the error, and I would love to know what class is used instead of the intended one
[10:07:58] markit: ok, may I pastebin the lines more near the error? maybe you can help further
[10:09:34] markit: mm can't find expire time
[10:09:44] markit: https://gist.github.com/4546085
[10:10:00] markit: I think the more relevant lines are at the top, correct?
[10:12:41] markit: sevenseacat: yep, ok, I've got now... the problem was using Dunning.importo_titoli instead of dunning.importo_titoli !!!!
[10:12:59] markit: thanks for insisting ;P
[10:13:17] markit: Scient: yep, because Dunning HAS importo_titoli method
[10:13:45] markit: the correct message would have been "don't use class, use object" ;P
[10:14:10] markit: Scient: yes, NOW seems so obvious
[10:14:57] markit: elaptics: I know, was joking
[10:51:45] markit: another problem, I've an array of ids, I can retrieve records with it, works fine. I can also sum a field of the entire table, works fine. If I combine both, does not work: Dunning.find(dunning_ingiunzioni_id).sum(:importo_dovuto) complains NoMethodError: undefined method `+' for #<Dunning:0x7fd073c22f68> any clue?
[10:53:29] markit: mmmm Dunning.sum(:importo_dovuto) works
[10:54:39] markit: clocKwize: I need one value, the sum
[10:55:32] markit: clocKwize: oh, I've got, dunning_ingiunzioni_id is an array (5 values) of ids
[10:56:14] markit: omarqureshi: I want the sum of the field ":importo_dovuto" of those 5 records, yes
[10:56:34] markit: clocKwize: in italian "ingiunzioni" is plural
[10:57:27] markit: omarqureshi: good shot, thanks
[10:57:43] markit: clocKwize: if you write the code in english, italian programmer don't understand it ;P
[10:58:00] markit: because you have to map a lot of nouns not related to programming in english
[10:58:16] markit: like I had to do with classes... a nightmare
[10:58:31] markit: I need an handy "conversion table" all the time ;P
[10:58:56] markit: ror seem too English-centric
[10:59:14] markit: sevenseacat: what is your language?
[11:00:00] markit: sevenseacat: so you can't understand... first time you will have to use an italian framework that forces you to use italian nouns you will see ;P
[11:00:27] markit: sevenseacat: but ror forces english... is it any better then?
[11:01:20] markit: this is not an international project, you are mixing a lot of things
[11:02:40] markit: omarqureshi: it was, he asked help in internet, was not an accounting program for his sister, and in Finland they speak english fluently, not in the rest of the europe, at least sourhern
[11:03:03] markit: in any case, if you want convince me that you know better than me about our situation, you will have hard time ;P
[11:03:42] markit: sevenseacat: did I?
[11:06:39] markit: royvandermeij: do you really code all variable names and procedures in english?
[11:06:59] markit: royvandermeij: and comments too?
[11:08:02] markit: wow, we are really far from that
[11:08:40] markit: I had hard times in finding the english accounting nouns equivalent of the italians one for models, of instance
[11:09:46] markit: clocKwize: I'm writing in english, I speak english, I read tech docs in english, I contribute code to FOSS projects in english, but for local programs I use italian variables and comments wheneter possible, much easier to understand
[11:11:05] markit: clocKwize: if I need more devs I hire italian ones, and if I write in english they will have hard times
[11:11:15] markit: of course if you want to hire for cheap Indian, is another story
[11:14:43] markit: clocKwize: what is your language?
[11:16:03] markit: clocKwize: maybe you already told me (I'm coding while chatting, sorry). Try to imagin if you had to use another language for your code. One thing is the program language itself, other are variables, comments, and so on that should be the most easy to understand by your brain, so in yout mother language, not a foreigh one
[11:17:48] markit: clocKwize: when my brain reads "dunning" is nothing emotional related, even if I had to learn the word and now, that I had to implement a "dunning", know what it means
[11:18:21] markit: clocKwize: also, if you, except for ROR, use italian verbs and nouns, will not use reserved words by mistake
[11:18:26] markit: so has a lot of pros
[11:18:47] markit: if I want to store a type, I use "tipo" as variable name
[11:19:07] markit: clocKwize: lucky you :)
[11:19:48] markit: in any case, this is how things go in my country, like it or not :)
[11:21:31] markit: clocKwize: sure, I apreciated and took notes of your objections
[11:21:58] markit: clocKwize: but belive me, you can't understand... english speakers rarely have to learn a foreign language

2013-01-14

[09:56:35] markit: hi, had ror 3.0.0 and updated to 3.0.19 (latest in 3.0.x) with bundle update rails. Seems everything fine but I'm puzzled by this: if I $ rails -v shows "Rails 3.0.19", while if I do $ gem list | grep rails I have rails (3.2.0, 3.0.10, 3.0.0) and no 3.0.19 mentioned, any idea?
[09:57:36] markit: Paradox: I know I can understand multiple, but at least 3.0.19 should be listed
[09:58:04] markit: rails (3.0.19)
[09:58:12] markit: mmm how is that? I'm puzzled
[09:58:57] markit: urgh, I'm using rvm
[09:59:51] markit: yep, but using rvm gem list should give me the gems available in that context, that is the context I check and install and so on
[10:03:42] markit: "[11:00] <Spaceghost|cloud> markit: I never use rvm to change my context. I use bundler for it." with "context" I mean gemset... do you use Bundle for it? So rvm is useless with bundler?

2012-11-13

[09:40:52] markit: Hi, I've a project that I upgraded long time ago to ror 3.0. Now I've modified ./public/stylesheets/main.css but even re-running the server or reloading the page, the "old" css is used. With firebug I see is using main.css?4741254 or whatever. How can make it use the new one?
[09:42:34] markit: rhizmoe: I've public, but not public/assets
[10:17:23] markit: rhizmoe: found, my foult, the above property was missing the ";" so my new property below it was ignored