search for: metaprograming

Displaying 20 results from an estimated 113 matches for "metaprograming".

Did you mean: metaprogramming
2008 Nov 13
3
metaprogramming with lm
Hello, Say I want to make a multiple regression model with the following expression: lm(y~x1 + x2 + x3 + ... + x_n,data=mydata) It gets boring to type in the whole independent variables, in this case x_i. Is there any simple way to do the metaprogramming for this? (There are different cases where the names of the independent variables might sometimes have apparent patterns or not)
2011 Jul 16
2
[LLVMdev] select1st, select2nd
Chris Lattner <clattner at apple.com> writes: > The problem that I have with this sort of higher order metaprogramming Metaprogramming? This isn't template metaprogramming if that's what you mean. > in C++'98 is that you're trading one set of complexity for another. What's the other complexity? -Dave
2005 Dec 30
1
metaprogramming in controller: accessing instance variables
Hi all, I''m trying to move a bunch of methods out of a controller into a library that I can include and call a class method to have it dynamically add a bunch of methods to the controller. The goal is to just add to each controller: include UIEnhancements::SubList sub_list ''Note'', ''incomplete'' and have the sub_list method create all the methods
2007 Mar 24
1
spec''ing metaprograming & rails CRUD
For edge rails there is a Crud generator. There is also a CRUD controller that is out there from which you can inherit your other controllers (see http://geekonomics.blogspot.com/2006/07/crud-and- shared-controllers.html) This got me thinking about Crud controllers in general. As far as I know, the generator can''t produce crud classes which are nested (i.e.
2011 Jul 15
2
[LLVMdev] select1st, select2nd
Chris Lattner <clattner at apple.com> writes: > On Jul 15, 2011, at 12:35 PM, David Greene wrote: > >> I've run into a use case where I'd like to use a mapped_iterator to >> iterator the 1st (or 2nd) items in a sequence of std::pairs. Does >> select1st/select2nd exist somewhere within LLVM or is there some >> equivalent? If not, I'll add it. >
2011 Jul 16
0
[LLVMdev] select1st, select2nd
On Jul 15, 2011, at 1:57 PM, David A. Greene wrote: > Chris Lattner <clattner at apple.com> writes: > >> On Jul 15, 2011, at 12:35 PM, David Greene wrote: >> >>> I've run into a use case where I'd like to use a mapped_iterator to >>> iterator the 1st (or 2nd) items in a sequence of std::pairs. Does >>> select1st/select2nd exist
2007 Jul 03
5
HOW TO: Easily output alternating item styles via metaprogramming
I always need to apply alternating item styles when outputting a collection, here''s what I''ve been using recently. In the app helper I define this method: def alternate(items,alt=false items.map{|i| i.class}.each { |k| k.class_eval {attr_accessor :alt}} items.each { |i| i.alt, alt = alt, !alt } end When I call the partial I wrap the collection with this method:
2006 Jun 01
5
History plugin
Hello, I felt annoyed enough when having to redirect user back to their previous location in a hackish way that I wrote this plugin. It avoids storing POST and Ajax request. It also has a facility to specify actions not to store in the history. If you are interested, it''s there: http://blog.cosinux.org/pages/rails-history See you all, Damien -- Damien MERENNE
2010 Dec 21
5
Rails, Ruby, haml, metaprogramming problem
In HAML I have hundreds of lines like the following: - xyz = someFuncThatReturnsString(''xyz'') and elsewhere %div{''id'' => xyz} The above lines work fine. - - - Attempting to keep things DRY (Don''t repeat yourself) I want to do something like - eval(otherFuncThatReturnsString(''xyz'')) where
2011 Jul 17
0
[LLVMdev] select1st, select2nd
I'm talking about mapped iterator + select1st. -Chris On Jul 16, 2011, at 2:58 PM, greened at obbligato.org (David A. Greene) wrote: > Chris Lattner <clattner at apple.com> writes: > >> The problem that I have with this sort of higher order metaprogramming > > Metaprogramming? This isn't template metaprogramming if that's what you > mean. > >>
2018 Mar 19
2
objc++ enhancements?
hi. Is there interest in enhancing the objc++ compiler to make objc mechanisms friendly to the newer features of c++? For instance... 1) making blocks movable so that they can capture things like unique_ptr<> and still be moved off the stack 2) making @property declarations work with move-only types like unique_ptr<> 3) enabling std::weak_ptr<> to weakly store an objc pointer
2010 Mar 10
5
Master thesis topic on Ruby or ROR
Hey fellows, I am a novice to ruby and ror, but really addicted to it. As a graduate student, I need master thesis topic around Ruby aor ROR. Can anyone suggest some for me? Regards/Buyan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2006 Nov 04
0
traits-0.9.2 - better living through metaprogramming
URLS http://rubyforge.org/projects/codeforpeople/ http://codeforpeople.com/lib/ruby/traits ABOUT traits.rb is set of attr_* like methods on steroids, caffeine, and botox. it encourages better living through meta-programming and uniform access priciples. traits.rb supports smart inheritence of class attributes and a fistful of hooks for veryifying and munging attr values.
2010 Mar 18
3
method_missing
i''m using method_missing to implement a simple metaprogramming that checks for account rights. in Account << ActiveRecord::Base i defined: def method_missing(m, a = {}) if m.to_s =~ /^has_right_(.*)$/ ... calls another method passing $1 parameter end end it seems to override some of the active record methods based on method missing. in the console it seems to work ok so i
2010 May 12
2
How to add an after_save callback on runtime on a particular instance
class User < AR end user = User.new Let''s say that I have a user instance with me. After this record is saved I want an after_save callback which would print the id of the record. The only catch is that I am not allowed to change the User class. How can I accomplish my goal? Is that even possible to add an after_save callback on a particular instance object. Any metaprogramming
2011 Jul 23
2
[LLVMdev] Correct use of StringRef and Twine
On Jul 22, 2011, at 2:59 PM, David Blaikie wrote: >> The dangerous part of this is that characters are integers, so "foo" + 'x' is very likely to cause serious problems. > > std::string already provides such overloads though, doesn't it? So the > code isn't any safer from accidental "foo" + 'x' expressions that > don't include
2011 Jul 24
0
[LLVMdev] Correct use of StringRef and Twine
> Yes, exactly.  I'm just saying that I think the additional clarity of: >  "foo" + Twine('x') > > is worth the inconvenience. Ok, attached a modified version of my patch with an Twine(char), Twine(unsigned char), and Twine(signed char). All three are explicit & have included test cases. Speaking of which - is there any LLVM dev policy or preference around
2006 Jan 25
1
Protecting Your Apps against Cross Site Scripting Attacks
This has been in the news lately, so I wrote up an article about a method I use to protect my app against XSS attacks. It''s easy to use if you don''t care how it works, and I go through some of the metaprogramming techniques I used if you do. Check it out: http://blog.explorationage.com/articles/2006/01/25/how-to-protect-your-rails-apps-against-cross-site-scripting-attacks
2018 Mar 19
0
objc++ enhancements?
Hi James, Non-Apple people can’t “see radar”. Do you work at Apple? In either case, the clang development email list would be the right start for this. Also, if you work at Apple, please consider reaching out to the DevTools department directly. Dave > On Mar 19, 2018, at 12:21, James Gregurich via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > hi. > > Is there interest
2020 Mar 17
3
new bquote feature splice does not address a common LISP @ use case?
Dear R-devel, There is a new feature in R-devel, which explicitly refers to LISP @ operator for splicing. > The backquote function bquote() has a new argument splice to enable splicing a computed list of values into an expression, like ,@ in LISP's backquote. Although the most upvoted SO question asking for exactly LISP's @ functionality in R doesn't seems to be addressed by this